]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
Fixed old FIXME about unsigned result of sunstraction + a few changes to be able...
[wxWidgets.git] / src / common / utilscmn.cpp
index db74590edfca571ae6c3b5369b5de519787d7f3a..9f14c1b3cba250e23a55101c9ebbbe5b3aab431d 100644 (file)
@@ -95,7 +95,7 @@
     #include <sys/stat.h>
 #endif
 
-#ifdef __WXMSW__
+#if defined(__WXMSW__) && !defined(__PALMOS__)
     #include "wx/msw/private.h"
 #endif
 
@@ -287,13 +287,8 @@ const wxChar *wxGetInstallPrefix()
 
 wxString wxGetDataDir()
 {
-    wxString format = wxGetInstallPrefix();
-    format <<  wxFILE_SEP_PATH
-           << wxT("share") << wxFILE_SEP_PATH
-           << wxT("wx") << wxFILE_SEP_PATH
-           << wxT("%i.%i");
-    wxString dir;
-    dir.Printf(format.c_str(), wxMAJOR_VERSION, wxMINOR_VERSION);
+    wxString dir = wxGetInstallPrefix();
+    dir <<  wxFILE_SEP_PATH << wxT("share") << wxFILE_SEP_PATH << wxT("wx");
     return dir;
 }
 
@@ -552,10 +547,13 @@ bool wxYieldIfNeeded()
 // Id generation
 static long wxCurrentId = 100;
 
-long
-wxNewId (void)
+long wxNewId()
 {
-  return wxCurrentId++;
+    // skip the part of IDs space that contains hard-coded values:
+    if (wxCurrentId == wxID_LOWEST)
+        wxCurrentId = wxID_HIGHEST + 1;
+
+    return wxCurrentId++;
 }
 
 long
@@ -811,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;
-    wxTextEntryDialog dialog(parent, message, caption, defaultValue,
-                             wxOK | wxCANCEL | wxTE_PASSWORD);
+    long style = wxTextEntryDialogStyle;
+
+    if (centre)
+        style |= wxCENTRE;
+    else
+        style &= ~wxCENTRE;
+
+    wxPasswordEntryDialog dialog(parent, message, caption, defaultValue,
+                             style, wxPoint(x, y));
     if ( dialog.ShowModal() == wxID_OK )
     {
         str = dialog.GetValue();