+ AlertStdCFStringAlertParamRec param ;
+ wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ;
+ wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ;
+
+ wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding());
+ wxMacCFStringHolder cfText(m_message , m_font.GetEncoding());
+
+ param.movable = true;
+ param.flags = 0 ;
+ param.version = kStdCFStringAlertVersionOne ;
+
+ bool skipDialog = false ;
+
+ if (style & wxYES_NO)
+ {
+ if (style & wxCANCEL)
+ {
+ param.defaultText = cfYesString ;
+ param.cancelText = (CFStringRef) kAlertDefaultCancelText;
+ param.otherText = cfNoString ;
+ param.helpButton = false ;
+ param.defaultButton = style & wxNO_DEFAULT ? kAlertStdAlertOtherButton : kAlertStdAlertOKButton;
+ param.cancelButton = kAlertStdAlertCancelButton;
+ }
+ else
+ {
+ param.defaultText = cfYesString ;
+ param.cancelText = NULL;
+ param.otherText = cfNoString ;
+ param.helpButton = false ;
+ param.defaultButton = style & wxNO_DEFAULT ? kAlertStdAlertOtherButton : kAlertStdAlertOKButton;
+ param.cancelButton = 0;
+ }
+ }
+ // the msw implementation even shows an ok button if it is not specified, we'll do the same
+ else
+ {
+ if (style & wxCANCEL)
+ {
+ // thats a cancel missing
+ param.defaultText = (CFStringRef) kAlertDefaultOKText ;
+ param.cancelText = (CFStringRef) kAlertDefaultCancelText ;
+ param.otherText = NULL;
+ param.helpButton = false ;
+ param.defaultButton = kAlertStdAlertOKButton;
+ param.cancelButton = 0;
+ }
+ else
+ {
+ param.defaultText = (CFStringRef) kAlertDefaultOKText ;
+ param.cancelText = NULL;
+ param.otherText = NULL;
+ param.helpButton = false ;
+ param.defaultButton = kAlertStdAlertOKButton;
+ param.cancelButton = 0;
+ }
+ }
+ /*
+ else
+ {
+ skipDialog = true ;
+ }
+ */
+
+ param.position = kWindowDefaultPosition;
+ if ( !skipDialog )
+ {
+ DialogRef alertRef ;
+ CreateStandardAlert( alertType , cfTitle , cfText , ¶m , &alertRef ) ;
+ RunStandardAlert( alertRef , NULL , &result ) ;
+ }
+ if ( skipDialog )
+ return wxID_CANCEL ;