Phoenix Logo

phoenix_title 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 Class Hierarchy

Inheritance diagram for class DrawObject:


method_summary Methods Summary

__init__ Default class constructor.
Bind Bind an event to the DrawObject
Hide Hide the object.
PutInBackground Put the object in the background.
PutInForeground Put the object in the foreground.
SetBrush Set the brush for this DrawObject
SetColor Set the Color - this method is overridden in the subclasses
SetFillColor Set the FillColor - this method is overridden in the subclasses
SetFillStyle Set the FillStyle - this method is overridden in the subclasses
SetHitBrush Set the brush used for hit test, do not call directly.
SetHitPen Set the pen used for hit test, do not call directly.
SetLineColor Set the LineColor - this method is overridden in the subclasses
SetLineStyle Set the LineStyle - this method is overridden in the subclasses
SetLineWidth Set the LineWidth
SetPen Set the Pen for this DrawObject
Show Show the object.
UnBindAll Unbind all events

api 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 entries
  • FillStyle – 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 entries
  • LineStyle – see SetLineStyle for valid entries
  • LineWidth (integer) – the width in pixels


Show(self)

Show the object.



UnBindAll(self)

Unbind all events

Note

Currently only removes one from each list