]> git.saurik.com Git - wxWidgets.git/blob - interface/textdlg.h
adjusted indentation with astyle; added Id keyword
[wxWidgets.git] / interface / textdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textdlg.h
3 // Purpose: documentation for wxPasswordEntryDialog class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPasswordEntryDialog
11 @wxheader{textdlg.h}
12
13 This class represents a dialog that requests a one-line password string from
14 the user.
15 It is implemented as a generic wxWidgets dialog.
16
17 @library{wxbase}
18 @category{cmndlg}
19
20 @seealso
21 @ref overview_wxpasswordentrydialogoverview "wxPassowrdEntryDialog overview"
22 */
23 class wxPasswordEntryDialog : public wxTextEntryDialog
24 {
25 public:
26
27 };
28
29
30 /**
31 @class wxTextEntryDialog
32 @wxheader{textdlg.h}
33
34 This class represents a dialog that requests a one-line text string from the
35 user.
36 It is implemented as a generic wxWidgets dialog.
37
38 @library{wxbase}
39 @category{cmndlg}
40
41 @seealso
42 @ref overview_wxtextentrydialogoverview "wxTextEntryDialog overview"
43 */
44 class wxTextEntryDialog : public wxDialog
45 {
46 public:
47 /**
48 Constructor. Use ShowModal() to show the dialog.
49
50 @param parent
51 Parent window.
52
53 @param message
54 Message to show on the dialog.
55
56 @param defaultValue
57 The default value, which may be the empty string.
58
59 @param style
60 A dialog style, specifying the buttons (wxOK, wxCANCEL)
61 and an optional wxCENTRE style. Additionally, wxTextCtrl styles (such as
62 wxTE_PASSWORD) may be specified here.
63
64 @param pos
65 Dialog position.
66 */
67 wxTextEntryDialog(wxWindow* parent, const wxString& message,
68 const wxString& caption = "Please enter text",
69 const wxString& defaultValue = "",
70 long style = wxOK | wxCANCEL | wxCENTRE,
71 const wxPoint& pos = wxDefaultPosition);
72
73 /**
74 Destructor.
75 */
76 ~wxTextEntryDialog();
77
78 /**
79 Returns the text that the user has entered if the user has pressed OK, or the
80 original value
81 if the user has pressed Cancel.
82 */
83 wxString GetValue();
84
85 /**
86 Sets the default text value.
87 */
88 void SetValue(const wxString& value);
89
90 /**
91 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
92 otherwise.
93 */
94 int ShowModal();
95 };
96
97
98 // ============================================================================
99 // Global functions/macros
100 // ============================================================================
101
102 /**
103 Pop up a dialog box with title set to @e caption, @e message, and a
104 @e default_value. The user may type in text and press OK to return this text,
105 or press Cancel to return the empty string.
106
107 If @e centre is @true, the message text (which may include new line characters)
108 is centred; if @false, the message is left-justified.
109 */
110 wxString wxGetTextFromUser(const wxString& message,
111 const wxString& caption = "Input text",
112 const wxString& default_value = "",
113 wxWindow * parent = @NULL,
114 int x = wxDefaultCoord,
115 int y = wxDefaultCoord,
116 bool centre = @true);
117
118 /**
119 Similar to wxGetTextFromUser but the text entered
120 in the dialog is not shown on screen but replaced with stars. This is intended
121 to be used for entering passwords as the function name implies.
122 */
123 wxString wxGetPasswordFromUser(const wxString& message,
124 const wxString& caption = "Input text",
125 const wxString& default_value = "",
126 wxWindow * parent = @NULL,
127 int x = wxDefaultCoord,
128 int y = wxDefaultCoord,
129 bool centre = @true);
130