X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd9811b13784a58dd58126bc4b7d5f4c195839b2..a977709b11432e05af48e205cc02c0a0ad4ecf16:/docs/latex/wx/listbox.tex?ds=inline diff --git a/docs/latex/wx/listbox.tex b/docs/latex/wx/listbox.tex index ea6620608f..5954ebf2a3 100644 --- a/docs/latex/wx/listbox.tex +++ b/docs/latex/wx/listbox.tex @@ -7,7 +7,8 @@ is selected, the previous selection is removed) or multiple selection (clicking an item toggles the item on or off independently of other selections). -List box elements are numbered from zero. +List box elements are numbered from zero. Their number is limited in +some platforms (e.g. ca. 2000 on GTK). A listbox callback gets an event wxEVT\_COMMAND\_LISTBOX\_SELECT for single clicks, and wxEVT\_COMMAND\_LISTBOX\_DOUBLE\_CLICKED for double clicks. @@ -38,6 +39,10 @@ select multiple items using the SHIFT key and the mouse or special key combinati \twocolitem{\windowstyle{wxLB\_SORT}}{The listbox contents are sorted in alphabetical order.} \end{twocollist} +Note that {\tt wxLB\_SINGLE}, {\tt wxLB\_MULTIPLE} and {\tt wxLB\_EXTENDED} +styles are mutually exclusive and you can specify at most one of them (single +selection is the default). + See also \helpref{window styles overview}{windowstyles}. \wxheading{Event handling} @@ -95,11 +100,12 @@ appropriately.} \helpref{wxListBox::Create}{wxlistboxcreate}, \helpref{wxValidator}{wxvalidator} -\pythonnote{The wxListBox constructor in wxPython reduces the \tt{n} -and \tt{choices} arguments are to a single argument, which is +\pythonnote{The wxListBox constructor in wxPython reduces the {\tt n} +and {\tt choices} arguments are to a single argument, which is a list of strings.} - +\perlnote{In wxPerl there is just an array reference in place of {\tt n} +and {\tt choices}.} \membersection{wxListBox::\destruct{wxListBox}} @@ -113,7 +119,7 @@ Destructor, destroying the list box. Adds the item to the end of the list box. -\func{void}{Append}{\param{const wxString\& }{ item}, \param{char* }{clientData}} +\func{void}{Append}{\param{const wxString\& }{ item}, \param{void* }{clientData}} Adds the item to the end of the list box, associating the given data with the item. @@ -180,7 +186,7 @@ The zero-based position of the item, or -1 if the string was not found. \membersection{wxListBox::GetClientData}\label{wxlistboxgetclientdata} -\constfunc{char*}{GetClientData}{\param{int}{ n}} +\constfunc{void*}{GetClientData}{\param{int}{ n}} Returns a pointer to the client data associated with the given item (if any). @@ -192,6 +198,12 @@ Returns a pointer to the client data associated with the given item (if any). A pointer to the client data, or NULL if not present. +\membersection{wxListBox::GetCount}\label{wxlistboxgetcount} + +\constfunc{int}{GetCount}{\void} + +Returns the number of items in the listbox. + \membersection{wxListBox::GetSelection}\label{wxlistboxgetselection} \constfunc{int}{GetSelection}{\void} @@ -214,7 +226,7 @@ Applicable to single selection list boxes only. \membersection{wxListBox::GetSelections}\label{wxlistboxgetselections} -\constfunc{int}{GetSelections}{\param{wxArrayInt&}{selections}} +\constfunc{int}{GetSelections}{\param{wxArrayInt\& }{selections}} Fill an array of ints with the positions of the currently selected items. @@ -239,6 +251,9 @@ Use this with a multiple selection listbox. \pythonnote{The wxPython version of this method takes no parameters and returns a tuple of the selected items.} +\perlnote{In wxPerl this method takes no parameters and returna the +selected items as a list.} + \membersection{wxListBox::GetString}\label{wxlistboxgetstring} \constfunc{wxString}{GetString}{\param{int}{ n}} @@ -282,10 +297,22 @@ Insert the given number of strings before the specified position. \docparam{pos}{Position before which to insert the items: for example, if {\it pos} is 0 the items will be inserted in the beginning of the listbox} +\pythonnote{The first two parameters are collapsed into a single +parameter for wxPython, which is a list of strings.} + +\perlnote{In wxPerl there is just an array reference in place of {\tt nItems} +and {\tt items}.} + \membersection{wxListBox::Number}\label{wxlistboxnumber} \constfunc{int}{Number}{\void} +{\bf Obsolescence note:} This method is obsolete and was replaced with +\helpref{GetCount}{wxlistboxgetcount}, please use the new method in the new +code. This method is only available if wxWindows was compiled with +{\tt WXWIN\_COMPATIBILITY\_2\_2} defined and will disappear completely in +future versions. + Returns the number of items in the listbox. \membersection{wxListBox::Selected}\label{wxlistboxselected} @@ -306,7 +333,7 @@ TRUE if the given item is selected, FALSE otherwise. \func{void}{Set}{\param{int}{ n}, \param{const wxString*}{ choices}} -Clears the list box and adds the given strings. +Clears the list box and adds the given strings. Not implemented for GTK. \wxheading{Parameters} @@ -321,7 +348,7 @@ after this function has been called. \membersection{wxListBox::SetClientData}\label{wxlistboxsetclientdata} -\func{void}{SetClientData}{\param{int}{ n}, \param{char* }{data}} +\func{void}{SetClientData}{\param{int}{ n}, \param{void* }{data}} Associates the given client data pointer with the given item.