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