wxSingleChoiceDialog Class Reference
[Common Dialogs]

#include <wx/choicdlg.h>

Inheritance diagram for wxSingleChoiceDialog:
Inheritance graph
[legend]

Detailed Description

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.

Library:  wxBase
Category:  Common Dialogs
See also:
wxSingleChoiceDialog Overview, wxMultiChoiceDialog

Public Member Functions

int GetSelection () const
 Returns the index of selected item.
char * GetSelectionClientData () const
 Returns the client data associated with the selection.
wxString GetStringSelection () const
 Returns the selected string.
void SetSelection (int selection)
 Sets the index of the initially selected item.
int ShowModal ()
 Shows the dialog, returning either wxID_OK or wxID_CANCEL.



 wxSingleChoiceDialog (wxWindow *parent, const wxString &message, const wxString &caption, int n, const wxString *choices, void **clientData=NULL, long style=wxCHOICEDLG_STYLE, const wxPoint &pos=wxDefaultPosition)
 Constructor, taking an array of wxString choices and optional client data.
 wxSingleChoiceDialog (wxWindow *parent, const wxString &message, const wxString &caption, const wxArrayString &choices, void **clientData=NULL, long style=wxCHOICEDLG_STYLE, const wxPoint &pos=wxDefaultPosition)
 Constructor, taking an array of wxString choices and optional client data.

List of all members.


Constructor & Destructor Documentation

wxSingleChoiceDialog::wxSingleChoiceDialog ( wxWindow parent,
const wxString message,
const wxString caption,
int  n,
const wxString choices,
void **  clientData = NULL,
long  style = wxCHOICEDLG_STYLE,
const wxPoint pos = wxDefaultPosition 
)

Constructor, taking an array of wxString choices and optional client data.

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 GetSelectionClientData().
style A dialog style (bitlist) containing flags chosen from standard dialog styles and the ones listed below. The default value is equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE.
pos Dialog position. Not Windows.

Styles

This class supports the following styles:

  • wxOK:
    Show an OK button.
  • wxCANCEL:
    Show a Cancel button.
  • wxCENTRE:
    Centre the message. Not Windows.
Remarks:
Use ShowModal() to show the dialog.

wxPython Note:

For Python the two parameters n and choices are collapsed into a multi parameter choices which is expected to be a Python list of strings.

wxPerl Note: Not supported by wxPerl.

wxSingleChoiceDialog::wxSingleChoiceDialog ( wxWindow parent,
const wxString message,
const wxString caption,
const wxArrayString choices,
void **  clientData = NULL,
long  style = wxCHOICEDLG_STYLE,
const wxPoint pos = wxDefaultPosition 
)

Constructor, taking an array of wxString choices and optional client data.

Parameters:
parent Parent window.
message Message to show on the dialog.
caption The dialog caption.
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 GetSelectionClientData().
style A dialog style (bitlist) containing flags chosen from standard dialog styles and the ones listed below. The default value is equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE.
pos Dialog position. Not Windows.

Styles

This class supports the following styles:

  • wxOK:
    Show an OK button.
  • wxCANCEL:
    Show a Cancel button.
  • wxCENTRE:
    Centre the message. Not Windows.
Remarks:
Use ShowModal() to show the dialog.

wxPython Note:

For Python the two parameters n and choices are collapsed into a multi parameter choices which is expected to be a Python list of strings.

wxPerl Note: Use an array reference for the choices parameter.


Member Function Documentation

int wxSingleChoiceDialog::GetSelection (  )  const

Returns the index of selected item.

char* wxSingleChoiceDialog::GetSelectionClientData (  )  const

Returns the client data associated with the selection.

wxString wxSingleChoiceDialog::GetStringSelection (  )  const

Returns the selected string.

void wxSingleChoiceDialog::SetSelection ( int  selection  ) 

Sets the index of the initially selected item.

int wxSingleChoiceDialog::ShowModal (  )  [virtual]

Shows the dialog, returning either wxID_OK or wxID_CANCEL.

Reimplemented from wxDialog.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]