turning off unconditional usage of filter-delegate, using native capabilities under 10.6, proper handling of empty default directories for dialogs by passing in nil to native calls,

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-06-06 19:19:42 +00:00
parent 0aff141c51
commit 7e3d8eabcf

View File

@@ -433,7 +433,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
accView = m_filterPanel->GetHandle();
if( HasFlag(wxFD_OPEN) )
{
if ( 1 /* UMAGetSystemVersion() < 0x1060 */ )
if ( UMAGetSystemVersion() < 0x1060 )
{
wxOpenPanelDelegate* del = [[wxOpenPanelDelegate alloc]init];
[del setFileDialog:this];
@@ -463,6 +463,8 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
int wxFileDialog::ShowModal()
{
wxMacAutoreleasePool autoreleasepool;
wxCFStringRef cf( m_message );
wxCFStringRef dir( m_dir );
@@ -564,7 +566,7 @@ int wxFileDialog::ShowModal()
DoOnFilterSelected(m_firstFileTypeFilter);
}
returnCode = [sPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() ];
returnCode = [sPanel runModalForDirectory: m_dir.IsEmpty() ? nil : dir.AsNSString() file:file.AsNSString() ];
ModalFinishedCallback(sPanel, returnCode);
}
else
@@ -582,13 +584,14 @@ int wxFileDialog::ShowModal()
if ( UMAGetSystemVersion() < 0x1060 )
{
returnCode = [oPanel runModalForDirectory:dir.AsNSString()
returnCode = [oPanel runModalForDirectory:m_dir.IsEmpty() ? nil : dir.AsNSString()
file:file.AsNSString() types:(m_delegate == nil ? types : nil)];
}
else
{
[oPanel setAllowedFileTypes: (m_delegate == nil ? types : nil)];
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
if ( !m_dir.IsEmpty() )
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
isDirectory:YES]];
returnCode = [oPanel runModal];
}