From b529726eff2a0a7e444ff14a8cf46239a346fae3 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 12 Dec 2006 21:44:51 +0000 Subject: [PATCH] Add a few more controls to the toolbar. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/toolbar/toolbar.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 4f983764ec..513f5bc9ad 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -32,6 +32,8 @@ #include "wx/log.h" #include "wx/image.h" #include "wx/filedlg.h" +#include "wx/spinctrl.h" +#include "wx/srchctrl.h" // define this to use XPMs everywhere (by default, BMPs are used under Win) // BMPs use less space, but aren't compiled into the executable on other platforms @@ -391,7 +393,7 @@ void MyFrame::RecreateToolbar() // adding a combo to a vertical toolbar is not very smart if ( !( toolBar->IsVertical() ) ) { - wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(200,wxDefaultCoord) ); + wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1) ); combo->Append(_T("This")); combo->Append(_T("is a")); combo->Append(_T("combobox")); @@ -399,8 +401,14 @@ void MyFrame::RecreateToolbar() combo->Append(_T("toolbar")); toolBar->AddControl(combo); - //wxSpinCtrl *spin = new wxSpinCtrl( toolBar, ID_SPIN, wxT("0"), wxDefaultPosition, wxSize(80,wxDefaultCoord), 0, 100, 0 ); - //toolBar->AddControl( spin ); + wxSpinCtrl *spin = new wxSpinCtrl( toolBar, ID_SPIN, wxT("0"), wxDefaultPosition, wxSize(80,wxDefaultCoord), 0, 0, 100 ); + toolBar->AddControl( spin ); + + wxTextCtrl *text = new wxTextCtrl( toolBar, -1, wxT("text"), wxDefaultPosition, wxSize(80,wxDefaultCoord) ); + toolBar->AddControl( text ); + + wxSearchCtrl *srch = new wxSearchCtrl( toolBar, -1, wxT("xx"), wxDefaultPosition, wxSize(80,wxDefaultCoord), wxSUNKEN_BORDER ); + toolBar->AddControl( srch ); } #endif // toolbars which don't support controls -- 2.47.2