X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4a81a2e96b5a349ee9430b91d36e7e8a21d7976..53997bc265b691aaf12fafd259a5a2d2a27b0565:/src/msw/brush.cpp diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index 4a46f5c0b4..83f9652783 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -33,9 +33,7 @@ #include "assert.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) -#endif wxBrushRefData::wxBrushRefData(void) { @@ -88,8 +86,12 @@ wxBrush::wxBrush(const wxBitmap& stipple) { 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(); @@ -98,7 +100,7 @@ wxBrush::wxBrush(const wxBitmap& stipple) wxTheBrushList->AddBrush(this); } -bool wxBrush::RealizeResource(void) +bool wxBrush::RealizeResource(void) { if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0)) { @@ -125,6 +127,7 @@ bool wxBrush::RealizeResource(void) // - could choose white always for a quick solution break; ***/ +#ifndef __WXMICROWIN__ case wxBDIAGONAL_HATCH: M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateHatchBrush(HS_BDIAGONAL,ms_colour) ; break ; @@ -149,6 +152,13 @@ bool wxBrush::RealizeResource(void) 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 ; +#endif case wxSOLID: default: M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ; @@ -168,7 +178,7 @@ WXHANDLE wxBrush::GetResourceHandle(void) return (WXHANDLE) M_BRUSHDATA->m_hBrush; } -bool wxBrush::FreeResource(bool force) +bool wxBrush::FreeResource(bool WXUNUSED(force)) { if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0)) { @@ -179,7 +189,7 @@ bool wxBrush::FreeResource(bool force) else return FALSE; } -bool wxBrush::IsFree(void) +bool wxBrush::IsFree() const { return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0)); } @@ -232,6 +242,10 @@ void wxBrush::SetStipple(const wxBitmap& Stipple) 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(); }