X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7a8c1299b05b34dcc400d597cc4a8cc0e85ac14..a6f4dbbd86b54c720bdeab1aea1fad5eb3f030e6:/contrib/samples/plot/plot.cpp diff --git a/contrib/samples/plot/plot.cpp b/contrib/samples/plot/plot.cpp index 0082a382bb..61de98f20d 100644 --- a/contrib/samples/plot/plot.cpp +++ b/contrib/samples/plot/plot.cpp @@ -69,7 +69,9 @@ public: void OnPlotDClick( wxPlotEvent &event ); wxPlotWindow *m_plot; +#if wxUSE_LOG wxTextCtrl *m_log; +#endif // wxUSE_LOG private: DECLARE_DYNAMIC_CLASS(MyFrame) @@ -115,9 +117,11 @@ MyFrame::MyFrame() SetMenuBar( menu_bar ); +#if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); +#endif // wxUSE_STATUSBAR m_plot = new wxPlotWindow( this, -1, wxPoint(0,0), wxSize(100,100), wxSUNKEN_BORDER | wxPLOT_DEFAULT ); m_plot->SetUnitsPerValue( 0.01 ); @@ -132,28 +136,32 @@ MyFrame::MyFrame() oo->Add( 1000, 2000 ); m_plot->Add( oo ); +#if wxUSE_LOG m_log = new wxTextCtrl( this, -1, _T("This is the log window.\n"), wxPoint(0,0), wxSize(100,100), wxTE_MULTILINE ); wxLog *old_log = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) ); delete old_log; +#endif // wxUSE_LOG wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); topsizer->Add( m_plot, 1, wxEXPAND ); +#if wxUSE_LOG topsizer->Add( m_log, 0, wxEXPAND ); +#endif // wxUSE_LOG - SetAutoLayout( TRUE ); + SetAutoLayout( true ); SetSizer( topsizer ); } void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) { - Close( TRUE ); + Close( true ); } void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) { - (void)wxMessageBox( _T("wxPlotWindow Demo\n" - "Robert Roebling (c) 1999,2000"), + (void)wxMessageBox( _T("wxPlotWindow Demo\n") + _T("Robert Roebling (c) 1999,2000"), _T("About wxPlotWindow Demo"), wxICON_INFORMATION | wxOK ); }