wx.lib.masked.combobox.BaseMaskedComboBox¶
Base class for generic masked edit comboboxes; allows auto-complete of values. It is not meant to be instantiated directly, but rather serves as a base class for any subsequent refinements.
Class Hierarchy¶
Known Subclasses¶
wx.lib.masked.combobox.ComboBox
, wx.lib.masked.combobox.PreMaskedComboBox
Known Superclasses¶
wx.ComboBox
, wx.lib.masked.maskededit.MaskedEditMixin
Methods Summary¶
Default class constructor. |
|
This base control function override is necessary so the control can keep |
|
|
|
This base control function override is necessary so the derived control |
|
This function redefines the externally accessible |
|
GetTextSelection() -> Tuple[int, int] |
|
IsEmpty() -> bool |
|
This function redefines the externally accessible |
|
This function redefines the externally accessible |
|
Set the font, then recalculate control size, if appropriate. |
|
Necessary override for bookkeeping on choice selection, to keep current |
|
This function redefines the externally accessible |
|
This function defines the undo operation for the control. |
Class API¶
- class BaseMaskedComboBox(wx.ComboBox, MaskedEditMixin)¶
Base class for generic masked edit comboboxes; allows auto-complete of values. It is not meant to be instantiated directly, but rather serves as a base class for any subsequent refinements.
Methods¶
- __init__(self, parent, id=-1, value = '', pos = wx.DefaultPosition, size = wx.DefaultSize, choices = [], style = wx.CB_DROPDOWN, validator = wx.DefaultValidator, name = "maskedComboBox", setupEventHandling = True, \*\*kwargs)¶
Default class constructor.
- Parameters:
parent (wx.Window) – the window parent. Must not be
None
;id (integer) – window identifier. A value of -1 indicates a default value;
value (string) – value to be shown;
pos (tuple or
wx.Point
) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
choices (list) – a list of valid choices;
style (integer) – the window style;
validator (wx.Validator) – this is mainly provided for data-transfer, as control does its own validation;
name (string) – the window name;
setupEventHandling (boolean) – setup event handling by default.
- Append(self, choice, clientData=None)¶
This base control function override is necessary so the control can keep track of any additions to the list of choices, because
ComboBox
doesn’t have an accessor for the choice list. The code here is the same as in the SetParameters() mixin function, but is done for the individual value as appended, so the list can be built incrementally without speed penalty.
- AppendItems(self, choices)¶
AppendItems
is handled in terms oflib.masked.combobox.ComboBox.Append
, to avoid code replication.
- Clear(self)¶
This base control function override is necessary so the derived control can keep track of any additions to the list of choices, because
ComboBox
doesn’t have an accessor for the choice list.
- Cut(self)¶
This function redefines the externally accessible
ComboBox.Cut
to be a smart “erase” of the text in question, so as not to corrupt the masked control.Note
This must be done in the class derived from the base wx control.
- GetMark(self)¶
GetTextSelection() -> Tuple[int, int]
Gets the current selection span.
- IsEmpty(\*args, \*\*kw)¶
IsEmpty() -> bool
Returns true if the control is empty or false if it has some items.
- OnWindowDestroy(self, event)¶
- Paste(self)¶
This function redefines the externally accessible
ComboBox.Paste
to be a smart “paste” of the text in question, so as not to corrupt the masked control.Note
This must be done in the class derived from the base wx control.
- Refresh(self)¶
This function redefines the externally accessible
ComboBox.Refresh
to validate the contents of the masked control as it refreshes.Note
This must be done in the class derived from the base wx control.
- SetFont(self, \*args, \*\*kwargs)¶
Set the font, then recalculate control size, if appropriate.
see
ComboBox.SetFont
for valid arguments
- SetSelection(self, index)¶
Necessary override for bookkeeping on choice selection, to keep current value current.
- Parameters:
index (integer) – index to choice item to be set
- SetValue(self, value)¶
This function redefines the externally accessible
ComboBox.SetValue
to be a smart “paste” of the text in question, so as not to corrupt the masked control.Note
This must be done in the class derived from the base wx control.
- Undo(self)¶
This function defines the undo operation for the control. (The default undo is 1-deep.)