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
This commit is contained in:
Kevin Hock 2004-11-06 02:21:39 +00:00
parent 01e1314745
commit b3bb2a7427
2 changed files with 14 additions and 3 deletions

View File

@ -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

View File

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