X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be5a51fb592f3fa2ba38ac6cd1e488d6d806058c..d3d0b8dba702091fb19c83ae0ad9844a9bc4bf47:/contrib/samples/deprecated/treelay/treelay.cpp?ds=sidebyside diff --git a/contrib/samples/deprecated/treelay/treelay.cpp b/contrib/samples/deprecated/treelay/treelay.cpp index fd8213832e..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& WXUNUSED(event)) { - Close(TRUE); + Close(true); } 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); @@ -174,7 +178,7 @@ 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); @@ -199,7 +203,7 @@ END_EVENT_TABLE() // Define a constructor for my canvas MyCanvas::MyCanvas(wxWindow *parent): - wxScrolledWindow(parent, -1) + wxScrolledWindow(parent, wxID_ANY) { SetBackgroundColour(*wxWHITE); }