Phoenix Logo

phoenix_title wx.lib.ogl.canvas.ShapeCanvas

The ShapeCanvas class.


class_hierarchy Class Hierarchy

Inheritance diagram for class ShapeCanvas:


super_classes Known Superclasses

wx.ScrolledWindow


method_summary Methods Summary

__init__ Default class constructor.
AddShape Add a shape to canvas.
Draw Update the buffer with the background and redraw the full diagram.
FindShape Find shape at given position.
GetDiagram Get the diagram associated with this canvas.
GetQuickEditMode Get quick edit mode.
InsertShape Insert a shape to canvas.
OnBeginDragLeft not implemented???
OnBeginDragRight not implemented???
OnDragLeft not implemented???
OnDragRight not implemented???
OnEndDragLeft not implemented???
OnEndDragRight not implemented???
OnLeftClick not implemented???
OnMouseEvent The mouse event handler.
OnPaint The paint handler, uses BufferedPaintDC to draw the
OnRightClick not implemented???
OnSize The size handler, it initializes the buffer to the size of the window.
Redraw Redraw the diagram.
RemoveShape Remove a shape from canvas.
SetDiagram Set the diagram associated with this canvas.
Snap Snap ???

api Class API



class ShapeCanvas(wx.ScrolledWindow)

The ShapeCanvas class.


Methods



__init__(self, parent = None, id = -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.BORDER, name = "ShapeCanvas")

Default class constructor.

Default class constructor.

Parameters:
  • parent (wx.Window) – parent window
  • id (integer) – window identifier. A value of -1 indicates a default value
  • pos (tuple or wx.Point) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform
  • size (tuple or wx.Size) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform
  • style (integer) – the underlying wx.Window style
  • name (str) – the window name


AddShape(self, object, addAfter = None)

Add a shape to canvas.

Parameters:
  • object – the Shape instance to add
  • addAfter – None or the Shape after which above shape is to be added.


Draw(self)

Update the buffer with the background and redraw the full diagram.



FindShape(self, x, y, info = None, notObject = None)

Find shape at given position.

Parameters:
  • x – the x position
  • y – the y position
  • info – ???

  • notObject – ???



GetDiagram(self)

Get the diagram associated with this canvas.



GetQuickEditMode(self)

Get quick edit mode.



InsertShape(self, object)

Insert a shape to canvas.

Parameters:object – the Shape instance to insert


OnBeginDragLeft(self, x, y, keys = 0)

not implemented???



OnBeginDragRight(self, x, y, keys = 0)

not implemented???



OnDragLeft(self, draw, x, y, keys = 0)

not implemented???



OnDragRight(self, draw, x, y, keys = 0)

not implemented???



OnEndDragLeft(self, x, y, keys = 0)

not implemented???



OnEndDragRight(self, x, y, keys = 0)

not implemented???



OnLeftClick(self, x, y, keys = 0)

not implemented???



OnMouseEvent(self, evt)

The mouse event handler.



OnPaint(self, evt)

The paint handler, uses BufferedPaintDC to draw the buffer to the screen.



OnRightClick(self, x, y, keys = 0)

not implemented???



OnSize(self, evt)

The size handler, it initializes the buffer to the size of the window.



Redraw(self, dc)

Redraw the diagram.



RemoveShape(self, object)

Remove a shape from canvas.

Parameters:object – the Shape instance to be removed


SetDiagram(self, diag)

Set the diagram associated with this canvas.

Parameters:diag – an instance of Diagram


Snap(self, x, y)

Snap ???

Parameters:
  • x – the x position
  • y – the y position