Sheet support for wxMessageDialog.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier 2009-03-05 21:20:05 +00:00
parent 037f9d3ba3
commit ba41a8c629

View File

@ -183,8 +183,30 @@ int wxMessageDialog::ShowModal()
}
}
int button = [alert runModal];
wxNonOwnedWindow* parentWindow = NULL;
int button = -1;
if (GetParent())
{
parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
}
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
[alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate
didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
button = [sheetDelegate code];
[sheetDelegate release];
}
else
{
button = [alert runModal];
}
[alert release];
if ( button < NSAlertFirstButtonReturn )