Show_Lines,
Show_Polygons,
Show_Mask,
- Show_Ops
+ Show_Ops,
+ Show_Regions
};
// ----------------------------------------------------------------------------
void DrawText(wxDC& dc);
void DrawImages(wxDC& dc);
void DrawWithLogicalOps(wxDC& dc);
+ void DrawRegions(wxDC& dc);
void DrawDefault(wxDC& dc);
private:
File_ShowPolygons,
File_ShowMask,
File_ShowOps,
- MenuShow_Last = File_ShowOps,
+ File_ShowRegions,
+ MenuShow_Last = File_ShowRegions,
MenuOption_First,
}
}
+void MyCanvas::DrawRegions(wxDC& dc)
+{
+ dc.SetBrush( *wxWHITE_BRUSH );
+ dc.SetPen( *wxTRANSPARENT_PEN );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ wxRegion region( 20,20,100,270 );
+ dc.SetClippingRegion( region );
+
+ dc.SetBrush( *wxRED_BRUSH );
+ dc.DrawRectangle( 10,10,310,310 );
+
+ region = wxRegion( 120,30,100,270 );
+ dc.SetClippingRegion( region );
+
+ dc.SetBrush( *wxGREY_BRUSH );
+ dc.DrawRectangle( 10,10,310,310 );
+}
+
void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
{
wxPaintDC dc(this);
}
}
- dc.Clear();
+// dc.Clear();
if ( m_owner->m_textureBackground) {
dc.SetPen(*wxMEDIUM_GREY_PEN);
DrawDefault(dc);
break;
+ case Show_Regions:
+ DrawRegions(dc);
+ break;
+
case Show_Text:
DrawText(dc);
break;
menuFile->Append(File_ShowPolygons, "&Polygons screen\tF4");
menuFile->Append(File_ShowMask, "wx&Mask screen\tF5");
menuFile->Append(File_ShowOps, "&ROP screen\tF6");
+ menuFile->Append(File_ShowRegions, "Re&gions screen\tF6");
menuFile->AppendSeparator();
menuFile->Append(File_About, "&About...\tCtrl-A", "Show about dialog");
menuFile->AppendSeparator();