//--------------------------------------------------------- void CACTIVE_Attributes::_Set_Positions(void) { int nButtons = 2; wxRect r(wxPoint(0, 0), GetSize()); if( m_pSelections->GetCount() > 0 ) { m_pSelections->SetSize(0, 0, r.GetWidth(), m_btn_height - BUTTON_DIST); r.SetTop(m_btn_height); r.SetHeight(r.GetHeight() - m_btn_height * 2); } else { r.SetHeight(r.GetHeight() - m_btn_height); } m_pControl->SetSize(r); r.SetTop(r.GetBottom() + BUTTON_DIST2); r.SetHeight(m_btn_height - BUTTON_DIST); r.SetWidth(r.GetWidth() / nButtons - BUTTON_DIST2); r.SetLeft(BUTTON_DIST); SET_BTN_POS(m_Btn_Apply); SET_BTN_POS(m_Btn_Restore); }
//--------------------------------------------------------- void CACTIVE_Parameters::_Set_Positions(void) { int nButtons; nButtons = (m_Btn_Apply ->IsShown() ? 1 : 0) + (m_Btn_Restore->IsShown() ? 1 : 0) + (m_Btn_Execute->IsShown() ? 1 : 0) + (m_Btn_Load ->IsShown() ? 1 : 0) + (m_Btn_Save ->IsShown() ? 1 : 0); if( nButtons > 0 ) { wxSize Size(GetClientSize()); Size.y -= m_btn_height; m_pControl->SetSize(Size); wxRect r(wxPoint(0, 0), Size); r.SetTop(r.GetHeight() + BUTTON_DIST); r.SetHeight(m_btn_height - BUTTON_DIST); r.SetWidth(r.GetWidth() / nButtons - BUTTON_DIST2); r.SetLeft(BUTTON_DIST); SET_BTN_POS(m_Btn_Apply); SET_BTN_POS(m_Btn_Restore); SET_BTN_POS(m_Btn_Execute); SET_BTN_POS(m_Btn_Load); SET_BTN_POS(m_Btn_Save); } else { m_pControl->SetSize(GetClientSize()); } }