]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_brush.i
cleanup - reformatting
[wxWidgets.git] / wxPython / src / _brush.i
CommitLineData
d14a1e28
RD
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
1e0c8722 19DocStr(wxBrush,
dce2bd22
RD
20"A brush is a drawing tool for filling in areas. It is used for
21painting the background of rectangles, ellipses, etc. when drawing on
d07d2bc9 22a `wx.DC`. It has a colour and a style.", "
dce2bd22
RD
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");
1e0c8722 35
ab1f7d2a
RD
36MustHaveApp(wxBrush);
37
d14a1e28
RD
38class wxBrush : public wxGDIObject {
39public:
dce2bd22
RD
40 DocCtorStr(
41 wxBrush(const wxColour& colour, int style=wxSOLID),
d07d2bc9
RD
42 "Constructs a brush from a `wx.Colour` object and a style.",
43 "The style parameter may be one of the following:
dce2bd22
RD
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
8224a808 59:see: `wx.BrushFromBitmap`
dce2bd22
RD
60");
61
8224a808
RD
62 DocCtorStrName(
63 wxBrush(const wxBitmap& stippleBitmap),
64 "Constructs a stippled brush using a bitmap.", "",
65 BrushFromBitmap);
66
d14a1e28 67 ~wxBrush();
d14a1e28 68
d14a1e28 69
dce2bd22
RD
70 DocDeclStr(
71 virtual void , SetColour(const wxColour& col),
d07d2bc9 72 "Set the brush's `wx.Colour`.", "");
dce2bd22
RD
73
74 DocDeclStr(
75 virtual void , SetStyle(int style),
d07d2bc9 76 "Sets the style of the brush. See `__init__` for a listing of styles.", "");
dce2bd22
RD
77
78 DocDeclStr(
79 virtual void , SetStipple(const wxBitmap& stipple),
d07d2bc9 80 "Sets the stipple `wx.Bitmap`.", "");
dce2bd22
RD
81
82
83 DocDeclStr(
84 wxColour , GetColour() const,
d07d2bc9 85 "Returns the `wx.Colour` of the brush.", "");
dce2bd22
RD
86
87 DocDeclStr(
88 int , GetStyle() const,
89 "Returns the style of the brush. See `__init__` for a listing of
d07d2bc9 90styles.", "");
dce2bd22
RD
91
92 DocDeclStr(
93 wxBitmap *, GetStipple() const,
94 "Returns the stiple `wx.Bitmap` of the brush. If the brush does not
95have a wx.STIPPLE style, then the return value may be non-None but an
d07d2bc9 96uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
dce2bd22 97
020303e6
RD
98
99 DocDeclStr(
100 bool , IsHatch() const,
101 "Is the current style a hatch type?", "");
102
dce2bd22
RD
103
104 DocDeclStr(
105 bool , Ok(),
d07d2bc9 106 "Returns True if the brush is initialised and valid.", "");
dce2bd22 107
d14a1e28
RD
108
109#ifdef __WXMAC__
7efa87d2
RD
110 short MacGetTheme();
111 void MacSetTheme(short macThemeBrush);
d14a1e28
RD
112#endif
113
114 %pythoncode { def __nonzero__(self): return self.Ok() }
115};
116
117//---------------------------------------------------------------------------