{
public:
MyFrame(wxFrame *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
const wxString& title = _T("wxToolBar Sample"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
EVT_MENU_RANGE(IDM_TOOLBAR_SHOW_TEXT, IDM_TOOLBAR_SHOW_BOTH,
MyFrame::OnToolbarStyle)
- EVT_MENU(-1, MyFrame::OnToolLeftClick)
+ EVT_MENU(wxID_ANY, MyFrame::OnToolLeftClick)
EVT_COMBOBOX(ID_COMBO, MyFrame::OnCombo)
bool MyApp::OnInit()
{
// Create the main frame window
- MyFrame* frame = new MyFrame((wxFrame *) NULL, -1,
+ MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
_T("wxToolBar Sample"),
#ifdef __WXWINCE__
wxDefaultPosition, wxDefaultSize
#endif
);
- frame->Show(TRUE);
+ frame->Show(true);
-#ifndef __SMARTPHONE__
+#if wxUSE_STATUSBAR
frame->SetStatusText(_T("Hello, wxWidgets"));
#endif
SetTopWindow(frame);
- return TRUE;
+ return true;
}
void MyFrame::RecreateToolbar()
#ifdef __WXWINCE__
// On Windows CE, we should not delete the
// previous toolbar in case it contains the menubar.
- // We'll try to accomodate this usage in due course.
+ // We'll try to accommodate this usage in due course.
wxToolBar* toolBar = CreateToolBar();
#else
// delete and recreate the toolbar
// adding a combo to a vertical toolbar is not very smart
if ( m_horzToolbar )
{
- wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, _T(""), wxDefaultPosition, wxSize(200,-1) );
+ wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, _T(""), wxDefaultPosition, wxSize(200,wxDefaultCoord) );
combo->Append(_T("This"));
combo->Append(_T("is a"));
combo->Append(_T("combobox"));
{
m_tbar = NULL;
- m_smallToolbar = TRUE;
- m_horzToolbar = TRUE;
- m_horzText = FALSE;
+ m_smallToolbar = true;
+ m_horzToolbar = true;
+ m_horzText = false;
m_rows = 1;
m_nPrint = 1;
-#ifndef __SMARTPHONE__
+#if wxUSE_STATUSBAR
// Give it a status line
CreateStatusBar();
#endif
// Associate the menu bar with the frame
SetMenuBar(menuBar);
- menuBar->Check(IDM_TOOLBAR_SHOW_BOTH, TRUE);
+ menuBar->Check(IDM_TOOLBAR_SHOW_BOTH, true);
// Create the toolbar
RecreateToolbar();
- m_textWindow = new wxTextCtrl(this, -1, _T(""), wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE);
+ m_textWindow = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
}
#if USE_GENERIC_TBAR
int offset;
if ( m_tbar )
{
- m_tbar->SetSize(-1, size.y);
+ m_tbar->SetSize(wxDefaultCoord, size.y);
m_tbar->Move(0, 0);
offset = m_tbar->GetSize().x;
style &= ~wxTB_HORIZONTAL;
style |= wxTB_VERTICAL;
- m_tbar = new wxToolBar(this, -1,
+ m_tbar = new wxToolBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
style);
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- Close(TRUE);
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& event)
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)