]>
git.saurik.com Git - wxWidgets.git/blob - interface/choicdlg.h
4f6f99974fa389a10346f8453a2ef0163267ef0c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxMultiChoiceDialog class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxMultiChoiceDialog
13 This class represents a dialog that shows a list of strings, and allows
14 the user to select one or more.
20 @ref overview_wxmultichoicedialogoverview "wxMultiChoiceDialog overview",
23 class wxMultiChoiceDialog
: public wxDialog
28 Constructor taking an array of wxString choices.
34 Message to show on the dialog.
40 The number of choices.
43 An array of strings, or a string list, containing the choices.
46 A dialog style (bitlist) containing flags chosen from standard
47 dialog styles and the following:
63 Centre the message. Not Windows.
65 The default value is equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER |
66 wxOK | wxCANCEL | wxCENTRE.
69 Dialog position. Not Windows.
71 @remarks Use ShowModal() to show the dialog.
73 wxMultiChoiceDialog(wxWindow
* parent
, const wxString
& message
,
74 const wxString
& caption
,
76 const wxString
* choices
,
77 long style
= wxCHOICEDLG_STYLE
,
78 const wxPoint
& pos
= wxDefaultPosition
);
79 wxMultiChoiceDialog(wxWindow
* parent
,
80 const wxString
& message
,
81 const wxString
& caption
,
82 const wxArrayString
& choices
,
83 long style
= wxCHOICEDLG_STYLE
,
84 const wxPoint
& pos
= wxDefaultPosition
);
88 Returns array with indexes of selected items.
90 wxArrayInt
GetSelection();
93 Sets selected items from the array of selected items' indexes.
95 void SetSelections(const wxArrayInt
& selections
);
98 Shows the dialog, returning either wxID_OK or wxID_CANCEL.
105 @class wxSingleChoiceDialog
106 @wxheader{choicdlg.h}
108 This class represents a dialog that shows a list of strings, and allows the
109 user to select one. Double-clicking on a list item is equivalent to
110 single-clicking and then pressing OK.
116 @ref overview_wxsinglechoicedialogoverview "wxSingleChoiceDialog overview",
119 class wxSingleChoiceDialog
: public wxDialog
124 Constructor, taking an array of wxString choices and optional client data.
130 Message to show on the dialog.
136 The number of choices.
139 An array of strings, or a string list, containing the choices.
142 An array of client data to be associated with the items.
143 See GetSelectionClientData.
146 A dialog style (bitlist) containing flags chosen from standard
147 dialog styles and the following:
158 Show a Cancel button.
163 Centre the message. Not Windows.
165 The default value is equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER |
166 wxOK | wxCANCEL | wxCENTRE.
169 Dialog position. Not Windows.
171 @remarks Use ShowModal() to show the dialog.
173 wxSingleChoiceDialog(wxWindow
* parent
, const wxString
& message
,
174 const wxString
& caption
,
176 const wxString
* choices
,
177 void** clientData
= @NULL
,
178 long style
= wxCHOICEDLG_STYLE
,
179 const wxPoint
& pos
= wxDefaultPosition
);
180 wxSingleChoiceDialog(wxWindow
* parent
,
181 const wxString
& message
,
182 const wxString
& caption
,
183 const wxArrayString
& choices
,
184 void** clientData
= @NULL
,
185 long style
= wxCHOICEDLG_STYLE
,
186 const wxPoint
& pos
= wxDefaultPosition
);
190 Returns the index of selected item.
195 Returns the client data associated with the selection.
197 char* GetSelectionClientData();
200 Returns the selected string.
202 wxString
GetStringSelection();
205 Sets the index of the initially selected item.
207 void SetSelection(int selection
);
210 Shows the dialog, returning either wxID_OK or wxID_CANCEL.
216 // ============================================================================
217 // Global functions/macros
218 // ============================================================================
222 As @b wxGetSingleChoice but returns the index representing the selected
223 string. If the user pressed cancel, -1 is returned.
225 int wxGetSingleChoiceIndex(const wxString
& message
,
226 const wxString
& caption
,
227 const wxArrayString
& aChoices
,
228 wxWindow
* parent
= @NULL
,
234 int wxGetSingleChoiceIndex(const wxString
& message
,
235 const wxString
& caption
,
237 const wxString
& choices
[],
238 wxWindow
* parent
= @NULL
,
248 Pops up a dialog box containing a message, OK/Cancel buttons and a
249 single-selection listbox. The user may choose an item and press OK to return a
250 string or Cancel to return the empty string. Use
251 wxGetSingleChoiceIndex if empty string is a
252 valid choice and if you want to be able to detect pressing Cancel reliably.
254 You may pass the list of strings to choose from either using @e choices
255 which is an array of @e n strings for the listbox or by using a single
256 @e aChoices parameter of type wxArrayString.
258 If @e centre is @true, the message text (which may include new line
259 characters) is centred; if @false, the message is left-justified.
261 wxString
wxGetSingleChoice(const wxString
& message
,
262 const wxString
& caption
,
263 const wxArrayString
& aChoices
,
264 wxWindow
* parent
= @NULL
,
270 wxString
wxGetSingleChoice(const wxString
& message
,
271 const wxString
& caption
,
273 const wxString
& choices
[],
274 wxWindow
* parent
= @NULL
,
284 As @b wxGetSingleChoice but takes an array of client data pointers
285 corresponding to the strings, and returns one of these pointers or @NULL if
286 Cancel was pressed. The @e client_data array must have the same number of
287 elements as @e choices or @e aChoices!
289 wxString
wxGetSingleChoiceData(const wxString
& message
,
290 const wxString
& caption
,
291 const wxArrayString
& aChoices
,
292 const wxString
& client_data
[],
293 wxWindow
* parent
= @NULL
,
299 wxString
wxGetSingleChoiceData(const wxString
& message
,
300 const wxString
& caption
,
302 const wxString
& choices
[],
303 const wxString
& client_data
[],
304 wxWindow
* parent
= @NULL
,
314 Pops up a dialog box containing a message, OK/Cancel buttons and a
315 multiple-selection listbox. The user may choose an arbitrary (including 0)
316 number of items in the listbox whose indices will be returned in
317 @e selection array. The initial contents of this array will be used to
318 select the items when the dialog is shown.
320 You may pass the list of strings to choose from either using @e choices
321 which is an array of @e n strings for the listbox or by using a single
322 @e aChoices parameter of type wxArrayString.
324 If @e centre is @true, the message text (which may include new line
325 characters) is centred; if @false, the message is left-justified.
327 size_t wxGetMultipleChoices(wxArrayInt
& selections
,
328 const wxString
& message
,
329 const wxString
& caption
,
330 const wxArrayString
& aChoices
,
331 wxWindow
* parent
= @NULL
,
337 size_t wxGetMultipleChoices(wxArrayInt
& selections
,
338 const wxString
& message
,
339 const wxString
& caption
,
341 const wxString
& choices
[],
342 wxWindow
* parent
= @NULL
,