Additional changes to 4bbc372

This commit is contained in:
Birunthan Mohanathas 2012-07-17 22:07:57 +03:00
parent 4dc5fe0b31
commit 1ecf6086bd
4 changed files with 9 additions and 3 deletions

View File

@ -447,6 +447,12 @@ bool CMeter::Update()
*/ */
bool CMeter::BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional) bool CMeter::BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional)
{ {
const std::wstring& style = parser.ReadString(section, L"MeterStyle", L"");
if (!style.empty())
{
parser.SetStyleTemplate(style);
}
const std::wstring& measureName = parser.ReadString(section, L"MeasureName", L""); const std::wstring& measureName = parser.ReadString(section, L"MeasureName", L"");
// The meter is not bound to anything // The meter is not bound to anything

View File

@ -40,7 +40,7 @@ public:
virtual UINT GetTypeID() = 0; virtual UINT GetTypeID() = 0;
void ReadOptions(CConfigParser& parser) { ReadOptions(parser, GetName()); parser.ClearStyleTemplate(); } void ReadOptions(CConfigParser& parser) { ReadOptions(parser, GetName()); parser.ClearStyleTemplate(); }
void BindMeasures(CConfigParser& parser) { BindMeasures(parser, GetName()); } void BindMeasures(CConfigParser& parser) { BindMeasures(parser, GetName()); parser.ClearStyleTemplate(); }
virtual void Initialize(); virtual void Initialize();
virtual bool Update(); virtual bool Update();

View File

@ -653,7 +653,7 @@ bool CMeterHistogram::Draw(Graphics& graphics)
*/ */
void CMeterHistogram::BindMeasures(CConfigParser& parser, const WCHAR* section) void CMeterHistogram::BindMeasures(CConfigParser& parser, const WCHAR* section)
{ {
if (BindPrimaryMeasure(parser, section, true)) if (BindPrimaryMeasure(parser, section, false))
{ {
const std::wstring* secondaryMeasure = &parser.ReadString(section, L"MeasureName2", L""); const std::wstring* secondaryMeasure = &parser.ReadString(section, L"MeasureName2", L"");
if (secondaryMeasure->empty()) if (secondaryMeasure->empty())

View File

@ -469,7 +469,7 @@ bool CMeterLine::Draw(Graphics& graphics)
*/ */
void CMeterLine::BindMeasures(CConfigParser& parser, const WCHAR* section) void CMeterLine::BindMeasures(CConfigParser& parser, const WCHAR* section)
{ {
if (BindPrimaryMeasure(parser, section, true)) if (BindPrimaryMeasure(parser, section, false))
{ {
BindSecondaryMeasures(parser, section); BindSecondaryMeasures(parser, section);
} }