void GraphicalSummaryWnd::DoLayout() { GG::Pt ul(GG::X0, SIDE_BOX_MARGIN); if(!m_options_bar) { m_options_bar = new OptionsBar(m_sizer); AttachChild(m_options_bar); GG::Connect( m_options_bar->ChangedSignal, &GraphicalSummaryWnd::DoLayout, this ); } m_options_bar->Resize( GG::Pt( ClientWidth(), OPTION_BAR_HEIGHT ) ); GG::Pt space_for_bars = ClientSize(); space_for_bars.y -= m_options_bar->Height(); m_sizer->SetAvailableSize(space_for_bars); m_options_bar->DoLayout(); for(std::vector<SideBar*>::iterator it = m_side_boxes.begin(); it != m_side_boxes.end(); ++it ) { SideBar* box = *it; box->MoveTo(ul); box->DoLayout(); ul.y += box->Height() + SIDE_BOX_MARGIN; } m_options_bar->MoveTo(GG::Pt(GG::X(10), ClientSize().y - m_options_bar->Height() )); }
void GraphicalSummaryWnd::DoLayout() { if (!m_sizer || !m_options_bar) return; GG::Pt ul(GG::X0, SIDE_BOX_MARGIN); m_options_bar->Resize( GG::Pt( ClientWidth(), OPTION_BAR_HEIGHT ) ); GG::Pt space_for_bars = ClientSize(); space_for_bars.y -= m_options_bar->Height(); m_sizer->SetAvailableSize(space_for_bars); m_options_bar->DoLayout(); for (std::vector<SideBar*>::iterator it = m_side_boxes.begin(); it != m_side_boxes.end(); ++it ) { SideBar* box = *it; box->MoveTo(ul); box->DoLayout(); ul.y += box->Height() + SIDE_BOX_MARGIN; } m_options_bar->MoveTo(GG::Pt(GG::X(4), ClientSize().y - m_options_bar->Height())); }