1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.ogl.drawn
.. highlight:: python
.. _wx.lib.ogl.drawn.DrawnShape:
==========================================================================================================================================
|phoenix_title| **wx.lib.ogl.drawn.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.
Derived from:
RectangleShape
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>DrawnShape</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.lib.ogl.drawn.DrawnShape_inheritance.png" alt="Inheritance diagram of DrawnShape" usemap="#dummy" class="inheritance"/></center>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.ogl.basic.RectangleShape.html" title="wx.lib.ogl.basic.RectangleShape" alt="" coords="9,160,231,189"/> <area shape="rect" id="node4" href="wx.lib.ogl.drawn.DrawnShape.html" title="wx.lib.ogl.drawn.DrawnShape" alt="" coords="17,237,223,267"/> <area shape="rect" id="node2" href="wx.lib.ogl.basic.Shape.html" title="wx.lib.ogl.basic.Shape" alt="" coords="39,83,200,112"/> <area shape="rect" id="node3" href="wx.lib.ogl.basic.ShapeEvtHandler.html" title="wx.lib.ogl.basic.ShapeEvtHandler" alt="" coords="5,5,235,35"/> </map>
</p>
|
|super_classes| Known Superclasses
==================================
:class:`wx.lib.ogl.basic.RectangleShape`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.ogl.drawn.DrawnShape.__init__`
:meth:`~wx.lib.ogl.drawn.DrawnShape.CalculateSize` Calculate the wxDrawnShape size from the current metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DestroyClippingRect` Destroy the clipping rectangle.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DetermineMetaFile`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawArc` Draw an arc.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawAtAngle` Set the metafile for the given orientation, which can be one of
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawEllipse`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawEllipticArc` Draw an elliptic arc.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawLine`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawLines`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawPoint`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawPolygon` Draw a polygon.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawRectangle`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawRoundedRectangle` Draw a rounded rectangle.
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawSpline`
:meth:`~wx.lib.ogl.drawn.DrawnShape.DrawText`
:meth:`~wx.lib.ogl.drawn.DrawnShape.GetAngle` Return the current orientation, which can be one of
:meth:`~wx.lib.ogl.drawn.DrawnShape.GetMetaFile` Return a reference to the internal 'pseudo-metafile'.
:meth:`~wx.lib.ogl.drawn.DrawnShape.GetPerimeterPoint`
:meth:`~wx.lib.ogl.drawn.DrawnShape.GetRotation` Return the current rotation of the shape in radians.
:meth:`~wx.lib.ogl.drawn.DrawnShape.LoadFromMetaFile` Load a (very simple) Windows metafile, created for example by
:meth:`~wx.lib.ogl.drawn.DrawnShape.OnDraw`
:meth:`~wx.lib.ogl.drawn.DrawnShape.OnDrawOutline`
:meth:`~wx.lib.ogl.drawn.DrawnShape.Rotate` Rotate about the given axis by the given amount in radians.
:meth:`~wx.lib.ogl.drawn.DrawnShape.Scale` Scale the shape by the given amount.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetClippingRect` Set the clipping rectangle.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnBackgroundColour` Set the current background colour for the current metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnBackgroundMode` Set the current background mode for the current metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnBrush` Set the brush for this metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnFont`
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnPen` Set the pen for this metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetDrawnTextColour` Set the current text colour for the current metafile.
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetSaveToFile` If save is True, the image will be saved along with the shape's
:meth:`~wx.lib.ogl.drawn.DrawnShape.SetSize`
:meth:`~wx.lib.ogl.drawn.DrawnShape.Translate` Translate the shape by the given amount.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: DrawnShape(RectangleShape)
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.
Derived from:
RectangleShape
.. method:: __init__(self)
.. method:: CalculateSize(self)
Calculate the wxDrawnShape size from the current metafile.
Call this after you have drawn into the shape.
.. method:: DestroyClippingRect(self)
Destroy the clipping rectangle.
.. method:: DetermineMetaFile(self, rotation)
.. method:: DrawArc(self, centrePt, startPt, endPt)
Draw an arc.
.. method:: DrawAtAngle(self, angle)
Set the metafile for the given orientation, which can be one of:
* DRAWN_ANGLE_0
* DRAWN_ANGLE_90
* DRAWN_ANGLE_180
* DRAWN_ANGLE_270
.. method:: DrawEllipse(self, rect)
.. method:: DrawEllipticArc(self, rect, startAngle, endAngle)
Draw an elliptic arc.
.. method:: DrawLine(self, pt1, pt2)
.. method:: DrawLines(self, pts)
.. method:: DrawPoint(self, pt)
.. method:: 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).
.. method:: DrawRectangle(self, rect)
.. method:: 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.
.. method:: DrawSpline(self, pts)
.. method:: DrawText(self, text, pt)
.. method:: GetAngle(self)
Return the current orientation, which can be one of:
* DRAWN_ANGLE_0
* DRAWN_ANGLE_90
* DRAWN_ANGLE_180
* DRAWN_ANGLE_270
.. method:: GetMetaFile(self, which = 0)
Return a reference to the internal 'pseudo-metafile'.
.. method:: GetPerimeterPoint(self, x1, y1, x2, y2)
.. method:: GetRotation(self)
Return the current rotation of the shape in radians.
.. method:: LoadFromMetaFile(self, filename)
Load a (very simple) Windows metafile, created for example by
Top Draw, the Windows shareware graphics package.
.. method:: OnDraw(self, dc)
.. method:: OnDrawOutline(self, dc, x, y, w, h)
.. method:: Rotate(self, x, y, theta)
Rotate about the given axis by the given amount in radians.
.. method:: Scale(self, sx, sy)
Scale the shape by the given amount.
.. method:: SetClippingRect(self, rect)
Set the clipping rectangle.
.. method:: SetDrawnBackgroundColour(self, colour)
Set the current background colour for the current metafile.
.. method:: SetDrawnBackgroundMode(self, mode)
Set the current background mode for the current metafile.
.. method:: SetDrawnBrush(self, brush, isFill = False)
Set the brush for this metafile.
If isFill is True, the brush is used as the fill brush.
.. method:: SetDrawnFont(self, font)
.. method:: 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).
.. method:: SetDrawnTextColour(self, colour)
Set the current text colour for the current metafile.
.. method:: 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.
.. method:: SetSize(self, w, h, recursive = True)
.. method:: Translate(self, x, y)
Translate the shape by the given amount.
|