]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_gdi.py
reSWIGged
[wxWidgets.git] / wxPython / src / mac / _gdi.py
CommitLineData
1bd55598 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4import _gdi_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
36ed4f51
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54import _core
55wx = _core
d55e5bfc
RD
56#---------------------------------------------------------------------------
57
58class GDIObject(_core.Object):
36ed4f51 59 """Proxy of C++ GDIObject class"""
1bd55598
RD
60 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
61 __repr__ = _swig_repr
62 def __init__(self, *args, **kwargs):
d55e5bfc 63 """__init__(self) -> GDIObject"""
1bd55598
RD
64 _gdi_.GDIObject_swiginit(self,_gdi_.new_GDIObject(*args, **kwargs))
65 __swig_destroy__ = _gdi_.delete_GDIObject
66 __del__ = lambda self : None;
d55e5bfc
RD
67 def IsNull(*args, **kwargs):
68 """IsNull(self) -> bool"""
69 return _gdi_.GDIObject_IsNull(*args, **kwargs)
70
2131d850 71_gdi_.GDIObject_swigregister(GDIObject)
d55e5bfc
RD
72
73#---------------------------------------------------------------------------
74
2131d850
RD
75C2S_NAME = _gdi_.C2S_NAME
76C2S_CSS_SYNTAX = _gdi_.C2S_CSS_SYNTAX
77C2S_HTML_SYNTAX = _gdi_.C2S_HTML_SYNTAX
fc46b7f3
RD
78ALPHA_TRANSPARENT = _gdi_.ALPHA_TRANSPARENT
79ALPHA_OPAQUE = _gdi_.ALPHA_OPAQUE
d55e5bfc
RD
80class Colour(_core.Object):
81 """
15817c7e
RD
82 A colour is an object representing a combination of Red, Green, and
83 Blue (RGB) intensity values, and is used to determine drawing colours,
84 window colours, etc. Valid RGB values are in the range 0 to 255.
d55e5bfc 85
15817c7e 86 In wxPython there are typemaps that will automatically convert from a
32fe5131
RD
87 colour name, from a '#RRGGBB' colour hex value string, or from a 3
88 integer tuple to a wx.Colour object when calling C++ methods that
89 expect a wxColour. This means that the following are all
90 equivallent::
d55e5bfc
RD
91
92 win.SetBackgroundColour(wxColour(0,0,255))
93 win.SetBackgroundColour('BLUE')
94 win.SetBackgroundColour('#0000FF')
32fe5131 95 win.SetBackgroundColour((0,0,255))
d55e5bfc 96
15817c7e
RD
97 Additional colour names and their coresponding values can be added
98 using `wx.ColourDatabase`. Various system colours (as set in the
99 user's system preferences) can be retrieved with
100 `wx.SystemSettings.GetColour`.
101
d55e5bfc 102 """
1bd55598
RD
103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
104 __repr__ = _swig_repr
105 def __init__(self, *args, **kwargs):
d55e5bfc 106 """
fc46b7f3 107 __init__(self, byte red=0, byte green=0, byte blue=0, byte alpha=ALPHA_OPAQUE) -> Colour
d55e5bfc
RD
108
109 Constructs a colour from red, green and blue values.
15817c7e
RD
110
111 :see: Alternate constructors `wx.NamedColour` and `wx.ColourRGB`.
112
d55e5bfc 113 """
1bd55598
RD
114 _gdi_.Colour_swiginit(self,_gdi_.new_Colour(*args, **kwargs))
115 __swig_destroy__ = _gdi_.delete_Colour
116 __del__ = lambda self : None;
d55e5bfc
RD
117 def Red(*args, **kwargs):
118 """
15817c7e 119 Red(self) -> byte
d55e5bfc
RD
120
121 Returns the red intensity.
122 """
123 return _gdi_.Colour_Red(*args, **kwargs)
124
125 def Green(*args, **kwargs):
126 """
15817c7e 127 Green(self) -> byte
d55e5bfc
RD
128
129 Returns the green intensity.
130 """
131 return _gdi_.Colour_Green(*args, **kwargs)
132
133 def Blue(*args, **kwargs):
134 """
15817c7e 135 Blue(self) -> byte
d55e5bfc
RD
136
137 Returns the blue intensity.
138 """
139 return _gdi_.Colour_Blue(*args, **kwargs)
140
fc46b7f3
RD
141 def Alpha(*args, **kwargs):
142 """
143 Alpha(self) -> byte
144
145 Returns the Alpha value.
146 """
147 return _gdi_.Colour_Alpha(*args, **kwargs)
148
b39fe951 149 def IsOk(*args, **kwargs):
d55e5bfc 150 """
b39fe951 151 IsOk(self) -> bool
d55e5bfc
RD
152
153 Returns True if the colour object is valid (the colour has been
154 initialised with RGB values).
155 """
b39fe951 156 return _gdi_.Colour_IsOk(*args, **kwargs)
d55e5bfc 157
b39fe951 158 Ok = IsOk
d55e5bfc
RD
159 def Set(*args, **kwargs):
160 """
fc46b7f3 161 Set(self, byte red, byte green, byte blue, byte alpha=ALPHA_OPAQUE)
d55e5bfc
RD
162
163 Sets the RGB intensity values.
164 """
165 return _gdi_.Colour_Set(*args, **kwargs)
166
167 def SetRGB(*args, **kwargs):
168 """
169 SetRGB(self, unsigned long colRGB)
170
171 Sets the RGB intensity values from a packed RGB value.
172 """
173 return _gdi_.Colour_SetRGB(*args, **kwargs)
174
175 def SetFromName(*args, **kwargs):
176 """
177 SetFromName(self, String colourName)
178
15817c7e
RD
179 Sets the RGB intensity values using a colour name listed in
180 ``wx.TheColourDatabase``.
d55e5bfc
RD
181 """
182 return _gdi_.Colour_SetFromName(*args, **kwargs)
183
2131d850
RD
184 def GetAsString(*args, **kwargs):
185 """
186 GetAsString(self, long flags=wxC2S_NAME|wxC2S_CSS_SYNTAX) -> String
187
188 Return the colour as a string. Acceptable flags are:
189
190 =================== ==================================
191 wx.C2S_NAME return colour name, when possible
192 wx.C2S_CSS_SYNTAX return colour in rgb(r,g,b) syntax
193 wx.C2S_HTML_SYNTAX return colour in #rrggbb syntax
194 =================== ==================================
195 """
196 return _gdi_.Colour_GetAsString(*args, **kwargs)
197
d55e5bfc
RD
198 def GetPixel(*args, **kwargs):
199 """
200 GetPixel(self) -> long
201
202 Returns a pixel value which is platform-dependent. On Windows, a
15817c7e
RD
203 COLORREF is returned. On X, an allocated pixel value is returned. -1
204 is returned if the pixel is invalid (on X, unallocated).
d55e5bfc
RD
205 """
206 return _gdi_.Colour_GetPixel(*args, **kwargs)
207
208 def __eq__(*args, **kwargs):
209 """
e9d6f3a4 210 __eq__(self, PyObject other) -> bool
d55e5bfc 211
e9d6f3a4 212 Compare colours for equality.
d55e5bfc
RD
213 """
214 return _gdi_.Colour___eq__(*args, **kwargs)
215
216 def __ne__(*args, **kwargs):
217 """
e9d6f3a4 218 __ne__(self, PyObject other) -> bool
d55e5bfc 219
e9d6f3a4 220 Compare colours for inequality.
d55e5bfc
RD
221 """
222 return _gdi_.Colour___ne__(*args, **kwargs)
223
224 def Get(*args, **kwargs):
225 """
226 Get() -> (r, g, b)
227
228 Returns the RGB intensity values as a tuple.
229 """
230 return _gdi_.Colour_Get(*args, **kwargs)
231
232 def GetRGB(*args, **kwargs):
233 """
234 GetRGB(self) -> unsigned long
235
236 Return the colour as a packed RGB value
237 """
238 return _gdi_.Colour_GetRGB(*args, **kwargs)
239
15817c7e 240 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
fc46b7f3
RD
241 def __str__(self): return str(self.Get(True))
242 def __repr__(self): return 'wx.Colour' + str(self.Get(True))
b39fe951
RD
243 def __len__(self): return len(self.Get())
244 def __getitem__(self, index): return self.Get()[index]
245 def __nonzero__(self): return self.IsOk()
d55e5bfc 246 __safe_for_unpickling__ = True
fc46b7f3 247 def __reduce__(self): return (Colour, self.Get(True))
d55e5bfc 248
2bf58437
RD
249 Pixel = property(GetPixel,doc="See `GetPixel`")
250 RGB = property(GetRGB,SetRGB,doc="See `GetRGB` and `SetRGB`")
2131d850 251_gdi_.Colour_swigregister(Colour)
d55e5bfc
RD
252
253def NamedColour(*args, **kwargs):
254 """
255 NamedColour(String colorName) -> Colour
256
15817c7e
RD
257 Constructs a colour object using a colour name listed in
258 ``wx.TheColourDatabase``.
d55e5bfc
RD
259 """
260 val = _gdi_.new_NamedColour(*args, **kwargs)
d55e5bfc
RD
261 return val
262
263def ColourRGB(*args, **kwargs):
264 """
265 ColourRGB(unsigned long colRGB) -> Colour
266
267 Constructs a colour from a packed RGB value.
268 """
269 val = _gdi_.new_ColourRGB(*args, **kwargs)
d55e5bfc
RD
270 return val
271
272Color = Colour
273NamedColor = NamedColour
274ColorRGB = ColourRGB
275
276class Palette(GDIObject):
36ed4f51 277 """Proxy of C++ Palette class"""
1bd55598
RD
278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
279 __repr__ = _swig_repr
280 def __init__(self, *args, **kwargs):
d55e5bfc 281 """__init__(self, int n, unsigned char red, unsigned char green, unsigned char blue) -> Palette"""
1bd55598
RD
282 _gdi_.Palette_swiginit(self,_gdi_.new_Palette(*args, **kwargs))
283 __swig_destroy__ = _gdi_.delete_Palette
284 __del__ = lambda self : None;
d55e5bfc
RD
285 def GetPixel(*args, **kwargs):
286 """GetPixel(self, byte red, byte green, byte blue) -> int"""
287 return _gdi_.Palette_GetPixel(*args, **kwargs)
288
289 def GetRGB(*args, **kwargs):
070c48b4 290 """GetRGB(self, int pixel) -> (R,G,B)"""
d55e5bfc
RD
291 return _gdi_.Palette_GetRGB(*args, **kwargs)
292
5cbf236d
RD
293 def GetColoursCount(*args, **kwargs):
294 """GetColoursCount(self) -> int"""
295 return _gdi_.Palette_GetColoursCount(*args, **kwargs)
296
b39fe951
RD
297 def IsOk(*args, **kwargs):
298 """IsOk(self) -> bool"""
299 return _gdi_.Palette_IsOk(*args, **kwargs)
d55e5bfc 300
b39fe951
RD
301 Ok = IsOk
302 def __nonzero__(self): return self.IsOk()
33d6fd3b 303 ColoursCount = property(GetColoursCount,doc="See `GetColoursCount`")
2131d850 304_gdi_.Palette_swigregister(Palette)
d55e5bfc
RD
305
306#---------------------------------------------------------------------------
307
308class Pen(GDIObject):
36ed4f51 309 """Proxy of C++ Pen class"""
1bd55598
RD
310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
311 __repr__ = _swig_repr
312 def __init__(self, *args, **kwargs):
d55e5bfc 313 """__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen"""
1bd55598
RD
314 _gdi_.Pen_swiginit(self,_gdi_.new_Pen(*args, **kwargs))
315 __swig_destroy__ = _gdi_.delete_Pen
316 __del__ = lambda self : None;
d55e5bfc
RD
317 def GetCap(*args, **kwargs):
318 """GetCap(self) -> int"""
319 return _gdi_.Pen_GetCap(*args, **kwargs)
320
321 def GetColour(*args, **kwargs):
322 """GetColour(self) -> Colour"""
323 return _gdi_.Pen_GetColour(*args, **kwargs)
324
325 def GetJoin(*args, **kwargs):
326 """GetJoin(self) -> int"""
327 return _gdi_.Pen_GetJoin(*args, **kwargs)
328
329 def GetStyle(*args, **kwargs):
330 """GetStyle(self) -> int"""
331 return _gdi_.Pen_GetStyle(*args, **kwargs)
332
333 def GetWidth(*args, **kwargs):
334 """GetWidth(self) -> int"""
335 return _gdi_.Pen_GetWidth(*args, **kwargs)
336
b39fe951
RD
337 def IsOk(*args, **kwargs):
338 """IsOk(self) -> bool"""
339 return _gdi_.Pen_IsOk(*args, **kwargs)
d55e5bfc 340
b39fe951 341 Ok = IsOk
d55e5bfc
RD
342 def SetCap(*args, **kwargs):
343 """SetCap(self, int cap_style)"""
344 return _gdi_.Pen_SetCap(*args, **kwargs)
345
346 def SetColour(*args, **kwargs):
347 """SetColour(self, Colour colour)"""
348 return _gdi_.Pen_SetColour(*args, **kwargs)
349
350 def SetJoin(*args, **kwargs):
351 """SetJoin(self, int join_style)"""
352 return _gdi_.Pen_SetJoin(*args, **kwargs)
353
354 def SetStyle(*args, **kwargs):
355 """SetStyle(self, int style)"""
356 return _gdi_.Pen_SetStyle(*args, **kwargs)
357
358 def SetWidth(*args, **kwargs):
359 """SetWidth(self, int width)"""
360 return _gdi_.Pen_SetWidth(*args, **kwargs)
361
362 def SetDashes(*args, **kwargs):
36ed4f51 363 """SetDashes(self, int dashes)"""
d55e5bfc
RD
364 return _gdi_.Pen_SetDashes(*args, **kwargs)
365
366 def GetDashes(*args, **kwargs):
367 """GetDashes(self) -> PyObject"""
368 return _gdi_.Pen_GetDashes(*args, **kwargs)
369
d6c14a4c
RD
370 def _SetDashes(*args, **kwargs):
371 """_SetDashes(self, PyObject _self, PyObject pyDashes)"""
372 return _gdi_.Pen__SetDashes(*args, **kwargs)
373
374 def SetDashes(self, dashes):
375 """
376 Associate a list of dash lengths with the Pen.
377 """
378 self._SetDashes(self, dashes)
379
d55e5bfc
RD
380 def __eq__(*args, **kwargs):
381 """__eq__(self, Pen other) -> bool"""
382 return _gdi_.Pen___eq__(*args, **kwargs)
383
384 def __ne__(*args, **kwargs):
385 """__ne__(self, Pen other) -> bool"""
386 return _gdi_.Pen___ne__(*args, **kwargs)
387
b39fe951 388 def __nonzero__(self): return self.IsOk()
33d6fd3b
RD
389 Cap = property(GetCap,SetCap,doc="See `GetCap` and `SetCap`")
390 Colour = property(GetColour,SetColour,doc="See `GetColour` and `SetColour`")
391 Dashes = property(GetDashes,SetDashes,doc="See `GetDashes` and `SetDashes`")
392 Join = property(GetJoin,SetJoin,doc="See `GetJoin` and `SetJoin`")
393 Style = property(GetStyle,SetStyle,doc="See `GetStyle` and `SetStyle`")
394 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
2131d850 395_gdi_.Pen_swigregister(Pen)
d55e5bfc 396
d6c14a4c 397#---------------------------------------------------------------------------
d55e5bfc 398
d6c14a4c
RD
399class Brush(GDIObject):
400 """
401 A brush is a drawing tool for filling in areas. It is used for
402 painting the background of rectangles, ellipses, etc. when drawing on
403 a `wx.DC`. It has a colour and a style.
d55e5bfc 404 """
1bd55598
RD
405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
406 __repr__ = _swig_repr
407 def __init__(self, *args, **kwargs):
d55e5bfc
RD
408 """
409 __init__(self, Colour colour, int style=SOLID) -> Brush
410
15817c7e 411 Constructs a brush from a `wx.Colour` object and a style.
d55e5bfc 412 """
1bd55598
RD
413 _gdi_.Brush_swiginit(self,_gdi_.new_Brush(*args, **kwargs))
414 __swig_destroy__ = _gdi_.delete_Brush
415 __del__ = lambda self : None;
d55e5bfc 416 def SetColour(*args, **kwargs):
d6c14a4c
RD
417 """
418 SetColour(self, Colour col)
419
420 Set the brush's `wx.Colour`.
421 """
d55e5bfc
RD
422 return _gdi_.Brush_SetColour(*args, **kwargs)
423
424 def SetStyle(*args, **kwargs):
d6c14a4c
RD
425 """
426 SetStyle(self, int style)
427
428 Sets the style of the brush. See `__init__` for a listing of styles.
429 """
d55e5bfc
RD
430 return _gdi_.Brush_SetStyle(*args, **kwargs)
431
432 def SetStipple(*args, **kwargs):
d6c14a4c
RD
433 """
434 SetStipple(self, Bitmap stipple)
435
436 Sets the stipple `wx.Bitmap`.
437 """
d55e5bfc
RD
438 return _gdi_.Brush_SetStipple(*args, **kwargs)
439
440 def GetColour(*args, **kwargs):
d6c14a4c
RD
441 """
442 GetColour(self) -> Colour
443
444 Returns the `wx.Colour` of the brush.
445 """
d55e5bfc
RD
446 return _gdi_.Brush_GetColour(*args, **kwargs)
447
448 def GetStyle(*args, **kwargs):
d6c14a4c
RD
449 """
450 GetStyle(self) -> int
451
452 Returns the style of the brush. See `__init__` for a listing of
453 styles.
454 """
d55e5bfc
RD
455 return _gdi_.Brush_GetStyle(*args, **kwargs)
456
457 def GetStipple(*args, **kwargs):
d6c14a4c
RD
458 """
459 GetStipple(self) -> Bitmap
460
461 Returns the stiple `wx.Bitmap` of the brush. If the brush does not
462 have a wx.STIPPLE style, then the return value may be non-None but an
463 uninitialised bitmap (`wx.Bitmap.Ok` returns False).
464 """
d55e5bfc
RD
465 return _gdi_.Brush_GetStipple(*args, **kwargs)
466
f78cc896
RD
467 def IsHatch(*args, **kwargs):
468 """
469 IsHatch(self) -> bool
470
471 Is the current style a hatch type?
472 """
473 return _gdi_.Brush_IsHatch(*args, **kwargs)
474
b39fe951 475 def IsOk(*args, **kwargs):
d6c14a4c 476 """
b39fe951 477 IsOk(self) -> bool
d6c14a4c
RD
478
479 Returns True if the brush is initialised and valid.
480 """
b39fe951 481 return _gdi_.Brush_IsOk(*args, **kwargs)
d55e5bfc 482
b39fe951 483 Ok = IsOk
d55e5bfc
RD
484 def MacGetTheme(*args, **kwargs):
485 """MacGetTheme(self) -> short"""
486 return _gdi_.Brush_MacGetTheme(*args, **kwargs)
487
488 def MacSetTheme(*args, **kwargs):
489 """MacSetTheme(self, short macThemeBrush)"""
490 return _gdi_.Brush_MacSetTheme(*args, **kwargs)
491
b39fe951 492 def __nonzero__(self): return self.IsOk()
2bf58437
RD
493 Colour = property(GetColour,SetColour,doc="See `GetColour` and `SetColour`")
494 Stipple = property(GetStipple,SetStipple,doc="See `GetStipple` and `SetStipple`")
495 Style = property(GetStyle,SetStyle,doc="See `GetStyle` and `SetStyle`")
2131d850 496_gdi_.Brush_swigregister(Brush)
d55e5bfc 497
d04418a7
RD
498def BrushFromBitmap(*args, **kwargs):
499 """
500 BrushFromBitmap(Bitmap stippleBitmap) -> Brush
501
502 Constructs a stippled brush using a bitmap.
503 """
504 val = _gdi_.new_BrushFromBitmap(*args, **kwargs)
d04418a7
RD
505 return val
506
d55e5bfc 507class Bitmap(GDIObject):
d6c14a4c
RD
508 """
509 The wx.Bitmap class encapsulates the concept of a platform-dependent
510 bitmap. It can be either monochrome or colour, and either loaded from
511 a file or created dynamically. A bitmap can be selected into a memory
512 device context (instance of `wx.MemoryDC`). This enables the bitmap to
513 be copied to a window or memory device context using `wx.DC.Blit`, or
514 to be used as a drawing surface.
d6c14a4c 515 """
1bd55598
RD
516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
517 __repr__ = _swig_repr
518 def __init__(self, *args, **kwargs):
d55e5bfc
RD
519 """
520 __init__(self, String name, int type=BITMAP_TYPE_ANY) -> Bitmap
521
522 Loads a bitmap from a file.
523 """
1bd55598
RD
524 _gdi_.Bitmap_swiginit(self,_gdi_.new_Bitmap(*args, **kwargs))
525 __swig_destroy__ = _gdi_.delete_Bitmap
526 __del__ = lambda self : None;
b39fe951
RD
527 def IsOk(*args, **kwargs):
528 """IsOk(self) -> bool"""
529 return _gdi_.Bitmap_IsOk(*args, **kwargs)
d55e5bfc 530
b39fe951 531 Ok = IsOk
d55e5bfc
RD
532 def GetWidth(*args, **kwargs):
533 """
534 GetWidth(self) -> int
535
536 Gets the width of the bitmap in pixels.
537 """
538 return _gdi_.Bitmap_GetWidth(*args, **kwargs)
539
540 def GetHeight(*args, **kwargs):
541 """
542 GetHeight(self) -> int
543
544 Gets the height of the bitmap in pixels.
545 """
546 return _gdi_.Bitmap_GetHeight(*args, **kwargs)
547
548 def GetDepth(*args, **kwargs):
549 """
550 GetDepth(self) -> int
551
552 Gets the colour depth of the bitmap. A value of 1 indicates a
553 monochrome bitmap.
554 """
555 return _gdi_.Bitmap_GetDepth(*args, **kwargs)
556
557 def GetSize(*args, **kwargs):
558 """
559 GetSize(self) -> Size
560
561 Get the size of the bitmap.
562 """
563 return _gdi_.Bitmap_GetSize(*args, **kwargs)
564
565 def ConvertToImage(*args, **kwargs):
566 """
567 ConvertToImage(self) -> Image
568
d6c14a4c
RD
569 Creates a platform-independent image from a platform-dependent
570 bitmap. This preserves mask information so that bitmaps and images can
571 be converted back and forth without loss in that respect.
d55e5bfc
RD
572 """
573 return _gdi_.Bitmap_ConvertToImage(*args, **kwargs)
574
575 def GetMask(*args, **kwargs):
576 """
577 GetMask(self) -> Mask
578
d6c14a4c
RD
579 Gets the associated mask (if any) which may have been loaded from a
580 file or explpicitly set for the bitmap.
581
582 :see: `SetMask`, `wx.Mask`
583
d55e5bfc
RD
584 """
585 return _gdi_.Bitmap_GetMask(*args, **kwargs)
586
587 def SetMask(*args, **kwargs):
588 """
589 SetMask(self, Mask mask)
590
591 Sets the mask for this bitmap.
d6c14a4c
RD
592
593 :see: `GetMask`, `wx.Mask`
594
d55e5bfc
RD
595 """
596 return _gdi_.Bitmap_SetMask(*args, **kwargs)
597
598 def SetMaskColour(*args, **kwargs):
599 """
600 SetMaskColour(self, Colour colour)
601
602 Create a Mask based on a specified colour in the Bitmap.
603 """
604 return _gdi_.Bitmap_SetMaskColour(*args, **kwargs)
605
606 def GetSubBitmap(*args, **kwargs):
607 """
608 GetSubBitmap(self, Rect rect) -> Bitmap
609
d6c14a4c
RD
610 Returns a sub-bitmap of the current one as long as the rect belongs
611 entirely to the bitmap. This function preserves bit depth and mask
612 information.
d55e5bfc
RD
613 """
614 return _gdi_.Bitmap_GetSubBitmap(*args, **kwargs)
615
616 def SaveFile(*args, **kwargs):
617 """
d6c14a4c 618 SaveFile(self, String name, int type, Palette palette=None) -> bool
d55e5bfc 619
d6c14a4c
RD
620 Saves a bitmap in the named file. See `__init__` for a description of
621 the ``type`` parameter.
d55e5bfc
RD
622 """
623 return _gdi_.Bitmap_SaveFile(*args, **kwargs)
624
625 def LoadFile(*args, **kwargs):
626 """
627 LoadFile(self, String name, int type) -> bool
628
d6c14a4c
RD
629 Loads a bitmap from a file. See `__init__` for a description of the
630 ``type`` parameter.
d55e5bfc
RD
631 """
632 return _gdi_.Bitmap_LoadFile(*args, **kwargs)
633
070c48b4
RD
634 def GetPalette(*args, **kwargs):
635 """GetPalette(self) -> Palette"""
636 return _gdi_.Bitmap_GetPalette(*args, **kwargs)
637
d55e5bfc
RD
638 def CopyFromIcon(*args, **kwargs):
639 """CopyFromIcon(self, Icon icon) -> bool"""
640 return _gdi_.Bitmap_CopyFromIcon(*args, **kwargs)
641
642 def SetHeight(*args, **kwargs):
643 """
644 SetHeight(self, int height)
645
d6c14a4c 646 Set the height property (does not affect the existing bitmap data).
d55e5bfc
RD
647 """
648 return _gdi_.Bitmap_SetHeight(*args, **kwargs)
649
650 def SetWidth(*args, **kwargs):
651 """
652 SetWidth(self, int width)
653
d6c14a4c 654 Set the width property (does not affect the existing bitmap data).
d55e5bfc
RD
655 """
656 return _gdi_.Bitmap_SetWidth(*args, **kwargs)
657
658 def SetDepth(*args, **kwargs):
659 """
660 SetDepth(self, int depth)
661
d6c14a4c 662 Set the depth property (does not affect the existing bitmap data).
d55e5bfc
RD
663 """
664 return _gdi_.Bitmap_SetDepth(*args, **kwargs)
665
666 def SetSize(*args, **kwargs):
667 """
668 SetSize(self, Size size)
669
d6c14a4c 670 Set the bitmap size (does not affect the existing bitmap data).
d55e5bfc
RD
671 """
672 return _gdi_.Bitmap_SetSize(*args, **kwargs)
673
8f514ab4
RD
674 def CopyFromBuffer(*args, **kwargs):
675 """
676 CopyFromBuffer(self, buffer data)
677
678 Copy data from a RGB buffer object to replace the bitmap pixel data.
679 See `wxBitmapFromBuffer` for more .
680 """
681 return _gdi_.Bitmap_CopyFromBuffer(*args, **kwargs)
682
683 def CopyFromBufferRGBA(*args, **kwargs):
684 """
685 CopyFromBufferRGBA(self, buffer data)
686
687 Copy data from a RGBA buffer object to replace the bitmap pixel data.
688 See `wxBitmapFromBufferRGBA` for more .
689 """
690 return _gdi_.Bitmap_CopyFromBufferRGBA(*args, **kwargs)
691
b39fe951 692 def __nonzero__(self): return self.IsOk()
d55e5bfc
RD
693 def __eq__(*args, **kwargs):
694 """__eq__(self, Bitmap other) -> bool"""
695 return _gdi_.Bitmap___eq__(*args, **kwargs)
696
697 def __ne__(*args, **kwargs):
698 """__ne__(self, Bitmap other) -> bool"""
699 return _gdi_.Bitmap___ne__(*args, **kwargs)
700
2bf58437
RD
701 Depth = property(GetDepth,SetDepth,doc="See `GetDepth` and `SetDepth`")
702 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
703 Mask = property(GetMask,SetMask,doc="See `GetMask` and `SetMask`")
704 Palette = property(GetPalette,doc="See `GetPalette`")
705 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
706 SubBitmap = property(GetSubBitmap,doc="See `GetSubBitmap`")
707 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
2131d850 708_gdi_.Bitmap_swigregister(Bitmap)
d55e5bfc 709
d6c14a4c
RD
710def EmptyBitmap(*args, **kwargs):
711 """
712 EmptyBitmap(int width, int height, int depth=-1) -> Bitmap
713
714 Creates a new bitmap of the given size. A depth of -1 indicates the
715 depth of the current screen or visual. Some platforms only support 1
1bd55598 716 for monochrome and -1 for the current display depth.
d6c14a4c
RD
717 """
718 val = _gdi_.new_EmptyBitmap(*args, **kwargs)
d6c14a4c
RD
719 return val
720
d55e5bfc
RD
721def BitmapFromIcon(*args, **kwargs):
722 """
723 BitmapFromIcon(Icon icon) -> Bitmap
724
d6c14a4c 725 Create a new bitmap from a `wx.Icon` object.
d55e5bfc
RD
726 """
727 val = _gdi_.new_BitmapFromIcon(*args, **kwargs)
d55e5bfc
RD
728 return val
729
730def BitmapFromImage(*args, **kwargs):
731 """
732 BitmapFromImage(Image image, int depth=-1) -> Bitmap
733
d6c14a4c
RD
734 Creates bitmap object from a `wx.Image`. This has to be done to
735 actually display a `wx.Image` as you cannot draw an image directly on
736 a window. The resulting bitmap will use the provided colour depth (or
737 that of the current screen colour depth if depth is -1) which entails
738 that a colour reduction may have to take place.
d55e5bfc
RD
739 """
740 val = _gdi_.new_BitmapFromImage(*args, **kwargs)
d55e5bfc
RD
741 return val
742
743def BitmapFromXPMData(*args, **kwargs):
744 """
745 BitmapFromXPMData(PyObject listOfStrings) -> Bitmap
746
747 Construct a Bitmap from a list of strings formatted as XPM data.
748 """
749 val = _gdi_.new_BitmapFromXPMData(*args, **kwargs)
d55e5bfc
RD
750 return val
751
752def BitmapFromBits(*args, **kwargs):
753 """
754 BitmapFromBits(PyObject bits, int width, int height, int depth=1) -> Bitmap
755
d6c14a4c
RD
756 Creates a bitmap from an array of bits. You should only use this
757 function for monochrome bitmaps (depth 1) in portable programs: in
758 this case the bits parameter should contain an XBM image. For other
759 bit depths, the behaviour is platform dependent.
d55e5bfc
RD
760 """
761 val = _gdi_.new_BitmapFromBits(*args, **kwargs)
d55e5bfc
RD
762 return val
763
fc46b7f3
RD
764
765def _BitmapFromBufferAlpha(*args, **kwargs):
766 """_BitmapFromBufferAlpha(int width, int height, buffer data, buffer alpha) -> Bitmap"""
767 return _gdi_._BitmapFromBufferAlpha(*args, **kwargs)
768
769def _BitmapFromBuffer(*args, **kwargs):
770 """_BitmapFromBuffer(int width, int height, buffer data) -> Bitmap"""
771 return _gdi_._BitmapFromBuffer(*args, **kwargs)
772def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
773 """
774 Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
eec1c382
RD
775 parameter must be a Python object that implements the buffer
776 interface, such as a string, array, etc. The dataBuffer object is
777 expected to contain a series of RGB bytes and be width*height*3
778 bytes long. A buffer object can optionally be supplied for the
779 image's alpha channel data, and it is expected to be width*height
780 bytes long. On Windows the RGB values are 'premultiplied' by the
781 alpha values. (The other platforms do the multiplication
782 themselves.)
783
784 Unlike `wx.ImageFromBuffer` the bitmap created with this function
785 does not share the memory buffer with the buffer object. This is
786 because the native pixel buffer format varies on different
787 platforms, and so instead an efficient as possible copy of the
788 data is made from the buffer objects to the bitmap's native pixel
789 buffer. For direct access to a bitmap's pixel buffer see
790 `wx.NativePixelData` and `wx.AlphaPixelData`.
fc46b7f3
RD
791
792 :see: `wx.Bitmap`, `wx.BitmapFromBufferRGBA`, `wx.NativePixelData`,
793 `wx.AlphaPixelData`, `wx.ImageFromBuffer`
794 """
fc46b7f3
RD
795 if alphaBuffer is not None:
796 return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
797 else:
798 return _gdi_._BitmapFromBuffer(width, height, dataBuffer)
799
800
801def _BitmapFromBufferRGBA(*args, **kwargs):
802 """_BitmapFromBufferRGBA(int width, int height, buffer data) -> Bitmap"""
803 return _gdi_._BitmapFromBufferRGBA(*args, **kwargs)
804def BitmapFromBufferRGBA(width, height, dataBuffer):
805 """
806 Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
eec1c382
RD
807 parameter must be a Python object that implements the buffer
808 interface, such as a string, array, etc. The dataBuffer object is
809 expected to contain a series of RGBA bytes (red, green, blue and
810 alpha) and be width*height*4 bytes long. On Windows the RGB
811 values are 'premultiplied' by the alpha values. (The other
812 platforms do the multiplication themselves.)
813
814 Unlike `wx.ImageFromBuffer` the bitmap created with this function
815 does not share the memory buffer with the buffer object. This is
816 because the native pixel buffer format varies on different
817 platforms, and so instead an efficient as possible copy of the
818 data is made from the buffer object to the bitmap's native pixel
819 buffer. For direct access to a bitmap's pixel buffer see
820 `wx.NativePixelData` and `wx.AlphaPixelData`.
fc46b7f3
RD
821
822 :see: `wx.Bitmap`, `wx.BitmapFromBuffer`, `wx.NativePixelData`,
823 `wx.AlphaPixelData`, `wx.ImageFromBuffer`
824 """
fc46b7f3
RD
825 return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
826
827class PixelDataBase(object):
828 """Proxy of C++ PixelDataBase class"""
829 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
830 def __init__(self): raise AttributeError, "No constructor defined"
831 __repr__ = _swig_repr
832 def GetOrigin(*args, **kwargs):
833 """GetOrigin(self) -> Point"""
834 return _gdi_.PixelDataBase_GetOrigin(*args, **kwargs)
835
836 def GetWidth(*args, **kwargs):
837 """GetWidth(self) -> int"""
838 return _gdi_.PixelDataBase_GetWidth(*args, **kwargs)
839
840 def GetHeight(*args, **kwargs):
841 """GetHeight(self) -> int"""
842 return _gdi_.PixelDataBase_GetHeight(*args, **kwargs)
843
844 def GetSize(*args, **kwargs):
845 """GetSize(self) -> Size"""
846 return _gdi_.PixelDataBase_GetSize(*args, **kwargs)
847
848 def GetRowStride(*args, **kwargs):
849 """GetRowStride(self) -> int"""
850 return _gdi_.PixelDataBase_GetRowStride(*args, **kwargs)
851
33d6fd3b
RD
852 Height = property(GetHeight,doc="See `GetHeight`")
853 Origin = property(GetOrigin,doc="See `GetOrigin`")
854 RowStride = property(GetRowStride,doc="See `GetRowStride`")
855 Size = property(GetSize,doc="See `GetSize`")
856 Width = property(GetWidth,doc="See `GetWidth`")
fc46b7f3
RD
857_gdi_.PixelDataBase_swigregister(PixelDataBase)
858
859class NativePixelData(PixelDataBase):
860 """Proxy of C++ NativePixelData class"""
861 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
862 __repr__ = _swig_repr
863 def __init__(self, *args):
864 """
865 __init__(self, Bitmap bmp) -> NativePixelData
866 __init__(self, Bitmap bmp, Rect rect) -> NativePixelData
867 __init__(self, Bitmap bmp, Point pt, Size sz) -> NativePixelData
868 """
869 _gdi_.NativePixelData_swiginit(self,_gdi_.new_NativePixelData(*args))
870 __swig_destroy__ = _gdi_.delete_NativePixelData
871 __del__ = lambda self : None;
872 def GetPixels(*args, **kwargs):
873 """GetPixels(self) -> NativePixelData_Accessor"""
874 return _gdi_.NativePixelData_GetPixels(*args, **kwargs)
875
876 def UseAlpha(*args, **kwargs):
877 """UseAlpha(self)"""
878 return _gdi_.NativePixelData_UseAlpha(*args, **kwargs)
879
880 def __nonzero__(*args, **kwargs):
881 """__nonzero__(self) -> bool"""
882 return _gdi_.NativePixelData___nonzero__(*args, **kwargs)
883
884 def __iter__(self):
195a89b4
RD
885 """
886 Create and return an iterator object for this pixel data
887 object. (It's really a generator but I won't tell if you
888 don't tell.)
889 """
890 width = self.GetWidth()
891 height = self.GetHeight()
892 pixels = self.GetPixels()
893
894
895
896
897 class PixelFacade(object):
fc46b7f3 898 def Get(self):
195a89b4
RD
899 return pixels.Get()
900 def Set(self, *args, **kw):
901 return pixels.Set(*args, **kw)
902 def __str__(self):
903 return str(self.Get())
904 def __repr__(self):
905 return 'pixel(%d,%d): %s' % (x,y,self.Get())
906 X = property(lambda self: x)
907 Y = property(lambda self: y)
908
909 pf = PixelFacade()
910 for y in xrange(height):
911 for x in xrange(width):
912
913
914
915 yield pf
916 pixels.nextPixel()
917 pixels.MoveTo(self, 0, y)
fc46b7f3 918
2bf58437 919 Pixels = property(GetPixels,doc="See `GetPixels`")
fc46b7f3
RD
920_gdi_.NativePixelData_swigregister(NativePixelData)
921
922class NativePixelData_Accessor(object):
923 """Proxy of C++ NativePixelData_Accessor class"""
924 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
925 __repr__ = _swig_repr
926 def __init__(self, *args):
927 """
928 __init__(self, NativePixelData data) -> NativePixelData_Accessor
929 __init__(self, Bitmap bmp, NativePixelData data) -> NativePixelData_Accessor
930 __init__(self) -> NativePixelData_Accessor
931 """
932 _gdi_.NativePixelData_Accessor_swiginit(self,_gdi_.new_NativePixelData_Accessor(*args))
933 __swig_destroy__ = _gdi_.delete_NativePixelData_Accessor
934 __del__ = lambda self : None;
935 def Reset(*args, **kwargs):
936 """Reset(self, NativePixelData data)"""
937 return _gdi_.NativePixelData_Accessor_Reset(*args, **kwargs)
938
939 def IsOk(*args, **kwargs):
940 """IsOk(self) -> bool"""
941 return _gdi_.NativePixelData_Accessor_IsOk(*args, **kwargs)
942
943 def nextPixel(*args, **kwargs):
944 """nextPixel(self)"""
945 return _gdi_.NativePixelData_Accessor_nextPixel(*args, **kwargs)
946
947 def Offset(*args, **kwargs):
948 """Offset(self, NativePixelData data, int x, int y)"""
949 return _gdi_.NativePixelData_Accessor_Offset(*args, **kwargs)
950
951 def OffsetX(*args, **kwargs):
952 """OffsetX(self, NativePixelData data, int x)"""
953 return _gdi_.NativePixelData_Accessor_OffsetX(*args, **kwargs)
954
955 def OffsetY(*args, **kwargs):
956 """OffsetY(self, NativePixelData data, int y)"""
957 return _gdi_.NativePixelData_Accessor_OffsetY(*args, **kwargs)
958
959 def MoveTo(*args, **kwargs):
960 """MoveTo(self, NativePixelData data, int x, int y)"""
961 return _gdi_.NativePixelData_Accessor_MoveTo(*args, **kwargs)
962
963 def Set(*args, **kwargs):
964 """Set(self, byte red, byte green, byte blue)"""
965 return _gdi_.NativePixelData_Accessor_Set(*args, **kwargs)
966
967 def Get(*args, **kwargs):
968 """Get(self) -> PyObject"""
969 return _gdi_.NativePixelData_Accessor_Get(*args, **kwargs)
970
971_gdi_.NativePixelData_Accessor_swigregister(NativePixelData_Accessor)
972
973class AlphaPixelData(PixelDataBase):
974 """Proxy of C++ AlphaPixelData class"""
975 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
976 __repr__ = _swig_repr
977 def __init__(self, *args):
978 """
979 __init__(self, Bitmap bmp) -> AlphaPixelData
980 __init__(self, Bitmap bmp, Rect rect) -> AlphaPixelData
981 __init__(self, Bitmap bmp, Point pt, Size sz) -> AlphaPixelData
982 """
983 _gdi_.AlphaPixelData_swiginit(self,_gdi_.new_AlphaPixelData(*args))
984 self.UseAlpha()
985
986 __swig_destroy__ = _gdi_.delete_AlphaPixelData
987 __del__ = lambda self : None;
988 def GetPixels(*args, **kwargs):
989 """GetPixels(self) -> AlphaPixelData_Accessor"""
990 return _gdi_.AlphaPixelData_GetPixels(*args, **kwargs)
991
992 def UseAlpha(*args, **kwargs):
993 """UseAlpha(self)"""
994 return _gdi_.AlphaPixelData_UseAlpha(*args, **kwargs)
995
996 def __nonzero__(*args, **kwargs):
997 """__nonzero__(self) -> bool"""
998 return _gdi_.AlphaPixelData___nonzero__(*args, **kwargs)
999
1000 def __iter__(self):
195a89b4
RD
1001 """
1002 Create and return an iterator object for this pixel data
1003 object. (It's really a generator but I won't tell if you
1004 don't tell.)
1005 """
1006 width = self.GetWidth()
1007 height = self.GetHeight()
1008 pixels = self.GetPixels()
1009
1010
1011
1012
1013 class PixelFacade(object):
fc46b7f3 1014 def Get(self):
195a89b4
RD
1015 return pixels.Get()
1016 def Set(self, *args, **kw):
1017 return pixels.Set(*args, **kw)
1018 def __str__(self):
1019 return str(self.Get())
1020 def __repr__(self):
1021 return 'pixel(%d,%d): %s' % (x,y,self.Get())
1022 X = property(lambda self: x)
1023 Y = property(lambda self: y)
1024
1025 pf = PixelFacade()
1026 for y in xrange(height):
1027 for x in xrange(width):
1028
1029
1030
1031 yield pf
1032 pixels.nextPixel()
1033 pixels.MoveTo(self, 0, y)
fc46b7f3 1034
2bf58437 1035 Pixels = property(GetPixels,doc="See `GetPixels`")
fc46b7f3
RD
1036_gdi_.AlphaPixelData_swigregister(AlphaPixelData)
1037
1038class AlphaPixelData_Accessor(object):
1039 """Proxy of C++ AlphaPixelData_Accessor class"""
1040 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1041 __repr__ = _swig_repr
1042 def __init__(self, *args):
1043 """
1044 __init__(self, AlphaPixelData data) -> AlphaPixelData_Accessor
1045 __init__(self, Bitmap bmp, AlphaPixelData data) -> AlphaPixelData_Accessor
1046 __init__(self) -> AlphaPixelData_Accessor
1047 """
1048 _gdi_.AlphaPixelData_Accessor_swiginit(self,_gdi_.new_AlphaPixelData_Accessor(*args))
1049 __swig_destroy__ = _gdi_.delete_AlphaPixelData_Accessor
1050 __del__ = lambda self : None;
1051 def Reset(*args, **kwargs):
1052 """Reset(self, AlphaPixelData data)"""
1053 return _gdi_.AlphaPixelData_Accessor_Reset(*args, **kwargs)
1054
1055 def IsOk(*args, **kwargs):
1056 """IsOk(self) -> bool"""
1057 return _gdi_.AlphaPixelData_Accessor_IsOk(*args, **kwargs)
1058
1059 def nextPixel(*args, **kwargs):
1060 """nextPixel(self)"""
1061 return _gdi_.AlphaPixelData_Accessor_nextPixel(*args, **kwargs)
1062
1063 def Offset(*args, **kwargs):
1064 """Offset(self, AlphaPixelData data, int x, int y)"""
1065 return _gdi_.AlphaPixelData_Accessor_Offset(*args, **kwargs)
1066
1067 def OffsetX(*args, **kwargs):
1068 """OffsetX(self, AlphaPixelData data, int x)"""
1069 return _gdi_.AlphaPixelData_Accessor_OffsetX(*args, **kwargs)
1070
1071 def OffsetY(*args, **kwargs):
1072 """OffsetY(self, AlphaPixelData data, int y)"""
1073 return _gdi_.AlphaPixelData_Accessor_OffsetY(*args, **kwargs)
1074
1075 def MoveTo(*args, **kwargs):
1076 """MoveTo(self, AlphaPixelData data, int x, int y)"""
1077 return _gdi_.AlphaPixelData_Accessor_MoveTo(*args, **kwargs)
1078
1079 def Set(*args, **kwargs):
1080 """Set(self, byte red, byte green, byte blue, byte alpha)"""
1081 return _gdi_.AlphaPixelData_Accessor_Set(*args, **kwargs)
1082
1083 def Get(*args, **kwargs):
1084 """Get(self) -> PyObject"""
1085 return _gdi_.AlphaPixelData_Accessor_Get(*args, **kwargs)
1086
1087_gdi_.AlphaPixelData_Accessor_swigregister(AlphaPixelData_Accessor)
1088
d6c14a4c 1089class Mask(_core.Object):
d55e5bfc 1090 """
d6c14a4c
RD
1091 This class encapsulates a monochrome mask bitmap, where the masked
1092 area is black and the unmasked area is white. When associated with a
1093 bitmap and drawn in a device context, the unmasked area of the bitmap
1094 will be drawn, and the masked area will not be drawn.
d55e5bfc 1095
d6c14a4c
RD
1096 A mask may be associated with a `wx.Bitmap`. It is used in
1097 `wx.DC.DrawBitmap` or `wx.DC.Blit` when the source device context is a
1098 `wx.MemoryDC` with a `wx.Bitmap` selected into it that contains a
1099 mask.
d55e5bfc 1100 """
1bd55598
RD
1101 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1102 __repr__ = _swig_repr
1103 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1104 """
1105 __init__(self, Bitmap bitmap, Colour colour=NullColour) -> Mask
1106
d6c14a4c
RD
1107 Constructs a mask from a `wx.Bitmap` and a `wx.Colour` in that bitmap
1108 that indicates the transparent portions of the mask. In other words,
1109 the pixels in ``bitmap`` that match ``colour`` will be the transparent
1110 portions of the mask. If no ``colour`` or an invalid ``colour`` is
1111 passed then BLACK is used.
1112
1113 :see: `wx.Bitmap`, `wx.Colour`
d55e5bfc 1114 """
1bd55598
RD
1115 _gdi_.Mask_swiginit(self,_gdi_.new_Mask(*args, **kwargs))
1116 __swig_destroy__ = _gdi_.delete_Mask
1117 __del__ = lambda self : None;
2131d850 1118_gdi_.Mask_swigregister(Mask)
d55e5bfc 1119
d6c14a4c 1120MaskColour = wx._deprecated(Mask, "wx.MaskColour is deprecated, use `wx.Mask` instead.")
d55e5bfc 1121class Icon(GDIObject):
36ed4f51 1122 """Proxy of C++ Icon class"""
1bd55598
RD
1123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1124 __repr__ = _swig_repr
1125 def __init__(self, *args, **kwargs):
d55e5bfc 1126 """__init__(self, String name, int type, int desiredWidth=-1, int desiredHeight=-1) -> Icon"""
1bd55598
RD
1127 _gdi_.Icon_swiginit(self,_gdi_.new_Icon(*args, **kwargs))
1128 __swig_destroy__ = _gdi_.delete_Icon
1129 __del__ = lambda self : None;
b39fe951
RD
1130 def IsOk(*args, **kwargs):
1131 """IsOk(self) -> bool"""
1132 return _gdi_.Icon_IsOk(*args, **kwargs)
d55e5bfc 1133
b39fe951 1134 Ok = IsOk
d55e5bfc
RD
1135 def GetWidth(*args, **kwargs):
1136 """GetWidth(self) -> int"""
1137 return _gdi_.Icon_GetWidth(*args, **kwargs)
1138
1139 def GetHeight(*args, **kwargs):
1140 """GetHeight(self) -> int"""
1141 return _gdi_.Icon_GetHeight(*args, **kwargs)
1142
1143 def GetDepth(*args, **kwargs):
1144 """GetDepth(self) -> int"""
1145 return _gdi_.Icon_GetDepth(*args, **kwargs)
1146
1147 def SetWidth(*args, **kwargs):
1148 """SetWidth(self, int w)"""
1149 return _gdi_.Icon_SetWidth(*args, **kwargs)
1150
1151 def SetHeight(*args, **kwargs):
1152 """SetHeight(self, int h)"""
1153 return _gdi_.Icon_SetHeight(*args, **kwargs)
1154
1155 def SetDepth(*args, **kwargs):
1156 """SetDepth(self, int d)"""
1157 return _gdi_.Icon_SetDepth(*args, **kwargs)
1158
1159 def CopyFromBitmap(*args, **kwargs):
1160 """CopyFromBitmap(self, Bitmap bmp)"""
1161 return _gdi_.Icon_CopyFromBitmap(*args, **kwargs)
1162
b39fe951 1163 def __nonzero__(self): return self.IsOk()
ac5d357a
RD
1164 Depth = property(GetDepth,SetDepth,doc="See `GetDepth` and `SetDepth`")
1165 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1166 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
2131d850 1167_gdi_.Icon_swigregister(Icon)
d55e5bfc
RD
1168
1169def EmptyIcon(*args, **kwargs):
1170 """EmptyIcon() -> Icon"""
1171 val = _gdi_.new_EmptyIcon(*args, **kwargs)
d55e5bfc
RD
1172 return val
1173
1174def IconFromLocation(*args, **kwargs):
1175 """IconFromLocation(IconLocation loc) -> Icon"""
1176 val = _gdi_.new_IconFromLocation(*args, **kwargs)
d55e5bfc
RD
1177 return val
1178
1179def IconFromBitmap(*args, **kwargs):
1180 """IconFromBitmap(Bitmap bmp) -> Icon"""
1181 val = _gdi_.new_IconFromBitmap(*args, **kwargs)
d55e5bfc
RD
1182 return val
1183
1184def IconFromXPMData(*args, **kwargs):
1185 """IconFromXPMData(PyObject listOfStrings) -> Icon"""
1186 val = _gdi_.new_IconFromXPMData(*args, **kwargs)
d55e5bfc
RD
1187 return val
1188
1189class IconLocation(object):
36ed4f51 1190 """Proxy of C++ IconLocation class"""
1bd55598
RD
1191 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1192 __repr__ = _swig_repr
1193 def __init__(self, *args, **kwargs):
d55e5bfc 1194 """__init__(self, String filename=&wxPyEmptyString, int num=0) -> IconLocation"""
1bd55598
RD
1195 _gdi_.IconLocation_swiginit(self,_gdi_.new_IconLocation(*args, **kwargs))
1196 __swig_destroy__ = _gdi_.delete_IconLocation
1197 __del__ = lambda self : None;
d55e5bfc
RD
1198 def IsOk(*args, **kwargs):
1199 """IsOk(self) -> bool"""
1200 return _gdi_.IconLocation_IsOk(*args, **kwargs)
1201
b39fe951 1202 def __nonzero__(self): return self.IsOk()
d55e5bfc
RD
1203 def SetFileName(*args, **kwargs):
1204 """SetFileName(self, String filename)"""
1205 return _gdi_.IconLocation_SetFileName(*args, **kwargs)
1206
1207 def GetFileName(*args, **kwargs):
1208 """GetFileName(self) -> String"""
1209 return _gdi_.IconLocation_GetFileName(*args, **kwargs)
1210
1211 def SetIndex(*args, **kwargs):
1212 """SetIndex(self, int num)"""
1213 return _gdi_.IconLocation_SetIndex(*args, **kwargs)
1214
1215 def GetIndex(*args, **kwargs):
1216 """GetIndex(self) -> int"""
1217 return _gdi_.IconLocation_GetIndex(*args, **kwargs)
1218
ac5d357a
RD
1219 FileName = property(GetFileName,SetFileName,doc="See `GetFileName` and `SetFileName`")
1220 Index = property(GetIndex,SetIndex,doc="See `GetIndex` and `SetIndex`")
2131d850 1221_gdi_.IconLocation_swigregister(IconLocation)
d55e5bfc
RD
1222
1223class IconBundle(object):
36ed4f51 1224 """Proxy of C++ IconBundle class"""
1bd55598
RD
1225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1226 __repr__ = _swig_repr
1227 def __init__(self, *args, **kwargs):
d55e5bfc 1228 """__init__(self) -> IconBundle"""
1bd55598
RD
1229 _gdi_.IconBundle_swiginit(self,_gdi_.new_IconBundle(*args, **kwargs))
1230 __swig_destroy__ = _gdi_.delete_IconBundle
1231 __del__ = lambda self : None;
d55e5bfc
RD
1232 def AddIcon(*args, **kwargs):
1233 """AddIcon(self, Icon icon)"""
1234 return _gdi_.IconBundle_AddIcon(*args, **kwargs)
1235
1236 def AddIconFromFile(*args, **kwargs):
1237 """AddIconFromFile(self, String file, long type)"""
1238 return _gdi_.IconBundle_AddIconFromFile(*args, **kwargs)
1239
1240 def GetIcon(*args, **kwargs):
1241 """GetIcon(self, Size size) -> Icon"""
1242 return _gdi_.IconBundle_GetIcon(*args, **kwargs)
1243
ac5d357a 1244 Icon = property(GetIcon,doc="See `GetIcon`")
2131d850 1245_gdi_.IconBundle_swigregister(IconBundle)
d55e5bfc
RD
1246
1247def IconBundleFromFile(*args, **kwargs):
1248 """IconBundleFromFile(String file, long type) -> IconBundle"""
1249 val = _gdi_.new_IconBundleFromFile(*args, **kwargs)
d55e5bfc
RD
1250 return val
1251
1252def IconBundleFromIcon(*args, **kwargs):
1253 """IconBundleFromIcon(Icon icon) -> IconBundle"""
1254 val = _gdi_.new_IconBundleFromIcon(*args, **kwargs)
d55e5bfc
RD
1255 return val
1256
1257class Cursor(GDIObject):
1258 """
15817c7e
RD
1259 A cursor is a small bitmap usually used for denoting where the mouse
1260 pointer is, with a picture that might indicate the interpretation of a
1261 mouse click.
d55e5bfc
RD
1262
1263 A single cursor object may be used in many windows (any subwindow
15817c7e
RD
1264 type). The wxWindows convention is to set the cursor for a window, as
1265 in X, rather than to set it globally as in MS Windows, although a
1266 global `wx.SetCursor` function is also available for use on MS Windows.
1267
d55e5bfc 1268 """
1bd55598
RD
1269 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1270 __repr__ = _swig_repr
1271 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1272 """
1273 __init__(self, String cursorName, long type, int hotSpotX=0, int hotSpotY=0) -> Cursor
1274
1275 Construct a Cursor from a file. Specify the type of file using
fef4c27a 1276 wx.BITAMP_TYPE* constants, and specify the hotspot if not using a .cur
15817c7e 1277 file.
d55e5bfc 1278 """
1bd55598
RD
1279 _gdi_.Cursor_swiginit(self,_gdi_.new_Cursor(*args, **kwargs))
1280 __swig_destroy__ = _gdi_.delete_Cursor
1281 __del__ = lambda self : None;
b39fe951
RD
1282 def IsOk(*args, **kwargs):
1283 """IsOk(self) -> bool"""
1284 return _gdi_.Cursor_IsOk(*args, **kwargs)
d55e5bfc 1285
b39fe951
RD
1286 Ok = IsOk
1287 def __nonzero__(self): return self.IsOk()
2131d850 1288_gdi_.Cursor_swigregister(Cursor)
d55e5bfc
RD
1289
1290def StockCursor(*args, **kwargs):
1291 """
1292 StockCursor(int id) -> Cursor
1293
15817c7e 1294 Create a cursor using one of the stock cursors. Note that not all
fef4c27a 1295 stock cursors are available on all platforms.
d55e5bfc
RD
1296 """
1297 val = _gdi_.new_StockCursor(*args, **kwargs)
d55e5bfc
RD
1298 return val
1299
1300def CursorFromImage(*args, **kwargs):
1301 """
1302 CursorFromImage(Image image) -> Cursor
1303
fef4c27a 1304 Constructs a cursor from a `wx.Image`. The mask (if any) will be used
53aa7709 1305 for setting the transparent portions of the cursor.
d55e5bfc
RD
1306 """
1307 val = _gdi_.new_CursorFromImage(*args, **kwargs)
d55e5bfc
RD
1308 return val
1309
1310#---------------------------------------------------------------------------
1311
1312OutRegion = _gdi_.OutRegion
1313PartRegion = _gdi_.PartRegion
1314InRegion = _gdi_.InRegion
1315class Region(GDIObject):
36ed4f51 1316 """Proxy of C++ Region class"""
1bd55598
RD
1317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1318 __repr__ = _swig_repr
1319 def __init__(self, *args, **kwargs):
d55e5bfc 1320 """__init__(self, int x=0, int y=0, int width=0, int height=0) -> Region"""
1bd55598
RD
1321 _gdi_.Region_swiginit(self,_gdi_.new_Region(*args, **kwargs))
1322 __swig_destroy__ = _gdi_.delete_Region
1323 __del__ = lambda self : None;
d55e5bfc
RD
1324 def Clear(*args, **kwargs):
1325 """Clear(self)"""
1326 return _gdi_.Region_Clear(*args, **kwargs)
1327
070c48b4
RD
1328 def Offset(*args, **kwargs):
1329 """Offset(self, int x, int y) -> bool"""
1330 return _gdi_.Region_Offset(*args, **kwargs)
1331
d55e5bfc
RD
1332 def Contains(*args, **kwargs):
1333 """Contains(self, int x, int y) -> int"""
1334 return _gdi_.Region_Contains(*args, **kwargs)
1335
1336 def ContainsPoint(*args, **kwargs):
1337 """ContainsPoint(self, Point pt) -> int"""
1338 return _gdi_.Region_ContainsPoint(*args, **kwargs)
1339
1340 def ContainsRect(*args, **kwargs):
1341 """ContainsRect(self, Rect rect) -> int"""
1342 return _gdi_.Region_ContainsRect(*args, **kwargs)
1343
1344 def ContainsRectDim(*args, **kwargs):
1345 """ContainsRectDim(self, int x, int y, int w, int h) -> int"""
1346 return _gdi_.Region_ContainsRectDim(*args, **kwargs)
1347
1348 def GetBox(*args, **kwargs):
1349 """GetBox(self) -> Rect"""
1350 return _gdi_.Region_GetBox(*args, **kwargs)
1351
1352 def Intersect(*args, **kwargs):
1353 """Intersect(self, int x, int y, int width, int height) -> bool"""
1354 return _gdi_.Region_Intersect(*args, **kwargs)
1355
1356 def IntersectRect(*args, **kwargs):
1357 """IntersectRect(self, Rect rect) -> bool"""
1358 return _gdi_.Region_IntersectRect(*args, **kwargs)
1359
1360 def IntersectRegion(*args, **kwargs):
1361 """IntersectRegion(self, Region region) -> bool"""
1362 return _gdi_.Region_IntersectRegion(*args, **kwargs)
1363
1364 def IsEmpty(*args, **kwargs):
1365 """IsEmpty(self) -> bool"""
1366 return _gdi_.Region_IsEmpty(*args, **kwargs)
1367
f5263701
RD
1368 def IsEqual(*args, **kwargs):
1369 """IsEqual(self, Region region) -> bool"""
1370 return _gdi_.Region_IsEqual(*args, **kwargs)
1371
d55e5bfc
RD
1372 def Union(*args, **kwargs):
1373 """Union(self, int x, int y, int width, int height) -> bool"""
1374 return _gdi_.Region_Union(*args, **kwargs)
1375
1376 def UnionRect(*args, **kwargs):
1377 """UnionRect(self, Rect rect) -> bool"""
1378 return _gdi_.Region_UnionRect(*args, **kwargs)
1379
1380 def UnionRegion(*args, **kwargs):
1381 """UnionRegion(self, Region region) -> bool"""
1382 return _gdi_.Region_UnionRegion(*args, **kwargs)
1383
1384 def Subtract(*args, **kwargs):
1385 """Subtract(self, int x, int y, int width, int height) -> bool"""
1386 return _gdi_.Region_Subtract(*args, **kwargs)
1387
1388 def SubtractRect(*args, **kwargs):
1389 """SubtractRect(self, Rect rect) -> bool"""
1390 return _gdi_.Region_SubtractRect(*args, **kwargs)
1391
1392 def SubtractRegion(*args, **kwargs):
1393 """SubtractRegion(self, Region region) -> bool"""
1394 return _gdi_.Region_SubtractRegion(*args, **kwargs)
1395
1396 def Xor(*args, **kwargs):
1397 """Xor(self, int x, int y, int width, int height) -> bool"""
1398 return _gdi_.Region_Xor(*args, **kwargs)
1399
1400 def XorRect(*args, **kwargs):
1401 """XorRect(self, Rect rect) -> bool"""
1402 return _gdi_.Region_XorRect(*args, **kwargs)
1403
1404 def XorRegion(*args, **kwargs):
1405 """XorRegion(self, Region region) -> bool"""
1406 return _gdi_.Region_XorRegion(*args, **kwargs)
1407
1408 def ConvertToBitmap(*args, **kwargs):
1409 """ConvertToBitmap(self) -> Bitmap"""
1410 return _gdi_.Region_ConvertToBitmap(*args, **kwargs)
1411
1412 def UnionBitmap(*args, **kwargs):
d07096ad 1413 """UnionBitmap(self, Bitmap bmp) -> bool"""
d55e5bfc
RD
1414 return _gdi_.Region_UnionBitmap(*args, **kwargs)
1415
d07096ad
RD
1416 def UnionBitmapColour(*args, **kwargs):
1417 """UnionBitmapColour(self, Bitmap bmp, Colour transColour, int tolerance=0) -> bool"""
1418 return _gdi_.Region_UnionBitmapColour(*args, **kwargs)
1419
33d6fd3b 1420 Box = property(GetBox,doc="See `GetBox`")
2131d850 1421_gdi_.Region_swigregister(Region)
d55e5bfc
RD
1422
1423def RegionFromBitmap(*args, **kwargs):
d07096ad 1424 """RegionFromBitmap(Bitmap bmp) -> Region"""
d55e5bfc 1425 val = _gdi_.new_RegionFromBitmap(*args, **kwargs)
d55e5bfc
RD
1426 return val
1427
d07096ad
RD
1428def RegionFromBitmapColour(*args, **kwargs):
1429 """RegionFromBitmapColour(Bitmap bmp, Colour transColour, int tolerance=0) -> Region"""
1430 val = _gdi_.new_RegionFromBitmapColour(*args, **kwargs)
d07096ad
RD
1431 return val
1432
d55e5bfc 1433def RegionFromPoints(*args, **kwargs):
36ed4f51 1434 """RegionFromPoints(int points, int fillStyle=WINDING_RULE) -> Region"""
d55e5bfc 1435 val = _gdi_.new_RegionFromPoints(*args, **kwargs)
d55e5bfc
RD
1436 return val
1437
1438class RegionIterator(_core.Object):
36ed4f51 1439 """Proxy of C++ RegionIterator class"""
1bd55598
RD
1440 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1441 __repr__ = _swig_repr
1442 def __init__(self, *args, **kwargs):
d55e5bfc 1443 """__init__(self, Region region) -> RegionIterator"""
1bd55598
RD
1444 _gdi_.RegionIterator_swiginit(self,_gdi_.new_RegionIterator(*args, **kwargs))
1445 __swig_destroy__ = _gdi_.delete_RegionIterator
1446 __del__ = lambda self : None;
d55e5bfc
RD
1447 def GetX(*args, **kwargs):
1448 """GetX(self) -> int"""
1449 return _gdi_.RegionIterator_GetX(*args, **kwargs)
1450
1451 def GetY(*args, **kwargs):
1452 """GetY(self) -> int"""
1453 return _gdi_.RegionIterator_GetY(*args, **kwargs)
1454
1455 def GetW(*args, **kwargs):
1456 """GetW(self) -> int"""
1457 return _gdi_.RegionIterator_GetW(*args, **kwargs)
1458
1459 def GetWidth(*args, **kwargs):
1460 """GetWidth(self) -> int"""
1461 return _gdi_.RegionIterator_GetWidth(*args, **kwargs)
1462
1463 def GetH(*args, **kwargs):
1464 """GetH(self) -> int"""
1465 return _gdi_.RegionIterator_GetH(*args, **kwargs)
1466
1467 def GetHeight(*args, **kwargs):
1468 """GetHeight(self) -> int"""
1469 return _gdi_.RegionIterator_GetHeight(*args, **kwargs)
1470
1471 def GetRect(*args, **kwargs):
1472 """GetRect(self) -> Rect"""
1473 return _gdi_.RegionIterator_GetRect(*args, **kwargs)
1474
1475 def HaveRects(*args, **kwargs):
1476 """HaveRects(self) -> bool"""
1477 return _gdi_.RegionIterator_HaveRects(*args, **kwargs)
1478
1479 def Reset(*args, **kwargs):
1480 """Reset(self)"""
1481 return _gdi_.RegionIterator_Reset(*args, **kwargs)
1482
1483 def Next(*args, **kwargs):
1484 """Next(self)"""
1485 return _gdi_.RegionIterator_Next(*args, **kwargs)
1486
1487 def __nonzero__(*args, **kwargs):
1488 """__nonzero__(self) -> bool"""
1489 return _gdi_.RegionIterator___nonzero__(*args, **kwargs)
1490
33d6fd3b
RD
1491 H = property(GetH,doc="See `GetH`")
1492 Height = property(GetHeight,doc="See `GetHeight`")
1493 Rect = property(GetRect,doc="See `GetRect`")
1494 W = property(GetW,doc="See `GetW`")
1495 Width = property(GetWidth,doc="See `GetWidth`")
1496 X = property(GetX,doc="See `GetX`")
1497 Y = property(GetY,doc="See `GetY`")
2131d850 1498_gdi_.RegionIterator_swigregister(RegionIterator)
d55e5bfc
RD
1499
1500#---------------------------------------------------------------------------
1501
1502FONTFAMILY_DEFAULT = _gdi_.FONTFAMILY_DEFAULT
1503FONTFAMILY_DECORATIVE = _gdi_.FONTFAMILY_DECORATIVE
1504FONTFAMILY_ROMAN = _gdi_.FONTFAMILY_ROMAN
1505FONTFAMILY_SCRIPT = _gdi_.FONTFAMILY_SCRIPT
1506FONTFAMILY_SWISS = _gdi_.FONTFAMILY_SWISS
1507FONTFAMILY_MODERN = _gdi_.FONTFAMILY_MODERN
1508FONTFAMILY_TELETYPE = _gdi_.FONTFAMILY_TELETYPE
1509FONTFAMILY_MAX = _gdi_.FONTFAMILY_MAX
1510FONTFAMILY_UNKNOWN = _gdi_.FONTFAMILY_UNKNOWN
1511FONTSTYLE_NORMAL = _gdi_.FONTSTYLE_NORMAL
1512FONTSTYLE_ITALIC = _gdi_.FONTSTYLE_ITALIC
1513FONTSTYLE_SLANT = _gdi_.FONTSTYLE_SLANT
1514FONTSTYLE_MAX = _gdi_.FONTSTYLE_MAX
1515FONTWEIGHT_NORMAL = _gdi_.FONTWEIGHT_NORMAL
1516FONTWEIGHT_LIGHT = _gdi_.FONTWEIGHT_LIGHT
1517FONTWEIGHT_BOLD = _gdi_.FONTWEIGHT_BOLD
1518FONTWEIGHT_MAX = _gdi_.FONTWEIGHT_MAX
1519FONTFLAG_DEFAULT = _gdi_.FONTFLAG_DEFAULT
1520FONTFLAG_ITALIC = _gdi_.FONTFLAG_ITALIC
1521FONTFLAG_SLANT = _gdi_.FONTFLAG_SLANT
1522FONTFLAG_LIGHT = _gdi_.FONTFLAG_LIGHT
1523FONTFLAG_BOLD = _gdi_.FONTFLAG_BOLD
1524FONTFLAG_ANTIALIASED = _gdi_.FONTFLAG_ANTIALIASED
1525FONTFLAG_NOT_ANTIALIASED = _gdi_.FONTFLAG_NOT_ANTIALIASED
1526FONTFLAG_UNDERLINED = _gdi_.FONTFLAG_UNDERLINED
1527FONTFLAG_STRIKETHROUGH = _gdi_.FONTFLAG_STRIKETHROUGH
1528FONTFLAG_MASK = _gdi_.FONTFLAG_MASK
1529FONTENCODING_SYSTEM = _gdi_.FONTENCODING_SYSTEM
1530FONTENCODING_DEFAULT = _gdi_.FONTENCODING_DEFAULT
1531FONTENCODING_ISO8859_1 = _gdi_.FONTENCODING_ISO8859_1
1532FONTENCODING_ISO8859_2 = _gdi_.FONTENCODING_ISO8859_2
1533FONTENCODING_ISO8859_3 = _gdi_.FONTENCODING_ISO8859_3
1534FONTENCODING_ISO8859_4 = _gdi_.FONTENCODING_ISO8859_4
1535FONTENCODING_ISO8859_5 = _gdi_.FONTENCODING_ISO8859_5
1536FONTENCODING_ISO8859_6 = _gdi_.FONTENCODING_ISO8859_6
1537FONTENCODING_ISO8859_7 = _gdi_.FONTENCODING_ISO8859_7
1538FONTENCODING_ISO8859_8 = _gdi_.FONTENCODING_ISO8859_8
1539FONTENCODING_ISO8859_9 = _gdi_.FONTENCODING_ISO8859_9
1540FONTENCODING_ISO8859_10 = _gdi_.FONTENCODING_ISO8859_10
1541FONTENCODING_ISO8859_11 = _gdi_.FONTENCODING_ISO8859_11
1542FONTENCODING_ISO8859_12 = _gdi_.FONTENCODING_ISO8859_12
1543FONTENCODING_ISO8859_13 = _gdi_.FONTENCODING_ISO8859_13
1544FONTENCODING_ISO8859_14 = _gdi_.FONTENCODING_ISO8859_14
1545FONTENCODING_ISO8859_15 = _gdi_.FONTENCODING_ISO8859_15
1546FONTENCODING_ISO8859_MAX = _gdi_.FONTENCODING_ISO8859_MAX
1547FONTENCODING_KOI8 = _gdi_.FONTENCODING_KOI8
1548FONTENCODING_KOI8_U = _gdi_.FONTENCODING_KOI8_U
1549FONTENCODING_ALTERNATIVE = _gdi_.FONTENCODING_ALTERNATIVE
1550FONTENCODING_BULGARIAN = _gdi_.FONTENCODING_BULGARIAN
1551FONTENCODING_CP437 = _gdi_.FONTENCODING_CP437
1552FONTENCODING_CP850 = _gdi_.FONTENCODING_CP850
1553FONTENCODING_CP852 = _gdi_.FONTENCODING_CP852
1554FONTENCODING_CP855 = _gdi_.FONTENCODING_CP855
1555FONTENCODING_CP866 = _gdi_.FONTENCODING_CP866
1556FONTENCODING_CP874 = _gdi_.FONTENCODING_CP874
1557FONTENCODING_CP932 = _gdi_.FONTENCODING_CP932
1558FONTENCODING_CP936 = _gdi_.FONTENCODING_CP936
1559FONTENCODING_CP949 = _gdi_.FONTENCODING_CP949
1560FONTENCODING_CP950 = _gdi_.FONTENCODING_CP950
1561FONTENCODING_CP1250 = _gdi_.FONTENCODING_CP1250
1562FONTENCODING_CP1251 = _gdi_.FONTENCODING_CP1251
1563FONTENCODING_CP1252 = _gdi_.FONTENCODING_CP1252
1564FONTENCODING_CP1253 = _gdi_.FONTENCODING_CP1253
1565FONTENCODING_CP1254 = _gdi_.FONTENCODING_CP1254
1566FONTENCODING_CP1255 = _gdi_.FONTENCODING_CP1255
1567FONTENCODING_CP1256 = _gdi_.FONTENCODING_CP1256
1568FONTENCODING_CP1257 = _gdi_.FONTENCODING_CP1257
1569FONTENCODING_CP12_MAX = _gdi_.FONTENCODING_CP12_MAX
1570FONTENCODING_UTF7 = _gdi_.FONTENCODING_UTF7
1571FONTENCODING_UTF8 = _gdi_.FONTENCODING_UTF8
1572FONTENCODING_EUC_JP = _gdi_.FONTENCODING_EUC_JP
1573FONTENCODING_UTF16BE = _gdi_.FONTENCODING_UTF16BE
1574FONTENCODING_UTF16LE = _gdi_.FONTENCODING_UTF16LE
1575FONTENCODING_UTF32BE = _gdi_.FONTENCODING_UTF32BE
1576FONTENCODING_UTF32LE = _gdi_.FONTENCODING_UTF32LE
1577FONTENCODING_MACROMAN = _gdi_.FONTENCODING_MACROMAN
1578FONTENCODING_MACJAPANESE = _gdi_.FONTENCODING_MACJAPANESE
1579FONTENCODING_MACCHINESETRAD = _gdi_.FONTENCODING_MACCHINESETRAD
1580FONTENCODING_MACKOREAN = _gdi_.FONTENCODING_MACKOREAN
1581FONTENCODING_MACARABIC = _gdi_.FONTENCODING_MACARABIC
1582FONTENCODING_MACHEBREW = _gdi_.FONTENCODING_MACHEBREW
1583FONTENCODING_MACGREEK = _gdi_.FONTENCODING_MACGREEK
1584FONTENCODING_MACCYRILLIC = _gdi_.FONTENCODING_MACCYRILLIC
1585FONTENCODING_MACDEVANAGARI = _gdi_.FONTENCODING_MACDEVANAGARI
1586FONTENCODING_MACGURMUKHI = _gdi_.FONTENCODING_MACGURMUKHI
1587FONTENCODING_MACGUJARATI = _gdi_.FONTENCODING_MACGUJARATI
1588FONTENCODING_MACORIYA = _gdi_.FONTENCODING_MACORIYA
1589FONTENCODING_MACBENGALI = _gdi_.FONTENCODING_MACBENGALI
1590FONTENCODING_MACTAMIL = _gdi_.FONTENCODING_MACTAMIL
1591FONTENCODING_MACTELUGU = _gdi_.FONTENCODING_MACTELUGU
1592FONTENCODING_MACKANNADA = _gdi_.FONTENCODING_MACKANNADA
1593FONTENCODING_MACMALAJALAM = _gdi_.FONTENCODING_MACMALAJALAM
1594FONTENCODING_MACSINHALESE = _gdi_.FONTENCODING_MACSINHALESE
1595FONTENCODING_MACBURMESE = _gdi_.FONTENCODING_MACBURMESE
1596FONTENCODING_MACKHMER = _gdi_.FONTENCODING_MACKHMER
1597FONTENCODING_MACTHAI = _gdi_.FONTENCODING_MACTHAI
1598FONTENCODING_MACLAOTIAN = _gdi_.FONTENCODING_MACLAOTIAN
1599FONTENCODING_MACGEORGIAN = _gdi_.FONTENCODING_MACGEORGIAN
1600FONTENCODING_MACARMENIAN = _gdi_.FONTENCODING_MACARMENIAN
1601FONTENCODING_MACCHINESESIMP = _gdi_.FONTENCODING_MACCHINESESIMP
1602FONTENCODING_MACTIBETAN = _gdi_.FONTENCODING_MACTIBETAN
1603FONTENCODING_MACMONGOLIAN = _gdi_.FONTENCODING_MACMONGOLIAN
1604FONTENCODING_MACETHIOPIC = _gdi_.FONTENCODING_MACETHIOPIC
1605FONTENCODING_MACCENTRALEUR = _gdi_.FONTENCODING_MACCENTRALEUR
1606FONTENCODING_MACVIATNAMESE = _gdi_.FONTENCODING_MACVIATNAMESE
1607FONTENCODING_MACARABICEXT = _gdi_.FONTENCODING_MACARABICEXT
1608FONTENCODING_MACSYMBOL = _gdi_.FONTENCODING_MACSYMBOL
1609FONTENCODING_MACDINGBATS = _gdi_.FONTENCODING_MACDINGBATS
1610FONTENCODING_MACTURKISH = _gdi_.FONTENCODING_MACTURKISH
1611FONTENCODING_MACCROATIAN = _gdi_.FONTENCODING_MACCROATIAN
1612FONTENCODING_MACICELANDIC = _gdi_.FONTENCODING_MACICELANDIC
1613FONTENCODING_MACROMANIAN = _gdi_.FONTENCODING_MACROMANIAN
1614FONTENCODING_MACCELTIC = _gdi_.FONTENCODING_MACCELTIC
1615FONTENCODING_MACGAELIC = _gdi_.FONTENCODING_MACGAELIC
1616FONTENCODING_MACKEYBOARD = _gdi_.FONTENCODING_MACKEYBOARD
1617FONTENCODING_MACMIN = _gdi_.FONTENCODING_MACMIN
1618FONTENCODING_MACMAX = _gdi_.FONTENCODING_MACMAX
1619FONTENCODING_MAX = _gdi_.FONTENCODING_MAX
1620FONTENCODING_UTF16 = _gdi_.FONTENCODING_UTF16
1621FONTENCODING_UTF32 = _gdi_.FONTENCODING_UTF32
1622FONTENCODING_UNICODE = _gdi_.FONTENCODING_UNICODE
1623FONTENCODING_GB2312 = _gdi_.FONTENCODING_GB2312
1624FONTENCODING_BIG5 = _gdi_.FONTENCODING_BIG5
1625FONTENCODING_SHIFT_JIS = _gdi_.FONTENCODING_SHIFT_JIS
1626#---------------------------------------------------------------------------
1627
1628class NativeFontInfo(object):
36ed4f51 1629 """Proxy of C++ NativeFontInfo class"""
1bd55598
RD
1630 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1631 __repr__ = _swig_repr
1632 def __init__(self, *args, **kwargs):
d55e5bfc 1633 """__init__(self) -> NativeFontInfo"""
1bd55598
RD
1634 _gdi_.NativeFontInfo_swiginit(self,_gdi_.new_NativeFontInfo(*args, **kwargs))
1635 __swig_destroy__ = _gdi_.delete_NativeFontInfo
1636 __del__ = lambda self : None;
d55e5bfc
RD
1637 def Init(*args, **kwargs):
1638 """Init(self)"""
1639 return _gdi_.NativeFontInfo_Init(*args, **kwargs)
1640
1641 def InitFromFont(*args, **kwargs):
1642 """InitFromFont(self, Font font)"""
1643 return _gdi_.NativeFontInfo_InitFromFont(*args, **kwargs)
1644
1645 def GetPointSize(*args, **kwargs):
1646 """GetPointSize(self) -> int"""
1647 return _gdi_.NativeFontInfo_GetPointSize(*args, **kwargs)
1648
1649 def GetStyle(*args, **kwargs):
1650 """GetStyle(self) -> int"""
1651 return _gdi_.NativeFontInfo_GetStyle(*args, **kwargs)
1652
1653 def GetWeight(*args, **kwargs):
1654 """GetWeight(self) -> int"""
1655 return _gdi_.NativeFontInfo_GetWeight(*args, **kwargs)
1656
1657 def GetUnderlined(*args, **kwargs):
1658 """GetUnderlined(self) -> bool"""
1659 return _gdi_.NativeFontInfo_GetUnderlined(*args, **kwargs)
1660
1661 def GetFaceName(*args, **kwargs):
1662 """GetFaceName(self) -> String"""
1663 return _gdi_.NativeFontInfo_GetFaceName(*args, **kwargs)
1664
1665 def GetFamily(*args, **kwargs):
1666 """GetFamily(self) -> int"""
1667 return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs)
1668
1669 def GetEncoding(*args, **kwargs):
1670 """GetEncoding(self) -> int"""
1671 return _gdi_.NativeFontInfo_GetEncoding(*args, **kwargs)
1672
1673 def SetPointSize(*args, **kwargs):
1674 """SetPointSize(self, int pointsize)"""
1675 return _gdi_.NativeFontInfo_SetPointSize(*args, **kwargs)
1676
1677 def SetStyle(*args, **kwargs):
1678 """SetStyle(self, int style)"""
1679 return _gdi_.NativeFontInfo_SetStyle(*args, **kwargs)
1680
1681 def SetWeight(*args, **kwargs):
1682 """SetWeight(self, int weight)"""
1683 return _gdi_.NativeFontInfo_SetWeight(*args, **kwargs)
1684
1685 def SetUnderlined(*args, **kwargs):
1686 """SetUnderlined(self, bool underlined)"""
1687 return _gdi_.NativeFontInfo_SetUnderlined(*args, **kwargs)
1688
1689 def SetFaceName(*args, **kwargs):
704eda0c 1690 """SetFaceName(self, String facename) -> bool"""
d55e5bfc
RD
1691 return _gdi_.NativeFontInfo_SetFaceName(*args, **kwargs)
1692
1693 def SetFamily(*args, **kwargs):
1694 """SetFamily(self, int family)"""
1695 return _gdi_.NativeFontInfo_SetFamily(*args, **kwargs)
1696
1697 def SetEncoding(*args, **kwargs):
1698 """SetEncoding(self, int encoding)"""
1699 return _gdi_.NativeFontInfo_SetEncoding(*args, **kwargs)
1700
1701 def FromString(*args, **kwargs):
1702 """FromString(self, String s) -> bool"""
1703 return _gdi_.NativeFontInfo_FromString(*args, **kwargs)
1704
1705 def ToString(*args, **kwargs):
1706 """ToString(self) -> String"""
1707 return _gdi_.NativeFontInfo_ToString(*args, **kwargs)
1708
1709 def __str__(*args, **kwargs):
1710 """__str__(self) -> String"""
1711 return _gdi_.NativeFontInfo___str__(*args, **kwargs)
1712
1713 def FromUserString(*args, **kwargs):
1714 """FromUserString(self, String s) -> bool"""
1715 return _gdi_.NativeFontInfo_FromUserString(*args, **kwargs)
1716
1717 def ToUserString(*args, **kwargs):
1718 """ToUserString(self) -> String"""
1719 return _gdi_.NativeFontInfo_ToUserString(*args, **kwargs)
1720
57332a5a
RD
1721 Encoding = property(GetEncoding,SetEncoding,doc="See `GetEncoding` and `SetEncoding`")
1722 FaceName = property(GetFaceName,SetFaceName,doc="See `GetFaceName` and `SetFaceName`")
1723 Family = property(GetFamily,SetFamily,doc="See `GetFamily` and `SetFamily`")
1724 PointSize = property(GetPointSize,SetPointSize,doc="See `GetPointSize` and `SetPointSize`")
1725 Style = property(GetStyle,SetStyle,doc="See `GetStyle` and `SetStyle`")
1726 Underlined = property(GetUnderlined,SetUnderlined,doc="See `GetUnderlined` and `SetUnderlined`")
1727 Weight = property(GetWeight,SetWeight,doc="See `GetWeight` and `SetWeight`")
2131d850 1728_gdi_.NativeFontInfo_swigregister(NativeFontInfo)
d55e5bfc
RD
1729
1730class NativeEncodingInfo(object):
36ed4f51 1731 """Proxy of C++ NativeEncodingInfo class"""
1bd55598
RD
1732 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1733 __repr__ = _swig_repr
d55e5bfc
RD
1734 facename = property(_gdi_.NativeEncodingInfo_facename_get, _gdi_.NativeEncodingInfo_facename_set)
1735 encoding = property(_gdi_.NativeEncodingInfo_encoding_get, _gdi_.NativeEncodingInfo_encoding_set)
1bd55598 1736 def __init__(self, *args, **kwargs):
d55e5bfc 1737 """__init__(self) -> NativeEncodingInfo"""
1bd55598
RD
1738 _gdi_.NativeEncodingInfo_swiginit(self,_gdi_.new_NativeEncodingInfo(*args, **kwargs))
1739 __swig_destroy__ = _gdi_.delete_NativeEncodingInfo
1740 __del__ = lambda self : None;
d55e5bfc
RD
1741 def FromString(*args, **kwargs):
1742 """FromString(self, String s) -> bool"""
1743 return _gdi_.NativeEncodingInfo_FromString(*args, **kwargs)
1744
1745 def ToString(*args, **kwargs):
1746 """ToString(self) -> String"""
1747 return _gdi_.NativeEncodingInfo_ToString(*args, **kwargs)
1748
2131d850 1749_gdi_.NativeEncodingInfo_swigregister(NativeEncodingInfo)
d55e5bfc
RD
1750
1751
1752def GetNativeFontEncoding(*args, **kwargs):
1bd55598
RD
1753 """GetNativeFontEncoding(int encoding) -> NativeEncodingInfo"""
1754 return _gdi_.GetNativeFontEncoding(*args, **kwargs)
d55e5bfc
RD
1755
1756def TestFontEncoding(*args, **kwargs):
1bd55598
RD
1757 """TestFontEncoding(NativeEncodingInfo info) -> bool"""
1758 return _gdi_.TestFontEncoding(*args, **kwargs)
d55e5bfc
RD
1759#---------------------------------------------------------------------------
1760
1761class FontMapper(object):
36ed4f51 1762 """Proxy of C++ FontMapper class"""
1bd55598
RD
1763 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1764 __repr__ = _swig_repr
1765 def __init__(self, *args, **kwargs):
d55e5bfc 1766 """__init__(self) -> FontMapper"""
1bd55598
RD
1767 _gdi_.FontMapper_swiginit(self,_gdi_.new_FontMapper(*args, **kwargs))
1768 __swig_destroy__ = _gdi_.delete_FontMapper
1769 __del__ = lambda self : None;
d55e5bfc 1770 def Get(*args, **kwargs):
d6c14a4c 1771 """Get() -> FontMapper"""
d55e5bfc
RD
1772 return _gdi_.FontMapper_Get(*args, **kwargs)
1773
1774 Get = staticmethod(Get)
1775 def Set(*args, **kwargs):
d6c14a4c 1776 """Set(FontMapper mapper) -> FontMapper"""
d55e5bfc
RD
1777 return _gdi_.FontMapper_Set(*args, **kwargs)
1778
1779 Set = staticmethod(Set)
1780 def CharsetToEncoding(*args, **kwargs):
1781 """CharsetToEncoding(self, String charset, bool interactive=True) -> int"""
1782 return _gdi_.FontMapper_CharsetToEncoding(*args, **kwargs)
1783
1784 def GetSupportedEncodingsCount(*args, **kwargs):
d6c14a4c 1785 """GetSupportedEncodingsCount() -> size_t"""
d55e5bfc
RD
1786 return _gdi_.FontMapper_GetSupportedEncodingsCount(*args, **kwargs)
1787
1788 GetSupportedEncodingsCount = staticmethod(GetSupportedEncodingsCount)
1789 def GetEncoding(*args, **kwargs):
d6c14a4c 1790 """GetEncoding(size_t n) -> int"""
d55e5bfc
RD
1791 return _gdi_.FontMapper_GetEncoding(*args, **kwargs)
1792
1793 GetEncoding = staticmethod(GetEncoding)
1794 def GetEncodingName(*args, **kwargs):
d6c14a4c 1795 """GetEncodingName(int encoding) -> String"""
d55e5bfc
RD
1796 return _gdi_.FontMapper_GetEncodingName(*args, **kwargs)
1797
1798 GetEncodingName = staticmethod(GetEncodingName)
1799 def GetEncodingDescription(*args, **kwargs):
d6c14a4c 1800 """GetEncodingDescription(int encoding) -> String"""
d55e5bfc
RD
1801 return _gdi_.FontMapper_GetEncodingDescription(*args, **kwargs)
1802
1803 GetEncodingDescription = staticmethod(GetEncodingDescription)
1804 def GetEncodingFromName(*args, **kwargs):
d6c14a4c 1805 """GetEncodingFromName(String name) -> int"""
d55e5bfc
RD
1806 return _gdi_.FontMapper_GetEncodingFromName(*args, **kwargs)
1807
1808 GetEncodingFromName = staticmethod(GetEncodingFromName)
d55e5bfc
RD
1809 def SetConfigPath(*args, **kwargs):
1810 """SetConfigPath(self, String prefix)"""
1811 return _gdi_.FontMapper_SetConfigPath(*args, **kwargs)
1812
1813 def GetDefaultConfigPath(*args, **kwargs):
d6c14a4c 1814 """GetDefaultConfigPath() -> String"""
d55e5bfc
RD
1815 return _gdi_.FontMapper_GetDefaultConfigPath(*args, **kwargs)
1816
1817 GetDefaultConfigPath = staticmethod(GetDefaultConfigPath)
1818 def GetAltForEncoding(*args, **kwargs):
1819 """GetAltForEncoding(self, int encoding, String facename=EmptyString, bool interactive=True) -> PyObject"""
1820 return _gdi_.FontMapper_GetAltForEncoding(*args, **kwargs)
1821
1822 def IsEncodingAvailable(*args, **kwargs):
1823 """IsEncodingAvailable(self, int encoding, String facename=EmptyString) -> bool"""
1824 return _gdi_.FontMapper_IsEncodingAvailable(*args, **kwargs)
1825
1826 def SetDialogParent(*args, **kwargs):
1827 """SetDialogParent(self, Window parent)"""
1828 return _gdi_.FontMapper_SetDialogParent(*args, **kwargs)
1829
1830 def SetDialogTitle(*args, **kwargs):
1831 """SetDialogTitle(self, String title)"""
1832 return _gdi_.FontMapper_SetDialogTitle(*args, **kwargs)
1833
ac5d357a 1834 AltForEncoding = property(GetAltForEncoding,doc="See `GetAltForEncoding`")
2131d850 1835_gdi_.FontMapper_swigregister(FontMapper)
d55e5bfc 1836
1bd55598
RD
1837def FontMapper_Get(*args):
1838 """FontMapper_Get() -> FontMapper"""
1839 return _gdi_.FontMapper_Get(*args)
d55e5bfc
RD
1840
1841def FontMapper_Set(*args, **kwargs):
1bd55598
RD
1842 """FontMapper_Set(FontMapper mapper) -> FontMapper"""
1843 return _gdi_.FontMapper_Set(*args, **kwargs)
d55e5bfc 1844
1bd55598
RD
1845def FontMapper_GetSupportedEncodingsCount(*args):
1846 """FontMapper_GetSupportedEncodingsCount() -> size_t"""
1847 return _gdi_.FontMapper_GetSupportedEncodingsCount(*args)
d55e5bfc
RD
1848
1849def FontMapper_GetEncoding(*args, **kwargs):
1bd55598
RD
1850 """FontMapper_GetEncoding(size_t n) -> int"""
1851 return _gdi_.FontMapper_GetEncoding(*args, **kwargs)
d55e5bfc
RD
1852
1853def FontMapper_GetEncodingName(*args, **kwargs):
1bd55598
RD
1854 """FontMapper_GetEncodingName(int encoding) -> String"""
1855 return _gdi_.FontMapper_GetEncodingName(*args, **kwargs)
d55e5bfc
RD
1856
1857def FontMapper_GetEncodingDescription(*args, **kwargs):
1bd55598
RD
1858 """FontMapper_GetEncodingDescription(int encoding) -> String"""
1859 return _gdi_.FontMapper_GetEncodingDescription(*args, **kwargs)
d55e5bfc
RD
1860
1861def FontMapper_GetEncodingFromName(*args, **kwargs):
1bd55598
RD
1862 """FontMapper_GetEncodingFromName(String name) -> int"""
1863 return _gdi_.FontMapper_GetEncodingFromName(*args, **kwargs)
d55e5bfc 1864
1bd55598
RD
1865def FontMapper_GetDefaultConfigPath(*args):
1866 """FontMapper_GetDefaultConfigPath() -> String"""
1867 return _gdi_.FontMapper_GetDefaultConfigPath(*args)
d55e5bfc
RD
1868
1869#---------------------------------------------------------------------------
1870
1871class Font(GDIObject):
a97cefba
RD
1872 """
1873 A font is an object which determines the appearance of text. Fonts are
1874 used for drawing text to a device context, and setting the appearance
1875 of a window's text.
1876
1877 You can retrieve the current system font settings with `wx.SystemSettings`.
1878 """
1bd55598
RD
1879 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1880 __repr__ = _swig_repr
1881 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1882 """
1883 __init__(self, int pointSize, int family, int style, int weight, bool underline=False,
1884 String face=EmptyString,
1885 int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
1886
1887 Creates a font object with the specified attributes.
1888
1889 :param pointSize: The size of the font in points.
1890
1891 :param family: Font family. A generic way of referring to fonts
1892 without specifying actual facename. It can be One of
1893 the ``wx.FONTFAMILY_xxx`` constants.
1894
1895 :param style: One of the ``wx.FONTSTYLE_xxx`` constants.
1896
1897 :param weight: Font weight, sometimes also referred to as font
1898 boldness. One of the ``wx.FONTWEIGHT_xxx`` constants.
1899
1900 :param underline: The value can be ``True`` or ``False`` and
1901 indicates whether the font will include an underline. This
1902 may not be supported on all platforms.
1903
1904 :param face: An optional string specifying the actual typeface to
1905 be used. If it is an empty string, a default typeface will be
1906 chosen based on the family.
1907
1908 :param encoding: An encoding which may be one of the
1909 ``wx.FONTENCODING_xxx`` constants. If the specified encoding isn't
1910 available, no font is created.
1911
1912 :see: `wx.FFont`, `wx.FontFromPixelSize`, `wx.FFontFromPixelSize`,
1913 `wx.FontFromNativeInfoString`, `wx.FontFromNativeInfo`
1914
d55e5bfc 1915 """
a5ee0656 1916 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
1bd55598
RD
1917 _gdi_.Font_swiginit(self,_gdi_.new_Font(*args, **kwargs))
1918 __swig_destroy__ = _gdi_.delete_Font
1919 __del__ = lambda self : None;
b39fe951 1920 def IsOk(*args, **kwargs):
a97cefba 1921 """
b39fe951 1922 IsOk(self) -> bool
a97cefba
RD
1923
1924 Returns ``True`` if this font was successfully created.
1925 """
b39fe951 1926 return _gdi_.Font_IsOk(*args, **kwargs)
d55e5bfc 1927
b39fe951
RD
1928 Ok = IsOk
1929 def __nonzero__(self): return self.IsOk()
d55e5bfc
RD
1930 def __eq__(*args, **kwargs):
1931 """__eq__(self, Font other) -> bool"""
1932 return _gdi_.Font___eq__(*args, **kwargs)
1933
1934 def __ne__(*args, **kwargs):
1935 """__ne__(self, Font other) -> bool"""
1936 return _gdi_.Font___ne__(*args, **kwargs)
1937
1938 def GetPointSize(*args, **kwargs):
a97cefba
RD
1939 """
1940 GetPointSize(self) -> int
1941
1942 Gets the point size.
1943 """
d55e5bfc
RD
1944 return _gdi_.Font_GetPointSize(*args, **kwargs)
1945
5e483524 1946 def GetPixelSize(*args, **kwargs):
a97cefba
RD
1947 """
1948 GetPixelSize(self) -> Size
1949
1950 Returns the size in pixels if the font was constructed with a pixel
1951 size.
1952 """
5e483524
RD
1953 return _gdi_.Font_GetPixelSize(*args, **kwargs)
1954
1955 def IsUsingSizeInPixels(*args, **kwargs):
a97cefba
RD
1956 """
1957 IsUsingSizeInPixels(self) -> bool
1958
1959 Returns ``True`` if the font is using a pixelSize.
1960 """
5e483524
RD
1961 return _gdi_.Font_IsUsingSizeInPixels(*args, **kwargs)
1962
d55e5bfc 1963 def GetFamily(*args, **kwargs):
a97cefba
RD
1964 """
1965 GetFamily(self) -> int
1966
1967 Gets the font family.
1968 """
d55e5bfc
RD
1969 return _gdi_.Font_GetFamily(*args, **kwargs)
1970
1971 def GetStyle(*args, **kwargs):
a97cefba
RD
1972 """
1973 GetStyle(self) -> int
1974
1975 Gets the font style.
1976 """
d55e5bfc
RD
1977 return _gdi_.Font_GetStyle(*args, **kwargs)
1978
1979 def GetWeight(*args, **kwargs):
a97cefba
RD
1980 """
1981 GetWeight(self) -> int
1982
1983 Gets the font weight.
1984 """
d55e5bfc
RD
1985 return _gdi_.Font_GetWeight(*args, **kwargs)
1986
1987 def GetUnderlined(*args, **kwargs):
a97cefba
RD
1988 """
1989 GetUnderlined(self) -> bool
1990
1991 Returns ``True`` if the font is underlined, ``False`` otherwise.
1992 """
d55e5bfc
RD
1993 return _gdi_.Font_GetUnderlined(*args, **kwargs)
1994
1995 def GetFaceName(*args, **kwargs):
a97cefba
RD
1996 """
1997 GetFaceName(self) -> String
1998
1999 Returns the typeface name associated with the font, or the empty
2000 string if there is no typeface information.
2001 """
d55e5bfc
RD
2002 return _gdi_.Font_GetFaceName(*args, **kwargs)
2003
2004 def GetEncoding(*args, **kwargs):
a97cefba
RD
2005 """
2006 GetEncoding(self) -> int
2007
2008 Get the font's encoding.
2009 """
d55e5bfc
RD
2010 return _gdi_.Font_GetEncoding(*args, **kwargs)
2011
2012 def GetNativeFontInfo(*args, **kwargs):
a97cefba
RD
2013 """
2014 GetNativeFontInfo(self) -> NativeFontInfo
2015
2016 Constructs a `wx.NativeFontInfo` object from this font.
2017 """
d55e5bfc
RD
2018 return _gdi_.Font_GetNativeFontInfo(*args, **kwargs)
2019
2020 def IsFixedWidth(*args, **kwargs):
a97cefba
RD
2021 """
2022 IsFixedWidth(self) -> bool
2023
2024 Returns true if the font is a fixed width (or monospaced) font, false
2025 if it is a proportional one or font is invalid.
2026 """
d55e5bfc
RD
2027 return _gdi_.Font_IsFixedWidth(*args, **kwargs)
2028
2029 def GetNativeFontInfoDesc(*args, **kwargs):
a97cefba
RD
2030 """
2031 GetNativeFontInfoDesc(self) -> String
2032
2033 Returns the platform-dependent string completely describing this font
2034 or an empty string if the font isn't valid.
2035 """
d55e5bfc
RD
2036 return _gdi_.Font_GetNativeFontInfoDesc(*args, **kwargs)
2037
2038 def GetNativeFontInfoUserDesc(*args, **kwargs):
a97cefba
RD
2039 """
2040 GetNativeFontInfoUserDesc(self) -> String
2041
2042 Returns a human readable version of `GetNativeFontInfoDesc`.
2043 """
d55e5bfc
RD
2044 return _gdi_.Font_GetNativeFontInfoUserDesc(*args, **kwargs)
2045
2046 def SetPointSize(*args, **kwargs):
a97cefba
RD
2047 """
2048 SetPointSize(self, int pointSize)
2049
2050 Sets the point size.
2051 """
d55e5bfc
RD
2052 return _gdi_.Font_SetPointSize(*args, **kwargs)
2053
5e483524 2054 def SetPixelSize(*args, **kwargs):
a97cefba
RD
2055 """
2056 SetPixelSize(self, Size pixelSize)
2057
2058 Sets the size in pixels rather than points. If there is platform API
2059 support for this then it is used, otherwise a font with the closest
2060 size is found using a binary search.
2061 """
5e483524
RD
2062 return _gdi_.Font_SetPixelSize(*args, **kwargs)
2063
d55e5bfc 2064 def SetFamily(*args, **kwargs):
a97cefba
RD
2065 """
2066 SetFamily(self, int family)
2067
2068 Sets the font family.
2069 """
d55e5bfc
RD
2070 return _gdi_.Font_SetFamily(*args, **kwargs)
2071
2072 def SetStyle(*args, **kwargs):
a97cefba
RD
2073 """
2074 SetStyle(self, int style)
2075
2076 Sets the font style.
2077 """
d55e5bfc
RD
2078 return _gdi_.Font_SetStyle(*args, **kwargs)
2079
2080 def SetWeight(*args, **kwargs):
a97cefba
RD
2081 """
2082 SetWeight(self, int weight)
2083
2084 Sets the font weight.
2085 """
d55e5bfc
RD
2086 return _gdi_.Font_SetWeight(*args, **kwargs)
2087
2088 def SetFaceName(*args, **kwargs):
a97cefba 2089 """
704eda0c 2090 SetFaceName(self, String faceName) -> bool
a97cefba
RD
2091
2092 Sets the facename for the font. The facename, which should be a valid
2093 font installed on the end-user's system.
2094
2095 To avoid portability problems, don't rely on a specific face, but
2096 specify the font family instead or as well. A suitable font will be
2097 found on the end-user's system. If both the family and the facename
2098 are specified, wxWidgets will first search for the specific face, and
2099 then for a font belonging to the same family.
2100 """
d55e5bfc
RD
2101 return _gdi_.Font_SetFaceName(*args, **kwargs)
2102
2103 def SetUnderlined(*args, **kwargs):
a97cefba
RD
2104 """
2105 SetUnderlined(self, bool underlined)
2106
2107 Sets underlining.
2108 """
d55e5bfc
RD
2109 return _gdi_.Font_SetUnderlined(*args, **kwargs)
2110
2111 def SetEncoding(*args, **kwargs):
a97cefba
RD
2112 """
2113 SetEncoding(self, int encoding)
2114
2115 Set the font encoding.
2116 """
d55e5bfc
RD
2117 return _gdi_.Font_SetEncoding(*args, **kwargs)
2118
2119 def SetNativeFontInfo(*args, **kwargs):
a97cefba
RD
2120 """
2121 SetNativeFontInfo(self, NativeFontInfo info)
2122
2123 Set the font's attributes from a `wx.NativeFontInfo` object.
2124 """
d55e5bfc
RD
2125 return _gdi_.Font_SetNativeFontInfo(*args, **kwargs)
2126
2127 def SetNativeFontInfoFromString(*args, **kwargs):
a97cefba 2128 """
704eda0c 2129 SetNativeFontInfoFromString(self, String info) -> bool
a97cefba
RD
2130
2131 Set the font's attributes from string representation of a
2132 `wx.NativeFontInfo` object.
2133 """
d55e5bfc
RD
2134 return _gdi_.Font_SetNativeFontInfoFromString(*args, **kwargs)
2135
2136 def SetNativeFontInfoUserDesc(*args, **kwargs):
a97cefba 2137 """
704eda0c 2138 SetNativeFontInfoUserDesc(self, String info) -> bool
a97cefba
RD
2139
2140 Set the font's attributes from a string formerly returned from
2141 `GetNativeFontInfoDesc`.
2142 """
d55e5bfc
RD
2143 return _gdi_.Font_SetNativeFontInfoUserDesc(*args, **kwargs)
2144
2145 def GetFamilyString(*args, **kwargs):
a97cefba
RD
2146 """
2147 GetFamilyString(self) -> String
2148
2149 Returns a string representation of the font family.
2150 """
d55e5bfc
RD
2151 return _gdi_.Font_GetFamilyString(*args, **kwargs)
2152
2153 def GetStyleString(*args, **kwargs):
a97cefba
RD
2154 """
2155 GetStyleString(self) -> String
2156
2157 Returns a string representation of the font style.
2158 """
d55e5bfc
RD
2159 return _gdi_.Font_GetStyleString(*args, **kwargs)
2160
2161 def GetWeightString(*args, **kwargs):
a97cefba
RD
2162 """
2163 GetWeightString(self) -> String
2164
2165 Return a string representation of the font weight.
2166 """
d55e5bfc
RD
2167 return _gdi_.Font_GetWeightString(*args, **kwargs)
2168
2169 def SetNoAntiAliasing(*args, **kwargs):
2170 """SetNoAntiAliasing(self, bool no=True)"""
2171 return _gdi_.Font_SetNoAntiAliasing(*args, **kwargs)
2172
2173 def GetNoAntiAliasing(*args, **kwargs):
2174 """GetNoAntiAliasing(self) -> bool"""
2175 return _gdi_.Font_GetNoAntiAliasing(*args, **kwargs)
2176
2177 def GetDefaultEncoding(*args, **kwargs):
a97cefba
RD
2178 """
2179 GetDefaultEncoding() -> int
2180
2181 Returns the encoding used for all fonts created with an encoding of
2182 ``wx.FONTENCODING_DEFAULT``.
2183 """
d55e5bfc
RD
2184 return _gdi_.Font_GetDefaultEncoding(*args, **kwargs)
2185
2186 GetDefaultEncoding = staticmethod(GetDefaultEncoding)
2187 def SetDefaultEncoding(*args, **kwargs):
a97cefba
RD
2188 """
2189 SetDefaultEncoding(int encoding)
2190
2191 Sets the default font encoding.
2192 """
d55e5bfc
RD
2193 return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
2194
2195 SetDefaultEncoding = staticmethod(SetDefaultEncoding)
ac5d357a
RD
2196 Encoding = property(GetEncoding,SetEncoding,doc="See `GetEncoding` and `SetEncoding`")
2197 FaceName = property(GetFaceName,SetFaceName,doc="See `GetFaceName` and `SetFaceName`")
2198 Family = property(GetFamily,SetFamily,doc="See `GetFamily` and `SetFamily`")
2199 FamilyString = property(GetFamilyString,doc="See `GetFamilyString`")
2200 NativeFontInfo = property(GetNativeFontInfo,SetNativeFontInfo,doc="See `GetNativeFontInfo` and `SetNativeFontInfo`")
2201 NativeFontInfoDesc = property(GetNativeFontInfoDesc,doc="See `GetNativeFontInfoDesc`")
2202 NativeFontInfoUserDesc = property(GetNativeFontInfoUserDesc,SetNativeFontInfoUserDesc,doc="See `GetNativeFontInfoUserDesc` and `SetNativeFontInfoUserDesc`")
2203 NoAntiAliasing = property(GetNoAntiAliasing,SetNoAntiAliasing,doc="See `GetNoAntiAliasing` and `SetNoAntiAliasing`")
2204 PixelSize = property(GetPixelSize,SetPixelSize,doc="See `GetPixelSize` and `SetPixelSize`")
2205 PointSize = property(GetPointSize,SetPointSize,doc="See `GetPointSize` and `SetPointSize`")
2206 Style = property(GetStyle,SetStyle,doc="See `GetStyle` and `SetStyle`")
2207 StyleString = property(GetStyleString,doc="See `GetStyleString`")
2208 Underlined = property(GetUnderlined,SetUnderlined,doc="See `GetUnderlined` and `SetUnderlined`")
2209 Weight = property(GetWeight,SetWeight,doc="See `GetWeight` and `SetWeight`")
2210 WeightString = property(GetWeightString,doc="See `GetWeightString`")
2131d850 2211_gdi_.Font_swigregister(Font)
d55e5bfc
RD
2212
2213def FontFromNativeInfo(*args, **kwargs):
a97cefba
RD
2214 """
2215 FontFromNativeInfo(NativeFontInfo info) -> Font
2216
2217 Construct a `wx.Font` from a `wx.NativeFontInfo` object.
2218 """
a5ee0656 2219 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
d55e5bfc 2220 val = _gdi_.new_FontFromNativeInfo(*args, **kwargs)
d55e5bfc
RD
2221 return val
2222
2223def FontFromNativeInfoString(*args, **kwargs):
a97cefba
RD
2224 """
2225 FontFromNativeInfoString(String info) -> Font
2226
2227 Construct a `wx.Font` from the string representation of a
2228 `wx.NativeFontInfo` object.
2229 """
a5ee0656 2230 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
d55e5bfc 2231 val = _gdi_.new_FontFromNativeInfoString(*args, **kwargs)
d55e5bfc
RD
2232 return val
2233
a97cefba 2234def FFont(*args, **kwargs):
d55e5bfc 2235 """
a97cefba 2236 FFont(int pointSize, int family, int flags=FONTFLAG_DEFAULT,
d55e5bfc 2237 String face=EmptyString, int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
2238
2239 A bit of a simpler way to create a `wx.Font` using flags instead of
2240 individual attribute settings. The value of flags can be a
2241 combination of the following:
2242
2243 ============================ ==
2244 wx.FONTFLAG_DEFAULT
2245 wx.FONTFLAG_ITALIC
2246 wx.FONTFLAG_SLANT
2247 wx.FONTFLAG_LIGHT
2248 wx.FONTFLAG_BOLD
2249 wx.FONTFLAG_ANTIALIASED
2250 wx.FONTFLAG_NOT_ANTIALIASED
2251 wx.FONTFLAG_UNDERLINED
2252 wx.FONTFLAG_STRIKETHROUGH
2253 ============================ ==
2254
2255 :see: `wx.Font.__init__`
d55e5bfc 2256 """
a5ee0656 2257 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
a97cefba 2258 val = _gdi_.new_FFont(*args, **kwargs)
d55e5bfc
RD
2259 return val
2260
5e483524
RD
2261def FontFromPixelSize(*args, **kwargs):
2262 """
2263 FontFromPixelSize(Size pixelSize, int family, int style, int weight,
2264 bool underlined=False, String face=wxEmptyString,
2265 int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
2266
2267 Creates a font using a size in pixels rather than points. If there is
2268 platform API support for this then it is used, otherwise a font with
2269 the closest size is found using a binary search.
2270
2271 :see: `wx.Font.__init__`
5e483524
RD
2272 """
2273 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
2274 val = _gdi_.new_FontFromPixelSize(*args, **kwargs)
5e483524
RD
2275 return val
2276
a97cefba
RD
2277def FFontFromPixelSize(*args, **kwargs):
2278 """
2279 FFontFromPixelSize(Size pixelSize, int family, int flags=FONTFLAG_DEFAULT,
2280 String face=wxEmptyString, int encoding=FONTENCODING_DEFAULT) -> Font
2281
2282 Creates a font using a size in pixels rather than points. If there is
2283 platform API support for this then it is used, otherwise a font with
2284 the closest size is found using a binary search.
2285
2286 :see: `wx.Font.__init__`, `wx.FFont`
2287 """
2288 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
2289 val = _gdi_.new_FFontFromPixelSize(*args, **kwargs)
a97cefba
RD
2290 return val
2291
1bd55598
RD
2292def Font_GetDefaultEncoding(*args):
2293 """
a97cefba
RD
2294 Font_GetDefaultEncoding() -> int
2295
2296 Returns the encoding used for all fonts created with an encoding of
2297 ``wx.FONTENCODING_DEFAULT``.
2298 """
1bd55598 2299 return _gdi_.Font_GetDefaultEncoding(*args)
d55e5bfc
RD
2300
2301def Font_SetDefaultEncoding(*args, **kwargs):
1bd55598 2302 """
a97cefba
RD
2303 Font_SetDefaultEncoding(int encoding)
2304
2305 Sets the default font encoding.
2306 """
1bd55598 2307 return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
d55e5bfc 2308
a97cefba 2309Font2 = wx._deprecated(FFont, "Use `wx.FFont` instead.")
d55e5bfc
RD
2310#---------------------------------------------------------------------------
2311
2312class FontEnumerator(object):
36ed4f51 2313 """Proxy of C++ FontEnumerator class"""
1bd55598
RD
2314 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2315 __repr__ = _swig_repr
2316 def __init__(self, *args, **kwargs):
d55e5bfc 2317 """__init__(self) -> FontEnumerator"""
1bd55598 2318 _gdi_.FontEnumerator_swiginit(self,_gdi_.new_FontEnumerator(*args, **kwargs))
c25f90f6 2319 FontEnumerator._setCallbackInfo(self, self, FontEnumerator)
d55e5bfc 2320
1bd55598
RD
2321 __swig_destroy__ = _gdi_.delete_FontEnumerator
2322 __del__ = lambda self : None;
d55e5bfc 2323 def _setCallbackInfo(*args, **kwargs):
c25f90f6 2324 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=0)"""
d55e5bfc
RD
2325 return _gdi_.FontEnumerator__setCallbackInfo(*args, **kwargs)
2326
2327 def EnumerateFacenames(*args, **kwargs):
2328 """EnumerateFacenames(self, int encoding=FONTENCODING_SYSTEM, bool fixedWidthOnly=False) -> bool"""
2329 return _gdi_.FontEnumerator_EnumerateFacenames(*args, **kwargs)
2330
2331 def EnumerateEncodings(*args, **kwargs):
2332 """EnumerateEncodings(self, String facename=EmptyString) -> bool"""
2333 return _gdi_.FontEnumerator_EnumerateEncodings(*args, **kwargs)
2334
2335 def GetEncodings(*args, **kwargs):
704eda0c 2336 """GetEncodings() -> PyObject"""
d55e5bfc
RD
2337 return _gdi_.FontEnumerator_GetEncodings(*args, **kwargs)
2338
704eda0c 2339 GetEncodings = staticmethod(GetEncodings)
d55e5bfc 2340 def GetFacenames(*args, **kwargs):
704eda0c 2341 """GetFacenames() -> PyObject"""
d55e5bfc
RD
2342 return _gdi_.FontEnumerator_GetFacenames(*args, **kwargs)
2343
704eda0c
RD
2344 GetFacenames = staticmethod(GetFacenames)
2345 def IsValidFacename(*args, **kwargs):
2346 """
2347 IsValidFacename(String str) -> bool
2348
2349 Convenience function that returns true if the given face name exist in
2350 the user's system
2351 """
2352 return _gdi_.FontEnumerator_IsValidFacename(*args, **kwargs)
2353
2354 IsValidFacename = staticmethod(IsValidFacename)
2131d850 2355_gdi_.FontEnumerator_swigregister(FontEnumerator)
d55e5bfc 2356
704eda0c
RD
2357def FontEnumerator_GetEncodings(*args):
2358 """FontEnumerator_GetEncodings() -> PyObject"""
2359 return _gdi_.FontEnumerator_GetEncodings(*args)
2360
2361def FontEnumerator_GetFacenames(*args):
2362 """FontEnumerator_GetFacenames() -> PyObject"""
2363 return _gdi_.FontEnumerator_GetFacenames(*args)
2364
2365def FontEnumerator_IsValidFacename(*args, **kwargs):
2366 """
2367 FontEnumerator_IsValidFacename(String str) -> bool
2368
2369 Convenience function that returns true if the given face name exist in
2370 the user's system
2371 """
2372 return _gdi_.FontEnumerator_IsValidFacename(*args, **kwargs)
2373
d55e5bfc
RD
2374#---------------------------------------------------------------------------
2375
2376LANGUAGE_DEFAULT = _gdi_.LANGUAGE_DEFAULT
2377LANGUAGE_UNKNOWN = _gdi_.LANGUAGE_UNKNOWN
2378LANGUAGE_ABKHAZIAN = _gdi_.LANGUAGE_ABKHAZIAN
2379LANGUAGE_AFAR = _gdi_.LANGUAGE_AFAR
2380LANGUAGE_AFRIKAANS = _gdi_.LANGUAGE_AFRIKAANS
2381LANGUAGE_ALBANIAN = _gdi_.LANGUAGE_ALBANIAN
2382LANGUAGE_AMHARIC = _gdi_.LANGUAGE_AMHARIC
2383LANGUAGE_ARABIC = _gdi_.LANGUAGE_ARABIC
2384LANGUAGE_ARABIC_ALGERIA = _gdi_.LANGUAGE_ARABIC_ALGERIA
2385LANGUAGE_ARABIC_BAHRAIN = _gdi_.LANGUAGE_ARABIC_BAHRAIN
2386LANGUAGE_ARABIC_EGYPT = _gdi_.LANGUAGE_ARABIC_EGYPT
2387LANGUAGE_ARABIC_IRAQ = _gdi_.LANGUAGE_ARABIC_IRAQ
2388LANGUAGE_ARABIC_JORDAN = _gdi_.LANGUAGE_ARABIC_JORDAN
2389LANGUAGE_ARABIC_KUWAIT = _gdi_.LANGUAGE_ARABIC_KUWAIT
2390LANGUAGE_ARABIC_LEBANON = _gdi_.LANGUAGE_ARABIC_LEBANON
2391LANGUAGE_ARABIC_LIBYA = _gdi_.LANGUAGE_ARABIC_LIBYA
2392LANGUAGE_ARABIC_MOROCCO = _gdi_.LANGUAGE_ARABIC_MOROCCO
2393LANGUAGE_ARABIC_OMAN = _gdi_.LANGUAGE_ARABIC_OMAN
2394LANGUAGE_ARABIC_QATAR = _gdi_.LANGUAGE_ARABIC_QATAR
2395LANGUAGE_ARABIC_SAUDI_ARABIA = _gdi_.LANGUAGE_ARABIC_SAUDI_ARABIA
2396LANGUAGE_ARABIC_SUDAN = _gdi_.LANGUAGE_ARABIC_SUDAN
2397LANGUAGE_ARABIC_SYRIA = _gdi_.LANGUAGE_ARABIC_SYRIA
2398LANGUAGE_ARABIC_TUNISIA = _gdi_.LANGUAGE_ARABIC_TUNISIA
2399LANGUAGE_ARABIC_UAE = _gdi_.LANGUAGE_ARABIC_UAE
2400LANGUAGE_ARABIC_YEMEN = _gdi_.LANGUAGE_ARABIC_YEMEN
2401LANGUAGE_ARMENIAN = _gdi_.LANGUAGE_ARMENIAN
2402LANGUAGE_ASSAMESE = _gdi_.LANGUAGE_ASSAMESE
2403LANGUAGE_AYMARA = _gdi_.LANGUAGE_AYMARA
2404LANGUAGE_AZERI = _gdi_.LANGUAGE_AZERI
2405LANGUAGE_AZERI_CYRILLIC = _gdi_.LANGUAGE_AZERI_CYRILLIC
2406LANGUAGE_AZERI_LATIN = _gdi_.LANGUAGE_AZERI_LATIN
2407LANGUAGE_BASHKIR = _gdi_.LANGUAGE_BASHKIR
2408LANGUAGE_BASQUE = _gdi_.LANGUAGE_BASQUE
2409LANGUAGE_BELARUSIAN = _gdi_.LANGUAGE_BELARUSIAN
2410LANGUAGE_BENGALI = _gdi_.LANGUAGE_BENGALI
2411LANGUAGE_BHUTANI = _gdi_.LANGUAGE_BHUTANI
2412LANGUAGE_BIHARI = _gdi_.LANGUAGE_BIHARI
2413LANGUAGE_BISLAMA = _gdi_.LANGUAGE_BISLAMA
2414LANGUAGE_BRETON = _gdi_.LANGUAGE_BRETON
2415LANGUAGE_BULGARIAN = _gdi_.LANGUAGE_BULGARIAN
2416LANGUAGE_BURMESE = _gdi_.LANGUAGE_BURMESE
2417LANGUAGE_CAMBODIAN = _gdi_.LANGUAGE_CAMBODIAN
2418LANGUAGE_CATALAN = _gdi_.LANGUAGE_CATALAN
2419LANGUAGE_CHINESE = _gdi_.LANGUAGE_CHINESE
2420LANGUAGE_CHINESE_SIMPLIFIED = _gdi_.LANGUAGE_CHINESE_SIMPLIFIED
2421LANGUAGE_CHINESE_TRADITIONAL = _gdi_.LANGUAGE_CHINESE_TRADITIONAL
2422LANGUAGE_CHINESE_HONGKONG = _gdi_.LANGUAGE_CHINESE_HONGKONG
2423LANGUAGE_CHINESE_MACAU = _gdi_.LANGUAGE_CHINESE_MACAU
2424LANGUAGE_CHINESE_SINGAPORE = _gdi_.LANGUAGE_CHINESE_SINGAPORE
2425LANGUAGE_CHINESE_TAIWAN = _gdi_.LANGUAGE_CHINESE_TAIWAN
2426LANGUAGE_CORSICAN = _gdi_.LANGUAGE_CORSICAN
2427LANGUAGE_CROATIAN = _gdi_.LANGUAGE_CROATIAN
2428LANGUAGE_CZECH = _gdi_.LANGUAGE_CZECH
2429LANGUAGE_DANISH = _gdi_.LANGUAGE_DANISH
2430LANGUAGE_DUTCH = _gdi_.LANGUAGE_DUTCH
2431LANGUAGE_DUTCH_BELGIAN = _gdi_.LANGUAGE_DUTCH_BELGIAN
2432LANGUAGE_ENGLISH = _gdi_.LANGUAGE_ENGLISH
2433LANGUAGE_ENGLISH_UK = _gdi_.LANGUAGE_ENGLISH_UK
2434LANGUAGE_ENGLISH_US = _gdi_.LANGUAGE_ENGLISH_US
2435LANGUAGE_ENGLISH_AUSTRALIA = _gdi_.LANGUAGE_ENGLISH_AUSTRALIA
2436LANGUAGE_ENGLISH_BELIZE = _gdi_.LANGUAGE_ENGLISH_BELIZE
2437LANGUAGE_ENGLISH_BOTSWANA = _gdi_.LANGUAGE_ENGLISH_BOTSWANA
2438LANGUAGE_ENGLISH_CANADA = _gdi_.LANGUAGE_ENGLISH_CANADA
2439LANGUAGE_ENGLISH_CARIBBEAN = _gdi_.LANGUAGE_ENGLISH_CARIBBEAN
2440LANGUAGE_ENGLISH_DENMARK = _gdi_.LANGUAGE_ENGLISH_DENMARK
2441LANGUAGE_ENGLISH_EIRE = _gdi_.LANGUAGE_ENGLISH_EIRE
2442LANGUAGE_ENGLISH_JAMAICA = _gdi_.LANGUAGE_ENGLISH_JAMAICA
2443LANGUAGE_ENGLISH_NEW_ZEALAND = _gdi_.LANGUAGE_ENGLISH_NEW_ZEALAND
2444LANGUAGE_ENGLISH_PHILIPPINES = _gdi_.LANGUAGE_ENGLISH_PHILIPPINES
2445LANGUAGE_ENGLISH_SOUTH_AFRICA = _gdi_.LANGUAGE_ENGLISH_SOUTH_AFRICA
2446LANGUAGE_ENGLISH_TRINIDAD = _gdi_.LANGUAGE_ENGLISH_TRINIDAD
2447LANGUAGE_ENGLISH_ZIMBABWE = _gdi_.LANGUAGE_ENGLISH_ZIMBABWE
2448LANGUAGE_ESPERANTO = _gdi_.LANGUAGE_ESPERANTO
2449LANGUAGE_ESTONIAN = _gdi_.LANGUAGE_ESTONIAN
2450LANGUAGE_FAEROESE = _gdi_.LANGUAGE_FAEROESE
2451LANGUAGE_FARSI = _gdi_.LANGUAGE_FARSI
2452LANGUAGE_FIJI = _gdi_.LANGUAGE_FIJI
2453LANGUAGE_FINNISH = _gdi_.LANGUAGE_FINNISH
2454LANGUAGE_FRENCH = _gdi_.LANGUAGE_FRENCH
2455LANGUAGE_FRENCH_BELGIAN = _gdi_.LANGUAGE_FRENCH_BELGIAN
2456LANGUAGE_FRENCH_CANADIAN = _gdi_.LANGUAGE_FRENCH_CANADIAN
2457LANGUAGE_FRENCH_LUXEMBOURG = _gdi_.LANGUAGE_FRENCH_LUXEMBOURG
2458LANGUAGE_FRENCH_MONACO = _gdi_.LANGUAGE_FRENCH_MONACO
2459LANGUAGE_FRENCH_SWISS = _gdi_.LANGUAGE_FRENCH_SWISS
2460LANGUAGE_FRISIAN = _gdi_.LANGUAGE_FRISIAN
2461LANGUAGE_GALICIAN = _gdi_.LANGUAGE_GALICIAN
2462LANGUAGE_GEORGIAN = _gdi_.LANGUAGE_GEORGIAN
2463LANGUAGE_GERMAN = _gdi_.LANGUAGE_GERMAN
2464LANGUAGE_GERMAN_AUSTRIAN = _gdi_.LANGUAGE_GERMAN_AUSTRIAN
2465LANGUAGE_GERMAN_BELGIUM = _gdi_.LANGUAGE_GERMAN_BELGIUM
2466LANGUAGE_GERMAN_LIECHTENSTEIN = _gdi_.LANGUAGE_GERMAN_LIECHTENSTEIN
2467LANGUAGE_GERMAN_LUXEMBOURG = _gdi_.LANGUAGE_GERMAN_LUXEMBOURG
2468LANGUAGE_GERMAN_SWISS = _gdi_.LANGUAGE_GERMAN_SWISS
2469LANGUAGE_GREEK = _gdi_.LANGUAGE_GREEK
2470LANGUAGE_GREENLANDIC = _gdi_.LANGUAGE_GREENLANDIC
2471LANGUAGE_GUARANI = _gdi_.LANGUAGE_GUARANI
2472LANGUAGE_GUJARATI = _gdi_.LANGUAGE_GUJARATI
2473LANGUAGE_HAUSA = _gdi_.LANGUAGE_HAUSA
2474LANGUAGE_HEBREW = _gdi_.LANGUAGE_HEBREW
2475LANGUAGE_HINDI = _gdi_.LANGUAGE_HINDI
2476LANGUAGE_HUNGARIAN = _gdi_.LANGUAGE_HUNGARIAN
2477LANGUAGE_ICELANDIC = _gdi_.LANGUAGE_ICELANDIC
2478LANGUAGE_INDONESIAN = _gdi_.LANGUAGE_INDONESIAN
2479LANGUAGE_INTERLINGUA = _gdi_.LANGUAGE_INTERLINGUA
2480LANGUAGE_INTERLINGUE = _gdi_.LANGUAGE_INTERLINGUE
2481LANGUAGE_INUKTITUT = _gdi_.LANGUAGE_INUKTITUT
2482LANGUAGE_INUPIAK = _gdi_.LANGUAGE_INUPIAK
2483LANGUAGE_IRISH = _gdi_.LANGUAGE_IRISH
2484LANGUAGE_ITALIAN = _gdi_.LANGUAGE_ITALIAN
2485LANGUAGE_ITALIAN_SWISS = _gdi_.LANGUAGE_ITALIAN_SWISS
2486LANGUAGE_JAPANESE = _gdi_.LANGUAGE_JAPANESE
2487LANGUAGE_JAVANESE = _gdi_.LANGUAGE_JAVANESE
2488LANGUAGE_KANNADA = _gdi_.LANGUAGE_KANNADA
2489LANGUAGE_KASHMIRI = _gdi_.LANGUAGE_KASHMIRI
2490LANGUAGE_KASHMIRI_INDIA = _gdi_.LANGUAGE_KASHMIRI_INDIA
2491LANGUAGE_KAZAKH = _gdi_.LANGUAGE_KAZAKH
2492LANGUAGE_KERNEWEK = _gdi_.LANGUAGE_KERNEWEK
2493LANGUAGE_KINYARWANDA = _gdi_.LANGUAGE_KINYARWANDA
2494LANGUAGE_KIRGHIZ = _gdi_.LANGUAGE_KIRGHIZ
2495LANGUAGE_KIRUNDI = _gdi_.LANGUAGE_KIRUNDI
2496LANGUAGE_KONKANI = _gdi_.LANGUAGE_KONKANI
2497LANGUAGE_KOREAN = _gdi_.LANGUAGE_KOREAN
2498LANGUAGE_KURDISH = _gdi_.LANGUAGE_KURDISH
2499LANGUAGE_LAOTHIAN = _gdi_.LANGUAGE_LAOTHIAN
2500LANGUAGE_LATIN = _gdi_.LANGUAGE_LATIN
2501LANGUAGE_LATVIAN = _gdi_.LANGUAGE_LATVIAN
2502LANGUAGE_LINGALA = _gdi_.LANGUAGE_LINGALA
2503LANGUAGE_LITHUANIAN = _gdi_.LANGUAGE_LITHUANIAN
2504LANGUAGE_MACEDONIAN = _gdi_.LANGUAGE_MACEDONIAN
2505LANGUAGE_MALAGASY = _gdi_.LANGUAGE_MALAGASY
2506LANGUAGE_MALAY = _gdi_.LANGUAGE_MALAY
2507LANGUAGE_MALAYALAM = _gdi_.LANGUAGE_MALAYALAM
2508LANGUAGE_MALAY_BRUNEI_DARUSSALAM = _gdi_.LANGUAGE_MALAY_BRUNEI_DARUSSALAM
2509LANGUAGE_MALAY_MALAYSIA = _gdi_.LANGUAGE_MALAY_MALAYSIA
2510LANGUAGE_MALTESE = _gdi_.LANGUAGE_MALTESE
2511LANGUAGE_MANIPURI = _gdi_.LANGUAGE_MANIPURI
2512LANGUAGE_MAORI = _gdi_.LANGUAGE_MAORI
2513LANGUAGE_MARATHI = _gdi_.LANGUAGE_MARATHI
2514LANGUAGE_MOLDAVIAN = _gdi_.LANGUAGE_MOLDAVIAN
2515LANGUAGE_MONGOLIAN = _gdi_.LANGUAGE_MONGOLIAN
2516LANGUAGE_NAURU = _gdi_.LANGUAGE_NAURU
2517LANGUAGE_NEPALI = _gdi_.LANGUAGE_NEPALI
2518LANGUAGE_NEPALI_INDIA = _gdi_.LANGUAGE_NEPALI_INDIA
2519LANGUAGE_NORWEGIAN_BOKMAL = _gdi_.LANGUAGE_NORWEGIAN_BOKMAL
2520LANGUAGE_NORWEGIAN_NYNORSK = _gdi_.LANGUAGE_NORWEGIAN_NYNORSK
2521LANGUAGE_OCCITAN = _gdi_.LANGUAGE_OCCITAN
2522LANGUAGE_ORIYA = _gdi_.LANGUAGE_ORIYA
2523LANGUAGE_OROMO = _gdi_.LANGUAGE_OROMO
2524LANGUAGE_PASHTO = _gdi_.LANGUAGE_PASHTO
2525LANGUAGE_POLISH = _gdi_.LANGUAGE_POLISH
2526LANGUAGE_PORTUGUESE = _gdi_.LANGUAGE_PORTUGUESE
2527LANGUAGE_PORTUGUESE_BRAZILIAN = _gdi_.LANGUAGE_PORTUGUESE_BRAZILIAN
2528LANGUAGE_PUNJABI = _gdi_.LANGUAGE_PUNJABI
2529LANGUAGE_QUECHUA = _gdi_.LANGUAGE_QUECHUA
2530LANGUAGE_RHAETO_ROMANCE = _gdi_.LANGUAGE_RHAETO_ROMANCE
2531LANGUAGE_ROMANIAN = _gdi_.LANGUAGE_ROMANIAN
2532LANGUAGE_RUSSIAN = _gdi_.LANGUAGE_RUSSIAN
2533LANGUAGE_RUSSIAN_UKRAINE = _gdi_.LANGUAGE_RUSSIAN_UKRAINE
2534LANGUAGE_SAMOAN = _gdi_.LANGUAGE_SAMOAN
2535LANGUAGE_SANGHO = _gdi_.LANGUAGE_SANGHO
2536LANGUAGE_SANSKRIT = _gdi_.LANGUAGE_SANSKRIT
2537LANGUAGE_SCOTS_GAELIC = _gdi_.LANGUAGE_SCOTS_GAELIC
2538LANGUAGE_SERBIAN = _gdi_.LANGUAGE_SERBIAN
2539LANGUAGE_SERBIAN_CYRILLIC = _gdi_.LANGUAGE_SERBIAN_CYRILLIC
2540LANGUAGE_SERBIAN_LATIN = _gdi_.LANGUAGE_SERBIAN_LATIN
2541LANGUAGE_SERBO_CROATIAN = _gdi_.LANGUAGE_SERBO_CROATIAN
2542LANGUAGE_SESOTHO = _gdi_.LANGUAGE_SESOTHO
2543LANGUAGE_SETSWANA = _gdi_.LANGUAGE_SETSWANA
2544LANGUAGE_SHONA = _gdi_.LANGUAGE_SHONA
2545LANGUAGE_SINDHI = _gdi_.LANGUAGE_SINDHI
2546LANGUAGE_SINHALESE = _gdi_.LANGUAGE_SINHALESE
2547LANGUAGE_SISWATI = _gdi_.LANGUAGE_SISWATI
2548LANGUAGE_SLOVAK = _gdi_.LANGUAGE_SLOVAK
2549LANGUAGE_SLOVENIAN = _gdi_.LANGUAGE_SLOVENIAN
2550LANGUAGE_SOMALI = _gdi_.LANGUAGE_SOMALI
2551LANGUAGE_SPANISH = _gdi_.LANGUAGE_SPANISH
2552LANGUAGE_SPANISH_ARGENTINA = _gdi_.LANGUAGE_SPANISH_ARGENTINA
2553LANGUAGE_SPANISH_BOLIVIA = _gdi_.LANGUAGE_SPANISH_BOLIVIA
2554LANGUAGE_SPANISH_CHILE = _gdi_.LANGUAGE_SPANISH_CHILE
2555LANGUAGE_SPANISH_COLOMBIA = _gdi_.LANGUAGE_SPANISH_COLOMBIA
2556LANGUAGE_SPANISH_COSTA_RICA = _gdi_.LANGUAGE_SPANISH_COSTA_RICA
2557LANGUAGE_SPANISH_DOMINICAN_REPUBLIC = _gdi_.LANGUAGE_SPANISH_DOMINICAN_REPUBLIC
2558LANGUAGE_SPANISH_ECUADOR = _gdi_.LANGUAGE_SPANISH_ECUADOR
2559LANGUAGE_SPANISH_EL_SALVADOR = _gdi_.LANGUAGE_SPANISH_EL_SALVADOR
2560LANGUAGE_SPANISH_GUATEMALA = _gdi_.LANGUAGE_SPANISH_GUATEMALA
2561LANGUAGE_SPANISH_HONDURAS = _gdi_.LANGUAGE_SPANISH_HONDURAS
2562LANGUAGE_SPANISH_MEXICAN = _gdi_.LANGUAGE_SPANISH_MEXICAN
2563LANGUAGE_SPANISH_MODERN = _gdi_.LANGUAGE_SPANISH_MODERN
2564LANGUAGE_SPANISH_NICARAGUA = _gdi_.LANGUAGE_SPANISH_NICARAGUA
2565LANGUAGE_SPANISH_PANAMA = _gdi_.LANGUAGE_SPANISH_PANAMA
2566LANGUAGE_SPANISH_PARAGUAY = _gdi_.LANGUAGE_SPANISH_PARAGUAY
2567LANGUAGE_SPANISH_PERU = _gdi_.LANGUAGE_SPANISH_PERU
2568LANGUAGE_SPANISH_PUERTO_RICO = _gdi_.LANGUAGE_SPANISH_PUERTO_RICO
2569LANGUAGE_SPANISH_URUGUAY = _gdi_.LANGUAGE_SPANISH_URUGUAY
2570LANGUAGE_SPANISH_US = _gdi_.LANGUAGE_SPANISH_US
2571LANGUAGE_SPANISH_VENEZUELA = _gdi_.LANGUAGE_SPANISH_VENEZUELA
2572LANGUAGE_SUNDANESE = _gdi_.LANGUAGE_SUNDANESE
2573LANGUAGE_SWAHILI = _gdi_.LANGUAGE_SWAHILI
2574LANGUAGE_SWEDISH = _gdi_.LANGUAGE_SWEDISH
2575LANGUAGE_SWEDISH_FINLAND = _gdi_.LANGUAGE_SWEDISH_FINLAND
2576LANGUAGE_TAGALOG = _gdi_.LANGUAGE_TAGALOG
2577LANGUAGE_TAJIK = _gdi_.LANGUAGE_TAJIK
2578LANGUAGE_TAMIL = _gdi_.LANGUAGE_TAMIL
2579LANGUAGE_TATAR = _gdi_.LANGUAGE_TATAR
2580LANGUAGE_TELUGU = _gdi_.LANGUAGE_TELUGU
2581LANGUAGE_THAI = _gdi_.LANGUAGE_THAI
2582LANGUAGE_TIBETAN = _gdi_.LANGUAGE_TIBETAN
2583LANGUAGE_TIGRINYA = _gdi_.LANGUAGE_TIGRINYA
2584LANGUAGE_TONGA = _gdi_.LANGUAGE_TONGA
2585LANGUAGE_TSONGA = _gdi_.LANGUAGE_TSONGA
2586LANGUAGE_TURKISH = _gdi_.LANGUAGE_TURKISH
2587LANGUAGE_TURKMEN = _gdi_.LANGUAGE_TURKMEN
2588LANGUAGE_TWI = _gdi_.LANGUAGE_TWI
2589LANGUAGE_UIGHUR = _gdi_.LANGUAGE_UIGHUR
2590LANGUAGE_UKRAINIAN = _gdi_.LANGUAGE_UKRAINIAN
2591LANGUAGE_URDU = _gdi_.LANGUAGE_URDU
2592LANGUAGE_URDU_INDIA = _gdi_.LANGUAGE_URDU_INDIA
2593LANGUAGE_URDU_PAKISTAN = _gdi_.LANGUAGE_URDU_PAKISTAN
2594LANGUAGE_UZBEK = _gdi_.LANGUAGE_UZBEK
2595LANGUAGE_UZBEK_CYRILLIC = _gdi_.LANGUAGE_UZBEK_CYRILLIC
2596LANGUAGE_UZBEK_LATIN = _gdi_.LANGUAGE_UZBEK_LATIN
2597LANGUAGE_VIETNAMESE = _gdi_.LANGUAGE_VIETNAMESE
2598LANGUAGE_VOLAPUK = _gdi_.LANGUAGE_VOLAPUK
2599LANGUAGE_WELSH = _gdi_.LANGUAGE_WELSH
2600LANGUAGE_WOLOF = _gdi_.LANGUAGE_WOLOF
2601LANGUAGE_XHOSA = _gdi_.LANGUAGE_XHOSA
2602LANGUAGE_YIDDISH = _gdi_.LANGUAGE_YIDDISH
2603LANGUAGE_YORUBA = _gdi_.LANGUAGE_YORUBA
2604LANGUAGE_ZHUANG = _gdi_.LANGUAGE_ZHUANG
2605LANGUAGE_ZULU = _gdi_.LANGUAGE_ZULU
2606LANGUAGE_USER_DEFINED = _gdi_.LANGUAGE_USER_DEFINED
2607class LanguageInfo(object):
36ed4f51 2608 """Proxy of C++ LanguageInfo class"""
1bd55598
RD
2609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2610 def __init__(self): raise AttributeError, "No constructor defined"
2611 __repr__ = _swig_repr
d55e5bfc
RD
2612 Language = property(_gdi_.LanguageInfo_Language_get, _gdi_.LanguageInfo_Language_set)
2613 CanonicalName = property(_gdi_.LanguageInfo_CanonicalName_get, _gdi_.LanguageInfo_CanonicalName_set)
2614 Description = property(_gdi_.LanguageInfo_Description_get, _gdi_.LanguageInfo_Description_set)
2131d850 2615_gdi_.LanguageInfo_swigregister(LanguageInfo)
d55e5bfc
RD
2616
2617LOCALE_CAT_NUMBER = _gdi_.LOCALE_CAT_NUMBER
2618LOCALE_CAT_DATE = _gdi_.LOCALE_CAT_DATE
2619LOCALE_CAT_MONEY = _gdi_.LOCALE_CAT_MONEY
2620LOCALE_CAT_MAX = _gdi_.LOCALE_CAT_MAX
2621LOCALE_THOUSANDS_SEP = _gdi_.LOCALE_THOUSANDS_SEP
2622LOCALE_DECIMAL_POINT = _gdi_.LOCALE_DECIMAL_POINT
2623LOCALE_LOAD_DEFAULT = _gdi_.LOCALE_LOAD_DEFAULT
2624LOCALE_CONV_ENCODING = _gdi_.LOCALE_CONV_ENCODING
2625class Locale(object):
36ed4f51 2626 """Proxy of C++ Locale class"""
1bd55598
RD
2627 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2628 __repr__ = _swig_repr
2629 def __init__(self, *args, **kwargs):
15817c7e 2630 """__init__(self, int language=-1, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> Locale"""
1bd55598
RD
2631 _gdi_.Locale_swiginit(self,_gdi_.new_Locale(*args, **kwargs))
2632 __swig_destroy__ = _gdi_.delete_Locale
2633 __del__ = lambda self : None;
d55e5bfc
RD
2634 def Init1(*args, **kwargs):
2635 """
2636 Init1(self, String szName, String szShort=EmptyString, String szLocale=EmptyString,
2637 bool bLoadDefault=True,
2638 bool bConvertEncoding=False) -> bool
2639 """
2640 return _gdi_.Locale_Init1(*args, **kwargs)
2641
2642 def Init2(*args, **kwargs):
2643 """Init2(self, int language=LANGUAGE_DEFAULT, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> bool"""
2644 return _gdi_.Locale_Init2(*args, **kwargs)
2645
2646 def Init(self, *_args, **_kwargs):
2647 if type(_args[0]) in [type(''), type(u'')]:
2648 val = self.Init1(*_args, **_kwargs)
2649 else:
2650 val = self.Init2(*_args, **_kwargs)
2651 return val
2652
2653 def GetSystemLanguage(*args, **kwargs):
d6c14a4c 2654 """GetSystemLanguage() -> int"""
d55e5bfc
RD
2655 return _gdi_.Locale_GetSystemLanguage(*args, **kwargs)
2656
2657 GetSystemLanguage = staticmethod(GetSystemLanguage)
2658 def GetSystemEncoding(*args, **kwargs):
d6c14a4c 2659 """GetSystemEncoding() -> int"""
d55e5bfc
RD
2660 return _gdi_.Locale_GetSystemEncoding(*args, **kwargs)
2661
2662 GetSystemEncoding = staticmethod(GetSystemEncoding)
2663 def GetSystemEncodingName(*args, **kwargs):
d6c14a4c 2664 """GetSystemEncodingName() -> String"""
d55e5bfc
RD
2665 return _gdi_.Locale_GetSystemEncodingName(*args, **kwargs)
2666
2667 GetSystemEncodingName = staticmethod(GetSystemEncodingName)
2668 def IsOk(*args, **kwargs):
2669 """IsOk(self) -> bool"""
2670 return _gdi_.Locale_IsOk(*args, **kwargs)
2671
2672 def __nonzero__(self): return self.IsOk()
2673 def GetLocale(*args, **kwargs):
2674 """GetLocale(self) -> String"""
2675 return _gdi_.Locale_GetLocale(*args, **kwargs)
2676
2677 def GetLanguage(*args, **kwargs):
2678 """GetLanguage(self) -> int"""
2679 return _gdi_.Locale_GetLanguage(*args, **kwargs)
2680
2681 def GetSysName(*args, **kwargs):
2682 """GetSysName(self) -> String"""
2683 return _gdi_.Locale_GetSysName(*args, **kwargs)
2684
2685 def GetCanonicalName(*args, **kwargs):
2686 """GetCanonicalName(self) -> String"""
2687 return _gdi_.Locale_GetCanonicalName(*args, **kwargs)
2688
2689 def AddCatalogLookupPathPrefix(*args, **kwargs):
d6c14a4c 2690 """AddCatalogLookupPathPrefix(String prefix)"""
d55e5bfc
RD
2691 return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs)
2692
2693 AddCatalogLookupPathPrefix = staticmethod(AddCatalogLookupPathPrefix)
2694 def AddCatalog(*args, **kwargs):
2695 """AddCatalog(self, String szDomain) -> bool"""
2696 return _gdi_.Locale_AddCatalog(*args, **kwargs)
2697
33d6fd3b
RD
2698 def IsAvailable(*args, **kwargs):
2699 """IsAvailable(int lang) -> bool"""
2700 return _gdi_.Locale_IsAvailable(*args, **kwargs)
2701
2702 IsAvailable = staticmethod(IsAvailable)
d55e5bfc
RD
2703 def IsLoaded(*args, **kwargs):
2704 """IsLoaded(self, String szDomain) -> bool"""
2705 return _gdi_.Locale_IsLoaded(*args, **kwargs)
2706
2707 def GetLanguageInfo(*args, **kwargs):
d6c14a4c 2708 """GetLanguageInfo(int lang) -> LanguageInfo"""
d55e5bfc
RD
2709 return _gdi_.Locale_GetLanguageInfo(*args, **kwargs)
2710
2711 GetLanguageInfo = staticmethod(GetLanguageInfo)
2712 def GetLanguageName(*args, **kwargs):
d6c14a4c 2713 """GetLanguageName(int lang) -> String"""
d55e5bfc
RD
2714 return _gdi_.Locale_GetLanguageName(*args, **kwargs)
2715
2716 GetLanguageName = staticmethod(GetLanguageName)
2717 def FindLanguageInfo(*args, **kwargs):
d6c14a4c 2718 """FindLanguageInfo(String locale) -> LanguageInfo"""
d55e5bfc
RD
2719 return _gdi_.Locale_FindLanguageInfo(*args, **kwargs)
2720
2721 FindLanguageInfo = staticmethod(FindLanguageInfo)
2722 def AddLanguage(*args, **kwargs):
d6c14a4c 2723 """AddLanguage(LanguageInfo info)"""
d55e5bfc
RD
2724 return _gdi_.Locale_AddLanguage(*args, **kwargs)
2725
2726 AddLanguage = staticmethod(AddLanguage)
2727 def GetString(*args, **kwargs):
2728 """GetString(self, String szOrigString, String szDomain=EmptyString) -> String"""
2729 return _gdi_.Locale_GetString(*args, **kwargs)
2730
2731 def GetName(*args, **kwargs):
2732 """GetName(self) -> String"""
2733 return _gdi_.Locale_GetName(*args, **kwargs)
2734
ac5d357a
RD
2735 CanonicalName = property(GetCanonicalName,doc="See `GetCanonicalName`")
2736 Language = property(GetLanguage,doc="See `GetLanguage`")
2737 Locale = property(GetLocale,doc="See `GetLocale`")
2738 Name = property(GetName,doc="See `GetName`")
2739 String = property(GetString,doc="See `GetString`")
2740 SysName = property(GetSysName,doc="See `GetSysName`")
2131d850 2741_gdi_.Locale_swigregister(Locale)
d55e5bfc 2742
1bd55598
RD
2743def Locale_GetSystemLanguage(*args):
2744 """Locale_GetSystemLanguage() -> int"""
2745 return _gdi_.Locale_GetSystemLanguage(*args)
d55e5bfc 2746
1bd55598
RD
2747def Locale_GetSystemEncoding(*args):
2748 """Locale_GetSystemEncoding() -> int"""
2749 return _gdi_.Locale_GetSystemEncoding(*args)
d55e5bfc 2750
1bd55598
RD
2751def Locale_GetSystemEncodingName(*args):
2752 """Locale_GetSystemEncodingName() -> String"""
2753 return _gdi_.Locale_GetSystemEncodingName(*args)
d55e5bfc
RD
2754
2755def Locale_AddCatalogLookupPathPrefix(*args, **kwargs):
1bd55598
RD
2756 """Locale_AddCatalogLookupPathPrefix(String prefix)"""
2757 return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs)
d55e5bfc 2758
33d6fd3b
RD
2759def Locale_IsAvailable(*args, **kwargs):
2760 """Locale_IsAvailable(int lang) -> bool"""
2761 return _gdi_.Locale_IsAvailable(*args, **kwargs)
2762
d55e5bfc 2763def Locale_GetLanguageInfo(*args, **kwargs):
1bd55598
RD
2764 """Locale_GetLanguageInfo(int lang) -> LanguageInfo"""
2765 return _gdi_.Locale_GetLanguageInfo(*args, **kwargs)
d55e5bfc
RD
2766
2767def Locale_GetLanguageName(*args, **kwargs):
1bd55598
RD
2768 """Locale_GetLanguageName(int lang) -> String"""
2769 return _gdi_.Locale_GetLanguageName(*args, **kwargs)
d55e5bfc
RD
2770
2771def Locale_FindLanguageInfo(*args, **kwargs):
1bd55598
RD
2772 """Locale_FindLanguageInfo(String locale) -> LanguageInfo"""
2773 return _gdi_.Locale_FindLanguageInfo(*args, **kwargs)
d55e5bfc
RD
2774
2775def Locale_AddLanguage(*args, **kwargs):
1bd55598
RD
2776 """Locale_AddLanguage(LanguageInfo info)"""
2777 return _gdi_.Locale_AddLanguage(*args, **kwargs)
d55e5bfc 2778
fc46b7f3
RD
2779class PyLocale(Locale):
2780 """Proxy of C++ PyLocale class"""
2781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2782 __repr__ = _swig_repr
2783 def __init__(self, *args, **kwargs):
2784 """__init__(self, int language=-1, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> PyLocale"""
2785 _gdi_.PyLocale_swiginit(self,_gdi_.new_PyLocale(*args, **kwargs))
c25f90f6 2786 PyLocale._setCallbackInfo(self, self, PyLocale)
fc46b7f3
RD
2787
2788 __swig_destroy__ = _gdi_.delete_PyLocale
2789 __del__ = lambda self : None;
2790 def _setCallbackInfo(*args, **kwargs):
2791 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2792 return _gdi_.PyLocale__setCallbackInfo(*args, **kwargs)
2793
2794 def GetSingularString(*args, **kwargs):
2795 """GetSingularString(self, wxChar szOrigString, wxChar szDomain=None) -> wxChar"""
2796 return _gdi_.PyLocale_GetSingularString(*args, **kwargs)
2797
2798 def GetPluralString(*args, **kwargs):
2799 """
2800 GetPluralString(self, wxChar szOrigString, wxChar szOrigString2, size_t n,
2801 wxChar szDomain=None) -> wxChar
2802 """
2803 return _gdi_.PyLocale_GetPluralString(*args, **kwargs)
2804
2805_gdi_.PyLocale_swigregister(PyLocale)
2806
d55e5bfc 2807
1bd55598
RD
2808def GetLocale(*args):
2809 """GetLocale() -> Locale"""
2810 return _gdi_.GetLocale(*args)
d55e5bfc
RD
2811#---------------------------------------------------------------------------
2812
2813CONVERT_STRICT = _gdi_.CONVERT_STRICT
2814CONVERT_SUBSTITUTE = _gdi_.CONVERT_SUBSTITUTE
2815PLATFORM_CURRENT = _gdi_.PLATFORM_CURRENT
2816PLATFORM_UNIX = _gdi_.PLATFORM_UNIX
2817PLATFORM_WINDOWS = _gdi_.PLATFORM_WINDOWS
2818PLATFORM_OS2 = _gdi_.PLATFORM_OS2
2819PLATFORM_MAC = _gdi_.PLATFORM_MAC
2820class EncodingConverter(_core.Object):
36ed4f51 2821 """Proxy of C++ EncodingConverter class"""
1bd55598
RD
2822 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2823 __repr__ = _swig_repr
2824 def __init__(self, *args, **kwargs):
d55e5bfc 2825 """__init__(self) -> EncodingConverter"""
1bd55598
RD
2826 _gdi_.EncodingConverter_swiginit(self,_gdi_.new_EncodingConverter(*args, **kwargs))
2827 __swig_destroy__ = _gdi_.delete_EncodingConverter
2828 __del__ = lambda self : None;
d55e5bfc
RD
2829 def Init(*args, **kwargs):
2830 """Init(self, int input_enc, int output_enc, int method=CONVERT_STRICT) -> bool"""
2831 return _gdi_.EncodingConverter_Init(*args, **kwargs)
2832
2833 def Convert(*args, **kwargs):
2834 """Convert(self, String input) -> String"""
2835 return _gdi_.EncodingConverter_Convert(*args, **kwargs)
2836
2837 def GetPlatformEquivalents(*args, **kwargs):
d6c14a4c 2838 """GetPlatformEquivalents(int enc, int platform=PLATFORM_CURRENT) -> wxFontEncodingArray"""
d55e5bfc
RD
2839 return _gdi_.EncodingConverter_GetPlatformEquivalents(*args, **kwargs)
2840
2841 GetPlatformEquivalents = staticmethod(GetPlatformEquivalents)
2842 def GetAllEquivalents(*args, **kwargs):
d6c14a4c 2843 """GetAllEquivalents(int enc) -> wxFontEncodingArray"""
d55e5bfc
RD
2844 return _gdi_.EncodingConverter_GetAllEquivalents(*args, **kwargs)
2845
2846 GetAllEquivalents = staticmethod(GetAllEquivalents)
2847 def CanConvert(*args, **kwargs):
d6c14a4c 2848 """CanConvert(int encIn, int encOut) -> bool"""
d55e5bfc
RD
2849 return _gdi_.EncodingConverter_CanConvert(*args, **kwargs)
2850
2851 CanConvert = staticmethod(CanConvert)
2852 def __nonzero__(self): return self.IsOk()
2131d850 2853_gdi_.EncodingConverter_swigregister(EncodingConverter)
d55e5bfc
RD
2854
2855def GetTranslation(*args):
1bd55598 2856 """
d55e5bfc 2857 GetTranslation(String str) -> String
fc46b7f3 2858 GetTranslation(String str, String domain) -> String
d55e5bfc 2859 GetTranslation(String str, String strPlural, size_t n) -> String
fc46b7f3 2860 GetTranslation(String str, String strPlural, size_t n, String domain) -> String
d55e5bfc 2861 """
1bd55598 2862 return _gdi_.GetTranslation(*args)
d55e5bfc
RD
2863
2864def EncodingConverter_GetPlatformEquivalents(*args, **kwargs):
1bd55598
RD
2865 """EncodingConverter_GetPlatformEquivalents(int enc, int platform=PLATFORM_CURRENT) -> wxFontEncodingArray"""
2866 return _gdi_.EncodingConverter_GetPlatformEquivalents(*args, **kwargs)
d55e5bfc
RD
2867
2868def EncodingConverter_GetAllEquivalents(*args, **kwargs):
1bd55598
RD
2869 """EncodingConverter_GetAllEquivalents(int enc) -> wxFontEncodingArray"""
2870 return _gdi_.EncodingConverter_GetAllEquivalents(*args, **kwargs)
d55e5bfc
RD
2871
2872def EncodingConverter_CanConvert(*args, **kwargs):
1bd55598
RD
2873 """EncodingConverter_CanConvert(int encIn, int encOut) -> bool"""
2874 return _gdi_.EncodingConverter_CanConvert(*args, **kwargs)
d55e5bfc
RD
2875
2876#----------------------------------------------------------------------------
68e533f8 2877# On MSW add the directory where the wxWidgets catalogs were installed
d55e5bfc
RD
2878# to the default catalog path.
2879if wx.Platform == "__WXMSW__":
2880 import os
c2829a8f 2881 _localedir = os.path.join(os.path.split(__file__)[0], "locale")
8fb0e70a 2882 Locale.AddCatalogLookupPathPrefix(_localedir)
d55e5bfc
RD
2883 del os
2884
2885#----------------------------------------------------------------------------
2886
2887#---------------------------------------------------------------------------
2888
2889class DC(_core.Object):
f5b96ee1
RD
2890 """
2891 A wx.DC is a device context onto which graphics and text can be
2892 drawn. It is intended to represent a number of output devices in a
2893 generic way, so a window can have a device context associated with it,
2894 and a printer also has a device context. In this way, the same piece
2895 of code may write to a number of different devices, if the device
2896 context is used as a parameter.
2897
2898 Derived types of wxDC have documentation for specific features only,
2899 so refer to this section for most device context information.
2900
2901 The wx.DC class is abstract and can not be instantiated, you must use
2902 one of the derived classes instead. Which one will depend on the
2903 situation in which it is used.
2904 """
1bd55598
RD
2905 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2906 def __init__(self): raise AttributeError, "No constructor defined"
2907 __repr__ = _swig_repr
2908 __swig_destroy__ = _gdi_.delete_DC
2909 __del__ = lambda self : None;
7f7aa166
RD
2910 # These have been deprecated in wxWidgets. Since they never
2911 # really did anything to begin with, just make them be NOPs.
2912 def BeginDrawing(self): pass
2913 def EndDrawing(self): pass
d55e5bfc 2914
d55e5bfc 2915 def FloodFill(*args, **kwargs):
f5b96ee1
RD
2916 """
2917 FloodFill(self, int x, int y, Colour col, int style=FLOOD_SURFACE) -> bool
2918
2919 Flood fills the device context starting from the given point, using
2920 the current brush colour, and using a style:
2921
2922 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
2923 the given colour is encountered.
2924
2925 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
2926 colour.
2927
2928 Returns False if the operation failed.
2929
2930 Note: The present implementation for non-Windows platforms may fail to
2931 find colour borders if the pixels do not match the colour
2932 exactly. However the function will still return true.
2933 """
d55e5bfc
RD
2934 return _gdi_.DC_FloodFill(*args, **kwargs)
2935
d6c14a4c 2936 def FloodFillPoint(*args, **kwargs):
f5b96ee1
RD
2937 """
2938 FloodFillPoint(self, Point pt, Colour col, int style=FLOOD_SURFACE) -> bool
2939
2940 Flood fills the device context starting from the given point, using
2941 the current brush colour, and using a style:
2942
2943 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
2944 the given colour is encountered.
2945
2946 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
2947 colour.
2948
2949 Returns False if the operation failed.
2950
2951 Note: The present implementation for non-Windows platforms may fail to
2952 find colour borders if the pixels do not match the colour
2953 exactly. However the function will still return true.
2954 """
d6c14a4c 2955 return _gdi_.DC_FloodFillPoint(*args, **kwargs)
d55e5bfc 2956
b1fcee84
RD
2957 def GradientFillConcentric(*args, **kwargs):
2958 """
2959 GradientFillConcentric(self, Rect rect, Colour initialColour, Colour destColour,
2960 Point circleCenter)
2961
2962 Fill the area specified by rect with a radial gradient, starting from
2963 initialColour in the center of the circle and fading to destColour on
2964 the outside of the circle. The circleCenter argument is the relative
2965 coordinants of the center of the circle in the specified rect.
2966
2967 Note: Currently this function is very slow, don't use it for real-time
2968 drawing.
2969 """
2970 return _gdi_.DC_GradientFillConcentric(*args, **kwargs)
2971
2972 def GradientFillLinear(*args, **kwargs):
2973 """
2974 GradientFillLinear(self, Rect rect, Colour initialColour, Colour destColour,
2975 int nDirection=EAST)
2976
2977 Fill the area specified by rect with a linear gradient, starting from
2978 initialColour and eventually fading to destColour. The nDirection
2979 parameter specifies the direction of the colour change, default is to
2980 use initialColour on the left part of the rectangle and destColour on
2981 the right side.
2982 """
2983 return _gdi_.DC_GradientFillLinear(*args, **kwargs)
2984
d55e5bfc 2985 def GetPixel(*args, **kwargs):
f5b96ee1
RD
2986 """
2987 GetPixel(self, int x, int y) -> Colour
2988
2989 Gets the colour at the specified location on the DC.
2990 """
d55e5bfc
RD
2991 return _gdi_.DC_GetPixel(*args, **kwargs)
2992
d6c14a4c
RD
2993 def GetPixelPoint(*args, **kwargs):
2994 """GetPixelPoint(self, Point pt) -> Colour"""
2995 return _gdi_.DC_GetPixelPoint(*args, **kwargs)
d55e5bfc
RD
2996
2997 def DrawLine(*args, **kwargs):
f5b96ee1
RD
2998 """
2999 DrawLine(self, int x1, int y1, int x2, int y2)
3000
3001 Draws a line from the first point to the second. The current pen is
3002 used for drawing the line. Note that the second point is *not* part of
3003 the line and is not drawn by this function (this is consistent with
3004 the behaviour of many other toolkits).
3005 """
d55e5bfc
RD
3006 return _gdi_.DC_DrawLine(*args, **kwargs)
3007
d6c14a4c 3008 def DrawLinePoint(*args, **kwargs):
f5b96ee1
RD
3009 """
3010 DrawLinePoint(self, Point pt1, Point pt2)
3011
3012 Draws a line from the first point to the second. The current pen is
3013 used for drawing the line. Note that the second point is *not* part of
3014 the line and is not drawn by this function (this is consistent with
3015 the behaviour of many other toolkits).
3016 """
d6c14a4c 3017 return _gdi_.DC_DrawLinePoint(*args, **kwargs)
d55e5bfc
RD
3018
3019 def CrossHair(*args, **kwargs):
f5b96ee1
RD
3020 """
3021 CrossHair(self, int x, int y)
3022
3023 Displays a cross hair using the current pen. This is a vertical and
3024 horizontal line the height and width of the window, centred on the
3025 given point.
3026 """
d55e5bfc
RD
3027 return _gdi_.DC_CrossHair(*args, **kwargs)
3028
d6c14a4c 3029 def CrossHairPoint(*args, **kwargs):
f5b96ee1
RD
3030 """
3031 CrossHairPoint(self, Point pt)
3032
3033 Displays a cross hair using the current pen. This is a vertical and
3034 horizontal line the height and width of the window, centred on the
3035 given point.
3036 """
d6c14a4c 3037 return _gdi_.DC_CrossHairPoint(*args, **kwargs)
d55e5bfc
RD
3038
3039 def DrawArc(*args, **kwargs):
f5b96ee1
RD
3040 """
3041 DrawArc(self, int x1, int y1, int x2, int y2, int xc, int yc)
3042
3043 Draws an arc of a circle, centred on the *center* point (xc, yc), from
3044 the first point to the second. The current pen is used for the outline
3045 and the current brush for filling the shape.
3046
3047 The arc is drawn in an anticlockwise direction from the start point to
3048 the end point.
3049 """
d55e5bfc
RD
3050 return _gdi_.DC_DrawArc(*args, **kwargs)
3051
d6c14a4c 3052 def DrawArcPoint(*args, **kwargs):
f5b96ee1
RD
3053 """
3054 DrawArcPoint(self, Point pt1, Point pt2, Point center)
3055
3056 Draws an arc of a circle, centred on the *center* point (xc, yc), from
3057 the first point to the second. The current pen is used for the outline
3058 and the current brush for filling the shape.
3059
3060 The arc is drawn in an anticlockwise direction from the start point to
3061 the end point.
3062 """
d6c14a4c 3063 return _gdi_.DC_DrawArcPoint(*args, **kwargs)
d55e5bfc
RD
3064
3065 def DrawCheckMark(*args, **kwargs):
f5b96ee1
RD
3066 """
3067 DrawCheckMark(self, int x, int y, int width, int height)
3068
3069 Draws a check mark inside the given rectangle.
3070 """
d55e5bfc
RD
3071 return _gdi_.DC_DrawCheckMark(*args, **kwargs)
3072
d6c14a4c 3073 def DrawCheckMarkRect(*args, **kwargs):
f5b96ee1
RD
3074 """
3075 DrawCheckMarkRect(self, Rect rect)
3076
3077 Draws a check mark inside the given rectangle.
3078 """
d6c14a4c 3079 return _gdi_.DC_DrawCheckMarkRect(*args, **kwargs)
d55e5bfc
RD
3080
3081 def DrawEllipticArc(*args, **kwargs):
f5b96ee1
RD
3082 """
3083 DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
3084
3085 Draws an arc of an ellipse, with the given rectangle defining the
3086 bounds of the ellipse. The current pen is used for drawing the arc and
3087 the current brush is used for drawing the pie.
3088
3089 The *start* and *end* parameters specify the start and end of the arc
3090 relative to the three-o'clock position from the center of the
3091 rectangle. Angles are specified in degrees (360 is a complete
3092 circle). Positive values mean counter-clockwise motion. If start is
3093 equal to end, a complete ellipse will be drawn.
3094 """
d55e5bfc
RD
3095 return _gdi_.DC_DrawEllipticArc(*args, **kwargs)
3096
d6c14a4c 3097 def DrawEllipticArcPointSize(*args, **kwargs):
f5b96ee1
RD
3098 """
3099 DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end)
3100
3101 Draws an arc of an ellipse, with the given rectangle defining the
3102 bounds of the ellipse. The current pen is used for drawing the arc and
3103 the current brush is used for drawing the pie.
3104
3105 The *start* and *end* parameters specify the start and end of the arc
3106 relative to the three-o'clock position from the center of the
3107 rectangle. Angles are specified in degrees (360 is a complete
3108 circle). Positive values mean counter-clockwise motion. If start is
3109 equal to end, a complete ellipse will be drawn.
3110 """
d6c14a4c 3111 return _gdi_.DC_DrawEllipticArcPointSize(*args, **kwargs)
d55e5bfc
RD
3112
3113 def DrawPoint(*args, **kwargs):
f5b96ee1
RD
3114 """
3115 DrawPoint(self, int x, int y)
3116
3117 Draws a point using the current pen.
3118 """
d55e5bfc
RD
3119 return _gdi_.DC_DrawPoint(*args, **kwargs)
3120
d6c14a4c 3121 def DrawPointPoint(*args, **kwargs):
f5b96ee1
RD
3122 """
3123 DrawPointPoint(self, Point pt)
3124
3125 Draws a point using the current pen.
3126 """
d6c14a4c 3127 return _gdi_.DC_DrawPointPoint(*args, **kwargs)
d55e5bfc
RD
3128
3129 def DrawRectangle(*args, **kwargs):
f5b96ee1
RD
3130 """
3131 DrawRectangle(self, int x, int y, int width, int height)
3132
3133 Draws a rectangle with the given top left corner, and with the given
3134 size. The current pen is used for the outline and the current brush
3135 for filling the shape.
3136 """
d55e5bfc
RD
3137 return _gdi_.DC_DrawRectangle(*args, **kwargs)
3138
3139 def DrawRectangleRect(*args, **kwargs):
f5b96ee1
RD
3140 """
3141 DrawRectangleRect(self, Rect rect)
3142
3143 Draws a rectangle with the given top left corner, and with the given
3144 size. The current pen is used for the outline and the current brush
3145 for filling the shape.
3146 """
d55e5bfc
RD
3147 return _gdi_.DC_DrawRectangleRect(*args, **kwargs)
3148
d6c14a4c 3149 def DrawRectanglePointSize(*args, **kwargs):
f5b96ee1
RD
3150 """
3151 DrawRectanglePointSize(self, Point pt, Size sz)
3152
3153 Draws a rectangle with the given top left corner, and with the given
3154 size. The current pen is used for the outline and the current brush
3155 for filling the shape.
3156 """
d6c14a4c 3157 return _gdi_.DC_DrawRectanglePointSize(*args, **kwargs)
d55e5bfc
RD
3158
3159 def DrawRoundedRectangle(*args, **kwargs):
f5b96ee1
RD
3160 """
3161 DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
3162
3163 Draws a rectangle with the given top left corner, and with the given
3164 size. The corners are quarter-circles using the given radius. The
3165 current pen is used for the outline and the current brush for filling
3166 the shape.
3167
3168 If radius is positive, the value is assumed to be the radius of the
3169 rounded corner. If radius is negative, the absolute value is assumed
3170 to be the proportion of the smallest dimension of the rectangle. This
3171 means that the corner can be a sensible size relative to the size of
3172 the rectangle, and also avoids the strange effects X produces when the
3173 corners are too big for the rectangle.
3174 """
d55e5bfc
RD
3175 return _gdi_.DC_DrawRoundedRectangle(*args, **kwargs)
3176
3177 def DrawRoundedRectangleRect(*args, **kwargs):
f5b96ee1
RD
3178 """
3179 DrawRoundedRectangleRect(self, Rect r, double radius)
3180
3181 Draws a rectangle with the given top left corner, and with the given
3182 size. The corners are quarter-circles using the given radius. The
3183 current pen is used for the outline and the current brush for filling
3184 the shape.
3185
3186 If radius is positive, the value is assumed to be the radius of the
3187 rounded corner. If radius is negative, the absolute value is assumed
3188 to be the proportion of the smallest dimension of the rectangle. This
3189 means that the corner can be a sensible size relative to the size of
3190 the rectangle, and also avoids the strange effects X produces when the
3191 corners are too big for the rectangle.
3192 """
d55e5bfc
RD
3193 return _gdi_.DC_DrawRoundedRectangleRect(*args, **kwargs)
3194
d6c14a4c 3195 def DrawRoundedRectanglePointSize(*args, **kwargs):
f5b96ee1
RD
3196 """
3197 DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
3198
3199 Draws a rectangle with the given top left corner, and with the given
3200 size. The corners are quarter-circles using the given radius. The
3201 current pen is used for the outline and the current brush for filling
3202 the shape.
3203
3204 If radius is positive, the value is assumed to be the radius of the
3205 rounded corner. If radius is negative, the absolute value is assumed
3206 to be the proportion of the smallest dimension of the rectangle. This
3207 means that the corner can be a sensible size relative to the size of
3208 the rectangle, and also avoids the strange effects X produces when the
3209 corners are too big for the rectangle.
3210 """
d6c14a4c 3211 return _gdi_.DC_DrawRoundedRectanglePointSize(*args, **kwargs)
d55e5bfc
RD
3212
3213 def DrawCircle(*args, **kwargs):
f5b96ee1
RD
3214 """
3215 DrawCircle(self, int x, int y, int radius)
3216
3217 Draws a circle with the given center point and radius. The current
3218 pen is used for the outline and the current brush for filling the
3219 shape.
3220 """
d55e5bfc
RD
3221 return _gdi_.DC_DrawCircle(*args, **kwargs)
3222
d6c14a4c 3223 def DrawCirclePoint(*args, **kwargs):
f5b96ee1
RD
3224 """
3225 DrawCirclePoint(self, Point pt, int radius)
3226
3227 Draws a circle with the given center point and radius. The current
3228 pen is used for the outline and the current brush for filling the
3229 shape.
3230 """
d6c14a4c 3231 return _gdi_.DC_DrawCirclePoint(*args, **kwargs)
d55e5bfc
RD
3232
3233 def DrawEllipse(*args, **kwargs):
f5b96ee1
RD
3234 """
3235 DrawEllipse(self, int x, int y, int width, int height)
3236
3237 Draws an ellipse contained in the specified rectangle. The current pen
3238 is used for the outline and the current brush for filling the shape.
3239 """
d55e5bfc
RD
3240 return _gdi_.DC_DrawEllipse(*args, **kwargs)
3241
3242 def DrawEllipseRect(*args, **kwargs):
f5b96ee1
RD
3243 """
3244 DrawEllipseRect(self, Rect rect)
3245
3246 Draws an ellipse contained in the specified rectangle. The current pen
3247 is used for the outline and the current brush for filling the shape.
3248 """
d55e5bfc
RD
3249 return _gdi_.DC_DrawEllipseRect(*args, **kwargs)
3250
d6c14a4c 3251 def DrawEllipsePointSize(*args, **kwargs):
f5b96ee1
RD
3252 """
3253 DrawEllipsePointSize(self, Point pt, Size sz)
3254
3255 Draws an ellipse contained in the specified rectangle. The current pen
3256 is used for the outline and the current brush for filling the shape.
3257 """
d6c14a4c 3258 return _gdi_.DC_DrawEllipsePointSize(*args, **kwargs)
d55e5bfc
RD
3259
3260 def DrawIcon(*args, **kwargs):
f5b96ee1
RD
3261 """
3262 DrawIcon(self, Icon icon, int x, int y)
3263
3264 Draw an icon on the display (does nothing if the device context is
3265 PostScript). This can be the simplest way of drawing bitmaps on a
3266 window.
3267 """
d55e5bfc
RD
3268 return _gdi_.DC_DrawIcon(*args, **kwargs)
3269
d6c14a4c 3270 def DrawIconPoint(*args, **kwargs):
f5b96ee1
RD
3271 """
3272 DrawIconPoint(self, Icon icon, Point pt)
3273
3274 Draw an icon on the display (does nothing if the device context is
3275 PostScript). This can be the simplest way of drawing bitmaps on a
3276 window.
3277 """
d6c14a4c 3278 return _gdi_.DC_DrawIconPoint(*args, **kwargs)
d55e5bfc
RD
3279
3280 def DrawBitmap(*args, **kwargs):
f5b96ee1
RD
3281 """
3282 DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
3283
3284 Draw a bitmap on the device context at the specified point. If
3285 *transparent* is true and the bitmap has a transparency mask, (or
3286 alpha channel on the platforms that support it) then the bitmap will
3287 be drawn transparently.
3288 """
d55e5bfc
RD
3289 return _gdi_.DC_DrawBitmap(*args, **kwargs)
3290
d6c14a4c 3291 def DrawBitmapPoint(*args, **kwargs):
f5b96ee1
RD
3292 """
3293 DrawBitmapPoint(self, Bitmap bmp, Point pt, bool useMask=False)
3294
3295 Draw a bitmap on the device context at the specified point. If
3296 *transparent* is true and the bitmap has a transparency mask, (or
3297 alpha channel on the platforms that support it) then the bitmap will
3298 be drawn transparently.
3299 """
d6c14a4c 3300 return _gdi_.DC_DrawBitmapPoint(*args, **kwargs)
d55e5bfc
RD
3301
3302 def DrawText(*args, **kwargs):
f5b96ee1
RD
3303 """
3304 DrawText(self, String text, int x, int y)
3305
3306 Draws a text string at the specified point, using the current text
3307 font, and the current text foreground and background colours.
3308
3309 The coordinates refer to the top-left corner of the rectangle bounding
3310 the string. See `GetTextExtent` for how to get the dimensions of a
3311 text string, which can be used to position the text more precisely.
3312
3313 **NOTE**: under wxGTK the current logical function is used by this
3314 function but it is ignored by wxMSW. Thus, you should avoid using
3315 logical functions with this function in portable programs.
3316 """
d55e5bfc
RD
3317 return _gdi_.DC_DrawText(*args, **kwargs)
3318
d6c14a4c 3319 def DrawTextPoint(*args, **kwargs):
f5b96ee1
RD
3320 """
3321 DrawTextPoint(self, String text, Point pt)
3322
3323 Draws a text string at the specified point, using the current text
3324 font, and the current text foreground and background colours.
3325
3326 The coordinates refer to the top-left corner of the rectangle bounding
3327 the string. See `GetTextExtent` for how to get the dimensions of a
3328 text string, which can be used to position the text more precisely.
3329
3330 **NOTE**: under wxGTK the current logical function is used by this
3331 function but it is ignored by wxMSW. Thus, you should avoid using
3332 logical functions with this function in portable programs.
3333 """
d6c14a4c 3334 return _gdi_.DC_DrawTextPoint(*args, **kwargs)
d55e5bfc
RD
3335
3336 def DrawRotatedText(*args, **kwargs):
f5b96ee1
RD
3337 """
3338 DrawRotatedText(self, String text, int x, int y, double angle)
3339
3340 Draws the text rotated by *angle* degrees, if supported by the platform.
3341
3342 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
3343 function. In particular, a font different from ``wx.NORMAL_FONT``
3344 should be used as the it is not normally a TrueType
3345 font. ``wx.SWISS_FONT`` is an example of a font which is.
3346 """
d55e5bfc
RD
3347 return _gdi_.DC_DrawRotatedText(*args, **kwargs)
3348
d6c14a4c 3349 def DrawRotatedTextPoint(*args, **kwargs):
f5b96ee1
RD
3350 """
3351 DrawRotatedTextPoint(self, String text, Point pt, double angle)
3352
3353 Draws the text rotated by *angle* degrees, if supported by the platform.
3354
3355 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
3356 function. In particular, a font different from ``wx.NORMAL_FONT``
3357 should be used as the it is not normally a TrueType
3358 font. ``wx.SWISS_FONT`` is an example of a font which is.
3359 """
d6c14a4c
RD
3360 return _gdi_.DC_DrawRotatedTextPoint(*args, **kwargs)
3361
3362 def Blit(*args, **kwargs):
d55e5bfc 3363 """
d6c14a4c 3364 Blit(self, int xdest, int ydest, int width, int height, DC source,
d55e5bfc
RD
3365 int xsrc, int ysrc, int rop=COPY, bool useMask=False,
3366 int xsrcMask=-1, int ysrcMask=-1) -> bool
f5b96ee1
RD
3367
3368 Copy from a source DC to this DC. Parameters specify the destination
3369 coordinates, size of area to copy, source DC, source coordinates,
3370 logical function, whether to use a bitmap mask, and mask source
3371 position.
d55e5bfc 3372 """
d6c14a4c 3373 return _gdi_.DC_Blit(*args, **kwargs)
d55e5bfc 3374
d6c14a4c 3375 def BlitPointSize(*args, **kwargs):
d55e5bfc 3376 """
d6c14a4c 3377 BlitPointSize(self, Point destPt, Size sz, DC source, Point srcPt, int rop=COPY,
d55e5bfc 3378 bool useMask=False, Point srcPtMask=DefaultPosition) -> bool
f5b96ee1
RD
3379
3380 Copy from a source DC to this DC. Parameters specify the destination
3381 coordinates, size of area to copy, source DC, source coordinates,
3382 logical function, whether to use a bitmap mask, and mask source
3383 position.
d55e5bfc 3384 """
d6c14a4c
RD
3385 return _gdi_.DC_BlitPointSize(*args, **kwargs)
3386
8f514ab4
RD
3387 def GetAsBitmap(*args, **kwargs):
3388 """GetAsBitmap(self, Rect subrect=None) -> Bitmap"""
3389 return _gdi_.DC_GetAsBitmap(*args, **kwargs)
3390
d6c14a4c 3391 def SetClippingRegion(*args, **kwargs):
f5b96ee1
RD
3392 """
3393 SetClippingRegion(self, int x, int y, int width, int height)
3394
3395 Sets the clipping region for this device context to the intersection
3396 of the given region described by the parameters of this method and the
3397 previously set clipping region. You should call `DestroyClippingRegion`
3398 if you want to set the clipping region exactly to the region
3399 specified.
3400
3401 The clipping region is an area to which drawing is
3402 restricted. Possible uses for the clipping region are for clipping
3403 text or for speeding up window redraws when only a known area of the
3404 screen is damaged.
3405 """
d6c14a4c
RD
3406 return _gdi_.DC_SetClippingRegion(*args, **kwargs)
3407
3408 def SetClippingRegionPointSize(*args, **kwargs):
f5b96ee1
RD
3409 """
3410 SetClippingRegionPointSize(self, Point pt, Size sz)
3411
3412 Sets the clipping region for this device context to the intersection
3413 of the given region described by the parameters of this method and the
3414 previously set clipping region. You should call `DestroyClippingRegion`
3415 if you want to set the clipping region exactly to the region
3416 specified.
3417
3418 The clipping region is an area to which drawing is
3419 restricted. Possible uses for the clipping region are for clipping
3420 text or for speeding up window redraws when only a known area of the
3421 screen is damaged.
3422 """
d6c14a4c
RD
3423 return _gdi_.DC_SetClippingRegionPointSize(*args, **kwargs)
3424
3425 def SetClippingRegionAsRegion(*args, **kwargs):
f5b96ee1
RD
3426 """
3427 SetClippingRegionAsRegion(self, Region region)
3428
3429 Sets the clipping region for this device context to the intersection
3430 of the given region described by the parameters of this method and the
3431 previously set clipping region. You should call `DestroyClippingRegion`
3432 if you want to set the clipping region exactly to the region
3433 specified.
3434
3435 The clipping region is an area to which drawing is
3436 restricted. Possible uses for the clipping region are for clipping
3437 text or for speeding up window redraws when only a known area of the
3438 screen is damaged.
3439 """
d6c14a4c
RD
3440 return _gdi_.DC_SetClippingRegionAsRegion(*args, **kwargs)
3441
3442 def SetClippingRect(*args, **kwargs):
f5b96ee1
RD
3443 """
3444 SetClippingRect(self, Rect rect)
3445
3446 Sets the clipping region for this device context to the intersection
3447 of the given region described by the parameters of this method and the
3448 previously set clipping region. You should call `DestroyClippingRegion`
3449 if you want to set the clipping region exactly to the region
3450 specified.
3451
3452 The clipping region is an area to which drawing is
3453 restricted. Possible uses for the clipping region are for clipping
3454 text or for speeding up window redraws when only a known area of the
3455 screen is damaged.
3456 """
d6c14a4c 3457 return _gdi_.DC_SetClippingRect(*args, **kwargs)
d55e5bfc
RD
3458
3459 def DrawLines(*args, **kwargs):
f5b96ee1
RD
3460 """
3461 DrawLines(self, List points, int xoffset=0, int yoffset=0)
3462
3463 Draws lines using a sequence of `wx.Point` objects, adding the
3464 optional offset coordinate. The current pen is used for drawing the
3465 lines.
3466 """
d55e5bfc
RD
3467 return _gdi_.DC_DrawLines(*args, **kwargs)
3468
3469 def DrawPolygon(*args, **kwargs):
3470 """
f5b96ee1 3471 DrawPolygon(self, List points, int xoffset=0, int yoffset=0,
d55e5bfc 3472 int fillStyle=ODDEVEN_RULE)
f5b96ee1
RD
3473
3474 Draws a filled polygon using a sequence of `wx.Point` objects, adding
3475 the optional offset coordinate. The last argument specifies the fill
3476 rule: ``wx.ODDEVEN_RULE`` (the default) or ``wx.WINDING_RULE``.
3477
3478 The current pen is used for drawing the outline, and the current brush
3479 for filling the shape. Using a transparent brush suppresses
3480 filling. Note that wxWidgets automatically closes the first and last
3481 points.
d55e5bfc
RD
3482 """
3483 return _gdi_.DC_DrawPolygon(*args, **kwargs)
3484
3485 def DrawLabel(*args, **kwargs):
3486 """
3487 DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
3488 int indexAccel=-1)
f5b96ee1
RD
3489
3490 Draw *text* within the specified rectangle, abiding by the alignment
3491 flags. Will additionally emphasize the character at *indexAccel* if
3492 it is not -1.
d55e5bfc
RD
3493 """
3494 return _gdi_.DC_DrawLabel(*args, **kwargs)
3495
3496 def DrawImageLabel(*args, **kwargs):
3497 """
3498 DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
3499 int indexAccel=-1) -> Rect
f5b96ee1
RD
3500
3501 Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
3502 drawing it) within the specified rectangle, abiding by the alignment
3503 flags. Will additionally emphasize the character at *indexAccel* if
3504 it is not -1. Returns the bounding rectangle.
d55e5bfc
RD
3505 """
3506 return _gdi_.DC_DrawImageLabel(*args, **kwargs)
3507
3508 def DrawSpline(*args, **kwargs):
f5b96ee1
RD
3509 """
3510 DrawSpline(self, List points)
3511
3512 Draws a spline between all given control points, (a list of `wx.Point`
3513 objects) using the current pen. The spline is drawn using a series of
3514 lines, using an algorithm taken from the X drawing program 'XFIG'.
3515 """
d55e5bfc
RD
3516 return _gdi_.DC_DrawSpline(*args, **kwargs)
3517
3518 def Clear(*args, **kwargs):
f5b96ee1
RD
3519 """
3520 Clear(self)
3521
3522 Clears the device context using the current background brush.
3523 """
d55e5bfc
RD
3524 return _gdi_.DC_Clear(*args, **kwargs)
3525
3526 def StartDoc(*args, **kwargs):
f5b96ee1
RD
3527 """
3528 StartDoc(self, String message) -> bool
3529
3530 Starts a document (only relevant when outputting to a
3531 printer). *Message* is a message to show whilst printing.
3532 """
d55e5bfc
RD
3533 return _gdi_.DC_StartDoc(*args, **kwargs)
3534
3535 def EndDoc(*args, **kwargs):
f5b96ee1
RD
3536 """
3537 EndDoc(self)
3538
3539 Ends a document (only relevant when outputting to a printer).
3540 """
d55e5bfc
RD
3541 return _gdi_.DC_EndDoc(*args, **kwargs)
3542
3543 def StartPage(*args, **kwargs):
f5b96ee1
RD
3544 """
3545 StartPage(self)
3546
3547 Starts a document page (only relevant when outputting to a printer).
3548 """
d55e5bfc
RD
3549 return _gdi_.DC_StartPage(*args, **kwargs)
3550
3551 def EndPage(*args, **kwargs):
f5b96ee1
RD
3552 """
3553 EndPage(self)
3554
3555 Ends a document page (only relevant when outputting to a printer).
3556 """
d55e5bfc
RD
3557 return _gdi_.DC_EndPage(*args, **kwargs)
3558
3559 def SetFont(*args, **kwargs):
f5b96ee1
RD
3560 """
3561 SetFont(self, Font font)
3562
3563 Sets the current font for the DC. It must be a valid font, in
3564 particular you should not pass ``wx.NullFont`` to this method.
3565 """
d55e5bfc
RD
3566 return _gdi_.DC_SetFont(*args, **kwargs)
3567
3568 def SetPen(*args, **kwargs):
f5b96ee1
RD
3569 """
3570 SetPen(self, Pen pen)
3571
3572 Sets the current pen for the DC.
3573
3574 If the argument is ``wx.NullPen``, the current pen is selected out of the
3575 device context, and the original pen restored.
3576 """
d55e5bfc
RD
3577 return _gdi_.DC_SetPen(*args, **kwargs)
3578
3579 def SetBrush(*args, **kwargs):
f5b96ee1
RD
3580 """
3581 SetBrush(self, Brush brush)
3582
3583 Sets the current brush for the DC.
3584
3585 If the argument is ``wx.NullBrush``, the current brush is selected out
3586 of the device context, and the original brush restored, allowing the
3587 current brush to be destroyed safely.
3588 """
d55e5bfc
RD
3589 return _gdi_.DC_SetBrush(*args, **kwargs)
3590
3591 def SetBackground(*args, **kwargs):
f5b96ee1
RD
3592 """
3593 SetBackground(self, Brush brush)
3594
3595 Sets the current background brush for the DC.
3596 """
d55e5bfc
RD
3597 return _gdi_.DC_SetBackground(*args, **kwargs)
3598
3599 def SetBackgroundMode(*args, **kwargs):
f5b96ee1
RD
3600 """
3601 SetBackgroundMode(self, int mode)
3602
3603 *mode* may be one of ``wx.SOLID`` and ``wx.TRANSPARENT``. This setting
3604 determines whether text will be drawn with a background colour or
3605 not.
3606 """
d55e5bfc
RD
3607 return _gdi_.DC_SetBackgroundMode(*args, **kwargs)
3608
3609 def SetPalette(*args, **kwargs):
f5b96ee1
RD
3610 """
3611 SetPalette(self, Palette palette)
3612
3613 If this is a window DC or memory DC, assigns the given palette to the
3614 window or bitmap associated with the DC. If the argument is
3615 ``wx.NullPalette``, the current palette is selected out of the device
3616 context, and the original palette restored.
3617 """
d55e5bfc
RD
3618 return _gdi_.DC_SetPalette(*args, **kwargs)
3619
d55e5bfc 3620 def DestroyClippingRegion(*args, **kwargs):
f5b96ee1
RD
3621 """
3622 DestroyClippingRegion(self)
3623
3624 Destroys the current clipping region so that none of the DC is
3625 clipped.
3626 """
d55e5bfc
RD
3627 return _gdi_.DC_DestroyClippingRegion(*args, **kwargs)
3628
3629 def GetClippingBox(*args, **kwargs):
f5b96ee1
RD
3630 """
3631 GetClippingBox() -> (x, y, width, height)
3632
3633 Gets the rectangle surrounding the current clipping region.
3634 """
d55e5bfc
RD
3635 return _gdi_.DC_GetClippingBox(*args, **kwargs)
3636
3637 def GetClippingRect(*args, **kwargs):
f5b96ee1
RD
3638 """
3639 GetClippingRect(self) -> Rect
3640
3641 Gets the rectangle surrounding the current clipping region.
3642 """
d55e5bfc
RD
3643 return _gdi_.DC_GetClippingRect(*args, **kwargs)
3644
3645 def GetCharHeight(*args, **kwargs):
f5b96ee1
RD
3646 """
3647 GetCharHeight(self) -> int
3648
3649 Gets the character height of the currently set font.
3650 """
d55e5bfc
RD
3651 return _gdi_.DC_GetCharHeight(*args, **kwargs)
3652
3653 def GetCharWidth(*args, **kwargs):
f5b96ee1
RD
3654 """
3655 GetCharWidth(self) -> int
3656
3657 Gets the average character width of the currently set font.
3658 """
d55e5bfc
RD
3659 return _gdi_.DC_GetCharWidth(*args, **kwargs)
3660
3661 def GetTextExtent(*args, **kwargs):
a001823c
RD
3662 """
3663 GetTextExtent(wxString string) -> (width, height)
3664
3665 Get the width and height of the text using the current font. Only
3666 works for single line strings.
3667 """
d55e5bfc
RD
3668 return _gdi_.DC_GetTextExtent(*args, **kwargs)
3669
3670 def GetFullTextExtent(*args, **kwargs):
3671 """
3672 GetFullTextExtent(wxString string, Font font=None) ->
3673 (width, height, descent, externalLeading)
3674
15817c7e
RD
3675 Get the width, height, decent and leading of the text using the
3676 current or specified font. Only works for single line strings.
d55e5bfc
RD
3677 """
3678 return _gdi_.DC_GetFullTextExtent(*args, **kwargs)
3679
3680 def GetMultiLineTextExtent(*args, **kwargs):
3681 """
3682 GetMultiLineTextExtent(wxString string, Font font=None) ->
fc46b7f3 3683 (width, height, lineHeight)
a001823c 3684
777e547f 3685 Get the width, height, and line height of the text using the
a001823c
RD
3686 current or specified font. Works for single as well as multi-line
3687 strings.
d55e5bfc
RD
3688 """
3689 return _gdi_.DC_GetMultiLineTextExtent(*args, **kwargs)
3690
3691 def GetPartialTextExtents(*args, **kwargs):
f5b96ee1
RD
3692 """
3693 GetPartialTextExtents(self, text) -> [widths]
3694
3695 Returns a list of integers such that each value is the distance in
3696 pixels from the begining of text to the coresponding character of
3697 *text*. The generic version simply builds a running total of the widths
3698 of each character using GetTextExtent, however if the various
3699 platforms have a native API function that is faster or more accurate
43e8916f 3700 than the generic implementation then it will be used instead.
f5b96ee1 3701 """
d55e5bfc
RD
3702 return _gdi_.DC_GetPartialTextExtents(*args, **kwargs)
3703
3704 def GetSize(*args, **kwargs):
3705 """
3706 GetSize(self) -> Size
3707
f5b96ee1
RD
3708 This gets the horizontal and vertical resolution in device units. It
3709 can be used to scale graphics to fit the page. For example, if *maxX*
3710 and *maxY* represent the maximum horizontal and vertical 'pixel' values
3711 used in your application, the following code will scale the graphic to
3712 fit on the printer page::
3713
3714 w, h = dc.GetSize()
3715 scaleX = maxX*1.0 / w
3716 scaleY = maxY*1.0 / h
3717 dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
3718
d55e5bfc
RD
3719 """
3720 return _gdi_.DC_GetSize(*args, **kwargs)
3721
3722 def GetSizeTuple(*args, **kwargs):
3723 """
3724 GetSizeTuple() -> (width, height)
3725
f5b96ee1
RD
3726 This gets the horizontal and vertical resolution in device units. It
3727 can be used to scale graphics to fit the page. For example, if *maxX*
3728 and *maxY* represent the maximum horizontal and vertical 'pixel' values
3729 used in your application, the following code will scale the graphic to
3730 fit on the printer page::
3731
3732 w, h = dc.GetSize()
3733 scaleX = maxX*1.0 / w
3734 scaleY = maxY*1.0 / h
3735 dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
3736
d55e5bfc
RD
3737 """
3738 return _gdi_.DC_GetSizeTuple(*args, **kwargs)
3739
3740 def GetSizeMM(*args, **kwargs):
3741 """
3742 GetSizeMM(self) -> Size
3743
3744 Get the DC size in milimeters.
3745 """
3746 return _gdi_.DC_GetSizeMM(*args, **kwargs)
3747
3748 def GetSizeMMTuple(*args, **kwargs):
3749 """
3750 GetSizeMMTuple() -> (width, height)
3751
3752 Get the DC size in milimeters.
3753 """
3754 return _gdi_.DC_GetSizeMMTuple(*args, **kwargs)
3755
3756 def DeviceToLogicalX(*args, **kwargs):
f5b96ee1
RD
3757 """
3758 DeviceToLogicalX(self, int x) -> int
3759
3760 Convert device X coordinate to logical coordinate, using the current
3761 mapping mode.
3762 """
d55e5bfc
RD
3763 return _gdi_.DC_DeviceToLogicalX(*args, **kwargs)
3764
3765 def DeviceToLogicalY(*args, **kwargs):
f5b96ee1
RD
3766 """
3767 DeviceToLogicalY(self, int y) -> int
3768
3769 Converts device Y coordinate to logical coordinate, using the current
3770 mapping mode.
3771 """
d55e5bfc
RD
3772 return _gdi_.DC_DeviceToLogicalY(*args, **kwargs)
3773
3774 def DeviceToLogicalXRel(*args, **kwargs):
f5b96ee1
RD
3775 """
3776 DeviceToLogicalXRel(self, int x) -> int
3777
3778 Convert device X coordinate to relative logical coordinate, using the
3779 current mapping mode but ignoring the x axis orientation. Use this
3780 function for converting a width, for example.
3781 """
d55e5bfc
RD
3782 return _gdi_.DC_DeviceToLogicalXRel(*args, **kwargs)
3783
3784 def DeviceToLogicalYRel(*args, **kwargs):
f5b96ee1
RD
3785 """
3786 DeviceToLogicalYRel(self, int y) -> int
3787
3788 Convert device Y coordinate to relative logical coordinate, using the
3789 current mapping mode but ignoring the y axis orientation. Use this
3790 function for converting a height, for example.
3791 """
d55e5bfc
RD
3792 return _gdi_.DC_DeviceToLogicalYRel(*args, **kwargs)
3793
3794 def LogicalToDeviceX(*args, **kwargs):
f5b96ee1
RD
3795 """
3796 LogicalToDeviceX(self, int x) -> int
3797
3798 Converts logical X coordinate to device coordinate, using the current
3799 mapping mode.
3800 """
d55e5bfc
RD
3801 return _gdi_.DC_LogicalToDeviceX(*args, **kwargs)
3802
3803 def LogicalToDeviceY(*args, **kwargs):
f5b96ee1
RD
3804 """
3805 LogicalToDeviceY(self, int y) -> int
3806
3807 Converts logical Y coordinate to device coordinate, using the current
3808 mapping mode.
3809 """
d55e5bfc
RD
3810 return _gdi_.DC_LogicalToDeviceY(*args, **kwargs)
3811
3812 def LogicalToDeviceXRel(*args, **kwargs):
f5b96ee1
RD
3813 """
3814 LogicalToDeviceXRel(self, int x) -> int
3815
3816 Converts logical X coordinate to relative device coordinate, using the
3817 current mapping mode but ignoring the x axis orientation. Use this for
3818 converting a width, for example.
3819 """
d55e5bfc
RD
3820 return _gdi_.DC_LogicalToDeviceXRel(*args, **kwargs)
3821
3822 def LogicalToDeviceYRel(*args, **kwargs):
f5b96ee1
RD
3823 """
3824 LogicalToDeviceYRel(self, int y) -> int
3825
3826 Converts logical Y coordinate to relative device coordinate, using the
3827 current mapping mode but ignoring the y axis orientation. Use this for
3828 converting a height, for example.
3829 """
d55e5bfc
RD
3830 return _gdi_.DC_LogicalToDeviceYRel(*args, **kwargs)
3831
3832 def CanDrawBitmap(*args, **kwargs):
3833 """CanDrawBitmap(self) -> bool"""
3834 return _gdi_.DC_CanDrawBitmap(*args, **kwargs)
3835
3836 def CanGetTextExtent(*args, **kwargs):
3837 """CanGetTextExtent(self) -> bool"""
3838 return _gdi_.DC_CanGetTextExtent(*args, **kwargs)
3839
3840 def GetDepth(*args, **kwargs):
f5b96ee1
RD
3841 """
3842 GetDepth(self) -> int
3843
3844 Returns the colour depth of the DC.
3845 """
d55e5bfc
RD
3846 return _gdi_.DC_GetDepth(*args, **kwargs)
3847
3848 def GetPPI(*args, **kwargs):
f5b96ee1
RD
3849 """
3850 GetPPI(self) -> Size
3851
92515dfc 3852 Resolution in pixels per inch
f5b96ee1 3853 """
d55e5bfc
RD
3854 return _gdi_.DC_GetPPI(*args, **kwargs)
3855
b39fe951 3856 def IsOk(*args, **kwargs):
f5b96ee1 3857 """
b39fe951 3858 IsOk(self) -> bool
f5b96ee1
RD
3859
3860 Returns true if the DC is ok to use.
3861 """
b39fe951 3862 return _gdi_.DC_IsOk(*args, **kwargs)
d55e5bfc 3863
b39fe951 3864 Ok = IsOk
d55e5bfc 3865 def GetBackgroundMode(*args, **kwargs):
f5b96ee1
RD
3866 """
3867 GetBackgroundMode(self) -> int
3868
3869 Returns the current background mode, either ``wx.SOLID`` or
3870 ``wx.TRANSPARENT``.
3871 """
d55e5bfc
RD
3872 return _gdi_.DC_GetBackgroundMode(*args, **kwargs)
3873
3874 def GetBackground(*args, **kwargs):
f5b96ee1
RD
3875 """
3876 GetBackground(self) -> Brush
3877
3878 Gets the brush used for painting the background.
3879 """
d55e5bfc
RD
3880 return _gdi_.DC_GetBackground(*args, **kwargs)
3881
3882 def GetBrush(*args, **kwargs):
f5b96ee1
RD
3883 """
3884 GetBrush(self) -> Brush
3885
3886 Gets the current brush
3887 """
d55e5bfc
RD
3888 return _gdi_.DC_GetBrush(*args, **kwargs)
3889
3890 def GetFont(*args, **kwargs):
f5b96ee1
RD
3891 """
3892 GetFont(self) -> Font
3893
3894 Gets the current font
3895 """
d55e5bfc
RD
3896 return _gdi_.DC_GetFont(*args, **kwargs)
3897
3898 def GetPen(*args, **kwargs):
f5b96ee1
RD
3899 """
3900 GetPen(self) -> Pen
3901
3902 Gets the current pen
3903 """
d55e5bfc
RD
3904 return _gdi_.DC_GetPen(*args, **kwargs)
3905
3906 def GetTextBackground(*args, **kwargs):
f5b96ee1
RD
3907 """
3908 GetTextBackground(self) -> Colour
3909
3910 Gets the current text background colour
3911 """
d55e5bfc
RD
3912 return _gdi_.DC_GetTextBackground(*args, **kwargs)
3913
3914 def GetTextForeground(*args, **kwargs):
f5b96ee1
RD
3915 """
3916 GetTextForeground(self) -> Colour
3917
3918 Gets the current text foreground colour
3919 """
d55e5bfc
RD
3920 return _gdi_.DC_GetTextForeground(*args, **kwargs)
3921
3922 def SetTextForeground(*args, **kwargs):
f5b96ee1
RD
3923 """
3924 SetTextForeground(self, Colour colour)
3925
3926 Sets the current text foreground colour for the DC.
3927 """
d55e5bfc
RD
3928 return _gdi_.DC_SetTextForeground(*args, **kwargs)
3929
3930 def SetTextBackground(*args, **kwargs):
f5b96ee1
RD
3931 """
3932 SetTextBackground(self, Colour colour)
3933
3934 Sets the current text background colour for the DC.
3935 """
d55e5bfc
RD
3936 return _gdi_.DC_SetTextBackground(*args, **kwargs)
3937
3938 def GetMapMode(*args, **kwargs):
f5b96ee1
RD
3939 """
3940 GetMapMode(self) -> int
3941
3942 Gets the current *mapping mode* for the device context
3943 """
d55e5bfc
RD
3944 return _gdi_.DC_GetMapMode(*args, **kwargs)
3945
3946 def SetMapMode(*args, **kwargs):
f5b96ee1
RD
3947 """
3948 SetMapMode(self, int mode)
3949
3950 The *mapping mode* of the device context defines the unit of
3951 measurement used to convert logical units to device units. The
3952 mapping mode can be one of the following:
3953
3954 ================ =============================================
3955 wx.MM_TWIPS Each logical unit is 1/20 of a point, or 1/1440
3956 of an inch.
3957 wx.MM_POINTS Each logical unit is a point, or 1/72 of an inch.
3958 wx.MM_METRIC Each logical unit is 1 mm.
3959 wx.MM_LOMETRIC Each logical unit is 1/10 of a mm.
3960 wx.MM_TEXT Each logical unit is 1 pixel.
3961 ================ =============================================
3962
3963 """
d55e5bfc
RD
3964 return _gdi_.DC_SetMapMode(*args, **kwargs)
3965
3966 def GetUserScale(*args, **kwargs):
f5b96ee1
RD
3967 """
3968 GetUserScale(self) -> (xScale, yScale)
3969
3970 Gets the current user scale factor (set by `SetUserScale`).
3971 """
d55e5bfc
RD
3972 return _gdi_.DC_GetUserScale(*args, **kwargs)
3973
3974 def SetUserScale(*args, **kwargs):
f5b96ee1
RD
3975 """
3976 SetUserScale(self, double x, double y)
3977
3978 Sets the user scaling factor, useful for applications which require
3979 'zooming'.
3980 """
d55e5bfc
RD
3981 return _gdi_.DC_SetUserScale(*args, **kwargs)
3982
3983 def GetLogicalScale(*args, **kwargs):
3984 """GetLogicalScale() -> (xScale, yScale)"""
3985 return _gdi_.DC_GetLogicalScale(*args, **kwargs)
3986
3987 def SetLogicalScale(*args, **kwargs):
3988 """SetLogicalScale(self, double x, double y)"""
3989 return _gdi_.DC_SetLogicalScale(*args, **kwargs)
3990
3991 def GetLogicalOrigin(*args, **kwargs):
3992 """GetLogicalOrigin(self) -> Point"""
3993 return _gdi_.DC_GetLogicalOrigin(*args, **kwargs)
3994
3995 def GetLogicalOriginTuple(*args, **kwargs):
3996 """GetLogicalOriginTuple() -> (x,y)"""
3997 return _gdi_.DC_GetLogicalOriginTuple(*args, **kwargs)
3998
3999 def SetLogicalOrigin(*args, **kwargs):
4000 """SetLogicalOrigin(self, int x, int y)"""
4001 return _gdi_.DC_SetLogicalOrigin(*args, **kwargs)
4002
d6c14a4c
RD
4003 def SetLogicalOriginPoint(*args, **kwargs):
4004 """SetLogicalOriginPoint(self, Point point)"""
4005 return _gdi_.DC_SetLogicalOriginPoint(*args, **kwargs)
4006
d55e5bfc
RD
4007 def GetDeviceOrigin(*args, **kwargs):
4008 """GetDeviceOrigin(self) -> Point"""
4009 return _gdi_.DC_GetDeviceOrigin(*args, **kwargs)
4010
4011 def GetDeviceOriginTuple(*args, **kwargs):
4012 """GetDeviceOriginTuple() -> (x,y)"""
4013 return _gdi_.DC_GetDeviceOriginTuple(*args, **kwargs)
4014
4015 def SetDeviceOrigin(*args, **kwargs):
4016 """SetDeviceOrigin(self, int x, int y)"""
4017 return _gdi_.DC_SetDeviceOrigin(*args, **kwargs)
4018
d6c14a4c
RD
4019 def SetDeviceOriginPoint(*args, **kwargs):
4020 """SetDeviceOriginPoint(self, Point point)"""
4021 return _gdi_.DC_SetDeviceOriginPoint(*args, **kwargs)
4022
d55e5bfc 4023 def SetAxisOrientation(*args, **kwargs):
f5b96ee1
RD
4024 """
4025 SetAxisOrientation(self, bool xLeftRight, bool yBottomUp)
4026
4027 Sets the x and y axis orientation (i.e., the direction from lowest to
4028 highest values on the axis). The default orientation is the natural
4029 orientation, e.g. x axis from left to right and y axis from bottom up.
4030 """
d55e5bfc
RD
4031 return _gdi_.DC_SetAxisOrientation(*args, **kwargs)
4032
4033 def GetLogicalFunction(*args, **kwargs):
f5b96ee1
RD
4034 """
4035 GetLogicalFunction(self) -> int
4036
4037 Gets the current logical function (set by `SetLogicalFunction`).
4038 """
d55e5bfc
RD
4039 return _gdi_.DC_GetLogicalFunction(*args, **kwargs)
4040
4041 def SetLogicalFunction(*args, **kwargs):
f5b96ee1
RD
4042 """
4043 SetLogicalFunction(self, int function)
4044
4045 Sets the current logical function for the device context. This
4046 determines how a source pixel (from a pen or brush colour, or source
4047 device context if using `Blit`) combines with a destination pixel in
4048 the current device context.
4049
4050 The possible values and their meaning in terms of source and
4051 destination pixel values are as follows:
4052
4053 ================ ==========================
4054 wx.AND src AND dst
4055 wx.AND_INVERT (NOT src) AND dst
4056 wx.AND_REVERSE src AND (NOT dst)
4057 wx.CLEAR 0
4058 wx.COPY src
4059 wx.EQUIV (NOT src) XOR dst
4060 wx.INVERT NOT dst
4061 wx.NAND (NOT src) OR (NOT dst)
4062 wx.NOR (NOT src) AND (NOT dst)
4063 wx.NO_OP dst
4064 wx.OR src OR dst
4065 wx.OR_INVERT (NOT src) OR dst
4066 wx.OR_REVERSE src OR (NOT dst)
4067 wx.SET 1
4068 wx.SRC_INVERT NOT src
4069 wx.XOR src XOR dst
4070 ================ ==========================
4071
4072 The default is wx.COPY, which simply draws with the current
4073 colour. The others combine the current colour and the background using
4074 a logical operation. wx.INVERT is commonly used for drawing rubber
4075 bands or moving outlines, since drawing twice reverts to the original
4076 colour.
4077
4078 """
d55e5bfc
RD
4079 return _gdi_.DC_SetLogicalFunction(*args, **kwargs)
4080
5cbf236d 4081 def ComputeScaleAndOrigin(*args, **kwargs):
f5b96ee1 4082 """
5cbf236d 4083 ComputeScaleAndOrigin(self)
f5b96ee1 4084
5cbf236d
RD
4085 Performs all necessary computations for given platform and context
4086 type after each change of scale and origin parameters. Usually called
4087 automatically internally after such changes.
f5b96ee1 4088
f5b96ee1 4089 """
5cbf236d 4090 return _gdi_.DC_ComputeScaleAndOrigin(*args, **kwargs)
d55e5bfc 4091
5cbf236d
RD
4092 def SetOptimization(self, optimize):
4093 pass
4094 def GetOptimization(self):
4095 return False
f5b96ee1 4096
5cbf236d
RD
4097 SetOptimization = wx._deprecated(SetOptimization)
4098 GetOptimization = wx._deprecated(GetOptimization)
d55e5bfc
RD
4099
4100 def CalcBoundingBox(*args, **kwargs):
f5b96ee1
RD
4101 """
4102 CalcBoundingBox(self, int x, int y)
4103
4104 Adds the specified point to the bounding box which can be retrieved
4105 with `MinX`, `MaxX` and `MinY`, `MaxY` or `GetBoundingBox` functions.
4106 """
d55e5bfc
RD
4107 return _gdi_.DC_CalcBoundingBox(*args, **kwargs)
4108
d6c14a4c 4109 def CalcBoundingBoxPoint(*args, **kwargs):
f5b96ee1
RD
4110 """
4111 CalcBoundingBoxPoint(self, Point point)
4112
4113 Adds the specified point to the bounding box which can be retrieved
4114 with `MinX`, `MaxX` and `MinY`, `MaxY` or `GetBoundingBox` functions.
4115 """
d6c14a4c
RD
4116 return _gdi_.DC_CalcBoundingBoxPoint(*args, **kwargs)
4117
d55e5bfc 4118 def ResetBoundingBox(*args, **kwargs):
f5b96ee1
RD
4119 """
4120 ResetBoundingBox(self)
4121
4122 Resets the bounding box: after a call to this function, the bounding
4123 box doesn't contain anything.
4124 """
d55e5bfc
RD
4125 return _gdi_.DC_ResetBoundingBox(*args, **kwargs)
4126
4127 def MinX(*args, **kwargs):
f5b96ee1
RD
4128 """
4129 MinX(self) -> int
4130
4131 Gets the minimum horizontal extent used in drawing commands so far.
4132 """
d55e5bfc
RD
4133 return _gdi_.DC_MinX(*args, **kwargs)
4134
4135 def MaxX(*args, **kwargs):
f5b96ee1
RD
4136 """
4137 MaxX(self) -> int
4138
4139 Gets the maximum horizontal extent used in drawing commands so far.
4140 """
d55e5bfc
RD
4141 return _gdi_.DC_MaxX(*args, **kwargs)
4142
4143 def MinY(*args, **kwargs):
f5b96ee1
RD
4144 """
4145 MinY(self) -> int
4146
4147 Gets the minimum vertical extent used in drawing commands so far.
4148 """
d55e5bfc
RD
4149 return _gdi_.DC_MinY(*args, **kwargs)
4150
4151 def MaxY(*args, **kwargs):
f5b96ee1
RD
4152 """
4153 MaxY(self) -> int
4154
4155 Gets the maximum vertical extent used in drawing commands so far.
4156 """
d55e5bfc
RD
4157 return _gdi_.DC_MaxY(*args, **kwargs)
4158
4159 def GetBoundingBox(*args, **kwargs):
f5b96ee1
RD
4160 """
4161 GetBoundingBox() -> (x1,y1, x2,y2)
4162
4163 Returns the min and max points used in drawing commands so far.
4164 """
d55e5bfc
RD
4165 return _gdi_.DC_GetBoundingBox(*args, **kwargs)
4166
b39fe951
RD
4167 def __nonzero__(self): return self.IsOk()
4168 def GetLayoutDirection(*args, **kwargs):
4169 """
4170 GetLayoutDirection(self) -> int
4171
4172 Get the layout direction (LTR or RTL)_ for this dc. On platforms
4173 where RTL layout is supported, the return value will either be
4174 ``wx.Layout_LeftToRight`` or ``wx.Layout_RightToLeft``.
4175 ``wx.Layout_Default`` is returned if layout direction is not
4176 supported.
4177 """
4178 return _gdi_.DC_GetLayoutDirection(*args, **kwargs)
4179
4180 def SetLayoutDirection(*args, **kwargs):
4181 """
4182 SetLayoutDirection(self, int dir)
4183
4184 Change the layout direction for this dc.
4185 """
4186 return _gdi_.DC_SetLayoutDirection(*args, **kwargs)
4187
d55e5bfc
RD
4188 def _DrawPointList(*args, **kwargs):
4189 """_DrawPointList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
4190 return _gdi_.DC__DrawPointList(*args, **kwargs)
4191
4192 def _DrawLineList(*args, **kwargs):
4193 """_DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
4194 return _gdi_.DC__DrawLineList(*args, **kwargs)
4195
4196 def _DrawRectangleList(*args, **kwargs):
4197 """_DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
4198 return _gdi_.DC__DrawRectangleList(*args, **kwargs)
4199
4200 def _DrawEllipseList(*args, **kwargs):
4201 """_DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
4202 return _gdi_.DC__DrawEllipseList(*args, **kwargs)
4203
4204 def _DrawPolygonList(*args, **kwargs):
4205 """_DrawPolygonList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
4206 return _gdi_.DC__DrawPolygonList(*args, **kwargs)
4207
4208 def _DrawTextList(*args, **kwargs):
4209 """
4210 _DrawTextList(self, PyObject textList, PyObject pyPoints, PyObject foregroundList,
4211 PyObject backgroundList) -> PyObject
4212 """
4213 return _gdi_.DC__DrawTextList(*args, **kwargs)
4214
4215 def DrawPointList(self, points, pens=None):
f5b96ee1
RD
4216 """
4217 Draw a list of points as quickly as possible.
4218
4219 :param points: A sequence of 2-element sequences representing
4220 each point to draw, (x,y).
4221 :param pens: If None, then the current pen is used. If a
4222 single pen then it will be used for all points. If
4223 a list of pens then there should be one for each point
4224 in points.
4225 """
d55e5bfc
RD
4226 if pens is None:
4227 pens = []
4228 elif isinstance(pens, wx.Pen):
4229 pens = [pens]
4230 elif len(pens) != len(points):
4231 raise ValueError('points and pens must have same length')
4232 return self._DrawPointList(points, pens, [])
4233
4234
4235 def DrawLineList(self, lines, pens=None):
f5b96ee1
RD
4236 """
4237 Draw a list of lines as quickly as possible.
4238
4239 :param lines: A sequence of 4-element sequences representing
4240 each line to draw, (x1,y1, x2,y2).
4241 :param pens: If None, then the current pen is used. If a
4242 single pen then it will be used for all lines. If
4243 a list of pens then there should be one for each line
4244 in lines.
4245 """
d55e5bfc
RD
4246 if pens is None:
4247 pens = []
4248 elif isinstance(pens, wx.Pen):
4249 pens = [pens]
4250 elif len(pens) != len(lines):
4251 raise ValueError('lines and pens must have same length')
4252 return self._DrawLineList(lines, pens, [])
4253
4254
4255 def DrawRectangleList(self, rectangles, pens=None, brushes=None):
f5b96ee1
RD
4256 """
4257 Draw a list of rectangles as quickly as possible.
4258
4259 :param rectangles: A sequence of 4-element sequences representing
4260 each rectangle to draw, (x,y, w,h).
4261 :param pens: If None, then the current pen is used. If a
4262 single pen then it will be used for all rectangles.
4263 If a list of pens then there should be one for each
4264 rectangle in rectangles.
4265 :param brushes: A brush or brushes to be used to fill the rectagles,
4266 with similar semantics as the pens parameter.
4267 """
d55e5bfc
RD
4268 if pens is None:
4269 pens = []
4270 elif isinstance(pens, wx.Pen):
4271 pens = [pens]
4272 elif len(pens) != len(rectangles):
4273 raise ValueError('rectangles and pens must have same length')
4274 if brushes is None:
4275 brushes = []
4276 elif isinstance(brushes, wx.Brush):
4277 brushes = [brushes]
4278 elif len(brushes) != len(rectangles):
4279 raise ValueError('rectangles and brushes must have same length')
4280 return self._DrawRectangleList(rectangles, pens, brushes)
4281
4282
4283 def DrawEllipseList(self, ellipses, pens=None, brushes=None):
f5b96ee1
RD
4284 """
4285 Draw a list of ellipses as quickly as possible.
4286
4287 :param ellipses: A sequence of 4-element sequences representing
4288 each ellipse to draw, (x,y, w,h).
4289 :param pens: If None, then the current pen is used. If a
4290 single pen then it will be used for all ellipses.
4291 If a list of pens then there should be one for each
4292 ellipse in ellipses.
4293 :param brushes: A brush or brushes to be used to fill the ellipses,
4294 with similar semantics as the pens parameter.
4295 """
d55e5bfc
RD
4296 if pens is None:
4297 pens = []
4298 elif isinstance(pens, wx.Pen):
4299 pens = [pens]
4300 elif len(pens) != len(ellipses):
4301 raise ValueError('ellipses and pens must have same length')
4302 if brushes is None:
4303 brushes = []
4304 elif isinstance(brushes, wx.Brush):
4305 brushes = [brushes]
4306 elif len(brushes) != len(ellipses):
4307 raise ValueError('ellipses and brushes must have same length')
4308 return self._DrawEllipseList(ellipses, pens, brushes)
4309
4310
4311 def DrawPolygonList(self, polygons, pens=None, brushes=None):
f5b96ee1
RD
4312 """
4313 Draw a list of polygons, each of which is a list of points.
4314
4315 :param polygons: A sequence of sequences of sequences.
4316 [[(x1,y1),(x2,y2),(x3,y3)...],
4317 [(x1,y1),(x2,y2),(x3,y3)...]]
4318
4319 :param pens: If None, then the current pen is used. If a
4320 single pen then it will be used for all polygons.
4321 If a list of pens then there should be one for each
4322 polygon.
4323 :param brushes: A brush or brushes to be used to fill the polygons,
4324 with similar semantics as the pens parameter.
4325 """
d55e5bfc
RD
4326 if pens is None:
4327 pens = []
4328 elif isinstance(pens, wx.Pen):
4329 pens = [pens]
4330 elif len(pens) != len(polygons):
4331 raise ValueError('polygons and pens must have same length')
4332 if brushes is None:
4333 brushes = []
4334 elif isinstance(brushes, wx.Brush):
4335 brushes = [brushes]
4336 elif len(brushes) != len(polygons):
4337 raise ValueError('polygons and brushes must have same length')
4338 return self._DrawPolygonList(polygons, pens, brushes)
4339
4340
f5b96ee1
RD
4341 def DrawTextList(self, textList, coords, foregrounds = None, backgrounds = None):
4342 """
4343 Draw a list of strings using a list of coordinants for positioning each string.
4344
4345 :param textList: A list of strings
4346 :param coords: A list of (x,y) positions
4347 :param foregrounds: A list of `wx.Colour` objects to use for the
4348 foregrounds of the strings.
4349 :param backgrounds: A list of `wx.Colour` objects to use for the
4350 backgrounds of the strings.
4351
4352 NOTE: Make sure you set Background mode to wx.Solid (DC.SetBackgroundMode)
4353 If you want backgrounds to do anything.
4354 """
d55e5bfc
RD
4355 if type(textList) == type(''):
4356 textList = [textList]
4357 elif len(textList) != len(coords):
4358 raise ValueError('textlist and coords must have same length')
4359 if foregrounds is None:
4360 foregrounds = []
4361 elif isinstance(foregrounds, wx.Colour):
4362 foregrounds = [foregrounds]
4363 elif len(foregrounds) != len(coords):
4364 raise ValueError('foregrounds and coords must have same length')
4365 if backgrounds is None:
4366 backgrounds = []
4367 elif isinstance(backgrounds, wx.Colour):
4368 backgrounds = [backgrounds]
4369 elif len(backgrounds) != len(coords):
4370 raise ValueError('backgrounds and coords must have same length')
4371 return self._DrawTextList(textList, coords, foregrounds, backgrounds)
4372
2bf58437
RD
4373 Background = property(GetBackground,SetBackground,doc="See `GetBackground` and `SetBackground`")
4374 BackgroundMode = property(GetBackgroundMode,SetBackgroundMode,doc="See `GetBackgroundMode` and `SetBackgroundMode`")
4375 BoundingBox = property(GetBoundingBox,doc="See `GetBoundingBox`")
4376 Brush = property(GetBrush,SetBrush,doc="See `GetBrush` and `SetBrush`")
4377 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
4378 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
4379 ClippingBox = property(GetClippingBox,doc="See `GetClippingBox`")
4380 ClippingRect = property(GetClippingRect,SetClippingRect,doc="See `GetClippingRect` and `SetClippingRect`")
4381 Depth = property(GetDepth,doc="See `GetDepth`")
4382 DeviceOrigin = property(GetDeviceOrigin,SetDeviceOrigin,doc="See `GetDeviceOrigin` and `SetDeviceOrigin`")
4383 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
4384 FullTextExtent = property(GetFullTextExtent,doc="See `GetFullTextExtent`")
4385 LogicalFunction = property(GetLogicalFunction,SetLogicalFunction,doc="See `GetLogicalFunction` and `SetLogicalFunction`")
4386 LogicalOrigin = property(GetLogicalOrigin,SetLogicalOrigin,doc="See `GetLogicalOrigin` and `SetLogicalOrigin`")
4387 LogicalScale = property(GetLogicalScale,SetLogicalScale,doc="See `GetLogicalScale` and `SetLogicalScale`")
4388 MapMode = property(GetMapMode,SetMapMode,doc="See `GetMapMode` and `SetMapMode`")
4389 MultiLineTextExtent = property(GetMultiLineTextExtent,doc="See `GetMultiLineTextExtent`")
4390 Optimization = property(GetOptimization,SetOptimization,doc="See `GetOptimization` and `SetOptimization`")
4391 PPI = property(GetPPI,doc="See `GetPPI`")
4392 PartialTextExtents = property(GetPartialTextExtents,doc="See `GetPartialTextExtents`")
4393 Pen = property(GetPen,SetPen,doc="See `GetPen` and `SetPen`")
4394 Pixel = property(GetPixel,doc="See `GetPixel`")
4395 PixelPoint = property(GetPixelPoint,doc="See `GetPixelPoint`")
4396 Size = property(GetSize,doc="See `GetSize`")
4397 SizeMM = property(GetSizeMM,doc="See `GetSizeMM`")
4398 TextBackground = property(GetTextBackground,SetTextBackground,doc="See `GetTextBackground` and `SetTextBackground`")
4399 TextExtent = property(GetTextExtent,doc="See `GetTextExtent`")
4400 TextForeground = property(GetTextForeground,SetTextForeground,doc="See `GetTextForeground` and `SetTextForeground`")
4401 UserScale = property(GetUserScale,SetUserScale,doc="See `GetUserScale` and `SetUserScale`")
b39fe951 4402 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection)
2131d850 4403_gdi_.DC_swigregister(DC)
d55e5bfc
RD
4404
4405#---------------------------------------------------------------------------
4406
70d7cb34
RD
4407class DCTextColourChanger(object):
4408 """
4409 wx.DCTextColourChanger can be used to temporarily change the DC text
4410 colour and restore it automatically when the object goes out of scope
4411 """
4412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4413 __repr__ = _swig_repr
4414 def __init__(self, *args, **kwargs):
4415 """
4416 __init__(self, DC dc, Colour col) -> DCTextColourChanger
4417
4418 wx.DCTextColourChanger can be used to temporarily change the DC text
4419 colour and restore it automatically when the object goes out of scope
4420 """
4421 _gdi_.DCTextColourChanger_swiginit(self,_gdi_.new_DCTextColourChanger(*args, **kwargs))
4422 __swig_destroy__ = _gdi_.delete_DCTextColourChanger
4423 __del__ = lambda self : None;
4424_gdi_.DCTextColourChanger_swigregister(DCTextColourChanger)
4425
4426class DCPenChanger(object):
4427 """
4428 wx.DCPenChanger can be used to temporarily change the DC pen and
4429 restore it automatically when the object goes out of scope
4430 """
4431 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4432 __repr__ = _swig_repr
4433 def __init__(self, *args, **kwargs):
4434 """
4435 __init__(self, DC dc, Pen pen) -> DCPenChanger
4436
4437 wx.DCPenChanger can be used to temporarily change the DC pen and
4438 restore it automatically when the object goes out of scope
4439 """
4440 _gdi_.DCPenChanger_swiginit(self,_gdi_.new_DCPenChanger(*args, **kwargs))
4441 __swig_destroy__ = _gdi_.delete_DCPenChanger
4442 __del__ = lambda self : None;
4443_gdi_.DCPenChanger_swigregister(DCPenChanger)
4444
4445class DCBrushChanger(object):
4446 """
4447 wx.DCBrushChanger can be used to temporarily change the DC brush and
4448 restore it automatically when the object goes out of scope
4449 """
4450 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4451 __repr__ = _swig_repr
4452 def __init__(self, *args, **kwargs):
4453 """
4454 __init__(self, DC dc, Brush brush) -> DCBrushChanger
4455
4456 wx.DCBrushChanger can be used to temporarily change the DC brush and
4457 restore it automatically when the object goes out of scope
4458 """
4459 _gdi_.DCBrushChanger_swiginit(self,_gdi_.new_DCBrushChanger(*args, **kwargs))
4460 __swig_destroy__ = _gdi_.delete_DCBrushChanger
4461 __del__ = lambda self : None;
4462_gdi_.DCBrushChanger_swigregister(DCBrushChanger)
4463
4464class DCClipper(object):
4465 """
4466 wx.wxDCClipper sets the DC's clipping region when it is constructed,
4467 and then automatically destroys the clipping region when the clipper
4468 goes out of scope.
4469 """
4470 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4471 __repr__ = _swig_repr
4472 def __init__(self, *args):
4473 """
4474 __init__(self, DC dc, Region r) -> DCClipper
4475 __init__(self, DC dc, Rect r) -> DCClipper
4476 __init__(self, DC dc, int x, int y, int w, int h) -> DCClipper
4477
4478 wx.wxDCClipper sets the DC's clipping region when it is constructed,
4479 and then automatically destroys the clipping region when the clipper
4480 goes out of scope.
4481 """
4482 _gdi_.DCClipper_swiginit(self,_gdi_.new_DCClipper(*args))
4483 __swig_destroy__ = _gdi_.delete_DCClipper
4484 __del__ = lambda self : None;
4485_gdi_.DCClipper_swigregister(DCClipper)
4486
4487#---------------------------------------------------------------------------
4488
d55e5bfc 4489class ScreenDC(DC):
f5b96ee1
RD
4490 """
4491 A wxScreenDC can be used to paint anywhere on the screen. This should
4492 normally be constructed as a temporary stack object; don't store a
4493 wxScreenDC object.
4494
4495 """
1bd55598
RD
4496 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4497 __repr__ = _swig_repr
4498 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4499 """
4500 __init__(self) -> ScreenDC
4501
4502 A wxScreenDC can be used to paint anywhere on the screen. This should
4503 normally be constructed as a temporary stack object; don't store a
4504 wxScreenDC object.
4505
4506 """
1bd55598 4507 _gdi_.ScreenDC_swiginit(self,_gdi_.new_ScreenDC(*args, **kwargs))
d55e5bfc 4508 def StartDrawingOnTopWin(*args, **kwargs):
f5b96ee1
RD
4509 """
4510 StartDrawingOnTopWin(self, Window window) -> bool
4511
4512 Specify that the area of the screen to be drawn upon coincides with
4513 the given window.
4514
4515 :see: `EndDrawingOnTop`
4516 """
d55e5bfc
RD
4517 return _gdi_.ScreenDC_StartDrawingOnTopWin(*args, **kwargs)
4518
4519 def StartDrawingOnTop(*args, **kwargs):
f5b96ee1
RD
4520 """
4521 StartDrawingOnTop(self, Rect rect=None) -> bool
4522
4523 Specify that the area is the given rectangle, or the whole screen if
4524 ``None`` is passed.
4525
4526 :see: `EndDrawingOnTop`
4527 """
d55e5bfc
RD
4528 return _gdi_.ScreenDC_StartDrawingOnTop(*args, **kwargs)
4529
4530 def EndDrawingOnTop(*args, **kwargs):
f5b96ee1
RD
4531 """
4532 EndDrawingOnTop(self) -> bool
4533
4534 Use this in conjunction with `StartDrawingOnTop` or
4535 `StartDrawingOnTopWin` to ensure that drawing to the screen occurs on
4536 top of existing windows. Without this, some window systems (such as X)
4537 only allow drawing to take place underneath other windows.
4538
4539 You might use this pair of functions when implementing a drag feature,
4540 for example as in the `wx.SplitterWindow` implementation.
4541
4542 These functions are probably obsolete since the X implementations
4543 allow drawing directly on the screen now. However, the fact that this
4544 function allows the screen to be refreshed afterwards may be useful
4545 to some applications.
4546 """
d55e5bfc
RD
4547 return _gdi_.ScreenDC_EndDrawingOnTop(*args, **kwargs)
4548
2131d850 4549_gdi_.ScreenDC_swigregister(ScreenDC)
d55e5bfc
RD
4550
4551#---------------------------------------------------------------------------
4552
72ef6efb
RD
4553class WindowDC(DC):
4554 """
4555 A wx.WindowDC must be constructed if an application wishes to paint on
4556 the whole area of a window (client and decorations). This should
4557 normally be constructed as a temporary stack object; don't store a
4558 wx.WindowDC object.
4559 """
4560 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4561 __repr__ = _swig_repr
4562 def __init__(self, *args, **kwargs):
4563 """
4564 __init__(self, Window win) -> WindowDC
4565
4566 Constructor. Pass the window on which you wish to paint.
4567 """
4568 _gdi_.WindowDC_swiginit(self,_gdi_.new_WindowDC(*args, **kwargs))
4569_gdi_.WindowDC_swigregister(WindowDC)
4570
4571#---------------------------------------------------------------------------
4572
4573class ClientDC(WindowDC):
f5b96ee1
RD
4574 """
4575 A wx.ClientDC must be constructed if an application wishes to paint on
4576 the client area of a window from outside an EVT_PAINT event. This should
4577 normally be constructed as a temporary stack object; don't store a
4578 wx.ClientDC object long term.
4579
4580 To draw on a window from within an EVT_PAINT handler, construct a
4581 `wx.PaintDC` object.
4582
4583 To draw on the whole window including decorations, construct a
4584 `wx.WindowDC` object (Windows only).
4585
4586 """
1bd55598
RD
4587 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4588 __repr__ = _swig_repr
4589 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4590 """
4591 __init__(self, Window win) -> ClientDC
4592
4593 Constructor. Pass the window on which you wish to paint.
4594 """
1bd55598 4595 _gdi_.ClientDC_swiginit(self,_gdi_.new_ClientDC(*args, **kwargs))
2131d850 4596_gdi_.ClientDC_swigregister(ClientDC)
d55e5bfc
RD
4597
4598#---------------------------------------------------------------------------
4599
72ef6efb 4600class PaintDC(ClientDC):
f5b96ee1
RD
4601 """
4602 A wx.PaintDC must be constructed if an application wishes to paint on
4603 the client area of a window from within an EVT_PAINT event
4604 handler. This should normally be constructed as a temporary stack
4605 object; don't store a wx.PaintDC object. If you have an EVT_PAINT
4606 handler, you **must** create a wx.PaintDC object within it even if you
4607 don't actually use it.
4608
4609 Using wx.PaintDC within EVT_PAINT handlers is important because it
4610 automatically sets the clipping area to the damaged area of the
4611 window. Attempts to draw outside this area do not appear.
4612
4613 To draw on a window from outside EVT_PAINT handlers, construct a
4614 `wx.ClientDC` object.
4615
4616 """
1bd55598
RD
4617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4618 __repr__ = _swig_repr
4619 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4620 """
4621 __init__(self, Window win) -> PaintDC
4622
4623 Constructor. Pass the window on which you wish to paint.
4624 """
1bd55598 4625 _gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs))
2131d850 4626_gdi_.PaintDC_swigregister(PaintDC)
d55e5bfc
RD
4627
4628#---------------------------------------------------------------------------
4629
26c4d26f
RD
4630class MemoryDC(WindowDC):
4631 """
4632 A memory device context provides a means to draw graphics onto a
4633 bitmap. A bitmap must be selected into the new memory DC before it may
4634 be used for anything. Typical usage is as follows::
4635
4636 dc = wx.MemoryDC()
4637 dc.SelectObject(bitmap)
4638 # draw on the dc using any of the Draw methods
4639 dc.SelectObject(wx.NullBitmap)
4640 # the bitmap now contains wahtever was drawn upon it
4641
4642 Note that the memory DC *must* be deleted (or the bitmap selected out
4643 of it) before a bitmap can be reselected into another memory DC.
4644
4645 """
4646 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4647 __repr__ = _swig_repr
4648 def __init__(self, *args, **kwargs):
4649 """
4650 __init__(self, Bitmap bitmap=NullBitmap) -> MemoryDC
4651
4652 Constructs a new memory device context.
4653
4654 Use the Ok member to test whether the constructor was successful in
4655 creating a usable device context. If a bitmap is not given to this
4656 constructor then don't forget to select a bitmap into the DC before
4657 drawing on it.
4658 """
4659 _gdi_.MemoryDC_swiginit(self,_gdi_.new_MemoryDC(*args, **kwargs))
4660 def SelectObject(*args, **kwargs):
4661 """
4662 SelectObject(self, Bitmap bitmap)
4663
4664 Selects the bitmap into the device context, to use as the memory
4665 bitmap. Selecting the bitmap into a memory DC allows you to draw into
4666 the DC, and therefore the bitmap, and also to use Blit to copy the
4667 bitmap to a window.
4668
4669 If the argument is wx.NullBitmap (or some other uninitialised
4670 `wx.Bitmap`) the current bitmap is selected out of the device context,
4671 and the original bitmap restored, allowing the current bitmap to be
4672 destroyed safely.
4673 """
4674 return _gdi_.MemoryDC_SelectObject(*args, **kwargs)
4675
4676 def SelectObjectAsSource(*args, **kwargs):
4677 """SelectObjectAsSource(self, Bitmap bmp)"""
4678 return _gdi_.MemoryDC_SelectObjectAsSource(*args, **kwargs)
4679
4680_gdi_.MemoryDC_swigregister(MemoryDC)
4681
4682def MemoryDCFromDC(*args, **kwargs):
4683 """
4684 MemoryDCFromDC(DC oldDC) -> MemoryDC
4685
4686 Creates a DC that is compatible with the oldDC.
4687 """
4688 val = _gdi_.new_MemoryDCFromDC(*args, **kwargs)
4689 return val
4690
4691#---------------------------------------------------------------------------
4692
24f6c4e8
RD
4693BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
4694BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
4695class BufferedDC(MemoryDC):
4696 """
4697 This simple class provides a simple way to avoid flicker: when drawing
4698 on it, everything is in fact first drawn on an in-memory buffer (a
4699 `wx.Bitmap`) and then copied to the screen only once, when this object
be68621e
RD
4700 is destroyed. You can either provide a buffer bitmap yourself, and
4701 reuse it the next time something needs painted, or you can let the
4702 buffered DC create and provide a buffer bitmap itself.
24f6c4e8 4703
be68621e 4704 Buffered DCs can be used in the same way as any other device context.
24f6c4e8
RD
4705 wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
4706 use it in your EVT_PAINT handler, you should look at
be68621e
RD
4707 `wx.BufferedPaintDC`. You can also use a wx.BufferedDC without
4708 providing a target DC. In this case the operations done on the dc
4709 will only be written to the buffer bitmap and *not* to any window, so
4710 you will want to have provided the buffer bitmap and then reuse it
4711 when it needs painted to the window.
24f6c4e8
RD
4712
4713 Please note that GTK+ 2.0 and OS X provide double buffering themselves
be68621e
RD
4714 natively. You may want to use `wx.Window.IsDoubleBuffered` to
4715 determine whether you need to use buffering or not, or use
4716 `wx.AutoBufferedPaintDC` to avoid needless double buffering on systems
4717 that already do it automatically.
4718
4719
24f6c4e8
RD
4720
4721 """
4722 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4723 __repr__ = _swig_repr
4724 def __init__(self, *args):
4725 """
4726 __init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
4727 __init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
4728
4729 Constructs a buffered DC.
4730 """
4731 _gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
e7e9d1b8
RD
4732 # save a ref so the other dc will not be deleted before self
4733 self.__dc = args[0]
4734 # also save a ref to the bitmap
4735 if len(args) > 1: self.__bmp = args[1]
4736
24f6c4e8
RD
4737
4738 __swig_destroy__ = _gdi_.delete_BufferedDC
4739 __del__ = lambda self : None;
4740 def UnMask(*args, **kwargs):
4741 """
4742 UnMask(self)
4743
4744 Blits the buffer to the dc, and detaches the dc from the buffer (so it
4745 can be effectively used once only). This is usually only called in
4746 the destructor.
4747 """
4748 return _gdi_.BufferedDC_UnMask(*args, **kwargs)
4749
b6df5cf9
RD
4750 def SetStyle(*args, **kwargs):
4751 """SetStyle(self, int style)"""
4752 return _gdi_.BufferedDC_SetStyle(*args, **kwargs)
4753
4754 def GetStyle(*args, **kwargs):
4755 """GetStyle(self) -> int"""
4756 return _gdi_.BufferedDC_GetStyle(*args, **kwargs)
4757
24f6c4e8
RD
4758_gdi_.BufferedDC_swigregister(BufferedDC)
4759
4760class BufferedPaintDC(BufferedDC):
4761 """
4762 This is a subclass of `wx.BufferedDC` which can be used inside of an
4763 EVT_PAINT event handler. Just create an object of this class instead
4764 of `wx.PaintDC` and that's all you have to do to (mostly) avoid
4765 flicker. The only thing to watch out for is that if you are using this
4766 class together with `wx.ScrolledWindow`, you probably do **not** want
4767 to call `wx.Window.PrepareDC` on it as it already does this internally
4768 for the real underlying `wx.PaintDC`.
4769
4770 If your window is already fully buffered in a `wx.Bitmap` then your
4771 EVT_PAINT handler can be as simple as just creating a
4772 ``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
4773 automatically when it is destroyed. For example::
4774
4775 def OnPaint(self, event):
4776 dc = wx.BufferedPaintDC(self, self.buffer)
4777
4778
4779
4780 """
4781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4782 __repr__ = _swig_repr
4783 def __init__(self, *args, **kwargs):
4784 """
4785 __init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
4786
4787 Create a buffered paint DC. As with `wx.BufferedDC`, you may either
4788 provide the bitmap to be used for buffering or let this object create
4789 one internally (in the latter case, the size of the client part of the
4790 window is automatically used).
4791 """
4792 _gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
e7e9d1b8
RD
4793 if len(args) > 1: self.__bmp = args[1]
4794
24f6c4e8
RD
4795_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
4796
4797#---------------------------------------------------------------------------
4798
4799class AutoBufferedPaintDC(DC):
b39fe951
RD
4800 """
4801 If the current platform double buffers by default then this DC is the
4802 same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
8e99bda9
RD
4803
4804 :see: `wx.AutoBufferedPaintDCFactory`
24f6c4e8 4805
b39fe951 4806 """
24f6c4e8
RD
4807 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4808 __repr__ = _swig_repr
4809 def __init__(self, *args, **kwargs):
4810 """
4811 __init__(self, Window win) -> AutoBufferedPaintDC
4812
4813 If the current platform double buffers by default then this DC is the
4814 same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
4815
4816 :see: `wx.AutoBufferedPaintDCFactory`
4817
4818 """
4819 _gdi_.AutoBufferedPaintDC_swiginit(self,_gdi_.new_AutoBufferedPaintDC(*args, **kwargs))
4820_gdi_.AutoBufferedPaintDC_swigregister(AutoBufferedPaintDC)
b39fe951 4821
8e99bda9
RD
4822
4823def AutoBufferedPaintDCFactory(*args, **kwargs):
4824 """
4825 AutoBufferedPaintDCFactory(Window window) -> DC
4826
4827 Checks if the window is natively double buffered and will return a
24f6c4e8
RD
4828 `wx.PaintDC` if it is, a `wx.BufferedPaintDC` otherwise. The advantage of
4829 this function over `wx.AutoBufferedPaintDC` is that this function will check
4830 if the the specified window has double-buffering enabled rather than just
4831 going by platform defaults.
8e99bda9
RD
4832 """
4833 return _gdi_.AutoBufferedPaintDCFactory(*args, **kwargs)
b39fe951
RD
4834#---------------------------------------------------------------------------
4835
d55e5bfc 4836class MirrorDC(DC):
f5b96ee1
RD
4837 """
4838 wx.MirrorDC is a simple wrapper class which is always associated with a
4839 real `wx.DC` object and either forwards all of its operations to it
4840 without changes (no mirroring takes place) or exchanges x and y
4841 coordinates which makes it possible to reuse the same code to draw a
4842 figure and its mirror -- i.e. reflection related to the diagonal line
4843 x == y.
4844 """
1bd55598
RD
4845 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4846 __repr__ = _swig_repr
4847 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4848 """
4849 __init__(self, DC dc, bool mirror) -> MirrorDC
4850
4851 Creates a mirrored DC associated with the real *dc*. Everything drawn
4852 on the wx.MirrorDC will appear on the *dc*, and will be mirrored if
4853 *mirror* is True.
4854 """
1bd55598 4855 _gdi_.MirrorDC_swiginit(self,_gdi_.new_MirrorDC(*args, **kwargs))
2131d850 4856_gdi_.MirrorDC_swigregister(MirrorDC)
d55e5bfc
RD
4857
4858#---------------------------------------------------------------------------
4859
4860class PostScriptDC(DC):
f5b96ee1 4861 """This is a `wx.DC` that can write to PostScript files on any platform."""
1bd55598
RD
4862 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4863 __repr__ = _swig_repr
4864 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4865 """
4866 __init__(self, wxPrintData printData) -> PostScriptDC
4867
4868 Constructs a PostScript printer device context from a `wx.PrintData`
4869 object.
4870 """
1bd55598 4871 _gdi_.PostScriptDC_swiginit(self,_gdi_.new_PostScriptDC(*args, **kwargs))
d55e5bfc
RD
4872 def GetPrintData(*args, **kwargs):
4873 """GetPrintData(self) -> wxPrintData"""
4874 return _gdi_.PostScriptDC_GetPrintData(*args, **kwargs)
4875
4876 def SetPrintData(*args, **kwargs):
4877 """SetPrintData(self, wxPrintData data)"""
4878 return _gdi_.PostScriptDC_SetPrintData(*args, **kwargs)
4879
4880 def SetResolution(*args, **kwargs):
f5b96ee1
RD
4881 """
4882 SetResolution(int ppi)
4883
4884 Set resolution (in pixels per inch) that will be used in PostScript
4885 output. Default is 720ppi.
4886 """
d55e5bfc
RD
4887 return _gdi_.PostScriptDC_SetResolution(*args, **kwargs)
4888
4889 SetResolution = staticmethod(SetResolution)
4890 def GetResolution(*args, **kwargs):
f5b96ee1
RD
4891 """
4892 GetResolution() -> int
4893
4894 Return resolution used in PostScript output.
4895 """
d55e5bfc
RD
4896 return _gdi_.PostScriptDC_GetResolution(*args, **kwargs)
4897
4898 GetResolution = staticmethod(GetResolution)
33d6fd3b 4899 PrintData = property(GetPrintData,SetPrintData,doc="See `GetPrintData` and `SetPrintData`")
2131d850 4900_gdi_.PostScriptDC_swigregister(PostScriptDC)
d55e5bfc
RD
4901
4902def PostScriptDC_SetResolution(*args, **kwargs):
1bd55598 4903 """
f5b96ee1
RD
4904 PostScriptDC_SetResolution(int ppi)
4905
4906 Set resolution (in pixels per inch) that will be used in PostScript
4907 output. Default is 720ppi.
4908 """
1bd55598 4909 return _gdi_.PostScriptDC_SetResolution(*args, **kwargs)
d55e5bfc 4910
1bd55598
RD
4911def PostScriptDC_GetResolution(*args):
4912 """
f5b96ee1
RD
4913 PostScriptDC_GetResolution() -> int
4914
4915 Return resolution used in PostScript output.
4916 """
1bd55598 4917 return _gdi_.PostScriptDC_GetResolution(*args)
d55e5bfc
RD
4918
4919#---------------------------------------------------------------------------
4920
4921class MetaFile(_core.Object):
36ed4f51 4922 """Proxy of C++ MetaFile class"""
1bd55598
RD
4923 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4924 __repr__ = _swig_repr
4925 def __init__(self, *args, **kwargs):
d55e5bfc 4926 """__init__(self, String filename=EmptyString) -> MetaFile"""
1bd55598
RD
4927 _gdi_.MetaFile_swiginit(self,_gdi_.new_MetaFile(*args, **kwargs))
4928 __swig_destroy__ = _gdi_.delete_MetaFile
4929 __del__ = lambda self : None;
b39fe951
RD
4930 def IsOk(*args, **kwargs):
4931 """IsOk(self) -> bool"""
4932 return _gdi_.MetaFile_IsOk(*args, **kwargs)
d55e5bfc 4933
b39fe951 4934 Ok = IsOk
d55e5bfc
RD
4935 def SetClipboard(*args, **kwargs):
4936 """SetClipboard(self, int width=0, int height=0) -> bool"""
4937 return _gdi_.MetaFile_SetClipboard(*args, **kwargs)
4938
4939 def GetSize(*args, **kwargs):
4940 """GetSize(self) -> Size"""
4941 return _gdi_.MetaFile_GetSize(*args, **kwargs)
4942
4943 def GetWidth(*args, **kwargs):
4944 """GetWidth(self) -> int"""
4945 return _gdi_.MetaFile_GetWidth(*args, **kwargs)
4946
4947 def GetHeight(*args, **kwargs):
4948 """GetHeight(self) -> int"""
4949 return _gdi_.MetaFile_GetHeight(*args, **kwargs)
4950
b39fe951 4951 def __nonzero__(self): return self.IsOk()
2131d850 4952_gdi_.MetaFile_swigregister(MetaFile)
d55e5bfc
RD
4953
4954class MetaFileDC(DC):
36ed4f51 4955 """Proxy of C++ MetaFileDC class"""
1bd55598
RD
4956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4957 __repr__ = _swig_repr
4958 def __init__(self, *args, **kwargs):
d55e5bfc
RD
4959 """
4960 __init__(self, String filename=EmptyString, int width=0, int height=0,
4961 String description=EmptyString) -> MetaFileDC
4962 """
1bd55598 4963 _gdi_.MetaFileDC_swiginit(self,_gdi_.new_MetaFileDC(*args, **kwargs))
d55e5bfc
RD
4964 def Close(*args, **kwargs):
4965 """Close(self) -> MetaFile"""
4966 return _gdi_.MetaFileDC_Close(*args, **kwargs)
4967
2131d850 4968_gdi_.MetaFileDC_swigregister(MetaFileDC)
d55e5bfc
RD
4969
4970class PrinterDC(DC):
36ed4f51 4971 """Proxy of C++ PrinterDC class"""
1bd55598
RD
4972 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4973 __repr__ = _swig_repr
4974 def __init__(self, *args, **kwargs):
d55e5bfc 4975 """__init__(self, wxPrintData printData) -> PrinterDC"""
1bd55598 4976 _gdi_.PrinterDC_swiginit(self,_gdi_.new_PrinterDC(*args, **kwargs))
2131d850 4977_gdi_.PrinterDC_swigregister(PrinterDC)
d55e5bfc 4978
d55e5bfc
RD
4979#---------------------------------------------------------------------------
4980
70d7cb34 4981class GraphicsObject(_core.Object):
26c4d26f
RD
4982 """
4983 This class is the superclass of native graphics objects like pens
4984 etc. It provides the internal reference counting. It is not to be
4985 instantiated by user code.
4986 """
70d7cb34
RD
4987 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4988 __repr__ = _swig_repr
4989 def __init__(self, *args, **kwargs):
26c4d26f
RD
4990 """
4991 __init__(self, GraphicsRenderer renderer=None) -> GraphicsObject
4992
4993 This class is the superclass of native graphics objects like pens
4994 etc. It provides the internal reference counting. It is not to be
4995 instantiated by user code.
4996 """
70d7cb34
RD
4997 _gdi_.GraphicsObject_swiginit(self,_gdi_.new_GraphicsObject(*args, **kwargs))
4998 __swig_destroy__ = _gdi_.delete_GraphicsObject
4999 __del__ = lambda self : None;
5000 def IsNull(*args, **kwargs):
26c4d26f
RD
5001 """
5002 IsNull(self) -> bool
5003
5004 Is this object valid (false) or still empty (true)?
5005 """
70d7cb34
RD
5006 return _gdi_.GraphicsObject_IsNull(*args, **kwargs)
5007
5008 def GetRenderer(*args, **kwargs):
26c4d26f
RD
5009 """
5010 GetRenderer(self) -> GraphicsRenderer
5011
5012 Returns the renderer that was used to create this instance, or
5013 ``None`` if it has not been initialized yet.
5014 """
70d7cb34
RD
5015 return _gdi_.GraphicsObject_GetRenderer(*args, **kwargs)
5016
5017_gdi_.GraphicsObject_swigregister(GraphicsObject)
5018
5019class GraphicsPen(GraphicsObject):
26c4d26f
RD
5020 """
5021 A wx.GraphicsPen is a native representation of a pen. It is used for
5022 stroking a path on a `wx.GraphicsContext`. The contents are specific and
5023 private to the respective renderer. The only way to get a valid instance
5024 is via a CreatePen call on the graphics context or the renderer
5025 instance.
5026 """
70d7cb34
RD
5027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5028 __repr__ = _swig_repr
5029 def __init__(self, *args, **kwargs):
26c4d26f
RD
5030 """
5031 __init__(self) -> GraphicsPen
5032
5033 A wx.GraphicsPen is a native representation of a pen. It is used for
5034 stroking a path on a `wx.GraphicsContext`. The contents are specific and
5035 private to the respective renderer. The only way to get a valid instance
5036 is via a CreatePen call on the graphics context or the renderer
5037 instance.
5038 """
70d7cb34
RD
5039 _gdi_.GraphicsPen_swiginit(self,_gdi_.new_GraphicsPen(*args, **kwargs))
5040 __swig_destroy__ = _gdi_.delete_GraphicsPen
5041 __del__ = lambda self : None;
5042_gdi_.GraphicsPen_swigregister(GraphicsPen)
5043
5044class GraphicsBrush(GraphicsObject):
26c4d26f
RD
5045 """
5046 A wx.GraphicsBrush is a native representation of a brush. It is used
5047 for filling a path on a `wx.GraphicsContext`. The contents are
5048 specific and private to the respective renderer. The only way to get a
5049 valid instance is via a Create...Brush call on the graphics context or
5050 the renderer instance.
5051 """
70d7cb34
RD
5052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5053 __repr__ = _swig_repr
5054 def __init__(self, *args, **kwargs):
26c4d26f
RD
5055 """
5056 __init__(self) -> GraphicsBrush
5057
5058 A wx.GraphicsBrush is a native representation of a brush. It is used
5059 for filling a path on a `wx.GraphicsContext`. The contents are
5060 specific and private to the respective renderer. The only way to get a
5061 valid instance is via a Create...Brush call on the graphics context or
5062 the renderer instance.
5063 """
70d7cb34
RD
5064 _gdi_.GraphicsBrush_swiginit(self,_gdi_.new_GraphicsBrush(*args, **kwargs))
5065 __swig_destroy__ = _gdi_.delete_GraphicsBrush
5066 __del__ = lambda self : None;
5067_gdi_.GraphicsBrush_swigregister(GraphicsBrush)
5068
5069class GraphicsFont(GraphicsObject):
26c4d26f
RD
5070 """
5071 A `wx.GraphicsFont` is a native representation of a font (including
5072 text colour). The contents are specific an private to the respective
5073 renderer. The only way to get a valid instance is via a CreateFont
5074 call on the graphics context or the renderer instance.
5075 """
70d7cb34
RD
5076 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5077 __repr__ = _swig_repr
5078 def __init__(self, *args, **kwargs):
26c4d26f
RD
5079 """
5080 __init__(self) -> GraphicsFont
5081
5082 A `wx.GraphicsFont` is a native representation of a font (including
5083 text colour). The contents are specific an private to the respective
5084 renderer. The only way to get a valid instance is via a CreateFont
5085 call on the graphics context or the renderer instance.
5086 """
70d7cb34
RD
5087 _gdi_.GraphicsFont_swiginit(self,_gdi_.new_GraphicsFont(*args, **kwargs))
5088 __swig_destroy__ = _gdi_.delete_GraphicsFont
5089 __del__ = lambda self : None;
5090_gdi_.GraphicsFont_swigregister(GraphicsFont)
5091
5c8c7dd3 5092class GraphicsMatrix(GraphicsObject):
26c4d26f
RD
5093 """
5094 A wx.GraphicsMatrix is a native representation of an affine
5095 matrix. The contents are specific an private to the respective
5096 renderer. The only way to get a valid instance is via a CreateMatrix
5097 call on the graphics context or the renderer instance.
5098 """
5c8c7dd3 5099 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5c8c7dd3 5100 __repr__ = _swig_repr
8f514ab4 5101 def __init__(self, *args, **kwargs):
26c4d26f
RD
5102 """
5103 __init__(self) -> GraphicsMatrix
5104
5105 A wx.GraphicsMatrix is a native representation of an affine
5106 matrix. The contents are specific an private to the respective
5107 renderer. The only way to get a valid instance is via a CreateMatrix
5108 call on the graphics context or the renderer instance.
5109 """
8f514ab4 5110 _gdi_.GraphicsMatrix_swiginit(self,_gdi_.new_GraphicsMatrix(*args, **kwargs))
5c8c7dd3
RD
5111 __swig_destroy__ = _gdi_.delete_GraphicsMatrix
5112 __del__ = lambda self : None;
5113 def Concat(*args, **kwargs):
5114 """
5115 Concat(self, GraphicsMatrix t)
5116
26c4d26f 5117 Concatenates the passed in matrix to the current matrix.
5c8c7dd3
RD
5118 """
5119 return _gdi_.GraphicsMatrix_Concat(*args, **kwargs)
5120
5c8c7dd3
RD
5121 def Set(*args, **kwargs):
5122 """
5123 Set(self, Double a=1.0, Double b=0.0, Double c=0.0, Double d=1.0,
5124 Double tx=0.0, Double ty=0.0)
5125
26c4d26f
RD
5126 Sets the matrix to the specified values (default values are the
5127 identity matrix.)
5c8c7dd3
RD
5128 """
5129 return _gdi_.GraphicsMatrix_Set(*args, **kwargs)
5130
5131 def Invert(*args, **kwargs):
5132 """
5133 Invert(self)
5134
26c4d26f 5135 Inverts the matrix.
5c8c7dd3
RD
5136 """
5137 return _gdi_.GraphicsMatrix_Invert(*args, **kwargs)
5138
5139 def IsEqual(*args, **kwargs):
5140 """
5141 IsEqual(self, GraphicsMatrix t) -> bool
5142
26c4d26f 5143 Returns ``True`` if the elements of the transformation matrix are equal
5c8c7dd3
RD
5144 """
5145 return _gdi_.GraphicsMatrix_IsEqual(*args, **kwargs)
5146
5147 def IsIdentity(*args, **kwargs):
5148 """
5149 IsIdentity(self) -> bool
5150
26c4d26f 5151 Returns ``True`` if this is the identity matrix
5c8c7dd3
RD
5152 """
5153 return _gdi_.GraphicsMatrix_IsIdentity(*args, **kwargs)
5154
5155 def Translate(*args, **kwargs):
5156 """
5157 Translate(self, Double dx, Double dy)
5158
26c4d26f 5159 Add a translation to this matrix.
5c8c7dd3
RD
5160 """
5161 return _gdi_.GraphicsMatrix_Translate(*args, **kwargs)
5162
5163 def Scale(*args, **kwargs):
5164 """
5165 Scale(self, Double xScale, Double yScale)
5166
26c4d26f 5167 Scales this matrix.
5c8c7dd3
RD
5168 """
5169 return _gdi_.GraphicsMatrix_Scale(*args, **kwargs)
5170
5171 def Rotate(*args, **kwargs):
5172 """
5173 Rotate(self, Double angle)
5174
26c4d26f 5175 Rotates this matrix. The angle should be specified in radians.
5c8c7dd3
RD
5176 """
5177 return _gdi_.GraphicsMatrix_Rotate(*args, **kwargs)
5178
5179 def TransformPoint(*args, **kwargs):
5180 """
5181 TransformPoint(self, x, y) --> (x, y)
5182
26c4d26f 5183 Applies this matrix to a point, returns the resulting point values
5c8c7dd3
RD
5184 """
5185 return _gdi_.GraphicsMatrix_TransformPoint(*args, **kwargs)
5186
5187 def TransformDistance(*args, **kwargs):
5188 """
5189 TransformDistance(self, dx, dy) --> (dx, dy)
5190
26c4d26f
RD
5191 Applies this matrix to a distance (ie. performs all transforms except
5192 translations)
5c8c7dd3
RD
5193 """
5194 return _gdi_.GraphicsMatrix_TransformDistance(*args, **kwargs)
5195
5196 def GetNativeMatrix(*args, **kwargs):
5197 """
5198 GetNativeMatrix(self) -> void
5199
26c4d26f
RD
5200 Returns the native representation of the matrix. For CoreGraphics this
5201 is a CFAffineMatrix pointer. For GDIPlus a Matrix Pointer and for
5202 Cairo a cairo_matrix_t pointer. NOTE: For wxPython we still need a
5203 way to make this value usable.
5c8c7dd3
RD
5204 """
5205 return _gdi_.GraphicsMatrix_GetNativeMatrix(*args, **kwargs)
5206
5207_gdi_.GraphicsMatrix_swigregister(GraphicsMatrix)
5208
70d7cb34 5209class GraphicsPath(GraphicsObject):
72ef6efb
RD
5210 """Proxy of C++ GraphicsPath class"""
5211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
72ef6efb 5212 __repr__ = _swig_repr
8f514ab4
RD
5213 def __init__(self, *args, **kwargs):
5214 """__init__(self) -> GraphicsPath"""
5215 _gdi_.GraphicsPath_swiginit(self,_gdi_.new_GraphicsPath(*args, **kwargs))
72ef6efb
RD
5216 __swig_destroy__ = _gdi_.delete_GraphicsPath
5217 __del__ = lambda self : None;
70d7cb34 5218 def MoveToPoint(*args):
72ef6efb
RD
5219 """
5220 MoveToPoint(self, Double x, Double y)
70d7cb34 5221 MoveToPoint(self, Point2D p)
72ef6efb 5222
26c4d26f 5223 Begins a new subpath at the specified point.
72ef6efb 5224 """
70d7cb34 5225 return _gdi_.GraphicsPath_MoveToPoint(*args)
72ef6efb 5226
70d7cb34 5227 def AddLineToPoint(*args):
72ef6efb
RD
5228 """
5229 AddLineToPoint(self, Double x, Double y)
70d7cb34 5230 AddLineToPoint(self, Point2D p)
72ef6efb 5231
26c4d26f 5232 Adds a straight line from the current point to the specified point.
72ef6efb 5233 """
70d7cb34 5234 return _gdi_.GraphicsPath_AddLineToPoint(*args)
72ef6efb 5235
70d7cb34 5236 def AddCurveToPoint(*args):
72ef6efb
RD
5237 """
5238 AddCurveToPoint(self, Double cx1, Double cy1, Double cx2, Double cy2, Double x,
5239 Double y)
70d7cb34 5240 AddCurveToPoint(self, Point2D c1, Point2D c2, Point2D e)
72ef6efb
RD
5241
5242 Adds a cubic Bezier curve from the current point, using two control
5243 points and an end point
5244 """
70d7cb34
RD
5245 return _gdi_.GraphicsPath_AddCurveToPoint(*args)
5246
5247 def AddPath(*args, **kwargs):
5248 """
5249 AddPath(self, GraphicsPath path)
5250
26c4d26f 5251 Adds another path
70d7cb34
RD
5252 """
5253 return _gdi_.GraphicsPath_AddPath(*args, **kwargs)
72ef6efb
RD
5254
5255 def CloseSubpath(*args, **kwargs):
5256 """
5257 CloseSubpath(self)
5258
26c4d26f 5259 Closes the current sub-path.
72ef6efb
RD
5260 """
5261 return _gdi_.GraphicsPath_CloseSubpath(*args, **kwargs)
5262
5263 def GetCurrentPoint(*args, **kwargs):
5264 """
5265 GetCurrentPoint(self) -> Point2D
5266
5267 Gets the last point of the current path, (0,0) if not yet set
5268 """
5269 return _gdi_.GraphicsPath_GetCurrentPoint(*args, **kwargs)
5270
70d7cb34 5271 def AddArc(*args):
72ef6efb
RD
5272 """
5273 AddArc(self, Double x, Double y, Double r, Double startAngle, Double endAngle,
5274 bool clockwise)
70d7cb34
RD
5275 AddArc(self, Point2D c, Double r, Double startAngle, Double endAngle,
5276 bool clockwise)
72ef6efb
RD
5277
5278 Adds an arc of a circle centering at (x,y) with radius (r) from
5279 startAngle to endAngle
5280 """
70d7cb34 5281 return _gdi_.GraphicsPath_AddArc(*args)
72ef6efb
RD
5282
5283 def AddQuadCurveToPoint(*args, **kwargs):
5284 """
5285 AddQuadCurveToPoint(self, Double cx, Double cy, Double x, Double y)
5286
5287 Adds a quadratic Bezier curve from the current point, using a control
5288 point and an end point
5289 """
5290 return _gdi_.GraphicsPath_AddQuadCurveToPoint(*args, **kwargs)
5291
5292 def AddRectangle(*args, **kwargs):
5293 """
5294 AddRectangle(self, Double x, Double y, Double w, Double h)
5295
26c4d26f 5296 Appends a rectangle as a new closed subpath.
72ef6efb
RD
5297 """
5298 return _gdi_.GraphicsPath_AddRectangle(*args, **kwargs)
5299
5300 def AddCircle(*args, **kwargs):
5301 """
5302 AddCircle(self, Double x, Double y, Double r)
5303
26c4d26f 5304 Appends a circle around (x,y) with radius r as a new closed subpath.
72ef6efb
RD
5305 """
5306 return _gdi_.GraphicsPath_AddCircle(*args, **kwargs)
5307
5308 def AddArcToPoint(*args, **kwargs):
5309 """
5310 AddArcToPoint(self, Double x1, Double y1, Double x2, Double y2, Double r)
5311
26c4d26f 5312 Appends an arc to two tangents connecting (current) to (x1,y1) and (x1,y1)
72ef6efb
RD
5313 to (x2,y2), also a straight line from (current) to (x1,y1)
5314 """
5315 return _gdi_.GraphicsPath_AddArcToPoint(*args, **kwargs)
5316
70d7cb34
RD
5317 def AddEllipse(*args, **kwargs):
5318 """
5319 AddEllipse(self, Double x, Double y, Double w, Double h)
5320
26c4d26f 5321 Appends an ellipse fitting into the passed in rectangle.
70d7cb34
RD
5322 """
5323 return _gdi_.GraphicsPath_AddEllipse(*args, **kwargs)
5324
5325 def AddRoundedRectangle(*args, **kwargs):
5326 """
5327 AddRoundedRectangle(self, Double x, Double y, Double w, Double h, Double radius)
5328
26c4d26f 5329 Appends a rounded rectangle.
70d7cb34
RD
5330 """
5331 return _gdi_.GraphicsPath_AddRoundedRectangle(*args, **kwargs)
5332
5333 def GetNativePath(*args, **kwargs):
5334 """
5335 GetNativePath(self) -> void
5336
26c4d26f
RD
5337 Returns the native path (CGPathRef for Core Graphics, Path pointer for
5338 GDIPlus and a cairo_path_t pointer for cairo). NOTE: For wxPython we
5339 still need a way to make this value usable.
70d7cb34
RD
5340 """
5341 return _gdi_.GraphicsPath_GetNativePath(*args, **kwargs)
5342
5343 def UnGetNativePath(*args, **kwargs):
5344 """
5345 UnGetNativePath(self, void p)
5346
26c4d26f
RD
5347 Gives back the native path returned by GetNativePath() because there
5348 might be some deallocations necessary (eg on cairo the native path
5349 returned by GetNativePath is newly allocated each time).
70d7cb34
RD
5350 """
5351 return _gdi_.GraphicsPath_UnGetNativePath(*args, **kwargs)
5352
5353 def Transform(*args, **kwargs):
5354 """
5355 Transform(self, GraphicsMatrix matrix)
5356
26c4d26f 5357 Transforms each point of this path by the matrix
70d7cb34
RD
5358 """
5359 return _gdi_.GraphicsPath_Transform(*args, **kwargs)
5360
5361 def GetBox(*args, **kwargs):
5362 """
5363 GetBox(self) -> wxRect2DDouble
5364
26c4d26f 5365 Gets the bounding box enclosing all points (possibly including control points)
70d7cb34
RD
5366 """
5367 return _gdi_.GraphicsPath_GetBox(*args, **kwargs)
5368
5369 def Contains(*args):
5370 """
8f514ab4
RD
5371 Contains(self, Double x, Double y, int fillStyle=ODDEVEN_RULE) -> bool
5372 Contains(self, wxPoint2DDouble c, int fillStyle=ODDEVEN_RULE) -> bool
26c4d26f
RD
5373
5374 Returns ``True`` if the point is within the path.
70d7cb34
RD
5375 """
5376 return _gdi_.GraphicsPath_Contains(*args)
5377
72ef6efb 5378_gdi_.GraphicsPath_swigregister(GraphicsPath)
70d7cb34
RD
5379
5380class GraphicsContext(GraphicsObject):
26c4d26f
RD
5381 """
5382 A `wx.GraphicsContext` instance is the object that is drawn upon. It is
5383 created by a renderer using the CreateContext calls, this can be done
5384 either directly using a renderer instance, or indirectly using the
5385 static convenience CreateXXX functions of wx.GraphicsContext that
5386 always delegate the task to the default renderer.
5387 """
72ef6efb
RD
5388 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5389 def __init__(self): raise AttributeError, "No constructor defined"
5390 __repr__ = _swig_repr
5391 __swig_destroy__ = _gdi_.delete_GraphicsContext
5392 __del__ = lambda self : None;
0a27f394
RD
5393 def Create(*args):
5394 """
5395 Create(WindowDC dc) -> GraphicsContext
5396 Create(Window window) -> GraphicsContext
26c4d26f
RD
5397
5398 Creates a wx.GraphicsContext either from a window or a DC.
0a27f394 5399 """
be68621e
RD
5400 val = _gdi_.GraphicsContext_Create(*args)
5401 val.__dc = args[0] # save a ref so the dc will not be deleted before self
5402 return val
72ef6efb
RD
5403
5404 Create = staticmethod(Create)
f89238b9
RD
5405 def CreateMeasuringContext(*args):
5406 """
5407 CreateMeasuringContext() -> GraphicsContext
5408
5409 Create a lightwieght context that can be used for measuring text only.
5410 """
5411 val = _gdi_.GraphicsContext_CreateMeasuringContext(*args)
5412 val.__dc = args[0] # save a ref so the dc will not be deleted before self
5413 return val
5414
5415 CreateMeasuringContext = staticmethod(CreateMeasuringContext)
0a27f394 5416 def CreateFromNative(*args, **kwargs):
26c4d26f
RD
5417 """
5418 CreateFromNative(void context) -> GraphicsContext
5419
5420 Creates a wx.GraphicsContext from a native context. This native context
5421 must be eg a CGContextRef for Core Graphics, a Graphics pointer for
5422 GDIPlus or a cairo_t pointer for Cairo.
5423 """
0a27f394
RD
5424 return _gdi_.GraphicsContext_CreateFromNative(*args, **kwargs)
5425
5426 CreateFromNative = staticmethod(CreateFromNative)
70d7cb34 5427 def CreateFromNativeWindow(*args, **kwargs):
26c4d26f
RD
5428 """
5429 CreateFromNativeWindow(void window) -> GraphicsContext
5430
5431 Creates a wx.GraphicsContext from a native window.
5432 """
70d7cb34
RD
5433 return _gdi_.GraphicsContext_CreateFromNativeWindow(*args, **kwargs)
5434
5435 CreateFromNativeWindow = staticmethod(CreateFromNativeWindow)
72ef6efb 5436 def CreatePath(*args, **kwargs):
70d7cb34
RD
5437 """
5438 CreatePath(self) -> GraphicsPath
5439
26c4d26f 5440 Creates a native graphics path which is initially empty.
70d7cb34 5441 """
72ef6efb
RD
5442 return _gdi_.GraphicsContext_CreatePath(*args, **kwargs)
5443
70d7cb34 5444 def CreatePen(*args, **kwargs):
26c4d26f
RD
5445 """
5446 CreatePen(self, Pen pen) -> GraphicsPen
5447
5448 Creates a native pen from a `wx.Pen`.
5449 """
70d7cb34
RD
5450 return _gdi_.GraphicsContext_CreatePen(*args, **kwargs)
5451
5452 def CreateBrush(*args, **kwargs):
26c4d26f
RD
5453 """
5454 CreateBrush(self, Brush brush) -> GraphicsBrush
5455
5456 Creates a native brush from a `wx.Brush`.
5457 """
70d7cb34
RD
5458 return _gdi_.GraphicsContext_CreateBrush(*args, **kwargs)
5459
5460 def CreateLinearGradientBrush(*args, **kwargs):
5461 """
5462 CreateLinearGradientBrush(self, Double x1, Double y1, Double x2, Double y2, Colour c1,
5463 Colour c2) -> GraphicsBrush
5464
26c4d26f
RD
5465 Creates a native brush, having a linear gradient, starting at (x1,y1)
5466 with color c1 to (x2,y2) with color c2.
70d7cb34
RD
5467 """
5468 return _gdi_.GraphicsContext_CreateLinearGradientBrush(*args, **kwargs)
5469
5470 def CreateRadialGradientBrush(*args, **kwargs):
5471 """
5472 CreateRadialGradientBrush(self, Double xo, Double yo, Double xc, Double yc, Double radius,
5473 Colour oColor, Colour cColor) -> GraphicsBrush
5474
26c4d26f
RD
5475 Creates a native brush, having a radial gradient originating at
5476 point (xo,yc) with color oColour and ends on a circle around (xc,yc) with
5477 radius r and color cColour.
70d7cb34
RD
5478 """
5479 return _gdi_.GraphicsContext_CreateRadialGradientBrush(*args, **kwargs)
5480
5481 def CreateFont(*args, **kwargs):
5482 """
5483 CreateFont(self, Font font, Colour col=*wxBLACK) -> GraphicsFont
5484
26c4d26f 5485 Creates a native graphics font from a `wx.Font` and a text colour.
70d7cb34
RD
5486 """
5487 return _gdi_.GraphicsContext_CreateFont(*args, **kwargs)
5488
5489 def CreateMatrix(*args, **kwargs):
5490 """
5491 CreateMatrix(self, Double a=1.0, Double b=0.0, Double c=0.0, Double d=1.0,
5492 Double tx=0.0, Double ty=0.0) -> GraphicsMatrix
5493
26c4d26f
RD
5494 Creates a native affine transformation matrix from the passed in
5495 values. The defaults result in an identity matrix.
70d7cb34
RD
5496 """
5497 return _gdi_.GraphicsContext_CreateMatrix(*args, **kwargs)
5498
72ef6efb 5499 def PushState(*args, **kwargs):
70d7cb34
RD
5500 """
5501 PushState(self)
5502
5503 push the current state of the context, ie the transformation matrix on a stack
5504 """
72ef6efb
RD
5505 return _gdi_.GraphicsContext_PushState(*args, **kwargs)
5506
5507 def PopState(*args, **kwargs):
70d7cb34
RD
5508 """
5509 PopState(self)
5510
5511 pops a stored state from the stack
5512 """
72ef6efb
RD
5513 return _gdi_.GraphicsContext_PopState(*args, **kwargs)
5514
0a27f394 5515 def ClipRegion(*args, **kwargs):
70d7cb34
RD
5516 """
5517 ClipRegion(self, Region region)
5518
26c4d26f 5519 Clips drawings to the region, combined to current clipping region.
70d7cb34 5520 """
0a27f394
RD
5521 return _gdi_.GraphicsContext_ClipRegion(*args, **kwargs)
5522
72ef6efb 5523 def Clip(*args, **kwargs):
70d7cb34
RD
5524 """
5525 Clip(self, Double x, Double y, Double w, Double h)
5526
26c4d26f 5527 Clips drawings to the rectangle.
70d7cb34 5528 """
72ef6efb
RD
5529 return _gdi_.GraphicsContext_Clip(*args, **kwargs)
5530
0a27f394 5531 def ResetClip(*args, **kwargs):
70d7cb34
RD
5532 """
5533 ResetClip(self)
5534
26c4d26f 5535 Resets the clipping to original shape.
70d7cb34 5536 """
0a27f394
RD
5537 return _gdi_.GraphicsContext_ResetClip(*args, **kwargs)
5538
5539 def GetNativeContext(*args, **kwargs):
70d7cb34
RD
5540 """
5541 GetNativeContext(self) -> void
5542
26c4d26f
RD
5543 Returns the native context (CGContextRef for Core Graphics, Graphics
5544 pointer for GDIPlus and cairo_t pointer for cairo).
70d7cb34 5545 """
0a27f394
RD
5546 return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
5547
72ef6efb 5548 def Translate(*args, **kwargs):
70d7cb34
RD
5549 """
5550 Translate(self, Double dx, Double dy)
5551
26c4d26f 5552 Translates the current transformation matrix.
70d7cb34 5553 """
72ef6efb
RD
5554 return _gdi_.GraphicsContext_Translate(*args, **kwargs)
5555
5556 def Scale(*args, **kwargs):
70d7cb34
RD
5557 """
5558 Scale(self, Double xScale, Double yScale)
5559
26c4d26f 5560 Scale the current transformation matrix of the context.
70d7cb34 5561 """
72ef6efb
RD
5562 return _gdi_.GraphicsContext_Scale(*args, **kwargs)
5563
5564 def Rotate(*args, **kwargs):
70d7cb34
RD
5565 """
5566 Rotate(self, Double angle)
72ef6efb 5567
26c4d26f
RD
5568 Rotate the current transformation matrix of the context. ``angle`` is
5569 specified in radians.
70d7cb34
RD
5570 """
5571 return _gdi_.GraphicsContext_Rotate(*args, **kwargs)
72ef6efb 5572
5c8c7dd3
RD
5573 def ConcatTransform(*args, **kwargs):
5574 """
5575 ConcatTransform(self, GraphicsMatrix matrix)
5576
26c4d26f
RD
5577 Concatenates the passed in transform with the current transform of
5578 this context.
5c8c7dd3
RD
5579 """
5580 return _gdi_.GraphicsContext_ConcatTransform(*args, **kwargs)
5581
5582 def SetTransform(*args, **kwargs):
5583 """
5584 SetTransform(self, GraphicsMatrix matrix)
5585
26c4d26f 5586 Sets the current transform of this context.
5c8c7dd3
RD
5587 """
5588 return _gdi_.GraphicsContext_SetTransform(*args, **kwargs)
5589
5590 def GetTransform(*args, **kwargs):
5591 """
5592 GetTransform(self) -> GraphicsMatrix
5593
26c4d26f 5594 Gets the current transformation matrix of this context.
5c8c7dd3
RD
5595 """
5596 return _gdi_.GraphicsContext_GetTransform(*args, **kwargs)
5597
70d7cb34 5598 def SetPen(*args):
72ef6efb 5599 """
70d7cb34
RD
5600 SetPen(self, GraphicsPen pen)
5601 SetPen(self, Pen pen)
5602
26c4d26f 5603 Sets the stroke pen
72ef6efb 5604 """
70d7cb34 5605 return _gdi_.GraphicsContext_SetPen(*args)
72ef6efb 5606
70d7cb34 5607 def SetBrush(*args):
72ef6efb 5608 """
70d7cb34
RD
5609 SetBrush(self, GraphicsBrush brush)
5610 SetBrush(self, Brush brush)
5611
26c4d26f 5612 Sets the brush for filling
72ef6efb 5613 """
70d7cb34 5614 return _gdi_.GraphicsContext_SetBrush(*args)
72ef6efb 5615
70d7cb34
RD
5616 def SetFont(*args):
5617 """
5618 SetFont(self, GraphicsFont font)
5619 SetFont(self, Font font, Colour colour=*wxBLACK)
72ef6efb 5620
26c4d26f 5621 Sets the font
70d7cb34
RD
5622 """
5623 return _gdi_.GraphicsContext_SetFont(*args)
72ef6efb
RD
5624
5625 def StrokePath(*args, **kwargs):
70d7cb34
RD
5626 """
5627 StrokePath(self, GraphicsPath path)
5628
26c4d26f 5629 Strokes along a path with the current pen.
70d7cb34 5630 """
72ef6efb
RD
5631 return _gdi_.GraphicsContext_StrokePath(*args, **kwargs)
5632
5633 def FillPath(*args, **kwargs):
70d7cb34 5634 """
8f514ab4 5635 FillPath(self, GraphicsPath path, int fillStyle=ODDEVEN_RULE)
70d7cb34 5636
26c4d26f 5637 Fills a path with the current brush.
70d7cb34 5638 """
72ef6efb
RD
5639 return _gdi_.GraphicsContext_FillPath(*args, **kwargs)
5640
5641 def DrawPath(*args, **kwargs):
70d7cb34 5642 """
8f514ab4 5643 DrawPath(self, GraphicsPath path, int fillStyle=ODDEVEN_RULE)
70d7cb34 5644
26c4d26f 5645 Draws the path by first filling and then stroking.
70d7cb34 5646 """
72ef6efb
RD
5647 return _gdi_.GraphicsContext_DrawPath(*args, **kwargs)
5648
b39fe951 5649 def DrawText(*args, **kwargs):
26c4d26f 5650 """
f89238b9 5651 DrawText(self, String str, Double x, Double y, GraphicsBrush backgroundBrush=NullGraphicsBrush)
26c4d26f 5652
f89238b9 5653 Draws a text string at the defined position.
26c4d26f 5654 """
b39fe951
RD
5655 return _gdi_.GraphicsContext_DrawText(*args, **kwargs)
5656
5657 def DrawRotatedText(*args, **kwargs):
9057d6d4
RD
5658 """
5659 DrawRotatedText(self, String str, Double x, Double y, Double angle, GraphicsBrush backgroundBrush=NullGraphicsBrush)
5660
5661 Draws a text string at the defined position, at the specified angle,
5662 which is given in radians.
5663 """
b39fe951 5664 return _gdi_.GraphicsContext_DrawRotatedText(*args, **kwargs)
72ef6efb 5665
be68621e 5666 def GetFullTextExtent(*args, **kwargs):
26c4d26f
RD
5667 """
5668 GetFullTextExtent(self, text) --> (width, height, descent, externalLeading)
5669
5670 Gets the dimensions of the string using the currently selected
5671 font. ``text`` is the string to measure, ``w`` and ``h`` are the total
5672 width and height respectively, ``descent`` is the dimension from the
5673 baseline of the font to the bottom of the descender, and
5674 ``externalLeading`` is any extra vertical space added to the font by
5675 the font designer (usually is zero).
5676 """
be68621e
RD
5677 return _gdi_.GraphicsContext_GetFullTextExtent(*args, **kwargs)
5678
72ef6efb 5679 def GetTextExtent(*args, **kwargs):
26c4d26f
RD
5680 """
5681 GetTextExtent(self, text) --> (width, height)
5682
5683 Gets the dimensions of the string using the currently selected
5684 font. ``text`` is the string to measure, ``w`` and ``h`` are the total
5685 width and height respectively.
5686 """
72ef6efb
RD
5687 return _gdi_.GraphicsContext_GetTextExtent(*args, **kwargs)
5688
5689 def GetPartialTextExtents(*args, **kwargs):
26c4d26f
RD
5690 """
5691 GetPartialTextExtents(self, text) -> [widths]
5692
5693 Returns a list of widths from the beginning of ``text`` to the
5694 coresponding character in ``text``.
5695 """
72ef6efb
RD
5696 return _gdi_.GraphicsContext_GetPartialTextExtents(*args, **kwargs)
5697
5698 def DrawBitmap(*args, **kwargs):
26c4d26f
RD
5699 """
5700 DrawBitmap(self, Bitmap bmp, Double x, Double y, Double w, Double h)
5701
5702 Draws the bitmap. In case of a mono bitmap, this is treated as a mask
5703 and the current brush is used for filling.
5704 """
72ef6efb
RD
5705 return _gdi_.GraphicsContext_DrawBitmap(*args, **kwargs)
5706
5707 def DrawIcon(*args, **kwargs):
26c4d26f
RD
5708 """
5709 DrawIcon(self, Icon icon, Double x, Double y, Double w, Double h)
5710
5711 Draws the icon.
5712 """
72ef6efb
RD
5713 return _gdi_.GraphicsContext_DrawIcon(*args, **kwargs)
5714
5715 def StrokeLine(*args, **kwargs):
70d7cb34
RD
5716 """
5717 StrokeLine(self, Double x1, Double y1, Double x2, Double y2)
5718
26c4d26f 5719 Strokes a single line.
70d7cb34 5720 """
72ef6efb
RD
5721 return _gdi_.GraphicsContext_StrokeLine(*args, **kwargs)
5722
b39fe951 5723 def StrokeLines(*args, **kwargs):
70d7cb34
RD
5724 """
5725 StrokeLines(self, List points)
5726
26c4d26f 5727 Stroke lines connecting each of the points
70d7cb34 5728 """
b39fe951
RD
5729 return _gdi_.GraphicsContext_StrokeLines(*args, **kwargs)
5730
f8eb59b9 5731 def StrokeLineSegements(*args, **kwargs):
70d7cb34
RD
5732 """
5733 StrokeLineSegements(self, PyObject beginPoints, PyObject endPoints)
5734
26c4d26f 5735 Stroke disconnected lines from begin to end points
70d7cb34 5736 """
f8eb59b9 5737 return _gdi_.GraphicsContext_StrokeLineSegements(*args, **kwargs)
72ef6efb
RD
5738
5739 def DrawLines(*args, **kwargs):
70d7cb34 5740 """
8f514ab4 5741 DrawLines(self, size_t points, int fillStyle=ODDEVEN_RULE)
70d7cb34 5742
26c4d26f 5743 Draws a polygon.
70d7cb34 5744 """
72ef6efb
RD
5745 return _gdi_.GraphicsContext_DrawLines(*args, **kwargs)
5746
5747 def DrawRectangle(*args, **kwargs):
70d7cb34
RD
5748 """
5749 DrawRectangle(self, Double x, Double y, Double w, Double h)
5750
26c4d26f 5751 Draws a rectangle.
70d7cb34 5752 """
72ef6efb
RD
5753 return _gdi_.GraphicsContext_DrawRectangle(*args, **kwargs)
5754
5755 def DrawEllipse(*args, **kwargs):
70d7cb34
RD
5756 """
5757 DrawEllipse(self, Double x, Double y, Double w, Double h)
5758
26c4d26f 5759 Draws an ellipse.
70d7cb34 5760 """
72ef6efb
RD
5761 return _gdi_.GraphicsContext_DrawEllipse(*args, **kwargs)
5762
5763 def DrawRoundedRectangle(*args, **kwargs):
70d7cb34
RD
5764 """
5765 DrawRoundedRectangle(self, Double x, Double y, Double w, Double h, Double radius)
5766
26c4d26f 5767 Draws a rounded rectangle
70d7cb34 5768 """
72ef6efb
RD
5769 return _gdi_.GraphicsContext_DrawRoundedRectangle(*args, **kwargs)
5770
70d7cb34
RD
5771 def ShouldOffset(*args, **kwargs):
5772 """
5773 ShouldOffset(self) -> bool
5774
5775 helper to determine if a 0.5 offset should be applied for the drawing operation
5776 """
5777 return _gdi_.GraphicsContext_ShouldOffset(*args, **kwargs)
5778
72ef6efb 5779_gdi_.GraphicsContext_swigregister(GraphicsContext)
5c8c7dd3
RD
5780cvar = _gdi_.cvar
5781NullGraphicsPen = cvar.NullGraphicsPen
5782NullGraphicsBrush = cvar.NullGraphicsBrush
5783NullGraphicsFont = cvar.NullGraphicsFont
5784NullGraphicsMatrix = cvar.NullGraphicsMatrix
5785NullGraphicsPath = cvar.NullGraphicsPath
72ef6efb 5786
0a27f394
RD
5787def GraphicsContext_Create(*args):
5788 """
5789 Create(WindowDC dc) -> GraphicsContext
5790 GraphicsContext_Create(Window window) -> GraphicsContext
26c4d26f
RD
5791
5792 Creates a wx.GraphicsContext either from a window or a DC.
0a27f394 5793 """
be68621e
RD
5794 val = _gdi_.GraphicsContext_Create(*args)
5795 val.__dc = args[0] # save a ref so the dc will not be deleted before self
5796 return val
0a27f394 5797
f89238b9
RD
5798def GraphicsContext_CreateMeasuringContext(*args):
5799 """
5800 GraphicsContext_CreateMeasuringContext() -> GraphicsContext
5801
5802 Create a lightwieght context that can be used for measuring text only.
5803 """
5804 val = _gdi_.GraphicsContext_CreateMeasuringContext(*args)
5805 val.__dc = args[0] # save a ref so the dc will not be deleted before self
5806 return val
5807
0a27f394 5808def GraphicsContext_CreateFromNative(*args, **kwargs):
26c4d26f
RD
5809 """
5810 GraphicsContext_CreateFromNative(void context) -> GraphicsContext
5811
5812 Creates a wx.GraphicsContext from a native context. This native context
5813 must be eg a CGContextRef for Core Graphics, a Graphics pointer for
5814 GDIPlus or a cairo_t pointer for Cairo.
5815 """
0a27f394 5816 return _gdi_.GraphicsContext_CreateFromNative(*args, **kwargs)
72ef6efb 5817
70d7cb34 5818def GraphicsContext_CreateFromNativeWindow(*args, **kwargs):
26c4d26f
RD
5819 """
5820 GraphicsContext_CreateFromNativeWindow(void window) -> GraphicsContext
5821
5822 Creates a wx.GraphicsContext from a native window.
5823 """
70d7cb34
RD
5824 return _gdi_.GraphicsContext_CreateFromNativeWindow(*args, **kwargs)
5825
5826class GraphicsRenderer(_core.Object):
5827 """Proxy of C++ GraphicsRenderer class"""
5828 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5829 def __init__(self): raise AttributeError, "No constructor defined"
5830 __repr__ = _swig_repr
5831 __swig_destroy__ = _gdi_.delete_GraphicsRenderer
5832 __del__ = lambda self : None;
5833 def GetDefaultRenderer(*args, **kwargs):
5834 """GetDefaultRenderer() -> GraphicsRenderer"""
5835 return _gdi_.GraphicsRenderer_GetDefaultRenderer(*args, **kwargs)
5836
5837 GetDefaultRenderer = staticmethod(GetDefaultRenderer)
5838 def CreateContext(*args):
5839 """
5840 CreateContext(self, WindowDC dc) -> GraphicsContext
5841 CreateContext(self, Window window) -> GraphicsContext
5842 """
5843 return _gdi_.GraphicsRenderer_CreateContext(*args)
5844
f89238b9
RD
5845 def CreateMeasuringContext(*args, **kwargs):
5846 """CreateMeasuringContext(self) -> GraphicsContext"""
5847 return _gdi_.GraphicsRenderer_CreateMeasuringContext(*args, **kwargs)
5848
70d7cb34
RD
5849 def CreateContextFromNativeContext(*args, **kwargs):
5850 """CreateContextFromNativeContext(self, void context) -> GraphicsContext"""
5851 return _gdi_.GraphicsRenderer_CreateContextFromNativeContext(*args, **kwargs)
5852
5853 def CreateContextFromNativeWindow(*args, **kwargs):
5854 """CreateContextFromNativeWindow(self, void window) -> GraphicsContext"""
5855 return _gdi_.GraphicsRenderer_CreateContextFromNativeWindow(*args, **kwargs)
5856
5857 def CreatePath(*args, **kwargs):
5858 """CreatePath(self) -> GraphicsPath"""
5859 return _gdi_.GraphicsRenderer_CreatePath(*args, **kwargs)
5860
5861 def CreateMatrix(*args, **kwargs):
5862 """
5863 CreateMatrix(self, Double a=1.0, Double b=0.0, Double c=0.0, Double d=1.0,
5864 Double tx=0.0, Double ty=0.0) -> GraphicsMatrix
5865 """
5866 return _gdi_.GraphicsRenderer_CreateMatrix(*args, **kwargs)
5867
5868 def CreatePen(*args, **kwargs):
5869 """CreatePen(self, Pen pen) -> GraphicsPen"""
5870 return _gdi_.GraphicsRenderer_CreatePen(*args, **kwargs)
5871
5872 def CreateBrush(*args, **kwargs):
5873 """CreateBrush(self, Brush brush) -> GraphicsBrush"""
5874 return _gdi_.GraphicsRenderer_CreateBrush(*args, **kwargs)
5875
5876 def CreateLinearGradientBrush(*args, **kwargs):
5877 """
5878 CreateLinearGradientBrush(self, Double x1, Double y1, Double x2, Double y2, Colour c1,
5879 Colour c2) -> GraphicsBrush
5880 """
5881 return _gdi_.GraphicsRenderer_CreateLinearGradientBrush(*args, **kwargs)
5882
5883 def CreateRadialGradientBrush(*args, **kwargs):
5884 """
5885 CreateRadialGradientBrush(self, Double xo, Double yo, Double xc, Double yc, Double radius,
5886 Colour oColor, Colour cColor) -> GraphicsBrush
5887 """
5888 return _gdi_.GraphicsRenderer_CreateRadialGradientBrush(*args, **kwargs)
5889
5890 def CreateFont(*args, **kwargs):
5891 """CreateFont(self, Font font, Colour col=*wxBLACK) -> GraphicsFont"""
5892 return _gdi_.GraphicsRenderer_CreateFont(*args, **kwargs)
5893
5894_gdi_.GraphicsRenderer_swigregister(GraphicsRenderer)
5895
5896def GraphicsRenderer_GetDefaultRenderer(*args):
5897 """GraphicsRenderer_GetDefaultRenderer() -> GraphicsRenderer"""
5898 return _gdi_.GraphicsRenderer_GetDefaultRenderer(*args)
5899
72ef6efb
RD
5900class GCDC(DC):
5901 """Proxy of C++ GCDC class"""
5902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5903 __repr__ = _swig_repr
48a0c021
RD
5904 def __init__(self, *args):
5905 """
5906 __init__(self, WindowDC dc) -> GCDC
5907 __init__(self, Window window) -> GCDC
5908 """
5909 _gdi_.GCDC_swiginit(self,_gdi_.new_GCDC(*args))
72ef6efb
RD
5910 self.__dc = args[0] # save a ref so the other dc will not be deleted before self
5911
5912 __swig_destroy__ = _gdi_.delete_GCDC
5913 __del__ = lambda self : None;
0a27f394
RD
5914 def GetGraphicsContext(*args, **kwargs):
5915 """GetGraphicsContext(self) -> GraphicsContext"""
5916 return _gdi_.GCDC_GetGraphicsContext(*args, **kwargs)
5917
5918 def SetGraphicsContext(*args, **kwargs):
5919 """SetGraphicsContext(self, GraphicsContext ctx)"""
5920 return _gdi_.GCDC_SetGraphicsContext(*args, **kwargs)
72ef6efb 5921
0a27f394 5922 GraphicsContext = property(GetGraphicsContext,SetGraphicsContext)
72ef6efb
RD
5923_gdi_.GCDC_swigregister(GCDC)
5924
b39fe951
RD
5925class Overlay(object):
5926 """Proxy of C++ Overlay class"""
5927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5928 __repr__ = _swig_repr
5929 def __init__(self, *args, **kwargs):
5930 """__init__(self) -> Overlay"""
5931 _gdi_.Overlay_swiginit(self,_gdi_.new_Overlay(*args, **kwargs))
5932 __swig_destroy__ = _gdi_.delete_Overlay
5933 __del__ = lambda self : None;
5934 def Reset(*args, **kwargs):
5935 """Reset(self)"""
5936 return _gdi_.Overlay_Reset(*args, **kwargs)
5937
5938_gdi_.Overlay_swigregister(Overlay)
5939
5940class DCOverlay(object):
5941 """Proxy of C++ DCOverlay class"""
5942 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5943 __repr__ = _swig_repr
5944 def __init__(self, *args):
5945 """
5946 __init__(self, Overlay overlay, WindowDC dc, int x, int y, int width,
5947 int height) -> DCOverlay
5948 __init__(self, Overlay overlay, WindowDC dc) -> DCOverlay
5949 """
5950 _gdi_.DCOverlay_swiginit(self,_gdi_.new_DCOverlay(*args))
5951 __swig_destroy__ = _gdi_.delete_DCOverlay
5952 __del__ = lambda self : None;
5953 def Clear(*args, **kwargs):
5954 """Clear(self)"""
5955 return _gdi_.DCOverlay_Clear(*args, **kwargs)
5956
5957_gdi_.DCOverlay_swigregister(DCOverlay)
5958
72ef6efb
RD
5959#---------------------------------------------------------------------------
5960
d55e5bfc
RD
5961IMAGELIST_DRAW_NORMAL = _gdi_.IMAGELIST_DRAW_NORMAL
5962IMAGELIST_DRAW_TRANSPARENT = _gdi_.IMAGELIST_DRAW_TRANSPARENT
5963IMAGELIST_DRAW_SELECTED = _gdi_.IMAGELIST_DRAW_SELECTED
5964IMAGELIST_DRAW_FOCUSED = _gdi_.IMAGELIST_DRAW_FOCUSED
5965IMAGE_LIST_NORMAL = _gdi_.IMAGE_LIST_NORMAL
5966IMAGE_LIST_SMALL = _gdi_.IMAGE_LIST_SMALL
5967IMAGE_LIST_STATE = _gdi_.IMAGE_LIST_STATE
5968class ImageList(_core.Object):
36ed4f51 5969 """Proxy of C++ ImageList class"""
1bd55598
RD
5970 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5971 __repr__ = _swig_repr
5972 def __init__(self, *args, **kwargs):
d55e5bfc 5973 """__init__(self, int width, int height, int mask=True, int initialCount=1) -> ImageList"""
1bd55598
RD
5974 _gdi_.ImageList_swiginit(self,_gdi_.new_ImageList(*args, **kwargs))
5975 __swig_destroy__ = _gdi_.delete_ImageList
5976 __del__ = lambda self : None;
d55e5bfc
RD
5977 def Add(*args, **kwargs):
5978 """Add(self, Bitmap bitmap, Bitmap mask=NullBitmap) -> int"""
5979 return _gdi_.ImageList_Add(*args, **kwargs)
5980
5981 def AddWithColourMask(*args, **kwargs):
5982 """AddWithColourMask(self, Bitmap bitmap, Colour maskColour) -> int"""
5983 return _gdi_.ImageList_AddWithColourMask(*args, **kwargs)
5984
5985 def AddIcon(*args, **kwargs):
5986 """AddIcon(self, Icon icon) -> int"""
5987 return _gdi_.ImageList_AddIcon(*args, **kwargs)
5988
7fbf8399
RD
5989 def GetBitmap(*args, **kwargs):
5990 """GetBitmap(self, int index) -> Bitmap"""
5991 return _gdi_.ImageList_GetBitmap(*args, **kwargs)
5992
5993 def GetIcon(*args, **kwargs):
5994 """GetIcon(self, int index) -> Icon"""
5995 return _gdi_.ImageList_GetIcon(*args, **kwargs)
5996
d55e5bfc 5997 def Replace(*args, **kwargs):
2131d850 5998 """Replace(self, int index, Bitmap bitmap, Bitmap mask=NullBitmap) -> bool"""
d55e5bfc
RD
5999 return _gdi_.ImageList_Replace(*args, **kwargs)
6000
6001 def Draw(*args, **kwargs):
6002 """
6003 Draw(self, int index, DC dc, int x, int x, int flags=IMAGELIST_DRAW_NORMAL,
6004 bool solidBackground=False) -> bool
6005 """
6006 return _gdi_.ImageList_Draw(*args, **kwargs)
6007
6008 def GetImageCount(*args, **kwargs):
6009 """GetImageCount(self) -> int"""
6010 return _gdi_.ImageList_GetImageCount(*args, **kwargs)
6011
6012 def Remove(*args, **kwargs):
6013 """Remove(self, int index) -> bool"""
6014 return _gdi_.ImageList_Remove(*args, **kwargs)
6015
6016 def RemoveAll(*args, **kwargs):
6017 """RemoveAll(self) -> bool"""
6018 return _gdi_.ImageList_RemoveAll(*args, **kwargs)
6019
6020 def GetSize(*args, **kwargs):
b850e7f3 6021 """GetSize(index) -> (width,height)"""
d55e5bfc
RD
6022 return _gdi_.ImageList_GetSize(*args, **kwargs)
6023
ac5d357a
RD
6024 ImageCount = property(GetImageCount,doc="See `GetImageCount`")
6025 Size = property(GetSize,doc="See `GetSize`")
2131d850 6026_gdi_.ImageList_swigregister(ImageList)
d55e5bfc
RD
6027
6028#---------------------------------------------------------------------------
6029
da91cb0f
RD
6030class StockGDI(object):
6031 """Proxy of C++ StockGDI class"""
1bd55598 6032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1bd55598 6033 __repr__ = _swig_repr
da91cb0f
RD
6034 BRUSH_BLACK = _gdi_.StockGDI_BRUSH_BLACK
6035 BRUSH_BLUE = _gdi_.StockGDI_BRUSH_BLUE
6036 BRUSH_CYAN = _gdi_.StockGDI_BRUSH_CYAN
6037 BRUSH_GREEN = _gdi_.StockGDI_BRUSH_GREEN
6038 BRUSH_GREY = _gdi_.StockGDI_BRUSH_GREY
6039 BRUSH_LIGHTGREY = _gdi_.StockGDI_BRUSH_LIGHTGREY
6040 BRUSH_MEDIUMGREY = _gdi_.StockGDI_BRUSH_MEDIUMGREY
6041 BRUSH_RED = _gdi_.StockGDI_BRUSH_RED
6042 BRUSH_TRANSPARENT = _gdi_.StockGDI_BRUSH_TRANSPARENT
6043 BRUSH_WHITE = _gdi_.StockGDI_BRUSH_WHITE
6044 COLOUR_BLACK = _gdi_.StockGDI_COLOUR_BLACK
6045 COLOUR_BLUE = _gdi_.StockGDI_COLOUR_BLUE
6046 COLOUR_CYAN = _gdi_.StockGDI_COLOUR_CYAN
6047 COLOUR_GREEN = _gdi_.StockGDI_COLOUR_GREEN
6048 COLOUR_LIGHTGREY = _gdi_.StockGDI_COLOUR_LIGHTGREY
6049 COLOUR_RED = _gdi_.StockGDI_COLOUR_RED
6050 COLOUR_WHITE = _gdi_.StockGDI_COLOUR_WHITE
6051 CURSOR_CROSS = _gdi_.StockGDI_CURSOR_CROSS
6052 CURSOR_HOURGLASS = _gdi_.StockGDI_CURSOR_HOURGLASS
6053 CURSOR_STANDARD = _gdi_.StockGDI_CURSOR_STANDARD
6054 FONT_ITALIC = _gdi_.StockGDI_FONT_ITALIC
6055 FONT_NORMAL = _gdi_.StockGDI_FONT_NORMAL
6056 FONT_SMALL = _gdi_.StockGDI_FONT_SMALL
6057 FONT_SWISS = _gdi_.StockGDI_FONT_SWISS
6058 PEN_BLACK = _gdi_.StockGDI_PEN_BLACK
6059 PEN_BLACKDASHED = _gdi_.StockGDI_PEN_BLACKDASHED
6060 PEN_CYAN = _gdi_.StockGDI_PEN_CYAN
6061 PEN_GREEN = _gdi_.StockGDI_PEN_GREEN
6062 PEN_GREY = _gdi_.StockGDI_PEN_GREY
6063 PEN_LIGHTGREY = _gdi_.StockGDI_PEN_LIGHTGREY
6064 PEN_MEDIUMGREY = _gdi_.StockGDI_PEN_MEDIUMGREY
6065 PEN_RED = _gdi_.StockGDI_PEN_RED
6066 PEN_TRANSPARENT = _gdi_.StockGDI_PEN_TRANSPARENT
6067 PEN_WHITE = _gdi_.StockGDI_PEN_WHITE
6068 ITEMCOUNT = _gdi_.StockGDI_ITEMCOUNT
6069 def __init__(self, *args, **kwargs):
6070 """__init__(self) -> StockGDI"""
6071 _gdi_.StockGDI_swiginit(self,_gdi_.new_StockGDI(*args, **kwargs))
6072 __swig_destroy__ = _gdi_.delete_StockGDI
6073 __del__ = lambda self : None;
6074 def DeleteAll(*args, **kwargs):
6075 """DeleteAll()"""
6076 return _gdi_.StockGDI_DeleteAll(*args, **kwargs)
d55e5bfc 6077
da91cb0f
RD
6078 DeleteAll = staticmethod(DeleteAll)
6079 def instance(*args, **kwargs):
6080 """instance() -> StockGDI"""
6081 return _gdi_.StockGDI_instance(*args, **kwargs)
d55e5bfc 6082
da91cb0f
RD
6083 instance = staticmethod(instance)
6084 def GetBrush(*args, **kwargs):
6085 """GetBrush(int item) -> Brush"""
6086 return _gdi_.StockGDI_GetBrush(*args, **kwargs)
d55e5bfc 6087
da91cb0f
RD
6088 GetBrush = staticmethod(GetBrush)
6089 def GetColour(*args, **kwargs):
6090 """GetColour(int item) -> Colour"""
6091 return _gdi_.StockGDI_GetColour(*args, **kwargs)
d55e5bfc 6092
da91cb0f
RD
6093 GetColour = staticmethod(GetColour)
6094 def GetCursor(*args, **kwargs):
6095 """GetCursor(int item) -> Cursor"""
6096 return _gdi_.StockGDI_GetCursor(*args, **kwargs)
6097
6098 GetCursor = staticmethod(GetCursor)
6099 def GetPen(*args, **kwargs):
6100 """GetPen(int item) -> Pen"""
6101 return _gdi_.StockGDI_GetPen(*args, **kwargs)
6102
6103 GetPen = staticmethod(GetPen)
6104 def GetFont(*args, **kwargs):
6105 """GetFont(self, int item) -> Font"""
6106 return _gdi_.StockGDI_GetFont(*args, **kwargs)
6107
2131d850
RD
6108 def _initStockObjects():
6109 import wx
704eda0c
RD
6110 wx.ITALIC_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_ITALIC).this
6111 wx.NORMAL_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_NORMAL).this
6112 wx.SMALL_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_SMALL).this
6113 wx.SWISS_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_SWISS).this
2131d850 6114
704eda0c
RD
6115 wx.BLACK_DASHED_PEN.this = StockGDI.GetPen(StockGDI.PEN_BLACKDASHED).this
6116 wx.BLACK_PEN.this = StockGDI.GetPen(StockGDI.PEN_BLACK).this
6117 wx.CYAN_PEN.this = StockGDI.GetPen(StockGDI.PEN_CYAN).this
6118 wx.GREEN_PEN.this = StockGDI.GetPen(StockGDI.PEN_GREEN).this
6119 wx.GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_GREY).this
6120 wx.LIGHT_GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_LIGHTGREY).this
6121 wx.MEDIUM_GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_MEDIUMGREY).this
6122 wx.RED_PEN.this = StockGDI.GetPen(StockGDI.PEN_RED).this
6123 wx.TRANSPARENT_PEN.this = StockGDI.GetPen(StockGDI.PEN_TRANSPARENT).this
6124 wx.WHITE_PEN.this = StockGDI.GetPen(StockGDI.PEN_WHITE).this
6125
6126 wx.BLACK_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_BLACK).this
6127 wx.BLUE_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_BLUE).this
6128 wx.CYAN_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_CYAN).this
6129 wx.GREEN_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_GREEN).this
6130 wx.GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_GREY).this
6131 wx.LIGHT_GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_LIGHTGREY).this
6132 wx.MEDIUM_GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_MEDIUMGREY).this
6133 wx.RED_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_RED).this
6134 wx.TRANSPARENT_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_TRANSPARENT).this
6135 wx.WHITE_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_WHITE).this
6136
6137 wx.BLACK.this = StockGDI.GetColour(StockGDI.COLOUR_BLACK).this
6138 wx.BLUE.this = StockGDI.GetColour(StockGDI.COLOUR_BLUE).this
6139 wx.CYAN.this = StockGDI.GetColour(StockGDI.COLOUR_CYAN).this
6140 wx.GREEN.this = StockGDI.GetColour(StockGDI.COLOUR_GREEN).this
6141 wx.LIGHT_GREY.this = StockGDI.GetColour(StockGDI.COLOUR_LIGHTGREY).this
6142 wx.RED.this = StockGDI.GetColour(StockGDI.COLOUR_RED).this
6143 wx.WHITE.this = StockGDI.GetColour(StockGDI.COLOUR_WHITE).this
6144
6145 wx.CROSS_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_CROSS).this
6146 wx.HOURGLASS_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_HOURGLASS).this
6147 wx.STANDARD_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_STANDARD).this
6148
6149 wx.TheFontList.this = _wxPyInitTheFontList().this
6150 wx.ThePenList.this = _wxPyInitThePenList().this
6151 wx.TheBrushList.this = _wxPyInitTheBrushList().this
6152 wx.TheColourDatabase.this = _wxPyInitTheColourDatabase().this
6153
2131d850
RD
6154
6155 _initStockObjects = staticmethod(_initStockObjects)
6156
6157_gdi_.StockGDI_swigregister(StockGDI)
da91cb0f
RD
6158
6159def StockGDI_DeleteAll(*args):
6160 """StockGDI_DeleteAll()"""
6161 return _gdi_.StockGDI_DeleteAll(*args)
6162
6163def StockGDI_instance(*args):
6164 """StockGDI_instance() -> StockGDI"""
6165 return _gdi_.StockGDI_instance(*args)
6166
6167def StockGDI_GetBrush(*args, **kwargs):
6168 """StockGDI_GetBrush(int item) -> Brush"""
6169 return _gdi_.StockGDI_GetBrush(*args, **kwargs)
6170
6171def StockGDI_GetColour(*args, **kwargs):
6172 """StockGDI_GetColour(int item) -> Colour"""
6173 return _gdi_.StockGDI_GetColour(*args, **kwargs)
6174
6175def StockGDI_GetCursor(*args, **kwargs):
6176 """StockGDI_GetCursor(int item) -> Cursor"""
6177 return _gdi_.StockGDI_GetCursor(*args, **kwargs)
6178
6179def StockGDI_GetPen(*args, **kwargs):
6180 """StockGDI_GetPen(int item) -> Pen"""
6181 return _gdi_.StockGDI_GetPen(*args, **kwargs)
6182
704eda0c
RD
6183# Create an uninitialized instance for the stock objects, they will
6184# be initialized later when the wx.App object is created.
6185ITALIC_FONT = Font.__new__(Font)
6186NORMAL_FONT = Font.__new__(Font)
6187SMALL_FONT = Font.__new__(Font)
6188SWISS_FONT = Font.__new__(Font)
6189
6190BLACK_DASHED_PEN = Pen.__new__(Pen)
6191BLACK_PEN = Pen.__new__(Pen)
6192CYAN_PEN = Pen.__new__(Pen)
6193GREEN_PEN = Pen.__new__(Pen)
6194GREY_PEN = Pen.__new__(Pen)
6195LIGHT_GREY_PEN = Pen.__new__(Pen)
6196MEDIUM_GREY_PEN = Pen.__new__(Pen)
6197RED_PEN = Pen.__new__(Pen)
6198TRANSPARENT_PEN = Pen.__new__(Pen)
6199WHITE_PEN = Pen.__new__(Pen)
6200
6201BLACK_BRUSH = Brush.__new__(Brush)
6202BLUE_BRUSH = Brush.__new__(Brush)
6203CYAN_BRUSH = Brush.__new__(Brush)
6204GREEN_BRUSH = Brush.__new__(Brush)
6205GREY_BRUSH = Brush.__new__(Brush)
6206LIGHT_GREY_BRUSH = Brush.__new__(Brush)
6207MEDIUM_GREY_BRUSH = Brush.__new__(Brush)
6208RED_BRUSH = Brush.__new__(Brush)
6209TRANSPARENT_BRUSH = Brush.__new__(Brush)
6210WHITE_BRUSH = Brush.__new__(Brush)
6211
6212BLACK = Colour.__new__(Colour)
6213BLUE = Colour.__new__(Colour)
6214CYAN = Colour.__new__(Colour)
6215GREEN = Colour.__new__(Colour)
6216LIGHT_GREY = Colour.__new__(Colour)
6217RED = Colour.__new__(Colour)
6218WHITE = Colour.__new__(Colour)
6219
6220CROSS_CURSOR = Cursor.__new__(Cursor)
6221HOURGLASS_CURSOR = Cursor.__new__(Cursor)
6222STANDARD_CURSOR = Cursor.__new__(Cursor)
6223
da91cb0f
RD
6224class GDIObjListBase(object):
6225 """Proxy of C++ GDIObjListBase class"""
6226 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6227 __repr__ = _swig_repr
6228 def __init__(self, *args, **kwargs):
6229 """__init__(self) -> GDIObjListBase"""
6230 _gdi_.GDIObjListBase_swiginit(self,_gdi_.new_GDIObjListBase(*args, **kwargs))
6231 __swig_destroy__ = _gdi_.delete_GDIObjListBase
6232 __del__ = lambda self : None;
2131d850 6233_gdi_.GDIObjListBase_swigregister(GDIObjListBase)
d55e5bfc
RD
6234NullBitmap = cvar.NullBitmap
6235NullIcon = cvar.NullIcon
6236NullCursor = cvar.NullCursor
6237NullPen = cvar.NullPen
6238NullBrush = cvar.NullBrush
6239NullPalette = cvar.NullPalette
6240NullFont = cvar.NullFont
6241NullColour = cvar.NullColour
6242
da91cb0f
RD
6243class PenList(GDIObjListBase):
6244 """Proxy of C++ PenList class"""
1bd55598
RD
6245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6246 def __init__(self): raise AttributeError, "No constructor defined"
6247 __repr__ = _swig_repr
da91cb0f
RD
6248 def FindOrCreatePen(*args, **kwargs):
6249 """FindOrCreatePen(self, Colour colour, int width, int style) -> Pen"""
6250 return _gdi_.PenList_FindOrCreatePen(*args, **kwargs)
6251
6252 def AddPen(*args, **kwargs):
6253 """AddPen(self, Pen pen)"""
6254 return _gdi_.PenList_AddPen(*args, **kwargs)
d55e5bfc 6255
da91cb0f
RD
6256 def RemovePen(*args, **kwargs):
6257 """RemovePen(self, Pen pen)"""
6258 return _gdi_.PenList_RemovePen(*args, **kwargs)
6259
6260 AddPen = wx._deprecated(AddPen)
6261 RemovePen = wx._deprecated(RemovePen)
6262
2131d850 6263_gdi_.PenList_swigregister(PenList)
da91cb0f
RD
6264
6265class BrushList(GDIObjListBase):
6266 """Proxy of C++ BrushList class"""
6267 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6268 def __init__(self): raise AttributeError, "No constructor defined"
6269 __repr__ = _swig_repr
d55e5bfc 6270 def FindOrCreateBrush(*args, **kwargs):
bb2ef2cc 6271 """FindOrCreateBrush(self, Colour colour, int style=SOLID) -> Brush"""
d55e5bfc
RD
6272 return _gdi_.BrushList_FindOrCreateBrush(*args, **kwargs)
6273
da91cb0f
RD
6274 def AddBrush(*args, **kwargs):
6275 """AddBrush(self, Brush brush)"""
6276 return _gdi_.BrushList_AddBrush(*args, **kwargs)
6277
d55e5bfc
RD
6278 def RemoveBrush(*args, **kwargs):
6279 """RemoveBrush(self, Brush brush)"""
6280 return _gdi_.BrushList_RemoveBrush(*args, **kwargs)
6281
da91cb0f
RD
6282 AddBrush = wx._deprecated(AddBrush)
6283 RemoveBrush = wx._deprecated(RemoveBrush)
d55e5bfc 6284
2131d850 6285_gdi_.BrushList_swigregister(BrushList)
d55e5bfc 6286
da91cb0f
RD
6287class FontList(GDIObjListBase):
6288 """Proxy of C++ FontList class"""
6289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6290 def __init__(self): raise AttributeError, "No constructor defined"
6291 __repr__ = _swig_repr
6292 def FindOrCreateFont(*args, **kwargs):
6293 """
6294 FindOrCreateFont(self, int point_size, int family, int style, int weight,
6295 bool underline=False, String facename=EmptyString,
6296 int encoding=FONTENCODING_DEFAULT) -> Font
6297 """
6298 return _gdi_.FontList_FindOrCreateFont(*args, **kwargs)
6299
6300 def AddFont(*args, **kwargs):
6301 """AddFont(self, Font font)"""
6302 return _gdi_.FontList_AddFont(*args, **kwargs)
6303
6304 def RemoveFont(*args, **kwargs):
6305 """RemoveFont(self, Font font)"""
6306 return _gdi_.FontList_RemoveFont(*args, **kwargs)
6307
6308 AddFont = wx._deprecated(AddFont)
6309 RemoveFont = wx._deprecated(RemoveFont)
6310
2131d850 6311_gdi_.FontList_swigregister(FontList)
da91cb0f
RD
6312
6313class ColourDatabase(object):
36ed4f51 6314 """Proxy of C++ ColourDatabase class"""
1bd55598
RD
6315 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6316 __repr__ = _swig_repr
6317 def __init__(self, *args, **kwargs):
d55e5bfc 6318 """__init__(self) -> ColourDatabase"""
1bd55598
RD
6319 _gdi_.ColourDatabase_swiginit(self,_gdi_.new_ColourDatabase(*args, **kwargs))
6320 __swig_destroy__ = _gdi_.delete_ColourDatabase
6321 __del__ = lambda self : None;
d55e5bfc
RD
6322 def Find(*args, **kwargs):
6323 """Find(self, String name) -> Colour"""
6324 return _gdi_.ColourDatabase_Find(*args, **kwargs)
6325
6326 def FindName(*args, **kwargs):
6327 """FindName(self, Colour colour) -> String"""
6328 return _gdi_.ColourDatabase_FindName(*args, **kwargs)
6329
6330 FindColour = Find
6331 def AddColour(*args, **kwargs):
6332 """AddColour(self, String name, Colour colour)"""
6333 return _gdi_.ColourDatabase_AddColour(*args, **kwargs)
6334
6335 def Append(*args, **kwargs):
6336 """Append(self, String name, int red, int green, int blue)"""
6337 return _gdi_.ColourDatabase_Append(*args, **kwargs)
6338
2131d850 6339_gdi_.ColourDatabase_swigregister(ColourDatabase)
d55e5bfc 6340
da91cb0f 6341#---------------------------------------------------------------------------
d55e5bfc 6342
d55e5bfc 6343
da91cb0f
RD
6344def _wxPyInitTheFontList(*args):
6345 """_wxPyInitTheFontList() -> FontList"""
6346 return _gdi_._wxPyInitTheFontList(*args)
d55e5bfc 6347
da91cb0f
RD
6348def _wxPyInitThePenList(*args):
6349 """_wxPyInitThePenList() -> PenList"""
6350 return _gdi_._wxPyInitThePenList(*args)
d55e5bfc 6351
da91cb0f
RD
6352def _wxPyInitTheBrushList(*args):
6353 """_wxPyInitTheBrushList() -> BrushList"""
6354 return _gdi_._wxPyInitTheBrushList(*args)
d55e5bfc 6355
da91cb0f
RD
6356def _wxPyInitTheColourDatabase(*args):
6357 """_wxPyInitTheColourDatabase() -> ColourDatabase"""
6358 return _gdi_._wxPyInitTheColourDatabase(*args)
704eda0c
RD
6359# Create an uninitialized instance for the stock objects, they will
6360# be initialized later when the wx.App object is created.
6361TheFontList = FontList.__new__(FontList)
6362ThePenList = PenList.__new__(PenList)
6363TheBrushList = BrushList.__new__(BrushList)
6364TheColourDatabase = ColourDatabase.__new__(ColourDatabase)
d55e5bfc
RD
6365
6366NullColor = NullColour
6367#---------------------------------------------------------------------------
6368
6369class Effects(_core.Object):
36ed4f51 6370 """Proxy of C++ Effects class"""
1bd55598
RD
6371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6372 __repr__ = _swig_repr
6373 def __init__(self, *args, **kwargs):
d55e5bfc 6374 """__init__(self) -> Effects"""
1bd55598 6375 _gdi_.Effects_swiginit(self,_gdi_.new_Effects(*args, **kwargs))
d55e5bfc
RD
6376 def GetHighlightColour(*args, **kwargs):
6377 """GetHighlightColour(self) -> Colour"""
6378 return _gdi_.Effects_GetHighlightColour(*args, **kwargs)
6379
6380 def GetLightShadow(*args, **kwargs):
6381 """GetLightShadow(self) -> Colour"""
6382 return _gdi_.Effects_GetLightShadow(*args, **kwargs)
6383
6384 def GetFaceColour(*args, **kwargs):
6385 """GetFaceColour(self) -> Colour"""
6386 return _gdi_.Effects_GetFaceColour(*args, **kwargs)
6387
6388 def GetMediumShadow(*args, **kwargs):
6389 """GetMediumShadow(self) -> Colour"""
6390 return _gdi_.Effects_GetMediumShadow(*args, **kwargs)
6391
6392 def GetDarkShadow(*args, **kwargs):
6393 """GetDarkShadow(self) -> Colour"""
6394 return _gdi_.Effects_GetDarkShadow(*args, **kwargs)
6395
6396 def SetHighlightColour(*args, **kwargs):
6397 """SetHighlightColour(self, Colour c)"""
6398 return _gdi_.Effects_SetHighlightColour(*args, **kwargs)
6399
6400 def SetLightShadow(*args, **kwargs):
6401 """SetLightShadow(self, Colour c)"""
6402 return _gdi_.Effects_SetLightShadow(*args, **kwargs)
6403
6404 def SetFaceColour(*args, **kwargs):
6405 """SetFaceColour(self, Colour c)"""
6406 return _gdi_.Effects_SetFaceColour(*args, **kwargs)
6407
6408 def SetMediumShadow(*args, **kwargs):
6409 """SetMediumShadow(self, Colour c)"""
6410 return _gdi_.Effects_SetMediumShadow(*args, **kwargs)
6411
6412 def SetDarkShadow(*args, **kwargs):
6413 """SetDarkShadow(self, Colour c)"""
6414 return _gdi_.Effects_SetDarkShadow(*args, **kwargs)
6415
6416 def Set(*args, **kwargs):
6417 """
6418 Set(self, Colour highlightColour, Colour lightShadow, Colour faceColour,
6419 Colour mediumShadow, Colour darkShadow)
6420 """
6421 return _gdi_.Effects_Set(*args, **kwargs)
6422
6423 def DrawSunkenEdge(*args, **kwargs):
6424 """DrawSunkenEdge(self, DC dc, Rect rect, int borderSize=1)"""
6425 return _gdi_.Effects_DrawSunkenEdge(*args, **kwargs)
6426
6427 def TileBitmap(*args, **kwargs):
6428 """TileBitmap(self, Rect rect, DC dc, Bitmap bitmap) -> bool"""
6429 return _gdi_.Effects_TileBitmap(*args, **kwargs)
6430
ac5d357a
RD
6431 DarkShadow = property(GetDarkShadow,SetDarkShadow,doc="See `GetDarkShadow` and `SetDarkShadow`")
6432 FaceColour = property(GetFaceColour,SetFaceColour,doc="See `GetFaceColour` and `SetFaceColour`")
6433 HighlightColour = property(GetHighlightColour,SetHighlightColour,doc="See `GetHighlightColour` and `SetHighlightColour`")
6434 LightShadow = property(GetLightShadow,SetLightShadow,doc="See `GetLightShadow` and `SetLightShadow`")
6435 MediumShadow = property(GetMediumShadow,SetMediumShadow,doc="See `GetMediumShadow` and `SetMediumShadow`")
2131d850 6436_gdi_.Effects_swigregister(Effects)
d55e5bfc 6437
be9b1dca
RD
6438#---------------------------------------------------------------------------
6439
6440CONTROL_DISABLED = _gdi_.CONTROL_DISABLED
6441CONTROL_FOCUSED = _gdi_.CONTROL_FOCUSED
6442CONTROL_PRESSED = _gdi_.CONTROL_PRESSED
79df624a 6443CONTROL_SPECIAL = _gdi_.CONTROL_SPECIAL
be9b1dca
RD
6444CONTROL_ISDEFAULT = _gdi_.CONTROL_ISDEFAULT
6445CONTROL_ISSUBMENU = _gdi_.CONTROL_ISSUBMENU
6446CONTROL_EXPANDED = _gdi_.CONTROL_EXPANDED
79df624a 6447CONTROL_SIZEGRIP = _gdi_.CONTROL_SIZEGRIP
be9b1dca
RD
6448CONTROL_CURRENT = _gdi_.CONTROL_CURRENT
6449CONTROL_SELECTED = _gdi_.CONTROL_SELECTED
6450CONTROL_CHECKED = _gdi_.CONTROL_CHECKED
6451CONTROL_CHECKABLE = _gdi_.CONTROL_CHECKABLE
6452CONTROL_UNDETERMINED = _gdi_.CONTROL_UNDETERMINED
6453CONTROL_FLAGS_MASK = _gdi_.CONTROL_FLAGS_MASK
6454CONTROL_DIRTY = _gdi_.CONTROL_DIRTY
6455class SplitterRenderParams(object):
6456 """
6457 This is just a simple struct used as a return value of
6458 `wx.RendererNative.GetSplitterParams` and contains some platform
6459 specific metrics about splitters.
6460
6461 * widthSash: the width of the splitter sash.
6462 * border: the width of the border of the splitter window.
6463 * isHotSensitive: ``True`` if the splitter changes its
6464 appearance when the mouse is over it.
6465
6466
6467 """
1bd55598
RD
6468 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6469 __repr__ = _swig_repr
6470 def __init__(self, *args, **kwargs):
be9b1dca
RD
6471 """
6472 __init__(self, int widthSash_, int border_, bool isSens_) -> SplitterRenderParams
6473
6474 This is just a simple struct used as a return value of
6475 `wx.RendererNative.GetSplitterParams` and contains some platform
6476 specific metrics about splitters.
6477
6478 * widthSash: the width of the splitter sash.
6479 * border: the width of the border of the splitter window.
6480 * isHotSensitive: ``True`` if the splitter changes its
6481 appearance when the mouse is over it.
6482
6483
6484 """
1bd55598
RD
6485 _gdi_.SplitterRenderParams_swiginit(self,_gdi_.new_SplitterRenderParams(*args, **kwargs))
6486 __swig_destroy__ = _gdi_.delete_SplitterRenderParams
6487 __del__ = lambda self : None;
be9b1dca
RD
6488 widthSash = property(_gdi_.SplitterRenderParams_widthSash_get)
6489 border = property(_gdi_.SplitterRenderParams_border_get)
6490 isHotSensitive = property(_gdi_.SplitterRenderParams_isHotSensitive_get)
2131d850 6491_gdi_.SplitterRenderParams_swigregister(SplitterRenderParams)
be9b1dca 6492
33d6fd3b
RD
6493class HeaderButtonParams(object):
6494 """Extra (optional) parameters for `wx.RendererNative.DrawHeaderButton`"""
6495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6496 __repr__ = _swig_repr
6497 def __init__(self, *args, **kwargs):
6498 """
6499 __init__(self) -> HeaderButtonParams
6500
6501 Extra (optional) parameters for `wx.RendererNative.DrawHeaderButton`
6502 """
6503 _gdi_.HeaderButtonParams_swiginit(self,_gdi_.new_HeaderButtonParams(*args, **kwargs))
6504 __swig_destroy__ = _gdi_.delete_HeaderButtonParams
6505 __del__ = lambda self : None;
6506 m_arrowColour = property(_gdi_.HeaderButtonParams_m_arrowColour_get, _gdi_.HeaderButtonParams_m_arrowColour_set)
6507 m_selectionColour = property(_gdi_.HeaderButtonParams_m_selectionColour_get, _gdi_.HeaderButtonParams_m_selectionColour_set)
6508 m_labelText = property(_gdi_.HeaderButtonParams_m_labelText_get, _gdi_.HeaderButtonParams_m_labelText_set)
6509 m_labelFont = property(_gdi_.HeaderButtonParams_m_labelFont_get, _gdi_.HeaderButtonParams_m_labelFont_set)
6510 m_labelColour = property(_gdi_.HeaderButtonParams_m_labelColour_get, _gdi_.HeaderButtonParams_m_labelColour_set)
6511 m_labelBitmap = property(_gdi_.HeaderButtonParams_m_labelBitmap_get, _gdi_.HeaderButtonParams_m_labelBitmap_set)
6512 m_labelAlignment = property(_gdi_.HeaderButtonParams_m_labelAlignment_get, _gdi_.HeaderButtonParams_m_labelAlignment_set)
6513_gdi_.HeaderButtonParams_swigregister(HeaderButtonParams)
6514
6515HDR_SORT_ICON_NONE = _gdi_.HDR_SORT_ICON_NONE
6516HDR_SORT_ICON_UP = _gdi_.HDR_SORT_ICON_UP
6517HDR_SORT_ICON_DOWN = _gdi_.HDR_SORT_ICON_DOWN
be9b1dca
RD
6518class RendererVersion(object):
6519 """
6520 This simple struct represents the `wx.RendererNative` interface
6521 version and is only used as the return value of
6522 `wx.RendererNative.GetVersion`.
6523 """
1bd55598
RD
6524 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6525 __repr__ = _swig_repr
6526 def __init__(self, *args, **kwargs):
be9b1dca
RD
6527 """
6528 __init__(self, int version_, int age_) -> RendererVersion
6529
6530 This simple struct represents the `wx.RendererNative` interface
6531 version and is only used as the return value of
6532 `wx.RendererNative.GetVersion`.
6533 """
1bd55598
RD
6534 _gdi_.RendererVersion_swiginit(self,_gdi_.new_RendererVersion(*args, **kwargs))
6535 __swig_destroy__ = _gdi_.delete_RendererVersion
6536 __del__ = lambda self : None;
be9b1dca
RD
6537 Current_Version = _gdi_.RendererVersion_Current_Version
6538 Current_Age = _gdi_.RendererVersion_Current_Age
6539 def IsCompatible(*args, **kwargs):
6540 """IsCompatible(RendererVersion ver) -> bool"""
6541 return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
6542
6543 IsCompatible = staticmethod(IsCompatible)
6544 version = property(_gdi_.RendererVersion_version_get)
6545 age = property(_gdi_.RendererVersion_age_get)
2131d850 6546_gdi_.RendererVersion_swigregister(RendererVersion)
be9b1dca
RD
6547
6548def RendererVersion_IsCompatible(*args, **kwargs):
1bd55598
RD
6549 """RendererVersion_IsCompatible(RendererVersion ver) -> bool"""
6550 return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
be9b1dca
RD
6551
6552class RendererNative(object):
6553 """
33d6fd3b
RD
6554 One of the design principles of wxWidgets is to use the native
6555 widgets on every platform in order to be as close as possible to
6556 the native look and feel on every platform. However there are
6557 still cases when some generic widgets are needed for various
6558 reasons, but it can sometimes take a lot of messy work to make
6559 them conform to the native LnF.
be9b1dca
RD
6560
6561 The wx.RendererNative class is a collection of functions that have
6562 platform-specific implementations for drawing certain parts of
6563 genereic controls in ways that are as close to the native look as
6564 possible.
6565
704eda0c
RD
6566 Note that each drawing function restores the `wx.DC` attributes if it
6567 changes them, so it is safe to assume that the same pen, brush and
6568 colours that were active before the call to this function are still in
6569 effect after it.
6570
be9b1dca 6571 """
1bd55598
RD
6572 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6573 def __init__(self): raise AttributeError, "No constructor defined"
6574 __repr__ = _swig_repr
be9b1dca
RD
6575 def DrawHeaderButton(*args, **kwargs):
6576 """
33d6fd3b
RD
6577 DrawHeaderButton(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE,
6578 HeaderButtonParams params=None)
be9b1dca 6579
1c71765a 6580 Draw the header control button (such as what is used by `wx.ListCtrl`
be9b1dca
RD
6581 in report mode.)
6582 """
6583 return _gdi_.RendererNative_DrawHeaderButton(*args, **kwargs)
6584
33d6fd3b
RD
6585 def DrawHeaderButtonContents(*args, **kwargs):
6586 """
6587 DrawHeaderButtonContents(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE,
6588 HeaderButtonParams params=None)
6589
6590 Draw the contents of a header control button, (label, sort
6591 arrows, etc.) Normally this is only called by `DrawHeaderButton`.
6592 """
6593 return _gdi_.RendererNative_DrawHeaderButtonContents(*args, **kwargs)
6594
6595 def GetHeaderButtonHeight(*args, **kwargs):
6596 """
6597 GetHeaderButtonHeight(self, Window win) -> int
6598
6599 Returns the default height of a header button, either a fixed platform
6600 height if available, or a generic height based on the window's font.
6601 """
6602 return _gdi_.RendererNative_GetHeaderButtonHeight(*args, **kwargs)
6603
be9b1dca
RD
6604 def DrawTreeItemButton(*args, **kwargs):
6605 """
6606 DrawTreeItemButton(self, Window win, DC dc, Rect rect, int flags=0)
6607
6608 Draw the expanded/collapsed icon for a tree control item.
6609 """
6610 return _gdi_.RendererNative_DrawTreeItemButton(*args, **kwargs)
6611
6612 def DrawSplitterBorder(*args, **kwargs):
6613 """
6614 DrawSplitterBorder(self, Window win, DC dc, Rect rect, int flags=0)
6615
6616 Draw the border for a sash window: this border must be such that the
6617 sash drawn by `DrawSplitterSash` blends into it well.
6618 """
6619 return _gdi_.RendererNative_DrawSplitterBorder(*args, **kwargs)
6620
6621 def DrawSplitterSash(*args, **kwargs):
6622 """
6623 DrawSplitterSash(self, Window win, DC dc, Size size, int position, int orient,
6624 int flags=0)
6625
6626 Draw a sash. The orient parameter defines whether the sash should be
6627 vertical or horizontal and how the position should be interpreted.
6628 """
6629 return _gdi_.RendererNative_DrawSplitterSash(*args, **kwargs)
6630
6631 def DrawComboBoxDropButton(*args, **kwargs):
6632 """
6633 DrawComboBoxDropButton(self, Window win, DC dc, Rect rect, int flags=0)
6634
6635 Draw a button like the one used by `wx.ComboBox` to show a drop down
6636 window. The usual appearance is a downwards pointing arrow.
6637
6638 The ``flags`` parameter may have the ``wx.CONTROL_PRESSED`` or
6639 ``wx.CONTROL_CURRENT`` bits set.
6640 """
6641 return _gdi_.RendererNative_DrawComboBoxDropButton(*args, **kwargs)
6642
6643 def DrawDropArrow(*args, **kwargs):
6644 """
6645 DrawDropArrow(self, Window win, DC dc, Rect rect, int flags=0)
6646
6647 Draw a drop down arrow that is suitable for use outside a combo
6648 box. Arrow will have a transparent background.
6649
6650 ``rect`` is not entirely filled by the arrow. Instead, you should use
6651 bounding rectangle of a drop down button which arrow matches the size
6652 you need. ``flags`` may have the ``wx.CONTROL_PRESSED`` or
6653 ``wx.CONTROL_CURRENT`` bit set.
6654 """
6655 return _gdi_.RendererNative_DrawDropArrow(*args, **kwargs)
6656
2131d850 6657 def DrawCheckBox(*args, **kwargs):
da91cb0f 6658 """
2131d850 6659 DrawCheckBox(self, Window win, DC dc, Rect rect, int flags=0)
da91cb0f
RD
6660
6661 Draw a check button. Flags may use wx.CONTROL_CHECKED,
6662 wx.CONTROL_UNDETERMINED and wx.CONTROL_CURRENT.
6663 """
2131d850
RD
6664 return _gdi_.RendererNative_DrawCheckBox(*args, **kwargs)
6665
6666 def DrawPushButton(*args, **kwargs):
6667 """
6668 DrawPushButton(self, Window win, DC dc, Rect rect, int flags=0)
6669
6670 Draw a blank button. Flags may be wx.CONTROL_PRESSED, wx.CONTROL_CURRENT and
6671 wx.CONTROL_ISDEFAULT
6672 """
6673 return _gdi_.RendererNative_DrawPushButton(*args, **kwargs)
6674
6675 def DrawItemSelectionRect(*args, **kwargs):
6676 """
6677 DrawItemSelectionRect(self, Window win, DC dc, Rect rect, int flags=0)
6678
6679 Draw rectangle indicating that an item in e.g. a list control has been
6680 selected or focused
6681
6682 The flags parameter may be:
6683
6684 ==================== ============================================
6685 wx.CONTROL_SELECTED item is selected, e.g. draw background
6686 wx.CONTROL_CURRENT item is the current item, e.g. dotted border
6687 wx.CONTROL_FOCUSED the whole control has focus, e.g. blue
6688 background vs. grey otherwise
6689 ==================== ============================================
6690
6691 """
6692 return _gdi_.RendererNative_DrawItemSelectionRect(*args, **kwargs)
da91cb0f 6693
be9b1dca
RD
6694 def GetSplitterParams(*args, **kwargs):
6695 """
6696 GetSplitterParams(self, Window win) -> SplitterRenderParams
6697
6698 Get the splitter parameters, see `wx.SplitterRenderParams`.
6699 """
6700 return _gdi_.RendererNative_GetSplitterParams(*args, **kwargs)
6701
6702 def Get(*args, **kwargs):
6703 """
6704 Get() -> RendererNative
6705
6706 Return the currently used renderer
6707 """
6708 return _gdi_.RendererNative_Get(*args, **kwargs)
6709
6710 Get = staticmethod(Get)
6711 def GetGeneric(*args, **kwargs):
6712 """
6713 GetGeneric() -> RendererNative
6714
6715 Return the generic implementation of the renderer. Under some
6716 platforms, this is the default renderer implementation, others have
6717 platform-specific default renderer which can be retrieved by calling
1d5ee749 6718 `wx.RendererNative.GetDefault`.
be9b1dca
RD
6719 """
6720 return _gdi_.RendererNative_GetGeneric(*args, **kwargs)
6721
6722 GetGeneric = staticmethod(GetGeneric)
6723 def GetDefault(*args, **kwargs):
6724 """
6725 GetDefault() -> RendererNative
6726
6727 Return the default (native) implementation for this platform -- this
1d5ee749
RD
6728 is also the one used by default but this may be changed by calling
6729 `wx.RendererNative.Set` in which case the return value of this method
6730 may be different from the return value of `wx.RendererNative.Get`.
be9b1dca
RD
6731 """
6732 return _gdi_.RendererNative_GetDefault(*args, **kwargs)
6733
6734 GetDefault = staticmethod(GetDefault)
6735 def Set(*args, **kwargs):
6736 """
6737 Set(RendererNative renderer) -> RendererNative
6738
6739 Set the renderer to use, passing None reverts to using the default
6740 renderer. Returns the previous renderer used with Set or None.
6741 """
6742 return _gdi_.RendererNative_Set(*args, **kwargs)
6743
6744 Set = staticmethod(Set)
6745 def GetVersion(*args, **kwargs):
6746 """
6747 GetVersion(self) -> RendererVersion
6748
6749 Returns the version of the renderer. Will be used for ensuring
6750 compatibility of dynamically loaded renderers.
6751 """
6752 return _gdi_.RendererNative_GetVersion(*args, **kwargs)
6753
33d6fd3b
RD
6754 SplitterParams = property(GetSplitterParams,doc="See `GetSplitterParams`")
6755 Version = property(GetVersion,doc="See `GetVersion`")
2131d850 6756_gdi_.RendererNative_swigregister(RendererNative)
be9b1dca 6757
1bd55598
RD
6758def RendererNative_Get(*args):
6759 """
be9b1dca
RD
6760 RendererNative_Get() -> RendererNative
6761
6762 Return the currently used renderer
6763 """
1bd55598 6764 return _gdi_.RendererNative_Get(*args)
be9b1dca 6765
1bd55598
RD
6766def RendererNative_GetGeneric(*args):
6767 """
be9b1dca
RD
6768 RendererNative_GetGeneric() -> RendererNative
6769
6770 Return the generic implementation of the renderer. Under some
6771 platforms, this is the default renderer implementation, others have
6772 platform-specific default renderer which can be retrieved by calling
1d5ee749 6773 `wx.RendererNative.GetDefault`.
be9b1dca 6774 """
1bd55598 6775 return _gdi_.RendererNative_GetGeneric(*args)
be9b1dca 6776
1bd55598
RD
6777def RendererNative_GetDefault(*args):
6778 """
be9b1dca
RD
6779 RendererNative_GetDefault() -> RendererNative
6780
6781 Return the default (native) implementation for this platform -- this
1d5ee749
RD
6782 is also the one used by default but this may be changed by calling
6783 `wx.RendererNative.Set` in which case the return value of this method
6784 may be different from the return value of `wx.RendererNative.Get`.
be9b1dca 6785 """
1bd55598 6786 return _gdi_.RendererNative_GetDefault(*args)
be9b1dca
RD
6787
6788def RendererNative_Set(*args, **kwargs):
1bd55598 6789 """
be9b1dca
RD
6790 RendererNative_Set(RendererNative renderer) -> RendererNative
6791
6792 Set the renderer to use, passing None reverts to using the default
6793 renderer. Returns the previous renderer used with Set or None.
6794 """
1bd55598 6795 return _gdi_.RendererNative_Set(*args, **kwargs)
be9b1dca 6796
27e45892
RD
6797#---------------------------------------------------------------------------
6798
6799class PseudoDC(_core.Object):
6800 """
6801 A PseudoDC is an object that can be used as if it were a `wx.DC`. All
6802 commands issued to the PseudoDC are stored in a list. You can then
6803 play these commands back to a real DC object using the DrawToDC
6804 method. Commands in the command list are indexed by ID. You can use
6805 this to clear the operations associated with a single ID and then
6806 re-draw the object associated with that ID.
6807 """
6808 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6809 __repr__ = _swig_repr
6810 def __init__(self, *args, **kwargs):
6811 """
6812 __init__(self) -> PseudoDC
6813
6814 Constructs a new Pseudo device context for recording dc operations
6815 """
6816 _gdi_.PseudoDC_swiginit(self,_gdi_.new_PseudoDC(*args, **kwargs))
6817 def BeginDrawing(*args, **kwargs):
6818 """
6819 BeginDrawing(self)
6820
6821 Allows for optimization of drawing code on platforms that need it. On
6822 other platforms this is just an empty function and is harmless. To
6823 take advantage of this postential optimization simply enclose each
6824 group of calls to the drawing primitives within calls to
6825 `BeginDrawing` and `EndDrawing`.
6826 """
6827 return _gdi_.PseudoDC_BeginDrawing(*args, **kwargs)
6828
6829 def EndDrawing(*args, **kwargs):
6830 """
6831 EndDrawing(self)
6832
6833 Ends the group of drawing primitives started with `BeginDrawing`, and
6834 invokes whatever optimization is available for this DC type on the
6835 current platform.
6836 """
6837 return _gdi_.PseudoDC_EndDrawing(*args, **kwargs)
6838
6839 __swig_destroy__ = _gdi_.delete_PseudoDC
6840 __del__ = lambda self : None;
6841 def RemoveAll(*args, **kwargs):
6842 """
6843 RemoveAll(self)
6844
6845 Removes all objects and operations from the recorded list.
6846 """
6847 return _gdi_.PseudoDC_RemoveAll(*args, **kwargs)
6848
6849 def GetLen(*args, **kwargs):
6850 """
6851 GetLen(self) -> int
6852
6853 Returns the number of operations in the recorded list.
6854 """
6855 return _gdi_.PseudoDC_GetLen(*args, **kwargs)
6856
6857 def SetId(*args, **kwargs):
6858 """
6859 SetId(self, int id)
6860
6861 Sets the id to be associated with subsequent operations.
6862 """
6863 return _gdi_.PseudoDC_SetId(*args, **kwargs)
6864
6865 def ClearId(*args, **kwargs):
6866 """
6867 ClearId(self, int id)
6868
6869 Removes all operations associated with id so the object can be redrawn.
6870 """
6871 return _gdi_.PseudoDC_ClearId(*args, **kwargs)
6872
6873 def RemoveId(*args, **kwargs):
6874 """
6875 RemoveId(self, int id)
6876
6877 Remove the object node (and all operations) associated with an id.
6878 """
6879 return _gdi_.PseudoDC_RemoveId(*args, **kwargs)
6880
6881 def TranslateId(*args, **kwargs):
6882 """
6883 TranslateId(self, int id, int dx, int dy)
6884
6885 Translate the operations of id by dx,dy.
6886 """
6887 return _gdi_.PseudoDC_TranslateId(*args, **kwargs)
6888
72ef6efb
RD
6889 def SetIdGreyedOut(*args, **kwargs):
6890 """
6891 SetIdGreyedOut(self, int id, bool greyout=True)
6892
6893 Set whether an object is drawn greyed out or not.
6894 """
6895 return _gdi_.PseudoDC_SetIdGreyedOut(*args, **kwargs)
6896
6897 def GetIdGreyedOut(*args, **kwargs):
6898 """
6899 GetIdGreyedOut(self, int id) -> bool
6900
6901 Get whether an object is drawn greyed out or not.
6902 """
6903 return _gdi_.PseudoDC_GetIdGreyedOut(*args, **kwargs)
6904
6905 def FindObjects(*args, **kwargs):
6906 """
6907 FindObjects(self, int x, int y, int radius=1, wxColor bg=*wxWHITE) -> PyObject
6908
6909 Returns a list of all the id's that draw a pixel with color
6910 not equal to bg within radius of (x,y).
6911 Returns an empty list if nothing is found. The list is in
6912 reverse drawing order so list[0] is the top id.
6913 """
6914 return _gdi_.PseudoDC_FindObjects(*args, **kwargs)
6915
6916 def FindObjectsByBBox(*args, **kwargs):
6917 """
6918 FindObjectsByBBox(self, int x, int y) -> PyObject
6919
6920 Returns a list of all the id's whose bounding boxes include (x,y).
6921 Returns an empty list if nothing is found. The list is in
6922 reverse drawing order so list[0] is the top id.
6923 """
6924 return _gdi_.PseudoDC_FindObjectsByBBox(*args, **kwargs)
6925
27e45892
RD
6926 def DrawIdToDC(*args, **kwargs):
6927 """
6928 DrawIdToDC(self, int id, DC dc)
6929
6930 Draw recorded operations of id to dc.
6931 """
6932 return _gdi_.PseudoDC_DrawIdToDC(*args, **kwargs)
6933
6934 def SetIdBounds(*args, **kwargs):
6935 """
6936 SetIdBounds(self, int id, Rect rect)
6937
6938 Set the bounding rect of a given object. This will create
6939 an object node if one doesn't exist.
6940 """
6941 return _gdi_.PseudoDC_SetIdBounds(*args, **kwargs)
6942
6943 def GetIdBounds(*args, **kwargs):
6944 """
6945 GetIdBounds(self, int id) -> Rect
6946
6947 Returns the bounding rectangle previouly set with SetIdBounds. If
6948 no bounds have been set, it returns wx.Rect(0,0,0,0).
6949 """
6950 return _gdi_.PseudoDC_GetIdBounds(*args, **kwargs)
6951
6952 def DrawToDCClipped(*args, **kwargs):
6953 """
6954 DrawToDCClipped(self, DC dc, Rect rect)
6955
6956 Draws the recorded operations to dc unless the operation is known to
6957 be outside rect.
6958 """
6959 return _gdi_.PseudoDC_DrawToDCClipped(*args, **kwargs)
6960
6961 def DrawToDCClippedRgn(*args, **kwargs):
6962 """
6963 DrawToDCClippedRgn(self, DC dc, Region region)
6964
6965 Draws the recorded operations to dc unless the operation is known to
6966 be outside rect.
6967 """
6968 return _gdi_.PseudoDC_DrawToDCClippedRgn(*args, **kwargs)
6969
6970 def DrawToDC(*args, **kwargs):
6971 """
6972 DrawToDC(self, DC dc)
6973
6974 Draws the recorded operations to dc.
6975 """
6976 return _gdi_.PseudoDC_DrawToDC(*args, **kwargs)
6977
6978 def FloodFill(*args, **kwargs):
6979 """
6980 FloodFill(self, int x, int y, Colour col, int style=FLOOD_SURFACE)
6981
6982 Flood fills the device context starting from the given point, using
6983 the current brush colour, and using a style:
6984
6985 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
6986 the given colour is encountered.
6987
6988 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
6989 colour.
6990
6991 Returns False if the operation failed.
6992
6993 Note: The present implementation for non-Windows platforms may fail to
6994 find colour borders if the pixels do not match the colour
6995 exactly. However the function will still return true.
6996 """
6997 return _gdi_.PseudoDC_FloodFill(*args, **kwargs)
6998
6999 def FloodFillPoint(*args, **kwargs):
7000 """
7001 FloodFillPoint(self, Point pt, Colour col, int style=FLOOD_SURFACE)
7002
7003 Flood fills the device context starting from the given point, using
7004 the current brush colour, and using a style:
7005
7006 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
7007 the given colour is encountered.
7008
7009 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
7010 colour.
7011
7012 Returns False if the operation failed.
7013
7014 Note: The present implementation for non-Windows platforms may fail to
7015 find colour borders if the pixels do not match the colour
7016 exactly. However the function will still return true.
7017 """
7018 return _gdi_.PseudoDC_FloodFillPoint(*args, **kwargs)
7019
7020 def DrawLine(*args, **kwargs):
7021 """
7022 DrawLine(self, int x1, int y1, int x2, int y2)
7023
7024 Draws a line from the first point to the second. The current pen is
7025 used for drawing the line. Note that the second point is *not* part of
7026 the line and is not drawn by this function (this is consistent with
7027 the behaviour of many other toolkits).
7028 """
7029 return _gdi_.PseudoDC_DrawLine(*args, **kwargs)
7030
7031 def DrawLinePoint(*args, **kwargs):
7032 """
7033 DrawLinePoint(self, Point pt1, Point pt2)
7034
7035 Draws a line from the first point to the second. The current pen is
7036 used for drawing the line. Note that the second point is *not* part of
7037 the line and is not drawn by this function (this is consistent with
7038 the behaviour of many other toolkits).
7039 """
7040 return _gdi_.PseudoDC_DrawLinePoint(*args, **kwargs)
7041
7042 def CrossHair(*args, **kwargs):
7043 """
7044 CrossHair(self, int x, int y)
7045
7046 Displays a cross hair using the current pen. This is a vertical and
7047 horizontal line the height and width of the window, centred on the
7048 given point.
7049 """
7050 return _gdi_.PseudoDC_CrossHair(*args, **kwargs)
7051
7052 def CrossHairPoint(*args, **kwargs):
7053 """
7054 CrossHairPoint(self, Point pt)
7055
7056 Displays a cross hair using the current pen. This is a vertical and
7057 horizontal line the height and width of the window, centred on the
7058 given point.
7059 """
7060 return _gdi_.PseudoDC_CrossHairPoint(*args, **kwargs)
7061
7062 def DrawArc(*args, **kwargs):
7063 """
7064 DrawArc(self, int x1, int y1, int x2, int y2, int xc, int yc)
7065
7066 Draws an arc of a circle, centred on the *center* point (xc, yc), from
7067 the first point to the second. The current pen is used for the outline
7068 and the current brush for filling the shape.
7069
7070 The arc is drawn in an anticlockwise direction from the start point to
7071 the end point.
7072 """
7073 return _gdi_.PseudoDC_DrawArc(*args, **kwargs)
7074
7075 def DrawArcPoint(*args, **kwargs):
7076 """
7077 DrawArcPoint(self, Point pt1, Point pt2, Point center)
7078
7079 Draws an arc of a circle, centred on the *center* point (xc, yc), from
7080 the first point to the second. The current pen is used for the outline
7081 and the current brush for filling the shape.
7082
7083 The arc is drawn in an anticlockwise direction from the start point to
7084 the end point.
7085 """
7086 return _gdi_.PseudoDC_DrawArcPoint(*args, **kwargs)
7087
7088 def DrawCheckMark(*args, **kwargs):
7089 """
7090 DrawCheckMark(self, int x, int y, int width, int height)
7091
7092 Draws a check mark inside the given rectangle.
7093 """
7094 return _gdi_.PseudoDC_DrawCheckMark(*args, **kwargs)
7095
7096 def DrawCheckMarkRect(*args, **kwargs):
7097 """
7098 DrawCheckMarkRect(self, Rect rect)
7099
7100 Draws a check mark inside the given rectangle.
7101 """
7102 return _gdi_.PseudoDC_DrawCheckMarkRect(*args, **kwargs)
7103
7104 def DrawEllipticArc(*args, **kwargs):
7105 """
7106 DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
7107
7108 Draws an arc of an ellipse, with the given rectangle defining the
7109 bounds of the ellipse. The current pen is used for drawing the arc and
7110 the current brush is used for drawing the pie.
7111
7112 The *start* and *end* parameters specify the start and end of the arc
7113 relative to the three-o'clock position from the center of the
7114 rectangle. Angles are specified in degrees (360 is a complete
7115 circle). Positive values mean counter-clockwise motion. If start is
7116 equal to end, a complete ellipse will be drawn.
7117 """
7118 return _gdi_.PseudoDC_DrawEllipticArc(*args, **kwargs)
7119
7120 def DrawEllipticArcPointSize(*args, **kwargs):
7121 """
7122 DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end)
7123
7124 Draws an arc of an ellipse, with the given rectangle defining the
7125 bounds of the ellipse. The current pen is used for drawing the arc and
7126 the current brush is used for drawing the pie.
7127
7128 The *start* and *end* parameters specify the start and end of the arc
7129 relative to the three-o'clock position from the center of the
7130 rectangle. Angles are specified in degrees (360 is a complete
7131 circle). Positive values mean counter-clockwise motion. If start is
7132 equal to end, a complete ellipse will be drawn.
7133 """
7134 return _gdi_.PseudoDC_DrawEllipticArcPointSize(*args, **kwargs)
7135
7136 def DrawPoint(*args, **kwargs):
7137 """
7138 DrawPoint(self, int x, int y)
7139
7140 Draws a point using the current pen.
7141 """
7142 return _gdi_.PseudoDC_DrawPoint(*args, **kwargs)
7143
7144 def DrawPointPoint(*args, **kwargs):
7145 """
7146 DrawPointPoint(self, Point pt)
7147
7148 Draws a point using the current pen.
7149 """
7150 return _gdi_.PseudoDC_DrawPointPoint(*args, **kwargs)
7151
7152 def DrawRectangle(*args, **kwargs):
7153 """
7154 DrawRectangle(self, int x, int y, int width, int height)
7155
7156 Draws a rectangle with the given top left corner, and with the given
7157 size. The current pen is used for the outline and the current brush
7158 for filling the shape.
7159 """
7160 return _gdi_.PseudoDC_DrawRectangle(*args, **kwargs)
7161
7162 def DrawRectangleRect(*args, **kwargs):
7163 """
7164 DrawRectangleRect(self, Rect rect)
7165
7166 Draws a rectangle with the given top left corner, and with the given
7167 size. The current pen is used for the outline and the current brush
7168 for filling the shape.
7169 """
7170 return _gdi_.PseudoDC_DrawRectangleRect(*args, **kwargs)
7171
7172 def DrawRectanglePointSize(*args, **kwargs):
7173 """
7174 DrawRectanglePointSize(self, Point pt, Size sz)
7175
7176 Draws a rectangle with the given top left corner, and with the given
7177 size. The current pen is used for the outline and the current brush
7178 for filling the shape.
7179 """
7180 return _gdi_.PseudoDC_DrawRectanglePointSize(*args, **kwargs)
7181
7182 def DrawRoundedRectangle(*args, **kwargs):
7183 """
7184 DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
7185
7186 Draws a rectangle with the given top left corner, and with the given
7187 size. The corners are quarter-circles using the given radius. The
7188 current pen is used for the outline and the current brush for filling
7189 the shape.
7190
7191 If radius is positive, the value is assumed to be the radius of the
7192 rounded corner. If radius is negative, the absolute value is assumed
7193 to be the proportion of the smallest dimension of the rectangle. This
7194 means that the corner can be a sensible size relative to the size of
7195 the rectangle, and also avoids the strange effects X produces when the
7196 corners are too big for the rectangle.
7197 """
7198 return _gdi_.PseudoDC_DrawRoundedRectangle(*args, **kwargs)
7199
7200 def DrawRoundedRectangleRect(*args, **kwargs):
7201 """
7202 DrawRoundedRectangleRect(self, Rect r, double radius)
7203
7204 Draws a rectangle with the given top left corner, and with the given
7205 size. The corners are quarter-circles using the given radius. The
7206 current pen is used for the outline and the current brush for filling
7207 the shape.
7208
7209 If radius is positive, the value is assumed to be the radius of the
7210 rounded corner. If radius is negative, the absolute value is assumed
7211 to be the proportion of the smallest dimension of the rectangle. This
7212 means that the corner can be a sensible size relative to the size of
7213 the rectangle, and also avoids the strange effects X produces when the
7214 corners are too big for the rectangle.
7215 """
7216 return _gdi_.PseudoDC_DrawRoundedRectangleRect(*args, **kwargs)
7217
7218 def DrawRoundedRectanglePointSize(*args, **kwargs):
7219 """
7220 DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
7221
7222 Draws a rectangle with the given top left corner, and with the given
7223 size. The corners are quarter-circles using the given radius. The
7224 current pen is used for the outline and the current brush for filling
7225 the shape.
7226
7227 If radius is positive, the value is assumed to be the radius of the
7228 rounded corner. If radius is negative, the absolute value is assumed
7229 to be the proportion of the smallest dimension of the rectangle. This
7230 means that the corner can be a sensible size relative to the size of
7231 the rectangle, and also avoids the strange effects X produces when the
7232 corners are too big for the rectangle.
7233 """
7234 return _gdi_.PseudoDC_DrawRoundedRectanglePointSize(*args, **kwargs)
7235
7236 def DrawCircle(*args, **kwargs):
7237 """
7238 DrawCircle(self, int x, int y, int radius)
7239
7240 Draws a circle with the given center point and radius. The current
7241 pen is used for the outline and the current brush for filling the
7242 shape.
7243 """
7244 return _gdi_.PseudoDC_DrawCircle(*args, **kwargs)
7245
7246 def DrawCirclePoint(*args, **kwargs):
7247 """
7248 DrawCirclePoint(self, Point pt, int radius)
7249
7250 Draws a circle with the given center point and radius. The current
7251 pen is used for the outline and the current brush for filling the
7252 shape.
7253 """
7254 return _gdi_.PseudoDC_DrawCirclePoint(*args, **kwargs)
7255
7256 def DrawEllipse(*args, **kwargs):
7257 """
7258 DrawEllipse(self, int x, int y, int width, int height)
7259
7260 Draws an ellipse contained in the specified rectangle. The current pen
7261 is used for the outline and the current brush for filling the shape.
7262 """
7263 return _gdi_.PseudoDC_DrawEllipse(*args, **kwargs)
7264
7265 def DrawEllipseRect(*args, **kwargs):
7266 """
7267 DrawEllipseRect(self, Rect rect)
7268
7269 Draws an ellipse contained in the specified rectangle. The current pen
7270 is used for the outline and the current brush for filling the shape.
7271 """
7272 return _gdi_.PseudoDC_DrawEllipseRect(*args, **kwargs)
7273
7274 def DrawEllipsePointSize(*args, **kwargs):
7275 """
7276 DrawEllipsePointSize(self, Point pt, Size sz)
7277
7278 Draws an ellipse contained in the specified rectangle. The current pen
7279 is used for the outline and the current brush for filling the shape.
7280 """
7281 return _gdi_.PseudoDC_DrawEllipsePointSize(*args, **kwargs)
7282
7283 def DrawIcon(*args, **kwargs):
7284 """
7285 DrawIcon(self, Icon icon, int x, int y)
7286
7287 Draw an icon on the display (does nothing if the device context is
7288 PostScript). This can be the simplest way of drawing bitmaps on a
7289 window.
7290 """
7291 return _gdi_.PseudoDC_DrawIcon(*args, **kwargs)
7292
7293 def DrawIconPoint(*args, **kwargs):
7294 """
7295 DrawIconPoint(self, Icon icon, Point pt)
7296
7297 Draw an icon on the display (does nothing if the device context is
7298 PostScript). This can be the simplest way of drawing bitmaps on a
7299 window.
7300 """
7301 return _gdi_.PseudoDC_DrawIconPoint(*args, **kwargs)
7302
7303 def DrawBitmap(*args, **kwargs):
7304 """
7305 DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
7306
7307 Draw a bitmap on the device context at the specified point. If
7308 *transparent* is true and the bitmap has a transparency mask, (or
7309 alpha channel on the platforms that support it) then the bitmap will
7310 be drawn transparently.
7311 """
7312 return _gdi_.PseudoDC_DrawBitmap(*args, **kwargs)
7313
7314 def DrawBitmapPoint(*args, **kwargs):
7315 """
7316 DrawBitmapPoint(self, Bitmap bmp, Point pt, bool useMask=False)
7317
7318 Draw a bitmap on the device context at the specified point. If
7319 *transparent* is true and the bitmap has a transparency mask, (or
7320 alpha channel on the platforms that support it) then the bitmap will
7321 be drawn transparently.
7322 """
7323 return _gdi_.PseudoDC_DrawBitmapPoint(*args, **kwargs)
7324
7325 def DrawText(*args, **kwargs):
7326 """
7327 DrawText(self, String text, int x, int y)
7328
7329 Draws a text string at the specified point, using the current text
7330 font, and the current text foreground and background colours.
7331
7332 The coordinates refer to the top-left corner of the rectangle bounding
1d5ee749
RD
7333 the string. See `wx.DC.GetTextExtent` for how to get the dimensions of
7334 a text string, which can be used to position the text more precisely,
7335 (you will need to use a real DC with GetTextExtent as wx.PseudoDC does
7336 not implement it.)
27e45892
RD
7337
7338 **NOTE**: under wxGTK the current logical function is used by this
7339 function but it is ignored by wxMSW. Thus, you should avoid using
7340 logical functions with this function in portable programs.
7341 """
7342 return _gdi_.PseudoDC_DrawText(*args, **kwargs)
7343
7344 def DrawTextPoint(*args, **kwargs):
7345 """
7346 DrawTextPoint(self, String text, Point pt)
7347
7348 Draws a text string at the specified point, using the current text
7349 font, and the current text foreground and background colours.
7350
7351 The coordinates refer to the top-left corner of the rectangle bounding
1d5ee749
RD
7352 the string. See `wx.DC.GetTextExtent` for how to get the dimensions of
7353 a text string, which can be used to position the text more precisely,
7354 (you will need to use a real DC with GetTextExtent as wx.PseudoDC does
7355 not implement it.)
27e45892
RD
7356
7357 **NOTE**: under wxGTK the current logical function is used by this
7358 function but it is ignored by wxMSW. Thus, you should avoid using
7359 logical functions with this function in portable programs.
7360 """
7361 return _gdi_.PseudoDC_DrawTextPoint(*args, **kwargs)
7362
7363 def DrawRotatedText(*args, **kwargs):
7364 """
7365 DrawRotatedText(self, String text, int x, int y, double angle)
7366
7367 Draws the text rotated by *angle* degrees, if supported by the platform.
7368
7369 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
7370 function. In particular, a font different from ``wx.NORMAL_FONT``
7371 should be used as the it is not normally a TrueType
7372 font. ``wx.SWISS_FONT`` is an example of a font which is.
7373 """
7374 return _gdi_.PseudoDC_DrawRotatedText(*args, **kwargs)
7375
7376 def DrawRotatedTextPoint(*args, **kwargs):
7377 """
7378 DrawRotatedTextPoint(self, String text, Point pt, double angle)
7379
7380 Draws the text rotated by *angle* degrees, if supported by the platform.
7381
7382 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
7383 function. In particular, a font different from ``wx.NORMAL_FONT``
7384 should be used as the it is not normally a TrueType
7385 font. ``wx.SWISS_FONT`` is an example of a font which is.
7386 """
7387 return _gdi_.PseudoDC_DrawRotatedTextPoint(*args, **kwargs)
7388
7389 def DrawLines(*args, **kwargs):
7390 """
7391 DrawLines(self, List points, int xoffset=0, int yoffset=0)
7392
7393 Draws lines using a sequence of `wx.Point` objects, adding the
7394 optional offset coordinate. The current pen is used for drawing the
7395 lines.
7396 """
7397 return _gdi_.PseudoDC_DrawLines(*args, **kwargs)
7398
7399 def DrawPolygon(*args, **kwargs):
7400 """
7401 DrawPolygon(self, List points, int xoffset=0, int yoffset=0,
7402 int fillStyle=ODDEVEN_RULE)
7403
7404 Draws a filled polygon using a sequence of `wx.Point` objects, adding
7405 the optional offset coordinate. The last argument specifies the fill
7406 rule: ``wx.ODDEVEN_RULE`` (the default) or ``wx.WINDING_RULE``.
7407
7408 The current pen is used for drawing the outline, and the current brush
7409 for filling the shape. Using a transparent brush suppresses
7410 filling. Note that wxWidgets automatically closes the first and last
7411 points.
7412 """
7413 return _gdi_.PseudoDC_DrawPolygon(*args, **kwargs)
7414
7415 def DrawLabel(*args, **kwargs):
7416 """
7417 DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
7418 int indexAccel=-1)
7419
7420 Draw *text* within the specified rectangle, abiding by the alignment
7421 flags. Will additionally emphasize the character at *indexAccel* if
7422 it is not -1.
7423 """
7424 return _gdi_.PseudoDC_DrawLabel(*args, **kwargs)
7425
7426 def DrawImageLabel(*args, **kwargs):
7427 """
7428 DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
7429 int indexAccel=-1)
7430
7431 Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
7432 drawing it) within the specified rectangle, abiding by the alignment
7433 flags. Will additionally emphasize the character at *indexAccel* if
7434 it is not -1.
7435 """
7436 return _gdi_.PseudoDC_DrawImageLabel(*args, **kwargs)
7437
7438 def DrawSpline(*args, **kwargs):
7439 """
7440 DrawSpline(self, List points)
7441
7442 Draws a spline between all given control points, (a list of `wx.Point`
7443 objects) using the current pen. The spline is drawn using a series of
7444 lines, using an algorithm taken from the X drawing program 'XFIG'.
7445 """
7446 return _gdi_.PseudoDC_DrawSpline(*args, **kwargs)
7447
7448 def Clear(*args, **kwargs):
7449 """
7450 Clear(self)
7451
7452 Clears the device context using the current background brush.
7453 """
7454 return _gdi_.PseudoDC_Clear(*args, **kwargs)
7455
7456 def SetFont(*args, **kwargs):
7457 """
7458 SetFont(self, Font font)
7459
7460 Sets the current font for the DC. It must be a valid font, in
7461 particular you should not pass ``wx.NullFont`` to this method.
7462 """
7463 return _gdi_.PseudoDC_SetFont(*args, **kwargs)
7464
7465 def SetPen(*args, **kwargs):
7466 """
7467 SetPen(self, Pen pen)
7468
7469 Sets the current pen for the DC.
7470
7471 If the argument is ``wx.NullPen``, the current pen is selected out of the
7472 device context, and the original pen restored.
7473 """
7474 return _gdi_.PseudoDC_SetPen(*args, **kwargs)
7475
7476 def SetBrush(*args, **kwargs):
7477 """
7478 SetBrush(self, Brush brush)
7479
7480 Sets the current brush for the DC.
7481
7482 If the argument is ``wx.NullBrush``, the current brush is selected out
7483 of the device context, and the original brush restored, allowing the
7484 current brush to be destroyed safely.
7485 """
7486 return _gdi_.PseudoDC_SetBrush(*args, **kwargs)
7487
7488 def SetBackground(*args, **kwargs):
7489 """
7490 SetBackground(self, Brush brush)
7491
7492 Sets the current background brush for the DC.
7493 """
7494 return _gdi_.PseudoDC_SetBackground(*args, **kwargs)
7495
7496 def SetBackgroundMode(*args, **kwargs):
7497 """
7498 SetBackgroundMode(self, int mode)
7499
7500 *mode* may be one of ``wx.SOLID`` and ``wx.TRANSPARENT``. This setting
7501 determines whether text will be drawn with a background colour or
7502 not.
7503 """
7504 return _gdi_.PseudoDC_SetBackgroundMode(*args, **kwargs)
7505
7506 def SetPalette(*args, **kwargs):
7507 """
7508 SetPalette(self, Palette palette)
7509
7510 If this is a window DC or memory DC, assigns the given palette to the
7511 window or bitmap associated with the DC. If the argument is
7512 ``wx.NullPalette``, the current palette is selected out of the device
7513 context, and the original palette restored.
7514 """
7515 return _gdi_.PseudoDC_SetPalette(*args, **kwargs)
7516
7517 def SetTextForeground(*args, **kwargs):
7518 """
7519 SetTextForeground(self, Colour colour)
7520
7521 Sets the current text foreground colour for the DC.
7522 """
7523 return _gdi_.PseudoDC_SetTextForeground(*args, **kwargs)
7524
7525 def SetTextBackground(*args, **kwargs):
7526 """
7527 SetTextBackground(self, Colour colour)
7528
7529 Sets the current text background colour for the DC.
7530 """
7531 return _gdi_.PseudoDC_SetTextBackground(*args, **kwargs)
7532
7533 def SetLogicalFunction(*args, **kwargs):
7534 """
7535 SetLogicalFunction(self, int function)
7536
7537 Sets the current logical function for the device context. This
1d5ee749
RD
7538 determines how a source pixel (from a pen or brush colour, combines
7539 with a destination pixel in the current device context.
27e45892
RD
7540
7541 The possible values and their meaning in terms of source and
7542 destination pixel values are as follows:
7543
7544 ================ ==========================
7545 wx.AND src AND dst
7546 wx.AND_INVERT (NOT src) AND dst
7547 wx.AND_REVERSE src AND (NOT dst)
7548 wx.CLEAR 0
7549 wx.COPY src
7550 wx.EQUIV (NOT src) XOR dst
7551 wx.INVERT NOT dst
7552 wx.NAND (NOT src) OR (NOT dst)
7553 wx.NOR (NOT src) AND (NOT dst)
7554 wx.NO_OP dst
7555 wx.OR src OR dst
7556 wx.OR_INVERT (NOT src) OR dst
7557 wx.OR_REVERSE src OR (NOT dst)
7558 wx.SET 1
7559 wx.SRC_INVERT NOT src
7560 wx.XOR src XOR dst
7561 ================ ==========================
7562
7563 The default is wx.COPY, which simply draws with the current
7564 colour. The others combine the current colour and the background using
7565 a logical operation. wx.INVERT is commonly used for drawing rubber
7566 bands or moving outlines, since drawing twice reverts to the original
7567 colour.
7568
7569 """
7570 return _gdi_.PseudoDC_SetLogicalFunction(*args, **kwargs)
7571
33d6fd3b
RD
7572 IdBounds = property(GetIdBounds,SetIdBounds,doc="See `GetIdBounds` and `SetIdBounds`")
7573 Len = property(GetLen,doc="See `GetLen`")
27e45892
RD
7574_gdi_.PseudoDC_swigregister(PseudoDC)
7575
d55e5bfc 7576
32fe5131 7577