X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3abcf424a3e250f5537f9f076d3fb86a925e2547..1f2b90153e9580ef89095cec62a61f770cb24ef9:/samples/drawing/drawing.cpp?ds=sidebyside diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 76ca96d4d0..31918e3f08 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -39,7 +39,8 @@ #if wxTEST_GRAPHICS #include "wx/graphics.h" #if wxUSE_GRAPHICS_CONTEXT == 0 -#error wxUSE_GRAPHICS_CONTEXT must be defined to 1 for testing +#undef wxTEST_GRAPHICS +#define wxTEST_GRAPHICS 0 #endif #else #undef wxUSE_GRAPHICS_CONTEXT @@ -894,8 +895,17 @@ void MyCanvas::DrawWithLogicalOps(wxDC& dc) } #if wxUSE_GRAPHICS_CONTEXT +#ifdef __WXGTK20__ +void MyCanvas::DrawAlpha(wxDC& no_dc) +#else void MyCanvas::DrawAlpha(wxDC& dc) +#endif { +#ifdef __WXGTK__ + wxGCDC dc( this ); + PrepareDC( dc ); +#endif + wxDouble margin = 20 ; wxDouble width = 180 ; wxDouble radius = 30 ; @@ -924,6 +934,10 @@ void MyCanvas::DrawAlpha(wxDC& dc) dc.SetPen( *wxTRANSPARENT_PEN ) ; dc.SetBrush( wxBrush( wxColour(255,255,128,128) ) ); dc.DrawRoundedRectangle( 0 , margin + width / 2 , width * 3 , 100 , radius) ; + + dc.SetTextForeground( wxColour(255,255,0,128) ); + dc.SetFont( wxFont( 40, wxFONTFAMILY_SWISS, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL ) ); + dc.DrawText( wxT("Hello!"), 120, 80 ); } #endif