X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38d7fa2525db147a278197a9e5a493305496a8a1..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/treelist.h diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index bace73cb6f..6928a2d91d 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -3,12 +3,45 @@ // Purpose: wxTreeListCtrl class documentation // Author: Vadim Zeitlin // Created: 2011-08-17 -// RCS-ID: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /** + wxTreeListCtrl styles. + + Notice that using wxTL_USER_3STATE implies wxTL_3STATE and wxTL_3STATE in + turn implies wxTL_CHECKBOX. +*/ +enum +{ + wxTL_SINGLE = 0x0000, /// This is the default anyhow. + wxTL_MULTIPLE = 0x0001, /// Allow multiple selection. + wxTL_CHECKBOX = 0x0002, /// Show checkboxes in the first column. + wxTL_3STATE = 0x0004, /// Allow 3rd state in checkboxes. + wxTL_USER_3STATE = 0x0008, /// Allow user to set 3rd state. + /** + Don't show the column headers. + + By default this control shows the column headers, using this class + allows to avoid this and show only the data. + + @since 2.9.5 + */ + wxTL_NO_HEADER = 0x0010, + + wxTL_DEFAULT_STYLE = wxTL_SINGLE, + wxTL_STYLE_MASK = wxTL_SINGLE | + wxTL_MULTIPLE | + wxTL_CHECKBOX | + wxTL_3STATE | + wxTL_USER_3STATE +}; + + +/** + @class wxTreeListItem + Unique identifier of an item in wxTreeListCtrl. This is an opaque class which can't be used by the application in any other @@ -38,7 +71,10 @@ public: bool IsOk() const; }; + /** + @class wxTreeListItemComparator + Class defining sort order for the items in wxTreeListCtrl. @see wxTreeListCtrl @@ -96,11 +132,13 @@ public: virtual ~wxTreeListItemComparator(); }; + /** Container of multiple items. */ typedef wxVector wxTreeListItems; + /** Special wxTreeListItem value meaning "insert before the first item". @@ -109,6 +147,7 @@ typedef wxVector wxTreeListItems; */ extern const wxTreeListItem wxTLI_FIRST; + /** Special wxTreeListItem value meaning "insert after the last item". @@ -117,7 +156,10 @@ extern const wxTreeListItem wxTLI_FIRST; */ extern const wxTreeListItem wxTLI_LAST; + /** + @class wxTreeListCtrl + A control combining wxTreeCtrl and wxListCtrl features. This is a multi-column tree control optionally supporting images and @@ -176,7 +218,7 @@ extern const wxTreeListItem wxTLI_LAST; @beginEventTable{wxTreeListEvent} @event{EVT_TREELIST_SELECTION_CHANGED(id, func)} - Process @c wxEVT_COMMAND_TREELIST_SELECTION_CHANGED event and notifies + Process @c wxEVT_TREELIST_SELECTION_CHANGED event and notifies about the selection change in the control. In the single selection case the item indicated by the event has been selected and previously selected item, if any, was deselected. In multiple selection case, the @@ -185,26 +227,26 @@ extern const wxTreeListItem wxTLI_LAST; could have changed as well, use wxTreeListCtrl::GetSelections() to retrieve the new selection if necessary. @event{EVT_TREELIST_ITEM_EXPANDING(id, func)} - Process @c wxEVT_COMMAND_TREELIST_ITEM_EXPANDING event notifying about + Process @c wxEVT_TREELIST_ITEM_EXPANDING event notifying about the given branch being expanded. This event is sent before the expansion occurs and can be vetoed to prevent it from happening. @event{EVT_TREELIST_ITEM_EXPANDED(id, func)} - Process @c wxEVT_COMMAND_TREELIST_ITEM_EXPANDED event notifying about + Process @c wxEVT_TREELIST_ITEM_EXPANDED event notifying about the expansion of the given branch. This event is sent after the expansion occurs and can't be vetoed. @event{EVT_TREELIST_ITEM_CHECKED(id, func)} - Process @c wxEVT_COMMAND_TREELIST_ITEM_CHECKED event notifying about + Process @c wxEVT_TREELIST_ITEM_CHECKED event notifying about the user checking or unchecking the item. You can use wxTreeListCtrl::GetCheckedState() to retrieve the new item state and wxTreeListEvent::GetOldCheckedState() to get the previous one. @event{EVT_TREELIST_ITEM_ACTIVATED(id, func)} - Process @c wxEVT_COMMAND_TREELIST_ITEM_ACTIVATED event notifying about + Process @c wxEVT_TREELIST_ITEM_ACTIVATED event notifying about the user double clicking the item or activating it from keyboard. @event{EVT_TREELIST_ITEM_CONTEXT_MENU(id, func)} - Process @c wxEVT_COMMAND_TREELIST_ITEM_CONTEXT_MENU event indicating + Process @c wxEVT_TREELIST_ITEM_CONTEXT_MENU event indicating that the popup menu for the given item should be displayed. @event{EVT_TREELIST_COLUMN_SORTED(id, func)} - Process @c wxEVT_COMMAND_TREELIST_COLUMN_SORTED event indicating that + Process @c wxEVT_TREELIST_COLUMN_SORTED event indicating that the control contents has just been resorted using the specified column. The event doesn't carry the sort direction, use GetSortColumn() method if you need to know it. @@ -417,6 +459,8 @@ public: wxTLI_FIRST or wxTLI_LAST indicating that the item should be either inserted before the first child of its parent (if any) or after the last one. + @param text + The item text. @param imageClosed The normal item image, may be NO_IMAGE to not show any image. @param imageOpened @@ -843,6 +887,8 @@ public: //@} }; + + /** Event generated by wxTreeListCtrl. @@ -851,6 +897,8 @@ public: class wxTreeListEvent : public wxNotifyEvent { public: + wxTreeListEvent(); + /** Return the item affected by the event. @@ -862,7 +910,7 @@ public: /** Return the previous state of the item checkbox. - This method can be used with @c wxEVT_COMMAND_TREELIST_ITEM_CHECKED + This method can be used with @c wxEVT_TREELIST_ITEM_CHECKED events only. Notice that the new state of the item can be retrieved using @@ -873,7 +921,7 @@ public: /** Return the column affected by the event. - This is currently only used with @c wxEVT_COMMAND_TREELIST_COLUMN_SORTED + This is currently only used with @c wxEVT_TREELIST_COLUMN_SORTED event. */ unsigned GetColumn() const; @@ -888,3 +936,12 @@ public: */ #define wxTreeListEventHandler(func) \ wxEVENT_HANDLER_CAST(wxTreeListEventFunction, func) + + +wxEventType wxEVT_TREELIST_SELECTION_CHANGED; +wxEventType wxEVT_TREELIST_ITEM_EXPANDING; +wxEventType wxEVT_TREELIST_ITEM_EXPANDED; +wxEventType wxEVT_TREELIST_ITEM_CHECKED; +wxEventType wxEVT_TREELIST_ITEM_ACTIVATED; +wxEventType wxEVT_TREELIST_ITEM_CONTEXT_MENU; +wxEventType wxEVT_TREELIST_COLUMN_SORTED;