X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d62b2e2b1d3360461ed3d28e6a2be1474e99ae4..39601a7f74796aae377ad1520595f083fdafd7b6:/interface/wx/treectrl.h diff --git a/interface/wx/treectrl.h b/interface/wx/treectrl.h index 5d5df02adf..6897303738 100644 --- a/interface/wx/treectrl.h +++ b/interface/wx/treectrl.h @@ -60,7 +60,7 @@ for a particular toolkit. @endStyleTable - @beginEventTable{wxTreeEvent} + @beginEventEmissionTable{wxTreeEvent} @event{EVT_TREE_BEGIN_DRAG(id, func)} Begin dragging with the left mouse button. If you want to enable left-dragging you need to intercept this event @@ -150,9 +150,10 @@ public: Window identifier. The value @c wxID_ANY indicates a default value. @param pos Window position. + If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. If wxDefaultSize is specified then the window is sized - appropriately. + Window size. + If ::wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxTreeCtrl. @param validator @@ -417,6 +418,15 @@ public: */ virtual wxTreeItemId GetFirstVisibleItem() const; + /** + Returns the item last clicked or otherwise selected. + Unlike GetSelection(), it can be used whether or not + the control has the @c wxTR_MULTIPLE style. + + @since 2.9.1 + */ + virtual wxTreeItemId GetFocusedItem() const; + /** Returns the normal image list. */ @@ -565,7 +575,8 @@ public: /** Returns the selection, or an invalid item if there is no selection. This function only works with the controls without @c wxTR_MULTIPLE style, - use GetSelections() for the controls which do have this style. + use GetSelections() for the controls which do have this style + or, if a single item is wanted, use GetFocusedItem(). */ virtual wxTreeItemId GetSelection() const; @@ -774,6 +785,11 @@ public: /** Sets the item client data. + Notice that the client data previously associated with the @a item (if + any) is @em not freed by this function and so calling this function + multiple times for the same item will result in memory leaks unless you + delete the old item data pointer yourself. + @beginWxPythonOnly - @b SetPyData( @a item, @c obj): Associate the given Python Object with the wxTreeItemData for the given item Id. @@ -915,13 +931,15 @@ public: @beginEventTable{wxTreeEvent} @event{EVT_TREE_BEGIN_DRAG(id, func)} - Begin dragging with the left mouse button. - If you want to enable left-dragging you need to intercept this event - and explicitely call wxTreeEvent::Allow(), as it's vetoed by default. + Begin dragging with the left mouse button. If you want to enable + left-dragging you need to intercept this event and explicitely call + wxTreeEvent::Allow(), as it's vetoed by default. Also notice that the + control must have an associated image list (see SetImageList()) to + drag its items under MSW. @event{EVT_TREE_BEGIN_RDRAG(id, func)} - Begin dragging with the right mouse button. - If you want to enable right-dragging you need to intercept this event - and explicitely call wxTreeEvent::Allow(), as it's vetoed by default. + Begin dragging with the right mouse button. If you want to enable + right-dragging you need to intercept this event and explicitely call + wxTreeEvent::Allow(), as it's vetoed by default. @event{EVT_TREE_END_DRAG(id, func)} End dragging with the left or right mouse button. @event{EVT_TREE_BEGIN_LABEL_EDIT(id, func)}