X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e40298d54ecd5b109222a7c60aa2ef084a304d69..ef4a634b1b90cb13426b9006d8e18380b9809fdb:/src/mac/carbon/msgdlg.cpp diff --git a/src/mac/carbon/msgdlg.cpp b/src/mac/carbon/msgdlg.cpp index f7a4a0a724..670d30644e 100644 --- a/src/mac/carbon/msgdlg.cpp +++ b/src/mac/carbon/msgdlg.cpp @@ -67,7 +67,7 @@ int wxMessageDialog::ShowModal() short result ; - wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ; + wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , wxT("this style is not supported on mac") ) ; AlertType alertType = kAlertPlainAlert ; if (m_dialogStyle & wxICON_EXCLAMATION) @@ -83,17 +83,12 @@ int wxMessageDialog::ShowModal() if ( UMAGetSystemVersion() >= 0x1000 ) { AlertStdCFStringAlertParamRec param ; - CFStringRef cfNoString = NULL ; - CFStringRef cfYesString = NULL ; - - CFStringRef cfTitle = NULL; - CFStringRef cfText = NULL; - - cfTitle = wxMacCreateCFString( m_caption ) ; - cfText = wxMacCreateCFString( m_message ) ; - cfNoString = wxMacCreateCFString( _("No") ) ; - cfYesString = wxMacCreateCFString( _("Yes") ) ; + wxMacCFStringHolder cfNoString(_("No")) ; + wxMacCFStringHolder cfYesString( _("Yes")) ; + wxMacCFStringHolder cfTitle(m_caption); + wxMacCFStringHolder cfText(m_message); + param.movable = true; param.flags = 0 ; @@ -120,7 +115,8 @@ int wxMessageDialog::ShowModal() param.cancelButton = 0; } } - else if (m_dialogStyle & wxOK) + // the msw implementation even shows an ok button if it is not specified, we'll do the same + else { if (m_dialogStyle & wxCANCEL) { @@ -142,10 +138,12 @@ int wxMessageDialog::ShowModal() param.cancelButton = 0; } } + /* else { skipDialog = true ; } + */ param.position = kWindowDefaultPosition; if ( !skipDialog ) @@ -154,32 +152,13 @@ int wxMessageDialog::ShowModal() CreateStandardAlert( alertType , cfTitle , cfText , ¶m , &alertRef ) ; RunStandardAlert( alertRef , NULL , &result ) ; } - if(cfTitle != NULL) - CFRelease(cfTitle); - if(cfText != NULL) - CFRelease(cfText); - if(cfNoString != NULL) - CFRelease(cfNoString); - if(cfYesString != NULL) - CFRelease(cfYesString); - if ( skipDialog ) + if ( skipDialog ) return wxID_CANCEL ; } else #endif { AlertStdAlertParamRec param; - char cText[2048] ; - - if (wxApp::s_macDefaultEncodingIsPC) - { - strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ; - } - else - { - strcpy( cText , m_message ) ; - } - wxMacConvertNewlines( cText , cText ) ; Str255 yesPString ; Str255 noPString ; @@ -189,7 +168,7 @@ int wxMessageDialog::ShowModal() wxMacStringToPascal( m_caption , pascalTitle ) ; wxMacStringToPascal( _("Yes") , yesPString ) ; wxMacStringToPascal( _("No") , noPString ) ; - CopyCStringToPascal( cText , pascalText ) ; + wxMacStringToPascal( m_message , pascalText ) ; param.movable = true; param.filterProc = NULL ;