+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name: listctrl.tex
+%% Purpose: wxListCtrl docs
+%% Author:
+%% Modified by:
+%% Created:
+%% RCS-ID: $Id$
+%% Copyright: (c) wxWidgets
+%% License: wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\section{\class{wxListCtrl}}\label{wxlistctrl}
A list control presents lists in a number of formats: list view, report view,
without consuming much memory. To use virtual list control you must use
\helpref{SetItemCount}{wxlistctrlsetitemcount} first and overload at least
\helpref{OnGetItemText}{wxlistctrlongetitemtext} (and optionally
-\helpref{OnGetItemImage}{wxlistctrlongetitemimage} and
+\helpref{OnGetItemImage}{wxlistctrlongetitemimage} or \helpref{OnGetItemColumnImage}{wxlistctrlongetitemcolumnimage} and
\helpref{OnGetItemAttr}{wxlistctrlongetitemattr}) 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
\wxheading{See also}
-\helpref{wxListCtrl overview}{wxlistctrloverview}, \helpref{wxListBox}{wxlistbox}, \helpref{wxTreeCtrl}{wxtreectrl},\rtfsp
-\helpref{wxImageList}{wximagelist}, \helpref{wxListEvent}{wxlistevent},
+\helpref{wxListCtrl overview}{wxlistctrloverview}, \helpref{wxListView}{wxlistview}, \helpref{wxListBox}{wxlistbox},\rtfsp
+\helpref{wxTreeCtrl}{wxtreectrl}, \helpref{wxImageList}{wximagelist}, \helpref{wxListEvent}{wxlistevent},
\helpref{wxListItem}{wxlistitem}
\latexignore{\rtfignore{\wxheading{Members}}}
Gets the application-defined data associated with this item.
+\membersection{wxListCtrl::GetItemFont}\label{wxlistctrlgetitemfont}
+
+\constfunc{wxFont}{GetItemFont}{\param{long }{item}}
+
+Returns the item's font.
+
+
\membersection{wxListCtrl::GetItemPosition}\label{wxlistctrlgetitemposition}
\constfunc{bool}{GetItemPosition}{\param{long }{item}, \param{wxPoint\& }{pos}}
\constfunc{bool}{GetItemRect}{\param{long }{item}, \param{wxRect\& }{rect}, \param{int }{code = wxLIST\_RECT\_BOUNDS}}
-Returns the rectangle representing the item's size and position, in client coordinates.
+Returns the rectangle representing the item's size and position, in physical
+coordinates.
{\it code} is one of wxLIST\_RECT\_BOUNDS, wxLIST\_RECT\_ICON, wxLIST\_RECT\_LABEL.
break;
// this item is selected - do whatever is needed with it
- wxLogMessage("Item %ld is selected."), item);
+ wxLogMessage("Item %ld is selected.", item);
}
\end{verbatim}
\twocolitem{wxLIST\_NEXT\_RIGHT}{Searches for an item to the right of the specified item.}
\end{twocollist}
-{\bf NB:} this parameters is only supported by wxMSW currently and ignored on
+{\bf NB:} this parameter is only supported by wxMSW currently and ignored on
other platforms.
{\it state} can be a bitlist of the following:
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf InsertColumn(col, heading, format=wxLIST\_FORMAT\_LEFT,
width=-1)}}{Creates a column using a header string only.}
-\twocolitem{{\bf InsertColumnInfo(col, item)}}{Creates a column using a
-wxListInfo.}
+\twocolitem{{\bf InsertColumnItem(col, item)}}{Creates a column using a
+wxListItem.}
\end{twocollist}}
}
\membersection{wxListCtrl::OnGetItemAttr}\label{wxlistctrlongetitemattr}
-\func{virtual wxListItemAttr *}{OnGetItemAttr}{\param{long }{item}}
+\constfunc{virtual wxListItemAttr *}{OnGetItemAttr}{\param{long }{item}}
This function may be overloaded in the derived class for a control with
{\tt wxLC\_VIRTUAL} style. It should return the attribute for the
for the specified {\tt item} or {\tt NULL} to use the default appearance
parameters.
+wxListCtrl will not delete the pointer or keep a reference of it. You can
+return the same wxListItemAttr pointer for every OnGetItemAttr call.
+
The base class version always returns {\tt NULL}.
\wxheading{See also}
\helpref{OnGetItemImage}{wxlistctrlongetitemimage},\\
+\helpref{OnGetItemColumnImage}{wxlistctrlongetitemcolumnimage},\\
\helpref{OnGetItemText}{wxlistctrlongetitemtext}
\membersection{wxListCtrl::OnGetItemImage}\label{wxlistctrlongetitemimage}
-\func{virtual int}{OnGetItemImage}{\param{long }{item}}
+\constfunc{virtual int}{OnGetItemImage}{\param{long }{item}}
This function must be overloaded in the derived class for a control with
{\tt wxLC\_VIRTUAL} style having an \helpref{image list}{wxlistctrlsetimagelist}
(if the control doesn't have an image list, it is not necessary to overload
it). It should return the index of the items image in the controls image list
or $-1$ for no image.
+In a control with {\tt wxLC\_REPORT} style, OnGetItemImage only gets called for
+the first column of each line.
The base class version always returns $-1$.
\wxheading{See also}
\helpref{OnGetItemText}{wxlistctrlongetitemtext},\\
+\helpref{OnGetItemColumnImage}{wxlistctrlongetitemcolumnimage},\\
\helpref{OnGetItemAttr}{wxlistctrlongetitemattr}
+\membersection{wxListCtrl::OnGetItemColumnImage}\label{wxlistctrlongetitemcolumnimage}
+
+\constfunc{virtual int}{OnGetItemColumnImage}{\param{long }{item}, \param{long }{column}}
+
+Overload this function in the derived class for a control with
+{\tt wxLC\_VIRTUAL} and {\tt wxLC\_REPORT} styles in order to specify the image
+index for the given line and column.
+
+The base class version always calls OnGetItemImage for the first column, else
+it returns $-1$.
+
+\wxheading{See also}
+
+\helpref{OnGetItemText}{wxlistctrlongetitemtext},\\
+\helpref{OnGetItemImage}{wxlistctrlongetitemimage},\\
+\helpref{OnGetItemAttr}{wxlistctrlongetitemattr}
\membersection{wxListCtrl::OnGetItemText}\label{wxlistctrlongetitemtext}
\helpref{SetItemCount}{wxlistctrlsetitemcount},\\
\helpref{OnGetItemImage}{wxlistctrlongetitemimage},\\
+\helpref{OnGetItemColumnImage}{wxlistctrlongetitemcolumnimage},\\
\helpref{OnGetItemAttr}{wxlistctrlongetitemattr}
Associates application-defined data with this item.
+\membersection{wxListCtrl::SetItemFont}\label{wxlistctrlsetitemfont}
+
+\func{void}{SetItemFont}{\param{long }{item}, \param{const wxFont\& }{font}}
+
+Sets the item's font.
+
+
\membersection{wxListCtrl::SetItemImage}\label{wxlistctrlsetitemimage}
\func{bool}{SetItemImage}{\param{long }{item}, \param{int }{image}}
parameters.}
\perlnote{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.}
+however, you may use a closure to achieve an effect similar to the
+SortItems third parameter.}