]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_gdi.py
log wxChoice events in the same format as wxComboBox ones to make it simpler to compa...
[wxWidgets.git] / wxPython / src / gtk / _gdi.py
CommitLineData
32fe5131 1# This file was created automatically by SWIG 1.3.27.
d14a1e28 2# Don't modify this file, modify the SWIG interface instead.
70551f47 3
54f9ee45 4import _gdi_
a323d3bd 5
093d3ff1
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
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):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
54f9ee45
RD
47import _core
48wx = _core
d14a1e28
RD
49#---------------------------------------------------------------------------
50
54f9ee45 51class GDIObject(_core.Object):
093d3ff1 52 """Proxy of C++ GDIObject class"""
e811c8ce
RD
53 def __repr__(self):
54 return "<%s.%s; proxy of C++ wxGDIObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 55 def __init__(self, *args, **kwargs):
a95a7133 56 """__init__(self) -> GDIObject"""
54f9ee45 57 newobj = _gdi_.new_GDIObject(*args, **kwargs)
d14a1e28 58 self.this = newobj.this
9df61a29 59 self.thisown = 1
d14a1e28 60 del newobj.thisown
54f9ee45 61 def __del__(self, destroy=_gdi_.delete_GDIObject):
a95a7133 62 """__del__(self)"""
d14a1e28
RD
63 try:
64 if self.thisown: destroy(self)
65 except: pass
e811c8ce
RD
66
67 def GetVisible(*args, **kwargs):
a95a7133 68 """GetVisible(self) -> bool"""
54f9ee45 69 return _gdi_.GDIObject_GetVisible(*args, **kwargs)
e811c8ce
RD
70
71 def SetVisible(*args, **kwargs):
a95a7133 72 """SetVisible(self, bool visible)"""
54f9ee45 73 return _gdi_.GDIObject_SetVisible(*args, **kwargs)
e811c8ce
RD
74
75 def IsNull(*args, **kwargs):
a95a7133 76 """IsNull(self) -> bool"""
54f9ee45 77 return _gdi_.GDIObject_IsNull(*args, **kwargs)
e811c8ce 78
9df61a29 79
d14a1e28
RD
80class GDIObjectPtr(GDIObject):
81 def __init__(self, this):
82 self.this = this
83 if not hasattr(self,"thisown"): self.thisown = 0
84 self.__class__ = GDIObject
54f9ee45 85_gdi_.GDIObject_swigregister(GDIObjectPtr)
9df61a29 86
d14a1e28
RD
87#---------------------------------------------------------------------------
88
54f9ee45 89class Colour(_core.Object):
b88bce5f 90 """
41e2b43e
RD
91 A colour is an object representing a combination of Red, Green, and
92 Blue (RGB) intensity values, and is used to determine drawing colours,
93 window colours, etc. Valid RGB values are in the range 0 to 255.
b88bce5f 94
41e2b43e 95 In wxPython there are typemaps that will automatically convert from a
32fe5131
RD
96 colour name, from a '#RRGGBB' colour hex value string, or from a 3
97 integer tuple to a wx.Colour object when calling C++ methods that
98 expect a wxColour. This means that the following are all
99 equivallent::
b88bce5f
RD
100
101 win.SetBackgroundColour(wxColour(0,0,255))
b2df227b
RD
102 win.SetBackgroundColour('BLUE')
103 win.SetBackgroundColour('#0000FF')
32fe5131 104 win.SetBackgroundColour((0,0,255))
b88bce5f 105
41e2b43e
RD
106 Additional colour names and their coresponding values can be added
107 using `wx.ColourDatabase`. Various system colours (as set in the
108 user's system preferences) can be retrieved with
109 `wx.SystemSettings.GetColour`.
110
b88bce5f 111 """
e811c8ce
RD
112 def __repr__(self):
113 return "<%s.%s; proxy of C++ wxColour instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 114 def __init__(self, *args, **kwargs):
b88bce5f 115 """
41e2b43e 116 __init__(self, byte red=0, byte green=0, byte blue=0) -> Colour
b88bce5f
RD
117
118 Constructs a colour from red, green and blue values.
41e2b43e
RD
119
120 :see: Alternate constructors `wx.NamedColour` and `wx.ColourRGB`.
121
b88bce5f 122 """
54f9ee45 123 newobj = _gdi_.new_Colour(*args, **kwargs)
d14a1e28
RD
124 self.this = newobj.this
125 self.thisown = 1
126 del newobj.thisown
54f9ee45 127 def __del__(self, destroy=_gdi_.delete_Colour):
a95a7133 128 """__del__(self)"""
d14a1e28
RD
129 try:
130 if self.thisown: destroy(self)
131 except: pass
e811c8ce
RD
132
133 def Red(*args, **kwargs):
b88bce5f 134 """
41e2b43e 135 Red(self) -> byte
b88bce5f
RD
136
137 Returns the red intensity.
138 """
54f9ee45 139 return _gdi_.Colour_Red(*args, **kwargs)
e811c8ce
RD
140
141 def Green(*args, **kwargs):
b88bce5f 142 """
41e2b43e 143 Green(self) -> byte
b88bce5f
RD
144
145 Returns the green intensity.
146 """
54f9ee45 147 return _gdi_.Colour_Green(*args, **kwargs)
e811c8ce
RD
148
149 def Blue(*args, **kwargs):
b88bce5f 150 """
41e2b43e 151 Blue(self) -> byte
b88bce5f
RD
152
153 Returns the blue intensity.
154 """
54f9ee45 155 return _gdi_.Colour_Blue(*args, **kwargs)
e811c8ce
RD
156
157 def Ok(*args, **kwargs):
b88bce5f 158 """
a95a7133 159 Ok(self) -> bool
b88bce5f
RD
160
161 Returns True if the colour object is valid (the colour has been
162 initialised with RGB values).
163 """
54f9ee45 164 return _gdi_.Colour_Ok(*args, **kwargs)
e811c8ce
RD
165
166 def Set(*args, **kwargs):
b88bce5f 167 """
41e2b43e 168 Set(self, byte red, byte green, byte blue)
b88bce5f
RD
169
170 Sets the RGB intensity values.
171 """
54f9ee45 172 return _gdi_.Colour_Set(*args, **kwargs)
e811c8ce 173
c9c7117a 174 def SetRGB(*args, **kwargs):
b88bce5f 175 """
a95a7133 176 SetRGB(self, unsigned long colRGB)
b88bce5f
RD
177
178 Sets the RGB intensity values from a packed RGB value.
179 """
54f9ee45 180 return _gdi_.Colour_SetRGB(*args, **kwargs)
e811c8ce 181
b88bce5f
RD
182 def SetFromName(*args, **kwargs):
183 """
a95a7133 184 SetFromName(self, String colourName)
b88bce5f 185
41e2b43e
RD
186 Sets the RGB intensity values using a colour name listed in
187 ``wx.TheColourDatabase``.
b88bce5f 188 """
54f9ee45 189 return _gdi_.Colour_SetFromName(*args, **kwargs)
b88bce5f
RD
190
191 def GetPixel(*args, **kwargs):
192 """
a95a7133 193 GetPixel(self) -> long
b88bce5f
RD
194
195 Returns a pixel value which is platform-dependent. On Windows, a
41e2b43e
RD
196 COLORREF is returned. On X, an allocated pixel value is returned. -1
197 is returned if the pixel is invalid (on X, unallocated).
b88bce5f 198 """
54f9ee45 199 return _gdi_.Colour_GetPixel(*args, **kwargs)
b88bce5f 200
e811c8ce 201 def __eq__(*args, **kwargs):
b88bce5f 202 """
a95a7133 203 __eq__(self, Colour colour) -> bool
b88bce5f
RD
204
205 Compare colours for equality
206 """
54f9ee45 207 return _gdi_.Colour___eq__(*args, **kwargs)
e811c8ce
RD
208
209 def __ne__(*args, **kwargs):
b88bce5f 210 """
a95a7133 211 __ne__(self, Colour colour) -> bool
e811c8ce 212
b88bce5f
RD
213 Compare colours for inequality
214 """
54f9ee45 215 return _gdi_.Colour___ne__(*args, **kwargs)
c9c7117a 216
e811c8ce 217 def Get(*args, **kwargs):
b88bce5f
RD
218 """
219 Get() -> (r, g, b)
220
221 Returns the RGB intensity values as a tuple.
222 """
54f9ee45 223 return _gdi_.Colour_Get(*args, **kwargs)
e811c8ce 224
b88bce5f
RD
225 def GetRGB(*args, **kwargs):
226 """
a95a7133 227 GetRGB(self) -> unsigned long
b88bce5f
RD
228
229 Return the colour as a packed RGB value
230 """
54f9ee45 231 return _gdi_.Colour_GetRGB(*args, **kwargs)
b88bce5f 232
41e2b43e
RD
233 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
234 def __str__(self): return str(self.Get())
235 def __repr__(self): return 'wx.Colour' + str(self.Get())
d14a1e28 236 def __nonzero__(self): return self.Ok()
74e96f3d
RD
237 __safe_for_unpickling__ = True
238 def __reduce__(self): return (Colour, self.Get())
9df61a29
RD
239
240
d14a1e28
RD
241class ColourPtr(Colour):
242 def __init__(self, this):
70551f47 243 self.this = this
d14a1e28
RD
244 if not hasattr(self,"thisown"): self.thisown = 0
245 self.__class__ = Colour
54f9ee45 246_gdi_.Colour_swigregister(ColourPtr)
70551f47 247
d14a1e28 248def NamedColour(*args, **kwargs):
b88bce5f
RD
249 """
250 NamedColour(String colorName) -> Colour
251
41e2b43e
RD
252 Constructs a colour object using a colour name listed in
253 ``wx.TheColourDatabase``.
b88bce5f 254 """
54f9ee45 255 val = _gdi_.new_NamedColour(*args, **kwargs)
d14a1e28
RD
256 val.thisown = 1
257 return val
70551f47 258
d14a1e28 259def ColourRGB(*args, **kwargs):
b88bce5f
RD
260 """
261 ColourRGB(unsigned long colRGB) -> Colour
262
263 Constructs a colour from a packed RGB value.
264 """
54f9ee45 265 val = _gdi_.new_ColourRGB(*args, **kwargs)
d14a1e28
RD
266 val.thisown = 1
267 return val
70551f47 268
994141e6
RD
269Color = Colour
270NamedColor = NamedColour
271ColorRGB = ColourRGB
272
d14a1e28 273class Palette(GDIObject):
093d3ff1 274 """Proxy of C++ Palette class"""
e811c8ce
RD
275 def __repr__(self):
276 return "<%s.%s; proxy of C++ wxPalette instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 277 def __init__(self, *args, **kwargs):
a95a7133 278 """__init__(self, int n, unsigned char red, unsigned char green, unsigned char blue) -> Palette"""
54f9ee45 279 newobj = _gdi_.new_Palette(*args, **kwargs)
d14a1e28
RD
280 self.this = newobj.this
281 self.thisown = 1
282 del newobj.thisown
54f9ee45 283 def __del__(self, destroy=_gdi_.delete_Palette):
a95a7133 284 """__del__(self)"""
d14a1e28
RD
285 try:
286 if self.thisown: destroy(self)
287 except: pass
e811c8ce
RD
288
289 def GetPixel(*args, **kwargs):
a95a7133 290 """GetPixel(self, byte red, byte green, byte blue) -> int"""
54f9ee45 291 return _gdi_.Palette_GetPixel(*args, **kwargs)
e811c8ce
RD
292
293 def GetRGB(*args, **kwargs):
d3b6e4ff 294 """GetRGB(self, int pixel) -> (R,G,B)"""
54f9ee45 295 return _gdi_.Palette_GetRGB(*args, **kwargs)
e811c8ce 296
5cbf236d
RD
297 def GetColoursCount(*args, **kwargs):
298 """GetColoursCount(self) -> int"""
299 return _gdi_.Palette_GetColoursCount(*args, **kwargs)
300
e811c8ce 301 def Ok(*args, **kwargs):
a95a7133 302 """Ok(self) -> bool"""
54f9ee45 303 return _gdi_.Palette_Ok(*args, **kwargs)
e811c8ce 304
322913ce 305 def __nonzero__(self): return self.Ok()
70551f47 306
d14a1e28
RD
307class PalettePtr(Palette):
308 def __init__(self, this):
70551f47 309 self.this = this
d14a1e28
RD
310 if not hasattr(self,"thisown"): self.thisown = 0
311 self.__class__ = Palette
54f9ee45 312_gdi_.Palette_swigregister(PalettePtr)
d14a1e28
RD
313
314#---------------------------------------------------------------------------
315
316class Pen(GDIObject):
093d3ff1 317 """Proxy of C++ Pen class"""
e811c8ce
RD
318 def __repr__(self):
319 return "<%s.%s; proxy of C++ wxPen instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 320 def __init__(self, *args, **kwargs):
a95a7133 321 """__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen"""
54f9ee45 322 newobj = _gdi_.new_Pen(*args, **kwargs)
d14a1e28
RD
323 self.this = newobj.this
324 self.thisown = 1
325 del newobj.thisown
54f9ee45 326 def __del__(self, destroy=_gdi_.delete_Pen):
a95a7133 327 """__del__(self)"""
d14a1e28
RD
328 try:
329 if self.thisown: destroy(self)
330 except: pass
e811c8ce
RD
331
332 def GetCap(*args, **kwargs):
a95a7133 333 """GetCap(self) -> int"""
54f9ee45 334 return _gdi_.Pen_GetCap(*args, **kwargs)
e811c8ce
RD
335
336 def GetColour(*args, **kwargs):
a95a7133 337 """GetColour(self) -> Colour"""
54f9ee45 338 return _gdi_.Pen_GetColour(*args, **kwargs)
e811c8ce
RD
339
340 def GetJoin(*args, **kwargs):
a95a7133 341 """GetJoin(self) -> int"""
54f9ee45 342 return _gdi_.Pen_GetJoin(*args, **kwargs)
e811c8ce
RD
343
344 def GetStyle(*args, **kwargs):
a95a7133 345 """GetStyle(self) -> int"""
54f9ee45 346 return _gdi_.Pen_GetStyle(*args, **kwargs)
e811c8ce
RD
347
348 def GetWidth(*args, **kwargs):
a95a7133 349 """GetWidth(self) -> int"""
54f9ee45 350 return _gdi_.Pen_GetWidth(*args, **kwargs)
e811c8ce
RD
351
352 def Ok(*args, **kwargs):
a95a7133 353 """Ok(self) -> bool"""
54f9ee45 354 return _gdi_.Pen_Ok(*args, **kwargs)
e811c8ce
RD
355
356 def SetCap(*args, **kwargs):
a95a7133 357 """SetCap(self, int cap_style)"""
54f9ee45 358 return _gdi_.Pen_SetCap(*args, **kwargs)
e811c8ce
RD
359
360 def SetColour(*args, **kwargs):
a95a7133 361 """SetColour(self, Colour colour)"""
54f9ee45 362 return _gdi_.Pen_SetColour(*args, **kwargs)
e811c8ce
RD
363
364 def SetJoin(*args, **kwargs):
a95a7133 365 """SetJoin(self, int join_style)"""
54f9ee45 366 return _gdi_.Pen_SetJoin(*args, **kwargs)
e811c8ce
RD
367
368 def SetStyle(*args, **kwargs):
a95a7133 369 """SetStyle(self, int style)"""
54f9ee45 370 return _gdi_.Pen_SetStyle(*args, **kwargs)
e811c8ce
RD
371
372 def SetWidth(*args, **kwargs):
a95a7133 373 """SetWidth(self, int width)"""
54f9ee45 374 return _gdi_.Pen_SetWidth(*args, **kwargs)
e811c8ce
RD
375
376 def SetDashes(*args, **kwargs):
093d3ff1 377 """SetDashes(self, int dashes)"""
54f9ee45 378 return _gdi_.Pen_SetDashes(*args, **kwargs)
e811c8ce
RD
379
380 def GetDashes(*args, **kwargs):
a95a7133 381 """GetDashes(self) -> PyObject"""
54f9ee45 382 return _gdi_.Pen_GetDashes(*args, **kwargs)
e811c8ce 383
66c033b4
RD
384 def _SetDashes(*args, **kwargs):
385 """_SetDashes(self, PyObject _self, PyObject pyDashes)"""
386 return _gdi_.Pen__SetDashes(*args, **kwargs)
387
388 def SetDashes(self, dashes):
389 """
390 Associate a list of dash lengths with the Pen.
391 """
392 self._SetDashes(self, dashes)
393
394 def GetDashCount(*args, **kwargs):
395 """GetDashCount(self) -> int"""
396 return _gdi_.Pen_GetDashCount(*args, **kwargs)
397
3adfb63b 398 def __eq__(*args, **kwargs):
a95a7133 399 """__eq__(self, Pen other) -> bool"""
54f9ee45 400 return _gdi_.Pen___eq__(*args, **kwargs)
3adfb63b 401
22faec7d 402 def __ne__(*args, **kwargs):
a95a7133 403 """__ne__(self, Pen other) -> bool"""
54f9ee45 404 return _gdi_.Pen___ne__(*args, **kwargs)
22faec7d 405
d14a1e28 406 def __nonzero__(self): return self.Ok()
d14a1e28
RD
407
408class PenPtr(Pen):
409 def __init__(self, this):
410 self.this = this
411 if not hasattr(self,"thisown"): self.thisown = 0
412 self.__class__ = Pen
54f9ee45 413_gdi_.Pen_swigregister(PenPtr)
d14a1e28 414
66c033b4 415#---------------------------------------------------------------------------
e811c8ce 416
66c033b4
RD
417class Brush(GDIObject):
418 """
419 A brush is a drawing tool for filling in areas. It is used for
420 painting the background of rectangles, ellipses, etc. when drawing on
421 a `wx.DC`. It has a colour and a style.
0df68c9f 422 """
e811c8ce
RD
423 def __repr__(self):
424 return "<%s.%s; proxy of C++ wxBrush instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 425 def __init__(self, *args, **kwargs):
0df68c9f 426 """
a95a7133 427 __init__(self, Colour colour, int style=SOLID) -> Brush
1e0c8722 428
41e2b43e 429 Constructs a brush from a `wx.Colour` object and a style.
0df68c9f 430 """
54f9ee45 431 newobj = _gdi_.new_Brush(*args, **kwargs)
d14a1e28
RD
432 self.this = newobj.this
433 self.thisown = 1
434 del newobj.thisown
54f9ee45 435 def __del__(self, destroy=_gdi_.delete_Brush):
a95a7133 436 """__del__(self)"""
d14a1e28
RD
437 try:
438 if self.thisown: destroy(self)
439 except: pass
e811c8ce
RD
440
441 def SetColour(*args, **kwargs):
66c033b4
RD
442 """
443 SetColour(self, Colour col)
444
445 Set the brush's `wx.Colour`.
446 """
54f9ee45 447 return _gdi_.Brush_SetColour(*args, **kwargs)
e811c8ce
RD
448
449 def SetStyle(*args, **kwargs):
66c033b4
RD
450 """
451 SetStyle(self, int style)
452
453 Sets the style of the brush. See `__init__` for a listing of styles.
454 """
54f9ee45 455 return _gdi_.Brush_SetStyle(*args, **kwargs)
e811c8ce
RD
456
457 def SetStipple(*args, **kwargs):
66c033b4
RD
458 """
459 SetStipple(self, Bitmap stipple)
460
461 Sets the stipple `wx.Bitmap`.
462 """
54f9ee45 463 return _gdi_.Brush_SetStipple(*args, **kwargs)
e811c8ce
RD
464
465 def GetColour(*args, **kwargs):
66c033b4
RD
466 """
467 GetColour(self) -> Colour
468
469 Returns the `wx.Colour` of the brush.
470 """
54f9ee45 471 return _gdi_.Brush_GetColour(*args, **kwargs)
e811c8ce
RD
472
473 def GetStyle(*args, **kwargs):
66c033b4
RD
474 """
475 GetStyle(self) -> int
476
477 Returns the style of the brush. See `__init__` for a listing of
478 styles.
479 """
54f9ee45 480 return _gdi_.Brush_GetStyle(*args, **kwargs)
e811c8ce
RD
481
482 def GetStipple(*args, **kwargs):
66c033b4
RD
483 """
484 GetStipple(self) -> Bitmap
485
486 Returns the stiple `wx.Bitmap` of the brush. If the brush does not
487 have a wx.STIPPLE style, then the return value may be non-None but an
488 uninitialised bitmap (`wx.Bitmap.Ok` returns False).
489 """
54f9ee45 490 return _gdi_.Brush_GetStipple(*args, **kwargs)
e811c8ce 491
f78cc896
RD
492 def IsHatch(*args, **kwargs):
493 """
494 IsHatch(self) -> bool
495
496 Is the current style a hatch type?
497 """
498 return _gdi_.Brush_IsHatch(*args, **kwargs)
499
e811c8ce 500 def Ok(*args, **kwargs):
66c033b4
RD
501 """
502 Ok(self) -> bool
503
504 Returns True if the brush is initialised and valid.
505 """
54f9ee45 506 return _gdi_.Brush_Ok(*args, **kwargs)
e811c8ce 507
d14a1e28 508 def __nonzero__(self): return self.Ok()
70551f47 509
d14a1e28
RD
510class BrushPtr(Brush):
511 def __init__(self, this):
70551f47 512 self.this = this
d14a1e28
RD
513 if not hasattr(self,"thisown"): self.thisown = 0
514 self.__class__ = Brush
54f9ee45 515_gdi_.Brush_swigregister(BrushPtr)
d14a1e28 516
d04418a7
RD
517def BrushFromBitmap(*args, **kwargs):
518 """
519 BrushFromBitmap(Bitmap stippleBitmap) -> Brush
520
521 Constructs a stippled brush using a bitmap.
522 """
523 val = _gdi_.new_BrushFromBitmap(*args, **kwargs)
524 val.thisown = 1
525 return val
526
d14a1e28 527class Bitmap(GDIObject):
66c033b4
RD
528 """
529 The wx.Bitmap class encapsulates the concept of a platform-dependent
530 bitmap. It can be either monochrome or colour, and either loaded from
531 a file or created dynamically. A bitmap can be selected into a memory
532 device context (instance of `wx.MemoryDC`). This enables the bitmap to
533 be copied to a window or memory device context using `wx.DC.Blit`, or
534 to be used as a drawing surface.
66c033b4 535 """
e811c8ce
RD
536 def __repr__(self):
537 return "<%s.%s; proxy of C++ wxBitmap instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 538 def __init__(self, *args, **kwargs):
0df68c9f 539 """
a95a7133 540 __init__(self, String name, int type=BITMAP_TYPE_ANY) -> Bitmap
1e0c8722 541
0df68c9f
RD
542 Loads a bitmap from a file.
543 """
54f9ee45 544 newobj = _gdi_.new_Bitmap(*args, **kwargs)
d14a1e28 545 self.this = newobj.this
8bf5d46e 546 self.thisown = 1
d14a1e28 547 del newobj.thisown
54f9ee45 548 def __del__(self, destroy=_gdi_.delete_Bitmap):
a95a7133 549 """__del__(self)"""
d14a1e28
RD
550 try:
551 if self.thisown: destroy(self)
552 except: pass
e811c8ce
RD
553
554 def Ok(*args, **kwargs):
a95a7133 555 """Ok(self) -> bool"""
54f9ee45 556 return _gdi_.Bitmap_Ok(*args, **kwargs)
e811c8ce
RD
557
558 def GetWidth(*args, **kwargs):
0df68c9f 559 """
a95a7133 560 GetWidth(self) -> int
1e0c8722 561
0df68c9f
RD
562 Gets the width of the bitmap in pixels.
563 """
54f9ee45 564 return _gdi_.Bitmap_GetWidth(*args, **kwargs)
e811c8ce
RD
565
566 def GetHeight(*args, **kwargs):
0df68c9f 567 """
a95a7133 568 GetHeight(self) -> int
1e0c8722 569
0df68c9f
RD
570 Gets the height of the bitmap in pixels.
571 """
54f9ee45 572 return _gdi_.Bitmap_GetHeight(*args, **kwargs)
e811c8ce
RD
573
574 def GetDepth(*args, **kwargs):
0df68c9f 575 """
a95a7133 576 GetDepth(self) -> int
1e0c8722 577
0df68c9f
RD
578 Gets the colour depth of the bitmap. A value of 1 indicates a
579 monochrome bitmap.
580 """
54f9ee45 581 return _gdi_.Bitmap_GetDepth(*args, **kwargs)
e811c8ce 582
b2df227b
RD
583 def GetSize(*args, **kwargs):
584 """
a95a7133 585 GetSize(self) -> Size
b2df227b
RD
586
587 Get the size of the bitmap.
588 """
54f9ee45 589 return _gdi_.Bitmap_GetSize(*args, **kwargs)
b2df227b 590
e811c8ce 591 def ConvertToImage(*args, **kwargs):
0df68c9f 592 """
a95a7133 593 ConvertToImage(self) -> Image
1e0c8722 594
66c033b4
RD
595 Creates a platform-independent image from a platform-dependent
596 bitmap. This preserves mask information so that bitmaps and images can
597 be converted back and forth without loss in that respect.
0df68c9f 598 """
54f9ee45 599 return _gdi_.Bitmap_ConvertToImage(*args, **kwargs)
e811c8ce
RD
600
601 def GetMask(*args, **kwargs):
0df68c9f 602 """
a95a7133 603 GetMask(self) -> Mask
1e0c8722 604
66c033b4
RD
605 Gets the associated mask (if any) which may have been loaded from a
606 file or explpicitly set for the bitmap.
607
608 :see: `SetMask`, `wx.Mask`
609
0df68c9f 610 """
54f9ee45 611 return _gdi_.Bitmap_GetMask(*args, **kwargs)
e811c8ce
RD
612
613 def SetMask(*args, **kwargs):
0df68c9f 614 """
a95a7133 615 SetMask(self, Mask mask)
1e0c8722 616
0df68c9f 617 Sets the mask for this bitmap.
66c033b4
RD
618
619 :see: `GetMask`, `wx.Mask`
620
0df68c9f 621 """
54f9ee45 622 return _gdi_.Bitmap_SetMask(*args, **kwargs)
e811c8ce
RD
623
624 def SetMaskColour(*args, **kwargs):
0df68c9f 625 """
a95a7133 626 SetMaskColour(self, Colour colour)
1e0c8722 627
0df68c9f
RD
628 Create a Mask based on a specified colour in the Bitmap.
629 """
54f9ee45 630 return _gdi_.Bitmap_SetMaskColour(*args, **kwargs)
e811c8ce
RD
631
632 def GetSubBitmap(*args, **kwargs):
0df68c9f 633 """
a95a7133 634 GetSubBitmap(self, Rect rect) -> Bitmap
1e0c8722 635
66c033b4
RD
636 Returns a sub-bitmap of the current one as long as the rect belongs
637 entirely to the bitmap. This function preserves bit depth and mask
638 information.
0df68c9f 639 """
54f9ee45 640 return _gdi_.Bitmap_GetSubBitmap(*args, **kwargs)
e811c8ce
RD
641
642 def SaveFile(*args, **kwargs):
0df68c9f 643 """
66c033b4 644 SaveFile(self, String name, int type, Palette palette=None) -> bool
1e0c8722 645
66c033b4
RD
646 Saves a bitmap in the named file. See `__init__` for a description of
647 the ``type`` parameter.
0df68c9f 648 """
54f9ee45 649 return _gdi_.Bitmap_SaveFile(*args, **kwargs)
e811c8ce
RD
650
651 def LoadFile(*args, **kwargs):
0df68c9f 652 """
a95a7133 653 LoadFile(self, String name, int type) -> bool
1e0c8722 654
66c033b4
RD
655 Loads a bitmap from a file. See `__init__` for a description of the
656 ``type`` parameter.
0df68c9f 657 """
54f9ee45 658 return _gdi_.Bitmap_LoadFile(*args, **kwargs)
e811c8ce 659
d3b6e4ff
RD
660 def GetPalette(*args, **kwargs):
661 """GetPalette(self) -> Palette"""
662 return _gdi_.Bitmap_GetPalette(*args, **kwargs)
663
e811c8ce 664 def CopyFromIcon(*args, **kwargs):
a95a7133 665 """CopyFromIcon(self, Icon icon) -> bool"""
54f9ee45 666 return _gdi_.Bitmap_CopyFromIcon(*args, **kwargs)
e811c8ce
RD
667
668 def SetHeight(*args, **kwargs):
0df68c9f 669 """
a95a7133 670 SetHeight(self, int height)
1e0c8722 671
66c033b4 672 Set the height property (does not affect the existing bitmap data).
0df68c9f 673 """
54f9ee45 674 return _gdi_.Bitmap_SetHeight(*args, **kwargs)
e811c8ce
RD
675
676 def SetWidth(*args, **kwargs):
0df68c9f 677 """
a95a7133 678 SetWidth(self, int width)
1e0c8722 679
66c033b4 680 Set the width property (does not affect the existing bitmap data).
0df68c9f 681 """
54f9ee45 682 return _gdi_.Bitmap_SetWidth(*args, **kwargs)
e811c8ce
RD
683
684 def SetDepth(*args, **kwargs):
0df68c9f 685 """
a95a7133 686 SetDepth(self, int depth)
1e0c8722 687
66c033b4 688 Set the depth property (does not affect the existing bitmap data).
0df68c9f 689 """
54f9ee45 690 return _gdi_.Bitmap_SetDepth(*args, **kwargs)
e811c8ce 691
b2df227b
RD
692 def SetSize(*args, **kwargs):
693 """
a95a7133 694 SetSize(self, Size size)
b2df227b 695
66c033b4 696 Set the bitmap size (does not affect the existing bitmap data).
b2df227b 697 """
54f9ee45 698 return _gdi_.Bitmap_SetSize(*args, **kwargs)
b2df227b 699
d14a1e28 700 def __nonzero__(self): return self.Ok()
4276dc52 701 def __eq__(*args, **kwargs):
a95a7133 702 """__eq__(self, Bitmap other) -> bool"""
54f9ee45 703 return _gdi_.Bitmap___eq__(*args, **kwargs)
4276dc52
RD
704
705 def __ne__(*args, **kwargs):
a95a7133 706 """__ne__(self, Bitmap other) -> bool"""
54f9ee45 707 return _gdi_.Bitmap___ne__(*args, **kwargs)
4276dc52 708
70551f47 709
d14a1e28
RD
710class BitmapPtr(Bitmap):
711 def __init__(self, this):
712 self.this = this
713 if not hasattr(self,"thisown"): self.thisown = 0
714 self.__class__ = Bitmap
54f9ee45 715_gdi_.Bitmap_swigregister(BitmapPtr)
70551f47 716
66c033b4
RD
717def EmptyBitmap(*args, **kwargs):
718 """
719 EmptyBitmap(int width, int height, int depth=-1) -> Bitmap
720
721 Creates a new bitmap of the given size. A depth of -1 indicates the
722 depth of the current screen or visual. Some platforms only support 1
723 for monochrome and -1 for the current colour setting.
724 """
725 val = _gdi_.new_EmptyBitmap(*args, **kwargs)
726 val.thisown = 1
727 return val
728
d14a1e28 729def BitmapFromIcon(*args, **kwargs):
0df68c9f
RD
730 """
731 BitmapFromIcon(Icon icon) -> Bitmap
1e0c8722 732
66c033b4 733 Create a new bitmap from a `wx.Icon` object.
0df68c9f 734 """
54f9ee45 735 val = _gdi_.new_BitmapFromIcon(*args, **kwargs)
d14a1e28
RD
736 val.thisown = 1
737 return val
70551f47 738
d14a1e28 739def BitmapFromImage(*args, **kwargs):
0df68c9f
RD
740 """
741 BitmapFromImage(Image image, int depth=-1) -> Bitmap
742
66c033b4
RD
743 Creates bitmap object from a `wx.Image`. This has to be done to
744 actually display a `wx.Image` as you cannot draw an image directly on
745 a window. The resulting bitmap will use the provided colour depth (or
746 that of the current screen colour depth if depth is -1) which entails
747 that a colour reduction may have to take place.
0df68c9f 748 """
54f9ee45 749 val = _gdi_.new_BitmapFromImage(*args, **kwargs)
d14a1e28
RD
750 val.thisown = 1
751 return val
3ef86e32 752
d14a1e28 753def BitmapFromXPMData(*args, **kwargs):
0df68c9f
RD
754 """
755 BitmapFromXPMData(PyObject listOfStrings) -> Bitmap
1e0c8722 756
0df68c9f
RD
757 Construct a Bitmap from a list of strings formatted as XPM data.
758 """
54f9ee45 759 val = _gdi_.new_BitmapFromXPMData(*args, **kwargs)
d14a1e28
RD
760 val.thisown = 1
761 return val
3ef86e32 762
d14a1e28 763def BitmapFromBits(*args, **kwargs):
0df68c9f
RD
764 """
765 BitmapFromBits(PyObject bits, int width, int height, int depth=1) -> Bitmap
766
66c033b4
RD
767 Creates a bitmap from an array of bits. You should only use this
768 function for monochrome bitmaps (depth 1) in portable programs: in
769 this case the bits parameter should contain an XBM image. For other
770 bit depths, the behaviour is platform dependent.
0df68c9f 771 """
54f9ee45 772 val = _gdi_.new_BitmapFromBits(*args, **kwargs)
d14a1e28
RD
773 val.thisown = 1
774 return val
3ef86e32 775
66c033b4 776class Mask(_core.Object):
b2df227b 777 """
66c033b4
RD
778 This class encapsulates a monochrome mask bitmap, where the masked
779 area is black and the unmasked area is white. When associated with a
780 bitmap and drawn in a device context, the unmasked area of the bitmap
781 will be drawn, and the masked area will not be drawn.
b2df227b 782
66c033b4
RD
783 A mask may be associated with a `wx.Bitmap`. It is used in
784 `wx.DC.DrawBitmap` or `wx.DC.Blit` when the source device context is a
785 `wx.MemoryDC` with a `wx.Bitmap` selected into it that contains a
786 mask.
0df68c9f 787 """
e811c8ce
RD
788 def __repr__(self):
789 return "<%s.%s; proxy of C++ wxMask instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 790 def __init__(self, *args, **kwargs):
0df68c9f 791 """
a95a7133 792 __init__(self, Bitmap bitmap, Colour colour=NullColour) -> Mask
1e0c8722 793
66c033b4
RD
794 Constructs a mask from a `wx.Bitmap` and a `wx.Colour` in that bitmap
795 that indicates the transparent portions of the mask. In other words,
796 the pixels in ``bitmap`` that match ``colour`` will be the transparent
797 portions of the mask. If no ``colour`` or an invalid ``colour`` is
798 passed then BLACK is used.
799
800 :see: `wx.Bitmap`, `wx.Colour`
0df68c9f 801 """
54f9ee45 802 newobj = _gdi_.new_Mask(*args, **kwargs)
d14a1e28
RD
803 self.this = newobj.this
804 self.thisown = 1
805 del newobj.thisown
3ef86e32 806
d14a1e28
RD
807class MaskPtr(Mask):
808 def __init__(self, this):
70551f47 809 self.this = this
d14a1e28
RD
810 if not hasattr(self,"thisown"): self.thisown = 0
811 self.__class__ = Mask
54f9ee45 812_gdi_.Mask_swigregister(MaskPtr)
d14a1e28 813
66c033b4 814MaskColour = wx._deprecated(Mask, "wx.MaskColour is deprecated, use `wx.Mask` instead.")
d14a1e28 815class Icon(GDIObject):
093d3ff1 816 """Proxy of C++ Icon class"""
e811c8ce
RD
817 def __repr__(self):
818 return "<%s.%s; proxy of C++ wxIcon instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 819 def __init__(self, *args, **kwargs):
a95a7133 820 """__init__(self, String name, int type, int desiredWidth=-1, int desiredHeight=-1) -> Icon"""
54f9ee45 821 newobj = _gdi_.new_Icon(*args, **kwargs)
d14a1e28 822 self.this = newobj.this
1893b029 823 self.thisown = 1
d14a1e28 824 del newobj.thisown
54f9ee45 825 def __del__(self, destroy=_gdi_.delete_Icon):
a95a7133 826 """__del__(self)"""
d14a1e28
RD
827 try:
828 if self.thisown: destroy(self)
829 except: pass
e811c8ce
RD
830
831 def LoadFile(*args, **kwargs):
a95a7133 832 """LoadFile(self, String name, int type) -> bool"""
54f9ee45 833 return _gdi_.Icon_LoadFile(*args, **kwargs)
e811c8ce
RD
834
835 def Ok(*args, **kwargs):
a95a7133 836 """Ok(self) -> bool"""
54f9ee45 837 return _gdi_.Icon_Ok(*args, **kwargs)
e811c8ce
RD
838
839 def GetWidth(*args, **kwargs):
a95a7133 840 """GetWidth(self) -> int"""
54f9ee45 841 return _gdi_.Icon_GetWidth(*args, **kwargs)
e811c8ce
RD
842
843 def GetHeight(*args, **kwargs):
a95a7133 844 """GetHeight(self) -> int"""
54f9ee45 845 return _gdi_.Icon_GetHeight(*args, **kwargs)
e811c8ce
RD
846
847 def GetDepth(*args, **kwargs):
a95a7133 848 """GetDepth(self) -> int"""
54f9ee45 849 return _gdi_.Icon_GetDepth(*args, **kwargs)
e811c8ce
RD
850
851 def SetWidth(*args, **kwargs):
a95a7133 852 """SetWidth(self, int w)"""
54f9ee45 853 return _gdi_.Icon_SetWidth(*args, **kwargs)
e811c8ce
RD
854
855 def SetHeight(*args, **kwargs):
a95a7133 856 """SetHeight(self, int h)"""
54f9ee45 857 return _gdi_.Icon_SetHeight(*args, **kwargs)
e811c8ce
RD
858
859 def SetDepth(*args, **kwargs):
a95a7133 860 """SetDepth(self, int d)"""
54f9ee45 861 return _gdi_.Icon_SetDepth(*args, **kwargs)
e811c8ce
RD
862
863 def CopyFromBitmap(*args, **kwargs):
a95a7133 864 """CopyFromBitmap(self, Bitmap bmp)"""
54f9ee45 865 return _gdi_.Icon_CopyFromBitmap(*args, **kwargs)
e811c8ce 866
d14a1e28 867 def __nonzero__(self): return self.Ok()
059a841c 868
d14a1e28
RD
869class IconPtr(Icon):
870 def __init__(self, this):
871 self.this = this
872 if not hasattr(self,"thisown"): self.thisown = 0
873 self.__class__ = Icon
54f9ee45 874_gdi_.Icon_swigregister(IconPtr)
059a841c 875
d14a1e28 876def EmptyIcon(*args, **kwargs):
e811c8ce 877 """EmptyIcon() -> Icon"""
54f9ee45 878 val = _gdi_.new_EmptyIcon(*args, **kwargs)
d14a1e28
RD
879 val.thisown = 1
880 return val
059a841c 881
d14a1e28 882def IconFromLocation(*args, **kwargs):
e811c8ce 883 """IconFromLocation(IconLocation loc) -> Icon"""
54f9ee45 884 val = _gdi_.new_IconFromLocation(*args, **kwargs)
a323d3bd
RD
885 val.thisown = 1
886 return val
059a841c 887
d14a1e28 888def IconFromBitmap(*args, **kwargs):
e811c8ce 889 """IconFromBitmap(Bitmap bmp) -> Icon"""
54f9ee45 890 val = _gdi_.new_IconFromBitmap(*args, **kwargs)
a323d3bd
RD
891 val.thisown = 1
892 return val
059a841c 893
d14a1e28 894def IconFromXPMData(*args, **kwargs):
e811c8ce 895 """IconFromXPMData(PyObject listOfStrings) -> Icon"""
54f9ee45 896 val = _gdi_.new_IconFromXPMData(*args, **kwargs)
d14a1e28
RD
897 val.thisown = 1
898 return val
059a841c 899
d14a1e28 900class IconLocation(object):
093d3ff1 901 """Proxy of C++ IconLocation class"""
e811c8ce
RD
902 def __repr__(self):
903 return "<%s.%s; proxy of C++ wxIconLocation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 904 def __init__(self, *args, **kwargs):
a95a7133 905 """__init__(self, String filename=&wxPyEmptyString, int num=0) -> IconLocation"""
54f9ee45 906 newobj = _gdi_.new_IconLocation(*args, **kwargs)
d14a1e28
RD
907 self.this = newobj.this
908 self.thisown = 1
909 del newobj.thisown
54f9ee45 910 def __del__(self, destroy=_gdi_.delete_IconLocation):
a95a7133 911 """__del__(self)"""
d14a1e28
RD
912 try:
913 if self.thisown: destroy(self)
914 except: pass
e811c8ce
RD
915
916 def IsOk(*args, **kwargs):
a95a7133 917 """IsOk(self) -> bool"""
54f9ee45 918 return _gdi_.IconLocation_IsOk(*args, **kwargs)
e811c8ce 919
d14a1e28 920 def __nonzero__(self): return self.Ok()
e811c8ce 921 def SetFileName(*args, **kwargs):
a95a7133 922 """SetFileName(self, String filename)"""
54f9ee45 923 return _gdi_.IconLocation_SetFileName(*args, **kwargs)
e811c8ce
RD
924
925 def GetFileName(*args, **kwargs):
a95a7133 926 """GetFileName(self) -> String"""
54f9ee45 927 return _gdi_.IconLocation_GetFileName(*args, **kwargs)
e811c8ce
RD
928
929 def SetIndex(*args, **kwargs):
a95a7133 930 """SetIndex(self, int num)"""
54f9ee45 931 return _gdi_.IconLocation_SetIndex(*args, **kwargs)
e811c8ce
RD
932
933 def GetIndex(*args, **kwargs):
a95a7133 934 """GetIndex(self) -> int"""
54f9ee45 935 return _gdi_.IconLocation_GetIndex(*args, **kwargs)
e811c8ce 936
d14a1e28
RD
937
938class IconLocationPtr(IconLocation):
939 def __init__(self, this):
940 self.this = this
941 if not hasattr(self,"thisown"): self.thisown = 0
942 self.__class__ = IconLocation
54f9ee45 943_gdi_.IconLocation_swigregister(IconLocationPtr)
d14a1e28
RD
944
945class IconBundle(object):
093d3ff1 946 """Proxy of C++ IconBundle class"""
e811c8ce
RD
947 def __repr__(self):
948 return "<%s.%s; proxy of C++ wxIconBundle instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 949 def __init__(self, *args, **kwargs):
a95a7133 950 """__init__(self) -> IconBundle"""
54f9ee45 951 newobj = _gdi_.new_IconBundle(*args, **kwargs)
d14a1e28 952 self.this = newobj.this
1fded56b 953 self.thisown = 1
d14a1e28 954 del newobj.thisown
54f9ee45 955 def __del__(self, destroy=_gdi_.delete_IconBundle):
a95a7133 956 """__del__(self)"""
d14a1e28
RD
957 try:
958 if self.thisown: destroy(self)
959 except: pass
e811c8ce
RD
960
961 def AddIcon(*args, **kwargs):
a95a7133 962 """AddIcon(self, Icon icon)"""
54f9ee45 963 return _gdi_.IconBundle_AddIcon(*args, **kwargs)
e811c8ce
RD
964
965 def AddIconFromFile(*args, **kwargs):
a95a7133 966 """AddIconFromFile(self, String file, long type)"""
54f9ee45 967 return _gdi_.IconBundle_AddIconFromFile(*args, **kwargs)
e811c8ce
RD
968
969 def GetIcon(*args, **kwargs):
a95a7133 970 """GetIcon(self, Size size) -> Icon"""
54f9ee45 971 return _gdi_.IconBundle_GetIcon(*args, **kwargs)
e811c8ce 972
5e40f9dd 973
d14a1e28
RD
974class IconBundlePtr(IconBundle):
975 def __init__(self, this):
976 self.this = this
977 if not hasattr(self,"thisown"): self.thisown = 0
978 self.__class__ = IconBundle
54f9ee45 979_gdi_.IconBundle_swigregister(IconBundlePtr)
5e40f9dd 980
d14a1e28 981def IconBundleFromFile(*args, **kwargs):
196addbf 982 """IconBundleFromFile(String file, long type) -> IconBundle"""
54f9ee45 983 val = _gdi_.new_IconBundleFromFile(*args, **kwargs)
d14a1e28
RD
984 val.thisown = 1
985 return val
5e40f9dd 986
d14a1e28 987def IconBundleFromIcon(*args, **kwargs):
e811c8ce 988 """IconBundleFromIcon(Icon icon) -> IconBundle"""
54f9ee45 989 val = _gdi_.new_IconBundleFromIcon(*args, **kwargs)
d14a1e28
RD
990 val.thisown = 1
991 return val
5e40f9dd 992
d14a1e28 993class Cursor(GDIObject):
15afbcd0 994 """
41e2b43e
RD
995 A cursor is a small bitmap usually used for denoting where the mouse
996 pointer is, with a picture that might indicate the interpretation of a
997 mouse click.
15afbcd0
RD
998
999 A single cursor object may be used in many windows (any subwindow
41e2b43e
RD
1000 type). The wxWindows convention is to set the cursor for a window, as
1001 in X, rather than to set it globally as in MS Windows, although a
1002 global `wx.SetCursor` function is also available for use on MS Windows.
1003
15afbcd0 1004 """
e811c8ce
RD
1005 def __repr__(self):
1006 return "<%s.%s; proxy of C++ wxCursor instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1007 def __init__(self, *args, **kwargs):
15afbcd0 1008 """
a95a7133 1009 __init__(self, String cursorName, long type, int hotSpotX=0, int hotSpotY=0) -> Cursor
15afbcd0
RD
1010
1011 Construct a Cursor from a file. Specify the type of file using
7557b9b5 1012 wx.BITAMP_TYPE* constants, and specify the hotspot if not using a .cur
41e2b43e 1013 file.
15afbcd0 1014 """
54f9ee45 1015 newobj = _gdi_.new_Cursor(*args, **kwargs)
d14a1e28
RD
1016 self.this = newobj.this
1017 self.thisown = 1
1018 del newobj.thisown
54f9ee45 1019 def __del__(self, destroy=_gdi_.delete_Cursor):
a95a7133 1020 """__del__(self)"""
d14a1e28
RD
1021 try:
1022 if self.thisown: destroy(self)
1023 except: pass
e811c8ce
RD
1024
1025 def Ok(*args, **kwargs):
a95a7133 1026 """Ok(self) -> bool"""
54f9ee45 1027 return _gdi_.Cursor_Ok(*args, **kwargs)
e811c8ce 1028
d14a1e28 1029 def __nonzero__(self): return self.Ok()
b67a9327 1030
d14a1e28
RD
1031class CursorPtr(Cursor):
1032 def __init__(self, this):
1033 self.this = this
1034 if not hasattr(self,"thisown"): self.thisown = 0
1035 self.__class__ = Cursor
54f9ee45 1036_gdi_.Cursor_swigregister(CursorPtr)
70551f47 1037
d14a1e28 1038def StockCursor(*args, **kwargs):
15afbcd0
RD
1039 """
1040 StockCursor(int id) -> Cursor
1041
41e2b43e 1042 Create a cursor using one of the stock cursors. Note that not all
7557b9b5 1043 stock cursors are available on all platforms.
15afbcd0 1044 """
54f9ee45 1045 val = _gdi_.new_StockCursor(*args, **kwargs)
d14a1e28
RD
1046 val.thisown = 1
1047 return val
70551f47 1048
d14a1e28 1049def CursorFromImage(*args, **kwargs):
0df68c9f 1050 """
15afbcd0
RD
1051 CursorFromImage(Image image) -> Cursor
1052
7557b9b5 1053 Constructs a cursor from a `wx.Image`. The mask (if any) will be used
53aa7709 1054 for setting the transparent portions of the cursor.
0df68c9f 1055 """
54f9ee45 1056 val = _gdi_.new_CursorFromImage(*args, **kwargs)
d14a1e28
RD
1057 val.thisown = 1
1058 return val
70551f47 1059
d14a1e28
RD
1060#---------------------------------------------------------------------------
1061
54f9ee45
RD
1062OutRegion = _gdi_.OutRegion
1063PartRegion = _gdi_.PartRegion
1064InRegion = _gdi_.InRegion
d14a1e28 1065class Region(GDIObject):
093d3ff1 1066 """Proxy of C++ Region class"""
e811c8ce
RD
1067 def __repr__(self):
1068 return "<%s.%s; proxy of C++ wxRegion instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1069 def __init__(self, *args, **kwargs):
a95a7133 1070 """__init__(self, int x=0, int y=0, int width=0, int height=0) -> Region"""
54f9ee45 1071 newobj = _gdi_.new_Region(*args, **kwargs)
d14a1e28 1072 self.this = newobj.this
2f4811fc 1073 self.thisown = 1
d14a1e28 1074 del newobj.thisown
54f9ee45 1075 def __del__(self, destroy=_gdi_.delete_Region):
a95a7133 1076 """__del__(self)"""
d14a1e28
RD
1077 try:
1078 if self.thisown: destroy(self)
1079 except: pass
e811c8ce
RD
1080
1081 def Clear(*args, **kwargs):
a95a7133 1082 """Clear(self)"""
54f9ee45 1083 return _gdi_.Region_Clear(*args, **kwargs)
e811c8ce
RD
1084
1085 def Offset(*args, **kwargs):
a95a7133 1086 """Offset(self, int x, int y) -> bool"""
54f9ee45 1087 return _gdi_.Region_Offset(*args, **kwargs)
e811c8ce
RD
1088
1089 def Contains(*args, **kwargs):
a95a7133 1090 """Contains(self, int x, int y) -> int"""
54f9ee45 1091 return _gdi_.Region_Contains(*args, **kwargs)
e811c8ce
RD
1092
1093 def ContainsPoint(*args, **kwargs):
a95a7133 1094 """ContainsPoint(self, Point pt) -> int"""
54f9ee45 1095 return _gdi_.Region_ContainsPoint(*args, **kwargs)
e811c8ce
RD
1096
1097 def ContainsRect(*args, **kwargs):
a95a7133 1098 """ContainsRect(self, Rect rect) -> int"""
54f9ee45 1099 return _gdi_.Region_ContainsRect(*args, **kwargs)
e811c8ce
RD
1100
1101 def ContainsRectDim(*args, **kwargs):
a95a7133 1102 """ContainsRectDim(self, int x, int y, int w, int h) -> int"""
54f9ee45 1103 return _gdi_.Region_ContainsRectDim(*args, **kwargs)
e811c8ce
RD
1104
1105 def GetBox(*args, **kwargs):
a95a7133 1106 """GetBox(self) -> Rect"""
54f9ee45 1107 return _gdi_.Region_GetBox(*args, **kwargs)
e811c8ce
RD
1108
1109 def Intersect(*args, **kwargs):
a95a7133 1110 """Intersect(self, int x, int y, int width, int height) -> bool"""
54f9ee45 1111 return _gdi_.Region_Intersect(*args, **kwargs)
e811c8ce
RD
1112
1113 def IntersectRect(*args, **kwargs):
a95a7133 1114 """IntersectRect(self, Rect rect) -> bool"""
54f9ee45 1115 return _gdi_.Region_IntersectRect(*args, **kwargs)
e811c8ce
RD
1116
1117 def IntersectRegion(*args, **kwargs):
a95a7133 1118 """IntersectRegion(self, Region region) -> bool"""
54f9ee45 1119 return _gdi_.Region_IntersectRegion(*args, **kwargs)
e811c8ce
RD
1120
1121 def IsEmpty(*args, **kwargs):
a95a7133 1122 """IsEmpty(self) -> bool"""
54f9ee45 1123 return _gdi_.Region_IsEmpty(*args, **kwargs)
e811c8ce
RD
1124
1125 def Union(*args, **kwargs):
a95a7133 1126 """Union(self, int x, int y, int width, int height) -> bool"""
54f9ee45 1127 return _gdi_.Region_Union(*args, **kwargs)
e811c8ce
RD
1128
1129 def UnionRect(*args, **kwargs):
a95a7133 1130 """UnionRect(self, Rect rect) -> bool"""
54f9ee45 1131 return _gdi_.Region_UnionRect(*args, **kwargs)
e811c8ce
RD
1132
1133 def UnionRegion(*args, **kwargs):
a95a7133 1134 """UnionRegion(self, Region region) -> bool"""
54f9ee45 1135 return _gdi_.Region_UnionRegion(*args, **kwargs)
e811c8ce
RD
1136
1137 def Subtract(*args, **kwargs):
a95a7133 1138 """Subtract(self, int x, int y, int width, int height) -> bool"""
54f9ee45 1139 return _gdi_.Region_Subtract(*args, **kwargs)
e811c8ce
RD
1140
1141 def SubtractRect(*args, **kwargs):
a95a7133 1142 """SubtractRect(self, Rect rect) -> bool"""
54f9ee45 1143 return _gdi_.Region_SubtractRect(*args, **kwargs)
e811c8ce
RD
1144
1145 def SubtractRegion(*args, **kwargs):
a95a7133 1146 """SubtractRegion(self, Region region) -> bool"""
54f9ee45 1147 return _gdi_.Region_SubtractRegion(*args, **kwargs)
e811c8ce
RD
1148
1149 def Xor(*args, **kwargs):
a95a7133 1150 """Xor(self, int x, int y, int width, int height) -> bool"""
54f9ee45 1151 return _gdi_.Region_Xor(*args, **kwargs)
e811c8ce
RD
1152
1153 def XorRect(*args, **kwargs):
a95a7133 1154 """XorRect(self, Rect rect) -> bool"""
54f9ee45 1155 return _gdi_.Region_XorRect(*args, **kwargs)
e811c8ce
RD
1156
1157 def XorRegion(*args, **kwargs):
a95a7133 1158 """XorRegion(self, Region region) -> bool"""
54f9ee45 1159 return _gdi_.Region_XorRegion(*args, **kwargs)
e811c8ce
RD
1160
1161 def ConvertToBitmap(*args, **kwargs):
a95a7133 1162 """ConvertToBitmap(self) -> Bitmap"""
54f9ee45 1163 return _gdi_.Region_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
1164
1165 def UnionBitmap(*args, **kwargs):
e6ffcedd 1166 """UnionBitmap(self, Bitmap bmp) -> bool"""
54f9ee45 1167 return _gdi_.Region_UnionBitmap(*args, **kwargs)
e811c8ce 1168
e6ffcedd
RD
1169 def UnionBitmapColour(*args, **kwargs):
1170 """UnionBitmapColour(self, Bitmap bmp, Colour transColour, int tolerance=0) -> bool"""
1171 return _gdi_.Region_UnionBitmapColour(*args, **kwargs)
1172
5e40f9dd 1173
d14a1e28
RD
1174class RegionPtr(Region):
1175 def __init__(self, this):
1176 self.this = this
1177 if not hasattr(self,"thisown"): self.thisown = 0
1178 self.__class__ = Region
54f9ee45 1179_gdi_.Region_swigregister(RegionPtr)
5e40f9dd 1180
d14a1e28 1181def RegionFromBitmap(*args, **kwargs):
e6ffcedd 1182 """RegionFromBitmap(Bitmap bmp) -> Region"""
54f9ee45 1183 val = _gdi_.new_RegionFromBitmap(*args, **kwargs)
d14a1e28
RD
1184 val.thisown = 1
1185 return val
5e40f9dd 1186
e6ffcedd
RD
1187def RegionFromBitmapColour(*args, **kwargs):
1188 """RegionFromBitmapColour(Bitmap bmp, Colour transColour, int tolerance=0) -> Region"""
1189 val = _gdi_.new_RegionFromBitmapColour(*args, **kwargs)
1190 val.thisown = 1
1191 return val
1192
d14a1e28 1193def RegionFromPoints(*args, **kwargs):
093d3ff1 1194 """RegionFromPoints(int points, int fillStyle=WINDING_RULE) -> Region"""
54f9ee45 1195 val = _gdi_.new_RegionFromPoints(*args, **kwargs)
d14a1e28
RD
1196 val.thisown = 1
1197 return val
5e40f9dd 1198
54f9ee45 1199class RegionIterator(_core.Object):
093d3ff1 1200 """Proxy of C++ RegionIterator class"""
e811c8ce
RD
1201 def __repr__(self):
1202 return "<%s.%s; proxy of C++ wxRegionIterator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1203 def __init__(self, *args, **kwargs):
a95a7133 1204 """__init__(self, Region region) -> RegionIterator"""
54f9ee45 1205 newobj = _gdi_.new_RegionIterator(*args, **kwargs)
d14a1e28
RD
1206 self.this = newobj.this
1207 self.thisown = 1
1208 del newobj.thisown
54f9ee45 1209 def __del__(self, destroy=_gdi_.delete_RegionIterator):
a95a7133 1210 """__del__(self)"""
d14a1e28
RD
1211 try:
1212 if self.thisown: destroy(self)
1213 except: pass
e811c8ce
RD
1214
1215 def GetX(*args, **kwargs):
a95a7133 1216 """GetX(self) -> int"""
54f9ee45 1217 return _gdi_.RegionIterator_GetX(*args, **kwargs)
e811c8ce
RD
1218
1219 def GetY(*args, **kwargs):
a95a7133 1220 """GetY(self) -> int"""
54f9ee45 1221 return _gdi_.RegionIterator_GetY(*args, **kwargs)
e811c8ce
RD
1222
1223 def GetW(*args, **kwargs):
a95a7133 1224 """GetW(self) -> int"""
54f9ee45 1225 return _gdi_.RegionIterator_GetW(*args, **kwargs)
e811c8ce
RD
1226
1227 def GetWidth(*args, **kwargs):
a95a7133 1228 """GetWidth(self) -> int"""
54f9ee45 1229 return _gdi_.RegionIterator_GetWidth(*args, **kwargs)
e811c8ce
RD
1230
1231 def GetH(*args, **kwargs):
a95a7133 1232 """GetH(self) -> int"""
54f9ee45 1233 return _gdi_.RegionIterator_GetH(*args, **kwargs)
e811c8ce
RD
1234
1235 def GetHeight(*args, **kwargs):
a95a7133 1236 """GetHeight(self) -> int"""
54f9ee45 1237 return _gdi_.RegionIterator_GetHeight(*args, **kwargs)
e811c8ce
RD
1238
1239 def GetRect(*args, **kwargs):
a95a7133 1240 """GetRect(self) -> Rect"""
54f9ee45 1241 return _gdi_.RegionIterator_GetRect(*args, **kwargs)
e811c8ce
RD
1242
1243 def HaveRects(*args, **kwargs):
a95a7133 1244 """HaveRects(self) -> bool"""
54f9ee45 1245 return _gdi_.RegionIterator_HaveRects(*args, **kwargs)
e811c8ce
RD
1246
1247 def Reset(*args, **kwargs):
a95a7133 1248 """Reset(self)"""
54f9ee45 1249 return _gdi_.RegionIterator_Reset(*args, **kwargs)
e811c8ce
RD
1250
1251 def Next(*args, **kwargs):
a95a7133 1252 """Next(self)"""
54f9ee45 1253 return _gdi_.RegionIterator_Next(*args, **kwargs)
e811c8ce
RD
1254
1255 def __nonzero__(*args, **kwargs):
a95a7133 1256 """__nonzero__(self) -> bool"""
54f9ee45 1257 return _gdi_.RegionIterator___nonzero__(*args, **kwargs)
e811c8ce 1258
d14a1e28
RD
1259
1260class RegionIteratorPtr(RegionIterator):
1261 def __init__(self, this):
70551f47 1262 self.this = this
d14a1e28
RD
1263 if not hasattr(self,"thisown"): self.thisown = 0
1264 self.__class__ = RegionIterator
54f9ee45 1265_gdi_.RegionIterator_swigregister(RegionIteratorPtr)
d14a1e28
RD
1266
1267#---------------------------------------------------------------------------
1268
54f9ee45
RD
1269FONTFAMILY_DEFAULT = _gdi_.FONTFAMILY_DEFAULT
1270FONTFAMILY_DECORATIVE = _gdi_.FONTFAMILY_DECORATIVE
1271FONTFAMILY_ROMAN = _gdi_.FONTFAMILY_ROMAN
1272FONTFAMILY_SCRIPT = _gdi_.FONTFAMILY_SCRIPT
1273FONTFAMILY_SWISS = _gdi_.FONTFAMILY_SWISS
1274FONTFAMILY_MODERN = _gdi_.FONTFAMILY_MODERN
1275FONTFAMILY_TELETYPE = _gdi_.FONTFAMILY_TELETYPE
1276FONTFAMILY_MAX = _gdi_.FONTFAMILY_MAX
1277FONTFAMILY_UNKNOWN = _gdi_.FONTFAMILY_UNKNOWN
1278FONTSTYLE_NORMAL = _gdi_.FONTSTYLE_NORMAL
1279FONTSTYLE_ITALIC = _gdi_.FONTSTYLE_ITALIC
1280FONTSTYLE_SLANT = _gdi_.FONTSTYLE_SLANT
1281FONTSTYLE_MAX = _gdi_.FONTSTYLE_MAX
1282FONTWEIGHT_NORMAL = _gdi_.FONTWEIGHT_NORMAL
1283FONTWEIGHT_LIGHT = _gdi_.FONTWEIGHT_LIGHT
1284FONTWEIGHT_BOLD = _gdi_.FONTWEIGHT_BOLD
1285FONTWEIGHT_MAX = _gdi_.FONTWEIGHT_MAX
1286FONTFLAG_DEFAULT = _gdi_.FONTFLAG_DEFAULT
1287FONTFLAG_ITALIC = _gdi_.FONTFLAG_ITALIC
1288FONTFLAG_SLANT = _gdi_.FONTFLAG_SLANT
1289FONTFLAG_LIGHT = _gdi_.FONTFLAG_LIGHT
1290FONTFLAG_BOLD = _gdi_.FONTFLAG_BOLD
1291FONTFLAG_ANTIALIASED = _gdi_.FONTFLAG_ANTIALIASED
1292FONTFLAG_NOT_ANTIALIASED = _gdi_.FONTFLAG_NOT_ANTIALIASED
1293FONTFLAG_UNDERLINED = _gdi_.FONTFLAG_UNDERLINED
1294FONTFLAG_STRIKETHROUGH = _gdi_.FONTFLAG_STRIKETHROUGH
1295FONTFLAG_MASK = _gdi_.FONTFLAG_MASK
1296FONTENCODING_SYSTEM = _gdi_.FONTENCODING_SYSTEM
1297FONTENCODING_DEFAULT = _gdi_.FONTENCODING_DEFAULT
1298FONTENCODING_ISO8859_1 = _gdi_.FONTENCODING_ISO8859_1
1299FONTENCODING_ISO8859_2 = _gdi_.FONTENCODING_ISO8859_2
1300FONTENCODING_ISO8859_3 = _gdi_.FONTENCODING_ISO8859_3
1301FONTENCODING_ISO8859_4 = _gdi_.FONTENCODING_ISO8859_4
1302FONTENCODING_ISO8859_5 = _gdi_.FONTENCODING_ISO8859_5
1303FONTENCODING_ISO8859_6 = _gdi_.FONTENCODING_ISO8859_6
1304FONTENCODING_ISO8859_7 = _gdi_.FONTENCODING_ISO8859_7
1305FONTENCODING_ISO8859_8 = _gdi_.FONTENCODING_ISO8859_8
1306FONTENCODING_ISO8859_9 = _gdi_.FONTENCODING_ISO8859_9
1307FONTENCODING_ISO8859_10 = _gdi_.FONTENCODING_ISO8859_10
1308FONTENCODING_ISO8859_11 = _gdi_.FONTENCODING_ISO8859_11
1309FONTENCODING_ISO8859_12 = _gdi_.FONTENCODING_ISO8859_12
1310FONTENCODING_ISO8859_13 = _gdi_.FONTENCODING_ISO8859_13
1311FONTENCODING_ISO8859_14 = _gdi_.FONTENCODING_ISO8859_14
1312FONTENCODING_ISO8859_15 = _gdi_.FONTENCODING_ISO8859_15
1313FONTENCODING_ISO8859_MAX = _gdi_.FONTENCODING_ISO8859_MAX
1314FONTENCODING_KOI8 = _gdi_.FONTENCODING_KOI8
1315FONTENCODING_KOI8_U = _gdi_.FONTENCODING_KOI8_U
1316FONTENCODING_ALTERNATIVE = _gdi_.FONTENCODING_ALTERNATIVE
1317FONTENCODING_BULGARIAN = _gdi_.FONTENCODING_BULGARIAN
1318FONTENCODING_CP437 = _gdi_.FONTENCODING_CP437
1319FONTENCODING_CP850 = _gdi_.FONTENCODING_CP850
1320FONTENCODING_CP852 = _gdi_.FONTENCODING_CP852
1321FONTENCODING_CP855 = _gdi_.FONTENCODING_CP855
1322FONTENCODING_CP866 = _gdi_.FONTENCODING_CP866
1323FONTENCODING_CP874 = _gdi_.FONTENCODING_CP874
1324FONTENCODING_CP932 = _gdi_.FONTENCODING_CP932
1325FONTENCODING_CP936 = _gdi_.FONTENCODING_CP936
1326FONTENCODING_CP949 = _gdi_.FONTENCODING_CP949
1327FONTENCODING_CP950 = _gdi_.FONTENCODING_CP950
1328FONTENCODING_CP1250 = _gdi_.FONTENCODING_CP1250
1329FONTENCODING_CP1251 = _gdi_.FONTENCODING_CP1251
1330FONTENCODING_CP1252 = _gdi_.FONTENCODING_CP1252
1331FONTENCODING_CP1253 = _gdi_.FONTENCODING_CP1253
1332FONTENCODING_CP1254 = _gdi_.FONTENCODING_CP1254
1333FONTENCODING_CP1255 = _gdi_.FONTENCODING_CP1255
1334FONTENCODING_CP1256 = _gdi_.FONTENCODING_CP1256
1335FONTENCODING_CP1257 = _gdi_.FONTENCODING_CP1257
1336FONTENCODING_CP12_MAX = _gdi_.FONTENCODING_CP12_MAX
1337FONTENCODING_UTF7 = _gdi_.FONTENCODING_UTF7
1338FONTENCODING_UTF8 = _gdi_.FONTENCODING_UTF8
1339FONTENCODING_EUC_JP = _gdi_.FONTENCODING_EUC_JP
1340FONTENCODING_UTF16BE = _gdi_.FONTENCODING_UTF16BE
1341FONTENCODING_UTF16LE = _gdi_.FONTENCODING_UTF16LE
1342FONTENCODING_UTF32BE = _gdi_.FONTENCODING_UTF32BE
1343FONTENCODING_UTF32LE = _gdi_.FONTENCODING_UTF32LE
1344FONTENCODING_MACROMAN = _gdi_.FONTENCODING_MACROMAN
1345FONTENCODING_MACJAPANESE = _gdi_.FONTENCODING_MACJAPANESE
1346FONTENCODING_MACCHINESETRAD = _gdi_.FONTENCODING_MACCHINESETRAD
1347FONTENCODING_MACKOREAN = _gdi_.FONTENCODING_MACKOREAN
1348FONTENCODING_MACARABIC = _gdi_.FONTENCODING_MACARABIC
1349FONTENCODING_MACHEBREW = _gdi_.FONTENCODING_MACHEBREW
1350FONTENCODING_MACGREEK = _gdi_.FONTENCODING_MACGREEK
1351FONTENCODING_MACCYRILLIC = _gdi_.FONTENCODING_MACCYRILLIC
1352FONTENCODING_MACDEVANAGARI = _gdi_.FONTENCODING_MACDEVANAGARI
1353FONTENCODING_MACGURMUKHI = _gdi_.FONTENCODING_MACGURMUKHI
1354FONTENCODING_MACGUJARATI = _gdi_.FONTENCODING_MACGUJARATI
1355FONTENCODING_MACORIYA = _gdi_.FONTENCODING_MACORIYA
1356FONTENCODING_MACBENGALI = _gdi_.FONTENCODING_MACBENGALI
1357FONTENCODING_MACTAMIL = _gdi_.FONTENCODING_MACTAMIL
1358FONTENCODING_MACTELUGU = _gdi_.FONTENCODING_MACTELUGU
1359FONTENCODING_MACKANNADA = _gdi_.FONTENCODING_MACKANNADA
1360FONTENCODING_MACMALAJALAM = _gdi_.FONTENCODING_MACMALAJALAM
1361FONTENCODING_MACSINHALESE = _gdi_.FONTENCODING_MACSINHALESE
1362FONTENCODING_MACBURMESE = _gdi_.FONTENCODING_MACBURMESE
1363FONTENCODING_MACKHMER = _gdi_.FONTENCODING_MACKHMER
1364FONTENCODING_MACTHAI = _gdi_.FONTENCODING_MACTHAI
1365FONTENCODING_MACLAOTIAN = _gdi_.FONTENCODING_MACLAOTIAN
1366FONTENCODING_MACGEORGIAN = _gdi_.FONTENCODING_MACGEORGIAN
1367FONTENCODING_MACARMENIAN = _gdi_.FONTENCODING_MACARMENIAN
1368FONTENCODING_MACCHINESESIMP = _gdi_.FONTENCODING_MACCHINESESIMP
1369FONTENCODING_MACTIBETAN = _gdi_.FONTENCODING_MACTIBETAN
1370FONTENCODING_MACMONGOLIAN = _gdi_.FONTENCODING_MACMONGOLIAN
1371FONTENCODING_MACETHIOPIC = _gdi_.FONTENCODING_MACETHIOPIC
1372FONTENCODING_MACCENTRALEUR = _gdi_.FONTENCODING_MACCENTRALEUR
1373FONTENCODING_MACVIATNAMESE = _gdi_.FONTENCODING_MACVIATNAMESE
1374FONTENCODING_MACARABICEXT = _gdi_.FONTENCODING_MACARABICEXT
1375FONTENCODING_MACSYMBOL = _gdi_.FONTENCODING_MACSYMBOL
1376FONTENCODING_MACDINGBATS = _gdi_.FONTENCODING_MACDINGBATS
1377FONTENCODING_MACTURKISH = _gdi_.FONTENCODING_MACTURKISH
1378FONTENCODING_MACCROATIAN = _gdi_.FONTENCODING_MACCROATIAN
1379FONTENCODING_MACICELANDIC = _gdi_.FONTENCODING_MACICELANDIC
1380FONTENCODING_MACROMANIAN = _gdi_.FONTENCODING_MACROMANIAN
1381FONTENCODING_MACCELTIC = _gdi_.FONTENCODING_MACCELTIC
1382FONTENCODING_MACGAELIC = _gdi_.FONTENCODING_MACGAELIC
1383FONTENCODING_MACKEYBOARD = _gdi_.FONTENCODING_MACKEYBOARD
1384FONTENCODING_MACMIN = _gdi_.FONTENCODING_MACMIN
1385FONTENCODING_MACMAX = _gdi_.FONTENCODING_MACMAX
1386FONTENCODING_MAX = _gdi_.FONTENCODING_MAX
1387FONTENCODING_UTF16 = _gdi_.FONTENCODING_UTF16
1388FONTENCODING_UTF32 = _gdi_.FONTENCODING_UTF32
1389FONTENCODING_UNICODE = _gdi_.FONTENCODING_UNICODE
1390FONTENCODING_GB2312 = _gdi_.FONTENCODING_GB2312
1391FONTENCODING_BIG5 = _gdi_.FONTENCODING_BIG5
1392FONTENCODING_SHIFT_JIS = _gdi_.FONTENCODING_SHIFT_JIS
d14a1e28
RD
1393#---------------------------------------------------------------------------
1394
1395class NativeFontInfo(object):
093d3ff1 1396 """Proxy of C++ NativeFontInfo class"""
e811c8ce
RD
1397 def __repr__(self):
1398 return "<%s.%s; proxy of C++ wxNativeFontInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1399 def __init__(self, *args, **kwargs):
a95a7133 1400 """__init__(self) -> NativeFontInfo"""
54f9ee45 1401 newobj = _gdi_.new_NativeFontInfo(*args, **kwargs)
d14a1e28
RD
1402 self.this = newobj.this
1403 self.thisown = 1
1404 del newobj.thisown
54f9ee45 1405 def __del__(self, destroy=_gdi_.delete_NativeFontInfo):
a95a7133 1406 """__del__(self)"""
d14a1e28
RD
1407 try:
1408 if self.thisown: destroy(self)
1409 except: pass
e811c8ce
RD
1410
1411 def Init(*args, **kwargs):
a95a7133 1412 """Init(self)"""
54f9ee45 1413 return _gdi_.NativeFontInfo_Init(*args, **kwargs)
e811c8ce
RD
1414
1415 def InitFromFont(*args, **kwargs):
a95a7133 1416 """InitFromFont(self, Font font)"""
54f9ee45 1417 return _gdi_.NativeFontInfo_InitFromFont(*args, **kwargs)
e811c8ce
RD
1418
1419 def GetPointSize(*args, **kwargs):
a95a7133 1420 """GetPointSize(self) -> int"""
54f9ee45 1421 return _gdi_.NativeFontInfo_GetPointSize(*args, **kwargs)
e811c8ce
RD
1422
1423 def GetStyle(*args, **kwargs):
a95a7133 1424 """GetStyle(self) -> int"""
54f9ee45 1425 return _gdi_.NativeFontInfo_GetStyle(*args, **kwargs)
e811c8ce
RD
1426
1427 def GetWeight(*args, **kwargs):
a95a7133 1428 """GetWeight(self) -> int"""
54f9ee45 1429 return _gdi_.NativeFontInfo_GetWeight(*args, **kwargs)
e811c8ce
RD
1430
1431 def GetUnderlined(*args, **kwargs):
a95a7133 1432 """GetUnderlined(self) -> bool"""
54f9ee45 1433 return _gdi_.NativeFontInfo_GetUnderlined(*args, **kwargs)
e811c8ce
RD
1434
1435 def GetFaceName(*args, **kwargs):
a95a7133 1436 """GetFaceName(self) -> String"""
54f9ee45 1437 return _gdi_.NativeFontInfo_GetFaceName(*args, **kwargs)
e811c8ce
RD
1438
1439 def GetFamily(*args, **kwargs):
a95a7133 1440 """GetFamily(self) -> int"""
54f9ee45 1441 return _gdi_.NativeFontInfo_GetFamily(*args, **kwargs)
e811c8ce
RD
1442
1443 def GetEncoding(*args, **kwargs):
a95a7133 1444 """GetEncoding(self) -> int"""
54f9ee45 1445 return _gdi_.NativeFontInfo_GetEncoding(*args, **kwargs)
e811c8ce
RD
1446
1447 def SetPointSize(*args, **kwargs):
a95a7133 1448 """SetPointSize(self, int pointsize)"""
54f9ee45 1449 return _gdi_.NativeFontInfo_SetPointSize(*args, **kwargs)
e811c8ce
RD
1450
1451 def SetStyle(*args, **kwargs):
a95a7133 1452 """SetStyle(self, int style)"""
54f9ee45 1453 return _gdi_.NativeFontInfo_SetStyle(*args, **kwargs)
e811c8ce
RD
1454
1455 def SetWeight(*args, **kwargs):
a95a7133 1456 """SetWeight(self, int weight)"""
54f9ee45 1457 return _gdi_.NativeFontInfo_SetWeight(*args, **kwargs)
e811c8ce
RD
1458
1459 def SetUnderlined(*args, **kwargs):
a95a7133 1460 """SetUnderlined(self, bool underlined)"""
54f9ee45 1461 return _gdi_.NativeFontInfo_SetUnderlined(*args, **kwargs)
e811c8ce
RD
1462
1463 def SetFaceName(*args, **kwargs):
a95a7133 1464 """SetFaceName(self, String facename)"""
54f9ee45 1465 return _gdi_.NativeFontInfo_SetFaceName(*args, **kwargs)
e811c8ce
RD
1466
1467 def SetFamily(*args, **kwargs):
a95a7133 1468 """SetFamily(self, int family)"""
54f9ee45 1469 return _gdi_.NativeFontInfo_SetFamily(*args, **kwargs)
e811c8ce
RD
1470
1471 def SetEncoding(*args, **kwargs):
a95a7133 1472 """SetEncoding(self, int encoding)"""
54f9ee45 1473 return _gdi_.NativeFontInfo_SetEncoding(*args, **kwargs)
e811c8ce
RD
1474
1475 def FromString(*args, **kwargs):
a95a7133 1476 """FromString(self, String s) -> bool"""
54f9ee45 1477 return _gdi_.NativeFontInfo_FromString(*args, **kwargs)
e811c8ce
RD
1478
1479 def ToString(*args, **kwargs):
a95a7133 1480 """ToString(self) -> String"""
54f9ee45 1481 return _gdi_.NativeFontInfo_ToString(*args, **kwargs)
e811c8ce
RD
1482
1483 def __str__(*args, **kwargs):
a95a7133 1484 """__str__(self) -> String"""
54f9ee45 1485 return _gdi_.NativeFontInfo___str__(*args, **kwargs)
e811c8ce
RD
1486
1487 def FromUserString(*args, **kwargs):
a95a7133 1488 """FromUserString(self, String s) -> bool"""
54f9ee45 1489 return _gdi_.NativeFontInfo_FromUserString(*args, **kwargs)
e811c8ce
RD
1490
1491 def ToUserString(*args, **kwargs):
a95a7133 1492 """ToUserString(self) -> String"""
54f9ee45 1493 return _gdi_.NativeFontInfo_ToUserString(*args, **kwargs)
e811c8ce 1494
d14a1e28
RD
1495
1496class NativeFontInfoPtr(NativeFontInfo):
1497 def __init__(self, this):
1498 self.this = this
1499 if not hasattr(self,"thisown"): self.thisown = 0
1500 self.__class__ = NativeFontInfo
54f9ee45 1501_gdi_.NativeFontInfo_swigregister(NativeFontInfoPtr)
d14a1e28
RD
1502
1503class NativeEncodingInfo(object):
093d3ff1 1504 """Proxy of C++ NativeEncodingInfo class"""
e811c8ce
RD
1505 def __repr__(self):
1506 return "<%s.%s; proxy of C++ wxNativeEncodingInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
1507 facename = property(_gdi_.NativeEncodingInfo_facename_get, _gdi_.NativeEncodingInfo_facename_set)
1508 encoding = property(_gdi_.NativeEncodingInfo_encoding_get, _gdi_.NativeEncodingInfo_encoding_set)
d14a1e28 1509 def __init__(self, *args, **kwargs):
a95a7133 1510 """__init__(self) -> NativeEncodingInfo"""
54f9ee45 1511 newobj = _gdi_.new_NativeEncodingInfo(*args, **kwargs)
d14a1e28 1512 self.this = newobj.this
70551f47 1513 self.thisown = 1
d14a1e28 1514 del newobj.thisown
54f9ee45 1515 def __del__(self, destroy=_gdi_.delete_NativeEncodingInfo):
a95a7133 1516 """__del__(self)"""
d14a1e28
RD
1517 try:
1518 if self.thisown: destroy(self)
1519 except: pass
e811c8ce
RD
1520
1521 def FromString(*args, **kwargs):
a95a7133 1522 """FromString(self, String s) -> bool"""
54f9ee45 1523 return _gdi_.NativeEncodingInfo_FromString(*args, **kwargs)
e811c8ce
RD
1524
1525 def ToString(*args, **kwargs):
a95a7133 1526 """ToString(self) -> String"""
54f9ee45 1527 return _gdi_.NativeEncodingInfo_ToString(*args, **kwargs)
e811c8ce 1528
70551f47 1529
d14a1e28
RD
1530class NativeEncodingInfoPtr(NativeEncodingInfo):
1531 def __init__(self, this):
1532 self.this = this
1533 if not hasattr(self,"thisown"): self.thisown = 0
1534 self.__class__ = NativeEncodingInfo
54f9ee45 1535_gdi_.NativeEncodingInfo_swigregister(NativeEncodingInfoPtr)
70551f47
RD
1536
1537
e811c8ce 1538def GetNativeFontEncoding(*args, **kwargs):
196addbf 1539 """GetNativeFontEncoding(int encoding) -> NativeEncodingInfo"""
54f9ee45 1540 return _gdi_.GetNativeFontEncoding(*args, **kwargs)
70551f47 1541
e811c8ce
RD
1542def TestFontEncoding(*args, **kwargs):
1543 """TestFontEncoding(NativeEncodingInfo info) -> bool"""
54f9ee45 1544 return _gdi_.TestFontEncoding(*args, **kwargs)
d14a1e28
RD
1545#---------------------------------------------------------------------------
1546
1547class FontMapper(object):
093d3ff1 1548 """Proxy of C++ FontMapper class"""
e811c8ce
RD
1549 def __repr__(self):
1550 return "<%s.%s; proxy of C++ wxFontMapper instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1551 def __init__(self, *args, **kwargs):
a95a7133 1552 """__init__(self) -> FontMapper"""
54f9ee45 1553 newobj = _gdi_.new_FontMapper(*args, **kwargs)
d14a1e28 1554 self.this = newobj.this
65191ae8 1555 self.thisown = 1
d14a1e28 1556 del newobj.thisown
54f9ee45 1557 def __del__(self, destroy=_gdi_.delete_FontMapper):
a95a7133 1558 """__del__(self)"""
d14a1e28
RD
1559 try:
1560 if self.thisown: destroy(self)
1561 except: pass
e811c8ce
RD
1562
1563 def Get(*args, **kwargs):
66c033b4 1564 """Get() -> FontMapper"""
54f9ee45 1565 return _gdi_.FontMapper_Get(*args, **kwargs)
e811c8ce
RD
1566
1567 Get = staticmethod(Get)
1568 def Set(*args, **kwargs):
66c033b4 1569 """Set(FontMapper mapper) -> FontMapper"""
54f9ee45 1570 return _gdi_.FontMapper_Set(*args, **kwargs)
e811c8ce
RD
1571
1572 Set = staticmethod(Set)
1573 def CharsetToEncoding(*args, **kwargs):
a95a7133 1574 """CharsetToEncoding(self, String charset, bool interactive=True) -> int"""
54f9ee45 1575 return _gdi_.FontMapper_CharsetToEncoding(*args, **kwargs)
e811c8ce
RD
1576
1577 def GetSupportedEncodingsCount(*args, **kwargs):
66c033b4 1578 """GetSupportedEncodingsCount() -> size_t"""
54f9ee45 1579 return _gdi_.FontMapper_GetSupportedEncodingsCount(*args, **kwargs)
e811c8ce
RD
1580
1581 GetSupportedEncodingsCount = staticmethod(GetSupportedEncodingsCount)
1582 def GetEncoding(*args, **kwargs):
66c033b4 1583 """GetEncoding(size_t n) -> int"""
54f9ee45 1584 return _gdi_.FontMapper_GetEncoding(*args, **kwargs)
e811c8ce
RD
1585
1586 GetEncoding = staticmethod(GetEncoding)
1587 def GetEncodingName(*args, **kwargs):
66c033b4 1588 """GetEncodingName(int encoding) -> String"""
54f9ee45 1589 return _gdi_.FontMapper_GetEncodingName(*args, **kwargs)
e811c8ce
RD
1590
1591 GetEncodingName = staticmethod(GetEncodingName)
1592 def GetEncodingDescription(*args, **kwargs):
66c033b4 1593 """GetEncodingDescription(int encoding) -> String"""
54f9ee45 1594 return _gdi_.FontMapper_GetEncodingDescription(*args, **kwargs)
e811c8ce
RD
1595
1596 GetEncodingDescription = staticmethod(GetEncodingDescription)
b2df227b 1597 def GetEncodingFromName(*args, **kwargs):
66c033b4 1598 """GetEncodingFromName(String name) -> int"""
54f9ee45 1599 return _gdi_.FontMapper_GetEncodingFromName(*args, **kwargs)
b2df227b
RD
1600
1601 GetEncodingFromName = staticmethod(GetEncodingFromName)
e811c8ce 1602 def SetConfigPath(*args, **kwargs):
a95a7133 1603 """SetConfigPath(self, String prefix)"""
54f9ee45 1604 return _gdi_.FontMapper_SetConfigPath(*args, **kwargs)
e811c8ce
RD
1605
1606 def GetDefaultConfigPath(*args, **kwargs):
66c033b4 1607 """GetDefaultConfigPath() -> String"""
54f9ee45 1608 return _gdi_.FontMapper_GetDefaultConfigPath(*args, **kwargs)
e811c8ce
RD
1609
1610 GetDefaultConfigPath = staticmethod(GetDefaultConfigPath)
1611 def GetAltForEncoding(*args, **kwargs):
a95a7133 1612 """GetAltForEncoding(self, int encoding, String facename=EmptyString, bool interactive=True) -> PyObject"""
54f9ee45 1613 return _gdi_.FontMapper_GetAltForEncoding(*args, **kwargs)
e811c8ce
RD
1614
1615 def IsEncodingAvailable(*args, **kwargs):
a95a7133 1616 """IsEncodingAvailable(self, int encoding, String facename=EmptyString) -> bool"""
54f9ee45 1617 return _gdi_.FontMapper_IsEncodingAvailable(*args, **kwargs)
e811c8ce
RD
1618
1619 def SetDialogParent(*args, **kwargs):
a95a7133 1620 """SetDialogParent(self, Window parent)"""
54f9ee45 1621 return _gdi_.FontMapper_SetDialogParent(*args, **kwargs)
e811c8ce
RD
1622
1623 def SetDialogTitle(*args, **kwargs):
a95a7133 1624 """SetDialogTitle(self, String title)"""
54f9ee45 1625 return _gdi_.FontMapper_SetDialogTitle(*args, **kwargs)
e811c8ce 1626
65191ae8 1627
d14a1e28
RD
1628class FontMapperPtr(FontMapper):
1629 def __init__(self, this):
1630 self.this = this
1631 if not hasattr(self,"thisown"): self.thisown = 0
1632 self.__class__ = FontMapper
54f9ee45 1633_gdi_.FontMapper_swigregister(FontMapperPtr)
65191ae8 1634
e811c8ce
RD
1635def FontMapper_Get(*args, **kwargs):
1636 """FontMapper_Get() -> FontMapper"""
54f9ee45 1637 return _gdi_.FontMapper_Get(*args, **kwargs)
65191ae8 1638
e811c8ce
RD
1639def FontMapper_Set(*args, **kwargs):
1640 """FontMapper_Set(FontMapper mapper) -> FontMapper"""
54f9ee45 1641 return _gdi_.FontMapper_Set(*args, **kwargs)
65191ae8 1642
e811c8ce
RD
1643def FontMapper_GetSupportedEncodingsCount(*args, **kwargs):
1644 """FontMapper_GetSupportedEncodingsCount() -> size_t"""
54f9ee45 1645 return _gdi_.FontMapper_GetSupportedEncodingsCount(*args, **kwargs)
d14a1e28 1646
e811c8ce 1647def FontMapper_GetEncoding(*args, **kwargs):
196addbf 1648 """FontMapper_GetEncoding(size_t n) -> int"""
54f9ee45 1649 return _gdi_.FontMapper_GetEncoding(*args, **kwargs)
d14a1e28 1650
e811c8ce 1651def FontMapper_GetEncodingName(*args, **kwargs):
196addbf 1652 """FontMapper_GetEncodingName(int encoding) -> String"""
54f9ee45 1653 return _gdi_.FontMapper_GetEncodingName(*args, **kwargs)
d14a1e28 1654
e811c8ce 1655def FontMapper_GetEncodingDescription(*args, **kwargs):
196addbf 1656 """FontMapper_GetEncodingDescription(int encoding) -> String"""
54f9ee45 1657 return _gdi_.FontMapper_GetEncodingDescription(*args, **kwargs)
d14a1e28 1658
b2df227b
RD
1659def FontMapper_GetEncodingFromName(*args, **kwargs):
1660 """FontMapper_GetEncodingFromName(String name) -> int"""
54f9ee45 1661 return _gdi_.FontMapper_GetEncodingFromName(*args, **kwargs)
b2df227b 1662
e811c8ce 1663def FontMapper_GetDefaultConfigPath(*args, **kwargs):
196addbf 1664 """FontMapper_GetDefaultConfigPath() -> String"""
54f9ee45 1665 return _gdi_.FontMapper_GetDefaultConfigPath(*args, **kwargs)
d14a1e28
RD
1666
1667#---------------------------------------------------------------------------
1668
1669class Font(GDIObject):
a97cefba
RD
1670 """
1671 A font is an object which determines the appearance of text. Fonts are
1672 used for drawing text to a device context, and setting the appearance
1673 of a window's text.
1674
1675 You can retrieve the current system font settings with `wx.SystemSettings`.
1676 """
e811c8ce
RD
1677 def __repr__(self):
1678 return "<%s.%s; proxy of C++ wxFont instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1679 def __init__(self, *args, **kwargs):
0df68c9f 1680 """
a95a7133 1681 __init__(self, int pointSize, int family, int style, int weight, bool underline=False,
196addbf
RD
1682 String face=EmptyString,
1683 int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
1684
1685 Creates a font object with the specified attributes.
1686
1687 :param pointSize: The size of the font in points.
1688
1689 :param family: Font family. A generic way of referring to fonts
1690 without specifying actual facename. It can be One of
1691 the ``wx.FONTFAMILY_xxx`` constants.
1692
1693 :param style: One of the ``wx.FONTSTYLE_xxx`` constants.
1694
1695 :param weight: Font weight, sometimes also referred to as font
1696 boldness. One of the ``wx.FONTWEIGHT_xxx`` constants.
1697
1698 :param underline: The value can be ``True`` or ``False`` and
1699 indicates whether the font will include an underline. This
1700 may not be supported on all platforms.
1701
1702 :param face: An optional string specifying the actual typeface to
1703 be used. If it is an empty string, a default typeface will be
1704 chosen based on the family.
1705
1706 :param encoding: An encoding which may be one of the
1707 ``wx.FONTENCODING_xxx`` constants. If the specified encoding isn't
1708 available, no font is created.
1709
1710 :see: `wx.FFont`, `wx.FontFromPixelSize`, `wx.FFontFromPixelSize`,
1711 `wx.FontFromNativeInfoString`, `wx.FontFromNativeInfo`
1712
0df68c9f 1713 """
db3e571a 1714 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
54f9ee45 1715 newobj = _gdi_.new_Font(*args, **kwargs)
d14a1e28
RD
1716 self.this = newobj.this
1717 self.thisown = 1
1718 del newobj.thisown
54f9ee45 1719 def __del__(self, destroy=_gdi_.delete_Font):
a95a7133 1720 """__del__(self)"""
d14a1e28
RD
1721 try:
1722 if self.thisown: destroy(self)
1723 except: pass
e811c8ce
RD
1724
1725 def Ok(*args, **kwargs):
a97cefba
RD
1726 """
1727 Ok(self) -> bool
1728
1729 Returns ``True`` if this font was successfully created.
1730 """
54f9ee45 1731 return _gdi_.Font_Ok(*args, **kwargs)
e811c8ce 1732
d14a1e28 1733 def __nonzero__(self): return self.Ok()
e811c8ce 1734 def __eq__(*args, **kwargs):
a95a7133 1735 """__eq__(self, Font other) -> bool"""
54f9ee45 1736 return _gdi_.Font___eq__(*args, **kwargs)
e811c8ce
RD
1737
1738 def __ne__(*args, **kwargs):
a95a7133 1739 """__ne__(self, Font other) -> bool"""
54f9ee45 1740 return _gdi_.Font___ne__(*args, **kwargs)
e811c8ce
RD
1741
1742 def GetPointSize(*args, **kwargs):
a97cefba
RD
1743 """
1744 GetPointSize(self) -> int
1745
1746 Gets the point size.
1747 """
54f9ee45 1748 return _gdi_.Font_GetPointSize(*args, **kwargs)
e811c8ce 1749
b6294124 1750 def GetPixelSize(*args, **kwargs):
a97cefba
RD
1751 """
1752 GetPixelSize(self) -> Size
1753
1754 Returns the size in pixels if the font was constructed with a pixel
1755 size.
1756 """
b6294124
RD
1757 return _gdi_.Font_GetPixelSize(*args, **kwargs)
1758
1759 def IsUsingSizeInPixels(*args, **kwargs):
a97cefba
RD
1760 """
1761 IsUsingSizeInPixels(self) -> bool
1762
1763 Returns ``True`` if the font is using a pixelSize.
1764 """
b6294124
RD
1765 return _gdi_.Font_IsUsingSizeInPixels(*args, **kwargs)
1766
e811c8ce 1767 def GetFamily(*args, **kwargs):
a97cefba
RD
1768 """
1769 GetFamily(self) -> int
1770
1771 Gets the font family.
1772 """
54f9ee45 1773 return _gdi_.Font_GetFamily(*args, **kwargs)
e811c8ce
RD
1774
1775 def GetStyle(*args, **kwargs):
a97cefba
RD
1776 """
1777 GetStyle(self) -> int
1778
1779 Gets the font style.
1780 """
54f9ee45 1781 return _gdi_.Font_GetStyle(*args, **kwargs)
e811c8ce
RD
1782
1783 def GetWeight(*args, **kwargs):
a97cefba
RD
1784 """
1785 GetWeight(self) -> int
1786
1787 Gets the font weight.
1788 """
54f9ee45 1789 return _gdi_.Font_GetWeight(*args, **kwargs)
e811c8ce
RD
1790
1791 def GetUnderlined(*args, **kwargs):
a97cefba
RD
1792 """
1793 GetUnderlined(self) -> bool
1794
1795 Returns ``True`` if the font is underlined, ``False`` otherwise.
1796 """
54f9ee45 1797 return _gdi_.Font_GetUnderlined(*args, **kwargs)
e811c8ce
RD
1798
1799 def GetFaceName(*args, **kwargs):
a97cefba
RD
1800 """
1801 GetFaceName(self) -> String
1802
1803 Returns the typeface name associated with the font, or the empty
1804 string if there is no typeface information.
1805 """
54f9ee45 1806 return _gdi_.Font_GetFaceName(*args, **kwargs)
e811c8ce
RD
1807
1808 def GetEncoding(*args, **kwargs):
a97cefba
RD
1809 """
1810 GetEncoding(self) -> int
1811
1812 Get the font's encoding.
1813 """
54f9ee45 1814 return _gdi_.Font_GetEncoding(*args, **kwargs)
e811c8ce
RD
1815
1816 def GetNativeFontInfo(*args, **kwargs):
a97cefba
RD
1817 """
1818 GetNativeFontInfo(self) -> NativeFontInfo
1819
1820 Constructs a `wx.NativeFontInfo` object from this font.
1821 """
54f9ee45 1822 return _gdi_.Font_GetNativeFontInfo(*args, **kwargs)
e811c8ce
RD
1823
1824 def IsFixedWidth(*args, **kwargs):
a97cefba
RD
1825 """
1826 IsFixedWidth(self) -> bool
1827
1828 Returns true if the font is a fixed width (or monospaced) font, false
1829 if it is a proportional one or font is invalid.
1830 """
54f9ee45 1831 return _gdi_.Font_IsFixedWidth(*args, **kwargs)
e811c8ce
RD
1832
1833 def GetNativeFontInfoDesc(*args, **kwargs):
a97cefba
RD
1834 """
1835 GetNativeFontInfoDesc(self) -> String
1836
1837 Returns the platform-dependent string completely describing this font
1838 or an empty string if the font isn't valid.
1839 """
54f9ee45 1840 return _gdi_.Font_GetNativeFontInfoDesc(*args, **kwargs)
e811c8ce
RD
1841
1842 def GetNativeFontInfoUserDesc(*args, **kwargs):
a97cefba
RD
1843 """
1844 GetNativeFontInfoUserDesc(self) -> String
1845
1846 Returns a human readable version of `GetNativeFontInfoDesc`.
1847 """
54f9ee45 1848 return _gdi_.Font_GetNativeFontInfoUserDesc(*args, **kwargs)
e811c8ce
RD
1849
1850 def SetPointSize(*args, **kwargs):
a97cefba
RD
1851 """
1852 SetPointSize(self, int pointSize)
1853
1854 Sets the point size.
1855 """
54f9ee45 1856 return _gdi_.Font_SetPointSize(*args, **kwargs)
e811c8ce 1857
b6294124 1858 def SetPixelSize(*args, **kwargs):
a97cefba
RD
1859 """
1860 SetPixelSize(self, Size pixelSize)
1861
1862 Sets the size in pixels rather than points. If there is platform API
1863 support for this then it is used, otherwise a font with the closest
1864 size is found using a binary search.
1865 """
b6294124
RD
1866 return _gdi_.Font_SetPixelSize(*args, **kwargs)
1867
e811c8ce 1868 def SetFamily(*args, **kwargs):
a97cefba
RD
1869 """
1870 SetFamily(self, int family)
1871
1872 Sets the font family.
1873 """
54f9ee45 1874 return _gdi_.Font_SetFamily(*args, **kwargs)
e811c8ce
RD
1875
1876 def SetStyle(*args, **kwargs):
a97cefba
RD
1877 """
1878 SetStyle(self, int style)
1879
1880 Sets the font style.
1881 """
54f9ee45 1882 return _gdi_.Font_SetStyle(*args, **kwargs)
e811c8ce
RD
1883
1884 def SetWeight(*args, **kwargs):
a97cefba
RD
1885 """
1886 SetWeight(self, int weight)
1887
1888 Sets the font weight.
1889 """
54f9ee45 1890 return _gdi_.Font_SetWeight(*args, **kwargs)
e811c8ce
RD
1891
1892 def SetFaceName(*args, **kwargs):
a97cefba
RD
1893 """
1894 SetFaceName(self, String faceName)
1895
1896 Sets the facename for the font. The facename, which should be a valid
1897 font installed on the end-user's system.
1898
1899 To avoid portability problems, don't rely on a specific face, but
1900 specify the font family instead or as well. A suitable font will be
1901 found on the end-user's system. If both the family and the facename
1902 are specified, wxWidgets will first search for the specific face, and
1903 then for a font belonging to the same family.
1904 """
54f9ee45 1905 return _gdi_.Font_SetFaceName(*args, **kwargs)
e811c8ce
RD
1906
1907 def SetUnderlined(*args, **kwargs):
a97cefba
RD
1908 """
1909 SetUnderlined(self, bool underlined)
1910
1911 Sets underlining.
1912 """
54f9ee45 1913 return _gdi_.Font_SetUnderlined(*args, **kwargs)
e811c8ce
RD
1914
1915 def SetEncoding(*args, **kwargs):
a97cefba
RD
1916 """
1917 SetEncoding(self, int encoding)
1918
1919 Set the font encoding.
1920 """
54f9ee45 1921 return _gdi_.Font_SetEncoding(*args, **kwargs)
e811c8ce
RD
1922
1923 def SetNativeFontInfo(*args, **kwargs):
a97cefba
RD
1924 """
1925 SetNativeFontInfo(self, NativeFontInfo info)
1926
1927 Set the font's attributes from a `wx.NativeFontInfo` object.
1928 """
54f9ee45 1929 return _gdi_.Font_SetNativeFontInfo(*args, **kwargs)
e811c8ce
RD
1930
1931 def SetNativeFontInfoFromString(*args, **kwargs):
a97cefba
RD
1932 """
1933 SetNativeFontInfoFromString(self, String info)
1934
1935 Set the font's attributes from string representation of a
1936 `wx.NativeFontInfo` object.
1937 """
54f9ee45 1938 return _gdi_.Font_SetNativeFontInfoFromString(*args, **kwargs)
e811c8ce
RD
1939
1940 def SetNativeFontInfoUserDesc(*args, **kwargs):
a97cefba
RD
1941 """
1942 SetNativeFontInfoUserDesc(self, String info)
1943
1944 Set the font's attributes from a string formerly returned from
1945 `GetNativeFontInfoDesc`.
1946 """
54f9ee45 1947 return _gdi_.Font_SetNativeFontInfoUserDesc(*args, **kwargs)
e811c8ce
RD
1948
1949 def GetFamilyString(*args, **kwargs):
a97cefba
RD
1950 """
1951 GetFamilyString(self) -> String
1952
1953 Returns a string representation of the font family.
1954 """
54f9ee45 1955 return _gdi_.Font_GetFamilyString(*args, **kwargs)
e811c8ce
RD
1956
1957 def GetStyleString(*args, **kwargs):
a97cefba
RD
1958 """
1959 GetStyleString(self) -> String
1960
1961 Returns a string representation of the font style.
1962 """
54f9ee45 1963 return _gdi_.Font_GetStyleString(*args, **kwargs)
e811c8ce
RD
1964
1965 def GetWeightString(*args, **kwargs):
a97cefba
RD
1966 """
1967 GetWeightString(self) -> String
1968
1969 Return a string representation of the font weight.
1970 """
54f9ee45 1971 return _gdi_.Font_GetWeightString(*args, **kwargs)
e811c8ce
RD
1972
1973 def SetNoAntiAliasing(*args, **kwargs):
a95a7133 1974 """SetNoAntiAliasing(self, bool no=True)"""
54f9ee45 1975 return _gdi_.Font_SetNoAntiAliasing(*args, **kwargs)
e811c8ce
RD
1976
1977 def GetNoAntiAliasing(*args, **kwargs):
a95a7133 1978 """GetNoAntiAliasing(self) -> bool"""
54f9ee45 1979 return _gdi_.Font_GetNoAntiAliasing(*args, **kwargs)
e811c8ce
RD
1980
1981 def GetDefaultEncoding(*args, **kwargs):
a97cefba
RD
1982 """
1983 GetDefaultEncoding() -> int
1984
1985 Returns the encoding used for all fonts created with an encoding of
1986 ``wx.FONTENCODING_DEFAULT``.
1987 """
54f9ee45 1988 return _gdi_.Font_GetDefaultEncoding(*args, **kwargs)
e811c8ce
RD
1989
1990 GetDefaultEncoding = staticmethod(GetDefaultEncoding)
1991 def SetDefaultEncoding(*args, **kwargs):
a97cefba
RD
1992 """
1993 SetDefaultEncoding(int encoding)
1994
1995 Sets the default font encoding.
1996 """
54f9ee45 1997 return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
e811c8ce
RD
1998
1999 SetDefaultEncoding = staticmethod(SetDefaultEncoding)
d14a1e28
RD
2000
2001class FontPtr(Font):
2002 def __init__(self, this):
5e40f9dd 2003 self.this = this
d14a1e28
RD
2004 if not hasattr(self,"thisown"): self.thisown = 0
2005 self.__class__ = Font
54f9ee45 2006_gdi_.Font_swigregister(FontPtr)
5e40f9dd 2007
d14a1e28 2008def FontFromNativeInfo(*args, **kwargs):
a97cefba
RD
2009 """
2010 FontFromNativeInfo(NativeFontInfo info) -> Font
2011
2012 Construct a `wx.Font` from a `wx.NativeFontInfo` object.
2013 """
db3e571a 2014 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
54f9ee45 2015 val = _gdi_.new_FontFromNativeInfo(*args, **kwargs)
d14a1e28
RD
2016 val.thisown = 1
2017 return val
5e40f9dd 2018
d14a1e28 2019def FontFromNativeInfoString(*args, **kwargs):
a97cefba
RD
2020 """
2021 FontFromNativeInfoString(String info) -> Font
2022
2023 Construct a `wx.Font` from the string representation of a
2024 `wx.NativeFontInfo` object.
2025 """
db3e571a 2026 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
54f9ee45 2027 val = _gdi_.new_FontFromNativeInfoString(*args, **kwargs)
d14a1e28
RD
2028 val.thisown = 1
2029 return val
5e40f9dd 2030
73c8ef6a 2031def FFont(*args, **kwargs):
0df68c9f 2032 """
73c8ef6a 2033 FFont(int pointSize, int family, int flags=FONTFLAG_DEFAULT,
196addbf 2034 String face=EmptyString, int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
2035
2036 A bit of a simpler way to create a `wx.Font` using flags instead of
2037 individual attribute settings. The value of flags can be a
2038 combination of the following:
2039
2040 ============================ ==
2041 wx.FONTFLAG_DEFAULT
2042 wx.FONTFLAG_ITALIC
2043 wx.FONTFLAG_SLANT
2044 wx.FONTFLAG_LIGHT
2045 wx.FONTFLAG_BOLD
2046 wx.FONTFLAG_ANTIALIASED
2047 wx.FONTFLAG_NOT_ANTIALIASED
2048 wx.FONTFLAG_UNDERLINED
2049 wx.FONTFLAG_STRIKETHROUGH
2050 ============================ ==
2051
2052 :see: `wx.Font.__init__`
0df68c9f 2053 """
db3e571a 2054 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
73c8ef6a 2055 val = _gdi_.new_FFont(*args, **kwargs)
d14a1e28
RD
2056 val.thisown = 1
2057 return val
5e40f9dd 2058
b6294124
RD
2059def FontFromPixelSize(*args, **kwargs):
2060 """
2061 FontFromPixelSize(Size pixelSize, int family, int style, int weight,
2062 bool underlined=False, String face=wxEmptyString,
2063 int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
2064
2065 Creates a font using a size in pixels rather than points. If there is
2066 platform API support for this then it is used, otherwise a font with
2067 the closest size is found using a binary search.
2068
2069 :see: `wx.Font.__init__`
b6294124
RD
2070 """
2071 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
2072 val = _gdi_.new_FontFromPixelSize(*args, **kwargs)
2073 val.thisown = 1
2074 return val
2075
73c8ef6a
RD
2076def FFontFromPixelSize(*args, **kwargs):
2077 """
2078 FFontFromPixelSize(Size pixelSize, int family, int flags=FONTFLAG_DEFAULT,
2079 String face=wxEmptyString, int encoding=FONTENCODING_DEFAULT) -> Font
a97cefba
RD
2080
2081 Creates a font using a size in pixels rather than points. If there is
2082 platform API support for this then it is used, otherwise a font with
2083 the closest size is found using a binary search.
2084
2085 :see: `wx.Font.__init__`, `wx.FFont`
73c8ef6a
RD
2086 """
2087 if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
2088 val = _gdi_.new_FFontFromPixelSize(*args, **kwargs)
2089 val.thisown = 1
2090 return val
2091
e811c8ce 2092def Font_GetDefaultEncoding(*args, **kwargs):
a97cefba
RD
2093 """
2094 Font_GetDefaultEncoding() -> int
2095
2096 Returns the encoding used for all fonts created with an encoding of
2097 ``wx.FONTENCODING_DEFAULT``.
2098 """
54f9ee45 2099 return _gdi_.Font_GetDefaultEncoding(*args, **kwargs)
70551f47 2100
e811c8ce 2101def Font_SetDefaultEncoding(*args, **kwargs):
a97cefba
RD
2102 """
2103 Font_SetDefaultEncoding(int encoding)
2104
2105 Sets the default font encoding.
2106 """
54f9ee45 2107 return _gdi_.Font_SetDefaultEncoding(*args, **kwargs)
70551f47 2108
a97cefba 2109Font2 = wx._deprecated(FFont, "Use `wx.FFont` instead.")
d14a1e28 2110#---------------------------------------------------------------------------
70551f47 2111
d14a1e28 2112class FontEnumerator(object):
093d3ff1 2113 """Proxy of C++ FontEnumerator class"""
e811c8ce
RD
2114 def __repr__(self):
2115 return "<%s.%s; proxy of C++ wxPyFontEnumerator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2116 def __init__(self, *args, **kwargs):
a95a7133 2117 """__init__(self) -> FontEnumerator"""
54f9ee45 2118 newobj = _gdi_.new_FontEnumerator(*args, **kwargs)
d14a1e28
RD
2119 self.this = newobj.this
2120 self.thisown = 1
2121 del newobj.thisown
2122 self._setCallbackInfo(self, FontEnumerator, 0)
e811c8ce 2123
54f9ee45 2124 def __del__(self, destroy=_gdi_.delete_FontEnumerator):
a95a7133 2125 """__del__(self)"""
d14a1e28
RD
2126 try:
2127 if self.thisown: destroy(self)
2128 except: pass
e811c8ce
RD
2129
2130 def _setCallbackInfo(*args, **kwargs):
a95a7133 2131 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 2132 return _gdi_.FontEnumerator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
2133
2134 def EnumerateFacenames(*args, **kwargs):
a95a7133 2135 """EnumerateFacenames(self, int encoding=FONTENCODING_SYSTEM, bool fixedWidthOnly=False) -> bool"""
54f9ee45 2136 return _gdi_.FontEnumerator_EnumerateFacenames(*args, **kwargs)
e811c8ce
RD
2137
2138 def EnumerateEncodings(*args, **kwargs):
a95a7133 2139 """EnumerateEncodings(self, String facename=EmptyString) -> bool"""
54f9ee45 2140 return _gdi_.FontEnumerator_EnumerateEncodings(*args, **kwargs)
e811c8ce
RD
2141
2142 def GetEncodings(*args, **kwargs):
a95a7133 2143 """GetEncodings(self) -> PyObject"""
54f9ee45 2144 return _gdi_.FontEnumerator_GetEncodings(*args, **kwargs)
e811c8ce
RD
2145
2146 def GetFacenames(*args, **kwargs):
a95a7133 2147 """GetFacenames(self) -> PyObject"""
54f9ee45 2148 return _gdi_.FontEnumerator_GetFacenames(*args, **kwargs)
e811c8ce 2149
70551f47 2150
d14a1e28
RD
2151class FontEnumeratorPtr(FontEnumerator):
2152 def __init__(self, this):
5e40f9dd 2153 self.this = this
d14a1e28
RD
2154 if not hasattr(self,"thisown"): self.thisown = 0
2155 self.__class__ = FontEnumerator
54f9ee45 2156_gdi_.FontEnumerator_swigregister(FontEnumeratorPtr)
d14a1e28
RD
2157
2158#---------------------------------------------------------------------------
2159
54f9ee45
RD
2160LANGUAGE_DEFAULT = _gdi_.LANGUAGE_DEFAULT
2161LANGUAGE_UNKNOWN = _gdi_.LANGUAGE_UNKNOWN
2162LANGUAGE_ABKHAZIAN = _gdi_.LANGUAGE_ABKHAZIAN
2163LANGUAGE_AFAR = _gdi_.LANGUAGE_AFAR
2164LANGUAGE_AFRIKAANS = _gdi_.LANGUAGE_AFRIKAANS
2165LANGUAGE_ALBANIAN = _gdi_.LANGUAGE_ALBANIAN
2166LANGUAGE_AMHARIC = _gdi_.LANGUAGE_AMHARIC
2167LANGUAGE_ARABIC = _gdi_.LANGUAGE_ARABIC
2168LANGUAGE_ARABIC_ALGERIA = _gdi_.LANGUAGE_ARABIC_ALGERIA
2169LANGUAGE_ARABIC_BAHRAIN = _gdi_.LANGUAGE_ARABIC_BAHRAIN
2170LANGUAGE_ARABIC_EGYPT = _gdi_.LANGUAGE_ARABIC_EGYPT
2171LANGUAGE_ARABIC_IRAQ = _gdi_.LANGUAGE_ARABIC_IRAQ
2172LANGUAGE_ARABIC_JORDAN = _gdi_.LANGUAGE_ARABIC_JORDAN
2173LANGUAGE_ARABIC_KUWAIT = _gdi_.LANGUAGE_ARABIC_KUWAIT
2174LANGUAGE_ARABIC_LEBANON = _gdi_.LANGUAGE_ARABIC_LEBANON
2175LANGUAGE_ARABIC_LIBYA = _gdi_.LANGUAGE_ARABIC_LIBYA
2176LANGUAGE_ARABIC_MOROCCO = _gdi_.LANGUAGE_ARABIC_MOROCCO
2177LANGUAGE_ARABIC_OMAN = _gdi_.LANGUAGE_ARABIC_OMAN
2178LANGUAGE_ARABIC_QATAR = _gdi_.LANGUAGE_ARABIC_QATAR
2179LANGUAGE_ARABIC_SAUDI_ARABIA = _gdi_.LANGUAGE_ARABIC_SAUDI_ARABIA
2180LANGUAGE_ARABIC_SUDAN = _gdi_.LANGUAGE_ARABIC_SUDAN
2181LANGUAGE_ARABIC_SYRIA = _gdi_.LANGUAGE_ARABIC_SYRIA
2182LANGUAGE_ARABIC_TUNISIA = _gdi_.LANGUAGE_ARABIC_TUNISIA
2183LANGUAGE_ARABIC_UAE = _gdi_.LANGUAGE_ARABIC_UAE
2184LANGUAGE_ARABIC_YEMEN = _gdi_.LANGUAGE_ARABIC_YEMEN
2185LANGUAGE_ARMENIAN = _gdi_.LANGUAGE_ARMENIAN
2186LANGUAGE_ASSAMESE = _gdi_.LANGUAGE_ASSAMESE
2187LANGUAGE_AYMARA = _gdi_.LANGUAGE_AYMARA
2188LANGUAGE_AZERI = _gdi_.LANGUAGE_AZERI
2189LANGUAGE_AZERI_CYRILLIC = _gdi_.LANGUAGE_AZERI_CYRILLIC
2190LANGUAGE_AZERI_LATIN = _gdi_.LANGUAGE_AZERI_LATIN
2191LANGUAGE_BASHKIR = _gdi_.LANGUAGE_BASHKIR
2192LANGUAGE_BASQUE = _gdi_.LANGUAGE_BASQUE
2193LANGUAGE_BELARUSIAN = _gdi_.LANGUAGE_BELARUSIAN
2194LANGUAGE_BENGALI = _gdi_.LANGUAGE_BENGALI
2195LANGUAGE_BHUTANI = _gdi_.LANGUAGE_BHUTANI
2196LANGUAGE_BIHARI = _gdi_.LANGUAGE_BIHARI
2197LANGUAGE_BISLAMA = _gdi_.LANGUAGE_BISLAMA
2198LANGUAGE_BRETON = _gdi_.LANGUAGE_BRETON
2199LANGUAGE_BULGARIAN = _gdi_.LANGUAGE_BULGARIAN
2200LANGUAGE_BURMESE = _gdi_.LANGUAGE_BURMESE
2201LANGUAGE_CAMBODIAN = _gdi_.LANGUAGE_CAMBODIAN
2202LANGUAGE_CATALAN = _gdi_.LANGUAGE_CATALAN
2203LANGUAGE_CHINESE = _gdi_.LANGUAGE_CHINESE
2204LANGUAGE_CHINESE_SIMPLIFIED = _gdi_.LANGUAGE_CHINESE_SIMPLIFIED
2205LANGUAGE_CHINESE_TRADITIONAL = _gdi_.LANGUAGE_CHINESE_TRADITIONAL
2206LANGUAGE_CHINESE_HONGKONG = _gdi_.LANGUAGE_CHINESE_HONGKONG
2207LANGUAGE_CHINESE_MACAU = _gdi_.LANGUAGE_CHINESE_MACAU
2208LANGUAGE_CHINESE_SINGAPORE = _gdi_.LANGUAGE_CHINESE_SINGAPORE
2209LANGUAGE_CHINESE_TAIWAN = _gdi_.LANGUAGE_CHINESE_TAIWAN
2210LANGUAGE_CORSICAN = _gdi_.LANGUAGE_CORSICAN
2211LANGUAGE_CROATIAN = _gdi_.LANGUAGE_CROATIAN
2212LANGUAGE_CZECH = _gdi_.LANGUAGE_CZECH
2213LANGUAGE_DANISH = _gdi_.LANGUAGE_DANISH
2214LANGUAGE_DUTCH = _gdi_.LANGUAGE_DUTCH
2215LANGUAGE_DUTCH_BELGIAN = _gdi_.LANGUAGE_DUTCH_BELGIAN
2216LANGUAGE_ENGLISH = _gdi_.LANGUAGE_ENGLISH
2217LANGUAGE_ENGLISH_UK = _gdi_.LANGUAGE_ENGLISH_UK
2218LANGUAGE_ENGLISH_US = _gdi_.LANGUAGE_ENGLISH_US
2219LANGUAGE_ENGLISH_AUSTRALIA = _gdi_.LANGUAGE_ENGLISH_AUSTRALIA
2220LANGUAGE_ENGLISH_BELIZE = _gdi_.LANGUAGE_ENGLISH_BELIZE
2221LANGUAGE_ENGLISH_BOTSWANA = _gdi_.LANGUAGE_ENGLISH_BOTSWANA
2222LANGUAGE_ENGLISH_CANADA = _gdi_.LANGUAGE_ENGLISH_CANADA
2223LANGUAGE_ENGLISH_CARIBBEAN = _gdi_.LANGUAGE_ENGLISH_CARIBBEAN
2224LANGUAGE_ENGLISH_DENMARK = _gdi_.LANGUAGE_ENGLISH_DENMARK
2225LANGUAGE_ENGLISH_EIRE = _gdi_.LANGUAGE_ENGLISH_EIRE
2226LANGUAGE_ENGLISH_JAMAICA = _gdi_.LANGUAGE_ENGLISH_JAMAICA
2227LANGUAGE_ENGLISH_NEW_ZEALAND = _gdi_.LANGUAGE_ENGLISH_NEW_ZEALAND
2228LANGUAGE_ENGLISH_PHILIPPINES = _gdi_.LANGUAGE_ENGLISH_PHILIPPINES
2229LANGUAGE_ENGLISH_SOUTH_AFRICA = _gdi_.LANGUAGE_ENGLISH_SOUTH_AFRICA
2230LANGUAGE_ENGLISH_TRINIDAD = _gdi_.LANGUAGE_ENGLISH_TRINIDAD
2231LANGUAGE_ENGLISH_ZIMBABWE = _gdi_.LANGUAGE_ENGLISH_ZIMBABWE
2232LANGUAGE_ESPERANTO = _gdi_.LANGUAGE_ESPERANTO
2233LANGUAGE_ESTONIAN = _gdi_.LANGUAGE_ESTONIAN
2234LANGUAGE_FAEROESE = _gdi_.LANGUAGE_FAEROESE
2235LANGUAGE_FARSI = _gdi_.LANGUAGE_FARSI
2236LANGUAGE_FIJI = _gdi_.LANGUAGE_FIJI
2237LANGUAGE_FINNISH = _gdi_.LANGUAGE_FINNISH
2238LANGUAGE_FRENCH = _gdi_.LANGUAGE_FRENCH
2239LANGUAGE_FRENCH_BELGIAN = _gdi_.LANGUAGE_FRENCH_BELGIAN
2240LANGUAGE_FRENCH_CANADIAN = _gdi_.LANGUAGE_FRENCH_CANADIAN
2241LANGUAGE_FRENCH_LUXEMBOURG = _gdi_.LANGUAGE_FRENCH_LUXEMBOURG
2242LANGUAGE_FRENCH_MONACO = _gdi_.LANGUAGE_FRENCH_MONACO
2243LANGUAGE_FRENCH_SWISS = _gdi_.LANGUAGE_FRENCH_SWISS
2244LANGUAGE_FRISIAN = _gdi_.LANGUAGE_FRISIAN
2245LANGUAGE_GALICIAN = _gdi_.LANGUAGE_GALICIAN
2246LANGUAGE_GEORGIAN = _gdi_.LANGUAGE_GEORGIAN
2247LANGUAGE_GERMAN = _gdi_.LANGUAGE_GERMAN
2248LANGUAGE_GERMAN_AUSTRIAN = _gdi_.LANGUAGE_GERMAN_AUSTRIAN
2249LANGUAGE_GERMAN_BELGIUM = _gdi_.LANGUAGE_GERMAN_BELGIUM
2250LANGUAGE_GERMAN_LIECHTENSTEIN = _gdi_.LANGUAGE_GERMAN_LIECHTENSTEIN
2251LANGUAGE_GERMAN_LUXEMBOURG = _gdi_.LANGUAGE_GERMAN_LUXEMBOURG
2252LANGUAGE_GERMAN_SWISS = _gdi_.LANGUAGE_GERMAN_SWISS
2253LANGUAGE_GREEK = _gdi_.LANGUAGE_GREEK
2254LANGUAGE_GREENLANDIC = _gdi_.LANGUAGE_GREENLANDIC
2255LANGUAGE_GUARANI = _gdi_.LANGUAGE_GUARANI
2256LANGUAGE_GUJARATI = _gdi_.LANGUAGE_GUJARATI
2257LANGUAGE_HAUSA = _gdi_.LANGUAGE_HAUSA
2258LANGUAGE_HEBREW = _gdi_.LANGUAGE_HEBREW
2259LANGUAGE_HINDI = _gdi_.LANGUAGE_HINDI
2260LANGUAGE_HUNGARIAN = _gdi_.LANGUAGE_HUNGARIAN
2261LANGUAGE_ICELANDIC = _gdi_.LANGUAGE_ICELANDIC
2262LANGUAGE_INDONESIAN = _gdi_.LANGUAGE_INDONESIAN
2263LANGUAGE_INTERLINGUA = _gdi_.LANGUAGE_INTERLINGUA
2264LANGUAGE_INTERLINGUE = _gdi_.LANGUAGE_INTERLINGUE
2265LANGUAGE_INUKTITUT = _gdi_.LANGUAGE_INUKTITUT
2266LANGUAGE_INUPIAK = _gdi_.LANGUAGE_INUPIAK
2267LANGUAGE_IRISH = _gdi_.LANGUAGE_IRISH
2268LANGUAGE_ITALIAN = _gdi_.LANGUAGE_ITALIAN
2269LANGUAGE_ITALIAN_SWISS = _gdi_.LANGUAGE_ITALIAN_SWISS
2270LANGUAGE_JAPANESE = _gdi_.LANGUAGE_JAPANESE
2271LANGUAGE_JAVANESE = _gdi_.LANGUAGE_JAVANESE
2272LANGUAGE_KANNADA = _gdi_.LANGUAGE_KANNADA
2273LANGUAGE_KASHMIRI = _gdi_.LANGUAGE_KASHMIRI
2274LANGUAGE_KASHMIRI_INDIA = _gdi_.LANGUAGE_KASHMIRI_INDIA
2275LANGUAGE_KAZAKH = _gdi_.LANGUAGE_KAZAKH
2276LANGUAGE_KERNEWEK = _gdi_.LANGUAGE_KERNEWEK
2277LANGUAGE_KINYARWANDA = _gdi_.LANGUAGE_KINYARWANDA
2278LANGUAGE_KIRGHIZ = _gdi_.LANGUAGE_KIRGHIZ
2279LANGUAGE_KIRUNDI = _gdi_.LANGUAGE_KIRUNDI
2280LANGUAGE_KONKANI = _gdi_.LANGUAGE_KONKANI
2281LANGUAGE_KOREAN = _gdi_.LANGUAGE_KOREAN
2282LANGUAGE_KURDISH = _gdi_.LANGUAGE_KURDISH
2283LANGUAGE_LAOTHIAN = _gdi_.LANGUAGE_LAOTHIAN
2284LANGUAGE_LATIN = _gdi_.LANGUAGE_LATIN
2285LANGUAGE_LATVIAN = _gdi_.LANGUAGE_LATVIAN
2286LANGUAGE_LINGALA = _gdi_.LANGUAGE_LINGALA
2287LANGUAGE_LITHUANIAN = _gdi_.LANGUAGE_LITHUANIAN
2288LANGUAGE_MACEDONIAN = _gdi_.LANGUAGE_MACEDONIAN
2289LANGUAGE_MALAGASY = _gdi_.LANGUAGE_MALAGASY
2290LANGUAGE_MALAY = _gdi_.LANGUAGE_MALAY
2291LANGUAGE_MALAYALAM = _gdi_.LANGUAGE_MALAYALAM
2292LANGUAGE_MALAY_BRUNEI_DARUSSALAM = _gdi_.LANGUAGE_MALAY_BRUNEI_DARUSSALAM
2293LANGUAGE_MALAY_MALAYSIA = _gdi_.LANGUAGE_MALAY_MALAYSIA
2294LANGUAGE_MALTESE = _gdi_.LANGUAGE_MALTESE
2295LANGUAGE_MANIPURI = _gdi_.LANGUAGE_MANIPURI
2296LANGUAGE_MAORI = _gdi_.LANGUAGE_MAORI
2297LANGUAGE_MARATHI = _gdi_.LANGUAGE_MARATHI
2298LANGUAGE_MOLDAVIAN = _gdi_.LANGUAGE_MOLDAVIAN
2299LANGUAGE_MONGOLIAN = _gdi_.LANGUAGE_MONGOLIAN
2300LANGUAGE_NAURU = _gdi_.LANGUAGE_NAURU
2301LANGUAGE_NEPALI = _gdi_.LANGUAGE_NEPALI
2302LANGUAGE_NEPALI_INDIA = _gdi_.LANGUAGE_NEPALI_INDIA
2303LANGUAGE_NORWEGIAN_BOKMAL = _gdi_.LANGUAGE_NORWEGIAN_BOKMAL
2304LANGUAGE_NORWEGIAN_NYNORSK = _gdi_.LANGUAGE_NORWEGIAN_NYNORSK
2305LANGUAGE_OCCITAN = _gdi_.LANGUAGE_OCCITAN
2306LANGUAGE_ORIYA = _gdi_.LANGUAGE_ORIYA
2307LANGUAGE_OROMO = _gdi_.LANGUAGE_OROMO
2308LANGUAGE_PASHTO = _gdi_.LANGUAGE_PASHTO
2309LANGUAGE_POLISH = _gdi_.LANGUAGE_POLISH
2310LANGUAGE_PORTUGUESE = _gdi_.LANGUAGE_PORTUGUESE
2311LANGUAGE_PORTUGUESE_BRAZILIAN = _gdi_.LANGUAGE_PORTUGUESE_BRAZILIAN
2312LANGUAGE_PUNJABI = _gdi_.LANGUAGE_PUNJABI
2313LANGUAGE_QUECHUA = _gdi_.LANGUAGE_QUECHUA
2314LANGUAGE_RHAETO_ROMANCE = _gdi_.LANGUAGE_RHAETO_ROMANCE
2315LANGUAGE_ROMANIAN = _gdi_.LANGUAGE_ROMANIAN
2316LANGUAGE_RUSSIAN = _gdi_.LANGUAGE_RUSSIAN
2317LANGUAGE_RUSSIAN_UKRAINE = _gdi_.LANGUAGE_RUSSIAN_UKRAINE
2318LANGUAGE_SAMOAN = _gdi_.LANGUAGE_SAMOAN
2319LANGUAGE_SANGHO = _gdi_.LANGUAGE_SANGHO
2320LANGUAGE_SANSKRIT = _gdi_.LANGUAGE_SANSKRIT
2321LANGUAGE_SCOTS_GAELIC = _gdi_.LANGUAGE_SCOTS_GAELIC
2322LANGUAGE_SERBIAN = _gdi_.LANGUAGE_SERBIAN
2323LANGUAGE_SERBIAN_CYRILLIC = _gdi_.LANGUAGE_SERBIAN_CYRILLIC
2324LANGUAGE_SERBIAN_LATIN = _gdi_.LANGUAGE_SERBIAN_LATIN
2325LANGUAGE_SERBO_CROATIAN = _gdi_.LANGUAGE_SERBO_CROATIAN
2326LANGUAGE_SESOTHO = _gdi_.LANGUAGE_SESOTHO
2327LANGUAGE_SETSWANA = _gdi_.LANGUAGE_SETSWANA
2328LANGUAGE_SHONA = _gdi_.LANGUAGE_SHONA
2329LANGUAGE_SINDHI = _gdi_.LANGUAGE_SINDHI
2330LANGUAGE_SINHALESE = _gdi_.LANGUAGE_SINHALESE
2331LANGUAGE_SISWATI = _gdi_.LANGUAGE_SISWATI
2332LANGUAGE_SLOVAK = _gdi_.LANGUAGE_SLOVAK
2333LANGUAGE_SLOVENIAN = _gdi_.LANGUAGE_SLOVENIAN
2334LANGUAGE_SOMALI = _gdi_.LANGUAGE_SOMALI
2335LANGUAGE_SPANISH = _gdi_.LANGUAGE_SPANISH
2336LANGUAGE_SPANISH_ARGENTINA = _gdi_.LANGUAGE_SPANISH_ARGENTINA
2337LANGUAGE_SPANISH_BOLIVIA = _gdi_.LANGUAGE_SPANISH_BOLIVIA
2338LANGUAGE_SPANISH_CHILE = _gdi_.LANGUAGE_SPANISH_CHILE
2339LANGUAGE_SPANISH_COLOMBIA = _gdi_.LANGUAGE_SPANISH_COLOMBIA
2340LANGUAGE_SPANISH_COSTA_RICA = _gdi_.LANGUAGE_SPANISH_COSTA_RICA
2341LANGUAGE_SPANISH_DOMINICAN_REPUBLIC = _gdi_.LANGUAGE_SPANISH_DOMINICAN_REPUBLIC
2342LANGUAGE_SPANISH_ECUADOR = _gdi_.LANGUAGE_SPANISH_ECUADOR
2343LANGUAGE_SPANISH_EL_SALVADOR = _gdi_.LANGUAGE_SPANISH_EL_SALVADOR
2344LANGUAGE_SPANISH_GUATEMALA = _gdi_.LANGUAGE_SPANISH_GUATEMALA
2345LANGUAGE_SPANISH_HONDURAS = _gdi_.LANGUAGE_SPANISH_HONDURAS
2346LANGUAGE_SPANISH_MEXICAN = _gdi_.LANGUAGE_SPANISH_MEXICAN
2347LANGUAGE_SPANISH_MODERN = _gdi_.LANGUAGE_SPANISH_MODERN
2348LANGUAGE_SPANISH_NICARAGUA = _gdi_.LANGUAGE_SPANISH_NICARAGUA
2349LANGUAGE_SPANISH_PANAMA = _gdi_.LANGUAGE_SPANISH_PANAMA
2350LANGUAGE_SPANISH_PARAGUAY = _gdi_.LANGUAGE_SPANISH_PARAGUAY
2351LANGUAGE_SPANISH_PERU = _gdi_.LANGUAGE_SPANISH_PERU
2352LANGUAGE_SPANISH_PUERTO_RICO = _gdi_.LANGUAGE_SPANISH_PUERTO_RICO
2353LANGUAGE_SPANISH_URUGUAY = _gdi_.LANGUAGE_SPANISH_URUGUAY
2354LANGUAGE_SPANISH_US = _gdi_.LANGUAGE_SPANISH_US
2355LANGUAGE_SPANISH_VENEZUELA = _gdi_.LANGUAGE_SPANISH_VENEZUELA
2356LANGUAGE_SUNDANESE = _gdi_.LANGUAGE_SUNDANESE
2357LANGUAGE_SWAHILI = _gdi_.LANGUAGE_SWAHILI
2358LANGUAGE_SWEDISH = _gdi_.LANGUAGE_SWEDISH
2359LANGUAGE_SWEDISH_FINLAND = _gdi_.LANGUAGE_SWEDISH_FINLAND
2360LANGUAGE_TAGALOG = _gdi_.LANGUAGE_TAGALOG
2361LANGUAGE_TAJIK = _gdi_.LANGUAGE_TAJIK
2362LANGUAGE_TAMIL = _gdi_.LANGUAGE_TAMIL
2363LANGUAGE_TATAR = _gdi_.LANGUAGE_TATAR
2364LANGUAGE_TELUGU = _gdi_.LANGUAGE_TELUGU
2365LANGUAGE_THAI = _gdi_.LANGUAGE_THAI
2366LANGUAGE_TIBETAN = _gdi_.LANGUAGE_TIBETAN
2367LANGUAGE_TIGRINYA = _gdi_.LANGUAGE_TIGRINYA
2368LANGUAGE_TONGA = _gdi_.LANGUAGE_TONGA
2369LANGUAGE_TSONGA = _gdi_.LANGUAGE_TSONGA
2370LANGUAGE_TURKISH = _gdi_.LANGUAGE_TURKISH
2371LANGUAGE_TURKMEN = _gdi_.LANGUAGE_TURKMEN
2372LANGUAGE_TWI = _gdi_.LANGUAGE_TWI
2373LANGUAGE_UIGHUR = _gdi_.LANGUAGE_UIGHUR
2374LANGUAGE_UKRAINIAN = _gdi_.LANGUAGE_UKRAINIAN
2375LANGUAGE_URDU = _gdi_.LANGUAGE_URDU
2376LANGUAGE_URDU_INDIA = _gdi_.LANGUAGE_URDU_INDIA
2377LANGUAGE_URDU_PAKISTAN = _gdi_.LANGUAGE_URDU_PAKISTAN
2378LANGUAGE_UZBEK = _gdi_.LANGUAGE_UZBEK
2379LANGUAGE_UZBEK_CYRILLIC = _gdi_.LANGUAGE_UZBEK_CYRILLIC
2380LANGUAGE_UZBEK_LATIN = _gdi_.LANGUAGE_UZBEK_LATIN
2381LANGUAGE_VIETNAMESE = _gdi_.LANGUAGE_VIETNAMESE
2382LANGUAGE_VOLAPUK = _gdi_.LANGUAGE_VOLAPUK
2383LANGUAGE_WELSH = _gdi_.LANGUAGE_WELSH
2384LANGUAGE_WOLOF = _gdi_.LANGUAGE_WOLOF
2385LANGUAGE_XHOSA = _gdi_.LANGUAGE_XHOSA
2386LANGUAGE_YIDDISH = _gdi_.LANGUAGE_YIDDISH
2387LANGUAGE_YORUBA = _gdi_.LANGUAGE_YORUBA
2388LANGUAGE_ZHUANG = _gdi_.LANGUAGE_ZHUANG
2389LANGUAGE_ZULU = _gdi_.LANGUAGE_ZULU
2390LANGUAGE_USER_DEFINED = _gdi_.LANGUAGE_USER_DEFINED
d14a1e28 2391class LanguageInfo(object):
093d3ff1 2392 """Proxy of C++ LanguageInfo class"""
d14a1e28 2393 def __init__(self): raise RuntimeError, "No constructor defined"
5e40f9dd 2394 def __repr__(self):
d14a1e28 2395 return "<%s.%s; proxy of C++ wxLanguageInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
2396 Language = property(_gdi_.LanguageInfo_Language_get, _gdi_.LanguageInfo_Language_set)
2397 CanonicalName = property(_gdi_.LanguageInfo_CanonicalName_get, _gdi_.LanguageInfo_CanonicalName_set)
2398 Description = property(_gdi_.LanguageInfo_Description_get, _gdi_.LanguageInfo_Description_set)
d14a1e28
RD
2399
2400class LanguageInfoPtr(LanguageInfo):
2401 def __init__(self, this):
5e40f9dd 2402 self.this = this
d14a1e28
RD
2403 if not hasattr(self,"thisown"): self.thisown = 0
2404 self.__class__ = LanguageInfo
54f9ee45
RD
2405_gdi_.LanguageInfo_swigregister(LanguageInfoPtr)
2406
2407LOCALE_CAT_NUMBER = _gdi_.LOCALE_CAT_NUMBER
2408LOCALE_CAT_DATE = _gdi_.LOCALE_CAT_DATE
2409LOCALE_CAT_MONEY = _gdi_.LOCALE_CAT_MONEY
2410LOCALE_CAT_MAX = _gdi_.LOCALE_CAT_MAX
2411LOCALE_THOUSANDS_SEP = _gdi_.LOCALE_THOUSANDS_SEP
2412LOCALE_DECIMAL_POINT = _gdi_.LOCALE_DECIMAL_POINT
2413LOCALE_LOAD_DEFAULT = _gdi_.LOCALE_LOAD_DEFAULT
2414LOCALE_CONV_ENCODING = _gdi_.LOCALE_CONV_ENCODING
d14a1e28 2415class Locale(object):
093d3ff1 2416 """Proxy of C++ Locale class"""
e811c8ce
RD
2417 def __repr__(self):
2418 return "<%s.%s; proxy of C++ wxLocale instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2419 def __init__(self, *args, **kwargs):
41e2b43e 2420 """__init__(self, int language=-1, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> Locale"""
54f9ee45 2421 newobj = _gdi_.new_Locale(*args, **kwargs)
d14a1e28
RD
2422 self.this = newobj.this
2423 self.thisown = 1
2424 del newobj.thisown
54f9ee45 2425 def __del__(self, destroy=_gdi_.delete_Locale):
a95a7133 2426 """__del__(self)"""
d14a1e28
RD
2427 try:
2428 if self.thisown: destroy(self)
2429 except: pass
e811c8ce
RD
2430
2431 def Init1(*args, **kwargs):
0df68c9f 2432 """
a95a7133 2433 Init1(self, String szName, String szShort=EmptyString, String szLocale=EmptyString,
196addbf 2434 bool bLoadDefault=True,
0df68c9f
RD
2435 bool bConvertEncoding=False) -> bool
2436 """
54f9ee45 2437 return _gdi_.Locale_Init1(*args, **kwargs)
e811c8ce
RD
2438
2439 def Init2(*args, **kwargs):
a95a7133 2440 """Init2(self, int language=LANGUAGE_DEFAULT, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> bool"""
54f9ee45 2441 return _gdi_.Locale_Init2(*args, **kwargs)
e811c8ce 2442
d14a1e28
RD
2443 def Init(self, *_args, **_kwargs):
2444 if type(_args[0]) in [type(''), type(u'')]:
2445 val = self.Init1(*_args, **_kwargs)
2446 else:
2447 val = self.Init2(*_args, **_kwargs)
2448 return val
2449
e811c8ce 2450 def GetSystemLanguage(*args, **kwargs):
66c033b4 2451 """GetSystemLanguage() -> int"""
54f9ee45 2452 return _gdi_.Locale_GetSystemLanguage(*args, **kwargs)
e811c8ce
RD
2453
2454 GetSystemLanguage = staticmethod(GetSystemLanguage)
2455 def GetSystemEncoding(*args, **kwargs):
66c033b4 2456 """GetSystemEncoding() -> int"""
54f9ee45 2457 return _gdi_.Locale_GetSystemEncoding(*args, **kwargs)
e811c8ce
RD
2458
2459 GetSystemEncoding = staticmethod(GetSystemEncoding)
2460 def GetSystemEncodingName(*args, **kwargs):
66c033b4 2461 """GetSystemEncodingName() -> String"""
54f9ee45 2462 return _gdi_.Locale_GetSystemEncodingName(*args, **kwargs)
e811c8ce
RD
2463
2464 GetSystemEncodingName = staticmethod(GetSystemEncodingName)
2465 def IsOk(*args, **kwargs):
a95a7133 2466 """IsOk(self) -> bool"""
54f9ee45 2467 return _gdi_.Locale_IsOk(*args, **kwargs)
e811c8ce 2468
d14a1e28 2469 def __nonzero__(self): return self.IsOk()
e811c8ce 2470 def GetLocale(*args, **kwargs):
a95a7133 2471 """GetLocale(self) -> String"""
54f9ee45 2472 return _gdi_.Locale_GetLocale(*args, **kwargs)
e811c8ce
RD
2473
2474 def GetLanguage(*args, **kwargs):
a95a7133 2475 """GetLanguage(self) -> int"""
54f9ee45 2476 return _gdi_.Locale_GetLanguage(*args, **kwargs)
e811c8ce
RD
2477
2478 def GetSysName(*args, **kwargs):
a95a7133 2479 """GetSysName(self) -> String"""
54f9ee45 2480 return _gdi_.Locale_GetSysName(*args, **kwargs)
e811c8ce
RD
2481
2482 def GetCanonicalName(*args, **kwargs):
a95a7133 2483 """GetCanonicalName(self) -> String"""
54f9ee45 2484 return _gdi_.Locale_GetCanonicalName(*args, **kwargs)
e811c8ce
RD
2485
2486 def AddCatalogLookupPathPrefix(*args, **kwargs):
66c033b4 2487 """AddCatalogLookupPathPrefix(String prefix)"""
54f9ee45 2488 return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs)
e811c8ce
RD
2489
2490 AddCatalogLookupPathPrefix = staticmethod(AddCatalogLookupPathPrefix)
2491 def AddCatalog(*args, **kwargs):
a95a7133 2492 """AddCatalog(self, String szDomain) -> bool"""
54f9ee45 2493 return _gdi_.Locale_AddCatalog(*args, **kwargs)
e811c8ce
RD
2494
2495 def IsLoaded(*args, **kwargs):
a95a7133 2496 """IsLoaded(self, String szDomain) -> bool"""
54f9ee45 2497 return _gdi_.Locale_IsLoaded(*args, **kwargs)
e811c8ce
RD
2498
2499 def GetLanguageInfo(*args, **kwargs):
66c033b4 2500 """GetLanguageInfo(int lang) -> LanguageInfo"""
54f9ee45 2501 return _gdi_.Locale_GetLanguageInfo(*args, **kwargs)
e811c8ce
RD
2502
2503 GetLanguageInfo = staticmethod(GetLanguageInfo)
2504 def GetLanguageName(*args, **kwargs):
66c033b4 2505 """GetLanguageName(int lang) -> String"""
54f9ee45 2506 return _gdi_.Locale_GetLanguageName(*args, **kwargs)
e811c8ce
RD
2507
2508 GetLanguageName = staticmethod(GetLanguageName)
2509 def FindLanguageInfo(*args, **kwargs):
66c033b4 2510 """FindLanguageInfo(String locale) -> LanguageInfo"""
54f9ee45 2511 return _gdi_.Locale_FindLanguageInfo(*args, **kwargs)
e811c8ce
RD
2512
2513 FindLanguageInfo = staticmethod(FindLanguageInfo)
2514 def AddLanguage(*args, **kwargs):
66c033b4 2515 """AddLanguage(LanguageInfo info)"""
54f9ee45 2516 return _gdi_.Locale_AddLanguage(*args, **kwargs)
e811c8ce
RD
2517
2518 AddLanguage = staticmethod(AddLanguage)
2519 def GetString(*args, **kwargs):
a95a7133 2520 """GetString(self, String szOrigString, String szDomain=EmptyString) -> String"""
54f9ee45 2521 return _gdi_.Locale_GetString(*args, **kwargs)
e811c8ce
RD
2522
2523 def GetName(*args, **kwargs):
a95a7133 2524 """GetName(self) -> String"""
54f9ee45 2525 return _gdi_.Locale_GetName(*args, **kwargs)
e811c8ce 2526
5e40f9dd 2527
d14a1e28
RD
2528class LocalePtr(Locale):
2529 def __init__(self, this):
2530 self.this = this
2531 if not hasattr(self,"thisown"): self.thisown = 0
2532 self.__class__ = Locale
54f9ee45 2533_gdi_.Locale_swigregister(LocalePtr)
5e40f9dd 2534
e811c8ce
RD
2535def Locale_GetSystemLanguage(*args, **kwargs):
2536 """Locale_GetSystemLanguage() -> int"""
54f9ee45 2537 return _gdi_.Locale_GetSystemLanguage(*args, **kwargs)
5e40f9dd 2538
e811c8ce 2539def Locale_GetSystemEncoding(*args, **kwargs):
196addbf 2540 """Locale_GetSystemEncoding() -> int"""
54f9ee45 2541 return _gdi_.Locale_GetSystemEncoding(*args, **kwargs)
5e40f9dd 2542
e811c8ce 2543def Locale_GetSystemEncodingName(*args, **kwargs):
196addbf 2544 """Locale_GetSystemEncodingName() -> String"""
54f9ee45 2545 return _gdi_.Locale_GetSystemEncodingName(*args, **kwargs)
d14a1e28 2546
e811c8ce 2547def Locale_AddCatalogLookupPathPrefix(*args, **kwargs):
196addbf 2548 """Locale_AddCatalogLookupPathPrefix(String prefix)"""
54f9ee45 2549 return _gdi_.Locale_AddCatalogLookupPathPrefix(*args, **kwargs)
d14a1e28 2550
e811c8ce
RD
2551def Locale_GetLanguageInfo(*args, **kwargs):
2552 """Locale_GetLanguageInfo(int lang) -> LanguageInfo"""
54f9ee45 2553 return _gdi_.Locale_GetLanguageInfo(*args, **kwargs)
d14a1e28 2554
e811c8ce 2555def Locale_GetLanguageName(*args, **kwargs):
196addbf 2556 """Locale_GetLanguageName(int lang) -> String"""
54f9ee45 2557 return _gdi_.Locale_GetLanguageName(*args, **kwargs)
d14a1e28 2558
e811c8ce 2559def Locale_FindLanguageInfo(*args, **kwargs):
196addbf 2560 """Locale_FindLanguageInfo(String locale) -> LanguageInfo"""
54f9ee45 2561 return _gdi_.Locale_FindLanguageInfo(*args, **kwargs)
d14a1e28 2562
e811c8ce
RD
2563def Locale_AddLanguage(*args, **kwargs):
2564 """Locale_AddLanguage(LanguageInfo info)"""
54f9ee45 2565 return _gdi_.Locale_AddLanguage(*args, **kwargs)
d14a1e28
RD
2566
2567
e811c8ce
RD
2568def GetLocale(*args, **kwargs):
2569 """GetLocale() -> Locale"""
54f9ee45 2570 return _gdi_.GetLocale(*args, **kwargs)
d14a1e28
RD
2571#---------------------------------------------------------------------------
2572
54f9ee45
RD
2573CONVERT_STRICT = _gdi_.CONVERT_STRICT
2574CONVERT_SUBSTITUTE = _gdi_.CONVERT_SUBSTITUTE
2575PLATFORM_CURRENT = _gdi_.PLATFORM_CURRENT
2576PLATFORM_UNIX = _gdi_.PLATFORM_UNIX
2577PLATFORM_WINDOWS = _gdi_.PLATFORM_WINDOWS
2578PLATFORM_OS2 = _gdi_.PLATFORM_OS2
2579PLATFORM_MAC = _gdi_.PLATFORM_MAC
2580class EncodingConverter(_core.Object):
093d3ff1 2581 """Proxy of C++ EncodingConverter class"""
e811c8ce
RD
2582 def __repr__(self):
2583 return "<%s.%s; proxy of C++ wxEncodingConverter instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2584 def __init__(self, *args, **kwargs):
a95a7133 2585 """__init__(self) -> EncodingConverter"""
54f9ee45 2586 newobj = _gdi_.new_EncodingConverter(*args, **kwargs)
d14a1e28
RD
2587 self.this = newobj.this
2588 self.thisown = 1
2589 del newobj.thisown
54f9ee45 2590 def __del__(self, destroy=_gdi_.delete_EncodingConverter):
a95a7133 2591 """__del__(self)"""
d14a1e28
RD
2592 try:
2593 if self.thisown: destroy(self)
2594 except: pass
e811c8ce
RD
2595
2596 def Init(*args, **kwargs):
a95a7133 2597 """Init(self, int input_enc, int output_enc, int method=CONVERT_STRICT) -> bool"""
54f9ee45 2598 return _gdi_.EncodingConverter_Init(*args, **kwargs)
e811c8ce
RD
2599
2600 def Convert(*args, **kwargs):
a95a7133 2601 """Convert(self, String input) -> String"""
54f9ee45 2602 return _gdi_.EncodingConverter_Convert(*args, **kwargs)
e811c8ce
RD
2603
2604 def GetPlatformEquivalents(*args, **kwargs):
66c033b4 2605 """GetPlatformEquivalents(int enc, int platform=PLATFORM_CURRENT) -> wxFontEncodingArray"""
54f9ee45 2606 return _gdi_.EncodingConverter_GetPlatformEquivalents(*args, **kwargs)
e811c8ce
RD
2607
2608 GetPlatformEquivalents = staticmethod(GetPlatformEquivalents)
2609 def GetAllEquivalents(*args, **kwargs):
66c033b4 2610 """GetAllEquivalents(int enc) -> wxFontEncodingArray"""
54f9ee45 2611 return _gdi_.EncodingConverter_GetAllEquivalents(*args, **kwargs)
e811c8ce
RD
2612
2613 GetAllEquivalents = staticmethod(GetAllEquivalents)
2614 def CanConvert(*args, **kwargs):
66c033b4 2615 """CanConvert(int encIn, int encOut) -> bool"""
54f9ee45 2616 return _gdi_.EncodingConverter_CanConvert(*args, **kwargs)
e811c8ce
RD
2617
2618 CanConvert = staticmethod(CanConvert)
d14a1e28 2619 def __nonzero__(self): return self.IsOk()
d14a1e28
RD
2620
2621class EncodingConverterPtr(EncodingConverter):
2622 def __init__(self, this):
2623 self.this = this
2624 if not hasattr(self,"thisown"): self.thisown = 0
2625 self.__class__ = EncodingConverter
54f9ee45 2626_gdi_.EncodingConverter_swigregister(EncodingConverterPtr)
d14a1e28 2627
e811c8ce 2628def GetTranslation(*args):
0df68c9f 2629 """
3adfb63b
RD
2630 GetTranslation(String str) -> String
2631 GetTranslation(String str, String strPlural, size_t n) -> String
0df68c9f 2632 """
54f9ee45 2633 return _gdi_.GetTranslation(*args)
d14a1e28 2634
e811c8ce 2635def EncodingConverter_GetPlatformEquivalents(*args, **kwargs):
196addbf 2636 """EncodingConverter_GetPlatformEquivalents(int enc, int platform=PLATFORM_CURRENT) -> wxFontEncodingArray"""
54f9ee45 2637 return _gdi_.EncodingConverter_GetPlatformEquivalents(*args, **kwargs)
d14a1e28 2638
e811c8ce 2639def EncodingConverter_GetAllEquivalents(*args, **kwargs):
196addbf 2640 """EncodingConverter_GetAllEquivalents(int enc) -> wxFontEncodingArray"""
54f9ee45 2641 return _gdi_.EncodingConverter_GetAllEquivalents(*args, **kwargs)
d14a1e28 2642
e811c8ce 2643def EncodingConverter_CanConvert(*args, **kwargs):
196addbf 2644 """EncodingConverter_CanConvert(int encIn, int encOut) -> bool"""
54f9ee45 2645 return _gdi_.EncodingConverter_CanConvert(*args, **kwargs)
d14a1e28
RD
2646
2647#----------------------------------------------------------------------------
89c876de 2648# On MSW add the directory where the wxWidgets catalogs were installed
d14a1e28
RD
2649# to the default catalog path.
2650if wx.Platform == "__WXMSW__":
2651 import os
8fb0e70a
RD
2652 _localedir = os.path.join(os.path.split(__file__)[0], "locale")
2653 Locale.AddCatalogLookupPathPrefix(_localedir)
d14a1e28
RD
2654 del os
2655
2656#----------------------------------------------------------------------------
2657
2658#---------------------------------------------------------------------------
2659
54f9ee45 2660class DC(_core.Object):
f5b96ee1
RD
2661 """
2662 A wx.DC is a device context onto which graphics and text can be
2663 drawn. It is intended to represent a number of output devices in a
2664 generic way, so a window can have a device context associated with it,
2665 and a printer also has a device context. In this way, the same piece
2666 of code may write to a number of different devices, if the device
2667 context is used as a parameter.
2668
2669 Derived types of wxDC have documentation for specific features only,
2670 so refer to this section for most device context information.
2671
2672 The wx.DC class is abstract and can not be instantiated, you must use
2673 one of the derived classes instead. Which one will depend on the
2674 situation in which it is used.
2675 """
e811c8ce
RD
2676 def __init__(self): raise RuntimeError, "No constructor defined"
2677 def __repr__(self):
2678 return "<%s.%s; proxy of C++ wxDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 2679 def __del__(self, destroy=_gdi_.delete_DC):
a95a7133 2680 """__del__(self)"""
d14a1e28
RD
2681 try:
2682 if self.thisown: destroy(self)
2683 except: pass
e811c8ce 2684
c26d9ab4
RD
2685 # These have been deprecated in wxWidgets. Since they never
2686 # really did anything to begin with, just make them be NOPs.
2687 def BeginDrawing(self): pass
2688 def EndDrawing(self): pass
e811c8ce 2689
e811c8ce 2690 def FloodFill(*args, **kwargs):
f5b96ee1
RD
2691 """
2692 FloodFill(self, int x, int y, Colour col, int style=FLOOD_SURFACE) -> bool
2693
2694 Flood fills the device context starting from the given point, using
2695 the current brush colour, and using a style:
2696
2697 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
2698 the given colour is encountered.
2699
2700 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
2701 colour.
2702
2703 Returns False if the operation failed.
2704
2705 Note: The present implementation for non-Windows platforms may fail to
2706 find colour borders if the pixels do not match the colour
2707 exactly. However the function will still return true.
2708 """
54f9ee45 2709 return _gdi_.DC_FloodFill(*args, **kwargs)
e811c8ce 2710
03e37cd5 2711 def FloodFillPoint(*args, **kwargs):
f5b96ee1
RD
2712 """
2713 FloodFillPoint(self, Point pt, Colour col, int style=FLOOD_SURFACE) -> bool
2714
2715 Flood fills the device context starting from the given point, using
2716 the current brush colour, and using a style:
2717
2718 - **wxFLOOD_SURFACE**: the flooding occurs until a colour other than
2719 the given colour is encountered.
2720
2721 - **wxFLOOD_BORDER**: the area to be flooded is bounded by the given
2722 colour.
2723
2724 Returns False if the operation failed.
2725
2726 Note: The present implementation for non-Windows platforms may fail to
2727 find colour borders if the pixels do not match the colour
2728 exactly. However the function will still return true.
2729 """
03e37cd5 2730 return _gdi_.DC_FloodFillPoint(*args, **kwargs)
e811c8ce 2731
b1fcee84
RD
2732 def GradientFillConcentric(*args, **kwargs):
2733 """
2734 GradientFillConcentric(self, Rect rect, Colour initialColour, Colour destColour,
2735 Point circleCenter)
2736
2737 Fill the area specified by rect with a radial gradient, starting from
2738 initialColour in the center of the circle and fading to destColour on
2739 the outside of the circle. The circleCenter argument is the relative
2740 coordinants of the center of the circle in the specified rect.
2741
2742 Note: Currently this function is very slow, don't use it for real-time
2743 drawing.
2744 """
2745 return _gdi_.DC_GradientFillConcentric(*args, **kwargs)
2746
2747 def GradientFillLinear(*args, **kwargs):
2748 """
2749 GradientFillLinear(self, Rect rect, Colour initialColour, Colour destColour,
2750 int nDirection=EAST)
2751
2752 Fill the area specified by rect with a linear gradient, starting from
2753 initialColour and eventually fading to destColour. The nDirection
2754 parameter specifies the direction of the colour change, default is to
2755 use initialColour on the left part of the rectangle and destColour on
2756 the right side.
2757 """
2758 return _gdi_.DC_GradientFillLinear(*args, **kwargs)
2759
e811c8ce 2760 def GetPixel(*args, **kwargs):
f5b96ee1
RD
2761 """
2762 GetPixel(self, int x, int y) -> Colour
2763
2764 Gets the colour at the specified location on the DC.
2765 """
54f9ee45 2766 return _gdi_.DC_GetPixel(*args, **kwargs)
e811c8ce 2767
03e37cd5
RD
2768 def GetPixelPoint(*args, **kwargs):
2769 """GetPixelPoint(self, Point pt) -> Colour"""
2770 return _gdi_.DC_GetPixelPoint(*args, **kwargs)
e811c8ce
RD
2771
2772 def DrawLine(*args, **kwargs):
f5b96ee1
RD
2773 """
2774 DrawLine(self, int x1, int y1, int x2, int y2)
2775
2776 Draws a line from the first point to the second. The current pen is
2777 used for drawing the line. Note that the second point is *not* part of
2778 the line and is not drawn by this function (this is consistent with
2779 the behaviour of many other toolkits).
2780 """
54f9ee45 2781 return _gdi_.DC_DrawLine(*args, **kwargs)
e811c8ce 2782
03e37cd5 2783 def DrawLinePoint(*args, **kwargs):
f5b96ee1
RD
2784 """
2785 DrawLinePoint(self, Point pt1, Point pt2)
2786
2787 Draws a line from the first point to the second. The current pen is
2788 used for drawing the line. Note that the second point is *not* part of
2789 the line and is not drawn by this function (this is consistent with
2790 the behaviour of many other toolkits).
2791 """
03e37cd5 2792 return _gdi_.DC_DrawLinePoint(*args, **kwargs)
e811c8ce
RD
2793
2794 def CrossHair(*args, **kwargs):
f5b96ee1
RD
2795 """
2796 CrossHair(self, int x, int y)
2797
2798 Displays a cross hair using the current pen. This is a vertical and
2799 horizontal line the height and width of the window, centred on the
2800 given point.
2801 """
54f9ee45 2802 return _gdi_.DC_CrossHair(*args, **kwargs)
e811c8ce 2803
03e37cd5 2804 def CrossHairPoint(*args, **kwargs):
f5b96ee1
RD
2805 """
2806 CrossHairPoint(self, Point pt)
2807
2808 Displays a cross hair using the current pen. This is a vertical and
2809 horizontal line the height and width of the window, centred on the
2810 given point.
2811 """
03e37cd5 2812 return _gdi_.DC_CrossHairPoint(*args, **kwargs)
e811c8ce
RD
2813
2814 def DrawArc(*args, **kwargs):
f5b96ee1
RD
2815 """
2816 DrawArc(self, int x1, int y1, int x2, int y2, int xc, int yc)
2817
2818 Draws an arc of a circle, centred on the *center* point (xc, yc), from
2819 the first point to the second. The current pen is used for the outline
2820 and the current brush for filling the shape.
2821
2822 The arc is drawn in an anticlockwise direction from the start point to
2823 the end point.
2824 """
54f9ee45 2825 return _gdi_.DC_DrawArc(*args, **kwargs)
e811c8ce 2826
03e37cd5 2827 def DrawArcPoint(*args, **kwargs):
f5b96ee1
RD
2828 """
2829 DrawArcPoint(self, Point pt1, Point pt2, Point center)
2830
2831 Draws an arc of a circle, centred on the *center* point (xc, yc), from
2832 the first point to the second. The current pen is used for the outline
2833 and the current brush for filling the shape.
2834
2835 The arc is drawn in an anticlockwise direction from the start point to
2836 the end point.
2837 """
03e37cd5 2838 return _gdi_.DC_DrawArcPoint(*args, **kwargs)
e811c8ce
RD
2839
2840 def DrawCheckMark(*args, **kwargs):
f5b96ee1
RD
2841 """
2842 DrawCheckMark(self, int x, int y, int width, int height)
2843
2844 Draws a check mark inside the given rectangle.
2845 """
54f9ee45 2846 return _gdi_.DC_DrawCheckMark(*args, **kwargs)
e811c8ce 2847
03e37cd5 2848 def DrawCheckMarkRect(*args, **kwargs):
f5b96ee1
RD
2849 """
2850 DrawCheckMarkRect(self, Rect rect)
2851
2852 Draws a check mark inside the given rectangle.
2853 """
03e37cd5 2854 return _gdi_.DC_DrawCheckMarkRect(*args, **kwargs)
e811c8ce
RD
2855
2856 def DrawEllipticArc(*args, **kwargs):
f5b96ee1
RD
2857 """
2858 DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
2859
2860 Draws an arc of an ellipse, with the given rectangle defining the
2861 bounds of the ellipse. The current pen is used for drawing the arc and
2862 the current brush is used for drawing the pie.
2863
2864 The *start* and *end* parameters specify the start and end of the arc
2865 relative to the three-o'clock position from the center of the
2866 rectangle. Angles are specified in degrees (360 is a complete
2867 circle). Positive values mean counter-clockwise motion. If start is
2868 equal to end, a complete ellipse will be drawn.
2869 """
54f9ee45 2870 return _gdi_.DC_DrawEllipticArc(*args, **kwargs)
e811c8ce 2871
03e37cd5 2872 def DrawEllipticArcPointSize(*args, **kwargs):
f5b96ee1
RD
2873 """
2874 DrawEllipticArcPointSize(self, Point pt, Size sz, double start, double end)
2875
2876 Draws an arc of an ellipse, with the given rectangle defining the
2877 bounds of the ellipse. The current pen is used for drawing the arc and
2878 the current brush is used for drawing the pie.
2879
2880 The *start* and *end* parameters specify the start and end of the arc
2881 relative to the three-o'clock position from the center of the
2882 rectangle. Angles are specified in degrees (360 is a complete
2883 circle). Positive values mean counter-clockwise motion. If start is
2884 equal to end, a complete ellipse will be drawn.
2885 """
03e37cd5 2886 return _gdi_.DC_DrawEllipticArcPointSize(*args, **kwargs)
e811c8ce
RD
2887
2888 def DrawPoint(*args, **kwargs):
f5b96ee1
RD
2889 """
2890 DrawPoint(self, int x, int y)
2891
2892 Draws a point using the current pen.
2893 """
54f9ee45 2894 return _gdi_.DC_DrawPoint(*args, **kwargs)
e811c8ce 2895
03e37cd5 2896 def DrawPointPoint(*args, **kwargs):
f5b96ee1
RD
2897 """
2898 DrawPointPoint(self, Point pt)
2899
2900 Draws a point using the current pen.
2901 """
03e37cd5 2902 return _gdi_.DC_DrawPointPoint(*args, **kwargs)
e811c8ce
RD
2903
2904 def DrawRectangle(*args, **kwargs):
f5b96ee1
RD
2905 """
2906 DrawRectangle(self, int x, int y, int width, int height)
2907
2908 Draws a rectangle with the given top left corner, and with the given
2909 size. The current pen is used for the outline and the current brush
2910 for filling the shape.
2911 """
54f9ee45 2912 return _gdi_.DC_DrawRectangle(*args, **kwargs)
e811c8ce
RD
2913
2914 def DrawRectangleRect(*args, **kwargs):
f5b96ee1
RD
2915 """
2916 DrawRectangleRect(self, Rect rect)
2917
2918 Draws a rectangle with the given top left corner, and with the given
2919 size. The current pen is used for the outline and the current brush
2920 for filling the shape.
2921 """
54f9ee45 2922 return _gdi_.DC_DrawRectangleRect(*args, **kwargs)
e811c8ce 2923
03e37cd5 2924 def DrawRectanglePointSize(*args, **kwargs):
f5b96ee1
RD
2925 """
2926 DrawRectanglePointSize(self, Point pt, Size sz)
2927
2928 Draws a rectangle with the given top left corner, and with the given
2929 size. The current pen is used for the outline and the current brush
2930 for filling the shape.
2931 """
03e37cd5 2932 return _gdi_.DC_DrawRectanglePointSize(*args, **kwargs)
e811c8ce
RD
2933
2934 def DrawRoundedRectangle(*args, **kwargs):
f5b96ee1
RD
2935 """
2936 DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
2937
2938 Draws a rectangle with the given top left corner, and with the given
2939 size. The corners are quarter-circles using the given radius. The
2940 current pen is used for the outline and the current brush for filling
2941 the shape.
2942
2943 If radius is positive, the value is assumed to be the radius of the
2944 rounded corner. If radius is negative, the absolute value is assumed
2945 to be the proportion of the smallest dimension of the rectangle. This
2946 means that the corner can be a sensible size relative to the size of
2947 the rectangle, and also avoids the strange effects X produces when the
2948 corners are too big for the rectangle.
2949 """
54f9ee45 2950 return _gdi_.DC_DrawRoundedRectangle(*args, **kwargs)
e811c8ce
RD
2951
2952 def DrawRoundedRectangleRect(*args, **kwargs):
f5b96ee1
RD
2953 """
2954 DrawRoundedRectangleRect(self, Rect r, double radius)
2955
2956 Draws a rectangle with the given top left corner, and with the given
2957 size. The corners are quarter-circles using the given radius. The
2958 current pen is used for the outline and the current brush for filling
2959 the shape.
2960
2961 If radius is positive, the value is assumed to be the radius of the
2962 rounded corner. If radius is negative, the absolute value is assumed
2963 to be the proportion of the smallest dimension of the rectangle. This
2964 means that the corner can be a sensible size relative to the size of
2965 the rectangle, and also avoids the strange effects X produces when the
2966 corners are too big for the rectangle.
2967 """
54f9ee45 2968 return _gdi_.DC_DrawRoundedRectangleRect(*args, **kwargs)
e811c8ce 2969
03e37cd5 2970 def DrawRoundedRectanglePointSize(*args, **kwargs):
f5b96ee1
RD
2971 """
2972 DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
2973
2974 Draws a rectangle with the given top left corner, and with the given
2975 size. The corners are quarter-circles using the given radius. The
2976 current pen is used for the outline and the current brush for filling
2977 the shape.
2978
2979 If radius is positive, the value is assumed to be the radius of the
2980 rounded corner. If radius is negative, the absolute value is assumed
2981 to be the proportion of the smallest dimension of the rectangle. This
2982 means that the corner can be a sensible size relative to the size of
2983 the rectangle, and also avoids the strange effects X produces when the
2984 corners are too big for the rectangle.
2985 """
03e37cd5 2986 return _gdi_.DC_DrawRoundedRectanglePointSize(*args, **kwargs)
e811c8ce
RD
2987
2988 def DrawCircle(*args, **kwargs):
f5b96ee1
RD
2989 """
2990 DrawCircle(self, int x, int y, int radius)
2991
2992 Draws a circle with the given center point and radius. The current
2993 pen is used for the outline and the current brush for filling the
2994 shape.
2995 """
54f9ee45 2996 return _gdi_.DC_DrawCircle(*args, **kwargs)
e811c8ce 2997
03e37cd5 2998 def DrawCirclePoint(*args, **kwargs):
f5b96ee1
RD
2999 """
3000 DrawCirclePoint(self, Point pt, int radius)
3001
3002 Draws a circle with the given center point and radius. The current
3003 pen is used for the outline and the current brush for filling the
3004 shape.
3005 """
03e37cd5 3006 return _gdi_.DC_DrawCirclePoint(*args, **kwargs)
e811c8ce
RD
3007
3008 def DrawEllipse(*args, **kwargs):
f5b96ee1
RD
3009 """
3010 DrawEllipse(self, int x, int y, int width, int height)
3011
3012 Draws an ellipse contained in the specified rectangle. The current pen
3013 is used for the outline and the current brush for filling the shape.
3014 """
54f9ee45 3015 return _gdi_.DC_DrawEllipse(*args, **kwargs)
e811c8ce
RD
3016
3017 def DrawEllipseRect(*args, **kwargs):
f5b96ee1
RD
3018 """
3019 DrawEllipseRect(self, Rect rect)
3020
3021 Draws an ellipse contained in the specified rectangle. The current pen
3022 is used for the outline and the current brush for filling the shape.
3023 """
54f9ee45 3024 return _gdi_.DC_DrawEllipseRect(*args, **kwargs)
e811c8ce 3025
03e37cd5 3026 def DrawEllipsePointSize(*args, **kwargs):
f5b96ee1
RD
3027 """
3028 DrawEllipsePointSize(self, Point pt, Size sz)
3029
3030 Draws an ellipse contained in the specified rectangle. The current pen
3031 is used for the outline and the current brush for filling the shape.
3032 """
03e37cd5 3033 return _gdi_.DC_DrawEllipsePointSize(*args, **kwargs)
e811c8ce
RD
3034
3035 def DrawIcon(*args, **kwargs):
f5b96ee1
RD
3036 """
3037 DrawIcon(self, Icon icon, int x, int y)
3038
3039 Draw an icon on the display (does nothing if the device context is
3040 PostScript). This can be the simplest way of drawing bitmaps on a
3041 window.
3042 """
54f9ee45 3043 return _gdi_.DC_DrawIcon(*args, **kwargs)
e811c8ce 3044
03e37cd5 3045 def DrawIconPoint(*args, **kwargs):
f5b96ee1
RD
3046 """
3047 DrawIconPoint(self, Icon icon, Point pt)
3048
3049 Draw an icon on the display (does nothing if the device context is
3050 PostScript). This can be the simplest way of drawing bitmaps on a
3051 window.
3052 """
03e37cd5 3053 return _gdi_.DC_DrawIconPoint(*args, **kwargs)
e811c8ce
RD
3054
3055 def DrawBitmap(*args, **kwargs):
f5b96ee1
RD
3056 """
3057 DrawBitmap(self, Bitmap bmp, int x, int y, bool useMask=False)
3058
3059 Draw a bitmap on the device context at the specified point. If
3060 *transparent* is true and the bitmap has a transparency mask, (or
3061 alpha channel on the platforms that support it) then the bitmap will
3062 be drawn transparently.
3063 """
54f9ee45 3064 return _gdi_.DC_DrawBitmap(*args, **kwargs)
e811c8ce 3065
03e37cd5 3066 def DrawBitmapPoint(*args, **kwargs):
f5b96ee1
RD
3067 """
3068 DrawBitmapPoint(self, Bitmap bmp, Point pt, bool useMask=False)
3069
3070 Draw a bitmap on the device context at the specified point. If
3071 *transparent* is true and the bitmap has a transparency mask, (or
3072 alpha channel on the platforms that support it) then the bitmap will
3073 be drawn transparently.
3074 """
03e37cd5 3075 return _gdi_.DC_DrawBitmapPoint(*args, **kwargs)
e811c8ce
RD
3076
3077 def DrawText(*args, **kwargs):
f5b96ee1
RD
3078 """
3079 DrawText(self, String text, int x, int y)
3080
3081 Draws a text string at the specified point, using the current text
3082 font, and the current text foreground and background colours.
3083
3084 The coordinates refer to the top-left corner of the rectangle bounding
3085 the string. See `GetTextExtent` for how to get the dimensions of a
3086 text string, which can be used to position the text more precisely.
3087
3088 **NOTE**: under wxGTK the current logical function is used by this
3089 function but it is ignored by wxMSW. Thus, you should avoid using
3090 logical functions with this function in portable programs.
3091 """
54f9ee45 3092 return _gdi_.DC_DrawText(*args, **kwargs)
e811c8ce 3093
03e37cd5 3094 def DrawTextPoint(*args, **kwargs):
f5b96ee1
RD
3095 """
3096 DrawTextPoint(self, String text, Point pt)
3097
3098 Draws a text string at the specified point, using the current text
3099 font, and the current text foreground and background colours.
3100
3101 The coordinates refer to the top-left corner of the rectangle bounding
3102 the string. See `GetTextExtent` for how to get the dimensions of a
3103 text string, which can be used to position the text more precisely.
3104
3105 **NOTE**: under wxGTK the current logical function is used by this
3106 function but it is ignored by wxMSW. Thus, you should avoid using
3107 logical functions with this function in portable programs.
3108 """
03e37cd5 3109 return _gdi_.DC_DrawTextPoint(*args, **kwargs)
e811c8ce
RD
3110
3111 def DrawRotatedText(*args, **kwargs):
f5b96ee1
RD
3112 """
3113 DrawRotatedText(self, String text, int x, int y, double angle)
3114
3115 Draws the text rotated by *angle* degrees, if supported by the platform.
3116
3117 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
3118 function. In particular, a font different from ``wx.NORMAL_FONT``
3119 should be used as the it is not normally a TrueType
3120 font. ``wx.SWISS_FONT`` is an example of a font which is.
3121 """
54f9ee45 3122 return _gdi_.DC_DrawRotatedText(*args, **kwargs)
e811c8ce 3123
03e37cd5 3124 def DrawRotatedTextPoint(*args, **kwargs):
f5b96ee1
RD
3125 """
3126 DrawRotatedTextPoint(self, String text, Point pt, double angle)
3127
3128 Draws the text rotated by *angle* degrees, if supported by the platform.
3129
3130 **NOTE**: Under Win9x only TrueType fonts can be drawn by this
3131 function. In particular, a font different from ``wx.NORMAL_FONT``
3132 should be used as the it is not normally a TrueType
3133 font. ``wx.SWISS_FONT`` is an example of a font which is.
3134 """
03e37cd5
RD
3135 return _gdi_.DC_DrawRotatedTextPoint(*args, **kwargs)
3136
3137 def Blit(*args, **kwargs):
0df68c9f 3138 """
03e37cd5 3139 Blit(self, int xdest, int ydest, int width, int height, DC source,
0df68c9f
RD
3140 int xsrc, int ysrc, int rop=COPY, bool useMask=False,
3141 int xsrcMask=-1, int ysrcMask=-1) -> bool
f5b96ee1
RD
3142
3143 Copy from a source DC to this DC. Parameters specify the destination
3144 coordinates, size of area to copy, source DC, source coordinates,
3145 logical function, whether to use a bitmap mask, and mask source
3146 position.
0df68c9f 3147 """
03e37cd5 3148 return _gdi_.DC_Blit(*args, **kwargs)
e811c8ce 3149
03e37cd5 3150 def BlitPointSize(*args, **kwargs):
0df68c9f 3151 """
03e37cd5 3152 BlitPointSize(self, Point destPt, Size sz, DC source, Point srcPt, int rop=COPY,
0df68c9f 3153 bool useMask=False, Point srcPtMask=DefaultPosition) -> bool
f5b96ee1
RD
3154
3155 Copy from a source DC to this DC. Parameters specify the destination
3156 coordinates, size of area to copy, source DC, source coordinates,
3157 logical function, whether to use a bitmap mask, and mask source
3158 position.
0df68c9f 3159 """
03e37cd5
RD
3160 return _gdi_.DC_BlitPointSize(*args, **kwargs)
3161
3162 def SetClippingRegion(*args, **kwargs):
f5b96ee1
RD
3163 """
3164 SetClippingRegion(self, int x, int y, int width, int height)
3165
3166 Sets the clipping region for this device context to the intersection
3167 of the given region described by the parameters of this method and the
3168 previously set clipping region. You should call `DestroyClippingRegion`
3169 if you want to set the clipping region exactly to the region
3170 specified.
3171
3172 The clipping region is an area to which drawing is
3173 restricted. Possible uses for the clipping region are for clipping
3174 text or for speeding up window redraws when only a known area of the
3175 screen is damaged.
3176 """
03e37cd5
RD
3177 return _gdi_.DC_SetClippingRegion(*args, **kwargs)
3178
3179 def SetClippingRegionPointSize(*args, **kwargs):
f5b96ee1
RD
3180 """
3181 SetClippingRegionPointSize(self, Point pt, Size sz)
3182
3183 Sets the clipping region for this device context to the intersection
3184 of the given region described by the parameters of this method and the
3185 previously set clipping region. You should call `DestroyClippingRegion`
3186 if you want to set the clipping region exactly to the region
3187 specified.
3188
3189 The clipping region is an area to which drawing is
3190 restricted. Possible uses for the clipping region are for clipping
3191 text or for speeding up window redraws when only a known area of the
3192 screen is damaged.
3193 """
03e37cd5
RD
3194 return _gdi_.DC_SetClippingRegionPointSize(*args, **kwargs)
3195
3196 def SetClippingRegionAsRegion(*args, **kwargs):
f5b96ee1
RD
3197 """
3198 SetClippingRegionAsRegion(self, Region region)
3199
3200 Sets the clipping region for this device context to the intersection
3201 of the given region described by the parameters of this method and the
3202 previously set clipping region. You should call `DestroyClippingRegion`
3203 if you want to set the clipping region exactly to the region
3204 specified.
3205
3206 The clipping region is an area to which drawing is
3207 restricted. Possible uses for the clipping region are for clipping
3208 text or for speeding up window redraws when only a known area of the
3209 screen is damaged.
3210 """
03e37cd5
RD
3211 return _gdi_.DC_SetClippingRegionAsRegion(*args, **kwargs)
3212
3213 def SetClippingRect(*args, **kwargs):
f5b96ee1
RD
3214 """
3215 SetClippingRect(self, Rect rect)
3216
3217 Sets the clipping region for this device context to the intersection
3218 of the given region described by the parameters of this method and the
3219 previously set clipping region. You should call `DestroyClippingRegion`
3220 if you want to set the clipping region exactly to the region
3221 specified.
3222
3223 The clipping region is an area to which drawing is
3224 restricted. Possible uses for the clipping region are for clipping
3225 text or for speeding up window redraws when only a known area of the
3226 screen is damaged.
3227 """
03e37cd5 3228 return _gdi_.DC_SetClippingRect(*args, **kwargs)
e811c8ce
RD
3229
3230 def DrawLines(*args, **kwargs):
f5b96ee1
RD
3231 """
3232 DrawLines(self, List points, int xoffset=0, int yoffset=0)
3233
3234 Draws lines using a sequence of `wx.Point` objects, adding the
3235 optional offset coordinate. The current pen is used for drawing the
3236 lines.
3237 """
54f9ee45 3238 return _gdi_.DC_DrawLines(*args, **kwargs)
e811c8ce
RD
3239
3240 def DrawPolygon(*args, **kwargs):
0df68c9f 3241 """
f5b96ee1 3242 DrawPolygon(self, List points, int xoffset=0, int yoffset=0,
0df68c9f 3243 int fillStyle=ODDEVEN_RULE)
f5b96ee1
RD
3244
3245 Draws a filled polygon using a sequence of `wx.Point` objects, adding
3246 the optional offset coordinate. The last argument specifies the fill
3247 rule: ``wx.ODDEVEN_RULE`` (the default) or ``wx.WINDING_RULE``.
3248
3249 The current pen is used for drawing the outline, and the current brush
3250 for filling the shape. Using a transparent brush suppresses
3251 filling. Note that wxWidgets automatically closes the first and last
3252 points.
0df68c9f 3253 """
54f9ee45 3254 return _gdi_.DC_DrawPolygon(*args, **kwargs)
e811c8ce
RD
3255
3256 def DrawLabel(*args, **kwargs):
0df68c9f 3257 """
a95a7133 3258 DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
0df68c9f 3259 int indexAccel=-1)
f5b96ee1
RD
3260
3261 Draw *text* within the specified rectangle, abiding by the alignment
3262 flags. Will additionally emphasize the character at *indexAccel* if
3263 it is not -1.
0df68c9f 3264 """
54f9ee45 3265 return _gdi_.DC_DrawLabel(*args, **kwargs)
e811c8ce
RD
3266
3267 def DrawImageLabel(*args, **kwargs):
0df68c9f 3268 """
a95a7133 3269 DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
0df68c9f 3270 int indexAccel=-1) -> Rect
f5b96ee1
RD
3271
3272 Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
3273 drawing it) within the specified rectangle, abiding by the alignment
3274 flags. Will additionally emphasize the character at *indexAccel* if
3275 it is not -1. Returns the bounding rectangle.
0df68c9f 3276 """
54f9ee45 3277 return _gdi_.DC_DrawImageLabel(*args, **kwargs)
e811c8ce
RD
3278
3279 def DrawSpline(*args, **kwargs):
f5b96ee1
RD
3280 """
3281 DrawSpline(self, List points)
3282
3283 Draws a spline between all given control points, (a list of `wx.Point`
3284 objects) using the current pen. The spline is drawn using a series of
3285 lines, using an algorithm taken from the X drawing program 'XFIG'.
3286 """
54f9ee45 3287 return _gdi_.DC_DrawSpline(*args, **kwargs)
e811c8ce
RD
3288
3289 def Clear(*args, **kwargs):
f5b96ee1
RD
3290 """
3291 Clear(self)
3292
3293 Clears the device context using the current background brush.
3294 """
54f9ee45 3295 return _gdi_.DC_Clear(*args, **kwargs)
e811c8ce
RD
3296
3297 def StartDoc(*args, **kwargs):
f5b96ee1
RD
3298 """
3299 StartDoc(self, String message) -> bool
3300
3301 Starts a document (only relevant when outputting to a
3302 printer). *Message* is a message to show whilst printing.
3303 """
54f9ee45 3304 return _gdi_.DC_StartDoc(*args, **kwargs)
e811c8ce
RD
3305
3306 def EndDoc(*args, **kwargs):
f5b96ee1
RD
3307 """
3308 EndDoc(self)
3309
3310 Ends a document (only relevant when outputting to a printer).
3311 """
54f9ee45 3312 return _gdi_.DC_EndDoc(*args, **kwargs)
e811c8ce
RD
3313
3314 def StartPage(*args, **kwargs):
f5b96ee1
RD
3315 """
3316 StartPage(self)
3317
3318 Starts a document page (only relevant when outputting to a printer).
3319 """
54f9ee45 3320 return _gdi_.DC_StartPage(*args, **kwargs)
e811c8ce
RD
3321
3322 def EndPage(*args, **kwargs):
f5b96ee1
RD
3323 """
3324 EndPage(self)
3325
3326 Ends a document page (only relevant when outputting to a printer).
3327 """
54f9ee45 3328 return _gdi_.DC_EndPage(*args, **kwargs)
e811c8ce
RD
3329
3330 def SetFont(*args, **kwargs):
f5b96ee1
RD
3331 """
3332 SetFont(self, Font font)
3333
3334 Sets the current font for the DC. It must be a valid font, in
3335 particular you should not pass ``wx.NullFont`` to this method.
3336 """
54f9ee45 3337 return _gdi_.DC_SetFont(*args, **kwargs)
e811c8ce
RD
3338
3339 def SetPen(*args, **kwargs):
f5b96ee1
RD
3340 """
3341 SetPen(self, Pen pen)
3342
3343 Sets the current pen for the DC.
3344
3345 If the argument is ``wx.NullPen``, the current pen is selected out of the
3346 device context, and the original pen restored.
3347 """
54f9ee45 3348 return _gdi_.DC_SetPen(*args, **kwargs)
e811c8ce
RD
3349
3350 def SetBrush(*args, **kwargs):
f5b96ee1
RD
3351 """
3352 SetBrush(self, Brush brush)
3353
3354 Sets the current brush for the DC.
3355
3356 If the argument is ``wx.NullBrush``, the current brush is selected out
3357 of the device context, and the original brush restored, allowing the
3358 current brush to be destroyed safely.
3359 """
54f9ee45 3360 return _gdi_.DC_SetBrush(*args, **kwargs)
e811c8ce
RD
3361
3362 def SetBackground(*args, **kwargs):
f5b96ee1
RD
3363 """
3364 SetBackground(self, Brush brush)
3365
3366 Sets the current background brush for the DC.
3367 """
54f9ee45 3368 return _gdi_.DC_SetBackground(*args, **kwargs)
e811c8ce
RD
3369
3370 def SetBackgroundMode(*args, **kwargs):
f5b96ee1
RD
3371 """
3372 SetBackgroundMode(self, int mode)
3373
3374 *mode* may be one of ``wx.SOLID`` and ``wx.TRANSPARENT``. This setting
3375 determines whether text will be drawn with a background colour or
3376 not.
3377 """
54f9ee45 3378 return _gdi_.DC_SetBackgroundMode(*args, **kwargs)
e811c8ce
RD
3379
3380 def SetPalette(*args, **kwargs):
f5b96ee1
RD
3381 """
3382 SetPalette(self, Palette palette)
3383
3384 If this is a window DC or memory DC, assigns the given palette to the
3385 window or bitmap associated with the DC. If the argument is
3386 ``wx.NullPalette``, the current palette is selected out of the device
3387 context, and the original palette restored.
3388 """
54f9ee45 3389 return _gdi_.DC_SetPalette(*args, **kwargs)
e811c8ce 3390
e811c8ce 3391 def DestroyClippingRegion(*args, **kwargs):
f5b96ee1
RD
3392 """
3393 DestroyClippingRegion(self)
3394
3395 Destroys the current clipping region so that none of the DC is
3396 clipped.
3397 """
54f9ee45 3398 return _gdi_.DC_DestroyClippingRegion(*args, **kwargs)
e811c8ce
RD
3399
3400 def GetClippingBox(*args, **kwargs):
f5b96ee1
RD
3401 """
3402 GetClippingBox() -> (x, y, width, height)
3403
3404 Gets the rectangle surrounding the current clipping region.
3405 """
54f9ee45 3406 return _gdi_.DC_GetClippingBox(*args, **kwargs)
e811c8ce
RD
3407
3408 def GetClippingRect(*args, **kwargs):
f5b96ee1
RD
3409 """
3410 GetClippingRect(self) -> Rect
3411
3412 Gets the rectangle surrounding the current clipping region.
3413 """
54f9ee45 3414 return _gdi_.DC_GetClippingRect(*args, **kwargs)
e811c8ce
RD
3415
3416 def GetCharHeight(*args, **kwargs):
f5b96ee1
RD
3417 """
3418 GetCharHeight(self) -> int
3419
3420 Gets the character height of the currently set font.
3421 """
54f9ee45 3422 return _gdi_.DC_GetCharHeight(*args, **kwargs)
e811c8ce
RD
3423
3424 def GetCharWidth(*args, **kwargs):
f5b96ee1
RD
3425 """
3426 GetCharWidth(self) -> int
3427
3428 Gets the average character width of the currently set font.
3429 """
54f9ee45 3430 return _gdi_.DC_GetCharWidth(*args, **kwargs)
e811c8ce
RD
3431
3432 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
3433 """
3434 GetTextExtent(wxString string) -> (width, height)
3435
3436 Get the width and height of the text using the current font. Only
3437 works for single line strings.
3438 """
54f9ee45 3439 return _gdi_.DC_GetTextExtent(*args, **kwargs)
e811c8ce
RD
3440
3441 def GetFullTextExtent(*args, **kwargs):
0df68c9f
RD
3442 """
3443 GetFullTextExtent(wxString string, Font font=None) ->
3444 (width, height, descent, externalLeading)
322913ce 3445
41e2b43e
RD
3446 Get the width, height, decent and leading of the text using the
3447 current or specified font. Only works for single line strings.
0df68c9f 3448 """
54f9ee45 3449 return _gdi_.DC_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
3450
3451 def GetMultiLineTextExtent(*args, **kwargs):
0df68c9f
RD
3452 """
3453 GetMultiLineTextExtent(wxString string, Font font=None) ->
3454 (width, height, descent, externalLeading)
fd2dc343
RD
3455
3456 Get the width, height, decent and leading of the text using the
3457 current or specified font. Works for single as well as multi-line
3458 strings.
0df68c9f 3459 """
54f9ee45 3460 return _gdi_.DC_GetMultiLineTextExtent(*args, **kwargs)
e811c8ce 3461
db914595 3462 def GetPartialTextExtents(*args, **kwargs):
f5b96ee1
RD
3463 """
3464 GetPartialTextExtents(self, text) -> [widths]
3465
3466 Returns a list of integers such that each value is the distance in
3467 pixels from the begining of text to the coresponding character of
3468 *text*. The generic version simply builds a running total of the widths
3469 of each character using GetTextExtent, however if the various
3470 platforms have a native API function that is faster or more accurate
43e8916f 3471 than the generic implementation then it will be used instead.
f5b96ee1 3472 """
54f9ee45 3473 return _gdi_.DC_GetPartialTextExtents(*args, **kwargs)
db914595 3474
e811c8ce 3475 def GetSize(*args, **kwargs):
0df68c9f 3476 """
a95a7133 3477 GetSize(self) -> Size
322913ce 3478
f5b96ee1
RD
3479 This gets the horizontal and vertical resolution in device units. It
3480 can be used to scale graphics to fit the page. For example, if *maxX*
3481 and *maxY* represent the maximum horizontal and vertical 'pixel' values
3482 used in your application, the following code will scale the graphic to
3483 fit on the printer page::
3484
3485 w, h = dc.GetSize()
3486 scaleX = maxX*1.0 / w
3487 scaleY = maxY*1.0 / h
3488 dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
3489
0df68c9f 3490 """
54f9ee45 3491 return _gdi_.DC_GetSize(*args, **kwargs)
e811c8ce 3492
322913ce 3493 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
3494 """
3495 GetSizeTuple() -> (width, height)
322913ce 3496
f5b96ee1
RD
3497 This gets the horizontal and vertical resolution in device units. It
3498 can be used to scale graphics to fit the page. For example, if *maxX*
3499 and *maxY* represent the maximum horizontal and vertical 'pixel' values
3500 used in your application, the following code will scale the graphic to
3501 fit on the printer page::
3502
3503 w, h = dc.GetSize()
3504 scaleX = maxX*1.0 / w
3505 scaleY = maxY*1.0 / h
3506 dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY))
3507
0df68c9f 3508 """
54f9ee45 3509 return _gdi_.DC_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
3510
3511 def GetSizeMM(*args, **kwargs):
0df68c9f 3512 """
a95a7133 3513 GetSizeMM(self) -> Size
322913ce 3514
0df68c9f
RD
3515 Get the DC size in milimeters.
3516 """
54f9ee45 3517 return _gdi_.DC_GetSizeMM(*args, **kwargs)
e811c8ce 3518
322913ce 3519 def GetSizeMMTuple(*args, **kwargs):
0df68c9f
RD
3520 """
3521 GetSizeMMTuple() -> (width, height)
322913ce 3522
0df68c9f
RD
3523 Get the DC size in milimeters.
3524 """
54f9ee45 3525 return _gdi_.DC_GetSizeMMTuple(*args, **kwargs)
322913ce 3526
e811c8ce 3527 def DeviceToLogicalX(*args, **kwargs):
f5b96ee1
RD
3528 """
3529 DeviceToLogicalX(self, int x) -> int
3530
3531 Convert device X coordinate to logical coordinate, using the current
3532 mapping mode.
3533 """
54f9ee45 3534 return _gdi_.DC_DeviceToLogicalX(*args, **kwargs)
e811c8ce
RD
3535
3536 def DeviceToLogicalY(*args, **kwargs):
f5b96ee1
RD
3537 """
3538 DeviceToLogicalY(self, int y) -> int
3539
3540 Converts device Y coordinate to logical coordinate, using the current
3541 mapping mode.
3542 """
54f9ee45 3543 return _gdi_.DC_DeviceToLogicalY(*args, **kwargs)
e811c8ce
RD
3544
3545 def DeviceToLogicalXRel(*args, **kwargs):
f5b96ee1
RD
3546 """
3547 DeviceToLogicalXRel(self, int x) -> int
3548
3549 Convert device X coordinate to relative logical coordinate, using the
3550 current mapping mode but ignoring the x axis orientation. Use this
3551 function for converting a width, for example.
3552 """
54f9ee45 3553 return _gdi_.DC_DeviceToLogicalXRel(*args, **kwargs)
e811c8ce
RD
3554
3555 def DeviceToLogicalYRel(*args, **kwargs):
f5b96ee1
RD
3556 """
3557 DeviceToLogicalYRel(self, int y) -> int
3558
3559 Convert device Y coordinate to relative logical coordinate, using the
3560 current mapping mode but ignoring the y axis orientation. Use this
3561 function for converting a height, for example.
3562 """
54f9ee45 3563 return _gdi_.DC_DeviceToLogicalYRel(*args, **kwargs)
e811c8ce
RD
3564
3565 def LogicalToDeviceX(*args, **kwargs):
f5b96ee1
RD
3566 """
3567 LogicalToDeviceX(self, int x) -> int
3568
3569 Converts logical X coordinate to device coordinate, using the current
3570 mapping mode.
3571 """
54f9ee45 3572 return _gdi_.DC_LogicalToDeviceX(*args, **kwargs)
e811c8ce
RD
3573
3574 def LogicalToDeviceY(*args, **kwargs):
f5b96ee1
RD
3575 """
3576 LogicalToDeviceY(self, int y) -> int
3577
3578 Converts logical Y coordinate to device coordinate, using the current
3579 mapping mode.
3580 """
54f9ee45 3581 return _gdi_.DC_LogicalToDeviceY(*args, **kwargs)
e811c8ce
RD
3582
3583 def LogicalToDeviceXRel(*args, **kwargs):
f5b96ee1
RD
3584 """
3585 LogicalToDeviceXRel(self, int x) -> int
3586
3587 Converts logical X coordinate to relative device coordinate, using the
3588 current mapping mode but ignoring the x axis orientation. Use this for
3589 converting a width, for example.
3590 """
54f9ee45 3591 return _gdi_.DC_LogicalToDeviceXRel(*args, **kwargs)
e811c8ce
RD
3592
3593 def LogicalToDeviceYRel(*args, **kwargs):
f5b96ee1
RD
3594 """
3595 LogicalToDeviceYRel(self, int y) -> int
3596
3597 Converts logical Y coordinate to relative device coordinate, using the
3598 current mapping mode but ignoring the y axis orientation. Use this for
3599 converting a height, for example.
3600 """
54f9ee45 3601 return _gdi_.DC_LogicalToDeviceYRel(*args, **kwargs)
e811c8ce
RD
3602
3603 def CanDrawBitmap(*args, **kwargs):
a95a7133 3604 """CanDrawBitmap(self) -> bool"""
54f9ee45 3605 return _gdi_.DC_CanDrawBitmap(*args, **kwargs)
e811c8ce
RD
3606
3607 def CanGetTextExtent(*args, **kwargs):
a95a7133 3608 """CanGetTextExtent(self) -> bool"""
54f9ee45 3609 return _gdi_.DC_CanGetTextExtent(*args, **kwargs)
e811c8ce
RD
3610
3611 def GetDepth(*args, **kwargs):
f5b96ee1
RD
3612 """
3613 GetDepth(self) -> int
3614
3615 Returns the colour depth of the DC.
3616 """
54f9ee45 3617 return _gdi_.DC_GetDepth(*args, **kwargs)
e811c8ce
RD
3618
3619 def GetPPI(*args, **kwargs):
f5b96ee1
RD
3620 """
3621 GetPPI(self) -> Size
3622
3623 Resolution in Pixels per inch
3624 """
54f9ee45 3625 return _gdi_.DC_GetPPI(*args, **kwargs)
e811c8ce
RD
3626
3627 def Ok(*args, **kwargs):
f5b96ee1
RD
3628 """
3629 Ok(self) -> bool
3630
3631 Returns true if the DC is ok to use.
3632 """
54f9ee45 3633 return _gdi_.DC_Ok(*args, **kwargs)
e811c8ce
RD
3634
3635 def GetBackgroundMode(*args, **kwargs):
f5b96ee1
RD
3636 """
3637 GetBackgroundMode(self) -> int
3638
3639 Returns the current background mode, either ``wx.SOLID`` or
3640 ``wx.TRANSPARENT``.
3641 """
54f9ee45 3642 return _gdi_.DC_GetBackgroundMode(*args, **kwargs)
e811c8ce
RD
3643
3644 def GetBackground(*args, **kwargs):
f5b96ee1
RD
3645 """
3646 GetBackground(self) -> Brush
3647
3648 Gets the brush used for painting the background.
3649 """
54f9ee45 3650 return _gdi_.DC_GetBackground(*args, **kwargs)
e811c8ce
RD
3651
3652 def GetBrush(*args, **kwargs):
f5b96ee1
RD
3653 """
3654 GetBrush(self) -> Brush
3655
3656 Gets the current brush
3657 """
54f9ee45 3658 return _gdi_.DC_GetBrush(*args, **kwargs)
e811c8ce
RD
3659
3660 def GetFont(*args, **kwargs):
f5b96ee1
RD
3661 """
3662 GetFont(self) -> Font
3663
3664 Gets the current font
3665 """
54f9ee45 3666 return _gdi_.DC_GetFont(*args, **kwargs)
e811c8ce
RD
3667
3668 def GetPen(*args, **kwargs):
f5b96ee1
RD
3669 """
3670 GetPen(self) -> Pen
3671
3672 Gets the current pen
3673 """
54f9ee45 3674 return _gdi_.DC_GetPen(*args, **kwargs)
e811c8ce
RD
3675
3676 def GetTextBackground(*args, **kwargs):
f5b96ee1
RD
3677 """
3678 GetTextBackground(self) -> Colour
3679
3680 Gets the current text background colour
3681 """
54f9ee45 3682 return _gdi_.DC_GetTextBackground(*args, **kwargs)
e811c8ce
RD
3683
3684 def GetTextForeground(*args, **kwargs):
f5b96ee1
RD
3685 """
3686 GetTextForeground(self) -> Colour
3687
3688 Gets the current text foreground colour
3689 """
54f9ee45 3690 return _gdi_.DC_GetTextForeground(*args, **kwargs)
e811c8ce
RD
3691
3692 def SetTextForeground(*args, **kwargs):
f5b96ee1
RD
3693 """
3694 SetTextForeground(self, Colour colour)
3695
3696 Sets the current text foreground colour for the DC.
3697 """
54f9ee45 3698 return _gdi_.DC_SetTextForeground(*args, **kwargs)
e811c8ce
RD
3699
3700 def SetTextBackground(*args, **kwargs):
f5b96ee1
RD
3701 """
3702 SetTextBackground(self, Colour colour)
3703
3704 Sets the current text background colour for the DC.
3705 """
54f9ee45 3706 return _gdi_.DC_SetTextBackground(*args, **kwargs)
e811c8ce
RD
3707
3708 def GetMapMode(*args, **kwargs):
f5b96ee1
RD
3709 """
3710 GetMapMode(self) -> int
3711
3712 Gets the current *mapping mode* for the device context
3713 """
54f9ee45 3714 return _gdi_.DC_GetMapMode(*args, **kwargs)
e811c8ce
RD
3715
3716 def SetMapMode(*args, **kwargs):
f5b96ee1
RD
3717 """
3718 SetMapMode(self, int mode)
3719
3720 The *mapping mode* of the device context defines the unit of
3721 measurement used to convert logical units to device units. The
3722 mapping mode can be one of the following:
3723
3724 ================ =============================================
3725 wx.MM_TWIPS Each logical unit is 1/20 of a point, or 1/1440
3726 of an inch.
3727 wx.MM_POINTS Each logical unit is a point, or 1/72 of an inch.
3728 wx.MM_METRIC Each logical unit is 1 mm.
3729 wx.MM_LOMETRIC Each logical unit is 1/10 of a mm.
3730 wx.MM_TEXT Each logical unit is 1 pixel.
3731 ================ =============================================
3732
3733 """
54f9ee45 3734 return _gdi_.DC_SetMapMode(*args, **kwargs)
e811c8ce
RD
3735
3736 def GetUserScale(*args, **kwargs):
f5b96ee1
RD
3737 """
3738 GetUserScale(self) -> (xScale, yScale)
3739
3740 Gets the current user scale factor (set by `SetUserScale`).
3741 """
54f9ee45 3742 return _gdi_.DC_GetUserScale(*args, **kwargs)
e811c8ce
RD
3743
3744 def SetUserScale(*args, **kwargs):
f5b96ee1
RD
3745 """
3746 SetUserScale(self, double x, double y)
3747
3748 Sets the user scaling factor, useful for applications which require
3749 'zooming'.
3750 """
54f9ee45 3751 return _gdi_.DC_SetUserScale(*args, **kwargs)
e811c8ce
RD
3752
3753 def GetLogicalScale(*args, **kwargs):
322913ce 3754 """GetLogicalScale() -> (xScale, yScale)"""
54f9ee45 3755 return _gdi_.DC_GetLogicalScale(*args, **kwargs)
e811c8ce
RD
3756
3757 def SetLogicalScale(*args, **kwargs):
a95a7133 3758 """SetLogicalScale(self, double x, double y)"""
54f9ee45 3759 return _gdi_.DC_SetLogicalScale(*args, **kwargs)
e811c8ce 3760
e811c8ce 3761 def GetLogicalOrigin(*args, **kwargs):
a95a7133 3762 """GetLogicalOrigin(self) -> Point"""
54f9ee45 3763 return _gdi_.DC_GetLogicalOrigin(*args, **kwargs)
e811c8ce 3764
322913ce
RD
3765 def GetLogicalOriginTuple(*args, **kwargs):
3766 """GetLogicalOriginTuple() -> (x,y)"""
54f9ee45 3767 return _gdi_.DC_GetLogicalOriginTuple(*args, **kwargs)
322913ce 3768
e811c8ce 3769 def SetLogicalOrigin(*args, **kwargs):
a95a7133 3770 """SetLogicalOrigin(self, int x, int y)"""
54f9ee45 3771 return _gdi_.DC_SetLogicalOrigin(*args, **kwargs)
e811c8ce 3772
03e37cd5
RD
3773 def SetLogicalOriginPoint(*args, **kwargs):
3774 """SetLogicalOriginPoint(self, Point point)"""
3775 return _gdi_.DC_SetLogicalOriginPoint(*args, **kwargs)
3776
e811c8ce 3777 def GetDeviceOrigin(*args, **kwargs):
a95a7133 3778 """GetDeviceOrigin(self) -> Point"""
54f9ee45 3779 return _gdi_.DC_GetDeviceOrigin(*args, **kwargs)
e811c8ce 3780
322913ce
RD
3781 def GetDeviceOriginTuple(*args, **kwargs):
3782 """GetDeviceOriginTuple() -> (x,y)"""
54f9ee45 3783 return _gdi_.DC_GetDeviceOriginTuple(*args, **kwargs)
322913ce 3784
e811c8ce 3785 def SetDeviceOrigin(*args, **kwargs):
a95a7133 3786 """SetDeviceOrigin(self, int x, int y)"""
54f9ee45 3787 return _gdi_.DC_SetDeviceOrigin(*args, **kwargs)
e811c8ce 3788
03e37cd5
RD
3789 def SetDeviceOriginPoint(*args, **kwargs):
3790 """SetDeviceOriginPoint(self, Point point)"""
3791 return _gdi_.DC_SetDeviceOriginPoint(*args, **kwargs)
3792
e811c8ce 3793 def SetAxisOrientation(*args, **kwargs):
f5b96ee1
RD
3794 """
3795 SetAxisOrientation(self, bool xLeftRight, bool yBottomUp)
3796
3797 Sets the x and y axis orientation (i.e., the direction from lowest to
3798 highest values on the axis). The default orientation is the natural
3799 orientation, e.g. x axis from left to right and y axis from bottom up.
3800 """
54f9ee45 3801 return _gdi_.DC_SetAxisOrientation(*args, **kwargs)
e811c8ce
RD
3802
3803 def GetLogicalFunction(*args, **kwargs):
f5b96ee1
RD
3804 """
3805 GetLogicalFunction(self) -> int
3806
3807 Gets the current logical function (set by `SetLogicalFunction`).
3808 """
54f9ee45 3809 return _gdi_.DC_GetLogicalFunction(*args, **kwargs)
e811c8ce
RD
3810
3811 def SetLogicalFunction(*args, **kwargs):
f5b96ee1
RD
3812 """
3813 SetLogicalFunction(self, int function)
3814
3815 Sets the current logical function for the device context. This
3816 determines how a source pixel (from a pen or brush colour, or source
3817 device context if using `Blit`) combines with a destination pixel in
3818 the current device context.
3819
3820 The possible values and their meaning in terms of source and
3821 destination pixel values are as follows:
3822
3823 ================ ==========================
3824 wx.AND src AND dst
3825 wx.AND_INVERT (NOT src) AND dst
3826 wx.AND_REVERSE src AND (NOT dst)
3827 wx.CLEAR 0
3828 wx.COPY src
3829 wx.EQUIV (NOT src) XOR dst
3830 wx.INVERT NOT dst
3831 wx.NAND (NOT src) OR (NOT dst)
3832 wx.NOR (NOT src) AND (NOT dst)
3833 wx.NO_OP dst
3834 wx.OR src OR dst
3835 wx.OR_INVERT (NOT src) OR dst
3836 wx.OR_REVERSE src OR (NOT dst)
3837 wx.SET 1
3838 wx.SRC_INVERT NOT src
3839 wx.XOR src XOR dst
3840 ================ ==========================
3841
3842 The default is wx.COPY, which simply draws with the current
3843 colour. The others combine the current colour and the background using
3844 a logical operation. wx.INVERT is commonly used for drawing rubber
3845 bands or moving outlines, since drawing twice reverts to the original
3846 colour.
3847
3848 """
54f9ee45 3849 return _gdi_.DC_SetLogicalFunction(*args, **kwargs)
e811c8ce 3850
5cbf236d 3851 def ComputeScaleAndOrigin(*args, **kwargs):
f5b96ee1 3852 """
5cbf236d 3853 ComputeScaleAndOrigin(self)
f5b96ee1 3854
5cbf236d
RD
3855 Performs all necessary computations for given platform and context
3856 type after each change of scale and origin parameters. Usually called
3857 automatically internally after such changes.
f5b96ee1 3858
f5b96ee1 3859 """
5cbf236d 3860 return _gdi_.DC_ComputeScaleAndOrigin(*args, **kwargs)
e811c8ce 3861
5cbf236d
RD
3862 def SetOptimization(self, optimize):
3863 pass
3864 def GetOptimization(self):
3865 return False
f5b96ee1 3866
5cbf236d
RD
3867 SetOptimization = wx._deprecated(SetOptimization)
3868 GetOptimization = wx._deprecated(GetOptimization)
e811c8ce
RD
3869
3870 def CalcBoundingBox(*args, **kwargs):
f5b96ee1
RD
3871 """
3872 CalcBoundingBox(self, int x, int y)
3873
3874 Adds the specified point to the bounding box which can be retrieved
3875 with `MinX`, `MaxX` and `MinY`, `MaxY` or `GetBoundingBox` functions.
3876 """
54f9ee45 3877 return _gdi_.DC_CalcBoundingBox(*args, **kwargs)
e811c8ce 3878
03e37cd5 3879 def CalcBoundingBoxPoint(*args, **kwargs):
f5b96ee1
RD
3880 """
3881 CalcBoundingBoxPoint(self, Point point)
3882
3883 Adds the specified point to the bounding box which can be retrieved
3884 with `MinX`, `MaxX` and `MinY`, `MaxY` or `GetBoundingBox` functions.
3885 """
03e37cd5
RD
3886 return _gdi_.DC_CalcBoundingBoxPoint(*args, **kwargs)
3887
e811c8ce 3888 def ResetBoundingBox(*args, **kwargs):
f5b96ee1
RD
3889 """
3890 ResetBoundingBox(self)
3891
3892 Resets the bounding box: after a call to this function, the bounding
3893 box doesn't contain anything.
3894 """
54f9ee45 3895 return _gdi_.DC_ResetBoundingBox(*args, **kwargs)
e811c8ce
RD
3896
3897 def MinX(*args, **kwargs):
f5b96ee1
RD
3898 """
3899 MinX(self) -> int
3900
3901 Gets the minimum horizontal extent used in drawing commands so far.
3902 """
54f9ee45 3903 return _gdi_.DC_MinX(*args, **kwargs)
e811c8ce
RD
3904
3905 def MaxX(*args, **kwargs):
f5b96ee1
RD
3906 """
3907 MaxX(self) -> int
3908
3909 Gets the maximum horizontal extent used in drawing commands so far.
3910 """
54f9ee45 3911 return _gdi_.DC_MaxX(*args, **kwargs)
e811c8ce
RD
3912
3913 def MinY(*args, **kwargs):
f5b96ee1
RD
3914 """
3915 MinY(self) -> int
3916
3917 Gets the minimum vertical extent used in drawing commands so far.
3918 """
54f9ee45 3919 return _gdi_.DC_MinY(*args, **kwargs)
e811c8ce
RD
3920
3921 def MaxY(*args, **kwargs):
f5b96ee1
RD
3922 """
3923 MaxY(self) -> int
3924
3925 Gets the maximum vertical extent used in drawing commands so far.
3926 """
54f9ee45 3927 return _gdi_.DC_MaxY(*args, **kwargs)
e811c8ce
RD
3928
3929 def GetBoundingBox(*args, **kwargs):
f5b96ee1
RD
3930 """
3931 GetBoundingBox() -> (x1,y1, x2,y2)
3932
3933 Returns the min and max points used in drawing commands so far.
3934 """
54f9ee45 3935 return _gdi_.DC_GetBoundingBox(*args, **kwargs)
e811c8ce 3936
d14a1e28 3937 def __nonzero__(self): return self.Ok()
e811c8ce 3938 def _DrawPointList(*args, **kwargs):
a95a7133 3939 """_DrawPointList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
54f9ee45 3940 return _gdi_.DC__DrawPointList(*args, **kwargs)
e811c8ce
RD
3941
3942 def _DrawLineList(*args, **kwargs):
a95a7133 3943 """_DrawLineList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
54f9ee45 3944 return _gdi_.DC__DrawLineList(*args, **kwargs)
e811c8ce
RD
3945
3946 def _DrawRectangleList(*args, **kwargs):
a95a7133 3947 """_DrawRectangleList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
54f9ee45 3948 return _gdi_.DC__DrawRectangleList(*args, **kwargs)
e811c8ce
RD
3949
3950 def _DrawEllipseList(*args, **kwargs):
a95a7133 3951 """_DrawEllipseList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
54f9ee45 3952 return _gdi_.DC__DrawEllipseList(*args, **kwargs)
e811c8ce
RD
3953
3954 def _DrawPolygonList(*args, **kwargs):
a95a7133 3955 """_DrawPolygonList(self, PyObject pyCoords, PyObject pyPens, PyObject pyBrushes) -> PyObject"""
54f9ee45 3956 return _gdi_.DC__DrawPolygonList(*args, **kwargs)
e811c8ce
RD
3957
3958 def _DrawTextList(*args, **kwargs):
0df68c9f 3959 """
a95a7133 3960 _DrawTextList(self, PyObject textList, PyObject pyPoints, PyObject foregroundList,
0df68c9f
RD
3961 PyObject backgroundList) -> PyObject
3962 """
54f9ee45 3963 return _gdi_.DC__DrawTextList(*args, **kwargs)
e811c8ce 3964
3bcd5e1c 3965 def DrawPointList(self, points, pens=None):
f5b96ee1
RD
3966 """
3967 Draw a list of points as quickly as possible.
3968
3969 :param points: A sequence of 2-element sequences representing
3970 each point to draw, (x,y).
3971 :param pens: If None, then the current pen is used. If a
3972 single pen then it will be used for all points. If
3973 a list of pens then there should be one for each point
3974 in points.
3975 """
3bcd5e1c
RD
3976 if pens is None:
3977 pens = []
d14a1e28 3978 elif isinstance(pens, wx.Pen):
3bcd5e1c
RD
3979 pens = [pens]
3980 elif len(pens) != len(points):
3981 raise ValueError('points and pens must have same length')
b67a9327
RD
3982 return self._DrawPointList(points, pens, [])
3983
3bcd5e1c
RD
3984
3985 def DrawLineList(self, lines, pens=None):
f5b96ee1
RD
3986 """
3987 Draw a list of lines as quickly as possible.
3988
3989 :param lines: A sequence of 4-element sequences representing
3990 each line to draw, (x1,y1, x2,y2).
3991 :param pens: If None, then the current pen is used. If a
3992 single pen then it will be used for all lines. If
3993 a list of pens then there should be one for each line
3994 in lines.
3995 """
3bcd5e1c
RD
3996 if pens is None:
3997 pens = []
d14a1e28 3998 elif isinstance(pens, wx.Pen):
3bcd5e1c
RD
3999 pens = [pens]
4000 elif len(pens) != len(lines):
4001 raise ValueError('lines and pens must have same length')
b67a9327
RD
4002 return self._DrawLineList(lines, pens, [])
4003
4004
4005 def DrawRectangleList(self, rectangles, pens=None, brushes=None):
f5b96ee1
RD
4006 """
4007 Draw a list of rectangles as quickly as possible.
4008
4009 :param rectangles: A sequence of 4-element sequences representing
4010 each rectangle to draw, (x,y, w,h).
4011 :param pens: If None, then the current pen is used. If a
4012 single pen then it will be used for all rectangles.
4013 If a list of pens then there should be one for each
4014 rectangle in rectangles.
4015 :param brushes: A brush or brushes to be used to fill the rectagles,
4016 with similar semantics as the pens parameter.
4017 """
b67a9327
RD
4018 if pens is None:
4019 pens = []
d14a1e28 4020 elif isinstance(pens, wx.Pen):
b67a9327
RD
4021 pens = [pens]
4022 elif len(pens) != len(rectangles):
4023 raise ValueError('rectangles and pens must have same length')
4024 if brushes is None:
4025 brushes = []
d14a1e28 4026 elif isinstance(brushes, wx.Brush):
b67a9327
RD
4027 brushes = [brushes]
4028 elif len(brushes) != len(rectangles):
4029 raise ValueError('rectangles and brushes must have same length')
4030 return self._DrawRectangleList(rectangles, pens, brushes)
4031
4032
4033 def DrawEllipseList(self, ellipses, pens=None, brushes=None):
f5b96ee1
RD
4034 """
4035 Draw a list of ellipses as quickly as possible.
4036
4037 :param ellipses: A sequence of 4-element sequences representing
4038 each ellipse to draw, (x,y, w,h).
4039 :param pens: If None, then the current pen is used. If a
4040 single pen then it will be used for all ellipses.
4041 If a list of pens then there should be one for each
4042 ellipse in ellipses.
4043 :param brushes: A brush or brushes to be used to fill the ellipses,
4044 with similar semantics as the pens parameter.
4045 """
b67a9327
RD
4046 if pens is None:
4047 pens = []
d14a1e28 4048 elif isinstance(pens, wx.Pen):
b67a9327
RD
4049 pens = [pens]
4050 elif len(pens) != len(ellipses):
4051 raise ValueError('ellipses and pens must have same length')
4052 if brushes is None:
4053 brushes = []
d14a1e28 4054 elif isinstance(brushes, wx.Brush):
b67a9327
RD
4055 brushes = [brushes]
4056 elif len(brushes) != len(ellipses):
4057 raise ValueError('ellipses and brushes must have same length')
4058 return self._DrawEllipseList(ellipses, pens, brushes)
4059
4060
4061 def DrawPolygonList(self, polygons, pens=None, brushes=None):
f5b96ee1
RD
4062 """
4063 Draw a list of polygons, each of which is a list of points.
4064
4065 :param polygons: A sequence of sequences of sequences.
4066 [[(x1,y1),(x2,y2),(x3,y3)...],
4067 [(x1,y1),(x2,y2),(x3,y3)...]]
4068
4069 :param pens: If None, then the current pen is used. If a
4070 single pen then it will be used for all polygons.
4071 If a list of pens then there should be one for each
4072 polygon.
4073 :param brushes: A brush or brushes to be used to fill the polygons,
4074 with similar semantics as the pens parameter.
4075 """
b67a9327
RD
4076 if pens is None:
4077 pens = []
d14a1e28 4078 elif isinstance(pens, wx.Pen):
b67a9327
RD
4079 pens = [pens]
4080 elif len(pens) != len(polygons):
4081 raise ValueError('polygons and pens must have same length')
4082 if brushes is None:
4083 brushes = []
d14a1e28 4084 elif isinstance(brushes, wx.Brush):
b67a9327
RD
4085 brushes = [brushes]
4086 elif len(brushes) != len(polygons):
4087 raise ValueError('polygons and brushes must have same length')
4088 return self._DrawPolygonList(polygons, pens, brushes)
4089
4090
f5b96ee1
RD
4091 def DrawTextList(self, textList, coords, foregrounds = None, backgrounds = None):
4092 """
4093 Draw a list of strings using a list of coordinants for positioning each string.
4094
4095 :param textList: A list of strings
4096 :param coords: A list of (x,y) positions
4097 :param foregrounds: A list of `wx.Colour` objects to use for the
4098 foregrounds of the strings.
4099 :param backgrounds: A list of `wx.Colour` objects to use for the
4100 backgrounds of the strings.
4101
4102 NOTE: Make sure you set Background mode to wx.Solid (DC.SetBackgroundMode)
4103 If you want backgrounds to do anything.
4104 """
b67a9327
RD
4105 if type(textList) == type(''):
4106 textList = [textList]
4107 elif len(textList) != len(coords):
4108 raise ValueError('textlist and coords must have same length')
4109 if foregrounds is None:
4110 foregrounds = []
fd3f2efe 4111 elif isinstance(foregrounds, wx.Colour):
b67a9327
RD
4112 foregrounds = [foregrounds]
4113 elif len(foregrounds) != len(coords):
4114 raise ValueError('foregrounds and coords must have same length')
4115 if backgrounds is None:
4116 backgrounds = []
fd3f2efe 4117 elif isinstance(backgrounds, wx.Colour):
b67a9327
RD
4118 backgrounds = [backgrounds]
4119 elif len(backgrounds) != len(coords):
4120 raise ValueError('backgrounds and coords must have same length')
4121 return self._DrawTextList(textList, coords, foregrounds, backgrounds)
3bcd5e1c 4122
70551f47 4123
d14a1e28
RD
4124class DCPtr(DC):
4125 def __init__(self, this):
4126 self.this = this
4127 if not hasattr(self,"thisown"): self.thisown = 0
4128 self.__class__ = DC
54f9ee45 4129_gdi_.DC_swigregister(DCPtr)
70551f47 4130
d14a1e28 4131#---------------------------------------------------------------------------
70551f47 4132
d14a1e28 4133class MemoryDC(DC):
f5b96ee1
RD
4134 """
4135 A memory device context provides a means to draw graphics onto a
4136 bitmap. A bitmap must be selected into the new memory DC before it may
4137 be used for anything. Typical usage is as follows::
4138
4139 dc = wx.MemoryDC()
4140 dc.SelectObject(bitmap)
4141 # draw on the dc usign any of the Draw methods
4142 dc.SelectObject(wx.NullBitmap)
4143 # the bitmap now contains wahtever was drawn upon it
4144
4145 Note that the memory DC *must* be deleted (or the bitmap selected out
4146 of it) before a bitmap can be reselected into another memory DC.
4147
4148 """
e811c8ce
RD
4149 def __repr__(self):
4150 return "<%s.%s; proxy of C++ wxMemoryDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4151 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4152 """
4153 __init__(self) -> MemoryDC
4154
4155 Constructs a new memory device context.
4156
4157 Use the Ok member to test whether the constructor was successful in
4158 creating a usable device context. Don't forget to select a bitmap into
4159 the DC before drawing on it.
4160 """
54f9ee45 4161 newobj = _gdi_.new_MemoryDC(*args, **kwargs)
d14a1e28 4162 self.this = newobj.this
70551f47 4163 self.thisown = 1
d14a1e28 4164 del newobj.thisown
e811c8ce 4165 def SelectObject(*args, **kwargs):
f5b96ee1
RD
4166 """
4167 SelectObject(self, Bitmap bitmap)
4168
4169 Selects the bitmap into the device context, to use as the memory
4170 bitmap. Selecting the bitmap into a memory DC allows you to draw into
4171 the DC, and therefore the bitmap, and also to use Blit to copy the
4172 bitmap to a window.
4173
4174 If the argument is wx.NullBitmap (or some other uninitialised
4175 `wx.Bitmap`) the current bitmap is selected out of the device context,
4176 and the original bitmap restored, allowing the current bitmap to be
4177 destroyed safely.
4178 """
54f9ee45 4179 return _gdi_.MemoryDC_SelectObject(*args, **kwargs)
e811c8ce 4180
70551f47 4181
d14a1e28
RD
4182class MemoryDCPtr(MemoryDC):
4183 def __init__(self, this):
4184 self.this = this
4185 if not hasattr(self,"thisown"): self.thisown = 0
4186 self.__class__ = MemoryDC
54f9ee45 4187_gdi_.MemoryDC_swigregister(MemoryDCPtr)
70551f47 4188
d14a1e28 4189def MemoryDCFromDC(*args, **kwargs):
f5b96ee1
RD
4190 """
4191 MemoryDCFromDC(DC oldDC) -> MemoryDC
4192
4193 Creates a DC that is compatible with the oldDC.
4194 """
54f9ee45 4195 val = _gdi_.new_MemoryDCFromDC(*args, **kwargs)
d14a1e28
RD
4196 val.thisown = 1
4197 return val
70551f47 4198
d14a1e28 4199#---------------------------------------------------------------------------
70551f47 4200
e2950dbb
RD
4201BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
4202BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
d14a1e28 4203class BufferedDC(MemoryDC):
f5b96ee1
RD
4204 """
4205 This simple class provides a simple way to avoid flicker: when drawing
4206 on it, everything is in fact first drawn on an in-memory buffer (a
4207 `wx.Bitmap`) and then copied to the screen only once, when this object
4208 is destroyed.
4209
4210 It can be used in the same way as any other device
4211 context. wx.BufferedDC itself typically replaces `wx.ClientDC`, if you
4212 want to use it in your EVT_PAINT handler, you should look at
4213 `wx.BufferedPaintDC`.
4214
4215 """
e811c8ce
RD
4216 def __repr__(self):
4217 return "<%s.%s; proxy of C++ wxBufferedDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3adfb63b
RD
4218 def __init__(self, *args):
4219 """
8f4d7c19 4220 __init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
e2950dbb 4221 __init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
f5b96ee1
RD
4222
4223 Constructs a buffered DC.
3adfb63b 4224 """
54f9ee45 4225 newobj = _gdi_.new_BufferedDC(*args)
d14a1e28 4226 self.this = newobj.this
a884bee5 4227 self.thisown = 1
d14a1e28 4228 del newobj.thisown
f5b96ee1 4229 self.__dc = args[0] # save a ref so the other dc will not be deleted before self
e811c8ce 4230
54f9ee45 4231 def __del__(self, destroy=_gdi_.delete_BufferedDC):
f5b96ee1
RD
4232 """
4233 __del__(self)
4234
4235 Copies everything drawn on the DC so far to the underlying DC
4236 associated with this object, if any.
4237 """
e498079e
RD
4238 try:
4239 if self.thisown: destroy(self)
4240 except: pass
4241
e811c8ce 4242 def UnMask(*args, **kwargs):
f5b96ee1
RD
4243 """
4244 UnMask(self)
4245
4246 Blits the buffer to the dc, and detaches the dc from the buffer (so it
4247 can be effectively used once only). This is usually only called in
4248 the destructor.
4249 """
54f9ee45 4250 return _gdi_.BufferedDC_UnMask(*args, **kwargs)
e811c8ce 4251
a884bee5 4252
d14a1e28
RD
4253class BufferedDCPtr(BufferedDC):
4254 def __init__(self, this):
4255 self.this = this
4256 if not hasattr(self,"thisown"): self.thisown = 0
4257 self.__class__ = BufferedDC
54f9ee45 4258_gdi_.BufferedDC_swigregister(BufferedDCPtr)
a884bee5 4259
d14a1e28 4260class BufferedPaintDC(BufferedDC):
f5b96ee1
RD
4261 """
4262 This is a subclass of `wx.BufferedDC` which can be used inside of an
4263 EVT_PAINT event handler. Just create an object of this class instead
4264 of `wx.PaintDC` and that's all you have to do to (mostly) avoid
4265 flicker. The only thing to watch out for is that if you are using this
4266 class together with `wx.ScrolledWindow`, you probably do **not** want
4267 to call `wx.Window.PrepareDC` on it as it already does this internally
4268 for the real underlying `wx.PaintDC`.
4269
4270 If your window is already fully buffered in a `wx.Bitmap` then your
4271 EVT_PAINT handler can be as simple as just creating a
4272 ``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
4273 automatically when it is destroyed. For example::
4274
4275 def OnPaint(self, event):
4276 dc = wx.BufferedPaintDC(self, self.buffer)
4277
4278
4279
e2950dbb
RD
4280
4281
f5b96ee1 4282 """
e811c8ce
RD
4283 def __repr__(self):
4284 return "<%s.%s; proxy of C++ wxBufferedPaintDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e498079e 4285 def __init__(self, *args, **kwargs):
f5b96ee1 4286 """
e2950dbb 4287 __init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
f5b96ee1
RD
4288
4289 Create a buffered paint DC. As with `wx.BufferedDC`, you may either
4290 provide the bitmap to be used for buffering or let this object create
4291 one internally (in the latter case, the size of the client part of the
4292 window is automatically used).
4293
4294
4295 """
54f9ee45 4296 newobj = _gdi_.new_BufferedPaintDC(*args, **kwargs)
d14a1e28 4297 self.this = newobj.this
a884bee5 4298 self.thisown = 1
d14a1e28 4299 del newobj.thisown
a884bee5 4300
d14a1e28
RD
4301class BufferedPaintDCPtr(BufferedPaintDC):
4302 def __init__(self, this):
4303 self.this = this
4304 if not hasattr(self,"thisown"): self.thisown = 0
4305 self.__class__ = BufferedPaintDC
54f9ee45 4306_gdi_.BufferedPaintDC_swigregister(BufferedPaintDCPtr)
a884bee5 4307
d14a1e28 4308#---------------------------------------------------------------------------
a884bee5 4309
d14a1e28 4310class ScreenDC(DC):
f5b96ee1
RD
4311 """
4312 A wxScreenDC can be used to paint anywhere on the screen. This should
4313 normally be constructed as a temporary stack object; don't store a
4314 wxScreenDC object.
4315
4316 """
e811c8ce
RD
4317 def __repr__(self):
4318 return "<%s.%s; proxy of C++ wxScreenDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4319 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4320 """
4321 __init__(self) -> ScreenDC
4322
4323 A wxScreenDC can be used to paint anywhere on the screen. This should
4324 normally be constructed as a temporary stack object; don't store a
4325 wxScreenDC object.
4326
4327 """
54f9ee45 4328 newobj = _gdi_.new_ScreenDC(*args, **kwargs)
d14a1e28 4329 self.this = newobj.this
70551f47 4330 self.thisown = 1
d14a1e28 4331 del newobj.thisown
e811c8ce 4332 def StartDrawingOnTopWin(*args, **kwargs):
f5b96ee1
RD
4333 """
4334 StartDrawingOnTopWin(self, Window window) -> bool
4335
4336 Specify that the area of the screen to be drawn upon coincides with
4337 the given window.
4338
4339 :see: `EndDrawingOnTop`
4340 """
54f9ee45 4341 return _gdi_.ScreenDC_StartDrawingOnTopWin(*args, **kwargs)
e811c8ce
RD
4342
4343 def StartDrawingOnTop(*args, **kwargs):
f5b96ee1
RD
4344 """
4345 StartDrawingOnTop(self, Rect rect=None) -> bool
4346
4347 Specify that the area is the given rectangle, or the whole screen if
4348 ``None`` is passed.
4349
4350 :see: `EndDrawingOnTop`
4351 """
54f9ee45 4352 return _gdi_.ScreenDC_StartDrawingOnTop(*args, **kwargs)
e811c8ce
RD
4353
4354 def EndDrawingOnTop(*args, **kwargs):
f5b96ee1
RD
4355 """
4356 EndDrawingOnTop(self) -> bool
4357
4358 Use this in conjunction with `StartDrawingOnTop` or
4359 `StartDrawingOnTopWin` to ensure that drawing to the screen occurs on
4360 top of existing windows. Without this, some window systems (such as X)
4361 only allow drawing to take place underneath other windows.
4362
4363 You might use this pair of functions when implementing a drag feature,
4364 for example as in the `wx.SplitterWindow` implementation.
4365
4366 These functions are probably obsolete since the X implementations
4367 allow drawing directly on the screen now. However, the fact that this
4368 function allows the screen to be refreshed afterwards may be useful
4369 to some applications.
4370 """
54f9ee45 4371 return _gdi_.ScreenDC_EndDrawingOnTop(*args, **kwargs)
e811c8ce 4372
70551f47 4373
d14a1e28
RD
4374class ScreenDCPtr(ScreenDC):
4375 def __init__(self, this):
4376 self.this = this
4377 if not hasattr(self,"thisown"): self.thisown = 0
4378 self.__class__ = ScreenDC
54f9ee45 4379_gdi_.ScreenDC_swigregister(ScreenDCPtr)
70551f47 4380
d14a1e28 4381#---------------------------------------------------------------------------
70551f47 4382
d14a1e28 4383class ClientDC(DC):
f5b96ee1
RD
4384 """
4385 A wx.ClientDC must be constructed if an application wishes to paint on
4386 the client area of a window from outside an EVT_PAINT event. This should
4387 normally be constructed as a temporary stack object; don't store a
4388 wx.ClientDC object long term.
4389
4390 To draw on a window from within an EVT_PAINT handler, construct a
4391 `wx.PaintDC` object.
4392
4393 To draw on the whole window including decorations, construct a
4394 `wx.WindowDC` object (Windows only).
4395
4396 """
e811c8ce
RD
4397 def __repr__(self):
4398 return "<%s.%s; proxy of C++ wxClientDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4399 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4400 """
4401 __init__(self, Window win) -> ClientDC
4402
4403 Constructor. Pass the window on which you wish to paint.
4404 """
54f9ee45 4405 newobj = _gdi_.new_ClientDC(*args, **kwargs)
d14a1e28 4406 self.this = newobj.this
70551f47 4407 self.thisown = 1
d14a1e28 4408 del newobj.thisown
70551f47 4409
d14a1e28
RD
4410class ClientDCPtr(ClientDC):
4411 def __init__(self, this):
4412 self.this = this
4413 if not hasattr(self,"thisown"): self.thisown = 0
4414 self.__class__ = ClientDC
54f9ee45 4415_gdi_.ClientDC_swigregister(ClientDCPtr)
70551f47 4416
d14a1e28 4417#---------------------------------------------------------------------------
70551f47 4418
d14a1e28 4419class PaintDC(DC):
f5b96ee1
RD
4420 """
4421 A wx.PaintDC must be constructed if an application wishes to paint on
4422 the client area of a window from within an EVT_PAINT event
4423 handler. This should normally be constructed as a temporary stack
4424 object; don't store a wx.PaintDC object. If you have an EVT_PAINT
4425 handler, you **must** create a wx.PaintDC object within it even if you
4426 don't actually use it.
4427
4428 Using wx.PaintDC within EVT_PAINT handlers is important because it
4429 automatically sets the clipping area to the damaged area of the
4430 window. Attempts to draw outside this area do not appear.
4431
4432 To draw on a window from outside EVT_PAINT handlers, construct a
4433 `wx.ClientDC` object.
4434
4435 """
e811c8ce
RD
4436 def __repr__(self):
4437 return "<%s.%s; proxy of C++ wxPaintDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4438 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4439 """
4440 __init__(self, Window win) -> PaintDC
4441
4442 Constructor. Pass the window on which you wish to paint.
4443 """
54f9ee45 4444 newobj = _gdi_.new_PaintDC(*args, **kwargs)
d14a1e28 4445 self.this = newobj.this
70551f47 4446 self.thisown = 1
d14a1e28 4447 del newobj.thisown
70551f47 4448
d14a1e28
RD
4449class PaintDCPtr(PaintDC):
4450 def __init__(self, this):
4451 self.this = this
4452 if not hasattr(self,"thisown"): self.thisown = 0
4453 self.__class__ = PaintDC
54f9ee45 4454_gdi_.PaintDC_swigregister(PaintDCPtr)
70551f47 4455
d14a1e28 4456#---------------------------------------------------------------------------
70551f47 4457
d14a1e28 4458class WindowDC(DC):
f5b96ee1
RD
4459 """
4460 A wx.WindowDC must be constructed if an application wishes to paint on
4461 the whole area of a window (client and decorations). This should
4462 normally be constructed as a temporary stack object; don't store a
4463 wx.WindowDC object.
4464 """
e811c8ce
RD
4465 def __repr__(self):
4466 return "<%s.%s; proxy of C++ wxWindowDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4467 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4468 """
4469 __init__(self, Window win) -> WindowDC
4470
4471 Constructor. Pass the window on which you wish to paint.
4472 """
54f9ee45 4473 newobj = _gdi_.new_WindowDC(*args, **kwargs)
d14a1e28 4474 self.this = newobj.this
c95e68d8 4475 self.thisown = 1
d14a1e28 4476 del newobj.thisown
c95e68d8 4477
d14a1e28
RD
4478class WindowDCPtr(WindowDC):
4479 def __init__(self, this):
4480 self.this = this
4481 if not hasattr(self,"thisown"): self.thisown = 0
4482 self.__class__ = WindowDC
54f9ee45 4483_gdi_.WindowDC_swigregister(WindowDCPtr)
c95e68d8 4484
d14a1e28 4485#---------------------------------------------------------------------------
c95e68d8 4486
d14a1e28 4487class MirrorDC(DC):
f5b96ee1
RD
4488 """
4489 wx.MirrorDC is a simple wrapper class which is always associated with a
4490 real `wx.DC` object and either forwards all of its operations to it
4491 without changes (no mirroring takes place) or exchanges x and y
4492 coordinates which makes it possible to reuse the same code to draw a
4493 figure and its mirror -- i.e. reflection related to the diagonal line
4494 x == y.
4495 """
e811c8ce
RD
4496 def __repr__(self):
4497 return "<%s.%s; proxy of C++ wxMirrorDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4498 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4499 """
4500 __init__(self, DC dc, bool mirror) -> MirrorDC
4501
4502 Creates a mirrored DC associated with the real *dc*. Everything drawn
4503 on the wx.MirrorDC will appear on the *dc*, and will be mirrored if
4504 *mirror* is True.
4505 """
54f9ee45 4506 newobj = _gdi_.new_MirrorDC(*args, **kwargs)
d14a1e28 4507 self.this = newobj.this
3ef86e32 4508 self.thisown = 1
d14a1e28 4509 del newobj.thisown
3ef86e32 4510
d14a1e28
RD
4511class MirrorDCPtr(MirrorDC):
4512 def __init__(self, this):
4513 self.this = this
4514 if not hasattr(self,"thisown"): self.thisown = 0
4515 self.__class__ = MirrorDC
54f9ee45 4516_gdi_.MirrorDC_swigregister(MirrorDCPtr)
3ef86e32 4517
d14a1e28 4518#---------------------------------------------------------------------------
3ef86e32 4519
d14a1e28 4520class PostScriptDC(DC):
f5b96ee1 4521 """This is a `wx.DC` that can write to PostScript files on any platform."""
e811c8ce
RD
4522 def __repr__(self):
4523 return "<%s.%s; proxy of C++ wxPostScriptDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4524 def __init__(self, *args, **kwargs):
f5b96ee1
RD
4525 """
4526 __init__(self, wxPrintData printData) -> PostScriptDC
4527
4528 Constructs a PostScript printer device context from a `wx.PrintData`
4529 object.
4530 """
54f9ee45 4531 newobj = _gdi_.new_PostScriptDC(*args, **kwargs)
d14a1e28
RD
4532 self.this = newobj.this
4533 self.thisown = 1
4534 del newobj.thisown
e811c8ce 4535 def GetPrintData(*args, **kwargs):
a95a7133 4536 """GetPrintData(self) -> wxPrintData"""
54f9ee45 4537 return _gdi_.PostScriptDC_GetPrintData(*args, **kwargs)
e811c8ce
RD
4538
4539 def SetPrintData(*args, **kwargs):
a95a7133 4540 """SetPrintData(self, wxPrintData data)"""
54f9ee45 4541 return _gdi_.PostScriptDC_SetPrintData(*args, **kwargs)
e811c8ce
RD
4542
4543 def SetResolution(*args, **kwargs):
f5b96ee1
RD
4544 """
4545 SetResolution(int ppi)
4546
4547 Set resolution (in pixels per inch) that will be used in PostScript
4548 output. Default is 720ppi.
4549 """
54f9ee45 4550 return _gdi_.PostScriptDC_SetResolution(*args, **kwargs)
e811c8ce
RD
4551
4552 SetResolution = staticmethod(SetResolution)
4553 def GetResolution(*args, **kwargs):
f5b96ee1
RD
4554 """
4555 GetResolution() -> int
4556
4557 Return resolution used in PostScript output.
4558 """
54f9ee45 4559 return _gdi_.PostScriptDC_GetResolution(*args, **kwargs)
e811c8ce
RD
4560
4561 GetResolution = staticmethod(GetResolution)
3ef86e32 4562
d14a1e28
RD
4563class PostScriptDCPtr(PostScriptDC):
4564 def __init__(self, this):
105e45b9 4565 self.this = this
d14a1e28
RD
4566 if not hasattr(self,"thisown"): self.thisown = 0
4567 self.__class__ = PostScriptDC
54f9ee45 4568_gdi_.PostScriptDC_swigregister(PostScriptDCPtr)
105e45b9 4569
e811c8ce 4570def PostScriptDC_SetResolution(*args, **kwargs):
f5b96ee1
RD
4571 """
4572 PostScriptDC_SetResolution(int ppi)
4573
4574 Set resolution (in pixels per inch) that will be used in PostScript
4575 output. Default is 720ppi.
4576 """
54f9ee45 4577 return _gdi_.PostScriptDC_SetResolution(*args, **kwargs)
105e45b9 4578
e811c8ce 4579def PostScriptDC_GetResolution(*args, **kwargs):
f5b96ee1
RD
4580 """
4581 PostScriptDC_GetResolution() -> int
4582
4583 Return resolution used in PostScript output.
4584 """
54f9ee45 4585 return _gdi_.PostScriptDC_GetResolution(*args, **kwargs)
105e45b9 4586
d14a1e28 4587#---------------------------------------------------------------------------
105e45b9 4588
54f9ee45 4589class MetaFile(_core.Object):
093d3ff1 4590 """Proxy of C++ MetaFile class"""
e811c8ce
RD
4591 def __repr__(self):
4592 return "<%s.%s; proxy of C++ wxMetaFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4593 def __init__(self, *args, **kwargs):
a95a7133 4594 """__init__(self, String filename=EmptyString) -> MetaFile"""
54f9ee45 4595 newobj = _gdi_.new_MetaFile(*args, **kwargs)
d14a1e28 4596 self.this = newobj.this
21f8d7ea 4597 self.thisown = 1
d14a1e28 4598 del newobj.thisown
21f8d7ea 4599
d14a1e28
RD
4600class MetaFilePtr(MetaFile):
4601 def __init__(self, this):
9df61a29 4602 self.this = this
d14a1e28
RD
4603 if not hasattr(self,"thisown"): self.thisown = 0
4604 self.__class__ = MetaFile
54f9ee45 4605_gdi_.MetaFile_swigregister(MetaFilePtr)
d14a1e28
RD
4606
4607class MetaFileDC(DC):
093d3ff1 4608 """Proxy of C++ MetaFileDC class"""
e811c8ce
RD
4609 def __repr__(self):
4610 return "<%s.%s; proxy of C++ wxMetaFileDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4611 def __init__(self, *args, **kwargs):
0df68c9f 4612 """
a95a7133 4613 __init__(self, String filename=EmptyString, int width=0, int height=0,
196addbf 4614 String description=EmptyString) -> MetaFileDC
0df68c9f 4615 """
54f9ee45 4616 newobj = _gdi_.new_MetaFileDC(*args, **kwargs)
d14a1e28 4617 self.this = newobj.this
9df61a29 4618 self.thisown = 1
d14a1e28 4619 del newobj.thisown
9df61a29 4620
d14a1e28
RD
4621class MetaFileDCPtr(MetaFileDC):
4622 def __init__(self, this):
9df61a29 4623 self.this = this
d14a1e28
RD
4624 if not hasattr(self,"thisown"): self.thisown = 0
4625 self.__class__ = MetaFileDC
54f9ee45 4626_gdi_.MetaFileDC_swigregister(MetaFileDCPtr)
d14a1e28
RD
4627
4628class PrinterDC(DC):
093d3ff1 4629 """Proxy of C++ PrinterDC class"""
e811c8ce
RD
4630 def __repr__(self):
4631 return "<%s.%s; proxy of C++ wxPrinterDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4632 def __init__(self, *args, **kwargs):
a95a7133 4633 """__init__(self, wxPrintData printData) -> PrinterDC"""
54f9ee45 4634 newobj = _gdi_.new_PrinterDC(*args, **kwargs)
d14a1e28 4635 self.this = newobj.this
9df61a29 4636 self.thisown = 1
d14a1e28 4637 del newobj.thisown
9df61a29 4638
d14a1e28
RD
4639class PrinterDCPtr(PrinterDC):
4640 def __init__(self, this):
4641 self.this = this
4642 if not hasattr(self,"thisown"): self.thisown = 0
4643 self.__class__ = PrinterDC
54f9ee45 4644_gdi_.PrinterDC_swigregister(PrinterDCPtr)
d14a1e28
RD
4645
4646#---------------------------------------------------------------------------
4647
54f9ee45
RD
4648IMAGELIST_DRAW_NORMAL = _gdi_.IMAGELIST_DRAW_NORMAL
4649IMAGELIST_DRAW_TRANSPARENT = _gdi_.IMAGELIST_DRAW_TRANSPARENT
4650IMAGELIST_DRAW_SELECTED = _gdi_.IMAGELIST_DRAW_SELECTED
4651IMAGELIST_DRAW_FOCUSED = _gdi_.IMAGELIST_DRAW_FOCUSED
4652IMAGE_LIST_NORMAL = _gdi_.IMAGE_LIST_NORMAL
4653IMAGE_LIST_SMALL = _gdi_.IMAGE_LIST_SMALL
4654IMAGE_LIST_STATE = _gdi_.IMAGE_LIST_STATE
4655class ImageList(_core.Object):
093d3ff1 4656 """Proxy of C++ ImageList class"""
e811c8ce
RD
4657 def __repr__(self):
4658 return "<%s.%s; proxy of C++ wxImageList instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4659 def __init__(self, *args, **kwargs):
a95a7133 4660 """__init__(self, int width, int height, int mask=True, int initialCount=1) -> ImageList"""
54f9ee45 4661 newobj = _gdi_.new_ImageList(*args, **kwargs)
d14a1e28
RD
4662 self.this = newobj.this
4663 self.thisown = 1
4664 del newobj.thisown
54f9ee45 4665 def __del__(self, destroy=_gdi_.delete_ImageList):
a95a7133 4666 """__del__(self)"""
d14a1e28
RD
4667 try:
4668 if self.thisown: destroy(self)
4669 except: pass
e811c8ce
RD
4670
4671 def Add(*args, **kwargs):
a95a7133 4672 """Add(self, Bitmap bitmap, Bitmap mask=NullBitmap) -> int"""
54f9ee45 4673 return _gdi_.ImageList_Add(*args, **kwargs)
e811c8ce
RD
4674
4675 def AddWithColourMask(*args, **kwargs):
a95a7133 4676 """AddWithColourMask(self, Bitmap bitmap, Colour maskColour) -> int"""
54f9ee45 4677 return _gdi_.ImageList_AddWithColourMask(*args, **kwargs)
e811c8ce
RD
4678
4679 def AddIcon(*args, **kwargs):
a95a7133 4680 """AddIcon(self, Icon icon) -> int"""
54f9ee45 4681 return _gdi_.ImageList_AddIcon(*args, **kwargs)
e811c8ce 4682
b9d6a5f3
RD
4683 def GetBitmap(*args, **kwargs):
4684 """GetBitmap(self, int index) -> Bitmap"""
4685 return _gdi_.ImageList_GetBitmap(*args, **kwargs)
4686
4687 def GetIcon(*args, **kwargs):
4688 """GetIcon(self, int index) -> Icon"""
4689 return _gdi_.ImageList_GetIcon(*args, **kwargs)
4690
e811c8ce 4691 def Replace(*args, **kwargs):
a95a7133 4692 """Replace(self, int index, Bitmap bitmap) -> bool"""
54f9ee45 4693 return _gdi_.ImageList_Replace(*args, **kwargs)
e811c8ce
RD
4694
4695 def Draw(*args, **kwargs):
0df68c9f 4696 """
a95a7133 4697 Draw(self, int index, DC dc, int x, int x, int flags=IMAGELIST_DRAW_NORMAL,
0df68c9f
RD
4698 bool solidBackground=False) -> bool
4699 """
54f9ee45 4700 return _gdi_.ImageList_Draw(*args, **kwargs)
e811c8ce
RD
4701
4702 def GetImageCount(*args, **kwargs):
a95a7133 4703 """GetImageCount(self) -> int"""
54f9ee45 4704 return _gdi_.ImageList_GetImageCount(*args, **kwargs)
e811c8ce
RD
4705
4706 def Remove(*args, **kwargs):
a95a7133 4707 """Remove(self, int index) -> bool"""
54f9ee45 4708 return _gdi_.ImageList_Remove(*args, **kwargs)
e811c8ce
RD
4709
4710 def RemoveAll(*args, **kwargs):
a95a7133 4711 """RemoveAll(self) -> bool"""
54f9ee45 4712 return _gdi_.ImageList_RemoveAll(*args, **kwargs)
e811c8ce
RD
4713
4714 def GetSize(*args, **kwargs):
322913ce 4715 """GetSize() -> (width,height)"""
54f9ee45 4716 return _gdi_.ImageList_GetSize(*args, **kwargs)
e811c8ce 4717
9df61a29 4718
d14a1e28
RD
4719class ImageListPtr(ImageList):
4720 def __init__(self, this):
4721 self.this = this
4722 if not hasattr(self,"thisown"): self.thisown = 0
4723 self.__class__ = ImageList
54f9ee45 4724_gdi_.ImageList_swigregister(ImageListPtr)
d14a1e28
RD
4725
4726#---------------------------------------------------------------------------
4727
54f9ee45 4728class PenList(_core.Object):
093d3ff1 4729 """Proxy of C++ PenList class"""
d14a1e28
RD
4730 def __init__(self): raise RuntimeError, "No constructor defined"
4731 def __repr__(self):
4732 return "<%s.%s; proxy of C++ wxPenList instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4733 def AddPen(*args, **kwargs):
a95a7133 4734 """AddPen(self, Pen pen)"""
54f9ee45 4735 return _gdi_.PenList_AddPen(*args, **kwargs)
e811c8ce
RD
4736
4737 def FindOrCreatePen(*args, **kwargs):
a95a7133 4738 """FindOrCreatePen(self, Colour colour, int width, int style) -> Pen"""
54f9ee45 4739 return _gdi_.PenList_FindOrCreatePen(*args, **kwargs)
e811c8ce
RD
4740
4741 def RemovePen(*args, **kwargs):
a95a7133 4742 """RemovePen(self, Pen pen)"""
54f9ee45 4743 return _gdi_.PenList_RemovePen(*args, **kwargs)
e811c8ce
RD
4744
4745 def GetCount(*args, **kwargs):
a95a7133 4746 """GetCount(self) -> int"""
54f9ee45 4747 return _gdi_.PenList_GetCount(*args, **kwargs)
e811c8ce 4748
9df61a29 4749
d14a1e28
RD
4750class PenListPtr(PenList):
4751 def __init__(self, this):
4752 self.this = this
4753 if not hasattr(self,"thisown"): self.thisown = 0
4754 self.__class__ = PenList
54f9ee45
RD
4755_gdi_.PenList_swigregister(PenListPtr)
4756cvar = _gdi_.cvar
994141e6
RD
4757NORMAL_FONT = cvar.NORMAL_FONT
4758SMALL_FONT = cvar.SMALL_FONT
4759ITALIC_FONT = cvar.ITALIC_FONT
4760SWISS_FONT = cvar.SWISS_FONT
4761RED_PEN = cvar.RED_PEN
4762CYAN_PEN = cvar.CYAN_PEN
4763GREEN_PEN = cvar.GREEN_PEN
4764BLACK_PEN = cvar.BLACK_PEN
4765WHITE_PEN = cvar.WHITE_PEN
4766TRANSPARENT_PEN = cvar.TRANSPARENT_PEN
4767BLACK_DASHED_PEN = cvar.BLACK_DASHED_PEN
4768GREY_PEN = cvar.GREY_PEN
4769MEDIUM_GREY_PEN = cvar.MEDIUM_GREY_PEN
4770LIGHT_GREY_PEN = cvar.LIGHT_GREY_PEN
4771BLUE_BRUSH = cvar.BLUE_BRUSH
4772GREEN_BRUSH = cvar.GREEN_BRUSH
4773WHITE_BRUSH = cvar.WHITE_BRUSH
4774BLACK_BRUSH = cvar.BLACK_BRUSH
4775TRANSPARENT_BRUSH = cvar.TRANSPARENT_BRUSH
4776CYAN_BRUSH = cvar.CYAN_BRUSH
4777RED_BRUSH = cvar.RED_BRUSH
4778GREY_BRUSH = cvar.GREY_BRUSH
4779MEDIUM_GREY_BRUSH = cvar.MEDIUM_GREY_BRUSH
4780LIGHT_GREY_BRUSH = cvar.LIGHT_GREY_BRUSH
4781BLACK = cvar.BLACK
4782WHITE = cvar.WHITE
4783RED = cvar.RED
4784BLUE = cvar.BLUE
4785GREEN = cvar.GREEN
4786CYAN = cvar.CYAN
4787LIGHT_GREY = cvar.LIGHT_GREY
4788STANDARD_CURSOR = cvar.STANDARD_CURSOR
4789HOURGLASS_CURSOR = cvar.HOURGLASS_CURSOR
4790CROSS_CURSOR = cvar.CROSS_CURSOR
4791NullBitmap = cvar.NullBitmap
4792NullIcon = cvar.NullIcon
4793NullCursor = cvar.NullCursor
4794NullPen = cvar.NullPen
4795NullBrush = cvar.NullBrush
4796NullPalette = cvar.NullPalette
4797NullFont = cvar.NullFont
4798NullColour = cvar.NullColour
d14a1e28 4799
54f9ee45 4800class BrushList(_core.Object):
093d3ff1 4801 """Proxy of C++ BrushList class"""
d14a1e28
RD
4802 def __init__(self): raise RuntimeError, "No constructor defined"
4803 def __repr__(self):
4804 return "<%s.%s; proxy of C++ wxBrushList instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4805 def AddBrush(*args, **kwargs):
a95a7133 4806 """AddBrush(self, Brush brush)"""
54f9ee45 4807 return _gdi_.BrushList_AddBrush(*args, **kwargs)
e811c8ce
RD
4808
4809 def FindOrCreateBrush(*args, **kwargs):
61d07ac7 4810 """FindOrCreateBrush(self, Colour colour, int style=SOLID) -> Brush"""
54f9ee45 4811 return _gdi_.BrushList_FindOrCreateBrush(*args, **kwargs)
e811c8ce
RD
4812
4813 def RemoveBrush(*args, **kwargs):
a95a7133 4814 """RemoveBrush(self, Brush brush)"""
54f9ee45 4815 return _gdi_.BrushList_RemoveBrush(*args, **kwargs)
e811c8ce
RD
4816
4817 def GetCount(*args, **kwargs):
a95a7133 4818 """GetCount(self) -> int"""
54f9ee45 4819 return _gdi_.BrushList_GetCount(*args, **kwargs)
e811c8ce 4820
9df61a29 4821
d14a1e28
RD
4822class BrushListPtr(BrushList):
4823 def __init__(self, this):
4824 self.this = this
4825 if not hasattr(self,"thisown"): self.thisown = 0
4826 self.__class__ = BrushList
54f9ee45 4827_gdi_.BrushList_swigregister(BrushListPtr)
d14a1e28 4828
54f9ee45 4829class ColourDatabase(_core.Object):
093d3ff1 4830 """Proxy of C++ ColourDatabase class"""
e811c8ce
RD
4831 def __repr__(self):
4832 return "<%s.%s; proxy of C++ wxColourDatabase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4833 def __init__(self, *args, **kwargs):
a95a7133 4834 """__init__(self) -> ColourDatabase"""
54f9ee45 4835 newobj = _gdi_.new_ColourDatabase(*args, **kwargs)
d14a1e28
RD
4836 self.this = newobj.this
4837 self.thisown = 1
4838 del newobj.thisown
54f9ee45 4839 def __del__(self, destroy=_gdi_.delete_ColourDatabase):
a95a7133 4840 """__del__(self)"""
d14a1e28
RD
4841 try:
4842 if self.thisown: destroy(self)
4843 except: pass
e811c8ce
RD
4844
4845 def Find(*args, **kwargs):
a95a7133 4846 """Find(self, String name) -> Colour"""
54f9ee45 4847 return _gdi_.ColourDatabase_Find(*args, **kwargs)
e811c8ce
RD
4848
4849 def FindName(*args, **kwargs):
a95a7133 4850 """FindName(self, Colour colour) -> String"""
54f9ee45 4851 return _gdi_.ColourDatabase_FindName(*args, **kwargs)
e811c8ce 4852
d14a1e28 4853 FindColour = Find
e811c8ce 4854 def AddColour(*args, **kwargs):
a95a7133 4855 """AddColour(self, String name, Colour colour)"""
54f9ee45 4856 return _gdi_.ColourDatabase_AddColour(*args, **kwargs)
e811c8ce
RD
4857
4858 def Append(*args, **kwargs):
a95a7133 4859 """Append(self, String name, int red, int green, int blue)"""
54f9ee45 4860 return _gdi_.ColourDatabase_Append(*args, **kwargs)
e811c8ce 4861
70551f47 4862
d14a1e28
RD
4863class ColourDatabasePtr(ColourDatabase):
4864 def __init__(self, this):
4865 self.this = this
4866 if not hasattr(self,"thisown"): self.thisown = 0
4867 self.__class__ = ColourDatabase
54f9ee45 4868_gdi_.ColourDatabase_swigregister(ColourDatabasePtr)
d14a1e28 4869
54f9ee45 4870class FontList(_core.Object):
093d3ff1 4871 """Proxy of C++ FontList class"""
d14a1e28
RD
4872 def __init__(self): raise RuntimeError, "No constructor defined"
4873 def __repr__(self):
4874 return "<%s.%s; proxy of C++ wxFontList instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4875 def AddFont(*args, **kwargs):
a95a7133 4876 """AddFont(self, Font font)"""
54f9ee45 4877 return _gdi_.FontList_AddFont(*args, **kwargs)
e811c8ce
RD
4878
4879 def FindOrCreateFont(*args, **kwargs):
0df68c9f 4880 """
a95a7133 4881 FindOrCreateFont(self, int point_size, int family, int style, int weight,
196addbf
RD
4882 bool underline=False, String facename=EmptyString,
4883 int encoding=FONTENCODING_DEFAULT) -> Font
0df68c9f 4884 """
54f9ee45 4885 return _gdi_.FontList_FindOrCreateFont(*args, **kwargs)
e811c8ce
RD
4886
4887 def RemoveFont(*args, **kwargs):
a95a7133 4888 """RemoveFont(self, Font font)"""
54f9ee45 4889 return _gdi_.FontList_RemoveFont(*args, **kwargs)
e811c8ce
RD
4890
4891 def GetCount(*args, **kwargs):
a95a7133 4892 """GetCount(self) -> int"""
54f9ee45 4893 return _gdi_.FontList_GetCount(*args, **kwargs)
e811c8ce 4894
70551f47 4895
d14a1e28
RD
4896class FontListPtr(FontList):
4897 def __init__(self, this):
4898 self.this = this
4899 if not hasattr(self,"thisown"): self.thisown = 0
4900 self.__class__ = FontList
54f9ee45 4901_gdi_.FontList_swigregister(FontListPtr)
70551f47 4902
d14a1e28 4903#---------------------------------------------------------------------------
fbcadfca 4904
994141e6 4905NullColor = NullColour
d14a1e28 4906#---------------------------------------------------------------------------
fbcadfca 4907
54f9ee45 4908class Effects(_core.Object):
093d3ff1 4909 """Proxy of C++ Effects class"""
e811c8ce
RD
4910 def __repr__(self):
4911 return "<%s.%s; proxy of C++ wxEffects instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4912 def __init__(self, *args, **kwargs):
a95a7133 4913 """__init__(self) -> Effects"""
54f9ee45 4914 newobj = _gdi_.new_Effects(*args, **kwargs)
d14a1e28
RD
4915 self.this = newobj.this
4916 self.thisown = 1
4917 del newobj.thisown
e811c8ce 4918 def GetHighlightColour(*args, **kwargs):
a95a7133 4919 """GetHighlightColour(self) -> Colour"""
54f9ee45 4920 return _gdi_.Effects_GetHighlightColour(*args, **kwargs)
e811c8ce
RD
4921
4922 def GetLightShadow(*args, **kwargs):
a95a7133 4923 """GetLightShadow(self) -> Colour"""
54f9ee45 4924 return _gdi_.Effects_GetLightShadow(*args, **kwargs)
e811c8ce
RD
4925
4926 def GetFaceColour(*args, **kwargs):
a95a7133 4927 """GetFaceColour(self) -> Colour"""
54f9ee45 4928 return _gdi_.Effects_GetFaceColour(*args, **kwargs)
e811c8ce
RD
4929
4930 def GetMediumShadow(*args, **kwargs):
a95a7133 4931 """GetMediumShadow(self) -> Colour"""
54f9ee45 4932 return _gdi_.Effects_GetMediumShadow(*args, **kwargs)
e811c8ce
RD
4933
4934 def GetDarkShadow(*args, **kwargs):
a95a7133 4935 """GetDarkShadow(self) -> Colour"""
54f9ee45 4936 return _gdi_.Effects_GetDarkShadow(*args, **kwargs)
e811c8ce
RD
4937
4938 def SetHighlightColour(*args, **kwargs):
a95a7133 4939 """SetHighlightColour(self, Colour c)"""
54f9ee45 4940 return _gdi_.Effects_SetHighlightColour(*args, **kwargs)
e811c8ce
RD
4941
4942 def SetLightShadow(*args, **kwargs):
a95a7133 4943 """SetLightShadow(self, Colour c)"""
54f9ee45 4944 return _gdi_.Effects_SetLightShadow(*args, **kwargs)
e811c8ce
RD
4945
4946 def SetFaceColour(*args, **kwargs):
a95a7133 4947 """SetFaceColour(self, Colour c)"""
54f9ee45 4948 return _gdi_.Effects_SetFaceColour(*args, **kwargs)
e811c8ce
RD
4949
4950 def SetMediumShadow(*args, **kwargs):
a95a7133 4951 """SetMediumShadow(self, Colour c)"""
54f9ee45 4952 return _gdi_.Effects_SetMediumShadow(*args, **kwargs)
e811c8ce
RD
4953
4954 def SetDarkShadow(*args, **kwargs):
a95a7133 4955 """SetDarkShadow(self, Colour c)"""
54f9ee45 4956 return _gdi_.Effects_SetDarkShadow(*args, **kwargs)
e811c8ce
RD
4957
4958 def Set(*args, **kwargs):
0df68c9f 4959 """
a95a7133 4960 Set(self, Colour highlightColour, Colour lightShadow, Colour faceColour,
0df68c9f
RD
4961 Colour mediumShadow, Colour darkShadow)
4962 """
54f9ee45 4963 return _gdi_.Effects_Set(*args, **kwargs)
e811c8ce
RD
4964
4965 def DrawSunkenEdge(*args, **kwargs):
a95a7133 4966 """DrawSunkenEdge(self, DC dc, Rect rect, int borderSize=1)"""
54f9ee45 4967 return _gdi_.Effects_DrawSunkenEdge(*args, **kwargs)
4be61064 4968
e811c8ce 4969 def TileBitmap(*args, **kwargs):
a95a7133 4970 """TileBitmap(self, Rect rect, DC dc, Bitmap bitmap) -> bool"""
54f9ee45 4971 return _gdi_.Effects_TileBitmap(*args, **kwargs)
e811c8ce
RD
4972
4973
4974class EffectsPtr(Effects):
d14a1e28
RD
4975 def __init__(self, this):
4976 self.this = this
4977 if not hasattr(self,"thisown"): self.thisown = 0
e811c8ce 4978 self.__class__ = Effects
54f9ee45 4979_gdi_.Effects_swigregister(EffectsPtr)
d14a1e28
RD
4980TheFontList = cvar.TheFontList
4981ThePenList = cvar.ThePenList
4982TheBrushList = cvar.TheBrushList
4983TheColourDatabase = cvar.TheColourDatabase
4984
8d38bd1d
RD
4985#---------------------------------------------------------------------------
4986
4987CONTROL_DISABLED = _gdi_.CONTROL_DISABLED
4988CONTROL_FOCUSED = _gdi_.CONTROL_FOCUSED
4989CONTROL_PRESSED = _gdi_.CONTROL_PRESSED
4990CONTROL_ISDEFAULT = _gdi_.CONTROL_ISDEFAULT
4991CONTROL_ISSUBMENU = _gdi_.CONTROL_ISSUBMENU
4992CONTROL_EXPANDED = _gdi_.CONTROL_EXPANDED
4993CONTROL_CURRENT = _gdi_.CONTROL_CURRENT
4994CONTROL_SELECTED = _gdi_.CONTROL_SELECTED
4995CONTROL_CHECKED = _gdi_.CONTROL_CHECKED
4996CONTROL_CHECKABLE = _gdi_.CONTROL_CHECKABLE
4997CONTROL_UNDETERMINED = _gdi_.CONTROL_UNDETERMINED
4998CONTROL_FLAGS_MASK = _gdi_.CONTROL_FLAGS_MASK
4999CONTROL_DIRTY = _gdi_.CONTROL_DIRTY
5000class SplitterRenderParams(object):
5001 """
5002 This is just a simple struct used as a return value of
5003 `wx.RendererNative.GetSplitterParams` and contains some platform
5004 specific metrics about splitters.
5005
5006 * widthSash: the width of the splitter sash.
5007 * border: the width of the border of the splitter window.
5008 * isHotSensitive: ``True`` if the splitter changes its
5009 appearance when the mouse is over it.
5010
5011
5012 """
5013 def __repr__(self):
5014 return "<%s.%s; proxy of C++ wxSplitterRenderParams instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5015 def __init__(self, *args, **kwargs):
5016 """
5017 __init__(self, int widthSash_, int border_, bool isSens_) -> SplitterRenderParams
5018
5019 This is just a simple struct used as a return value of
5020 `wx.RendererNative.GetSplitterParams` and contains some platform
5021 specific metrics about splitters.
5022
5023 * widthSash: the width of the splitter sash.
5024 * border: the width of the border of the splitter window.
5025 * isHotSensitive: ``True`` if the splitter changes its
5026 appearance when the mouse is over it.
5027
5028
5029 """
5030 newobj = _gdi_.new_SplitterRenderParams(*args, **kwargs)
5031 self.this = newobj.this
5032 self.thisown = 1
5033 del newobj.thisown
5034 def __del__(self, destroy=_gdi_.delete_SplitterRenderParams):
5035 """__del__(self)"""
5036 try:
5037 if self.thisown: destroy(self)
5038 except: pass
5039
5040 widthSash = property(_gdi_.SplitterRenderParams_widthSash_get)
5041 border = property(_gdi_.SplitterRenderParams_border_get)
5042 isHotSensitive = property(_gdi_.SplitterRenderParams_isHotSensitive_get)
5043
5044class SplitterRenderParamsPtr(SplitterRenderParams):
5045 def __init__(self, this):
5046 self.this = this
5047 if not hasattr(self,"thisown"): self.thisown = 0
5048 self.__class__ = SplitterRenderParams
5049_gdi_.SplitterRenderParams_swigregister(SplitterRenderParamsPtr)
5050
5051class RendererVersion(object):
5052 """
5053 This simple struct represents the `wx.RendererNative` interface
5054 version and is only used as the return value of
5055 `wx.RendererNative.GetVersion`.
5056 """
5057 def __repr__(self):
5058 return "<%s.%s; proxy of C++ wxRendererVersion instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5059 def __init__(self, *args, **kwargs):
5060 """
5061 __init__(self, int version_, int age_) -> RendererVersion
5062
5063 This simple struct represents the `wx.RendererNative` interface
5064 version and is only used as the return value of
5065 `wx.RendererNative.GetVersion`.
5066 """
5067 newobj = _gdi_.new_RendererVersion(*args, **kwargs)
5068 self.this = newobj.this
5069 self.thisown = 1
5070 del newobj.thisown
5071 def __del__(self, destroy=_gdi_.delete_RendererVersion):
5072 """__del__(self)"""
5073 try:
5074 if self.thisown: destroy(self)
5075 except: pass
5076
5077 Current_Version = _gdi_.RendererVersion_Current_Version
5078 Current_Age = _gdi_.RendererVersion_Current_Age
5079 def IsCompatible(*args, **kwargs):
5080 """IsCompatible(RendererVersion ver) -> bool"""
5081 return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
5082
5083 IsCompatible = staticmethod(IsCompatible)
5084 version = property(_gdi_.RendererVersion_version_get)
5085 age = property(_gdi_.RendererVersion_age_get)
5086
5087class RendererVersionPtr(RendererVersion):
5088 def __init__(self, this):
5089 self.this = this
5090 if not hasattr(self,"thisown"): self.thisown = 0
5091 self.__class__ = RendererVersion
5092_gdi_.RendererVersion_swigregister(RendererVersionPtr)
5093
5094def RendererVersion_IsCompatible(*args, **kwargs):
5095 """RendererVersion_IsCompatible(RendererVersion ver) -> bool"""
5096 return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
5097
5098class RendererNative(object):
5099 """
5100 One of the design principles of wxWidgets is to use the native widgets
5101 on every platform in order to be as close to the native look and feel
5102 on every platform. However there are still cases when some generic
5103 widgets are needed for various reasons, but it can sometimes take a
5104 lot of messy work to make them conform to the native LnF.
5105
5106 The wx.RendererNative class is a collection of functions that have
5107 platform-specific implementations for drawing certain parts of
5108 genereic controls in ways that are as close to the native look as
5109 possible.
5110
5111 """
5112 def __init__(self): raise RuntimeError, "No constructor defined"
5113 def __repr__(self):
5114 return "<%s.%s; proxy of C++ wxRendererNative instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5115 def DrawHeaderButton(*args, **kwargs):
5116 """
5117 DrawHeaderButton(self, Window win, DC dc, Rect rect, int flags=0)
5118
5119 Draw the header control button (such as whar is used by `wx.ListCtrl`
5120 in report mode.)
5121 """
5122 return _gdi_.RendererNative_DrawHeaderButton(*args, **kwargs)
5123
5124 def DrawTreeItemButton(*args, **kwargs):
5125 """
5126 DrawTreeItemButton(self, Window win, DC dc, Rect rect, int flags=0)
5127
5128 Draw the expanded/collapsed icon for a tree control item.
5129 """
5130 return _gdi_.RendererNative_DrawTreeItemButton(*args, **kwargs)
5131
5132 def DrawSplitterBorder(*args, **kwargs):
5133 """
5134 DrawSplitterBorder(self, Window win, DC dc, Rect rect, int flags=0)
5135
5136 Draw the border for a sash window: this border must be such that the
5137 sash drawn by `DrawSplitterSash` blends into it well.
5138 """
5139 return _gdi_.RendererNative_DrawSplitterBorder(*args, **kwargs)
5140
5141 def DrawSplitterSash(*args, **kwargs):
5142 """
5143 DrawSplitterSash(self, Window win, DC dc, Size size, int position, int orient,
5144 int flags=0)
5145
5146 Draw a sash. The orient parameter defines whether the sash should be
5147 vertical or horizontal and how the position should be interpreted.
5148 """
5149 return _gdi_.RendererNative_DrawSplitterSash(*args, **kwargs)
5150
5151 def DrawComboBoxDropButton(*args, **kwargs):
5152 """
5153 DrawComboBoxDropButton(self, Window win, DC dc, Rect rect, int flags=0)
5154
5155 Draw a button like the one used by `wx.ComboBox` to show a drop down
5156 window. The usual appearance is a downwards pointing arrow.
5157
5158 The ``flags`` parameter may have the ``wx.CONTROL_PRESSED`` or
5159 ``wx.CONTROL_CURRENT`` bits set.
5160 """
5161 return _gdi_.RendererNative_DrawComboBoxDropButton(*args, **kwargs)
5162
5163 def DrawDropArrow(*args, **kwargs):
5164 """
5165 DrawDropArrow(self, Window win, DC dc, Rect rect, int flags=0)
5166
5167 Draw a drop down arrow that is suitable for use outside a combo
5168 box. Arrow will have a transparent background.
5169
5170 ``rect`` is not entirely filled by the arrow. Instead, you should use
5171 bounding rectangle of a drop down button which arrow matches the size
5172 you need. ``flags`` may have the ``wx.CONTROL_PRESSED`` or
5173 ``wx.CONTROL_CURRENT`` bit set.
5174 """
5175 return _gdi_.RendererNative_DrawDropArrow(*args, **kwargs)
5176
5177 def GetSplitterParams(*args, **kwargs):
5178 """
5179 GetSplitterParams(self, Window win) -> SplitterRenderParams
5180
5181 Get the splitter parameters, see `wx.SplitterRenderParams`.
5182 """
5183 return _gdi_.RendererNative_GetSplitterParams(*args, **kwargs)
5184
5185 def Get(*args, **kwargs):
5186 """
5187 Get() -> RendererNative
5188
5189 Return the currently used renderer
5190 """
5191 return _gdi_.RendererNative_Get(*args, **kwargs)
5192
5193 Get = staticmethod(Get)
5194 def GetGeneric(*args, **kwargs):
5195 """
5196 GetGeneric() -> RendererNative
5197
5198 Return the generic implementation of the renderer. Under some
5199 platforms, this is the default renderer implementation, others have
5200 platform-specific default renderer which can be retrieved by calling
5201 `GetDefault`.
5202 """
5203 return _gdi_.RendererNative_GetGeneric(*args, **kwargs)
5204
5205 GetGeneric = staticmethod(GetGeneric)
5206 def GetDefault(*args, **kwargs):
5207 """
5208 GetDefault() -> RendererNative
5209
5210 Return the default (native) implementation for this platform -- this
5211 is also the one used by default but this may be changed by calling `Set`
5212 in which case the return value of this method may be different from
5213 the return value of `Get`.
5214 """
5215 return _gdi_.RendererNative_GetDefault(*args, **kwargs)
5216
5217 GetDefault = staticmethod(GetDefault)
5218 def Set(*args, **kwargs):
5219 """
5220 Set(RendererNative renderer) -> RendererNative
5221
5222 Set the renderer to use, passing None reverts to using the default
5223 renderer. Returns the previous renderer used with Set or None.
5224 """
5225 return _gdi_.RendererNative_Set(*args, **kwargs)
5226
5227 Set = staticmethod(Set)
5228 def GetVersion(*args, **kwargs):
5229 """
5230 GetVersion(self) -> RendererVersion
5231
5232 Returns the version of the renderer. Will be used for ensuring
5233 compatibility of dynamically loaded renderers.
5234 """
5235 return _gdi_.RendererNative_GetVersion(*args, **kwargs)
5236
5237
5238class RendererNativePtr(RendererNative):
5239 def __init__(self, this):
5240 self.this = this
5241 if not hasattr(self,"thisown"): self.thisown = 0
5242 self.__class__ = RendererNative
5243_gdi_.RendererNative_swigregister(RendererNativePtr)
5244
5245def RendererNative_Get(*args, **kwargs):
5246 """
5247 RendererNative_Get() -> RendererNative
5248
5249 Return the currently used renderer
5250 """
5251 return _gdi_.RendererNative_Get(*args, **kwargs)
5252
5253def RendererNative_GetGeneric(*args, **kwargs):
5254 """
5255 RendererNative_GetGeneric() -> RendererNative
5256
5257 Return the generic implementation of the renderer. Under some
5258 platforms, this is the default renderer implementation, others have
5259 platform-specific default renderer which can be retrieved by calling
5260 `GetDefault`.
5261 """
5262 return _gdi_.RendererNative_GetGeneric(*args, **kwargs)
5263
5264def RendererNative_GetDefault(*args, **kwargs):
5265 """
5266 RendererNative_GetDefault() -> RendererNative
5267
5268 Return the default (native) implementation for this platform -- this
5269 is also the one used by default but this may be changed by calling `Set`
5270 in which case the return value of this method may be different from
5271 the return value of `Get`.
5272 """
5273 return _gdi_.RendererNative_GetDefault(*args, **kwargs)
5274
5275def RendererNative_Set(*args, **kwargs):
5276 """
5277 RendererNative_Set(RendererNative renderer) -> RendererNative
5278
5279 Set the renderer to use, passing None reverts to using the default
5280 renderer. Returns the previous renderer used with Set or None.
5281 """
5282 return _gdi_.RendererNative_Set(*args, **kwargs)
5283
70551f47 5284
32fe5131 5285