]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/treectrl.h
Removed unnecessary code from utilsunx.cpp
[wxWidgets.git] / include / wx / generic / treectrl.h
index 76ca47975baee78291bc9f1dce0f37e5b9e6ba28..7d1dd7e39de669a3c05071135d9366d5e602eaa2 100644 (file)
@@ -96,51 +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,
-#if wxUSE_VALIDATORS
-                    const wxValidator& validator = wxDefaultValidator,
-#endif
-                    const wxString &name = wxTextCtrlNameStr );
-    void OnChar( wxKeyEvent &event );
-    void OnKillFocus( wxFocusEvent &event );
-
-  DECLARE_EVENT_TABLE()
-};
-
 // -----------------------------------------------------------------------------
 // wxTreeCtrl - the tree control
 // -----------------------------------------------------------------------------
@@ -156,9 +111,7 @@ public:
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
-#if wxUSE_VALIDATORS
                const wxValidator &validator = wxDefaultValidator,
-#endif
                const wxString& name = wxTreeCtrlNameStr)
     {
         Create(parent, id, pos, size, style, validator, name);
@@ -170,9 +123,7 @@ public:
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
-#if wxUSE_VALIDATORS
                 const wxValidator &validator = wxDefaultValidator,
-#endif
                 const wxString& name = wxTreeCtrlNameStr);
 
     // accessors
@@ -337,9 +288,9 @@ public:
                             int image = -1, int selectedImage = -1,
                             wxTreeItemData *data = NULL);
 
-        // insert a new item before a given one
+        // insert a new item before the one with the given index
     wxTreeItemId InsertItem(const wxTreeItemId& parent,
-                            size_t before,
+                            size_t index,
                             const wxString& text,
                             int image = -1, int selectedImage = -1,
                             wxTreeItemData *data = NULL);
@@ -411,7 +362,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 );
@@ -421,12 +372,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;
@@ -448,8 +398,14 @@ protected:
     wxBrush             *m_hilightBrush;
     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;
     wxString             m_renameRes;
@@ -485,6 +441,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)