]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/app.cpp
VA needs FALSE not false
[wxWidgets.git] / src / os2 / app.cpp
index d918cd0d42b6a93119d098382ce43e937c6b8e87..cf75302c7832d741c13623afa382663aef7f4d15 100644 (file)
@@ -92,6 +92,9 @@ HICON wxDEFAULT_MDIPARENTFRAME_ICON  = (HICON) NULL;
 
 HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
 
 
 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
 // ===========================================================================
 // ===========================================================================
 // implementation
 // ===========================================================================
@@ -206,8 +209,8 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxFrameClassName
 
     if (!::WinRegisterClass( vHab
                             ,wxFrameClassName
-                            ,NULL
-                            ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
+                            ,wxFrameWndProc
+                            ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT  | CS_CLIPCHILDREN
                             ,sizeof(ULONG)
                            ))
     {
                             ,sizeof(ULONG)
                            ))
     {
@@ -219,9 +222,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxFrameClassNameNoRedraw
 
     if (!::WinRegisterClass( vHab
                             ,wxFrameClassNameNoRedraw
-                            ,NULL
-                            ,0
+                            ,wxWndProc
                             ,0
                             ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -232,9 +235,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIFrameClassName
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIFrameClassName
-                            ,NULL
+                            ,wxWndProc
                             ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
                             ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
-                            ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -245,9 +248,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIFrameClassNameNoRedraw
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIFrameClassNameNoRedraw
-                            ,NULL
-                            ,0
+                            ,wxWndProc
                             ,0
                             ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -258,9 +261,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIChildFrameClassName
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIChildFrameClassName
-                            ,NULL
+                            ,wxWndProc
                             ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST
                             ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST
-                            ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -271,9 +274,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIChildFrameClassNameNoRedraw
 
     if (!::WinRegisterClass( vHab
                             ,wxMDIChildFrameClassNameNoRedraw
-                            ,NULL
+                            ,wxWndProc
                             ,CS_HITTEST
                             ,CS_HITTEST
-                            ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -284,9 +287,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxPanelClassName
 
     if (!::WinRegisterClass( vHab
                             ,wxPanelClassName
-                            ,NULL
+                            ,wxWndProc
                             ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT
                             ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT
-                            ,0
+                            ,sizeof(ULONG)
                            ))
     {
         vError = ::WinGetLastError(vHab);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -297,9 +300,9 @@ bool wxApp::RegisterWindowClasses(
 
     if (!::WinRegisterClass( vHab
                             ,wxCanvasClassName
 
     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);
                            ))
     {
         vError = ::WinGetLastError(vHab);
@@ -483,25 +486,23 @@ int wxEntry(
         if (wxTheApp->OnInit())
         {
             nRetValue = wxTheApp->OnRun();
         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
         }
     }
     else // app initialization failed
@@ -759,6 +760,12 @@ bool wxApp::ProcessMessage(
     }
 #endif // wxUSE_TOOLTIPS
 
     }
 #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
     //
     // For some composite controls (like a combobox), wndThis might be NULL
     // because the subcontrol is not a wxWindow, but only the control itself