X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64fa6f167ebb404e5441eddcee5bbd0808466d7a..58f1fdc926e4fc0f0b8ca49384d72e51bea2e86b:/docs/latex/wx/ctrlsub.tex?ds=sidebyside diff --git a/docs/latex/wx/ctrlsub.tex b/docs/latex/wx/ctrlsub.tex index 0848843058..d6f9040e6e 100644 --- a/docs/latex/wx/ctrlsub.tex +++ b/docs/latex/wx/ctrlsub.tex @@ -6,27 +6,27 @@ %% Created: 01.01.03 %% RCS-ID: $Id$ %% Copyright: (c) 2003 Vadim Zeitlin -%% License: wxWidgets license +%% License: wxWindows license %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\class{wxControlWithItems}}\label{wxcontrolwithitems} This class is an abstract base class for some wxWidgets controls which contain -several items, such as \helpref{wxListBox}{wxlistbox} and -\helpref{wxCheckListBox}{wxchecklistbox} derived from it, +several items, such as \helpref{wxListBox}{wxlistbox} and +\helpref{wxCheckListBox}{wxchecklistbox} derived from it, \helpref{wxChoice}{wxchoice} and \helpref{wxComboBox}{wxcombobox}. It defines the methods for accessing the controls items and although each of the derived classes implements them differently, they still all conform to the same interface. -The items in a wxControlWithItems have (non empty) string labels and, +The items in a wxControlWithItems have (non-empty) string labels and, optionally, client data associated with them. Client data may be of two different kinds: either simple untyped ({\tt void *}) pointers which are simply stored by the control but not used in any way by it, or typed pointers ({\tt wxClientData *}) which are owned by the control meaning that the typed -client data (and only it) will be deleted when an item is -\helpref{deleted}{wxcontrolwithitemsdelete} or the entire control is +client data (and only it) will be deleted when an item is +\helpref{deleted}{wxcontrolwithitemsdelete} or the entire control is \helpref{cleared}{wxcontrolwithitemsclear} (which also happens when it is destroyed). Finally note that in the same control all items must have client data of the same type (typed or untyped), if any. This type is determined by @@ -88,7 +88,7 @@ by the control. \membersection{wxControlWithItems::Delete}\label{wxcontrolwithitemsdelete} -\func{void}{Delete}{\param{int}{ n}} +\func{void}{Delete}{\param{unsigned int}{ n}} Deletes an item from the control. The client data associated with the item will be also deleted if it is owned by the control. @@ -107,7 +107,7 @@ items in the control. \membersection{wxControlWithItems::FindString}\label{wxcontrolwithitemsfindstring} -\func{int}{FindString}{\param{const wxString\& }{string}} +\func{int}{FindString}{\param{const wxString\& }{string}, \param{bool}{ caseSensitive = false}} Finds an item whose label matches the given string. @@ -115,6 +115,8 @@ Finds an item whose label matches the given string. \docparam{string}{String to find.} +\docparam{caseSensitive}{Whether search is case sensitive (default is not).} + \wxheading{Return value} The zero-based position of the item, or {\tt wxNOT\_FOUND} if the string was @@ -123,7 +125,7 @@ not found. \membersection{wxControlWithItems::GetClientData}\label{wxcontrolwithitemsgetclientdata} -\constfunc{void *}{GetClientData}{\param{int}{ n}} +\constfunc{void *}{GetClientData}{\param{unsigned int}{ n}} Returns a pointer to the client data associated with the given item (if any). It is an error to call this function for a control which doesn't have untyped @@ -141,7 +143,7 @@ A pointer to the client data, or {\tt NULL} if not present. \membersection{wxControlWithItems::GetClientObject}\label{wxcontrolwithitemsgetclientobject} -\constfunc{wxClientData *}{GetClientObject}{\param{int}{ n}} +\constfunc{wxClientData *}{GetClientObject}{\param{unsigned int}{ n}} Returns a pointer to the client data associated with the given item (if any). It is an error to call this function for a control which doesn't have typed @@ -159,7 +161,7 @@ A pointer to the client data, or {\tt NULL} if not present. \membersection{wxControlWithItems::GetCount}\label{wxcontrolwithitemsgetcount} -\constfunc{int}{GetCount}{\void} +\constfunc{unsigned int}{GetCount}{\void} Returns the number of items in the control. @@ -181,7 +183,7 @@ The position of the current selection. \wxheading{Remarks} -This method can be used with single selection list boxes only, you should use +This method can be used with single selection list boxes only, you should use \helpref{wxListBox::GetSelections}{wxlistboxgetselections} for the list boxes with {\tt wxLB\_MULTIPLE} style. @@ -193,7 +195,7 @@ with {\tt wxLB\_MULTIPLE} style. \membersection{wxControlWithItems::GetString}\label{wxcontrolwithitemsgetstring} -\constfunc{wxString}{GetString}{\param{int}{ n}} +\constfunc{wxString}{GetString}{\param{unsigned int}{ n}} Returns the label of the item with the given index. @@ -220,14 +222,14 @@ selected. \membersection{wxControlWithItems::Insert}\label{wxcontrolwithitemsinsert} -\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}} +\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}} Inserts the item into the list before pos. Not valid for {\tt wxLB\_SORT} or {\tt wxCB\_SORT} styles, use Append instead. -\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}, \param{void *}{clientData}} +\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}, \param{void *}{clientData}} -\func{int}{Insert}{\param{const wxString\& }{ item}, \param{int }{pos}, \param{wxClientData *}{clientData}} +\func{int}{Insert}{\param{const wxString\& }{ item}, \param{unsigned int }{pos}, \param{wxClientData *}{clientData}} Inserts the item into the list before pos, associating the given, typed or untyped, client data pointer with the item. @@ -264,14 +266,23 @@ Returns {\tt true} if the control is empty or {\tt false} if it has some items. {\bf Obsolescence note:} This method is obsolete and was replaced with \helpref{GetCount}{wxcontrolwithitemsgetcount}, please use the new method in -the new code. This method is only available if wxWidgets was compiled with +the new code. This method is only available if wxWidgets was compiled with {\tt WXWIN\_COMPATIBILITY\_2\_2} defined and will disappear completely in future versions. +\membersection{wxControlWithItems::Select}\label{wxcontrolwithitemsselect} + +\func{void}{Select}{\param{int}{ n}} + +This is the same as \helpref{SetSelection}{wxcontrolwithitemssetselection} and +exists only because it is slightly more natural for controls which support +multiple selection. + + \membersection{wxControlWithItems::SetClientData}\label{wxcontrolwithitemssetclientdata} -\func{void}{SetClientData}{\param{int}{ n}, \param{void *}{data}} +\func{void}{SetClientData}{\param{unsigned int}{ n}, \param{void *}{data}} Associates the given untyped client data pointer with the given item. Note that it is an error to call this function if any typed client data pointers had been @@ -286,9 +297,9 @@ associated with the control items before. \membersection{wxControlWithItems::SetClientObject}\label{wxcontrolwithitemssetclientobject} -\func{void}{SetClientObject}{\param{int}{ n}, \param{wxClientData *}{data}} +\func{void}{SetClientObject}{\param{unsigned int}{ n}, \param{wxClientData *}{data}} -Associates the given typed client data pointer with the given item: the +Associates the given typed client data pointer with the given item: the {\it data} object will be deleted when the item is deleted (either explicitly by using \helpref{Deletes}{wxcontrolwithitemsdelete} or implicitly when the control itself is destroyed). @@ -310,7 +321,8 @@ pointers had been associated with the control items before. Sets the selection to the given item \arg{n} or removes the selection entirely if \arg{n} $==$ {\tt wxNOT\_FOUND}. -Note that this does not cause any command events to be emitted. +Note that this does not cause any command events to be emitted nor does it +deselect any other items in the controls which support multiple selections. \wxheading{Parameters} @@ -324,7 +336,7 @@ Note that this does not cause any command events to be emitted. \membersection{wxControlWithItems::SetString}\label{wxcontrolwithitemssetstring} -\func{void}{SetString}{\param{int}{ n}, \param{const wxString\& }{ string}} +\func{void}{SetString}{\param{unsigned int}{ n}, \param{const wxString\& }{ string}} Sets the label for the given item. @@ -354,5 +366,3 @@ the control. \wxheading{See also} \helpref{SetSelection}{wxcontrolwithitemssetselection} - -