A brush is a drawing tool for filling in areas. It is used for painting the background of rectangles, ellipses, etc within a DeviceContext. It has a colour and a style.
The following predefined brushes are available everywhere once the application has started.
Wx::NULL_BRUSH
Wx::BLUE_BRUSH
Wx::GREEN_BRUSH
Wx::WHITE_BRUSH
Wx::BLACK_BRUSH
Wx::GREY_BRUSH
Wx::MEDIUM_GREY_BRUSH
Wx::LIGHT_GREY_BRUSH
Wx::TRANSPARENT_BRUSH
Wx::CYAN_BRUSH
Wx::RED_BRUSH
On a monochrome display, Widgets shows all brushes as white unless the colour is really black.
Do not initialize brushes before the program commences, since other required structures may not have been set up yet. Instead, reference them using methods which create them if necessary.
Default constructor. The brush will be uninitialised, and “is_ok” will return false.
Brush.new(Colour colour, Integer style = Wx::SOLID)
Constructs a brush from a colour object and a fill style.
Brush.new(String colour_name, Integer style)
Constructs a brush from a colour name and a fill style.
Brush.new(Bitmap stipple_bitmap)
Constructs a stippled brush using a bitmap. The brush style will
automatically be set to Wx::STIPPLE
The style for a brush may be one of the following constants:
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.Colour get_colour()
Returns this brush’s colour.
Bitmap get_stipple()
Returns the stipple bitmap used by this brush
Integer get_style()
Returns the integer fill-style constant for this brush.
Boolean is_hatch()
Returns true if this brush has any of the hatched fill styles.
Boolean is_ok()
Returns true if this brush is properly initialized and ready for use.
set_colour(Colour colour)
set_colour(String colour_name)
set_colour(Integer red, Integer green, Integer blue)
Sets the fill colour used by this brush, by using a Colour object, a colour name, or a set of red/green/blue components.
set_bitmap(Bitmap stipple_bitmap)
Sets the stipple bitmap to be used by this brush.
set_style(Integer style)
Sets the fill style to be used by this brush. See Brush.new for a list of the available styles.
[This page automatically generated from the Textile source at Thu Aug 28 20:29:05 +0100 2008]