X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c9955d147ed92cdd79d795ed94d6e03fca06a52..e77c5d96822bf69003ec6c210b19c3fa1c799c65:/contrib/samples/deprecated/treelay/treelay.cpp diff --git a/contrib/samples/deprecated/treelay/treelay.cpp b/contrib/samples/deprecated/treelay/treelay.cpp index 43d9c9832c..a4f00f7782 100644 --- a/contrib/samples/deprecated/treelay/treelay.cpp +++ b/contrib/samples/deprecated/treelay/treelay.cpp @@ -2,7 +2,7 @@ // Name: treelay.cpp // Purpose: wxTreeLayout sample // Author: Julian Smart -// Modified by: +// Modified by: // Created: 7/4/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart @@ -41,10 +41,12 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { // Create the main frame window - MyFrame* frame = new MyFrame(NULL, _T("Tree Test"), wxPoint(-1, -1), wxSize(400, 550)); + MyFrame* frame = new MyFrame(NULL, _T("Tree Test"), wxDefaultPosition, wxSize(400, 550)); +#if wxUSE_STATUSBAR // Give it a status line frame->CreateStatusBar(2); +#endif // wxUSE_STATUSBAR // Give it an icon #ifdef __WINDOWS__ @@ -83,12 +85,14 @@ bool MyApp::OnInit() dc.SetFont(font); TreeTest(*myTree, dc); - frame->Show(TRUE); + frame->Show(true); +#if wxUSE_STATUSBAR frame->SetStatusText(_T("Hello, tree!")); +#endif // wxUSE_STATUSBAR // Return the main frame window - return TRUE; + return true; } int MyApp::OnExit() @@ -105,7 +109,7 @@ int MyApp::OnExit() void MyApp::TreeTest(wxTreeLayoutStored& tree, wxDC& dc) { tree.Initialize(200); - + tree.AddChild(_T("animal")); tree.AddChild(_T("mammal"), _T("animal")); tree.AddChild(_T("insect"), _T("animal")); @@ -148,20 +152,20 @@ END_EVENT_TABLE() // Define my frame constructor MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size): - wxFrame(parent, -1, title, pos, size) + wxFrame(parent, wxID_ANY, title, pos, size) { } -void MyFrame::OnQuit(wxCommandEvent& event) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } -void MyFrame::OnLeftRight(wxCommandEvent& event) +void MyFrame::OnLeftRight(wxCommandEvent& WXUNUSED(event)) { if (myTree) { - myTree->SetOrientation(FALSE); + myTree->SetOrientation(false); wxClientDC dc(canvas); wxFont font(10, wxROMAN, wxNORMAL, wxBOLD); dc.SetFont(font); @@ -170,11 +174,11 @@ void MyFrame::OnLeftRight(wxCommandEvent& event) } } -void MyFrame::OnTopBottom(wxCommandEvent& event) +void MyFrame::OnTopBottom(wxCommandEvent& WXUNUSED(event)) { if (myTree) { - myTree->SetOrientation(TRUE); + myTree->SetOrientation(true); wxClientDC dc(canvas); wxFont font(10, wxROMAN, wxNORMAL, wxBOLD); dc.SetFont(font); @@ -183,12 +187,12 @@ void MyFrame::OnTopBottom(wxCommandEvent& event) } } -void MyFrame::OnAbout(wxCommandEvent& event) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox(_T("wxWindows tree library demo Vsn 2.0\nAuthor: Julian Smart (c) 1998"), _T("About tree test")); + (void)wxMessageBox(_T("wxWidgets tree library demo Vsn 2.0\nAuthor: Julian Smart (c) 1998"), _T("About tree test")); } -void MyFrame::OnCloseWindow(wxCloseEvent& event) +void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { Destroy(); } @@ -199,13 +203,13 @@ END_EVENT_TABLE() // Define a constructor for my canvas MyCanvas::MyCanvas(wxWindow *parent): - wxScrolledWindow(parent, -1) + wxScrolledWindow(parent, wxID_ANY) { SetBackgroundColour(*wxWHITE); } // Define the repainting behaviour -void MyCanvas::OnPaint(wxPaintEvent& event) +void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); PrepareDC(dc);