]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/textdlg.h
Moved list of subclasses away from 'classes overview' corrected some wxGrid overview...
[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 caption
74 The caption of the the dialog.
75 @param defaultValue
76 The default value, which may be the empty string.
77 @param style
78 A dialog style, specifying the buttons (wxOK, wxCANCEL)
79 and an optional wxCENTRE style. Additionally, wxTextCtrl styles
80 (such as wxTE_PASSWORD) may be specified here.
81 @param pos
82 Dialog position.
83 */
84 wxTextEntryDialog(wxWindow* parent, const wxString& message,
85 const wxString& caption = "Please enter text",
86 const wxString& defaultValue = "",
87 long style = wxOK | wxCANCEL | wxCENTRE,
88 const wxPoint& pos = wxDefaultPosition);
89
90 /**
91 Destructor.
92 */
93 virtual ~wxTextEntryDialog();
94
95 /**
96 Returns the text that the user has entered if the user has pressed OK, or the
97 original value if the user has pressed Cancel.
98 */
99 wxString GetValue() const;
100
101 /**
102 Sets the default text value.
103 */
104 void SetValue(const wxString& value);
105
106 /**
107 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
108 otherwise.
109 */
110 int ShowModal();
111 };
112
113
114
115 // ============================================================================
116 // Global functions/macros
117 // ============================================================================
118
119 /** @ingroup group_funcmacro_dialog */
120 //@{
121
122 /**
123 Pop up a dialog box with title set to @e caption, @c message, and a
124 @c default_value. The user may type in text and press OK to return this
125 text, or press Cancel to return the empty string.
126
127 If @c centre is @true, the message text (which may include new line
128 characters) is centred; if @false, the message is left-justified.
129
130 @header{wx/textdlg.h}
131 */
132 wxString wxGetTextFromUser(const wxString& message,
133 const wxString& caption = "Input text",
134 const wxString& default_value = "",
135 wxWindow* parent = NULL,
136 int x = wxDefaultCoord,
137 int y = wxDefaultCoord,
138 bool centre = true);
139
140 /**
141 Similar to wxGetTextFromUser() but the text entered in the dialog is not
142 shown on screen but replaced with stars. This is intended to be used for
143 entering passwords as the function name implies.
144
145 @header{wx/textdlg.h}
146 */
147 wxString wxGetPasswordFromUser(const wxString& message,
148 const wxString& caption = "Input text",
149 const wxString& default_value = "",
150 wxWindow* parent = NULL,
151 int x = wxDefaultCoord,
152 int y = wxDefaultCoord,
153 bool centre = true);
154
155 //@}
156