Adjust x,y parameters by pizza scroll offset in DoSetSize
This should cause no change in behavior, and is merely preparation for further changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2596,15 +2596,22 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
|||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
||||||
wxASSERT_MSG( (m_parent != NULL), wxT("wxWindowGTK::SetSize requires parent.\n") );
|
wxASSERT_MSG( (m_parent != NULL), wxT("wxWindowGTK::SetSize requires parent.\n") );
|
||||||
|
|
||||||
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0 && (x == -1 || y == -1))
|
int scrollX = 0, scrollY = 0;
|
||||||
|
GtkWidget* parent = gtk_widget_get_parent(m_widget);
|
||||||
|
if (WX_IS_PIZZA(parent))
|
||||||
{
|
{
|
||||||
int currentX, currentY;
|
wxPizza* pizza = WX_PIZZA(parent);
|
||||||
GetPosition(¤tX, ¤tY);
|
scrollX = pizza->m_scroll_x;
|
||||||
if (x == -1)
|
scrollY = pizza->m_scroll_y;
|
||||||
x = currentX;
|
|
||||||
if (y == -1)
|
|
||||||
y = currentY;
|
|
||||||
}
|
}
|
||||||
|
if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
x += scrollX;
|
||||||
|
else
|
||||||
|
x = m_x;
|
||||||
|
if (y != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
y += scrollY;
|
||||||
|
else
|
||||||
|
y = m_y;
|
||||||
|
|
||||||
// calculate the best size if we should auto size the window
|
// calculate the best size if we should auto size the window
|
||||||
if ( ((sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1) ||
|
if ( ((sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1) ||
|
||||||
@@ -2625,9 +2632,8 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
|||||||
|
|
||||||
if (m_parent->m_wxwindow)
|
if (m_parent->m_wxwindow)
|
||||||
{
|
{
|
||||||
wxPizza* pizza = WX_PIZZA(m_parent->m_wxwindow);
|
m_x = x;
|
||||||
m_x = x + pizza->m_scroll_x;
|
m_y = y;
|
||||||
m_y = y + pizza->m_scroll_y;
|
|
||||||
|
|
||||||
int left_border = 0;
|
int left_border = 0;
|
||||||
int right_border = 0;
|
int right_border = 0;
|
||||||
|
Reference in New Issue
Block a user