]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpcbox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapComboBox
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxBitmapComboBox
11 A combobox that displays bitmap in front of the list items.
12 It currently only allows using bitmaps of one size, and resizes itself
13 so that a bitmap can be shown next to the text field.
16 While wxBitmapComboBox contains the wxComboBox API, but it might not actually
17 be derived from that class. In fact, if the platform does not have a native
18 implementation, wxBitmapComboBox will inherit from wxOwnerDrawnComboBox.
19 You can determine if the implementation is generic by checking whether
20 @c wxGENERIC_BITMAPCOMBOBOX is defined. Currently wxBitmapComboBox is
21 implemented natively for MSW and GTK+.
25 Creates a combobox without a text editor. On some platforms the
26 control may appear very different when this style is used.
28 Sorts the entries in the list alphabetically.
29 @style{wxTE_PROCESS_ENTER}
30 The control will generate the event wxEVT_TEXT_ENTER
31 (otherwise pressing Enter key is either processed internally by the
32 control or used for navigation between dialog controls).
36 @todo create wxCB_PROCESS_ENTER rather than reusing wxTE_PROCESS_ENTER!
38 @beginEventEmissionTable{wxCommandEvent}
39 @event{EVT_COMBOBOX(id, func)}
40 Process a @c wxEVT_COMBOBOX event, when an item on
42 @event{EVT_TEXT(id, func)}
43 Process a @c wxEVT_TEXT event, when the combobox text changes.
44 @event{EVT_TEXT_ENTER(id, func)}
45 Process a @c wxEVT_TEXT_ENTER event, when RETURN is pressed in
51 @appearance{bitmapcombobox}
53 @see wxComboBox, wxChoice, wxOwnerDrawnComboBox, wxCommandEvent
55 class wxBitmapComboBox
: public wxComboBox
64 Constructor, creating and showing a combobox.
67 Parent window. Must not be @NULL.
69 Window identifier. The value wxID_ANY indicates a default value.
71 Initial selection string. An empty string indicates no selection.
77 Number of strings with which to initialise the control.
79 An array of strings with which to initialise the control.
81 The window style, see wxCB_* flags.
83 Validator which can be used for additional data checks.
87 @see Create(), wxValidator
89 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
90 const wxString
& value
= wxEmptyString
,
91 const wxPoint
& pos
= wxDefaultPosition
,
92 const wxSize
& size
= wxDefaultSize
,
94 const wxString choices
[] = NULL
,
96 const wxValidator
& validator
= wxDefaultValidator
,
97 const wxString
& name
= wxBitmapComboBoxNameStr
);
100 Constructor, creating and showing a combobox.
103 Parent window. Must not be @NULL.
105 Window identifier. The value wxID_ANY indicates a default value.
107 Initial selection string. An empty string indicates no selection.
113 An wxArrayString with which to initialise the control.
115 The window style, see wxCB_* flags.
117 Validator which can be used for additional data checks.
121 @see Create(), wxValidator
123 wxBitmapComboBox(wxWindow
* parent
, wxWindowID id
,
124 const wxString
& value
,
127 const wxArrayString
& choices
,
129 const wxValidator
& validator
= wxDefaultValidator
,
130 const wxString
& name
= wxBitmapComboBoxNameStr
);
133 Destructor, destroying the combobox.
135 virtual ~wxBitmapComboBox();
138 Adds the item to the end of the combo box.
140 int Append(const wxString
& item
,
141 const wxBitmap
& bitmap
= wxNullBitmap
);
144 Adds the item to the end of the combo box, associating the given
145 untyped, client data pointer @a clientData with the item.
147 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
151 Adds the item to the end of the combo box, associating the given typed
152 client data pointer @a clientData with the item.
154 int Append(const wxString
& item
, const wxBitmap
& bitmap
,
155 wxClientData
* clientData
);
158 Creates the combobox for two-step construction.
160 bool Create(wxWindow
* parent
, wxWindowID id
,
161 const wxString
& value
,
164 int n
, const wxString choices
[],
166 const wxValidator
& validator
= wxDefaultValidator
,
167 const wxString
& name
= wxBitmapComboBoxNameStr
);
170 Creates the combobox for two-step construction.
172 bool Create(wxWindow
* parent
, wxWindowID id
,
173 const wxString
& value
,
176 const wxArrayString
& choices
,
178 const wxValidator
& validator
= wxDefaultValidator
,
179 const wxString
& name
= wxBitmapComboBoxNameStr
);
182 Returns the size of the bitmaps used in the combo box.
183 If the combo box is empty, then ::wxDefaultSize is returned.
185 virtual wxSize
GetBitmapSize() const;
188 Returns the bitmap of the item with the given index.
190 virtual wxBitmap
GetItemBitmap(unsigned int n
) const;
193 Inserts the item into the list before @a pos.
194 Not valid for @c wxCB_SORT style, use Append() instead.
196 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
200 Inserts the item into the list before pos, associating the given
201 untyped, client data pointer with the item.
202 Not valid for @c wxCB_SORT style, use Append() instead.
204 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
209 Inserts the item into the list before pos, associating the given typed
210 client data pointer with the item.
211 Not valid for @c wxCB_SORT style, use Append() instead.
213 int Insert(const wxString
& item
, const wxBitmap
& bitmap
,
215 wxClientData
* clientData
);
218 Sets the bitmap for the given item.
220 virtual void SetItemBitmap(unsigned int n
, const wxBitmap
& bitmap
);