X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/25f701e6324fe5b1cf4c9b87621183ed4b863f64..29a35dd5fee0e33143a39824e71aefd66e3e4851:/include/wx/msw/treectrl.h?ds=sidebyside diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 18df088b58..41b8df96f1 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -127,6 +127,7 @@ public: virtual wxTreeItemId GetRootItem() const; virtual wxTreeItemId GetSelection() const; virtual size_t GetSelections(wxArrayTreeItemIds& selections) const; + virtual wxTreeItemId GetFocusedItem() const; virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, @@ -244,7 +245,13 @@ protected: return !HandleTreeEvent(event) || event.IsAllowed(); } - // handle a key event in a multi-selection control + // generate a wxEVT_KEY_DOWN event from the specified WPARAM/LPARAM values + // having the same meaning as for WM_KEYDOWN, return true if it was + // processed + bool MSWHandleTreeKeyDownEvent(WXWPARAM wParam, WXLPARAM lParam); + + // handle a key event in a multi-selection control, should be only called + // for keys which can be used to change the selection // // return true if the key was processed, false otherwise bool MSWHandleSelectionKey(unsigned vkey); @@ -264,6 +271,10 @@ private: void DoExpand(const wxTreeItemId& item, int flag); + void DoSelectItem(const wxTreeItemId& item, bool select = true); + void DoUnselectItem(const wxTreeItemId& item); + void DoToggleItemSelection(const wxTreeItemId& item); + void DoUnselectAll(); void DeleteTextCtrl(); @@ -272,6 +283,9 @@ 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); // the hash storing the items attributes (indexed by item ids) wxMapTreeAttr m_attrs; @@ -297,6 +311,10 @@ private: // whether focus was lost between subsequent clicks of a single item bool m_focusLost; + // set when we are changing selection ourselves (only used in multi + // selection mode) + bool m_changingSelection; + // whether we need to trigger a state image click event bool m_triggerStateImageClick;