X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89bb8035c8920948d6aad8cc24b6ee6b76d401b7..967d3d97839afc098999cee27e0c8c70fa42294c:/src/mac/carbon/fontdlg.cpp diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index 3aefb6d5b2..e155dd7bd5 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -20,13 +20,15 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_FONTDLG + #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/dcclient.h" #include "wx/frame.h" #include "wx/textctrl.h" @@ -123,7 +125,9 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve RGBColor fontColor ; if ( cEvent.GetParameter(kEventParamFontColor, &fontColor) == noErr ) - fontdata.m_fontColour.FromRGBColor((WXCOLORREF*) &fontColor); + { + fontdata.m_fontColour = fontColor; + } else { CFDictionaryRef dict ; @@ -148,7 +152,7 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve { if ( tagPtr[i] == kATSUColorTag && sizePtr[i] == sizeof(RGBColor)) { - fontdata.m_fontColour.FromRGBColor((WXCOLORREF*) valuesPtr); + fontdata.m_fontColour = *(RGBColor *)valuesPtr; break ; } bytePtr = (UInt32*)( (UInt8*)bytePtr + sizePtr[i]); @@ -286,7 +290,7 @@ class wxFontColourSwatchCtrl: public wxControl DECLARE_CLASS(wxFontColourSwatchCtrl) public: wxFontColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); - ~wxFontColourSwatchCtrl(); + virtual ~wxFontColourSwatchCtrl(); void OnPaint(wxPaintEvent& event); void OnMouseEvent(wxMouseEvent& event); @@ -448,7 +452,7 @@ void wxFontDialog::CreateControls() itemBoxSizer3->Add(itemFlexGridSizer4, 1, wxGROW|wxALL, 5); wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL, 5); wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); itemFlexGridSizer4->Add(itemBoxSizer6, 0, wxGROW|wxGROW, 5); @@ -458,7 +462,7 @@ void wxFontDialog::CreateControls() itemBoxSizer6->Add(m_facenameCtrl, 0, wxGROW|wxALL, 5); wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer4->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + 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->SetHelpText(_("The font size in points.")); @@ -467,7 +471,7 @@ void wxFontDialog::CreateControls() itemFlexGridSizer4->Add(m_sizeCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, _("Style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer4->Add(itemStaticText10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer4->Add(itemStaticText10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer4->Add(itemBoxSizer11, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); @@ -499,7 +503,7 @@ void wxFontDialog::CreateControls() if (m_fontData.GetEnableEffects()) { wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("Colour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer4->Add(itemStaticText15, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer4->Add(itemStaticText15, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL, 5); m_colourCtrl = new wxFontColourSwatchCtrl( itemDialog1, wxID_FONTDIALOG_COLOUR, wxDefaultPosition, wxSize(-1, 30), wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); m_colourCtrl->SetHelpText(_("Click to change the font colour.")); @@ -509,7 +513,7 @@ void wxFontDialog::CreateControls() } wxStaticText* itemStaticText17 = new wxStaticText( itemDialog1, wxID_STATIC, _("Preview:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer4->Add(itemStaticText17, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer4->Add(itemStaticText17, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL, 5); m_previewCtrl = new wxFontPreviewCtrl( itemDialog1, wxID_FONTDIALOG_PREVIEW, wxDefaultPosition, wxSize(-1, 70), wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); m_previewCtrl->SetHelpText(_("Shows a preview of the font.")); @@ -782,4 +786,6 @@ int FontFamilyStringToInt(const wxChar *family) #endif // !USE_NATIVE_FONT_DIALOG_FOR_MACOSX -#endif +#endif // wxMAC_USE_EXPERIMENTAL_FONTDIALOG + +#endif // wxUSE_FONTDLG