X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/243dbf1a5088be31980df51b97831b52cb6986cd..5aa67d6619d7758bd66375ef75b698ae49f3418b:/docs/latex/wx/ctrlsub.tex diff --git a/docs/latex/wx/ctrlsub.tex b/docs/latex/wx/ctrlsub.tex index 80e9c90e60..032f4b9af4 100644 --- a/docs/latex/wx/ctrlsub.tex +++ b/docs/latex/wx/ctrlsub.tex @@ -11,9 +11,9 @@ \section{\class{wxControlWithItems}}\label{wxcontrolwithitems} -This class is an abstract base class for some wxWindows controls which contain -several items, such as \helpref{wxListBox}{wxlistbox} and -\helpref{wxCheckListBox}{wxchecklistbox} derived from it, +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, \helpref{wxChoice}{wxchoice} and \helpref{wxComboBox}{wxcombobox}. It defines the methods for accessing the controls items and although each of @@ -25,8 +25,8 @@ 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 @@ -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 @@ -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{size\_t}{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. @@ -264,11 +266,20 @@ 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 wxWindows 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}} @@ -288,7 +299,7 @@ associated with the control items before. \func{void}{SetClientObject}{\param{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). @@ -307,8 +318,11 @@ pointers had been associated with the control items before. \func{void}{SetSelection}{\param{int}{ n}} -Sets the choice by passing the desired string position. This does not cause -any command events to get emitted. +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 nor does it +deselect any other items in the controls which support multiple selections. \wxheading{Parameters} @@ -335,7 +349,7 @@ Sets the label for the given item. \membersection{wxControlWithItems::SetStringSelection}\label{wxcontrolwithitemssetstringselection} -\func{void}{SetStringSelection}{\param{const wxString\& }{ string}} +\func{bool}{SetStringSelection}{\param{const wxString\& }{ string}} Selects the item with the specified string in the control. This doesn't cause any command events being emitted. @@ -344,8 +358,11 @@ any command events being emitted. \docparam{string}{The string to select.} -\wxheading{See also} +\wxheading{Return value} -\helpref{SetSelection}{wxcontrolwithitemssetselection} +\true if the specified string has been selected, \false if it wasn't found in +the control. +\wxheading{See also} +\helpref{SetSelection}{wxcontrolwithitemssetselection}