In order to use a custom popup with wx.ComboCtrl, an interface class must be derived from wx.ComboPopup.
For more information on how to use it, see Setting Custom Popup for wxComboCtrl.
See also
Default constructor. |
|
The derived class must implement this to create the popup control. |
|
You only need to implement this member function if you create your popup class in non-standard way. |
|
Utility function that hides the popup. |
|
Implement to customize matching of value string to an item container entry. |
|
The derived class may implement this to return adjusted size for the popup control, according to the variables given. |
|
Returns pointer to the associated parent wx.ComboCtrl. |
|
The derived class must implement this to return pointer to the associated control created in |
|
The derived class must implement this to return string representation of the value. |
|
The derived class must implement this to initialize its internal variables. |
|
Utility method that returns |
|
The derived class may implement this to return |
|
The derived class may implement this to do something when the parent wx.ComboCtrl gets double-clicked. |
|
The derived class may implement this to receive key events from the parent wx.ComboCtrl. |
|
The derived class may implement this to do special processing when popup is hidden. |
|
The derived class may implement this to do special processing when popup is shown. |
|
The derived class may implement this to paint the parent wx.ComboCtrl. |
|
The derived class must implement this to receive string value changes from wx.ComboCtrl. |
See |
|
See |
|
See |
wx.
ComboPopup
(object)¶Possible constructors:
ComboPopup()
In order to use a custom popup with ComboCtrl, an interface class must be derived from ComboPopup.
__init__
(self)¶Default constructor.
It is recommended that internal variables are prepared in Init
instead (because m_combo is not valid in constructor).
Create
(self, parent)¶The derived class must implement this to create the popup control.
parent (wx.Window) –
bool
True
if the call succeeded, False
otherwise.
DestroyPopup
(self)¶You only need to implement this member function if you create your popup class in non-standard way.
The default implementation can handle both multiple-inherited popup control (as seen in wx.ComboCtrl samples) and one allocated separately in heap.
If you do completely re-implement this function, make sure it calls Destroy() for the popup control and also deletes this
object (usually as the last thing).
Dismiss
(self)¶Utility function that hides the popup.
FindItem
(self, item, trueItem=None)¶Implement to customize matching of value string to an item container entry.
item (string) – String entered, usually by user or from SetValue() call.
trueItem (string) – When item matches an entry, but the entry’s string representation is not exactly the same (case mismatch, for example), then the True
item string should be written back to here, if it is not a None
pointer.
bool
Note
Default implementation always return True
and does not alter trueItem.
GetAdjustedSize
(self, minWidth, prefHeight, maxHeight)¶The derived class may implement this to return adjusted size for the popup control, according to the variables given.
minWidth (int) – Preferred minimum width.
prefHeight (int) – Preferred height. May be -1 to indicate no preference.
maxHeight (int) – Max height for window, as limited by screen size.
Note
This function is called each time popup is about to be shown.
GetComboCtrl
(self)¶Returns pointer to the associated parent wx.ComboCtrl.
GetControl
(self)¶The derived class must implement this to return pointer to the associated control created in Create
.
GetStringValue
(self)¶The derived class must implement this to return string representation of the value.
string
Init
(self)¶The derived class must implement this to initialize its internal variables.
This method is called immediately after construction finishes. m_combo member variable has been initialized before the call.
IsCreated
(self)¶Utility method that returns True
if Create has been called.
Useful in conjunction with LazyCreate
.
bool
LazyCreate
(self)¶The derived class may implement this to return True
if it wants to delay call to Create
until the popup is shown for the first time.
It is more efficient, but on the other hand it is often more convenient to have the control created immediately.
bool
Note
Base implementation returns False
.
OnComboDoubleClick
(self)¶The derived class may implement this to do something when the parent wx.ComboCtrl gets double-clicked.
OnComboKeyEvent
(self, event)¶The derived class may implement this to receive key events from the parent wx.ComboCtrl.
Events not handled should be skipped, as usual.
event (wx.KeyEvent) –
OnDismiss
(self)¶The derived class may implement this to do special processing when popup is hidden.
OnPopup
(self)¶The derived class may implement this to do special processing when popup is shown.
PaintComboControl
(self, dc, rect)¶The derived class may implement this to paint the parent wx.ComboCtrl.
Default implementation draws value as string.
SetStringValue
(self, value)¶The derived class must implement this to receive string value changes from wx.ComboCtrl.
value (string) –
ComboCtrl
¶See GetComboCtrl
Control
¶See GetControl
StringValue
¶See GetStringValue
and SetStringValue