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.
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:
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>
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.
Include file:
#include <wx/utils.h>
This function creates a wxTipProvider which may be used with wxShowTip().
Include file:
#include <wx/tipdlg.h>
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:
Include file:
#include <wx/dirdlg.h>
Changes the cursor back to the original cursor, for all windows in the application.
Use with wxBeginBusyCursor().
Include file:
#include <wx/utils.h> wxFD_OPEN, wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD:
The application must check for an empty return value (the user pressed Cancel). For example:
Include file:
#include <wx/filedlg.h>
An extended version of wxFileSelector()
Include file:
#include <wx/filedlg.h>
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.
Include file:
#include <wx/aboutdlg.h>
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.
Include file:
#include <wx/colordlg.h>
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.
Include file:
#include <wx/fontdlg.h>
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>
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>
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.. In wxPerl there is no selections parameter; the function returns an array containing the user selections.
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 wxGetS.
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.
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. 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> wxWindow which doesn't otherwise handle this event.
Include file:
#include <wx/utils.h>
Returns true if between two wxBeginBusyCursor() and wxEndBusyCursor() calls.
Include file:
#include <wx/utils.h>
Shows a file dialog asking the user for a file name for opening a file.
Include file:
#include <wx/filedlg.h>
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:
message may contain newline characters, in which case the message will be split into separate lines, to cater for large messages.
Include file:
#include <wx/msgdlg.h>
Shows a file dialog asking the user for a file name for saving a file.
Include file:
#include <wx/filedlg.h>
This function shows a "startup tip" to the user.
The return value is the state of the "Show tips at startup" checkbox.
Include file:
#include <wx/tipdlg.h>