]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stubs/filedlg.cpp
Added #include wx/dcclient.h for Vadims changes to work without pc headers
[wxWidgets.git] / src / stubs / filedlg.cpp
index cf096037d662701646471c6e179c33a7ea308009..8832598af41c29001acd781e577cf51a17f859e7 100644 (file)
 #include "wx/utils.h"
 #include "wx/dialog.h"
 #include "wx/filedlg.h"
+#include "wx/intl.h"
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_CLASS(wxFileDialog, wxDialog)
 #endif
 
-char *wxFileSelector(const char *title,
+wxString wxFileSelector(const char *title,
                      const char *defaultDir, const char *defaultFileName,
                      const char *defaultExtension, const char *filter, int flags,
                      wxWindow *parent, int x, int y)
@@ -52,14 +53,13 @@ char *wxFileSelector(const char *title,
 
     if ( fileDialog.ShowModal() == wxID_OK )
     {
-        strcpy(wxBuffer, (const char *)fileDialog.GetPath());
-        return wxBuffer;
+        return fileDialog.GetPath();
     }
     else
-        return NULL;
+        return wxEmptyString;
 }
 
-char *wxFileSelectorEx(const char *title,
+wxString wxFileSelectorEx(const char *title,
                        const char *defaultDir,
                        const char *defaultFileName,
                        int* defaultFilterIndex,
@@ -76,11 +76,10 @@ char *wxFileSelectorEx(const char *title,
     if ( fileDialog.ShowModal() == wxID_OK )
     {
         *defaultFilterIndex = fileDialog.GetFilterIndex();
-        strcpy(wxBuffer, (const char *)fileDialog.GetPath());
-        return wxBuffer;
+        return fileDialog.GetPath();
     }
     else
-        return NULL;
+        return wxEmptyString;
 }
 
 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
@@ -100,12 +99,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
 int wxFileDialog::ShowModal()
 {
     // TODO
-    wxID_CANCEL;
+    return wxID_CANCEL;
 }
 
 // Generic file load/save dialog
-static char *
-wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
+static wxString wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
 {
   char *ext = (char *)extension;
   
@@ -125,16 +123,14 @@ wxDefaultFileSelector(bool load, const char *what, const char *extension, const
 }
 
 // Generic file load dialog
-char *
-wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
 {
   return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
 }
 
 
 // Generic file save dialog
-char *
-wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
 {
   return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
 }