X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/fontdlg.cpp diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index 80c103c46f..d9f1f99ede 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -42,6 +42,7 @@ #include "wx/fontdlg.h" #include "wx/fontutil.h" +#include "wx/testing.h" #if wxOSX_USE_EXPERIMENTAL_FONTDIALOG @@ -77,7 +78,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), { bool setup = false ; #if wxOSX_USE_CORE_TEXT - if ( UMAGetSystemVersion() >= 0x1050 ) + if ( !setup ) { CTFontDescriptorRef descr; if ( cEvent.GetParameter( kEventParamCTFontDescriptor, typeCTFontDescriptorRef, &descr ) == noErr ) @@ -202,6 +203,11 @@ wxFontDialog::wxFontDialog() { } +wxFontDialog::wxFontDialog(wxWindow *parent) +{ + Create(parent); +} + wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); @@ -211,14 +217,21 @@ wxFontDialog::~wxFontDialog() { } -bool wxFontDialog::Create(wxWindow *WXUNUSED(parent), const wxFontData& data) +bool wxFontDialog::Create(wxWindow *WXUNUSED(parent)) { - m_fontData = data; return true ; } +bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) +{ + m_fontData = data; + return Create(parent) ; +} + int wxFontDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + #if wxOSX_USE_CARBON OSStatus err ; @@ -230,7 +243,7 @@ int wxFontDialog::ShowModal() bool setup = false; #if wxOSX_USE_CORE_TEXT - if ( UMAGetSystemVersion() >= 0x1050 ) + if ( !setup ) { CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.OSXGetCTFont() ); err = SetFontInfoForSelection (kFontSelectionCoreTextType,1, &descr , NULL); @@ -504,7 +517,7 @@ void wxFontDialog::CreateControls() itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL, 5); wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); - itemFlexGridSizer4->Add(itemBoxSizer6, 0, wxGROW|wxGROW, 5); + itemFlexGridSizer4->Add(itemBoxSizer6, 0, wxGROW, 5); wxString* m_facenameCtrlStrings = NULL; m_facenameCtrl = new wxListBox( itemDialog1, wxID_FONTDIALOG_FACENAME, wxDefaultPosition, wxSize(320, 100), 0, m_facenameCtrlStrings, wxLB_SINGLE );