Search documentation of wx

# wxSingleChoiceDialog (wx v2.4.3.1)

View Source

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.

## Styles

This class supports the following styles:

- wxOK: Show an OK button.

- wxCANCEL: Show a Cancel button.

- wxCENTRE: Centre the message.

See:

- Overview cmndlg

- `wxMultiChoiceDialog`

This class is derived, and can use functions, from:

- `wxDialog`

- `wxTopLevelWindow`

- `wxWindow`

- `wxEvtHandler`

wxWidgets docs: wxSingleChoiceDialog

# Summary

## Types

wxSingleChoiceDialog()

## Functions

destroy(This)

Destroys the object

getSelection(This)

Returns the index of selected item.

getStringSelection(This)

Returns the selected string.

new(Parent, Message, Caption, Choices)

Equivalent to `new(Parent, Message, Caption, Choices, [])`.

new/5

Constructor, taking an array of `wxString` (not implemented in wx) choices and optional client data.

setSelection(This, Selection)

Sets the index of the initially selected item.

# Types

# wxSingleChoiceDialog()

    -type wxSingleChoiceDialog() :: wx:wx_object().

# Functions

# destroy(This)

    -spec destroy(This :: wxSingleChoiceDialog()) -> ok.

Destroys the object

# getSelection(This)

    -spec getSelection(This) -> integer() when This :: wxSingleChoiceDialog().

Returns the index of selected item.

# getStringSelection(This)

    -spec getStringSelection(This) -> unicode:charlist() when This :: wxSingleChoiceDialog().

Returns the selected string.

# new(Parent, Message, Caption, Choices)

    -spec new(Parent, Message, Caption, Choices) -> wxSingleChoiceDialog()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Message :: unicode:chardata(),
                     Caption :: unicode:chardata(),
                     Choices :: [unicode:chardata()].

Equivalent to `new(Parent, Message, Caption, Choices, [])`.

# new/5

    -spec new(Parent, Message, Caption, Choices, [Option]) -> wxSingleChoiceDialog()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Message :: unicode:chardata(),
                     Caption :: unicode:chardata(),
                     Choices :: [unicode:chardata()],
                     Option :: {style, integer()} | {pos, {X :: integer(), Y :: integer()}}.

Constructor, taking an array of `wxString` (not implemented in wx) choices and optional client data.

Remark: Use `wxDialog:showModal/1` to show the dialog.

# setSelection(This, Selection)

    -spec setSelection(This, Selection) -> ok when This :: wxSingleChoiceDialog(), Selection :: integer().

Sets the index of the initially selected item.