X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc2ec626ea6114fdafb18da7752be495088b8832..804cd2075d5b091425277a9a863367b93a3cbd4d:/samples/thread/thread.cpp diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 7a6b0ef5e7..d239920382 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -47,7 +47,7 @@ class MyApp : public wxApp { public: MyApp(); - virtual ~MyApp(); + virtual ~MyApp(){}; virtual bool OnInit(); @@ -358,10 +358,6 @@ MyApp::MyApp() m_waitingUntilAllDone = false; } -MyApp::~MyApp() -{ -} - // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { @@ -423,7 +419,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, m_dlgProgress = (wxProgressDialog *)NULL; +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0), wxTE_MULTILINE | wxTE_READONLY); @@ -525,9 +523,11 @@ void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) threads.Add(thr); } +#if wxUSE_STATUSBAR wxString msg; msg.Printf(wxT("%d new threads created."), count); SetStatusText(msg, 1); +#endif // wxUSE_STATUSBAR // ...and then start them for ( n = 0; n < count; n++ ) @@ -545,7 +545,9 @@ void MyFrame::OnStartThread(wxCommandEvent& WXUNUSED(event) ) wxLogError(wxT("Can't start thread!")); } +#if wxUSE_STATUSBAR SetStatusText(_T("New thread started."), 1); +#endif // wxUSE_STATUSBAR } void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) ) @@ -570,7 +572,9 @@ void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) ) thread->Delete(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread stopped."), 1); +#endif // wxUSE_STATUSBAR } } @@ -591,7 +595,9 @@ void MyFrame::OnResumeThread(wxCommandEvent& WXUNUSED(event) ) { wxGetApp().m_threads[n]->Resume(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread resumed."), 1); +#endif // wxUSE_STATUSBAR } } @@ -612,7 +618,9 @@ void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(event) ) { wxGetApp().m_threads[n]->Pause(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread paused."), 1); +#endif // wxUSE_STATUSBAR } }