-1->wxID_ANY, wxDefaultSize, TRUE->true and FALSE->false replacements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-01 07:45:11 +00:00
parent 1bec2ee494
commit bc2ec626ea
3 changed files with 31 additions and 31 deletions

View File

@@ -66,11 +66,11 @@ bool MyApp::OnInit(void)
// canvas->SetScrollbars(20, 20, 50, 50, 4, 4); // canvas->SetScrollbars(20, 20, 50, 50, 4, 4);
frame->canvas = canvas; frame->canvas = canvas;
frame->Show(TRUE); frame->Show(true);
frame->SetStatusText(_T("Hello, wxWidgets")); frame->SetStatusText(_T("Hello, wxWidgets"));
return TRUE; return true;
} }
BEGIN_EVENT_TABLE(MyFrame, wxFrame) BEGIN_EVENT_TABLE(MyFrame, wxFrame)
@@ -82,7 +82,7 @@ END_EVENT_TABLE()
// Define my frame constructor // Define my frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size): 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; canvas = (MyCanvas *) NULL;
} }
@@ -99,7 +99,7 @@ MyFrame::~MyFrame()
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -165,7 +165,7 @@ END_EVENT_TABLE()
// Define a constructor for my canvas // Define a constructor for my canvas
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size): MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size):
wxScrolledWindow(parent, -1, pos, size) wxScrolledWindow(parent, wxID_ANY, pos, size)
{ {
} }
@@ -195,7 +195,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
memDC.SelectObject(* g_TestBitmap); memDC.SelectObject(* g_TestBitmap);
// Normal, non-transparent blitting // 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); memDC.SelectObject(wxNullBitmap);
} }
@@ -207,7 +207,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
// Transparent blitting if there's a mask in the bitmap // 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, 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); memDC.SelectObject(wxNullBitmap);
} }

View File

@@ -210,7 +210,7 @@ void MyThread::OnExit()
// waiting for us // waiting for us
if ( wxGetApp().m_waitingUntilAllDone ) if ( wxGetApp().m_waitingUntilAllDone )
{ {
wxGetApp().m_waitingUntilAllDone = FALSE; wxGetApp().m_waitingUntilAllDone = false;
wxGetApp().m_semAllDone.Post(); wxGetApp().m_semAllDone.Post();
} }
@@ -355,7 +355,7 @@ END_EVENT_TABLE()
MyApp::MyApp() MyApp::MyApp()
: m_semAllDone() : m_semAllDone()
{ {
m_waitingUntilAllDone = FALSE; m_waitingUntilAllDone = false;
} }
MyApp::~MyApp() MyApp::~MyApp()
@@ -407,17 +407,17 @@ bool MyApp::OnInit()
frame->SetMenuBar(menuBar); frame->SetMenuBar(menuBar);
// Show the frame // Show the frame
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
return TRUE; return true;
} }
// My frame constructor // My frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxString& title, MyFrame::MyFrame(wxFrame *frame, const wxString& title,
int x, int y, int w, int h) 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; m_nRunning = m_nCount = 0;
@@ -425,7 +425,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title,
CreateStatusBar(2); 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); wxTE_MULTILINE | wxTE_READONLY);
} }
@@ -450,7 +450,7 @@ MyFrame::~MyFrame()
if ( count ) if ( count )
{ {
// set the flag for MyThread::OnExit() // set the flag for MyThread::OnExit()
wxGetApp().m_waitingUntilAllDone = TRUE; wxGetApp().m_waitingUntilAllDone = true;
// stop all threads // stop all threads
while ( ! threads.IsEmpty() ) while ( ! threads.IsEmpty() )
@@ -644,7 +644,7 @@ void MyFrame::OnIdle(wxIdleEvent& event)
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
{ {
Close(TRUE); Close(true);
} }
void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event))
@@ -734,7 +734,7 @@ void MyFrame::OnStartWorker(wxCommandEvent& WXUNUSED(event))
); );
// thread is not running yet, no need for crit sect // thread is not running yet, no need for crit sect
m_cancelled = FALSE; m_cancelled = false;
thread->Run(); thread->Run();
} }
@@ -763,7 +763,7 @@ void MyFrame::OnWorkerEvent(wxCommandEvent& event)
{ {
wxCriticalSectionLocker lock(m_critsectWork); wxCriticalSectionLocker lock(m_critsectWork);
m_cancelled = TRUE; m_cancelled = true;
} }
} }
#endif #endif

View File

@@ -88,7 +88,7 @@ class MyFrame: public wxFrame
{ {
public: public:
MyFrame(wxFrame *parent, MyFrame(wxFrame *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& title = _T("wxToolBar Sample"), const wxString& title = _T("wxToolBar Sample"),
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -223,7 +223,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU_RANGE(IDM_TOOLBAR_SHOW_TEXT, IDM_TOOLBAR_SHOW_BOTH, EVT_MENU_RANGE(IDM_TOOLBAR_SHOW_TEXT, IDM_TOOLBAR_SHOW_BOTH,
MyFrame::OnToolbarStyle) MyFrame::OnToolbarStyle)
EVT_MENU(-1, MyFrame::OnToolLeftClick) EVT_MENU(wxID_ANY, MyFrame::OnToolLeftClick)
EVT_COMBOBOX(ID_COMBO, MyFrame::OnCombo) EVT_COMBOBOX(ID_COMBO, MyFrame::OnCombo)
@@ -254,7 +254,7 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main frame window // Create the main frame window
MyFrame* frame = new MyFrame((wxFrame *) NULL, -1, MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
_T("wxToolBar Sample"), _T("wxToolBar Sample"),
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxDefaultPosition, wxDefaultSize wxDefaultPosition, wxDefaultSize
@@ -263,7 +263,7 @@ bool MyApp::OnInit()
#endif #endif
); );
frame->Show(TRUE); frame->Show(true);
#ifndef __SMARTPHONE__ #ifndef __SMARTPHONE__
frame->SetStatusText(_T("Hello, wxWidgets")); frame->SetStatusText(_T("Hello, wxWidgets"));
@@ -271,7 +271,7 @@ bool MyApp::OnInit()
SetTopWindow(frame); SetTopWindow(frame);
return TRUE; return true;
} }
void MyFrame::RecreateToolbar() void MyFrame::RecreateToolbar()
@@ -343,7 +343,7 @@ void MyFrame::RecreateToolbar()
// adding a combo to a vertical toolbar is not very smart // adding a combo to a vertical toolbar is not very smart
if ( m_horzToolbar ) 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("This"));
combo->Append(_T("is a")); combo->Append(_T("is a"));
combo->Append(_T("combobox")); combo->Append(_T("combobox"));
@@ -383,9 +383,9 @@ MyFrame::MyFrame(wxFrame* parent,
{ {
m_tbar = NULL; m_tbar = NULL;
m_smallToolbar = TRUE; m_smallToolbar = true;
m_horzToolbar = TRUE; m_horzToolbar = true;
m_horzText = FALSE; m_horzText = false;
m_rows = 1; m_rows = 1;
m_nPrint = 1; m_nPrint = 1;
@@ -455,12 +455,12 @@ MyFrame::MyFrame(wxFrame* parent,
// Associate the menu bar with the frame // Associate the menu bar with the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
menuBar->Check(IDM_TOOLBAR_SHOW_BOTH, TRUE); menuBar->Check(IDM_TOOLBAR_SHOW_BOTH, true);
// Create the toolbar // Create the toolbar
RecreateToolbar(); 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 #if USE_GENERIC_TBAR
@@ -483,7 +483,7 @@ void MyFrame::LayoutChildren()
int offset; int offset;
if ( m_tbar ) if ( m_tbar )
{ {
m_tbar->SetSize(-1, size.y); m_tbar->SetSize(wxDefaultSize.x, size.y);
m_tbar->Move(0, 0); m_tbar->Move(0, 0);
offset = m_tbar->GetSize().x; offset = m_tbar->GetSize().x;
@@ -544,7 +544,7 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event))
style &= ~wxTB_HORIZONTAL; style &= ~wxTB_HORIZONTAL;
style |= wxTB_VERTICAL; style |= wxTB_VERTICAL;
m_tbar = new wxToolBar(this, -1, m_tbar = new wxToolBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
style); style);
@@ -588,7 +588,7 @@ void MyFrame::OnToggleToolbarOrient(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& event) void MyFrame::OnAbout(wxCommandEvent& event)