2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: textdlg.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxPasswordEntryDialog
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPasswordEntryDialog
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This class represents a dialog that requests a one-line password string from
|
|
|
|
the user.
|
2008-10-04 11:01:50 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
It is implemented as a generic wxWidgets dialog.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxbase}
|
|
|
|
@category{cmndlg}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-04 11:01:50 +00:00
|
|
|
@see @ref overview_cmndlg_password
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxPasswordEntryDialog : public wxTextEntryDialog
|
|
|
|
{
|
|
|
|
public:
|
2008-10-04 11:01:50 +00:00
|
|
|
/**
|
|
|
|
Constructor.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-04 11:01:50 +00:00
|
|
|
Use wxTextEntryDialog::ShowModal to show the dialog.
|
|
|
|
|
|
|
|
@param parent
|
|
|
|
Parent window.
|
|
|
|
@param message
|
|
|
|
Message to show on the dialog.
|
2008-10-07 16:57:34 +00:00
|
|
|
@param caption
|
|
|
|
The caption of the dialog.
|
2008-10-04 11:01:50 +00:00
|
|
|
@param defaultValue
|
|
|
|
The default value, which may be the empty string.
|
|
|
|
@param style
|
|
|
|
A dialog style, specifying the buttons (wxOK, wxCANCEL) and an
|
|
|
|
optional wxCENTRE style. You do not need to specify the wxTE_PASSWORD style,
|
|
|
|
it is always applied.
|
|
|
|
@param pos
|
|
|
|
Dialog position.
|
|
|
|
*/
|
|
|
|
wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
|
2008-10-13 13:46:42 +00:00
|
|
|
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
2008-10-04 11:01:50 +00:00
|
|
|
const wxString& defaultValue = wxEmptyString,
|
|
|
|
long style = wxOK | wxCANCEL | wxCENTRE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxTextEntryDialog
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-04 11:01:50 +00:00
|
|
|
This class represents a dialog that requests a one-line text string from the user.
|
2008-03-08 13:52:38 +00:00
|
|
|
It is implemented as a generic wxWidgets dialog.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxbase}
|
|
|
|
@category{cmndlg}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-04 11:01:50 +00:00
|
|
|
@see @ref overview_cmndlg_textentry
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxTextEntryDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor. Use ShowModal() to show the dialog.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param message
|
2008-03-09 12:33:59 +00:00
|
|
|
Message to show on the dialog.
|
2008-10-04 14:52:38 +00:00
|
|
|
@param caption
|
|
|
|
The caption of the the dialog.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param defaultValue
|
2008-03-09 12:33:59 +00:00
|
|
|
The default value, which may be the empty string.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
A dialog style, specifying the buttons (wxOK, wxCANCEL)
|
2008-10-04 11:01:50 +00:00
|
|
|
and an optional wxCENTRE style. Additionally, wxTextCtrl styles
|
|
|
|
(such as wxTE_PASSWORD) may be specified here.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Dialog position.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxTextEntryDialog(wxWindow* parent, const wxString& message,
|
2008-10-13 13:46:42 +00:00
|
|
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
|
|
|
const wxString& value = wxEmptyString,
|
2008-03-09 12:33:59 +00:00
|
|
|
long style = wxOK | wxCANCEL | wxCENTRE,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxTextEntryDialog();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text that the user has entered if the user has pressed OK, or the
|
2008-10-04 11:01:50 +00:00
|
|
|
original value if the user has pressed Cancel.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetValue() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the default text value.
|
|
|
|
*/
|
|
|
|
void SetValue(const wxString& value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
|
|
|
|
otherwise.
|
|
|
|
*/
|
|
|
|
int ShowModal();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2008-03-18 19:30:01 +00:00
|
|
|
/** @ingroup group_funcmacro_dialog */
|
|
|
|
//@{
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2008-03-18 19:30:01 +00:00
|
|
|
Pop up a dialog box with title set to @e caption, @c message, and a
|
|
|
|
@c default_value. The user may type in text and press OK to return this
|
|
|
|
text, or press Cancel to return the empty string.
|
|
|
|
|
|
|
|
If @c centre is @true, the message text (which may include new line
|
|
|
|
characters) is centred; if @false, the message is left-justified.
|
|
|
|
|
|
|
|
@header{wx/textdlg.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxString wxGetTextFromUser(const wxString& message,
|
|
|
|
const wxString& caption = "Input text",
|
|
|
|
const wxString& default_value = "",
|
2008-03-09 12:33:59 +00:00
|
|
|
wxWindow* parent = NULL,
|
2008-03-08 13:52:38 +00:00
|
|
|
int x = wxDefaultCoord,
|
|
|
|
int y = wxDefaultCoord,
|
2008-03-09 12:33:59 +00:00
|
|
|
bool centre = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-18 19:30:01 +00:00
|
|
|
Similar to wxGetTextFromUser() but the text entered in the dialog is not
|
|
|
|
shown on screen but replaced with stars. This is intended to be used for
|
|
|
|
entering passwords as the function name implies.
|
|
|
|
|
|
|
|
@header{wx/textdlg.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxString wxGetPasswordFromUser(const wxString& message,
|
|
|
|
const wxString& caption = "Input text",
|
|
|
|
const wxString& default_value = "",
|
2008-03-09 12:33:59 +00:00
|
|
|
wxWindow* parent = NULL,
|
2008-03-08 13:52:38 +00:00
|
|
|
int x = wxDefaultCoord,
|
|
|
|
int y = wxDefaultCoord,
|
2008-03-09 12:33:59 +00:00
|
|
|
bool centre = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2008-03-18 19:30:01 +00:00
|
|
|
//@}
|
|
|
|
|