]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/drawing/drawing.cpp
added wxTLS_TYPE() macro
[wxWidgets.git] / samples / drawing / drawing.cpp
index 7c1e0d578f9012c1a83375ec32ac511466daf45e..200e5aeee9453cfe7c1bd5539fa7da9fc38d3856 100644 (file)
 #include "wx/artprov.h"
 #include "wx/dcgraph.h"
 #include "wx/overlay.h"
-
-#define wxTEST_GRAPHICS 1
+#include "wx/graphics.h"
 
 #define TEST_CAIRO_EVERYWHERE 0
 
-#if wxTEST_GRAPHICS
-#include "wx/graphics.h"
-#include "wx/dcgraph.h"
-#if wxUSE_GRAPHICS_CONTEXT == 0
-#undef wxTEST_GRAPHICS
-#define wxTEST_GRAPHICS 0
-#endif
-#else
-#undef wxUSE_GRAPHICS_CONTEXT
-#define wxUSE_GRAPHICS_CONTEXT 0
-#endif
-
 // ----------------------------------------------------------------------------
-// ressources
+// resources
 // ----------------------------------------------------------------------------
 
 // the application icon
@@ -1364,7 +1351,7 @@ void MyCanvas::DrawRegionsHelper(wxDC& dc, wxCoord x, bool firstTime)
     if ( !firstTime )
         region.Offset(10, 10);
 #endif
-    dc.SetClippingRegion(region);
+    dc.SetDeviceClippingRegion(region);
 
     dc.SetBrush( *wxGREY_BRUSH );
     dc.DrawRectangle( x, y, 310, 310 );
@@ -1527,7 +1514,7 @@ void MyCanvas::OnMouseMove(wxMouseEvent &event)
 
         wxDCOverlay overlaydc( m_overlay, &dc );
         overlaydc.Clear();
-#if __WXMAC__
+#ifdef __WXMAC__
         dc.SetPen( *wxGREY_PEN );
         dc.SetBrush( wxColour( 192,192,192,64 ) );
 #else
@@ -1556,6 +1543,7 @@ void MyCanvas::OnMouseUp(wxMouseEvent &event)
 {
     if ( m_rubberBand )
     {
+        ReleaseMouse();
         {
             wxClientDC dc( this );
             PrepareDC( dc );
@@ -1622,7 +1610,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     menuFile->Append(File_ShowSplines, _T("&Splines screen\tF11"));
     menuFile->Append(File_ShowGradients, _T("&Gradients screen\tF12"));
 #if wxUSE_GRAPHICS_CONTEXT
-     menuFile->Append(File_ShowGraphics, _T("&Graphics screen\tF13"));
+     menuFile->Append(File_ShowGraphics, _T("&Graphics screen"));
 #endif
     menuFile->AppendSeparator();
     menuFile->AppendCheckItem(File_Clip, _T("&Clip\tCtrl-C"), _T("Clip/unclip drawing"));