/////////////////////////////////////////////////////////////////////////////
-// Name: fontdlg.cpp
+// Name: src/msw/fontdlg.cpp
// Purpose: wxFontDialog class
// Author: Julian Smart
// Modified by:
#pragma hdrstop
#endif
+#if wxUSE_FONTDLG
+
#ifndef WX_PRECOMP
#include "wx/defs.h"
#include "wx/utils.h"
#include "wx/fontdlg.h"
-#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__)
- #include <commdlg.h>
+#if !defined(__WIN32__) || defined(__SALFORDC__)
+#include <windows.h>
+#include <commdlg.h>
#endif
#include "wx/msw/private.h"
// wxWin macros
// ----------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
- IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
-#endif
+IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
// ============================================================================
// implementation
// 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;
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() )
return wxID_CANCEL;
}
}
+
+#endif // wxUSE_FONTDLG