]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/msgdlg.mm
guarding open combo box against AppDefined NSEvents issued by wxEventLoop::WakeUp...
[wxWidgets.git] / src / osx / cocoa / msgdlg.mm
index 445a097caa5f1c9887a708fff6ff472fd78baa83..40ed938450cc39086eef58770f64eb8d3a2283f8 100644 (file)
     #include "wx/app.h"
 #endif
 
     #include "wx/app.h"
 #endif
 
+#include "wx/control.h"
 #include "wx/thread.h"
 #include "wx/thread.h"
+#include "wx/evtloop.h"
+#include "wx/modalhook.h"
 #include "wx/osx/private.h"
 
 
 #include "wx/osx/private.h"
 
 
@@ -60,6 +63,10 @@ wxMessageDialog::~wxMessageDialog()
 
 int wxMessageDialog::ShowModal()
 {
 
 int wxMessageDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
+    wxCFEventLoopPauseIdleEvents pause;
+    
     int resultbutton = wxID_CANCEL;
 
     const long style = GetMessageDialogStyle();
     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 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);
                 
 
         NSAlertStyle alertType = GetAlertStyleFromWXStyle(style);
                 
@@ -227,10 +234,10 @@ void* wxMessageDialog::ConstructNSAlert()
     NSAlert* alert = [[NSAlert alloc] init];
     NSAlertStyle alertType = GetAlertStyleFromWXStyle(style);
 
     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() );
 
     wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() );
     wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );