1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPasswordEntryDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxPasswordEntryDialog
12 This class represents a dialog that requests a one-line password string from
15 It is implemented as a generic wxWidgets dialog.
20 @see @ref overview_cmndlg_password
22 class wxPasswordEntryDialog
: public wxTextEntryDialog
28 Use wxTextEntryDialog::ShowModal to show the dialog.
33 Message to show on the dialog.
35 The caption of the dialog.
37 The default value, which may be the empty string.
39 A dialog style, specifying the buttons (wxOK, wxCANCEL) and an
40 optional wxCENTRE style. You do not need to specify the wxTE_PASSWORD style,
45 wxPasswordEntryDialog(wxWindow
* parent
, const wxString
& message
,
46 const wxString
& caption
= wxGetPasswordFromUserPromptStr
,
47 const wxString
& defaultValue
= wxEmptyString
,
48 long style
= wxOK
| wxCANCEL
| wxCENTRE
,
49 const wxPoint
& pos
= wxDefaultPosition
);
55 @class wxTextEntryDialog
57 This class represents a dialog that requests a one-line text string from the user.
58 It is implemented as a generic wxWidgets dialog.
63 @see @ref overview_cmndlg_textentry
65 class wxTextEntryDialog
: public wxDialog
69 Constructor. Use ShowModal() to show the dialog.
74 Message to show on the dialog.
76 The caption of the dialog.
78 The default value, which may be the empty string.
80 A dialog style, specifying the buttons (wxOK, wxCANCEL)
81 and an optional wxCENTRE style. Additionally, wxTextCtrl styles
82 (such as @c wxTE_PASSWORD or @c wxTE_MULTILINE) may be specified
87 wxTextEntryDialog(wxWindow
* parent
, const wxString
& message
,
88 const wxString
& caption
= wxGetTextFromUserPromptStr
,
89 const wxString
& value
= wxEmptyString
,
90 long style
= wxOK
| wxCANCEL
| wxCENTRE
,
91 const wxPoint
& pos
= wxDefaultPosition
);
96 virtual ~wxTextEntryDialog();
99 Returns the text that the user has entered if the user has pressed OK, or the
100 original value if the user has pressed Cancel.
102 wxString
GetValue() const;
105 Sets the default text value.
107 void SetValue(const wxString
& value
);
110 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
118 // ============================================================================
119 // Global functions/macros
120 // ============================================================================
122 /** @addtogroup group_funcmacro_dialog */
126 Pop up a dialog box with title set to @e caption, @c message, and a
127 @c default_value. The user may type in text and press OK to return this
128 text, or press Cancel to return the empty string.
130 If @c centre is @true, the message text (which may include new line
131 characters) is centred; if @false, the message is left-justified.
133 This function is a wrapper around wxTextEntryDialog and while it is usually
134 more convenient to use, using the dialog directly is more flexible, e.g. it
135 allows you to specify the @c wxTE_MULTILINE to allow the user enter
136 multiple lines of text while this function is limited to single line entry
139 @header{wx/textdlg.h}
141 wxString
wxGetTextFromUser(const wxString
& message
,
142 const wxString
& caption
= "Input text",
143 const wxString
& default_value
= wxEmptyString
,
144 wxWindow
* parent
= NULL
,
145 int x
= wxDefaultCoord
,
146 int y
= wxDefaultCoord
,
150 Similar to wxGetTextFromUser() but the text entered in the dialog is not
151 shown on screen but replaced with stars. This is intended to be used for
152 entering passwords as the function name implies.
154 @header{wx/textdlg.h}
156 wxString
wxGetPasswordFromUser(const wxString
& message
,
157 const wxString
& caption
= "Input text",
158 const wxString
& default_value
= wxEmptyString
,
159 wxWindow
* parent
= NULL
,
160 int x
= wxDefaultCoord
,
161 int y
= wxDefaultCoord
,