don't set m_font upfront in wxMac, let the GetDefaultAttributes mechanism used by other ports pick the right font if m_font is wxNullFont
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -152,7 +152,7 @@ wxSize wxButton::DoGetBestSize() const
|
||||
OSStatus err = m_peer->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
|
||||
verify_noerr( err );
|
||||
|
||||
wxCFStringRef str( m_label, m_font.GetEncoding() );
|
||||
wxCFStringRef str( m_label, GetFont().GetEncoding() );
|
||||
|
||||
#if wxMAC_USE_ATSU_TEXT
|
||||
SInt16 baseline;
|
||||
|
@@ -139,7 +139,7 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
|
||||
|
||||
UMAInsertMenuItem(MAC_WXHMENU( m_macPopUpMenuHandle ),
|
||||
items[i],
|
||||
m_font.GetEncoding(),
|
||||
GetFont().GetEncoding(),
|
||||
idx);
|
||||
m_datas.Insert( NULL, idx );
|
||||
AssignNewItemClientData(idx, clientData, i, type);
|
||||
|
@@ -422,7 +422,7 @@ wxString wxComboBox::GetValue() const
|
||||
#if USE_HICOMBOBOX
|
||||
CFStringRef myString;
|
||||
HIComboBoxCopyTextItemAtIndex( m_peer->GetControlRef(), (CFIndex)GetSelection(), &myString );
|
||||
return wxMacCFStringHolder( myString, m_font.GetEncoding() ).AsString();
|
||||
return wxMacCFStringHolder( myString, GetFont().GetEncoding() ).AsString();
|
||||
#else
|
||||
wxString result;
|
||||
|
||||
@@ -547,7 +547,7 @@ int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
|
||||
HIComboBoxInsertTextItemAtIndex(m_peer->GetControlRef(),
|
||||
(CFIndex)pos,
|
||||
wxMacCFStringHolder(items[i],
|
||||
m_font.GetEncoding()));
|
||||
GetFont().GetEncoding()));
|
||||
AssignNewItemClientData(pos, clientData, i, type);
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ void wxComboBox::SetString(unsigned int n, const wxString& s)
|
||||
{
|
||||
#if USE_HICOMBOBOX
|
||||
verify_noerr ( HIComboBoxInsertTextItemAtIndex( m_peer->GetControlRef(), (CFIndex) n,
|
||||
wxMacCFStringHolder(s, m_font.GetEncoding()) ) );
|
||||
wxMacCFStringHolder(s, GetFont().GetEncoding()) ) );
|
||||
verify_noerr ( HIComboBoxRemoveItemAtIndex( m_peer->GetControlRef(), (CFIndex) n + 1 ) );
|
||||
#else
|
||||
m_choice->SetString( n , s );
|
||||
|
@@ -1028,9 +1028,9 @@ bool wxDataViewCtrl::AppendColumn(wxDataViewColumn* columnPtr)
|
||||
wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(this->m_peer));
|
||||
|
||||
#if wxCHECK_VERSION(2,9,0)
|
||||
wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
#else
|
||||
wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1148,9 +1148,9 @@ bool wxDataViewCtrl::PrependColumn(wxDataViewColumn* columnPtr)
|
||||
wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(this->m_peer));
|
||||
|
||||
#if wxCHECK_VERSION(2,9,0)
|
||||
wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
#else
|
||||
wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -87,7 +87,7 @@ int wxDirDialog::ShowModal()
|
||||
options.optionFlags &= ~kNavAllowMultipleFiles;
|
||||
if (err == noErr)
|
||||
{
|
||||
wxCFStringRef message(m_message, m_font.GetEncoding());
|
||||
wxCFStringRef message(m_message, GetFont().GetEncoding());
|
||||
options.message = message;
|
||||
err = NavCreateChooseFolderDialog(&options, sStandardNavEventFilter , NULL, this , &dialog);
|
||||
if (err == noErr)
|
||||
|
@@ -301,10 +301,10 @@ int wxFileDialog::ShowModal()
|
||||
// this was always unset in the old code
|
||||
dialogCreateOptions.optionFlags &= ~kNavSelectDefaultLocation;
|
||||
|
||||
wxCFStringRef message(m_message, m_font.GetEncoding());
|
||||
wxCFStringRef message(m_message, GetFont().GetEncoding());
|
||||
dialogCreateOptions.windowTitle = message;
|
||||
|
||||
wxCFStringRef defaultFileName(m_fileName, m_font.GetEncoding());
|
||||
wxCFStringRef defaultFileName(m_fileName, GetFont().GetEncoding());
|
||||
dialogCreateOptions.saveFileName = defaultFileName;
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ int wxFileDialog::ShowModal()
|
||||
myData.menuitems = dialogCreateOptions.popupExtension ;
|
||||
for ( size_t i = 0 ; i < numFilters ; ++i )
|
||||
{
|
||||
CFArrayAppendValue( popup , (CFStringRef) wxCFStringRef( myData.name[i] , m_font.GetEncoding() ) ) ;
|
||||
CFArrayAppendValue( popup , (CFStringRef) wxCFStringRef( myData.name[i] , GetFont().GetEncoding() ) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -979,7 +979,7 @@ bool wxListCtrl::SetColumn(int col, wxListItem& item)
|
||||
{
|
||||
wxFontEncoding enc;
|
||||
if ( m_font.Ok() )
|
||||
enc = m_font.GetEncoding();
|
||||
enc = GetFont().GetEncoding();
|
||||
else
|
||||
enc = wxLocale::GetSystemEncoding();
|
||||
wxCFStringRef cfTitle;
|
||||
|
@@ -864,7 +864,7 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
}
|
||||
else
|
||||
{
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], m_font.GetEncoding() ) ;
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], GetFont().GetEncoding() ) ;
|
||||
menu->MacBeforeDisplay(false) ;
|
||||
|
||||
::InsertMenu(MAC_WXHMENU(_wxMenuAt(m_menus, i)->GetHMenu()), 0);
|
||||
@@ -979,7 +979,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 , m_font.GetEncoding() ) ;
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , GetFont().GetEncoding() ) ;
|
||||
if ( pos == m_menus.GetCount() - 1)
|
||||
::InsertMenu( MAC_WXHMENU(menu->GetHMenu()) , 0 ) ;
|
||||
else
|
||||
@@ -1002,7 +1002,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
|
||||
m_titles.Insert(title, pos);
|
||||
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , GetFont().GetEncoding() ) ;
|
||||
|
||||
if ( IsAttached() && s_macInstalledMenuBar == this )
|
||||
{
|
||||
@@ -1054,7 +1054,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
||||
|
||||
m_titles.Add(title);
|
||||
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , m_font.GetEncoding() ) ;
|
||||
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , title , GetFont().GetEncoding() ) ;
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
|
@@ -110,13 +110,13 @@ int wxMessageDialog::ShowModal()
|
||||
CFStringRef alternateButtonTitle = NULL;
|
||||
CFStringRef otherButtonTitle = NULL;
|
||||
|
||||
wxCFStringRef cfTitle( msgtitle, m_font.GetEncoding() );
|
||||
wxCFStringRef cfText( msgtext, m_font.GetEncoding() );
|
||||
wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() );
|
||||
wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );
|
||||
|
||||
wxCFStringRef cfNoString( m_no.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfYesString( m_yes.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfOKString( m_ok.c_str() , m_font.GetEncoding()) ;
|
||||
wxCFStringRef cfCancelString( m_cancel.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfNoString( m_no.c_str(), GetFont().GetEncoding() );
|
||||
wxCFStringRef cfYesString( m_yes.c_str(), GetFont().GetEncoding() );
|
||||
wxCFStringRef cfOKString( m_ok.c_str() , GetFont().GetEncoding()) ;
|
||||
wxCFStringRef cfCancelString( m_cancel.c_str(), GetFont().GetEncoding() );
|
||||
|
||||
int buttonId[4] = { 0, 0, 0, wxID_CANCEL /* time-out */ };
|
||||
|
||||
@@ -167,13 +167,13 @@ int wxMessageDialog::ShowModal()
|
||||
short result;
|
||||
|
||||
AlertStdCFStringAlertParamRec param;
|
||||
wxCFStringRef cfNoString( m_no.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfYesString( m_yes.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfOKString( m_ok.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfCancelString( m_cancel.c_str(), m_font.GetEncoding() );
|
||||
wxCFStringRef cfNoString( m_no.c_str(), GetFont().GetEncoding() );
|
||||
wxCFStringRef cfYesString( m_yes.c_str(), GetFont().GetEncoding() );
|
||||
wxCFStringRef cfOKString( m_ok.c_str(), GetFont().GetEncoding() );
|
||||
wxCFStringRef cfCancelString( m_cancel.c_str(), GetFont().GetEncoding() );
|
||||
|
||||
wxCFStringRef cfTitle( msgtitle, m_font.GetEncoding() );
|
||||
wxCFStringRef cfText( msgtext, m_font.GetEncoding() );
|
||||
wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() );
|
||||
wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );
|
||||
|
||||
param.movable = true;
|
||||
param.flags = 0;
|
||||
|
@@ -399,7 +399,7 @@ void wxNotebook::MacSetupTabs()
|
||||
page = m_pages[ii];
|
||||
info.version = kControlTabInfoVersionOne;
|
||||
info.iconSuiteID = 0;
|
||||
wxCFStringRef cflabel( page->GetLabel(), m_font.GetEncoding() ) ;
|
||||
wxCFStringRef cflabel( page->GetLabel(), GetFont().GetEncoding() ) ;
|
||||
info.name = cflabel ;
|
||||
m_peer->SetData<ControlTabInfoRecV1>( ii + 1, kControlTabInfoTag, &info ) ;
|
||||
|
||||
|
@@ -92,7 +92,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
OSStatus err = m_peer->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
|
||||
verify_noerr( err );
|
||||
|
||||
wxCFStringRef str( m_label, m_font.GetEncoding() );
|
||||
wxCFStringRef str( m_label, GetFont().GetEncoding() );
|
||||
|
||||
#if wxMAC_USE_ATSU_TEXT
|
||||
SInt16 baseline;
|
||||
@@ -179,7 +179,7 @@ void wxStaticText::DoSetLabel(const wxString& label)
|
||||
m_labelOrig = label;
|
||||
m_label = RemoveMnemonics(label);
|
||||
|
||||
wxCFStringRef str( m_label, m_font.GetEncoding() );
|
||||
wxCFStringRef str( m_label, GetFont().GetEncoding() );
|
||||
OSStatus err = m_peer->SetData<CFStringRef>(kControlEntireControl, kControlStaticTextCFStringTag, str);
|
||||
verify_noerr( err );
|
||||
}
|
||||
|
@@ -1526,7 +1526,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
|
||||
InstallEventHandler(
|
||||
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
|
||||
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
|
||||
HIToolbarItemSetLabel( item, wxCFStringRef(label, m_font.GetEncoding()) );
|
||||
HIToolbarItemSetLabel( item, wxCFStringRef(label, GetFont().GetEncoding()) );
|
||||
HIToolbarItemSetImage( item, info2.u.imageRef );
|
||||
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
|
||||
tool->SetToolbarItemRef( item );
|
||||
|
@@ -1209,7 +1209,7 @@ void wxTopLevelWindowMac::DoMacCreateRealWindow(
|
||||
SetWindowBounds( (WindowRef) m_macWindow , kWindowStructureRgn , &theBoundsRect ) ;
|
||||
|
||||
wxAssociateWinWithMacWindow( (WindowRef) m_macWindow , this ) ;
|
||||
SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxCFStringRef( title , m_font.GetEncoding() ) );
|
||||
SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxCFStringRef( title , GetFont().GetEncoding() ) );
|
||||
m_peer = new wxMacControl(this , true /*isRootControl*/) ;
|
||||
|
||||
// There is a bug in 10.2.X for ::GetRootControl returning the window view instead of
|
||||
@@ -1306,7 +1306,7 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool WXUNUSED(inIsActiva
|
||||
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
||||
{
|
||||
wxWindow::SetLabel( title ) ;
|
||||
SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxCFStringRef( title , m_font.GetEncoding() ) ) ;
|
||||
SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxCFStringRef( title , GetFont().GetEncoding() ) ) ;
|
||||
}
|
||||
|
||||
wxString wxTopLevelWindowMac::GetTitle() const
|
||||
|
@@ -885,9 +885,6 @@ void wxWindowMac::Init()
|
||||
m_macIsUserPane = true;
|
||||
m_clipChildren = false ;
|
||||
m_cachedClippedRectValid = false ;
|
||||
|
||||
// we need a valid font for the encodings
|
||||
wxWindowBase::SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
}
|
||||
|
||||
wxWindowMac::~wxWindowMac()
|
||||
|
Reference in New Issue
Block a user