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