+ AlertStdCFStringAlertParamRec param ;
+ wxMacCFStringHolder cfNoString(_("No")) ;
+ wxMacCFStringHolder cfYesString( _("Yes")) ;
+
+ wxMacCFStringHolder cfTitle(m_caption);
+ wxMacCFStringHolder cfText(m_message);
+
+ param.movable = true;
+ param.flags = 0 ;
+
+ bool skipDialog = false ;
+
+ if (m_dialogStyle & wxYES_NO)
+ {
+ if (m_dialogStyle & wxCANCEL)
+ {
+ param.defaultText = cfYesString ;
+ param.cancelText = (CFStringRef) kAlertDefaultCancelText;
+ param.otherText = cfNoString ;
+ param.helpButton = false ;
+ param.defaultButton = kAlertStdAlertOKButton;
+ param.cancelButton = kAlertStdAlertCancelButton;
+ }
+ else
+ {
+ param.defaultText = cfYesString ;
+ param.cancelText = NULL;
+ param.otherText = cfNoString ;
+ param.helpButton = false ;
+ param.defaultButton = kAlertStdAlertOKButton;
+ param.cancelButton = 0;
+ }
+ }
+ // the msw implementation even shows an ok button if it is not specified, we'll do the same
+ else
+ {
+ if (m_dialogStyle & 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 ;