From 411f53b1f9a2a13cf1e6c58dea3158496a83ee70 Mon Sep 17 00:00:00 2001 From: spx Date: Fri, 30 Nov 2012 10:57:35 +0900 Subject: [PATCH] Added "*" to !UpdateMeasure/!UpdateMeter to update all measures/meters forcibly --- Library/MeterWindow.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index ee126b66..511dce00 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1212,13 +1212,19 @@ void CMeterWindow::MoveMeter(const std::wstring& name, int x, int y) void CMeterWindow::UpdateMeter(const std::wstring& name, bool group) { const WCHAR* meter = name.c_str(); + bool all = false; + + if (!group && meter[0] == L'*' && meter[1] == L'\0') // Allow [!UpdateMeter *] + { + all = true; + group = true; + } bool bActiveTransition = false; bool bContinue = true; - std::vector::const_iterator j = m_Meters.begin(); - for ( ; j != m_Meters.end(); ++j) + for (auto j = m_Meters.cbegin(); j != m_Meters.cend(); ++j) { - if (bContinue && CompareName((*j), meter, group)) + if (all || (bContinue && CompareName((*j), meter, group))) { UpdateMeter((*j), bActiveTransition, true); SetResizeWindowMode(RESIZEMODE_CHECK); // Need to recalculate the window size @@ -1322,12 +1328,18 @@ void CMeterWindow::ToggleMeasure(const std::wstring& name, bool group) void CMeterWindow::UpdateMeasure(const std::wstring& name, bool group) { const WCHAR* measure = name.c_str(); + bool all = false; + + if (!group && measure[0] == L'*' && measure[1] == L'\0') // Allow [!UpdateMeasure *] + { + all = true; + group = true; + } bool bNetStats = m_HasNetMeasures; - std::vector::const_iterator i = m_Measures.begin(); - for ( ; i != m_Measures.end(); ++i) + for (auto i = m_Measures.cbegin(); i != m_Measures.cend(); ++i) { - if (CompareName((*i), measure, group)) + if (all || CompareName((*i), measure, group)) { if (bNetStats && (*i)->GetTypeID() == TypeID()) {