!Move/!MoveMeter: Added support for formulas [Smurfier]

This commit is contained in:
Birunthan Mohanathas 2012-03-08 18:34:30 +00:00
parent 81540a88d8
commit cea569c0b6

View File

@ -833,8 +833,14 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const std::vector<std::wstring>& ar
break;
case BANG_MOVE:
MoveWindow(_wtoi(args[0].c_str()), _wtoi(args[1].c_str()));
break;
{
double value;
int x = m_Parser.ParseFormula(args[0], &value) ? (int)value : _wtoi(args[0].c_str());
int y = m_Parser.ParseFormula(args[1], &value) ? (int)value : _wtoi(args[1].c_str());
MoveWindow(x, y);
break;
}
case BANG_ZPOS:
SetWindowZPosition((ZPOSITION)_wtoi(args[0].c_str()));
@ -879,8 +885,14 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const std::vector<std::wstring>& ar
break;
case BANG_MOVEMETER:
MoveMeter(args[2], _wtoi(args[0].c_str()), _wtoi(args[1].c_str()));
break;
{
double value;
int x = m_Parser.ParseFormula(args[0], &value) ? (int)value : _wtoi(args[0].c_str());
int y = m_Parser.ParseFormula(args[1], &value) ? (int)value : _wtoi(args[1].c_str());
MoveMeter(args[2], x, y);
break;
}
case BANG_COMMANDMEASURE:
{