X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c51a665c649f7579fb39e62070cef4f66b3210d..0c80814ffe7d0c2a0179345b8884727b9fb335ff:/src/gtk/collpane.cpp diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index 87b4a42488..ac2b928d80 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -4,7 +4,6 @@ // Author: Francesco Montorsi // Modified By: // Created: 8/10/2006 -// Id: $Id$ // Copyright: (c) Francesco Montorsi // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -24,14 +23,16 @@ #include "wx/sizer.h" #include "wx/panel.h" +#include #include "wx/gtk/private.h" +#include "wx/gtk/private/gtk2-compat.h" // the lines below duplicate the same definitions in collpaneg.cpp, if we have // another implementation of this class we should extract them to a common file const char wxCollapsiblePaneNameStr[] = "collapsiblePane"; -wxDEFINE_EVENT( wxEVT_COMMAND_COLLPANE_CHANGED, wxCollapsiblePaneEvent ); +wxDEFINE_EVENT( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEvent ); IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneEvent, wxCommandEvent) @@ -95,7 +96,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object), // 1) need to update our size hints // NB: this function call won't actually do any long operation - // (redraw/relayouting/resizing) so that it's flicker-free + // (redraw/relayout/resize) so that it's flicker-free p->SetMinSize(sz); if (p->HasFlag(wxCP_NO_TLW_RESIZE)) @@ -123,7 +124,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object), // transition. This may be sometimes undesired but *is* // necessary and if you look carefully, all GTK+ programs using // GtkExpander perform this trick (e.g. the standard "open file" - // dialog of GTK+>=2.4 is not resizeable when the expander is + // dialog of GTK+>=2.4 is not resizable when the expander is // collapsed!) gtk_window_set_resizable (GTK_WINDOW (top->m_widget), p->IsExpanded()); @@ -200,7 +201,6 @@ bool wxCollapsiblePane::Create(wxWindow *parent, m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxNO_BORDER, wxS("wxCollapsiblePanePane")); - gtk_widget_show(m_widget); m_parent->DoAddChild( this ); PostCreation(size); @@ -221,10 +221,11 @@ wxSize wxCollapsiblePane::DoGetBestSize() const wxASSERT_MSG( m_widget, wxT("DoGetBestSize called before creation") ); GtkRequisition req; - req.width = 2; - req.height = 2; - (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request ) - (m_widget, &req ); +#ifdef __WXGTK3__ + gtk_widget_get_preferred_size(m_widget, NULL, &req); +#else + GTK_WIDGET_GET_CLASS(m_widget)->size_request(m_widget, &req); +#endif // notice that we do not cache our best size here as it changes // all times the user expands/hide our pane @@ -281,8 +282,8 @@ void wxCollapsiblePane::OnSize(wxSizeEvent &ev) GdkWindow *wxCollapsiblePane::GTKGetWindow(wxArrayGdkWindows& windows) const { GtkWidget *label = gtk_expander_get_label_widget( GTK_EXPANDER(m_widget) ); - windows.Add( label->window ); - windows.Add( m_widget->window ); + windows.Add(gtk_widget_get_window(label)); + windows.Add(gtk_widget_get_window(m_widget)); return NULL; }