Package wx :: Module combo :: Class ComboPopup

[frames | no frames]

## Type ComboPopup

    object --+
             |
            ComboPopup

In order to use a custom popup with `wx.combo.ComboCtrl` an interface class derived from wx.combo.ComboPopup is used to manage the interface between the popup control and the popup. You can either derive a new class from both the widget class and this ComboPopup class, or the derived class can have a reference to the widget used for the popup. In either case you simply need to return the widget from the `GetControl` method to allow the ComboCtrl to interact with it.

Nearly all of the methods of this class are overridable in Python.

Method Summary
ComboPopup | ``__init__`(self)` Constructor
| `__del__(self)`
bool | ``Create`(self, parent)` The derived class must implement this method to create the popup control.
| ``DefaultPaintComboControl`(combo, dc, rect)` Default PaintComboControl behaviour (Static method)
| ``Dismiss`(self)` Hides the popup
Size | ``GetAdjustedSize`(self, minWidth, prefHeight, maxHeight)` The derived class may implement this method to return adjusted size for the popup control, according to the variables given.
ComboCtrl | ``GetCombo`(self)` Returns a reference to the `wx.combo.ComboCtrl` this ComboPopup object is associated with.
Window | ``GetControl`(self)` The derived class must implement this method and it should return a reference to the widget created in the `Create` method.
String | ``GetStringValue`(self)` Gets the string representation of the currently selected value to be used to display in the combo widget.
| ``Init`(self)` This method is called after the popup is contructed and has been assigned to the ComboCtrl.
bool | ``IsCreated`(self)` Returns true if `Create` has been called.
bool | ``LazyCreate`(self)` The derived class may implement this to return `True` if it wants to delay the call to `Create` until the popup is shown for the first time.
| ``OnComboDoubleClick`(self)` Implement this method in the derived class if you need to support special actions when the user double-clicks on the parent ComboCtrl.
| ``OnComboKeyEvent`(self, event)` Receives key events from the parent ComboCtrl.
| ``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)` This is called to custom paint in the combo control itself (ie.
| ``SetStringValue`(self, value)` Called just prior to displaying the popup.

Property Summary
| `thisown`: The membership flag

Instance Method Details

### __init__(self)
(Constructor)

Constructor

  Returns:
    ComboPopup
  Overrides:
    `__builtin__.object.__init__`

### Create(self, parent)

The derived class must implement this method to create the popup control. It should be a child of the `parent` passed in, but other than that there is much flexibility in what the widget can be, its style, etc. Return `True` for success, `False` otherwise. (NOTE: this return value is not currently checked...)

  Parameters:
    `parent`
    (type=Window)

  Returns:
    bool

### Dismiss(self)

Hides the popup

### GetAdjustedSize(self, minWidth, prefHeight, maxHeight)

The derived class may implement this method to return adjusted size for the popup control, according to the variables given. It is called on every popup, just prior to `OnPopup`.

  Parameters:
    `minWidth` - Preferred minimum width.
    (type=int)

    `prefHeight` - Preferred height. May be -1 to indicate no preference.
    (type=int)

    `maxHeight`
    (type=int)

  Returns:
    Size

### GetCombo(self)

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

  Returns:
    ComboCtrl

### GetControl(self)

The derived class must implement this method and it should return a reference to the widget created in the `Create` method. If the derived class inherits from both the widget class and ComboPopup then the return value is probably just `self`.

  Returns:
    Window

### GetStringValue(self)

Gets the string representation of the currently selected value to be used to display in the combo widget.

  Returns:
    String

### Init(self)

This method is called after the popup is contructed and has been assigned to the ComboCtrl. Derived classes can override this to do extra inialization or whatever.

### IsCreated(self)

Returns true if `Create` has been called.

  Returns:
    bool

### LazyCreate(self)

The derived class may implement this to return `True` if it wants to delay the 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. The default implementation returns `False`.

  Returns:
    bool

### OnComboDoubleClick(self)

Implement this method in the derived class if you need to support special actions when the user double-clicks on the parent ComboCtrl.

### OnComboKeyEvent(self, event)

Receives key events from the parent ComboCtrl. Events not handled should be skipped, as usual.

  Parameters:
    `event`
    (type=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)

This is called to custom paint in the combo control itself (ie. not the popup). Default implementation draws the current value as string.

  Parameters:
    `dc`
    (type=DC)

    `rect`
    (type=Rect)

### SetStringValue(self, value)

Called just prior to displaying the popup. The derived class can implement this to "select" the item in the popup that coresponds to the passed in string value, if appropriate. The default implementation does nothing.

  Parameters:
    `value`
    (type=String)

Static Method Details

### DefaultPaintComboControl(combo, dc, rect)

Default PaintComboControl behaviour

  Parameters:
    `combo`
    (type=wxComboCtrlBase)

    `dc`
    (type=DC)

    `rect`
    (type=Rect)

Property Details

### thisown

The membership flag

  Get Method:
    unknown--1217728868(...)
  Set Method:
    unknown--1217728812(...)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:11:12 2007 | http://epydoc.sf.net