This is the main module of the floatcanvas package, it contains the FloatCanvas
and all the all the different objects which are sub-classed from DrawObject
.
In the following very simple sample self
is a frame, but it could be another
container type control:
from wx.lib.floatcanvas import FloatCanvas
self.Canvas = FloatCanvas.FloatCanvas(self, -1,
size=(500, 500),
ProjectionFun=None,
Debug=0,
BackgroundColor="White",
)
# add a circle
cir = FloatCanvas.Circle((10, 10), 100)
self.Canvas.AddObject(cir)
# add a rectangle
rect = FloatCanvas.Rectangle((110, 10), (100, 100), FillColor='Red')
self.Canvas.AddObject(rect)
self.Canvas.Draw()
Many samples are available in the wxPhoenix/samples/floatcanvas folder.
This event class takes a regular wxWindows mouse event as a parameter, |
|
The main class of the floatcanvas package |
|
Custom FloatCanvas exception. |