Store pointer to owning wxWindow in wxPizza widget

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2009-01-29 22:32:25 +00:00
parent c12822fec7
commit 55ca41b1ea
5 changed files with 7 additions and 5 deletions

View File

@ -21,7 +21,7 @@ struct WXDLLIMPEXP_CORE wxPizza
enum { BORDER_STYLES = enum { BORDER_STYLES =
wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME }; wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME };
static GtkWidget* New(long windowStyle = 0); static GtkWidget* New(long windowStyle, void *owner);
static GType type(); static GType type();
void move(GtkWidget* widget, int x, int y); void move(GtkWidget* widget, int x, int y);
void scroll(int dx, int dy); void scroll(int dx, int dy);
@ -33,6 +33,7 @@ struct WXDLLIMPEXP_CORE wxPizza
int m_scroll_y; int m_scroll_y;
int m_border_style; int m_border_style;
bool m_is_scrollable; bool m_is_scrollable;
void *m_owner;
}; };
#endif // _WX_GTK_PIZZA_H_ #endif // _WX_GTK_PIZZA_H_

View File

@ -133,7 +133,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
g_signal_connect (m_widget, "delete_event", g_signal_connect (m_widget, "delete_event",
G_CALLBACK (gtk_dialog_delete_callback), this); G_CALLBACK (gtk_dialog_delete_callback), this);
m_wxwindow = wxPizza::New(m_windowStyle); m_wxwindow = wxPizza::New(m_windowStyle, this);
gtk_widget_show( m_wxwindow ); gtk_widget_show( m_wxwindow );
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );

View File

@ -552,7 +552,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget ); gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
// m_wxwindow is the client area // m_wxwindow is the client area
m_wxwindow = wxPizza::New(); m_wxwindow = wxPizza::New(0,this);
gtk_widget_show( m_wxwindow ); gtk_widget_show( m_wxwindow );
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );

View File

@ -282,10 +282,11 @@ GType wxPizza::type()
return type; return type;
} }
GtkWidget* wxPizza::New(long windowStyle) GtkWidget* wxPizza::New(long windowStyle,void* owner)
{ {
GtkWidget* widget = GTK_WIDGET(g_object_new(type(), NULL)); GtkWidget* widget = GTK_WIDGET(g_object_new(type(), NULL));
wxPizza* pizza = WX_PIZZA(widget); wxPizza* pizza = WX_PIZZA(widget);
pizza->m_owner = owner;
pizza->m_backing_window = NULL; pizza->m_backing_window = NULL;
pizza->m_scroll_x = 0; pizza->m_scroll_x = 0;
pizza->m_scroll_y = 0; pizza->m_scroll_y = 0;

View File

@ -2113,7 +2113,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
#endif #endif
m_wxwindow = wxPizza::New(m_windowStyle); m_wxwindow = wxPizza::New(m_windowStyle,this);
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
if (HasFlag(wxPizza::BORDER_STYLES)) if (HasFlag(wxPizza::BORDER_STYLES))
{ {