added possible mach-o compliant version
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
171fe25be9
commit
9854b6eddf
@ -491,17 +491,36 @@ int wxFileDialog::ShowModal()
|
|||||||
if (specDesc.dataHandle != nil) {
|
if (specDesc.dataHandle != nil) {
|
||||||
::AEDisposeDesc(&specDesc);
|
::AEDisposeDesc(&specDesc);
|
||||||
}
|
}
|
||||||
|
#ifdef __DARWIN__
|
||||||
|
FSRef fsr ;
|
||||||
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
err = FSpMakeFSRef( &outFileSpec , &fsr ) ;
|
||||||
|
if ( err == fnfErr )
|
||||||
|
{
|
||||||
|
FSSpec fss ;
|
||||||
|
err = FSMakeFSSpec( outFileSpec.vRefNum , outFileSpec.parID, "\p" , &fss ) ;
|
||||||
|
err = FSpMakeFSRef( &fss , &fsr ) ;
|
||||||
|
char path[256] ;
|
||||||
|
err = FSRefMakePath( &fsr , (unsigned char*) path , sizeof(path) ) ;
|
||||||
|
strcat( path , "/" ) ;
|
||||||
|
p2cstr( outFileSpec.name ) ;
|
||||||
|
strcat( path , (char*) outFileSpec.name ) ;
|
||||||
|
m_path = path ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
||||||
|
}
|
||||||
|
#else
|
||||||
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
||||||
|
#endif
|
||||||
m_paths.Add( m_path ) ;
|
m_paths.Add( m_path ) ;
|
||||||
m_fileNames.Add(m_fileName);
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
}
|
m_fileNames.Add(m_fileName);
|
||||||
// set these to the first hit
|
}
|
||||||
m_path = m_paths[ 0 ] ;
|
// set these to the first hit
|
||||||
m_fileName = wxFileNameFromPath(m_path);
|
m_path = m_paths[ 0 ] ;
|
||||||
m_dir = wxPathOnly(m_path);
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
|
m_dir = wxPathOnly(m_path);
|
||||||
NavDisposeReply( &mNavReply ) ;
|
NavDisposeReply( &mNavReply ) ;
|
||||||
return wxID_OK ;
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
|
@ -491,17 +491,36 @@ int wxFileDialog::ShowModal()
|
|||||||
if (specDesc.dataHandle != nil) {
|
if (specDesc.dataHandle != nil) {
|
||||||
::AEDisposeDesc(&specDesc);
|
::AEDisposeDesc(&specDesc);
|
||||||
}
|
}
|
||||||
|
#ifdef __DARWIN__
|
||||||
|
FSRef fsr ;
|
||||||
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
err = FSpMakeFSRef( &outFileSpec , &fsr ) ;
|
||||||
|
if ( err == fnfErr )
|
||||||
|
{
|
||||||
|
FSSpec fss ;
|
||||||
|
err = FSMakeFSSpec( outFileSpec.vRefNum , outFileSpec.parID, "\p" , &fss ) ;
|
||||||
|
err = FSpMakeFSRef( &fss , &fsr ) ;
|
||||||
|
char path[256] ;
|
||||||
|
err = FSRefMakePath( &fsr , (unsigned char*) path , sizeof(path) ) ;
|
||||||
|
strcat( path , "/" ) ;
|
||||||
|
p2cstr( outFileSpec.name ) ;
|
||||||
|
strcat( path , (char*) outFileSpec.name ) ;
|
||||||
|
m_path = path ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
||||||
|
}
|
||||||
|
#else
|
||||||
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
|
||||||
|
#endif
|
||||||
m_paths.Add( m_path ) ;
|
m_paths.Add( m_path ) ;
|
||||||
m_fileNames.Add(m_fileName);
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
}
|
m_fileNames.Add(m_fileName);
|
||||||
// set these to the first hit
|
}
|
||||||
m_path = m_paths[ 0 ] ;
|
// set these to the first hit
|
||||||
m_fileName = wxFileNameFromPath(m_path);
|
m_path = m_paths[ 0 ] ;
|
||||||
m_dir = wxPathOnly(m_path);
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
|
m_dir = wxPathOnly(m_path);
|
||||||
NavDisposeReply( &mNavReply ) ;
|
NavDisposeReply( &mNavReply ) ;
|
||||||
return wxID_OK ;
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user