X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..7cfdeaadb8070f806cfdfa6c9021c71f3391b742:/src/msw/fontdlg.cpp?ds=sidebyside diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index 75acaeeea3..b15e0adcbd 100644 --- a/src/msw/fontdlg.cpp +++ b/src/msw/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.cpp +// Name: src/msw/fontdlg.cpp // Purpose: wxFontDialog class // Author: Julian Smart // Modified by: @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_FONTDLG + #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/utils.h" @@ -52,7 +54,7 @@ // wxWin macros // ---------------------------------------------------------------------------- - IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) +IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) // ============================================================================ // implementation @@ -103,7 +105,13 @@ int wxFontDialog::ShowModal() wxFillLogFont(&logFont, &m_fontData.initialFont); } - chooseFontStruct.rgbColors = wxColourToRGB(m_fontData.fontColour); + if ( m_fontData.fontColour.Ok() ) + { + chooseFontStruct.rgbColors = wxColourToRGB(m_fontData.fontColour); + + // need this for the colour to be taken into account + flags |= CF_EFFECTS; + } // CF_ANSIONLY flag is obsolete for Win32 if ( !m_fontData.GetAllowSymbols() ) @@ -156,3 +164,5 @@ int wxFontDialog::ShowModal() return wxID_CANCEL; } } + +#endif // wxUSE_FONTDLG