]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/textdlg.h
interface revisions of ta*h te*h headers; grouped wxTextAttr #defines into enums...
[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{wxbase}
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 defaultValue
35 The default value, which may be the empty string.
36 @param style
37 A dialog style, specifying the buttons (wxOK, wxCANCEL) and an
38 optional wxCENTRE style. You do not need to specify the wxTE_PASSWORD style,
39 it is always applied.
40 @param pos
41 Dialog position.
42 */
43 wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
44 const wxString& caption = "Enter password",
45 const wxString& defaultValue = wxEmptyString,
46 long style = wxOK | wxCANCEL | wxCENTRE,
47 const wxPoint& pos = wxDefaultPosition);
48 };
49
50
51
52 /**
53 @class wxTextEntryDialog
54
55 This class represents a dialog that requests a one-line text string from the user.
56 It is implemented as a generic wxWidgets dialog.
57
58 @library{wxbase}
59 @category{cmndlg}
60
61 @see @ref overview_cmndlg_textentry
62 */
63 class wxTextEntryDialog : public wxDialog
64 {
65 public:
66 /**
67 Constructor. Use ShowModal() to show the dialog.
68
69 @param parent
70 Parent window.
71 @param message
72 Message to show on the dialog.
73 @param defaultValue
74 The default value, which may be the empty string.
75 @param style
76 A dialog style, specifying the buttons (wxOK, wxCANCEL)
77 and an optional wxCENTRE style. Additionally, wxTextCtrl styles
78 (such as wxTE_PASSWORD) may be specified here.
79 @param pos
80 Dialog position.
81 */
82 wxTextEntryDialog(wxWindow* parent, const wxString& message,
83 const wxString& caption = "Please enter text",
84 const wxString& defaultValue = "",
85 long style = wxOK | wxCANCEL | wxCENTRE,
86 const wxPoint& pos = wxDefaultPosition);
87
88 /**
89 Destructor.
90 */
91 virtual ~wxTextEntryDialog();
92
93 /**
94 Returns the text that the user has entered if the user has pressed OK, or the
95 original value if the user has pressed Cancel.
96 */
97 wxString GetValue() const;
98
99 /**
100 Sets the default text value.
101 */
102 void SetValue(const wxString& value);
103
104 /**
105 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
106 otherwise.
107 */
108 int ShowModal();
109 };
110
111
112
113 // ============================================================================
114 // Global functions/macros
115 // ============================================================================
116
117 /** @ingroup group_funcmacro_dialog */
118 //@{
119
120 /**
121 Pop up a dialog box with title set to @e caption, @c message, and a
122 @c default_value. The user may type in text and press OK to return this
123 text, or press Cancel to return the empty string.
124
125 If @c centre is @true, the message text (which may include new line
126 characters) is centred; if @false, the message is left-justified.
127
128 @header{wx/textdlg.h}
129 */
130 wxString wxGetTextFromUser(const wxString& message,
131 const wxString& caption = "Input text",
132 const wxString& default_value = "",
133 wxWindow* parent = NULL,
134 int x = wxDefaultCoord,
135 int y = wxDefaultCoord,
136 bool centre = true);
137
138 /**
139 Similar to wxGetTextFromUser() but the text entered in the dialog is not
140 shown on screen but replaced with stars. This is intended to be used for
141 entering passwords as the function name implies.
142
143 @header{wx/textdlg.h}
144 */
145 wxString wxGetPasswordFromUser(const wxString& message,
146 const wxString& caption = "Input text",
147 const wxString& default_value = "",
148 wxWindow* parent = NULL,
149 int x = wxDefaultCoord,
150 int y = wxDefaultCoord,
151 bool centre = true);
152
153 //@}
154