X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8375af8ff97a3649361b988a40b991a8cdaab09..fc9361e3ec5b81a7e8c32d93a03aea0b2cd3e045:/src/gtk/popupwin.cpp diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 6ed9c1a9ad..6e1048917c 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -110,7 +110,7 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win ) * virtual function here as wxWidgets requires different ways to insert * a child in container classes. */ -static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) +static void wxInsertChildInPopupWin(wxWindowGTK* parent, wxWindowGTK* child) { gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), child->m_widget, @@ -143,6 +143,8 @@ wxPopupWindow::~wxPopupWindow() bool wxPopupWindow::Create( wxWindow *parent, int style ) { + m_sizeSet = false; + if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { @@ -156,7 +158,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) // All dialogs should really have this style m_windowStyle |= wxTAB_TRAVERSAL; - m_insertCallback = (wxInsertChildFunction) wxInsertChildInDialog; + m_insertCallback = wxInsertChildInPopupWin; m_widget = gtk_window_new( GTK_WINDOW_POPUP ); @@ -237,15 +239,7 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag } */ - int minWidth = GetMinWidth(), - minHeight = GetMinHeight(), - maxWidth = GetMaxWidth(), - maxHeight = GetMaxHeight(); - - if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth; - if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight; - if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth; - if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight; + ConstrainSize(); if ((m_x != -1) || (m_y != -1)) {