From b69da09293cf4155788b28dc5e3f51145d2ce0d5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 21 Dec 2013 12:23:59 +0000 Subject: [PATCH] Add wxPasswordEntryDialog default ctor and Create(). Allow creating wxPasswordEntryDialog in 2 steps, as most of the other classes. Closes #15770. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/textdlgg.h | 15 ++++++++++++++- src/generic/textdlgg.cpp | 16 ++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/include/wx/generic/textdlgg.h b/include/wx/generic/textdlgg.h index 023d497c30..69d29415c5 100644 --- a/include/wx/generic/textdlgg.h +++ b/include/wx/generic/textdlgg.h @@ -96,12 +96,25 @@ private: class WXDLLIMPEXP_CORE wxPasswordEntryDialog : public wxTextEntryDialog { public: + wxPasswordEntryDialog(); wxPasswordEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetPasswordFromUserPromptStr, const wxString& value = wxEmptyString, long style = wxTextEntryDialogStyle, - const wxPoint& pos = wxDefaultPosition); + const wxPoint& pos = wxDefaultPosition) + { + Create(parent, message, caption, value, style, pos); + } + + bool Create(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) wxDECLARE_NO_COPY_CLASS(wxPasswordEntryDialog); diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index f3d697fafc..78c6093982 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -189,16 +189,16 @@ void wxTextEntryDialog::SetTextValidator( const wxTextValidator& validator ) IMPLEMENT_CLASS(wxPasswordEntryDialog, wxTextEntryDialog) -wxPasswordEntryDialog::wxPasswordEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxString& value, - long style, - const wxPoint& pos) - : wxTextEntryDialog(parent, message, caption, value, - style | wxTE_PASSWORD, pos) +bool wxPasswordEntryDialog::Create(wxWindow *parent, + const wxString& message, + const wxString& caption, + const wxString& value, + long style, + const wxPoint& pos) { // Only change from wxTextEntryDialog is the password style + return wxTextEntryDialog::Create(parent, message, caption, value, + style | wxTE_PASSWORD, pos); } #endif // wxUSE_TEXTDLG