From 55b46fd164e36b063ee924e8a433f6b0f876dc70 Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Tue, 9 Nov 2004 19:13:15 +0000 Subject: [PATCH] [1001483] Added wxPasswordEntryDialog analagous to wxTextEntryDialog, allows detecting entering an empty string vs. cancel unlike the wxGetPasswordFromUser dialog function. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/category.tex | 1 + docs/latex/wx/passdlg.tex | 42 +++++++++++++++++++++++++++++++++++ docs/latex/wx/tcommdlg.tex | 8 +++++++ include/wx/generic/textdlgg.h | 21 +++++++++++++++++- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 docs/latex/wx/passdlg.tex diff --git a/docs/latex/wx/category.tex b/docs/latex/wx/category.tex index b62983d59e..517185ec06 100644 --- a/docs/latex/wx/category.tex +++ b/docs/latex/wx/category.tex @@ -68,6 +68,7 @@ in an application. \twocolitem{\helpref{wxMultiChoiceDialog}{wxmultichoicedialog}}{Dialog to get one or more selections from a list} \twocolitem{\helpref{wxSingleChoiceDialog}{wxsinglechoicedialog}}{Dialog to get a single selection from a list and return the string} \twocolitem{\helpref{wxTextEntryDialog}{wxtextentrydialog}}{Dialog to get a single line of text from the user} +\twocolitem{\helpref{wxPasswordEntryDialog}{wxpasswordentrydialog}}{Dialog to get a password from the user} \twocolitem{\helpref{wxFontDialog}{wxfontdialog}}{Font chooser dialog} \twocolitem{\helpref{wxPageSetupDialog}{wxpagesetupdialog}}{Standard page setup dialog} \twocolitem{\helpref{wxPrintDialog}{wxprintdialog}}{Standard print dialog} diff --git a/docs/latex/wx/passdlg.tex b/docs/latex/wx/passdlg.tex new file mode 100644 index 0000000000..8960e2f3ea --- /dev/null +++ b/docs/latex/wx/passdlg.tex @@ -0,0 +1,42 @@ +\section{\class{wxPasswordEntryDialog}}\label{wxpasswordentrydialog} + +This class represents a dialog that requests a one-line password string from the user. +It is implemented as a generic wxWidgets dialog. + +\wxheading{Derived from} + +\helpref{wxTextEntryDialog}{wxtextentrydialog}\\ +\helpref{wxDialog}{wxdialog}\\ +\helpref{wxWindow}{wxwindow}\\ +\helpref{wxEvtHandler}{wxevthandler}\\ +\helpref{wxObject}{wxobject} + +\wxheading{Include files} + + + +\wxheading{See also} + +\helpref{wxPassowrdEntryDialog overview}{wxpasswordentrydialogoverview} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxPasswordEntryDialog::wxPasswordEntryDialog}\label{wxpasswordentrydialogctor} + +\func{}{wxPasswordEntryDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message},\rtfsp +\param{const wxString\& }{caption = "Enter password"}, \param{const wxString\& }{defaultValue = ""}, \param{long }{style = wxOK \pipe wxCANCEL \pipe wxCENTRE}, \param{const wxPoint\& }{pos = wxDefaultPosition}} + +Constructor. Use \helpref{wxTextEntryDialog::ShowModal}{wxtextentrydialogshowmodal} to show the dialog. + +\wxheading{Parameters} + +\docparam{parent}{Parent window.} + +\docparam{message}{Message to show on the dialog.} + +\docparam{defaultValue}{The default value, which may be the empty string.} + +\docparam{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. + +\docparam{pos}{Dialog position.} diff --git a/docs/latex/wx/tcommdlg.tex b/docs/latex/wx/tcommdlg.tex index ab04ca7b56..564a734ebb 100644 --- a/docs/latex/wx/tcommdlg.tex +++ b/docs/latex/wx/tcommdlg.tex @@ -3,6 +3,7 @@ Classes: \helpref{wxColourDialog}{wxcolourdialog}, \helpref{wxFontDialog}{wxfontdialog}, \rtfsp\helpref{wxPrintDialog}{wxprintdialog}, \helpref{wxFileDialog}{wxfiledialog},\rtfsp \helpref{wxDirDialog}{wxdirdialog}, \helpref{wxTextEntryDialog}{wxtextentrydialog},\rtfsp +\helpref{wxPasswordEntryDialog}{wxpasswordentrydialog},\rtfsp \helpref{wxMessageDialog}{wxmessagedialog}, \helpref{wxSingleChoiceDialog}{wxsinglechoicedialog},\rtfsp \helpref{wxMultiChoiceDialog}{wxmultichoicedialog} @@ -178,6 +179,13 @@ Classes: \helpref{wxTextEntryDialog}{wxtextentrydialog} This is a dialog with a text entry field. The value that the user entered is obtained using \helpref{wxTextEntryDialog::GetValue}{wxtextentrydialoggetvalue}. +\subsection{wxPasswordEntryDialog overview}\label{wxpasswordentrydialogoverview} + +Classes: \helpref{wxPasswordEntryDialog}{wxpasswordentrydialog} + +This is a dialog with a password entry field. The value that the user +entered is obtained using \helpref{wxTextEntryDialog::GetValue}{wxtextentrydialoggetvalue}. + \subsection{wxMessageDialog overview}\label{wxmessagedialogoverview} Classes: \helpref{wxMessageDialog}{wxmessagedialog} diff --git a/include/wx/generic/textdlgg.h b/include/wx/generic/textdlgg.h index a95f4acec3..46883085ab 100644 --- a/include/wx/generic/textdlgg.h +++ b/include/wx/generic/textdlgg.h @@ -28,6 +28,7 @@ class WXDLLEXPORT wxTextCtrl; WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr; +WXDLLEXPORT_DATA(extern const wxChar*) wxGetPasswordFromUserPromptStr; #define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY) @@ -69,6 +70,24 @@ private: DECLARE_NO_COPY_CLASS(wxTextEntryDialog) }; +// ---------------------------------------------------------------------------- +// wxPasswordEntryDialog: dialog with password control, [ok] and [cancel] +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxPasswordEntryDialog : public wxTextEntryDialog +{ +public: + wxPasswordEntryDialog(wxWindow *parent, + const wxString& message, + const wxString& caption = wxGetPasswordFromUserPromptStr, + const wxString& value = wxEmptyString, + long style = wxTextEntryDialogStyle, + const wxPoint& pos = wxDefaultPosition); +private: + DECLARE_DYNAMIC_CLASS(wxPasswordEntryDialog) + DECLARE_NO_COPY_CLASS(wxPasswordEntryDialog) +}; + // ---------------------------------------------------------------------------- // function to get a string from user // ---------------------------------------------------------------------------- @@ -84,7 +103,7 @@ wxGetTextFromUser(const wxString& message, wxString WXDLLEXPORT wxGetPasswordFromUser(const wxString& message, - const wxString& caption = wxGetTextFromUserPromptStr, + const wxString& caption = wxGetPasswordFromUserPromptStr, const wxString& default_value = wxEmptyString, wxWindow *parent = (wxWindow *) NULL, wxCoord x = wxDefaultCoord, -- 2.45.2