X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38d6b9572cbe98fffe90340396b0e4c43a7fffef..daf3246330c8ae7b4536cd1f6deef733a405cecd:/samples/thread/thread.cpp?ds=sidebyside diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index e4e71d0928..7a6b0ef5e7 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// // Name: thread.cpp -// Purpose: wxWindows thread sample +// Purpose: wxWidgets thread sample // Author: Guilhem Lavaux, Vadim Zeitlin // Modified by: // Created: 06/16/98 // RCS-ID: $Id$ -// Copyright: (c) 1998-2002 wxWindows team +// Copyright: (c) 1998-2002 wxWidgets team // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -26,6 +26,7 @@ #include "wx/thread.h" #include "wx/dynarray.h" +#include "wx/numdlg.h" #include "wx/progdlg.h" @@ -209,7 +210,7 @@ void MyThread::OnExit() // waiting for us if ( wxGetApp().m_waitingUntilAllDone ) { - wxGetApp().m_waitingUntilAllDone = FALSE; + wxGetApp().m_waitingUntilAllDone = false; wxGetApp().m_semAllDone.Post(); } @@ -354,7 +355,7 @@ END_EVENT_TABLE() MyApp::MyApp() : m_semAllDone() { - m_waitingUntilAllDone = FALSE; + m_waitingUntilAllDone = false; } MyApp::~MyApp() @@ -369,7 +370,7 @@ bool MyApp::OnInit() //wxLog::AddTraceMask("thread"); // Create the main frame window - MyFrame *frame = new MyFrame((wxFrame *)NULL, _T("wxWindows threads sample"), + MyFrame *frame = new MyFrame((wxFrame *)NULL, _T("wxWidgets threads sample"), 50, 50, 450, 340); // Make a menubar @@ -406,17 +407,17 @@ bool MyApp::OnInit() frame->SetMenuBar(menuBar); // Show the frame - frame->Show(TRUE); + frame->Show(true); SetTopWindow(frame); - return TRUE; + return true; } // My frame constructor MyFrame::MyFrame(wxFrame *frame, const wxString& title, int x, int y, int w, int h) - : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) + : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { m_nRunning = m_nCount = 0; @@ -424,7 +425,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, CreateStatusBar(2); - m_txtctrl = new wxTextCtrl(this, -1, _T(""), wxPoint(0, 0), wxSize(0, 0), + m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0), wxTE_MULTILINE | wxTE_READONLY); } @@ -449,7 +450,7 @@ MyFrame::~MyFrame() if ( count ) { // set the flag for MyThread::OnExit() - wxGetApp().m_waitingUntilAllDone = TRUE; + wxGetApp().m_waitingUntilAllDone = true; // stop all threads while ( ! threads.IsEmpty() ) @@ -643,7 +644,7 @@ void MyFrame::OnIdle(wxIdleEvent& event) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) { - Close(TRUE); + Close(true); } void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event)) @@ -690,7 +691,7 @@ void MyFrame::OnShowCPUs(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { wxMessageDialog dialog(this, - _T("wxWindows multithreaded application sample\n") + _T("wxWidgets multithreaded application sample\n") _T("(c) 1998 Julian Smart, Guilhem Lavaux\n") _T("(c) 1999 Vadim Zeitlin\n") _T("(c) 2000 Robert Roebling"), @@ -733,7 +734,7 @@ void MyFrame::OnStartWorker(wxCommandEvent& WXUNUSED(event)) ); // thread is not running yet, no need for crit sect - m_cancelled = FALSE; + m_cancelled = false; thread->Run(); } @@ -762,7 +763,7 @@ void MyFrame::OnWorkerEvent(wxCommandEvent& event) { wxCriticalSectionLocker lock(m_critsectWork); - m_cancelled = TRUE; + m_cancelled = true; } } #endif