Fixed that meters were initialized before measures

This commit is contained in:
Birunthan Mohanathas
2012-07-18 08:19:01 +03:00
parent ef375232a8
commit f2b52b4204
6 changed files with 99 additions and 103 deletions

View File

@ -92,7 +92,7 @@ void CMeter::Initialize()
if (!m_RelativeMeter)
{
const std::list<CMeter*>& meters = m_MeterWindow->GetMeters();
const std::vector<CMeter*>& meters = m_MeterWindow->GetMeters();
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
{
if (*iter == this)
@ -251,6 +251,11 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
parser.SetStyleTemplate(style);
}
if (!m_Initialized)
{
BindMeasures(parser, section);
}
int oldX = m_X;
std::wstring& x = (std::wstring&)parser.ReadString(section, L"X", L"0");
if (!x.empty())
@ -455,12 +460,6 @@ bool CMeter::Update()
*/
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"");
// The meter is not bound to anything