Package wx :: Class PseudoDC

[frames | no frames]

## Type PseudoDC

    object --+
             |
        Object --+
                 |
                PseudoDC

A PseudoDC is an object that can be used as if it were a `wx.DC`. All commands issued to the PseudoDC are stored in a list. You can then play these commands back to a real DC object using the DrawToDC method. Commands in the command list are indexed by ID. You can use this to clear the operations associated with a single ID and then re-draw the object associated with that ID.

Method Summary
PseudoDC | ``__init__`(self)` Constructs a new Pseudo device context for recording dc operations
| `__del__(self)`
| ``BeginDrawing`(self)` Allows for optimization of drawing code on platforms that need it.
| ``Clear`(self)` Clears the device context using the current background brush.
| ``ClearId`(self, id)` Removes all operations associated with id so the object can be redrawn.
| ``CrossHair`(self, x, y)` Displays a cross hair using the current pen.
| ``CrossHairPoint`(self, pt)` Displays a cross hair using the current pen.
| ``DrawArc`(self, x1, y1, x2, y2, xc, yc)` Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second.
| ``DrawArcPoint`(self, pt1, pt2, center)` Draws an arc of a circle, centred on the center point (xc, yc), from the first point to the second.
| ``DrawBitmap`(self, bmp, x, y, useMask)` Draw a bitmap on the device context at the specified point.
| ``DrawBitmapPoint`(self, bmp, pt, useMask)` Draw a bitmap on the device context at the specified point.
| ``DrawCheckMark`(self, x, y, width, height)` Draws a check mark inside the given rectangle.
| ``DrawCheckMarkRect`(self, rect)` Draws a check mark inside the given rectangle.
| ``DrawCircle`(self, x, y, radius)` Draws a circle with the given center point and radius.
| ``DrawCirclePoint`(self, pt, radius)` Draws a circle with the given center point and radius.
| ``DrawEllipse`(self, x, y, width, height)` Draws an ellipse contained in the specified rectangle.
| ``DrawEllipsePointSize`(self, pt, sz)` Draws an ellipse contained in the specified rectangle.
| ``DrawEllipseRect`(self, rect)` Draws an ellipse contained in the specified rectangle.
| ``DrawEllipticArc`(self, x, y, w, h, start, end)` Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse.
| ``DrawEllipticArcPointSize`(self, pt, sz, start, end)` Draws an arc of an ellipse, with the given rectangle defining the bounds of the ellipse.
| ``DrawIcon`(self, icon, x, y)` Draw an icon on the display (does nothing if the device context is PostScript).
| ``DrawIconPoint`(self, icon, pt)` Draw an icon on the display (does nothing if the device context is PostScript).
| ``DrawIdToDC`(self, id, dc)` Draw recorded operations of id to dc.
| ``DrawImageLabel`(self, text, image, rect, alignment, indexAccel)` Draw text and an image (which may be `wx.NullBitmap` to skip drawing it) within the specified rectangle, abiding by the alignment flags.
| ``DrawLabel`(self, text, rect, alignment, indexAccel)` Draw text within the specified rectangle, abiding by the alignment flags.
| ``DrawLine`(self, x1, y1, x2, y2)` Draws a line from the first point to the second.
| ``DrawLinePoint`(self, pt1, pt2)` Draws a line from the first point to the second.
| ``DrawLines`(self, points, xoffset, yoffset)` Draws lines using a sequence of `wx.Point` objects, adding the optional offset coordinate.
| ``DrawPoint`(self, x, y)` Draws a point using the current pen.
| ``DrawPointPoint`(self, pt)` Draws a point using the current pen.
| ``DrawPolygon`(self, points, xoffset, yoffset, fillStyle)` Draws a filled polygon using a sequence of `wx.Point` objects, adding the optional offset coordinate.
| ``DrawRectangle`(self, x, y, width, height)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawRectanglePointSize`(self, pt, sz)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawRectangleRect`(self, rect)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawRotatedText`(self, text, x, y, angle)` Draws the text rotated by angle degrees, if supported by the platform.
| ``DrawRotatedTextPoint`(self, text, pt, angle)` Draws the text rotated by angle degrees, if supported by the platform.
| ``DrawRoundedRectangle`(self, x, y, width, height, radius)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawRoundedRectanglePointSize`(self, pt, sz, radius)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawRoundedRectangleRect`(self, r, radius)` Draws a rectangle with the given top left corner, and with the given size.
| ``DrawSpline`(self, points)` Draws a spline between all given control points, (a list of `wx.Point` objects) using the current pen.
| ``DrawText`(self, text, x, y)` Draws a text string at the specified point, using the current text font, and the current text foreground and background colours.
| ``DrawTextPoint`(self, text, pt)` Draws a text string at the specified point, using the current text font, and the current text foreground and background colours.
| ``DrawToDC`(self, dc)` Draws the recorded operations to dc.
| ``DrawToDCClipped`(self, dc, rect)` Draws the recorded operations to dc unless the operation is known to be outside rect.
| ``DrawToDCClippedRgn`(self, dc, region)` Draws the recorded operations to dc unless the operation is known to be outside rect.
| ``EndDrawing`(self)` Ends the group of drawing primitives started with `BeginDrawing`, and invokes whatever optimization is available for this DC type on the current platform.
PyObject | ``FindObjects`(self, x, y, radius, bg)` Returns a list of all the id's that draw a pixel with color not equal to bg within radius of (x,y).
PyObject | ``FindObjectsByBBox`(self, x, y)` Returns a list of all the id's whose bounding boxes include (x,y).
| ``FloodFill`(self, x, y, col, style)` Flood fills the device context starting from the given point, using the current brush colour, and using a style:
| ``FloodFillPoint`(self, pt, col, style)` Flood fills the device context starting from the given point, using the current brush colour, and using a style:
Rect | ``GetIdBounds`(self, id)` Returns the bounding rectangle previouly set with SetIdBounds.
bool | ``GetIdGreyedOut`(self, id)` Get whether an object is drawn greyed out or not.
int | ``GetLen`(self)` Returns the number of operations in the recorded list.
| ``RemoveAll`(self)` Removes all objects and operations from the recorded list.
| ``RemoveId`(self, id)` Remove the object node (and all operations) associated with an id.
| ``SetBackground`(self, brush)` Sets the current background brush for the DC.
| ``SetBackgroundMode`(self, mode)` mode may be one of `wx.SOLID` and `wx.TRANSPARENT`.
| ``SetBrush`(self, brush)` Sets the current brush for the DC.
| ``SetFont`(self, font)` Sets the current font for the DC.
| ``SetId`(self, id)` Sets the id to be associated with subsequent operations.
| ``SetIdBounds`(self, id, rect)` Set the bounding rect of a given object.
| ``SetIdGreyedOut`(self, id, greyout)` Set whether an object is drawn greyed out or not.
| ``SetLogicalFunction`(self, function)` Sets the current logical function for the device context.
| ``SetPalette`(self, palette)` If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC.
| ``SetPen`(self, pen)` Sets the current pen for the DC.
| ``SetTextBackground`(self, colour)` Sets the current text background colour for the DC.
| ``SetTextForeground`(self, colour)` Sets the current text foreground colour for the DC.
| ``TranslateId`(self, id, dx, dy)` Translate the operations of id by dx,dy.

Property Summary
| `IdBounds`: See `GetIdBounds` and `SetIdBounds`
| `Len`: See `GetLen`
| `thisown`: The membership flag

Method Details

### __init__(self)
(Constructor)

Constructs a new Pseudo device context for recording dc operations

  Returns:
    PseudoDC
  Overrides:
    `wx.Object.__init__`

### BeginDrawing(self)

Allows for optimization of drawing code on platforms that need it. On other platforms this is just an empty function and is harmless. To take advantage of this postential optimization simply enclose each group of calls to the drawing primitives within calls to `BeginDrawing` and `EndDrawing`.

### Clear(self)

Clears the device context using the current background brush.

### ClearId(self, id)

Removes all operations associated with id so the object can be redrawn.

  Parameters:
    `id`
    (type=int)

### CrossHair(self, x, y)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

### CrossHairPoint(self, pt)

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.

  Parameters:
    `pt`
    (type=Point)

### DrawArc(self, x1, y1, x2, y2, xc, yc)

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.

  Parameters:
    `x1`
    (type=int)

    `y1`
    (type=int)

    `x2`
    (type=int)

    `y2`
    (type=int)

    `xc`
    (type=int)

    `yc`
    (type=int)

### DrawArcPoint(self, pt1, pt2, center)

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.

  Parameters:
    `pt1`
    (type=Point)

    `pt2`
    (type=Point)

    `center`
    (type=Point)

### DrawBitmap(self, bmp, x, y, useMask=False)

Draw a bitmap on the device context at the specified point. If transparent 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).

  Parameters:
    `bmp`
    (type=Bitmap)

    `x`
    (type=int)

    `y`
    (type=int)

    `useMask`
    (type=bool)

  See Also:

  `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`

### DrawBitmapPoint(self, bmp, pt, useMask=False)

Draw a bitmap on the device context at the specified point. If transparent 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).

  Parameters:
    `bmp`
    (type=Bitmap)

    `pt`
    (type=Point)

    `useMask`
    (type=bool)

  See Also:

  `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`

### DrawCheckMark(self, x, y, width, height)

Draws a check mark inside the given rectangle.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `width`
    (type=int)

    `height`
    (type=int)

### DrawCheckMarkRect(self, rect)

Draws a check mark inside the given rectangle.

  Parameters:
    `rect`
    (type=Rect)

### DrawCircle(self, x, y, radius)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `radius`
    (type=int)

  See Also:

  `DrawEllipse`

### DrawCirclePoint(self, pt, radius)

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.

  Parameters:
    `pt`
    (type=Point)

    `radius`
    (type=int)

  See Also:

  `DrawEllipse`

### DrawEllipse(self, x, y, width, height)

Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `width`
    (type=int)

    `height`
    (type=int)

  See Also:

  `DrawCircle`

### DrawEllipsePointSize(self, pt, sz)

Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.

  Parameters:
    `pt`
    (type=Point)

    `sz`
    (type=Size)

  See Also:

  `DrawCircle`

### DrawEllipseRect(self, rect)

Draws an ellipse contained in the specified rectangle. The current pen is used for the outline and the current brush for filling the shape.

  Parameters:
    `rect`
    (type=Rect)

  See Also:

  `DrawCircle`

### DrawEllipticArc(self, x, y, w, h, start, end)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `w`
    (type=int)

    `h`
    (type=int)

    `start`
    (type=double)

    `end`
    (type=double)

### DrawEllipticArcPointSize(self, pt, sz, start, end)

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.

  Parameters:
    `pt`
    (type=Point)

    `sz`
    (type=Size)

    `start`
    (type=double)

    `end`
    (type=double)

### DrawIcon(self, icon, x, y)

Draw an icon on the display (does nothing if the device context is PostScript). This can be the simplest way of drawing bitmaps on a window.

  Parameters:
    `icon`
    (type=Icon)

    `x`
    (type=int)

    `y`
    (type=int)

### DrawIconPoint(self, icon, pt)

Draw an icon on the display (does nothing if the device context is PostScript). This can be the simplest way of drawing bitmaps on a window.

  Parameters:
    `icon`
    (type=Icon)

    `pt`
    (type=Point)

### DrawIdToDC(self, id, dc)

Draw recorded operations of id to dc.

  Parameters:
    `id`
    (type=int)

    `dc`
    (type=DC)

### DrawImageLabel(self, text, image, rect, alignment=wxALIGN_LEFT|wxALIGN_TOP, indexAccel=-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.

  Parameters:
    `text`
    (type=String)

    `image`
    (type=Bitmap)

    `rect`
    (type=Rect)

    `alignment`
    (type=int)

    `indexAccel`
    (type=int)

### DrawLabel(self, text, rect, alignment=wxALIGN_LEFT|wxALIGN_TOP, indexAccel=-1)

Draw text within the specified rectangle, abiding by the alignment flags. Will additionally emphasize the character at indexAccel if it is not -1.

  Parameters:
    `text`
    (type=String)

    `rect`
    (type=Rect)

    `alignment`
    (type=int)

    `indexAccel`
    (type=int)

  See Also:

  `DrawImageLabel`

### DrawLine(self, x1, y1, x2, y2)

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).

  Parameters:
    `x1`
    (type=int)

    `y1`
    (type=int)

    `x2`
    (type=int)

    `y2`
    (type=int)

### DrawLinePoint(self, pt1, pt2)

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).

  Parameters:
    `pt1`
    (type=Point)

    `pt2`
    (type=Point)

### DrawLines(self, points, xoffset=0, yoffset=0)

Draws lines using a sequence of `wx.Point` objects, adding the optional offset coordinate. The current pen is used for drawing the lines.

  Parameters:
    `points`
    (type=List)

    `xoffset`
    (type=int)

    `yoffset`
    (type=int)

### DrawPoint(self, x, y)

Draws a point using the current pen.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

### DrawPointPoint(self, pt)

Draws a point using the current pen.

  Parameters:
    `pt`
    (type=Point)

### DrawPolygon(self, points, xoffset=0, yoffset=0, fillStyle=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.

  Parameters:
    `points`
    (type=List)

    `xoffset`
    (type=int)

    `yoffset`
    (type=int)

    `fillStyle`
    (type=int)

### DrawRectangle(self, x, y, width, height)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `width`
    (type=int)

    `height`
    (type=int)

### DrawRectanglePointSize(self, pt, sz)

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.

  Parameters:
    `pt`
    (type=Point)

    `sz`
    (type=Size)

### DrawRectangleRect(self, rect)

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.

  Parameters:
    `rect`
    (type=Rect)

### DrawRotatedText(self, text, x, y, angle)

Draws the text rotated by angle degrees, if supported by the platform.

NOTE: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font different from `wx.NORMAL_FONT` should be used as the it is not normally a TrueType font. `wx.SWISS_FONT` is an example of a font which is.

  Parameters:
    `text`
    (type=String)

    `x`
    (type=int)

    `y`
    (type=int)

    `angle`
    (type=double)

  See Also:

  `DrawText`

### DrawRotatedTextPoint(self, text, pt, angle)

Draws the text rotated by angle degrees, if supported by the platform.

NOTE: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font different from `wx.NORMAL_FONT` should be used as the it is not normally a TrueType font. `wx.SWISS_FONT` is an example of a font which is.

  Parameters:
    `text`
    (type=String)

    `pt`
    (type=Point)

    `angle`
    (type=double)

  See Also:

  `DrawText`

### DrawRoundedRectangle(self, x, y, width, height, radius)

Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape.

If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `width`
    (type=int)

    `height`
    (type=int)

    `radius`
    (type=double)

### DrawRoundedRectanglePointSize(self, pt, sz, radius)

Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape.

If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.

  Parameters:
    `pt`
    (type=Point)

    `sz`
    (type=Size)

    `radius`
    (type=double)

### DrawRoundedRectangleRect(self, r, radius)

Draws a rectangle with the given top left corner, and with the given size. The corners are quarter-circles using the given radius. The current pen is used for the outline and the current brush for filling the shape.

If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.

  Parameters:
    `r`
    (type=Rect)

    `radius`
    (type=double)

### DrawSpline(self, points)

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'.

  Parameters:
    `points`
    (type=List)

### DrawText(self, text, x, y)

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.

  Parameters:
    `text`
    (type=String)

    `x`
    (type=int)

    `y`
    (type=int)

  See Also:

  `DrawRotatedText`

### DrawTextPoint(self, text, pt)

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.

  Parameters:
    `text`
    (type=String)

    `pt`
    (type=Point)

  See Also:

  `DrawRotatedText`

### DrawToDC(self, dc)

Draws the recorded operations to dc.

  Parameters:
    `dc`
    (type=DC)

### DrawToDCClipped(self, dc, rect)

Draws the recorded operations to dc unless the operation is known to be outside rect.

  Parameters:
    `dc`
    (type=DC)

    `rect`
    (type=Rect)

### DrawToDCClippedRgn(self, dc, region)

Draws the recorded operations to dc unless the operation is known to be outside rect.

  Parameters:
    `dc`
    (type=DC)

    `region`
    (type=Region)

### EndDrawing(self)

Ends the group of drawing primitives started with `BeginDrawing`, and invokes whatever optimization is available for this DC type on the current platform.

### FindObjects(self, x, y, radius=1, bg=*wxWHITE)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `radius`
    (type=int)

    `bg`
    (type=Colour)

  Returns:
    PyObject

### FindObjectsByBBox(self, x, y)

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.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

  Returns:
    PyObject

### FloodFill(self, x, y, col, style=FLOOD_SURFACE)

Flood fills the device context starting from the given point, using the current brush colour, and using a style:

> - wxFLOOD_SURFACE: the flooding occurs until a colour other than the given colour is encountered.
> - wxFLOOD_BORDER: the area to be flooded is bounded by the given colour.

Returns False if the operation failed.

Note: The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return true.

  Parameters:
    `x`
    (type=int)

    `y`
    (type=int)

    `col`
    (type=Colour)

    `style`
    (type=int)

### FloodFillPoint(self, pt, col, style=FLOOD_SURFACE)

Flood fills the device context starting from the given point, using the current brush colour, and using a style:

> - wxFLOOD_SURFACE: the flooding occurs until a colour other than the given colour is encountered.
> - wxFLOOD_BORDER: the area to be flooded is bounded by the given colour.

Returns False if the operation failed.

Note: The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return true.

  Parameters:
    `pt`
    (type=Point)

    `col`
    (type=Colour)

    `style`
    (type=int)

### GetIdBounds(self, id)

Returns the bounding rectangle previouly set with SetIdBounds. If no bounds have been set, it returns wx.Rect(0,0,0,0).

  Parameters:
    `id`
    (type=int)

  Returns:
    Rect

### GetIdGreyedOut(self, id)

Get whether an object is drawn greyed out or not.

  Parameters:
    `id`
    (type=int)

  Returns:
    bool

### GetLen(self)

Returns the number of operations in the recorded list.

  Returns:
    int

### RemoveAll(self)

Removes all objects and operations from the recorded list.

### RemoveId(self, id)

Remove the object node (and all operations) associated with an id.

  Parameters:
    `id`
    (type=int)

### SetBackground(self, brush)

Sets the current background brush for the DC.

  Parameters:
    `brush`
    (type=Brush)

### SetBackgroundMode(self, mode)

mode may be one of `wx.SOLID` and `wx.TRANSPARENT`. This setting determines whether text will be drawn with a background colour or not.

  Parameters:
    `mode`
    (type=int)

### SetBrush(self, 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.

  Parameters:
    `brush`
    (type=Brush)

  See Also:

  `wx.Brush`

### SetFont(self, 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.

  Parameters:
    `font`
    (type=Font)

  See Also:

  `wx.Font`

### SetId(self, id)

Sets the id to be associated with subsequent operations.

  Parameters:
    `id`
    (type=int)

### SetIdBounds(self, id, rect)

Set the bounding rect of a given object. This will create an object node if one doesn't exist.

  Parameters:
    `id`
    (type=int)

    `rect`
    (type=Rect)

### SetIdGreyedOut(self, id, greyout=True)

Set whether an object is drawn greyed out or not.

  Parameters:
    `id`
    (type=int)

    `greyout`
    (type=bool)

### SetLogicalFunction(self, function)

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 as follows:

> wx.AND | src AND dst
> wx.AND_INVERT | (NOT src) AND dst
> wx.AND_REVERSE | src AND (NOT dst)
> wx.CLEAR | 0
> wx.COPY | src
> wx.EQUIV | (NOT src) XOR dst
> wx.INVERT | NOT dst
> wx.NAND | (NOT src) OR (NOT dst)
> wx.NOR | (NOT src) AND (NOT dst)
> wx.NO_OP | dst
> wx.OR | src OR dst
> wx.OR_INVERT | (NOT src) OR dst
> wx.OR_REVERSE | src OR (NOT dst)
> wx.SET | 1
> wx.SRC_INVERT | NOT src
> wx.XOR | src XOR dst

The default is wx.COPY, which simply draws with the current colour. The others combine the current colour and the background using a logical operation. wx.INVERT is commonly used for drawing rubber bands or moving outlines, since drawing twice reverts to the original colour.

  Parameters:
    `function`
    (type=int)

### SetPalette(self, palette)

If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC. If the argument is `wx.NullPalette`, the current palette is selected out of the device context, and the original palette restored.

  Parameters:
    `palette`
    (type=Palette)

  See Also:

  `wx.Palette`

### SetPen(self, 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.

  Parameters:
    `pen`
    (type=Pen)

  See Also:

  `wx.Pen`

### SetTextBackground(self, colour)

Sets the current text background colour for the DC.

  Parameters:
    `colour`
    (type=Colour)

### SetTextForeground(self, colour)

Sets the current text foreground colour for the DC.

  Parameters:
    `colour`
    (type=Colour)

### TranslateId(self, id, dx, dy)

Translate the operations of id by dx,dy.

  Parameters:
    `id`
    (type=int)

    `dx`
    (type=int)

    `dy`
    (type=int)

Property Details

### IdBounds

See `GetIdBounds` and `SetIdBounds`

  Get Method:
    `GetIdBounds`(self, id)
  Set Method:
    `SetIdBounds`(self, id, rect)

### Len

See `GetLen`

  Get Method:
    `GetLen`(self)

### thisown

The membership flag

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:14:08 2007 | http://epydoc.sf.net