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