font encoding support

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-02-08 06:23:07 +00:00
parent fef5c55604
commit a9412f8f03
20 changed files with 74 additions and 74 deletions

View File

@@ -90,7 +90,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int wxChoice::DoAppend(const wxString& item) int wxChoice::DoAppend(const wxString& item)
{ {
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item); UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Add( item ) ; m_strings.Add( item ) ;
m_datas.Add( NULL ) ; m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ; int index = m_strings.GetCount() - 1 ;
@@ -107,7 +107,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
if (pos == GetCount()) if (pos == GetCount())
return DoAppend(item); return DoAppend(item);
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item); UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Insert( item, pos ) ; m_strings.Insert( item, pos ) ;
m_datas.Insert( NULL, pos ) ; m_datas.Insert( NULL, pos ) ;
DoSetItemClientData( pos , NULL ) ; DoSetItemClientData( pos , NULL ) ;
@@ -277,7 +277,7 @@ wxSize wxChoice::DoGetBestSize() const
#if wxUSE_UNICODE #if wxUSE_UNICODE
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) , ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
false, false,

View File

@@ -207,7 +207,7 @@ void wxControl::SetLabel(const wxString& title)
if ( m_macControl ) if ( m_macControl )
{ {
UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ; UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ;
} }
Refresh() ; Refresh() ;
} }
@@ -338,7 +338,7 @@ void wxControl::MacPostControlCreate()
controlstyle.flags = kControlUseFontMask ; controlstyle.flags = kControlUseFontMask ;
if (IsKindOf( CLASSINFO( wxButton ) ) ) if (IsKindOf( CLASSINFO( wxButton ) ) )
controlstyle.font = kControlFontSmallSystemFont ; // eventually kControlFontBigSystemFont ; controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ;
else else
controlstyle.font = kControlFontSmallSystemFont ; controlstyle.font = kControlFontSmallSystemFont ;
@@ -400,7 +400,7 @@ void wxControl::MacPostControlCreate()
SetSize(pos.x, pos.y, new_size.x, new_size.y); SetSize(pos.x, pos.y, new_size.x, new_size.y);
#if wxUSE_UNICODE #if wxUSE_UNICODE
UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ; UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ;
#endif #endif
if ( m_macControlIsShown ) if ( m_macControlIsShown )

View File

@@ -1485,7 +1485,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
if ( m_backgroundMode != wxTRANSPARENT ) if ( m_backgroundMode != wxTRANSPARENT )
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
@@ -1527,7 +1527,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ;
if ( m_backgroundMode != wxTRANSPARENT ) if ( m_backgroundMode != wxTRANSPARENT )
{ {
@@ -1614,7 +1614,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString, ::GetThemeTextDimensions( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
@@ -1642,7 +1642,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString, ::GetThemeTextDimensions( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,

View File

@@ -141,7 +141,7 @@ NavEventProc(
{ {
sfilename = sfilename.Left(pos+1)+extension ; sfilename = sfilename.Left(pos+1)+extension ;
#if TARGET_CARBON #if TARGET_CARBON
cfString = sfilename ; cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ;
NavDialogSetSaveFileName( ioParams->context , cfString ) ; NavDialogSetSaveFileName( ioParams->context , cfString ) ;
#else #else
wxMacStringToPascal( sfilename , filename ) ; wxMacStringToPascal( sfilename , filename ) ;
@@ -356,7 +356,7 @@ int wxFileDialog::ShowModal()
#else #else
CFStringRef titleRef = ::CFStringCreateWithCString(NULL, CFStringRef titleRef = ::CFStringCreateWithCString(NULL,
m_message.c_str(), m_message.c_str(),
CFStringGetSystemEncoding()); m_font.GetEncoding() );
#endif #endif
dialogCreateOptions.windowTitle = titleRef; dialogCreateOptions.windowTitle = titleRef;
#if wxUSE_UNICODE #if wxUSE_UNICODE
@@ -366,7 +366,7 @@ int wxFileDialog::ShowModal()
#else #else
CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL, CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL,
m_fileName.c_str(), m_fileName.c_str(),
CFStringGetSystemEncoding()); m_font.GetEncoding());
#endif #endif
dialogCreateOptions.saveFileName = defaultFileNameRef; dialogCreateOptions.saveFileName = defaultFileNameRef;
NavDialogRef dialog; NavDialogRef dialog;
@@ -403,7 +403,7 @@ int wxFileDialog::ShowModal()
myData.menuitems = dialogCreateOptions.popupExtension ; myData.menuitems = dialogCreateOptions.popupExtension ;
for ( size_t i = 0 ; i < numfilters ; ++i ) for ( size_t i = 0 ; i < numfilters ; ++i )
{ {
CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ; CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] , m_font.GetEncoding() ) ) ;
} }
} }
@@ -484,7 +484,7 @@ int wxFileDialog::ShowModal()
CFURLPathStyle pathstyle = kCFURLHFSPathStyle; CFURLPathStyle pathstyle = kCFURLHFSPathStyle;
#endif #endif
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
thePath = wxMacCFStringHolder(cfString).AsString(); thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding());
if (!thePath) if (!thePath)
{ {
::NavDisposeReply(&navReply); ::NavDisposeReply(&navReply);

View File

@@ -123,7 +123,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
{ {
Rect frame = { drawRect->top, drawRect->left + 4, Rect frame = { drawRect->top, drawRect->left + 4,
drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ; drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext) ) ; CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ;
::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ; ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
::DrawThemeTextBox( mString, ::DrawThemeTextBox( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
@@ -636,7 +636,7 @@ wxSize wxListBox::DoGetBestSize() const
#if wxUSE_UNICODE #if wxUSE_UNICODE
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) , ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
false, false,

View File

@@ -70,7 +70,7 @@ void wxMenu::Init()
// create the menu // create the menu
m_macMenuId = s_macNextMenuId++; m_macMenuId = s_macNextMenuId++;
m_hMenu = UMANewMenu(m_macMenuId, m_title); m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );
if ( !m_hMenu ) if ( !m_hMenu )
{ {
@@ -130,9 +130,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
} }
if ( pos == (size_t)-1 ) if ( pos == (size_t)-1 )
UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), pSubMenu->m_macMenuId); UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pSubMenu->m_macMenuId);
else else
UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText() , pos, pSubMenu->m_macMenuId); UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pos, pSubMenu->m_macMenuId);
pItem->UpdateItemBitmap() ; pItem->UpdateItemBitmap() ;
pItem->UpdateItemStatus() ; pItem->UpdateItemStatus() ;
} }
@@ -140,7 +140,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{ {
if ( pos == (size_t)-1 ) if ( pos == (size_t)-1 )
{ {
UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") ); UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , wxFont::GetDefaultEncoding() );
pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ; pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ;
} }
else else
@@ -148,7 +148,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
// MacOS counts menu items from 1 and inserts after, therefore having the // MacOS counts menu items from 1 and inserts after, therefore having the
// same effect as wx 0 based and inserting before, we must correct pos // same effect as wx 0 based and inserting before, we must correct pos
// after however for updates to be correct // after however for updates to be correct
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos); UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos);
pos += 1 ; pos += 1 ;
} }
@@ -273,7 +273,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
void wxMenu::SetTitle(const wxString& label) void wxMenu::SetTitle(const wxString& label)
{ {
m_title = label ; m_title = label ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label ) ; UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ;
} }
bool wxMenu::ProcessCommand(wxCommandEvent & event) bool wxMenu::ProcessCommand(wxCommandEvent & event)
{ {
@@ -580,7 +580,7 @@ void wxMenuBar::MacInstallMenuBar()
if ( item->GetId() == wxApp::s_macAboutMenuItemId ) if ( item->GetId() == wxApp::s_macAboutMenuItemId )
{ {
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() ); UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() , wxFont::GetDefaultEncoding() );
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true ); UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ; SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ;
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ; UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
@@ -589,7 +589,7 @@ void wxMenuBar::MacInstallMenuBar()
{ {
if ( mh ) if ( mh )
{ {
UMAAppendMenuItem(mh, item->GetText() , entry ); UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry);
SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ; SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ;
} }
} }
@@ -601,7 +601,7 @@ void wxMenuBar::MacInstallMenuBar()
} }
else else
{ {
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i] ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], m_font.GetEncoding() ) ;
m_menus[i]->MacBeforeDisplay(false) ; m_menus[i]->MacBeforeDisplay(false) ;
::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0); ::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0);
} }
@@ -684,7 +684,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; ::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
{ {
menu->MacBeforeDisplay( false ) ; menu->MacBeforeDisplay( false ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( pos == m_menus.GetCount() - 1) if ( pos == m_menus.GetCount() - 1)
{ {
::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ;
@@ -709,7 +709,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
m_titles.Insert(title, pos); m_titles.Insert(title, pos);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() && s_macInstalledMenuBar == this ) if ( IsAttached() && s_macInstalledMenuBar == this )
{ {
@@ -762,7 +762,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
m_titles.Add(title); m_titles.Add(title);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() ) if ( IsAttached() )
{ {

View File

@@ -130,7 +130,7 @@ void wxMenuItem::UpdateItemStatus()
else else
::SetItemMark( mhandle , index , 0 ) ; // no mark ::SetItemMark( mhandle , index , 0 ) ; // no mark
UMASetMenuItemText( mhandle , index , m_text ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
@@ -147,7 +147,7 @@ void wxMenuItem::UpdateItemText()
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
return ; return ;
UMASetMenuItemText( mhandle , index , m_text ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;

View File

@@ -53,11 +53,11 @@ int wxMessageDialog::ShowModal()
if ( UMAGetSystemVersion() >= 0x1000 ) if ( UMAGetSystemVersion() >= 0x1000 )
{ {
AlertStdCFStringAlertParamRec param ; AlertStdCFStringAlertParamRec param ;
wxMacCFStringHolder cfNoString(_("No")) ; wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ;
wxMacCFStringHolder cfYesString( _("Yes")) ; wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ;
wxMacCFStringHolder cfTitle(m_caption); wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding());
wxMacCFStringHolder cfText(m_message); wxMacCFStringHolder cfText(m_message , m_font.GetEncoding());
param.movable = true; param.movable = true;
param.flags = 0 ; param.flags = 0 ;

View File

@@ -144,7 +144,7 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintData* data )
// collate cannot be set // collate cannot be set
#if 0 // not yet tested #if 0 // not yet tested
if ( m_printerName.Length() > 0 ) if ( m_printerName.Length() > 0 )
PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName ) ) ; PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
#endif #endif
PMColorMode color ; PMColorMode color ;
PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ; PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ;

View File

@@ -233,7 +233,7 @@ void wxMacToolTip::Draw()
LocalToGlobal( (Point *) &tag.absHotRect.top ); LocalToGlobal( (Point *) &tag.absHotRect.top );
LocalToGlobal( (Point *) &tag.absHotRect.bottom ); LocalToGlobal( (Point *) &tag.absHotRect.bottom );
SetPort( port ); SetPort( port );
m_helpTextRef = m_label ; m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ;
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;

View File

@@ -90,7 +90,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int wxChoice::DoAppend(const wxString& item) int wxChoice::DoAppend(const wxString& item)
{ {
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item); UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Add( item ) ; m_strings.Add( item ) ;
m_datas.Add( NULL ) ; m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ; int index = m_strings.GetCount() - 1 ;
@@ -107,7 +107,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
if (pos == GetCount()) if (pos == GetCount())
return DoAppend(item); return DoAppend(item);
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item); UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Insert( item, pos ) ; m_strings.Insert( item, pos ) ;
m_datas.Insert( NULL, pos ) ; m_datas.Insert( NULL, pos ) ;
DoSetItemClientData( pos , NULL ) ; DoSetItemClientData( pos , NULL ) ;
@@ -277,7 +277,7 @@ wxSize wxChoice::DoGetBestSize() const
#if wxUSE_UNICODE #if wxUSE_UNICODE
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) , ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
false, false,

View File

@@ -207,7 +207,7 @@ void wxControl::SetLabel(const wxString& title)
if ( m_macControl ) if ( m_macControl )
{ {
UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ; UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ;
} }
Refresh() ; Refresh() ;
} }
@@ -338,7 +338,7 @@ void wxControl::MacPostControlCreate()
controlstyle.flags = kControlUseFontMask ; controlstyle.flags = kControlUseFontMask ;
if (IsKindOf( CLASSINFO( wxButton ) ) ) if (IsKindOf( CLASSINFO( wxButton ) ) )
controlstyle.font = kControlFontSmallSystemFont ; // eventually kControlFontBigSystemFont ; controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ;
else else
controlstyle.font = kControlFontSmallSystemFont ; controlstyle.font = kControlFontSmallSystemFont ;
@@ -400,7 +400,7 @@ void wxControl::MacPostControlCreate()
SetSize(pos.x, pos.y, new_size.x, new_size.y); SetSize(pos.x, pos.y, new_size.x, new_size.y);
#if wxUSE_UNICODE #if wxUSE_UNICODE
UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ; UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ;
#endif #endif
if ( m_macControlIsShown ) if ( m_macControlIsShown )

View File

@@ -1485,7 +1485,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
if ( m_backgroundMode != wxTRANSPARENT ) if ( m_backgroundMode != wxTRANSPARENT )
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
@@ -1527,7 +1527,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ;
if ( m_backgroundMode != wxTRANSPARENT ) if ( m_backgroundMode != wxTRANSPARENT )
{ {
@@ -1614,7 +1614,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString, ::GetThemeTextDimensions( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
@@ -1642,7 +1642,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{ {
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ; wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString, ::GetThemeTextDimensions( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,

View File

@@ -141,7 +141,7 @@ NavEventProc(
{ {
sfilename = sfilename.Left(pos+1)+extension ; sfilename = sfilename.Left(pos+1)+extension ;
#if TARGET_CARBON #if TARGET_CARBON
cfString = sfilename ; cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ;
NavDialogSetSaveFileName( ioParams->context , cfString ) ; NavDialogSetSaveFileName( ioParams->context , cfString ) ;
#else #else
wxMacStringToPascal( sfilename , filename ) ; wxMacStringToPascal( sfilename , filename ) ;
@@ -356,7 +356,7 @@ int wxFileDialog::ShowModal()
#else #else
CFStringRef titleRef = ::CFStringCreateWithCString(NULL, CFStringRef titleRef = ::CFStringCreateWithCString(NULL,
m_message.c_str(), m_message.c_str(),
CFStringGetSystemEncoding()); m_font.GetEncoding() );
#endif #endif
dialogCreateOptions.windowTitle = titleRef; dialogCreateOptions.windowTitle = titleRef;
#if wxUSE_UNICODE #if wxUSE_UNICODE
@@ -366,7 +366,7 @@ int wxFileDialog::ShowModal()
#else #else
CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL, CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL,
m_fileName.c_str(), m_fileName.c_str(),
CFStringGetSystemEncoding()); m_font.GetEncoding());
#endif #endif
dialogCreateOptions.saveFileName = defaultFileNameRef; dialogCreateOptions.saveFileName = defaultFileNameRef;
NavDialogRef dialog; NavDialogRef dialog;
@@ -403,7 +403,7 @@ int wxFileDialog::ShowModal()
myData.menuitems = dialogCreateOptions.popupExtension ; myData.menuitems = dialogCreateOptions.popupExtension ;
for ( size_t i = 0 ; i < numfilters ; ++i ) for ( size_t i = 0 ; i < numfilters ; ++i )
{ {
CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] ) ) ; CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] , m_font.GetEncoding() ) ) ;
} }
} }
@@ -484,7 +484,7 @@ int wxFileDialog::ShowModal()
CFURLPathStyle pathstyle = kCFURLHFSPathStyle; CFURLPathStyle pathstyle = kCFURLHFSPathStyle;
#endif #endif
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
thePath = wxMacCFStringHolder(cfString).AsString(); thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding());
if (!thePath) if (!thePath)
{ {
::NavDisposeReply(&navReply); ::NavDisposeReply(&navReply);

View File

@@ -123,7 +123,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
{ {
Rect frame = { drawRect->top, drawRect->left + 4, Rect frame = { drawRect->top, drawRect->left + 4,
drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ; drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext) ) ; CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ;
::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ; ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
::DrawThemeTextBox( mString, ::DrawThemeTextBox( mString,
kThemeCurrentPortFont, kThemeCurrentPortFont,
@@ -636,7 +636,7 @@ wxSize wxListBox::DoGetBestSize() const
#if wxUSE_UNICODE #if wxUSE_UNICODE
Point bounds={0,0} ; Point bounds={0,0} ;
SInt16 baseline ; SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) , ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont, kThemeCurrentPortFont,
kThemeStateActive, kThemeStateActive,
false, false,

View File

@@ -70,7 +70,7 @@ void wxMenu::Init()
// create the menu // create the menu
m_macMenuId = s_macNextMenuId++; m_macMenuId = s_macNextMenuId++;
m_hMenu = UMANewMenu(m_macMenuId, m_title); m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );
if ( !m_hMenu ) if ( !m_hMenu )
{ {
@@ -130,9 +130,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
} }
if ( pos == (size_t)-1 ) if ( pos == (size_t)-1 )
UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), pSubMenu->m_macMenuId); UMAAppendSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pSubMenu->m_macMenuId);
else else
UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText() , pos, pSubMenu->m_macMenuId); UMAInsertSubMenuItem(MAC_WXHMENU(m_hMenu), pItem->GetText(), wxFont::GetDefaultEncoding() , pos, pSubMenu->m_macMenuId);
pItem->UpdateItemBitmap() ; pItem->UpdateItemBitmap() ;
pItem->UpdateItemStatus() ; pItem->UpdateItemStatus() ;
} }
@@ -140,7 +140,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{ {
if ( pos == (size_t)-1 ) if ( pos == (size_t)-1 )
{ {
UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") ); UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , wxFont::GetDefaultEncoding() );
pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ; pos = CountMenuItems(MAC_WXHMENU(m_hMenu)) ;
} }
else else
@@ -148,7 +148,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
// MacOS counts menu items from 1 and inserts after, therefore having the // MacOS counts menu items from 1 and inserts after, therefore having the
// same effect as wx 0 based and inserting before, we must correct pos // same effect as wx 0 based and inserting before, we must correct pos
// after however for updates to be correct // after however for updates to be correct
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a") , pos); UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos);
pos += 1 ; pos += 1 ;
} }
@@ -273,7 +273,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
void wxMenu::SetTitle(const wxString& label) void wxMenu::SetTitle(const wxString& label)
{ {
m_title = label ; m_title = label ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label ) ; UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ;
} }
bool wxMenu::ProcessCommand(wxCommandEvent & event) bool wxMenu::ProcessCommand(wxCommandEvent & event)
{ {
@@ -580,7 +580,7 @@ void wxMenuBar::MacInstallMenuBar()
if ( item->GetId() == wxApp::s_macAboutMenuItemId ) if ( item->GetId() == wxApp::s_macAboutMenuItemId )
{ {
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() ); UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetText() , wxFont::GetDefaultEncoding() );
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true ); UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ; SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ;
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ; UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
@@ -589,7 +589,7 @@ void wxMenuBar::MacInstallMenuBar()
{ {
if ( mh ) if ( mh )
{ {
UMAAppendMenuItem(mh, item->GetText() , entry ); UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry);
SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ; SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ;
} }
} }
@@ -601,7 +601,7 @@ void wxMenuBar::MacInstallMenuBar()
} }
else else
{ {
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i] ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], m_font.GetEncoding() ) ;
m_menus[i]->MacBeforeDisplay(false) ; m_menus[i]->MacBeforeDisplay(false) ;
::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0); ::InsertMenu(MAC_WXHMENU(m_menus[i]->GetHMenu()), 0);
} }
@@ -684,7 +684,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ; ::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
{ {
menu->MacBeforeDisplay( false ) ; menu->MacBeforeDisplay( false ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( pos == m_menus.GetCount() - 1) if ( pos == m_menus.GetCount() - 1)
{ {
::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ; ::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ;
@@ -709,7 +709,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
m_titles.Insert(title, pos); m_titles.Insert(title, pos);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() && s_macInstalledMenuBar == this ) if ( IsAttached() && s_macInstalledMenuBar == this )
{ {
@@ -762,7 +762,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
m_titles.Add(title); m_titles.Add(title);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ; UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() ) if ( IsAttached() )
{ {

View File

@@ -130,7 +130,7 @@ void wxMenuItem::UpdateItemStatus()
else else
::SetItemMark( mhandle , index , 0 ) ; // no mark ::SetItemMark( mhandle , index , 0 ) ; // no mark
UMASetMenuItemText( mhandle , index , m_text ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
@@ -147,7 +147,7 @@ void wxMenuItem::UpdateItemText()
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
return ; return ;
UMASetMenuItemText( mhandle , index , m_text ) ; UMASetMenuItemText( mhandle , index , m_text , wxFont::GetDefaultEncoding() ) ;
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;

View File

@@ -53,11 +53,11 @@ int wxMessageDialog::ShowModal()
if ( UMAGetSystemVersion() >= 0x1000 ) if ( UMAGetSystemVersion() >= 0x1000 )
{ {
AlertStdCFStringAlertParamRec param ; AlertStdCFStringAlertParamRec param ;
wxMacCFStringHolder cfNoString(_("No")) ; wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ;
wxMacCFStringHolder cfYesString( _("Yes")) ; wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ;
wxMacCFStringHolder cfTitle(m_caption); wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding());
wxMacCFStringHolder cfText(m_message); wxMacCFStringHolder cfText(m_message , m_font.GetEncoding());
param.movable = true; param.movable = true;
param.flags = 0 ; param.flags = 0 ;

View File

@@ -144,7 +144,7 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintData* data )
// collate cannot be set // collate cannot be set
#if 0 // not yet tested #if 0 // not yet tested
if ( m_printerName.Length() > 0 ) if ( m_printerName.Length() > 0 )
PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName ) ) ; PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
#endif #endif
PMColorMode color ; PMColorMode color ;
PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ; PMGetColorMode( (PMPrintSettings) m_macPrintSettings, &color ) ;

View File

@@ -233,7 +233,7 @@ void wxMacToolTip::Draw()
LocalToGlobal( (Point *) &tag.absHotRect.top ); LocalToGlobal( (Point *) &tag.absHotRect.top );
LocalToGlobal( (Point *) &tag.absHotRect.bottom ); LocalToGlobal( (Point *) &tag.absHotRect.bottom );
SetPort( port ); SetPort( port );
m_helpTextRef = m_label ; m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ;
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;