]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/brush.cpp
Add wxDataViewCtrl::GTKPathToItem() function and use it.
[wxWidgets.git] / src / dfb / brush.cpp
index 6d310fc0bd2c24e7e553c3c67ec2f5ce05fb9bfc..87ba89e3092fe93c13be01cad6c8048926e245df 100644 (file)
@@ -29,7 +29,7 @@
 class wxBrushRefData : public wxGDIRefData
 {
 public:
-    wxBrushRefData(const wxColour& clr = wxNullColour, int style = wxSOLID)
+    wxBrushRefData(const wxColour& clr = wxNullColour, wxBrushStyle style = wxBRUSHSTYLE_SOLID)
     {
         m_colour = clr;
         SetStyle(style);
@@ -43,19 +43,19 @@ public:
 
     virtual bool IsOk() const { return m_colour.IsOk(); }
 
-    void SetStyle(int style)
+    void SetStyle(wxBrushStyle style)
     {
         if ( style != wxSOLID && style != wxTRANSPARENT )
         {
             wxFAIL_MSG( wxT("only wxSOLID and wxTRANSPARENT styles are supported") );
-            style = wxSOLID;
+            style = wxBRUSHSTYLE_SOLID;
         }
 
         m_style = style;
     }
 
     wxColour       m_colour;
-    int            m_style;
+    wxBrushStyle   m_style;
 };
 
 //-----------------------------------------------------------------------------
@@ -64,11 +64,18 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
 
-wxBrush::wxBrush(const wxColour &colour, int style)
+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") );
@@ -82,24 +89,16 @@ bool wxBrush::operator==(const wxBrush& brush) const
     return m_refData == brush.m_refData;
 }
 
-int wxBrush::GetStyle() const
+wxBrushStyle wxBrush::GetStyle() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return 0;
-    }
+    wxCHECK_MSG( Ok(), 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( Ok(), wxNullColour, wxT("invalid brush") );
 
     return M_BRUSHDATA->m_colour;
 }
@@ -122,7 +121,7 @@ void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
     M_BRUSHDATA->m_colour.Set(r, g, b);
 }
 
-void wxBrush::SetStyle(int style)
+void wxBrush::SetStyle(wxBrushStyle style)
 {
     AllocExclusive();
     M_BRUSHDATA->SetStyle(style);