moved AdjustToClientAreaOrigin to wxWindowBase, needed worldwide for wxUniv
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -198,10 +198,6 @@ public:
|
|||||||
// smaller
|
// smaller
|
||||||
virtual wxPoint GetClientAreaOrigin() const;
|
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
|
// Windows subclassing
|
||||||
void SubclassWin(WXHWND hWnd);
|
void SubclassWin(WXHWND hWnd);
|
||||||
void UnsubclassWin();
|
void UnsubclassWin();
|
||||||
|
@@ -215,13 +215,6 @@ public:
|
|||||||
// smaller
|
// smaller
|
||||||
virtual wxPoint GetClientAreaOrigin(void) const;
|
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
|
// Windows subclassing
|
||||||
void SubclassWin(WXHWND hWnd);
|
void SubclassWin(WXHWND hWnd);
|
||||||
void UnsubclassWin(void);
|
void UnsubclassWin(void);
|
||||||
|
@@ -975,6 +975,10 @@ protected:
|
|||||||
|
|
||||||
virtual void DoSetClientData( void *data );
|
virtual void DoSetClientData( void *data );
|
||||||
virtual void *DoGetClientData() const;
|
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?
|
// what kind of data do we have?
|
||||||
wxClientDataType m_clientDataType;
|
wxClientDataType m_clientDataType;
|
||||||
|
@@ -1355,6 +1355,23 @@ void wxWindowBase::GetClientSizeConstraint(int *w, int *h) const
|
|||||||
GetClientSize(w, h);
|
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
|
void wxWindowBase::GetPositionConstraint(int *x, int *y) const
|
||||||
{
|
{
|
||||||
wxLayoutConstraints *constr = GetConstraints();
|
wxLayoutConstraints *constr = GetConstraints();
|
||||||
|
@@ -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 */
|
if (m_resizing) return; /* I don't like recursions */
|
||||||
m_resizing = TRUE;
|
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 */
|
if (m_parent->m_wxwindow == NULL) /* i.e. wxNotebook */
|
||||||
{
|
{
|
||||||
/* don't set the size for children of wxNotebook, just take the values. */
|
/* don't set the size for children of wxNotebook, just take the values. */
|
||||||
|
@@ -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 */
|
if (m_resizing) return; /* I don't like recursions */
|
||||||
m_resizing = TRUE;
|
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 */
|
if (m_parent->m_wxwindow == NULL) /* i.e. wxNotebook */
|
||||||
{
|
{
|
||||||
/* don't set the size for children of wxNotebook, just take the values. */
|
/* don't set the size for children of wxNotebook, just take the values. */
|
||||||
|
@@ -180,6 +180,8 @@ static ibool wxWindowMouseHandler(window_t *wnd, event_t *e)
|
|||||||
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
||||||
wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
|
wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
|
||||||
|
|
||||||
|
if ( !win->IsEnabled() ) return FALSE;
|
||||||
|
|
||||||
wxEventType type = wxEVT_NULL;
|
wxEventType type = wxEVT_NULL;
|
||||||
wxMouseEvent event;
|
wxMouseEvent event;
|
||||||
event.SetEventObject(win);
|
event.SetEventObject(win);
|
||||||
@@ -387,6 +389,9 @@ static ibool wxWindowKeybHandler(window_t *wnd, event_t *e)
|
|||||||
{
|
{
|
||||||
wxEventType type = wxEVT_NULL;
|
wxEventType type = wxEVT_NULL;
|
||||||
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
||||||
|
|
||||||
|
if ( !win->IsEnabled() ) return FALSE;
|
||||||
|
|
||||||
wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
|
wxPoint where = win->ScreenToClient(wxPoint(e->where_x, e->where_y));
|
||||||
|
|
||||||
wxKeyEvent event;
|
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) )
|
if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||||
y = currentY;
|
y = currentY;
|
||||||
|
|
||||||
#if 0 // FIXME_MGL -- what's this good for?
|
|
||||||
AdjustForParentClientOrigin(x, y, sizeFlags);
|
AdjustForParentClientOrigin(x, y, sizeFlags);
|
||||||
#endif
|
|
||||||
|
|
||||||
wxSize size(-1, -1);
|
wxSize size(-1, -1);
|
||||||
if ( width == -1 )
|
if ( width == -1 )
|
||||||
|
@@ -1554,24 +1554,6 @@ wxPoint wxWindowMSW::GetClientAreaOrigin() const
|
|||||||
return wxPoint(0, 0);
|
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
|
// text metrics
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -1639,29 +1639,6 @@ wxPoint wxWindowOS2::GetClientAreaOrigin() const
|
|||||||
return wxPoint(0, 0);
|
return wxPoint(0, 0);
|
||||||
} // end of wxWindowOS2::GetClientAreaOrigin
|
} // 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
|
// text metrics
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user