]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/treectrl.h
Generic dirctrl corrections
[wxWidgets.git] / include / wx / generic / treectrl.h
index dc9b2e8ca01f1732a0597d90da900f36a298079c..50d949b2b2fe9a2a953ab41ba37d6bb82553bf73 100644 (file)
@@ -96,49 +96,6 @@ protected:
     wxTreeItemId m_pItem;
 };
 
-//-----------------------------------------------------------------------------
-// wxTreeRenameTimer (internal)
-//-----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxTreeRenameTimer: public wxTimer
-{
- private:
-   wxTreeCtrl   *m_owner;
-
- public:
-   wxTreeRenameTimer( wxTreeCtrl *owner );
-   void Notify();
-};
-
-//-----------------------------------------------------------------------------
-//  wxTreeTextCtrl (internal)
-//-----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl
-{
-  DECLARE_DYNAMIC_CLASS(wxTreeTextCtrl);
-
-  private:
-    bool               *m_accept;
-    wxString           *m_res;
-    wxTreeCtrl         *m_owner;
-    wxString            m_startValue;
-
-  public:
-    wxTreeTextCtrl(void) {};
-    wxTreeTextCtrl( wxWindow *parent, const wxWindowID id,
-                    bool *accept, wxString *res, wxTreeCtrl *owner,
-                    const wxString &value = wxEmptyString,
-                    const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-                    int style = 0,
-                    const wxValidator& validator = wxDefaultValidator,
-                    const wxString &name = wxTextCtrlNameStr );
-    void OnChar( wxKeyEvent &event );
-    void OnKillFocus( wxFocusEvent &event );
-
-  DECLARE_EVENT_TABLE()
-};
-
 // -----------------------------------------------------------------------------
 // wxTreeCtrl - the tree control
 // -----------------------------------------------------------------------------
@@ -355,6 +312,8 @@ public:
 
         // expand this item
     void Expand(const wxTreeItemId& item);
+        // expand this item and all subitems recursively
+    void ExpandAll(const wxTreeItemId& item);
         // collapse the item without removing its children
     void Collapse(const wxTreeItemId& item);
         // collapse the item and remove all children
@@ -405,7 +364,7 @@ public:
     void SetItemSelectedImage(const wxTreeItemId& item, int image)
         { SetItemImage(item, image, wxTreeItemIcon_Selected); }
 
-    // implementation
+    // implementation only from now on
 
     // callbacks
     void OnPaint( wxPaintEvent &event );
@@ -415,12 +374,11 @@ public:
     void OnMouse( wxMouseEvent &event );
     void OnIdle( wxIdleEvent &event );
 
-    // implementation
+    // implementation helpers
     void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
 
-    // Draw Special Information
-    void DrawBorder(wxTreeItemId& item);
-    void DrawLine(wxTreeItemId& item, bool below);
+    void DrawBorder(const wxTreeItemId& item);
+    void DrawLine(const wxTreeItemId& item, bool below);
 
 protected:
     friend class wxGenericTreeItem;
@@ -440,13 +398,19 @@ protected:
     int                  m_lineHeight;
     wxPen                m_dottedPen;
     wxBrush             *m_hilightBrush;
-    wxBrush             *m_normalBrush;
     wxImageList         *m_imageListNormal,
                         *m_imageListState;
+
     int                  m_dragCount;
     wxPoint              m_dragStart;
+    bool                 m_isDragging; // true between BEGIN/END drag events
+    wxGenericTreeItem   *m_dropTarget;
+    wxCursor             m_oldCursor;  // cursor is changed while dragging
+    wxGenericTreeItem   *m_oldSelection;
+
     wxTimer             *m_renameTimer;
     bool                 m_renameAccept;
+    bool                 m_lastOnSame;  // last click on the same item as prev
     wxString             m_renameRes;
 
     // the common part of all ctors
@@ -480,6 +444,8 @@ protected:
     bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
     void UnselectAllChildren( wxGenericTreeItem *item );
 
+    void DrawDropEffect(wxGenericTreeItem *item);
+
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxTreeCtrl)