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();