]> git.saurik.com Git - wxWidgets.git/commitdiff
Add ability to position and/or center the dialog for wxGetPasswordFromUser like you...
authorKevin Hock <hockkn@yahoo.com>
Sat, 6 Nov 2004 02:21:39 +0000 (02:21 +0000)
committerKevin Hock <hockkn@yahoo.com>
Sat, 6 Nov 2004 02:21:39 +0000 (02:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/textdlgg.h
src/common/utilscmn.cpp

index f39a29b6387e0ec253ca641619cb99d8aab86186..a95f4acec3950bd5a186bf4a6b8def49a3564f43 100644 (file)
@@ -86,7 +86,10 @@ wxString WXDLLEXPORT
 wxGetPasswordFromUser(const wxString& message,
                       const wxString& caption = wxGetTextFromUserPromptStr,
                       const wxString& default_value = wxEmptyString,
 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
 
 #endif
     // wxUSE_TEXTDLG
index 5e25ae4024b39d71d7a93a90bb986fa0d88a8273..cc066591b57bfa2c410f59cdcde27c26b2f9cfc8 100644 (file)
@@ -809,11 +809,19 @@ wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
 wxString wxGetPasswordFromUser(const wxString& message,
                                const wxString& caption,
                                const wxString& defaultValue,
 wxString wxGetPasswordFromUser(const wxString& message,
                                const wxString& caption,
                                const wxString& defaultValue,
-                               wxWindow *parent)
+                               wxWindow *parent,
+                               wxCoord x, wxCoord y, bool centre )
 {
     wxString str;
 {
     wxString str;
+    long style = wxTextEntryDialogStyle;
+
+    if (centre)
+        style |= wxCENTRE;
+    else
+        style &= ~wxCENTRE;
+
     wxTextEntryDialog dialog(parent, message, caption, defaultValue,
     wxTextEntryDialog dialog(parent, message, caption, defaultValue,
-                             wxOK | wxCANCEL | wxTE_PASSWORD);
+                             style | wxTE_PASSWORD, wxPoint(x, y));
     if ( dialog.ShowModal() == wxID_OK )
     {
         str = dialog.GetValue();
     if ( dialog.ShowModal() == wxID_OK )
     {
         str = dialog.GetValue();