]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/spinctrl.cpp
compilation fix after last change
[wxWidgets.git] / src / msw / spinctrl.cpp
index 1b9910d66f996edadb41cd6737e1beccc0ae6df6..c5644f4dfcdba04aa8b2f597fe2b6587e07754b5 100644 (file)
@@ -148,8 +148,7 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
 {
     wxSpinCtrl *spin = (wxSpinCtrl *)wxGetWindowUserData(hwnd);
 
-    // forward some messages (the key and focus ones only so far) to
-    // the spin ctrl
+    // forward some messages (mostly the key and focus ones) to the spin ctrl
     switch ( message )
     {
         case WM_SETFOCUS:
@@ -164,6 +163,12 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
         case WM_DEADCHAR:
         case WM_KEYUP:
         case WM_KEYDOWN:
+#ifdef WM_HELP
+        // we need to forward WM_HELP too to ensure that the context help
+        // associated with wxSpinCtrl is shown when the text control part of it
+        // is clicked with the "?" cursor
+        case WM_HELP:
+#endif
             spin->MSWWindowProc(message, wParam, lParam);
 
             // The control may have been deleted at this point, so check.
@@ -207,7 +212,7 @@ bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id))
         wxString val = wxGetWindowText(m_hwndBuddy);
         event.SetString(val);
         event.SetInt(GetValue());
-        return GetEventHandler()->ProcessEvent(event);
+        return HandleWindowEvent(event);
     }
 
     // not processed
@@ -225,7 +230,7 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event)
                 wxString val = wxGetWindowText(m_hwndBuddy);
                 event.SetString(val);
                 event.SetInt(GetValue());
-                if ( GetEventHandler()->ProcessEvent(event) )
+                if ( HandleWindowEvent(event) )
                     return;
                 break;
             }
@@ -241,7 +246,7 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event)
                 eventNav.SetWindowChange(event.ControlDown());
                 eventNav.SetEventObject(this);
 
-                if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) )
+                if ( GetParent()->HandleWindowEvent(eventNav) )
                     return;
             }
             break;
@@ -571,7 +576,7 @@ void wxSpinCtrl::SendSpinUpdate(int value)
     event.SetEventObject(this);
     event.SetInt(value);
 
-    (void)GetEventHandler()->ProcessEvent(event);
+    (void)HandleWindowEvent(event);
 
     m_oldValue = value;
 }
@@ -643,6 +648,19 @@ void wxSpinCtrl::DoGetSize(int *x, int *y) const
         *y = ctrlrect.bottom - ctrlrect.top;
 }
 
+void wxSpinCtrl::DoGetClientSize(int *x, int *y) const
+{
+    RECT spinrect = wxGetClientRect(GetHwnd());
+    RECT textrect = wxGetClientRect(GetBuddyHwnd());
+    RECT ctrlrect;
+    UnionRect(&ctrlrect,&textrect, &spinrect);
+
+    if ( x )
+        *x = ctrlrect.right - ctrlrect.left;
+    if ( y )
+        *y = ctrlrect.bottom - ctrlrect.top;
+}
+
 void wxSpinCtrl::DoGetPosition(int *x, int *y) const
 {
     // hack: pretend that our HWND is the text control just for a moment