X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cafbad8f17e0c3f1f4453dfd098ac3fa09eaa4a0..ab5ebf521fca1ddff1de556db7c53b25b501cdeb:/src/msw/brush.cpp?ds=inline diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index c201a55748..5f497f119c 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 @@ -151,26 +151,30 @@ void wxBrushRefData::Free() static int TransllateHatchStyle(int style) { +#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) 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; } +#else // __WXMICROWIN__ + return -1; +#endif } HBRUSH wxBrushRefData::GetHBRUSH() { if ( !m_hBrush ) { +#ifndef __WXWINCE__ int hatchStyle = TransllateHatchStyle(m_style); if ( hatchStyle == -1 ) +#endif { switch ( m_style ) { @@ -196,10 +200,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 +248,7 @@ wxBrush::~wxBrush() wxBrush& wxBrush::operator=(const wxBrush& brush) { - if ( *this != brush ) + if ( this != &brush ) { Ref(brush); } @@ -293,11 +299,11 @@ wxBitmap *wxBrush::GetStipple() const return M_BRUSHDATA->GetStipple(); } -WXHBRUSH wxBrush::GetResourceHandle() const +WXHANDLE wxBrush::GetResourceHandle() const { wxCHECK_MSG( Ok(), FALSE, _T("invalid brush") ); - return (WXHBRUSH)M_BRUSHDATA->GetHBRUSH(); + return (WXHANDLE)M_BRUSHDATA->GetHBRUSH(); } // ----------------------------------------------------------------------------