X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3ecfad1923022f59dca6fe065e5f278e2802faf..a9711a4deb97504db860a136df11077fbc56eeee:/src/gtk1/popupwin.cpp diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index 36ef2e7b62..ace707144e 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -142,17 +142,23 @@ static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxPopupWindow,wxPopupWindowBase) - EVT_SIZE (wxPopupWindow::OnSize) +#ifdef __WXUNIVERSAL__ + EVT_SIZE(wxPopupWindow::OnSize) +#endif END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow,wxPopupWindowBase) +IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) + +wxPopupWindow::~wxPopupWindow() +{ +} bool wxPopupWindow::Create( wxWindow *parent, int style ) { m_needParent = FALSE; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, "popup" )) + !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { wxFAIL_MSG( wxT("wxPopupWindow creation failed") ); return FALSE; @@ -245,10 +251,15 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag } */ - if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth; - if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; - if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; - if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; + 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; if ((m_x != -1) || (m_y != -1)) { @@ -285,20 +296,25 @@ void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int m_width = width; m_height = height; - if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth; - if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; - if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; - if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; + 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; /* set size hints */ gint flag = 0; // GDK_HINT_POS; - if ((m_minWidth != -1) || (m_minHeight != -1)) flag |= GDK_HINT_MIN_SIZE; - if ((m_maxWidth != -1) || (m_maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE; + if ((minWidth != -1) || (minHeight != -1)) flag |= GDK_HINT_MIN_SIZE; + if ((maxWidth != -1) || (maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE; GdkGeometry geom; - geom.min_width = m_minWidth; - geom.min_height = m_minHeight; - geom.max_width = m_maxWidth; - geom.max_height = m_maxHeight; + geom.min_width = minWidth; + geom.min_height = minHeight; + geom.max_width = maxWidth; + geom.max_height = maxHeight; gtk_window_set_geometry_hints( GTK_WINDOW(m_widget), (GtkWidget*) NULL, &geom, @@ -330,9 +346,9 @@ bool wxPopupWindow::Show( bool show ) GtkOnSize( m_x, m_y, m_width, m_height ); } - + bool ret = wxWindow::Show( show ); - + return ret; }