]>
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 While wxBitmapComboBox contains the wxComboBox API, but it might not actually
19 be derived from that class. In fact, if the platform does not have a native
20 implementation, wxBitmapComboBox will inherit from wxOwnerDrawnComboBox.
21 You can determine if the implementation is generic by checking whether
22 @c wxGENERIC_BITMAPCOMBOBOX is defined. Currently wxBitmapComboBox is
23 implemented natively for MSW and GTK+.
27 Creates a combobox without a text editor. On some platforms the
28 control may appear very different when this style is used.
30 Sorts the entries in the list alphabetically.
31 @style{wxTE_PROCESS_ENTER}
32 The control will generate the event wxEVT_COMMAND_TEXT_ENTER
33 (otherwise pressing Enter key is either processed internally by the
34 control or used for navigation between dialog controls).
38 @todo create wxCB_PROCESS_ENTER rather than reusing wxTE_PROCESS_ENTER!
40 @beginEventTable{wxCommandEvent}
41 @event{EVT_COMBOBOX(id, func)}
42 Process a wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on
44 @event{EVT_TEXT(id, func)}
45 Process a wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text changes.
46 @event{EVT_TEXT_ENTER(id, func)}
47 Process a wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in
53 <!-- @appearance{bitmapcombobox.png} -->
55 @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxCommandEvent
57 class wxBitmapComboBox
: public wxComboBox
66 Constructor, creating and showing a combobox.
69 Parent window. Must not be @NULL.
71 Window identifier. The value wxID_ANY indicates a default value.
73 Initial selection string. An empty string indicates no selection.
75 Number of strings with which to initialise the control.
77 An array of strings with which to initialise the control.
79 @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");
92 Constructor, creating and showing a combobox.
95 Parent window. Must not be @NULL.
97 Window identifier. The value wxID_ANY indicates a default value.
99 Initial selection string. An empty string indicates no selection.
101 An wxArrayString with which to initialise the control.
103 @see Create(), wxValidator
105 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
106 const wxString
& value
,
109 const wxArrayString
& choices
,
111 const wxValidator
& validator
= wxDefaultValidator
,
112 const wxString
& name
= "comboBox");
115 Destructor, destroying the combobox.
117 virtual ~wxBitmapComboBox();
120 Adds the item to the end of the combo box.
122 int Append(const wxString
& item
,
123 const wxBitmap
& bitmap
= wxNullBitmap
);
126 Adds the item to the end of the combo box, associating the given
127 untyped, client data pointer @a clientData with the item.
129 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
133 Adds the item to the end of the combo box, associating the given typed
134 client data pointer @a clientData with the item.
136 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
137 wxClientData
* clientData
);
140 Creates the combobox for two-step construction.
142 bool Create(wxWindow
* parent
, wxWindowID id
,
143 const wxString
& value
= "",
144 const wxPoint
& pos
= wxDefaultPosition
,
145 const wxSize
& size
= wxDefaultSize
,
146 int n
, const wxString choices
[],
148 const wxValidator
& validator
= wxDefaultValidator
,
149 const wxString
& name
= "comboBox");
152 Creates the combobox for two-step construction.
154 bool Create(wxWindow
* parent
, wxWindowID id
,
155 const wxString
& value
,
158 const wxArrayString
& choices
,
160 const wxValidator
& validator
= wxDefaultValidator
,
161 const wxString
& name
= "comboBox");
164 Returns size of bitmaps used in the list.
166 virtual wxSize
GetBitmapSize() const;
169 Returns the bitmap of the item with the given index.
171 virtual wxBitmap
GetItemBitmap(unsigned int n
) const;
174 Inserts the item into the list before @a pos.
175 Not valid for @c wxCB_SORT style, use Append() instead.
177 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
181 Inserts the item into the list before pos, associating the given
182 untyped, client data pointer with the item.
183 Not valid for @c wxCB_SORT style, use Append() instead.
185 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
190 Inserts the item into the list before pos, associating the given typed
191 client data pointer with the item.
192 Not valid for @c wxCB_SORT style, use Append() instead.
194 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
196 wxClientData
* clientData
);
199 Sets the bitmap for the given item.
201 virtual void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);