]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toolbar.cpp
Add wxAnyScrollHelperBase to reduce code duplication in wxVarScrollHelperBase.
[wxWidgets.git] / src / gtk / toolbar.cpp
index 6f4aa4c6e9f8663b196ef6bfba6b8fd32547f392..f19f11d5b26b51dda716ac54e316d4638d9c47f2 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     GTK toolbar
 // Author:      Robert Roebling
 // Modified:    13.12.99 by VZ to derive from wxToolBarBase
-// RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -271,18 +270,15 @@ void wxToolBarTool::SetImage()
 void wxToolBarTool::CreateDropDown()
 {
     gtk_tool_item_set_homogeneous(m_item, false);
-    GtkWidget* box;
-    GtkWidget* arrow;
+    GtkOrientation orient = GTK_ORIENTATION_HORIZONTAL;
+    GtkArrowType arrowType = GTK_ARROW_DOWN;
     if (GetToolBar()->HasFlag(wxTB_LEFT | wxTB_RIGHT))
     {
-        box = gtk_vbox_new(false, 0);
-        arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
-    }
-    else
-    {
-        box = gtk_hbox_new(false, 0);
-        arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+        orient = GTK_ORIENTATION_VERTICAL;
+        arrowType = GTK_ARROW_RIGHT;
     }
+    GtkWidget* box = gtk_box_new(orient, 0);
+    GtkWidget* arrow = gtk_arrow_new(arrowType, GTK_SHADOW_NONE);
     GtkWidget* tool_button = gtk_bin_get_child(GTK_BIN(m_item));
     gtk_widget_reparent(tool_button, box);
     GtkWidget* arrow_button = gtk_toggle_button_new();
@@ -301,7 +297,7 @@ void wxToolBarTool::CreateDropDown()
 void wxToolBarTool::ShowDropdown(GtkToggleButton* button)
 {
     wxToolBarBase* toolbar = GetToolBar();
-    wxCommandEvent event(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, GetId());
+    wxCommandEvent event(wxEVT_TOOL_DROPDOWN, GetId());
     if (!toolbar->HandleWindowEvent(event))
     {
         wxMenu* menu = GetDropdownMenu();