]> git.saurik.com Git - wxWidgets.git/commitdiff
further wxPenStyle/wxBrushStyle fixes for builds with compat off (partially by Marcin...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 19 Mar 2008 18:28:04 +0000 (18:28 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 19 Mar 2008 18:28:04 +0000 (18:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp
src/msw/brush.cpp
src/msw/combo.cpp
src/msw/control.cpp
src/msw/dc.cpp
src/msw/dcclient.cpp
src/msw/dragimag.cpp
src/msw/pen.cpp
src/stc/PlatWX.cpp

index a30532702bf5848f69978c412516c28165e7fbd7..6a5a381c0570470d81488ba52ab6809324369094 100644 (file)
@@ -1399,7 +1399,7 @@ void wxWindowBase::ClearBackground()
     // wxGTK uses its own version, no need to add never used code
 #ifndef __WXGTK__
     wxClientDC dc((wxWindow *)this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
+    wxBrush brush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID);
     dc.SetBackground(brush);
     dc.Clear();
 #endif // __WXGTK__
index 8876224ae24151c39ee52d074b7cf83c2456d029..95119e26b68b7012fc69a43623a9b65932899744 100644 (file)
@@ -131,7 +131,8 @@ bool wxBrushRefData::operator==(const wxBrushRefData& data) const
 void wxBrushRefData::DoSetStipple(const wxBitmap& stipple)
 {
     m_stipple = stipple;
-    m_style = stipple.GetMask() ? wxSTIPPLE_MASK_OPAQUE : wxSTIPPLE;
+    m_style = stipple.GetMask() ? wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE
+                                : wxBRUSHSTYLE_STIPPLE;
 }
 
 // ----------------------------------------------------------------------------
@@ -154,12 +155,12 @@ static int TranslateHatchStyle(int style)
 {
     switch ( style )
     {
-        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 wxBRUSHSTYLE_BDIAGONAL_HATCH: return HS_BDIAGONAL;
+        case wxBRUSHSTYLE_CROSSDIAG_HATCH: return HS_DIAGCROSS;
+        case wxBRUSHSTYLE_FDIAGONAL_HATCH: return HS_FDIAGONAL;
+        case wxBRUSHSTYLE_CROSS_HATCH:     return HS_CROSS;
+        case wxBRUSHSTYLE_HORIZONTAL_HATCH:return HS_HORIZONTAL;
+        case wxBRUSHSTYLE_VERTICAL_HATCH:  return HS_VERTICAL;
         default:                return -1;
     }
 }
@@ -177,15 +178,15 @@ HBRUSH wxBrushRefData::GetHBRUSH()
         {
             switch ( m_style )
             {
-                case wxTRANSPARENT:
+                case wxBRUSHSTYLE_TRANSPARENT:
                     m_hBrush = (HBRUSH)::GetStockObject(NULL_BRUSH);
                     break;
 
-                case wxSTIPPLE:
+                case wxBRUSHSTYLE_STIPPLE:
                     m_hBrush = ::CreatePatternBrush(GetHbitmapOf(m_stipple));
                     break;
 
-                case wxSTIPPLE_MASK_OPAQUE:
+                case wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE:
                     m_hBrush = ::CreatePatternBrush((HBITMAP)m_stipple.GetMask()
                                                         ->GetMaskBitmap());
                     break;
@@ -194,7 +195,7 @@ HBRUSH wxBrushRefData::GetHBRUSH()
                     wxFAIL_MSG( _T("unknown brush style") );
                     // fall through
 
-                case wxSOLID:
+                case wxBRUSHSTYLE_SOLID:
                     m_hBrush = ::CreateSolidBrush(m_colour.GetPixel());
                     break;
             }
index 72b053da4516681b7489e75fddb30a9307d054e6..d27c1594d90c8f7e264ac3eba92617331bbadb33 100644 (file)
@@ -309,7 +309,7 @@ static void wxMSWDrawFocusRect( wxDC& dc, const wxRect& rect )
     //   it employs wxCAP_BUTT hack to have line of width 1.
     dc.SetLogicalFunction(wxINVERT);
 
-    wxPen pen(*wxBLACK,1,wxDOT);
+    wxPen pen(*wxBLACK, 1, wxPENSTYLE_DOT);
     pen.SetCap(wxCAP_BUTT);
     dc.SetPen(pen);
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
index b58195c0cf56d8b274f99f3eb4bc4a068f1467a7..24a4e37f2c4bc20c13d2057137d4e99314696d91 100644 (file)
@@ -392,10 +392,9 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
         ::SetBkColor(hdc, wxColourToRGB(colBg));
 
         // draw children with the same colour as the parent
-        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID);
-
+        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg,
+                                                           wxBRUSHSTYLE_SOLID);
         hbr = (WXHBRUSH)brush->GetResourceHandle();
-
     }
 
     // if we use custom background, we should set foreground ourselves too
index 1e326b44a8e5108ad72e3b098b0f0b283e42d233..1db02a2c5733603c8ba8be74a52a0b44db1750ce 100644 (file)
@@ -279,7 +279,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxGDIDLLsCleanupModule, wxModule)
 wxColourChanger::wxColourChanger(wxMSWDCImpl& dc) : m_dc(dc)
 {
     const wxBrush& brush = dc.GetBrush();
-    if ( brush.IsOk() && brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE )
+    if ( brush.IsOk() && brush.GetStyle() == wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE )
     {
         HDC hdc = GetHdcOf(dc);
         m_colFgOld = ::GetTextColor(hdc);
@@ -300,8 +300,8 @@ wxColourChanger::wxColourChanger(wxMSWDCImpl& dc) : m_dc(dc)
         }
 
         SetBkMode(hdc,
-                  dc.GetBackgroundMode() == wxTRANSPARENT ? TRANSPARENT
-                                                          : OPAQUE);
+                  dc.GetBackgroundMode() == wxBRUSHSTYLE_TRANSPARENT
+                                                  ? TRANSPARENT : OPAQUE);
 
         // flag which telsl us to undo changes in the dtor
         m_changed = true;
@@ -740,7 +740,7 @@ void wxMSWDCImpl::DoDrawArc(wxCoord x1, wxCoord y1,
     wxCoord xxx2 = (wxCoord) (xxc+ray);
     wxCoord yyy2 = (wxCoord) (yyc+ray);
 
-    if ( m_brush.IsOk() && m_brush.GetStyle() != wxTRANSPARENT )
+    if ( m_brush.IsOk() && m_brush.GetStyle() != wxBRUSHSTYLE_TRANSPARENT )
     {
         // Have to add 1 to bottom-right corner of rectangle
         // to make semi-circles look right (crooked line otherwise).
@@ -948,7 +948,7 @@ void wxMSWDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h
     // (i.e. drawn with a transparent pen) one pixel smaller in both directions
     // and we want them to have the same size regardless of which pen is used
 #ifndef __WXWINCE__
-    if ( m_pen.GetStyle() == wxTRANSPARENT )
+    if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
     {
         x2dev++;
         y2dev++;
@@ -982,7 +982,7 @@ void wxMSWDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wx
     // Windows draws the filled rectangles without outline (i.e. drawn with a
     // transparent pen) one pixel smaller in both directions and we want them
     // to have the same size regardless of which pen is used - adjust
-    if ( m_pen.GetStyle() == wxTRANSPARENT )
+    if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
     {
         x2++;
         y2++;
@@ -1349,7 +1349,7 @@ void wxMSWDCImpl::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
         old_background = SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
     }
 
-    SetBkMode(GetHdc(), m_backgroundMode == wxTRANSPARENT ? TRANSPARENT
+    SetBkMode(GetHdc(), m_backgroundMode == wxBRUSHSTYLE_TRANSPARENT ? TRANSPARENT
                                                           : OPAQUE);
 
 #ifdef __WXWINCE__
index 3eff38d0d4bbd01b181d52090bf2c6fb58537757..e97fe01af2b2a691b9c822bcd73d0db792bc2bb2 100644 (file)
@@ -110,7 +110,7 @@ void wxWindowDCImpl::InitDC()
     ::SetBkMode(GetHdc(), TRANSPARENT);
 
     // default bg colour is pne of the window
-    SetBackground(wxBrush(m_window->GetBackgroundColour(), wxSOLID));
+    SetBackground(wxBrush(m_window->GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
 
     // since we are a window dc we need to grab the palette from the window
 #if wxUSE_PALETTE
index 4f42ad81d99ef53768300cbfffeeb7e41fdc7354..0f1aa1ebb7bea02c10b231fd22921d658386e0c6 100644 (file)
@@ -218,7 +218,7 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor)
 
     dc2.SetBackground(* wxWHITE_BRUSH);
     dc2.Clear();
-    dc2.SetBackgroundMode(wxTRANSPARENT);
+    dc2.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
     dc2.SetTextForeground(* wxLIGHT_GREY);
     dc2.DrawText(str, 0, 0);
     dc2.DrawText(str, 1, 0);
index d13f4310e5008b8d8eb6b7b9ec9d675c7813b2d6..be20ac765d0b27b35cee088bb2a6a10a07c6721d 100644 (file)
@@ -435,10 +435,12 @@ wxPen::wxPen(const wxColour& col, int width, wxPenStyle style)
     m_refData = new wxPenRefData(col, width, style);
 }
 
+/* error: `wxBrushStyle' has not been declared
 wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
 {
     m_refData = new wxPenRefData(colour, width, (wxPenStyle)style);
 }
+*/
 
 wxPen::wxPen(const wxBitmap& stipple, int width)
 {
index 299aea9e9dddde46201fa52f332233a3c1a5a8b5..79bb27b8018a3eaab84af9d3054b15987d500223 100644 (file)
@@ -289,11 +289,11 @@ bool SurfaceImpl::Initialised() {
 
 
 void SurfaceImpl::PenColour(ColourAllocated fore) {
-    hdc->SetPen(wxPen(wxColourFromCA(fore), 1, wxSOLID));
+    hdc->SetPen(wxPen(wxColourFromCA(fore)));
 }
 
 void SurfaceImpl::BrushColour(ColourAllocated back) {
-    hdc->SetBrush(wxBrush(wxColourFromCA(back), wxSOLID));
+    hdc->SetBrush(wxBrush(wxColourFromCA(back)));
 }
 
 void SurfaceImpl::SetFont(Font &font_) {
@@ -344,7 +344,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
     if (((SurfaceImpl&)surfacePattern).bitmap)
         br = wxBrush(*((SurfaceImpl&)surfacePattern).bitmap);
     else    // Something is wrong so display in red
-        br = wxBrush(*wxRED, wxSOLID);
+        br = wxBrush(*wxRED);
     hdc->SetPen(*wxTRANSPARENT_PEN);
     hdc->SetBrush(br);
     hdc->DrawRectangle(wxRectFromPRectangle(rc));
@@ -475,13 +475,13 @@ void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, int ybase,
 
     SetFont(font);
     hdc->SetTextForeground(wxColourFromCA(fore));
-    hdc->SetBackgroundMode(wxTRANSPARENT);
+    hdc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
 
     // ybase is where the baseline should be, but wxWin uses the upper left
     // corner, so I need to calculate the real position for the text...
     hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent);
 
-    hdc->SetBackgroundMode(wxSOLID);
+    hdc->SetBackgroundMode(wxBRUSHSTYLE_SOLID);
 }