X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8208e181cb576ec6cda37624923f95a59af43072..dbcbe229628c7667da2b6257198467d4f09ab28d:/src/mac/msgdlg.cpp diff --git a/src/mac/msgdlg.cpp b/src/mac/msgdlg.cpp index cf229e5200..17fae2c24f 100644 --- a/src/mac/msgdlg.cpp +++ b/src/mac/msgdlg.cpp @@ -13,10 +13,13 @@ #pragma implementation "msgdlg.h" #endif +#include "wx/app.h" #include "wx/msgdlg.h" #include "wx/mac/uma.h" +#if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxMessageDialog, wxDialog) +#endif #define kMacOKAlertResourceID 128 #define kMacYesNoAlertResourceID 129 @@ -26,6 +29,7 @@ IMPLEMENT_CLASS(wxMessageDialog, wxDialog) short language = 0 ; +void wxMacConvertNewlines( const char *source , char * destination ) ; void wxMacConvertNewlines( const char *source , char * destination ) { const char *s = source ; @@ -69,22 +73,26 @@ int wxMessageDialog::ShowModal() short result ; Str255 pascalTitle ; Str255 pascalText ; + char cText[256] ; + + Str255 yesPString ; + Str255 noPString ; + wxMacStringToPascal( m_caption , pascalTitle ) ; + wxMacStringToPascal( _("Yes") , yesPString ) ; + wxMacStringToPascal( _("No") , noPString ) ; if (wxApp::s_macDefaultEncodingIsPC) { - strcpy( (char*) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ; - strcpy( (char*) pascalText , wxMacMakeMacStringFromPC( m_message) ) ; + strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ; } else { - strcpy( (char*) pascalTitle , m_caption ) ; - strcpy( (char*) pascalText , m_message ) ; + strcpy( cText , m_message ) ; } - c2pstr( (char*) pascalTitle ) ; - wxMacConvertNewlines( (char*)pascalText ,(char*) pascalText) ; - c2pstr( (char*) pascalText ) ; + wxMacConvertNewlines( cText , cText ) ; + CopyCStringToPascal( cText , pascalText ) ; wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ; @@ -176,18 +184,18 @@ int wxMessageDialog::ShowModal() { if (m_dialogStyle & wxCANCEL) { - param.defaultText = "\pYes" ; + param.defaultText = yesPString ; param.cancelText = (StringPtr) kAlertDefaultCancelText; - param.otherText = "\pNo"; + param.otherText = noPString ; param.helpButton = false ; param.defaultButton = kAlertStdAlertOKButton; param.cancelButton = kAlertStdAlertCancelButton; } else { - param.defaultText = "\pYes" ; + param.defaultText = yesPString ; param.cancelText = NULL; - param.otherText = "\pNo"; + param.otherText = noPString ; param.helpButton = false ; param.defaultButton = kAlertStdAlertOKButton; param.cancelButton = 0;