]>
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.
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 @beginEventTable{wxCommandEvent}
40 @event{EVT_COMBOBOX(id, func)}
41 Process a wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on
43 @event{EVT_TEXT(id, func)}
44 Process a wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text changes.
45 @event{EVT_TEXT_ENTER(id, func)}
46 Process a wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in
52 <!-- @appearance{bitmapcombobox.png} -->
54 @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxCommandEvent
56 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.
77 Window size. If wxDefaultSize is specified then the window is sized
80 Number of strings with which to initialise the control.
82 An array of strings with which to initialise the control.
84 Window style. See wxBitmapComboBox.
90 @see Create(), wxValidator
92 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
93 const wxString
& value
= "",
94 const wxPoint
& pos
= wxDefaultPosition
,
95 const wxSize
& size
= wxDefaultSize
,
97 const wxString choices
[] = NULL
,
99 const wxValidator
& validator
= wxDefaultValidator
,
100 const wxString
& name
= "comboBox");
101 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
102 const wxString
& value
,
105 const wxArrayString
& choices
,
107 const wxValidator
& validator
= wxDefaultValidator
,
108 const wxString
& name
= "comboBox");
112 Destructor, destroying the combobox.
114 virtual ~wxBitmapComboBox();
117 Adds the item to the end of the combo box.
119 int Append(const wxString
& item
,
120 const wxBitmap
& bitmap
= wxNullBitmap
);
124 Adds the item to the end of the combo box, associating the given, typed or
125 untyped, client data pointer @a clientData with the item.
127 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
129 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
130 wxClientData
* clientData
);
135 Creates the combobox for two-step construction. Derived classes
136 should call or replace this function. See wxBitmapComboBox()
139 bool Create(wxWindow
* parent
, wxWindowID id
,
140 const wxString
& value
= "",
141 const wxPoint
& pos
= wxDefaultPosition
,
142 const wxSize
& size
= wxDefaultSize
,
143 int n
, const wxString choices
[],
145 const wxValidator
& validator
= wxDefaultValidator
,
146 const wxString
& name
= "comboBox");
147 bool Create(wxWindow
* parent
, wxWindowID id
,
148 const wxString
& value
,
151 const wxArrayString
& choices
,
153 const wxValidator
& validator
= wxDefaultValidator
,
154 const wxString
& name
= "comboBox");
158 Returns size of bitmaps used in the list.
160 virtual wxSize
GetBitmapSize() const;
163 Returns the bitmap of the item with the given index.
165 virtual wxBitmap
GetItemBitmap(unsigned int n
) const;
168 Inserts the item into the list before @a pos.
169 Not valid for @c wxCB_SORT style, use Append() instead.
171 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
176 Inserts the item into the list before pos, associating the given, typed or
177 untyped, client data pointer with the item.
178 Not valid for @c wxCB_SORT style, use Append() instead.
181 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
184 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
186 wxClientData
* clientData
);
190 Sets the bitmap for the given item.
192 virtual void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);