X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7dac12efa723086f1de9bd2d496168587f736ce9..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/msw/treectrl.h diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index a16b068984..5eeede8598 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: Vadim Zeitlin to be less MSW-specific on 10/10/98 // Created: 01/02/97 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -127,6 +126,11 @@ public: virtual wxTreeItemId GetRootItem() const; virtual wxTreeItemId GetSelection() const; virtual size_t GetSelections(wxArrayTreeItemIds& selections) const; + virtual wxTreeItemId GetFocusedItem() const; + + virtual void ClearFocusedItem(); + virtual void SetFocusedItem(const wxTreeItemId& item); + virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, @@ -161,12 +165,13 @@ public: virtual void Unselect(); virtual void UnselectAll(); virtual void SelectItem(const wxTreeItemId& item, bool select = true); + virtual void SelectChildren(const wxTreeItemId& parent); virtual void EnsureVisible(const wxTreeItemId& item); virtual void ScrollTo(const wxTreeItemId& item); virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, - wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl)); + wxClassInfo* textCtrlClass = wxCLASSINFO(wxTextCtrl)); virtual wxTextCtrl *GetEditControl() const; virtual void EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool discardChanges = false) @@ -206,6 +211,14 @@ public: virtual bool CanApplyThemeBorder() const { return false; } protected: + // Implement "update locking" in a custom way for this control. + virtual void DoFreeze(); + virtual void DoThaw(); + + virtual void DoSetSize(int x, int y, + int width, int height, + int sizeFlags = wxSIZE_AUTO); + // SetImageList helper void SetAnyImageList(wxImageList *imageList, int which); @@ -275,6 +288,7 @@ private: void DoToggleItemSelection(const wxTreeItemId& item); void DoUnselectAll(); + void DoSelectChildren(const wxTreeItemId& parent); void DeleteTextCtrl(); @@ -282,9 +296,14 @@ private: // and the tree has wxTR_HIDE_ROOT style) bool IsHiddenRoot(const wxTreeItemId& item) const; - // clears/sets the currently focused item - void ClearFocusedItem(); - void SetFocusedItem(const wxTreeItemId& item); + + // check if the given flags (taken from TV_HITTESTINFO structure) + // indicate a position "on item": this is less trivial than just checking + // for TVHT_ONITEM because we consider that points to the left and right of + // item text are also "on item" when wxTR_FULL_ROW_HIGHLIGHT is used as the + // item visually spans the entire breadth of the window then + bool MSWIsOnItem(unsigned flags) const; + // the hash storing the items attributes (indexed by item ids) wxMapTreeAttr m_attrs; @@ -317,6 +336,12 @@ private: // whether we need to trigger a state image click event bool m_triggerStateImageClick; + // whether we need to deselect other items on mouse up + bool m_mouseUpDeselect; + + // The size to restore the control to when it is thawed, see DoThaw(). + wxSize m_thawnSize; + friend class wxTreeItemIndirectData; friend class wxTreeSortHelper;