#if defined(__WXMOTIF__)
int width, height;
frame->GetSize(& width, & height);
- frame->SetSize(wxDefaultPosition.x, wxDefaultPosition.y, width, height);
+ frame->SetSize(wxDefaultCoord, wxDefaultCoord, width, height);
#endif
frame->Show();
m_btnExit = new wxButton( m_panel, wxID_OK, wxT("&Exit") );
m_btnExit->SetDefault();
+#if wxUSE_LOG
m_text = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
m_logTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(m_text) );
+#endif // wxUSE_LOG
// Set sizers
m_sizerFrame = new wxBoxSizer(wxVERTICAL);
m_sizerFrame->Add(m_sizerTop, 1, wxEXPAND);
+#if wxUSE_LOG
m_sizerFrame->Add(m_text, 0, wxEXPAND);
+#endif // wxUSE_LOG
ReInitNotebook();
m_notebook->CreateInitialPages();
m_panel->SetSizer(m_sizerFrame);
- m_panel->SetAutoLayout(true);
-
m_sizerFrame->Fit(this);
m_sizerFrame->SetSizeHints(this);
MyFrame::~MyFrame()
{
+#if wxUSE_LOG
delete wxLog::SetActiveTarget(m_logTargetOld);
+#endif // wxUSE_LOG
if (m_imageList)
{
m_notebook->AddPage(page, str, false, m_notebook->GetIconIndex() );
}
- if (m_sizerNotebook)
- {
- m_sizerTop->Remove(m_sizerNotebook);
- }
-
+ m_sizerTop->Detach(notebook);
+
delete notebook;
// restore selection
}
- m_sizerNotebook = new wxBookCtrlSizer(m_notebook);
- m_sizerTop->Add(m_sizerNotebook, 1, wxEXPAND | wxALL, 4);
+ m_sizerTop->Add(m_notebook, 1, wxEXPAND | wxALL, 4);
m_sizerTop->Layout();
}
wxLogMessage(wxT("Notebook event #%d: %s (%d)"),
s_numNotebookEvents++, str.c_str(), eventType);
+#if wxUSE_LOG
m_text->SetInsertionPointEnd();
+#endif // wxUSE_LOG
event.Skip();
}