wxchoicea choice item is used to select one of a list of strings. unlike a listbox, only the selection is visible until the user pulls down the menu of choices. derived from
wxcontrolwithitems include files <wx/choice.h> window styles there are no special styles for wxchoice. see also window styles overview. event handling
see also wxlistbox, wxcombobox, wxcommandevent members
wxchoice::wxchoice
wxchoice::wxchoicewxchoice() default constructor. wxchoice(wxwindow *parent, wxwindowid id, const wxpoint& pos, const wxsize& size, int n, const wxstring choices[], long style = 0, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "choice") wxchoice(wxwindow *parent, wxwindowid id, const wxpoint& pos, const wxsize& size, const wxarraystring& choices, long style = 0, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "choice") constructor, creating and showing a choice. parameters parent
id
pos
size
n
choices
style
validator
name
see also wxpython note: the wxchoice constructor in wxpython reduces the n and choices arguments are to a single argument, which is a list of strings. wxperl note: in wxperl there is just an array reference in place of n and choices.
wxchoice::~wxchoice~wxchoice() destructor, destroying the choice item.
wxchoice::createbool create(wxwindow *parent, wxwindowid id, const wxpoint& pos, const wxsize& size, int n, const wxstring choices[], long style = 0, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "choice") bool create(wxwindow *parent, wxwindowid id, const wxpoint& pos, const wxsize& size, const wxarraystring& choices, long style = 0, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "choice") creates the choice for two-step construction. see wxchoice::wxchoice.
wxchoice::getcolumnsint getcolumns() const gets the number of columns in this choice item. remarks this is implemented for motif only and always returns 1 for the other platforms.
wxchoice::getcurrentselectionint getcurrentselection() const unlike getselection which only returns the accepted selection value, i.e. the selection in the control once the user closes the dropdown list, this function returns the current selection. that is, while the dropdown list is shown, it returns the currently selected item in it. when it is not shown, its result is the same as for the other function. this function is new since wxwidgets version 2.6.2 (before this version getselection itself behaved like this).
wxchoice::setcolumnsvoid setcolumns(int n = 1) sets the number of columns in this choice item. parameters n
remarks this is implemented for motif only and doesn't do anything under other platforms.
|