X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a4f7b480c1132509b1890b90342744cd3013c517..78cb09ec439962b53ba75fef814b9a3871412287:/docs/latex/wx/listctrl.tex diff --git a/docs/latex/wx/listctrl.tex b/docs/latex/wx/listctrl.tex index 33777d9597..ac0fdfb739 100644 --- a/docs/latex/wx/listctrl.tex +++ b/docs/latex/wx/listctrl.tex @@ -38,6 +38,12 @@ Using many of wxListCtrl features is shown in the To intercept events from a list control, use the event table macros described in \helpref{wxListEvent}{wxlistevent}. +{\bf Mac Note:} Starting with 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 +mac.listctrl.always\_use\_generic \helpref{wxSystemOption}{wxsystemoptions} to +1. + \wxheading{Derived from} \helpref{wxControl}{wxcontrol}\\ @@ -49,6 +55,10 @@ in \helpref{wxListEvent}{wxlistevent}. +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{Window styles} \twocolwidtha{7cm} @@ -105,6 +115,22 @@ functions that take a \helpref{wxListEvent}{wxlistevent} argument. \twocolitem{{\bf EVT\_LIST\_CACHE\_HINT(id, func)}}{Prepare cache for a virtual list control} \end{twocollist}% +\wxheading{Column ordering} + +In report view, the control has several columns which are identified by their +internal indices. By default, these indices correspond to their order on +screen, i.e. the column $0$ appears first (in the left-to-right or maybe +right-to-left if the current language uses this writing direction), the column +$1$ next and so on. However it is possible to reorder the columns visual order +using \helpref{SetColumnsOrder}{wxlistctrlsetcolumnsorder} method and the +user can also rearrange the columns interactively by dragging them. In this +case, the index of the column is not the same as its order and the functions +\helpref{GetColumnOrder}{wxlistctrlgetcolumnorder} and +\helpref{GetColumnIndexFromOrder}{wxlistctrlgetcolumnindexfromorder} should be +used to translate between them. + +Please notice that current column reordering is implemented only in wxMSW. + \wxheading{See also} \helpref{wxListCtrl overview}{wxlistctrloverview}, \helpref{wxListView}{wxlistview}, \helpref{wxListBox}{wxlistbox},\rtfsp @@ -250,10 +276,12 @@ Ensures this item is visible. \membersection{wxListCtrl::FindItem}\label{wxlistctrlfinditem} -\func{long}{FindItem}{\param{long }{start}, \param{const wxString\& }{str}, \param{const bool }{partial = false}} +\func{long}{FindItem}{\param{long }{start}, \param{const wxString\& }{str}, \param{bool }{partial = false}} Find an item whose label matches this string, starting from {\it start} or -the beginning if {\it start} is -1. +the beginning if {\it start} is -1. The string comparison is case +insensitive. If {\it partial} is true then this method will look for +items which begin with {\it str}. \func{long}{FindItem}{\param{long }{start}, \param{long }{data}} @@ -309,6 +337,28 @@ Returns the number of columns. Gets the column width (report view only). +\membersection{wxListCtrl::GetColumnIndexFromOrder}\label{wxlistctrlgetcolumnindexfromorder} + +\constfunc{int}{GetColumnIndexFromOrder}{\param{int }{order}} + +Gets the column number by visual order index (report view only). + + +\membersection{wxListCtrl::GetColumnOrder}\label{wxlistctrlgetcolumnorder} + +\constfunc{int}{GetColumnOrder}{\param{int }{col}} + +Gets the column visual order index (valid in report view only). + + +\membersection{wxListCtrl::GetColumnsOrder}\label{wxlistctrlgetcolumnsorder} + +\constfunc{wxArrayInt}{GetColumnsOrder}{\void} + +Returns the array containing the orders of all columns. On error, an empty +array is returned. + + \membersection{wxListCtrl::GetCountPerPage}\label{wxlistctrlgetcountperpage} \constfunc{int}{GetCountPerPage}{\void} @@ -326,7 +376,8 @@ or small icon view). Returns the edit control being currently used to edit a label. Returns {\tt NULL} if no label is being edited. -{\bf NB:} It is currently only implemented for wxMSW. +{\bf NB:} It is currently only implemented for wxMSW and the generic version, +not for the native Mac OS X version. \membersection{wxListCtrl::GetImageList}\label{wxlistctrlgetimagelist} @@ -573,7 +624,7 @@ list or report views (this is a limitation of the native Win32 control). \membersection{wxListCtrl::HitTest}\label{wxlistctrlhittest} -\func{long}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}, \param{long\* }{ptrSubItem}} +\constfunc{long}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}, \param{long *}{ptrSubItem}} Determines which item (if any) is at the specified point, giving details in {\it flags}. Returns index of the item or {\tt wxNOT\_FOUND} @@ -823,6 +874,17 @@ will resize the column to the length of the header (Win32) or 80 pixels (other p In small or normal icon view, {\it col} must be -1, and the column width is set for all columns. +\membersection{wxListCtrl::SetColumnsOrder}\label{wxlistctrlsetcolumnsorder} + +\constfunc{bool}{SetColumnOrder}{\param{const wxArrayInt\& }{orders}} + +Sets the order of all columns at once. The \arg{orders} array must have the +same number elements as the number of columns and contain each position exactly +once. + +This function is valid in report view only. + + \membersection{wxListCtrl::SetImageList}\label{wxlistctrlsetimagelist} \func{void}{SetImageList}{\param{wxImageList*}{ imageList}, \param{int }{which}} @@ -934,6 +996,9 @@ from $0$ to {\it count}. Associates application-defined data with this item. +Notice that this function cannot be used to associate pointers with the control +items, use \helpref{SetItemPtrData}{wxlistctrlsetitemptrdata} instead. + \membersection{wxListCtrl::SetItemFont}\label{wxlistctrlsetitemfont} @@ -959,7 +1024,7 @@ used. \membersection{wxListCtrl::SetItemColumnImage}\label{wxlistctrlsetitemcolumnimage} -\func{bool}{SetItemImage}{\param{long }{item}, \param{long }{column}\param{int }{image}} +\func{bool}{SetItemColumnImage}{\param{long }{item}, \param{long }{column}, \param{int }{image}} Sets the image associated with the item. In report view, you can specify the column. The image is an index into the image list associated with the list control. @@ -972,6 +1037,18 @@ The image is an index into the image list associated with the list control. Sets the position of the item, in icon or small icon view. Windows only. +\membersection{wxListCtrl::SetItemPtrData}\label{wxlistctrlsetitemptrdata} + +\func{bool}{SetItemPtrData}{\param{long }{item}, \param{wxUIntPtr }{data}} + +Associates application-defined data with this item. The \arg{data} parameter may +be either an integer or a pointer cast to the \texttt{wxUIntPtr} type which is +guaranteed to be large enough to be able to contain all integer types and +pointers. + +\newsince{2.8.4} + + \membersection{wxListCtrl::SetItemState}\label{wxlistctrlsetitemstate} \func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}} @@ -1000,7 +1077,7 @@ The colour can be retrieved using \membersection{wxListCtrl::SetSingleStyle}\label{wxlistctrlsetsinglestyle} -\func{void}{SetSingleStyle}{\param{long }{style}, \param{const bool }{add = true}} +\func{void}{SetSingleStyle}{\param{long }{style}, \param{bool }{add = true}} Adds or removes a single window style.