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
}
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
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
// --------------
menu_bar->Append(file_menu, _T("&File"));
SetMenuBar(menu_bar);
+#if wxUSE_STATUSBAR
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
// child controls
wxPanel *panel = new wxPanel(this);
return false;
}
+#if wxUSE_STATUSBAR
frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2);
+#endif // wxUSE_STATUSBAR
return true;
}
// ... 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
}
{
s_isOnline = isOnline;
+#if wxUSE_STATUSBAR
SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1);
+#endif // wxUSE_STATUSBAR
}
}
SetMenuBar(menuBar);
#endif // wxUSE_MENUS
+#if wxUSE_STATUSBAR
// create status bar
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
// create child controls
void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event))
{
+#if wxUSE_STATUSBAR
SetStatusText(_T("Press the mouse anywhere..."));
+#endif // wxUSE_STATUSBAR
CaptureMouse();
}
// 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() )
// frame icon and status bar
SetIcon(wxICON(mondrian));
+#if wxUSE_STATUSBAR
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
// construct menu
wxMenu *file_menu = new wxMenu;
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;
}
SetStatusText(wxString(_T("Drag result: ")) + pc);
+#else
+ wxUnusedVar(result);
+#endif // wxUSE_STATUSBAR
}
#endif // wxUSE_DRAG_AND_DROP
}
: 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"));
SetMenuBar(menubar);
+#if wxUSE_STATUSBAR
SetStatusText(_T("Press Ctrl-S to create a new shape"));
+#endif // wxUSE_STATUSBAR
SetDropTarget(new DnDShapeDropTarget(this));
break;
case wxDragNone:
+#if wxUSE_STATUSBAR
SetStatusText(_T("Nothing happened"));
+#endif // wxUSE_STATUSBAR
break;
case wxDragCopy:
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
}
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);
{
SetShape(dlg.GetShape());
+#if wxUSE_STATUSBAR
if ( m_shape )
{
SetStatusText(_T("You can now drag the shape to another frame"));
}
+#endif // wxUSE_STATUSBAR
}
}
{
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))
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);
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) );
}
(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
}
}
{
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))
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))
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
}
// --------------------------------------------------------
// ... 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
m_hlbox->SetBackgroundColour(col);
m_hlbox->Refresh();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Background colour changed."));
+#endif // wxUSE_STATUSBAR
}
}
m_hlbox->SetSelectionBackground(col);
m_hlbox->Refresh();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Selection background colour changed."));
+#endif // wxUSE_STATUSBAR
}
}
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
}
// ============================================================================
// ... 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);
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);
// ... 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"));
}
// ... 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"));
}
// ... 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"));
- }
}
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) );
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));
# 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"
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
+#if wxUSE_STATUSBAR
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
frame->CenterOnScreen();
frame->Show(true);
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);
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())
// 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
RecreateList(wxLC_REPORT | wxLC_SINGLE_SEL);
+#if wxUSE_STATUSBAR
CreateStatusBar(3);
+#endif // wxUSE_STATUSBAR
}
MyFrame::~MyFrame()
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
+#if wxUSE_STATUSBAR
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
frame->Show(true);
// 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);
{
// 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 );
{
// 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
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
{
m_filename = wxEmptyString;
+#if wxUSE_STATUSBAR
SetStatusText( _T("") );
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
m_filename = dialog.GetPath();
m_text->LoadFile( m_filename );
+#if wxUSE_STATUSBAR
SetStatusText( m_filename );
+#endif // wxUSE_STATUSBAR
}
}
m_filename = dialog.GetPath();
m_text->SaveFile( m_filename );
+#if wxUSE_STATUSBAR
SetStatusText( m_filename );
+#endif // wxUSE_STATUSBAR
}
}
// 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;
// ... 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
}
// 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);
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))
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
}
// 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;
frame->Show(true);
+#if wxUSE_STATUSBAR
frame->SetStatusText(_T("Hello, wxWidgets"));
+#endif // wxUSE_STATUSBAR
return true;
}
// 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) );
frame->Centre(wxBOTH);
frame->Show();
+#if wxUSE_STATUSBAR
frame->SetStatusText(_T("Printing demo"));
+#endif // wxUSE_STATUSBAR
SetTopWindow(frame);
m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree);
#endif
+#if wxUSE_STATUSBAR
// create the status line
// ----------------------
CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
}
RegFrame::~RegFrame()
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)
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
+#if wxUSE_STATUSBAR
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
frame->Show(true);
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;
SetMenuBar( menu_bar );
+#if wxUSE_STATUSBAR
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
+#endif // wxUSE_STATUSBAR
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
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 );
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,
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);
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,
void MyFrame::UpdateStatusBar()
{
+#if wxUSE_STATUSBAR
wxString s;
s.Printf(_("%d clients connected"), m_numClients);
SetStatusText(s, 1);
+#endif // wxUSE_STATUSBAR
}
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;
m_splitter->SplitVertically(m_left, m_right, 100);
#endif
+#if wxUSE_STATUSBAR
SetStatusText(_T("Min pane size = 0"), 1);
+#endif // wxUSE_STATUSBAR
}
MyFrame::~MyFrame()
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) )
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 )
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
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();
}
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 );
}
#endif
);
+#if wxUSE_STATUSBAR
SetStatusText(msg);
+#endif // wxUSE_STATUSBAR
}
event.Skip();
}
menuBar->Append(editMenu, _("Edit"));
SetMenuBar(menuBar);
+#if wxUSE_STATUSBAR
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
}
// Event handlers
long insertionPoint = m_textCtrl->GetInsertionPoint();
if (insertionPoint != m_currentPosition)
{
+#if wxUSE_STATUSBAR
wxTextAttr attr;
if (m_textCtrl->GetStyle(insertionPoint, attr))
{
(const wxChar*) alignment);
SetStatusText(msg);
}
+#endif // wxUSE_STATUSBAR
m_currentPosition = insertionPoint;
}
}
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);
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++ )
wxLogError(wxT("Can't start thread!"));
}
+#if wxUSE_STATUSBAR
SetStatusText(_T("New thread started."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) )
thread->Delete();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Thread stopped."), 1);
+#endif // wxUSE_STATUSBAR
}
}
{
wxGetApp().m_threads[n]->Resume();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Thread resumed."), 1);
+#endif // wxUSE_STATUSBAR
}
}
{
wxGetApp().m_threads[n]->Pause();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Thread paused."), 1);
+#endif // wxUSE_STATUSBAR
}
}
frame->Show(true);
-#ifndef __SMARTPHONE__
+#if wxUSE_STATUSBAR
frame->SetStatusText(_T("Hello, wxWidgets"));
#endif
m_rows = 1;
m_nPrint = 1;
-#ifndef __SMARTPHONE__
+#if wxUSE_STATUSBAR
// Give it a status line
CreateStatusBar();
#endif
void MyFrame::OnToolEnter(wxCommandEvent& event)
{
-#ifndef __SMARTPHONE__
+#if wxUSE_STATUSBAR
if (event.GetSelection() > -1)
{
wxString str;
}
else
SetStatusText(_T(""));
-#endif
+#else
+ wxUnusedVar(event);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnToggleRadioBtn(wxCommandEvent& event)
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))
void OnIdle(wxIdleEvent&)
{
+#if wxUSE_STATUSBAR
m_frame->SetStatusText(wxString::Format
(
_T("Page size = %d, pos = %d, max = %d"),
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
));
+#endif // wxUSE_STATUSBAR
m_changed = false;
}