]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
1. bug in wxString::find_first_of() fixed
[wxWidgets.git] / src / common / utilscmn.cpp
index a9fda2f4acc5416af274f405994ddf577124342b..9af79de3296495dc1990c7d8bfc6467896988ebd 100644 (file)
@@ -865,19 +865,14 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
     {
         case wxID_OK:
             return wxOK;
     {
         case wxID_OK:
             return wxOK;
-            break;
         case wxID_YES:
             return wxYES;
         case wxID_YES:
             return wxYES;
-            break;
         case wxID_NO:
             return wxNO;
         case wxID_NO:
             return wxNO;
-            break;
         default:
         case wxID_CANCEL:
             return wxCANCEL;
         default:
         case wxID_CANCEL:
             return wxCANCEL;
-            break;
     }
     }
-    return ans;
 }
 
 #if wxUSE_TEXTDLG
 }
 
 #if wxUSE_TEXTDLG
@@ -885,12 +880,32 @@ wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
                         const wxString& defaultValue, wxWindow *parent,
                         int x, int y, bool WXUNUSED(centre) )
 {
                         const wxString& defaultValue, wxWindow *parent,
                         int x, int y, bool WXUNUSED(centre) )
 {
+    wxString str;
     wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
     if (dialog.ShowModal() == wxID_OK)
     wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
     if (dialog.ShowModal() == wxID_OK)
-        return dialog.GetValue();
-    else
-        return wxString("");
+    {
+        str = dialog.GetValue();
+    }
+
+    return str;
 }
 }
+
+wxString wxGetPasswordFromUser(const wxString& message,
+                               const wxString& caption,
+                               const wxString& defaultValue,
+                               wxWindow *parent)
+{
+    wxString str;
+    wxTextEntryDialog dialog(parent, message, caption, defaultValue,
+                             wxOK | wxCANCEL | wxTE_PASSWORD);
+    if ( dialog.ShowModal() == wxID_OK )
+    {
+        str = dialog.GetValue();
+    }
+
+    return str;
+}
+
 #endif // wxUSE_TEXTDLG
 
 #ifdef __MWERKS__
 #endif // wxUSE_TEXTDLG
 
 #ifdef __MWERKS__