]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/toolbar/toolbar.cpp
Changes for wxOGL since wxFatalError has been deprecated.
[wxWidgets.git] / samples / toolbar / toolbar.cpp
index df5e434c44f07e50842f004552b0a3c7e63abdc6..8ec29ca590e3830844b5a1ec8d672ce26e531133 100644 (file)
@@ -18,7 +18,7 @@
 // ----------------------------------------------------------------------------
 
 // For compilers that support precompilation, includes "wx/wx.h".
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
     #pragma hdrstop
@@ -31,6 +31,7 @@
 #include <wx/toolbar.h>
 #include <wx/log.h>
 #include <wx/image.h>
+#include <wx/spinctrl.h>
 
 // define this to 1 to use wxToolBarSimple instead of the native one
 #define USE_GENERIC_TBAR 0
@@ -151,6 +152,8 @@ private:
 
 const int ID_TOOLBAR = 500;
 
+static const long TOOLBAR_STYLE = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE;
+
 enum
 {
     IDM_TOOLBAR_TOGGLETOOLBARSIZE = 200,
@@ -239,7 +242,7 @@ void MyFrame::RecreateToolbar()
 
     SetToolBar(NULL);
 
-    long style = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE;
+    long style = TOOLBAR_STYLE;
     style |= m_horzToolbar ? wxTB_HORIZONTAL : wxTB_VERTICAL;
 
     toolBar = CreateToolBar(style, ID_TOOLBAR);
@@ -298,12 +301,15 @@ void MyFrame::RecreateToolbar()
     // adding a combo to a vertical toolbar is not very smart
     if ( m_horzToolbar )
     {
-        wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO);
+        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
@@ -461,7 +467,7 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event))
     {
         m_tbar = new wxToolBar(this, -1,
                                wxDefaultPosition, wxDefaultSize,
-                               wxTB_VERTICAL);
+                               TOOLBAR_STYLE | wxTB_VERTICAL);
         m_tbar->AddTool(wxID_HELP, wxBITMAP(help),
                         wxNullBitmap, FALSE,
                         NULL,
@@ -600,8 +606,6 @@ void MyFrame::OnToolEnter(wxCommandEvent& event)
 
 void MyFrame::OnToggleFullScreen(wxCommandEvent& event)
 {
-#ifdef __WXMSW__
     ShowFullScreen(!IsFullScreen());
-#endif
 }