X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cc81d32f2bf8c159f3b1bf6ddaf62e6d77720209..65baafba0e8cd74f2264b7e2f7625ff5bea84864:/docs/latex/wx/ctrlsub.tex diff --git a/docs/latex/wx/ctrlsub.tex b/docs/latex/wx/ctrlsub.tex index 55d6c1ac36..fcd01effb3 100644 --- a/docs/latex/wx/ctrlsub.tex +++ b/docs/latex/wx/ctrlsub.tex @@ -1,4 +1,4 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Name: ctrlsub.tex %% Purpose: wxControlWithItems documentation %% Author: Vadim Zeitlin @@ -7,11 +7,11 @@ %% RCS-ID: $Id$ %% Copyright: (c) 2003 Vadim Zeitlin %% License: wxWindows license -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\class{wxControlWithItems}}\label{wxcontrolwithitems} -This class is an abstract base class for some wxWindows controls which contain +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}. @@ -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 @@ -218,6 +220,35 @@ selected. \helpref{GetSelection}{wxcontrolwithitemsgetselection} +\membersection{wxControlWithItems::Insert}\label{wxcontrolwithitemsinsert} + +\func{int}{Insert}{\param{const wxString\& }{ item}, \param{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{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. +Not valid for {\tt wxLB\_SORT} or {\tt wxCB\_SORT} styles, use Append instead. + +\wxheading{Parameters} + +\docparam{item}{String to add.} + +\docparam{pos}{Position to insert item before, zero based.} + +\docparam{clientData}{Client data to associate with the item.} + +\wxheading{Return value} + +The return value is the index of the newly inserted item. If the insertion failed +for some reason, -1 is returned. + + \membersection{wxControlWithItems::IsEmpty}\label{wxcontrolwithitemsisempty} \constfunc{bool}{IsEmpty}{\void} @@ -235,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}} @@ -278,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} @@ -306,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. @@ -315,6 +358,11 @@ any command events being emitted. \docparam{string}{The string to select.} +\wxheading{Return value} + +\true if the specified string has been selected, \false if it wasn't found in +the control. + \wxheading{See also} \helpref{SetSelection}{wxcontrolwithitemssetselection}