wx.lib.floatcanvas.FCObjects.DrawObject¶
This is the base class for all the objects that can be drawn.
One must subclass from this (and an assortment of Mixins) to create
a new DrawObject, see for example Circle.
Class Hierarchy¶
Known Subclasses¶
wx.lib.floatcanvas.FCObjects.Arc, wx.lib.floatcanvas.FCObjects.Arrow, wx.lib.floatcanvas.FCObjects.ArrowLine, wx.lib.floatcanvas.FCObjects.Bitmap, wx.lib.floatcanvas.FCObjects.Circle, wx.lib.floatcanvas.FCObjects.Group, wx.lib.floatcanvas.FCObjects.Line, wx.lib.floatcanvas.FCObjects.PieChart, wx.lib.floatcanvas.FCObjects.Point, wx.lib.floatcanvas.FCObjects.PointSet, wx.lib.floatcanvas.FCObjects.Polygon, wx.lib.floatcanvas.FCObjects.RectEllipse, wx.lib.floatcanvas.FCObjects.ScaledBitmap, wx.lib.floatcanvas.FCObjects.ScaledBitmap2, wx.lib.floatcanvas.FCObjects.ScaledText, wx.lib.floatcanvas.FCObjects.ScaledTextBox, wx.lib.floatcanvas.FCObjects.SquarePoint, wx.lib.floatcanvas.FCObjects.Text
Methods Summary¶
Default class constructor. |
|
Bind an event to the DrawObject |
|
Hide the object. |
|
Put the object in the background. |
|
Put the object in the foreground. |
|
Set the brush for this DrawObject |
|
Set the Color - this method is overridden in the subclasses |
|
Set the FillColor - this method is overridden in the subclasses |
|
Set the FillStyle - this method is overridden in the subclasses |
|
Set the brush used for hit test, do not call directly. |
|
Set the pen used for hit test, do not call directly. |
|
Set the LineColor - this method is overridden in the subclasses |
|
Set the LineStyle - this method is overridden in the subclasses |
|
Set the LineWidth |
|
Set the Pen for this DrawObject |
|
Show the object. |
|
Unbind all events |
Class API¶
- class DrawObject¶
This is the base class for all the objects that can be drawn.
One must subclass from this (and an assortment of Mixins) to create a new DrawObject, see for example
Circle.
Methods¶
- __init__(self, InForeground=False, IsVisible=True)¶
Default class constructor.
- Parameters:
InForeground (boolean) – Define if object should be in foreground or not
IsVisible (boolean) – Define if object should be visible
- Bind(self, Event, CallBackFun)¶
Bind an event to the DrawObject
- Parameters:
Event – see below for supported event types
EVT_FC_LEFT_DOWN
EVT_FC_LEFT_UP
EVT_FC_LEFT_DCLICK
EVT_FC_MIDDLE_DOWN
EVT_FC_MIDDLE_UP
EVT_FC_MIDDLE_DCLICK
EVT_FC_RIGHT_DOWN
EVT_FC_RIGHT_UP
EVT_FC_RIGHT_DCLICK
EVT_FC_ENTER_OBJECT
EVT_FC_LEAVE_OBJECT
CallBackFun – the call back function for the event
- Hide(self)¶
Hide the object.
- PutInBackground(self)¶
Put the object in the background.
- PutInForeground(self)¶
Put the object in the foreground.
- SetBrush(self, FillColor, FillStyle)¶
Set the brush for this DrawObject
- Parameters:
FillColor – see
SetColorfor valid entriesFillStyle – see
SetFillStylefor valid entries
- SetColor(self, Color)¶
Set the Color - this method is overridden in the subclasses
- Parameters:
Color –
use one of the following values any valid entry from
wx.ColourDatabaseGreenWhiteBlackGreyMediumGreyLightGreyCyanRed
- SetFillColor(self, FillColor)¶
Set the FillColor - this method is overridden in the subclasses
- Parameters:
FillColor – see
SetColorfor valid values
- SetFillStyle(self, FillStyle)¶
Set the FillStyle - this method is overridden in the subclasses
- Parameters:
FillStyle (string) – following is a list of valid values:
Style
Description
TransparentTransparent fill
SolidSolid fill
BiDiagonalHatchBi Diagonal hatch fill
CrossDiagHatchCross Diagonal hatch fill
FDiagonal_HatchF Diagonal hatch fill
CrossHatchCross hatch fill
HorizontalHatchHorizontal hatch fill
VerticalHatchVertical hatch fill
- SetHitBrush(self, HitColor)¶
Set the brush used for hit test, do not call directly.
- Parameters:
HitColor – see
SetColor
- SetHitPen(self, HitColor, LineWidth)¶
Set the pen used for hit test, do not call directly.
- Parameters:
HitColor – see
SetColorLineWidth (integer) – the line width in pixels
- SetLineColor(self, LineColor)¶
Set the LineColor - this method is overridden in the subclasses
- Parameters:
LineColor – see
SetColorfor valid values
- SetLineStyle(self, LineStyle)¶
Set the LineStyle - this method is overridden in the subclasses
- Parameters:
LineStyle – Use one of the following values or
None:Style
Description
SolidSolid line
TransparentA transparent line
DotDotted line
LongDashDashed line (long)
ShortDashDashed line (short)
DotDashDash-dot-dash line
- SetLineWidth(self, LineWidth)¶
Set the LineWidth
- Parameters:
LineWidth (integer) – sets the line width in pixel
- SetPen(self, LineColor, LineStyle, LineWidth)¶
Set the Pen for this DrawObject
- Parameters:
LineColor – see
SetColorfor valid entriesLineStyle – see
SetLineStylefor valid entriesLineWidth (integer) – the width in pixels
- Show(self)¶
Show the object.
- UnBindAll(self)¶
Unbind all events
Note
Currently only removes one from each list