Draws a pseduo-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.
Derived from
See also wxRectangleShape.
Members
wxDrawnShape::wxDrawnShape
wxDrawnShape::~wxDrawnShape
wxDrawnShape::CalculateSize
wxDrawnShape::DestroyClippingRect
wxDrawnShape::DrawArc
wxDrawnShape::DrawAtAngle
wxDrawnShape::DrawEllipticArc
wxDrawnShape::DrawLine
wxDrawnShape::DrawLines
wxDrawnShape::DrawPoint
wxDrawnShape::DrawPolygon
wxDrawnShape::DrawRectangle
wxDrawnShape::DrawRoundedRectangle
wxDrawnShape::DrawSpline
wxDrawnShape::DrawText
wxDrawnShape::GetAngle
wxDrawnShape::GetMetaFile
wxDrawnShape::GetRotation
wxDrawnShape::LoadFromMetaFile
wxDrawnShape::Rotate
wxDrawnShape::SetClippingRect
wxDrawnShape::SetDrawnBackgroundColour
wxDrawnShape::SetDrawnBackgroundMode
wxDrawnShape::SetDrawnBrush
wxDrawnShape::SetDrawnFont
wxDrawnShape::SetDrawnPen
wxDrawnShape::SetDrawnTextColour
wxDrawnShape::Scale
wxDrawnShape::SetSaveToFile
wxDrawnShape::Translate
wxDrawnShape()
Constructor.
~wxDrawnShape()
Destructor.
void CalculateSize()
Calculates the wxDrawnShape size from the current metafile. Call this after you have drawn into the shape.
void DestroyClippingRect()
Destroys the clipping rectangle. See also wxDrawnShape::SetClippingRect.
void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint, const wxPoint& endPoint)
Draws an arc (see wxWindows documentation for details).
void DrawAtAngle(int angle)
Sets the metafile for the given orientation, which can be one of:
See also wxDrawnShape::GetAngle.
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle)
Draws an elliptic arc (see wxWindows documentation for details).
void DrawLine(const wxPoint& point1, const wxPoint& point2)
Draws a line from point1 to point2.
void DrawLines(int n, wxPoint& points[])
Draws n lines.
void DrawPoint(const wxPoint& point)
Draws a point.
void DrawPolygon(int n, wxPoint& points[], int flags = 0)
Draws a polygon. flags can be one or more of oglMETAFLAGS_OUTLINE (use this polygon for the drag outline) and oglMETAFLAGS_ATTACHMENTS (use the vertices of this polygon for attachments).
void DrawRectangle(const wxRect& rect)
Draws a rectangle.
void DrawRoundedRectangle(const wxRect& rect, double radius)
Draws 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.
void DrawSpline(int n, wxPoint& points[])
Draws a spline curve.
void DrawText(const wxString& text, const wxPoint& point)
Draws text at the given point.
int GetAngle() const
Returns the current orientation, which can be one of:
See also wxDrawnShape::DrawAtAngle.
wxPseudoMetaFile& GetMetaFile() const
Returns a reference to the internal 'pseudo-metafile'.
double GetRotation() const
Returns the current rotation of the shape in radians.
bool LoadFromMetaFile(const wxString& filename)
Loads a (very simple) Windows metafile, created for example by Top Draw, the Windows shareware graphics package.
void Rotate(double x, double y, double theta)
Rotate about the given axis by the given amount in radians.
void SetClippingRect(const wxRect& rect)
Sets the clipping rectangle. See also wxDrawnShape::DestroyClippingRect.
void SetDrawnBackgroundColour(const wxColour& colour)
Sets the current background colour for the current metafile.
void SetDrawnBackgroundMode(int mode)
Sets the current background mode for the current metafile.
void SetDrawnBrush(wxPen* pen, bool isOutline = FALSE)
Sets 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).
void SetDrawnFont(wxFont* font)
Sets the current font for the current metafile.
void SetDrawnPen(wxPen* pen, bool isOutline = FALSE)
Sets 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).
void SetDrawnTextColour(const wxColour& colour)
Sets the current text colour for the current metafile.
void Scale(double sx, double sy)
Scales the shape by the given amount.
void SetSaveToFile(bool 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.
void Translate(double x, double y)
Translates the shape by the given amount.