X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a1b3ead3fd406e870042014eb7bd117586f4fff..249803fbcd1f73040e4b5457e341d8db2e5cb66e:/src/gtk/tbargtk.cpp?ds=sidebyside diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index e56eba64a1..cd573461e5 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -19,10 +19,10 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/toolbar.h" - #if wxUSE_TOOLBAR_NATIVE +#include "wx/toolbar.h" + #ifndef WX_PRECOMP #include "wx/frame.h" #endif @@ -204,7 +204,7 @@ static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget), GdkEventCrossing *gdk_event, wxToolBarTool *tool ) { - if (g_isIdle) wxapp_install_idle_handler(); + // don't need to install idle handler, its done from "event" signal if (g_blockEventsOnDrag) return TRUE; @@ -317,7 +317,6 @@ bool wxToolBar::Create( wxWindow *parent, ConnectWidget( m_widget ); gtk_widget_show(GTK_WIDGET(m_toolbar)); } - gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), !(style & wxTB_NO_TOOLTIPS) ); // FIXME: there is no such function for toolbars in 2.0 #if 0 @@ -340,21 +339,13 @@ void wxToolBar::GtkSetStyle() gtk_toolbar_set_orientation(m_toolbar, orient); gtk_toolbar_set_style(m_toolbar, style); + gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), !(style & wxTB_NO_TOOLTIPS) ); } void wxToolBar::SetWindowStyleFlag( long style ) { wxToolBarBase::SetWindowStyleFlag(style); - if( style & wxTB_TOOLTIPS ) - { - if( m_toolbar ) - gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE ); - } - else - { - if( m_toolbar ) - gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), FALSE ); - } + if ( m_toolbar ) GtkSetStyle(); } @@ -374,7 +365,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) wxCHECK_MSG( bitmap.Ok(), false, wxT("invalid bitmap for wxToolBar icon") ); - wxCHECK_MSG( bitmap.GetBitmap() == NULL, false, + wxCHECK_MSG( bitmap.GetDepth() != 1, false, wxT("wxToolBar doesn't support GdkBitmap") ); wxCHECK_MSG( bitmap.GetPixmap() != NULL, false, @@ -615,6 +606,9 @@ void wxToolBar::SetToolShortHelp( int id, const wxString& helpString ) void wxToolBar::OnInternalIdle() { + // Check if we have to show window now + if (GtkShowFromOnIdle()) return; + wxCursor cursor = m_cursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;