X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..c3d15542d6047f49f493dbd5559fab99c06a336e:/src/msw/fontdlg.cpp diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index 75acaeeea3..fdcbccd218 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" @@ -36,8 +38,9 @@ #include "wx/fontdlg.h" -#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__) - #include +#if !defined(__WIN32__) || defined(__SALFORDC__) +#include +#include #endif #include "wx/msw/private.h" @@ -52,7 +55,7 @@ // wxWin macros // ---------------------------------------------------------------------------- - IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) +IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) // ============================================================================ // implementation @@ -62,27 +65,6 @@ // wxFontDialog // ---------------------------------------------------------------------------- -wxFontDialog::wxFontDialog() -{ - m_parent = NULL; -} - -wxFontDialog::wxFontDialog(wxWindow *parent, wxFontData *data) -{ - Create(parent, data); -} - -bool wxFontDialog::Create(wxWindow *parent, wxFontData *data) -{ - m_parent = parent; - - wxCHECK_MSG( data, FALSE, _T("no font data in wxFontDialog") ); - - m_fontData = *data; - - return TRUE; -} - int wxFontDialog::ShowModal() { DWORD flags = CF_SCREENFONTS | CF_NOSIMULATIONS; @@ -103,7 +85,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 +144,5 @@ int wxFontDialog::ShowModal() return wxID_CANCEL; } } + +#endif // wxUSE_FONTDLG