.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.adv.PseudoDC:
==========================================================================================================================================
|phoenix_title| **wx.adv.PseudoDC**
==========================================================================================================================================
A PseudoDC is an object that can be used much like real
:class:`wx.DC`, however it provides some additional features for
object recording and manipulation beyond what a ``wx.DC`` can
provide.
All commands issued to the ``PseudoDC`` are stored in a list. You
can then play these commands back to a real DC object as often as
needed, using the :meth:`DrawToDC` method or one of the similar
methods. Commands in the command list can be tagged by an ``ID``. You
can use this ``ID`` to clear the operations associated with a single
``ID``, redraw the objects associated with that ``ID``, grey them, adjust
their position, etc.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
PseudoDC:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.adv.PseudoDC.__init__` Constructs a new Pseudo device context for recording and
:meth:`~wx.adv.PseudoDC.Clear` Clears the device context using the current background brush.
:meth:`~wx.adv.PseudoDC.ClearId` Removes all operations associated with id so the object can be redrawn.
:meth:`~wx.adv.PseudoDC.CrossHair` Displays a cross hair using the current pen. This is a
:meth:`~wx.adv.PseudoDC.DrawArc` Draws an arc of a circle, centred on the center point
:meth:`~wx.adv.PseudoDC.DrawBitmap` Draw a bitmap on the device context at the specified
:meth:`~wx.adv.PseudoDC.DrawCheckMark` Draws a check mark inside the given rectangle
:meth:`~wx.adv.PseudoDC.DrawCircle` Draws a circle with the given center point and radius.
:meth:`~wx.adv.PseudoDC.DrawEllipse` Draws an ellipse contained in the specified rectangle. The current pen
:meth:`~wx.adv.PseudoDC.DrawEllipticArc` Draws an arc of an ellipse, with the given rectangle
:meth:`~wx.adv.PseudoDC.DrawIcon` Draw an icon on the display at the given position.
:meth:`~wx.adv.PseudoDC.DrawIdToDC` Draw recorded operations tagged with id to dc.
:meth:`~wx.adv.PseudoDC.DrawLabel` Draw text within the specified rectangle, abiding by the
:meth:`~wx.adv.PseudoDC.DrawLine` Draws a line from the first point to the second.
:meth:`~wx.adv.PseudoDC.DrawLines` Draws lines using a sequence of `wx.Point` objects, adding the
:meth:`~wx.adv.PseudoDC.DrawPoint` Draws a point using the current pen.
:meth:`~wx.adv.PseudoDC.DrawPolygon` Draws a filled polygon using a sequence of `wx.Point` objects, adding
:meth:`~wx.adv.PseudoDC.DrawRectangle` Draws a rectangle with the given top left corner, and with
:meth:`~wx.adv.PseudoDC.DrawRotatedText` Draws the text rotated by angle degrees, if supported by the platform.
:meth:`~wx.adv.PseudoDC.DrawRoundedRectangle` Draws a rectangle with the given top left corner, and with
:meth:`~wx.adv.PseudoDC.DrawSpline` Draws a spline between all given control points, (a list of `wx.Point`
:meth:`~wx.adv.PseudoDC.DrawText` Draws a text string at the specified point, using the
:meth:`~wx.adv.PseudoDC.DrawToDC` Draws the recorded operations to dc.
:meth:`~wx.adv.PseudoDC.DrawToDCClipped` Draws the recorded operations to dc,
:meth:`~wx.adv.PseudoDC.DrawToDCClippedRgn` Draws the recorded operations to dc,
:meth:`~wx.adv.PseudoDC.FindObjects` Returns a list of all the id's that draw a pixel with
:meth:`~wx.adv.PseudoDC.FindObjectsByBBox` Returns a list of all the id's whose bounding boxes include (x,y).
:meth:`~wx.adv.PseudoDC.FloodFill` Flood fills the device context starting from the given point,
:meth:`~wx.adv.PseudoDC.GetIdBounds` Returns the bounding rectangle previously set with `SetIdBounds`.
:meth:`~wx.adv.PseudoDC.GetIdGreyedOut` Get whether the set of objects with tag `id` are drawn greyed out or not.
:meth:`~wx.adv.PseudoDC.GetLen` Returns the number of operations in the recorded list.
:meth:`~wx.adv.PseudoDC.RemoveAll` Removes all objects and operations from the recorded list.
:meth:`~wx.adv.PseudoDC.RemoveId` Remove the object node (and all operations) associated with an id.
:meth:`~wx.adv.PseudoDC.SetBackground` Sets the current background brush for the DC.
:meth:`~wx.adv.PseudoDC.SetBackgroundMode` The mode parameter may be one of ``wx.SOLID`` and
:meth:`~wx.adv.PseudoDC.SetBrush` Sets the current brush for the DC.
:meth:`~wx.adv.PseudoDC.SetFont` Sets the current font for the DC. It must be a valid font, in
:meth:`~wx.adv.PseudoDC.SetId` Sets the id to be associated with subsequent operations.
:meth:`~wx.adv.PseudoDC.SetIdBounds` Set the bounding rect of a given object.
:meth:`~wx.adv.PseudoDC.SetIdGreyedOut` Set whether the set of objects with tag `id` are drawn greyed out or not.
:meth:`~wx.adv.PseudoDC.SetLogicalFunction` Sets the current logical function for the device context. This
:meth:`~wx.adv.PseudoDC.SetPen` Sets the current pen for the DC.
:meth:`~wx.adv.PseudoDC.SetTextBackground` Sets the current text background colour for the DC.
:meth:`~wx.adv.PseudoDC.SetTextForeground` Sets the current text foreground colour for the DC.
:meth:`~wx.adv.PseudoDC.TranslateId` Translate the position of the operations of tag `id` by (`dx`, `dy`).
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.adv.PseudoDC.Len` See :meth:`~wx.adv.PseudoDC.GetLen`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.adv.PseudoDC(Object)
**Possible constructors**::
PseudoDC() -> None
A PseudoDC is an object that can be used much like real
:class:`wx.DC`, however it provides some additional features for
object recording and manipulation beyond what a ``wx.DC`` can
provide.
All commands issued to the ``PseudoDC`` are stored in a list. You
can then play these commands back to a real DC object as often as
needed, using the :meth:`DrawToDC` method or one of the similar
methods. Commands in the command list can be tagged by an ``ID``. You
can use this ``ID`` to clear the operations associated with a single
``ID``, redraw the objects associated with that ``ID``, grey them, adjust
their position, etc.
.. method:: __init__(self)
Constructs a new Pseudo device context for recording and
replaying DC operations.
:rtype: `None`
.. method:: Clear(self)
Clears the device context using the current background brush.
:rtype: `None`
.. method:: ClearId(self, id : int)
Removes all operations associated with id so the object can be redrawn.
:param `id`:
:type `id`: int
:rtype: `None`
.. method:: CrossHair(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**CrossHair** `(self, x : int, y : int)`
Displays a cross hair using the current pen. This is a
vertical and horizontal line the height and width of the
window, centred on the given point.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:rtype: `None`
:html:`
`
**CrossHair** `(self, pt : Point)`
:param `pt`:
:type `pt`: wx.Point
:rtype: `None`
:html:`
`
.. method:: DrawArc(self, x1 : int, y1 : int, x2 : int, y2 : int, xc : int, yc : int)
Draws an arc of a circle, centred on the center point
(xc, yc), from the first point to the second. The current
pen is used for the outline and the current brush for
filling the shape.
The arc is drawn in an anticlockwise direction from the
start point to the end point.
:param `x1`:
:type `x1`: int
:param `y1`:
:type `y1`: int
:param `x2`:
:type `x2`: int
:param `y2`:
:type `y2`: int
:param `xc`:
:type `xc`: int
:param `yc`:
:type `yc`: int
:rtype: `None`
.. method:: DrawBitmap(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawBitmap** `(self, bmp : Bitmap, x : int, y : int, useMask: bool=False)`
Draw a bitmap on the device context at the specified
point. If useMask is ``True`` and the bitmap has a
transparency mask, (or alpha channel on the platforms that
support it) then the bitmap will be drawn transparently.
When drawing a mono-bitmap, the current text foreground
colour will be used to draw the foreground of the bitmap
(all bits set to 1), and the current text background
colour to draw the background (all bits set to 0).
.. seealso:: `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`
:param `bmp`:
:type `bmp`: wx.Bitmap
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `useMask`:
:type `useMask`: bool
:rtype: `None`
:html:`
`
**DrawBitmap** `(self, bmp : Bitmap, pt : Point, useMask: bool=False)`
:param `bmp`:
:type `bmp`: wx.Bitmap
:param `pt`:
:type `pt`: wx.Point
:param `useMask`:
:type `useMask`: bool
:rtype: `None`
:html:`
`
.. method:: DrawCheckMark(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawCheckMark** `(self, x : int, y : int, width : int, height : int)`
Draws a check mark inside the given rectangle
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
:rtype: `None`
:html:`
`
**DrawCheckMark** `(self, rect : Rect)`
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
:html:`
`
.. method:: DrawCircle(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawCircle** `(self, x : int, y : int, radius : int)`
Draws a circle with the given center point and radius.
The current pen is used for the outline and the current
brush for filling the shape.
.. seealso:: `DrawEllipse`
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `radius`:
:type `radius`: int
:rtype: `None`
:html:`
`
**DrawCircle** `(self, pt : Point, radius : int)`
:param `pt`:
:type `pt`: wx.Point
:param `radius`:
:type `radius`: int
:rtype: `None`
:html:`
`
.. method:: DrawEllipse(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawEllipse** `(self, x : int, y : int, width : int, height : int)`
Draws an ellipse contained in the specified rectangle. The current pen
is used for the outline and the current brush for filling the shape.", "
.. seealso:: `DrawCircle`
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
:rtype: `None`
:html:`
`
**DrawEllipse** `(self, rect : Rect)`
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
:html:`
`
**DrawEllipse** `(self, pt : Point, sz : Size)`
:param `pt`:
:type `pt`: wx.Point
:param `sz`:
:type `sz`: wx.Size
:rtype: `None`
:html:`
`
.. method:: DrawEllipticArc(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawEllipticArc** `(self, x : int, y : int, w : int, h : int, start : float, end : float)`
Draws an arc of an ellipse, with the given rectangle
defining the bounds of the ellipse. The current pen is
used for drawing the arc and the current brush is used for
drawing the pie.
The start and end parameters specify the start and end
of the arc relative to the three-o'clock position from the
center of the rectangle. Angles are specified in degrees
(360 is a complete circle). Positive values mean
counter-clockwise motion. If start is equal to end, a
complete ellipse will be drawn.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `w`:
:type `w`: int
:param `h`:
:type `h`: int
:param `start`:
:type `start`: float
:param `end`:
:type `end`: float
:rtype: `None`
:html:`
`
**DrawEllipticArc** `(self, pt : Point, sz : Size, start : float, end : float)`
:param `pt`:
:type `pt`: wx.Point
:param `sz`:
:type `sz`: wx.Size
:param `start`:
:type `start`: float
:param `end`:
:type `end`: float
:rtype: `None`
:html:`
`
.. method:: DrawIcon(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawIcon** `(self, icon : Icon, x : int, y : int)`
Draw an icon on the display at the given position.
:param `icon`:
:type `icon`: wx.Icon
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:rtype: `None`
:html:`
`
**DrawIcon** `(self, icon : Icon, pt : Point)`
:param `icon`:
:type `icon`: wx.Icon
:param `pt`:
:type `pt`: wx.Point
:rtype: `None`
:html:`
`
.. method:: DrawIdToDC(self, id : int, dc : DC)
Draw recorded operations tagged with id to dc.
:param `id`:
:type `id`: int
:param `dc`:
:type `dc`: wx.DC
:rtype: `None`
.. method:: DrawLabel(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawLabel** `(self, text : str, rect : Rect, alignment: int=ALIGN_LEFT|ALIGN_TOP, indexAccel: int=-1)`
Draw text within the specified rectangle, abiding by the
alignment flags. Will additionally emphasize the
character at indexAccel if it is not -1.
:param `text`:
:type `text`: string
:param `rect`:
:type `rect`: wx.Rect
:param `alignment`:
:type `alignment`: int
:param `indexAccel`:
:type `indexAccel`: int
:rtype: `None`
:html:`
`
**DrawLabel** `(self, text : str, image : Bitmap, rect : Rect, alignment: int=ALIGN_LEFT|ALIGN_TOP, indexAccel: int=-1)`
Draw text and an image (which may be ``wx.NullBitmap`` to skip
drawing it) within the specified rectangle, abiding by the alignment
flags. Will additionally emphasize the character at indexAccel if
it is not -1.
:param `text`:
:type `text`: string
:param `image`:
:type `image`: wx.Bitmap
:param `rect`:
:type `rect`: wx.Rect
:param `alignment`:
:type `alignment`: int
:param `indexAccel`:
:type `indexAccel`: int
:rtype: `None`
:html:`
`
.. method:: DrawLine(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawLine** `(self, x1 : int, y1 : int, x2 : int, y2 : int)`
Draws a line from the first point to the second.
The current pen is used for drawing the line. Note that
the second point is not part of the line and is not
drawn by this function (this is consistent with the
behaviour of many other toolkits).
:param `x1`:
:type `x1`: int
:param `y1`:
:type `y1`: int
:param `x2`:
:type `x2`: int
:param `y2`:
:type `y2`: int
:rtype: `None`
:html:`
`
**DrawLine** `(self, pt1 : Point, pt2 : Point)`
:param `pt1`:
:type `pt1`: wx.Point
:param `pt2`:
:type `pt2`: wx.Point
:rtype: `None`
:html:`
`
.. method:: DrawLines(self, points : PointList, xoffset: int=0, yoffset: int=0)
Draws lines using a sequence of `wx.Point` objects, adding the
optional offset coordinate. The current pen is used for drawing the
lines.
:param `points`:
:type `points`: PointList
:param `xoffset`:
:type `xoffset`: int
:param `yoffset`:
:type `yoffset`: int
:rtype: `None`
.. method:: DrawPoint(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawPoint** `(self, x : int, y : int)`
Draws a point using the current pen.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:rtype: `None`
:html:`
`
**DrawPoint** `(self, pt : Point)`
:param `pt`:
:type `pt`: wx.Point
:rtype: `None`
:html:`
`
.. method:: DrawPolygon(self, points : PointList, xoffset: int=0, yoffset: int=0, fillStyle: PolygonFillMode=ODDEVEN_RULE)
Draws a filled polygon using a sequence of `wx.Point` objects, adding
the optional offset coordinate. The last argument specifies the fill
rule: ``wx.ODDEVEN_RULE`` (the default) or ``wx.WINDING_RULE``.
The current pen is used for drawing the outline, and the current brush
for filling the shape. Using a transparent brush suppresses
filling. Note that wxWidgets automatically closes the first and last
points.
:param `points`:
:type `points`: PointList
:param `xoffset`:
:type `xoffset`: int
:param `yoffset`:
:type `yoffset`: int
:param `fillStyle`:
:type `fillStyle`: wx.PolygonFillMode
:rtype: `None`
.. method:: DrawRectangle(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawRectangle** `(self, x : int, y : int, width : int, height : int)`
Draws a rectangle with the given top left corner, and with
the given size. The current pen is used for the outline
and the current brush for filling the shape.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
:rtype: `None`
:html:`
`
**DrawRectangle** `(self, rect : Rect)`
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
:html:`
`
**DrawRectangle** `(self, pt : Point, sz : Size)`
:param `pt`:
:type `pt`: wx.Point
:param `sz`:
:type `sz`: wx.Size
:rtype: `None`
:html:`
`
.. method:: DrawRotatedText(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawRotatedText** `(self, text : str, x : int, y : int, angle : float)`
Draws the text rotated by angle degrees, if supported by the platform.
:param `text`:
:type `text`: string
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `angle`:
:type `angle`: float
:rtype: `None`
:html:`
`
**DrawRotatedText** `(self, text : str, pt : Point, angle : float)`
:param `text`:
:type `text`: string
:param `pt`:
:type `pt`: wx.Point
:param `angle`:
:type `angle`: float
:rtype: `None`
:html:`
`
.. method:: DrawRoundedRectangle(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawRoundedRectangle** `(self, x : int, y : int, width : int, height : int, radius : float)`
Draws a rectangle with the given top left corner, and with
the given size. The current pen is used for the outline
and the current brush for filling the shape.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `width`:
:type `width`: int
:param `height`:
:type `height`: int
:param `radius`:
:type `radius`: float
:rtype: `None`
:html:`
`
**DrawRoundedRectangle** `(self, rect : Rect, radius : float)`
:param `rect`:
:type `rect`: wx.Rect
:param `radius`:
:type `radius`: float
:rtype: `None`
:html:`
`
**DrawRoundedRectangle** `(self, pt : Point, sz : Size, radius : float)`
:param `pt`:
:type `pt`: wx.Point
:param `sz`:
:type `sz`: wx.Size
:param `radius`:
:type `radius`: float
:rtype: `None`
:html:`
`
.. method:: DrawSpline(self, points : PointList)
Draws a spline between all given control points, (a list of `wx.Point`
objects) using the current pen. The spline is drawn using a series of
lines, using an algorithm taken from the X drawing program '``XFIG``'.
:param `points`:
:type `points`: PointList
:rtype: `None`
.. method:: DrawText(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**DrawText** `(self, text : str, x : int, y : int)`
Draws a text string at the specified point, using the
current text font, and the current text foreground and
background colours.
The coordinates refer to the top-left corner of the
rectangle bounding the string. See `wx.DC.GetTextExtent`
for how to get the dimensions of a text string, which can
be used to position the text more precisely, (you will
need to use a real DC with GetTextExtent as wx.PseudoDC
does not implement it.)
``NOTE``: under wxGTK the current logical function is used
by this function but it is ignored by wxMSW. Thus, you
should avoid using logical functions with this function
in portable programs.", "
.. seealso:: `DrawRotatedText`
:param `text`:
:type `text`: string
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:rtype: `None`
:html:`
`
**DrawText** `(self, text : str, pt : Point)`
:param `text`:
:type `text`: string
:param `pt`:
:type `pt`: wx.Point
:rtype: `None`
:html:`
`
.. method:: DrawToDC(self, dc : DC)
Draws the recorded operations to dc.
:param `dc`:
:type `dc`: wx.DC
:rtype: `None`
.. method:: DrawToDCClipped(self, dc : DC, rect : Rect)
Draws the recorded operations to dc,
unless the operation is known to be outside of rect.
:param `dc`:
:type `dc`: wx.DC
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
.. method:: DrawToDCClippedRgn(self, dc : DC, region : Region)
Draws the recorded operations to dc,
unless the operation is known to be outside the given region.
:param `dc`:
:type `dc`: wx.DC
:param `region`:
:type `region`: wx.Region
:rtype: `None`
.. method:: FindObjects(self, x : int, y : int, radius: int=1, bg: Colour=WHITE)
Returns a list of all the id's that draw a pixel with
color not equal to bg within radius of (x,y). Returns an
empty list if nothing is found. The list is in reverse
drawing order so list[0] is the top id.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `radius`:
:type `radius`: int
:param `bg`:
:type `bg`: wx.Colour
:rtype: `Any`
.. method:: FindObjectsByBBox(self, x : int, y : int)
Returns a list of all the id's whose bounding boxes include (x,y).
Returns an empty list if nothing is found. The list is in
reverse drawing order so list[0] is the top id.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:rtype: `Any`
.. method:: FloodFill(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**FloodFill** `(self, x : int, y : int, col : Colour, style: FloodFillStyle=FLOOD_SURFACE)`
Flood fills the device context starting from the given point,
using the current brush colour, and using a style:
- ``wx.FLOOD_SURFACE``: the flooding occurs until a colour other than the given colour is encountered.
- ``wx.FLOOD_BORDER``: the area to be flooded is bounded by the given colour.
:param `x`:
:type `x`: int
:param `y`:
:type `y`: int
:param `col`:
:type `col`: wx.Colour
:param `style`:
:type `style`: wx.FloodFillStyle
:rtype: `None`
:html:`
`
**FloodFill** `(self, pt : Point, col : Colour, style: FloodFillStyle=FLOOD_SURFACE)`
:param `pt`:
:type `pt`: wx.Point
:param `col`:
:type `col`: wx.Colour
:param `style`:
:type `style`: wx.FloodFillStyle
:rtype: `None`
:html:`
`
.. method:: GetIdBounds(self, id : int)
Returns the bounding rectangle previously set with `SetIdBounds`.
If no bounds have been set, it returns wx.Rect(0,0,0,0).
:param `id`:
:type `id`: int
:rtype: `Rect`
.. method:: GetIdGreyedOut(self, id : int)
Get whether the set of objects with tag `id` are drawn greyed out or not.
:param `id`:
:type `id`: int
:rtype: `bool`
.. method:: GetLen(self)
Returns the number of operations in the recorded list.
:rtype: `int`
.. method:: RemoveAll(self)
Removes all objects and operations from the recorded list.
:rtype: `None`
.. method:: RemoveId(self, id : int)
Remove the object node (and all operations) associated with an id.
:param `id`:
:type `id`: int
:rtype: `None`
.. method:: SetBackground(self, brush : Brush)
Sets the current background brush for the DC.
:param `brush`:
:type `brush`: wx.Brush
:rtype: `None`
.. method:: SetBackgroundMode(self, mode : int)
The mode parameter may be one of ``wx.SOLID`` and
``wx.TRANSPARENT``. This setting determines whether text
will be drawn with a background colour or not.
:param `mode`:
:type `mode`: int
:rtype: `None`
.. method:: SetBrush(self, brush : Brush)
Sets the current brush for the DC.
If the argument is ``wx.NullBrush``, the current brush is selected out
of the device context, and the original brush restored, allowing the
current brush to be destroyed safely.
.. seealso:: `wx.Brush`
:param `brush`:
:type `brush`: wx.Brush
:rtype: `None`
.. method:: SetFont(self, font : Font)
Sets the current font for the DC. It must be a valid font, in
particular you should not pass ``wx.NullFont`` to this method.
.. seealso:: `wx.Font`
:param `font`:
:type `font`: wx.Font
:rtype: `None`
.. method:: SetId(self, id : int)
Sets the id to be associated with subsequent operations.
:param `id`:
:type `id`: int
:rtype: `None`
.. method:: SetIdBounds(self, id : int, rect : Rect)
Set the bounding rect of a given object.
This will create an object node if one doesn't exist.
:param `id`:
:type `id`: int
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
.. method:: SetIdGreyedOut(self, id : int, greyout : bool)
Set whether the set of objects with tag `id` are drawn greyed out or not.
:param `id`:
:type `id`: int
:param `greyout`:
:type `greyout`: bool
:rtype: `None`
.. method:: SetLogicalFunction(self, function : RasterOperationMode)
Sets the current logical function for the device context. This
determines how a source pixel (from a pen or brush colour, combines
with a destination pixel in the current device context.
The possible values and their meaning in terms of source and
destination pixel values are defined in the :ref:`wx.RasterOperationMode`
enumeration.
The default is wx.``wx.COPY``, which simply draws with the current
colour. The others combine the current colour and the background using
a logical operation. wx.``wx.INVERT`` is commonly used for drawing rubber
bands or moving outlines, since drawing twice reverts to the original
colour.
:param `function`:
:type `function`: wx.RasterOperationMode
:rtype: `None`
.. method:: SetPen(self, pen : Pen)
Sets the current pen for the DC.
If the argument is ``wx.NullPen``, the current pen is selected out of the
device context, and the original pen restored.
.. seealso:: `wx.Pen`
:param `pen`:
:type `pen`: wx.Pen
:rtype: `None`
.. method:: SetTextBackground(self, colour : Colour)
Sets the current text background colour for the DC.
:param `colour`:
:type `colour`: :class:`Colour`
:rtype: `None`
.. method:: SetTextForeground(self, colour : Colour)
Sets the current text foreground colour for the DC.
:param `colour`:
:type `colour`: wx.Colour
:rtype: `None`
.. method:: TranslateId(self, id : int, dx : int, dy : int)
Translate the position of the operations of tag `id` by (`dx`, `dy`).
:param `id`:
:type `id`: int
:param `dx`:
:type `dx`: int
:param `dy`:
:type `dy`: int
:rtype: `None`
.. attribute:: Len
See :meth:`~wx.adv.PseudoDC.GetLen`