long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
long wxApp::s_macPreferencesMenuItemId = 0 ;
long wxApp::s_macExitMenuItemId = wxID_EXIT ;
-wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
+wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ;
//----------------------------------------------------------------------
// Core Apple Event Support
#endif
#endif
-
+ wxMacSetupConverters() ;
+
s_macCursorRgn = ::NewRgn() ;
wxClassInfo::InitializeClasses();
// __wxterminate in Mach-O shared libraries
wxStAppResource::CloseSharedLibraryResource();
#endif
-
+ wxMacCleanupConverters() ;
+
UMACleanupToolbox() ;
if (s_macCursorRgn) {
::DisposeRgn((RgnHandle)s_macCursorRgn);
// we could try to get the open apple events here to adjust argc and argv better
wxTheApp->argc = argc;
+#if wxUSE_UNICODE
+ wxTheApp->argv = new wxChar*[argc+1];
+ int mb_argc ;
+ for ( mb_argc = 0; mb_argc < argc; mb_argc++ )
+ {
+ wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[mb_argc]));
+ }
+ wxTheApp->argv[mb_argc] = (wxChar *)NULL;
+#else
wxTheApp->argv = argv;
+#endif
// GUI-specific initialization, such as creating an app context.
wxEntryInitGui();
return true;
}
}
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return false;
}
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return FALSE;
}
return image.SaveFile(filename, type);
}
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return false;
}
public:
inline wxPICTResourceHandler()
{
- m_name = "Macintosh Pict resource";
- m_extension = "";
+ m_name = wxT("Macintosh Pict resource");
+ m_extension = wxEmptyString;
m_type = wxBITMAP_TYPE_PICT_RESOURCE;
};
int desiredWidth, int desiredHeight)
{
Str255 theName ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , name ) ;
-#else
- strcpy( (char *) theName , name ) ;
- c2pstr( (char *)theName ) ;
-#endif
-
+ wxMacStringToPascal( name , theName ) ;
+
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )
{
if ( m_bmpNormal.Ok() )
bmap = (wxBitmapRefData*) ( m_bmpNormal.GetRefData()) ;
- MacPreControlCreate( parent , id , "" , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
kControlBehaviorOffsetContents +
( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ?
kControlContentCIconHandle : kControlContentPictHandle ) , 0,
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlPushButtonProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPostControlCreate() ;
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
long wxApp::s_macPreferencesMenuItemId = 0 ;
long wxApp::s_macExitMenuItemId = wxID_EXIT ;
-wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
+wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ;
//----------------------------------------------------------------------
// Core Apple Event Support
#endif
#endif
-
+ wxMacSetupConverters() ;
+
s_macCursorRgn = ::NewRgn() ;
wxClassInfo::InitializeClasses();
// __wxterminate in Mach-O shared libraries
wxStAppResource::CloseSharedLibraryResource();
#endif
-
+ wxMacCleanupConverters() ;
+
UMACleanupToolbox() ;
if (s_macCursorRgn) {
::DisposeRgn((RgnHandle)s_macCursorRgn);
// we could try to get the open apple events here to adjust argc and argv better
wxTheApp->argc = argc;
+#if wxUSE_UNICODE
+ wxTheApp->argv = new wxChar*[argc+1];
+ int mb_argc ;
+ for ( mb_argc = 0; mb_argc < argc; mb_argc++ )
+ {
+ wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[mb_argc]));
+ }
+ wxTheApp->argv[mb_argc] = (wxChar *)NULL;
+#else
wxTheApp->argv = argv;
+#endif
// GUI-specific initialization, such as creating an app context.
wxEntryInitGui();
return true;
}
}
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return false;
}
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return FALSE;
}
return image.SaveFile(filename, type);
}
- wxLogWarning("no bitmap handler for type %d defined.", type);
+ wxLogWarning(wxT("no bitmap handler for type %d defined."), type);
return false;
}
public:
inline wxPICTResourceHandler()
{
- m_name = "Macintosh Pict resource";
- m_extension = "";
+ m_name = wxT("Macintosh Pict resource");
+ m_extension = wxEmptyString;
m_type = wxBITMAP_TYPE_PICT_RESOURCE;
};
int desiredWidth, int desiredHeight)
{
Str255 theName ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , name ) ;
-#else
- strcpy( (char *) theName , name ) ;
- c2pstr( (char *)theName ) ;
-#endif
-
+ wxMacStringToPascal( name , theName ) ;
+
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )
{
if ( m_bmpNormal.Ok() )
bmap = (wxBitmapRefData*) ( m_bmpNormal.GetRefData()) ;
- MacPreControlCreate( parent , id , "" , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
kControlBehaviorOffsetContents +
( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ?
kControlContentCIconHandle : kControlContentPictHandle ) , 0,
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlPushButtonProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPostControlCreate() ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
ListDefSpec listDef;
listDef.defType = kListDefUserProcType;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
void wxChoice::DoSetItemClientData( int n, void* clientData )
{
wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(),
- "invalid index in wxChoice::SetClientData" );
+ wxT("invalid index in wxChoice::SetClientData") );
m_datas[n] = (char*) clientData ;
}
void *wxChoice::DoGetItemClientData(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
- "invalid index in wxChoice::GetClientData" );
+ wxT("invalid index in wxChoice::GetClientData") );
return (void *)m_datas[n];
}
case wxDF_TEXT:
break;
+ case wxDF_UNICODETEXT:
+ break;
case wxDF_BITMAP :
case wxDF_METAFILE :
break ;
{
if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr)
{
- if ( dataFormat.GetType() == wxDF_TEXT )
- byteCount++ ;
+ Size allocSize = byteCount ;
+ if ( dataFormat.GetType() == wxDF_TEXT )
+ allocSize += 1 ;
+ else if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ allocSize += 2 ;
- data = new char[ byteCount ] ;
+ data = new char[ allocSize ] ;
+
if (( err = GetScrapFlavorData( scrapRef, dataFormat.GetFormatId(), &byteCount , data )) == noErr )
{
- *len = byteCount ;
+ *len = allocSize ;
if ( dataFormat.GetType() == wxDF_TEXT )
((char*)data)[byteCount] = 0 ;
+ if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ ((wxChar*)data)[byteCount/2] = 0 ;
}
else
{
if ( GetHandleSize( datahandle ) > 0 )
{
byteCount = GetHandleSize( datahandle ) ;
+ Size allocSize = byteCount ;
if ( dataFormat.GetType() == wxDF_TEXT )
- data = new char[ byteCount + 1] ;
- else
- data = new char[ byteCount ] ;
-
+ allocSize += 1 ;
+ else if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ allocSize += 2 ;
+
+ data = new char[ allocSize ] ;
+
memcpy( (char*) data , (char*) *datahandle , byteCount ) ;
if ( dataFormat.GetType() == wxDF_TEXT )
((char*)data)[byteCount] = 0 ;
+ if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ ((wxChar*)data)[byteCount/2] = 0 ;
*len = byteCount ;
}
DisposeHandle( datahandle ) ;
return NULL ;
}
+
if ( dataFormat.GetType() == wxDF_TEXT && wxApp::s_macDefaultEncodingIsPC )
{
- wxMacConvertToPC((char*)data,(char*)data,byteCount) ;
+ wxString st = wxMacMakeStringFromCString( (char*) data ) ;
+#if wxUSE_UNICODE
+ wxCharBuffer buf = st.ToAscii() ;
+#else
+ char* buf = st ;
+#endif
+ char* newdata = new char[strlen(buf)+1] ;
+ memcpy( newdata , buf , strlen(buf)+1 ) ;
+ delete[] ((char*) data ) ;
+ data = newdata ;
}
+
return data;
}
{
wxTextDataObject* textDataObject = (wxTextDataObject*) data;
wxString str(textDataObject->GetText());
- wxString mac ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- mac = wxMacMakeMacStringFromPC(textDataObject->GetText()) ;
- }
- else
- {
- mac = textDataObject->GetText() ;
- }
- err = UMAPutScrap( mac.Length() , 'TEXT' , (void*) mac.c_str() ) ;
+ wxCharBuffer buf = wxMacStringToCString( str ) ;
+ err = UMAPutScrap( strlen(buf) , kScrapFlavorTypeText , (void*) buf.data() ) ;
}
break ;
-
+#if wxUSE_UNICODE
+ case wxDF_UNICODETEXT :
+ {
+ wxTextDataObject* textDataObject = (wxTextDataObject*) data;
+ wxString str(textDataObject->GetText());
+ err = UMAPutScrap( str.Length() * sizeof(wxChar) , kScrapFlavorTypeUnicode , (void*) str.wc_str() ) ;
+ }
+ break ;
+#endif
#if wxUSE_DRAG_AND_DROP
case wxDF_METAFILE:
{
wxMetafile metaFile = metaFileDataObject->GetMetafile();
PicHandle pict = (PicHandle) metaFile.GetHMETAFILE() ;
HLock( (Handle) pict ) ;
- err = UMAPutScrap( GetHandleSize( (Handle) pict ) , 'PICT' , *pict ) ;
+ err = UMAPutScrap( GetHandleSize( (Handle) pict ) , kScrapFlavorTypePicture , *pict ) ;
HUnlock( (Handle) pict ) ;
}
break ;
pict = (PicHandle) bitmapDataObject->GetBitmap().GetPict( &created ) ;
HLock( (Handle) pict ) ;
- err = UMAPutScrap( GetHandleSize( (Handle) pict ) , 'PICT' , *pict ) ;
+ err = UMAPutScrap( GetHandleSize( (Handle) pict ) , kScrapFlavorTypePicture , *pict ) ;
HUnlock( (Handle) pict ) ;
if ( created )
KillPicture( pict ) ;
if (sel > -1)
return wxString(this->GetString (sel));
else
- return wxString("");
+ return wxEmptyString;
}
bool wxComboBox::SetStringSelection(const wxString& sel)
{
m_label = wxStripMenuCodes(title) ;
- if ( (ControlHandle) m_macControl )
+ if ( m_macControl )
{
- Str255 maclabel ;
- wxString label ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( m_label ) ;
- else
- label = m_label ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) maclabel , label ) ;
-#else
- strcpy( (char *) maclabel , label ) ;
- c2pstr( (char *) maclabel ) ;
-#endif
- ::SetControlTitle( (ControlHandle) m_macControl , maclabel ) ;
+ UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ;
}
Refresh() ;
}
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( inControl != (ControlHandle) NULL, "attempt to add a NULL WindowRef to window list" );
+ wxCHECK_RET( inControl != (ControlHandle) NULL, wxT("attempt to add a NULL WindowRef to window list") );
if ( !wxWinMacControlList->Find((long)inControl) )
wxWinMacControlList->Append((long)inControl, control);
void wxControl::MacPostControlCreate()
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
{
SetSize(pos.x, pos.y, new_size.x, new_size.y);
+#if wxUSE_UNICODE
+ UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ;
+#endif
+
UMAShowControl( (ControlHandle) m_macControl ) ;
SetCursor( *wxSTANDARD_CURSOR ) ;
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
}
if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE )
{
Str255 theName ;
-
- #if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , cursor_file ) ;
- #else
- strcpy( (char *) theName , cursor_file ) ;
- c2pstr( (char *) theName ) ;
- #endif
+ wxMacStringToPascal( cursor_file , theName ) ;
wxStAppResource resload ;
Handle resHandle = ::GetNamedResource( 'crsr' , theName ) ;
///////////////////////////////////////////////////////////////////////////////
-// Name: os2/dataobj.cpp
-// Purpose: implementation of wx[I]DataObject class
-// Author: David Webster
+// Name: mac/dataobj.cpp
+// Purpose: implementation of wxDataObject class
+// Author: Stefan Csomor
// Modified by:
// Created: 10/21/99
// RCS-ID: $Id$
-// Copyright: (c) 1999 David Webster
+// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/mstream.h"
#include "wx/image.h"
#include "wx/mac/private.h"
+#include "Scrap.h"
// ----------------------------------------------------------------------------
// functions
{
m_type = Type;
- if (m_type == wxDF_TEXT)
- m_format = 'TEXT';
+ if (m_type == wxDF_TEXT )
+ m_format = kScrapFlavorTypeText;
+ else if (m_type == wxDF_UNICODETEXT )
+ m_format = kScrapFlavorTypeUnicode ;
else if (m_type == wxDF_BITMAP || m_type == wxDF_METAFILE )
- m_format = 'PICT';
+ m_format = kScrapFlavorTypePicture;
else if (m_type == wxDF_FILENAME)
m_format = kDragFlavorTypeHFS ;
else
wxString wxDataFormat::GetId() const
{
- wxString sRet(""); // TODO: to name of ( m_format ) );
- return sRet;
+ char text[5] ;
+ strncpy( text , (char*) m_format , 4 ) ;
+ text[4] = 0 ;
+ return wxString::FromAscii( text ) ;
}
void wxDataFormat::SetId( NativeFormat format )
{
m_format = format;
- if (m_format == 'TEXT')
+ if (m_format == kScrapFlavorTypeText)
m_type = wxDF_TEXT;
else
- if (m_format == 'PICT')
+ if (m_format == kScrapFlavorTypeUnicode )
+ m_type = wxDF_UNICODETEXT;
+ else
+ if (m_format == kScrapFlavorTypePicture)
m_type = wxDF_BITMAP;
else
if (m_format == kDragFlavorTypeHFS )
{
m_filenames.Empty();
- wxString sFile( (const char *)pBuf); /* char, not wxChar */
-
- AddFile(sFile);
+ AddFile(wxString::FromAscii((char*)pBuf));
return TRUE;
}
}
if ( mode == kUnsupportedMode )
{
- wxFAIL_MSG("unsupported blitting mode" );
+ wxFAIL_MSG(wxT("unsupported blitting mode" ));
return FALSE ;
}
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
}
if ( str.Length() == 0 )
return ;
+
wxMacPortSetter helper(this) ;
MacInstallFont() ;
- wxString text ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- text = wxMacMakeMacStringFromPC( str ) ;
- }
- else
- {
- text = str ;
- }
+
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
if ( 0 )
{
m_macAliasWasEnabled = true ;
}
OSStatus status = noErr ;
+ ATSUTextLayout atsuLayout ;
+ UniCharCount chars = str.Length() ;
+#if wxUSE_UNICODE
+ status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) (const wxChar*) str , 0 , str.Length() , str.Length() , 1 ,
+ &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
+#else
TECObjectRef ec;
- status = TECCreateConverter(&ec, kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
- wxASSERT_MSG( status == noErr , "couldn't start converter" ) ;
+ status = TECCreateConverter(&ec,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
+
+ wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ;
ByteCount byteOutLen ;
- ByteCount byteInLen = text.Length() ;
+ ByteCount byteInLen = str.Length() ;
ByteCount byteBufferLen = byteInLen *2 ;
char* buf = new char[byteBufferLen] ;
- status = TECConvertText(ec, (ConstTextPtr)text.c_str() , byteInLen, &byteInLen,
+ status = TECConvertText(ec, (ConstTextPtr)str.c_str() , byteInLen, &byteInLen,
(TextPtr)buf, byteBufferLen, &byteOutLen);
- wxASSERT_MSG( status == noErr , "couldn't convert text" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't convert text") ) ;
status = TECDisposeConverter(ec);
- wxASSERT_MSG( status == noErr , "couldn't dispose converter" ) ;
- ATSUTextLayout atsuLayout ;
- UniCharCount chars = byteOutLen / 2 ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't dispose converter") ) ;
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) buf , 0 , byteOutLen / 2 , byteOutLen / 2 , 1 ,
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
- wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
+#endif
+ wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") );
int iAngle = int( angle );
int drawX = XLOG2DEVMAC(x) ;
int drawY = YLOG2DEVMAC(y) ;
drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ;
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) );
- wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
+ wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") );
Rect rect ;
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) , &rect );
- wxASSERT_MSG( status == noErr , "couldn't measure the rotated text" );
+ wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") );
OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ;
CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) );
CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) );
::ATSUDisposeTextLayout(atsuLayout);
+#if wxUSE_UNICODE
+#else
delete[] buf ;
+#endif
}
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{
::TextMode( srcCopy ) ;
}
- const char *text = NULL ;
- int length = 0 ;
- wxString macText ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- macText = wxMacMakeMacStringFromPC( strtext ) ;
- text = macText ;
- length = macText.Length() ;
- }
- else
- {
- text = strtext ;
- length = strtext.Length() ;
- }
+ int length = strtext.Length() ;
+
int laststop = 0 ;
int i = 0 ;
int line = 0 ;
{
while( i < length )
{
- if( text[i] == 13 || text[i] == 10)
+ if( strtext[i] == 13 || strtext[i] == 10)
{
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useDrawThemeText )
{
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
Point bounds={0,0} ;
&frame,
teJustLeft,
nil );
- CFRelease( mString ) ;
line++ ;
}
else
#endif
{
- ::DrawText( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ ::DrawText( text , 0 , strlen(text) ) ;
line++ ;
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
}
}
i++ ;
}
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useDrawThemeText )
{
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
- CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
+ wxMacCFStringHolder mString( linetext ) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
&frame,
teJustLeft,
nil );
- CFRelease( mString ) ;
}
else
#endif
{
- ::DrawText( text , laststop , i - laststop ) ;
- }
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ ::DrawText( text , 0 , strlen(text) ) ;
+ }
}
::TextMode( srcOr ) ;
}
return true ;
}
-void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
+void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading ,
wxFont *theFont ) const
{
*descent =YDEV2LOGREL( fi.descent );
if ( externalLeading )
*externalLeading = YDEV2LOGREL( fi.leading ) ;
+ int length = strtext.Length() ;
+ /*
const char *text = NULL ;
- int length = 0 ;
wxString macText ;
if ( wxApp::s_macDefaultEncodingIsPC )
{
text = string ;
length = string.Length() ;
}
+ */
int laststop = 0 ;
int i = 0 ;
int curwidth = 0 ;
*width = 0 ;
while( i < length )
{
- if( text[i] == 13 || text[i] == 10)
+ if( strtext[i] == 13 || strtext[i] == 10)
{
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
if ( height )
*height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ;
#if TARGET_CARBON
{
Point bounds={0,0} ;
SInt16 baseline ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
false,
&bounds,
&baseline );
- CFRelease( mString ) ;
curwidth = bounds.h ;
}
else
#endif
{
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
i++ ;
}
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useGetThemeText )
{
Point bounds={0,0} ;
SInt16 baseline ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
false,
&bounds,
&baseline );
- CFRelease( mString ) ;
curwidth = bounds.h ;
}
else
#endif
{
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
Style qdStyle = font->m_macFontStyle ;
ATSUFontID atsuFont = font->m_macATSUFontID ;
status = ::ATSUCreateStyle(&(ATSUStyle)m_macATSUIStyle) ;
- wxASSERT_MSG( status == noErr , "couldn't create ATSU style" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") ) ;
ATSUAttributeTag atsuTags[] =
{
kATSUFontTag ,
} ;
status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
atsuTags, atsuSizes, atsuValues);
- wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ;
}
Pattern gHatchPatterns[] =
if ( err != noErr )
#endif
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease( m_macPrintSessionPort ) ;
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
UMAPrClose(NULL) ;
m_ok = FALSE;
err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
err = PrError() ;
if ( err )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
UMAPrClose(NULL) ;
m_ok = FALSE;
if ( err != noErr || m_macPrintSessionPort == kPMNoReference )
#endif
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
}
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ;
::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld") , err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
::UMAPrClose(NULL) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
const wxSize& WXUNUSED(size),
const wxString& WXUNUSED(name))
{
- wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
+ wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
m_message = message;
m_dialogStyle = style;
m_parent = parent;
0L); // User Data
if ( (err != noErr) && (err != userCanceledErr) ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
folderInfo = **(FSSpec**) specDesc.dataHandle;
err = ::PBGetCatInfoSync(&thePB);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
// Create cannonical FSSpec
err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
#endif
- wxASSERT_MSG( (err == noErr) || (err == nsvErr) , "Error accessing directory " + m_dirname) ;
+ wxASSERT_MSG( (err == noErr) || (err == nsvErr) , wxT("Error accessing directory " + m_dirname)) ;
m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ;
if ( !m_isDir )
return FALSE ;
-#if TARGET_CARBON
- char c_name[256] ;
-#endif
wxString result;
short err = noErr ;
if ( err != noErr )
break ;
-#if TARGET_CARBON
- p2cstrcpy( c_name, m_name ) ;
- strcpy( (char *)m_name, c_name);
-#else
- p2cstr( m_name ) ;
-#endif
// its hidden but we don't want it
if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) )
continue ;
#ifdef __DARWIN__
// under X, names that start with '.' are hidden
- if ( ( m_name[0] == '.' ) && !(m_flags & wxDIR_HIDDEN) )
+ if ( ( m_name[1] == '.' ) && !(m_flags & wxDIR_HIDDEN) )
continue;
#endif
#if TARGET_CARBON
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
- wxString file( m_name ) ;
- if ( m_filespec.IsEmpty() || m_filespec == "*.*" || m_filespec == "*" )
+ wxString file = wxMacMakeStringFromPascal( m_name ) ;
+ if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
{
}
- else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
+ else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") )
{
if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
{
continue ;
}
}
- else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
+ else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == wxT("*") )
{
if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
{
return FALSE ;
}
- *filename = (char*) m_name ;
+ *filename = wxMacMakeStringFromPascal( m_name ) ;
return TRUE;
}
GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L);
if( theType == 'TEXT' )
{
- theData[dataSize]=0 ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- wxMacConvertToPC((char*)theData,(char*)theData,dataSize) ;
- }
- m_dataObject->SetData( format, dataSize, theData );
+ theData[dataSize]=0 ;
+ wxString convert = wxMacMakeStringFromCString( theData ) ;
+ m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert );
}
else if ( theType == kDragFlavorTypeHFS )
{
if ( type == 'TEXT' )
{
dataSize-- ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- wxMacConvertFromPC((char*)dataPtr,(char*)dataPtr,dataSize) ;
- }
- AddDragItemFlavor(theDrag, theItem, type , dataPtr, dataSize, 0);
+ dataPtr[ dataSize ] = 0 ;
+ wxString st( (wxChar*) dataPtr ) ;
+ wxCharBuffer buf = wxMacStringToCString( st ) ;
+ AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0);
}
else if (type == kDragFlavorTypeHFS )
{
Str255 filename ;
// get the current filename
NavCustomControl(ioParams->context, kNavCtlGetEditFileName, &filename);
- CopyPascalStringToC( filename , (char*) filename ) ;
- wxString sfilename( filename ) ;
+ wxString sfilename = wxMacMakeStringFromPascal( filename ) ;
int pos = sfilename.Find('.',TRUE) ;
if ( pos != wxNOT_FOUND )
{
sfilename = sfilename.Left(pos+1)+extension ;
- CopyCStringToPascal( sfilename.c_str() , filename ) ;
+ wxMacStringToPascal( sfilename , filename ) ;
NavCustomControl(ioParams->context, kNavCtlSetEditFileName, &filename);
}
}
}
}
-const char * gfilters[] =
+const wxChar * gfilters[] =
{
- "*.TXT" ,
- "*.TIF" ,
- "*.JPG" ,
+ wxT("*.TXT") ,
+ wxT("*.TIF") ,
+ wxT("*.JPG") ,
NULL
} ;
++filterIndex ;
}
isName = !isName ;
- current = "" ;
+ current = wxEmptyString ;
}
else
{
// we allow for compatibility reason to have a single filter expression (like *.*) without
// an explanatory text, in that case the first part is name and extension at the same time
- wxASSERT_MSG( filterIndex == 0 || !isName , "incorrect format of format string" ) ;
+ wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
if ( current.IsEmpty() )
myData->extensions.Add( myData->name[filterIndex] ) ;
else
int j ;
for ( j = 0 ; gfilters[j] ; j++ )
{
- if ( strcmp( myData->extensions[i] , gfilters[j] ) == 0 )
+ if ( myData->extensions[i] == gfilters[j] )
{
myData->filtermactypes.Add( gfiltersmac[j] ) ;
break ;
static Boolean CheckFile( ConstStr255Param name , OSType type , OpenUserDataRecPtr data)
{
+/*
Str255 filename ;
#if TARGET_CARBON
p2cstr( filename ) ;
#endif
wxString file(filename) ;
+*/
+ wxString file = wxMacMakeStringFromPascal( name ) ;
file.MakeUpper() ;
if ( data->extensions.GetCount() > 0 )
{
//for ( int i = 0 ; i < data->numfilters ; ++i )
int i = data->currentfilter ;
- if ( data->extensions[i].Right(2) == ".*" )
+ if ( data->extensions[i].Right(2) == wxT(".*") )
return true ;
{
if ( type == (OSType)data->filtermactypes[i] )
return true ;
- wxStringTokenizer tokenizer( data->extensions[i] , ";" ) ;
+ wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ;
while( tokenizer.HasMoreTokens() )
{
wxString extension = tokenizer.GetNextToken() ;
// end wxmac
-wxString wxFileSelector(const char *title,
- const char *defaultDir, const char *defaultFileName,
- const char *defaultExtension, const char *filter, int flags,
+wxString wxFileSelector(const wxChar *title,
+ const wxChar *defaultDir, const wxChar *defaultFileName,
+ const wxChar *defaultExtension, const wxChar *filter, int flags,
wxWindow *parent, int x, int y)
{
// If there's a default extension specified but no filter, we create a suitable
// filter.
- wxString filter2("");
+ wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString("*.") + wxString(defaultExtension) ;
+ filter2 = wxString(wxT("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
if (defaultDir)
defaultDirString = defaultDir;
else
- defaultDirString = "";
+ defaultDirString = wxEmptyString ;
wxString defaultFilenameString;
if (defaultFileName)
defaultFilenameString = defaultFileName;
else
- defaultFilenameString = "";
+ defaultFilenameString = wxEmptyString;
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y));
return wxGetEmptyString();
}
-WXDLLEXPORT wxString wxFileSelectorEx(const char *title,
- const char *defaultDir,
- const char *defaultFileName,
+WXDLLEXPORT wxString wxFileSelectorEx(const wxChar *title,
+ const wxChar *defaultDir,
+ const wxChar *defaultFileName,
int* defaultFilterIndex,
- const char *filter,
+ const wxChar *filter,
int flags,
wxWindow* parent,
int x,
int y)
{
- wxFileDialog fileDialog(parent, title ? title : "", defaultDir ? defaultDir : "",
- defaultFileName ? defaultFileName : "", filter ? filter : "", flags, wxPoint(x, y));
+ wxFileDialog fileDialog(parent, title ? title : wxT(""), defaultDir ? defaultDir : wxT(""),
+ defaultFileName ? defaultFileName : wxT(""), filter ? filter : wxT(""), flags, wxPoint(x, y));
if ( fileDialog.ShowModal() == wxID_OK )
{
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
long style, const wxPoint& pos)
{
- wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
+ wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
m_message = message;
m_dialogStyle = style;
m_parent = parent;
- m_path = "";
+ m_path = wxT("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_filterIndex = 0;
}
-
pascal Boolean CrossPlatformFilterCallback (
AEDesc *theItem,
void *info,
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
}
}
-
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)mNavOptions.message, m_message) ;
-#else
- strcpy((char *)mNavOptions.message, m_message) ;
- c2pstr((char *)mNavOptions.message ) ;
-#endif
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)mNavOptions.savedFileName, m_fileName) ;
-#else
- strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
- c2pstr((char *)mNavOptions.savedFileName ) ;
-#endif
+ wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ;
+ wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ;
// zero all data
(*mNavOptions.popupExtension)[i].version = kNavMenuItemSpecVersion ;
(*mNavOptions.popupExtension)[i].menuCreator = 'WXNG' ;
(*mNavOptions.popupExtension)[i].menuType = i ;
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)(*mNavOptions.popupExtension)[i].menuItemName, myData.name[i]) ;
-#else
- strcpy((char *)(*mNavOptions.popupExtension)[i].menuItemName, myData.name[i]) ;
- c2pstr((char *)(*mNavOptions.popupExtension)[i].menuItemName ) ;
-#endif
+ wxMacStringToPascal( myData.name[i] , (StringPtr)(*mNavOptions.popupExtension)[i].menuItemName ) ;
}
}
if ( m_dialogStyle & wxSAVE )
{
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
outFileSpec = **(FSSpec**) specDesc.dataHandle;
// Generic file load/save dialog
static wxString
-wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxDefaultFileSelector(bool load, const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
- char *ext = (char *)extension;
-
- char prompt[50];
+ wxString prompt;
+
wxString str;
if (load)
- str = "Load %s file";
+ str = wxT("Load %s file");
else
- str = "Save %s file";
- sprintf(prompt, wxGetTranslation(str), what);
+ str = wxT("Save %s file");
+ prompt.Printf( wxGetTranslation(str), what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ const wxChar *ext = extension;
+ if (*ext == wxT('.'))
+ ext++;
+
+ wxString wild;
+ wild.Printf(wxT("*.%s"), ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}
// Generic file load dialog
wxString
-wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxLoadFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
}
// Generic file save dialog
wxString
-wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxSaveFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
}
-
-
void wxFontRefData::MacFindFont()
{
- if( m_faceName == "" )
+ if( m_faceName.Length() == 0 )
{
switch( m_family )
{
}
Str255 name ;
GetFontName( m_macFontNum , name ) ;
- CopyPascalStringToC( name , (char*) name ) ;
- m_faceName = (char*) name ;
+ m_faceName = wxMacMakeStringFromPascal( name ) ;
}
else
{
- if ( m_faceName == "systemfont" )
+ if ( m_faceName == wxT("systemfont") )
m_macFontNum = ::GetSysFont() ;
- else if ( m_faceName == "applicationfont" )
+ else if ( m_faceName == wxT("applicationfont") )
m_macFontNum = ::GetAppFont() ;
else
{
status = ATSUFindFontFromName ( (Ptr) m_faceName , strlen( m_faceName ) ,
kFontFullName, kFontMacintoshPlatform, kFontRomanScript , kFontNoLanguage , (UInt32*)&m_macATSUFontID ) ;
*/
- wxASSERT_MSG( status == noErr , "couldn't retrieve font identifier" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't retrieve font identifier") ) ;
}
// ----------------------------------------------------------------------------
size = wxSize( 200 , 16 ) ;
}
- MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
kControlProgressBarProc , (long) this ) ;
}
}
-void wxGLContext::SetColour(const char *colour)
+void wxGLContext::SetColour(const wxChar *colour)
{
float r = 0.0;
float g = 0.0;
}
}
-void wxGLCanvas::SetColour(const char *colour)
+void wxGLCanvas::SetColour(const wxChar *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
int desiredWidth, int desiredHeight)
{
short theId = -1 ;
- if ( name == "wxICON_INFORMATION" )
+ if ( name == wxT("wxICON_INFORMATION") )
{
theId = kNoteIcon ;
}
- else if ( name == "wxICON_QUESTION" )
+ else if ( name == wxT("wxICON_QUESTION") )
{
theId = kCautionIcon ;
}
- else if ( name == "wxICON_WARNING" )
+ else if ( name == wxT("wxICON_WARNING") )
{
theId = kCautionIcon ;
}
- else if ( name == "wxICON_ERROR" )
+ else if ( name == wxT("wxICON_ERROR") )
{
theId = kStopIcon ;
}
{
Str255 theName ;
OSType theType ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , name ) ;
-#else
- strcpy( (char *) theName , name ) ;
- c2pstr( (char *) theName ) ;
-#endif
+ wxMacStringToPascal( name , theName ) ;
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L )
wxString wxJoystick::GetProductName() const
{
// TODO
- return wxString("");
+ return wxString(wxT(""));
}
int wxJoystick::GetXMin() const
case lDrawMsg:
{
- const wxString text = list->m_stringArray[cell.v] ;
+ const wxString linetext = list->m_stringArray[cell.v] ;
// Save the current clip region, and set the clip region to the area we are about
// to draw.
}
#if TARGET_CARBON
- bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
-
- if ( useDrawThemeText )
- {
- Rect frame = { drawRect->top, drawRect->left + 4,
- drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
- CFStringRef sString = CFStringCreateWithBytes( NULL , (UInt8*) text.c_str(), text.Length(), CFStringGetSystemEncoding(), false ) ;
- CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , sString ) ;
- CFRelease( sString ) ;
- ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- false,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- }
- else
-#endif
- {
+ {
+ Rect frame = { drawRect->top, drawRect->left + 4,
+ drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
+ CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext) ) ;
+ ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ }
+#else
+ {
+ wxCharBuffer text = wxMacStringToCString( linetext ) ;
MoveTo(drawRect->left + 4 , drawRect->top + 10 );
- DrawText(text, 0 , text.Length());
+ DrawText(text, 0 , strlen(text) );
}
-
+#endif
// If the cell is hilited, do the hilite now. Paint the cell contents with the
// appropriate QuickDraw transform mode.
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
ListDefSpec listDef;
listDef.defType = kListDefUserProcType;
fontSize = 9 ;
fontStyle = normal ;
#endif
- CopyPascalStringToC( fontName , (char*) fontName ) ;
- SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , fontName ) ) ;
+ SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , wxMacMakeStringFromPascal( fontName ) ) ) ;
#if TARGET_CARBON
Size asize;
int wxListBox::DoAppend(const wxString& item)
{
int index = m_noItems ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- m_stringArray.Add( wxMacMakeMacStringFromPC( item ) ) ;
- m_dataArray.Add( NULL );
- }
- else {
- m_stringArray.Add( item ) ;
- m_dataArray.Add( NULL );
- }
+ m_stringArray.Add( item ) ;
+ m_dataArray.Add( NULL );
m_noItems ++;
DoSetItemClientData( index , NULL ) ;
MacAppend( item ) ;
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
}
-int wxListBox::FindString(const wxString& st) const
+int wxListBox::FindString(const wxString& s) const
{
- wxString s ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- s = wxMacMakeMacStringFromPC( st ) ;
- }
- else
- s = st ;
- if ( s.Right(1) == "*" )
+ if ( s.Right(1) == wxT("*") )
{
wxString search = s.Left( s.Length() - 1 ) ;
int len = search.Length() ;
Str255 s1 , s2 ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s2 , search.c_str() ) ;
-#else
- strcpy( (char *) s2 , search.c_str() ) ;
- c2pstr( (char *) s2 ) ;
-#endif
+ wxMacStringToPascal( search , s2 ) ;
for ( int i = 0 ; i < m_noItems ; ++ i )
{
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s1 , m_stringArray[i].Left( len ).c_str() ) ;
-#else
- strcpy( (char *) s1 , m_stringArray[i].Left( len ).c_str() ) ;
- c2pstr( (char *) s1 ) ;
-#endif
+ wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
+
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
- if ( s.Left(1) == "*" && s.Length() > 1 )
+ if ( s.Left(1) == wxT("*") && s.Length() > 1 )
{
- s = st ;
- s.MakeLower() ;
+ wxString st = s ;
+ st.MakeLower() ;
for ( int i = 0 ; i < m_noItems ; ++i )
{
- if ( GetString(i).Lower().Matches(s) )
+ if ( GetString(i).Lower().Matches(st) )
return i ;
}
}
{
Str255 s1 , s2 ;
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s2 , s.c_str() ) ;
-#else
- strcpy( (char *) s2 , s.c_str() ) ;
- c2pstr( (char *) s2 ) ;
-#endif
+ wxMacStringToPascal( s , s2 ) ;
for ( int i = 0 ; i < m_noItems ; ++ i )
{
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s1 , m_stringArray[i].c_str() ) ;
-#else
- strcpy( (char *) s1 , m_stringArray[i].c_str() ) ;
- c2pstr( (char *) s1 ) ;
-#endif
+ wxMacStringToPascal( m_stringArray[i] , s1 ) ;
+
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
void wxListBox::SetSelection(int N, bool select)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- "invalid index in wxListBox::SetSelection" );
+ wxT("invalid index in wxListBox::SetSelection") );
MacSetSelection( N , select ) ;
GetSelections( m_selectionPreImage ) ;
}
bool wxListBox::IsSelected(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE,
- "invalid index in wxListBox::Selected" );
+ wxT("invalid index in wxListBox::Selected") );
return MacIsSelected( N ) ;
}
void wxListBox::DoSetItemClientData(int N, void *Client_data)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- "invalid index in wxListBox::SetClientData" );
+ wxT("invalid index in wxListBox::SetClientData") );
#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW )
wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
}
#endif // wxUSE_OWNER_DRAWN
- wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , "invalid client_data array" ) ;
+ wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ;
if ( m_dataArray.GetCount() > (size_t) N )
{
// Find string for position
wxString wxListBox::GetString(int N) const
{
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- return wxMacMakePCStringFromMac( m_stringArray[N] ) ;
- }
- else
- return m_stringArray[N] ;
+ return m_stringArray[N] ;
}
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
void wxListBox::SetString(int N, const wxString& s)
{
- wxString str ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- str = wxMacMakeMacStringFromPC( s ) ;
- }
- else
- str = s ;
- m_stringArray[N] = str ;
+ m_stringArray[N] = s ;
MacSet( N , s ) ;
}
Refresh();
}
-void wxListBox::MacInsert( int n , const char * text)
+void wxListBox::MacInsert( int n , const wxString& text)
{
Cell cell = { 0 , 0 } ;
cell.v = n ;
Refresh();
}
-void wxListBox::MacAppend( const char * text)
+void wxListBox::MacAppend( const wxString& text)
{
Cell cell = { 0 , 0 } ;
cell.v = (**(ListHandle)m_macList).dataBounds.bottom ;
return no_sel ;
}
-void wxListBox::MacSet( int n , const char * text )
+void wxListBox::MacSet( int n , const wxString& text )
{
// our implementation does not store anything in the list
// so we just have to redraw
{
if ( event.GetTimestamp() > m_lastTypeIn + 60 )
{
- m_typeIn = "" ;
+ m_typeIn = wxEmptyString ;
}
m_lastTypeIn = event.GetTimestamp() ;
m_typeIn += (char) event.GetKeyCode() ;
- int line = FindString("*"+m_typeIn+"*") ;
+ int line = FindString(wxT("*")+m_typeIn+wxT("*")) ;
if ( line >= 0 )
{
if ( GetSelection() != line )
short wakeUp )
{
wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ;
- wxASSERT_MSG( handler != NULL , "illegal notification proc ptr" ) ;
+ wxASSERT_MSG( handler != NULL , wxT("illegal notification proc ptr") ) ;
/* this should be protected eventually */
short index = e->top++ ;
// append a new item or submenu to the menu
bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{
- wxASSERT_MSG( pItem != NULL, "can't append NULL item to the menu" );
+ wxASSERT_MSG( pItem != NULL, wxT("can't append NULL item to the menu") );
if ( pItem->IsSeparator() )
{
wxMenu *pSubMenu = pItem->GetSubMenu() ;
if ( pSubMenu != NULL )
{
- wxASSERT_MSG( pSubMenu->m_hMenu != NULL , "invalid submenu added");
+ wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
{
if ( pos == (size_t)-1 )
{
- UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), "a" );
+ UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") );
pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ;
}
else
{
- UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), "a" , pos);
+ UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
}
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ;
Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ;
wxString message ;
- wxCHECK_RET( menubar != NULL, "can't read MBAR resource" );
+ wxCHECK_RET( menubar != NULL, wxT("can't read MBAR resource") );
::SetMenuBar( menubar ) ;
#if TARGET_API_MAC_CARBON
::DisposeMenuBar( menubar ) ;
int pos ;
wxMenu* menu = m_menus[i] , *subMenu = NULL ;
- if( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName )
+ if( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName )
{
if ( mh == NULL )
{
{
// In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines
// therefore these item must not be translated
- if ( wxStripMenuCodes(m_text).Upper() == "EXIT" )
+ if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") )
{
- m_text = "Quit\tCtrl+Q" ;
+ m_text =wxT("Quit\tCtrl+Q") ;
}
m_radioGroup.start = -1;
void wxMenuItem::Check(bool bDoCheck)
{
- wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
+ wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
if ( m_isChecked != bDoCheck )
{
M_METAFILEDATA->m_metafile = 0;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
/*
if (!file.IsNull() && (file.Cmp("") == 0))
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
m_maxX = -10000;
m_maxY = -10000;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
- m_metaFile = new wxMetaFile("") ;
+ m_metaFile = new wxMetaFile(wxEmptyString) ;
Rect r={0,0,1000,1000} ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
m_maxX = -10000;
m_maxY = -10000;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet")) ;
- m_metaFile = new wxMetaFile("") ;
+ m_metaFile = new wxMetaFile(wxEmptyString) ;
Rect r={yorg,xorg,yorg+yext,xorg+xext} ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
{
wxString ext = e ;
ext = ext.Lower() ;
- if ( ext == "txt" )
+ if ( ext == wxT("txt") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("text/text");
+ fileType->m_impl->SetFileType(wxT("text/text"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "htm" || ext == "html" )
+ else if ( ext == wxT("htm") || ext == wxT("html") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("text/html");
+ fileType->m_impl->SetFileType(wxT("text/html"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "gif" )
+ else if ( ext == wxT("gif") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/gif");
+ fileType->m_impl->SetFileType(wxT("image/gif"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "png" )
+ else if ( ext == wxT("png" ))
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/png");
+ fileType->m_impl->SetFileType(wxT("image/png"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "jpg" || ext == "jpeg" )
+ else if ( ext == wxT("jpg" )|| ext == wxT("jpeg") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/jpeg");
+ fileType->m_impl->SetFileType(wxT("image/jpeg"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "bmp" )
+ else if ( ext == wxT("bmp") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/bmp");
+ fileType->m_impl->SetFileType(wxT("image/bmp"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "tif" || ext == "tiff" )
+ else if ( ext == wxT("tif") || ext == wxT("tiff") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/tiff");
+ fileType->m_impl->SetFileType(wxT("image/tiff"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "xpm" )
+ else if ( ext == wxT("xpm") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/xpm");
+ fileType->m_impl->SetFileType(wxT("image/xpm"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "xbm" )
+ else if ( ext == wxT("xbm") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/xbm");
+ fileType->m_impl->SetFileType(wxT("image/xbm"));
fileType->m_impl->SetExt(ext);
return fileType;
}
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)
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 ;
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 ;
wxMacStringToPascal( m_caption , pascalTitle ) ;
wxMacStringToPascal( _("Yes") , yesPString ) ;
wxMacStringToPascal( _("No") , noPString ) ;
- CopyCStringToPascal( cText , pascalText ) ;
+ wxMacStringToPascal( m_message , pascalText ) ;
param.movable = true;
param.filterProc = NULL ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
int tabstyle = kControlTabSmallNorthProc ;
if ( HasFlag(wxNB_LEFT) )
page = m_pages[ii];
info.version = 0;
info.iconSuiteID = 0;
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) info.name , page->GetLabel() ) ;
-#else
- strcpy( (char *) info.name , page->GetLabel() ) ;
- c2pstr( (char *) info.name ) ;
-#endif
+ wxMacStringToPascal( page->GetLabel() , info.name ) ;
+
SetControlData( (ControlHandle) m_macControl, ii+1, kControlTabInfoTag,
sizeof( ControlTabInfoRec) , (char*) &info ) ;
SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ;
void wxNotebook::Command(wxCommandEvent& event)
{
- wxFAIL_MSG("wxNotebook::Command not implemented");
+ wxFAIL_MSG(wxT("wxNotebook::Command not implemented"));
}
// ----------------------------------------------------------------------------
void
ima_png_error(png_struct *png_ptr, char *message)
{
- wxMessageBox(message, "PNG error");
+ wxMessageBox(wxString::FromAscii(message), wxT("PNG error"));
longjmp(png_ptr->jmpbuf, 1);
}
strcpy(nameStr, name);
else
{
- strcpy(nameStr, filename);
- wxStripExtension(nameStr);
+ wxString str = wxString::FromAscii(filename) ;
+ wxStripExtension( str ) ;
+ strcpy(nameStr, str.ToAscii() );
}
if ( GetDepth() > 4 )
int desiredWidth, int desiredHeight)
{
wxPNGReader reader;
- if (reader.ReadFile((char*) (const char*) name))
+ if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) )
{
return reader.InstantiateBitmap(bitmap);
}
}
else
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxT(""), wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
::UMAPrClose(NULL) ;
}
if ((err != noErr) && (err != kPMCancel))
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
#else
}
else
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
::UMAPrClose(NULL) ;
}
if ((err != noErr) && (err != kPMCancel))
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
#else
if (!win)
{
wxEndBusyCursor();
- wxMessageBox("Sorry, could not create an abort dialog.", "Print Error", wxOK, parent);
+ wxMessageBox(wxT("Sorry, could not create an abort dialog."), wxT("Print Error"), wxOK, parent);
delete dc;
return FALSE;
}
if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage()))
{
wxEndBusyCursor();
- wxMessageBox("Could not start printing.", "Print Error", wxOK, parent);
+ wxMessageBox(wxT("Could not start printing."), wxT("Print Error"), wxOK, parent);
break;
}
if (sm_abortIt)
wxRadioButton *current;
if ((item < 0) || (item >= m_noItems))
- return wxString("");
+ return wxEmptyString;
i = 0;
current = m_radioButtonCycle;
int totWidth,totHeight;
SetFont(GetParent()->GetFont());
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
charWidth/=52;
maxWidth=-1;
int totWidth, totHeight;
wxFont font = GetParent()->GetFont();
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
&charWidth, &charHeight, NULL, NULL, &font);
charWidth /= 52;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100,
kControlScrollBarLiveProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
m_pageSize = (int)((maxValue-minValue)/10);
- MacPreControlCreate( parent, id, "", pos, size, style,
+ MacPreControlCreate( parent, id, wxEmptyString, pos, size, style,
validator, name, &bounds, title );
procID = kControlSliderProc + kControlSliderLiveFeedback;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false,
value, minValue, maxValue, procID, (long) this);
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
if(style & wxSL_LABELS)
{
- m_macMinimumStatic = new wxStaticText( this, -1, "" );
- m_macMaximumStatic = new wxStaticText( this, -1, "" );
- m_macValueStatic = new wxStaticText( this, -1, "" );
+ m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macValueStatic = new wxStaticText( this, -1, wxEmptyString );
SetRange(minValue, maxValue);
SetValue(value);
}
void wxSlider::SetValue(int value)
{
wxString valuestring ;
- valuestring.Printf( "%d" , value ) ;
+ valuestring.Printf( wxT("%d") , value ) ;
if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ;
SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
- value.Printf("%d", m_rangeMin);
+ value.Printf(wxT("%d"), m_rangeMin);
m_macMinimumStatic->SetLabel(value);
}
if(m_macMaximumStatic) {
- value.Printf("%d", m_rangeMax);
+ value.Printf(wxT("%d"), m_rangeMax);
m_macMaximumStatic->SetLabel(value);
}
SetValue(m_rangeMin);
int ht, wd;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &textwidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &wd, &ht);
if(ht > textheight) {
textheight = ht;
int ht;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &minValWidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &maxValWidth, &ht);
if(ht > textheight) {
textheight = ht;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100,
kControlLittleArrowsProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPostControlCreate() ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlSeparatorLineProc , (long) this ) ;
return ret;
}
-const wxString punct = " ,.-;:!?";
+const wxString punct = wxT(" ,.-;:!?");
void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
{
if (paragraph.Length() == 0)
{
// empty line
- dc.GetTextExtent( "H", &width, &height );
+ dc.GetTextExtent( wxT("H"), &width, &height );
y += height;
return;
}
dc.DrawText( paragraph, pos , y) ;
- paragraph="";
+ paragraph=wxEmptyString;
y += height ;
}
}
if (text[i] == 13 || text[i] == 10)
{
DrawParagraph(dc, paragraph,y);
- paragraph = "" ;
+ paragraph = wxEmptyString ;
}
else
{
m_imageList = NULL;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlTabSmallProc , (long) this ) ;
wxString wxTabCtrl::GetItemText(int item) const
{
// TODO
- return wxString("");
+ return wxEmptyString;
}
// Get the item image
kTXNStartOffset,
kTXNEndOffset);
/* set the field's background */
+
tback.bgType = kTXNBackgroundTypeRGB;
tback.bg.color = rgbWhite;
TXNSetBackground( varsp->fTXNRec, &tback);
mySize.y += 2 * m_macVerticalBorder ;
}
*/
- MacPreControlCreate( parent , id , "" , pos , mySize ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , mySize ,style, validator , name , &bounds , title ) ;
if ( m_windowStyle & wxTE_MULTILINE )
{
}
MacPostControlCreate() ;
- wxString value ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- value = wxMacMakeMacStringFromPC( st ) ;
- else
- value = st ;
-
if ( !m_macUsesTXN )
{
- ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ;
}
else
{
/* set up locals */
tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl);
/* set the text in the record */
- TXNSetData( (**tpvars).fTXNRec, kTXNTextData, (void*)value.c_str(), value.Length(),
- kTXNStartOffset, kTXNEndOffset);
m_macTXN = (**tpvars).fTXNRec ;
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN) , kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2,
+ kTXNStartOffset, kTXNEndOffset);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN) , kTXNTextData, (void*)text.data(), strlen( text ) ,
+ kTXNStartOffset, kTXNEndOffset);
+#endif
m_macTXNvars = tpvars ;
m_macUsesTXN = true ;
TXNSetSelection( (TXNObject) m_macTXN, 0, 0);
err = ::GetControlDataSize((ControlHandle) m_macControl, 0,
( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, &actualSize ) ;
- if ( err )
- return wxEmptyString ;
-
- if ( actualSize > 0 )
- {
- wxChar *ptr = result.GetWriteBuf(actualSize) ;
-
+ if ( err )
+ return wxEmptyString ;
+
+ if ( actualSize > 0 )
+ {
+ wxCharBuffer buf(actualSize) ;
::GetControlData( (ControlHandle) m_macControl, 0,
( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag,
- actualSize , ptr , &actualSize ) ;
- ptr[actualSize] = 0 ;
- result.UngetWriteBuf(actualSize) ;
+ actualSize , buf.data() , &actualSize ) ;
+ result = wxMacMakeStringFromCString( buf ) ;
}
-
}
else
{
+#if wxUSE_UNICODE
Handle theText ;
- err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
+ err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNUnicodeTextData );
// all done
if ( err )
{
else
{
actualSize = GetHandleSize( theText ) ;
- if ( actualSize > 0 )
- {
- wxChar *ptr = result.GetWriteBuf(actualSize) ;
- strncpy( ptr , *theText , actualSize ) ;
+ if ( actualSize > 0 )
+ {
+ wxChar *ptr = result.GetWriteBuf(actualSize*sizeof(wxChar)) ;
+ wxStrncpy( ptr , (wxChar*) *theText , actualSize ) ;
ptr[actualSize] = 0 ;
result.UngetWriteBuf( actualSize ) ;
}
DisposeHandle( theText ) ;
}
+#else
+ Handle theText ;
+ err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
+ // all done
+ if ( err )
+ {
+ actualSize = 0 ;
+ }
+ else
+ {
+ actualSize = GetHandleSize( theText ) ;
+ if ( actualSize > 0 )
+ {
+ HLock( theText ) ;
+ result = wxMacMakeStringFromCString( *theText , actualSize ) ;
+ HUnlock( theText ) ;
+ }
+ DisposeHandle( theText ) ;
+ }
+#endif
}
- return wxMacMakeStringFromMacString( result ) ;
+ return result ;
}
void wxTextCtrl::GetSelection(long* from, long* to) const
void wxTextCtrl::SetValue(const wxString& st)
{
- wxString value;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- value = wxMacMakeMacStringFromPC( st ) ;
- // value.Replace( "\n", "\r" ); TODO this should be handled by the conversion
- }
- else
- value = st;
-
-
if ( !m_macUsesTXN )
{
- ::SetControlData((ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ;
}
else
{
bool formerEditable = IsEditable() ;
if ( !formerEditable )
SetEditable(true) ;
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2 ,
+ kTXNStartOffset, kTXNEndOffset);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)text.data(), strlen( text ) ,
kTXNStartOffset, kTXNEndOffset);
+#endif
TXNSetSelection( (TXNObject) m_macTXN, 0, 0);
TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart);
if ( !formerEditable )
if ( style.HasFont() )
{
const wxFont &font = style.GetFont() ;
- CopyCStringToPascal( font.GetFaceName().c_str() , fontName ) ;
+ wxMacStringToPascal( font.GetFaceName() , fontName ) ;
fontSize = font.GetPointSize() ;
if ( font.GetUnderlined() )
fontStyle |= underline ;
{
OSStatus status = TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr,
start,end);
- wxASSERT_MSG( status == noErr , "Couldn't set text attributes" ) ;
+ wxASSERT_MSG( status == noErr , wxT("Couldn't set text attributes") ) ;
}
if ( !formerEditable )
SetEditable(formerEditable) ;
SetEditable(true) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
TXNClear( ((TXNObject) m_macTXN) ) ;
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)value.wc_str(), value.Length() * 2 ,
+ kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#else
TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#endif
if ( !formerEditable )
SetEditable( formerEditable ) ;
}
return FALSE;
}
-void wxTextCtrl::WriteText(const wxString& text)
-{
- wxString value ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- value = wxMacMakeMacStringFromPC( text ) ;
- // value.Replace( "\n", "\r" ); // TODO this should be handled by the conversion
- }
- else
- value = text ;
-
+void wxTextCtrl::WriteText(const wxString& st)
+{
if ( !m_macUsesTXN )
{
- TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TEInsert( text , strlen(text) , ((TEHandle) m_macTE) ) ;
}
else
{
SetEditable(true) ;
long start , end , dummy ;
GetSelection( &start , &dummy ) ;
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*) (const char*)value, value.Length(),
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2 ,
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)text.data(), strlen( text ) ,
+ kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#endif
GetSelection( &dummy , &end ) ;
SetStyle( start , end , GetDefaultStyle() ) ;
if ( !formerEditable )
if (count == lineNo)
{
// Add chars in line then
- wxString tmp("");
+ wxString tmp;
for (size_t j = i; j < content.Length(); j++)
{
}
if (content[i] == '\r') count++;
}
- return "" ;
+ return wxEmptyString ;
}
/*
#endif
if ( !hasThreadManager )
{
- wxMessageBox( "Error" , "Thread Support is not available on this System" , wxOK ) ;
+ wxMessageBox( wxT("Error") , wxT("Thread Support is not available on this System") , wxOK ) ;
return FALSE ;
}
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
*/
ControlHandle container = (ControlHandle) GetParent()->MacGetContainerForEmbedding() ;
- wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
+ wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
::EmbedControl( m_macToolHandle , container ) ;
if ( GetWindowStyleFlag() & wxTB_VERTICAL )
{
return tool->GetShortHelp() ;
}
- return "" ;
+ return wxEmptyString ;
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable)
wxMacToolTip( ) ;
~wxMacToolTip() ;
- void Setup( WindowRef window , wxString text , wxPoint localPosition ) ;
+ void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ;
long GetMark() { return m_mark ; }
void Draw() ;
void Clear() ;
bool m_shown ;
long m_mark ;
wxMacToolTipTimer* m_timer ;
-#ifdef TARGET_CARBON
- CFStringRef m_helpTextRef ;
+#if TARGET_CARBON
+ wxMacCFStringHolder m_helpTextRef ;
#endif
} ;
m_mark = 0 ;
m_shown = false ;
m_timer = NULL ;
- m_helpTextRef = NULL ;
}
-void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
+void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition )
{
m_mark++ ;
Clear() ;
m_position = localPosition ;
- if( wxApp::s_macDefaultEncodingIsPC )
- m_label = wxMacMakeMacStringFromPC( text ) ;
- else
- m_label = text ;
+ m_label = text ;
m_window =win;
s_ToolTipWindowRef = m_window ;
m_backpict = NULL ;
{
m_shown = true ;
#if TARGET_CARBON
- if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
- {
- HMHelpContentRec tag ;
- tag.version = kMacHelpVersion;
- SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
- GrafPtr port ;
- GetPort( &port ) ;
- SetPortWindowPort(m_window) ;
- LocalToGlobal( (Point *) &tag.absHotRect.top );
- LocalToGlobal( (Point *) &tag.absHotRect.bottom );
- SetPort( port );
- if( m_helpTextRef )
- {
- CFRelease( m_helpTextRef ) ;
- m_helpTextRef = NULL ;
- }
- m_helpTextRef = wxMacCreateCFString(m_label) ;
- tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
- tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
- tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
- tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ;
- tag.tagSide = kHMDefaultSide;
- HMDisplayTag( &tag );
- }
- else
-#endif
+ HMHelpContentRec tag ;
+ tag.version = kMacHelpVersion;
+ SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
+ GrafPtr port ;
+ GetPort( &port ) ;
+ SetPortWindowPort(m_window) ;
+ LocalToGlobal( (Point *) &tag.absHotRect.top );
+ LocalToGlobal( (Point *) &tag.absHotRect.bottom );
+ SetPort( port );
+ m_helpTextRef = m_label ;
+ tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
+ tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
+ tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
+ tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ;
+ tag.tagSide = kHMDefaultSide;
+ HMDisplayTag( &tag );
+#else
+ wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
+ FontFamilyID fontId ;
+ Str255 fontName ;
+ SInt16 fontSize ;
+ Style fontStyle ;
+ GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
+ GetFNum( fontName, &fontId );
+
+ TextFont( fontId ) ;
+ TextSize( fontSize ) ;
+ TextFace( fontStyle ) ;
+ FontInfo fontInfo;
+ ::GetFontInfo(&fontInfo);
+ short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading;
+ short height = 0 ;
+ // short width = TextWidth( m_label , 0 ,m_label.Length() ) ;
+
+ int i = 0 ;
+ int length = m_label.Length() ;
+ int width = 0 ;
+ int thiswidth = 0 ;
+ int laststop = 0 ;
+ wxCharBuffer text = wxMacStringToCString( m_label ) ;
+
+ while( i < length )
{
- wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
-#if TARGET_CARBON
- bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
-#endif
-
- FontFamilyID fontId ;
- Str255 fontName ;
- SInt16 fontSize ;
- Style fontStyle ;
- GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
- GetFNum( fontName, &fontId );
-
- TextFont( fontId ) ;
- TextSize( fontSize ) ;
- TextFace( fontStyle ) ;
- FontInfo fontInfo;
- ::GetFontInfo(&fontInfo);
- short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading;
- short height = 0 ;
- // short width = TextWidth( m_label , 0 ,m_label.Length() ) ;
-
- int i = 0 ;
- int length = m_label.Length() ;
- int width = 0 ;
- int thiswidth = 0 ;
- int laststop = 0 ;
- const char *text = m_label ;
- while( i < length )
- {
- if( text[i] == 13 || text[i] == 10)
- {
- thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
- if ( thiswidth > width )
- width = thiswidth ;
-
- height += lineh ;
- laststop = i+1 ;
- }
- i++ ;
- }
- if ( i - laststop > 0 )
+ if( text[i] == 13 || text[i] == 10)
{
thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
if ( thiswidth > width )
width = thiswidth ;
+
height += lineh ;
+ laststop = i+1 ;
}
-
-
- m_rect.left = m_position.x + kTipOffset;
- m_rect.top = m_position.y + kTipOffset;
- m_rect.right = m_rect.left + width + 2 * kTipBorder;
-#if TARGET_CARBON
- if ( useDrawThemeText )
- m_rect.right += kTipBorder ;
-#endif
- m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
- Rect r ;
- GetPortBounds( GetWindowPort( m_window ) , &r ) ;
- if ( m_rect.top < 0 )
- {
- m_rect.bottom += -m_rect.top ;
- m_rect.top = 0 ;
- }
- if ( m_rect.left < 0 )
- {
- m_rect.right += -m_rect.left ;
- m_rect.left = 0 ;
- }
- if ( m_rect.right > r.right )
- {
- m_rect.left -= (m_rect.right - r.right ) ;
- m_rect.right = r.right ;
- }
- if ( m_rect.bottom > r.bottom )
- {
- m_rect.top -= (m_rect.bottom - r.bottom) ;
- m_rect.bottom = r.bottom ;
- }
- ClipRect( &m_rect ) ;
- BackColor( whiteColor ) ;
- ForeColor(blackColor ) ;
- GWorldPtr port ;
- NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ;
- CGrafPtr origPort ;
- GDHandle origDevice ;
-
- GetGWorld( &origPort , &origDevice ) ;
- SetGWorld( port , NULL ) ;
-
- m_backpict = OpenPicture(&m_rect);
-
- CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)),
- GetPortBitMapForCopyBits(port),
- &m_rect,
- &m_rect,
- srcCopy,
- NULL);
- ClosePicture();
- SetGWorld( origPort , origDevice ) ;
- DisposeGWorld( port ) ;
- PenNormal() ;
-
- RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ;
- BackColor( whiteColor ) ;
- RGBForeColor( &tooltipbackground ) ;
-
- PaintRect( &m_rect ) ;
- ForeColor(blackColor ) ;
- FrameRect( &m_rect ) ;
- SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ;
- ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
-
- i = 0 ;
- laststop = 0 ;
- height = 0 ;
-
- while( i < length )
- {
- if( text[i] == 13 || text[i] == 10)
- {
-#if TARGET_CARBON
- if ( useDrawThemeText )
- {
- Rect frame ;
- frame.top = m_rect.top + kTipBorder + height ;
- frame.left = m_rect.left + kTipBorder ;
- frame.bottom = frame.top + 1000 ;
- frame.right = frame.left + 1000 ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- true,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- height += lineh ;
- }
- else
-#endif
- {
- ::DrawText( text , laststop , i - laststop ) ;
- height += lineh ;
- ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height );
- }
- laststop = i+1 ;
- }
- i++ ;
- }
-#if TARGET_CARBON
- if ( useDrawThemeText )
- {
- Rect frame ;
- frame.top = m_rect.top + kTipBorder + height ;
- frame.left = m_rect.left + kTipBorder ;
- frame.bottom = frame.top + 1000 ;
- frame.right = frame.left + 1000 ;
- CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- true,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- }
- else
-#endif
+ i++ ;
+ }
+ if ( i - laststop > 0 )
+ {
+ thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
+ if ( thiswidth > width )
+ width = thiswidth ;
+ height += lineh ;
+ }
+
+ m_rect.left = m_position.x + kTipOffset;
+ m_rect.top = m_position.y + kTipOffset;
+ m_rect.right = m_rect.left + width + 2 * kTipBorder;
+
+ m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
+ Rect r ;
+ GetPortBounds( GetWindowPort( m_window ) , &r ) ;
+ if ( m_rect.top < 0 )
+ {
+ m_rect.bottom += -m_rect.top ;
+ m_rect.top = 0 ;
+ }
+ if ( m_rect.left < 0 )
+ {
+ m_rect.right += -m_rect.left ;
+ m_rect.left = 0 ;
+ }
+ if ( m_rect.right > r.right )
+ {
+ m_rect.left -= (m_rect.right - r.right ) ;
+ m_rect.right = r.right ;
+ }
+ if ( m_rect.bottom > r.bottom )
+ {
+ m_rect.top -= (m_rect.bottom - r.bottom) ;
+ m_rect.bottom = r.bottom ;
+ }
+ ClipRect( &m_rect ) ;
+ BackColor( whiteColor ) ;
+ ForeColor(blackColor ) ;
+ GWorldPtr port ;
+ NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ;
+ CGrafPtr origPort ;
+ GDHandle origDevice ;
+
+ GetGWorld( &origPort , &origDevice ) ;
+ SetGWorld( port , NULL ) ;
+
+ m_backpict = OpenPicture(&m_rect);
+
+ CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)),
+ GetPortBitMapForCopyBits(port),
+ &m_rect,
+ &m_rect,
+ srcCopy,
+ NULL);
+ ClosePicture();
+ SetGWorld( origPort , origDevice ) ;
+ DisposeGWorld( port ) ;
+ PenNormal() ;
+
+ RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ;
+ BackColor( whiteColor ) ;
+ RGBForeColor( &tooltipbackground ) ;
+
+ PaintRect( &m_rect ) ;
+ ForeColor(blackColor ) ;
+ FrameRect( &m_rect ) ;
+ SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ;
+ ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
+
+ i = 0 ;
+ laststop = 0 ;
+ height = 0 ;
+
+ while( i < length )
+ {
+ if( text[i] == 13 || text[i] == 10)
{
::DrawText( text , laststop , i - laststop ) ;
+ height += lineh ;
+ ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height );
+ laststop = i+1 ;
}
- ::TextMode( srcOr ) ;
- }
+ i++ ;
+ }
+ ::DrawText( text , laststop , i - laststop ) ;
+ ::TextMode( srcOr ) ;
+#endif
}
}
return ;
#if TARGET_CARBON
HMHideTag() ;
- if( m_helpTextRef )
- {
- CFRelease( m_helpTextRef ) ;
- m_helpTextRef = NULL ;
- }
+ m_helpTextRef.Release() ;
#else
if ( m_window == s_ToolTipWindowRef && m_backpict )
{
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( inWindowRef != (WindowRef) NULL, "attempt to add a NULL WindowRef to window list" );
+ wxCHECK_RET( inWindowRef != (WindowRef) NULL, wxT("attempt to add a NULL WindowRef to window list") );
if ( !wxWinMacWindowList->Find((long)inWindowRef) )
wxWinMacWindowList->Append((long)inWindowRef, win);
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
wxAssociateWinWithMacWindow( m_macWindow , this ) ;
- wxString label ;
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( title ) ;
- else
- label = title ;
- UMASetWTitleC( (WindowRef)m_macWindow , label ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title ) ;
::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ;
#if TARGET_CARBON
InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
wxWindow::SetTitle( title ) ;
-
- wxString label ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( m_label ) ;
- else
- label = m_label ;
-
- UMASetWTitleC( (WindowRef)m_macWindow , label ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title ) ;
}
bool wxTopLevelWindowMac::Show(bool show)
wxString str = wxStripMenuCodes( title ) ;
MenuRef menu ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
CreateNewMenu( id , 0 , &menu ) ;
- SetMenuTitleWithCFString( menu , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
- SetMenuTitleWithCFString( menu , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
- SetMenuItemTextWithCFString( menu , item , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
DisposeWindow( inWindowRef ) ;
}
-void UMASetWTitleC( WindowRef inWindowRef , const char *title )
+void UMASetWTitle( WindowRef inWindowRef , const wxString& title )
{
- Str255 ptitle ;
- strncpy( (char*)ptitle , title , 96 ) ;
- ptitle[96] = 0 ;
#if TARGET_CARBON
- c2pstrcpy( ptitle, (char *)ptitle ) ;
+ SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title) ) ;
#else
- c2pstr( (char*)ptitle ) ;
-#endif
+ Str255 ptitle ;
+ wxMacStringToPascal( title , ptitle ) ;
SetWTitle( inWindowRef , ptitle ) ;
+#endif
}
void UMAGetWTitleC( WindowRef inWindowRef , char *title )
// appearance additions
+void UMASetControlTitle( ControlHandle inControl , const wxString& title )
+{
+#if TARGET_CARBON
+ SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title) ) ;
+#else
+ Str255 ptitle ;
+ wxMacStringToPascal( title , ptitle ) ;
+ SetControlTitle( inControl , ptitle ) ;
+#endif
+}
+
void UMAActivateControl( ControlHandle inControl )
{
// we have to add the control after again to the update rgn
{
GetPort( &m_oldPort ) ;
SetPort( newport ) ;
- wxASSERT_MSG( m_clip == NULL , "Cannot call setup twice" ) ;
+ wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ;
m_clip = NewRgn() ;
GetClip( m_clip );
m_textFont = GetPortTextFont( (CGrafPtr) newport);
#include <Sound.h>
#endif
+#include "ATSUnicode.h"
+#include "TextCommon.h"
+#include "TextEncodingConverter.h"
+
#ifndef __DARWIN__
// defined in unix/utilsunx.cpp for Mac OS X
}
// Get hostname only (without domain name)
-bool wxGetHostName(char *buf, int maxSize)
+bool wxGetHostName(wxChar *buf, int maxSize)
{
// Gets Chooser name of user by examining a System resource.
if (chooserName && *chooserName)
{
- int length = (*chooserName)[0] ;
- if ( length + 1 > maxSize )
- {
- length = maxSize - 1 ;
- }
- strncpy( buf , (char*) &(*chooserName)[1] , length ) ;
- buf[length] = 0 ;
+ HLock( (Handle) chooserName ) ;
+ wxString name = wxMacMakeStringFromPascal( *chooserName ) ;
+ HUnlock( (Handle) chooserName ) ;
+ ReleaseResource( (Handle) chooserName ) ;
+ wxStrncpy( buf , name , maxSize - 1 ) ;
}
else
buf[0] = 0 ;
}
// Get user ID e.g. jacs
-bool wxGetUserId(char *buf, int maxSize)
+bool wxGetUserId(wxChar *buf, int maxSize)
{
return wxGetUserName( buf , maxSize ) ;
}
}
// Get user name e.g. Stefan Csomor
-bool wxGetUserName(char *buf, int maxSize)
+bool wxGetUserName(wxChar *buf, int maxSize)
{
// Gets Chooser name of user by examining a System resource.
if (chooserName && *chooserName)
{
- int length = (*chooserName)[0] ;
- if ( length + 1 > maxSize )
- {
- length = maxSize - 1 ;
- }
- strncpy( buf , (char*) &(*chooserName)[1] , length ) ;
- buf[length] = 0 ;
+ HLock( (Handle) chooserName ) ;
+ wxString name = wxMacMakeStringFromPascal( *chooserName ) ;
+ HUnlock( (Handle) chooserName ) ;
+ ReleaseResource( (Handle) chooserName ) ;
+ wxStrncpy( buf , name , maxSize - 1 ) ;
}
else
buf[0] = 0 ;
bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%.4f", value);
+ wxString buf;
+ buf.Printf(wxT("%.4f"), value);
+
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%ld", value);
+ wxString buf;
+ buf.Printf(wxT("%ld"), value);
+
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%d", value);
+ wxString buf;
+ buf.Printf(wxT("%d"), value);
+
return wxWriteResource(section, entry, buf, file);
}
}
#ifndef __DARWIN__
-char *wxGetUserHome (const wxString& user)
+wxChar *wxGetUserHome (const wxString& user)
{
// TODO
return NULL;
p = p.Mid(1,pos) ;
}
- p = p + ":" ;
+ p = p + wxT(":") ;
Str255 volumeName ;
XVolumeParam pb ;
// use configure generated description if available
return wxString("MacOS (") + WXWIN_OS_DESCRIPTION + wxString(")");
#else
- return "MacOS" ; //TODO:define further
+ return wxT("MacOS") ; //TODO:define further
#endif
}
}
}
-wxString wxMacMakeMacStringFromPC( const char * p )
+TECObjectRef s_TECNativeCToUnicode = NULL ;
+TECObjectRef s_TECUnicodeToNativeC = NULL ;
+TECObjectRef s_TECPCToNativeC = NULL ;
+TECObjectRef s_TECNativeCToPC = NULL ;
+void wxMacSetupConverters()
{
+ // if we assume errors are happening here we need low level debugging since the high level assert will use the encoders that
+ // are not yet setup...
+
+ OSStatus status = noErr ;
+ status = TECCreateConverter(&s_TECNativeCToUnicode,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
+
+
+ status = TECCreateConverter(&s_TECUnicodeToNativeC,
+ kTextEncodingUnicodeDefault, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman);
+
+ if ( !wxApp::s_macDefaultEncodingIsPC )
+ {
+ status = TECCreateConverter(&s_TECPCToNativeC,
+ kTextEncodingWindowsLatin1, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman);
+
+
+ status = TECCreateConverter(&s_TECNativeCToPC,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman , kTextEncodingWindowsLatin1 );
+ }
+}
+
+void wxMacCleanupConverters()
+{
+ OSStatus status = noErr ;
+ status = TECDisposeConverter(s_TECNativeCToUnicode);
+
+ status = TECDisposeConverter(s_TECUnicodeToNativeC);
+
+ status = TECDisposeConverter(s_TECPCToNativeC);
+
+ status = TECDisposeConverter(s_TECNativeCToPC);
+}
+
+wxWCharBuffer wxMacStringToWString( const wxString &from )
+{
+#if wxUSE_UNICODE
+ wxWCharBuffer result( from.wc_str() ) ;
+#else
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() ;
+ ByteCount byteBufferLen = byteInLen *2 ;
+ wxWCharBuffer result( from.Length() ) ;
+ status = TECConvertText(s_TECNativeCToUnicode, (ConstTextPtr)from.c_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ result.data()[byteOutLen/2] = 0 ;
+#endif
+ return result ;
+}
+
+wxString wxMacMakeStringFromCString( const char * from , int len )
+{
+ OSStatus status = noErr ;
wxString result ;
- int len = strlen ( p ) ;
+ wxChar* buf = result.GetWriteBuf( len ) ;
+#if wxUSE_UNICODE
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = len ;
+ ByteCount byteBufferLen = len *2 ;
+
+ status = TECConvertText(s_TECNativeCToUnicode, (ConstTextPtr)from , byteInLen, &byteInLen,
+ (TextPtr)buf, byteBufferLen, &byteOutLen);
+#else
+ if ( wxApp::s_macDefaultEncodingIsPC )
+ memcpy( buf , from , len ) ;
+ else
+ {
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = len ;
+ ByteCount byteBufferLen = byteInLen ;
+
+ status = TECConvertText(s_TECNativeCToPC, (ConstTextPtr)from , byteInLen, &byteInLen,
+ (TextPtr)buf, byteBufferLen, &byteOutLen);
+ }
+#endif
+ buf[len] = 0 ;
+ result.UngetWriteBuf() ;
+ return result ;
+}
+
+wxString wxMacMakeStringFromCString( const char * from )
+{
+ return wxMacMakeStringFromCString( from , strlen(from) ) ;
+}
+
+wxCharBuffer wxMacStringToCString( const wxString &from )
+{
+#if wxUSE_UNICODE
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() * 2 ;
+ ByteCount byteBufferLen = from.Length() ;
+ wxCharBuffer result( from.Length() ) ;
+ status = TECConvertText(s_TECUnicodeToNativeC , (ConstTextPtr)from.wc_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ return result ;
+#else
+ if ( wxApp::s_macDefaultEncodingIsPC )
+ return wxCharBuffer( from.c_str() ) ;
+ else
+ {
+ wxCharBuffer result( from.Length() ) ;
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() ;
+ ByteCount byteBufferLen = byteInLen ;
+
+ status = TECConvertText(s_TECPCToNativeC, (ConstTextPtr)from.c_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ return result ;
+ }
+#endif
+}
+
+void wxMacStringToPascal( const wxString&from , StringPtr to )
+{
+ wxCharBuffer buf = wxMacStringToCString( from ) ;
+ int len = strlen(buf) ;
+
+ if ( len > 255 )
+ len = 255 ;
+ to[0] = len ;
+ memcpy( (char*) &to[1] , buf , len ) ;
+}
+
+wxString wxMacMakeStringFromPascal( ConstStringPtr from )
+{
+ return wxMacMakeStringFromCString( (char*) &from[1] , from[0] ) ;
+}
+
+//
+// CFStringRefs (Carbon only)
+//
+
+#if TARGET_CARBON
+// converts this string into a carbon foundation string with optional pc 2 mac encoding
+void wxMacCFStringHolder::Assign( const wxString &str )
+{
+#if wxUSE_UNICODE
+ m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault,
+ (const unsigned short*)str.wc_str(), str.Len() );
+#else
+ m_cfs = CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
+ wxApp::s_macDefaultEncodingIsPC ?
+ kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
+#endif
+ m_release = true ;
+}
+
+wxString wxMacCFStringHolder::AsString()
+{
+ wxString result ;
+ Size len = CFStringGetLength( m_cfs ) ;
+ wxChar* buf = result.GetWriteBuf( len ) ;
+#if wxUSE_UNICODE
+ CFStringGetCharacters( m_cfs , CFRangeMake( 0 , len ) , (UniChar*) buf ) ;
+#else
+ CFStringGetCString( m_cfs , buf , len+1 , s_macDefaultEncodingIsPC ?
+ kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
+#endif
+ buf[len] = 0 ;
+ result.UngetWriteBuf() ;
+ return result ;
+}
+
+#if 0
+
+wxString wxMacMakeMacStringFromPC( const wxChar * p )
+{
+ wxString result ;
+ int len = wxStrlen ( p ) ;
if ( len > 0 )
{
wxChar* ptr = result.GetWriteBuf(len) ;
return result ;
}
-wxString wxMacMakePCStringFromMac( const char * p )
+wxString wxMacMakePCStringFromMac( const wxChar * p )
{
wxString result ;
- int len = strlen ( p ) ;
+ int len = wxStrlen ( p ) ;
if ( len > 0 )
{
wxChar* ptr = result.GetWriteBuf(len) ;
return result ;
}
-wxString wxMacMakeStringFromMacString( const char* from , bool mac2pcEncoding )
+wxString wxMacMakeStringFromMacString( const wxChar* from , bool mac2pcEncoding )
{
if (mac2pcEncoding)
{
}
}
-void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding )
+void wxMacStringToPascal( const wxChar * from , StringPtr to , bool pc2macEncoding )
{
if (pc2macEncoding)
{
CopyCStringToPascal( from , to ) ;
}
}
+#endif
-//
-// CFStringRefs (Carbon only)
-//
-
-#if TARGET_CARBON
-// converts this string into a carbon foundation string with optional pc 2 mac encoding
-CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding )
-{
- return CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
- pc2macEncoding ?
- kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
-}
#endif //TARGET_CARBON
//don't know what to do with looped, wth
bool wxWave::Play(bool async, bool looped) const
{
- char lpSnd[32];
bool ret = false;
if (m_isResource)
{
-#if TARGET_CARBON
- c2pstrcpy((unsigned char *)lpSnd, m_sndname);
-#else
- strcpy(lpSnd, m_sndname);
- c2pstr((char *) lpSnd);
-#endif
- SndListHandle hSnd;
+ Str255 snd ;
+ wxMacStringToPascal( m_sndname , snd ) ;
+ SndListHandle hSnd;
- hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
+ hSnd = (SndListHandle) GetNamedResource('snd ', snd);
- if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
- ret = true;
+ if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
+ ret = true;
}
return ret;
{
return m_tooltip->GetTip() ;
}
- return "" ;
+ return wxEmptyString ;
}
void wxWindowMac::Update()
iter = iter->GetParent() ;
}
- wxASSERT_MSG( 1 , "No valid mac root window" ) ;
+ wxASSERT_MSG( 1 , wxT("No valid mac root window") ) ;
return NULL ;
}
void wxWindowMac::MacCreateScrollBars( long style )
{
- wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , "attempt to create window twice" ) ;
+ wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ;
bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ;
int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
ListDefSpec listDef;
listDef.defType = kListDefUserProcType;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
void wxChoice::DoSetItemClientData( int n, void* clientData )
{
wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(),
- "invalid index in wxChoice::SetClientData" );
+ wxT("invalid index in wxChoice::SetClientData") );
m_datas[n] = (char*) clientData ;
}
void *wxChoice::DoGetItemClientData(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
- "invalid index in wxChoice::GetClientData" );
+ wxT("invalid index in wxChoice::GetClientData") );
return (void *)m_datas[n];
}
case wxDF_TEXT:
break;
+ case wxDF_UNICODETEXT:
+ break;
case wxDF_BITMAP :
case wxDF_METAFILE :
break ;
{
if (( err = GetScrapFlavorSize( scrapRef, dataFormat.GetFormatId(), &byteCount )) == noErr)
{
- if ( dataFormat.GetType() == wxDF_TEXT )
- byteCount++ ;
+ Size allocSize = byteCount ;
+ if ( dataFormat.GetType() == wxDF_TEXT )
+ allocSize += 1 ;
+ else if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ allocSize += 2 ;
- data = new char[ byteCount ] ;
+ data = new char[ allocSize ] ;
+
if (( err = GetScrapFlavorData( scrapRef, dataFormat.GetFormatId(), &byteCount , data )) == noErr )
{
- *len = byteCount ;
+ *len = allocSize ;
if ( dataFormat.GetType() == wxDF_TEXT )
((char*)data)[byteCount] = 0 ;
+ if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ ((wxChar*)data)[byteCount/2] = 0 ;
}
else
{
if ( GetHandleSize( datahandle ) > 0 )
{
byteCount = GetHandleSize( datahandle ) ;
+ Size allocSize = byteCount ;
if ( dataFormat.GetType() == wxDF_TEXT )
- data = new char[ byteCount + 1] ;
- else
- data = new char[ byteCount ] ;
-
+ allocSize += 1 ;
+ else if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ allocSize += 2 ;
+
+ data = new char[ allocSize ] ;
+
memcpy( (char*) data , (char*) *datahandle , byteCount ) ;
if ( dataFormat.GetType() == wxDF_TEXT )
((char*)data)[byteCount] = 0 ;
+ if ( dataFormat.GetType() == wxDF_UNICODETEXT )
+ ((wxChar*)data)[byteCount/2] = 0 ;
*len = byteCount ;
}
DisposeHandle( datahandle ) ;
return NULL ;
}
+
if ( dataFormat.GetType() == wxDF_TEXT && wxApp::s_macDefaultEncodingIsPC )
{
- wxMacConvertToPC((char*)data,(char*)data,byteCount) ;
+ wxString st = wxMacMakeStringFromCString( (char*) data ) ;
+#if wxUSE_UNICODE
+ wxCharBuffer buf = st.ToAscii() ;
+#else
+ char* buf = st ;
+#endif
+ char* newdata = new char[strlen(buf)+1] ;
+ memcpy( newdata , buf , strlen(buf)+1 ) ;
+ delete[] ((char*) data ) ;
+ data = newdata ;
}
+
return data;
}
{
wxTextDataObject* textDataObject = (wxTextDataObject*) data;
wxString str(textDataObject->GetText());
- wxString mac ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- mac = wxMacMakeMacStringFromPC(textDataObject->GetText()) ;
- }
- else
- {
- mac = textDataObject->GetText() ;
- }
- err = UMAPutScrap( mac.Length() , 'TEXT' , (void*) mac.c_str() ) ;
+ wxCharBuffer buf = wxMacStringToCString( str ) ;
+ err = UMAPutScrap( strlen(buf) , kScrapFlavorTypeText , (void*) buf.data() ) ;
}
break ;
-
+#if wxUSE_UNICODE
+ case wxDF_UNICODETEXT :
+ {
+ wxTextDataObject* textDataObject = (wxTextDataObject*) data;
+ wxString str(textDataObject->GetText());
+ err = UMAPutScrap( str.Length() * sizeof(wxChar) , kScrapFlavorTypeUnicode , (void*) str.wc_str() ) ;
+ }
+ break ;
+#endif
#if wxUSE_DRAG_AND_DROP
case wxDF_METAFILE:
{
wxMetafile metaFile = metaFileDataObject->GetMetafile();
PicHandle pict = (PicHandle) metaFile.GetHMETAFILE() ;
HLock( (Handle) pict ) ;
- err = UMAPutScrap( GetHandleSize( (Handle) pict ) , 'PICT' , *pict ) ;
+ err = UMAPutScrap( GetHandleSize( (Handle) pict ) , kScrapFlavorTypePicture , *pict ) ;
HUnlock( (Handle) pict ) ;
}
break ;
pict = (PicHandle) bitmapDataObject->GetBitmap().GetPict( &created ) ;
HLock( (Handle) pict ) ;
- err = UMAPutScrap( GetHandleSize( (Handle) pict ) , 'PICT' , *pict ) ;
+ err = UMAPutScrap( GetHandleSize( (Handle) pict ) , kScrapFlavorTypePicture , *pict ) ;
HUnlock( (Handle) pict ) ;
if ( created )
KillPicture( pict ) ;
if (sel > -1)
return wxString(this->GetString (sel));
else
- return wxString("");
+ return wxEmptyString;
}
bool wxComboBox::SetStringSelection(const wxString& sel)
{
m_label = wxStripMenuCodes(title) ;
- if ( (ControlHandle) m_macControl )
+ if ( m_macControl )
{
- Str255 maclabel ;
- wxString label ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( m_label ) ;
- else
- label = m_label ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) maclabel , label ) ;
-#else
- strcpy( (char *) maclabel , label ) ;
- c2pstr( (char *) maclabel ) ;
-#endif
- ::SetControlTitle( (ControlHandle) m_macControl , maclabel ) ;
+ UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ;
}
Refresh() ;
}
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( inControl != (ControlHandle) NULL, "attempt to add a NULL WindowRef to window list" );
+ wxCHECK_RET( inControl != (ControlHandle) NULL, wxT("attempt to add a NULL WindowRef to window list") );
if ( !wxWinMacControlList->Find((long)inControl) )
wxWinMacControlList->Append((long)inControl, control);
void wxControl::MacPostControlCreate()
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
{
SetSize(pos.x, pos.y, new_size.x, new_size.y);
+#if wxUSE_UNICODE
+ UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ;
+#endif
+
UMAShowControl( (ControlHandle) m_macControl ) ;
SetCursor( *wxSTANDARD_CURSOR ) ;
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
}
if ( flags == wxBITMAP_TYPE_MACCURSOR_RESOURCE )
{
Str255 theName ;
-
- #if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , cursor_file ) ;
- #else
- strcpy( (char *) theName , cursor_file ) ;
- c2pstr( (char *) theName ) ;
- #endif
+ wxMacStringToPascal( cursor_file , theName ) ;
wxStAppResource resload ;
Handle resHandle = ::GetNamedResource( 'crsr' , theName ) ;
///////////////////////////////////////////////////////////////////////////////
-// Name: os2/dataobj.cpp
-// Purpose: implementation of wx[I]DataObject class
-// Author: David Webster
+// Name: mac/dataobj.cpp
+// Purpose: implementation of wxDataObject class
+// Author: Stefan Csomor
// Modified by:
// Created: 10/21/99
// RCS-ID: $Id$
-// Copyright: (c) 1999 David Webster
+// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/mstream.h"
#include "wx/image.h"
#include "wx/mac/private.h"
+#include "Scrap.h"
// ----------------------------------------------------------------------------
// functions
{
m_type = Type;
- if (m_type == wxDF_TEXT)
- m_format = 'TEXT';
+ if (m_type == wxDF_TEXT )
+ m_format = kScrapFlavorTypeText;
+ else if (m_type == wxDF_UNICODETEXT )
+ m_format = kScrapFlavorTypeUnicode ;
else if (m_type == wxDF_BITMAP || m_type == wxDF_METAFILE )
- m_format = 'PICT';
+ m_format = kScrapFlavorTypePicture;
else if (m_type == wxDF_FILENAME)
m_format = kDragFlavorTypeHFS ;
else
wxString wxDataFormat::GetId() const
{
- wxString sRet(""); // TODO: to name of ( m_format ) );
- return sRet;
+ char text[5] ;
+ strncpy( text , (char*) m_format , 4 ) ;
+ text[4] = 0 ;
+ return wxString::FromAscii( text ) ;
}
void wxDataFormat::SetId( NativeFormat format )
{
m_format = format;
- if (m_format == 'TEXT')
+ if (m_format == kScrapFlavorTypeText)
m_type = wxDF_TEXT;
else
- if (m_format == 'PICT')
+ if (m_format == kScrapFlavorTypeUnicode )
+ m_type = wxDF_UNICODETEXT;
+ else
+ if (m_format == kScrapFlavorTypePicture)
m_type = wxDF_BITMAP;
else
if (m_format == kDragFlavorTypeHFS )
{
m_filenames.Empty();
- wxString sFile( (const char *)pBuf); /* char, not wxChar */
-
- AddFile(sFile);
+ AddFile(wxString::FromAscii((char*)pBuf));
return TRUE;
}
}
if ( mode == kUnsupportedMode )
{
- wxFAIL_MSG("unsupported blitting mode" );
+ wxFAIL_MSG(wxT("unsupported blitting mode" ));
return FALSE ;
}
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
}
if ( str.Length() == 0 )
return ;
+
wxMacPortSetter helper(this) ;
MacInstallFont() ;
- wxString text ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- text = wxMacMakeMacStringFromPC( str ) ;
- }
- else
- {
- text = str ;
- }
+
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
if ( 0 )
{
m_macAliasWasEnabled = true ;
}
OSStatus status = noErr ;
+ ATSUTextLayout atsuLayout ;
+ UniCharCount chars = str.Length() ;
+#if wxUSE_UNICODE
+ status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) (const wxChar*) str , 0 , str.Length() , str.Length() , 1 ,
+ &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
+#else
TECObjectRef ec;
- status = TECCreateConverter(&ec, kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
- wxASSERT_MSG( status == noErr , "couldn't start converter" ) ;
+ status = TECCreateConverter(&ec,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
+
+ wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ;
ByteCount byteOutLen ;
- ByteCount byteInLen = text.Length() ;
+ ByteCount byteInLen = str.Length() ;
ByteCount byteBufferLen = byteInLen *2 ;
char* buf = new char[byteBufferLen] ;
- status = TECConvertText(ec, (ConstTextPtr)text.c_str() , byteInLen, &byteInLen,
+ status = TECConvertText(ec, (ConstTextPtr)str.c_str() , byteInLen, &byteInLen,
(TextPtr)buf, byteBufferLen, &byteOutLen);
- wxASSERT_MSG( status == noErr , "couldn't convert text" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't convert text") ) ;
status = TECDisposeConverter(ec);
- wxASSERT_MSG( status == noErr , "couldn't dispose converter" ) ;
- ATSUTextLayout atsuLayout ;
- UniCharCount chars = byteOutLen / 2 ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't dispose converter") ) ;
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) buf , 0 , byteOutLen / 2 , byteOutLen / 2 , 1 ,
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
- wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" );
+#endif
+ wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") );
int iAngle = int( angle );
int drawX = XLOG2DEVMAC(x) ;
int drawY = YLOG2DEVMAC(y) ;
drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ;
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) );
- wxASSERT_MSG( status == noErr , "couldn't draw the rotated text" );
+ wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") );
Rect rect ;
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) , &rect );
- wxASSERT_MSG( status == noErr , "couldn't measure the rotated text" );
+ wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") );
OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ;
CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) );
CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) );
::ATSUDisposeTextLayout(atsuLayout);
+#if wxUSE_UNICODE
+#else
delete[] buf ;
+#endif
}
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{
::TextMode( srcCopy ) ;
}
- const char *text = NULL ;
- int length = 0 ;
- wxString macText ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- macText = wxMacMakeMacStringFromPC( strtext ) ;
- text = macText ;
- length = macText.Length() ;
- }
- else
- {
- text = strtext ;
- length = strtext.Length() ;
- }
+ int length = strtext.Length() ;
+
int laststop = 0 ;
int i = 0 ;
int line = 0 ;
{
while( i < length )
{
- if( text[i] == 13 || text[i] == 10)
+ if( strtext[i] == 13 || strtext[i] == 10)
{
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useDrawThemeText )
{
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
Point bounds={0,0} ;
&frame,
teJustLeft,
nil );
- CFRelease( mString ) ;
line++ ;
}
else
#endif
{
- ::DrawText( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ ::DrawText( text , 0 , strlen(text) ) ;
line++ ;
::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
}
}
i++ ;
}
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useDrawThemeText )
{
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
- CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
+ wxMacCFStringHolder mString( linetext ) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
&frame,
teJustLeft,
nil );
- CFRelease( mString ) ;
}
else
#endif
{
- ::DrawText( text , laststop , i - laststop ) ;
- }
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ ::DrawText( text , 0 , strlen(text) ) ;
+ }
}
::TextMode( srcOr ) ;
}
return true ;
}
-void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
+void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading ,
wxFont *theFont ) const
{
*descent =YDEV2LOGREL( fi.descent );
if ( externalLeading )
*externalLeading = YDEV2LOGREL( fi.leading ) ;
+ int length = strtext.Length() ;
+ /*
const char *text = NULL ;
- int length = 0 ;
wxString macText ;
if ( wxApp::s_macDefaultEncodingIsPC )
{
text = string ;
length = string.Length() ;
}
+ */
int laststop = 0 ;
int i = 0 ;
int curwidth = 0 ;
*width = 0 ;
while( i < length )
{
- if( text[i] == 13 || text[i] == 10)
+ if( strtext[i] == 13 || strtext[i] == 10)
{
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
if ( height )
*height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ;
#if TARGET_CARBON
{
Point bounds={0,0} ;
SInt16 baseline ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
false,
&bounds,
&baseline );
- CFRelease( mString ) ;
curwidth = bounds.h ;
}
else
#endif
{
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
i++ ;
}
+ wxString linetext = strtext.Mid( laststop , i - laststop ) ;
#if TARGET_CARBON
if ( useGetThemeText )
{
Point bounds={0,0} ;
SInt16 baseline ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ wxMacCFStringHolder mString( linetext ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
false,
&bounds,
&baseline );
- CFRelease( mString ) ;
curwidth = bounds.h ;
}
else
#endif
{
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ wxCharBuffer text = wxMacStringToCString(linetext) ;
+ curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
if ( curwidth > *width )
*width = XDEV2LOGREL( curwidth ) ;
Style qdStyle = font->m_macFontStyle ;
ATSUFontID atsuFont = font->m_macATSUFontID ;
status = ::ATSUCreateStyle(&(ATSUStyle)m_macATSUIStyle) ;
- wxASSERT_MSG( status == noErr , "couldn't create ATSU style" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") ) ;
ATSUAttributeTag atsuTags[] =
{
kATSUFontTag ,
} ;
status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
atsuTags, atsuSizes, atsuValues);
- wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ;
}
Pattern gHatchPatterns[] =
if ( err != noErr )
#endif
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease( m_macPrintSessionPort ) ;
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
UMAPrClose(NULL) ;
m_ok = FALSE;
err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
err = PrError() ;
if ( err )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
UMAPrClose(NULL) ;
m_ok = FALSE;
if ( err != noErr || m_macPrintSessionPort == kPMNoReference )
#endif
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
PMRelease(&m_macPrintSessionPort) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
}
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ;
::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
err = PrError() ;
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld") , err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
::UMAPrClose(NULL) ;
#endif
if ( err != noErr )
{
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %ld"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
const wxSize& WXUNUSED(size),
const wxString& WXUNUSED(name))
{
- wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
+ wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
m_message = message;
m_dialogStyle = style;
m_parent = parent;
0L); // User Data
if ( (err != noErr) && (err != userCanceledErr) ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
folderInfo = **(FSSpec**) specDesc.dataHandle;
err = ::PBGetCatInfoSync(&thePB);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
// Create cannonical FSSpec
err = FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
#endif
- wxASSERT_MSG( (err == noErr) || (err == nsvErr) , "Error accessing directory " + m_dirname) ;
+ wxASSERT_MSG( (err == noErr) || (err == nsvErr) , wxT("Error accessing directory " + m_dirname)) ;
m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ;
if ( !m_isDir )
return FALSE ;
-#if TARGET_CARBON
- char c_name[256] ;
-#endif
wxString result;
short err = noErr ;
if ( err != noErr )
break ;
-#if TARGET_CARBON
- p2cstrcpy( c_name, m_name ) ;
- strcpy( (char *)m_name, c_name);
-#else
- p2cstr( m_name ) ;
-#endif
// its hidden but we don't want it
if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) )
continue ;
#ifdef __DARWIN__
// under X, names that start with '.' are hidden
- if ( ( m_name[0] == '.' ) && !(m_flags & wxDIR_HIDDEN) )
+ if ( ( m_name[1] == '.' ) && !(m_flags & wxDIR_HIDDEN) )
continue;
#endif
#if TARGET_CARBON
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
- wxString file( m_name ) ;
- if ( m_filespec.IsEmpty() || m_filespec == "*.*" || m_filespec == "*" )
+ wxString file = wxMacMakeStringFromPascal( m_name ) ;
+ if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
{
}
- else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
+ else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") )
{
if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
{
continue ;
}
}
- else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
+ else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == wxT("*") )
{
if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
{
return FALSE ;
}
- *filename = (char*) m_name ;
+ *filename = wxMacMakeStringFromPascal( m_name ) ;
return TRUE;
}
GetFlavorData((DragReference)m_currentDrag, theItem, theType, (void*) theData, &dataSize, 0L);
if( theType == 'TEXT' )
{
- theData[dataSize]=0 ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- wxMacConvertToPC((char*)theData,(char*)theData,dataSize) ;
- }
- m_dataObject->SetData( format, dataSize, theData );
+ theData[dataSize]=0 ;
+ wxString convert = wxMacMakeStringFromCString( theData ) ;
+ m_dataObject->SetData( format, convert.Length() * sizeof(wxChar), (const wxChar*) convert );
}
else if ( theType == kDragFlavorTypeHFS )
{
if ( type == 'TEXT' )
{
dataSize-- ;
- if ( wxApp::s_macDefaultEncodingIsPC )
- {
- wxMacConvertFromPC((char*)dataPtr,(char*)dataPtr,dataSize) ;
- }
- AddDragItemFlavor(theDrag, theItem, type , dataPtr, dataSize, 0);
+ dataPtr[ dataSize ] = 0 ;
+ wxString st( (wxChar*) dataPtr ) ;
+ wxCharBuffer buf = wxMacStringToCString( st ) ;
+ AddDragItemFlavor(theDrag, theItem, type , buf.data(), strlen(buf), 0);
}
else if (type == kDragFlavorTypeHFS )
{
Str255 filename ;
// get the current filename
NavCustomControl(ioParams->context, kNavCtlGetEditFileName, &filename);
- CopyPascalStringToC( filename , (char*) filename ) ;
- wxString sfilename( filename ) ;
+ wxString sfilename = wxMacMakeStringFromPascal( filename ) ;
int pos = sfilename.Find('.',TRUE) ;
if ( pos != wxNOT_FOUND )
{
sfilename = sfilename.Left(pos+1)+extension ;
- CopyCStringToPascal( sfilename.c_str() , filename ) ;
+ wxMacStringToPascal( sfilename , filename ) ;
NavCustomControl(ioParams->context, kNavCtlSetEditFileName, &filename);
}
}
}
}
-const char * gfilters[] =
+const wxChar * gfilters[] =
{
- "*.TXT" ,
- "*.TIF" ,
- "*.JPG" ,
+ wxT("*.TXT") ,
+ wxT("*.TIF") ,
+ wxT("*.JPG") ,
NULL
} ;
++filterIndex ;
}
isName = !isName ;
- current = "" ;
+ current = wxEmptyString ;
}
else
{
// we allow for compatibility reason to have a single filter expression (like *.*) without
// an explanatory text, in that case the first part is name and extension at the same time
- wxASSERT_MSG( filterIndex == 0 || !isName , "incorrect format of format string" ) ;
+ wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
if ( current.IsEmpty() )
myData->extensions.Add( myData->name[filterIndex] ) ;
else
int j ;
for ( j = 0 ; gfilters[j] ; j++ )
{
- if ( strcmp( myData->extensions[i] , gfilters[j] ) == 0 )
+ if ( myData->extensions[i] == gfilters[j] )
{
myData->filtermactypes.Add( gfiltersmac[j] ) ;
break ;
static Boolean CheckFile( ConstStr255Param name , OSType type , OpenUserDataRecPtr data)
{
+/*
Str255 filename ;
#if TARGET_CARBON
p2cstr( filename ) ;
#endif
wxString file(filename) ;
+*/
+ wxString file = wxMacMakeStringFromPascal( name ) ;
file.MakeUpper() ;
if ( data->extensions.GetCount() > 0 )
{
//for ( int i = 0 ; i < data->numfilters ; ++i )
int i = data->currentfilter ;
- if ( data->extensions[i].Right(2) == ".*" )
+ if ( data->extensions[i].Right(2) == wxT(".*") )
return true ;
{
if ( type == (OSType)data->filtermactypes[i] )
return true ;
- wxStringTokenizer tokenizer( data->extensions[i] , ";" ) ;
+ wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ;
while( tokenizer.HasMoreTokens() )
{
wxString extension = tokenizer.GetNextToken() ;
// end wxmac
-wxString wxFileSelector(const char *title,
- const char *defaultDir, const char *defaultFileName,
- const char *defaultExtension, const char *filter, int flags,
+wxString wxFileSelector(const wxChar *title,
+ const wxChar *defaultDir, const wxChar *defaultFileName,
+ const wxChar *defaultExtension, const wxChar *filter, int flags,
wxWindow *parent, int x, int y)
{
// If there's a default extension specified but no filter, we create a suitable
// filter.
- wxString filter2("");
+ wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString("*.") + wxString(defaultExtension) ;
+ filter2 = wxString(wxT("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
if (defaultDir)
defaultDirString = defaultDir;
else
- defaultDirString = "";
+ defaultDirString = wxEmptyString ;
wxString defaultFilenameString;
if (defaultFileName)
defaultFilenameString = defaultFileName;
else
- defaultFilenameString = "";
+ defaultFilenameString = wxEmptyString;
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y));
return wxGetEmptyString();
}
-WXDLLEXPORT wxString wxFileSelectorEx(const char *title,
- const char *defaultDir,
- const char *defaultFileName,
+WXDLLEXPORT wxString wxFileSelectorEx(const wxChar *title,
+ const wxChar *defaultDir,
+ const wxChar *defaultFileName,
int* defaultFilterIndex,
- const char *filter,
+ const wxChar *filter,
int flags,
wxWindow* parent,
int x,
int y)
{
- wxFileDialog fileDialog(parent, title ? title : "", defaultDir ? defaultDir : "",
- defaultFileName ? defaultFileName : "", filter ? filter : "", flags, wxPoint(x, y));
+ wxFileDialog fileDialog(parent, title ? title : wxT(""), defaultDir ? defaultDir : wxT(""),
+ defaultFileName ? defaultFileName : wxT(""), filter ? filter : wxT(""), flags, wxPoint(x, y));
if ( fileDialog.ShowModal() == wxID_OK )
{
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
long style, const wxPoint& pos)
{
- wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
+ wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
m_message = message;
m_dialogStyle = style;
m_parent = parent;
- m_path = "";
+ m_path = wxT("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_filterIndex = 0;
}
-
pascal Boolean CrossPlatformFilterCallback (
AEDesc *theItem,
void *info,
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
}
}
-
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)mNavOptions.message, m_message) ;
-#else
- strcpy((char *)mNavOptions.message, m_message) ;
- c2pstr((char *)mNavOptions.message ) ;
-#endif
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)mNavOptions.savedFileName, m_fileName) ;
-#else
- strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
- c2pstr((char *)mNavOptions.savedFileName ) ;
-#endif
+ wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ;
+ wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ;
// zero all data
(*mNavOptions.popupExtension)[i].version = kNavMenuItemSpecVersion ;
(*mNavOptions.popupExtension)[i].menuCreator = 'WXNG' ;
(*mNavOptions.popupExtension)[i].menuType = i ;
-#if TARGET_CARBON
- c2pstrcpy((StringPtr)(*mNavOptions.popupExtension)[i].menuItemName, myData.name[i]) ;
-#else
- strcpy((char *)(*mNavOptions.popupExtension)[i].menuItemName, myData.name[i]) ;
- c2pstr((char *)(*mNavOptions.popupExtension)[i].menuItemName ) ;
-#endif
+ wxMacStringToPascal( myData.name[i] , (StringPtr)(*mNavOptions.popupExtension)[i].menuItemName ) ;
}
}
if ( m_dialogStyle & wxSAVE )
{
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc);
if ( err != noErr ) {
- m_path = "" ;
+ m_path = wxT("") ;
return wxID_CANCEL ;
}
outFileSpec = **(FSSpec**) specDesc.dataHandle;
// Generic file load/save dialog
static wxString
-wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxDefaultFileSelector(bool load, const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
- char *ext = (char *)extension;
-
- char prompt[50];
+ wxString prompt;
+
wxString str;
if (load)
- str = "Load %s file";
+ str = wxT("Load %s file");
else
- str = "Save %s file";
- sprintf(prompt, wxGetTranslation(str), what);
+ str = wxT("Save %s file");
+ prompt.Printf( wxGetTranslation(str), what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ const wxChar *ext = extension;
+ if (*ext == wxT('.'))
+ ext++;
+
+ wxString wild;
+ wild.Printf(wxT("*.%s"), ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}
// Generic file load dialog
wxString
-wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxLoadFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
}
// Generic file save dialog
wxString
-wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
+wxSaveFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent)
{
return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
}
-
-
void wxFontRefData::MacFindFont()
{
- if( m_faceName == "" )
+ if( m_faceName.Length() == 0 )
{
switch( m_family )
{
}
Str255 name ;
GetFontName( m_macFontNum , name ) ;
- CopyPascalStringToC( name , (char*) name ) ;
- m_faceName = (char*) name ;
+ m_faceName = wxMacMakeStringFromPascal( name ) ;
}
else
{
- if ( m_faceName == "systemfont" )
+ if ( m_faceName == wxT("systemfont") )
m_macFontNum = ::GetSysFont() ;
- else if ( m_faceName == "applicationfont" )
+ else if ( m_faceName == wxT("applicationfont") )
m_macFontNum = ::GetAppFont() ;
else
{
status = ATSUFindFontFromName ( (Ptr) m_faceName , strlen( m_faceName ) ,
kFontFullName, kFontMacintoshPlatform, kFontRomanScript , kFontNoLanguage , (UInt32*)&m_macATSUFontID ) ;
*/
- wxASSERT_MSG( status == noErr , "couldn't retrieve font identifier" ) ;
+ wxASSERT_MSG( status == noErr , wxT("couldn't retrieve font identifier") ) ;
}
// ----------------------------------------------------------------------------
size = wxSize( 200 , 16 ) ;
}
- MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
kControlProgressBarProc , (long) this ) ;
}
}
-void wxGLContext::SetColour(const char *colour)
+void wxGLContext::SetColour(const wxChar *colour)
{
float r = 0.0;
float g = 0.0;
}
}
-void wxGLCanvas::SetColour(const char *colour)
+void wxGLCanvas::SetColour(const wxChar *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
int desiredWidth, int desiredHeight)
{
short theId = -1 ;
- if ( name == "wxICON_INFORMATION" )
+ if ( name == wxT("wxICON_INFORMATION") )
{
theId = kNoteIcon ;
}
- else if ( name == "wxICON_QUESTION" )
+ else if ( name == wxT("wxICON_QUESTION") )
{
theId = kCautionIcon ;
}
- else if ( name == "wxICON_WARNING" )
+ else if ( name == wxT("wxICON_WARNING") )
{
theId = kCautionIcon ;
}
- else if ( name == "wxICON_ERROR" )
+ else if ( name == wxT("wxICON_ERROR") )
{
theId = kStopIcon ;
}
{
Str255 theName ;
OSType theType ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) theName , name ) ;
-#else
- strcpy( (char *) theName , name ) ;
- c2pstr( (char *) theName ) ;
-#endif
+ wxMacStringToPascal( name , theName ) ;
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L )
wxString wxJoystick::GetProductName() const
{
// TODO
- return wxString("");
+ return wxString(wxT(""));
}
int wxJoystick::GetXMin() const
case lDrawMsg:
{
- const wxString text = list->m_stringArray[cell.v] ;
+ const wxString linetext = list->m_stringArray[cell.v] ;
// Save the current clip region, and set the clip region to the area we are about
// to draw.
}
#if TARGET_CARBON
- bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
-
- if ( useDrawThemeText )
- {
- Rect frame = { drawRect->top, drawRect->left + 4,
- drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
- CFStringRef sString = CFStringCreateWithBytes( NULL , (UInt8*) text.c_str(), text.Length(), CFStringGetSystemEncoding(), false ) ;
- CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , sString ) ;
- CFRelease( sString ) ;
- ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- false,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- }
- else
-#endif
- {
+ {
+ Rect frame = { drawRect->top, drawRect->left + 4,
+ drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
+ CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext) ) ;
+ ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ }
+#else
+ {
+ wxCharBuffer text = wxMacStringToCString( linetext ) ;
MoveTo(drawRect->left + 4 , drawRect->top + 10 );
- DrawText(text, 0 , text.Length());
+ DrawText(text, 0 , strlen(text) );
}
-
+#endif
// If the cell is hilited, do the hilite now. Paint the cell contents with the
// appropriate QuickDraw transform mode.
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
ListDefSpec listDef;
listDef.defType = kListDefUserProcType;
fontSize = 9 ;
fontStyle = normal ;
#endif
- CopyPascalStringToC( fontName , (char*) fontName ) ;
- SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , fontName ) ) ;
+ SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , wxMacMakeStringFromPascal( fontName ) ) ) ;
#if TARGET_CARBON
Size asize;
int wxListBox::DoAppend(const wxString& item)
{
int index = m_noItems ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- m_stringArray.Add( wxMacMakeMacStringFromPC( item ) ) ;
- m_dataArray.Add( NULL );
- }
- else {
- m_stringArray.Add( item ) ;
- m_dataArray.Add( NULL );
- }
+ m_stringArray.Add( item ) ;
+ m_dataArray.Add( NULL );
m_noItems ++;
DoSetItemClientData( index , NULL ) ;
MacAppend( item ) ;
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
}
-int wxListBox::FindString(const wxString& st) const
+int wxListBox::FindString(const wxString& s) const
{
- wxString s ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- s = wxMacMakeMacStringFromPC( st ) ;
- }
- else
- s = st ;
- if ( s.Right(1) == "*" )
+ if ( s.Right(1) == wxT("*") )
{
wxString search = s.Left( s.Length() - 1 ) ;
int len = search.Length() ;
Str255 s1 , s2 ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s2 , search.c_str() ) ;
-#else
- strcpy( (char *) s2 , search.c_str() ) ;
- c2pstr( (char *) s2 ) ;
-#endif
+ wxMacStringToPascal( search , s2 ) ;
for ( int i = 0 ; i < m_noItems ; ++ i )
{
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s1 , m_stringArray[i].Left( len ).c_str() ) ;
-#else
- strcpy( (char *) s1 , m_stringArray[i].Left( len ).c_str() ) ;
- c2pstr( (char *) s1 ) ;
-#endif
+ wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
+
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
- if ( s.Left(1) == "*" && s.Length() > 1 )
+ if ( s.Left(1) == wxT("*") && s.Length() > 1 )
{
- s = st ;
- s.MakeLower() ;
+ wxString st = s ;
+ st.MakeLower() ;
for ( int i = 0 ; i < m_noItems ; ++i )
{
- if ( GetString(i).Lower().Matches(s) )
+ if ( GetString(i).Lower().Matches(st) )
return i ;
}
}
{
Str255 s1 , s2 ;
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s2 , s.c_str() ) ;
-#else
- strcpy( (char *) s2 , s.c_str() ) ;
- c2pstr( (char *) s2 ) ;
-#endif
+ wxMacStringToPascal( s , s2 ) ;
for ( int i = 0 ; i < m_noItems ; ++ i )
{
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) s1 , m_stringArray[i].c_str() ) ;
-#else
- strcpy( (char *) s1 , m_stringArray[i].c_str() ) ;
- c2pstr( (char *) s1 ) ;
-#endif
+ wxMacStringToPascal( m_stringArray[i] , s1 ) ;
+
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
void wxListBox::SetSelection(int N, bool select)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- "invalid index in wxListBox::SetSelection" );
+ wxT("invalid index in wxListBox::SetSelection") );
MacSetSelection( N , select ) ;
GetSelections( m_selectionPreImage ) ;
}
bool wxListBox::IsSelected(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE,
- "invalid index in wxListBox::Selected" );
+ wxT("invalid index in wxListBox::Selected") );
return MacIsSelected( N ) ;
}
void wxListBox::DoSetItemClientData(int N, void *Client_data)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- "invalid index in wxListBox::SetClientData" );
+ wxT("invalid index in wxListBox::SetClientData") );
#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW )
wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
}
#endif // wxUSE_OWNER_DRAWN
- wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , "invalid client_data array" ) ;
+ wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ;
if ( m_dataArray.GetCount() > (size_t) N )
{
// Find string for position
wxString wxListBox::GetString(int N) const
{
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- return wxMacMakePCStringFromMac( m_stringArray[N] ) ;
- }
- else
- return m_stringArray[N] ;
+ return m_stringArray[N] ;
}
void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
void wxListBox::SetString(int N, const wxString& s)
{
- wxString str ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- str = wxMacMakeMacStringFromPC( s ) ;
- }
- else
- str = s ;
- m_stringArray[N] = str ;
+ m_stringArray[N] = s ;
MacSet( N , s ) ;
}
Refresh();
}
-void wxListBox::MacInsert( int n , const char * text)
+void wxListBox::MacInsert( int n , const wxString& text)
{
Cell cell = { 0 , 0 } ;
cell.v = n ;
Refresh();
}
-void wxListBox::MacAppend( const char * text)
+void wxListBox::MacAppend( const wxString& text)
{
Cell cell = { 0 , 0 } ;
cell.v = (**(ListHandle)m_macList).dataBounds.bottom ;
return no_sel ;
}
-void wxListBox::MacSet( int n , const char * text )
+void wxListBox::MacSet( int n , const wxString& text )
{
// our implementation does not store anything in the list
// so we just have to redraw
{
if ( event.GetTimestamp() > m_lastTypeIn + 60 )
{
- m_typeIn = "" ;
+ m_typeIn = wxEmptyString ;
}
m_lastTypeIn = event.GetTimestamp() ;
m_typeIn += (char) event.GetKeyCode() ;
- int line = FindString("*"+m_typeIn+"*") ;
+ int line = FindString(wxT("*")+m_typeIn+wxT("*")) ;
if ( line >= 0 )
{
if ( GetSelection() != line )
short wakeUp )
{
wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ;
- wxASSERT_MSG( handler != NULL , "illegal notification proc ptr" ) ;
+ wxASSERT_MSG( handler != NULL , wxT("illegal notification proc ptr") ) ;
/* this should be protected eventually */
short index = e->top++ ;
// append a new item or submenu to the menu
bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{
- wxASSERT_MSG( pItem != NULL, "can't append NULL item to the menu" );
+ wxASSERT_MSG( pItem != NULL, wxT("can't append NULL item to the menu") );
if ( pItem->IsSeparator() )
{
wxMenu *pSubMenu = pItem->GetSubMenu() ;
if ( pSubMenu != NULL )
{
- wxASSERT_MSG( pSubMenu->m_hMenu != NULL , "invalid submenu added");
+ wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
{
if ( pos == (size_t)-1 )
{
- UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), "a" );
+ UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") );
pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ;
}
else
{
- UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), "a" , pos);
+ UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos);
}
SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ;
Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ;
wxString message ;
- wxCHECK_RET( menubar != NULL, "can't read MBAR resource" );
+ wxCHECK_RET( menubar != NULL, wxT("can't read MBAR resource") );
::SetMenuBar( menubar ) ;
#if TARGET_API_MAC_CARBON
::DisposeMenuBar( menubar ) ;
int pos ;
wxMenu* menu = m_menus[i] , *subMenu = NULL ;
- if( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName )
+ if( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName )
{
if ( mh == NULL )
{
{
// In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines
// therefore these item must not be translated
- if ( wxStripMenuCodes(m_text).Upper() == "EXIT" )
+ if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") )
{
- m_text = "Quit\tCtrl+Q" ;
+ m_text =wxT("Quit\tCtrl+Q") ;
}
m_radioGroup.start = -1;
void wxMenuItem::Check(bool bDoCheck)
{
- wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
+ wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
if ( m_isChecked != bDoCheck )
{
M_METAFILEDATA->m_metafile = 0;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
/*
if (!file.IsNull() && (file.Cmp("") == 0))
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
m_maxX = -10000;
m_maxY = -10000;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
- m_metaFile = new wxMetaFile("") ;
+ m_metaFile = new wxMetaFile(wxEmptyString) ;
Rect r={0,0,1000,1000} ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
m_maxX = -10000;
m_maxY = -10000;
- wxASSERT_MSG( file.IsEmpty() , "no file based metafile support yet") ;
+ wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet")) ;
- m_metaFile = new wxMetaFile("") ;
+ m_metaFile = new wxMetaFile(wxEmptyString) ;
Rect r={yorg,xorg,yorg+yext,xorg+xext} ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
{
wxString ext = e ;
ext = ext.Lower() ;
- if ( ext == "txt" )
+ if ( ext == wxT("txt") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("text/text");
+ fileType->m_impl->SetFileType(wxT("text/text"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "htm" || ext == "html" )
+ else if ( ext == wxT("htm") || ext == wxT("html") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("text/html");
+ fileType->m_impl->SetFileType(wxT("text/html"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "gif" )
+ else if ( ext == wxT("gif") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/gif");
+ fileType->m_impl->SetFileType(wxT("image/gif"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "png" )
+ else if ( ext == wxT("png" ))
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/png");
+ fileType->m_impl->SetFileType(wxT("image/png"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "jpg" || ext == "jpeg" )
+ else if ( ext == wxT("jpg" )|| ext == wxT("jpeg") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/jpeg");
+ fileType->m_impl->SetFileType(wxT("image/jpeg"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "bmp" )
+ else if ( ext == wxT("bmp") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/bmp");
+ fileType->m_impl->SetFileType(wxT("image/bmp"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "tif" || ext == "tiff" )
+ else if ( ext == wxT("tif") || ext == wxT("tiff") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/tiff");
+ fileType->m_impl->SetFileType(wxT("image/tiff"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "xpm" )
+ else if ( ext == wxT("xpm") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/xpm");
+ fileType->m_impl->SetFileType(wxT("image/xpm"));
fileType->m_impl->SetExt(ext);
return fileType;
}
- else if ( ext == "xbm" )
+ else if ( ext == wxT("xbm") )
{
wxFileType *fileType = new wxFileType;
- fileType->m_impl->SetFileType("image/xbm");
+ fileType->m_impl->SetFileType(wxT("image/xbm"));
fileType->m_impl->SetExt(ext);
return fileType;
}
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)
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 ;
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 ;
wxMacStringToPascal( m_caption , pascalTitle ) ;
wxMacStringToPascal( _("Yes") , yesPString ) ;
wxMacStringToPascal( _("No") , noPString ) ;
- CopyCStringToPascal( cText , pascalText ) ;
+ wxMacStringToPascal( m_message , pascalText ) ;
param.movable = true;
param.filterProc = NULL ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
int tabstyle = kControlTabSmallNorthProc ;
if ( HasFlag(wxNB_LEFT) )
page = m_pages[ii];
info.version = 0;
info.iconSuiteID = 0;
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) info.name , page->GetLabel() ) ;
-#else
- strcpy( (char *) info.name , page->GetLabel() ) ;
- c2pstr( (char *) info.name ) ;
-#endif
+ wxMacStringToPascal( page->GetLabel() , info.name ) ;
+
SetControlData( (ControlHandle) m_macControl, ii+1, kControlTabInfoTag,
sizeof( ControlTabInfoRec) , (char*) &info ) ;
SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ;
void wxNotebook::Command(wxCommandEvent& event)
{
- wxFAIL_MSG("wxNotebook::Command not implemented");
+ wxFAIL_MSG(wxT("wxNotebook::Command not implemented"));
}
// ----------------------------------------------------------------------------
void
ima_png_error(png_struct *png_ptr, char *message)
{
- wxMessageBox(message, "PNG error");
+ wxMessageBox(wxString::FromAscii(message), wxT("PNG error"));
longjmp(png_ptr->jmpbuf, 1);
}
strcpy(nameStr, name);
else
{
- strcpy(nameStr, filename);
- wxStripExtension(nameStr);
+ wxString str = wxString::FromAscii(filename) ;
+ wxStripExtension( str ) ;
+ strcpy(nameStr, str.ToAscii() );
}
if ( GetDepth() > 4 )
int desiredWidth, int desiredHeight)
{
wxPNGReader reader;
- if (reader.ReadFile((char*) (const char*) name))
+ if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) )
{
return reader.InstantiateBitmap(bitmap);
}
}
else
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxT(""), wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
::UMAPrClose(NULL) ;
}
if ((err != noErr) && (err != kPMCancel))
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
#else
}
else
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString , wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
::UMAPrClose(NULL) ;
}
if ((err != noErr) && (err != kPMCancel))
{
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ message.Printf( wxT("Print Error %d"), err ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
#else
if (!win)
{
wxEndBusyCursor();
- wxMessageBox("Sorry, could not create an abort dialog.", "Print Error", wxOK, parent);
+ wxMessageBox(wxT("Sorry, could not create an abort dialog."), wxT("Print Error"), wxOK, parent);
delete dc;
return FALSE;
}
if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage()))
{
wxEndBusyCursor();
- wxMessageBox("Could not start printing.", "Print Error", wxOK, parent);
+ wxMessageBox(wxT("Could not start printing."), wxT("Print Error"), wxOK, parent);
break;
}
if (sm_abortIt)
wxRadioButton *current;
if ((item < 0) || (item >= m_noItems))
- return wxString("");
+ return wxEmptyString;
i = 0;
current = m_radioButtonCycle;
int totWidth,totHeight;
SetFont(GetParent()->GetFont());
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
charWidth/=52;
maxWidth=-1;
int totWidth, totHeight;
wxFont font = GetParent()->GetFont();
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
&charWidth, &charHeight, NULL, NULL, &font);
charWidth /= 52;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100,
kControlScrollBarLiveProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
m_pageSize = (int)((maxValue-minValue)/10);
- MacPreControlCreate( parent, id, "", pos, size, style,
+ MacPreControlCreate( parent, id, wxEmptyString, pos, size, style,
validator, name, &bounds, title );
procID = kControlSliderProc + kControlSliderLiveFeedback;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false,
value, minValue, maxValue, procID, (long) this);
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
if(style & wxSL_LABELS)
{
- m_macMinimumStatic = new wxStaticText( this, -1, "" );
- m_macMaximumStatic = new wxStaticText( this, -1, "" );
- m_macValueStatic = new wxStaticText( this, -1, "" );
+ m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macValueStatic = new wxStaticText( this, -1, wxEmptyString );
SetRange(minValue, maxValue);
SetValue(value);
}
void wxSlider::SetValue(int value)
{
wxString valuestring ;
- valuestring.Printf( "%d" , value ) ;
+ valuestring.Printf( wxT("%d") , value ) ;
if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ;
SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
- value.Printf("%d", m_rangeMin);
+ value.Printf(wxT("%d"), m_rangeMin);
m_macMinimumStatic->SetLabel(value);
}
if(m_macMaximumStatic) {
- value.Printf("%d", m_rangeMax);
+ value.Printf(wxT("%d"), m_rangeMax);
m_macMaximumStatic->SetLabel(value);
}
SetValue(m_rangeMin);
int ht, wd;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &textwidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &wd, &ht);
if(ht > textheight) {
textheight = ht;
int ht;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &minValWidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &maxValWidth, &ht);
if(ht > textheight) {
textheight = ht;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100,
kControlLittleArrowsProc , (long) this ) ;
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPostControlCreate() ;
Rect bounds ;
Str255 title ;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlSeparatorLineProc , (long) this ) ;
return ret;
}
-const wxString punct = " ,.-;:!?";
+const wxString punct = wxT(" ,.-;:!?");
void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
{
if (paragraph.Length() == 0)
{
// empty line
- dc.GetTextExtent( "H", &width, &height );
+ dc.GetTextExtent( wxT("H"), &width, &height );
y += height;
return;
}
dc.DrawText( paragraph, pos , y) ;
- paragraph="";
+ paragraph=wxEmptyString;
y += height ;
}
}
if (text[i] == 13 || text[i] == 10)
{
DrawParagraph(dc, paragraph,y);
- paragraph = "" ;
+ paragraph = wxEmptyString ;
}
else
{
m_imageList = NULL;
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlTabSmallProc , (long) this ) ;
wxString wxTabCtrl::GetItemText(int item) const
{
// TODO
- return wxString("");
+ return wxEmptyString;
}
// Get the item image
kTXNStartOffset,
kTXNEndOffset);
/* set the field's background */
+
tback.bgType = kTXNBackgroundTypeRGB;
tback.bg.color = rgbWhite;
TXNSetBackground( varsp->fTXNRec, &tback);
mySize.y += 2 * m_macVerticalBorder ;
}
*/
- MacPreControlCreate( parent , id , "" , pos , mySize ,style, validator , name , &bounds , title ) ;
+ MacPreControlCreate( parent , id , wxEmptyString , pos , mySize ,style, validator , name , &bounds , title ) ;
if ( m_windowStyle & wxTE_MULTILINE )
{
}
MacPostControlCreate() ;
- wxString value ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- value = wxMacMakeMacStringFromPC( st ) ;
- else
- value = st ;
-
if ( !m_macUsesTXN )
{
- ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ;
}
else
{
/* set up locals */
tpvars = (STPTextPaneVars **) GetControlReference((ControlHandle) m_macControl);
/* set the text in the record */
- TXNSetData( (**tpvars).fTXNRec, kTXNTextData, (void*)value.c_str(), value.Length(),
- kTXNStartOffset, kTXNEndOffset);
m_macTXN = (**tpvars).fTXNRec ;
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN) , kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2,
+ kTXNStartOffset, kTXNEndOffset);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN) , kTXNTextData, (void*)text.data(), strlen( text ) ,
+ kTXNStartOffset, kTXNEndOffset);
+#endif
m_macTXNvars = tpvars ;
m_macUsesTXN = true ;
TXNSetSelection( (TXNObject) m_macTXN, 0, 0);
err = ::GetControlDataSize((ControlHandle) m_macControl, 0,
( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag, &actualSize ) ;
- if ( err )
- return wxEmptyString ;
-
- if ( actualSize > 0 )
- {
- wxChar *ptr = result.GetWriteBuf(actualSize) ;
-
+ if ( err )
+ return wxEmptyString ;
+
+ if ( actualSize > 0 )
+ {
+ wxCharBuffer buf(actualSize) ;
::GetControlData( (ControlHandle) m_macControl, 0,
( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag,
- actualSize , ptr , &actualSize ) ;
- ptr[actualSize] = 0 ;
- result.UngetWriteBuf(actualSize) ;
+ actualSize , buf.data() , &actualSize ) ;
+ result = wxMacMakeStringFromCString( buf ) ;
}
-
}
else
{
+#if wxUSE_UNICODE
Handle theText ;
- err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
+ err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNUnicodeTextData );
// all done
if ( err )
{
else
{
actualSize = GetHandleSize( theText ) ;
- if ( actualSize > 0 )
- {
- wxChar *ptr = result.GetWriteBuf(actualSize) ;
- strncpy( ptr , *theText , actualSize ) ;
+ if ( actualSize > 0 )
+ {
+ wxChar *ptr = result.GetWriteBuf(actualSize*sizeof(wxChar)) ;
+ wxStrncpy( ptr , (wxChar*) *theText , actualSize ) ;
ptr[actualSize] = 0 ;
result.UngetWriteBuf( actualSize ) ;
}
DisposeHandle( theText ) ;
}
+#else
+ Handle theText ;
+ err = TXNGetDataEncoded( ((TXNObject) m_macTXN), kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
+ // all done
+ if ( err )
+ {
+ actualSize = 0 ;
+ }
+ else
+ {
+ actualSize = GetHandleSize( theText ) ;
+ if ( actualSize > 0 )
+ {
+ HLock( theText ) ;
+ result = wxMacMakeStringFromCString( *theText , actualSize ) ;
+ HUnlock( theText ) ;
+ }
+ DisposeHandle( theText ) ;
+ }
+#endif
}
- return wxMacMakeStringFromMacString( result ) ;
+ return result ;
}
void wxTextCtrl::GetSelection(long* from, long* to) const
void wxTextCtrl::SetValue(const wxString& st)
{
- wxString value;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- value = wxMacMakeMacStringFromPC( st ) ;
- // value.Replace( "\n", "\r" ); TODO this should be handled by the conversion
- }
- else
- value = st;
-
-
if ( !m_macUsesTXN )
{
- ::SetControlData((ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ ::SetControlData( (ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , strlen(text) , text ) ;
}
else
{
bool formerEditable = IsEditable() ;
if ( !formerEditable )
SetEditable(true) ;
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2 ,
+ kTXNStartOffset, kTXNEndOffset);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)text.data(), strlen( text ) ,
kTXNStartOffset, kTXNEndOffset);
+#endif
TXNSetSelection( (TXNObject) m_macTXN, 0, 0);
TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart);
if ( !formerEditable )
if ( style.HasFont() )
{
const wxFont &font = style.GetFont() ;
- CopyCStringToPascal( font.GetFaceName().c_str() , fontName ) ;
+ wxMacStringToPascal( font.GetFaceName() , fontName ) ;
fontSize = font.GetPointSize() ;
if ( font.GetUnderlined() )
fontStyle |= underline ;
{
OSStatus status = TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr,
start,end);
- wxASSERT_MSG( status == noErr , "Couldn't set text attributes" ) ;
+ wxASSERT_MSG( status == noErr , wxT("Couldn't set text attributes") ) ;
}
if ( !formerEditable )
SetEditable(formerEditable) ;
SetEditable(true) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
TXNClear( ((TXNObject) m_macTXN) ) ;
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)value.wc_str(), value.Length() * 2 ,
+ kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#else
TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#endif
if ( !formerEditable )
SetEditable( formerEditable ) ;
}
return FALSE;
}
-void wxTextCtrl::WriteText(const wxString& text)
-{
- wxString value ;
- if( wxApp::s_macDefaultEncodingIsPC )
- {
- value = wxMacMakeMacStringFromPC( text ) ;
- // value.Replace( "\n", "\r" ); // TODO this should be handled by the conversion
- }
- else
- value = text ;
-
+void wxTextCtrl::WriteText(const wxString& st)
+{
if ( !m_macUsesTXN )
{
- TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ;
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TEInsert( text , strlen(text) , ((TEHandle) m_macTE) ) ;
}
else
{
SetEditable(true) ;
long start , end , dummy ;
GetSelection( &start , &dummy ) ;
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*) (const char*)value, value.Length(),
+#if wxUSE_UNICODE
+ TXNSetData( ((TXNObject) m_macTXN), kTXNUnicodeTextData, (void*)st.wc_str(), st.Length() * 2 ,
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#else
+ wxCharBuffer text = wxMacStringToCString( st ) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)text.data(), strlen( text ) ,
+ kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+#endif
GetSelection( &dummy , &end ) ;
SetStyle( start , end , GetDefaultStyle() ) ;
if ( !formerEditable )
if (count == lineNo)
{
// Add chars in line then
- wxString tmp("");
+ wxString tmp;
for (size_t j = i; j < content.Length(); j++)
{
}
if (content[i] == '\r') count++;
}
- return "" ;
+ return wxEmptyString ;
}
/*
#endif
if ( !hasThreadManager )
{
- wxMessageBox( "Error" , "Thread Support is not available on this System" , wxOK ) ;
+ wxMessageBox( wxT("Error") , wxT("Thread Support is not available on this System") , wxOK ) ;
return FALSE ;
}
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
*/
ControlHandle container = (ControlHandle) GetParent()->MacGetContainerForEmbedding() ;
- wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
+ wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
::EmbedControl( m_macToolHandle , container ) ;
if ( GetWindowStyleFlag() & wxTB_VERTICAL )
{
return tool->GetShortHelp() ;
}
- return "" ;
+ return wxEmptyString ;
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable)
wxMacToolTip( ) ;
~wxMacToolTip() ;
- void Setup( WindowRef window , wxString text , wxPoint localPosition ) ;
+ void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ;
long GetMark() { return m_mark ; }
void Draw() ;
void Clear() ;
bool m_shown ;
long m_mark ;
wxMacToolTipTimer* m_timer ;
-#ifdef TARGET_CARBON
- CFStringRef m_helpTextRef ;
+#if TARGET_CARBON
+ wxMacCFStringHolder m_helpTextRef ;
#endif
} ;
m_mark = 0 ;
m_shown = false ;
m_timer = NULL ;
- m_helpTextRef = NULL ;
}
-void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
+void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition )
{
m_mark++ ;
Clear() ;
m_position = localPosition ;
- if( wxApp::s_macDefaultEncodingIsPC )
- m_label = wxMacMakeMacStringFromPC( text ) ;
- else
- m_label = text ;
+ m_label = text ;
m_window =win;
s_ToolTipWindowRef = m_window ;
m_backpict = NULL ;
{
m_shown = true ;
#if TARGET_CARBON
- if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
- {
- HMHelpContentRec tag ;
- tag.version = kMacHelpVersion;
- SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
- GrafPtr port ;
- GetPort( &port ) ;
- SetPortWindowPort(m_window) ;
- LocalToGlobal( (Point *) &tag.absHotRect.top );
- LocalToGlobal( (Point *) &tag.absHotRect.bottom );
- SetPort( port );
- if( m_helpTextRef )
- {
- CFRelease( m_helpTextRef ) ;
- m_helpTextRef = NULL ;
- }
- m_helpTextRef = wxMacCreateCFString(m_label) ;
- tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
- tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
- tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
- tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ;
- tag.tagSide = kHMDefaultSide;
- HMDisplayTag( &tag );
- }
- else
-#endif
+ HMHelpContentRec tag ;
+ tag.version = kMacHelpVersion;
+ SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
+ GrafPtr port ;
+ GetPort( &port ) ;
+ SetPortWindowPort(m_window) ;
+ LocalToGlobal( (Point *) &tag.absHotRect.top );
+ LocalToGlobal( (Point *) &tag.absHotRect.bottom );
+ SetPort( port );
+ m_helpTextRef = m_label ;
+ tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
+ tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
+ tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
+ tag.content[kHMMaximumContentIndex].u.tagCFString = m_helpTextRef ;
+ tag.tagSide = kHMDefaultSide;
+ HMDisplayTag( &tag );
+#else
+ wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
+ FontFamilyID fontId ;
+ Str255 fontName ;
+ SInt16 fontSize ;
+ Style fontStyle ;
+ GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
+ GetFNum( fontName, &fontId );
+
+ TextFont( fontId ) ;
+ TextSize( fontSize ) ;
+ TextFace( fontStyle ) ;
+ FontInfo fontInfo;
+ ::GetFontInfo(&fontInfo);
+ short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading;
+ short height = 0 ;
+ // short width = TextWidth( m_label , 0 ,m_label.Length() ) ;
+
+ int i = 0 ;
+ int length = m_label.Length() ;
+ int width = 0 ;
+ int thiswidth = 0 ;
+ int laststop = 0 ;
+ wxCharBuffer text = wxMacStringToCString( m_label ) ;
+
+ while( i < length )
{
- wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
-#if TARGET_CARBON
- bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
-#endif
-
- FontFamilyID fontId ;
- Str255 fontName ;
- SInt16 fontSize ;
- Style fontStyle ;
- GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
- GetFNum( fontName, &fontId );
-
- TextFont( fontId ) ;
- TextSize( fontSize ) ;
- TextFace( fontStyle ) ;
- FontInfo fontInfo;
- ::GetFontInfo(&fontInfo);
- short lineh = fontInfo.ascent + fontInfo.descent + fontInfo.leading;
- short height = 0 ;
- // short width = TextWidth( m_label , 0 ,m_label.Length() ) ;
-
- int i = 0 ;
- int length = m_label.Length() ;
- int width = 0 ;
- int thiswidth = 0 ;
- int laststop = 0 ;
- const char *text = m_label ;
- while( i < length )
- {
- if( text[i] == 13 || text[i] == 10)
- {
- thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
- if ( thiswidth > width )
- width = thiswidth ;
-
- height += lineh ;
- laststop = i+1 ;
- }
- i++ ;
- }
- if ( i - laststop > 0 )
+ if( text[i] == 13 || text[i] == 10)
{
thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
if ( thiswidth > width )
width = thiswidth ;
+
height += lineh ;
+ laststop = i+1 ;
}
-
-
- m_rect.left = m_position.x + kTipOffset;
- m_rect.top = m_position.y + kTipOffset;
- m_rect.right = m_rect.left + width + 2 * kTipBorder;
-#if TARGET_CARBON
- if ( useDrawThemeText )
- m_rect.right += kTipBorder ;
-#endif
- m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
- Rect r ;
- GetPortBounds( GetWindowPort( m_window ) , &r ) ;
- if ( m_rect.top < 0 )
- {
- m_rect.bottom += -m_rect.top ;
- m_rect.top = 0 ;
- }
- if ( m_rect.left < 0 )
- {
- m_rect.right += -m_rect.left ;
- m_rect.left = 0 ;
- }
- if ( m_rect.right > r.right )
- {
- m_rect.left -= (m_rect.right - r.right ) ;
- m_rect.right = r.right ;
- }
- if ( m_rect.bottom > r.bottom )
- {
- m_rect.top -= (m_rect.bottom - r.bottom) ;
- m_rect.bottom = r.bottom ;
- }
- ClipRect( &m_rect ) ;
- BackColor( whiteColor ) ;
- ForeColor(blackColor ) ;
- GWorldPtr port ;
- NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ;
- CGrafPtr origPort ;
- GDHandle origDevice ;
-
- GetGWorld( &origPort , &origDevice ) ;
- SetGWorld( port , NULL ) ;
-
- m_backpict = OpenPicture(&m_rect);
-
- CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)),
- GetPortBitMapForCopyBits(port),
- &m_rect,
- &m_rect,
- srcCopy,
- NULL);
- ClosePicture();
- SetGWorld( origPort , origDevice ) ;
- DisposeGWorld( port ) ;
- PenNormal() ;
-
- RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ;
- BackColor( whiteColor ) ;
- RGBForeColor( &tooltipbackground ) ;
-
- PaintRect( &m_rect ) ;
- ForeColor(blackColor ) ;
- FrameRect( &m_rect ) ;
- SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ;
- ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
-
- i = 0 ;
- laststop = 0 ;
- height = 0 ;
-
- while( i < length )
- {
- if( text[i] == 13 || text[i] == 10)
- {
-#if TARGET_CARBON
- if ( useDrawThemeText )
- {
- Rect frame ;
- frame.top = m_rect.top + kTipBorder + height ;
- frame.left = m_rect.left + kTipBorder ;
- frame.bottom = frame.top + 1000 ;
- frame.right = frame.left + 1000 ;
- CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- true,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- height += lineh ;
- }
- else
-#endif
- {
- ::DrawText( text , laststop , i - laststop ) ;
- height += lineh ;
- ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height );
- }
- laststop = i+1 ;
- }
- i++ ;
- }
-#if TARGET_CARBON
- if ( useDrawThemeText )
- {
- Rect frame ;
- frame.top = m_rect.top + kTipBorder + height ;
- frame.left = m_rect.left + kTipBorder ;
- frame.bottom = frame.top + 1000 ;
- frame.right = frame.left + 1000 ;
- CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
- ::DrawThemeTextBox( mString,
- kThemeCurrentPortFont,
- kThemeStateActive,
- true,
- &frame,
- teJustLeft,
- nil );
- CFRelease( mString ) ;
- }
- else
-#endif
+ i++ ;
+ }
+ if ( i - laststop > 0 )
+ {
+ thiswidth = ::TextWidth( text , laststop , i - laststop ) ;
+ if ( thiswidth > width )
+ width = thiswidth ;
+ height += lineh ;
+ }
+
+ m_rect.left = m_position.x + kTipOffset;
+ m_rect.top = m_position.y + kTipOffset;
+ m_rect.right = m_rect.left + width + 2 * kTipBorder;
+
+ m_rect.bottom = m_rect.top + height + 2 * kTipBorder;
+ Rect r ;
+ GetPortBounds( GetWindowPort( m_window ) , &r ) ;
+ if ( m_rect.top < 0 )
+ {
+ m_rect.bottom += -m_rect.top ;
+ m_rect.top = 0 ;
+ }
+ if ( m_rect.left < 0 )
+ {
+ m_rect.right += -m_rect.left ;
+ m_rect.left = 0 ;
+ }
+ if ( m_rect.right > r.right )
+ {
+ m_rect.left -= (m_rect.right - r.right ) ;
+ m_rect.right = r.right ;
+ }
+ if ( m_rect.bottom > r.bottom )
+ {
+ m_rect.top -= (m_rect.bottom - r.bottom) ;
+ m_rect.bottom = r.bottom ;
+ }
+ ClipRect( &m_rect ) ;
+ BackColor( whiteColor ) ;
+ ForeColor(blackColor ) ;
+ GWorldPtr port ;
+ NewGWorld( &port , wxDisplayDepth() , &m_rect , NULL , NULL , 0 ) ;
+ CGrafPtr origPort ;
+ GDHandle origDevice ;
+
+ GetGWorld( &origPort , &origDevice ) ;
+ SetGWorld( port , NULL ) ;
+
+ m_backpict = OpenPicture(&m_rect);
+
+ CopyBits(GetPortBitMapForCopyBits(GetWindowPort(m_window)),
+ GetPortBitMapForCopyBits(port),
+ &m_rect,
+ &m_rect,
+ srcCopy,
+ NULL);
+ ClosePicture();
+ SetGWorld( origPort , origDevice ) ;
+ DisposeGWorld( port ) ;
+ PenNormal() ;
+
+ RGBColor tooltipbackground = { 0xFFFF , 0xFFFF , 0xC000 } ;
+ BackColor( whiteColor ) ;
+ RGBForeColor( &tooltipbackground ) ;
+
+ PaintRect( &m_rect ) ;
+ ForeColor(blackColor ) ;
+ FrameRect( &m_rect ) ;
+ SetThemeTextColor(kThemeTextColorNotification,wxDisplayDepth(),true) ;
+ ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
+
+ i = 0 ;
+ laststop = 0 ;
+ height = 0 ;
+
+ while( i < length )
+ {
+ if( text[i] == 13 || text[i] == 10)
{
::DrawText( text , laststop , i - laststop ) ;
+ height += lineh ;
+ ::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder + height );
+ laststop = i+1 ;
}
- ::TextMode( srcOr ) ;
- }
+ i++ ;
+ }
+ ::DrawText( text , laststop , i - laststop ) ;
+ ::TextMode( srcOr ) ;
+#endif
}
}
return ;
#if TARGET_CARBON
HMHideTag() ;
- if( m_helpTextRef )
- {
- CFRelease( m_helpTextRef ) ;
- m_helpTextRef = NULL ;
- }
+ m_helpTextRef.Release() ;
#else
if ( m_window == s_ToolTipWindowRef && m_backpict )
{
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( inWindowRef != (WindowRef) NULL, "attempt to add a NULL WindowRef to window list" );
+ wxCHECK_RET( inWindowRef != (WindowRef) NULL, wxT("attempt to add a NULL WindowRef to window list") );
if ( !wxWinMacWindowList->Find((long)inWindowRef) )
wxWinMacWindowList->Append((long)inWindowRef, win);
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
wxAssociateWinWithMacWindow( m_macWindow , this ) ;
- wxString label ;
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( title ) ;
- else
- label = title ;
- UMASetWTitleC( (WindowRef)m_macWindow , label ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title ) ;
::CreateRootControl( (WindowRef)m_macWindow , (ControlHandle*)&m_macRootControl ) ;
#if TARGET_CARBON
InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
wxWindow::SetTitle( title ) ;
-
- wxString label ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( m_label ) ;
- else
- label = m_label ;
-
- UMASetWTitleC( (WindowRef)m_macWindow , label ) ;
+ UMASetWTitle( (WindowRef)m_macWindow , title ) ;
}
bool wxTopLevelWindowMac::Show(bool show)
wxString str = wxStripMenuCodes( title ) ;
MenuRef menu ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
CreateNewMenu( id , 0 , &menu ) ;
- SetMenuTitleWithCFString( menu , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
- SetMenuTitleWithCFString( menu , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- CFStringRef cfs = wxMacCreateCFString( str ) ;
- SetMenuItemTextWithCFString( menu , item , cfs ) ;
- CFRelease( cfs ) ;
+ SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
DisposeWindow( inWindowRef ) ;
}
-void UMASetWTitleC( WindowRef inWindowRef , const char *title )
+void UMASetWTitle( WindowRef inWindowRef , const wxString& title )
{
- Str255 ptitle ;
- strncpy( (char*)ptitle , title , 96 ) ;
- ptitle[96] = 0 ;
#if TARGET_CARBON
- c2pstrcpy( ptitle, (char *)ptitle ) ;
+ SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title) ) ;
#else
- c2pstr( (char*)ptitle ) ;
-#endif
+ Str255 ptitle ;
+ wxMacStringToPascal( title , ptitle ) ;
SetWTitle( inWindowRef , ptitle ) ;
+#endif
}
void UMAGetWTitleC( WindowRef inWindowRef , char *title )
// appearance additions
+void UMASetControlTitle( ControlHandle inControl , const wxString& title )
+{
+#if TARGET_CARBON
+ SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title) ) ;
+#else
+ Str255 ptitle ;
+ wxMacStringToPascal( title , ptitle ) ;
+ SetControlTitle( inControl , ptitle ) ;
+#endif
+}
+
void UMAActivateControl( ControlHandle inControl )
{
// we have to add the control after again to the update rgn
{
GetPort( &m_oldPort ) ;
SetPort( newport ) ;
- wxASSERT_MSG( m_clip == NULL , "Cannot call setup twice" ) ;
+ wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ;
m_clip = NewRgn() ;
GetClip( m_clip );
m_textFont = GetPortTextFont( (CGrafPtr) newport);
#include <Sound.h>
#endif
+#include "ATSUnicode.h"
+#include "TextCommon.h"
+#include "TextEncodingConverter.h"
+
#ifndef __DARWIN__
// defined in unix/utilsunx.cpp for Mac OS X
}
// Get hostname only (without domain name)
-bool wxGetHostName(char *buf, int maxSize)
+bool wxGetHostName(wxChar *buf, int maxSize)
{
// Gets Chooser name of user by examining a System resource.
if (chooserName && *chooserName)
{
- int length = (*chooserName)[0] ;
- if ( length + 1 > maxSize )
- {
- length = maxSize - 1 ;
- }
- strncpy( buf , (char*) &(*chooserName)[1] , length ) ;
- buf[length] = 0 ;
+ HLock( (Handle) chooserName ) ;
+ wxString name = wxMacMakeStringFromPascal( *chooserName ) ;
+ HUnlock( (Handle) chooserName ) ;
+ ReleaseResource( (Handle) chooserName ) ;
+ wxStrncpy( buf , name , maxSize - 1 ) ;
}
else
buf[0] = 0 ;
}
// Get user ID e.g. jacs
-bool wxGetUserId(char *buf, int maxSize)
+bool wxGetUserId(wxChar *buf, int maxSize)
{
return wxGetUserName( buf , maxSize ) ;
}
}
// Get user name e.g. Stefan Csomor
-bool wxGetUserName(char *buf, int maxSize)
+bool wxGetUserName(wxChar *buf, int maxSize)
{
// Gets Chooser name of user by examining a System resource.
if (chooserName && *chooserName)
{
- int length = (*chooserName)[0] ;
- if ( length + 1 > maxSize )
- {
- length = maxSize - 1 ;
- }
- strncpy( buf , (char*) &(*chooserName)[1] , length ) ;
- buf[length] = 0 ;
+ HLock( (Handle) chooserName ) ;
+ wxString name = wxMacMakeStringFromPascal( *chooserName ) ;
+ HUnlock( (Handle) chooserName ) ;
+ ReleaseResource( (Handle) chooserName ) ;
+ wxStrncpy( buf , name , maxSize - 1 ) ;
}
else
buf[0] = 0 ;
bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%.4f", value);
+ wxString buf;
+ buf.Printf(wxT("%.4f"), value);
+
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%ld", value);
+ wxString buf;
+ buf.Printf(wxT("%ld"), value);
+
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file)
{
- char buf[50];
- sprintf(buf, "%d", value);
+ wxString buf;
+ buf.Printf(wxT("%d"), value);
+
return wxWriteResource(section, entry, buf, file);
}
}
#ifndef __DARWIN__
-char *wxGetUserHome (const wxString& user)
+wxChar *wxGetUserHome (const wxString& user)
{
// TODO
return NULL;
p = p.Mid(1,pos) ;
}
- p = p + ":" ;
+ p = p + wxT(":") ;
Str255 volumeName ;
XVolumeParam pb ;
// use configure generated description if available
return wxString("MacOS (") + WXWIN_OS_DESCRIPTION + wxString(")");
#else
- return "MacOS" ; //TODO:define further
+ return wxT("MacOS") ; //TODO:define further
#endif
}
}
}
-wxString wxMacMakeMacStringFromPC( const char * p )
+TECObjectRef s_TECNativeCToUnicode = NULL ;
+TECObjectRef s_TECUnicodeToNativeC = NULL ;
+TECObjectRef s_TECPCToNativeC = NULL ;
+TECObjectRef s_TECNativeCToPC = NULL ;
+void wxMacSetupConverters()
{
+ // if we assume errors are happening here we need low level debugging since the high level assert will use the encoders that
+ // are not yet setup...
+
+ OSStatus status = noErr ;
+ status = TECCreateConverter(&s_TECNativeCToUnicode,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
+
+
+ status = TECCreateConverter(&s_TECUnicodeToNativeC,
+ kTextEncodingUnicodeDefault, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman);
+
+ if ( !wxApp::s_macDefaultEncodingIsPC )
+ {
+ status = TECCreateConverter(&s_TECPCToNativeC,
+ kTextEncodingWindowsLatin1, wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman);
+
+
+ status = TECCreateConverter(&s_TECNativeCToPC,
+ wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman , kTextEncodingWindowsLatin1 );
+ }
+}
+
+void wxMacCleanupConverters()
+{
+ OSStatus status = noErr ;
+ status = TECDisposeConverter(s_TECNativeCToUnicode);
+
+ status = TECDisposeConverter(s_TECUnicodeToNativeC);
+
+ status = TECDisposeConverter(s_TECPCToNativeC);
+
+ status = TECDisposeConverter(s_TECNativeCToPC);
+}
+
+wxWCharBuffer wxMacStringToWString( const wxString &from )
+{
+#if wxUSE_UNICODE
+ wxWCharBuffer result( from.wc_str() ) ;
+#else
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() ;
+ ByteCount byteBufferLen = byteInLen *2 ;
+ wxWCharBuffer result( from.Length() ) ;
+ status = TECConvertText(s_TECNativeCToUnicode, (ConstTextPtr)from.c_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ result.data()[byteOutLen/2] = 0 ;
+#endif
+ return result ;
+}
+
+wxString wxMacMakeStringFromCString( const char * from , int len )
+{
+ OSStatus status = noErr ;
wxString result ;
- int len = strlen ( p ) ;
+ wxChar* buf = result.GetWriteBuf( len ) ;
+#if wxUSE_UNICODE
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = len ;
+ ByteCount byteBufferLen = len *2 ;
+
+ status = TECConvertText(s_TECNativeCToUnicode, (ConstTextPtr)from , byteInLen, &byteInLen,
+ (TextPtr)buf, byteBufferLen, &byteOutLen);
+#else
+ if ( wxApp::s_macDefaultEncodingIsPC )
+ memcpy( buf , from , len ) ;
+ else
+ {
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = len ;
+ ByteCount byteBufferLen = byteInLen ;
+
+ status = TECConvertText(s_TECNativeCToPC, (ConstTextPtr)from , byteInLen, &byteInLen,
+ (TextPtr)buf, byteBufferLen, &byteOutLen);
+ }
+#endif
+ buf[len] = 0 ;
+ result.UngetWriteBuf() ;
+ return result ;
+}
+
+wxString wxMacMakeStringFromCString( const char * from )
+{
+ return wxMacMakeStringFromCString( from , strlen(from) ) ;
+}
+
+wxCharBuffer wxMacStringToCString( const wxString &from )
+{
+#if wxUSE_UNICODE
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() * 2 ;
+ ByteCount byteBufferLen = from.Length() ;
+ wxCharBuffer result( from.Length() ) ;
+ status = TECConvertText(s_TECUnicodeToNativeC , (ConstTextPtr)from.wc_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ return result ;
+#else
+ if ( wxApp::s_macDefaultEncodingIsPC )
+ return wxCharBuffer( from.c_str() ) ;
+ else
+ {
+ wxCharBuffer result( from.Length() ) ;
+ OSStatus status = noErr ;
+ ByteCount byteOutLen ;
+ ByteCount byteInLen = from.Length() ;
+ ByteCount byteBufferLen = byteInLen ;
+
+ status = TECConvertText(s_TECPCToNativeC, (ConstTextPtr)from.c_str() , byteInLen, &byteInLen,
+ (TextPtr)result.data(), byteBufferLen, &byteOutLen);
+ return result ;
+ }
+#endif
+}
+
+void wxMacStringToPascal( const wxString&from , StringPtr to )
+{
+ wxCharBuffer buf = wxMacStringToCString( from ) ;
+ int len = strlen(buf) ;
+
+ if ( len > 255 )
+ len = 255 ;
+ to[0] = len ;
+ memcpy( (char*) &to[1] , buf , len ) ;
+}
+
+wxString wxMacMakeStringFromPascal( ConstStringPtr from )
+{
+ return wxMacMakeStringFromCString( (char*) &from[1] , from[0] ) ;
+}
+
+//
+// CFStringRefs (Carbon only)
+//
+
+#if TARGET_CARBON
+// converts this string into a carbon foundation string with optional pc 2 mac encoding
+void wxMacCFStringHolder::Assign( const wxString &str )
+{
+#if wxUSE_UNICODE
+ m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault,
+ (const unsigned short*)str.wc_str(), str.Len() );
+#else
+ m_cfs = CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
+ wxApp::s_macDefaultEncodingIsPC ?
+ kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
+#endif
+ m_release = true ;
+}
+
+wxString wxMacCFStringHolder::AsString()
+{
+ wxString result ;
+ Size len = CFStringGetLength( m_cfs ) ;
+ wxChar* buf = result.GetWriteBuf( len ) ;
+#if wxUSE_UNICODE
+ CFStringGetCharacters( m_cfs , CFRangeMake( 0 , len ) , (UniChar*) buf ) ;
+#else
+ CFStringGetCString( m_cfs , buf , len+1 , s_macDefaultEncodingIsPC ?
+ kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
+#endif
+ buf[len] = 0 ;
+ result.UngetWriteBuf() ;
+ return result ;
+}
+
+#if 0
+
+wxString wxMacMakeMacStringFromPC( const wxChar * p )
+{
+ wxString result ;
+ int len = wxStrlen ( p ) ;
if ( len > 0 )
{
wxChar* ptr = result.GetWriteBuf(len) ;
return result ;
}
-wxString wxMacMakePCStringFromMac( const char * p )
+wxString wxMacMakePCStringFromMac( const wxChar * p )
{
wxString result ;
- int len = strlen ( p ) ;
+ int len = wxStrlen ( p ) ;
if ( len > 0 )
{
wxChar* ptr = result.GetWriteBuf(len) ;
return result ;
}
-wxString wxMacMakeStringFromMacString( const char* from , bool mac2pcEncoding )
+wxString wxMacMakeStringFromMacString( const wxChar* from , bool mac2pcEncoding )
{
if (mac2pcEncoding)
{
}
}
-void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding )
+void wxMacStringToPascal( const wxChar * from , StringPtr to , bool pc2macEncoding )
{
if (pc2macEncoding)
{
CopyCStringToPascal( from , to ) ;
}
}
+#endif
-//
-// CFStringRefs (Carbon only)
-//
-
-#if TARGET_CARBON
-// converts this string into a carbon foundation string with optional pc 2 mac encoding
-CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding )
-{
- return CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
- pc2macEncoding ?
- kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
-}
#endif //TARGET_CARBON
//don't know what to do with looped, wth
bool wxWave::Play(bool async, bool looped) const
{
- char lpSnd[32];
bool ret = false;
if (m_isResource)
{
-#if TARGET_CARBON
- c2pstrcpy((unsigned char *)lpSnd, m_sndname);
-#else
- strcpy(lpSnd, m_sndname);
- c2pstr((char *) lpSnd);
-#endif
- SndListHandle hSnd;
+ Str255 snd ;
+ wxMacStringToPascal( m_sndname , snd ) ;
+ SndListHandle hSnd;
- hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
+ hSnd = (SndListHandle) GetNamedResource('snd ', snd);
- if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
- ret = true;
+ if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
+ ret = true;
}
return ret;
{
return m_tooltip->GetTip() ;
}
- return "" ;
+ return wxEmptyString ;
}
void wxWindowMac::Update()
iter = iter->GetParent() ;
}
- wxASSERT_MSG( 1 , "No valid mac root window" ) ;
+ wxASSERT_MSG( 1 , wxT("No valid mac root window") ) ;
return NULL ;
}
void wxWindowMac::MacCreateScrollBars( long style )
{
- wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , "attempt to create window twice" ) ;
+ wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ;
bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ;
int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ;
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
- <FILE>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- <FILEKIND>Text</FILEKIND>
- <FILEFLAGS>Debug</FILEFLAGS>
- </FILE>
<FILE>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcprint.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:appcmn.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<PATH>:dcbuffer.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<PATHTYPE>PathRelative</PATHTYPE>
<PATHROOT>Project</PATHROOT>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
- <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0—ô0#Þ##Þ\1fÈ</VALUE></SETTING>
+ <SETTING><NAME>MWFTP_Post_password</NAME><VALUE>0ÿÄ \ 5æ\aø"²¸</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_remoteDir</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathVersion</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_ftp_PathType</NAME><VALUE>0</VALUE></SETTING>
<PATH>:object.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <TARGETNAME>wxlib PPC debug</TARGETNAME>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:common:</ACCESSPATH>
- <PATH>:odbc.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<TARGETNAME>wxlib PPC debug</TARGETNAME>
<PATHTYPE>PathRelative</PATHTYPE>
<PATH>:gridctrl.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <TARGETNAME>wxlib PPC debug</TARGETNAME>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:generic:</ACCESSPATH>
- <PATH>:gridg.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<TARGETNAME>wxlib PPC debug</TARGETNAME>
<PATHTYPE>PathRelative</PATHTYPE>
<PATH>:accel.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
- <FILEREF>
- <TARGETNAME>wxlib PPC debug</TARGETNAME>
- <PATHTYPE>PathRelative</PATHTYPE>
- <PATHROOT>Project</PATHROOT>
- <ACCESSPATH>:mac:</ACCESSPATH>
- <PATH>:aga.cpp</PATH>
- <PATHFORMAT>MacOS</PATHFORMAT>
- </FILEREF>
<FILEREF>
<TARGETNAME>wxlib PPC debug</TARGETNAME>
<PATHTYPE>PathRelative</PATHTYPE>