Revised previous commit

This commit is contained in:
Brian Ferguson 2013-01-11 00:23:21 -07:00
parent 61f088e59c
commit 69762e1b05
3 changed files with 2 additions and 8 deletions

View File

@ -88,8 +88,7 @@ CMeasure::CMeasure(CMeterWindow* meterWindow, const WCHAR* name) : CSection(name
m_Disabled(false), m_Disabled(false),
m_Initialized(false), m_Initialized(false),
m_OldValue(0.0), m_OldValue(0.0),
m_OldStringValue(L""), m_OldStringValue(L"")
m_SkipFirstChange(true)
{ {
} }

View File

@ -74,8 +74,6 @@ public:
double GetOldValue() { return m_OldValue; } double GetOldValue() { return m_OldValue; }
void SetOldStringValue(std::wstring value) { m_OldStringValue = value; } void SetOldStringValue(std::wstring value) { m_OldStringValue = value; }
std::wstring GetOldStringValue() { return m_OldStringValue; } std::wstring GetOldStringValue() { return m_OldStringValue; }
void SetFirstChange(bool value) { m_SkipFirstChange = value; }
bool GetFirstChange() { return m_SkipFirstChange; }
CMeterWindow* GetMeterWindow() { return m_MeterWindow; } CMeterWindow* GetMeterWindow() { return m_MeterWindow; }
@ -125,7 +123,6 @@ protected:
std::wstring m_OnChangeAction; std::wstring m_OnChangeAction;
double m_OldValue; double m_OldValue;
std::wstring m_OldStringValue; std::wstring m_OldStringValue;
bool m_SkipFirstChange;
CMeterWindow* m_MeterWindow; CMeterWindow* m_MeterWindow;
}; };

View File

@ -2693,13 +2693,11 @@ void CMeterWindow::Update(bool refresh)
double newValue = (*i)->GetValue(); double newValue = (*i)->GetValue();
const WCHAR* newStringValue = (*i)->GetStringValue(AUTOSCALE_OFF, 1, -1, false); const WCHAR* newStringValue = (*i)->GetStringValue(AUTOSCALE_OFF, 1, -1, false);
std::wstring changeAction = (*i)->GetOnChangeAction(); std::wstring changeAction = (*i)->GetOnChangeAction();
bool skip = (*i)->GetFirstChange();
if (skip) if (refresh)
{ {
(*i)->SetOldValue(newValue); (*i)->SetOldValue(newValue);
(*i)->SetOldStringValue(newStringValue); (*i)->SetOldStringValue(newStringValue);
(*i)->SetFirstChange(false);
} }
else if (((*i)->GetOldValue() != newValue || (*i)->GetOldStringValue() != newStringValue) && !changeAction.empty()) else if (((*i)->GetOldValue() != newValue || (*i)->GetOldStringValue() != newStringValue) && !changeAction.empty())
{ {