X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56873923f39af96aac6bfc5776d2637b8c4623ca..68fe70ea1f131471b82747ee2759dba7a19a0c23:/include/wx/msw/treectrl.h?ds=sidebyside diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 60abe8cbf8..a16b068984 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -233,6 +233,28 @@ protected: // obtain the user data for the lParam member of TV_ITEM class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const; + // update the event to include the items client data and pass it to + // HandleWindowEvent(), return true if it processed it + bool HandleTreeEvent(wxTreeEvent& event) const; + + // pass the event to HandleTreeEvent() and return true if the event was + // either unprocessed or not vetoed + bool IsTreeEventAllowed(wxTreeEvent& event) const + { + return !HandleTreeEvent(event) || event.IsAllowed(); + } + + // 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); + // data used only while editing the item label: wxTextCtrl *m_textCtrl; // text control in which it is edited @@ -242,20 +264,27 @@ private: // the common part of all ctors void Init(); - // helper functions: DoGetItem() doesn't work for hidden virtual root item - // while DoGetPossiblyRootItem() does + // helper functions bool DoGetItem(wxTreeViewItem *tvItem) const; - bool DoGetPossiblyRootItem(wxTreeViewItem *tvItem) const; void DoSetItem(wxTreeViewItem *tvItem); 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(); // return true if the item is the hidden root one (i.e. it's the root item // 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; @@ -275,11 +304,24 @@ private: wxTreeItemId m_htSelStart, m_htClickedItem; wxPoint m_ptClick; + // whether dragging has started + bool m_dragStarted; + + // 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; + friend class wxTreeItemIndirectData; friend class wxTreeSortHelper; DECLARE_DYNAMIC_CLASS(wxTreeCtrl) - DECLARE_NO_COPY_CLASS(wxTreeCtrl) + wxDECLARE_NO_COPY_CLASS(wxTreeCtrl); }; #endif // wxUSE_TREECTRL