]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/font.h
IS_HATCH macro replaced with wxBrush::IsHatch() + source and docs little cleaning.
[wxWidgets.git] / include / wx / msw / font.h
index 22708e45ae0288323718fc6f4df8b2f786109d82..5b05caf5d5cd1d790421a0b1b071b3051899eec7 100644 (file)
@@ -16,6 +16,8 @@
     #pragma interface "font.h"
 #endif
 
     #pragma interface "font.h"
 #endif
 
+#include <wx/gdicmn.h>
+
 // ----------------------------------------------------------------------------
 // wxFont
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxFont
 // ----------------------------------------------------------------------------
@@ -40,6 +42,20 @@ public:
         (void)Create(size, family, style, weight, underlined, face, encoding);
     }
 
         (void)Create(size, family, style, weight, underlined, face, encoding);
     }
 
+    wxFont(const wxSize& pixelSize,
+           int family,
+           int style,
+           int weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Init();
+
+        (void)Create(pixelSize, family, style, weight,
+                     underlined, face, encoding);
+    }
+
     wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
     {
         Init();
     wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
     {
         Init();
@@ -55,7 +71,23 @@ public:
                 int weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
                 int weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
-                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        return DoCreate(size, wxDefaultSize, false, family, style,
+                        weight, underlined, face, encoding);
+    }
+
+    bool Create(const wxSize& pixelSize,
+                int family,
+                int style,
+                int weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        return DoCreate(-1, pixelSize, true, family, style,
+                        weight, underlined, face, encoding);
+    }
 
     bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
 
 
     bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
 
@@ -66,6 +98,8 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
+    virtual wxSize GetPixelSize() const;
+    virtual bool IsUsingSizeInPixels() const;
     virtual int GetFamily() const;
     virtual int GetStyle() const;
     virtual int GetWeight() const;
     virtual int GetFamily() const;
     virtual int GetStyle() const;
     virtual int GetWeight() const;
@@ -75,6 +109,7 @@ public:
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
+    virtual void SetPixelSize(const wxSize& pixelSize);
     virtual void SetFamily(int family);
     virtual void SetStyle(int style);
     virtual void SetWeight(int weight);
     virtual void SetFamily(int family);
     virtual void SetStyle(int style);
     virtual void SetWeight(int weight);
@@ -101,6 +136,17 @@ public:
      */
 
 protected:
      */
 
 protected:
+    // real font creation function, used in all cases
+    bool DoCreate(int size,
+                  const wxSize& pixelSize,
+                  bool sizeUsingPixels,
+                  int family,
+                  int style,
+                  int weight,
+                  bool underlined = false,
+                  const wxString& face = wxEmptyString,
+                  wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+
     virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
 
     // common part of all ctors
     virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
 
     // common part of all ctors