X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94e0018723919fe2ca2f5b5f0a42804c16dbf3a1..0afeb753e0a6a3fdba290bf3612bb2f012d44d95:/src/osx/cocoa/msgdlg.mm diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index 445a097caa..40ed938450 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -18,7 +18,10 @@ #include "wx/app.h" #endif +#include "wx/control.h" #include "wx/thread.h" +#include "wx/evtloop.h" +#include "wx/modalhook.h" #include "wx/osx/private.h" @@ -60,6 +63,10 @@ wxMessageDialog::~wxMessageDialog() int wxMessageDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + + wxCFEventLoopPauseIdleEvents pause; + int resultbutton = wxID_CANCEL; const long style = GetMessageDialogStyle(); @@ -94,10 +101,10 @@ int wxMessageDialog::ShowModal() wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() ); wxCFStringRef cfText( msgtext, GetFont().GetEncoding() ); - wxCFStringRef cfNoString( GetNoLabel(), GetFont().GetEncoding() ); - wxCFStringRef cfYesString( GetYesLabel(), GetFont().GetEncoding() ); - wxCFStringRef cfOKString( GetOKLabel(), GetFont().GetEncoding()) ; - wxCFStringRef cfCancelString( GetCancelLabel(), GetFont().GetEncoding() ); + wxCFStringRef cfNoString( wxControl::GetLabelText(GetNoLabel()), GetFont().GetEncoding() ); + wxCFStringRef cfYesString( wxControl::GetLabelText(GetYesLabel()), GetFont().GetEncoding() ); + wxCFStringRef cfOKString( wxControl::GetLabelText(GetOKLabel()), GetFont().GetEncoding()) ; + wxCFStringRef cfCancelString( wxControl::GetLabelText(GetCancelLabel()), GetFont().GetEncoding() ); NSAlertStyle alertType = GetAlertStyleFromWXStyle(style); @@ -227,10 +234,10 @@ void* wxMessageDialog::ConstructNSAlert() NSAlert* alert = [[NSAlert alloc] init]; NSAlertStyle alertType = GetAlertStyleFromWXStyle(style); - wxCFStringRef cfNoString( GetNoLabel(), GetFont().GetEncoding() ); - wxCFStringRef cfYesString( GetYesLabel(), GetFont().GetEncoding() ); - wxCFStringRef cfOKString( GetOKLabel(), GetFont().GetEncoding() ); - wxCFStringRef cfCancelString( GetCancelLabel(), GetFont().GetEncoding() ); + wxCFStringRef cfNoString( wxControl::GetLabelText(GetNoLabel()), GetFont().GetEncoding() ); + wxCFStringRef cfYesString( wxControl::GetLabelText(GetYesLabel()), GetFont().GetEncoding() ); + wxCFStringRef cfOKString( wxControl::GetLabelText(GetOKLabel()), GetFont().GetEncoding() ); + wxCFStringRef cfCancelString( wxControl::GetLabelText(GetCancelLabel()), GetFont().GetEncoding() ); wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() ); wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );