s/""/wxEmptyString
[wxWidgets.git] / interface / wx / textdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textdlg.h
3 // Purpose: interface of wxPasswordEntryDialog
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPasswordEntryDialog
11
12 This class represents a dialog that requests a one-line password string from
13 the user.
14
15 It is implemented as a generic wxWidgets dialog.
16
17 @library{wxcore}
18 @category{cmndlg}
19
20 @see @ref overview_cmndlg_password
21 */
22 class wxPasswordEntryDialog : public wxTextEntryDialog
23 {
24 public:
25 /**
26 Constructor.
27
28 Use wxTextEntryDialog::ShowModal to show the dialog.
29
30 @param parent
31 Parent window.
32 @param message
33 Message to show on the dialog.
34 @param caption
35 The caption of the dialog.
36 @param defaultValue
37 The default value, which may be the empty string.
38 @param style
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,
41 it is always applied.
42 @param pos
43 Dialog position.
44 */
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);
50 };
51
52
53
54 /**
55 @class wxTextEntryDialog
56
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.
59
60 @library{wxcore}
61 @category{cmndlg}
62
63 @see @ref overview_cmndlg_textentry
64 */
65 class wxTextEntryDialog : public wxDialog
66 {
67 public:
68 /**
69 Constructor. Use ShowModal() to show the dialog.
70
71 @param parent
72 Parent window.
73 @param message
74 Message to show on the dialog.
75 @param caption
76 The caption of the the dialog.
77 @param value
78 The default value, which may be the empty string.
79 @param style
80 A dialog style, specifying the buttons (wxOK, wxCANCEL)
81 and an optional wxCENTRE style. Additionally, wxTextCtrl styles
82 (such as wxTE_PASSWORD) may be specified here.
83 @param pos
84 Dialog position.
85 */
86 wxTextEntryDialog(wxWindow* parent, const wxString& message,
87 const wxString& caption = wxGetTextFromUserPromptStr,
88 const wxString& value = wxEmptyString,
89 long style = wxOK | wxCANCEL | wxCENTRE,
90 const wxPoint& pos = wxDefaultPosition);
91
92 /**
93 Destructor.
94 */
95 virtual ~wxTextEntryDialog();
96
97 /**
98 Returns the text that the user has entered if the user has pressed OK, or the
99 original value if the user has pressed Cancel.
100 */
101 wxString GetValue() const;
102
103 /**
104 Sets the default text value.
105 */
106 void SetValue(const wxString& value);
107
108 /**
109 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
110 otherwise.
111 */
112 int ShowModal();
113 };
114
115
116
117 // ============================================================================
118 // Global functions/macros
119 // ============================================================================
120
121 /** @addtogroup group_funcmacro_dialog */
122 //@{
123
124 /**
125 Pop up a dialog box with title set to @e caption, @c message, and a
126 @c default_value. The user may type in text and press OK to return this
127 text, or press Cancel to return the empty string.
128
129 If @c centre is @true, the message text (which may include new line
130 characters) is centred; if @false, the message is left-justified.
131
132 @header{wx/textdlg.h}
133 */
134 wxString wxGetTextFromUser(const wxString& message,
135 const wxString& caption = "Input text",
136 const wxString& default_value = wxEmptyString,
137 wxWindow* parent = NULL,
138 int x = wxDefaultCoord,
139 int y = wxDefaultCoord,
140 bool centre = true);
141
142 /**
143 Similar to wxGetTextFromUser() but the text entered in the dialog is not
144 shown on screen but replaced with stars. This is intended to be used for
145 entering passwords as the function name implies.
146
147 @header{wx/textdlg.h}
148 */
149 wxString wxGetPasswordFromUser(const wxString& message,
150 const wxString& caption = "Input text",
151 const wxString& default_value = wxEmptyString,
152 wxWindow* parent = NULL,
153 int x = wxDefaultCoord,
154 int y = wxDefaultCoord,
155 bool centre = true);
156
157 //@}
158