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:
parent
037f9d3ba3
commit
ba41a8c629
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user