]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
underscors are handled better in the menu item labels
[wxWidgets.git] / src / msw / treectrl.cpp
index 8363d6ca9f58e033820252684541e2cb2f9396e3..d9affa465f8abe62add4e730d9f73ead0609a336 100644 (file)
@@ -66,6 +66,7 @@
 // ----------------------------------------------------------------------------
 
 // a convenient wrapper around TV_ITEM struct which adds a ctor
+#pragma warning( disable : 4097 )
 struct wxTreeViewItem : public TV_ITEM
 {
     wxTreeViewItem(const wxTreeItemId& item,    // the item handle
@@ -78,6 +79,7 @@ struct wxTreeViewItem : public TV_ITEM
         hItem = (HTREEITEM) (WXHTREEITEM) item;
     }
 };
+#pragma warning( default : 4097 )
 
 // a class which encapsulates the tree traversal logic: it vists all (unless
 // OnVisit() returns FALSE) items under the given one
@@ -197,11 +199,13 @@ bool wxTreeCtrl::Create(wxWindow *parent,
     if ( m_windowStyle & wxTR_LINES_AT_ROOT )
         wstyle |= TVS_LINESATROOT;
 
-#if !defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS)
+#if !defined( __GNUWIN32__ ) && !defined( __BORLANDC__ ) && !defined(wxUSE_NORLANDER_HEADERS)
     // we emulate the multiple selection tree controls by using checkboxes: set
     // up the image list we need for this if we do have multiple selections
+#if !defined(__VISUALC__) || (__VISUALC__ != 1010)
     if ( m_windowStyle & wxTR_MULTIPLE )
         wstyle |= TVS_CHECKBOXES;
+#endif
 #endif
 
     // Create the tree control.
@@ -345,15 +349,14 @@ void wxTreeCtrl::SetStateImageList(wxImageList *imageList)
     SetAnyImageList(m_imageListState = imageList, TVSIL_STATE);
 }
 
-size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
-                                    bool recursively) const
+// internal class for counting tree items
+
+class TraverseCounter : public wxTreeTraversal
 {
-    class TraverseCounter : public wxTreeTraversal
-    {
-    public:
+public:
         TraverseCounter(const wxTreeCtrl *tree,
                         const wxTreeItemId& root,
-                        bool recursively)
+                       bool recursively)
             : wxTreeTraversal(tree)
             {
                 m_count = 0;
@@ -370,9 +373,15 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
 
         size_t GetCount() const { return m_count; }
 
-    private:
+private:
         size_t m_count;
-    } counter(this, item, recursively);
+};
+
+
+size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
+                                    bool recursively) const
+{
+    TraverseCounter counter(this, item, recursively);
 
     return counter.GetCount();
 }
@@ -645,11 +654,11 @@ void wxTreeCtrl::SetItemCheck(const wxTreeItemId& item, bool check)
     DoSetItem(&tvItem);
 }
 
-size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
+// internal class for getting the selected
+
+class TraverseSelections : public wxTreeTraversal
 {
-    class TraverseSelections : public wxTreeTraversal
-    {
-    public:
+public:
         TraverseSelections(const wxTreeCtrl *tree,
                            wxArrayTreeItemIds& selections)
             : wxTreeTraversal(tree), m_selections(selections)
@@ -669,9 +678,13 @@ size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
             return TRUE;
         }
 
-    private:
+private:
         wxArrayTreeItemIds& m_selections;
-    } selector(this, selections);
+};
+
+size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
+{
+    TraverseSelections selector(this, selections);
 
     return selections.GetCount();
 }