1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13enum wxBrushStyle 14{ 15 wxBRUSHSTYLE_INVALID, 16 wxBRUSHSTYLE_SOLID, 17 wxBRUSHSTYLE_TRANSPARENT, 18 wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE, 19 wxBRUSHSTYLE_STIPPLE_MASK, 20 wxBRUSHSTYLE_STIPPLE, 21 wxBRUSHSTYLE_BDIAGONAL_HATCH, 22 wxBRUSHSTYLE_CROSSDIAG_HATCH, 23 wxBRUSHSTYLE_FDIAGONAL_HATCH, 24 wxBRUSHSTYLE_CROSS_HATCH, 25 wxBRUSHSTYLE_HORIZONTAL_HATCH, 26 wxBRUSHSTYLE_VERTICAL_HATCH, 27 wxBRUSHSTYLE_FIRST_HATCH, 28 wxBRUSHSTYLE_LAST_HATCH 29}; 30 31class wxBrush : wxGDIObject 32{ 33 %Docstring 34 Brush() 35 Brush(colour, style=BRUSHSTYLE_SOLID) 36 Brush(stippleBitmap) 37 Brush(brush) 38 39 A brush is a drawing tool for filling in areas. 40 %End 41 %TypeHeaderCode 42 #include <wx/brush.h> 43 %End 44 45 %TypeCode 46 #ifdef __WXMAC__ 47 #include <wx/osx/private.h> 48 #endif 49 %End 50public: 51 wxBrush(); 52 53 wxBrush( 54 const wxColour & colour, 55 wxBrushStyle style = wxBRUSHSTYLE_SOLID 56 ); 57 %PreMethodCode 58 if (!wxPyCheckForApp()) return NULL; 59 %End 60 61 wxBrush( 62 const wxBitmap & stippleBitmap 63 ); 64 %PreMethodCode 65 if (!wxPyCheckForApp()) return NULL; 66 %End 67 68 wxBrush( 69 const wxBrush & brush 70 ); 71 %PreMethodCode 72 if (!wxPyCheckForApp()) return NULL; 73 %End 74 75 ~wxBrush(); 76 77 void SetColour( 78 const wxColour & colour 79 ); 80 %Docstring 81 SetColour(colour) 82 SetColour(red, green, blue) 83 84 Sets the brush colour using red, green and blue values. 85 %End 86 87 void SetColour( 88 unsigned char red, 89 unsigned char green, 90 unsigned char blue 91 ); 92 93 wxColour GetColour() const; 94 %Docstring 95 GetColour() -> Colour 96 97 Returns a reference to the brush colour. 98 %End 99 100 wxBitmap * GetStipple() const; 101 %Docstring 102 GetStipple() -> Bitmap 103 104 Gets a pointer to the stipple bitmap. 105 %End 106 107 wxBrushStyle GetStyle() const; 108 %Docstring 109 GetStyle() -> BrushStyle 110 111 Returns the brush style, one of the wxBrushStyle values. 112 %End 113 114 bool IsHatch() const; 115 %Docstring 116 IsHatch() -> bool 117 118 Returns true if the style of the brush is any of hatched fills. 119 %End 120 121 bool IsOk() const; 122 %Docstring 123 IsOk() -> bool 124 125 Returns true if the brush is initialised. 126 %End 127 128 bool IsNonTransparent() const; 129 %Docstring 130 IsNonTransparent() -> bool 131 132 Returns true if the brush is a valid non-transparent brush. 133 %End 134 135 bool IsTransparent() const; 136 %Docstring 137 IsTransparent() -> bool 138 139 Returns true if the brush is transparent. 140 %End 141 142 void SetStipple( 143 const wxBitmap & bitmap 144 ); 145 %Docstring 146 SetStipple(bitmap) 147 148 Sets the stipple bitmap. 149 %End 150 151 void SetStyle( 152 wxBrushStyle style 153 ); 154 %Docstring 155 SetStyle(style) 156 157 Sets the brush style. 158 %End 159 160 bool operator!=( 161 const wxBrush & brush 162 ) const; 163 164 bool operator==( 165 const wxBrush & brush 166 ) const; 167 168 int __nonzero__(); 169 %Docstring 170 __nonzero__() -> int 171 %End 172 %MethodCode 173 PyErr_Clear(); 174 Py_BEGIN_ALLOW_THREADS 175 sipRes = _wxBrush___nonzero__(sipCpp); 176 Py_END_ALLOW_THREADS 177 if (PyErr_Occurred()) sipIsErr = 1; 178 %End 179 %TypeCode 180 int _wxBrush___nonzero__(wxBrush* self) 181 { 182 return self->IsOk(); 183 } 184 %End 185 186 int __bool__(); 187 %Docstring 188 __bool__() -> int 189 %End 190 %MethodCode 191 PyErr_Clear(); 192 Py_BEGIN_ALLOW_THREADS 193 sipRes = _wxBrush___bool__(sipCpp); 194 Py_END_ALLOW_THREADS 195 if (PyErr_Occurred()) sipIsErr = 1; 196 %End 197 %TypeCode 198 int _wxBrush___bool__(wxBrush* self) 199 { 200 return self->IsOk(); 201 } 202 %End 203 204 void MacSetTheme(int macThemeBrushID); 205 %Docstring 206 MacSetTheme(macThemeBrushID) 207 %End 208 %MethodCode 209 PyErr_Clear(); 210 Py_BEGIN_ALLOW_THREADS 211 _wxBrush_MacSetTheme(sipCpp, macThemeBrushID); 212 Py_END_ALLOW_THREADS 213 if (PyErr_Occurred()) sipIsErr = 1; 214 %End 215 %TypeCode 216 void _wxBrush_MacSetTheme(wxBrush* self, int macThemeBrushID) 217 { 218 #ifdef __WXMAC__ 219 self->SetColour(wxColour(wxMacCreateCGColorFromHITheme(macThemeBrushID))); 220 #else 221 wxPyRaiseNotImplemented(); 222 #endif 223 } 224 %End 225 226 public: 227 228 229 %Property(name=Colour, get=GetColour, set=SetColour) 230 %Property(name=Stipple, get=GetStipple, set=SetStipple) 231 %Property(name=Style, get=GetStyle, set=SetStyle) 232 void _copyFrom(const wxBrush* other); 233 %Docstring 234 _copyFrom(other) 235 236 For internal use only. 237 %End 238 %MethodCode 239 PyErr_Clear(); 240 Py_BEGIN_ALLOW_THREADS 241 _wxBrush__copyFrom(sipCpp, other); 242 Py_END_ALLOW_THREADS 243 if (PyErr_Occurred()) sipIsErr = 1; 244 %End 245 %TypeCode 246 void _wxBrush__copyFrom(wxBrush* self, const wxBrush* other) 247 { 248 *self = *other; 249 } 250 %End 251 252}; // end of class wxBrush 253 254 255class wxBrushList 256{ 257 %Docstring 258 A brush list is a list containing all brushes which have been created. 259 %End 260 %TypeHeaderCode 261 #include <wx/brush.h> 262 %End 263 264public: 265 wxBrush * FindOrCreateBrush( 266 const wxColour & colour, 267 wxBrushStyle style = wxBRUSHSTYLE_SOLID 268 ); 269 %Docstring 270 FindOrCreateBrush(colour, style=BRUSHSTYLE_SOLID) -> Brush 271 272 Finds a brush with the specified attributes and returns it, else 273 creates a new brush, adds it to the brush list, and returns it. 274 %End 275 276}; // end of class wxBrushList 277 278 279wxBrush wxNullBrush; 280 281%Extract(id=pycode_core) 282# These stock brushes will be initialized when the wx.App object is created. 283BLUE_BRUSH = Brush() 284GREEN_BRUSH = Brush() 285YELLOW_BRUSH = Brush() 286WHITE_BRUSH = Brush() 287BLACK_BRUSH = Brush() 288GREY_BRUSH = Brush() 289MEDIUM_GREY_BRUSH = Brush() 290LIGHT_GREY_BRUSH = Brush() 291TRANSPARENT_BRUSH = Brush() 292CYAN_BRUSH = Brush() 293RED_BRUSH = Brush() 294 295%End 296 297%Extract(id=pycode_core) 298wx.STIPPLE_MASK_OPAQUE = int(wx.BRUSHSTYLE_STIPPLE_MASK_OPAQUE) 299wx.STIPPLE_MASK = int(wx.BRUSHSTYLE_STIPPLE_MASK) 300wx.STIPPLE = int(wx.BRUSHSTYLE_STIPPLE) 301wx.BDIAGONAL_HATCH = int(wx.BRUSHSTYLE_BDIAGONAL_HATCH) 302wx.CROSSDIAG_HATCH = int(wx.BRUSHSTYLE_CROSSDIAG_HATCH) 303wx.FDIAGONAL_HATCH = int(wx.BRUSHSTYLE_FDIAGONAL_HATCH) 304wx.CROSS_HATCH = int(wx.BRUSHSTYLE_CROSS_HATCH) 305wx.HORIZONTAL_HATCH = int(wx.BRUSHSTYLE_HORIZONTAL_HATCH) 306wx.VERTICAL_HATCH = int(wx.BRUSHSTYLE_VERTICAL_HATCH) 307 308%End 309 310 311//--------------------------------------------------------------------------- 312 313