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
SetColor
for valid entriesFillStyle – see
SetFillStyle
for 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.ColourDatabase
Green
White
Black
Grey
MediumGrey
LightGrey
Cyan
Red
- SetFillColor(self, FillColor)¶
Set the FillColor - this method is overridden in the subclasses
- Parameters:
FillColor – see
SetColor
for 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
Transparent
Transparent fill
Solid
Solid fill
BiDiagonalHatch
Bi Diagonal hatch fill
CrossDiagHatch
Cross Diagonal hatch fill
FDiagonal_Hatch
F Diagonal hatch fill
CrossHatch
Cross hatch fill
HorizontalHatch
Horizontal hatch fill
VerticalHatch
Vertical 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
SetColor
LineWidth (integer) – the line width in pixels
- SetLineColor(self, LineColor)¶
Set the LineColor - this method is overridden in the subclasses
- Parameters:
LineColor – see
SetColor
for 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
Solid
Solid line
Transparent
A transparent line
Dot
Dotted line
LongDash
Dashed line (long)
ShortDash
Dashed line (short)
DotDash
Dash-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
SetColor
for valid entriesLineStyle – see
SetLineStyle
for 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