X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab1ca7b3dda18b48e83f9ad2f5f3ea9b22247197..0b659b0a51c13cdc4ed21f3f8c020c5055c6c024:/samples/drawing/drawing.cpp diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 573ef9c94a..8287997293 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -464,18 +464,27 @@ void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc ) dc.DrawText(_T("User dash"), x + 150, y + 140); wxPen ud( wxT("black"), width, wxUSER_DASH ); - wxDash dash1[1]; - dash1[0] = 0; - ud.SetDashes( 1, dash1 ); + wxDash dash1[6]; + dash1[0] = 8; // Long dash <---------+ + dash1[1] = 2; // Short gap | + dash1[2] = 3; // Short dash | + dash1[3] = 2; // Short gap | + dash1[4] = 3; // Short dash | + dash1[5] = 2; // Short gap and repeat + + ud.SetDashes( 6, dash1 ); + dc.SetPen( ud ); dc.DrawLine( x+20, y+140, 100, y+140 ); - dash1[0] = 1; - ud.SetDashes( 1, dash1 ); + dash1[0] = 5; // Make first dash shorter + ud.SetDashes( 6, dash1 ); + dc.SetPen( ud ); dc.DrawLine( x+20, y+150, 100, y+150 ); - dash1[0] = 2; - ud.SetDashes( 1, dash1 ); + dash1[2] = 5; // Make second dash longer + ud.SetDashes( 6, dash1 ); + dc.SetPen( ud ); dc.DrawLine( x+20, y+160, 100, y+160 ); - dash1[0] = 0x7F; - ud.SetDashes( 1, dash1 ); + dash1[4] = 5; // Make third dash longer + ud.SetDashes( 6, dash1 ); + dc.SetPen( ud ); dc.DrawLine( x+20, y+170, 100, y+170 ); } @@ -1253,3 +1262,4 @@ wxColour MyFrame::SelectColour() return col; } +