]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/brush.cpp
compilation fix for old broken Borland compiler
[wxWidgets.git] / src / msw / brush.cpp
index 7e107855c927f359167757ad11f125f5ad95febe..83f9652783a2e69f3d9836fa4d93dee2fb3761a7 100644 (file)
@@ -86,8 +86,12 @@ wxBrush::wxBrush(const wxBitmap& stipple)
 {
   m_refData = new wxBrushRefData;
 
 {
   m_refData = new wxBrushRefData;
 
-  M_BRUSHDATA->m_style = wxSTIPPLE;
   M_BRUSHDATA->m_stipple = stipple;
   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();
   M_BRUSHDATA->m_hBrush = 0;
 
   RealizeResource();
@@ -96,7 +100,7 @@ wxBrush::wxBrush(const wxBitmap& stipple)
     wxTheBrushList->AddBrush(this);
 }
 
     wxTheBrushList->AddBrush(this);
 }
 
-bool wxBrush::RealizeResource(void) 
+bool wxBrush::RealizeResource(void)
 {
   if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0))
   {
 {
   if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0))
   {
@@ -123,6 +127,7 @@ bool wxBrush::RealizeResource(void)
                       // - could choose white always for a quick solution
       break;
 ***/
                       // - 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 ;
       case wxBDIAGONAL_HATCH:
         M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateHatchBrush(HS_BDIAGONAL,ms_colour) ;
         break ;
@@ -147,6 +152,13 @@ bool wxBrush::RealizeResource(void)
         else
           M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
         break ;
         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) ;
       case wxSOLID:
       default:
         M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
@@ -230,6 +242,10 @@ void wxBrush::SetStipple(const wxBitmap& Stipple)
     Unshare();
 
     M_BRUSHDATA->m_stipple = 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();
 }
 
     RealizeResource();
 }