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