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)
  __repr__(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 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.
    Inherited from GDIObject
bool GetVisible(self)
bool IsNull(self)
  SetVisible(self, visible)
    Inherited from Object
  Destroy(self)
Deletes the C++ object this Python object is a proxy for.
String GetClassName(self)
Returns the class name of the C++ class using wxRTTI.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

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

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)


Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:50:36 2007 http://epydoc.sf.net