]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
cosmetic fixes to font encoding names
[wxWidgets.git] / src / os2 / window.cpp
index 0573448e600f9e6ff69f6f1bbbcb283f9f65b19c..76ab3ba44081eb04b069c73614fcaef591b6681b 100644 (file)
@@ -1718,9 +1718,14 @@ void wxWindow::UnpackCommand(
 , WORD*                             pCmd
 )
 {
+/*
     *pId = LOWORD(wParam);
     *phWnd = (WXHWND)lParam;
     *pCmd = HIWORD(wParam);
+*/
+    *pId = LOWORD(wParam);
+    *phWnd = NULL;  // or may be GetHWND() ?
+    *pCmd = LOWORD(lParam);
 } // end of wxWindow::UnpackCommand
 
 void wxWindow::UnpackActivate(
@@ -1802,7 +1807,7 @@ MRESULT EXPENTRY wxWndProc(
         pWnd->SetHWND((WXHWND)hWnd);
     }
 
-    MRESULT                         rc = (MRESULT)FALSE;
+    MRESULT                         rc = (MRESULT)0;
 
 
     //
@@ -1821,6 +1826,7 @@ MRESULT EXPENTRY wxWndProc(
         else
             rc = ::WinDefWindowProc(hWnd, ulMsg, wParam, lParam);
     }
+
     return rc;
 } // end of wxWndProc
 
@@ -1881,7 +1887,6 @@ MRESULT wxWindow::OS2WindowProc(
         case WM_DESTROY:
              HandleDestroy();
              bProcessed = TRUE;
-             delete this;
              break;
 
         case WM_MOVE:
@@ -2337,10 +2342,10 @@ bool wxWindow::OS2Create(
 {
     ERRORID                         vError;
     wxString                        sError;
-    long                            lX1      = (long)CW_USEDEFAULT;
+    long                            lX1      = 0L;
     long                            lY1      = 0L;
-    long                            lWidth1  = (long)CW_USEDEFAULT;
-    long                            lHeight1 = 100L;
+    long                            lWidth1  = 20L;
+    long                            lHeight1 = 20L;
     int                             nControlId = 0;
 
     //
@@ -2426,7 +2431,7 @@ bool wxWindow::OS2Create(
     wxAssociateWinWithHandle((HWND)m_hWnd
                              ,this
                             );
-    // 
+    //
     // Now need to subclass window.
     //
 
@@ -3968,3 +3973,43 @@ static void TranslateKbdEventToMouse(
     pWin->ScreenToClient(pX, pY);
 } // end of TranslateKbdEventToMouse
 
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+{
+    return wxFindWindowAtPoint(wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+#if 0
+    POINT pt2;
+    pt2.x = pt.x;
+    pt2.y = pt.y;
+    HWND hWndHit = ::WindowFromPoint(pt2);
+
+    wxWindow* win = wxFindWinFromHandle((WXHWND) hWndHit) ;
+    HWND hWnd = hWndHit;
+
+    // Try to find a window with a wxWindow associated with it
+    while (!win && (hWnd != 0))
+    {
+        hWnd = ::GetParent(hWnd);
+        win = wxFindWinFromHandle((WXHWND) hWnd) ;
+    }
+    return win;
+#endif
+    return (wxWindow*)NULL;
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+#if 0
+    POINT pt;
+    GetCursorPos( & pt );
+    return wxPoint(pt.x, pt.y);
+#endif
+    return wxPoint(0,0);
+}
+