From 0856cb256202963ff01496da8e6523a02ceb265d Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 1 Dec 2012 22:34:07 +0000 Subject: [PATCH] use new pen/brush style names in samples git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/combo/combo.cpp | 24 ++++++++++++------------ samples/drawing/drawing.cpp | 34 +++++++++++++++++----------------- samples/printing/printing.cpp | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index 419c3e0359..057277c474 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -189,29 +189,29 @@ public: r.Deflate(3); r.height -= 2; - int penStyle = wxSOLID; + wxPenStyle penStyle = wxPENSTYLE_SOLID; if ( item == 1 ) - penStyle = wxTRANSPARENT; + penStyle = wxPENSTYLE_TRANSPARENT; else if ( item == 2 ) - penStyle = wxDOT; + penStyle = wxPENSTYLE_DOT; else if ( item == 3 ) - penStyle = wxLONG_DASH; + penStyle = wxPENSTYLE_LONG_DASH; else if ( item == 4 ) - penStyle = wxSHORT_DASH; + penStyle = wxPENSTYLE_SHORT_DASH; else if ( item == 5 ) - penStyle = wxDOT_DASH; + penStyle = wxPENSTYLE_DOT_DASH; else if ( item == 6 ) - penStyle = wxBDIAGONAL_HATCH; + penStyle = wxPENSTYLE_BDIAGONAL_HATCH; else if ( item == 7 ) - penStyle = wxCROSSDIAG_HATCH; + penStyle = wxPENSTYLE_CROSSDIAG_HATCH; else if ( item == 8 ) - penStyle = wxFDIAGONAL_HATCH; + penStyle = wxPENSTYLE_FDIAGONAL_HATCH; else if ( item == 9 ) - penStyle = wxCROSS_HATCH; + penStyle = wxPENSTYLE_CROSS_HATCH; else if ( item == 10 ) - penStyle = wxHORIZONTAL_HATCH; + penStyle = wxPENSTYLE_HORIZONTAL_HATCH; else if ( item == 11 ) - penStyle = wxVERTICAL_HATCH; + penStyle = wxPENSTYLE_VERTICAL_HATCH; wxPen pen( dc.GetTextForeground(), 3, penStyle ); diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 80f0402fc0..dd9709656f 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -426,22 +426,22 @@ void MyCanvas::DrawTestBrushes(wxDC& dc) 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.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.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.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); @@ -458,7 +458,7 @@ void MyCanvas::DrawTestBrushes(wxDC& dc) void MyCanvas::DrawTestPoly(wxDC& dc) { - wxBrush brushHatch(*wxRED, wxFDIAGONAL_HATCH); + wxBrush brushHatch(*wxRED, wxBRUSHSTYLE_FDIAGONAL_HATCH); 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.SetPen( wxPen( wxT("black"), width, wxDOT) ); + dc.SetPen( wxPen( *wxBLACK, width, wxPENSTYLE_DOT) ); 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.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.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.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.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.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.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.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.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); - 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 | @@ -1669,7 +1669,7 @@ void MyCanvas::OnMouseMove(wxMouseEvent &event) 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 ); diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index ace34b5d7f..07c7769912 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -161,7 +161,7 @@ void MyApp::Draw(wxDC&dc) 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); -- 2.45.2