// Name: src/gtk1/brush.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
public:
wxBrushRefData()
{
- m_style = 0;
+ m_style = wxBRUSHSTYLE_INVALID;
}
wxBrushRefData( const wxBrushRefData& data )
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();
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()
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;
}
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;
}