1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPasswordEntryDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 Default text dialog style.
12 #define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)
14 /// Default text dialog caption.
15 const char wxGetTextFromUserPromptStr
[] = "Input Text";
17 /// Default password dialog caption.
18 const char wxGetPasswordFromUserPromptStr
[] = "Enter Password";
22 @class wxPasswordEntryDialog
24 This class represents a dialog that requests a one-line password string from
27 It is implemented as a generic wxWidgets dialog.
32 @see @ref overview_cmndlg_password
34 class wxPasswordEntryDialog
: public wxTextEntryDialog
40 Use wxTextEntryDialog::ShowModal to show the dialog.
45 Message to show on the dialog.
47 The caption of the dialog.
49 The default value, which may be the empty string.
51 A dialog style, specifying the buttons (wxOK, wxCANCEL) and an
52 optional wxCENTRE style. You do not need to specify the wxTE_PASSWORD style,
57 wxPasswordEntryDialog(wxWindow
* parent
, const wxString
& message
,
58 const wxString
& caption
= wxGetPasswordFromUserPromptStr
,
59 const wxString
& defaultValue
= wxEmptyString
,
60 long style
= wxTextEntryDialogStyle
,
61 const wxPoint
& pos
= wxDefaultPosition
);
67 @class wxTextEntryDialog
69 This class represents a dialog that requests a one-line text string from the user.
70 It is implemented as a generic wxWidgets dialog.
75 @see @ref overview_cmndlg_textentry
77 class wxTextEntryDialog
: public wxDialog
81 Constructor. Use ShowModal() to show the dialog.
86 Message to show on the dialog.
88 The caption of the dialog.
90 The default value, which may be the empty string.
92 A dialog style, specifying the buttons (wxOK, wxCANCEL)
93 and an optional wxCENTRE style. Additionally, wxTextCtrl styles
94 (such as @c wxTE_PASSWORD or @c wxTE_MULTILINE) may be specified
99 wxTextEntryDialog(wxWindow
* parent
, const wxString
& message
,
100 const wxString
& caption
= wxGetTextFromUserPromptStr
,
101 const wxString
& value
= wxEmptyString
,
102 long style
= wxTextEntryDialogStyle
,
103 const wxPoint
& pos
= wxDefaultPosition
);
108 virtual ~wxTextEntryDialog();
111 Returns the text that the user has entered if the user has pressed OK, or the
112 original value if the user has pressed Cancel.
114 wxString
GetValue() const;
117 Sets the default text value.
119 void SetValue(const wxString
& value
);
122 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
130 // ============================================================================
131 // Global functions/macros
132 // ============================================================================
134 /** @addtogroup group_funcmacro_dialog */
138 Pop up a dialog box with title set to @e caption, @c message, and a
139 @c default_value. The user may type in text and press OK to return this
140 text, or press Cancel to return the empty string.
142 If @c centre is @true, the message text (which may include new line
143 characters) is centred; if @false, the message is left-justified.
145 This function is a wrapper around wxTextEntryDialog and while it is usually
146 more convenient to use, using the dialog directly is more flexible, e.g. it
147 allows you to specify the @c wxTE_MULTILINE to allow the user enter
148 multiple lines of text while this function is limited to single line entry
151 @header{wx/textdlg.h}
153 wxString
wxGetTextFromUser(const wxString
& message
,
154 const wxString
& caption
= wxGetTextFromUserPromptStr
,
155 const wxString
& default_value
= wxEmptyString
,
156 wxWindow
* parent
= NULL
,
157 int x
= wxDefaultCoord
,
158 int y
= wxDefaultCoord
,
162 Similar to wxGetTextFromUser() but the text entered in the dialog is not
163 shown on screen but replaced with stars. This is intended to be used for
164 entering passwords as the function name implies.
166 @header{wx/textdlg.h}
168 wxString
wxGetPasswordFromUser(const wxString
& message
,
169 const wxString
& caption
= wxGetPasswordFromUserPromptStr
,
170 const wxString
& default_value
= wxEmptyString
,
171 wxWindow
* parent
= NULL
,
172 int x
= wxDefaultCoord
,
173 int y
= wxDefaultCoord
,