]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_brush.i
Patch# 893337, Fix for line control point handling in wxLineShape
[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 class wxBrush : public wxGDIObject {
37 public:
38 DocCtorStr(
39 wxBrush(const wxColour& colour, int style=wxSOLID),
40 "Constructs a brush from a `wx.Colour` object and a style. The style
41 parameter may be one of the following:
42
43 =================== =============================
44 Style Meaning
45 =================== =============================
46 wx.TRANSPARENT Transparent (no fill).
47 wx.SOLID Solid.
48 wx.STIPPLE Uses a bitmap as a stipple.
49 wx.BDIAGONAL_HATCH Backward diagonal hatch.
50 wx.CROSSDIAG_HATCH Cross-diagonal hatch.
51 wx.FDIAGONAL_HATCH Forward diagonal hatch.
52 wx.CROSS_HATCH Cross hatch.
53 wx.HORIZONTAL_HATCH Horizontal hatch.
54 wx.VERTICAL_HATCH Vertical hatch.
55 =================== =============================
56
57 ");
58
59 ~wxBrush();
60
61
62 DocDeclStr(
63 virtual void , SetColour(const wxColour& col),
64 "Set the brush's `wx.Colour`.");
65
66 DocDeclStr(
67 virtual void , SetStyle(int style),
68 "Sets the style of the brush. See `__init__` for a listing of styles.");
69
70 DocDeclStr(
71 virtual void , SetStipple(const wxBitmap& stipple),
72 "Sets the stipple `wx.Bitmap`.");
73
74
75 DocDeclStr(
76 wxColour , GetColour() const,
77 "Returns the `wx.Colour` of the brush.");
78
79 DocDeclStr(
80 int , GetStyle() const,
81 "Returns the style of the brush. See `__init__` for a listing of
82 styles.");
83
84 DocDeclStr(
85 wxBitmap *, GetStipple() const,
86 "Returns the stiple `wx.Bitmap` of the brush. If the brush does not
87 have a wx.STIPPLE style, then the return value may be non-None but an
88 uninitialised bitmap (`wx.Bitmap.Ok` returns False).");
89
90
91 DocDeclStr(
92 bool , Ok(),
93 "Returns True if the brush is initialised and valid.");
94
95
96 #ifdef __WXMAC__
97 short MacGetTheme();
98 void MacSetTheme(short macThemeBrush);
99 #endif
100
101 %pythoncode { def __nonzero__(self): return self.Ok() }
102 };
103
104 //---------------------------------------------------------------------------