]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/brush.cpp
No real changes, just make wxWindow::CanScroll() virtual.
[wxWidgets.git] / src / dfb / brush.cpp
index 51a295f9979be411cfa4d44f741edc38697abd8f..c4935f602e10db9146e6499308519fa778237cbb 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxBrush class implementation
 // Author:      Vaclav Slavik
 // Created:     2006-08-04
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 REA Elektronik GmbH
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -48,7 +47,7 @@ public:
         if ( style != wxSOLID && style != wxTRANSPARENT )
         {
             wxFAIL_MSG( wxT("only wxSOLID and wxTRANSPARENT styles are supported") );
-            style = wxSOLID;
+            style = wxBRUSHSTYLE_SOLID;
         }
 
         m_style = style;
@@ -69,6 +68,13 @@ wxBrush::wxBrush(const wxColour &colour, wxBrushStyle style)
     m_refData = new wxBrushRefData(colour, style);
 }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+wxBrush::wxBrush(const wxColour& col, int style)
+{
+    m_refData = new wxBrushRefData(col, (wxBrushStyle)style);
+}
+#endif
+
 wxBrush::wxBrush(const wxBitmap &stippleBitmap)
 {
     wxFAIL_MSG( wxT("brushes with stipple bitmaps not implemented") );
@@ -78,28 +84,20 @@ wxBrush::wxBrush(const wxBitmap &stippleBitmap)
 
 bool wxBrush::operator==(const wxBrush& brush) const
 {
-#warning "this is incorrect (MGL too)"
+#warning "this is incorrect"
     return m_refData == brush.m_refData;
 }
 
 wxBrushStyle wxBrush::GetStyle() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return 0;
-    }
+    wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
 
     return M_BRUSHDATA->m_style;
 }
 
-wxColour& wxBrush::GetColour() const
+wxColour wxBrush::GetColour() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return wxNullColour;
-    }
+    wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
 
     return M_BRUSHDATA->m_colour;
 }