Fixed issue with 8330415

This commit is contained in:
Brian Ferguson 2013-01-10 23:48:31 -07:00
parent 83304154a8
commit 61f088e59c
3 changed files with 13 additions and 2 deletions

View File

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

View File

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

View File

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