-
- dc.SetPen( *wxWHITE_PEN );
- for (int i = 0; i < 20; i += 2)
- dc.DrawLine( i,i, i+100,i );
-
- wxRegion region( 110, 110, 80, 80 );
- wxRegion hole( 130, 130, 40, 1 );
- region.Intersect( hole );
- dc.SetClippingRegion( region );
-
- dc.SetBrush( *wxRED_BRUSH );
- dc.DrawRectangle( 100, 100, 200, 200 );
-
- dc.DestroyClippingRegion();
-
- dc.SetPen( *wxTRANSPARENT_PEN );
-
- wxRegion strip( 110, 200, 30, 1 );
- wxRegionIterator it( strip );
- while (it)
+
+ dc.SetBrush( *wxBLACK_BRUSH );
+ dc.DrawRectangle( 10,10,60,50 );
+
+ dc.DrawBitmap( m_bitmap, 20, 20, true );
+
+ dc.SetTextForeground(*wxWHITE);
+ dc.DrawText("This text is drawn from OnPaint", 65, 65);
+
+ wxString tmp;
+ tmp.Printf("Hit any key to display more text: %s", m_text);
+
+ int w,h;
+ dc.GetTextExtent( tmp, &w, &h );
+ dc.DrawRectangle( 65, 85, w, h );
+ dc.DrawText( tmp, 65, 85 );
+}
+
+void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
+{
+ if ( m_useBuffer )
+ {
+ wxAutoBufferedPaintDC dc(this);
+ PrepareDC(dc);
+
+ DoPaint(dc);
+ }
+ else