X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b70362998b8f562923f6ed6708f06537ac056cd4..a738f87caeafd5e51fc029a6228c540e942505b7:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 59b929c7ce..537b447d18 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -40,7 +40,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/log.h" #include "wx/module.h" #endif @@ -52,6 +52,7 @@ #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" +#include "wx/msw/private/timer.h" #if wxUSE_TOOLTIPS #include "wx/tooltip.h" @@ -77,10 +78,7 @@ #include #include -// For MB_TASKMODAL -#ifdef __WXWINCE__ -#include "wx/msw/wince/missing.h" -#endif +#include "wx/msw/missing.h" // instead of including which is not part of the core SDK and not // shipped at all with other compilers, we always define the parts of it we @@ -215,7 +213,7 @@ bool wxGUIAppTraits::DoMessageFromThreadWait() { // we should return false only if the app should exit, i.e. only if // Dispatch() determines that the main event loop should terminate - wxEventLoop *evtLoop = wxEventLoop::GetActive(); + wxEventLoopBase * const evtLoop = wxEventLoop::GetActive(); if ( !evtLoop || !evtLoop->Pending() ) { // no events means no quit event @@ -234,20 +232,14 @@ DWORD wxGUIAppTraits::WaitForThread(WXHANDLE hThread) if ( !wxEventLoop::GetActive() ) return DoSimpleWaitForThread(hThread); - const DWORD wakeMask = - QS_ALLINPUT // return as soon as there are any events -#if !defined(__WXWINCE__) - | QS_ALLPOSTMESSAGE -#endif - ; - return ::MsgWaitForMultipleObjects ( 1, // number of objects to wait for (HANDLE *)&hThread, // the objects false, // wait for any objects, not all INFINITE, // no timeout - wakeMask + QS_ALLINPUT | // return as soon as there are any events + QS_ALLPOSTMESSAGE ); } @@ -274,6 +266,20 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const #endif } +#if wxUSE_TIMER + +wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) +{ + return new wxMSWTimerImpl(timer); +} + +#endif // wxUSE_TIMER + +wxEventLoopBase* wxGUIAppTraits::CreateEventLoop() +{ + return new wxEventLoop; +} + // =========================================================================== // wxApp implementation // =========================================================================== @@ -318,9 +324,9 @@ bool wxApp::Initialize(int& argc, wxChar **argv) #ifdef __WXWINCE__ wxString tmp = GetAppName(); tmp += wxT("ClassName"); - wxCanvasClassName = wxStrdup( tmp.c_str() ); + wxCanvasClassName = wxStrdup( tmp.wc_str() ); tmp += wxT("NR"); - wxCanvasClassNameNR = wxStrdup( tmp.c_str() ); + wxCanvasClassNameNR = wxStrdup( tmp.wc_str() ); HWND hWnd = FindWindow( wxCanvasClassNameNR, NULL ); if (hWnd) { @@ -546,10 +552,8 @@ wxApp::~wxApp() // wxApp idle handling // ---------------------------------------------------------------------------- -void wxApp::OnIdle(wxIdleEvent& event) +void wxApp::OnIdle(wxIdleEvent& WXUNUSED(event)) { - wxAppBase::OnIdle(event); - #if wxUSE_DC_CACHEING // automated DC cache management: clear the cached DCs and bitmap // if it's likely that the app has finished with them, that is, we @@ -778,30 +782,3 @@ terminate the program,\r\n\ } #endif // wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// deprecated event loop functions -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -void wxApp::DoMessage(WXMSG *pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - if ( evtLoop ) - evtLoop->ProcessMessage(pMsg); -} - -bool wxApp::DoMessage() -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop ? evtLoop->Dispatch() : false; -} - -bool wxApp::ProcessMessage(WXMSG* pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop && evtLoop->PreProcessMessage(pMsg); -} - -#endif // WXWIN_COMPATIBILITY_2_4