X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e99520bd3fc092bbbcbc38bb699a0236618ea40..eedb15434a5f0350f4e1a11faaab3391b900cb5b:/src/os2/app.cpp diff --git a/src/os2/app.cpp b/src/os2/app.cpp index d918cd0d42..cf75302c78 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -92,6 +92,9 @@ HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL; HBRUSH wxDisableButtonBrush = (HBRUSH) 0; +MRESULT EXPENTRY wxWndProc( HWND hWnd,ULONG message,MPARAM mp1,MPARAM mp2); +MRESULT EXPENTRY wxFrameWndProc( HWND hWnd,ULONG message,MPARAM mp1,MPARAM mp2); + // =========================================================================== // implementation // =========================================================================== @@ -206,8 +209,8 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxFrameClassName - ,NULL - ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT + ,wxFrameWndProc + ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT | CS_CLIPCHILDREN ,sizeof(ULONG) )) { @@ -219,9 +222,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxFrameClassNameNoRedraw - ,NULL - ,0 + ,wxWndProc ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -232,9 +235,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIFrameClassName - ,NULL + ,wxWndProc ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT - ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -245,9 +248,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIFrameClassNameNoRedraw - ,NULL - ,0 + ,wxWndProc ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -258,9 +261,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIChildFrameClassName - ,NULL + ,wxWndProc ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST - ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -271,9 +274,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxMDIChildFrameClassNameNoRedraw - ,NULL + ,wxWndProc ,CS_HITTEST - ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -284,9 +287,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxPanelClassName - ,NULL + ,wxWndProc ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT - ,0 + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -297,9 +300,9 @@ bool wxApp::RegisterWindowClasses( if (!::WinRegisterClass( vHab ,wxCanvasClassName - ,NULL - ,0 // CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT - ,0 + ,wxWndProc + ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT + ,sizeof(ULONG) )) { vError = ::WinGetLastError(vHab); @@ -483,25 +486,23 @@ int wxEntry( if (wxTheApp->OnInit()) { nRetValue = wxTheApp->OnRun(); -// nRetValue = -1; - } - } -// Normal exit - wxWindow* pTopWindow = wxTheApp->GetTopWindow(); - - if (pTopWindow) - { - // Forcibly delete the window. - if (pTopWindow->IsKindOf(CLASSINFO(wxFrame)) || - pTopWindow->IsKindOf(CLASSINFO(wxDialog)) ) - { - pTopWindow->Close(TRUE); - wxTheApp->DeletePendingObjects(); } - else + // Normal exit + wxWindow* pTopWindow = wxTheApp->GetTopWindow(); + if (pTopWindow) { - delete pTopWindow; - wxTheApp->SetTopWindow(NULL); + // Forcibly delete the window. + if (pTopWindow->IsKindOf(CLASSINFO(wxFrame)) || + pTopWindow->IsKindOf(CLASSINFO(wxDialog)) ) + { + pTopWindow->Close(TRUE); + wxTheApp->DeletePendingObjects(); + } + else + { + delete pTopWindow; + wxTheApp->SetTopWindow(NULL); + } } } else // app initialization failed @@ -759,6 +760,12 @@ bool wxApp::ProcessMessage( } #endif // wxUSE_TOOLTIPS + // + // We must relay Timer events to wxTimer's processing function + // + if (pMsg->msg == WM_TIMER) + wxTimerProc(NULL, 0, pMsg->mp1, 0); + // // For some composite controls (like a combobox), wndThis might be NULL // because the subcontrol is not a wxWindow, but only the control itself