]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
compilation fix (not all paths returned a value)
[wxWidgets.git] / src / msw / window.cpp
index f5db90dc550348a211e1c657c8bf0fd51fc08368..54c791ddad23ac6cf5f5e0b1ef684e45ff4fc1cb 100644 (file)
@@ -217,15 +217,13 @@ static inline void wxBringWindowToTop(HWND hwnd)
 
     // activate (set focus to) specified window
     ::SetFocus(hwnd);
+#endif
 
     // raise top level parent to top of z order
-    ::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-#else // !__WXMICROWIN__
-    if ( !::BringWindowToTop(hwnd) )
+    if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
     {
-        wxLogLastError(_T("BringWindowToTop"));
+        wxLogLastError(_T("SetWindowPos"));
     }
-#endif // __WXMICROWIN__/!__WXMICROWIN__
 }
 
 // ---------------------------------------------------------------------------
@@ -2188,6 +2186,24 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
             processed = HandleMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
             break;
 
+        case WM_MOVING:
+                       {
+                               LPRECT pRect = (LPRECT)lParam;
+                               wxRect rc;
+                               rc.SetLeft(pRect->left);
+                               rc.SetTop(pRect->top);
+                               rc.SetRight(pRect->right);
+                               rc.SetBottom(pRect->bottom);
+                               processed = HandleMoving(rc);
+                               if (processed) {
+                                       pRect->left = rc.GetLeft();
+                                       pRect->top = rc.GetTop();
+                                       pRect->right = rc.GetRight();
+                                       pRect->bottom = rc.GetBottom();
+                               }
+                       }
+            break;
+
         case WM_SIZE:
             switch ( wParam )
             {
@@ -2216,6 +2232,24 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
             }
             break;
 
+        case WM_SIZING:
+            {
+                LPRECT pRect = (LPRECT)lParam;
+                wxRect rc;
+                rc.SetLeft(pRect->left);
+                rc.SetTop(pRect->top);
+                rc.SetRight(pRect->right);
+                rc.SetBottom(pRect->bottom);
+                processed = HandleSizing(rc);
+                if (processed) {
+                    pRect->left = rc.GetLeft();
+                    pRect->top = rc.GetTop();
+                    pRect->right = rc.GetRight();
+                    pRect->bottom = rc.GetBottom();
+                }
+            }
+            break;
+
 #ifndef __WXMICROWIN__
         case WM_ACTIVATEAPP:
             wxTheApp->SetActive(wParam != 0, FindFocus());
@@ -3397,16 +3431,21 @@ bool wxWindowMSW::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
     }
 #endif // wxUSE_MENUS_NATIVE
 
+#endif // USE_OWNER_DRAWN
+
 #if wxUSE_CONTROLS
+
     wxWindow *item = FindItem(id);
+#if wxUSE_OWNER_DRAWN
     if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
-    {
         return ((wxControl *)item)->MSWOnDraw(itemStruct);
-    }
-#endif // wxUSE_CONTROLS
-
+#else
+    if ( item && item->IsKindOf(CLASSINFO(wxButton)) )
+        return ((wxButton *)item)->MSWOnDraw(itemStruct);
 #endif // USE_OWNER_DRAWN
 
+#endif // wxUSE_CONTROLS
+
     return FALSE;
 }
 
@@ -3818,6 +3857,17 @@ bool wxWindowMSW::HandleMove(int x, int y)
     return GetEventHandler()->ProcessEvent(event);
 }
 
+bool wxWindowMSW::HandleMoving(wxRect& rect)
+{
+    wxMoveEvent event(rect, m_windowId);
+    event.SetEventObject(this);
+    
+    bool rc = GetEventHandler()->ProcessEvent(event);
+    if (rc)
+        rect = event.GetRect();
+    return rc;
+}
+
 bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
                              WXUINT WXUNUSED(flag))
 {
@@ -3830,6 +3880,17 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
     return GetEventHandler()->ProcessEvent(event);
 }
 
+bool wxWindowMSW::HandleSizing(wxRect& rect)
+{
+    wxSizeEvent event(rect, m_windowId);
+    event.SetEventObject(this);
+    
+    bool rc = GetEventHandler()->ProcessEvent(event);
+    if (rc)
+        rect = event.GetRect();
+    return rc;
+}
+
 bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
 {
     MINMAXINFO *info = (MINMAXINFO *)mmInfo;