X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1c40652a0c2d6752c57df1b8aed22fae7e118dd..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/osx/carbon/fontdlg.cpp diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index 9846fffdc1..80c103c46f 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -103,7 +103,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), FMFontFamily fontFamily = cEvent.GetParameter(kEventParamFMFontFamily); ATSFontFamilyRef atsfontfamilyref = FMGetATSFontFamilyRefFromFontFamily( fontFamily ) ; OSStatus err = ATSFontFamilyGetName( atsfontfamilyref , kATSOptionFlagsDefault , &cfName ) ; - if ( err == noErr ) + if ( err != noErr ) { wxFAIL_MSG("ATSFontFamilyGetName failed"); } @@ -223,7 +223,7 @@ int wxFontDialog::ShowModal() OSStatus err ; wxFont font = *wxNORMAL_FONT ; - if ( m_fontData.m_initialFont.Ok() ) + if ( m_fontData.m_initialFont.IsOk() ) { font = m_fontData.m_initialFont ; } @@ -232,7 +232,7 @@ int wxFontDialog::ShowModal() #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.GetCTFont() ); + CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.OSXGetCTFont() ); err = SetFontInfoForSelection (kFontSelectionCoreTextType,1, &descr , NULL); CFRelease( descr ); setup = true; @@ -257,8 +257,9 @@ int wxFontDialog::ShowModal() if ( !FPIsFontPanelVisible() ) FPShowHideFontPanel(); #endif + wxDialog::OSXBeginModalDialog(); int retval = RunMixedFontDialog(this); - + wxDialog::OSXEndModalDialog(); #if wxOSX_USE_CARBON ::RemoveEventHandler(handler); #endif @@ -315,7 +316,7 @@ void wxFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) wxSize size = GetSize(); wxFont font = GetFont(); - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); // Calculate vertical centre @@ -512,7 +513,7 @@ void wxFontDialog::CreateControls() wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer4->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, _T("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 ); + m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, wxT("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 ); m_sizeCtrl->SetHelpText(_("The font size in points.")); if (ShowToolTips()) m_sizeCtrl->SetToolTip(_("The font size in points.")); @@ -588,7 +589,7 @@ void wxFontDialog::CreateControls() wxFontEnumerator enumerator; enumerator.EnumerateFacenames(); wxArrayString facenames = enumerator.GetFacenames(); - if (facenames) + if (!facenames.empty()) { facenames.Add(_("")); facenames.Add(_("")); @@ -603,7 +604,7 @@ void wxFontDialog::CreateControls() InitializeControls(); m_previewCtrl->SetFont(m_dialogFont); - if (m_fontData.GetColour().Ok()) + if (m_fontData.GetColour().IsOk()) { m_previewCtrl->SetForegroundColour(m_fontData.GetColour()); } @@ -699,7 +700,7 @@ void wxFontDialog::InitializeFont() bool fontUnderline = false; wxString fontName; - if (m_fontData.m_initialFont.Ok()) + if (m_fontData.m_initialFont.IsOk()) { fontFamily = m_fontData.m_initialFont.GetFamily(); fontWeight = m_fontData.m_initialFont.GetWeight(); @@ -737,7 +738,7 @@ void wxFontDialog::InitializeControls() } m_facenameCtrl->SetStringSelection(facename); - if (m_colourCtrl && m_fontData.GetColour().Ok()) + if (m_colourCtrl && m_fontData.GetColour().IsOk()) { m_colourCtrl->SetColour(m_fontData.GetColour()); m_colourCtrl->Refresh();