X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/08f53168acef5006826b22c11fe562432193d854..98225d0279de4d074d306b40683667670333be51:/src/gtk/popupwin.cpp diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index e82b1a4b25..0885668e42 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -19,7 +19,7 @@ #include -#include "wx/gtk/win_gtk.h" +#include "wx/gtk/private/win_gtk.h" //----------------------------------------------------------------------------- // "button_press" @@ -53,7 +53,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); event.SetEventObject( win ); - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); return TRUE; } @@ -98,27 +98,18 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win ) } } -//----------------------------------------------------------------------------- -// InsertChild for wxPopupWindow -//----------------------------------------------------------------------------- - -/* Callback for wxFrame. This very strange beast has to be used because - * C++ has no virtual methods in a constructor. We have to emulate a - * virtual function here as wxWidgets requires different ways to insert - * a child in container classes. */ - -static void wxInsertChildInPopupWin(wxWindowGTK* parent, wxWindowGTK* child) +void wxPopupWindow::AddChildGTK(wxWindowGTK* child) { gtk_widget_set_size_request( child->m_widget, child->m_width, child->m_height); gtk_fixed_put( - GTK_FIXED(parent->m_wxwindow), child->m_widget, child->m_x, child->m_y); + GTK_FIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y); - if (parent->HasFlag(wxTAB_TRAVERSAL)) + if (HasFlag(wxTAB_TRAVERSAL)) { /* we now allow a window to get the focus as long as it doesn't have any children. */ - GTK_WIDGET_UNSET_FLAGS( parent->m_wxwindow, GTK_CAN_FOCUS ); + GTK_WIDGET_UNSET_FLAGS(m_wxwindow, GTK_CAN_FOCUS); } } @@ -151,9 +142,8 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) // All dialogs should really have this style m_windowStyle |= wxTAB_TRAVERSAL; - m_insertCallback = wxInsertChildInPopupWin; - m_widget = gtk_window_new( GTK_WINDOW_POPUP ); + g_object_ref(m_widget); if ((m_parent) && (GTK_IS_WINDOW(m_parent->m_widget))) gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); @@ -227,7 +217,7 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag gtk_widget_set_size_request( m_widget, m_width, m_height ); wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -237,7 +227,7 @@ bool wxPopupWindow::Show( bool show ) { wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } bool ret = wxWindow::Show( show );