wx.combo.ComboPopup

Inheritance diagram for wx.combo.ComboPopup:



Description

In order to use a custom popup with wx.combo.ComboCtrl, an interface class must be derived from wx.combo.ComboPopup.

For more information how to use it, see wx.combo.ComboCtrl.

Class API

Methods

__init__()

Default constructor. It is recommended that internal variables are prepared in Init.


Returns:

wx.combo.ComboPopup


Create(parent)

The derived class must implement this to create the popup control.

Returns True if the call succeeded, False otherwise.

Parameters:


Returns:

bool


DefaultPaintComboControl(combo, dc, rect)

Default PaintComboControl behaviour.

Parameters:


Dismiss()
Utility function that hides the popup.

GetAdjustedSize(minWidth, prefHeight, maxHeight)

The derived class may implement this to return adjusted size for the popup control, according to the variables given.

Parameters:

  • minWidth (int): Preferred minimum width.
  • prefHeight (int): Preferred height. May be -1 to indicate no preference.
  • maxHeight (int): Preferred maximum height.

Returns:

wx.Size

Note

This is called each time popup is about to be shown.


GetCombo()

Returns a reference to the wx.combo.ComboCtrl this wx.combo.ComboPopup object is associated with.


Returns:

wx.combo.ComboCtrl


GetControl()

The derived class must implement this to return pointer to the associated control created in Create.


Returns:

wx.Window


GetStringValue()

The derived class must implement this to return string representation of the value.


Returns:

string


Init()

The derived class must implement this to initialize its internal variables.

This method is called immediately after construction finishes. Derived classes can override this to do extra inialization or whatever.


IsCreated()

Utility method that returns True if Create has been called. Useful in conjunction with LazyCreate.


Returns:

bool


LazyCreate()

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.


Returns:

bool

Note

The base implementation returns False.


OnComboDoubleClick()
The derived class may implement this to do something when the parent wx.combo.ComboCtrl gets double-clicked.

OnComboKeyEvent(event)

The derived class may implement this to receive key events from the parent wx.combo.ComboCtrl.

Events not handled should be skipped, as usual.

Parameters:


OnDismiss()
The derived class may implement this to do special processing when popup is hidden.

OnPopup()
The derived class may implement this to do special processing when popup is shown.

PaintComboControl(dc, rect)

The derived class may implement this to paint the parent wx.combo.ComboCtrl.

Default implementation draws value as string.

Parameters:


SetStringValue(value)

The derived class must implement this to receive string value changes from wx.combo.ComboCtrl.

Parameters:

  • value (string)