X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8520f1374ceec64abae3802984c4f8654d8836ba..40711af81b4a412892045837997211d597d98ff2:/samples/thread/thread.cpp diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index dd421d794d..248b3dee44 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -30,6 +30,8 @@ #include "wx/progdlg.h" +#include "../sample.xpm" + // define this to use wxExecute in the exec tests, otherwise just use system #define USE_EXECUTE @@ -47,7 +49,7 @@ class MyApp : public wxApp { public: MyApp(); - virtual ~MyApp(); + virtual ~MyApp(){}; virtual bool OnInit(); @@ -132,7 +134,8 @@ private: // ID for the menu commands enum { - THREAD_QUIT = 1, + THREAD_QUIT = wxID_EXIT, + THREAD_ABOUT = wxID_ABOUT, THREAD_TEXT = 101, THREAD_CLEAR, THREAD_START_THREAD = 201, @@ -146,7 +149,6 @@ enum THREAD_EXEC_THREAD, THREAD_SHOWCPUS, - THREAD_ABOUT, WORKER_EVENT // this one gets sent from the worker thread }; @@ -358,10 +360,6 @@ MyApp::MyApp() m_waitingUntilAllDone = false; } -MyApp::~MyApp() -{ -} - // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { @@ -405,7 +403,7 @@ bool MyApp::OnInit() menuBar->Append(menuHelp, _T("&Help")); frame->SetMenuBar(menuBar); - + // Show the frame frame->Show(true); @@ -419,6 +417,8 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, int x, int y, int w, int h) : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { + SetIcon(wxIcon(sample_xpm)); + m_nRunning = m_nCount = 0; m_dlgProgress = (wxProgressDialog *)NULL; @@ -730,6 +730,7 @@ void MyFrame::OnStartWorker(wxCommandEvent& WXUNUSED(event)) if ( thread->Create() != wxTHREAD_NO_ERROR ) { wxLogError(wxT("Can't create thread!")); + return; } m_dlgProgress = new wxProgressDialog