}
-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 )
if ( fileDialog.ShowModal() == wxID_OK )
{
- strcpy(wxBuffer, (const char *)fileDialog.GetPath());
- return wxBuffer;
+ return fileDialog.GetPath();
}
else
{
- return (char *) NULL;
+ return wxEmptyString;
}
}
-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 )
{
char *ext = (char *)extension;
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
}
-char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
+wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
{
char *ext = (char *)extension;
}
-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 )
if ( fileDialog.ShowModal() == wxID_OK )
{
- strcpy(wxBuffer, (const char *)fileDialog.GetPath());
- return wxBuffer;
+ return fileDialog.GetPath();
}
else
{
- return (char *) NULL;
+ return wxEmptyString;
}
}
-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 )
{
char *ext = (char *)extension;
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
}
-char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
+wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
{
char *ext = (char *)extension;
#define wxFSB_HEIGHT 500
-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)
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,
if ( fileDialog.ShowModal() == wxID_OK )
{
*defaultFilterIndex = fileDialog.GetFilterIndex();
- strcpy(wxBuffer, (const char *)fileDialog.GetPath());
- return wxBuffer;
+ return fileDialog.GetPath());
}
else
- return NULL;
+ return wxEmptyString;
}
wxString wxFileDialog::m_fileSelectorAnswer = "";
}
// Generic file load/save dialog
-static char *
+static wxString
wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
{
char *ext = (char *)extension;
}
// 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);
}
if( i-is-1 > 0 && is+1 < filter2.Len() )
{
- if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) )
+// if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) )
+ if( filter2.Mid(is+1,i-is-1) == defaultExtension )
{
filterFind = filterIndex;
break;
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)
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,
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,
}
// 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;
}
// 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);
}