wxWidgets: Dialogs

| Version: 3.2.5

Functions
Dialogs
Functions and Macros by Category

## Detailed Description

Below are a number of convenience functions for getting input from the user or displaying messages.

Note that in these functions the last three parameters are optional. However, it is recommended to pass a parent frame parameter, or (in MS Windows or Motif) the wrong window frame may be brought to the front when the dialog box is popped up.

## Functions
void | wxAboutBox (const wxAboutDialogInfo &info, wxWindow *parent=NULL)
| This function shows the standard about dialog containing the information specified in info. More...
void | wxGenericAboutBox (const wxAboutDialogInfo &info, wxWindow *parent=NULL)
| This function does the same thing as wxAboutBox() except that it always uses the generic wxWidgets version of the dialog instead of the native one. More...
int | wxGetSingleChoiceIndex (const wxString &message, const wxString &caption, const wxArrayString &aChoices, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
| Same as wxGetSingleChoice() but returns the index representing the selected string. More...
int | wxGetSingleChoiceIndex (const wxString &message, const wxString &caption, int n, const wxString &choices[], wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
int | wxGetSingleChoiceIndex (const wxString &message, const wxString &caption, const wxArrayString &choices, int initialSelection, wxWindow *parent=NULL)
int | wxGetSingleChoiceIndex (const wxString &message, const wxString &caption, int n, const wxString *choices, int initialSelection, wxWindow *parent=NULL)
wxString | wxGetSingleChoice (const wxString &message, const wxString &caption, const wxArrayString &aChoices, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
| Pops up a dialog box containing a message, OK/Cancel buttons and a single-selection listbox. More...
wxString | wxGetSingleChoice (const wxString &message, const wxString &caption, int n, const wxString &choices[], wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
wxString | wxGetSingleChoice (const wxString &message, const wxString &caption, const wxArrayString &choices, int initialSelection, wxWindow *parent=NULL)
wxString | wxGetSingleChoice (const wxString &message, const wxString &caption, int n, const wxString *choices, int initialSelection, wxWindow *parent=NULL)
wxString | wxGetSingleChoiceData (const wxString &message, const wxString &caption, const wxArrayString &aChoices, const wxString &client_data[], wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
| Same as wxGetSingleChoice but takes an array of client data pointers corresponding to the strings, and returns one of these pointers or NULL if Cancel was pressed. More...
wxString | wxGetSingleChoiceData (const wxString &message, const wxString &caption, int n, const wxString &choices[], const wxString &client_data[], wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT, int initialSelection=0)
void * | wxGetSingleChoiceData (const wxString &message, const wxString &caption, const wxArrayString &choices, void **client_data, int initialSelection, wxWindow *parent=NULL)
void * | wxGetSingleChoiceData (const wxString &message, const wxString &caption, int n, const wxString *choices, void **client_data, int initialSelection, wxWindow *parent=NULL)
int | wxGetSelectedChoices (wxArrayInt &selections, const wxString &message, const wxString &caption, const wxArrayString &aChoices, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT)
| Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection listbox. More...
int | wxGetSelectedChoices (wxArrayInt &selections, const wxString &message, const wxString &caption, int n, const wxString &choices[], wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true, int width=wxCHOICE_WIDTH, int height=wxCHOICE_HEIGHT)
wxColour | wxGetColourFromUser (wxWindow *parent, const wxColour &colInit, const wxString &caption=wxEmptyString, wxColourData *data=NULL)
| Shows the colour selection dialog and returns the colour selected by user or invalid colour (use wxColour::IsOk() to test whether a colour is valid) if the dialog was cancelled. More...
wxString | wxDirSelector (const wxString &message=wxDirSelectorPromptStr, const wxString &default_path=wxEmptyString, long style=0, const wxPoint &pos=wxDefaultPosition, wxWindow *parent=NULL)
| Pops up a directory selector dialog. More...
wxString | wxFileSelector (const wxString &message, const wxString &default_path=wxEmptyString, const wxString &default_filename=wxEmptyString, const wxString &default_extension=wxEmptyString, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, int flags=0, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
| Pops up a file selector box. More...
wxString | wxFileSelectorEx (const wxString &message=wxFileSelectorPromptStr, const wxString &default_path=wxEmptyString, const wxString &default_filename=wxEmptyString, int *indexDefaultExtension=NULL, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, int flags=0, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
| An extended version of wxFileSelector() More...
wxString | wxLoadFileSelector (const wxString &what, const wxString &extension, const wxString &default_name=wxEmptyString, wxWindow *parent=NULL)
| Shows a file dialog asking the user for a file name for opening a file. More...
wxString | wxSaveFileSelector (const wxString &what, const wxString &extension, const wxString &default_name=wxEmptyString, wxWindow *parent=NULL)
| Shows a file dialog asking the user for a file name for saving a file. More...
wxFont | wxGetFontFromUser (wxWindow *parent, const wxFont &fontInit, const wxString &caption=wxEmptyString)
| Shows the font selection dialog and returns the font selected by user or invalid font (use wxFont::IsOk() to test whether a font is valid) if the dialog was cancelled. More...
int | wxMessageBox (const wxString &message, const wxString &caption=wxMessageBoxCaptionStr, int style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
| Show a general purpose message dialog. More...
long | wxGetNumberFromUser (const wxString &message, const wxString &prompt, const wxString &caption, long value, long min=0, long max=100, wxWindow *parent=NULL, const wxPoint &pos=wxDefaultPosition)
| Shows a dialog asking the user for numeric input. More...
wxString | wxGetTextFromUser (const wxString &message, const wxString &caption=wxGetTextFromUserPromptStr, const wxString &default_value=wxEmptyString, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true)
| Pop up a dialog box with title set to caption, `message`, and a `default_value`. More...
wxString | wxGetPasswordFromUser (const wxString &message, const wxString &caption=wxGetPasswordFromUserPromptStr, const wxString &default_value=wxEmptyString, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true)
| Similar to wxGetTextFromUser() but the text entered in the dialog is not shown on screen but replaced with stars. More...
wxTipProvider * | wxCreateFileTipProvider (const wxString &filename, size_t currentTip)
| This function creates a wxTipProvider which may be used with wxShowTip(). More...
bool | wxShowTip (wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup=true)
| This function shows a "startup tip" to the user. More...
void | wxBeginBusyCursor (const wxCursor *cursor=wxHOURGLASS_CURSOR)
| Changes the cursor to the given cursor for all windows in the application. More...
void | wxEndBusyCursor ()
| Changes the cursor back to the original cursor, for all windows in the application. More...
bool | wxIsBusy ()
| Returns true if between two wxBeginBusyCursor() and wxEndBusyCursor() calls. More...
void | wxBell ()
| Ring the system bell. More...
void | wxInfoMessageBox (wxWindow *parent)
| Shows a message box with the information about the wxWidgets build used, including its version, most important build parameters and the version of the underlying GUI toolkit. More...

## Function Documentation

## ◆ wxAboutBox()

void wxAboutBox | ( | const wxAboutDialogInfo & | info,
|  | wxWindow * | parent = `NULL`
| ) |  |

This function shows the standard about dialog containing the information specified in info.

If the current platform has a native about dialog which is capable of showing all the fields in info, the native dialog is used, otherwise the function falls back to the generic wxWidgets version of the dialog, i.e. does the same thing as wxGenericAboutBox.

Here is an example of how this function may be used:

void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
{
wxAboutDialogInfo info;
info.SetName(_("My Program"));
info.SetVersion(_("1.2.3 Beta"));
info.SetDescription(_("This program does something great."));
info.SetCopyright(wxT("(C) 2007 Me <my@email.addre.ss>"));
wxAboutBox(info);
}
wxAboutDialogInfo
wxAboutDialogInfo contains information shown in the standard About dialog displayed by the wxAboutBox...
Definition: aboutdlg.h:54
wxAboutDialogInfo::SetCopyright
void SetCopyright(const wxString &copyright)
Set the short string containing the program copyright information.
wxAboutDialogInfo::SetDescription
void SetDescription(const wxString &desc)
Set brief, but possibly multiline, description of the program.
wxAboutDialogInfo::SetName
void SetName(const wxString &name)
Set the name of the program.
wxAboutDialogInfo::SetVersion
void SetVersion(const wxString &version, const wxString &longVersion=wxString())
Set the version of the program.
wxCommandEvent
This event class contains information about command events, which originate from a variety of simple ...
Definition: event.h:2042
wxAboutBox
void wxAboutBox(const wxAboutDialogInfo &info, wxWindow *parent=NULL)
This function shows the standard about dialog containing the information specified in info.
wxT
#define wxT(string)
This macro can be used with character and string literals (in other words, 'x' or "foo") to automatic...
Definition: chartype.h:32
_
const wxString & _(const wxString &string)
Macro to be used around all literal strings that should be translated.

Please see the Dialogs Sample for more examples of using this function and wxAboutDialogInfo for the description of the information which can be shown in the about dialog.

Include file:

    #include <wx/aboutdlg.h>

## ◆ wxBeginBusyCursor()

void wxBeginBusyCursor | ( | const wxCursor * | cursor = `wxHOURGLASS_CURSOR` | ) |

Changes the cursor to the given cursor for all windows in the application.

Use wxEndBusyCursor() to revert the cursor back to its previous state. These two calls can be nested, and a counter ensures that only the outer calls take effect.

See also
  wxIsBusy(), wxBusyCursor

Include file:

    #include <wx/utils.h>

## ◆ wxBell()

void wxBell | ( |  | ) |

Ring the system bell.

Note
  This function is categorized as a GUI one and so is not thread-safe.

Include file:

    #include <wx/utils.h>

##

Library: wxCore

## ◆ wxCreateFileTipProvider()

wxTipProvider* wxCreateFileTipProvider | ( | const wxString & | filename,
|  | size_t | currentTip
| ) |  |

This function creates a wxTipProvider which may be used with wxShowTip().

Parameters

  filename | The name of the file containing the tips, one per line.
  currentTip | The index of the first tip to show. Normally this index is remembered between the 2 program runs.

See also
  wxTipProvider Overview

Include file:

    #include <wx/tipdlg.h>

## ◆ wxDirSelector()

wxString wxDirSelector | ( | const wxString & | message = `wxDirSelectorPromptStr`,
|  | const wxString & | default_path = `wxEmptyString`,
|  | long | style = `0`,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | wxWindow * | parent = `NULL`
| ) |  |

Pops up a directory selector dialog.

The arguments have the same meaning as those of wxDirDialog::wxDirDialog(). The message is displayed at the top, and the default_path, if specified, is set as the initial selection.

The application must check for an empty return value (if the user pressed Cancel). For example:

const wxString& dir = wxDirSelector("Choose a folder");
if ( !dir.empty() )
{
...
}
wxString
String class for passing textual data to or receiving it from wxWidgets.
Definition: string.h:315
wxString::empty
bool empty() const
wxDirSelector
wxString wxDirSelector(const wxString &message=wxDirSelectorPromptStr, const wxString &default_path=wxEmptyString, long style=0, const wxPoint &pos=wxDefaultPosition, wxWindow *parent=NULL)
Pops up a directory selector dialog.

Include file:

    #include <wx/dirdlg.h>

## ◆ wxEndBusyCursor()

void wxEndBusyCursor | ( |  | ) |

Changes the cursor back to the original cursor, for all windows in the application.

Use with wxBeginBusyCursor().

See also
  wxIsBusy(), wxBusyCursor

Include file:

    #include <wx/utils.h>

## ◆ wxFileSelector()

wxString wxFileSelector | ( | const wxString & | message,
|  | const wxString & | default_path = `wxEmptyString`,
|  | const wxString & | default_filename = `wxEmptyString`,
|  | const wxString & | default_extension = `wxEmptyString`,
|  | const wxString & | wildcard = `wxFileSelectorDefaultWildcardStr`,
|  | int | flags = `0`,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`
| ) |  |

Pops up a file selector box.

In Windows, this is the common file selector dialog. In X, this is a file selector box with the same functionality. The path and filename are distinct elements of a full file pathname. If path is empty, the current directory will be used. If filename is empty, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename. Flags may be a combination of wxFD_OPEN, wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD_FILE_MUST_EXIST.

Note
  wxFD_MULTIPLE can only be used with wxFileDialog and not here since this function only returns a single file name.

Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed.

The wildcard may be a specification for multiple types of file with a description for each, such as:

"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"

The application must check for an empty return value (the user pressed Cancel). For example:

wxString filename = wxFileSelector("Choose a file to open");
if ( !filename.empty() )
{
// work with the file
...
}
//else: cancelled by user
wxFileSelector
wxString wxFileSelector(const wxString &message, const wxString &default_path=wxEmptyString, const wxString &default_filename=wxEmptyString, const wxString &default_extension=wxEmptyString, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, int flags=0, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Pops up a file selector box.

Include file:

    #include <wx/filedlg.h>

## ◆ wxFileSelectorEx()

wxString wxFileSelectorEx | ( | const wxString & | message = `wxFileSelectorPromptStr`,
|  | const wxString & | default_path = `wxEmptyString`,
|  | const wxString & | default_filename = `wxEmptyString`,
|  | int * | indexDefaultExtension = `NULL`,
|  | const wxString & | wildcard = `wxFileSelectorDefaultWildcardStr`,
|  | int | flags = `0`,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`
| ) |  |

An extended version of wxFileSelector()

Include file:

    #include <wx/filedlg.h>

## ◆ wxGenericAboutBox()

void wxGenericAboutBox | ( | const wxAboutDialogInfo & | info,
|  | wxWindow * | parent = `NULL`
| ) |  |

This function does the same thing as wxAboutBox() except that it always uses the generic wxWidgets version of the dialog instead of the native one.

This is mainly useful if you need to customize the dialog by e.g. adding custom controls to it (customizing the native dialog is not currently supported).

See the Dialogs Sample for an example of about dialog customization.

See also
  wxAboutDialogInfo

Include file:

    #include <wx/aboutdlg.h>

## ◆ wxGetColourFromUser()

wxColour wxGetColourFromUser | ( | wxWindow * | parent,
|  | const wxColour & | colInit,
|  | const wxString & | caption = `wxEmptyString`,
|  | wxColourData * | data = `NULL`
| ) |  |

Shows the colour selection dialog and returns the colour selected by user or invalid colour (use wxColour::IsOk() to test whether a colour is valid) if the dialog was cancelled.

Parameters

  parent | The parent window for the colour selection dialog.
  colInit | If given, this will be the colour initially selected in the dialog.
  caption | If given, this will be used for the dialog caption.
  data | Optional object storing additional colour dialog settings, such as custom colours. If none is provided the same settings as the last time are used.

Include file:

    #include <wx/colordlg.h>

## ◆ wxGetFontFromUser()

wxFont wxGetFontFromUser | ( | wxWindow * | parent,
|  | const wxFont & | fontInit,
|  | const wxString & | caption = `wxEmptyString`
| ) |  |

Shows the font selection dialog and returns the font selected by user or invalid font (use wxFont::IsOk() to test whether a font is valid) if the dialog was cancelled.

Parameters

  parent | The parent window for the font selection dialog.
  fontInit | If given, this will be the font initially selected in the dialog.
  caption | If given, this will be used for the dialog caption.

Include file:

    #include <wx/fontdlg.h>

## ◆ wxGetNumberFromUser()

long wxGetNumberFromUser | ( | const wxString & | message,
|  | const wxString & | prompt,
|  | const wxString & | caption,
|  | long | value,
|  | long | min = `0`,
|  | long | max = `100`,
|  | wxWindow * | parent = `NULL`,
|  | const wxPoint & | pos = `wxDefaultPosition`
| ) |  |

Shows a dialog asking the user for numeric input.

The dialogs title is set to `caption`, it contains a (possibly) multiline `message` above the single line `prompt` and the zone for entering the number.

The number entered must be in the range `min` to `max` (both of which should be positive) and `value` is the initial value of it. If the user enters an invalid value, it is forced to fall into the specified range. If the user cancels the dialog, the function returns -1. If it is important to distinguish between cancelling the dialog and actually entering -1 in it, i.e. if -1 is a valid input value, this convenience function can't be used and wxNumberEntryDialog should be used directly instead.

Dialog is centered on its `parent` unless an explicit position is given in `pos`.

Include file:

    #include <wx/numdlg.h>

See also
  wxNumberEntryDialog

## ◆ wxGetPasswordFromUser()

wxString wxGetPasswordFromUser | ( | const wxString & | message,
|  | const wxString & | caption = `wxGetPasswordFromUserPromptStr`,
|  | const wxString & | default_value = `wxEmptyString`,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`
| ) |  |

Similar to wxGetTextFromUser() but the text entered in the dialog is not shown on screen but replaced with stars.

This is intended to be used for entering passwords as the function name implies.

Include file:

    #include <wx/textdlg.h>

## ◆ wxGetSelectedChoices() [1/2]

int wxGetSelectedChoices | ( | wxArrayInt & | selections,
|  | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | aChoices,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`
| ) |  |

Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection listbox.

The user may choose an arbitrary (including 0) number of items in the listbox whose indices will be returned in `selections` array. The initial contents of this array will be used to select the items when the dialog is shown. If the user cancels the dialog, the function returns -1 and `selections` array is left unchanged.

You may pass the list of strings to choose from either using `choices` which is an array of n strings for the listbox or by using a single `aChoices` parameter of type wxArrayString.

If `centre` is true, the message text (which may include new line characters) is centred; if false, the message is left-justified.

Include file:

    #include <wx/choicdlg.h>

wxPerl Note: Use an array reference for the choices parameter. In wxPerl there is no selections parameter; the function returns an array containing the user selections.

## ◆ wxGetSelectedChoices() [2/2]

int wxGetSelectedChoices | ( | wxArrayInt & | selections,
|  | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString & | choices[],
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`
| ) |  |

## ◆ wxGetSingleChoice() [1/4]

wxString wxGetSingleChoice | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | aChoices,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

Pops up a dialog box containing a message, OK/Cancel buttons and a single-selection listbox.

The user may choose an item and press OK to return a string or Cancel to return the empty string. Use wxGetSingleChoiceIndex() if empty string is a valid choice and if you want to be able to detect pressing Cancel reliably.

You may pass the list of strings to choose from either using `choices` which is an array of n strings for the listbox or by using a single `aChoices` parameter of type wxArrayString.

If `centre` is true, the message text (which may include new line characters) is centred; if false, the message is left-justified.

Include file:

    #include <wx/choicdlg.h>

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

## ◆ wxGetSingleChoice() [2/4]

wxString wxGetSingleChoice | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | choices,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetSingleChoice() [3/4]

wxString wxGetSingleChoice | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString & | choices[],
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

## ◆ wxGetSingleChoice() [4/4]

wxString wxGetSingleChoice | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString * | choices,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetSingleChoiceData() [1/4]

wxString wxGetSingleChoiceData | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | aChoices,
|  | const wxString & | client_data[],
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

Same as wxGetSingleChoice but takes an array of client data pointers corresponding to the strings, and returns one of these pointers or NULL if Cancel was pressed.

The `client_data` array must have the same number of elements as `choices` or `aChoices!`

Include file:

    #include <wx/choicdlg.h>

wxPerl Note: Use an array reference for the aChoices and client_data parameters.

## ◆ wxGetSingleChoiceData() [2/4]

void* wxGetSingleChoiceData | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | choices,
|  | void ** | client_data,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetSingleChoiceData() [3/4]

wxString wxGetSingleChoiceData | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString & | choices[],
|  | const wxString & | client_data[],
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

## ◆ wxGetSingleChoiceData() [4/4]

void* wxGetSingleChoiceData | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString * | choices,
|  | void ** | client_data,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetSingleChoiceIndex() [1/4]

int wxGetSingleChoiceIndex | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | aChoices,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

Same as wxGetSingleChoice() but returns the index representing the selected string.

If the user pressed cancel, -1 is returned.

Include file:

    #include <wx/choicdlg.h>

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

## ◆ wxGetSingleChoiceIndex() [2/4]

int wxGetSingleChoiceIndex | ( | const wxString & | message,
|  | const wxString & | caption,
|  | const wxArrayString & | choices,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetSingleChoiceIndex() [3/4]

int wxGetSingleChoiceIndex | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString & | choices[],
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`,
|  | int | width = `wxCHOICE_WIDTH`,
|  | int | height = `wxCHOICE_HEIGHT`,
|  | int | initialSelection = `0`
| ) |  |

## ◆ wxGetSingleChoiceIndex() [4/4]

int wxGetSingleChoiceIndex | ( | const wxString & | message,
|  | const wxString & | caption,
|  | int | n,
|  | const wxString * | choices,
|  | int | initialSelection,
|  | wxWindow * | parent = `NULL`
| ) |  |

## ◆ wxGetTextFromUser()

wxString wxGetTextFromUser | ( | const wxString & | message,
|  | const wxString & | caption = `wxGetTextFromUserPromptStr`,
|  | const wxString & | default_value = `wxEmptyString`,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`,
|  | bool | centre = `true`
| ) |  |

Pop up a dialog box with title set to caption, `message`, and a `default_value`.

The user may type in text and press OK to return this text, or press Cancel to return the empty string.

If `centre` is true, the message text (which may include new line characters) is centred; if false, the message is left-justified.

This function is a wrapper around wxTextEntryDialog and while it is usually more convenient to use, using the dialog directly is more flexible, e.g. it allows you to specify the `wxTE_MULTILINE` to allow the user enter multiple lines of text while this function is limited to single line entry only.

Include file:

    #include <wx/textdlg.h>

## ◆ wxInfoMessageBox()

void wxInfoMessageBox | ( | wxWindow * | parent | ) |

Shows a message box with the information about the wxWidgets build used, including its version, most important build parameters and the version of the underlying GUI toolkit.

This is mainly used for diagnostic purposes and can be invoked by Ctrl-Alt-middle clicking on any wxWindow which doesn't otherwise handle this event.

Since
  2.9.0

See also
  wxGetLibraryVersionInfo()

Include file:

    #include <wx/utils.h>

## ◆ wxIsBusy()

bool wxIsBusy | ( |  | ) |

Returns true if between two wxBeginBusyCursor() and wxEndBusyCursor() calls.

See also
  wxBusyCursor.

Include file:

    #include <wx/utils.h>

## ◆ wxLoadFileSelector()

wxString wxLoadFileSelector | ( | const wxString & | what,
|  | const wxString & | extension,
|  | const wxString & | default_name = `wxEmptyString`,
|  | wxWindow * | parent = `NULL`
| ) |  |

Shows a file dialog asking the user for a file name for opening a file.

See also
  wxFileSelector(), wxFileDialog

Include file:

    #include <wx/filedlg.h>

## ◆ wxMessageBox()

int wxMessageBox | ( | const wxString & | message,
|  | const wxString & | caption = `wxMessageBoxCaptionStr`,
|  | int | style = `wxOK|wxCENTRE`,
|  | wxWindow * | parent = `NULL`,
|  | int | x = `wxDefaultCoord`,
|  | int | y = `wxDefaultCoord`
| ) |  |

Show a general purpose message dialog.

This is a convenient function which is usually used instead of using wxMessageDialog directly. Notice however that some of the features, such as extended text and custom labels for the message box buttons, are not provided by this function but only by wxMessageDialog.

The return value is one of: `wxYES`, `wxNO`, `wxCANCEL`, `wxOK` or `wxHELP` (notice that this return value is different from the return value of wxMessageDialog::ShowModal()).

For example:

int answer = wxMessageBox("Quit program?", "Confirm",
wxYES_NO | wxCANCEL, main_frame);
if (answer == wxYES)
main_frame->Close();
wxCANCEL
#define wxCANCEL
Definition: defs.h:455
wxYES_NO
#define wxYES_NO
Definition: defs.h:454
wxYES
#define wxYES
Definition: defs.h:451
wxMessageBox
int wxMessageBox(const wxString &message, const wxString &caption=wxMessageBoxCaptionStr, int style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Show a general purpose message dialog.

message may contain newline characters, in which case the message will be split into separate lines, to cater for large messages.

Parameters

  message | Message to show in the dialog.
  caption | The dialog title.
  parent | Parent window.
  style | Combination of style flags described in wxMessageDialog documentation.
  x | Horizontal dialog position (ignored under MSW). Use wxDefaultCoord for x and y to let the system position the window.
  y | Vertical dialog position (ignored under MSW).

Include file:

    #include <wx/msgdlg.h>

## ◆ wxSaveFileSelector()

wxString wxSaveFileSelector | ( | const wxString & | what,
|  | const wxString & | extension,
|  | const wxString & | default_name = `wxEmptyString`,
|  | wxWindow * | parent = `NULL`
| ) |  |

Shows a file dialog asking the user for a file name for saving a file.

See also
  wxFileSelector(), wxFileDialog

Include file:

    #include <wx/filedlg.h>

## ◆ wxShowTip()

bool wxShowTip | ( | wxWindow * | parent,
|  | wxTipProvider * | tipProvider,
|  | bool | showAtStartup = `true`
| ) |  |

This function shows a "startup tip" to the user.

The return value is the state of the "Show tips at startup" checkbox.

Parameters

  parent | The parent window for the modal dialog.
  tipProvider | An object which is used to get the text of the tips. It may be created with the wxCreateFileTipProvider() function.
  showAtStartup | Should be true if startup tips are shown, false otherwise. This is used as the initial value for "Show tips at startup" checkbox which is shown in the tips dialog.

See also
  wxTipProvider Overview

Include file:

    #include <wx/tipdlg.h>