New build-in variables: #WORKAREAWIDTH#, #WORKAREAHEIGHT#, #SCREENAREAWIDTH#, #SCREENAREAHEIGHT#

Added support for math formulas for the X, Y, W, H, WindowX and WindowY (e.g. "WindowX=(#WORKAREAWIDTH# / 2)"). The formula must be surrounded by parenthesis.
This commit is contained in:
Kimmo Pekkola
2009-07-30 15:19:47 +00:00
parent 920268395d
commit 7440667743
8 changed files with 72 additions and 4 deletions

View File

@ -1176,6 +1176,22 @@ void CMeterWindow::ReadConfig()
m_WindowY = ConvertToWide(tmpSz);
}
// Check if the window position should be read as a formula
if (!m_WindowX.empty() && m_WindowX[0] == L'(' && m_WindowX[m_WindowX.size() - 1] == L')')
{
double value = parser.ReadFormula(section, _T("WindowX"), 0.0);
TCHAR buffer[256];
swprintf(buffer, L"%i", (int)value);
m_WindowX = buffer;
}
if (!m_WindowY.empty() && m_WindowY[0] == L'(' && m_WindowY[m_WindowY.size() - 1] == L')')
{
double value = parser.ReadFormula(section, _T("WindowY"), 0.0);
TCHAR buffer[256];
swprintf(buffer, L"%i", (int)value);
m_WindowY = buffer;
}
int zPos = parser.ReadInt(section, L"AlwaysOnTop", m_WindowZPosition);
if (zPos == -1)
{