wx.combo.BitmapComboBox

Inheritance diagram for wx.combo.BitmapComboBox:



Description

A combobox that displays bitmap in front of the list items. It currently only allows using bitmaps of one size, and resizes itself so that a bitmap can be shown next to the text field.

Remarks

While wx.BitmapComboBox contains the wx.ComboBox API, but it might not actually be derived from that class. In fact, if the platform does not have a native implementation, wx.BitmapComboBox will inherit from wx.combo.OwnerDrawnComboBox.

You can determine if the implementation is generic by checking whether wx.GENERIC_BITMAPCOMBOBOX is defined.

Window Styles

Window Style Description
wx.CB_READONLY Same as wx.CB_DROPDOWN but only the strings specified as the combobox choices can be selected, it is impossible to select (even from a program) a string which is not in the choices list.
wx.CB_SORT Sorts the entries in the list alphabetically.
wx.TE_PROCESS_ENTER The control will generate the event wx.EVT_COMMAND_TEXT_ENTER (otherwise pressing Enter key is either processed internally by the control or used for navigation between dialog controls). Windows only.

Event Handling

Event Name Description
wx.EVT_COMBOBOX(id, func) Process a wx.wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on the list is selected.
wx.EVT_TEXT(id, func) Process a wx.wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text changes.
wx.EVT_TEXT_ENTER(id, func) Process a wx.wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in the combobox.

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Class API

Methods

__init__(parent, id=-1, value="", pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=wx.DefaultValidator, name=wx.BitmapComboBoxNameStr)

Standard constructor.

Parameters:


Returns:

wx.combo.BitmapComboBox


Append(item, bitmap=wx.NullBitmap, clientData=None)

Adds the item to the end of the combo box, associating the given, typed or untyped, client data pointer with the item.

Parameters:

  • item (string): The item name.
  • bitmap (wx.Bitmap): The bitmap associated with this item.
  • clientData (PyObject): The item data.

Returns:

int


Create(parent, id=-1, value="", pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=wx.DefaultValidator, name=wx.BitmapComboBoxNameStr)

Creates the combobox for two-step construction. Derived classes should call or replace this function.

Parameters:


Returns:

bool

See also

__init__


GetBitmapSize()

Returns size of bitmaps used in the list.


Returns:

wx.Size


GetItemBitmap(n)

Returns the bitmap of the item with the given index.

Parameters:

  • n (unsigned int)

Returns:

wx.Bitmap


Insert(item, bitmap, pos, clientData=None)

Inserts the item into the list before pos, associating the given, typed or untyped, client data pointer with the item.

Not valid for wx.CB_SORT style, use Append instead.

Parameters:

  • item (string): The item name.
  • bitmap (wx.Bitmap): The bitmap associated with this item.
  • pos (int): the item position.
  • clientData (PyObject): The item data.

Returns:

int


SetItemBitmap(n, bitmap)

Sets the bitmap for the given item.

Parameters: