-1->wxID_ANY, TRUE->true and FALSE->false replacements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -137,11 +137,11 @@ class TextWindow : public wxWindow
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextWindow(wxWindow *parent)
|
TextWindow(wxWindow *parent)
|
||||||
: wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize,
|
: wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||||
wxRAISED_BORDER)
|
wxRAISED_BORDER)
|
||||||
{
|
{
|
||||||
m_skip = TRUE;
|
m_skip = true;
|
||||||
m_showRaw = FALSE;
|
m_showRaw = false;
|
||||||
|
|
||||||
SetBackgroundColour(*wxBLUE);
|
SetBackgroundColour(*wxBLUE);
|
||||||
}
|
}
|
||||||
@@ -242,12 +242,12 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
// and show it (the frames, unlike simple controls, are not shown when
|
// and show it (the frames, unlike simple controls, are not shown when
|
||||||
// created initially)
|
// created initially)
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
// success: wxApp::OnRun() will be called which will enter the main message
|
// 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.
|
// application would exit immediately.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -256,7 +256,7 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
// frame constructor
|
// frame constructor
|
||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
|
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)
|
m_winText(NULL)
|
||||||
{
|
{
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
@@ -284,15 +284,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
|||||||
// ... and attach this menu bar to the frame
|
// ... and attach this menu bar to the frame
|
||||||
SetMenuBar(menuBar);
|
SetMenuBar(menuBar);
|
||||||
|
|
||||||
menuBar->Check(Keyboard_Skip, TRUE);
|
menuBar->Check(Keyboard_Skip, true);
|
||||||
|
|
||||||
#ifndef wxHAS_RAW_KEY_CODES
|
#ifndef wxHAS_RAW_KEY_CODES
|
||||||
menuBar->Enable(Keyboard_ShowRaw, FALSE);
|
menuBar->Enable(Keyboard_ShowRaw, false);
|
||||||
#endif // !wxHAS_RAW_KEY_CODES
|
#endif // !wxHAS_RAW_KEY_CODES
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
m_winText = new TextWindow(this);
|
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());
|
m_logTarget = new LboxLogger(m_lboxLog, wxLog::GetActiveTarget());
|
||||||
wxLog::SetActiveTarget(m_logTarget);
|
wxLog::SetActiveTarget(m_logTarget);
|
||||||
@@ -308,8 +308,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
|||||||
|
|
||||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// TRUE is to force the frame to close
|
// true is to force the frame to close
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
|
@@ -105,7 +105,7 @@ private:
|
|||||||
// toggle the state of the status bar controls
|
// toggle the state of the status bar controls
|
||||||
void DoToggle();
|
void DoToggle();
|
||||||
|
|
||||||
wxBitmap CreateBitmapForButton(bool on = FALSE);
|
wxBitmap CreateBitmapForButton(bool on = false);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -216,8 +216,8 @@ END_EVENT_TABLE()
|
|||||||
BEGIN_EVENT_TABLE(MyStatusBar, wxStatusBar)
|
BEGIN_EVENT_TABLE(MyStatusBar, wxStatusBar)
|
||||||
EVT_SIZE(MyStatusBar::OnSize)
|
EVT_SIZE(MyStatusBar::OnSize)
|
||||||
EVT_CHECKBOX(StatusBar_Checkbox, MyStatusBar::OnToggleClock)
|
EVT_CHECKBOX(StatusBar_Checkbox, MyStatusBar::OnToggleClock)
|
||||||
EVT_BUTTON(-1, MyStatusBar::OnButton)
|
EVT_BUTTON(wxID_ANY, MyStatusBar::OnButton)
|
||||||
EVT_TIMER(-1, MyStatusBar::OnTimer)
|
EVT_TIMER(wxID_ANY, MyStatusBar::OnTimer)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// Create a new application object: this macro will allow wxWindows to create
|
// Create a new application object: this macro will allow wxWindows to create
|
||||||
@@ -244,12 +244,12 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
// and show it (the frames, unlike simple controls, are not shown when
|
// and show it (the frames, unlike simple controls, are not shown when
|
||||||
// created initially)
|
// created initially)
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
// success: wxApp::OnRun() will be called which will enter the main message
|
// 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.
|
// application would exit immediately.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -259,9 +259,9 @@ bool MyApp::OnInit()
|
|||||||
// frame constructor
|
// frame constructor
|
||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
#ifdef USE_MDI_PARENT_FRAME
|
#ifdef USE_MDI_PARENT_FRAME
|
||||||
: wxMDIParentFrame((wxWindow *)NULL, -1, title, pos, size)
|
: wxMDIParentFrame((wxWindow *)NULL, wxID_ANY, title, pos, size)
|
||||||
#else
|
#else
|
||||||
: wxFrame((wxWindow *)NULL, -1, title, pos, size)
|
: wxFrame((wxWindow *)NULL, wxID_ANY, title, pos, size)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_statbarDefault = NULL;
|
m_statbarDefault = NULL;
|
||||||
@@ -445,8 +445,8 @@ void MyFrame::OnRecreateStatusBar(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// TRUE is to force the frame to close
|
// true is to force the frame to close
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -460,11 +460,11 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
||||||
: wxDialog(parent, -1, wxString(_T("About statbar")),
|
: wxDialog(parent, wxID_ANY, wxString(_T("About statbar")),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
wxStaticText *text = new wxStaticText(this, -1,
|
wxStaticText *text = new wxStaticText(this, wxID_ANY,
|
||||||
_T("wxStatusBar sample\n")
|
_T("wxStatusBar sample\n")
|
||||||
_T("(c) 2000 Vadim Zeitlin"));
|
_T("(c) 2000 Vadim Zeitlin"));
|
||||||
|
|
||||||
@@ -472,13 +472,13 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
|||||||
|
|
||||||
// create the top status bar without the size grip (default style),
|
// create the top status bar without the size grip (default style),
|
||||||
// otherwise it looks weird
|
// otherwise it looks weird
|
||||||
wxStatusBar *statbarTop = new wxStatusBar(this, -1, 0);
|
wxStatusBar *statbarTop = new wxStatusBar(this, wxID_ANY, 0);
|
||||||
statbarTop->SetFieldsCount(3);
|
statbarTop->SetFieldsCount(3);
|
||||||
statbarTop->SetStatusText(_T("This is a top status bar"), 0);
|
statbarTop->SetStatusText(_T("This is a top status bar"), 0);
|
||||||
statbarTop->SetStatusText(_T("in a dialog"), 1);
|
statbarTop->SetStatusText(_T("in a dialog"), 1);
|
||||||
statbarTop->SetStatusText(_T("Great, isn't it?"), 2);
|
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->SetFieldsCount(2);
|
||||||
statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0);
|
statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0);
|
||||||
statbarBottom->SetStatusText(_T("in a dialog"), 1);
|
statbarBottom->SetStatusText(_T("in a dialog"), 1);
|
||||||
@@ -492,7 +492,7 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(-1, 10, 1, wxGROW);
|
sizerTop->Add(-1, 10, 1, wxGROW);
|
||||||
sizerTop->Add(statbarBottom, 0, wxGROW);
|
sizerTop->Add(statbarBottom, 0, wxGROW);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
SetAutoLayout(true);
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -509,7 +509,7 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
MyStatusBar::MyStatusBar(wxWindow *parent)
|
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 };
|
static const int widths[Field_Max] = { -1, 150, BITMAP_SIZE_X, 100 };
|
||||||
|
|
||||||
@@ -517,12 +517,12 @@ MyStatusBar::MyStatusBar(wxWindow *parent)
|
|||||||
SetStatusWidths(Field_Max, widths);
|
SetStatusWidths(Field_Max, widths);
|
||||||
|
|
||||||
m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, _T("&Toggle clock"));
|
m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, _T("&Toggle clock"));
|
||||||
m_checkbox->SetValue(TRUE);
|
m_checkbox->SetValue(true);
|
||||||
|
|
||||||
#ifdef USE_STATIC_BITMAP
|
#ifdef USE_STATIC_BITMAP
|
||||||
m_statbmp = new wxStaticBitmap(this, -1, wxIcon(green_xpm));
|
m_statbmp = new wxStaticBitmap(this, wxID_ANY, wxIcon(green_xpm));
|
||||||
#else
|
#else
|
||||||
m_statbmp = new wxBitmapButton(this, -1, CreateBitmapForButton(),
|
m_statbmp = new wxBitmapButton(this, wxID_ANY, CreateBitmapForButton(),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxBU_EXACTFIT);
|
wxBU_EXACTFIT);
|
||||||
#endif
|
#endif
|
||||||
@@ -603,7 +603,7 @@ void MyStatusBar::DoToggle()
|
|||||||
#ifdef USE_STATIC_BITMAP
|
#ifdef USE_STATIC_BITMAP
|
||||||
m_statbmp->SetIcon(wxIcon(green_xpm));
|
m_statbmp->SetIcon(wxIcon(green_xpm));
|
||||||
#else
|
#else
|
||||||
m_statbmp->SetBitmapLabel(CreateBitmapForButton(FALSE));
|
m_statbmp->SetBitmapLabel(CreateBitmapForButton(false));
|
||||||
m_statbmp->Refresh();
|
m_statbmp->Refresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -616,7 +616,7 @@ void MyStatusBar::DoToggle()
|
|||||||
#ifdef USE_STATIC_BITMAP
|
#ifdef USE_STATIC_BITMAP
|
||||||
m_statbmp->SetIcon(wxIcon(red_xpm));
|
m_statbmp->SetIcon(wxIcon(red_xpm));
|
||||||
#else
|
#else
|
||||||
m_statbmp->SetBitmapLabel(CreateBitmapForButton(TRUE));
|
m_statbmp->SetBitmapLabel(CreateBitmapForButton(true));
|
||||||
m_statbmp->Refresh();
|
m_statbmp->Refresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user