// private functions
// ----------------------------------------------------------------------------
-// translate wxWindows toolbar style flags to GTK orientation and style
+// translate wxWidgets toolbar style flags to GTK orientation and style
static void GetGtkStyle(long style,
GtkOrientation *orient, GtkToolbarStyle *gtkStyle)
{
}
}
- tbar->OnLeftClick( tool->GetId(), tool->IsToggled() );
+ if( !tbar->OnLeftClick( tool->GetId(), tool->IsToggled() ) && tool->CanBeToggled() )
+ {
+ // revert back
+ tool->Toggle();
+
+ wxBitmap bitmap = tool->GetBitmap();
+ if ( bitmap.Ok() )
+ {
+ GtkPixmap *pixmap = GTK_PIXMAP( tool->m_pixmap );
+
+ GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap()
+ : (GdkBitmap *)NULL;
+
+ gtk_pixmap_set( pixmap, bitmap.GetPixmap(), mask );
+ }
+ }
}
//-----------------------------------------------------------------------------
m_parent->DoAddChild( this );
- PostCreation();
-
- Show( TRUE );
+ PostCreation(size);
return TRUE;
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
+
+// ----------------------------------------------------------------------------
+
+// static
+wxVisualAttributes
+wxToolBar::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+#ifdef __WXGTK20__
+ return GetDefaultAttributesFromGTKWidget(gtk_toolbar_new);
+#else
+ wxVisualAttributes attr;
+ GtkWidget* widget = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
+ attr = GetDefaultAttributesFromGTKWidget(widget);
+ gtk_widget_destroy(widget);
+ return attr;
+#endif
+}
+
#endif // wxUSE_TOOLBAR_NATIVE