Changed behavior so as not to indicate the error message box when DynamicVariables is 1 and FontSize is 0. (issue 126)

FIXED: Virtual Bytes usage for an x64 process with perfmon plugin does not display value greater than 4 GB (issue 113)
The numerical value greater than 32bit can be now displayed when NumOfDecimals is 0 in Meter=STRING.
Fixed the broken compatibility in Windows 2000. (AboutDialog, SysInfo)
This commit is contained in:
spx
2010-02-04 07:16:22 +00:00
parent 4d25eb85f7
commit c9fd071177
6 changed files with 45 additions and 14 deletions

View File

@ -137,7 +137,10 @@ void CMeterString::Initialize()
}
c_FontFamilies[m_FontFace] = m_FontFamily;
if(m_FontFamily)
{
c_FontFamilies[m_FontFace] = m_FontFamily;
}
}
FontStyle style = FontStyleRegular;
@ -180,12 +183,21 @@ void CMeterString::Initialize()
{
m_Font = new Gdiplus::Font(FontFamily::GenericSansSerif(), size, style);
}
c_Fonts[properties] = m_Font;
Status status = m_Font->GetLastStatus();
if(Ok != status)
if (Ok == status)
{
throw CError(std::wstring(L"Unable to create font: ") + m_FontFace, __LINE__, __FILE__);
c_Fonts[properties] = m_Font;
}
else
{
delete m_Font;
m_Font = NULL;
if (!m_DynamicVariables || m_FontSize != 0)
{
throw CError(std::wstring(L"Unable to create font: ") + m_FontFace, __LINE__, __FILE__);
}
}
}
}
@ -241,7 +253,7 @@ void CMeterString::ReadConfig(const WCHAR* section)
m_AutoScale = 0!=parser.ReadInt(section, L"AutoScale", 0);
m_ClipString = 0!=parser.ReadInt(section, L"ClipString", 0);
m_FontSize = parser.ReadFormula(section, L"FontSize", 10);
m_FontSize = (int)parser.ReadFormula(section, L"FontSize", 10);
m_NumOfDecimals = parser.ReadInt(section, L"NumOfDecimals", -1);
m_Angle = (Gdiplus::REAL)parser.ReadFloat(section, L"Angle", 0.0);
@ -347,7 +359,7 @@ void CMeterString::ReadConfig(const WCHAR* section)
*/
bool CMeterString::Update()
{
if (CMeter::Update())
if (CMeter::Update() && m_Font)
{
std::vector<std::wstring> stringValues;
@ -422,7 +434,7 @@ bool CMeterString::Update()
*/
bool CMeterString::Draw(Graphics& graphics)
{
if(!CMeter::Draw(graphics)) return false;
if(!CMeter::Draw(graphics) || m_Font == NULL) return false;
return DrawString(graphics, NULL);
}