// canvas->SetScrollbars(20, 20, 50, 50, 4, 4);
frame->canvas = canvas;
- frame->Show(TRUE);
+ frame->Show(true);
frame->SetStatusText(_T("Hello, wxWidgets"));
- return TRUE;
+ return true;
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
// Define my frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
- wxFrame(frame, -1, title, pos, size)
+ wxFrame(frame, wxID_ANY, title, pos, size)
{
canvas = (MyCanvas *) NULL;
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- Close(TRUE);
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
// Define a constructor for my canvas
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size):
- wxScrolledWindow(parent, -1, pos, size)
+ wxScrolledWindow(parent, wxID_ANY, pos, size)
{
}
memDC.SelectObject(* g_TestBitmap);
// Normal, non-transparent blitting
- dc.Blit(20, 20, g_TestBitmap->GetWidth(), g_TestBitmap->GetHeight(), & memDC, 0, 0, wxCOPY, FALSE);
+ dc.Blit(20, 20, g_TestBitmap->GetWidth(), g_TestBitmap->GetHeight(), & memDC, 0, 0, wxCOPY, false);
memDC.SelectObject(wxNullBitmap);
}
// Transparent blitting if there's a mask in the bitmap
dc.Blit(20 + g_TestBitmap->GetWidth() + 20, 20, g_TestBitmap->GetWidth(), g_TestBitmap->GetHeight(), & memDC,
- 0, 0, wxCOPY, TRUE);
+ 0, 0, wxCOPY, true);
memDC.SelectObject(wxNullBitmap);
}
// waiting for us
if ( wxGetApp().m_waitingUntilAllDone )
{
- wxGetApp().m_waitingUntilAllDone = FALSE;
+ wxGetApp().m_waitingUntilAllDone = false;
wxGetApp().m_semAllDone.Post();
}
MyApp::MyApp()
: m_semAllDone()
{
- m_waitingUntilAllDone = FALSE;
+ m_waitingUntilAllDone = false;
}
MyApp::~MyApp()
frame->SetMenuBar(menuBar);
// Show the frame
- frame->Show(TRUE);
+ frame->Show(true);
SetTopWindow(frame);
- return TRUE;
+ return true;
}
// My frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxString& title,
int x, int y, int w, int h)
- : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
+ : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
m_nRunning = m_nCount = 0;
CreateStatusBar(2);
- m_txtctrl = new wxTextCtrl(this, -1, _T(""), wxPoint(0, 0), wxSize(0, 0),
+ m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0),
wxTE_MULTILINE | wxTE_READONLY);
}
if ( count )
{
// set the flag for MyThread::OnExit()
- wxGetApp().m_waitingUntilAllDone = TRUE;
+ wxGetApp().m_waitingUntilAllDone = true;
// stop all threads
while ( ! threads.IsEmpty() )
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
{
- Close(TRUE);
+ Close(true);
}
void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event))
);
// thread is not running yet, no need for crit sect
- m_cancelled = FALSE;
+ m_cancelled = false;
thread->Run();
}
{
wxCriticalSectionLocker lock(m_critsectWork);
- m_cancelled = TRUE;
+ m_cancelled = true;
}
}
#endif
{
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__
frame->SetStatusText(_T("Hello, wxWidgets"));
SetTopWindow(frame);
- return TRUE;
+ return true;
}
void MyFrame::RecreateToolbar()
// 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,wxDefaultSize.y) );
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;
// 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(wxDefaultSize.x, 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)