fixing multiple extensions in one filter, turning off temporarily sheets code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/filename.h"
|
#include "wx/filename.h"
|
||||||
|
#include "wx/tokenzr.h"
|
||||||
|
|
||||||
#include "wx/osx/private.h"
|
#include "wx/osx/private.h"
|
||||||
|
|
||||||
@@ -102,34 +103,38 @@ NSArray* GetTypesFromFilter( const wxString filter )
|
|||||||
const size_t extCount = extensions.GetCount();
|
const size_t extCount = extensions.GetCount();
|
||||||
for ( size_t i = 0 ; i < extCount; i++ )
|
for ( size_t i = 0 ; i < extCount; i++ )
|
||||||
{
|
{
|
||||||
wxString extension = extensions[i];
|
wxString extensiongroup = extensions[i];
|
||||||
|
wxStringTokenizer tokenizer( extensiongroup , wxT(";") ) ;
|
||||||
// Remove leading '*'
|
while ( tokenizer.HasMoreTokens() )
|
||||||
if (extension.length() && (extension.GetChar(0) == '*'))
|
|
||||||
extension = extension.Mid( 1 );
|
|
||||||
|
|
||||||
// Remove leading '.'
|
|
||||||
if (extension.length() && (extension.GetChar(0) == '.'))
|
|
||||||
extension = extension.Mid( 1 );
|
|
||||||
|
|
||||||
if ( extension.IsEmpty() )
|
|
||||||
{
|
{
|
||||||
if ( types != nil )
|
wxString extension = tokenizer.GetNextToken() ;
|
||||||
[types release];
|
// Remove leading '*'
|
||||||
return nil;
|
if (extension.length() && (extension.GetChar(0) == '*'))
|
||||||
|
extension = extension.Mid( 1 );
|
||||||
|
|
||||||
|
// Remove leading '.'
|
||||||
|
if (extension.length() && (extension.GetChar(0) == '.'))
|
||||||
|
extension = extension.Mid( 1 );
|
||||||
|
|
||||||
|
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
|
||||||
|
// add support for classic fileType / creator here
|
||||||
|
wxUint32 fileType, creator;
|
||||||
|
// extension -> mactypes
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( types == nil )
|
|
||||||
types = [[NSMutableArray alloc] init];
|
|
||||||
|
|
||||||
wxCFStringRef cfext(extension);
|
|
||||||
[types addObject: (NSString*)cfext.AsNSString() ];
|
|
||||||
#if 0
|
|
||||||
// add support for classic fileType / creator here
|
|
||||||
wxUint32 fileType, creator;
|
|
||||||
// extension -> mactypes
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return types;
|
return types;
|
||||||
@@ -172,7 +177,8 @@ int wxFileDialog::ShowModal()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentWindow)
|
// avoid multiple event handlers on stack
|
||||||
|
if ( 0 /*parentWindow*/)
|
||||||
{
|
{
|
||||||
NSWindow* nativeParent = parentWindow->GetWXWindow();
|
NSWindow* nativeParent = parentWindow->GetWXWindow();
|
||||||
ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
|
ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
|
||||||
@@ -211,7 +217,8 @@ int wxFileDialog::ShowModal()
|
|||||||
[oPanel setCanChooseFiles:YES];
|
[oPanel setCanChooseFiles:YES];
|
||||||
[oPanel setMessage:cf.AsNSString()];
|
[oPanel setMessage:cf.AsNSString()];
|
||||||
|
|
||||||
if (parentWindow)
|
// avoid multiple event handlers on stack
|
||||||
|
if ( 0 /*parentWindow*/)
|
||||||
{
|
{
|
||||||
NSWindow* nativeParent = parentWindow->GetWXWindow();
|
NSWindow* nativeParent = parentWindow->GetWXWindow();
|
||||||
ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
|
ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
|
||||||
|
Reference in New Issue
Block a user