X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..bdebb379299aaf1ee588dbe15968829df49ccedc:/src/msw/brush.cpp?ds=sidebyside diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index e47a77f3b1..07c11e9bdb 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -5,15 +5,15 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ // declarations // ============================================================================ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "brush.h" #endif @@ -103,7 +103,8 @@ wxBrushRefData::wxBrushRefData(const wxBitmap& stipple) } wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) - : m_stipple(data.m_stipple), + : wxGDIRefData(), + m_stipple(data.m_stipple), m_colour(data.m_colour) { m_style = data.m_style; @@ -149,28 +150,32 @@ void wxBrushRefData::Free() } } -static int TransllateHatchStyle(int style) +#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) + +static int TranslateHatchStyle(int style) { switch ( style ) { -#ifndef __WXMICROWIN__ case wxBDIAGONAL_HATCH: return HS_BDIAGONAL; case wxCROSSDIAG_HATCH: return HS_DIAGCROSS; case wxFDIAGONAL_HATCH: return HS_FDIAGONAL; case wxCROSS_HATCH: return HS_CROSS; case wxHORIZONTAL_HATCH:return HS_HORIZONTAL; case wxVERTICAL_HATCH: return HS_VERTICAL; -#endif // __WXMICROWIN__ default: return -1; } } +#endif // !__WXMICROWIN__ && !__WXWINCE__ + HBRUSH wxBrushRefData::GetHBRUSH() { if ( !m_hBrush ) { - int hatchStyle = TransllateHatchStyle(m_style); +#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) + int hatchStyle = TranslateHatchStyle(m_style); if ( hatchStyle == -1 ) +#endif // !__WXMICROWIN__ && !__WXWINCE__ { switch ( m_style ) { @@ -196,10 +201,12 @@ HBRUSH wxBrushRefData::GetHBRUSH() break; } } +#ifndef __WXWINCE__ else // create a hatched brush { m_hBrush = ::CreateHatchBrush(hatchStyle, m_colour.GetPixel()); } +#endif if ( !m_hBrush ) { @@ -242,7 +249,7 @@ wxBrush::~wxBrush() wxBrush& wxBrush::operator=(const wxBrush& brush) { - if ( *this != brush ) + if ( this != &brush ) { Ref(brush); }