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
This commit is contained in:
@@ -189,29 +189,29 @@ public:
|
|||||||
r.Deflate(3);
|
r.Deflate(3);
|
||||||
r.height -= 2;
|
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 );
|
||||||
|
|
||||||
|
@@ -426,22 +426,22 @@ void MyCanvas::DrawTestBrushes(wxDC& dc)
|
|||||||
dc.DrawText(wxT("Solid green"), x + 10, y + 10);
|
dc.DrawText(wxT("Solid green"), x + 10, y + 10);
|
||||||
|
|
||||||
y += HEIGHT;
|
y += HEIGHT;
|
||||||
dc.SetBrush(wxBrush(*wxRED, wxCROSSDIAG_HATCH));
|
dc.SetBrush(wxBrush(*wxRED, wxBRUSHSTYLE_CROSSDIAG_HATCH));
|
||||||
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
||||||
dc.DrawText(wxT("Diagonally hatched red"), x + 10, y + 10);
|
dc.DrawText(wxT("Diagonally hatched red"), x + 10, y + 10);
|
||||||
|
|
||||||
y += HEIGHT;
|
y += HEIGHT;
|
||||||
dc.SetBrush(wxBrush(*wxBLUE, wxCROSS_HATCH));
|
dc.SetBrush(wxBrush(*wxBLUE, wxBRUSHSTYLE_CROSS_HATCH));
|
||||||
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
||||||
dc.DrawText(wxT("Cross hatched blue"), x + 10, y + 10);
|
dc.DrawText(wxT("Cross hatched blue"), x + 10, y + 10);
|
||||||
|
|
||||||
y += HEIGHT;
|
y += HEIGHT;
|
||||||
dc.SetBrush(wxBrush(*wxCYAN, wxVERTICAL_HATCH));
|
dc.SetBrush(wxBrush(*wxCYAN, wxBRUSHSTYLE_VERTICAL_HATCH));
|
||||||
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
||||||
dc.DrawText(wxT("Vertically hatched cyan"), x + 10, y + 10);
|
dc.DrawText(wxT("Vertically hatched cyan"), x + 10, y + 10);
|
||||||
|
|
||||||
y += HEIGHT;
|
y += HEIGHT;
|
||||||
dc.SetBrush(wxBrush(*wxBLACK, wxHORIZONTAL_HATCH));
|
dc.SetBrush(wxBrush(*wxBLACK, wxBRUSHSTYLE_HORIZONTAL_HATCH));
|
||||||
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
|
||||||
dc.DrawText(wxT("Horizontally hatched black"), x + 10, y + 10);
|
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);
|
dc.SetBrush(brushHatch);
|
||||||
|
|
||||||
wxPoint star[5];
|
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.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
|
||||||
dc.SetPen( wxPen( *wxBLACK, width ) );
|
dc.SetPen( wxPen( *wxBLACK, width ) );
|
||||||
dc.DrawLine( x+20, y+20, 100, y+20 );
|
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.DrawLine( x+20, y+60, 100, y+60 );
|
||||||
|
|
||||||
dc.DrawText(wxT("Misc hatches"), x + 150, y + 70);
|
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.DrawLine( x+20, y+120, 100, y+120 );
|
||||||
|
|
||||||
dc.DrawText(wxT("User dash"), x + 150, y + 140);
|
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];
|
wxDash dash1[6];
|
||||||
dash1[0] = 8; // Long dash <---------+
|
dash1[0] = 8; // Long dash <---------+
|
||||||
dash1[1] = 2; // Short gap |
|
dash1[1] = 2; // Short gap |
|
||||||
@@ -1669,7 +1669,7 @@ void MyCanvas::OnMouseMove(wxMouseEvent &event)
|
|||||||
dc.SetPen( *wxGREY_PEN );
|
dc.SetPen( *wxGREY_PEN );
|
||||||
dc.SetBrush( wxColour( 192,192,192,64 ) );
|
dc.SetBrush( wxColour( 192,192,192,64 ) );
|
||||||
#else
|
#else
|
||||||
dc.SetPen( wxPen( *wxLIGHT_GREY, 2, ) );
|
dc.SetPen( wxPen( *wxLIGHT_GREY, 2 ) );
|
||||||
dc.SetBrush( *wxTRANSPARENT_BRUSH );
|
dc.SetBrush( *wxTRANSPARENT_BRUSH );
|
||||||
#endif
|
#endif
|
||||||
dc.DrawRectangle( newrect );
|
dc.DrawRectangle( newrect );
|
||||||
|
@@ -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.DrawEllipse(50, 140, 100, 50);
|
||||||
dc.SetPen(*wxRED_PEN);
|
dc.SetPen(*wxRED_PEN);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user