]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpcbox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapComboBox
4 // Author: wxWidgets team
6 // Licence: wxWindows license
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 @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
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.
74 Number of strings with which to initialise the control.
76 An array of strings with which to initialise the control.
78 @see Create(), wxValidator
80 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
81 const wxString
& value
= wxEmptyString
,
82 const wxPoint
& pos
= wxDefaultPosition
,
83 const wxSize
& size
= wxDefaultSize
,
85 const wxString choices
[] = NULL
,
87 const wxValidator
& validator
= wxDefaultValidator
,
88 const wxString
& name
= wxBitmapComboBoxNameStr
);
91 Constructor, creating and showing a combobox.
94 Parent window. Must not be @NULL.
96 Window identifier. The value wxID_ANY indicates a default value.
98 Initial selection string. An empty string indicates no selection.
100 An wxArrayString with which to initialise the control.
102 @see Create(), wxValidator
104 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
105 const wxString
& value
,
108 const wxArrayString
& choices
,
110 const wxValidator
& validator
= wxDefaultValidator
,
111 const wxString
& name
= wxBitmapComboBoxNameStr
);
114 Destructor, destroying the combobox.
116 virtual ~wxBitmapComboBox();
119 Adds the item to the end of the combo box.
121 int Append(const wxString
& item
,
122 const wxBitmap
& bitmap
= wxNullBitmap
);
125 Adds the item to the end of the combo box, associating the given
126 untyped, client data pointer @a clientData with the item.
128 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
132 Adds the item to the end of the combo box, associating the given typed
133 client data pointer @a clientData with the item.
135 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
136 wxClientData
* clientData
);
139 Creates the combobox for two-step construction.
141 bool Create(wxWindow
* parent
, wxWindowID id
,
142 const wxString
& value
,
145 int n
, const wxString choices
[],
147 const wxValidator
& validator
= wxDefaultValidator
,
148 const wxString
& name
= wxBitmapComboBoxNameStr
);
151 Creates the combobox for two-step construction.
153 bool Create(wxWindow
* parent
, wxWindowID id
,
154 const wxString
& value
,
157 const wxArrayString
& choices
,
159 const wxValidator
& validator
= wxDefaultValidator
,
160 const wxString
& name
= wxBitmapComboBoxNameStr
);
163 Returns size of bitmaps used in the list.
165 virtual wxSize
GetBitmapSize() const;
168 Returns the bitmap of the item with the given index.
170 virtual wxBitmap
GetItemBitmap(unsigned int n
) const;
173 Inserts the item into the list before @a pos.
174 Not valid for @c wxCB_SORT style, use Append() instead.
176 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
180 Inserts the item into the list before pos, associating the given
181 untyped, client data pointer with the item.
182 Not valid for @c wxCB_SORT style, use Append() instead.
184 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
189 Inserts the item into the list before pos, associating the given typed
190 client data pointer with the item.
191 Not valid for @c wxCB_SORT style, use Append() instead.
193 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
195 wxClientData
* clientData
);
198 Sets the bitmap for the given item.
200 virtual void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);