X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c3627a004d0333ec7bfc88e2a397d7d7f9752ea9..11ef729d54ee338a1d569b5a238c2feb84d488ff:/docs/latex/wx/listctrl.tex diff --git a/docs/latex/wx/listctrl.tex b/docs/latex/wx/listctrl.tex index 434c995694..8c74191853 100644 --- a/docs/latex/wx/listctrl.tex +++ b/docs/latex/wx/listctrl.tex @@ -1,3 +1,14 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 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, @@ -9,10 +20,10 @@ A special case of report view quite different from the other modes of the list control is a virtual control in which the items data (including text, images and attributes) is managed by the main program and is requested by the control itself only when needed which allows to have controls with millions of items -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 +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{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 @@ -96,8 +107,8 @@ functions that take a \helpref{wxListEvent}{wxlistevent} argument. \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}}} @@ -111,7 +122,7 @@ Default constructor. \func{}{wxListCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp -\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}} +\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxListCtrlNameStr}} Constructor, creating and showing a list control. @@ -163,7 +174,7 @@ Arranges the items in icon or small icon view. This only has effect on Win32. {\ \func{void}{AssignImageList}{\param{wxImageList*}{ imageList}, \param{int }{which}} -Sets the image list associated with the control and +Sets the image list associated with the control and takes ownership of it (i.e. the control will, unlike when using SetImageList, delete the list when destroyed). {\it which} is one of wxIMAGE\_LIST\_NORMAL, wxIMAGE\_LIST\_SMALL, wxIMAGE\_LIST\_STATE (the last is unimplemented). @@ -184,7 +195,7 @@ Deletes all items and all columns. \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp -\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}} +\param{long}{ style = wxLC\_ICON}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxListCtrlNameStr}} Creates the list control. See \helpref{wxListCtrl::wxListCtrl}{wxlistctrlctor} for further details. @@ -251,7 +262,7 @@ the beginning if 'start' is -1. \func{long}{FindItem}{\param{long }{start}, \param{const wxPoint\& }{pt}, \param{int }{direction}} -Find an item nearest this position in the specified direction, starting from +Find an item nearest this position in the specified direction, starting from {\it start} or the beginning if {\it start} is -1. \pythonnote{In place of a single overloaded method name, wxPython @@ -377,6 +388,13 @@ Returns the number of items in the list control. 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}} @@ -394,7 +412,8 @@ returns a Wx::Point ( or undef ).} \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. @@ -467,7 +486,7 @@ This function may be used to find all selected items in the control like this: 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} @@ -579,8 +598,8 @@ implements the following methods:\par \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}} } @@ -638,9 +657,9 @@ method:\par \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 +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. @@ -655,10 +674,10 @@ The base class version always returns {\tt NULL}. \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} +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. @@ -673,9 +692,9 @@ The base class version always returns $-1$. \membersection{wxListCtrl::OnGetItemText}\label{wxlistctrlongetitemtext} -\func{virtual wxString}{OnGetItemText}{\param{long }{item}, \param{long }{column}} +\constfunc{virtual wxString}{OnGetItemText}{\param{long }{item}, \param{long }{column}} -This function {\bf must} be overloaded in the derived class for a control with +This function {\bf must} be overloaded in the derived class for a control with {\tt wxLC\_VIRTUAL} style. It should return the string containing the text of the given {\it column} for the specified {\tt item}. @@ -716,8 +735,8 @@ virtual list controls. \func{bool}{ScrollList}{\param{int }{dx}, \param{int }{dy}} -Scrolls the list control. If in icon, small icon or report view mode, -{\it dx} specifies the number of pixels to scroll. If in list view mode, +Scrolls the list control. If in icon, small icon or report view mode, +{\it dx} specifies the number of pixels to scroll. If in list view mode, {\it dx} specifies the number of columns to scroll. {\it dy} always specifies the number of pixels to scroll vertically. @@ -842,7 +861,7 @@ string or image at a given location.} Sets the background colour for this item. This function only works in report view. -The colour can be retrieved using +The colour can be retrieved using \helpref{GetItemBackgroundColour}{wxlistctrlgetitembackgroundcolour}. @@ -865,6 +884,13 @@ from $0$ to {\it count}. 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}} @@ -908,7 +934,7 @@ Sets the item text for this item. Sets the colour for this item. This function only works in report view. -The colour can be retrieved using +The colour can be retrieved using \helpref{GetItemTextColour}{wxlistctrlgetitemtextcolour}. @@ -972,4 +998,3 @@ 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.} -