+
+ // now some filled rectangles
+ dc.SetBrush(wxBrush(m_owner->m_colourForeground, wxSOLID));
+
+ for ( n = 0; n < WXSIZEOF(rasterOperations); n++ )
+ {
+ wxCoord x = 20 + 150*(n%4),
+ y = 500 + 100*(n/4);
+
+ dc.DrawText(rasterOperations[n].name, x, y - 20);
+ dc.SetLogicalFunction(rasterOperations[n].rop);
+ dc.DrawRectangle(x, y, w, h);
+ }
+}
+
+void MyCanvas::DrawCircles(wxDC& dc)
+{
+ int x = 100,
+ y = 100,
+ r = 20;
+
+ dc.DrawText("Some circles", 0, y);
+ dc.DrawCircle(x, y, r);
+ dc.DrawCircle(x + 2*r, y, r);
+ dc.DrawCircle(x + 4*r, y, r);
+
+ y += 2*r;
+ dc.DrawText("And ellipses", 0, y);
+ dc.DrawEllipse(x - r, y, 2*r, r);
+ dc.DrawEllipse(x + r, y, 2*r, r);
+ dc.DrawEllipse(x + 3*r, y, 2*r, r);
+
+ y += 2*r;
+ dc.DrawText("And arcs", 0, y);
+ dc.DrawArc(x - r, y, x + r, y, x, y);
+ dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y);
+ dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y);
+
+ y += 2*r;
+ dc.DrawEllipticArc(x - r, y, 2*r, r, 0, 90);
+ dc.DrawEllipticArc(x + r, y, 2*r, r, 90, 180);
+ dc.DrawEllipticArc(x + 3*r, y, 2*r, r, 180, 270);
+ dc.DrawEllipticArc(x + 5*r, y, 2*r, r, 270, 360);
+}
+
+void MyCanvas::DrawRegions(wxDC& dc)
+{
+ dc.SetBrush( *wxWHITE_BRUSH );
+ dc.SetPen( *wxTRANSPARENT_PEN );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ dc.SetClippingRegion( 20,20,100,270 );
+
+ dc.SetBrush( *wxRED_BRUSH );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ dc.SetClippingRegion( 20,20,100,100 );
+
+ dc.SetBrush( *wxCYAN_BRUSH );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ dc.DestroyClippingRegion();
+ dc.SetClippingRegion( 120,30,100,270 );
+
+ dc.SetBrush( *wxGREY_BRUSH );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ if (m_smile_bmp.Ok())
+ {
+ dc.DrawBitmap( m_smile_bmp, 140, 20, TRUE );
+ dc.DrawBitmap( m_smile_bmp, 140, 290, TRUE );
+ dc.DrawBitmap( m_smile_bmp, 110, 80, TRUE );
+ dc.DrawBitmap( m_smile_bmp, 210, 80, TRUE );
+ }