This commit is contained in:
Birunthan Mohanathas 2012-07-18 13:27:30 +03:00
parent 4dbf7932ab
commit ffbdcbf65a
3 changed files with 7 additions and 19 deletions

View File

@ -89,24 +89,6 @@ CMeter::~CMeter()
void CMeter::Initialize()
{
m_Initialized = true;
if (!m_RelativeMeter)
{
const std::vector<CMeter*>& meters = m_MeterWindow->GetMeters();
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
{
if (*iter == this)
{
if (iter != meters.begin())
{
--iter;
m_RelativeMeter = (*iter);
}
break;
}
}
}
}
/*

View File

@ -60,6 +60,8 @@ public:
void SetX(int x);
void SetY(int y);
void SetRelativeMeter(CMeter* meter) { m_RelativeMeter = meter; }
const CMouse& GetMouse() { return m_Mouse; }
bool HasMouseAction() { return m_HasMouseAction; }

View File

@ -2175,7 +2175,7 @@ bool CMeterWindow::ReadSkin()
}
// Initialize measures. This is a separate loop to avoid errors caused by
// referencing not-yet-existent [measures] referencing in the options.
// referencing not-yet-existent [measures] in the options.
for (auto iter = measures.cbegin(); iter != measures.cend(); ++iter)
{
CMeasure* measure = *iter;
@ -2185,6 +2185,7 @@ bool CMeterWindow::ReadSkin()
// Initialize meters.
m_Meters.reserve(meters.size());
CMeter* prevMeter = NULL;
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
{
CMeter* meter = *iter;
@ -2192,6 +2193,7 @@ bool CMeterWindow::ReadSkin()
meter->ReadOptions(m_Parser);
meter->Initialize();
meter->SetRelativeMeter(prevMeter);
if (!meter->GetToolTipText().empty())
{
@ -2202,6 +2204,8 @@ bool CMeterWindow::ReadSkin()
{
m_HasButtons = true;
}
prevMeter = meter;
}
if (m_Meters.empty())