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)
{
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item);
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Add( item ) ;
m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ;
@@ -107,7 +107,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
if (pos == GetCount())
return DoAppend(item);
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item);
UMAAppendMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ) , item, m_font.GetEncoding() );
m_strings.Insert( item, pos ) ;
m_datas.Insert( NULL, pos ) ;
DoSetItemClientData( pos , NULL ) ;
@@ -277,7 +277,7 @@ wxSize wxChoice::DoGetBestSize() const
#if wxUSE_UNICODE
Point bounds={0,0} ;
SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) ,
::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont,
kThemeStateActive,
false,

View File

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

View File

@@ -1485,7 +1485,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText )
{
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 )
{
Point bounds={0,0} ;
@@ -1527,7 +1527,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText )
{
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 )
{
@@ -1614,7 +1614,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{
Point bounds={0,0} ;
SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
@@ -1642,7 +1642,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{
Point bounds={0,0} ;
SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,

View File

@@ -141,7 +141,7 @@ NavEventProc(
{
sfilename = sfilename.Left(pos+1)+extension ;
#if TARGET_CARBON
cfString = sfilename ;
cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ;
NavDialogSetSaveFileName( ioParams->context , cfString ) ;
#else
wxMacStringToPascal( sfilename , filename ) ;
@@ -356,7 +356,7 @@ int wxFileDialog::ShowModal()
#else
CFStringRef titleRef = ::CFStringCreateWithCString(NULL,
m_message.c_str(),
CFStringGetSystemEncoding());
m_font.GetEncoding() );
#endif
dialogCreateOptions.windowTitle = titleRef;
#if wxUSE_UNICODE
@@ -366,7 +366,7 @@ int wxFileDialog::ShowModal()
#else
CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL,
m_fileName.c_str(),
CFStringGetSystemEncoding());
m_font.GetEncoding());
#endif
dialogCreateOptions.saveFileName = defaultFileNameRef;
NavDialogRef dialog;
@@ -403,7 +403,7 @@ int wxFileDialog::ShowModal()
myData.menuitems = dialogCreateOptions.popupExtension ;
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;
#endif
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
thePath = wxMacCFStringHolder(cfString).AsString();
thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding());
if (!thePath)
{
::NavDisposeReply(&navReply);

View File

@@ -123,7 +123,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
{
Rect frame = { drawRect->top, drawRect->left + 4,
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 ) ;
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
@@ -636,7 +636,7 @@ wxSize wxListBox::DoGetBestSize() const
#if wxUSE_UNICODE
Point bounds={0,0} ;
SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) ,
::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont,
kThemeStateActive,
false,

View File

@@ -70,7 +70,7 @@ void wxMenu::Init()
// create the menu
m_macMenuId = s_macNextMenuId++;
m_hMenu = UMANewMenu(m_macMenuId, m_title);
m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );
if ( !m_hMenu )
{
@@ -130,9 +130,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
}
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
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->UpdateItemStatus() ;
}
@@ -140,7 +140,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{
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)) ;
}
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
// same effect as wx 0 based and inserting before, we must correct pos
// 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 ;
}
@@ -273,7 +273,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
void wxMenu::SetTitle(const wxString& label)
{
m_title = label ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label ) ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ;
}
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
@@ -580,7 +580,7 @@ void wxMenuBar::MacInstallMenuBar()
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 );
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ;
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
@@ -589,7 +589,7 @@ void wxMenuBar::MacInstallMenuBar()
{
if ( mh )
{
UMAAppendMenuItem(mh, item->GetText() , entry );
UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry);
SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ;
}
}
@@ -601,7 +601,7 @@ void wxMenuBar::MacInstallMenuBar()
}
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) ;
::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() */ ) ;
{
menu->MacBeforeDisplay( false ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( pos == m_menus.GetCount() - 1)
{
::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);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() && s_macInstalledMenuBar == this )
{
@@ -762,7 +762,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
m_titles.Add(title);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() )
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1485,7 +1485,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText )
{
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 )
{
Point bounds={0,0} ;
@@ -1527,7 +1527,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
if ( useDrawThemeText )
{
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 )
{
@@ -1614,7 +1614,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{
Point bounds={0,0} ;
SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
@@ -1642,7 +1642,7 @@ void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *h
{
Point bounds={0,0} ;
SInt16 baseline ;
wxMacCFStringHolder mString( linetext ) ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,

View File

@@ -141,7 +141,7 @@ NavEventProc(
{
sfilename = sfilename.Left(pos+1)+extension ;
#if TARGET_CARBON
cfString = sfilename ;
cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ;
NavDialogSetSaveFileName( ioParams->context , cfString ) ;
#else
wxMacStringToPascal( sfilename , filename ) ;
@@ -356,7 +356,7 @@ int wxFileDialog::ShowModal()
#else
CFStringRef titleRef = ::CFStringCreateWithCString(NULL,
m_message.c_str(),
CFStringGetSystemEncoding());
m_font.GetEncoding() );
#endif
dialogCreateOptions.windowTitle = titleRef;
#if wxUSE_UNICODE
@@ -366,7 +366,7 @@ int wxFileDialog::ShowModal()
#else
CFStringRef defaultFileNameRef = ::CFStringCreateWithCString(NULL,
m_fileName.c_str(),
CFStringGetSystemEncoding());
m_font.GetEncoding());
#endif
dialogCreateOptions.saveFileName = defaultFileNameRef;
NavDialogRef dialog;
@@ -403,7 +403,7 @@ int wxFileDialog::ShowModal()
myData.menuitems = dialogCreateOptions.popupExtension ;
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;
#endif
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
thePath = wxMacCFStringHolder(cfString).AsString();
thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding());
if (!thePath)
{
::NavDisposeReply(&navReply);

View File

@@ -123,7 +123,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
{
Rect frame = { drawRect->top, drawRect->left + 4,
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 ) ;
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
@@ -636,7 +636,7 @@ wxSize wxListBox::DoGetBestSize() const
#if wxUSE_UNICODE
Point bounds={0,0} ;
SInt16 baseline ;
::GetThemeTextDimensions( wxMacCFStringHolder( str ) ,
::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
kThemeCurrentPortFont,
kThemeStateActive,
false,

View File

@@ -70,7 +70,7 @@ void wxMenu::Init()
// create the menu
m_macMenuId = s_macNextMenuId++;
m_hMenu = UMANewMenu(m_macMenuId, m_title);
m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );
if ( !m_hMenu )
{
@@ -130,9 +130,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
}
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
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->UpdateItemStatus() ;
}
@@ -140,7 +140,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{
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)) ;
}
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
// same effect as wx 0 based and inserting before, we must correct pos
// 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 ;
}
@@ -273,7 +273,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
void wxMenu::SetTitle(const wxString& label)
{
m_title = label ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label ) ;
UMASetMenuTitle(MAC_WXHMENU(m_hMenu) , label , wxFont::GetDefaultEncoding() ) ;
}
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
@@ -580,7 +580,7 @@ void wxMenuBar::MacInstallMenuBar()
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 );
SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , item->GetId() ) ;
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
@@ -589,7 +589,7 @@ void wxMenuBar::MacInstallMenuBar()
{
if ( mh )
{
UMAAppendMenuItem(mh, item->GetText() , entry );
UMAAppendMenuItem(mh, item->GetText() , wxFont::GetDefaultEncoding(), entry);
SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ;
}
}
@@ -601,7 +601,7 @@ void wxMenuBar::MacInstallMenuBar()
}
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) ;
::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() */ ) ;
{
menu->MacBeforeDisplay( false ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( pos == m_menus.GetCount() - 1)
{
::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);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() && s_macInstalledMenuBar == this )
{
@@ -762,7 +762,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
m_titles.Add(title);
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title ) ;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
if ( IsAttached() )
{

View File

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

View File

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

View File

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

View File

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