X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f66ecdc4fbfa14f18f95331ba859a85baee36ae6..f941a30bef665561d96d29c4cee07471dbbd497f:/src/osx/cocoa/filedlg.mm diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 4a9d65fbc9..727e9fe1a3 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -153,11 +153,12 @@ int wxFileDialog::ShowModal() m_path = wxEmptyString; m_fileNames.Clear(); - + m_paths.Clear(); + wxNonOwnedWindow* parentWindow = NULL; int returnCode = -1; - - if (GetParent()) + + if (GetParent()) { parentWindow = dynamic_cast(wxGetTopLevelParent(GetParent())); } @@ -181,10 +182,10 @@ int wxFileDialog::ShowModal() if (parentWindow) { NSWindow* nativeParent = parentWindow->GetWXWindow(); - ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init]; - [sPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString() - modalForWindow: nativeParent modalDelegate: sheetDelegate - didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) + ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init]; + [sPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString() + modalForWindow: nativeParent modalDelegate: sheetDelegate + didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; [sheetDelegate waitForSheetToFinish]; returnCode = [sheetDelegate code]; @@ -195,7 +196,7 @@ int wxFileDialog::ShowModal() { returnCode = [sPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() ]; } - + if (returnCode == NSOKButton ) { panel = sPanel; @@ -220,11 +221,11 @@ int wxFileDialog::ShowModal() if (parentWindow) { NSWindow* nativeParent = parentWindow->GetWXWindow(); - ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init]; - [oPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString() - types: types modalForWindow: nativeParent - modalDelegate: sheetDelegate - didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) + ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init]; + [oPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString() + types: types modalForWindow: nativeParent + modalDelegate: sheetDelegate + didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; [sheetDelegate waitForSheetToFinish]; returnCode = [sheetDelegate code]; @@ -233,7 +234,7 @@ int wxFileDialog::ShowModal() else */ { - returnCode = [oPanel runModalForDirectory:dir.AsNSString() + returnCode = [oPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() types:types]; } if (returnCode == NSOKButton )