git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28310
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
41 files changed:
m_canvas = new MyCanvas(this);
m_canvas = new MyCanvas(this);
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText(_T("Welcome to wxWidgets!"));
// 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));
free(m_text);
m_text = (wxChar *)calloc(m_xChars * m_yChars, sizeof(wxChar));
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame && frame->GetStatusBar() )
{
wxString msg;
msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars);
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);
}
frame->SetStatusText(msg, 1);
}
+#endif // wxUSE_STATUSBAR
}
// NB: this method is horrible inefficient especially because the caret
}
// 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))
{
int x, int y, int w, int h)
: wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
// create the status line
const int widths[] = { -1, 60 };
CreateStatusBar(2);
SetStatusWidths(2, widths);
wxLogStatus(this, _T("no selection"));
// 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
// --------------
// Make a menubar
// --------------
menu_bar->Append(file_menu, _T("&File"));
SetMenuBar(menu_bar);
menu_bar->Append(file_menu, _T("&File"));
SetMenuBar(menu_bar);
+#endif // wxUSE_STATUSBAR
// child controls
wxPanel *panel = new wxPanel(this);
// child controls
wxPanel *panel = new wxPanel(this);
frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2);
frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2);
+#endif // wxUSE_STATUSBAR
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create status bar and fill the LAN field
CreateStatusBar(3);
static const int widths[3] = { -1, 100, 60 };
SetStatusWidths(3, widths);
// create status bar and fill the LAN field
CreateStatusBar(3);
static const int widths[3] = { -1, 100, 60 };
SetStatusWidths(3, widths);
+#endif // wxUSE_STATUSBAR
SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1);
SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1);
+#endif // wxUSE_STATUSBAR
SetMenuBar(menuBar);
#endif // wxUSE_MENUS
SetMenuBar(menuBar);
#endif // wxUSE_MENUS
// create status bar
CreateStatusBar();
// create status bar
CreateStatusBar();
+#endif // wxUSE_STATUSBAR
void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event))
{
void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event))
{
SetStatusText(_T("Press the mouse anywhere..."));
SetStatusText(_T("Press the mouse anywhere..."));
+#endif // wxUSE_STATUSBAR
// override base class (pure) virtuals
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def)
// 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);
+ }
- { 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() )
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)
{
if ( !GetData() )
// frame icon and status bar
SetIcon(wxICON(mondrian));
// frame icon and status bar
SetIcon(wxICON(mondrian));
+#endif // wxUSE_STATUSBAR
// construct menu
wxMenu *file_menu = new wxMenu;
// construct menu
wxMenu *file_menu = new wxMenu;
else if ( m_moveAllow )
flags |= wxDrag_AllowMove;
else if ( m_moveAllow )
flags |= wxDrag_AllowMove;
+ wxDragResult result = source.DoDragDrop(flags);
+
+#if wxUSE_STATUSBAR
- switch ( source.DoDragDrop(flags) )
{
case wxDragError: pc = _T("Error!"); break;
case wxDragNone: pc = _T("Nothing"); break;
{
case wxDragError: pc = _T("Error!"); break;
case wxDragNone: pc = _T("Nothing"); break;
}
SetStatusText(wxString(_T("Drag result: ")) + pc);
}
SetStatusText(wxString(_T("Drag result: ")) + pc);
+#else
+ wxUnusedVar(result);
+#endif // wxUSE_STATUSBAR
}
#endif // wxUSE_DRAG_AND_DROP
}
}
#endif // wxUSE_DRAG_AND_DROP
}
: wxFrame(parent, wxID_ANY, _T("Shape Frame"),
wxDefaultPosition, wxSize(250, 150))
{
: wxFrame(parent, wxID_ANY, _T("Shape Frame"),
wxDefaultPosition, wxSize(250, 150))
{
+#endif // wxUSE_STATUSBAR
wxMenu *menuShape = new wxMenu;
menuShape->Append(Menu_Shape_New, _T("&New default shape\tCtrl-S"));
wxMenu *menuShape = new wxMenu;
menuShape->Append(Menu_Shape_New, _T("&New default shape\tCtrl-S"));
SetStatusText(_T("Press Ctrl-S to create a new shape"));
SetStatusText(_T("Press Ctrl-S to create a new shape"));
+#endif // wxUSE_STATUSBAR
SetDropTarget(new DnDShapeDropTarget(this));
SetDropTarget(new DnDShapeDropTarget(this));
SetStatusText(_T("Nothing happened"));
SetStatusText(_T("Nothing happened"));
+#endif // wxUSE_STATUSBAR
break;
case wxDragCancel:
break;
case wxDragCancel:
SetStatusText(_T("Drag and drop operation cancelled"));
SetStatusText(_T("Drag and drop operation cancelled"));
+#endif // wxUSE_STATUSBAR
SetStatusText(wxString(_T("Shape successfully ")) + pc);
SetStatusText(wxString(_T("Shape successfully ")) + pc);
+#endif // wxUSE_STATUSBAR
}
//else: status text already set
}
}
//else: status text already set
}
wxString s;
s.Printf(wxT("Shape dropped at (%d, %d)"), pt.x, pt.y);
SetStatusText(s);
wxString s;
s.Printf(wxT("Shape dropped at (%d, %d)"), pt.x, pt.y);
SetStatusText(s);
+#endif // wxUSE_STATUSBAR
shape->Move(pt);
SetShape(shape);
shape->Move(pt);
SetShape(shape);
{
SetShape(dlg.GetShape());
{
SetShape(dlg.GetShape());
if ( m_shape )
{
SetStatusText(_T("You can now drag the shape to another frame"));
}
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));
{
SetShape(new DnDEllipticShape(wxPoint(10, 10), wxSize(80, 60), *wxRED));
SetStatusText(_T("You can now drag the shape to another frame"));
SetStatusText(_T("You can now drag the shape to another frame"));
+#endif // wxUSE_STATUSBAR
}
void DnDShapeFrame::OnClearShape(wxCommandEvent& WXUNUSED(event))
}
void DnDShapeFrame::OnClearShape(wxCommandEvent& WXUNUSED(event))
static void ShowBitmap(const wxBitmap& bitmap)
{
wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Bitmap view"));
static void ShowBitmap(const wxBitmap& bitmap)
{
wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Bitmap view"));
frame->CreateStatusBar();
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
DnDCanvasBitmap *canvas = new DnDCanvasBitmap(frame);
canvas->SetBitmap(bitmap);
int w = bitmap.GetWidth(),
h = bitmap.GetHeight();
DnDCanvasBitmap *canvas = new DnDCanvasBitmap(frame);
canvas->SetBitmap(bitmap);
int w = bitmap.GetWidth(),
h = bitmap.GetHeight();
frame->SetStatusText(wxString::Format(_T("%dx%d"), w, h));
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);
frame->SetClientSize(w > 100 ? 100 : w, h > 100 ? 100 : h);
frame->Show(true);
SetIcon(wxICON(mondrian));
SetMenuBar( menu_bar );
SetIcon(wxICON(mondrian));
SetMenuBar( menu_bar );
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
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) );
}
m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) );
}
(wxEventFunction)
(wxCommandEventFunction)&MyFrame::OnDynamic);
(wxEventFunction)
(wxCommandEventFunction)&MyFrame::OnDynamic);
SetStatusText(_T("You can now use \"Dynamic\" item in the menu"));
SetStatusText(_T("Dynamic: on"), Status_Dynamic);
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);
}
else // connect
{
Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED);
SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
SetStatusText(_T("Dynamic: off"), Status_Dynamic);
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));
{
PushEventHandler(new MyEvtHandler(++m_nPush));
SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
PopEventHandler(true /* delete handler */);
m_nPush--;
PopEventHandler(true /* delete handler */);
m_nPush--;
SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
splitter->SplitHorizontally(m_textctrl, m_canvas, 100);
splitter->SplitHorizontally(m_textctrl, m_canvas, 100);
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar();
SetStatusText(wxT("Welcome to wxWidgets font demo!"));
// 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);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar();
SetStatusText(_T("Welcome to wxWidgets!"));
// 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
// now create some controls
m_hlbox->SetBackgroundColour(col);
m_hlbox->Refresh();
m_hlbox->SetBackgroundColour(col);
m_hlbox->Refresh();
SetStatusText(_T("Background colour changed."));
SetStatusText(_T("Background colour changed."));
+#endif // wxUSE_STATUSBAR
m_hlbox->SetSelectionBackground(col);
m_hlbox->Refresh();
m_hlbox->SetSelectionBackground(col);
m_hlbox->Refresh();
SetStatusText(_T("Selection background colour changed."));
SetStatusText(_T("Selection background colour changed."));
+#endif // wxUSE_STATUSBAR
wxLogMessage(_T("Selected items: %s"), s.c_str());
}
wxLogMessage(_T("Selected items: %s"), s.c_str());
}
SetStatusText(wxString::Format(
_T("# items selected = %lu"),
(unsigned long)m_hlbox->GetSelectedCount()
));
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);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+#endif // wxUSE_STATUSBAR
m_Html = new wxHtmlWindow(this);
m_Html -> SetRelatedFrame(this, _("HTML : %s"));
m_Html = new wxHtmlWindow(this);
m_Html -> SetRelatedFrame(this, _("HTML : %s"));
m_Html -> SetRelatedStatusBar(0);
m_Html -> SetRelatedStatusBar(0);
+#endif // wxUSE_STATUSBAR
m_Name = wxT("test.htm");
m_Html -> LoadPage(m_Name);
m_Name = wxT("test.htm");
m_Html -> LoadPage(m_Name);
SetAcceleratorTable(accel);
#endif // wxUSE_ACCEL
SetAcceleratorTable(accel);
#endif // wxUSE_ACCEL
+#endif // wxUSE_STATUSBAR
m_Processor = new BoldProcessor;
m_Processor->Enable(false);
m_Html = new wxHtmlWindow(this);
m_Html->SetRelatedFrame(this, _("HTML : %s"));
m_Processor = new BoldProcessor;
m_Processor->Enable(false);
m_Html = new wxHtmlWindow(this);
m_Html->SetRelatedFrame(this, _("HTML : %s"));
m_Html->SetRelatedStatusBar(0);
m_Html->SetRelatedStatusBar(0);
+#endif // wxUSE_STATUSBAR
m_Html->ReadCustomization(wxConfig::Get());
m_Html->LoadFile(wxFileName(wxT("test.htm")));
m_Html->AddProcessor(m_Processor);
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);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+#endif // wxUSE_STATUSBAR
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html -> SetRelatedStatusBar(1);
html -> SetRelatedStatusBar(1);
+#endif // wxUSE_STATUSBAR
html -> LoadPage(wxT("start.htm"));
}
html -> LoadPage(wxT("start.htm"));
}
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+#endif // wxUSE_STATUSBAR
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html -> SetRelatedStatusBar(1);
html -> SetRelatedStatusBar(1);
+#endif // wxUSE_STATUSBAR
html -> LoadPage(wxT("start.htm"));
}
html -> LoadPage(wxT("start.htm"));
}
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+#endif // wxUSE_STATUSBAR
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("HTML : %s"));
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, _("HTML : %s"));
html -> SetRelatedStatusBar(0);
html -> SetRelatedStatusBar(0);
+#endif // wxUSE_STATUSBAR
html -> LoadPage(wxT("start.htm"));
html -> LoadPage(wxT("start.htm"));
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
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) );
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))
{
MyFrame::MyFrame(wxFrame *frame, const wxString& title)
: wxFrame(frame, wxID_ANY, title, wxDefaultPosition, wxSize(350, 250))
{
+#endif // wxUSE_STATUSBAR
// Give it an icon
SetIcon(wxICON(mondrian));
// Give it an icon
SetIcon(wxICON(mondrian));
# error You must set wxUSE_JOYSTICK to 1 in setup.h
#endif
# 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"
#include "wx/sound.h"
#include "wx/joystick.h"
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
frame->CreateStatusBar();
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
frame->CenterOnScreen();
frame->Show(true);
frame->CenterOnScreen();
frame->Show(true);
xpos = pt.x;
ypos = pt.y;
xpos = pt.x;
ypos = pt.y;
wxString buf;
if (event.ButtonDown())
buf.Printf(_T("Joystick (%d, %d) Fire!"), pt.x, pt.y);
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);
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())
#if wxUSE_SOUND
if (event.ButtonDown() && wxGetApp().m_fire.IsOk())
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
CreateStatusBar(2);
SetStatusText(_T("wxWidgets layout demo"));
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
// 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);
RecreateList(wxLC_REPORT | wxLC_SINGLE_SEL);
+#endif // wxUSE_STATUSBAR
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
frame->CreateStatusBar();
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
subframe->CreateStatusBar();
subframe->SetStatusText(title);
subframe->CreateStatusBar();
subframe->SetStatusText(title);
+#endif // wxUSE_STATUSBAR
int width, height;
subframe->GetClientSize(&width, &height);
int width, height;
subframe->GetClientSize(&width, &height);
{
// Create menu and status bar.
CreateMyMenuBar();
{
// Create menu and status bar.
CreateMyMenuBar();
CreateStatusBar(1);
SetStatusText( _T("Welcome to Styles!") );
CreateStatusBar(1);
SetStatusText( _T("Welcome to Styles!") );
+#endif // wxUSE_STATUSBAR
wxImage image;
image.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG );
wxImage image;
image.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG );
{
// Create menu and status bar.
CreateMyMenuBar();
{
// Create menu and status bar.
CreateMyMenuBar();
CreateStatusBar(1);
SetStatusText( _T("Welcome to wxEdit!") );
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
// Create edit control. Since it is the only
// control in the frame, it will be resized
if( index < m_history.GetCount() )
{
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
m_filename = wxEmptyString;
m_filename = wxEmptyString;
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
}
void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
m_filename = dialog.GetPath();
m_text->LoadFile( m_filename );
m_filename = dialog.GetPath();
m_text->LoadFile( m_filename );
SetStatusText( m_filename );
SetStatusText( m_filename );
+#endif // wxUSE_STATUSBAR
m_filename = dialog.GetPath();
m_text->SaveFile( m_filename );
m_filename = dialog.GetPath();
m_text->SaveFile( m_filename );
SetStatusText( m_filename );
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));
// Create the main frame window
MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
// Give it a status line
frame->CreateStatusBar(2);
// Give it a status line
frame->CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Make a menubar
wxMenu *file_menu = new wxMenu;
// Make a menubar
wxMenu *file_menu = new wxMenu;
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText(_T("Welcome to wxWidgets!"));
// 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();
// create the menu
InitMenu();
// create the status line
const int widths[] = { -1, 60 };
CreateStatusBar(2);
SetStatusWidths(2, widths);
SetStatusText(_T("no selection"), 0);
// 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);
// make a panel with some controls
wxPanel *pPanel = new wxPanel(this);
void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event)
{
void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event)
{
wxString strSelection;
unsigned int nSel = event.GetSelection();
strSelection.Printf(wxT("item %d selected (%schecked)"), nSel,
m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not "));
SetStatusText(strSelection);
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::OnListboxDblClick(wxCommandEvent& WXUNUSED(event))
void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event)
{
void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event)
{
wxString strSelection;
unsigned int nItem = event.GetInt();
strSelection.Printf(wxT("item %d was %schecked"), nItem,
m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un"));
SetStatusText(strSelection);
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));
// Create the main frame window
frame = new MyFrame((wxFrame *) NULL, _T("wxPNGBitmap Demo"), wxPoint(0, 0), wxSize(300, 300));
// Give it a status line
frame->CreateStatusBar(2);
// Give it a status line
frame->CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Make a menubar
wxMenu *file_menu = new wxMenu;
// Make a menubar
wxMenu *file_menu = new wxMenu;
frame->SetStatusText(_T("Hello, wxWidgets"));
frame->SetStatusText(_T("Hello, wxWidgets"));
+#endif // wxUSE_STATUSBAR
// Create the main frame window
frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Printing Demo"), wxPoint(0, 0), wxSize(400, 400));
// Create the main frame window
frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Printing Demo"), wxPoint(0, 0), wxSize(400, 400));
// Give it a status line
frame->CreateStatusBar(2);
// Give it a status line
frame->CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Load icon and bitmap
frame->SetIcon( wxICON( mondrian) );
// Load icon and bitmap
frame->SetIcon( wxICON( mondrian) );
frame->Centre(wxBOTH);
frame->Show();
frame->Centre(wxBOTH);
frame->Show();
frame->SetStatusText(_T("Printing demo"));
frame->SetStatusText(_T("Printing demo"));
+#endif // wxUSE_STATUSBAR
m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree);
#endif
m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree);
#endif
// create the status line
// ----------------------
CreateStatusBar(2);
// create the status line
// ----------------------
CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
void RegTreeCtrl::OnSelChanged(wxTreeEvent& event)
{
void RegTreeCtrl::OnSelChanged(wxTreeEvent& event)
{
wxFrame *pFrame = (wxFrame *) wxWindow::GetParent();
pFrame->SetStatusText(GetNode(event)->FullName(), 1);
wxFrame *pFrame = (wxFrame *) wxWindow::GetParent();
pFrame->SetStatusText(GetNode(event)->FullName(), 1);
+#else
+ wxUnusedVar(event);
+#endif // wxUSE_STATUSBAR
}
void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
}
void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
frame->CreateStatusBar();
frame->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
subframe->SetIcon(wxIcon(_T("sashtest_icn")));
#endif
subframe->SetIcon(wxIcon(_T("sashtest_icn")));
#endif
// Give it a status line
subframe->CreateStatusBar();
// Give it a status line
subframe->CreateStatusBar();
+#endif // wxUSE_STATUSBAR
// Make a menubar
wxMenu *file_menu = new wxMenu;
// Make a menubar
wxMenu *file_menu = new wxMenu;
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
+#endif // wxUSE_STATUSBAR
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
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_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);
m_menuBar->Append(m_menuProtocols, _("&Protocols"));
SetMenuBar(m_menuBar);
// Status bar
CreateStatusBar(2);
// Status bar
CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Make a textctrl for logging
m_text = new wxTextCtrl(this, wxID_ANY,
// Make a textctrl for logging
m_text = new wxTextCtrl(this, wxID_ANY,
s.Printf(_("%s : %d"), (addr.Hostname()).c_str(), addr.Service());
}
s.Printf(_("%s : %d"), (addr.Hostname()).c_str(), addr.Service());
}
+#endif // wxUSE_STATUSBAR
m_menuSocket->Enable(CLIENT_OPEN, !m_sock->IsConnected() && !m_busy);
m_menuSocket->Enable(CLIENT_TEST1, m_sock->IsConnected() && !m_busy);
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);
m_menuBar->Append(m_menuFile, _("&File"));
SetMenuBar(m_menuBar);
// Status bar
CreateStatusBar(2);
// Status bar
CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
// Make a textctrl for logging
m_text = new wxTextCtrl(this, wxID_ANY,
// Make a textctrl for logging
m_text = new wxTextCtrl(this, wxID_ANY,
void MyFrame::UpdateStatusBar()
{
void MyFrame::UpdateStatusBar()
{
wxString s;
s.Printf(_("%d clients connected"), m_numClients);
SetStatusText(s, 1);
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)
{
wxDefaultPosition, wxSize(420, 300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
+#endif // wxUSE_STATUSBAR
// Make a menubar
wxMenu *splitMenu = new wxMenu;
// Make a menubar
wxMenu *splitMenu = new wxMenu;
m_splitter->SplitVertically(m_left, m_right, 100);
#endif
m_splitter->SplitVertically(m_left, m_right, 100);
#endif
SetStatusText(_T("Min pane size = 0"), 1);
SetStatusText(_T("Min pane size = 0"), 1);
+#endif // wxUSE_STATUSBAR
m_right->Show(true);
m_splitter->SplitHorizontally( m_left, m_right );
m_right->Show(true);
m_splitter->SplitHorizontally( m_left, m_right );
SetStatusText(_T("Splitter split horizontally"), 1);
SetStatusText(_T("Splitter split horizontally"), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::SplitVertical(wxCommandEvent& WXUNUSED(event) )
}
void MyFrame::SplitVertical(wxCommandEvent& WXUNUSED(event) )
m_right->Show(true);
m_splitter->SplitVertically( m_left, m_right );
m_right->Show(true);
m_splitter->SplitVertically( m_left, m_right );
SetStatusText(_T("Splitter split vertically"), 1);
SetStatusText(_T("Splitter split vertically"), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::Unsplit(wxCommandEvent& WXUNUSED(event) )
{
if ( m_splitter->IsSplit() )
m_splitter->Unsplit();
}
void MyFrame::Unsplit(wxCommandEvent& WXUNUSED(event) )
{
if ( m_splitter->IsSplit() )
m_splitter->Unsplit();
SetStatusText(_T("No splitter"));
SetStatusText(_T("No splitter"));
+#endif // wxUSE_STATUSBAR
}
void MyFrame::ToggleLive(wxCommandEvent& event )
}
void MyFrame::ToggleLive(wxCommandEvent& event )
int minsize = wxStrtol( str, (wxChar**)NULL, 10 );
m_splitter->SetMinimumPaneSize(minsize);
int minsize = wxStrtol( str, (wxChar**)NULL, 10 );
m_splitter->SetMinimumPaneSize(minsize);
str.Printf( wxT("Min pane size = %d"), minsize);
SetStatusText(str, 1);
str.Printf( wxT("Min pane size = %d"), minsize);
SetStatusText(str, 1);
+#endif // wxUSE_STATUSBAR
void MySplitterWindow::OnDClick(wxSplitterEvent& event)
{
void MySplitterWindow::OnDClick(wxSplitterEvent& event)
{
m_frame->SetStatusText(_T("Splitter double clicked"), 1);
m_frame->SetStatusText(_T("Splitter double clicked"), 1);
+#endif // wxUSE_STATUSBAR
event.Skip();
}
void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event)
{
event.Skip();
}
void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event)
{
m_frame->SetStatusText(_T("Splitter unsplit"), 1);
m_frame->SetStatusText(_T("Splitter unsplit"), 1);
+#endif // wxUSE_STATUSBAR
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) )
{
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) )
{
+#endif // wxUSE_STATUSBAR
m_panel = new MyPanel( this, 10, 10, 300, 100 );
}
m_panel = new MyPanel( this, 10, 10, 300, 100 );
}
+#endif // wxUSE_STATUSBAR
menuBar->Append(editMenu, _("Edit"));
SetMenuBar(menuBar);
menuBar->Append(editMenu, _("Edit"));
SetMenuBar(menuBar);
+#endif // wxUSE_STATUSBAR
long insertionPoint = m_textCtrl->GetInsertionPoint();
if (insertionPoint != m_currentPosition)
{
long insertionPoint = m_textCtrl->GetInsertionPoint();
if (insertionPoint != m_currentPosition)
{
wxTextAttr attr;
if (m_textCtrl->GetStyle(insertionPoint, attr))
{
wxTextAttr attr;
if (m_textCtrl->GetStyle(insertionPoint, attr))
{
(const wxChar*) alignment);
SetStatusText(msg);
}
(const wxChar*) alignment);
SetStatusText(msg);
}
+#endif // wxUSE_STATUSBAR
m_currentPosition = insertionPoint;
}
}
m_currentPosition = insertionPoint;
}
}
m_dlgProgress = (wxProgressDialog *)NULL;
m_dlgProgress = (wxProgressDialog *)NULL;
+#endif // wxUSE_STATUSBAR
m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0),
wxTE_MULTILINE | wxTE_READONLY);
m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0),
wxTE_MULTILINE | wxTE_READONLY);
wxString msg;
msg.Printf(wxT("%d new threads created."), count);
SetStatusText(msg, 1);
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++ )
// ...and then start them
for ( n = 0; n < count; n++ )
wxLogError(wxT("Can't start thread!"));
}
wxLogError(wxT("Can't start thread!"));
}
SetStatusText(_T("New thread started."), 1);
SetStatusText(_T("New thread started."), 1);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) )
}
void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) )
SetStatusText(_T("Thread stopped."), 1);
SetStatusText(_T("Thread stopped."), 1);
+#endif // wxUSE_STATUSBAR
{
wxGetApp().m_threads[n]->Resume();
{
wxGetApp().m_threads[n]->Resume();
SetStatusText(_T("Thread resumed."), 1);
SetStatusText(_T("Thread resumed."), 1);
+#endif // wxUSE_STATUSBAR
{
wxGetApp().m_threads[n]->Pause();
{
wxGetApp().m_threads[n]->Pause();
SetStatusText(_T("Thread paused."), 1);
SetStatusText(_T("Thread paused."), 1);
+#endif // wxUSE_STATUSBAR
frame->SetStatusText(_T("Hello, wxWidgets"));
#endif
frame->SetStatusText(_T("Hello, wxWidgets"));
#endif
m_rows = 1;
m_nPrint = 1;
m_rows = 1;
m_nPrint = 1;
// Give it a status line
CreateStatusBar();
#endif
// Give it a status line
CreateStatusBar();
#endif
void MyFrame::OnToolEnter(wxCommandEvent& event)
{
void MyFrame::OnToolEnter(wxCommandEvent& event)
{
if (event.GetSelection() > -1)
{
wxString str;
if (event.GetSelection() > -1)
{
wxString str;
}
else
SetStatusText(_T(""));
}
else
SetStatusText(_T(""));
+#else
+ wxUnusedVar(event);
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnToggleRadioBtn(wxCommandEvent& event)
}
void MyFrame::OnToggleRadioBtn(wxCommandEvent& event)
wxValidator::SetBellOnError(m_silent);
file_menu->Check(VALIDATE_TOGGLE_BELL, !wxValidator::IsSilent());
wxValidator::SetBellOnError(m_silent);
file_menu->Check(VALIDATE_TOGGLE_BELL, !wxValidator::IsSilent());
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void OnIdle(wxIdleEvent&)
{
void OnIdle(wxIdleEvent&)
{
m_frame->SetStatusText(wxString::Format
(
_T("Page size = %d, pos = %d, max = %d"),
m_frame->SetStatusText(wxString::Format
(
_T("Page size = %d, pos = %d, max = %d"),
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
));
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
));
+#endif // wxUSE_STATUSBAR