X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f884a0dccd6b642f35c441ac9bfc87a6d5b4d35..2028c33ab5a39a12bd410ac953731a56ad6377ba:/src/mgl/brush.cpp?ds=sidebyside diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index b8f6073f38..a03abbfb1c 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -85,7 +85,7 @@ public: m_colour == data.m_colour); } - int m_style; + wxBrushStyle m_style; wxColour m_colour; wxBitmap m_stipple; pixpattern24_t m_pixPattern; @@ -126,18 +126,27 @@ wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject) -wxBrush::wxBrush(const wxColour &colour, int style) +wxBrush::wxBrush(const wxColour &colour, wxBrushStyle style) { m_refData = new wxBrushRefData(); M_BRUSHDATA->m_style = 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 = colour; +} +#endif + wxBrush::wxBrush(const wxBitmap &stippleBitmap) { - wxCHECK_RET( stippleBitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stippleBitmap.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); m_refData = new wxBrushRefData(); M_BRUSHDATA->m_colour = *wxBLACK; @@ -166,35 +175,23 @@ 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; } wxBitmap *wxBrush::GetStipple() const { - if (m_refData == NULL) - { - wxFAIL_MSG( wxT("invalid brush") ); - return &wxNullBitmap; - } + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } @@ -225,7 +222,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->m_style = style; @@ -235,9 +232,9 @@ void wxBrush::SetStipple(const wxBitmap& stipple) { AllocExclusive(); - wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); M_BRUSHDATA->m_stipple = stipple; wxBitmapToPixPattern(stipple, &(M_BRUSHDATA->m_pixPattern),