back to gui 

wxComboBox

generated from ../src/mod_gui/control/combobox.cpp

A combobox is like a combination of an edit control and a listbox. It can be displayed as static list with editable or read-only text field; or a drop-down list with text field; or a drop-down list without a text field.

Constants

Style

Name Description
SIMPLE
DROPDOWN
READONLY
SORT

Constructor

wxComboBox

wxComboBox()
 
wxComboBox(Parent, 
           Id, 
           Text = "", 
           Position = wxDefaultPosition, 
           Size = wxDefaultSize, 
           Items = null, 
           Style = 0, 
           Validator = null)
 
Name Type Default Description
Parent wxWindow The parent of the wxComboBox
Id Integer A window identifier. Use -1 when you don't need it
Text String The default text of the text field
Position wxPoint wxDefaultPosition The position of the control on the given parent.
Size wxSize wxDefaultSize The size of the control.
Items Array null An array of Strings to initialize the control.
Style Integer 0 The window style.
Validator wxValidator null A validator

Constructs a new wxComboBox object

Properties

Name Type Description
canCopy read only Boolean Returns true if the combobox is editable and there is a text selection to copy to the clipboard. Only available on Windows.
canCut read only Boolean Returns true if the combobox is editable and there is a text selection to cut to the clipboard. Only available on Windows.
canPaste read only Boolean Returns true if the combobox is editable and there is text to paste from the clipboard. Only available on Windows.
canRedo read only Boolean Returns true if the combobox is editable and the last undo can be redone. Only available on Windows.
canUndo read only Boolean Returns true if the combobox is editable and the last edit can be undone. Only available on Windows.
insertionPoint Integer Gets/Sets the insertion point of the text field
lastPosition read only Integer Gets the last position of the text field
value String Gets/Sets the text field

Methods

copy

copy()
 

Copies the selected text to the clipboard

create

create(Parent, 
       Id, 
       Text = "", 
       Position = wxDefaultPosition, 
       Size = wxDefaultSize, 
       Items = null, 
       Style = 0, 
       Validator = null)
 
Name Type Default Description
Parent wxWindow The parent of the wxComboBox
Id Integer A window identifier. Use -1 when you don't need it
Text String The default text of the text field
Position wxPoint wxDefaultPosition The position of the control on the given parent.
Size wxSize wxDefaultSize The size of the control.
Items Array null An array of Strings to initialize the control.
Style Integer 0 The window style.
Validator wxValidator null A validator

Creates a wxComboBox

cut

cut()
 

Copies the selected text to the clipboard and removes the selected text

paste

paste()
 

Pastes the content of the clipboard in the text field.

redo

redo()
 

Redoes the last undo in the text field. Windows only.

remove

remove(From, 
       To)
 
Name Type Default Description
From Integer
To Integer

Removes the text between From and To

replace

replace(From, 
        To, 
        Text)
 
Name Type Default Description
From Integer
To Integer
Text String

Replaces the text between From and To with the given text

undo

undo()
 

Undoes the last edit in the text field. Windows only.

Events

onText Called when the text of the textfield is changed. The type of the argument that your handler receives is wxCommandEvent.
onComboBox Called when an item is selected. The type of the argument that your handler receives is wxCommandEvent.



Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.