#include "wx/app.h"
#endif
+#include "wx/control.h"
#include "wx/thread.h"
+#include "wx/evtloop.h"
+#include "wx/testing.h"
#include "wx/osx/private.h"
int wxMessageDialog::ShowModal()
{
+ WX_TESTING_SHOW_MODAL_HOOK();
+
+ wxCFEventLoopPauseIdleEvents pause;
+
int resultbutton = wxID_CANCEL;
const long style = GetMessageDialogStyle();
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);
}
}
+ wxASSERT_MSG( !(style & wxHELP), "wxHELP not supported in non-GUI thread" );
+
CFOptionFlags exitButton;
OSStatus err = CFUserNotificationDisplayAlert(
0, alertType, NULL, NULL, NULL, cfTitle, cfText,
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() );
}
}
+
+ if ( style & wxHELP )
+ {
+ wxCFStringRef cfHelpString( GetHelpLabel(), GetFont().GetEncoding() );
+ [alert addButtonWithTitle:cfHelpString.AsNSString()];
+ m_buttonId[ m_buttonCount++ ] = wxID_HELP;
+ }
+
+ wxASSERT_MSG( m_buttonCount <= WXSIZEOF(m_buttonId), "Too many buttons" );
+
return alert;
}