]> git.saurik.com Git - wxWidgets.git/commitdiff
moved AdjustToClientAreaOrigin to wxWindowBase, needed worldwide for wxUniv
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Sep 2001 22:36:18 +0000 (22:36 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Sep 2001 22:36:18 +0000 (22:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/window.h
include/wx/os2/window.h
include/wx/window.h
src/common/wincmn.cpp
src/gtk/window.cpp
src/gtk1/window.cpp
src/mgl/window.cpp
src/msw/window.cpp
src/os2/window.cpp

index 487ad1e54294dde87c1d0f1f073f5c81bcc09e90..3a77679b8afe177485bc667b512659b89bffc552 100644 (file)
@@ -198,10 +198,6 @@ public:
     // smaller
     virtual wxPoint GetClientAreaOrigin() const;
 
-    // Makes an adjustment to the window position (for example, a frame that has
-    // a toolbar that it manages itself).
-    virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
-
     // Windows subclassing
     void SubclassWin(WXHWND hWnd);
     void UnsubclassWin();
index 4c3fc7391e88073383bae549557473566e800ec5..edc0e474bbeffdc8589695bb8d0e8d0a759109c5 100644 (file)
@@ -215,13 +215,6 @@ public:
     // smaller
     virtual wxPoint GetClientAreaOrigin(void) const;
 
-    // Makes an adjustment to the window position (for example, a frame that has
-    // a toolbar that it manages itself).
-    virtual void AdjustForParentClientOrigin( int& rX
-                                             ,int& rY
-                                             ,int  nSizeFlags
-                                            );
-
     // Windows subclassing
     void SubclassWin(WXHWND hWnd);
     void UnsubclassWin(void);
index 2e940e1ddd7863392a6130f1b9130a5cec2fcab2..734e518ca79e80f1ce8534d246538c93bc94ab11 100644 (file)
@@ -975,6 +975,10 @@ protected:
 
     virtual void DoSetClientData( void *data );
     virtual void *DoGetClientData() const;
+    
+    // Makes an adjustment to the window position (for example, a frame that has
+    // a toolbar that it manages itself).
+    virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
 
     // what kind of data do we have?
     wxClientDataType m_clientDataType;
index df455c9cfa4568af5e783e3bf17fa8149070474c..9a7b7a3bc66c0d9dbebb95116320341b0134ebd2 100644 (file)
@@ -1355,6 +1355,23 @@ void wxWindowBase::GetClientSizeConstraint(int *w, int *h) const
         GetClientSize(w, h);
 }
 
+void wxWindowBase::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags)
+{
+    // don't do it for the dialogs/frames - they float independently of their
+    // parent
+    if ( !IsTopLevel() )
+    {
+        wxWindow *parent = GetParent();
+        if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
+        {
+            wxPoint pt(parent->GetClientAreaOrigin());
+            x += pt.x;
+            y += pt.y;
+        }
+    }
+}
+
+
 void wxWindowBase::GetPositionConstraint(int *x, int *y) const
 {
     wxLayoutConstraints *constr = GetConstraints();
index 9b8f1de926c3e28897cc3c42709a0505a127bc4e..866d2b4f8b1dd47f9d6ecc10619c70accdfc32b3 100644 (file)
@@ -2690,6 +2690,12 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
     if (m_resizing) return; /* I don't like recursions */
     m_resizing = TRUE;
 
+    if (x == -1) 
+        x = m_x;
+    if (y == -1)
+        y = m_y;
+    AdjustForParentClientOrigin(x, y, sizeFlags);
+
     if (m_parent->m_wxwindow == NULL) /* i.e. wxNotebook */
     {
         /* don't set the size for children of wxNotebook, just take the values. */
index 9b8f1de926c3e28897cc3c42709a0505a127bc4e..866d2b4f8b1dd47f9d6ecc10619c70accdfc32b3 100644 (file)
@@ -2690,6 +2690,12 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
     if (m_resizing) return; /* I don't like recursions */
     m_resizing = TRUE;
 
+    if (x == -1) 
+        x = m_x;
+    if (y == -1)
+        y = m_y;
+    AdjustForParentClientOrigin(x, y, sizeFlags);
+
     if (m_parent->m_wxwindow == NULL) /* i.e. wxNotebook */
     {
         /* don't set the size for children of wxNotebook, just take the values. */
index 61e992901fd0f4cea532e80d63103a599f451689..8f3bb0905a71900b8554ddb47a3d1325fabbf3a4 100644 (file)
@@ -180,6 +180,8 @@ static ibool wxWindowMouseHandler(window_t *wnd, event_t *e)
     wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
     wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
     
+    if ( !win->IsEnabled() ) return FALSE;
+    
     wxEventType type = wxEVT_NULL;
     wxMouseEvent event;
     event.SetEventObject(win);
@@ -387,6 +389,9 @@ static ibool wxWindowKeybHandler(window_t *wnd, event_t *e)
 {
     wxEventType type = wxEVT_NULL;
     wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
+
+    if ( !win->IsEnabled() ) return FALSE;
+
     wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
     
     wxKeyEvent event;
@@ -847,9 +852,7 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags)
     if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
         y = currentY;
 
-#if 0 // FIXME_MGL -- what's this good for?
     AdjustForParentClientOrigin(x, y, sizeFlags);
-#endif
 
     wxSize size(-1, -1);
     if ( width == -1 )
index cd2ca7448d4496fa1d72cc6a0a8d97da2664f67f..59e4c2a5f118d7f76cf4d7f29f2756268aa79ee0 100644 (file)
@@ -1554,24 +1554,6 @@ wxPoint wxWindowMSW::GetClientAreaOrigin() const
     return wxPoint(0, 0);
 }
 
-// Makes an adjustment to the window position (for example, a frame that has
-// a toolbar that it manages itself).
-void wxWindowMSW::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags)
-{
-    // don't do it for the dialogs/frames - they float independently of their
-    // parent
-    if ( !IsTopLevel() )
-    {
-        wxWindow *parent = GetParent();
-        if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
-        {
-            wxPoint pt(parent->GetClientAreaOrigin());
-            x += pt.x;
-            y += pt.y;
-        }
-    }
-}
-
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------
index 90180cf64c65458b8266552fac358806762dd4af..bd50f98ca95ba20f8d9690ede9e90042d3624b7c 100644 (file)
@@ -1639,29 +1639,6 @@ wxPoint wxWindowOS2::GetClientAreaOrigin() const
     return wxPoint(0, 0);
 } // end of wxWindowOS2::GetClientAreaOrigin
 
-void wxWindowOS2::AdjustForParentClientOrigin(
-  int&                              rX
-, int&                              rY
-, int                               nSizeFlags
-)
-{
-    //
-    // Don't do it for the dialogs/frames - they float independently of their
-    // parent
-    //
-    if (!IsTopLevel())
-    {
-        wxWindow*                   pParent = GetParent();
-
-        if (!(nSizeFlags & wxSIZE_NO_ADJUSTMENTS) && pParent)
-        {
-            wxPoint                 vPoint(pParent->GetClientAreaOrigin());
-            rX += vPoint.x;
-            rY += vPoint.y;
-        }
-    }
-} // end of wxWindowOS2::AdjustForParentClientOrigin
-
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------