From 76e23cdba3a2e58e788dd18734e7893185531a5b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 18 Dec 2000 23:49:58 +0000 Subject: [PATCH] compilation fixes for wxMSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 7 +++++++ include/wx/font.h | 2 +- include/wx/msw/font.h | 7 +++++-- src/common/fontcmn.cpp | 3 ++- src/common/fontmap.cpp | 2 +- src/msw/data.cpp | 1 - src/msw/font.cpp | 16 +++++++++++++++- src/msw/fontenum.cpp | 1 + 8 files changed, 32 insertions(+), 7 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4a95094a5e..aa01794a8e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,6 +1,13 @@ wxWindows 2 Change Log ---------------------- +2.4.0 +----- + +wxBase: + +- wxMimeTypesManager now can create file associations too + 2.3.0 ----- diff --git a/include/wx/font.h b/include/wx/font.h index fe9632599c..b5d1650c3b 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -72,7 +72,7 @@ enum wxFontWeight // ---------------------------------------------------------------------------- class WXDLLEXPORT wxFontRefData; -class WXDLLEXPORT wxNativeFontInfo; +struct WXDLLEXPORT wxNativeFontInfo; class WXDLLEXPORT wxFontBase : public wxGDIObject { diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h index 12677e19d5..47454c69e9 100644 --- a/include/wx/msw/font.h +++ b/include/wx/msw/font.h @@ -44,10 +44,11 @@ public: { Init(); - (void)Create(info.pointSize, info.family, info.style, info.weight, - info.underlined, info.faceName, info.encoding); + Create(info); } + wxFont(const wxString& fontDesc); + bool Create(int size, int family, int style, @@ -56,6 +57,8 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); + bool Create(const wxNativeFontInfo& info); + virtual ~wxFont(); // assignment diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 5d0050e77f..7044e66827 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -30,9 +30,10 @@ #ifndef WX_PRECOMP #include "wx/font.h" - #include "wx/fontutil.h" #endif // WX_PRECOMP +#include "wx/fontutil.h" // for wxNativeFontInfo + #include "wx/tokenzr.h" // ============================================================================ diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 5032eeb6bf..9ea0196dd7 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -32,9 +32,9 @@ #include "wx/app.h" #include "wx/log.h" #include "wx/intl.h" - #include "wx/fontutil.h" #endif // PCH +#include "wx/fontutil.h" #include "wx/fontmap.h" #if wxUSE_CONFIG diff --git a/src/msw/data.cpp b/src/msw/data.cpp index e9e1c75c78..0a9c7286a2 100644 --- a/src/msw/data.cpp +++ b/src/msw/data.cpp @@ -96,7 +96,6 @@ wxBrush wxNullBrush; wxPalette wxNullPalette; wxFont wxNullFont; wxColour wxNullColour; -wxNativeFontInfo wxNullNativeFontInfo; // Default window names const wxChar *wxControlNameStr = wxT("control"); diff --git a/src/msw/font.cpp b/src/msw/font.cpp index acb3be04c5..4fcafbeb96 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -29,7 +29,6 @@ #endif #ifndef WX_PRECOMP - #include #include "wx/setup.h" #include "wx/list.h" #include "wx/utils.h" @@ -38,6 +37,8 @@ #include "wx/log.h" #endif // WX_PRECOMP +#include "wx/fontutil.h" + #include "wx/msw/private.h" IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) @@ -166,6 +167,19 @@ void wxFont::Init() wxTheFontList->Append(this); } +bool wxFont::Create(const wxNativeFontInfo& info) +{ + return Create(info.pointSize, info.family, info.style, info.weight, + info.underlined, info.faceName, info.encoding); +} + +wxFont::wxFont(const wxString& fontdesc) +{ + wxNativeFontInfo info; + if ( info.FromString(fontdesc) ) + (void)Create(info); +} + /* Constructor for a font. Note that the real construction is done * in wxDC::SetFont, when information is available about scaling etc. */ diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index b547ec12f4..ca84524de7 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -32,6 +32,7 @@ #include "wx/font.h" #endif +#include "wx/fontutil.h" #include "wx/fontenum.h" #include "wx/fontmap.h" -- 2.47.2