Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Package ogl :: Class DrawnShape |
|
object
--+ |ShapeEvtHandler
--+ |Shape
--+ |RectangleShape
--+ | DrawnShape
Draws a pseudo-metafile shape, which can be loaded from a simple Windows metafile.
wxDrawnShape allows you to specify a different shape for each of four orientations (North, West, South and East). It also provides a set of drawing functions for programmatic drawing of a shape, so that during construction of the shape you can draw into it as if it were a device context.
Method Summary | |
---|---|
__init__(self)
| |
Calculate the wxDrawnShape size from the current metafile. | |
Destroy the clipping rectangle. | |
DetermineMetaFile(self,
rotation)
| |
Draw an arc. | |
Set the metafile for the given orientation, which can be one of: | |
DrawEllipse(self,
rect)
| |
Draw an elliptic arc. | |
DrawLine(self,
pt1,
pt2)
| |
DrawLines(self,
pts)
| |
DrawPoint(self,
pt)
| |
Draw a polygon. | |
DrawRectangle(self,
rect)
| |
Draw a rounded rectangle. | |
DrawSpline(self,
pts)
| |
DrawText(self,
text,
pt)
| |
Return the current orientation, which can be one of: | |
Return a reference to the internal 'pseudo-metafile'. | |
Get the point at which the line from (x1, y1) to (x2, y2) hits the shape. | |
Return the current rotation of the shape in radians. | |
Load a (very simple) Windows metafile, created for example by Top Draw, the Windows shareware graphics package. | |
OnDraw(self,
dc)
| |
OnDrawOutline(self,
dc,
x,
y,
w,
h)
| |
Rotate about the given axis by the given amount in radians. | |
Scale the shape by the given amount. | |
Set the clipping rectangle. | |
Set the current background colour for the current metafile. | |
Set the current background mode for the current metafile. | |
Set the brush for this metafile. | |
SetDrawnFont(self,
font)
| |
Set the pen for this metafile. | |
Set the current text colour for the current metafile. | |
If save is True, the image will be saved along with the shape's other attributes. | |
SetSize(self,
w,
h,
recursive)
| |
Translate the shape by the given amount. | |
Inherited from RectangleShape | |
Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text). | |
Get the radius of the rectangle's rounded corners. | |
| |
| |
Set the radius of the rectangle's rounded corners. | |
| |
| |
Inherited from Shape | |
| |
| |
Add a line between this shape and the given other shape, at the specified attachment points. | |
Add a region to the shape. | |
Add a line of text to the shape's default text region. | |
Add the shape to the canvas's shape list. | |
TRUE if the shape's ancestor is currently selected. | |
Apply the line ordering in linesToSort to the shape, to reorder the way lines are attached. | |
Assign new ids to this image and its children. | |
Set the shape's internal canvas pointer to point to the given canvas. | |
TRUE if attachment is a valid attachment point. | |
Return TRUE if pt1 is less than or equal to pt2, in the sense that one point comes before another on an edge of the shape. | |
Assuming the attachment lies along a vertical or horizontal line, calculate the position on that point. | |
Clear internal custom attachment point shapes (of class wxAttachmentPoint). | |
Clear the ShapeRegions from the shape. | |
Clear the text from the specified text region. | |
Fully disconnect this shape from parents, children, the canvas, etc. | |
Delete the control points (or handles) for the shape. | |
Disassociates the shape from its canvas. | |
TRUE if the shape may be dragged by the user. | |
Draw the whole shape and any lines attached to it. | |
Draw the internal graphic of the shape (such as text). | |
Draws any lines linked to this shape. | |
Erase the shape. | |
Erase the shape contents, that is, the area within the shape's minimum bounding box. | |
Erase links attached to this shape, but do not repair damage caused to other shapes. | |
Find the actual image ('this' if non-composite) and region id for the given region name. | |
Get a list of all region names for this image (composite or simple). | |
Flash the shape. | |
Reformat the given text region; defaults to formatting the default region. | |
Get the number of lines at this attachment position. | |
Return the attachment mode. | |
Get the position at which the given attachment point should be drawn. | |
Only get the attachment position at the _edge_ of the shape, ignoring branching mode. | |
Return brush of the right colour for the background. | |
Return pen of the right colour for the background. | |
Get the maximum bounding box for the shape, taking into account external features such as shadows. | |
Get information about where branching connections go. | |
| |
Get the root point at the given attachment. | |
| |
Return the brush used for filling the shape. | |
Get the internal canvas. | |
TRUE if the shape is to be resized from the centre (the centre stands still), or FALSE if from the corner or side being dragged (the other corner or side stands still) | |
Return the list of children for this shape. | |
| |
TRUE if the default region will not be shown, FALSE otherwise. | |
Return the list of drawhandles. | |
Return the event handler for this shape. | |
TRUE if the shape cannot be resized in the vertical plane. | |
Return flags indicating whether the shape is of fixed size in either direction. | |
TRUE if the shape cannot be resized in the horizontal plane. | |
Get the font for the specified text region. | |
| |
Return the integer identifier for this shape. | |
Get the zero-based position of line in the list of lines for this shape. | |
Return the list of lines connected to this shape. | |
TRUE if shape keeps aspect ratio during resize. | |
Get the number of attachment points for this shape. | |
Return the number of text regions for this shape. | |
Return the parent of this shape, if it is part of a composite. | |
Return the pen used for drawing the shape's outline. | |
Get the region's identifier by name. | |
Get the region's name. | |
Return the list of ShapeRegions. | |
Return the sensitivity filter, a bitlist of values. | |
Return the current shadow mode setting | |
Return whether lines should be spaced out evenly at the point they touch the node (True), or whether they should join at a single point (False). | |
Get the colour for the specified text region. | |
Return the top-most ancestor of this shape (the root of the composite). | |
Get the x position of the centre of the shape. | |
Get the y position of the centre of the shape. | |
TRUE if image is a descendant of this composite. | |
Given a point on a canvas, returns TRUE if the point was on the shape, and returns the nearest attachment point and distance from the given point and target. | |
Insert the shape at the front of the shape list of canvas. | |
TRUE if the shape is highlighted. | |
TRUE if the shape is in a visible state, FALSE otherwise. | |
Rotate the standard attachment point from logical to physical (0 is always North). | |
Make a list of control points (draggable handles) appropriate to the shape. | |
Make the mandatory control points. | |
Move the shape to the given position. | |
Move the given line (which must already be attached to the shape) to a different attachment point on the shape, or a different order on the same attachment. | |
Redraw all the lines attached to the shape. | |
Make unique names for all the regions in a shape or composite shape. | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Rotate the standard attachment point from physical (0 is always North) to logical (0 -> 1 if rotated by 90 degrees) | |
Do recentring (or other formatting) for all the text regions for this shape. | |
Recomputes any constraints associated with the shape. | |
Remove the shape from the canvas. | |
Remove the given line from the shape's list of attached lines. | |
Reset the positions of the control points (for instance when the shape's shape has changed). | |
Reset the mandatory control points. | |
Select or deselect the given shape, drawing or erasing control points (handles) as necessary. | |
TRUE if the shape is currently selected. | |
Set the attachment mode. | |
| |
Set the brush for filling the shape's shape. | |
Identical to Shape.Attach. | |
Specify whether the shape is to be resized from the centre (the centre stands still) or from the corner or side being dragged (the other corner or side stands still). | |
Set the default region to be consistent with the shape size. | |
Set flag to TRUE to stop the default region being shown. | |
Set the shape to be draggable or not draggable. | |
Set the drawHandles flag for this shape and all descendants. | |
Set the event handler for this shape. | |
Set the shape to be fixed size. | |
Set the font for the specified text region. | |
Set the format mode of the default text region. | |
Set the highlight for a shape. | |
Set the integer identifier for this shape. | |
Set whether a shape that resizes should not change the aspect ratio (width and height should be in the original proportion). | |
| |
Set the pen for drawing the shape's outline. | |
Set the name for this region. | |
| |
Set the shape to be sensitive or insensitive to specific mouse operations. | |
Set the shadow mode (whether a shadow is drawn or not). | |
| |
Indicate whether lines should be spaced out evenly at the point they touch the node (sp = True), or whether they should join at a single point (sp = False). | |
Set the colour for the specified text region. | |
Set the x position of the shape. | |
Set the y position of the shape. | |
Set a flag indicating whether the shape should be drawn. | |
Reorder the lines coming into the node image at this attachment position, in the order in which they appear in linesToSort. | |
Inherited from ShapeEvtHandler | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
Return repr(x)... | |
x.__setattr__('name', value) <==> x.name = value |
Class Variable Summary | |
---|---|
Inherited from Shape | |
bool |
GraphicsInSizeToContents = False
|
Method Details |
---|
CalculateSize(self)Calculate the wxDrawnShape size from the current metafile. Call this after you have drawn into the shape. |
DestroyClippingRect(self)Destroy the clipping rectangle. |
DrawArc(self, centrePt, startPt, endPt)Draw an arc. |
DrawAtAngle(self, angle)Set the metafile for the given orientation, which can be one of:
|
DrawEllipticArc(self, rect, startAngle, endAngle)Draw an elliptic arc. |
DrawPolygon(self, pts, flags=0)Draw a polygon. flags can be one or more of: METAFLAGS_OUTLINE (use this polygon for the drag outline) and METAFLAGS_ATTACHMENTS (use the vertices of this polygon for attachments). |
DrawRoundedRectangle(self, rect, radius)Draw a rounded rectangle. radius is the corner radius. If radius is negative, it expresses the radius as a proportion of the smallest dimension of the rectangle. |
GetAngle(self)Return the current orientation, which can be one of:
|
GetMetaFile(self, which=0)Return a reference to the internal 'pseudo-metafile'. |
GetPerimeterPoint(self, x1, y1, x2, y2)Get the point at which the line from (x1, y1) to (x2, y2) hits the shape. Returns False if the line doesn't hit the perimeter.
|
GetRotation(self)Return the current rotation of the shape in radians.
|
LoadFromMetaFile(self, filename)Load a (very simple) Windows metafile, created for example by Top Draw, the Windows shareware graphics package. |
Rotate(self, x, y, theta)Rotate about the given axis by the given amount in radians.
|
Scale(self, sx, sy)Scale the shape by the given amount. |
SetClippingRect(self, rect)Set the clipping rectangle. |
SetDrawnBackgroundColour(self, colour)Set the current background colour for the current metafile. |
SetDrawnBackgroundMode(self, mode)Set the current background mode for the current metafile. |
SetDrawnBrush(self, brush, isFill=False)Set the brush for this metafile. If isFill is True, the brush is used as the fill brush. |
SetDrawnPen(self, pen, isOutline=False)Set the pen for this metafile. If isOutline is True, this pen is taken to indicate the outline (and if the outline pen is changed for the whole shape, the pen will be replaced with the outline pen). |
SetDrawnTextColour(self, colour)Set the current text colour for the current metafile. |
SetSaveToFile(self, save)If save is True, the image will be saved along with the shape's other attributes. The reason why this might not be desirable is that if there are many shapes with the same image, it would be more efficient for the application to save one copy, and not duplicate the information for every shape. The default is True. |
Translate(self, x, y)Translate the shape by the given amount. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 17:03:40 2007 | http://epydoc.sf.net |