Apply patch which makes it possible to resize a
control in a toolbar. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
dcd3c79cfa
commit
fe39b16a97
@ -24,6 +24,9 @@
|
|||||||
#include "wx/msgdlg.h"
|
#include "wx/msgdlg.h"
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
#include "wx/combobox.h"
|
#include "wx/combobox.h"
|
||||||
|
#if wxUSE_TOOLBAR_NATIVE
|
||||||
|
#include "wx/toolbar.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
#include "wx/dnd.h"
|
#include "wx/dnd.h"
|
||||||
@ -2910,28 +2913,6 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
|||||||
y = currentY;
|
y = currentY;
|
||||||
AdjustForParentClientOrigin(x, y, sizeFlags);
|
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. */
|
|
||||||
m_x = x;
|
|
||||||
m_y = y;
|
|
||||||
m_width = width;
|
|
||||||
m_height = height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow);
|
|
||||||
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
|
||||||
{
|
|
||||||
if (x != -1) m_x = x + pizza->xoffset;
|
|
||||||
if (y != -1) m_y = y + pizza->yoffset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_x = x + pizza->xoffset;
|
|
||||||
m_y = y + pizza->yoffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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) ||
|
||||||
((sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1) )
|
((sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1) )
|
||||||
@ -2953,11 +2934,44 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
|||||||
maxWidth = GetMaxWidth(),
|
maxWidth = GetMaxWidth(),
|
||||||
maxHeight = GetMaxHeight();
|
maxHeight = GetMaxHeight();
|
||||||
|
|
||||||
if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
|
if ((minWidth != -1) && (m_width < minWidth )) m_width = minWidth;
|
||||||
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
||||||
if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
|
if ((maxWidth != -1) && (m_width > maxWidth )) m_width = maxWidth;
|
||||||
if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
|
if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
|
||||||
|
|
||||||
|
#if wxUSE_TOOLBAR_NATIVE
|
||||||
|
if (wxDynamicCast(GetParent(), wxToolBar))
|
||||||
|
{
|
||||||
|
// don't take the x,y values, they're wrong because toolbar sets them
|
||||||
|
GtkWidget *widget = GTK_WIDGET(m_widget);
|
||||||
|
gtk_widget_set_size_request (widget, m_width, m_height);
|
||||||
|
if (GTK_WIDGET_VISIBLE (widget))
|
||||||
|
gtk_widget_queue_resize (widget);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (m_parent->m_wxwindow == NULL) // i.e. wxNotebook
|
||||||
|
{
|
||||||
|
// don't set the size for children of wxNotebook, just take the values.
|
||||||
|
m_x = x;
|
||||||
|
m_y = y;
|
||||||
|
m_width = width;
|
||||||
|
m_height = height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow);
|
||||||
|
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
||||||
|
{
|
||||||
|
if (x != -1) m_x = x + pizza->xoffset;
|
||||||
|
if (y != -1) m_y = y + pizza->yoffset;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_x = x + pizza->xoffset;
|
||||||
|
m_y = y + pizza->yoffset;
|
||||||
|
}
|
||||||
|
|
||||||
int left_border = 0;
|
int left_border = 0;
|
||||||
int right_border = 0;
|
int right_border = 0;
|
||||||
int top_border = 0;
|
int top_border = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user