]>
git.saurik.com Git - wxWidgets.git/blob - interface/bmpcbox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapComboBox
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxBitmapComboBox
13 A combobox that displays bitmap in front of the list items.
14 It currently only allows using bitmaps of one size, and resizes itself
15 so that a bitmap can be shown next to the text field.
18 @style{wxCB_READONLY}:
19 Creates a combobox without a text editor. On some platforms the
20 control may appear very different when this style is used.
22 Sorts the entries in the list alphabetically.
23 @style{wxTE_PROCESS_ENTER}:
24 The control will generate the event wxEVT_COMMAND_TEXT_ENTER
25 (otherwise pressing Enter key is either processed internally by the
26 control or used for navigation between dialog controls). Windows
31 @event{EVT_COMBOBOX(id, func)}:
32 Process a wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on
34 @event{EVT_TEXT(id, func)}:
35 Process a wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text
37 @event{EVT_TEXT_ENTER(id, func)}:
38 Process a wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in
44 @appearance{bitmapcombobox.png}
46 @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxCommandEvent
48 class wxBitmapComboBox
: public wxComboBox
53 Constructor, creating and showing a combobox.
56 Parent window. Must not be @NULL.
58 Window identifier. The value wxID_ANY indicates a default value.
60 Initial selection string. An empty string indicates no selection.
64 Window size. If wxDefaultSize is specified then the window is
68 Number of strings with which to initialise the control.
70 An array of strings with which to initialise the control.
72 Window style. See wxBitmapComboBox.
78 @see Create(), wxValidator
81 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
82 const wxString
& value
= "",
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
86 const wxString choices
[] = NULL
,
88 const wxValidator
& validator
= wxDefaultValidator
,
89 const wxString
& name
= "comboBox");
90 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
91 const wxString
& value
,
94 const wxArrayString
& choices
,
96 const wxValidator
& validator
= wxDefaultValidator
,
97 const wxString
& name
= "comboBox");
101 Destructor, destroying the combobox.
107 Adds the item to the end of the combo box, associating the given, typed or
108 untyped, client data pointer with the item.
110 int Append(const wxString
& item
,
111 const wxBitmap
& bitmap
= wxNullBitmap
);
112 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
114 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
115 wxClientData
* clientData
);
120 Creates the combobox for two-step construction. Derived classes
121 should call or replace this function. See wxBitmapComboBox()
124 bool Create(wxWindow
* parent
, wxWindowID id
,
125 const wxString
& value
= "",
126 const wxPoint
& pos
= wxDefaultPosition
,
127 const wxSize
& size
= wxDefaultSize
,
128 int n
, const wxString choices
[],
130 const wxValidator
& validator
= wxDefaultValidator
,
131 const wxString
& name
= "comboBox");
132 bool Create(wxWindow
* parent
, wxWindowID id
,
133 const wxString
& value
,
136 const wxArrayString
& choices
,
138 const wxValidator
& validator
= wxDefaultValidator
,
139 const wxString
& name
= "comboBox");
143 Returns size of bitmaps used in the list.
145 wxSize
GetBitmapSize() const;
148 Returns the bitmap of the item with the given index.
150 wxBitmap
GetItemBitmap(unsigned int n
) const;
154 Inserts the item into the list before pos, associating the given, typed or
155 untyped, client data pointer with the item.
156 Not valid for @c wxCB_SORT style, use Append instead.
158 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
160 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
163 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
165 wxClientData
* clientData
);
169 Sets the bitmap for the given item.
171 void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);