]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Rotated text patch from Hans-Joachim Baader (with some corrections)
[wxWidgets.git] / src / msw / window.cpp
index 3a49e008d6ba02ccaed4fa6057c09f01af798bb6..7459dda31174f7dd3cd9635bb5a08e8c74c5d6a8 100644 (file)
@@ -163,6 +163,17 @@ END_EVENT_TABLE()
 // Find an item given the MS Windows id
 wxWindow *wxWindow::FindItem(long id) const
 {
+    wxControl *item = wxDynamicCast(this, wxControl);
+    if ( item )
+    {
+        // i it we or one of our "internal" children?
+        if ( item->GetId() == id ||
+             (item->GetSubcontrols().Index(id) != wxNOT_FOUND) )
+        {
+            return item;
+        }
+    }
+
     wxWindowList::Node *current = GetChildren().GetFirst();
     while (current)
     {
@@ -172,19 +183,6 @@ wxWindow *wxWindow::FindItem(long id) const
         if ( wnd )
             return wnd;
 
-        if ( childWin->IsKindOf(CLASSINFO(wxControl)) )
-        {
-            wxControl *item = (wxControl *)childWin;
-            if ( item->GetId() == id )
-                return item;
-            else
-            {
-                // In case it's a 'virtual' control (e.g. radiobox)
-                if ( item->GetSubcontrols().Member((wxObject *)id) )
-                    return item;
-            }
-        }
-
         current = current->GetNext();
     }
 
@@ -1836,6 +1834,14 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
             break;
 
         case WM_MOUSEMOVE:
+           {
+                short x = LOWORD(lParam);
+                short y = HIWORD(lParam);
+
+                processed = HandleMouseMove(x, y, wParam);
+           }
+           break;
+
         case WM_LBUTTONDOWN:
         case WM_LBUTTONUP:
         case WM_LBUTTONDBLCLK:
@@ -2938,7 +2944,8 @@ bool wxWindow::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
         return popupMenu->MSWCommand(cmd, id);
     }
 
-    wxWindow *win = FindItem(id);
+    // must cast to a signed type before comparing with other ids!
+    wxWindow *win = FindItem((signed short)id);
     if ( !win )
     {
         win = wxFindWinFromHandle(control);