X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/292e5e1f17af67a5885f1fdaa8c45a8a5a2a3ca5..472137baebae6c011ad7d70285de454b9ce7796d:/src/osx/carbon/fontdlg.cpp diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index bfc19e1386..221f769ed8 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/fontdlg.cpp +// Name: src/osx/carbon/fontdlg.cpp // Purpose: wxFontDialog class for carbon 10.2+. // Author: Ryan Norton // Modified by: @@ -46,12 +46,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) -#include "wx/osx/uma.h" +#include "wx/osx/private.h" // --------------------------------------------------------------------------- // wxFontDialog // --------------------------------------------------------------------------- +#if wxOSX_USE_CARBON + static const EventTypeSpec eventList[] = { { kEventClassFont, kEventFontSelection } , @@ -191,6 +193,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), } DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacCarbonFontPanelHandler ) +#endif wxFontDialog::wxFontDialog() { @@ -213,6 +216,8 @@ bool wxFontDialog::Create(wxWindow *WXUNUSED(parent), const wxFontData& data) int wxFontDialog::ShowModal() { +#if wxOSX_USE_CARBON + OSStatus err ; wxFont font = *wxNORMAL_FONT ; if ( m_fontData.m_initialFont.Ok() ) @@ -224,8 +229,9 @@ int wxFontDialog::ShowModal() #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontDescriptorRef descr = (CTFontDescriptorRef)font.MacGetCTFontDescriptor(); + CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.MacGetCTFont() ); err = SetFontInfoForSelection (kFontSelectionCoreTextType,1, &descr , NULL); + CFRelease( descr ); setup = true; } #endif @@ -247,10 +253,12 @@ int wxFontDialog::ShowModal() if ( !FPIsFontPanelVisible() ) FPShowHideFontPanel(); - +#endif int retval = RunMixedFontDialog(this); +#if wxOSX_USE_CARBON ::RemoveEventHandler(handler); +#endif return retval ; }