1wxBrush(3) Erlang Module Definition wxBrush(3)
2
3
4
6 wxBrush - Functions for wxBrush class
7
9 A brush is a drawing tool for filling in areas. It is used for painting
10 the background of rectangles, ellipses, etc. It has a colour and a
11 style.
12
13 On a monochrome display, wxWidgets shows all brushes as white unless
14 the colour is really black.
15
16 Do not initialize objects on the stack before the program commences,
17 since other required structures may not have been set up yet. Instead,
18 define global pointers to objects and create them in wxApp::OnInit (not
19 implemented in wx) or when required.
20
21 An application may wish to create brushes with different characteris‐
22 tics dynamically, and there is the consequent danger that a large num‐
23 ber of duplicate brushes will be created. Therefore an application may
24 wish to get a pointer to a brush by using the global list of brushes
25 ?wxTheBrushList, and calling the member function wxBrushList::FindOr‐
26 CreateBrush() (not implemented in wx).
27
28 This class uses reference counting and copy-on-write internally so that
29 assignments between two instances of this class are very cheap. You can
30 therefore use actual objects instead of pointers without efficiency
31 problems. If an instance of this class is changed it will create its
32 own data internally so that other instances, which previously shared
33 the data using the reference counting, are not affected.
34
35 Predefined objects (include wx.hrl):
36
37 See: wxBrushList (not implemented in wx), wxDC, wxDC:setBrush/2
38
39 wxWidgets docs: wxBrush
40
42 wxBrush() = wx:wx_object()
43
45 new() -> wxBrush()
46
47 Default constructor.
48
49 The brush will be uninitialised, and wxBrush:isOk/1 will return
50 false.
51
52 new(Colour) -> wxBrush()
53
54 new(Brush) -> wxBrush()
55
56 Types:
57
58 Brush = wxBrush:wxBrush() | wxBitmap:wxBitmap()
59
60 Copy constructor, uses reference counting.
61
62 new(Colour, Options :: [Option]) -> wxBrush()
63
64 Types:
65
66 Colour = wx:wx_colour()
67 Option = {style, wx:wx_enum()}
68
69 Constructs a brush from a colour object and style.
70
71 destroy(This :: wxBrush()) -> ok
72
73 Destructor.
74
75 See overview_refcount_destruct for more info.
76
77 Remark: Although all remaining brushes are deleted when the ap‐
78 plication exits, the application should try to clean up all
79 brushes itself. This is because wxWidgets cannot know if a
80 pointer to the brush object is stored in an application data
81 structure, and there is a risk of double deletion.
82
83 getColour(This) -> wx:wx_colour4()
84
85 Types:
86
87 This = wxBrush()
88
89 Returns a reference to the brush colour.
90
91 See: setColour/4
92
93 getStipple(This) -> wxBitmap:wxBitmap()
94
95 Types:
96
97 This = wxBrush()
98
99 Gets a pointer to the stipple bitmap.
100
101 If the brush does not have a wxBRUSHSTYLE_STIPPLE style, this
102 bitmap may be non-NULL but uninitialised (i.e. wxBitmap:isOk/1
103 returns false).
104
105 See: setStipple/2
106
107 getStyle(This) -> wx:wx_enum()
108
109 Types:
110
111 This = wxBrush()
112
113 Returns the brush style, one of the ?wxBrushStyle values.
114
115 See: setStyle/2, setColour/4, setStipple/2
116
117 isHatch(This) -> boolean()
118
119 Types:
120
121 This = wxBrush()
122
123 Returns true if the style of the brush is any of hatched fills.
124
125 See: getStyle/1
126
127 isOk(This) -> boolean()
128
129 Types:
130
131 This = wxBrush()
132
133 Returns true if the brush is initialised.
134
135 Notice that an uninitialized brush object can't be queried for
136 any brush properties and all calls to the accessor methods on it
137 will result in an assert failure.
138
139 setColour(This, Colour) -> ok
140
141 Types:
142
143 This = wxBrush()
144 Colour = wx:wx_colour()
145
146 Sets the brush colour using red, green and blue values.
147
148 See: getColour/1
149
150 setColour(This, Red, Green, Blue) -> ok
151
152 Types:
153
154 This = wxBrush()
155 Red = Green = Blue = integer()
156
157 setStipple(This, Bitmap) -> ok
158
159 Types:
160
161 This = wxBrush()
162 Bitmap = wxBitmap:wxBitmap()
163
164 Sets the stipple bitmap.
165
166 Remark: The style will be set to wxBRUSHSTYLE_STIPPLE, unless
167 the bitmap has a mask associated to it, in which case the style
168 will be set to wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE.
169
170 See: wxBitmap
171
172 setStyle(This, Style) -> ok
173
174 Types:
175
176 This = wxBrush()
177 Style = wx:wx_enum()
178
179 Sets the brush style.
180
181 See: getStyle/1
182
183
184
185wxWidgets team. wx 2.1.4 wxBrush(3)