]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxFont::Underlined() and MakeUnderlined() methods.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:46:59 +0000 (12:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:46:59 +0000 (12:46 +0000)
Add two more helpers for consistency with the existing methods such as Bold()
and MakeBold().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/font.h
interface/wx/font.h
src/common/fontcmn.cpp

index 52638ef724c2c700afac52391c3c7b6108a399e8..dd27fe19eed1f0bed723601c383e859ef24c2154 100644 (file)
@@ -467,6 +467,7 @@ All (GUI):
 - Added support for saving PNG files with palette (troelsk).
 - Added support for saving as GIF and animated GIF (troelsk).
 - Fix wxWrapSizer minimal size calculation (Catalin Raceanu).
+- Added wxFont::Underlined() and MakeUnderlined() methods.
 
 GTK:
 
index 35d696a4579517c9a3e7e70956dba249466f591e..3109409104d9ab4c1ceac02adb20eb0fb912355b 100644 (file)
@@ -303,12 +303,14 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
     /* functions for modifying font in place */ \
     wxFont& MakeBold(); \
     wxFont& MakeItalic(); \
+    wxFont& MakeUnderlined(); \
     wxFont& MakeLarger() { return Scale(1.2f); } \
     wxFont& MakeSmaller() { return Scale(1/1.2f); } \
     wxFont& Scale(float x); \
     /* functions for creating fonts based on this one */ \
     wxFont Bold() const; \
     wxFont Italic() const; \
+    wxFont Underlined() const; \
     wxFont Larger() const { return Scaled(1.2f); } \
     wxFont Smaller() const { return Scaled(1/1.2f); } \
     wxFont Scaled(float x) const
index ffa5505743bb49e5a2af87a545742e9ac30ea394..47afe9019a317294b6b3d39618f2dc96c02c09b1 100644 (file)
@@ -574,6 +574,15 @@ public:
      */
     wxFont Smaller() const;
 
+    /**
+        Returns underlined version of this font.
+
+        @see MakeUnderlined()
+
+        @since 2.9.2
+     */
+    wxFont Underlined() const;
+
     /**
         Changes this font to be bold.
 
@@ -616,6 +625,15 @@ public:
      */
     wxFont& MakeSmaller();
 
+    /**
+        Changes this font to be underlined.
+
+        @see Underlined()
+
+        @since 2.9.2
+     */
+    wxFont& MakeUnderlined();
+
     /**
         Changes the size of this font.
 
index 01587a796ff5451af028ab306520dba886eaa4f7..2125ea97e9a203b0467ddcb2fcd4e0fefeed58f6 100644 (file)
@@ -513,7 +513,20 @@ wxFont& wxFont::MakeItalic()
 wxFont wxFont::Italic() const
 {
     wxFont font(*this);
-    font.SetStyle(wxFONTSTYLE_ITALIC);
+    font.MakeItalic();
+    return font;
+}
+
+wxFont& wxFont::MakeUnderlined()
+{
+    SetUnderlined(true);
+    return *this;
+}
+
+wxFont wxFont::Underlined() const
+{
+    wxFont font(*this);
+    font.MakeUnderlined();
     return font;
 }