#include "wx/cursor.h"
#endif // WX_PRECOMP
-#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-#include "wx/gtk/private.h" //for idle stuff
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
extern "C" {
bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win )
{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
if (win->IsEnabled())
win->Close();
static gint
gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
* 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),
- GTK_WIDGET(child->m_widget),
+ child->m_widget,
child->m_x,
child->m_y,
child->m_width,
bool wxPopupWindow::Create( wxWindow *parent, int style )
{
- m_needParent = false;
+ m_sizeSet = false;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") ))
// 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 );
}
*/
- 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))
{