{
public:
TextWindow(wxWindow *parent)
- : wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize,
+ : wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxRAISED_BORDER)
{
- m_skip = TRUE;
- m_showRaw = FALSE;
+ m_skip = true;
+ m_showRaw = false;
SetBackgroundColour(*wxBLUE);
}
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
- frame->Show(TRUE);
+ frame->Show(true);
// success: wxApp::OnRun() will be called which will enter the main message
- // loop and the application will run. If we returned FALSE here, the
+ // loop and the application will run. If we returned false here, the
// application would exit immediately.
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
- : wxFrame(NULL, -1, title, pos, size, style),
+ : wxFrame(NULL, wxID_ANY, title, pos, size, style),
m_winText(NULL)
{
#if wxUSE_MENUS
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
- menuBar->Check(Keyboard_Skip, TRUE);
+ menuBar->Check(Keyboard_Skip, true);
#ifndef wxHAS_RAW_KEY_CODES
- menuBar->Enable(Keyboard_ShowRaw, FALSE);
+ menuBar->Enable(Keyboard_ShowRaw, false);
#endif // !wxHAS_RAW_KEY_CODES
#endif // wxUSE_MENUS
m_winText = new TextWindow(this);
- m_lboxLog = new wxListBox(this, -1);
+ m_lboxLog = new wxListBox(this, wxID_ANY);
m_logTarget = new LboxLogger(m_lboxLog, wxLog::GetActiveTarget());
wxLog::SetActiveTarget(m_logTarget);
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
// toggle the state of the status bar controls
void DoToggle();
- wxBitmap CreateBitmapForButton(bool on = FALSE);
+ wxBitmap CreateBitmapForButton(bool on = false);
enum
{
BEGIN_EVENT_TABLE(MyStatusBar, wxStatusBar)
EVT_SIZE(MyStatusBar::OnSize)
EVT_CHECKBOX(StatusBar_Checkbox, MyStatusBar::OnToggleClock)
- EVT_BUTTON(-1, MyStatusBar::OnButton)
- EVT_TIMER(-1, MyStatusBar::OnTimer)
+ EVT_BUTTON(wxID_ANY, MyStatusBar::OnButton)
+ EVT_TIMER(wxID_ANY, MyStatusBar::OnTimer)
END_EVENT_TABLE()
// Create a new application object: this macro will allow wxWindows to create
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
- frame->Show(TRUE);
+ frame->Show(true);
// success: wxApp::OnRun() will be called which will enter the main message
- // loop and the application will run. If we returned FALSE here, the
+ // loop and the application will run. If we returned 'false' here, the
// application would exit immediately.
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
#ifdef USE_MDI_PARENT_FRAME
- : wxMDIParentFrame((wxWindow *)NULL, -1, title, pos, size)
+ : wxMDIParentFrame((wxWindow *)NULL, wxID_ANY, title, pos, size)
#else
- : wxFrame((wxWindow *)NULL, -1, title, pos, size)
+ : wxFrame((wxWindow *)NULL, wxID_ANY, title, pos, size)
#endif
{
m_statbarDefault = NULL;
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
// ----------------------------------------------------------------------------
MyAboutDialog::MyAboutDialog(wxWindow *parent)
- : wxDialog(parent, -1, wxString(_T("About statbar")),
+ : wxDialog(parent, wxID_ANY, wxString(_T("About statbar")),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
- wxStaticText *text = new wxStaticText(this, -1,
+ wxStaticText *text = new wxStaticText(this, wxID_ANY,
_T("wxStatusBar sample\n")
_T("(c) 2000 Vadim Zeitlin"));
// create the top status bar without the size grip (default style),
// otherwise it looks weird
- wxStatusBar *statbarTop = new wxStatusBar(this, -1, 0);
+ wxStatusBar *statbarTop = new wxStatusBar(this, wxID_ANY, 0);
statbarTop->SetFieldsCount(3);
statbarTop->SetStatusText(_T("This is a top status bar"), 0);
statbarTop->SetStatusText(_T("in a dialog"), 1);
statbarTop->SetStatusText(_T("Great, isn't it?"), 2);
- wxStatusBar *statbarBottom = new wxStatusBar(this, -1);
+ wxStatusBar *statbarBottom = new wxStatusBar(this, wxID_ANY);
statbarBottom->SetFieldsCount(2);
statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0);
statbarBottom->SetStatusText(_T("in a dialog"), 1);
sizerTop->Add(-1, 10, 1, wxGROW);
sizerTop->Add(statbarBottom, 0, wxGROW);
- SetAutoLayout(TRUE);
+ SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->Fit(this);
#endif
MyStatusBar::MyStatusBar(wxWindow *parent)
- : wxStatusBar(parent, -1), m_timer(this), m_checkbox(NULL)
+ : wxStatusBar(parent, wxID_ANY), m_timer(this), m_checkbox(NULL)
{
static const int widths[Field_Max] = { -1, 150, BITMAP_SIZE_X, 100 };
SetStatusWidths(Field_Max, widths);
m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, _T("&Toggle clock"));
- m_checkbox->SetValue(TRUE);
+ m_checkbox->SetValue(true);
#ifdef USE_STATIC_BITMAP
- m_statbmp = new wxStaticBitmap(this, -1, wxIcon(green_xpm));
+ m_statbmp = new wxStaticBitmap(this, wxID_ANY, wxIcon(green_xpm));
#else
- m_statbmp = new wxBitmapButton(this, -1, CreateBitmapForButton(),
+ m_statbmp = new wxBitmapButton(this, wxID_ANY, CreateBitmapForButton(),
wxDefaultPosition, wxDefaultSize,
wxBU_EXACTFIT);
#endif
#ifdef USE_STATIC_BITMAP
m_statbmp->SetIcon(wxIcon(green_xpm));
#else
- m_statbmp->SetBitmapLabel(CreateBitmapForButton(FALSE));
+ m_statbmp->SetBitmapLabel(CreateBitmapForButton(false));
m_statbmp->Refresh();
#endif
#ifdef USE_STATIC_BITMAP
m_statbmp->SetIcon(wxIcon(red_xpm));
#else
- m_statbmp->SetBitmapLabel(CreateBitmapForButton(TRUE));
+ m_statbmp->SetBitmapLabel(CreateBitmapForButton(true));
m_statbmp->Refresh();
#endif