From b3bb2a742781bab68da4a5e40f355784ffa79c23 Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Sat, 6 Nov 2004 02:21:39 +0000 Subject: [PATCH 1/1] Add ability to position and/or center the dialog for wxGetPasswordFromUser like you can for wxGetTextFrom User git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/textdlgg.h | 5 ++++- src/common/utilscmn.cpp | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/wx/generic/textdlgg.h b/include/wx/generic/textdlgg.h index f39a29b638..a95f4acec3 100644 --- a/include/wx/generic/textdlgg.h +++ b/include/wx/generic/textdlgg.h @@ -86,7 +86,10 @@ wxString WXDLLEXPORT wxGetPasswordFromUser(const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr, const wxString& default_value = wxEmptyString, - wxWindow *parent = (wxWindow *) NULL); + wxWindow *parent = (wxWindow *) NULL, + wxCoord x = wxDefaultCoord, + wxCoord y = wxDefaultCoord, + bool centre = true); #endif // wxUSE_TEXTDLG diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 5e25ae4024..cc066591b5 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -809,11 +809,19 @@ wxString wxGetTextFromUser(const wxString& message, const wxString& caption, wxString wxGetPasswordFromUser(const wxString& message, const wxString& caption, const wxString& defaultValue, - wxWindow *parent) + wxWindow *parent, + wxCoord x, wxCoord y, bool centre ) { wxString str; + long style = wxTextEntryDialogStyle; + + if (centre) + style |= wxCENTRE; + else + style &= ~wxCENTRE; + wxTextEntryDialog dialog(parent, message, caption, defaultValue, - wxOK | wxCANCEL | wxTE_PASSWORD); + style | wxTE_PASSWORD, wxPoint(x, y)); if ( dialog.ShowModal() == wxID_OK ) { str = dialog.GetValue(); -- 2.45.2