]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/brush.cpp
setting clipping correctly
[wxWidgets.git] / src / msw / brush.cpp
index 9f44181943b9ad86569adbf47eaea6b741e75656..5e49333dc036dd26480766b4d759118d1014b017 100644 (file)
 // declarations
 // ============================================================================
 
 // declarations
 // ============================================================================
 
-#ifdef __GNUG__
-#pragma implementation "brush.h"
-#endif
-
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#include "wx/brush.h"
+
 #ifndef WX_PRECOMP
     #include "wx/list.h"
     #include "wx/utils.h"
     #include "wx/app.h"
 #ifndef WX_PRECOMP
     #include "wx/list.h"
     #include "wx/utils.h"
     #include "wx/app.h"
-    #include "wx/brush.h"
 #endif // WX_PRECOMP
 
 #include "wx/msw/private.h"
 #endif // WX_PRECOMP
 
 #include "wx/msw/private.h"
@@ -103,7 +100,8 @@ wxBrushRefData::wxBrushRefData(const wxBitmap& stipple)
 }
 
 wxBrushRefData::wxBrushRefData(const wxBrushRefData& data)
 }
 
 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;
                 m_colour(data.m_colour)
 {
     m_style = data.m_style;
@@ -149,28 +147,32 @@ void wxBrushRefData::Free()
     }
 }
 
     }
 }
 
-static int TransllateHatchStyle(int style)
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+
+static int TranslateHatchStyle(int style)
 {
     switch ( 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;
         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;
     }
 }
 
         default:                return -1;
     }
 }
 
+#endif // !__WXMICROWIN__ && !__WXWINCE__
+
 HBRUSH wxBrushRefData::GetHBRUSH()
 {
     if ( !m_hBrush )
     {
 HBRUSH wxBrushRefData::GetHBRUSH()
 {
     if ( !m_hBrush )
     {
-        int hatchStyle = TransllateHatchStyle(m_style);
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+        int hatchStyle = TranslateHatchStyle(m_style);
         if ( hatchStyle == -1 )
         if ( hatchStyle == -1 )
+#endif // !__WXMICROWIN__ && !__WXWINCE__
         {
             switch ( m_style )
             {
         {
             switch ( m_style )
             {
@@ -196,10 +198,12 @@ HBRUSH wxBrushRefData::GetHBRUSH()
                     break;
             }
         }
                     break;
             }
         }
+#ifndef __WXWINCE__
         else // create a hatched brush
         {
             m_hBrush = ::CreateHatchBrush(hatchStyle, m_colour.GetPixel());
         }
         else // create a hatched brush
         {
             m_hBrush = ::CreateHatchBrush(hatchStyle, m_colour.GetPixel());
         }
+#endif
 
         if ( !m_hBrush )
         {
 
         if ( !m_hBrush )
         {
@@ -240,16 +244,6 @@ wxBrush::~wxBrush()
 // wxBrush house keeping stuff
 // ----------------------------------------------------------------------------
 
 // wxBrush house keeping stuff
 // ----------------------------------------------------------------------------
 
-wxBrush& wxBrush::operator=(const wxBrush& brush)
-{
-    if ( *this != brush )
-    {
-        Ref(brush);
-    }
-
-    return *this;
-}
-
 bool wxBrush::operator==(const wxBrush& brush) const
 {
     const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData;
 bool wxBrush::operator==(const wxBrush& brush) const
 {
     const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData;
@@ -331,5 +325,3 @@ void wxBrush::SetStipple(const wxBitmap& stipple)
 
     M_BRUSHDATA->SetStipple(stipple);
 }
 
     M_BRUSHDATA->SetStipple(stipple);
 }
-
-