]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/treectrl.h
regrouped the fix by VZ so that __MWERKS__ comes first, since CW also defines _MSC_VE...
[wxWidgets.git] / include / wx / msw / treectrl.h
index 1c2dd8b34899ed1cf9f8ba9f1ccc339b5857f335..716be9607336d69b5953e01db9180fac90b81a34 100644 (file)
 #include "wx/control.h"
 #include "wx/event.h"
 
+#ifdef __MINGW32__
+#undef GetFirstChild()
+#undef GetNextSibling()
+#endif
+
 // the type for "untyped" data
 typedef long wxDataType;
 
@@ -110,9 +115,7 @@ public:
     wxTreeItemId(WXHTREEITEM itemId) { m_itemId = (long)itemId; }
     operator WXHTREEITEM() const { return (WXHTREEITEM)m_itemId; }
 
-    void operator =(WXHTREEITEM item) { m_itemId = (long) item; }
-
-//    wxTreeItemId(long itemId) { m_itemId = itemId; }
+    void operator=(WXHTREEITEM item) { m_itemId = (long) item; }
 
 protected:
     long m_itemId;
@@ -238,6 +241,9 @@ public:
         // usage and loading time.
     void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
 
+        // the item will be shown in bold
+    void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
+
     // item status inquiries
     // ---------------------
 
@@ -249,6 +255,8 @@ public:
     bool IsExpanded(const wxTreeItemId& item) const;
         // is this item currently selected (the same as has focus)?
     bool IsSelected(const wxTreeItemId& item) const;
+        // is item text in bold font?
+    bool IsBold(const wxTreeItemId& item) const;
 
     // number of children
     // ------------------
@@ -371,19 +379,23 @@ public:
     // helpers
     // -------
 
-    // @@@ do we really need to expose these functions to the application?
-
-        // get the bounding rectangle of the item (or of its label only)
-    void GetBoundingRect(const wxTreeItemId& item,
-                         wxRectangle& rect,
-                         bool textOnly = FALSE) const;
-
         // determine to which item (if any) belongs the given point (the
         // coordinates specified are relative to the client area of tree ctrl)
         // and fill the flags parameter with a bitmask of wxTREE_HITTEST_xxx
-        // constants
+        // constants.
+        //
+        // The first function is more portable (because easier to implement
+        // on other platforms), but the second one returns some extra info.
+    wxTreeItemId HitTest(const wxPoint& point)
+        { int dummy; return HitTest(point, dummy); }
     wxTreeItemId HitTest(const wxPoint& point, int& flags);
 
+        // get the bounding rectangle of the item (or of its label only)
+        // @@@ do we really need to expose this functions to the application?
+    void GetBoundingRect(const wxTreeItemId& item,
+                         wxRect& rect,
+                         bool textOnly = FALSE) const;
+
     // deprecated
     // ----------
 
@@ -410,8 +422,8 @@ public:
     // implementation
     // --------------
     void Command(wxCommandEvent& event) { ProcessCommand(event); };
-    bool MSWCommand(WXUINT param, WXWORD id);
-    bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
+    virtual bool MSWCommand(WXUINT param, WXWORD id);
+    virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
 
 protected:
     // SetImageList helper
@@ -448,7 +460,7 @@ private:
 // NB: note that not all accessors make sense for all events, see the event
 //     descriptions below
 // ----------------------------------------------------------------------------
-class WXDLLEXPORT wxTreeEvent : public wxCommandEvent
+class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
 {
 friend wxTreeCtrl;
 public:
@@ -470,10 +482,6 @@ public:
         // keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
     int GetCode() const { return m_code; }
 
-    // set return code for wxEVT_COMMAND_TREE_ITEM_{EXPAND|COLLAPS}ING events
-        // call this to forbid the change in item status
-    void Veto() { m_code = TRUE; }
-
 private:
     // @@ we could save some space by using union here
     int           m_code;