1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxPen
7 // Created: 7-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 "A brush is a drawing tool for filling in areas. It is used for
21 painting the background of rectangles, ellipses, etc. when drawing on
22 a `wx.DC`. It has a colour and a style.", "
24 :warning: Do not create instances of wx.Brush before the `wx.App`
25 object has been created because, depending on the platform,
26 required internal data structures may not have been initialized
27 yet. Instead create your brushes in the app's OnInit or as they
28 are needed for drawing.
30 :note: On monochrome displays all brushes are white, unless the colour
33 :see: `wx.BrushList`, `wx.DC`, `wx.DC.SetBrush`
38 class wxBrush : public wxGDIObject {
41 wxBrush(const wxColour& colour, int style=wxSOLID),
42 "Constructs a brush from a `wx.Colour` object and a style.",
43 "The style parameter may be one of the following:
45 =================== =============================
47 =================== =============================
48 wx.TRANSPARENT Transparent (no fill).
50 wx.STIPPLE Uses a bitmap as a stipple.
51 wx.BDIAGONAL_HATCH Backward diagonal hatch.
52 wx.CROSSDIAG_HATCH Cross-diagonal hatch.
53 wx.FDIAGONAL_HATCH Forward diagonal hatch.
54 wx.CROSS_HATCH Cross hatch.
55 wx.HORIZONTAL_HATCH Horizontal hatch.
56 wx.VERTICAL_HATCH Vertical hatch.
57 =================== =============================
59 :see: `wx.BrushFromBitmap`
63 wxBrush(const wxBitmap& stippleBitmap),
64 "Constructs a stippled brush using a bitmap.", "",
71 virtual void , SetColour(const wxColour& col),
72 "Set the brush's `wx.Colour`.", "");
75 virtual void , SetStyle(int style),
76 "Sets the style of the brush. See `__init__` for a listing of styles.", "");
79 virtual void , SetStipple(const wxBitmap& stipple),
80 "Sets the stipple `wx.Bitmap`.", "");
84 wxColour , GetColour() const,
85 "Returns the `wx.Colour` of the brush.", "");
88 int , GetStyle() const,
89 "Returns the style of the brush. See `__init__` for a listing of
93 wxBitmap *, GetStipple() const,
94 "Returns the stiple `wx.Bitmap` of the brush. If the brush does not
95 have a wx.STIPPLE style, then the return value may be non-None but an
96 uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
100 bool , IsHatch() const,
101 "Is the current style a hatch type?", "");
106 "Returns True if the brush is initialised and valid.", "");
111 void MacSetTheme(short macThemeBrush);
114 %pythoncode { def __nonzero__(self): return self.Ok() }
116 %property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
117 %property(Stipple, GetStipple, SetStipple, doc="See `GetStipple` and `SetStipple`");
118 %property(Style, GetStyle, SetStyle, doc="See `GetStyle` and `SetStyle`");
122 //---------------------------------------------------------------------------