X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33611ebbd99217ef90f1178eed37e30385c121de..a6d57d0388f29fca011b0e168e926b61be0f465c:/samples/erase/erase.cpp diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp index 8162f96f6f..eeddaad927 100644 --- a/samples/erase/erase.cpp +++ b/samples/erase/erase.cpp @@ -18,8 +18,8 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma implementation "minimal.cpp" - #pragma interface "minimal.cpp" + #pragma implementation "erase.cpp" + #pragma interface "erase.cpp" #endif // For compilers that support precompilation, includes "wx/wx.h". @@ -39,7 +39,7 @@ // resources // ---------------------------------------------------------------------------- // the application icon -#if defined(__WXGTK__) || defined(__WXMOTIF__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) #include "mondrian.xpm" #endif @@ -157,10 +157,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the about dialog of minimal sample.\n") + msg.Printf( _T("This is the about dialog of the Erase sample.\n") _T("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, "About Minimal", wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, "About Erase", wxOK | wxICON_INFORMATION, this); } @@ -181,8 +181,13 @@ void MyCanvas::OnPaint( wxPaintEvent &event ) wxPaintDC dc(this); PrepareDC( dc ); + 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, 300, 500 ); + dc.DrawRectangle( 100, 100, 200, 200 ); } void MyCanvas::OnEraseBackground( wxEraseEvent &event )