]> git.saurik.com Git - wxWidgets.git/commitdiff
use new pen/brush style names in samples
authorPaul Cornett <paulcor@bullseye.com>
Sat, 1 Dec 2012 22:34:07 +0000 (22:34 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sat, 1 Dec 2012 22:34:07 +0000 (22:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/combo/combo.cpp
samples/drawing/drawing.cpp
samples/printing/printing.cpp

index 419c3e03597a23bd1a440b8a698bb2a3d554add7..057277c474f7ec94c03286b008a19115ac31f1a1 100644 (file)
@@ -189,29 +189,29 @@ public:
         r.Deflate(3);
         r.height -= 2;
 
         r.Deflate(3);
         r.height -= 2;
 
-        int penStyle = wxSOLID;
+        wxPenStyle penStyle = wxPENSTYLE_SOLID;
         if ( item == 1 )
         if ( item == 1 )
-            penStyle = wxTRANSPARENT;
+            penStyle = wxPENSTYLE_TRANSPARENT;
         else if ( item == 2 )
         else if ( item == 2 )
-            penStyle = wxDOT;
+            penStyle = wxPENSTYLE_DOT;
         else if ( item == 3 )
         else if ( item == 3 )
-            penStyle = wxLONG_DASH;
+            penStyle = wxPENSTYLE_LONG_DASH;
         else if ( item == 4 )
         else if ( item == 4 )
-            penStyle = wxSHORT_DASH;
+            penStyle = wxPENSTYLE_SHORT_DASH;
         else if ( item == 5 )
         else if ( item == 5 )
-            penStyle = wxDOT_DASH;
+            penStyle = wxPENSTYLE_DOT_DASH;
         else if ( item == 6 )
         else if ( item == 6 )
-            penStyle = wxBDIAGONAL_HATCH;
+            penStyle = wxPENSTYLE_BDIAGONAL_HATCH;
         else if ( item == 7 )
         else if ( item == 7 )
-            penStyle = wxCROSSDIAG_HATCH;
+            penStyle = wxPENSTYLE_CROSSDIAG_HATCH;
         else if ( item == 8 )
         else if ( item == 8 )
-            penStyle = wxFDIAGONAL_HATCH;
+            penStyle = wxPENSTYLE_FDIAGONAL_HATCH;
         else if ( item == 9 )
         else if ( item == 9 )
-            penStyle = wxCROSS_HATCH;
+            penStyle = wxPENSTYLE_CROSS_HATCH;
         else if ( item == 10 )
         else if ( item == 10 )
-            penStyle = wxHORIZONTAL_HATCH;
+            penStyle = wxPENSTYLE_HORIZONTAL_HATCH;
         else if ( item == 11 )
         else if ( item == 11 )
-            penStyle = wxVERTICAL_HATCH;
+            penStyle = wxPENSTYLE_VERTICAL_HATCH;
 
         wxPen pen( dc.GetTextForeground(), 3, penStyle );
 
 
         wxPen pen( dc.GetTextForeground(), 3, penStyle );
 
index 80f0402fc082819cc27555511449ba33ce110bdc..dd9709656f0dfa009ebc8ffd1f60d81f54d8307b 100644 (file)
@@ -426,22 +426,22 @@ void MyCanvas::DrawTestBrushes(wxDC& dc)
     dc.DrawText(wxT("Solid green"), x + 10, y + 10);
 
     y += HEIGHT;
     dc.DrawText(wxT("Solid green"), x + 10, y + 10);
 
     y += HEIGHT;
-    dc.SetBrush(wxBrush(*wxRED, wxCROSSDIAG_HATCH));
+    dc.SetBrush(wxBrush(*wxRED, wxBRUSHSTYLE_CROSSDIAG_HATCH));
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Diagonally hatched red"), x + 10, y + 10);
 
     y += HEIGHT;
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Diagonally hatched red"), x + 10, y + 10);
 
     y += HEIGHT;
-    dc.SetBrush(wxBrush(*wxBLUE, wxCROSS_HATCH));
+    dc.SetBrush(wxBrush(*wxBLUE, wxBRUSHSTYLE_CROSS_HATCH));
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Cross hatched blue"), x + 10, y + 10);
 
     y += HEIGHT;
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Cross hatched blue"), x + 10, y + 10);
 
     y += HEIGHT;
-    dc.SetBrush(wxBrush(*wxCYAN, wxVERTICAL_HATCH));
+    dc.SetBrush(wxBrush(*wxCYAN, wxBRUSHSTYLE_VERTICAL_HATCH));
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Vertically hatched cyan"), x + 10, y + 10);
 
     y += HEIGHT;
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Vertically hatched cyan"), x + 10, y + 10);
 
     y += HEIGHT;
-    dc.SetBrush(wxBrush(*wxBLACK, wxHORIZONTAL_HATCH));
+    dc.SetBrush(wxBrush(*wxBLACK, wxBRUSHSTYLE_HORIZONTAL_HATCH));
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Horizontally hatched black"), x + 10, y + 10);
 
     dc.DrawRectangle(x, y, WIDTH, HEIGHT);
     dc.DrawText(wxT("Horizontally hatched black"), x + 10, y + 10);
 
@@ -458,7 +458,7 @@ void MyCanvas::DrawTestBrushes(wxDC& dc)
 
 void MyCanvas::DrawTestPoly(wxDC& dc)
 {
 
 void MyCanvas::DrawTestPoly(wxDC& dc)
 {
-    wxBrush brushHatch(*wxRED, wxFDIAGONAL_HATCH);
+    wxBrush brushHatch(*wxRED, wxBRUSHSTYLE_FDIAGONAL_HATCH);
     dc.SetBrush(brushHatch);
 
     wxPoint star[5];
     dc.SetBrush(brushHatch);
 
     wxPoint star[5];
@@ -503,31 +503,31 @@ void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc )
     dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
     dc.SetPen( wxPen( *wxBLACK, width ) );
     dc.DrawLine( x+20, y+20, 100, y+20 );
     dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
     dc.SetPen( wxPen( *wxBLACK, width ) );
     dc.DrawLine( x+20, y+20, 100, y+20 );
-    dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_DOT) );
     dc.DrawLine( x+20, y+30, 100, y+30 );
     dc.DrawLine( x+20, y+30, 100, y+30 );
-    dc.SetPen( wxPen( wxT("black"), width, wxSHORT_DASH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_SHORT_DASH) );
     dc.DrawLine( x+20, y+40, 100, y+40 );
     dc.DrawLine( x+20, y+40, 100, y+40 );
-    dc.SetPen( wxPen( wxT("black"), width, wxLONG_DASH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_LONG_DASH) );
     dc.DrawLine( x+20, y+50, 100, y+50 );
     dc.DrawLine( x+20, y+50, 100, y+50 );
-    dc.SetPen( wxPen( wxT("black"), width, wxDOT_DASH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_DOT_DASH) );
     dc.DrawLine( x+20, y+60, 100, y+60 );
 
     dc.DrawText(wxT("Misc hatches"), x + 150, y + 70);
     dc.DrawLine( x+20, y+60, 100, y+60 );
 
     dc.DrawText(wxT("Misc hatches"), x + 150, y + 70);
-    dc.SetPen( wxPen( wxT("black"), width, wxBDIAGONAL_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_BDIAGONAL_HATCH) );
     dc.DrawLine( x+20, y+70, 100, y+70 );
     dc.DrawLine( x+20, y+70, 100, y+70 );
-    dc.SetPen( wxPen( wxT("black"), width, wxCROSSDIAG_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_CROSSDIAG_HATCH) );
     dc.DrawLine( x+20, y+80, 100, y+80 );
     dc.DrawLine( x+20, y+80, 100, y+80 );
-    dc.SetPen( wxPen( wxT("black"), width, wxFDIAGONAL_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_FDIAGONAL_HATCH) );
     dc.DrawLine( x+20, y+90, 100, y+90 );
     dc.DrawLine( x+20, y+90, 100, y+90 );
-    dc.SetPen( wxPen( wxT("black"), width, wxCROSS_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_CROSS_HATCH) );
     dc.DrawLine( x+20, y+100, 100, y+100 );
     dc.DrawLine( x+20, y+100, 100, y+100 );
-    dc.SetPen( wxPen( wxT("black"), width, wxHORIZONTAL_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_HORIZONTAL_HATCH) );
     dc.DrawLine( x+20, y+110, 100, y+110 );
     dc.DrawLine( x+20, y+110, 100, y+110 );
-    dc.SetPen( wxPen( wxT("black"), width, wxVERTICAL_HATCH) );
+    dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_VERTICAL_HATCH) );
     dc.DrawLine( x+20, y+120, 100, y+120 );
 
     dc.DrawText(wxT("User dash"), x + 150, y + 140);
     dc.DrawLine( x+20, y+120, 100, y+120 );
 
     dc.DrawText(wxT("User dash"), x + 150, y + 140);
-    wxPen ud( wxT("black"), width, wxUSER_DASH );
+    wxPen ud( *wxBLACK, width, wxPENSTYLE_USER_DASH );
     wxDash dash1[6];
     dash1[0] = 8;  // Long dash  <---------+
     dash1[1] = 2;  // Short gap            |
     wxDash dash1[6];
     dash1[0] = 8;  // Long dash  <---------+
     dash1[1] = 2;  // Short gap            |
@@ -1669,7 +1669,7 @@ void MyCanvas::OnMouseMove(wxMouseEvent &event)
         dc.SetPen( *wxGREY_PEN );
         dc.SetBrush( wxColour( 192,192,192,64 ) );
 #else
         dc.SetPen( *wxGREY_PEN );
         dc.SetBrush( wxColour( 192,192,192,64 ) );
 #else
-        dc.SetPen( wxPen( *wxLIGHT_GREY, 2, ) );
+        dc.SetPen( wxPen( *wxLIGHT_GREY, 2 ) );
         dc.SetBrush( *wxTRANSPARENT_BRUSH );
 #endif
         dc.DrawRectangle( newrect );
         dc.SetBrush( *wxTRANSPARENT_BRUSH );
 #endif
         dc.DrawRectangle( newrect );
index ace34b5d7f1c35b80d6e24da3e3bb4fcb45ce63c..07c7769912729495f61be62f8a5d04bb28e00b2b 100644 (file)
@@ -161,7 +161,7 @@ void MyApp::Draw(wxDC&dc)
 
     dc.DrawText( wxT("Rectangle 200 by 80"), 40, 40);
 
 
     dc.DrawText( wxT("Rectangle 200 by 80"), 40, 40);
 
-    dc.SetPen( wxPen(*wxBLACK,0,wxDOT_DASH) );
+    dc.SetPen( wxPen(*wxBLACK, 0, wxPENSTYLE_DOT_DASH) );
     dc.DrawEllipse(50, 140, 100, 50);
     dc.SetPen(*wxRED_PEN);
 
     dc.DrawEllipse(50, 140, 100, 50);
     dc.SetPen(*wxRED_PEN);