Fixed Bar/Histogram meters containing wrong width/height values when used with images

This commit is contained in:
Brian Ferguson 2012-08-04 17:15:56 -06:00
parent e2ce7d59a7
commit 90c81e01d1
7 changed files with 8 additions and 8 deletions

View File

@ -292,7 +292,7 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
}
bool oldWDefined = m_WDefined;
m_W = parser.ReadInt(section, L"W", m_W);
m_W = IsFixedSize(true) ? parser.ReadInt(section, L"W", m_W) : m_W;
m_WDefined = parser.GetLastValueDefined();
if (!m_WDefined && oldWDefined && IsFixedSize())
{
@ -300,7 +300,7 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
}
bool oldHDefined = m_HDefined;
m_H = parser.ReadInt(section, L"H", m_H);
m_H = IsFixedSize(true) ? parser.ReadInt(section, L"H", m_H) : m_H;
m_HDefined = parser.GetLastValueDefined();
if (!m_HDefined && oldHDefined && IsFixedSize())
{

View File

@ -120,7 +120,7 @@ protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return true; }
virtual bool IsFixedSize(bool overwrite = false) { return true; }
bool BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional);
void BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section);

View File

@ -37,7 +37,7 @@ public:
protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return m_ImageName.empty(); }
virtual bool IsFixedSize(bool overwrite = false) { return m_ImageName.empty(); }
private:
enum ORIENTATION

View File

@ -46,7 +46,7 @@ protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return false; }
virtual bool IsFixedSize(bool overwrite = false) { return overwrite; }
private:
bool HitTest2(int px, int py, bool checkAlpha);

View File

@ -38,7 +38,7 @@ protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return m_PrimaryImageName.empty(); }
virtual bool IsFixedSize(bool overwrite = false) { return m_PrimaryImageName.empty(); }
private:
void DisposeBuffer();

View File

@ -38,7 +38,7 @@ protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return m_ImageName.empty(); }
virtual bool IsFixedSize(bool overwrite = false) { return m_ImageNameResult.empty(); }
private:
void LoadImage(const std::wstring& imageName, bool bLoadAlways);

View File

@ -47,7 +47,7 @@ protected:
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize() { return false; }
virtual bool IsFixedSize(bool overwrite = false) { return overwrite; }
private:
enum TEXTSTYLE