X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..4ceb1196bb688d56bbceca98c615fa7b9222ba1d:/src/mac/msgdlg.cpp?ds=sidebyside diff --git a/src/mac/msgdlg.cpp b/src/mac/msgdlg.cpp index f19da7bb4f..064d9bbba6 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 @@ -69,12 +72,38 @@ int wxMessageDialog::ShowModal() short result ; Str255 pascalTitle ; Str255 pascalText ; + char cText[256] ; - strcpy( (char*) pascalTitle , m_caption ) ; - c2pstr( (char*) pascalTitle ) ; - strcpy( (char*) pascalText , m_message ) ; - wxMacConvertNewlines( (char*)pascalText ,(char*) pascalText) ; - c2pstr( (char*) pascalText ) ; + if (wxApp::s_macDefaultEncodingIsPC) + { +#if TARGET_CARBON + c2pstrcpy( (StringPtr) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ; +#else + strcpy( (char *) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ; + c2pstr( (char *) pascalTitle ) ; +#endif + strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ; + } + else + { +#if TARGET_CARBON + c2pstrcpy( (StringPtr) pascalTitle , m_caption ) ; +#else + strcpy( (char *) pascalTitle , m_caption ) ; + c2pstr( (char *) pascalTitle ) ; +#endif + strcpy( cText , m_message ) ; + } + + wxMacConvertNewlines( cText , cText ) ; +#if TARGET_CARBON + c2pstrcpy( (StringPtr) pascalText , cText ) ; +#else + strcpy( (char *) pascalText , cText ) ; + c2pstr( (char *) pascalText ) ; +#endif + + wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ; if ( !UMAHasAppearance() ) {