1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
class CComboBox - Currently Windows ONLY (not Tk)
__init__(self, parent, text, items, nlines = None)
class CComboBoxEdit
Class CComboBox represents a combo box control, a static control showing
the selected item, and a button to display a list of text lines
which may be selected by the user. The combo box may have a vertical
scroll bar if all the items do not fit into the space available. The
returned size of a combo box does not include the size of the list box.
Get the text from a combo box with CWnd::GetWindowText().
Class CComboBoxEdit is identical to CComboBox, except that the control is
an edit control instead of a static control and so text can be typed into it.
You can set text to the edit control with CWnd::SetWindowText().
Instance Variables
wpyParent, wpyText, wpyChildList, wpySizeX/Y, wpyLocX/Y
wpyListBoxItems, list or tuple of strings, readonly after Create()
The list of strings in the combo box; set by "items" in the
constructor. May be changed until Create() is called.
wpyScrollWidth, int, readonly
The width of the vertical scroll bar were there to be one.
wpyCharSizeX/Y, int, readonly
The x or y size of a character. Useful for sizing the combo
box if the list of items is empty.
Methods
__init__(self, parent, text, items, nlines = None)
Return a combo box with self.wpySizeX/Y set according to the arguments given.
No items are selected.
parent, object
The view or dialog parent of the control.
text, string
The name of the combo box. This is not visible, but must be a valid
Python name because it is used to make the message handler name. Do
NOT put blanks in this name.
items, list
A list of strings to appear in the combo box.
nlines, int
The number of lines to display in the associated list box. If there
are more items, a scroll bar is added. If None, equal to the number
of items.
Create(self)
Make the combo box visible by calling the underlying GUI.
SelectString(self, string)
Make the string the selected string of the combo box. May be
called only after the combo box is created.
WpySetItems(self, items)
items, list or tuple of strings
Set the items in the combo box to the new list "items". The old
items will be replaced.
Messages
These messages are sent using the command router mechanism. The handler names are
generated using wpyText which must be a valid Python name. The "WPYTEXT" below
refers to this name.
OnCloseup(self, control)
Sent when the list box of a combo box has closed.
OnEditChange(self, control)
Sent when the edit control of a combo box has changed. This
may be sent for each key stroke, so it must be efficient.
|