]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_brush.i
wxRect::union and docstring fixes
[wxWidgets.git] / wxPython / src / _brush.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _brush.i
3 // Purpose: SWIG interface for wxPen
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 7-July-1997
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup
18
19 DocStr(wxBrush,
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.", "
23
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.
29
30 :note: On monochrome displays all brushes are white, unless the colour
31 really is black.
32
33 :see: `wx.BrushList`, `wx.DC`, `wx.DC.SetBrush`
34 ");
35
36 MustHaveApp(wxBrush);
37
38 class wxBrush : public wxGDIObject {
39 public:
40 DocCtorStr(
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:
44
45 =================== =============================
46 Style Meaning
47 =================== =============================
48 wx.TRANSPARENT Transparent (no fill).
49 wx.SOLID Solid.
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 =================== =============================
58
59 ");
60
61 ~wxBrush();
62
63
64 DocDeclStr(
65 virtual void , SetColour(const wxColour& col),
66 "Set the brush's `wx.Colour`.", "");
67
68 DocDeclStr(
69 virtual void , SetStyle(int style),
70 "Sets the style of the brush. See `__init__` for a listing of styles.", "");
71
72 DocDeclStr(
73 virtual void , SetStipple(const wxBitmap& stipple),
74 "Sets the stipple `wx.Bitmap`.", "");
75
76
77 DocDeclStr(
78 wxColour , GetColour() const,
79 "Returns the `wx.Colour` of the brush.", "");
80
81 DocDeclStr(
82 int , GetStyle() const,
83 "Returns the style of the brush. See `__init__` for a listing of
84 styles.", "");
85
86 DocDeclStr(
87 wxBitmap *, GetStipple() const,
88 "Returns the stiple `wx.Bitmap` of the brush. If the brush does not
89 have a wx.STIPPLE style, then the return value may be non-None but an
90 uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
91
92
93 DocDeclStr(
94 bool , IsHatch() const,
95 "Is the current style a hatch type?", "");
96
97
98 DocDeclStr(
99 bool , Ok(),
100 "Returns True if the brush is initialised and valid.", "");
101
102
103 #ifdef __WXMAC__
104 short MacGetTheme();
105 void MacSetTheme(short macThemeBrush);
106 #endif
107
108 %pythoncode { def __nonzero__(self): return self.Ok() }
109 };
110
111 //---------------------------------------------------------------------------