]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpcbox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapComboBox
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxBitmapComboBox
12 A combobox that displays bitmap in front of the list items.
13 It currently only allows using bitmaps of one size, and resizes itself
14 so that a bitmap can be shown next to the text field.
17 While wxBitmapComboBox contains the wxComboBox API, but it might not actually
18 be derived from that class. In fact, if the platform does not have a native
19 implementation, wxBitmapComboBox will inherit from wxOwnerDrawnComboBox.
20 You can determine if the implementation is generic by checking whether
21 @c wxGENERIC_BITMAPCOMBOBOX is defined. Currently wxBitmapComboBox is
22 implemented natively for MSW and GTK+.
26 Creates a combobox without a text editor. On some platforms the
27 control may appear very different when this style is used.
29 Sorts the entries in the list alphabetically.
30 @style{wxTE_PROCESS_ENTER}
31 The control will generate the event wxEVT_COMMAND_TEXT_ENTER
32 (otherwise pressing Enter key is either processed internally by the
33 control or used for navigation between dialog controls).
37 @todo create wxCB_PROCESS_ENTER rather than reusing wxTE_PROCESS_ENTER!
39 @beginEventEmissionTable{wxCommandEvent}
40 @event{EVT_COMBOBOX(id, func)}
41 Process a @c wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on
43 @event{EVT_TEXT(id, func)}
44 Process a @c wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text changes.
45 @event{EVT_TEXT_ENTER(id, func)}
46 Process a @c wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in
52 @appearance{bitmapcombobox}
54 @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxCommandEvent
56 class wxBitmapComboBox
: public wxComboBox
65 Constructor, creating and showing a combobox.
68 Parent window. Must not be @NULL.
70 Window identifier. The value wxID_ANY indicates a default value.
72 Initial selection string. An empty string indicates no selection.
78 Number of strings with which to initialise the control.
80 An array of strings with which to initialise the control.
82 The window style, see wxCB_* flags.
84 Validator which can be used for additional data checks.
88 @see Create(), wxValidator
90 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
91 const wxString
& value
= wxEmptyString
,
92 const wxPoint
& pos
= wxDefaultPosition
,
93 const wxSize
& size
= wxDefaultSize
,
95 const wxString choices
[] = NULL
,
97 const wxValidator
& validator
= wxDefaultValidator
,
98 const wxString
& name
= wxBitmapComboBoxNameStr
);
101 Constructor, creating and showing a combobox.
104 Parent window. Must not be @NULL.
106 Window identifier. The value wxID_ANY indicates a default value.
108 Initial selection string. An empty string indicates no selection.
114 An wxArrayString with which to initialise the control.
116 The window style, see wxCB_* flags.
118 Validator which can be used for additional data checks.
122 @see Create(), wxValidator
124 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
125 const wxString
& value
,
128 const wxArrayString
& choices
,
130 const wxValidator
& validator
= wxDefaultValidator
,
131 const wxString
& name
= wxBitmapComboBoxNameStr
);
134 Destructor, destroying the combobox.
136 virtual ~wxBitmapComboBox();
139 Adds the item to the end of the combo box.
141 int Append(const wxString
& item
,
142 const wxBitmap
& bitmap
= wxNullBitmap
);
145 Adds the item to the end of the combo box, associating the given
146 untyped, client data pointer @a clientData with the item.
148 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
152 Adds the item to the end of the combo box, associating the given typed
153 client data pointer @a clientData with the item.
155 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
156 wxClientData
* clientData
);
159 Creates the combobox for two-step construction.
161 bool Create(wxWindow
* parent
, wxWindowID id
,
162 const wxString
& value
,
165 int n
, const wxString choices
[],
167 const wxValidator
& validator
= wxDefaultValidator
,
168 const wxString
& name
= wxBitmapComboBoxNameStr
);
171 Creates the combobox for two-step construction.
173 bool Create(wxWindow
* parent
, wxWindowID id
,
174 const wxString
& value
,
177 const wxArrayString
& choices
,
179 const wxValidator
& validator
= wxDefaultValidator
,
180 const wxString
& name
= wxBitmapComboBoxNameStr
);
183 Returns the size of the bitmaps used in the combo box.
184 If the combo box is empty, then ::wxDefaultSize is returned.
186 virtual wxSize
GetBitmapSize() const;
189 Returns the bitmap of the item with the given index.
191 virtual wxBitmap
GetItemBitmap(unsigned int n
) const;
194 Inserts the item into the list before @a pos.
195 Not valid for @c wxCB_SORT style, use Append() instead.
197 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
201 Inserts the item into the list before pos, associating the given
202 untyped, client data pointer with the item.
203 Not valid for @c wxCB_SORT style, use Append() instead.
205 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
210 Inserts the item into the list before pos, associating the given typed
211 client data pointer with the item.
212 Not valid for @c wxCB_SORT style, use Append() instead.
214 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
216 wxClientData
* clientData
);
219 Sets the bitmap for the given item.
221 virtual void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);