Dynamic variables can be used to change the font in the string Meter.cpp.

Removed the error message if the meter's dimensions are 0.
This commit is contained in:
Kimmo Pekkola
2009-08-27 17:05:10 +00:00
parent c09ff5cf61
commit c6fdbf7b60
4 changed files with 19 additions and 10 deletions

View File

@ -164,6 +164,11 @@ void CMeterString::ReadConfig(const WCHAR* section)
{
WCHAR tmpName[256];
// Store the current font values so we know if the font needs to be updated
std::wstring oldFontFace = m_FontFace;
int oldFontSize = m_FontSize;
TEXTSTYLE oldStyle = m_Style;
// Read common configs
CMeter::ReadConfig(section);
@ -286,6 +291,14 @@ void CMeterString::ReadConfig(const WCHAR* section)
{
m_DimensionsDefined = true;
}
if (m_Initialized &&
(oldFontFace != m_FontFace ||
oldFontSize != m_FontSize ||
oldStyle != m_Style))
{
Initialize(); // Recreate the font
}
}
/*