Table Of Contents

Previous topic

_composit

Next topic

Constraint

This Page

phoenix_title CompositeShape

This is an object with a list of child objects, and a list of size and positioning constraints between the children.

Derived from:
wxRectangleShape

class_hierarchy Inheritance Diagram

Inheritance diagram for class CompositeShape

Inheritance diagram of CompositeShape


super_classes Known Superclasses

lib.ogl._basic.RectangleShape


method_summary Methods Summary

__init__  
AddChild Adds a child shape to the composite.
AddConstraint Adds a constraint to the composite.
AddSimpleConstraint Add a constraint of the given type to the composite.
CalculateSize Calculates the size and position of the composite based on
Constrain  
ContainsDivision Returns TRUE if division is a descendant of this container.
Delete Fully disconnect this shape from parents, children, the
DeleteConstraint Deletes constraint from composite.
DeleteConstraintsInvolvingChild This function deletes constraints which mention the given child.
FindConstraint Finds the constraint with the given id.
FindContainerImage Finds the image used to visualize a container. This is any child of
GetConstraints Return the list of constraints.
GetDivisions Return the list of divisions.
MakeContainer Makes this composite into a container by creating one child
OnBeginDragLeft  
OnCreateDivision  
OnDragLeft  
OnDraw  
OnDrawContents  
OnEndDragLeft  
OnErase  
OnMovePre  
OnRightClick  
Recompute Recomputes any constraints associated with the object. If FALSE is
RemoveChild Removes the child from the composite and any constraint
RemoveChildFromConstraints  
SetSize  

api Class API



class CompositeShape(RectangleShape)

This is an object with a list of child objects, and a list of size and positioning constraints between the children.

Derived from:
wxRectangleShape

Methods



__init__(self)


AddChild(self, child, addAfter = None)

Adds a child shape to the composite.

If addAfter is not None, the shape will be added after this shape.



AddConstraint(self, constraint)

Adds a constraint to the composite.



AddSimpleConstraint(self, type, constraining, constrained)

Add a constraint of the given type to the composite.

constraining is the shape doing the constraining constrained is a list of shapes being constrained



CalculateSize(self)

Calculates the size and position of the composite based on child sizes and positions.



Constrain(self)


ContainsDivision(self, division)

Returns TRUE if division is a descendant of this container.



Delete(self)

Fully disconnect this shape from parents, children, the canvas, etc.



DeleteConstraint(self, constraint)

Deletes constraint from composite.



DeleteConstraintsInvolvingChild(self, child)

This function deletes constraints which mention the given child.

Used when deleting a child from the composite.



FindConstraint(self, cId)

Finds the constraint with the given id.

Returns a tuple of the constraint and the actual composite the constraint was in, in case that composite was a descendant of this composit.

Returns None if not found.



FindContainerImage(self)

Finds the image used to visualize a container. This is any child of the composite that is not in the divisions list.



GetConstraints(self)

Return the list of constraints.



GetDivisions(self)

Return the list of divisions.



MakeContainer(self)

Makes this composite into a container by creating one child DivisionShape.



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


OnCreateDivision(self)


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


OnDraw(self, dc)


OnDrawContents(self, dc)


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


OnErase(self, dc)


OnMovePre(self, dc, x, y, old_x, old_y, display = True)


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


Recompute(self)

Recomputes any constraints associated with the object. If FALSE is returned, the constraints could not be satisfied (there was an inconsistency).



RemoveChild(self, child)

Removes the child from the composite and any constraint relationships, but does not delete the child.



RemoveChildFromConstraints(self, child)


SetSize(self, w, h, recursive = True)