#include "assert.h"
-#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
-#endif
wxBrushRefData::wxBrushRefData(void)
{
{
m_refData = new wxBrushRefData;
- M_BRUSHDATA->m_style = wxSTIPPLE;
M_BRUSHDATA->m_stipple = stipple;
+ if (M_BRUSHDATA->m_stipple.GetMask())
+ M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
+ else
+ M_BRUSHDATA->m_style = wxSTIPPLE;
+
M_BRUSHDATA->m_hBrush = 0;
RealizeResource();
wxTheBrushList->AddBrush(this);
}
-bool wxBrush::RealizeResource(void)
+bool wxBrush::RealizeResource(void)
{
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0))
{
else
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
break ;
+ case wxSTIPPLE_MASK_OPAQUE:
+ if (M_BRUSHDATA->m_stipple.Ok() && M_BRUSHDATA->m_stipple.GetMask())
+ M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreatePatternBrush((HBITMAP) M_BRUSHDATA->m_stipple.GetMask()->GetMaskBitmap());
+ else
+ M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
+ break ;
case wxSOLID:
default:
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
else return FALSE;
}
-bool wxBrush::IsFree(void)
+bool wxBrush::IsFree() const
{
return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0));
}
Unshare();
M_BRUSHDATA->m_stipple = Stipple;
+ if (M_BRUSHDATA->m_stipple.GetMask())
+ M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
+ else
+ M_BRUSHDATA->m_style = wxSTIPPLE;
RealizeResource();
}