1998-10-26 17:11:33 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 15:00:57 +00:00
|
|
|
// Name: wx/generic/treectlg.h
|
1998-10-26 17:11:33 +00:00
|
|
|
// Purpose: wxTreeCtrl class
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1997,1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-10-26 17:11:33 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _GENERIC_TREECTRL_H_
|
|
|
|
#define _GENERIC_TREECTRL_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if wxUSE_TREECTRL
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/scrolwin.h"
|
1999-01-04 13:52:06 +00:00
|
|
|
#include "wx/pen.h"
|
1999-06-13 15:24:01 +00:00
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// forward declaration
|
|
|
|
// -----------------------------------------------------------------------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeItemData;
|
1999-07-25 12:59:58 +00:00
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeRenameTimer;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeFindTimer;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeTextCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
1998-07-01 15:42:11 +00:00
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2000-08-04 13:59:45 +00:00
|
|
|
// wxGenericTreeCtrl - the tree control
|
1998-10-26 17:11:33 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxGenericTreeCtrl : public wxTreeCtrlBase,
|
2005-10-10 20:25:02 +00:00
|
|
|
public wxScrollHelper
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1998-07-07 13:16:37 +00:00
|
|
|
public:
|
1998-10-26 17:11:33 +00:00
|
|
|
// creation
|
|
|
|
// --------
|
2005-10-10 20:25:02 +00:00
|
|
|
|
|
|
|
wxGenericTreeCtrl() : wxTreeCtrlBase(), wxScrollHelper(this) { Init(); }
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2004-06-17 16:22:36 +00:00
|
|
|
wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
1998-10-26 17:11:33 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2001-08-18 13:09:26 +00:00
|
|
|
long style = wxTR_DEFAULT_STYLE,
|
1999-02-22 11:01:13 +00:00
|
|
|
const wxValidator &validator = wxDefaultValidator,
|
1998-12-28 12:35:49 +00:00
|
|
|
const wxString& name = wxTreeCtrlNameStr)
|
2005-10-10 20:25:02 +00:00
|
|
|
: wxTreeCtrlBase(),
|
|
|
|
wxScrollHelper(this)
|
1998-10-26 17:11:33 +00:00
|
|
|
{
|
2000-09-08 13:52:10 +00:00
|
|
|
Init();
|
1998-12-17 14:07:46 +00:00
|
|
|
Create(parent, id, pos, size, style, validator, name);
|
1998-10-26 17:11:33 +00:00
|
|
|
}
|
|
|
|
|
2000-08-04 13:59:45 +00:00
|
|
|
virtual ~wxGenericTreeCtrl();
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2004-06-17 16:22:36 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
1998-10-26 17:11:33 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2001-08-18 13:09:26 +00:00
|
|
|
long style = wxTR_DEFAULT_STYLE,
|
1999-02-22 11:01:13 +00:00
|
|
|
const wxValidator &validator = wxDefaultValidator,
|
1998-12-28 12:35:49 +00:00
|
|
|
const wxString& name = wxTreeCtrlNameStr);
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2006-03-24 23:46:43 +00:00
|
|
|
virtual unsigned int GetCount() const;
|
2005-01-07 22:31:42 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual unsigned int GetIndent() const { return m_indent; }
|
|
|
|
virtual void SetIndent(unsigned int indent);
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void SetImageList(wxImageList *imageList);
|
|
|
|
virtual void SetStateImageList(wxImageList *imageList);
|
|
|
|
|
|
|
|
virtual wxString GetItemText(const wxTreeItemId& item) const;
|
2004-11-03 23:01:57 +00:00
|
|
|
virtual int GetItemImage(const wxTreeItemId& item,
|
1999-09-29 22:47:56 +00:00
|
|
|
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
|
|
|
virtual wxColour GetItemTextColour(const wxTreeItemId& item) const;
|
|
|
|
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
|
|
|
|
virtual wxFont GetItemFont(const wxTreeItemId& item) const;
|
|
|
|
|
|
|
|
virtual void SetItemText(const wxTreeItemId& item, const wxString& text);
|
|
|
|
virtual void SetItemImage(const wxTreeItemId& item,
|
|
|
|
int image,
|
|
|
|
wxTreeItemIcon which = wxTreeItemIcon_Normal);
|
|
|
|
virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
|
|
|
|
|
|
|
virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
|
|
|
|
virtual void SetItemBold(const wxTreeItemId& item, bool bold = true);
|
|
|
|
virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
|
|
|
|
virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
|
|
|
|
virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
|
|
|
|
virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font);
|
|
|
|
|
|
|
|
virtual bool IsVisible(const wxTreeItemId& item) const;
|
|
|
|
virtual bool ItemHasChildren(const wxTreeItemId& item) const;
|
|
|
|
virtual bool IsExpanded(const wxTreeItemId& item) const;
|
|
|
|
virtual bool IsSelected(const wxTreeItemId& item) const;
|
|
|
|
virtual bool IsBold(const wxTreeItemId& item) const;
|
|
|
|
|
|
|
|
virtual size_t GetChildrenCount(const wxTreeItemId& item,
|
|
|
|
bool recursively = true) const;
|
2002-12-04 14:11:26 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
// navigation
|
|
|
|
// ----------
|
2002-12-04 14:11:26 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemId GetRootItem() const { return m_anchor; }
|
2007-11-01 00:09:13 +00:00
|
|
|
virtual wxTreeItemId GetSelection() const
|
|
|
|
{
|
|
|
|
wxASSERT_MSG( !HasFlag(wxTR_MULTIPLE),
|
|
|
|
wxT("must use GetSelections() with this control") );
|
|
|
|
|
|
|
|
return m_current;
|
|
|
|
}
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual size_t GetSelections(wxArrayTreeItemIds&) const;
|
2002-12-04 14:11:26 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
|
|
|
|
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item,
|
|
|
|
wxTreeItemIdValue& cookie) const;
|
|
|
|
virtual wxTreeItemId GetNextChild(const wxTreeItemId& item,
|
|
|
|
wxTreeItemIdValue& cookie) const;
|
|
|
|
virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
|
|
|
virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
|
|
|
|
virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemId GetFirstVisibleItem() const;
|
|
|
|
virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
|
|
|
|
virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
// operations
|
|
|
|
// ----------
|
1998-12-07 18:23:57 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemId AddRoot(const wxString& text,
|
|
|
|
int image = -1, int selectedImage = -1,
|
|
|
|
wxTreeItemData *data = NULL);
|
2005-01-30 12:44:50 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void Delete(const wxTreeItemId& item);
|
|
|
|
virtual void DeleteChildren(const wxTreeItemId& item);
|
|
|
|
virtual void DeleteAllItems();
|
1999-12-06 13:18:14 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void Expand(const wxTreeItemId& item);
|
|
|
|
virtual void Collapse(const wxTreeItemId& item);
|
|
|
|
virtual void CollapseAndReset(const wxTreeItemId& item);
|
|
|
|
virtual void Toggle(const wxTreeItemId& item);
|
1999-12-06 13:18:14 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void Unselect();
|
|
|
|
virtual void UnselectAll();
|
|
|
|
virtual void SelectItem(const wxTreeItemId& item, bool select = true);
|
1999-12-06 13:18:14 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void EnsureVisible(const wxTreeItemId& item);
|
|
|
|
virtual void ScrollTo(const wxTreeItemId& item);
|
2001-04-24 16:38:02 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTextCtrl *EditLabel(const wxTreeItemId& item,
|
|
|
|
wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl));
|
|
|
|
virtual wxTextCtrl *GetEditControl() const;
|
|
|
|
virtual void EndEditLabel(const wxTreeItemId& item,
|
|
|
|
bool discardChanges = false);
|
1998-11-13 20:47:22 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual void SortChildren(const wxTreeItemId& item);
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
// items geometry
|
|
|
|
// --------------
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual bool GetBoundingRect(const wxTreeItemId& item,
|
|
|
|
wxRect& rect,
|
|
|
|
bool textOnly = false) const;
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
// this version specific methods
|
|
|
|
// -----------------------------
|
1999-06-01 15:32:12 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
wxImageList *GetButtonsImageList() const { return m_imageListButtons; }
|
|
|
|
void SetButtonsImageList(wxImageList *imageList);
|
|
|
|
void AssignButtonsImageList(wxImageList *imageList);
|
2002-12-29 07:48:21 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
void SetDropEffectAboveItem( bool above = false ) { m_dropEffectAboveItem = above; }
|
|
|
|
bool GetDropEffectAboveItem() const { return m_dropEffectAboveItem; }
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2000-08-18 12:45:21 +00:00
|
|
|
wxTreeItemId GetNext(const wxTreeItemId& item) const;
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_6
|
|
|
|
// use EditLabel() instead
|
|
|
|
void Edit( const wxTreeItemId& item ) { EditLabel(item); }
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_6
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2000-02-18 22:12:58 +00:00
|
|
|
// implementation only from now on
|
1999-09-29 22:47:56 +00:00
|
|
|
|
2001-08-25 12:06:53 +00:00
|
|
|
// overridden base class virtuals
|
|
|
|
virtual bool SetBackgroundColour(const wxColour& colour);
|
|
|
|
virtual bool SetForegroundColour(const wxColour& colour);
|
|
|
|
|
2006-07-24 18:18:34 +00:00
|
|
|
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual bool SetFont( const wxFont &font );
|
|
|
|
virtual void SetWindowStyle(const long styles);
|
|
|
|
|
1998-12-17 19:26:16 +00:00
|
|
|
// callbacks
|
1998-12-01 17:41:58 +00:00
|
|
|
void OnPaint( wxPaintEvent &event );
|
|
|
|
void OnSetFocus( wxFocusEvent &event );
|
|
|
|
void OnKillFocus( wxFocusEvent &event );
|
1998-10-26 17:11:33 +00:00
|
|
|
void OnChar( wxKeyEvent &event );
|
1998-12-01 17:41:58 +00:00
|
|
|
void OnMouse( wxMouseEvent &event );
|
2004-03-07 17:28:36 +00:00
|
|
|
void OnGetToolTip( wxTreeEvent &event );
|
2006-11-11 00:22:20 +00:00
|
|
|
void OnSize( wxSizeEvent &event );
|
2003-07-09 17:15:09 +00:00
|
|
|
void OnInternalIdle( );
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2004-05-06 21:01:24 +00:00
|
|
|
virtual wxVisualAttributes GetDefaultAttributes() const
|
|
|
|
{
|
|
|
|
return GetClassDefaultAttributes(GetWindowVariant());
|
|
|
|
}
|
|
|
|
|
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2000-02-18 22:12:58 +00:00
|
|
|
// implementation helpers
|
2005-10-10 20:25:02 +00:00
|
|
|
void AdjustMyScrollbars();
|
|
|
|
|
|
|
|
WX_FORWARD_TO_SCROLL_HELPER()
|
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
protected:
|
1999-06-13 15:24:01 +00:00
|
|
|
friend class wxGenericTreeItem;
|
1999-07-25 12:59:58 +00:00
|
|
|
friend class wxTreeRenameTimer;
|
2002-06-04 15:00:57 +00:00
|
|
|
friend class wxTreeFindTimer;
|
1999-07-25 12:59:58 +00:00
|
|
|
friend class wxTreeTextCtrl;
|
1999-06-13 15:24:01 +00:00
|
|
|
|
1999-11-09 14:48:41 +00:00
|
|
|
wxFont m_normalFont;
|
|
|
|
wxFont m_boldFont;
|
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
wxGenericTreeItem *m_anchor;
|
2002-06-04 15:00:57 +00:00
|
|
|
wxGenericTreeItem *m_current,
|
2003-05-01 15:37:30 +00:00
|
|
|
*m_key_current,
|
|
|
|
// A hint to select a parent item after deleting a child
|
|
|
|
*m_select_me;
|
2001-08-18 13:09:26 +00:00
|
|
|
unsigned short m_indent;
|
1998-10-26 17:11:33 +00:00
|
|
|
int m_lineHeight;
|
|
|
|
wxPen m_dottedPen;
|
2001-08-20 14:13:34 +00:00
|
|
|
wxBrush *m_hilightBrush,
|
|
|
|
*m_hilightUnfocusedBrush;
|
2001-08-18 13:09:26 +00:00
|
|
|
bool m_hasFocus;
|
|
|
|
bool m_dirty;
|
2005-10-10 20:25:02 +00:00
|
|
|
bool m_ownsImageListButtons;
|
2001-08-18 13:09:26 +00:00
|
|
|
bool m_isDragging; // true between BEGIN/END drag events
|
|
|
|
bool m_lastOnSame; // last click on the same item as prev
|
2005-10-10 20:25:02 +00:00
|
|
|
wxImageList *m_imageListButtons;
|
2000-02-18 22:12:58 +00:00
|
|
|
|
1999-01-08 20:33:18 +00:00
|
|
|
int m_dragCount;
|
1999-08-16 12:18:40 +00:00
|
|
|
wxPoint m_dragStart;
|
2000-02-18 22:12:58 +00:00
|
|
|
wxGenericTreeItem *m_dropTarget;
|
2000-02-21 14:35:44 +00:00
|
|
|
wxCursor m_oldCursor; // cursor is changed while dragging
|
|
|
|
wxGenericTreeItem *m_oldSelection;
|
2004-02-16 23:12:33 +00:00
|
|
|
wxGenericTreeItem *m_underMouse; // for visual effects
|
2002-12-11 09:08:46 +00:00
|
|
|
wxTreeTextCtrl *m_textCtrl;
|
2000-02-18 22:12:58 +00:00
|
|
|
|
1999-07-25 12:59:58 +00:00
|
|
|
wxTimer *m_renameTimer;
|
2002-06-04 15:00:57 +00:00
|
|
|
|
|
|
|
// incremental search data
|
|
|
|
wxString m_findPrefix;
|
|
|
|
wxTimer *m_findTimer;
|
2005-01-11 21:17:16 +00:00
|
|
|
|
2005-01-07 22:31:42 +00:00
|
|
|
bool m_dropEffectAboveItem;
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
// the common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2008-01-05 00:21:31 +00:00
|
|
|
// overridden wxWindow methods
|
|
|
|
virtual void DoThaw();
|
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
// misc helpers
|
2002-06-04 15:00:57 +00:00
|
|
|
void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
|
|
|
|
|
|
|
|
void DrawBorder(const wxTreeItemId& item);
|
|
|
|
void DrawLine(const wxTreeItemId& item, bool below);
|
|
|
|
void DrawDropEffect(wxGenericTreeItem *item);
|
|
|
|
|
2004-02-10 19:14:41 +00:00
|
|
|
void DoSelectItem(const wxTreeItemId& id,
|
2004-06-17 16:22:36 +00:00
|
|
|
bool unselect_others = true,
|
|
|
|
bool extended_select = false);
|
2004-02-10 19:14:41 +00:00
|
|
|
|
2008-06-16 17:50:40 +00:00
|
|
|
virtual int DoGetItemState(const wxTreeItemId& item) const;
|
|
|
|
virtual void DoSetItemState(const wxTreeItemId& item, int state);
|
|
|
|
|
2005-10-10 20:25:02 +00:00
|
|
|
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
|
|
|
|
size_t previous,
|
|
|
|
const wxString& text,
|
|
|
|
int image,
|
|
|
|
int selectedImage,
|
|
|
|
wxTreeItemData *data);
|
|
|
|
virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent,
|
|
|
|
const wxTreeItemId& idPrevious,
|
|
|
|
const wxString& text,
|
|
|
|
int image = -1, int selImage = -1,
|
|
|
|
wxTreeItemData *data = NULL);
|
2006-06-14 12:00:57 +00:00
|
|
|
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
|
2002-06-04 15:00:57 +00:00
|
|
|
|
2002-12-11 09:08:46 +00:00
|
|
|
// called by wxTextTreeCtrl when it marks itself for deletion
|
|
|
|
void ResetTextControl();
|
|
|
|
|
2002-06-04 15:00:57 +00:00
|
|
|
// find the first item starting with the given prefix after the given item
|
|
|
|
wxTreeItemId FindItem(const wxTreeItemId& id, const wxString& prefix) const;
|
|
|
|
|
2003-08-06 23:03:01 +00:00
|
|
|
bool HasButtons() const { return HasFlag(wxTR_HAS_BUTTONS); }
|
1998-10-26 17:11:33 +00:00
|
|
|
|
2001-08-18 13:09:26 +00:00
|
|
|
void CalculateLineHeight();
|
1999-06-13 15:24:01 +00:00
|
|
|
int GetLineHeight(wxGenericTreeItem *item) const;
|
1998-12-07 18:23:57 +00:00
|
|
|
void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y );
|
|
|
|
void PaintItem( wxGenericTreeItem *item, wxDC& dc);
|
1998-10-26 17:11:33 +00:00
|
|
|
|
|
|
|
void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
|
|
|
|
void CalculatePositions();
|
|
|
|
|
|
|
|
void RefreshSubtree( wxGenericTreeItem *item );
|
|
|
|
void RefreshLine( wxGenericTreeItem *item );
|
1999-07-30 22:45:55 +00:00
|
|
|
|
2001-08-20 14:13:34 +00:00
|
|
|
// redraw all selected items
|
|
|
|
void RefreshSelected();
|
|
|
|
|
|
|
|
// RefreshSelected() recursive helper
|
|
|
|
void RefreshSelectedUnder(wxGenericTreeItem *item);
|
|
|
|
|
1999-07-25 12:59:58 +00:00
|
|
|
void OnRenameTimer();
|
2002-07-08 16:38:46 +00:00
|
|
|
bool OnRenameAccept(wxGenericTreeItem *item, const wxString& value);
|
2002-09-05 19:50:41 +00:00
|
|
|
void OnRenameCancelled(wxGenericTreeItem *item);
|
1998-07-23 16:09:55 +00:00
|
|
|
|
1999-06-13 15:24:01 +00:00
|
|
|
void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const;
|
1999-06-01 15:32:12 +00:00
|
|
|
void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 );
|
|
|
|
bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
|
|
|
|
bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
|
|
|
|
void UnselectAllChildren( wxGenericTreeItem *item );
|
2004-11-24 15:03:28 +00:00
|
|
|
void ChildrenClosing(wxGenericTreeItem* item);
|
1999-06-01 15:32:12 +00:00
|
|
|
|
2006-07-24 18:12:23 +00:00
|
|
|
void DoDirtyProcessing();
|
|
|
|
|
2006-11-25 14:54:22 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
1998-07-07 13:16:37 +00:00
|
|
|
private:
|
1998-10-26 17:11:33 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2000-08-04 13:59:45 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
2003-01-02 23:38:11 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxGenericTreeCtrl)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2004-03-28 13:10:14 +00:00
|
|
|
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
|
2000-08-04 15:23:28 +00:00
|
|
|
/*
|
|
|
|
* wxTreeCtrl has to be a real class or we have problems with
|
|
|
|
* the run-time information.
|
|
|
|
*/
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxTreeCtrl: public wxGenericTreeCtrl
|
2000-08-04 15:23:28 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
|
|
|
|
2001-08-18 13:09:26 +00:00
|
|
|
public:
|
2000-08-04 15:23:28 +00:00
|
|
|
wxTreeCtrl() {}
|
|
|
|
|
2004-06-17 16:22:36 +00:00
|
|
|
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
2000-08-04 15:23:28 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2001-08-18 13:09:26 +00:00
|
|
|
long style = wxTR_DEFAULT_STYLE,
|
2000-08-04 15:23:28 +00:00
|
|
|
const wxValidator &validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxTreeCtrlNameStr)
|
2001-08-18 13:09:26 +00:00
|
|
|
: wxGenericTreeCtrl(parent, id, pos, size, style, validator, name)
|
2000-08-04 15:23:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2004-03-28 13:10:14 +00:00
|
|
|
#endif // !__WXMSW__ || __WXUNIVERSAL__
|
2000-08-04 15:23:28 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_TREECTRL
|
|
|
|
|
1998-10-26 17:11:33 +00:00
|
|
|
#endif // _GENERIC_TREECTRL_H_
|