Added OnChangeAction to measures

This commit is contained in:
Brian Ferguson
2013-01-10 23:03:07 -07:00
parent 9800692f19
commit 90b80a2ca9
3 changed files with 25 additions and 1 deletions

View File

@ -2689,6 +2689,17 @@ void CMeterWindow::Update(bool refresh)
{
Rainmeter->ExecuteCommand(updateAction.c_str(), this);
}
double newValue = (*i)->GetValue();
const WCHAR* newStringValue = (*i)->GetStringValue(AUTOSCALE_OFF, 1, -1, false);
std::wstring changeAction = (*i)->GetOnChangeAction();
if (((*i)->GetOldValue() != newValue || (*i)->GetOldStringValue() != newStringValue) && !changeAction.empty())
{
(*i)->SetOldValue(newValue);
(*i)->SetOldStringValue(newStringValue);
Rainmeter->ExecuteCommand(changeAction.c_str(), this);
}
}
}
}