X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11c7d5b6d1cb54d5ffdc11d8ff092b41e225bfb6..546bfbea8180aeee5a16f4abb34e721445277305:/src/msw/fontdlg.cpp diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index 4882531f54..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" @@ -42,6 +44,7 @@ #include "wx/msw/private.h" #include "wx/cmndata.h" +#include "wx/log.h" #include #include @@ -51,9 +54,7 @@ // wxWin macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) -#endif +IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) // ============================================================================ // implementation @@ -104,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() ) @@ -157,3 +164,5 @@ int wxFontDialog::ShowModal() return wxID_CANCEL; } } + +#endif // wxUSE_FONTDLG