X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eab1336c903271946530509a6c7939eba54371e6..2028c33ab5a39a12bd410ac953731a56ad6377ba:/interface/wx/listctrl.h diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index d7f0e2ba06..860049943c 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -23,6 +23,7 @@ (and optionally wxListCtrl::OnGetItemImage or wxListCtrl::OnGetItemColumnImage and wxListCtrl::OnGetItemAttr) to return the information about the items when the control requests it. + Virtual list control can be used as a normal one except that no operations which can take time proportional to the number of items in the control happen -- this is required to allow having a practically infinite number of items. @@ -39,19 +40,19 @@ wxMac Note: Starting with wxWidgets 2.8, wxListCtrl uses a native implementation for report mode, and uses a generic implementation for other modes. You can use the generic implementation for report mode as well by setting - the @c mac.listctrl.always_use_generic system option (see wxSystemOption) to 1. + the @c mac.listctrl.always_use_generic system option (see wxSystemOptions) to 1. @beginStyleTable @style{wxLC_LIST} Multicolumn list view, with optional small icons. Columns are computed automatically, i.e. you don't set columns as in - wxLC_REPORT. In other words, the list wraps, unlike a wxListBox. + @c wxLC_REPORT. In other words, the list wraps, unlike a wxListBox. @style{wxLC_REPORT} Single or multicolumn report view, with optional header. @style{wxLC_VIRTUAL} The application provides items text on demand. May only be used - with wxLC_REPORT. + with @c wxLC_REPORT. @style{wxLC_ICON} Large icon view, with optional labels. @style{wxLC_SMALL_ICON} @@ -82,7 +83,7 @@ @endStyleTable - @beginEventTable{wxListEvent} + @beginEventEmissionTable{wxListEvent} @event{EVT_LIST_BEGIN_DRAG(id, func)} Begin dragging with the left mouse button. @event{EVT_LIST_BEGIN_RDRAG(id, func)} @@ -150,9 +151,10 @@ public: Window identifier. The value 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. + If ::wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxListCtrl. @param validator @@ -255,6 +257,8 @@ public: beginning if start is @c -1. The string comparison is case insensitive. If @a partial is @true then this method will look for items which begin with @a str. + + @return The next matching item if any or @c -1 (wxNOT_FOUND) otherwise. */ long FindItem(long start, const wxString& str, bool partial = false); @@ -262,18 +266,35 @@ public: /** Find an item whose data matches this data, starting from start or the beginning if 'start' is @c -1. + + @beginWxPerlOnly + In wxPerl this method is implemented as FindItemData(start, data). + @endWxPerlOnly + + @return The next matching item if any or @c -1 (wxNOT_FOUND) otherwise. */ long FindItem(long start, wxUIntPtr data); /** Find an item nearest this position in the specified direction, starting from @a start or the beginning if @a start is -1. + + @beginWxPerlOnly + In wxPerl this method is implemented as FindItemAtPos(start, pt, direction). + @endWxPerlOnly + + @return The next matching item if any or @c -1 (wxNOT_FOUND) otherwise. */ long FindItem(long start, const wxPoint& pt, int direction); /** Gets information about this column. See SetItem() for more information. + + @beginWxPerlOnly + In wxPerl this method takes only the @a col parameter and + returns a @c Wx::ListItem (or @c undef). + @endWxPerlOnly */ bool GetColumn(int col, wxListItem& item) const; @@ -357,6 +378,11 @@ public: You must call @e info.SetId() to set the ID of item you're interested in before calling this method, and @e info.SetMask() with the flags indicating what fields you need to retrieve from @a info. + + @beginWxPerlOnly + In wxPerl this method takes as parameter the ID of the item + and (optionally) the column, and returns a Wx::ListItem object. + @endWxPerlOnly */ bool GetItem(wxListItem& info) const; @@ -386,6 +412,11 @@ public: /** Returns the position of the item, in icon or small icon view. + + @beginWxPerlOnly + In wxPerl this method takes only the @a item parameter and + returns a @c Wx::Point (or @c undef). + @endWxPerlOnly */ bool GetItemPosition(long item, wxPoint& pos) const; @@ -394,6 +425,11 @@ public: coordinates. @a code is one of wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON, wxLIST_RECT_LABEL. + + @beginWxPerlOnly + In wxPerl this method takes only the @a item and @a code parameters and + returns a @c Wx::Rect (or @c undef). + @endWxPerlOnly */ bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const; @@ -539,6 +575,11 @@ public: the host system or the value stored in @a ptrSubItem will be always -1. To compile this feature into wxWidgets library you need to have access to commctrl.h of version 4.70 that is provided by Microsoft. + + @beginWxPerlOnly + In wxPerl this method only takes the @a point parameter + and returns a 2-element list (item, flags). + @endWxPerlOnly */ long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const; @@ -569,6 +610,10 @@ public: Index of the new item, supplied by the application @param label String label + + @beginWxPerlOnly + In wxPerl this method is implemented as InsertStringItem(index, label). + @endWxPerlOnly */ long InsertItem(long index, const wxString& label); @@ -579,6 +624,10 @@ public: Index of the new item, supplied by the application @param imageIndex Index into the image list associated with this control and view style + + @beginWxPerlOnly + In wxPerl this method is implemented as InsertImageItem(index, imageIndex). + @endWxPerlOnly */ long InsertItem(long index, int imageIndex); @@ -591,6 +640,10 @@ public: String label @param imageIndex Index into the image list associated with this control and view style + + @beginWxPerlOnly + In wxPerl this method is implemented as InsertImageStringItem(index, label, imageIndex). + @endWxPerlOnly */ long InsertItem(long index, const wxString& label, int imageIndex); @@ -841,7 +894,7 @@ public: using the specified @a fnSortCallBack function. This function must have the following prototype: @code - int wxCALLBACK wxListCompareFunction(long item1, long item2, long sortData) + int wxCALLBACK wxListCompareFunction(long item1, long item2, wxIntPtr sortData) @endcode It is called each time when the two items must be compared and should return 0 @@ -858,8 +911,14 @@ public: items in the control. Please see the @ref page_samples_listctrl for an example of using this function. + + @beginWxPerlOnly + In wxPerl the comparison function must take just two parameters; + however, you may use a closure to achieve an effect similar to the + SortItems third parameter. + @endWxPerlOnly */ - bool SortItems(wxListCtrlCompare fnSortCallBack, long data); + bool SortItems(wxListCtrlCompare fnSortCallBack, wxIntPtr data); protected: @@ -1083,7 +1142,7 @@ public: Represents the attributes (color, font, ...) of a wxListCtrl's wxListItem. @library{wxbase} - @category{ctrl} + @category{data} @see @ref overview_listctrl, wxListCtrl, wxListItem */ @@ -1295,7 +1354,7 @@ enum wxListColumnFormat If the colour/font is not specified, the default list control colour/font is used. @library{wxbase} - @category{ctrl} + @category{data} @see wxListCtrl */