X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2a5251d0109a1be6b9ce5c818d89f56ebfaeae1..7608a6837f5cee96f31972bc69c8af24f51641b5:/samples/drawing/drawing.cpp diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 1f1fd268da..ac792382f8 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -150,7 +150,7 @@ public: void OnPaint(wxPaintEvent &event); void OnMouseMove(wxMouseEvent &event); - void Show(ScreenToShow show) { m_show = show; Refresh(); } + void ToShow(ScreenToShow show) { m_show = show; Refresh(); } // set or remove the clipping region void Clip(bool clip) { m_clip = clip; Refresh(); } @@ -424,9 +424,25 @@ void MyCanvas::DrawTestPoly(wxDC& dc) _T("hatched"), 10, 10); dc.DrawText(_T("except for the central region and the right ") _T("one entirely hatched"), 10, 30); - - dc.DrawPolygon(WXSIZEOF(star), star); - dc.DrawPolygon(WXSIZEOF(star), star, 160, 0, wxWINDING_RULE); + dc.DrawText(_T("The third star only has a hatched outline"), 10, 50); + + dc.DrawPolygon(WXSIZEOF(star), star, 0, 30); + dc.DrawPolygon(WXSIZEOF(star), star, 160, 30, wxWINDING_RULE); + + wxPoint star2[10]; + star2[0] = wxPoint(0, 100); + star2[1] = wxPoint(-59, -81); + star2[2] = wxPoint(95, 31); + star2[3] = wxPoint(-95, 31); + star2[4] = wxPoint(59, -81); + star2[5] = wxPoint(0, 80); + star2[6] = wxPoint(-47, -64); + star2[7] = wxPoint(76, 24); + star2[8] = wxPoint(-76, 24); + star2[9] = wxPoint(47, -64); + int count[2] = {5, 5}; + + dc.DrawPolyPolygon(WXSIZEOF(count), count, star2, 450, 150); } void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc ) @@ -1141,7 +1157,7 @@ void MyFrame::OnClip(wxCommandEvent& event) void MyFrame::OnShow(wxCommandEvent& event) { - m_canvas->Show((ScreenToShow)(event.GetId() - MenuShow_First)); + m_canvas->ToShow((ScreenToShow)(event.GetId() - MenuShow_First)); } void MyFrame::OnOption(wxCommandEvent& event) @@ -1262,3 +1278,4 @@ wxColour MyFrame::SelectColour() return col; } +