// 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
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__
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()
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"));
// 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);
{
if (myTree)
{
- myTree->SetOrientation(TRUE);
+ myTree->SetOrientation(true);
wxClientDC dc(canvas);
wxFont font(10, wxROMAN, wxNORMAL, wxBOLD);
dc.SetFont(font);
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& WXUNUSED(event))
// Define a constructor for my canvas
MyCanvas::MyCanvas(wxWindow *parent):
- wxScrolledWindow(parent, -1)
+ wxScrolledWindow(parent, wxID_ANY)
{
SetBackgroundColour(*wxWHITE);
}