h1(#wxsinglechoicedialog). Wx::SingleChoiceDialog This class represents a dialog that shows a list of strings, and allows the user to select one. Double-clicking on a list item is equivalent to single-clicking and then pressing OK. h2. Derived from "Dialog":dialog.html "Window":window.html "EvtHandler":evthandler.html "Object":object.html h2. See also "SingleChoiceDialog overview":singlechoicedialogoverview.html, "MultiChoiceDialog":multichoicedialog.html
h2. Methods * "SingleChoiceDialog.new":#SingleChoiceDialog_new * "SingleChoiceDialog#get_selection":#SingleChoiceDialog_getselection * "SingleChoiceDialog#get_selection_client_data":#SingleChoiceDialog_getselectionclientdata * "SingleChoiceDialog#get_string_selection":#SingleChoiceDialog_getstringselection * "SingleChoiceDialog#set_selection":#SingleChoiceDialog_setselection * "SingleChoiceDialog#show_modal":#SingleChoiceDialog_showmodal
h3(#SingleChoiceDialog_new). SingleChoiceDialog.new *SingleChoiceDialog.new*(%(arg-type)"Window":window.html% parent, %(arg-type)String% message, %(arg-type)String% caption, %(arg-type)Integer% n, %(arg-type)String% choices, %(arg-type)% clientData = nil, %(arg-type)Integer% style = CHOICEDLG_STYLE, %(arg-type)"Point":point.html% pos = DEFAULT_POSITION) *SingleChoiceDialog.new*(%(arg-type)"Window":window.html% parent, %(arg-type)String% message, %(arg-type)String% caption, %(arg-type)"ArrayString":arraystring.html% choices, %(arg-type)% clientData = nil, %(arg-type)Integer% style = CHOICEDLG_STYLE, %(arg-type)"Point":point.html% pos = DEFAULT_POSITION) Constructor, taking an array of String choices and optional client data. h4. Parameters * _parent_ Parent window. * _message_ Message to show on the dialog. * _caption_ The dialog caption. * _n_ The number of choices. * _choices_ An array of strings, or a string list, containing the choices. * _clientData_ An array of client data to be associated with the items. See "get_selection_client_data":#SingleChoiceDialog_getselectionclientdata. * _style_ A dialog style (bitlist) containing flags chosen from standard dialog styles and the following: |*OK*|Show an OK button.| |*CANCEL*|Show a Cancel button.| |*CENTRE*|Centre the message. Not Windows.| The default value is equivalent to *DEFAULT_DIALOG_STYLE ** RESIZE_BORDER ** OK ** CANCEL ** CENTRE*. * _pos_ Dialog position. Not Windows. h4. Remarks Use "SingleChoiceDialog#show_modal":singlechoicedialog.html#SingleChoiceDialog_showmodal to show the dialog. h3(#SingleChoiceDialog_getselection). SingleChoiceDialog#get_selection Integer *get_selection*() Returns the index of selected item. h3(#SingleChoiceDialog_getselectionclientdata). SingleChoiceDialog#get_selection_client_data char *get_selection_client_data*() Returns the client data associated with the selection. h3(#SingleChoiceDialog_getstringselection). SingleChoiceDialog#get_string_selection String *get_string_selection*() Returns the selected string. h3(#SingleChoiceDialog_setselection). SingleChoiceDialog#set_selection *set_selection*(%(arg-type)Integer% selection) Sets the index of the initially selected item. h3(#SingleChoiceDialog_showmodal). SingleChoiceDialog#show_modal Integer *show_modal*() Shows the dialog, returning either ID_OK or ID_CANCEL.