Package wx :: Class Brush
[frames | no frames]

Type Brush

object --+        
         |        
    Object --+    
             |    
     GDIObject --+
                 |
                Brush


A brush is a drawing tool for filling in areas. It is used for painting the background of rectangles, ellipses, etc. when drawing on a wx.DC. It has a colour and a style.


Warning:

Do not create instances of wx.Brush before the wx.App object has been created because, depending on the platform, required internal data structures may not have been initialized yet. Instead create your brushes in the app's OnInit or as they are needed for drawing.

Note:

On monochrome displays all brushes are white, unless the colour really is black.

See Also:

wx.BrushList, wx.DC, wx.DC.SetBrush

Method Summary
Brush __init__(self, colour, style)
Constructs a brush from a wx.Colour object and a style.The style parameter may be one of the following:
  __del__(self)
  __nonzero__(self)
Colour GetColour(self)
Returns the wx.Colour of the brush.
Bitmap GetStipple(self)
Returns the stiple wx.Bitmap of the brush.
int GetStyle(self)
Returns the style of the brush.
bool IsHatch(self)
Is the current style a hatch type?
bool IsOk(self)
Returns True if the brush is initialised and valid.
bool Ok(self)
Returns True if the brush is initialised and valid.
  SetColour(self, col)
Set the brush's wx.Colour.
  SetStipple(self, stipple)
Sets the stipple wx.Bitmap.
  SetStyle(self, style)
Sets the style of the brush.

Property Summary
  Colour: See GetColour and SetColour
  Stipple: See GetStipple and SetStipple
  Style: See GetStyle and SetStyle
  thisown: The membership flag

Method Details

__init__(self, colour, style=SOLID)
(Constructor)

Constructs a brush from a wx.Colour object and a style.The style parameter may be one of the following:

Style Meaning
wx.TRANSPARENT Transparent (no fill).
wx.SOLID Solid.
wx.STIPPLE Uses a bitmap as a stipple.
wx.BDIAGONAL_HATCH Backward diagonal hatch.
wx.CROSSDIAG_HATCH Cross-diagonal hatch.
wx.FDIAGONAL_HATCH Forward diagonal hatch.
wx.CROSS_HATCH Cross hatch.
wx.HORIZONTAL_HATCH Horizontal hatch.
wx.VERTICAL_HATCH Vertical hatch.
Parameters:
colour
           (type=Colour)

style
           (type=int)

Returns:
Brush
Overrides:
wx.GDIObject.__init__

See Also:

wx.BrushFromBitmap

GetColour(self)

Returns the wx.Colour of the brush.

Returns:
Colour

GetStipple(self)

Returns the stiple wx.Bitmap of the brush. If the brush does not have a wx.STIPPLE style, then the return value may be non-None but an uninitialised bitmap (wx.Bitmap.Ok returns False).

Returns:
Bitmap

GetStyle(self)

Returns the style of the brush. See __init__ for a listing of styles.

Returns:
int

IsHatch(self)

Is the current style a hatch type?

Returns:
bool

IsOk(self)

Returns True if the brush is initialised and valid.

Returns:
bool

Ok(self)

Returns True if the brush is initialised and valid.

Returns:
bool

SetColour(self, col)

Set the brush's wx.Colour.

Parameters:
col
           (type=Colour)

SetStipple(self, stipple)

Sets the stipple wx.Bitmap.

Parameters:
stipple
           (type=Bitmap)

SetStyle(self, style)

Sets the style of the brush. See __init__ for a listing of styles.

Parameters:
style
           (type=int)


Property Details

Colour

See GetColour and SetColour

Get Method:
GetColour(self)
Set Method:
SetColour(self, col)

Stipple

See GetStipple and SetStipple

Get Method:
GetStipple(self)
Set Method:
SetStipple(self, stipple)

Style

See GetStyle and SetStyle

Get Method:
GetStyle(self)
Set Method:
SetStyle(self, style)

thisown

The membership flag


Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:55:24 2009 http://epydoc.sf.net