From 85ad5eb54d74e371bc4bce6ff92f2de70fd21ac9 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 4 Jun 1999 07:27:02 +0000 Subject: [PATCH] Corrected bug in DoSetSize() (wxALLOW_MINUS_ONE) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dialog.cpp | 2 +- src/gtk/frame.cpp | 2 +- src/gtk/window.cpp | 7 +++++-- src/gtk1/dialog.cpp | 2 +- src/gtk1/frame.cpp | 2 +- src/gtk1/window.cpp | 7 +++++-- utils/glcanvas/gtk/glcanvas.cpp | 2 +- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 57560172e6..68afab7f74 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -437,7 +437,7 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 37e2910235..eadb75575f 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -482,7 +482,7 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 0200936cf0..97cc6cd44a 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1983,7 +1983,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) } else { - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; @@ -2994,7 +2994,10 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) while (node) { wxWindow *child = (wxWindow*) node->Data(); - child->Move( child->m_x + dx, child->m_y + dy ); + int sx = 0; + int sy = 0; + child->GetSize( &sx, &sy ); + child->SetSize( child->m_x + dx, child->m_y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE ); node = node->Next(); } diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 57560172e6..68afab7f74 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -437,7 +437,7 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 37e2910235..eadb75575f 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -482,7 +482,7 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 0200936cf0..97cc6cd44a 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1983,7 +1983,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) } else { - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; @@ -2994,7 +2994,10 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) while (node) { wxWindow *child = (wxWindow*) node->Data(); - child->Move( child->m_x + dx, child->m_y + dy ); + int sx = 0; + int sy = 0; + child->GetSize( &sx, &sy ); + child->SetSize( child->m_x + dx, child->m_y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE ); node = node->Next(); } diff --git a/utils/glcanvas/gtk/glcanvas.cpp b/utils/glcanvas/gtk/glcanvas.cpp index 14d5ac816d..93918cf149 100644 --- a/utils/glcanvas/gtk/glcanvas.cpp +++ b/utils/glcanvas/gtk/glcanvas.cpp @@ -350,7 +350,7 @@ void wxGLCanvas::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; -- 2.45.2