X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e6858cdcb9278b36446466c346d984e7e306553..8516f4fc7a3f0496418e5b77ef3a539aec253b6b:/src/gtk1/brush.cpp diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index 908cfd933c..ea2d852743 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -2,7 +2,6 @@ // Name: src/gtk1/brush.cpp // Purpose: // Author: Robert Roebling -// Id: $Id$ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -27,7 +26,7 @@ class wxBrushRefData: public wxGDIRefData public: wxBrushRefData() { - m_style = 0; + m_style = wxBRUSHSTYLE_INVALID; } wxBrushRefData( const wxBrushRefData& data ) @@ -63,6 +62,15 @@ wxBrush::wxBrush( const wxColour &colour, wxBrushStyle style ) M_BRUSHDATA->m_colour = colour; } +#if FUTURE_WXWIN_COMPATIBILITY_3_0 +wxBrush::wxBrush(const wxColour& col, int style) +{ + m_refData = new wxBrushRefData; + M_BRUSHDATA->m_style = (wxBrushStyle)style; + M_BRUSHDATA->m_colour = col; +} +#endif + wxBrush::wxBrush( const wxBitmap &stippleBitmap ) { m_refData = new wxBrushRefData(); @@ -71,9 +79,9 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap ) M_BRUSHDATA->m_stipple = stippleBitmap; if (M_BRUSHDATA->m_stipple.GetMask()) - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE; else - M_BRUSHDATA->m_style = wxSTIPPLE; + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK; } wxBrush::~wxBrush() @@ -102,33 +110,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const 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; } wxBitmap *wxBrush::GetStipple() const { - if (m_refData == NULL) - { - wxFAIL_MSG( wxT("invalid brush") ); - return &wxNullBitmap; - } + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } @@ -160,11 +156,7 @@ void wxBrush::SetStipple( const wxBitmap& stipple ) M_BRUSHDATA->m_stipple = stipple; if (M_BRUSHDATA->m_stipple.GetMask()) - { - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; - } + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE; else - { - M_BRUSHDATA->m_style = wxSTIPPLE; - } + M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK; }