back to gui
wxChoice
generated from ../src/mod_gui/control/choice.cpp
A 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. An example:
var items = new Array();
items[0] = "Opel";
items[1] = "Ford";
items[2] = "BMW";
// dlg is a wxDialog
var choice = new wxChoice(dlg, -1, wxDefaultPosition, wxDefaultSize, items);
Constants
Constructor
wxChoice
wxChoice()
wxChoice(Parent,
Id,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Items = null,
Style = 0,
Validator = null)
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of the control
|
| Id |
Integer |
|
An window identifier. Use -1 when you don't need it.
|
| Position |
wxPoint |
wxDefaultPosition |
The position of the choice control on the given parent.
|
| Size |
wxSize |
wxDefaultSize |
The size of the choice control.
|
| Items |
Array |
null |
An array of Strings to initialize the control.
|
| Style |
Integer |
0 |
The style of the control
|
| Validator |
wxValidator |
null |
A validator
|
Constructs a new wxChoice object.
Properties
| Name |
Type |
Description |
| columns |
Integer |
Gets/Sets the number of columns
|
currentSelection  |
Integer |
Unlike selection which only returns the accepted
selection value, i.e. the selection in the control once the user closes
the dropdown list, this property 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
property.
|
Methods
create
create(Parent,
Id,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Items = null,
Style = 0,
Validator = null) : Boolean
| Name |
Type |
Default |
Description |
| Parent |
wxWindow |
|
The parent of the control
|
| Id |
Integer |
|
An window identifier. Use -1 when you don't need it.
|
| Position |
wxPoint |
wxDefaultPosition |
The position of the choice control on the given parent.
|
| Size |
wxSize |
wxDefaultSize |
The size of the choice control.
|
| Items |
Array |
null |
An array of Strings to initialize the control.
|
| Style |
Integer |
0 |
The style of the control
|
| Validator |
wxValidator |
null |
A validator
|
Creates a wxChoice
Events
| onChoice |
Called when an item is selected. The type of the argument that your handler receives
is wxCommandEvent.
|