]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/wxToolBar.py
wxHandleFatalExceptions() added, documented
[wxWidgets.git] / utils / wxPython / demo / wxToolBar.py
index d49195ba75da230b65d0517d6b1c22265e538983..e4926741b8e75f955c220ccd2ff4bcacfa17d6d3 100644 (file)
@@ -11,47 +11,49 @@ class TestToolBar(wxFrame):
 
         wxWindow(self, -1).SetBackgroundColour(wxNamedColour("WHITE"))
 
-        tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER)
+        tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER) #|wxTB_FLAT)
         #tb = wxToolBar(self, -1, wxDefaultPosition, wxDefaultSize,
         #               wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT)
         #self.SetToolBar(tb)
 
         self.CreateStatusBar()
 
-        tb.AddTool(10, wxNoRefBitmap('bitmaps/new.bmp',   wxBITMAP_TYPE_BMP),
-                        wxNullBitmap, false, -1, -1, "New", "Long help for 'New'")
+        tb.AddSimpleTool(10, wxBitmap('bitmaps/new.bmp',   wxBITMAP_TYPE_BMP),
+                         "New", "Long help for 'New'")
         EVT_TOOL(self, 10, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
 
-        tb.AddTool(20, wxNoRefBitmap('bitmaps/open.bmp',  wxBITMAP_TYPE_BMP),
-                        wxNullBitmap, false, -1, -1, "Open")
+        tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp',  wxBITMAP_TYPE_BMP), "Open")
         EVT_TOOL(self, 20, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
 
         tb.AddSeparator()
-        tb.AddTool(30, wxNoRefBitmap('bitmaps/copy.bmp',  wxBITMAP_TYPE_BMP),
-                        wxNullBitmap, false, -1, -1, "Copy")
+        tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp',  wxBITMAP_TYPE_BMP), "Copy")
         EVT_TOOL(self, 30, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
 
-        tb.AddTool(40, wxNoRefBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP),
-                        wxNullBitmap, false, -1, -1, "Paste")
+        tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP), "Paste")
         EVT_TOOL(self, 40, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
 
         tb.AddSeparator()
 
-        tb.AddTool(50, wxNoRefBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
-                        wxNullBitmap, true, -1, -1, "Toggle this")
+        tool = tb.AddTool(50, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
+                          shortHelpString="Toggle this", toggle=true)
         EVT_TOOL(self, 50, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 50, self.OnToolRClick)
 
-        tb.AddTool(60, wxNoRefBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
-                        wxNoRefBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
-                        true, -1, -1, "Toggle with 2 bitmaps")
+        tb.AddTool(60, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
+                   wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
+                   shortHelpString="Toggle with 2 bitmaps", toggle=true)
         EVT_TOOL(self, 60, self.OnToolClick)
         EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick)
 
+
+        tb.AddSeparator()
+        tb.AddControl(wxComboBox(tb, -1, "", choices=["", "This", "is a", "wxComboBox"],
+                                 size=(150,-1), style=wxCB_DROPDOWN))
+
         tb.Realize()