]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/gizmos/splittree/tree.cpp
Patch from Joe "shmengie" Brown joebrown@podiatryfl.com
[wxWidgets.git] / contrib / samples / gizmos / splittree / tree.cpp
index 10aff3c6018fa6393935dd4b360acb7bccbaaf7d..e3cc5486f6aa031bf850ebe6709ece9ca9bdb7d2 100644 (file)
@@ -17,8 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 #ifdef __GNUG__
 // headers
 // ----------------------------------------------------------------------------
 #ifdef __GNUG__
-    #pragma implementation "tree.cpp"
-    #pragma interface "tree.cpp"
+    #pragma implementation "tree.h"
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -138,12 +137,12 @@ bool MyApp::OnInit()
 
     // and show it (the frames, unlike simple controls, are not shown when
     // created initially)
 
     // and show it (the frames, unlike simple controls, are not shown when
     // created initially)
-    frame->Show(TRUE);
+    frame->Show(true);
 
     // success: wxApp::OnRun() will be called which will enter the main message
 
     // success: wxApp::OnRun() will be called which will enter the main message
-    // loop and the application will run. If we returned FALSE here, the
+    // loop and the application will run. If we returned false here, the
     // application would exit immediately.
     // application would exit immediately.
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -155,7 +154,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
        : wxFrame((wxFrame *)NULL, idMAIN_FRAME, title, pos, size)
 {
     m_splitter = NULL;
        : wxFrame((wxFrame *)NULL, idMAIN_FRAME, title, pos, size)
 {
     m_splitter = NULL;
-       m_scrolledWindow = NULL;
+    m_scrolledWindow = NULL;
     m_tree = NULL;
     m_valueWindow = NULL;
 #ifdef __WXMAC__
     m_tree = NULL;
     m_valueWindow = NULL;
 #ifdef __WXMAC__
@@ -165,26 +164,26 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 #endif
 
     m_scrolledWindow = new wxSplitterScrolledWindow(this, idSCROLLED_WINDOW, wxDefaultPosition,
 #endif
 
     m_scrolledWindow = new wxSplitterScrolledWindow(this, idSCROLLED_WINDOW, wxDefaultPosition,
-               wxSize(300, 400), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
+        wxSize(300, 400), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
     m_splitter = new wxThinSplitterWindow(m_scrolledWindow, idSPLITTER_WINDOW, wxDefaultPosition,
     m_splitter = new wxThinSplitterWindow(m_scrolledWindow, idSPLITTER_WINDOW, wxDefaultPosition,
-               wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
-       m_splitter->SetSashSize(2);
+        wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
+    m_splitter->SetSashSize(2);
 
 
-       /* Note the wxTR_ROW_LINES style: draws horizontal lines between items */
+    /* Note the wxTR_ROW_LINES style: draws horizontal lines between items */
     m_tree = new TestTree(m_splitter , idTREE_CTRL, wxDefaultPosition,
     m_tree = new TestTree(m_splitter , idTREE_CTRL, wxDefaultPosition,
-               wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES );
+        wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES );
     m_valueWindow = new TestValueWindow(m_splitter, idVALUE_WINDOW, wxDefaultPosition,
     m_valueWindow = new TestValueWindow(m_splitter, idVALUE_WINDOW, wxDefaultPosition,
-               wxDefaultSize, wxNO_BORDER);
+        wxDefaultSize, wxNO_BORDER);
     m_splitter->SplitVertically(m_tree, m_valueWindow);
     m_splitter->SplitVertically(m_tree, m_valueWindow);
-       //m_splitter->AdjustScrollbars();
-       m_splitter->SetSashPosition(200);
-       m_scrolledWindow->SetTargetWindow(m_tree);
+    //m_splitter->AdjustScrollbars();
+    m_splitter->SetSashPosition(200);
+    m_scrolledWindow->SetTargetWindow(m_tree);
 
 
-       m_scrolledWindow->EnableScrolling(FALSE, FALSE);
+    m_scrolledWindow->EnableScrolling(false, false);
 
 
-       // Let the two controls know about each other
-       m_valueWindow->SetTreeCtrl(m_tree);
-       m_tree->SetCompanionWindow(m_valueWindow);
+    // Let the two controls know about each other
+    m_valueWindow->SetTreeCtrl(m_tree);
+    m_tree->SetCompanionWindow(m_valueWindow);
 
     // set the frame icon
     SetIcon(wxICON(mondrian));
 
     // set the frame icon
     SetIcon(wxICON(mondrian));
@@ -212,8 +211,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
-    // TRUE is to force the frame to close
-    Close(TRUE);
+    // true is to force the frame to close
+    Close(true);
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 }
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -238,7 +237,7 @@ TestTree::TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt,
         const wxSize& sz, long style):
         wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style)
 {
         const wxSize& sz, long style):
         wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style)
 {
-    m_imageList = new wxImageList(16, 16, TRUE);
+    m_imageList = new wxImageList(16, 16, true);
 #if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW
     m_imageList->Add(wxIcon(icon1_xpm));
     m_imageList->Add(wxIcon(icon2_xpm));
 #if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW
     m_imageList->Add(wxIcon(icon1_xpm));
     m_imageList->Add(wxIcon(icon2_xpm));
@@ -250,28 +249,28 @@ TestTree::TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt,
 #endif
     SetImageList(m_imageList);
 
 #endif
     SetImageList(m_imageList);
 
-               
-       // Add some dummy items
-       wxTreeItemId rootId = AddRoot(_("Root"), -1, -1);
-       int i;
-       for (i = 1; i <= 20; i++)
-       {
-               wxString label;
-               label.Printf(wxT("Item %d"), i);
-               wxTreeItemId id = AppendItem(rootId, label, 0);
-               //SetItemImage( id, 1, wxTreeItemIcon_Expanded );
-
-               int j;
-               for (j = 0; j < 10; j++)
-                       AppendItem(id, _("Child"), 1);
-       }
-       Expand(rootId);
+
+    // Add some dummy items
+    wxTreeItemId rootId = AddRoot(_("Root"), -1, -1);
+    int i;
+    for (i = 1; i <= 20; i++)
+    {
+        wxString label;
+        label.Printf(wxT("Item %d"), i);
+        wxTreeItemId id = AppendItem(rootId, label, 0);
+        //SetItemImage( id, 1, wxTreeItemIcon_Expanded );
+
+        int j;
+        for (j = 0; j < 10; j++)
+            AppendItem(id, _("Child"), 1);
+    }
+    Expand(rootId);
 }
 
 TestTree::~TestTree()
 {
 }
 
 TestTree::~TestTree()
 {
-       SetImageList(NULL);
-       delete m_imageList;
+    SetImageList(NULL);
+    delete m_imageList;
 }
 
 /*
 }
 
 /*
@@ -289,5 +288,5 @@ TestValueWindow::TestValueWindow(wxWindow* parent, wxWindowID id,
       long style):
       wxTreeCompanionWindow(parent, id, pos, sz, style)
 {
       long style):
       wxTreeCompanionWindow(parent, id, pos, sz, style)
 {
-       SetBackgroundColour(* wxWHITE);
+    SetBackgroundColour(* wxWHITE);
 }
 }