]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: textdlg.h | |
e54c96f1 | 3 | // Purpose: interface of wxPasswordEntryDialog |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxPasswordEntryDialog | |
7c913512 | 11 | |
23324ae1 FM |
12 | This class represents a dialog that requests a one-line password string from |
13 | the user. | |
c6cf894a | 14 | |
23324ae1 | 15 | It is implemented as a generic wxWidgets dialog. |
7c913512 | 16 | |
23324ae1 FM |
17 | @library{wxbase} |
18 | @category{cmndlg} | |
7c913512 | 19 | |
c6cf894a | 20 | @see @ref overview_cmndlg_password |
23324ae1 FM |
21 | */ |
22 | class wxPasswordEntryDialog : public wxTextEntryDialog | |
23 | { | |
24 | public: | |
c6cf894a FM |
25 | /** |
26 | Constructor. | |
7c913512 | 27 | |
c6cf894a FM |
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); | |
23324ae1 FM |
48 | }; |
49 | ||
50 | ||
e54c96f1 | 51 | |
23324ae1 FM |
52 | /** |
53 | @class wxTextEntryDialog | |
7c913512 | 54 | |
c6cf894a | 55 | This class represents a dialog that requests a one-line text string from the user. |
23324ae1 | 56 | It is implemented as a generic wxWidgets dialog. |
7c913512 | 57 | |
23324ae1 FM |
58 | @library{wxbase} |
59 | @category{cmndlg} | |
7c913512 | 60 | |
c6cf894a | 61 | @see @ref overview_cmndlg_textentry |
23324ae1 FM |
62 | */ |
63 | class wxTextEntryDialog : public wxDialog | |
64 | { | |
65 | public: | |
66 | /** | |
67 | Constructor. Use ShowModal() to show the dialog. | |
3c4f71cc | 68 | |
7c913512 | 69 | @param parent |
4cc4bfaf | 70 | Parent window. |
7c913512 | 71 | @param message |
4cc4bfaf | 72 | Message to show on the dialog. |
77bfb902 FM |
73 | @param caption |
74 | The caption of the the dialog. | |
7c913512 | 75 | @param defaultValue |
4cc4bfaf | 76 | The default value, which may be the empty string. |
7c913512 | 77 | @param style |
4cc4bfaf | 78 | A dialog style, specifying the buttons (wxOK, wxCANCEL) |
c6cf894a FM |
79 | and an optional wxCENTRE style. Additionally, wxTextCtrl styles |
80 | (such as wxTE_PASSWORD) may be specified here. | |
7c913512 | 81 | @param pos |
4cc4bfaf | 82 | Dialog position. |
23324ae1 FM |
83 | */ |
84 | wxTextEntryDialog(wxWindow* parent, const wxString& message, | |
85 | const wxString& caption = "Please enter text", | |
86 | const wxString& defaultValue = "", | |
4cc4bfaf | 87 | long style = wxOK | wxCANCEL | wxCENTRE, |
23324ae1 FM |
88 | const wxPoint& pos = wxDefaultPosition); |
89 | ||
90 | /** | |
91 | Destructor. | |
92 | */ | |
adaaa686 | 93 | virtual ~wxTextEntryDialog(); |
23324ae1 FM |
94 | |
95 | /** | |
96 | Returns the text that the user has entered if the user has pressed OK, or the | |
c6cf894a | 97 | original value if the user has pressed Cancel. |
23324ae1 | 98 | */ |
328f5751 | 99 | wxString GetValue() const; |
23324ae1 FM |
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 | ||
e54c96f1 | 114 | |
23324ae1 FM |
115 | // ============================================================================ |
116 | // Global functions/macros | |
117 | // ============================================================================ | |
118 | ||
ba2874ff BP |
119 | /** @ingroup group_funcmacro_dialog */ |
120 | //@{ | |
121 | ||
23324ae1 | 122 | /** |
ba2874ff BP |
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} | |
23324ae1 FM |
131 | */ |
132 | wxString wxGetTextFromUser(const wxString& message, | |
133 | const wxString& caption = "Input text", | |
134 | const wxString& default_value = "", | |
4cc4bfaf | 135 | wxWindow* parent = NULL, |
23324ae1 FM |
136 | int x = wxDefaultCoord, |
137 | int y = wxDefaultCoord, | |
4cc4bfaf | 138 | bool centre = true); |
23324ae1 FM |
139 | |
140 | /** | |
ba2874ff BP |
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} | |
23324ae1 FM |
146 | */ |
147 | wxString wxGetPasswordFromUser(const wxString& message, | |
148 | const wxString& caption = "Input text", | |
149 | const wxString& default_value = "", | |
4cc4bfaf | 150 | wxWindow* parent = NULL, |
23324ae1 FM |
151 | int x = wxDefaultCoord, |
152 | int y = wxDefaultCoord, | |
4cc4bfaf | 153 | bool centre = true); |
23324ae1 | 154 | |
ba2874ff BP |
155 | //@} |
156 |