]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/treectlg.h
corrected control inheritance
[wxWidgets.git] / include / wx / generic / treectlg.h
index 1bc9bd11032d2edd01d2a2fefc276b6f76efb332..0357da9761bd8cb27032e53c4a0a23107a0e8dd9 100644 (file)
@@ -16,6 +16,8 @@
     #pragma interface "treectlg.h"
 #endif
 
+#if wxUSE_TREECTRL
+
 #include "wx/defs.h"
 #include "wx/string.h"
 #include "wx/object.h"
@@ -53,7 +55,11 @@ public:
     wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = -1,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
+#ifdef __WXMAC__
+               long style = wxTR_MAC_BUTTONS | wxTR_NO_LINES | wxTR_ROW_LINES,
+#else
                long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+#endif
                const wxValidator &validator = wxDefaultValidator,
                const wxString& name = wxTreeCtrlNameStr)
     {
@@ -66,7 +72,11 @@ public:
     bool Create(wxWindow *parent, wxWindowID id = -1,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+#ifdef __WXMAC__
+               long style = wxTR_MAC_BUTTONS | wxTR_NO_LINES | wxTR_ROW_LINES,
+#else
+               long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+#endif
                 const wxValidator &validator = wxDefaultValidator,
                 const wxString& name = wxTreeCtrlNameStr);
 
@@ -87,9 +97,11 @@ public:
     void SetSpacing(unsigned int spacing);
 
         // image list: these functions allow to associate an image list with
-        // the control and retrieve it. Note that the control does _not_ delete
+        // the control and retrieve it. Note that when assigned with 
+        // SetImageList, the control does _not_ delete
         // the associated image list when it's deleted in order to allow image
-        // lists to be shared between different controls.
+        // lists to be shared between different controls. If you use 
+        // AssignImageList, the control _does_ delete the image list.
         //
         // The normal image list is for the icons which correspond to the
         // normal tree item state (whether it is selected or not).
@@ -101,6 +113,8 @@ public:
 
     void SetImageList(wxImageList *imageList);
     void SetStateImageList(wxImageList *imageList);
+    void AssignImageList(wxImageList *imageList);
+    void AssignStateImageList(wxImageList *imageList);
 
     // Functions to work with tree ctrl items.
 
@@ -144,6 +158,9 @@ public:
         // set the items font (should be of the same height for all items)
     void SetItemFont(const wxTreeItemId& item, const wxFont& font);
 
+        // set the window font
+    virtual bool SetFont( const wxFont &font );
+
     // item status inquiries
     // ---------------------
 
@@ -353,6 +370,8 @@ protected:
     wxBrush             *m_hilightBrush;
     wxImageList         *m_imageListNormal,
                         *m_imageListState;
+    bool                 m_ownsImageListNormal, 
+                         m_ownsImageListState;
 
     int                  m_dragCount;
     wxPoint              m_dragStart;
@@ -433,5 +452,7 @@ public:
 
 #endif
 
+#endif // wxUSE_TREECTRL
+
 #endif // _GENERIC_TREECTRL_H_