#include <windows.h>
-#ifndef __WIN32__
+#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__)
#include <commdlg.h>
#endif
wxFontDialog::wxFontDialog(void)
{
- dialogParent = NULL;
+ m_dialogParent = NULL;
}
wxFontDialog::wxFontDialog(wxWindow *parent, wxFontData *data)
bool wxFontDialog::Create(wxWindow *parent, wxFontData *data)
{
- dialogParent = parent;
-
+ m_dialogParent = parent;
+
if (data)
- fontData = *data;
+ m_fontData = *data;
return TRUE;
}
memset(&chooseFontStruct, 0, sizeof(CHOOSEFONT));
chooseFontStruct.lStructSize = sizeof(CHOOSEFONT);
- chooseFontStruct.hwndOwner = (HWND) (dialogParent ? (HWND) dialogParent->GetHWND() : NULL);
+ chooseFontStruct.hwndOwner = (HWND) (m_dialogParent ? (HWND) m_dialogParent->GetHWND() : NULL);
chooseFontStruct.lpLogFont = &logFont;
- if (fontData.initialFont.Ok())
+ if (m_fontData.initialFont.Ok())
{
flags |= CF_INITTOLOGFONTSTRUCT;
- wxFillLogFont(&logFont, & fontData.initialFont);
+ wxFillLogFont(&logFont, & m_fontData.initialFont);
}
chooseFontStruct.iPointSize = 0;
- chooseFontStruct.rgbColors = RGB((BYTE)fontData.fontColour.Red(), (BYTE)fontData.fontColour.Green(), (BYTE)fontData.fontColour.Blue());
+ chooseFontStruct.rgbColors = RGB((BYTE)m_fontData.fontColour.Red(), (BYTE)m_fontData.fontColour.Green(), (BYTE)m_fontData.fontColour.Blue());
- if (!fontData.GetAllowSymbols())
+ if (!m_fontData.GetAllowSymbols())
flags |= CF_ANSIONLY;
- if (fontData.GetEnableEffects())
+ if (m_fontData.GetEnableEffects())
flags |= CF_EFFECTS;
- if (fontData.GetShowHelp())
+ if (m_fontData.GetShowHelp())
flags |= CF_SHOWHELP;
- if (!(fontData.minSize == 0 && fontData.maxSize == 0))
+ if (!(m_fontData.minSize == 0 && m_fontData.maxSize == 0))
{
- chooseFontStruct.nSizeMin = fontData.minSize;
- chooseFontStruct.nSizeMax = fontData.maxSize;
+ chooseFontStruct.nSizeMin = m_fontData.minSize;
+ chooseFontStruct.nSizeMax = m_fontData.maxSize;
flags |= CF_LIMITSIZE;
}
// Restore values
if (success)
{
- fontData.fontColour.Set(GetRValue(chooseFontStruct.rgbColors), GetGValue(chooseFontStruct.rgbColors),
+ m_fontData.fontColour.Set(GetRValue(chooseFontStruct.rgbColors), GetGValue(chooseFontStruct.rgbColors),
GetBValue(chooseFontStruct.rgbColors));
- fontData.chosenFont = wxCreateFontFromLogFont(&logFont);
+ m_fontData.chosenFont = wxCreateFontFromLogFont(&logFont);
}
return success ? wxID_OK : wxID_CANCEL;
// up fonts. So, set ppInch to a constant 96 dpi.
ppInch = 96;
-#if FONT_SIZE_COMPATIBILITY
+#if wxFONT_SIZE_COMPATIBILITY
// Incorrect, but compatible with old wxWindows behaviour
int nHeight = (font->GetPointSize()*ppInch/72);
#else
logFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
logFont->lfQuality = PROOF_QUALITY;
logFont->lfPitchAndFamily = DEFAULT_PITCH | ff_family;
- strcpy(logFont->lfFaceName, ff_face);
+ wxStrcpy(logFont->lfFaceName, ff_face);
}
wxFont wxCreateFontFromLogFont(LOGFONT *logFont) // , bool createNew)
int fontWeight = wxNORMAL;
int fontPoints = 10;
bool fontUnderline = FALSE;
- char *fontFace = NULL;
+ wxChar *fontFace = NULL;
// int lfFamily = logFont->lfPitchAndFamily & 0xF0;
int lfFamily = logFont->lfPitchAndFamily;