- int currentX = 5;
-
- toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
- currentX += width + 5;
- toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file");
-
- wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO);
- combo->Append("This");
- combo->Append("is a");
- combo->Append("combobox");
- combo->Append("in a");
- combo->Append("toolbar");
- toolBar->AddControl(combo);
-
- if ( !smallicons )
- {
- currentX += width + 5;
- toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1");
- currentX += width + 5;
- toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 2");
- currentX += width + 5;
- toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Toggle/Untoggle help button");
- currentX += width + 5;
- toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste");
- currentX += width + 5;
- toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Delete this tool");
- currentX += width + 5;
- toolBar->AddSeparator();
- toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Help button");
- }
-
- toolBar->Realize();
-
- // Can delete the bitmaps since they're reference counted
- int i, max = smallicons ? 2 : WXSIZEOF(toolBarBitmaps);
- for (i = 0; i < max; i++)
- delete toolBarBitmaps[i];
-
- return TRUE;
+
+ int currentX = 5;
+
+ toolBar->AddTool(wxID_NEW, toolBarBitmaps[0], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
+ currentX += width + 5;
+ toolBar->AddTool(wxID_OPEN, toolBarBitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file");
+
+ // neither the generic nor Motif native toolbars really support this
+#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && !defined(__WXX11__)
+ // adding a combo to a vertical toolbar is not very smart
+ if ( m_horzToolbar )
+ {
+ wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, "", wxDefaultPosition, wxSize(200,-1) );
+ combo->Append("This");
+ combo->Append("is a");
+ combo->Append("combobox");
+ combo->Append("in a");
+ combo->Append("toolbar");
+/*
+ wxTextCtrl *combo = new wxTextCtrl( toolBar, -1, "", wxDefaultPosition, wxSize(80,-1) );
+*/
+ toolBar->AddControl(combo);
+ }
+#endif // toolbars which don't support controls
+
+ currentX += width + 5;
+ toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1");
+ currentX += width + 5;
+ toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 2");
+ currentX += width + 5;
+ toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Toggle/Untoggle help button");
+ currentX += width + 5;
+ toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste");
+ currentX += width + 5;
+ toolBar->AddTool(wxID_PRINT, toolBarBitmaps[6], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Delete this tool");
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(wxID_HELP, toolBarBitmaps[7], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Help button");
+
+ // after adding the buttons to the toolbar, must call Realize() to reflect
+ // the changes
+ toolBar->Realize();
+
+ toolBar->SetRows(m_horzToolbar ? m_rows : 10 / m_rows);