use the sizer to layout the main window/panel (this allows to give more size to the log window by resizing the main frame while before it was pretty difficult to see anything in it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,7 +74,6 @@ public:
|
|||||||
MyPanel(wxFrame *frame, int x, int y, int w, int h);
|
MyPanel(wxFrame *frame, int x, int y, int w, int h);
|
||||||
virtual ~MyPanel();
|
virtual ~MyPanel();
|
||||||
|
|
||||||
void OnSize( wxSizeEvent& event );
|
|
||||||
void OnIdle( wxIdleEvent &event );
|
void OnIdle( wxIdleEvent &event );
|
||||||
void OnListBox( wxCommandEvent &event );
|
void OnListBox( wxCommandEvent &event );
|
||||||
void OnListBoxDoubleClick( wxCommandEvent &event );
|
void OnListBoxDoubleClick( wxCommandEvent &event );
|
||||||
@@ -480,7 +479,6 @@ const int ID_SIZER_CHECK14 = 205;
|
|||||||
const int ID_SIZER_CHECKBIG = 206;
|
const int ID_SIZER_CHECKBIG = 206;
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
||||||
EVT_SIZE ( MyPanel::OnSize)
|
|
||||||
EVT_IDLE ( MyPanel::OnIdle)
|
EVT_IDLE ( MyPanel::OnIdle)
|
||||||
EVT_BOOKCTRL_PAGE_CHANGING(ID_BOOK, MyPanel::OnPageChanging)
|
EVT_BOOKCTRL_PAGE_CHANGING(ID_BOOK, MyPanel::OnPageChanging)
|
||||||
EVT_BOOKCTRL_PAGE_CHANGED(ID_BOOK, MyPanel::OnPageChanged)
|
EVT_BOOKCTRL_PAGE_CHANGED(ID_BOOK, MyPanel::OnPageChanged)
|
||||||
@@ -1040,16 +1038,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
panel->SetSizer( sizer );
|
panel->SetSizer( sizer );
|
||||||
|
|
||||||
m_book->AddPage(panel, _T("wxSizer"));
|
m_book->AddPage(panel, _T("wxSizer"));
|
||||||
}
|
|
||||||
|
|
||||||
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
|
// set the sizer for the panel itself
|
||||||
{
|
sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
int x = 0;
|
sizer->Add(m_book, wxSizerFlags().Border().Expand());
|
||||||
int y = 0;
|
sizer->Add(m_text, wxSizerFlags(1).Border().Expand());
|
||||||
GetClientSize( &x, &y );
|
SetSizer(sizer);
|
||||||
|
|
||||||
if (m_book) m_book->SetSize( 2, 2, x-4, y*2/3-4 );
|
|
||||||
if (m_text) m_text->SetSize( 2, y*2/3+2, x-4, y/3-4 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyPanel::OnIdle(wxIdleEvent& event)
|
void MyPanel::OnIdle(wxIdleEvent& event)
|
||||||
|
Reference in New Issue
Block a user