#include </home/zeitlin/src/wx/github/interface/wx/bmpcbox.h>
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.
wxGENERIC_BITMAPCOMBOBOX
is defined. Currently wxBitmapComboBox is implemented natively for MSW and GTK+.This class supports the following styles:
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
wxEVT_COMMAND_COMBOBOX_SELECTED
event, when an item on the list is selected. wxEVT_COMMAND_TEXT_UPDATED
event, when the combobox text changes. wxEVT_COMMAND_TEXT_ENTER
event, when RETURN is pressed in the combobox. wxMSW appearance | wxGTK appearance | wxMac appearance |
Public Member Functions | |
wxBitmapComboBox () | |
Default ctor. | |
wxBitmapComboBox (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &value=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxBitmapComboBoxNameStr) | |
Constructor, creating and showing a combobox. | |
wxBitmapComboBox (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxBitmapComboBoxNameStr) | |
Constructor, creating and showing a combobox. | |
virtual | ~wxBitmapComboBox () |
Destructor, destroying the combobox. | |
int | Append (const wxString &item, const wxBitmap &bitmap=wxNullBitmap) |
Adds the item to the end of the combo box. | |
int | Append (const wxString &item, const wxBitmap &bitmap, void *clientData) |
Adds the item to the end of the combo box, associating the given untyped, client data pointer clientData with the item. | |
int | Append (const wxString &item, const wxBitmap &bitmap, wxClientData *clientData) |
Adds the item to the end of the combo box, associating the given typed client data pointer clientData with the item. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, int n, const wxString choices[], long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxBitmapComboBoxNameStr) |
Creates the combobox for two-step construction. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxBitmapComboBoxNameStr) |
Creates the combobox for two-step construction. | |
virtual wxSize | GetBitmapSize () const |
Returns the size of the bitmaps used in the combo box. | |
virtual wxBitmap | GetItemBitmap (unsigned int n) const |
Returns the bitmap of the item with the given index. | |
int | Insert (const wxString &item, const wxBitmap &bitmap, unsigned int pos) |
Inserts the item into the list before pos. | |
int | Insert (const wxString &item, const wxBitmap &bitmap, unsigned int pos, void *clientData) |
Inserts the item into the list before pos, associating the given untyped, client data pointer with the item. | |
int | Insert (const wxString &item, const wxBitmap &bitmap, unsigned int pos, wxClientData *clientData) |
Inserts the item into the list before pos, associating the given typed client data pointer with the item. | |
virtual void | SetItemBitmap (unsigned int n, const wxBitmap &bitmap) |
Sets the bitmap for the given item. |
wxBitmapComboBox::wxBitmapComboBox | ( | ) |
Default ctor.
wxBitmapComboBox::wxBitmapComboBox | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxString & | value = wxEmptyString , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = NULL , |
||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxBitmapComboBoxNameStr |
||
) |
Constructor, creating and showing a combobox.
parent | Parent window. Must not be NULL. |
id | Window identifier. The value wxID_ANY indicates a default value. |
value | Initial selection string. An empty string indicates no selection. |
pos | Initial position. |
size | Initial size. |
n | Number of strings with which to initialise the control. |
choices | An array of strings with which to initialise the control. |
style | The window style, see wxCB_* flags. |
validator | Validator which can be used for additional data checks. |
name | Control name. |
wxBitmapComboBox::wxBitmapComboBox | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxString & | value, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
const wxArrayString & | choices, | ||
long | style, | ||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxBitmapComboBoxNameStr |
||
) |
Constructor, creating and showing a combobox.
parent | Parent window. Must not be NULL. |
id | Window identifier. The value wxID_ANY indicates a default value. |
value | Initial selection string. An empty string indicates no selection. |
pos | Initial position. |
size | Initial size. |
choices | An wxArrayString with which to initialise the control. |
style | The window style, see wxCB_* flags. |
validator | Validator which can be used for additional data checks. |
name | Control name. |
virtual wxBitmapComboBox::~wxBitmapComboBox | ( | ) | [virtual] |
Destructor, destroying the combobox.
int wxBitmapComboBox::Append | ( | const wxString & | item, |
const wxBitmap & | bitmap = wxNullBitmap |
||
) |
Adds the item to the end of the combo box.
Adds the item to the end of the combo box, associating the given untyped, client data pointer clientData with the item.
int wxBitmapComboBox::Append | ( | const wxString & | item, |
const wxBitmap & | bitmap, | ||
wxClientData * | clientData | ||
) |
Adds the item to the end of the combo box, associating the given typed client data pointer clientData with the item.
bool wxBitmapComboBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxString & | value, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
int | n, | ||
const wxString | choices[], | ||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxBitmapComboBoxNameStr |
||
) |
Creates the combobox for two-step construction.
Reimplemented from wxComboBox.
bool wxBitmapComboBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxString & | value, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
const wxArrayString & | choices, | ||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxBitmapComboBoxNameStr |
||
) |
Creates the combobox for two-step construction.
Reimplemented from wxComboBox.
virtual wxSize wxBitmapComboBox::GetBitmapSize | ( | ) | const [virtual] |
Returns the size of the bitmaps used in the combo box.
If the combo box is empty, then wxDefaultSize is returned.
virtual wxBitmap wxBitmapComboBox::GetItemBitmap | ( | unsigned int | n | ) | const [virtual] |
Returns the bitmap of the item with the given index.
int wxBitmapComboBox::Insert | ( | const wxString & | item, |
const wxBitmap & | bitmap, | ||
unsigned int | pos, | ||
void * | clientData | ||
) |
Inserts the item into the list before pos, associating the given untyped, client data pointer with the item.
Not valid for wxCB_SORT
style, use Append() instead.
Inserts the item into the list before pos.
Not valid for wxCB_SORT
style, use Append() instead.
int wxBitmapComboBox::Insert | ( | const wxString & | item, |
const wxBitmap & | bitmap, | ||
unsigned int | pos, | ||
wxClientData * | clientData | ||
) |
Inserts the item into the list before pos, associating the given typed client data pointer with the item.
Not valid for wxCB_SORT
style, use Append() instead.
virtual void wxBitmapComboBox::SetItemBitmap | ( | unsigned int | n, |
const wxBitmap & | bitmap | ||
) | [virtual] |
Sets the bitmap for the given item.