]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
Lots of Unix/Unicode compile fixes, some of which
[wxWidgets.git] / src / os2 / window.cpp
index 52a983498a0940591749a505b324dec09d193847..c9ad0104c27ed19901f3da7c8c9873b9de1ac86b 100644 (file)
@@ -442,17 +442,19 @@ bool wxWindowOS2::Create(
     // Generic OS/2 Windows have no Control Data but other classes
     // that call OS2Create may have some.
     //
-    OS2Create( (PSZ)wxCanvasClassName
-              ,rName.c_str()
-              ,ulCreateFlags
-              ,rPos
-              ,rSize
-              ,NULL         // Control Data
-              ,dwExStyle
-              ,TRUE         // Child
-             );
+    bool                            bRetVal = OS2Create( (PSZ)wxCanvasClassName
+                                                        ,rName.c_str()
+                                                        ,ulCreateFlags
+                                                        ,rPos
+                                                        ,rSize
+                                                        ,NULL         // Control Data
+                                                        ,dwExStyle
+                                                        ,TRUE         // Child
+                                                       );
 
-    return(TRUE);
+    if (bRetVal)
+        ::WinSubclassWindow(m_hWnd, (PFNWP)wxWndProc);
+    return(bRetVal);
 } // end of wxWindowOS2::Create
 
 // ---------------------------------------------------------------------------
@@ -2330,17 +2332,6 @@ bool wxWindowOS2::OS2ProcessMessage(
     pMsg = pMsg; // just shut up the compiler
 #endif // __WXUNIVERSAL__
 
-#if wxUSE_TOOLTIPS
-    if ( m_tooltip )
-    {
-        // relay mouse move events to the tooltip control
-        QMSG*                       pQMsg = (QMSG*)pMsg;
-
-        if (pQMsg->msg == WM_MOUSEMOVE )
-            m_tooltip->RelayEvent(pMsg);
-    }
-#endif // wxUSE_TOOLTIPS
-
     return FALSE;
 } // end of wxWindowOS2::OS2ProcessMessage
 
@@ -2879,6 +2870,11 @@ MRESULT wxWindowOS2::OS2WindowProc(
                         HWND                hWnd = ::WinWindowFromID(GetHWND(), SHORT1FROMMP(wParam));
                         wxWindowOS2*        pChild = wxFindWinFromHandle(hWnd);
 
+                        if (!pChild)
+                        {
+                            bProcessed = FALSE;
+                            break;
+                        }
                         if (pChild->IsKindOf(CLASSINFO(wxSlider)))
                             bProcessed = OS2OnScroll( wxVERTICAL
                                                      ,(int)SHORT2FROMMP(wParam)
@@ -3942,6 +3938,8 @@ bool wxWindowOS2::HandleMouseEvent(
 , WXUINT                            uFlags
 )
 {
+    bool                            bProcessed = FALSE;
+
     //
     // The mouse events take consecutive IDs from WM_MOUSEFIRST to
     // WM_MOUSELAST, so it's enough to substract WM_MOUSEMOVE == WM_MOUSEFIRST
@@ -3970,6 +3968,18 @@ bool wxWindowOS2::HandleMouseEvent(
                    ,uFlags
                   );
 
+    bProcessed = GetEventHandler()->ProcessEvent(vEvent);
+    if (!bProcessed)
+    {
+        HPOINTER                    hPtr = ::WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
+        HPOINTER                    hCursor = (HPOINTER)GetCursor().GetHCURSOR();
+
+        if (hCursor != NULLHANDLE)
+        {
+            ::WinSetPointer(HWND_DESKTOP, hCursor);
+            bProcessed = TRUE;
+        }
+    }
     return GetEventHandler()->ProcessEvent(vEvent);
 } // end of wxWindowOS2::HandleMouseEvent