2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: textdlg.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxPasswordEntryDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPasswordEntryDialog
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class represents a dialog that requests a one-line password string from
|
|
|
|
the user.
|
2008-10-04 07:01:50 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
It is implemented as a generic wxWidgets dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@category{cmndlg}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 07:01:50 -04:00
|
|
|
@see @ref overview_cmndlg_password
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxPasswordEntryDialog : public wxTextEntryDialog
|
|
|
|
{
|
|
|
|
public:
|
2008-10-04 07:01:50 -04:00
|
|
|
/**
|
|
|
|
Constructor.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 07:01:50 -04:00
|
|
|
Use wxTextEntryDialog::ShowModal to show the dialog.
|
|
|
|
|
|
|
|
@param parent
|
|
|
|
Parent window.
|
|
|
|
@param message
|
|
|
|
Message to show on the dialog.
|
2008-10-07 12:57:34 -04:00
|
|
|
@param caption
|
|
|
|
The caption of the dialog.
|
2008-10-04 07:01:50 -04: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 09:46:42 -04:00
|
|
|
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
2008-10-04 07:01:50 -04:00
|
|
|
const wxString& defaultValue = wxEmptyString,
|
|
|
|
long style = wxOK | wxCANCEL | wxCENTRE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxTextEntryDialog
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 07:01:50 -04:00
|
|
|
This class represents a dialog that requests a one-line text string from the user.
|
2008-03-08 08:52:38 -05:00
|
|
|
It is implemented as a generic wxWidgets dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@category{cmndlg}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 07:01:50 -04:00
|
|
|
@see @ref overview_cmndlg_textentry
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxTextEntryDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor. Use ShowModal() to show the dialog.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param message
|
2008-03-09 08:33:59 -04:00
|
|
|
Message to show on the dialog.
|
2008-10-04 10:52:38 -04:00
|
|
|
@param caption
|
|
|
|
The caption of the the dialog.
|
2008-10-19 12:07:00 -04:00
|
|
|
@param value
|
2008-03-09 08:33:59 -04:00
|
|
|
The default value, which may be the empty string.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
A dialog style, specifying the buttons (wxOK, wxCANCEL)
|
2008-10-04 07:01:50 -04:00
|
|
|
and an optional wxCENTRE style. Additionally, wxTextCtrl styles
|
|
|
|
(such as wxTE_PASSWORD) may be specified here.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Dialog position.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxTextEntryDialog(wxWindow* parent, const wxString& message,
|
2008-10-13 09:46:42 -04:00
|
|
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
|
|
|
const wxString& value = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxOK | wxCANCEL | wxCENTRE,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxTextEntryDialog();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text that the user has entered if the user has pressed OK, or the
|
2008-10-04 07:01:50 -04:00
|
|
|
original value if the user has pressed Cancel.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString GetValue() const;
|
2008-03-08 08:52:38 -05: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 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2008-03-18 15:30:01 -04:00
|
|
|
/** @ingroup group_funcmacro_dialog */
|
|
|
|
//@{
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-18 15:30:01 -04: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 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxString wxGetTextFromUser(const wxString& message,
|
|
|
|
const wxString& caption = "Input text",
|
|
|
|
const wxString& default_value = "",
|
2008-03-09 08:33:59 -04:00
|
|
|
wxWindow* parent = NULL,
|
2008-03-08 08:52:38 -05:00
|
|
|
int x = wxDefaultCoord,
|
|
|
|
int y = wxDefaultCoord,
|
2008-03-09 08:33:59 -04:00
|
|
|
bool centre = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-18 15:30:01 -04: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 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxString wxGetPasswordFromUser(const wxString& message,
|
|
|
|
const wxString& caption = "Input text",
|
|
|
|
const wxString& default_value = "",
|
2008-03-09 08:33:59 -04:00
|
|
|
wxWindow* parent = NULL,
|
2008-03-08 08:52:38 -05:00
|
|
|
int x = wxDefaultCoord,
|
|
|
|
int y = wxDefaultCoord,
|
2008-03-09 08:33:59 -04:00
|
|
|
bool centre = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-18 15:30:01 -04:00
|
|
|
//@}
|
|
|
|
|