X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afbe150a7625268fb9fcc1a770dfb7d7bd218e01..a75124d0da255513e83d2e62f963dd849829466b:/docs/latex/wx/ctrlsub.tex diff --git a/docs/latex/wx/ctrlsub.tex b/docs/latex/wx/ctrlsub.tex index 032f4b9af4..deae9e7dca 100644 --- a/docs/latex/wx/ctrlsub.tex +++ b/docs/latex/wx/ctrlsub.tex @@ -20,7 +20,7 @@ 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 @@ -44,6 +44,10 @@ client data pointer) or \helpref{SetClientData}{wxcontrolwithitemssetclientdata} but usually never included directly +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \latexignore{\rtfignore{\wxheading{Members}}} \membersection{wxControlWithItems::Append}\label{wxcontrolwithitemsappend} @@ -61,15 +65,27 @@ untyped, client data pointer with the item. \func{void}{Append}{\param{const wxArrayString\& }{strings}} +\func{void}{Append}{\param{unsigned int }{n},\param{const wxString* }{strings}} + +\func{void}{Append}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{void **}{clientData}} + +\func{void}{Append}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{wxClientData **}{clientData}} + Appends several items at once to the control. Notice that calling this method -may be much faster than appending the items one by one if you need to add a lot +is usually much faster than appending them one by one if you need to add a lot of items. \wxheading{Parameters} \docparam{item}{String to add.} -\docparam{clientData}{Client data to associate with the item.} +\docparam{stringsArray}{Contains items to append to the control.} + +\docparam{strings}{Array of strings of size \arg{n}.} + +\docparam{n}{Number of items in the \arg{strings} array.} + +\docparam{clientData}{Array of client data pointers of size \arg{n} to associate with the new items.} \wxheading{Return value} @@ -88,7 +104,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. @@ -125,7 +141,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 @@ -143,7 +159,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 @@ -161,7 +177,7 @@ A pointer to the client data, or {\tt NULL} if not present. \membersection{wxControlWithItems::GetCount}\label{wxcontrolwithitemsgetcount} -\constfunc{size\_t}{GetCount}{\void} +\constfunc{unsigned int}{GetCount}{\void} Returns the number of items in the control. @@ -195,7 +211,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. @@ -208,6 +224,13 @@ Returns the label of the item with the given index. The label of the item or an empty string if the position was invalid. +\membersection{wxControlWithItems::GetStrings}\label{wxcontrolwithitemsgetstrings} + +\constfunc{wxArrayString}{GetStrings}{\void} + +Returns the array of the labels of all items in the control. + + \membersection{wxControlWithItems::GetStringSelection}\label{wxcontrolwithitemsgetstringselection} \constfunc{wxString}{GetStringSelection}{\void} @@ -222,26 +245,47 @@ 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. Not valid for {\tt wxLB\_SORT} or {\tt wxCB\_SORT} styles, use Append instead. +\func{void}{Insert}{\param{const wxArrayString\& }{strings}, \param{unsigned int }{pos}} + +\func{void}{Insert}{\param{const wxArrayString\& }{strings}, \param{unsigned int }{pos}} + +\func{void}{Insert}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{unsigned int }{pos}} + +\func{void}{Insert}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{unsigned int }{pos}, \param{void **}{clientData}} + +\func{void}{Insert}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{unsigned int }{pos}, \param{wxClientData **}{clientData}} + +Inserts several items at once into the control. Notice that calling this method +is usually much faster than inserting them one by one if you need to insert a lot +of items. + + \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.} +\docparam{stringsArray}{Contains items to insert into the control content} + +\docparam{strings}{Array of strings of size \arg{n}.} + +\docparam{n}{Number of items in the \arg{strings} array.} + +\docparam{clientData}{Array of client data pointers of size \arg{n} to associate with the new items.} \wxheading{Return value} @@ -260,17 +304,6 @@ Returns {\tt true} if the control is empty or {\tt false} if it has some items. \helpref{GetCount}{wxcontrolwithitemsgetcount} -\membersection{wxControlWithItems::Number}\label{wxcontrolwithitemsnumber} - -\constfunc{int}{Number}{\void} - -{\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 -{\tt WXWIN\_COMPATIBILITY\_2\_2} defined and will disappear completely in -future versions. - - \membersection{wxControlWithItems::Select}\label{wxcontrolwithitemsselect} \func{void}{Select}{\param{int}{ n}} @@ -280,9 +313,56 @@ exists only because it is slightly more natural for controls which support multiple selection. +\membersection{wxControlWithItems::Set}\label{wxcontrolwithitemsset} + +\func{int}{Set}{\param{const wxString\& }{ item}} + +\func{int}{Set}{\param{const wxString\& }{ item}, \param{void *}{clientData}} + +\func{int}{Set}{\param{const wxString\& }{ item}, \param{wxClientData *}{clientData}} + +Replace control items with the (only) item specified, associating the typed or +untyped client data pointer with it if given. + +\func{void}{Set}{\param{const wxArrayString\& }{stringsArray}} + +\func{void}{Set}{\param{unsigned int }{n},\param{const wxString* }{strings}} + +\func{void}{Set}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{void **}{clientData}} + +\func{void}{Set}{\param{unsigned int }{n},\param{const wxString* }{strings}, \param{wxClientData **}{clientData}} + +Replaces the current control contents with the given items. Notice that calling +this method is much faster than appending the items one by one if you need to +append a lot of them. + +\wxheading{Parameters} + +\docparam{item}{The single item to insert into the control.} + +\docparam{stringsArray}{Contains items to set as control content.} + +\docparam{strings}{Raw C++ array of strings. Only used in conjunction with 'n'.} + +\docparam{n}{Number of items passed in 'strings'. Only used in conjunction with 'strings'.} + +\docparam{clientData}{Client data to associate with the item(s).} + +\wxheading{Return value} + +When the control is sorted (e.g. has {\tt wxLB\_SORT} or {\tt wxCB\_SORT} style) +the return value could be different from (GetCount() - 1). +When setting a single item to the container, the return value is the index of the +newly added item which may be different from the last one if the control is sorted +(e.g. has {\tt wxLB\_SORT} or {\tt wxCB\_SORT} style). + +By default this method subsequently calls \helpref{Clear}{wxcontrolwithitemsclear} +and \helpref{Append}{wxcontrolwithitemsappend}. + + \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 @@ -297,7 +377,7 @@ 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 {\it data} object will be deleted when the item is deleted (either explicitly @@ -336,7 +416,7 @@ deselect any other items in the controls which support multiple selections. \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. @@ -352,7 +432,7 @@ Sets the label for the given item. \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. +any command events to be emitted. \wxheading{Parameters} @@ -366,3 +446,4 @@ the control. \wxheading{See also} \helpref{SetSelection}{wxcontrolwithitemssetselection} +