virtual wxDirTraverseResult OnDir(const wxString& dirname)
{
wxString path, name, ext;
- wxSplitPath(dirname, &path, &name, &ext);
+ wxFileName::SplitPath(dirname, &path, &name, &ext);
if ( !ext.empty() )
name << _T('.') << ext;
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
- wxSplitPath(path, &m_dir, &m_fileName, &ext);
+ wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}
wxString fileName(tmp);
wxString path, name, ext;
- wxSplitPath(fileName, & path, & name, & ext);
+ wxFileName::SplitPath(fileName, & path, & name, & ext);
if (ext.empty())
{
wxString* arguments)
{
wxString path, file, ext;
- wxSplitPath(shortcutPath, & path, & file, & ext);
+ wxFileName::SplitPath(shortcutPath, & path, & file, & ext);
HRESULT hres;
IShellLink* psl;
#include "wx/imagxpm.h"
#include "wx/wfstream.h"
#include "wx/xpmdecod.h"
+#include "wx/filename.h"
IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler)
wxString sName;
if ( image->HasOption(wxIMAGE_OPTION_FILENAME) )
{
- wxSplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
- NULL, &sName, NULL);
+ wxFileName::SplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
+ NULL, &sName, NULL);
sName << wxT("_xpm");
}
m_type |= (fileAttribs & FILE_ATTRIBUTE_DIRECTORY) != 0 ? is_dir : 0;
wxString p, f, ext;
- wxSplitPath(m_filePath, & p, & f, & ext);
+ wxFileName::SplitPath(m_filePath, & p, & f, & ext);
if (wxStricmp(ext, wxT("exe")) == 0)
m_type |= is_exe;
return;
}
-
+
m_ignoreChanges = true;
m_text->SetValue( filename );
return false;
wxString ext;
- wxSplitPath( path, &m_dir, &m_fileName, &ext );
+ wxFileName::SplitPath( path, &m_dir, &m_fileName, &ext );
if ( !ext.empty() )
{
m_fileName += wxT( "." );
wxHtmlHelpFrame* frame = new wxHtmlHelpFrame(data);
frame->SetController(this);
frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle, m_Config, m_ConfigRoot);
- frame->SetTitleFormat(m_titleFormat);
+ frame->SetTitleFormat(m_titleFormat);
m_helpFrame = frame;
return frame;
}
{
wxHtmlHelpDialog* dialog = new wxHtmlHelpDialog(data);
dialog->SetController(this);
- dialog->SetTitleFormat(m_titleFormat);
+ dialog->SetTitleFormat(m_titleFormat);
dialog->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle);
m_helpDialog = dialog;
return dialog;
bool wxHtmlHelpController::Initialize(const wxString& file)
{
wxString dir, filename, ext;
- wxSplitPath(file, & dir, & filename, & ext);
+ wxFileName::SplitPath(file, & dir, & filename, & ext);
if (!dir.empty())
dir = dir + wxFILE_SEP_PATH;
#endif
// it needs to be a full path to be usable
if ( prog.compare(1, 2, _T(":\\")) == 0 )
- wxSplitPath(prog, &strDir, NULL, NULL);
+ wxFileName::SplitPath(prog, &strDir, NULL, NULL);
}
if ( strDir.empty() )
{
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
- wxSplitPath(path, &m_dir, &m_fileName, &ext);
+ wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}
wxString wxCHMHelpController::GetValidFilename() const
{
wxString path, name, ext;
- wxSplitPath(m_helpFile, &path, &name, &ext);
+ wxFileName::SplitPath(m_helpFile, &path, &name, &ext);
wxString fullName;
if (path.IsEmpty())
wxString wxWinHelpController::GetValidFilename(const wxString& file) const
{
wxString path, name, ext;
- wxSplitPath(file, & path, & name, & ext);
+ wxFileName::SplitPath(file, & path, & name, & ext);
wxString fullName;
if (path.empty())
{
// make up a default value for it
wxString cmd;
- wxSplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
+ wxFileName::SplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
mimeType << _T("application/x-") << cmd;
}
else
else // fall back to the program directory
{
// extract the directory component of the program file name
- wxSplitPath(wxGetFullModuleName(), &strDir, NULL, NULL);
+ wxFileName::SplitPath(wxGetFullModuleName(), &strDir, NULL, NULL);
}
#endif // UNIX/Win
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
- wxSplitPath(path, &m_dir, &m_fileName, &ext);
+ wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}
wxString wxWinceHelpController::GetValidFilename(const wxString& file) const
{
wxString path, name, ext;
- wxSplitPath(file, & path, & name, & ext);
+ wxFileName::SplitPath(file, & path, & name, & ext);
wxString fullName;
if (path.empty())
int nIdx = wxStrlen(zFileNameBuffer) - 1;
wxString sExt;
- wxSplitPath( zFileNameBuffer
- ,&m_path
- ,&m_fileName
- ,&sExt
- );
+ wxFileName::SplitPath( zFileNameBuffer
+ ,&m_path
+ ,&m_fileName
+ ,&sExt
+ );
if (zFileNameBuffer[nIdx] == wxT('.') || sExt.empty())
{
zFileNameBuffer[nIdx] = wxT('\0');
{
wxArrayString names ;
wxArrayString extensions;
-
+
wxString filter2(filter) ;
int filterIndex = 0;
bool isName = true ;
if (extension.length() && (extension.GetChar(0) == '.'))
extension = extension.Mid( 1 );
- if ( extension.IsEmpty() )
+ if ( extension.IsEmpty() )
{
if ( types != nil )
[types release];
return nil;
}
-
-
+
+
if ( types == nil )
types = [[NSMutableArray alloc] init];
-
+
wxCFStringRef cfext(extension);
[types addObject: (NSString*)cfext.AsNSString() ];
-#if 0
+#if 0
wxUint32 fileType, creator;
-
+
// extension -> mactypes
#endif
}
int wxFileDialog::ShowModal()
{
int result = wxID_CANCEL;
-
+
NSSavePanel *panel = nil;
-
+
wxCFStringRef cf( m_message );
-
+
wxCFStringRef dir( m_path );
wxCFStringRef file( m_fileName );
-
+
m_path = wxEmptyString;
m_fileNames.Clear();
-
+
if (HasFlag(wxFD_SAVE))
{
NSSavePanel* sPanel = [NSSavePanel savePanel];
[sPanel setCanCreateDirectories:YES];
[sPanel setMessage:cf.AsNSString()];
[sPanel setTreatsFilePackagesAsDirectories:NO];
-
+
if ( HasFlag(wxFD_OVERWRITE_PROMPT) )
{
}
{
panel = sPanel;
result = wxID_OK;
-
+
wxCFStringRef filename( [[sPanel filename] retain] );
m_path = filename.AsString();
[oPanel setResolvesAliases:YES];
[oPanel setCanChooseFiles:YES];
[oPanel setMessage:cf.AsNSString()];
-
+
if ( [oPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() types:types] == NSOKButton )
{
panel = oPanel;
if ( types != nil )
[types release];
}
-
+
return result;
}
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
- wxSplitPath(path, &m_dir, &m_fileName, &ext);
+ wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}
bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const
{
wxString path, file, ext;
- wxSplitPath(filename, & path, & file, & ext);
+ wxFileName::SplitPath(filename, & path, & file, & ext);
return (ext.Lower() == wxT("html") || ext.Lower() == wxT("htm"));
}
wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
- wxCMD_LINE_DESC_END
+ wxCMD_LINE_DESC_END
};
wxCmdLineParser parser(cmdLineDesc, argc, argv);
}
wxString name, ext, path;
- wxSplitPath(parFiles[i], &path, &name, &ext);
+ wxFileName::SplitPath(parFiles[i], &path, &name, &ext);
FindFilesInXML(doc.GetRoot(), flist, path);
if (flagH)