]> git.saurik.com Git - wxWidgets.git/commitdiff
Add default constructor to wxGraphicsGradientStop.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Apr 2010 13:55:35 +0000 (13:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Apr 2010 13:55:35 +0000 (13:55 +0000)
It may be convenient to create wxGraphicsGradientStop first and initialize it
later so allow doing this by providing the default argument for constructor
parameters and thus allowing to use it as the default constructor.

See #11897.

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

include/wx/graphics.h
interface/wx/graphics.h

index f2edd54ca30b25d0b6eb5c49c0ecc418431715db..87669dfc7a4036f0aa8beeb79064d508208bc2ff 100644 (file)
@@ -309,7 +309,8 @@ extern WXDLLIMPEXP_DATA_CORE(wxGraphicsPath) wxNullGraphicsPath;
 class wxGraphicsGradientStop
 {
 public:
-    wxGraphicsGradientStop(wxColour col, float pos)
+    wxGraphicsGradientStop(wxColour col = wxTransparentColour,
+                           float pos = 0.)
         : m_col(col),
           m_pos(pos)
     {
index 638787d06941120a644c05fe24068fd2da07d6f3..323d935cea43b606f1709cdc03ecacdd3d04e9c8 100644 (file)
@@ -686,12 +686,10 @@ public:
         @param col The colour of this stop. Note that the alpha component of
             the colour is honoured thus allowing the background colours to
             partially show through the gradient.
-        @param pos The stop position, must be in [0, 1) range with 0 being the
-            beginning and 1 the end of the gradient (but it doesn't make sense
-            to create a stop at position 1 because it would never be visible
-            anyhow).
+        @param pos The stop position, must be in [0, 1] range with 0 being the
+            beginning and 1 the end of the gradient.
     */
-    wxGraphicsGradientStop(wxColour col, float pos);
+    wxGraphicsGradientStop(wxColour col = wxTransparentColour, float pos = 0.);
 
     /// Return the stop colour.
     const wxColour& GetColour() const;
@@ -709,7 +707,7 @@ public:
     /**
         Change the stop position.
 
-        @param pos The new position, must always be in [0, 1) range.
+        @param pos The new position, must always be in [0, 1] range.
     */
     void SetPosition(float pos);
 };