From 8520f1374ceec64abae3802984c4f8654d8836ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 19 Jul 2004 15:36:01 +0000 Subject: [PATCH] Fixes for wxUSE_STATUSBAR. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28310 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/caret/caret.cpp | 5 +++- samples/checklst/checklst.cpp | 2 ++ samples/config/conftest.cpp | 2 ++ samples/dialup/nettest.cpp | 6 +++++ samples/display/display.cpp | 4 +++ samples/dnd/dnd.cpp | 43 +++++++++++++++++++++++++++--- samples/dragimag/dragimag.cpp | 2 ++ samples/event/event.cpp | 8 ++++++ samples/font/font.cpp | 2 ++ samples/help/demo.cpp | 2 ++ samples/htlbox/htlbox.cpp | 6 +++++ samples/html/printing/printing.cpp | 4 +++ samples/html/test/test.cpp | 4 +++ samples/html/virtual/virtual.cpp | 4 +++ samples/html/widget/widget.cpp | 4 +++ samples/html/zip/zip.cpp | 6 +++-- samples/image/image.cpp | 2 ++ samples/ipc/server.cpp | 2 ++ samples/joytest/joytest.cpp | 8 +++--- samples/layout/layout.cpp | 3 ++- samples/listctrl/listtest.cpp | 2 ++ samples/mdi/mdi.cpp | 4 +++ samples/mobile/styles/styles.cpp | 2 ++ samples/mobile/wxedit/wxedit.cpp | 18 ++++++++++--- samples/nativdlg/nativdlg.cpp | 2 ++ samples/oleauto/oleauto.cpp | 2 ++ samples/ownerdrw/ownerdrw.cpp | 10 +++++++ samples/png/pngdemo.cpp | 4 +++ samples/printing/printing.cpp | 4 +++ samples/regtest/regtest.cpp | 6 +++++ samples/sashtest/sashtest.cpp | 4 +++ samples/scroll/scroll.cpp | 2 ++ samples/scrollsub/scrollsub.cpp | 2 ++ samples/sockets/client.cpp | 4 +++ samples/sockets/server.cpp | 4 +++ samples/splitter/splitter.cpp | 16 +++++++++++ samples/text/text.cpp | 8 ++++++ samples/thread/thread.cpp | 12 +++++++++ samples/toolbar/toolbar.cpp | 10 ++++--- samples/validate/validate.cpp | 2 ++ samples/vscroll/vstest.cpp | 2 ++ 41 files changed, 220 insertions(+), 19 deletions(-) diff --git a/samples/caret/caret.cpp b/samples/caret/caret.cpp index 2908746b32..e075f5a4bf 100644 --- a/samples/caret/caret.cpp +++ b/samples/caret/caret.cpp @@ -225,9 +225,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) m_canvas = new MyCanvas(this); +#if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText(_T("Welcome to wxWidgets!")); +#endif // wxUSE_STATUSBAR } @@ -385,15 +387,16 @@ void MyCanvas::ChangeSize() free(m_text); m_text = (wxChar *)calloc(m_xChars * m_yChars, sizeof(wxChar)); +#if wxUSE_STATUSBAR wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame && frame->GetStatusBar() ) { wxString msg; msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars); - frame->SetStatusText(msg, 1); } +#endif // wxUSE_STATUSBAR } // NB: this method is horrible inefficient especially because the caret diff --git a/samples/checklst/checklst.cpp b/samples/checklst/checklst.cpp index bd844baa04..6b584352fb 100644 --- a/samples/checklst/checklst.cpp +++ b/samples/checklst/checklst.cpp @@ -138,11 +138,13 @@ CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame, int x, int y, int w, int h) : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { +#if wxUSE_STATUSBAR // create the status line const int widths[] = { -1, 60 }; CreateStatusBar(2); SetStatusWidths(2, widths); wxLogStatus(this, _T("no selection")); +#endif // wxUSE_STATUSBAR // Make a menubar // -------------- diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index 40fd36a672..ba142b25b8 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -159,7 +159,9 @@ MyFrame::MyFrame() menu_bar->Append(file_menu, _T("&File")); SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR // child controls wxPanel *panel = new wxPanel(this); diff --git a/samples/dialup/nettest.cpp b/samples/dialup/nettest.cpp index 9e85641a9c..775527ec30 100644 --- a/samples/dialup/nettest.cpp +++ b/samples/dialup/nettest.cpp @@ -178,7 +178,9 @@ bool MyApp::OnInit() return false; } +#if wxUSE_STATUSBAR frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2); +#endif // wxUSE_STATUSBAR return true; } @@ -238,10 +240,12 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR // create status bar and fill the LAN field CreateStatusBar(3); static const int widths[3] = { -1, 100, 60 }; SetStatusWidths(3, widths); +#endif // wxUSE_STATUSBAR } @@ -335,6 +339,8 @@ void MyFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) { s_isOnline = isOnline; +#if wxUSE_STATUSBAR SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1); +#endif // wxUSE_STATUSBAR } } diff --git a/samples/display/display.cpp b/samples/display/display.cpp index 22a94cf0b6..2a0b0bc082 100644 --- a/samples/display/display.cpp +++ b/samples/display/display.cpp @@ -220,8 +220,10 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, SetMenuBar(menuBar); #endif // wxUSE_MENUS +#if wxUSE_STATUSBAR // create status bar CreateStatusBar(); +#endif // wxUSE_STATUSBAR // create child controls @@ -336,7 +338,9 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event)) { +#if wxUSE_STATUSBAR SetStatusText(_T("Press the mouse anywhere...")); +#endif // wxUSE_STATUSBAR CaptureMouse(); } diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 203fe37303..fe72a36dcb 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -742,9 +742,18 @@ public: // override base class (pure) virtuals virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def) - { m_frame->SetStatusText(_T("Mouse entered the frame")); return OnDragOver(x, y, def); } + { +#if wxUSE_STATUSBAR + m_frame->SetStatusText(_T("Mouse entered the frame")); +#endif // wxUSE_STATUSBAR + return OnDragOver(x, y, def); + } virtual void OnLeave() - { m_frame->SetStatusText(_T("Mouse left the frame")); } + { +#if wxUSE_STATUSBAR + m_frame->SetStatusText(_T("Mouse left the frame")); +#endif // wxUSE_STATUSBAR + } virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) { if ( !GetData() ) @@ -919,7 +928,9 @@ DnDFrame::DnDFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h) // frame icon and status bar SetIcon(wxICON(mondrian)); +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR // construct menu wxMenu *file_menu = new wxMenu; @@ -1155,8 +1166,11 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) ) else if ( m_moveAllow ) flags |= wxDrag_AllowMove; + wxDragResult result = source.DoDragDrop(flags); + +#if wxUSE_STATUSBAR const wxChar *pc; - switch ( source.DoDragDrop(flags) ) + switch ( result ) { case wxDragError: pc = _T("Error!"); break; case wxDragNone: pc = _T("Nothing"); break; @@ -1167,6 +1181,9 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) ) } SetStatusText(wxString(_T("Drag result: ")) + pc); +#else + wxUnusedVar(result); +#endif // wxUSE_STATUSBAR } #endif // wxUSE_DRAG_AND_DROP } @@ -1625,7 +1642,9 @@ DnDShapeFrame::DnDShapeFrame(wxFrame *parent) : wxFrame(parent, wxID_ANY, _T("Shape Frame"), wxDefaultPosition, wxSize(250, 150)) { +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR wxMenu *menuShape = new wxMenu; menuShape->Append(Menu_Shape_New, _T("&New default shape\tCtrl-S")); @@ -1643,7 +1662,9 @@ DnDShapeFrame::DnDShapeFrame(wxFrame *parent) SetMenuBar(menubar); +#if wxUSE_STATUSBAR SetStatusText(_T("Press Ctrl-S to create a new shape")); +#endif // wxUSE_STATUSBAR SetDropTarget(new DnDShapeDropTarget(this)); @@ -1689,7 +1710,9 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; case wxDragNone: +#if wxUSE_STATUSBAR SetStatusText(_T("Nothing happened")); +#endif // wxUSE_STATUSBAR break; case wxDragCopy: @@ -1706,13 +1729,17 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; case wxDragCancel: +#if wxUSE_STATUSBAR SetStatusText(_T("Drag and drop operation cancelled")); +#endif // wxUSE_STATUSBAR break; } if ( pc ) { +#if wxUSE_STATUSBAR SetStatusText(wxString(_T("Shape successfully ")) + pc); +#endif // wxUSE_STATUSBAR } //else: status text already set } @@ -1723,9 +1750,11 @@ void DnDShapeFrame::OnDrop(wxCoord x, wxCoord y, DnDShape *shape) wxPoint pt(x, y); +#if wxUSE_STATUSBAR wxString s; s.Printf(wxT("Shape dropped at (%d, %d)"), pt.x, pt.y); SetStatusText(s); +#endif // wxUSE_STATUSBAR shape->Move(pt); SetShape(shape); @@ -1738,10 +1767,12 @@ void DnDShapeFrame::OnEditShape(wxCommandEvent& WXUNUSED(event)) { SetShape(dlg.GetShape()); +#if wxUSE_STATUSBAR if ( m_shape ) { SetStatusText(_T("You can now drag the shape to another frame")); } +#endif // wxUSE_STATUSBAR } } @@ -1749,7 +1780,9 @@ void DnDShapeFrame::OnNewShape(wxCommandEvent& WXUNUSED(event)) { SetShape(new DnDEllipticShape(wxPoint(10, 10), wxSize(80, 60), *wxRED)); +#if wxUSE_STATUSBAR SetStatusText(_T("You can now drag the shape to another frame")); +#endif // wxUSE_STATUSBAR } void DnDShapeFrame::OnClearShape(wxCommandEvent& WXUNUSED(event)) @@ -1902,13 +1935,17 @@ void DnDShapeDataObject::CreateBitmap() const static void ShowBitmap(const wxBitmap& bitmap) { wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Bitmap view")); +#if wxUSE_STATUSBAR frame->CreateStatusBar(); +#endif // wxUSE_STATUSBAR DnDCanvasBitmap *canvas = new DnDCanvasBitmap(frame); canvas->SetBitmap(bitmap); int w = bitmap.GetWidth(), h = bitmap.GetHeight(); +#if wxUSE_STATUSBAR frame->SetStatusText(wxString::Format(_T("%dx%d"), w, h)); +#endif // wxUSE_STATUSBAR frame->SetClientSize(w > 100 ? 100 : w, h > 100 ? 100 : h); frame->Show(true); diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index 1141186f1a..031940c99f 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -341,9 +341,11 @@ MyFrame::MyFrame() SetIcon(wxICON(mondrian)); SetMenuBar( menu_bar ); +#if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); +#endif // wxUSE_STATUSBAR m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) ); } diff --git a/samples/event/event.cpp b/samples/event/event.cpp index 8994d0a138..5b21599ec9 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -323,15 +323,19 @@ void MyFrame::OnConnect(wxCommandEvent& event) (wxEventFunction) (wxCommandEventFunction)&MyFrame::OnDynamic); +#if wxUSE_STATUSBAR SetStatusText(_T("You can now use \"Dynamic\" item in the menu")); SetStatusText(_T("Dynamic: on"), Status_Dynamic); +#endif // wxUSE_STATUSBAR } else // connect { Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED); +#if wxUSE_STATUSBAR SetStatusText(_T("You can no more use \"Dynamic\" item in the menu")); SetStatusText(_T("Dynamic: off"), Status_Dynamic); +#endif // wxUSE_STATUSBAR } } @@ -343,7 +347,9 @@ void MyFrame::OnPushEventHandler(wxCommandEvent& WXUNUSED(event)) { PushEventHandler(new MyEvtHandler(++m_nPush)); +#if wxUSE_STATUSBAR SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); +#endif // wxUSE_STATUSBAR } void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event)) @@ -353,7 +359,9 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event)) PopEventHandler(true /* delete handler */); m_nPush--; +#if wxUSE_STATUSBAR SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); +#endif // wxUSE_STATUSBAR } void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/font/font.cpp b/samples/font/font.cpp index a2d13fa08d..c11dfa7370 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -293,9 +293,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) splitter->SplitHorizontally(m_textctrl, m_canvas, 100); +#if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(); SetStatusText(wxT("Welcome to wxWidgets font demo!")); +#endif // wxUSE_STATUSBAR } // -------------------------------------------------------- diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index d0dc6d9471..2256106012 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -425,9 +425,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(); SetStatusText(_T("Welcome to wxWidgets!")); +#endif // wxUSE_STATUSBAR // now create some controls diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index aa0f22e7f6..93b6d26f58 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -335,7 +335,9 @@ void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) m_hlbox->SetBackgroundColour(col); m_hlbox->Refresh(); +#if wxUSE_STATUSBAR SetStatusText(_T("Background colour changed.")); +#endif // wxUSE_STATUSBAR } } @@ -347,7 +349,9 @@ void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event)) m_hlbox->SetSelectionBackground(col); m_hlbox->Refresh(); +#if wxUSE_STATUSBAR SetStatusText(_T("Selection background colour changed.")); +#endif // wxUSE_STATUSBAR } } @@ -387,10 +391,12 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event) wxLogMessage(_T("Selected items: %s"), s.c_str()); } +#if wxUSE_STATUSBAR SetStatusText(wxString::Format( _T("# items selected = %lu"), (unsigned long)m_hlbox->GetSelectedCount() )); +#endif // wxUSE_STATUSBAR } // ============================================================================ diff --git a/samples/html/printing/printing.cpp b/samples/html/printing/printing.cpp index 90497c7de8..7d3f11bf00 100644 --- a/samples/html/printing/printing.cpp +++ b/samples/html/printing/printing.cpp @@ -189,11 +189,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR CreateStatusBar(1); +#endif // wxUSE_STATUSBAR m_Html = new wxHtmlWindow(this); m_Html -> SetRelatedFrame(this, _("HTML : %s")); +#if wxUSE_STATUSBAR m_Html -> SetRelatedStatusBar(0); +#endif // wxUSE_STATUSBAR m_Name = wxT("test.htm"); m_Html -> LoadPage(m_Name); diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index d514ddc7ba..50e10402e4 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -184,13 +184,17 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) SetAcceleratorTable(accel); #endif // wxUSE_ACCEL +#if wxUSE_STATUSBAR CreateStatusBar(1); +#endif // wxUSE_STATUSBAR m_Processor = new BoldProcessor; m_Processor->Enable(false); m_Html = new wxHtmlWindow(this); m_Html->SetRelatedFrame(this, _("HTML : %s")); +#if wxUSE_STATUSBAR m_Html->SetRelatedStatusBar(0); +#endif // wxUSE_STATUSBAR m_Html->ReadCustomization(wxConfig::Get()); m_Html->LoadFile(wxFileName(wxT("test.htm"))); m_Html->AddProcessor(m_Processor); diff --git a/samples/html/virtual/virtual.cpp b/samples/html/virtual/virtual.cpp index 75d9193dfb..0260ba5514 100644 --- a/samples/html/virtual/virtual.cpp +++ b/samples/html/virtual/virtual.cpp @@ -202,11 +202,15 @@ wxHtmlWindow *html; // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR html = new wxHtmlWindow(this); html -> SetRelatedFrame(this, _("VFS Demo: '%s'")); +#if wxUSE_STATUSBAR html -> SetRelatedStatusBar(1); +#endif // wxUSE_STATUSBAR html -> LoadPage(wxT("start.htm")); } diff --git a/samples/html/widget/widget.cpp b/samples/html/widget/widget.cpp index 816c029b7b..667d7705aa 100644 --- a/samples/html/widget/widget.cpp +++ b/samples/html/widget/widget.cpp @@ -193,11 +193,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR html = new wxHtmlWindow(this); html -> SetRelatedFrame(this, _("VFS Demo: '%s'")); +#if wxUSE_STATUSBAR html -> SetRelatedStatusBar(1); +#endif // wxUSE_STATUSBAR html -> LoadPage(wxT("start.htm")); } diff --git a/samples/html/zip/zip.cpp b/samples/html/zip/zip.cpp index f33295c215..ad3b9b2478 100644 --- a/samples/html/zip/zip.cpp +++ b/samples/html/zip/zip.cpp @@ -153,14 +153,16 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR CreateStatusBar(1); +#endif // wxUSE_STATUSBAR - { html = new wxHtmlWindow(this); html -> SetRelatedFrame(this, _("HTML : %s")); +#if wxUSE_STATUSBAR html -> SetRelatedStatusBar(0); +#endif // wxUSE_STATUSBAR html -> LoadPage(wxT("start.htm")); - } } diff --git a/samples/image/image.cpp b/samples/image/image.cpp index dd69ad6a45..9c3108725f 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -880,9 +880,11 @@ MyFrame::MyFrame() SetMenuBar( menu_bar ); +#if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); +#endif // wxUSE_STATUSBAR m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) ); diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 44401f9718..0ea33ed6bf 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -100,7 +100,9 @@ int MyApp::OnExit() MyFrame::MyFrame(wxFrame *frame, const wxString& title) : wxFrame(frame, wxID_ANY, title, wxDefaultPosition, wxSize(350, 250)) { +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR // Give it an icon SetIcon(wxICON(mondrian)); diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 3e99d23496..924103bf01 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -24,10 +24,6 @@ # error You must set wxUSE_JOYSTICK to 1 in setup.h #endif -#if !wxUSE_STATUSBAR -# error You must set wxUSE_STATUSBAR to 1 in setup.h -#endif - #include "wx/sound.h" #include "wx/joystick.h" @@ -87,7 +83,9 @@ bool MyApp::OnInit() // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR frame->CreateStatusBar(); +#endif // wxUSE_STATUSBAR frame->CenterOnScreen(); frame->Show(true); @@ -151,6 +149,7 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) xpos = pt.x; ypos = pt.y; +#if wxUSE_STATUSBAR wxString buf; if (event.ButtonDown()) buf.Printf(_T("Joystick (%d, %d) Fire!"), pt.x, pt.y); @@ -158,6 +157,7 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) buf.Printf(_T("Joystick (%d, %d)"), pt.x, pt.y); frame->SetStatusText(buf); +#endif // wxUSE_STATUSBAR #if wxUSE_SOUND if (event.ButtonDown() && wxGetApp().m_fire.IsOk()) diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 5a7e7a8c59..1ee69f89e5 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -91,9 +91,10 @@ MyFrame::MyFrame() // Associate the menu bar with the frame SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR CreateStatusBar(2); SetStatusText(_T("wxWidgets layout demo")); - +#endif // wxUSE_STATUSBAR // we want to get a dialog that is stretchable because it // has a text ctrl in the middle. at the bottom, we have diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index f7c3851ba4..b440b9eaf7 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -238,7 +238,9 @@ MyFrame::MyFrame(const wxChar *title, int x, int y, int w, int h) RecreateList(wxLC_REPORT | wxLC_SINGLE_SEL); +#if wxUSE_STATUSBAR CreateStatusBar(3); +#endif // wxUSE_STATUSBAR } MyFrame::~MyFrame() diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index f8b7b47e74..33582119bc 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -145,7 +145,9 @@ bool MyApp::OnInit() // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR frame->CreateStatusBar(); +#endif // wxUSE_STATUSBAR frame->Show(true); @@ -260,8 +262,10 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR subframe->CreateStatusBar(); subframe->SetStatusText(title); +#endif // wxUSE_STATUSBAR int width, height; subframe->GetClientSize(&width, &height); diff --git a/samples/mobile/styles/styles.cpp b/samples/mobile/styles/styles.cpp index 14bc753390..55d194a95c 100644 --- a/samples/mobile/styles/styles.cpp +++ b/samples/mobile/styles/styles.cpp @@ -37,8 +37,10 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, { // Create menu and status bar. CreateMyMenuBar(); +#if wxUSE_STATUSBAR CreateStatusBar(1); SetStatusText( _T("Welcome to Styles!") ); +#endif // wxUSE_STATUSBAR wxImage image; image.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG ); diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index fa4a2d3ee3..53d6b6f710 100644 --- a/samples/mobile/wxedit/wxedit.cpp +++ b/samples/mobile/wxedit/wxedit.cpp @@ -58,8 +58,10 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, { // Create menu and status bar. CreateMyMenuBar(); +#if wxUSE_STATUSBAR CreateStatusBar(1); SetStatusText( _T("Welcome to wxEdit!") ); +#endif // wxUSE_STATUSBAR // Create edit control. Since it is the only // control in the frame, it will be resized @@ -179,12 +181,14 @@ void MyFrame::OnLastFiles( wxCommandEvent &event ) if( index < m_history.GetCount() ) { - m_filename = m_history[index]; + m_filename = m_history[index]; - m_text->Clear(); - m_text->LoadFile( m_filename ); + m_text->Clear(); + m_text->LoadFile( m_filename ); - SetStatusText( m_filename ); +#if wxUSE_STATUSBAR + SetStatusText( m_filename ); +#endif // wxUSE_STATUSBAR } else { @@ -208,7 +212,9 @@ void MyFrame::OnNew( wxCommandEvent& WXUNUSED(event) ) m_filename = wxEmptyString; +#if wxUSE_STATUSBAR SetStatusText( _T("") ); +#endif // wxUSE_STATUSBAR } void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) @@ -252,7 +258,9 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) m_filename = dialog.GetPath(); m_text->LoadFile( m_filename ); +#if wxUSE_STATUSBAR SetStatusText( m_filename ); +#endif // wxUSE_STATUSBAR } } @@ -271,7 +279,9 @@ void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) ) m_filename = dialog.GetPath(); m_text->SaveFile( m_filename ); +#if wxUSE_STATUSBAR SetStatusText( m_filename ); +#endif // wxUSE_STATUSBAR } } diff --git a/samples/nativdlg/nativdlg.cpp b/samples/nativdlg/nativdlg.cpp index 2028fb17d2..3bb9a21494 100644 --- a/samples/nativdlg/nativdlg.cpp +++ b/samples/nativdlg/nativdlg.cpp @@ -44,8 +44,10 @@ bool MyApp::OnInit(void) // Create the main frame window MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250)); +#if wxUSE_STATUSBAR // Give it a status line frame->CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Make a menubar wxMenu *file_menu = new wxMenu; diff --git a/samples/oleauto/oleauto.cpp b/samples/oleauto/oleauto.cpp index 1d851b9f64..a4de77a6a2 100644 --- a/samples/oleauto/oleauto.cpp +++ b/samples/oleauto/oleauto.cpp @@ -170,9 +170,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText(_T("Welcome to wxWidgets!")); +#endif // wxUSE_STATUSBAR } diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index c0e47b4b8b..cfaadcc756 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -212,11 +212,13 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title, // create the menu InitMenu(); +#if wxUSE_STATUSBAR // create the status line const int widths[] = { -1, 60 }; CreateStatusBar(2); SetStatusWidths(2, widths); SetStatusText(_T("no selection"), 0); +#endif // wxUSE_STATUSBAR // make a panel with some controls wxPanel *pPanel = new wxPanel(this); @@ -332,11 +334,15 @@ void OwnerDrawnFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event) { +#if wxUSE_STATUSBAR wxString strSelection; unsigned int nSel = event.GetSelection(); strSelection.Printf(wxT("item %d selected (%schecked)"), nSel, m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not ")); SetStatusText(strSelection); +#else + wxUnusedVar(event); +#endif // wxUSE_STATUSBAR } void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& WXUNUSED(event)) @@ -350,9 +356,13 @@ void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& WXUNUSED(event)) void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event) { +#if wxUSE_STATUSBAR wxString strSelection; unsigned int nItem = event.GetInt(); strSelection.Printf(wxT("item %d was %schecked"), nItem, m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un")); SetStatusText(strSelection); +#else + wxUnusedVar(event); +#endif // wxUSE_STATUSBAR } diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp index 7bbd13e473..7d1c3a47d3 100644 --- a/samples/png/pngdemo.cpp +++ b/samples/png/pngdemo.cpp @@ -40,8 +40,10 @@ bool MyApp::OnInit(void) // Create the main frame window frame = new MyFrame((wxFrame *) NULL, _T("wxPNGBitmap Demo"), wxPoint(0, 0), wxSize(300, 300)); +#if wxUSE_STATUSBAR // Give it a status line frame->CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Make a menubar wxMenu *file_menu = new wxMenu; @@ -68,7 +70,9 @@ bool MyApp::OnInit(void) frame->Show(true); +#if wxUSE_STATUSBAR frame->SetStatusText(_T("Hello, wxWidgets")); +#endif // wxUSE_STATUSBAR return true; } diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index 8cc579cb29..95d65c86d3 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -82,8 +82,10 @@ bool MyApp::OnInit(void) // Create the main frame window frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Printing Demo"), wxPoint(0, 0), wxSize(400, 400)); +#if wxUSE_STATUSBAR // Give it a status line frame->CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Load icon and bitmap frame->SetIcon( wxICON( mondrian) ); @@ -135,7 +137,9 @@ bool MyApp::OnInit(void) frame->Centre(wxBOTH); frame->Show(); +#if wxUSE_STATUSBAR frame->SetStatusText(_T("Printing demo")); +#endif // wxUSE_STATUSBAR SetTopWindow(frame); diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index b3e3367cbf..4cca25f55d 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -361,9 +361,11 @@ RegFrame::RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h) m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree); #endif +#if wxUSE_STATUSBAR // create the status line // ---------------------- CreateStatusBar(2); +#endif // wxUSE_STATUSBAR } RegFrame::~RegFrame() @@ -697,8 +699,12 @@ void RegTreeCtrl::OnChar(wxKeyEvent& event) void RegTreeCtrl::OnSelChanged(wxTreeEvent& event) { +#if wxUSE_STATUSBAR wxFrame *pFrame = (wxFrame *) wxWindow::GetParent(); pFrame->SetStatusText(GetNode(event)->FullName(), 1); +#else + wxUnusedVar(event); +#endif // wxUSE_STATUSBAR } void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event) diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index 560a5ebc90..7db36a819a 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -70,7 +70,9 @@ bool MyApp::OnInit(void) // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR frame->CreateStatusBar(); +#endif // wxUSE_STATUSBAR frame->Show(true); @@ -228,8 +230,10 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) subframe->SetIcon(wxIcon(_T("sashtest_icn"))); #endif +#if wxUSE_STATUSBAR // Give it a status line subframe->CreateStatusBar(); +#endif // wxUSE_STATUSBAR // Make a menubar wxMenu *file_menu = new wxMenu; diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index f0725ee57d..5484c73dac 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -453,9 +453,11 @@ MyFrame::MyFrame() SetMenuBar( menu_bar ); +#if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); +#endif // wxUSE_STATUSBAR wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); diff --git a/samples/scrollsub/scrollsub.cpp b/samples/scrollsub/scrollsub.cpp index fc9864f45c..6ea28ffcec 100644 --- a/samples/scrollsub/scrollsub.cpp +++ b/samples/scrollsub/scrollsub.cpp @@ -391,9 +391,11 @@ MyFrame::MyFrame() SetMenuBar( menu_bar ); +#if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); +#endif // wxUSE_STATUSBAR m_scrolled = new MyScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize(100,100) ); m_scrolled->SetScrollbars( 10, 10, 50, 50 ); diff --git a/samples/sockets/client.cpp b/samples/sockets/client.cpp index 9ca5518df8..805ff140fb 100644 --- a/samples/sockets/client.cpp +++ b/samples/sockets/client.cpp @@ -205,8 +205,10 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, m_menuBar->Append(m_menuProtocols, _("&Protocols")); SetMenuBar(m_menuBar); +#if wxUSE_STATUSBAR // Status bar CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Make a textctrl for logging m_text = new wxTextCtrl(this, wxID_ANY, @@ -622,7 +624,9 @@ void MyFrame::UpdateStatusBar() s.Printf(_("%s : %d"), (addr.Hostname()).c_str(), addr.Service()); } +#if wxUSE_STATUSBAR SetStatusText(s, 1); +#endif // wxUSE_STATUSBAR m_menuSocket->Enable(CLIENT_OPEN, !m_sock->IsConnected() && !m_busy); m_menuSocket->Enable(CLIENT_TEST1, m_sock->IsConnected() && !m_busy); diff --git a/samples/sockets/server.cpp b/samples/sockets/server.cpp index b90dc2643c..4904c662fc 100644 --- a/samples/sockets/server.cpp +++ b/samples/sockets/server.cpp @@ -163,8 +163,10 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, m_menuBar->Append(m_menuFile, _("&File")); SetMenuBar(m_menuBar); +#if wxUSE_STATUSBAR // Status bar CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Make a textctrl for logging m_text = new wxTextCtrl(this, wxID_ANY, @@ -412,7 +414,9 @@ void MyFrame::OnSocketEvent(wxSocketEvent& event) void MyFrame::UpdateStatusBar() { +#if wxUSE_STATUSBAR wxString s; s.Printf(_("%d clients connected"), m_numClients); SetStatusText(s, 1); +#endif // wxUSE_STATUSBAR } diff --git a/samples/splitter/splitter.cpp b/samples/splitter/splitter.cpp index 633e94ea0b..0fdc603d09 100644 --- a/samples/splitter/splitter.cpp +++ b/samples/splitter/splitter.cpp @@ -176,7 +176,9 @@ MyFrame::MyFrame() wxDefaultPosition, wxSize(420, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) { +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Make a menubar wxMenu *splitMenu = new wxMenu; @@ -235,7 +237,9 @@ MyFrame::MyFrame() m_splitter->SplitVertically(m_left, m_right, 100); #endif +#if wxUSE_STATUSBAR SetStatusText(_T("Min pane size = 0"), 1); +#endif // wxUSE_STATUSBAR } MyFrame::~MyFrame() @@ -257,7 +261,9 @@ void MyFrame::SplitHorizontal(wxCommandEvent& WXUNUSED(event) ) m_right->Show(true); m_splitter->SplitHorizontally( m_left, m_right ); +#if wxUSE_STATUSBAR SetStatusText(_T("Splitter split horizontally"), 1); +#endif // wxUSE_STATUSBAR } void MyFrame::SplitVertical(wxCommandEvent& WXUNUSED(event) ) @@ -268,14 +274,18 @@ void MyFrame::SplitVertical(wxCommandEvent& WXUNUSED(event) ) m_right->Show(true); m_splitter->SplitVertically( m_left, m_right ); +#if wxUSE_STATUSBAR SetStatusText(_T("Splitter split vertically"), 1); +#endif // wxUSE_STATUSBAR } void MyFrame::Unsplit(wxCommandEvent& WXUNUSED(event) ) { if ( m_splitter->IsSplit() ) m_splitter->Unsplit(); +#if wxUSE_STATUSBAR SetStatusText(_T("No splitter")); +#endif // wxUSE_STATUSBAR } void MyFrame::ToggleLive(wxCommandEvent& event ) @@ -319,8 +329,10 @@ void MyFrame::SetMinSize(wxCommandEvent& WXUNUSED(event) ) int minsize = wxStrtol( str, (wxChar**)NULL, 10 ); m_splitter->SetMinimumPaneSize(minsize); +#if wxUSE_STATUSBAR str.Printf( wxT("Min pane size = %d"), minsize); SetStatusText(str, 1); +#endif // wxUSE_STATUSBAR } // Update UI handlers @@ -380,14 +392,18 @@ void MySplitterWindow::OnPositionChanging(wxSplitterEvent& event) void MySplitterWindow::OnDClick(wxSplitterEvent& event) { +#if wxUSE_STATUSBAR m_frame->SetStatusText(_T("Splitter double clicked"), 1); +#endif // wxUSE_STATUSBAR event.Skip(); } void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event) { +#if wxUSE_STATUSBAR m_frame->SetStatusText(_T("Splitter unsplit"), 1); +#endif // wxUSE_STATUSBAR event.Skip(); } diff --git a/samples/text/text.cpp b/samples/text/text.cpp index c229d8c0a7..7579ac0a45 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -1135,7 +1135,9 @@ END_EVENT_TABLE() MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h) : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h) ) { +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR m_panel = new MyPanel( this, 10, 10, 300, 100 ); } @@ -1280,7 +1282,9 @@ void MyFrame::OnIdle( wxIdleEvent& event ) #endif ); +#if wxUSE_STATUSBAR SetStatusText(msg); +#endif // wxUSE_STATUSBAR } event.Skip(); } @@ -1357,7 +1361,9 @@ RichTextFrame::RichTextFrame(wxWindow* parent, const wxString& title): menuBar->Append(editMenu, _("Edit")); SetMenuBar(menuBar); +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR } // Event handlers @@ -1548,6 +1554,7 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) long insertionPoint = m_textCtrl->GetInsertionPoint(); if (insertionPoint != m_currentPosition) { +#if wxUSE_STATUSBAR wxTextAttr attr; if (m_textCtrl->GetStyle(insertionPoint, attr)) { @@ -1572,6 +1579,7 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) (const wxChar*) alignment); SetStatusText(msg); } +#endif // wxUSE_STATUSBAR m_currentPosition = insertionPoint; } } diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 7a6b0ef5e7..dd421d794d 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -423,7 +423,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, m_dlgProgress = (wxProgressDialog *)NULL; +#if wxUSE_STATUSBAR CreateStatusBar(2); +#endif // wxUSE_STATUSBAR m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0), wxTE_MULTILINE | wxTE_READONLY); @@ -525,9 +527,11 @@ void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) threads.Add(thr); } +#if wxUSE_STATUSBAR wxString msg; msg.Printf(wxT("%d new threads created."), count); SetStatusText(msg, 1); +#endif // wxUSE_STATUSBAR // ...and then start them for ( n = 0; n < count; n++ ) @@ -545,7 +549,9 @@ void MyFrame::OnStartThread(wxCommandEvent& WXUNUSED(event) ) wxLogError(wxT("Can't start thread!")); } +#if wxUSE_STATUSBAR SetStatusText(_T("New thread started."), 1); +#endif // wxUSE_STATUSBAR } void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) ) @@ -570,7 +576,9 @@ void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) ) thread->Delete(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread stopped."), 1); +#endif // wxUSE_STATUSBAR } } @@ -591,7 +599,9 @@ void MyFrame::OnResumeThread(wxCommandEvent& WXUNUSED(event) ) { wxGetApp().m_threads[n]->Resume(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread resumed."), 1); +#endif // wxUSE_STATUSBAR } } @@ -612,7 +622,9 @@ void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(event) ) { wxGetApp().m_threads[n]->Pause(); +#if wxUSE_STATUSBAR SetStatusText(_T("Thread paused."), 1); +#endif // wxUSE_STATUSBAR } } diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index c13dc5050e..181b30df00 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -265,7 +265,7 @@ bool MyApp::OnInit() frame->Show(true); -#ifndef __SMARTPHONE__ +#if wxUSE_STATUSBAR frame->SetStatusText(_T("Hello, wxWidgets")); #endif @@ -389,7 +389,7 @@ MyFrame::MyFrame(wxFrame* parent, m_rows = 1; m_nPrint = 1; -#ifndef __SMARTPHONE__ +#if wxUSE_STATUSBAR // Give it a status line CreateStatusBar(); #endif @@ -711,7 +711,7 @@ void MyFrame::OnInsertPrint(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnToolEnter(wxCommandEvent& event) { -#ifndef __SMARTPHONE__ +#if wxUSE_STATUSBAR if (event.GetSelection() > -1) { wxString str; @@ -720,7 +720,9 @@ void MyFrame::OnToolEnter(wxCommandEvent& event) } else SetStatusText(_T("")); -#endif +#else + wxUnusedVar(event); +#endif // wxUSE_STATUSBAR } void MyFrame::OnToggleRadioBtn(wxCommandEvent& event) diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index 052d043a52..3e3e1130e8 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -120,7 +120,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, int x, int y, int w, int wxValidator::SetBellOnError(m_silent); file_menu->Check(VALIDATE_TOGGLE_BELL, !wxValidator::IsSilent()); +#if wxUSE_STATUSBAR CreateStatusBar(1); +#endif // wxUSE_STATUSBAR } void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/vscroll/vstest.cpp b/samples/vscroll/vstest.cpp index 515b8183bc..4fcf2c0b3d 100644 --- a/samples/vscroll/vstest.cpp +++ b/samples/vscroll/vstest.cpp @@ -100,6 +100,7 @@ public: void OnIdle(wxIdleEvent&) { +#if wxUSE_STATUSBAR m_frame->SetStatusText(wxString::Format ( _T("Page size = %d, pos = %d, max = %d"), @@ -107,6 +108,7 @@ public: GetScrollPos(wxVERTICAL), GetScrollRange(wxVERTICAL) )); +#endif // wxUSE_STATUSBAR m_changed = false; } -- 2.45.2