X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5c6eb5c178b44f4400495e06274ffd130635190..ba0b7b323817e44903ba5ee199d17bbb166ed3d5:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 5cc6077376..095156baa1 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -31,6 +31,7 @@ #include "wx/module.h" #include "wx/memory.h" #include "wx/tooltip.h" +#include "wx/textctrl.h" #include "wx/menu.h" #if wxUSE_WX_RESOURCES #include "wx/resource.h" @@ -88,8 +89,6 @@ wxWindow* wxApp::s_captureWindow = NULL ; int wxApp::s_lastMouseDown = 0 ; long wxApp::sm_lastMessageTime = 0; -#ifdef __WXMAC__ - bool wxApp::s_macDefaultEncodingIsPC = true ; bool wxApp::s_macSupportPCMenuShortcuts = true ; long wxApp::s_macAboutMenuItemId = wxID_ABOUT ; @@ -137,6 +136,7 @@ pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigne OSErr wxApp::MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply) { + SysBeep(40) ; ProcessSerialNumber PSN ; PSN.highLongOfPSN = 0 ; PSN.lowLongOfPSN = kCurrentProcess ; @@ -341,7 +341,44 @@ wxString wxMacMakePCStringFromMac( const char * p ) return result ; } -#endif +wxString wxMacMakeStringFromMacString( const char* from , bool mac2pcEncoding ) +{ + if (mac2pcEncoding) + { + return wxMacMakePCStringFromMac( from ) ; + } + else + { + return wxString( from ) ; + } +} + +wxString wxMacMakeStringFromPascal( StringPtr from , bool mac2pcEncoding ) +{ + // this is safe since a pascal string can never be larger than 256 bytes + char s[256] ; + CopyPascalStringToC( from , s ) ; + if (mac2pcEncoding) + { + return wxMacMakePCStringFromMac( s ) ; + } + else + { + return wxString( s ) ; + } +} + +void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding ) +{ + if (pc2macEncoding) + { + CopyCStringToPascal( wxMacMakeMacStringFromPC( from ) , to ) ; + } + else + { + CopyCStringToPascal( from , to ) ; + } +} bool wxApp::Initialize() {