]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / gtk / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
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):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 CB_SIMPLE = _core_.CB_SIMPLE
120 CB_DROPDOWN = _core_.CB_DROPDOWN
121 CB_SORT = _core_.CB_SORT
122 CB_READONLY = _core_.CB_READONLY
123 RA_HORIZONTAL = _core_.RA_HORIZONTAL
124 RA_VERTICAL = _core_.RA_VERTICAL
125 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
126 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
127 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
128 RB_GROUP = _core_.RB_GROUP
129 RB_SINGLE = _core_.RB_SINGLE
130 SB_HORIZONTAL = _core_.SB_HORIZONTAL
131 SB_VERTICAL = _core_.SB_VERTICAL
132 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
133 ST_SIZEGRIP = _core_.ST_SIZEGRIP
134 FLOOD_SURFACE = _core_.FLOOD_SURFACE
135 FLOOD_BORDER = _core_.FLOOD_BORDER
136 ODDEVEN_RULE = _core_.ODDEVEN_RULE
137 WINDING_RULE = _core_.WINDING_RULE
138 TOOL_TOP = _core_.TOOL_TOP
139 TOOL_BOTTOM = _core_.TOOL_BOTTOM
140 TOOL_LEFT = _core_.TOOL_LEFT
141 TOOL_RIGHT = _core_.TOOL_RIGHT
142 OK = _core_.OK
143 YES_NO = _core_.YES_NO
144 CANCEL = _core_.CANCEL
145 YES = _core_.YES
146 NO = _core_.NO
147 NO_DEFAULT = _core_.NO_DEFAULT
148 YES_DEFAULT = _core_.YES_DEFAULT
149 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
150 ICON_HAND = _core_.ICON_HAND
151 ICON_QUESTION = _core_.ICON_QUESTION
152 ICON_INFORMATION = _core_.ICON_INFORMATION
153 ICON_STOP = _core_.ICON_STOP
154 ICON_ASTERISK = _core_.ICON_ASTERISK
155 ICON_MASK = _core_.ICON_MASK
156 ICON_WARNING = _core_.ICON_WARNING
157 ICON_ERROR = _core_.ICON_ERROR
158 FORWARD = _core_.FORWARD
159 BACKWARD = _core_.BACKWARD
160 RESET = _core_.RESET
161 HELP = _core_.HELP
162 MORE = _core_.MORE
163 SETUP = _core_.SETUP
164 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
165 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
166 SIZE_AUTO = _core_.SIZE_AUTO
167 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
168 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
169 SIZE_FORCE = _core_.SIZE_FORCE
170 PORTRAIT = _core_.PORTRAIT
171 LANDSCAPE = _core_.LANDSCAPE
172 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
173 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
174 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
175 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
176 ID_ANY = _core_.ID_ANY
177 ID_SEPARATOR = _core_.ID_SEPARATOR
178 ID_NONE = _core_.ID_NONE
179 ID_LOWEST = _core_.ID_LOWEST
180 ID_OPEN = _core_.ID_OPEN
181 ID_CLOSE = _core_.ID_CLOSE
182 ID_NEW = _core_.ID_NEW
183 ID_SAVE = _core_.ID_SAVE
184 ID_SAVEAS = _core_.ID_SAVEAS
185 ID_REVERT = _core_.ID_REVERT
186 ID_EXIT = _core_.ID_EXIT
187 ID_UNDO = _core_.ID_UNDO
188 ID_REDO = _core_.ID_REDO
189 ID_HELP = _core_.ID_HELP
190 ID_PRINT = _core_.ID_PRINT
191 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
192 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
193 ID_PREVIEW = _core_.ID_PREVIEW
194 ID_ABOUT = _core_.ID_ABOUT
195 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
196 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
197 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
198 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
199 ID_HELP_INDEX = _core_.ID_HELP_INDEX
200 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
201 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
202 ID_PREFERENCES = _core_.ID_PREFERENCES
203 ID_EDIT = _core_.ID_EDIT
204 ID_CUT = _core_.ID_CUT
205 ID_COPY = _core_.ID_COPY
206 ID_PASTE = _core_.ID_PASTE
207 ID_CLEAR = _core_.ID_CLEAR
208 ID_FIND = _core_.ID_FIND
209 ID_DUPLICATE = _core_.ID_DUPLICATE
210 ID_SELECTALL = _core_.ID_SELECTALL
211 ID_DELETE = _core_.ID_DELETE
212 ID_REPLACE = _core_.ID_REPLACE
213 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214 ID_PROPERTIES = _core_.ID_PROPERTIES
215 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST = _core_.ID_VIEW_LIST
219 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223 ID_FILE = _core_.ID_FILE
224 ID_FILE1 = _core_.ID_FILE1
225 ID_FILE2 = _core_.ID_FILE2
226 ID_FILE3 = _core_.ID_FILE3
227 ID_FILE4 = _core_.ID_FILE4
228 ID_FILE5 = _core_.ID_FILE5
229 ID_FILE6 = _core_.ID_FILE6
230 ID_FILE7 = _core_.ID_FILE7
231 ID_FILE8 = _core_.ID_FILE8
232 ID_FILE9 = _core_.ID_FILE9
233 ID_OK = _core_.ID_OK
234 ID_CANCEL = _core_.ID_CANCEL
235 ID_APPLY = _core_.ID_APPLY
236 ID_YES = _core_.ID_YES
237 ID_NO = _core_.ID_NO
238 ID_STATIC = _core_.ID_STATIC
239 ID_FORWARD = _core_.ID_FORWARD
240 ID_BACKWARD = _core_.ID_BACKWARD
241 ID_DEFAULT = _core_.ID_DEFAULT
242 ID_MORE = _core_.ID_MORE
243 ID_SETUP = _core_.ID_SETUP
244 ID_RESET = _core_.ID_RESET
245 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246 ID_YESTOALL = _core_.ID_YESTOALL
247 ID_NOTOALL = _core_.ID_NOTOALL
248 ID_ABORT = _core_.ID_ABORT
249 ID_RETRY = _core_.ID_RETRY
250 ID_IGNORE = _core_.ID_IGNORE
251 ID_ADD = _core_.ID_ADD
252 ID_REMOVE = _core_.ID_REMOVE
253 ID_UP = _core_.ID_UP
254 ID_DOWN = _core_.ID_DOWN
255 ID_HOME = _core_.ID_HOME
256 ID_REFRESH = _core_.ID_REFRESH
257 ID_STOP = _core_.ID_STOP
258 ID_INDEX = _core_.ID_INDEX
259 ID_BOLD = _core_.ID_BOLD
260 ID_ITALIC = _core_.ID_ITALIC
261 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265 ID_UNDERLINE = _core_.ID_UNDERLINE
266 ID_INDENT = _core_.ID_INDENT
267 ID_UNINDENT = _core_.ID_UNINDENT
268 ID_ZOOM_100 = _core_.ID_ZOOM_100
269 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270 ID_ZOOM_IN = _core_.ID_ZOOM_IN
271 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272 ID_UNDELETE = _core_.ID_UNDELETE
273 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
274 ID_HIGHEST = _core_.ID_HIGHEST
275 MENU_TEAROFF = _core_.MENU_TEAROFF
276 MB_DOCKABLE = _core_.MB_DOCKABLE
277 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
278 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
279 LI_HORIZONTAL = _core_.LI_HORIZONTAL
280 LI_VERTICAL = _core_.LI_VERTICAL
281 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
282 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
283 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
284 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
285 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
286 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
287 MM_TEXT = _core_.MM_TEXT
288 MM_LOMETRIC = _core_.MM_LOMETRIC
289 MM_HIMETRIC = _core_.MM_HIMETRIC
290 MM_LOENGLISH = _core_.MM_LOENGLISH
291 MM_HIENGLISH = _core_.MM_HIENGLISH
292 MM_TWIPS = _core_.MM_TWIPS
293 MM_ISOTROPIC = _core_.MM_ISOTROPIC
294 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
295 MM_POINTS = _core_.MM_POINTS
296 MM_METRIC = _core_.MM_METRIC
297 CENTRE = _core_.CENTRE
298 CENTER = _core_.CENTER
299 HORIZONTAL = _core_.HORIZONTAL
300 VERTICAL = _core_.VERTICAL
301 BOTH = _core_.BOTH
302 LEFT = _core_.LEFT
303 RIGHT = _core_.RIGHT
304 UP = _core_.UP
305 DOWN = _core_.DOWN
306 TOP = _core_.TOP
307 BOTTOM = _core_.BOTTOM
308 NORTH = _core_.NORTH
309 SOUTH = _core_.SOUTH
310 WEST = _core_.WEST
311 EAST = _core_.EAST
312 ALL = _core_.ALL
313 ALIGN_NOT = _core_.ALIGN_NOT
314 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
315 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
316 ALIGN_LEFT = _core_.ALIGN_LEFT
317 ALIGN_TOP = _core_.ALIGN_TOP
318 ALIGN_RIGHT = _core_.ALIGN_RIGHT
319 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
320 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
321 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
322 ALIGN_CENTER = _core_.ALIGN_CENTER
323 ALIGN_CENTRE = _core_.ALIGN_CENTRE
324 ALIGN_MASK = _core_.ALIGN_MASK
325 STRETCH_NOT = _core_.STRETCH_NOT
326 SHRINK = _core_.SHRINK
327 GROW = _core_.GROW
328 EXPAND = _core_.EXPAND
329 SHAPED = _core_.SHAPED
330 FIXED_MINSIZE = _core_.FIXED_MINSIZE
331 TILE = _core_.TILE
332 ADJUST_MINSIZE = 0
333 BORDER_DEFAULT = _core_.BORDER_DEFAULT
334 BORDER_NONE = _core_.BORDER_NONE
335 BORDER_STATIC = _core_.BORDER_STATIC
336 BORDER_SIMPLE = _core_.BORDER_SIMPLE
337 BORDER_RAISED = _core_.BORDER_RAISED
338 BORDER_SUNKEN = _core_.BORDER_SUNKEN
339 BORDER_DOUBLE = _core_.BORDER_DOUBLE
340 BORDER_MASK = _core_.BORDER_MASK
341 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
342 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
343 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
344 DEFAULT = _core_.DEFAULT
345 DECORATIVE = _core_.DECORATIVE
346 ROMAN = _core_.ROMAN
347 SCRIPT = _core_.SCRIPT
348 SWISS = _core_.SWISS
349 MODERN = _core_.MODERN
350 TELETYPE = _core_.TELETYPE
351 VARIABLE = _core_.VARIABLE
352 FIXED = _core_.FIXED
353 NORMAL = _core_.NORMAL
354 LIGHT = _core_.LIGHT
355 BOLD = _core_.BOLD
356 ITALIC = _core_.ITALIC
357 SLANT = _core_.SLANT
358 SOLID = _core_.SOLID
359 DOT = _core_.DOT
360 LONG_DASH = _core_.LONG_DASH
361 SHORT_DASH = _core_.SHORT_DASH
362 DOT_DASH = _core_.DOT_DASH
363 USER_DASH = _core_.USER_DASH
364 TRANSPARENT = _core_.TRANSPARENT
365 STIPPLE = _core_.STIPPLE
366 STIPPLE_MASK = _core_.STIPPLE_MASK
367 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
368 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
369 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
370 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
371 CROSS_HATCH = _core_.CROSS_HATCH
372 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
373 VERTICAL_HATCH = _core_.VERTICAL_HATCH
374 JOIN_BEVEL = _core_.JOIN_BEVEL
375 JOIN_MITER = _core_.JOIN_MITER
376 JOIN_ROUND = _core_.JOIN_ROUND
377 CAP_ROUND = _core_.CAP_ROUND
378 CAP_PROJECTING = _core_.CAP_PROJECTING
379 CAP_BUTT = _core_.CAP_BUTT
380 CLEAR = _core_.CLEAR
381 XOR = _core_.XOR
382 INVERT = _core_.INVERT
383 OR_REVERSE = _core_.OR_REVERSE
384 AND_REVERSE = _core_.AND_REVERSE
385 COPY = _core_.COPY
386 AND = _core_.AND
387 AND_INVERT = _core_.AND_INVERT
388 NO_OP = _core_.NO_OP
389 NOR = _core_.NOR
390 EQUIV = _core_.EQUIV
391 SRC_INVERT = _core_.SRC_INVERT
392 OR_INVERT = _core_.OR_INVERT
393 NAND = _core_.NAND
394 OR = _core_.OR
395 SET = _core_.SET
396 WXK_BACK = _core_.WXK_BACK
397 WXK_TAB = _core_.WXK_TAB
398 WXK_RETURN = _core_.WXK_RETURN
399 WXK_ESCAPE = _core_.WXK_ESCAPE
400 WXK_SPACE = _core_.WXK_SPACE
401 WXK_DELETE = _core_.WXK_DELETE
402 WXK_START = _core_.WXK_START
403 WXK_LBUTTON = _core_.WXK_LBUTTON
404 WXK_RBUTTON = _core_.WXK_RBUTTON
405 WXK_CANCEL = _core_.WXK_CANCEL
406 WXK_MBUTTON = _core_.WXK_MBUTTON
407 WXK_CLEAR = _core_.WXK_CLEAR
408 WXK_SHIFT = _core_.WXK_SHIFT
409 WXK_ALT = _core_.WXK_ALT
410 WXK_CONTROL = _core_.WXK_CONTROL
411 WXK_MENU = _core_.WXK_MENU
412 WXK_PAUSE = _core_.WXK_PAUSE
413 WXK_CAPITAL = _core_.WXK_CAPITAL
414 WXK_END = _core_.WXK_END
415 WXK_HOME = _core_.WXK_HOME
416 WXK_LEFT = _core_.WXK_LEFT
417 WXK_UP = _core_.WXK_UP
418 WXK_RIGHT = _core_.WXK_RIGHT
419 WXK_DOWN = _core_.WXK_DOWN
420 WXK_SELECT = _core_.WXK_SELECT
421 WXK_PRINT = _core_.WXK_PRINT
422 WXK_EXECUTE = _core_.WXK_EXECUTE
423 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
424 WXK_INSERT = _core_.WXK_INSERT
425 WXK_HELP = _core_.WXK_HELP
426 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
427 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
428 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
429 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
430 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
431 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
432 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
433 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
434 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
435 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
436 WXK_MULTIPLY = _core_.WXK_MULTIPLY
437 WXK_ADD = _core_.WXK_ADD
438 WXK_SEPARATOR = _core_.WXK_SEPARATOR
439 WXK_SUBTRACT = _core_.WXK_SUBTRACT
440 WXK_DECIMAL = _core_.WXK_DECIMAL
441 WXK_DIVIDE = _core_.WXK_DIVIDE
442 WXK_F1 = _core_.WXK_F1
443 WXK_F2 = _core_.WXK_F2
444 WXK_F3 = _core_.WXK_F3
445 WXK_F4 = _core_.WXK_F4
446 WXK_F5 = _core_.WXK_F5
447 WXK_F6 = _core_.WXK_F6
448 WXK_F7 = _core_.WXK_F7
449 WXK_F8 = _core_.WXK_F8
450 WXK_F9 = _core_.WXK_F9
451 WXK_F10 = _core_.WXK_F10
452 WXK_F11 = _core_.WXK_F11
453 WXK_F12 = _core_.WXK_F12
454 WXK_F13 = _core_.WXK_F13
455 WXK_F14 = _core_.WXK_F14
456 WXK_F15 = _core_.WXK_F15
457 WXK_F16 = _core_.WXK_F16
458 WXK_F17 = _core_.WXK_F17
459 WXK_F18 = _core_.WXK_F18
460 WXK_F19 = _core_.WXK_F19
461 WXK_F20 = _core_.WXK_F20
462 WXK_F21 = _core_.WXK_F21
463 WXK_F22 = _core_.WXK_F22
464 WXK_F23 = _core_.WXK_F23
465 WXK_F24 = _core_.WXK_F24
466 WXK_NUMLOCK = _core_.WXK_NUMLOCK
467 WXK_SCROLL = _core_.WXK_SCROLL
468 WXK_PAGEUP = _core_.WXK_PAGEUP
469 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
470 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
471 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
472 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
473 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
474 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
475 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
476 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
477 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
478 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
479 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
480 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
481 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
482 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
483 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
484 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
485 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
486 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
487 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
488 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
489 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
490 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
491 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
492 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
493 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
494 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
495 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
496 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
497 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
498 WXK_COMMAND = _core_.WXK_COMMAND
499 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
500 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
501 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
502 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
503 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
504 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
505 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
506 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
507 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
508 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
509 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
510 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
511 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
512 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
513 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
514 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
515 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
516 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
517 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
518 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
519 WXK_PRIOR = WXK_PAGEUP
520 WXK_NEXT = WXK_PAGEDOWN
521 WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
522 WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
523
524 PAPER_NONE = _core_.PAPER_NONE
525 PAPER_LETTER = _core_.PAPER_LETTER
526 PAPER_LEGAL = _core_.PAPER_LEGAL
527 PAPER_A4 = _core_.PAPER_A4
528 PAPER_CSHEET = _core_.PAPER_CSHEET
529 PAPER_DSHEET = _core_.PAPER_DSHEET
530 PAPER_ESHEET = _core_.PAPER_ESHEET
531 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
532 PAPER_TABLOID = _core_.PAPER_TABLOID
533 PAPER_LEDGER = _core_.PAPER_LEDGER
534 PAPER_STATEMENT = _core_.PAPER_STATEMENT
535 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
536 PAPER_A3 = _core_.PAPER_A3
537 PAPER_A4SMALL = _core_.PAPER_A4SMALL
538 PAPER_A5 = _core_.PAPER_A5
539 PAPER_B4 = _core_.PAPER_B4
540 PAPER_B5 = _core_.PAPER_B5
541 PAPER_FOLIO = _core_.PAPER_FOLIO
542 PAPER_QUARTO = _core_.PAPER_QUARTO
543 PAPER_10X14 = _core_.PAPER_10X14
544 PAPER_11X17 = _core_.PAPER_11X17
545 PAPER_NOTE = _core_.PAPER_NOTE
546 PAPER_ENV_9 = _core_.PAPER_ENV_9
547 PAPER_ENV_10 = _core_.PAPER_ENV_10
548 PAPER_ENV_11 = _core_.PAPER_ENV_11
549 PAPER_ENV_12 = _core_.PAPER_ENV_12
550 PAPER_ENV_14 = _core_.PAPER_ENV_14
551 PAPER_ENV_DL = _core_.PAPER_ENV_DL
552 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
553 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
554 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
555 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
556 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
557 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
558 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
559 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
560 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
561 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
562 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
563 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
564 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
565 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
566 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
567 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
568 PAPER_9X11 = _core_.PAPER_9X11
569 PAPER_10X11 = _core_.PAPER_10X11
570 PAPER_15X11 = _core_.PAPER_15X11
571 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
572 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
573 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
574 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
575 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
576 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
577 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
578 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
579 PAPER_A_PLUS = _core_.PAPER_A_PLUS
580 PAPER_B_PLUS = _core_.PAPER_B_PLUS
581 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
582 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
583 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
584 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
585 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
586 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
587 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
588 PAPER_A2 = _core_.PAPER_A2
589 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
590 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
591 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
592 PAPER_A6 = _core_.PAPER_A6
593 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
594 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
595 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
596 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
597 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
598 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
599 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
600 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
601 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
602 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
603 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
604 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
606 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
607 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
608 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
609 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
610 PAPER_B6_JIS = _core_.PAPER_B6_JIS
611 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
612 PAPER_12X11 = _core_.PAPER_12X11
613 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
614 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
615 PAPER_P16K = _core_.PAPER_P16K
616 PAPER_P32K = _core_.PAPER_P32K
617 PAPER_P32KBIG = _core_.PAPER_P32KBIG
618 PAPER_PENV_1 = _core_.PAPER_PENV_1
619 PAPER_PENV_2 = _core_.PAPER_PENV_2
620 PAPER_PENV_3 = _core_.PAPER_PENV_3
621 PAPER_PENV_4 = _core_.PAPER_PENV_4
622 PAPER_PENV_5 = _core_.PAPER_PENV_5
623 PAPER_PENV_6 = _core_.PAPER_PENV_6
624 PAPER_PENV_7 = _core_.PAPER_PENV_7
625 PAPER_PENV_8 = _core_.PAPER_PENV_8
626 PAPER_PENV_9 = _core_.PAPER_PENV_9
627 PAPER_PENV_10 = _core_.PAPER_PENV_10
628 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
629 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
630 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
631 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
632 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
633 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
634 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
635 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
636 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
637 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
638 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
639 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
640 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
641 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
642 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
643 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
644 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
645 ITEM_NORMAL = _core_.ITEM_NORMAL
646 ITEM_CHECK = _core_.ITEM_CHECK
647 ITEM_RADIO = _core_.ITEM_RADIO
648 ITEM_MAX = _core_.ITEM_MAX
649 HT_NOWHERE = _core_.HT_NOWHERE
650 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
651 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
652 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
653 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
654 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
655 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
656 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
657 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
658 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
659 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
660 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
661 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
662 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
663 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
664 HT_MAX = _core_.HT_MAX
665 MOD_NONE = _core_.MOD_NONE
666 MOD_ALT = _core_.MOD_ALT
667 MOD_CONTROL = _core_.MOD_CONTROL
668 MOD_ALTGR = _core_.MOD_ALTGR
669 MOD_SHIFT = _core_.MOD_SHIFT
670 MOD_META = _core_.MOD_META
671 MOD_WIN = _core_.MOD_WIN
672 MOD_CMD = _core_.MOD_CMD
673 MOD_ALL = _core_.MOD_ALL
674 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
675 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
676 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
677 Layout_Default = _core_.Layout_Default
678 Layout_LeftToRight = _core_.Layout_LeftToRight
679 Layout_RightToLeft = _core_.Layout_RightToLeft
680 #---------------------------------------------------------------------------
681
682 class Object(object):
683 """
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
686 """
687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
688 def __init__(self): raise AttributeError, "No constructor defined"
689 __repr__ = _swig_repr
690 def GetClassName(*args, **kwargs):
691 """
692 GetClassName(self) -> String
693
694 Returns the class name of the C++ class using wxRTTI.
695 """
696 return _core_.Object_GetClassName(*args, **kwargs)
697
698 def Destroy(*args, **kwargs):
699 """
700 Destroy(self)
701
702 Deletes the C++ object this Python object is a proxy for.
703 """
704 args[0].this.own(False)
705 return _core_.Object_Destroy(*args, **kwargs)
706
707 def IsSameAs(*args, **kwargs):
708 """
709 IsSameAs(self, Object p) -> bool
710
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
713 object.
714 """
715 return _core_.Object_IsSameAs(*args, **kwargs)
716
717 ClassName = property(GetClassName,doc="See `GetClassName`")
718 _core_.Object_swigregister(Object)
719 _wxPySetDictionary = _core_._wxPySetDictionary
720 cvar = _core_.cvar
721 EmptyString = cvar.EmptyString
722
723 #---------------------------------------------------------------------------
724
725 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
743 BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
744 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746 CURSOR_NONE = _core_.CURSOR_NONE
747 CURSOR_ARROW = _core_.CURSOR_ARROW
748 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750 CURSOR_CHAR = _core_.CURSOR_CHAR
751 CURSOR_CROSS = _core_.CURSOR_CROSS
752 CURSOR_HAND = _core_.CURSOR_HAND
753 CURSOR_IBEAM = _core_.CURSOR_IBEAM
754 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759 CURSOR_PENCIL = _core_.CURSOR_PENCIL
760 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765 CURSOR_SIZENS = _core_.CURSOR_SIZENS
766 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768 CURSOR_SIZING = _core_.CURSOR_SIZING
769 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770 CURSOR_WAIT = _core_.CURSOR_WAIT
771 CURSOR_WATCH = _core_.CURSOR_WATCH
772 CURSOR_BLANK = _core_.CURSOR_BLANK
773 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776 CURSOR_MAX = _core_.CURSOR_MAX
777 #---------------------------------------------------------------------------
778
779 class Size(object):
780 """
781 wx.Size is a useful data structure used to represent the size of
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
784 expected a (width, height) tuple can be used instead.
785 """
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
790 x = width; y = height
791 def __init__(self, *args, **kwargs):
792 """
793 __init__(self, int w=0, int h=0) -> Size
794
795 Creates a size object.
796 """
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
800 def __eq__(*args, **kwargs):
801 """
802 __eq__(self, PyObject other) -> bool
803
804 Test for equality of wx.Size objects.
805 """
806 return _core_.Size___eq__(*args, **kwargs)
807
808 def __ne__(*args, **kwargs):
809 """
810 __ne__(self, PyObject other) -> bool
811
812 Test for inequality of wx.Size objects.
813 """
814 return _core_.Size___ne__(*args, **kwargs)
815
816 def __add__(*args, **kwargs):
817 """
818 __add__(self, Size sz) -> Size
819
820 Add sz's proprties to this and return the result.
821 """
822 return _core_.Size___add__(*args, **kwargs)
823
824 def __sub__(*args, **kwargs):
825 """
826 __sub__(self, Size sz) -> Size
827
828 Subtract sz's properties from this and return the result.
829 """
830 return _core_.Size___sub__(*args, **kwargs)
831
832 def IncTo(*args, **kwargs):
833 """
834 IncTo(self, Size sz)
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
839 return _core_.Size_IncTo(*args, **kwargs)
840
841 def DecTo(*args, **kwargs):
842 """
843 DecTo(self, Size sz)
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
848 return _core_.Size_DecTo(*args, **kwargs)
849
850 def IncBy(*args, **kwargs):
851 """IncBy(self, int dx, int dy)"""
852 return _core_.Size_IncBy(*args, **kwargs)
853
854 def DecBy(*args, **kwargs):
855 """DecBy(self, int dx, int dy)"""
856 return _core_.Size_DecBy(*args, **kwargs)
857
858 def Scale(*args, **kwargs):
859 """
860 Scale(self, float xscale, float yscale)
861
862 Scales the dimensions of this object by the given factors.
863 """
864 return _core_.Size_Scale(*args, **kwargs)
865
866 def Set(*args, **kwargs):
867 """
868 Set(self, int w, int h)
869
870 Set both width and height.
871 """
872 return _core_.Size_Set(*args, **kwargs)
873
874 def SetWidth(*args, **kwargs):
875 """SetWidth(self, int w)"""
876 return _core_.Size_SetWidth(*args, **kwargs)
877
878 def SetHeight(*args, **kwargs):
879 """SetHeight(self, int h)"""
880 return _core_.Size_SetHeight(*args, **kwargs)
881
882 def GetWidth(*args, **kwargs):
883 """GetWidth(self) -> int"""
884 return _core_.Size_GetWidth(*args, **kwargs)
885
886 def GetHeight(*args, **kwargs):
887 """GetHeight(self) -> int"""
888 return _core_.Size_GetHeight(*args, **kwargs)
889
890 def IsFullySpecified(*args, **kwargs):
891 """
892 IsFullySpecified(self) -> bool
893
894 Returns True if both components of the size are non-default values.
895 """
896 return _core_.Size_IsFullySpecified(*args, **kwargs)
897
898 def SetDefaults(*args, **kwargs):
899 """
900 SetDefaults(self, Size size)
901
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
904 """
905 return _core_.Size_SetDefaults(*args, **kwargs)
906
907 def Get(*args, **kwargs):
908 """
909 Get() -> (width,height)
910
911 Returns the width and height properties as a tuple.
912 """
913 return _core_.Size_Get(*args, **kwargs)
914
915 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
916 def __str__(self): return str(self.Get())
917 def __repr__(self): return 'wx.Size'+str(self.Get())
918 def __len__(self): return len(self.Get())
919 def __getitem__(self, index): return self.Get()[index]
920 def __setitem__(self, index, val):
921 if index == 0: self.width = val
922 elif index == 1: self.height = val
923 else: raise IndexError
924 def __nonzero__(self): return self.Get() != (0,0)
925 __safe_for_unpickling__ = True
926 def __reduce__(self): return (wx.Size, self.Get())
927
928 _core_.Size_swigregister(Size)
929
930 #---------------------------------------------------------------------------
931
932 class RealPoint(object):
933 """
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
937 """
938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
939 __repr__ = _swig_repr
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
942 def __init__(self, *args, **kwargs):
943 """
944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
945
946 Create a wx.RealPoint object
947 """
948 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
949 __swig_destroy__ = _core_.delete_RealPoint
950 __del__ = lambda self : None;
951 def __eq__(*args, **kwargs):
952 """
953 __eq__(self, PyObject other) -> bool
954
955 Test for equality of wx.RealPoint objects.
956 """
957 return _core_.RealPoint___eq__(*args, **kwargs)
958
959 def __ne__(*args, **kwargs):
960 """
961 __ne__(self, PyObject other) -> bool
962
963 Test for inequality of wx.RealPoint objects.
964 """
965 return _core_.RealPoint___ne__(*args, **kwargs)
966
967 def __add__(*args, **kwargs):
968 """
969 __add__(self, RealPoint pt) -> RealPoint
970
971 Add pt's proprties to this and return the result.
972 """
973 return _core_.RealPoint___add__(*args, **kwargs)
974
975 def __sub__(*args, **kwargs):
976 """
977 __sub__(self, RealPoint pt) -> RealPoint
978
979 Subtract pt's proprties from this and return the result
980 """
981 return _core_.RealPoint___sub__(*args, **kwargs)
982
983 def Set(*args, **kwargs):
984 """
985 Set(self, double x, double y)
986
987 Set both the x and y properties
988 """
989 return _core_.RealPoint_Set(*args, **kwargs)
990
991 def Get(*args, **kwargs):
992 """
993 Get() -> (x,y)
994
995 Return the x and y properties as a tuple.
996 """
997 return _core_.RealPoint_Get(*args, **kwargs)
998
999 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1000 def __str__(self): return str(self.Get())
1001 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1002 def __len__(self): return len(self.Get())
1003 def __getitem__(self, index): return self.Get()[index]
1004 def __setitem__(self, index, val):
1005 if index == 0: self.x = val
1006 elif index == 1: self.y = val
1007 else: raise IndexError
1008 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1009 __safe_for_unpickling__ = True
1010 def __reduce__(self): return (wx.RealPoint, self.Get())
1011
1012 _core_.RealPoint_swigregister(RealPoint)
1013
1014 #---------------------------------------------------------------------------
1015
1016 class Point(object):
1017 """
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
1021 """
1022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1023 __repr__ = _swig_repr
1024 x = property(_core_.Point_x_get, _core_.Point_x_set)
1025 y = property(_core_.Point_y_get, _core_.Point_y_set)
1026 def __init__(self, *args, **kwargs):
1027 """
1028 __init__(self, int x=0, int y=0) -> Point
1029
1030 Create a wx.Point object
1031 """
1032 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1033 __swig_destroy__ = _core_.delete_Point
1034 __del__ = lambda self : None;
1035 def __eq__(*args, **kwargs):
1036 """
1037 __eq__(self, PyObject other) -> bool
1038
1039 Test for equality of wx.Point objects.
1040 """
1041 return _core_.Point___eq__(*args, **kwargs)
1042
1043 def __ne__(*args, **kwargs):
1044 """
1045 __ne__(self, PyObject other) -> bool
1046
1047 Test for inequality of wx.Point objects.
1048 """
1049 return _core_.Point___ne__(*args, **kwargs)
1050
1051 def __add__(*args, **kwargs):
1052 """
1053 __add__(self, Point pt) -> Point
1054
1055 Add pt's proprties to this and return the result.
1056 """
1057 return _core_.Point___add__(*args, **kwargs)
1058
1059 def __sub__(*args, **kwargs):
1060 """
1061 __sub__(self, Point pt) -> Point
1062
1063 Subtract pt's proprties from this and return the result
1064 """
1065 return _core_.Point___sub__(*args, **kwargs)
1066
1067 def __iadd__(*args, **kwargs):
1068 """
1069 __iadd__(self, Point pt) -> Point
1070
1071 Add pt to this object.
1072 """
1073 return _core_.Point___iadd__(*args, **kwargs)
1074
1075 def __isub__(*args, **kwargs):
1076 """
1077 __isub__(self, Point pt) -> Point
1078
1079 Subtract pt from this object.
1080 """
1081 return _core_.Point___isub__(*args, **kwargs)
1082
1083 def Set(*args, **kwargs):
1084 """
1085 Set(self, long x, long y)
1086
1087 Set both the x and y properties
1088 """
1089 return _core_.Point_Set(*args, **kwargs)
1090
1091 def Get(*args, **kwargs):
1092 """
1093 Get() -> (x,y)
1094
1095 Return the x and y properties as a tuple.
1096 """
1097 return _core_.Point_Get(*args, **kwargs)
1098
1099 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1100 def __str__(self): return str(self.Get())
1101 def __repr__(self): return 'wx.Point'+str(self.Get())
1102 def __len__(self): return len(self.Get())
1103 def __getitem__(self, index): return self.Get()[index]
1104 def __setitem__(self, index, val):
1105 if index == 0: self.x = val
1106 elif index == 1: self.y = val
1107 else: raise IndexError
1108 def __nonzero__(self): return self.Get() != (0,0)
1109 __safe_for_unpickling__ = True
1110 def __reduce__(self): return (wx.Point, self.Get())
1111
1112 _core_.Point_swigregister(Point)
1113
1114 #---------------------------------------------------------------------------
1115
1116 class Rect(object):
1117 """
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
1121 """
1122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1123 __repr__ = _swig_repr
1124 def __init__(self, *args, **kwargs):
1125 """
1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1127
1128 Create a new Rect object.
1129 """
1130 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1131 __swig_destroy__ = _core_.delete_Rect
1132 __del__ = lambda self : None;
1133 def GetX(*args, **kwargs):
1134 """GetX(self) -> int"""
1135 return _core_.Rect_GetX(*args, **kwargs)
1136
1137 def SetX(*args, **kwargs):
1138 """SetX(self, int x)"""
1139 return _core_.Rect_SetX(*args, **kwargs)
1140
1141 def GetY(*args, **kwargs):
1142 """GetY(self) -> int"""
1143 return _core_.Rect_GetY(*args, **kwargs)
1144
1145 def SetY(*args, **kwargs):
1146 """SetY(self, int y)"""
1147 return _core_.Rect_SetY(*args, **kwargs)
1148
1149 def GetWidth(*args, **kwargs):
1150 """GetWidth(self) -> int"""
1151 return _core_.Rect_GetWidth(*args, **kwargs)
1152
1153 def SetWidth(*args, **kwargs):
1154 """SetWidth(self, int w)"""
1155 return _core_.Rect_SetWidth(*args, **kwargs)
1156
1157 def GetHeight(*args, **kwargs):
1158 """GetHeight(self) -> int"""
1159 return _core_.Rect_GetHeight(*args, **kwargs)
1160
1161 def SetHeight(*args, **kwargs):
1162 """SetHeight(self, int h)"""
1163 return _core_.Rect_SetHeight(*args, **kwargs)
1164
1165 def GetPosition(*args, **kwargs):
1166 """GetPosition(self) -> Point"""
1167 return _core_.Rect_GetPosition(*args, **kwargs)
1168
1169 def SetPosition(*args, **kwargs):
1170 """SetPosition(self, Point p)"""
1171 return _core_.Rect_SetPosition(*args, **kwargs)
1172
1173 def GetSize(*args, **kwargs):
1174 """GetSize(self) -> Size"""
1175 return _core_.Rect_GetSize(*args, **kwargs)
1176
1177 def SetSize(*args, **kwargs):
1178 """SetSize(self, Size s)"""
1179 return _core_.Rect_SetSize(*args, **kwargs)
1180
1181 def IsEmpty(*args, **kwargs):
1182 """IsEmpty(self) -> bool"""
1183 return _core_.Rect_IsEmpty(*args, **kwargs)
1184
1185 def GetTopLeft(*args, **kwargs):
1186 """GetTopLeft(self) -> Point"""
1187 return _core_.Rect_GetTopLeft(*args, **kwargs)
1188
1189 def SetTopLeft(*args, **kwargs):
1190 """SetTopLeft(self, Point p)"""
1191 return _core_.Rect_SetTopLeft(*args, **kwargs)
1192
1193 def GetBottomRight(*args, **kwargs):
1194 """GetBottomRight(self) -> Point"""
1195 return _core_.Rect_GetBottomRight(*args, **kwargs)
1196
1197 def SetBottomRight(*args, **kwargs):
1198 """SetBottomRight(self, Point p)"""
1199 return _core_.Rect_SetBottomRight(*args, **kwargs)
1200
1201 def GetTopRight(*args, **kwargs):
1202 """GetTopRight(self) -> Point"""
1203 return _core_.Rect_GetTopRight(*args, **kwargs)
1204
1205 def SetTopRight(*args, **kwargs):
1206 """SetTopRight(self, Point p)"""
1207 return _core_.Rect_SetTopRight(*args, **kwargs)
1208
1209 def GetBottomLeft(*args, **kwargs):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1212
1213 def SetBottomLeft(*args, **kwargs):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1216
1217 def GetLeft(*args, **kwargs):
1218 """GetLeft(self) -> int"""
1219 return _core_.Rect_GetLeft(*args, **kwargs)
1220
1221 def GetTop(*args, **kwargs):
1222 """GetTop(self) -> int"""
1223 return _core_.Rect_GetTop(*args, **kwargs)
1224
1225 def GetBottom(*args, **kwargs):
1226 """GetBottom(self) -> int"""
1227 return _core_.Rect_GetBottom(*args, **kwargs)
1228
1229 def GetRight(*args, **kwargs):
1230 """GetRight(self) -> int"""
1231 return _core_.Rect_GetRight(*args, **kwargs)
1232
1233 def SetLeft(*args, **kwargs):
1234 """SetLeft(self, int left)"""
1235 return _core_.Rect_SetLeft(*args, **kwargs)
1236
1237 def SetRight(*args, **kwargs):
1238 """SetRight(self, int right)"""
1239 return _core_.Rect_SetRight(*args, **kwargs)
1240
1241 def SetTop(*args, **kwargs):
1242 """SetTop(self, int top)"""
1243 return _core_.Rect_SetTop(*args, **kwargs)
1244
1245 def SetBottom(*args, **kwargs):
1246 """SetBottom(self, int bottom)"""
1247 return _core_.Rect_SetBottom(*args, **kwargs)
1248
1249 position = property(GetPosition, SetPosition)
1250 size = property(GetSize, SetSize)
1251 left = property(GetLeft, SetLeft)
1252 right = property(GetRight, SetRight)
1253 top = property(GetTop, SetTop)
1254 bottom = property(GetBottom, SetBottom)
1255
1256 def Inflate(*args, **kwargs):
1257 """
1258 Inflate(self, int dx, int dy) -> Rect
1259
1260 Increases the size of the rectangle.
1261
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1268 direction.
1269
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1272 first::
1273
1274 copy = wx.Rect(*original)
1275 copy.Inflate(10,15)
1276
1277
1278 """
1279 return _core_.Rect_Inflate(*args, **kwargs)
1280
1281 def Deflate(*args, **kwargs):
1282 """
1283 Deflate(self, int dx, int dy) -> Rect
1284
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
1288 """
1289 return _core_.Rect_Deflate(*args, **kwargs)
1290
1291 def OffsetXY(*args, **kwargs):
1292 """
1293 OffsetXY(self, int dx, int dy)
1294
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
1298 """
1299 return _core_.Rect_OffsetXY(*args, **kwargs)
1300
1301 def Offset(*args, **kwargs):
1302 """
1303 Offset(self, Point pt)
1304
1305 Same as `OffsetXY` but uses dx,dy from Point
1306 """
1307 return _core_.Rect_Offset(*args, **kwargs)
1308
1309 def Intersect(*args, **kwargs):
1310 """
1311 Intersect(self, Rect rect) -> Rect
1312
1313 Returns the intersectsion of this rectangle and rect.
1314 """
1315 return _core_.Rect_Intersect(*args, **kwargs)
1316
1317 def Union(*args, **kwargs):
1318 """
1319 Union(self, Rect rect) -> Rect
1320
1321 Returns the union of this rectangle and rect.
1322 """
1323 return _core_.Rect_Union(*args, **kwargs)
1324
1325 def __add__(*args, **kwargs):
1326 """
1327 __add__(self, Rect rect) -> Rect
1328
1329 Add the properties of rect to this rectangle and return the result.
1330 """
1331 return _core_.Rect___add__(*args, **kwargs)
1332
1333 def __iadd__(*args, **kwargs):
1334 """
1335 __iadd__(self, Rect rect) -> Rect
1336
1337 Add the properties of rect to this rectangle, updating this rectangle.
1338 """
1339 return _core_.Rect___iadd__(*args, **kwargs)
1340
1341 def __eq__(*args, **kwargs):
1342 """
1343 __eq__(self, PyObject other) -> bool
1344
1345 Test for equality of wx.Rect objects.
1346 """
1347 return _core_.Rect___eq__(*args, **kwargs)
1348
1349 def __ne__(*args, **kwargs):
1350 """
1351 __ne__(self, PyObject other) -> bool
1352
1353 Test for inequality of wx.Rect objects.
1354 """
1355 return _core_.Rect___ne__(*args, **kwargs)
1356
1357 def ContainsXY(*args, **kwargs):
1358 """
1359 ContainsXY(self, int x, int y) -> bool
1360
1361 Return True if the point is inside the rect.
1362 """
1363 return _core_.Rect_ContainsXY(*args, **kwargs)
1364
1365 def Contains(*args, **kwargs):
1366 """
1367 Contains(self, Point pt) -> bool
1368
1369 Return True if the point is inside the rect.
1370 """
1371 return _core_.Rect_Contains(*args, **kwargs)
1372
1373 def ContainsRect(*args, **kwargs):
1374 """
1375 ContainsRect(self, Rect rect) -> bool
1376
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1379 """
1380 return _core_.Rect_ContainsRect(*args, **kwargs)
1381
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1385 Inside = Contains
1386 InsideXY = ContainsXY
1387 InsideRect = ContainsRect
1388
1389 def Intersects(*args, **kwargs):
1390 """
1391 Intersects(self, Rect rect) -> bool
1392
1393 Returns True if the rectangles have a non empty intersection.
1394 """
1395 return _core_.Rect_Intersects(*args, **kwargs)
1396
1397 def CenterIn(*args, **kwargs):
1398 """
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1400
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1403 """
1404 return _core_.Rect_CenterIn(*args, **kwargs)
1405
1406 CentreIn = CenterIn
1407 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1408 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1409 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1410 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1411 def Set(*args, **kwargs):
1412 """
1413 Set(self, int x=0, int y=0, int width=0, int height=0)
1414
1415 Set all rectangle properties.
1416 """
1417 return _core_.Rect_Set(*args, **kwargs)
1418
1419 def Get(*args, **kwargs):
1420 """
1421 Get() -> (x,y,width,height)
1422
1423 Return the rectangle properties as a tuple.
1424 """
1425 return _core_.Rect_Get(*args, **kwargs)
1426
1427 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1428 def __str__(self): return str(self.Get())
1429 def __repr__(self): return 'wx.Rect'+str(self.Get())
1430 def __len__(self): return len(self.Get())
1431 def __getitem__(self, index): return self.Get()[index]
1432 def __setitem__(self, index, val):
1433 if index == 0: self.x = val
1434 elif index == 1: self.y = val
1435 elif index == 2: self.width = val
1436 elif index == 3: self.height = val
1437 else: raise IndexError
1438 def __nonzero__(self): return self.Get() != (0,0,0,0)
1439 __safe_for_unpickling__ = True
1440 def __reduce__(self): return (wx.Rect, self.Get())
1441
1442 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1443 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
1444 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
1445 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1446 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1447 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1448 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1449 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1450 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1451 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
1452 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
1453 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1454 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1455 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1456 Empty = property(IsEmpty,doc="See `IsEmpty`")
1457 _core_.Rect_swigregister(Rect)
1458
1459 def RectPP(*args, **kwargs):
1460 """
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
1462
1463 Create a new Rect object from Points representing two corners.
1464 """
1465 val = _core_.new_RectPP(*args, **kwargs)
1466 return val
1467
1468 def RectPS(*args, **kwargs):
1469 """
1470 RectPS(Point pos, Size size) -> Rect
1471
1472 Create a new Rect from a position and size.
1473 """
1474 val = _core_.new_RectPS(*args, **kwargs)
1475 return val
1476
1477 def RectS(*args, **kwargs):
1478 """
1479 RectS(Size size) -> Rect
1480
1481 Create a new Rect from a size only.
1482 """
1483 val = _core_.new_RectS(*args, **kwargs)
1484 return val
1485
1486
1487 def IntersectRect(*args, **kwargs):
1488 """
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1490
1491 Calculate and return the intersection of r1 and r2.
1492 """
1493 return _core_.IntersectRect(*args, **kwargs)
1494 #---------------------------------------------------------------------------
1495
1496 class Point2D(object):
1497 """
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1500 """
1501 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1502 __repr__ = _swig_repr
1503 def __init__(self, *args, **kwargs):
1504 """
1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
1506
1507 Create a w.Point2D object.
1508 """
1509 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1510 __swig_destroy__ = _core_.delete_Point2D
1511 __del__ = lambda self : None;
1512 def GetFloor(*args, **kwargs):
1513 """
1514 GetFloor() -> (x,y)
1515
1516 Convert to integer
1517 """
1518 return _core_.Point2D_GetFloor(*args, **kwargs)
1519
1520 def GetRounded(*args, **kwargs):
1521 """
1522 GetRounded() -> (x,y)
1523
1524 Convert to integer
1525 """
1526 return _core_.Point2D_GetRounded(*args, **kwargs)
1527
1528 def GetVectorLength(*args, **kwargs):
1529 """GetVectorLength(self) -> double"""
1530 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1531
1532 def GetVectorAngle(*args, **kwargs):
1533 """GetVectorAngle(self) -> double"""
1534 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1535
1536 def SetVectorLength(*args, **kwargs):
1537 """SetVectorLength(self, double length)"""
1538 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1539
1540 def SetVectorAngle(*args, **kwargs):
1541 """SetVectorAngle(self, double degrees)"""
1542 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1543
1544 def SetPolarCoordinates(self, angle, length):
1545 self.SetVectorLength(length)
1546 self.SetVectorAngle(angle)
1547 def Normalize(self):
1548 self.SetVectorLength(1.0)
1549
1550 def GetDistance(*args, **kwargs):
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_.Point2D_GetDistance(*args, **kwargs)
1553
1554 def GetDistanceSquare(*args, **kwargs):
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1557
1558 def GetDotProduct(*args, **kwargs):
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1561
1562 def GetCrossProduct(*args, **kwargs):
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1565
1566 def __neg__(*args, **kwargs):
1567 """
1568 __neg__(self) -> Point2D
1569
1570 the reflection of this point
1571 """
1572 return _core_.Point2D___neg__(*args, **kwargs)
1573
1574 def __iadd__(*args, **kwargs):
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___iadd__(*args, **kwargs)
1577
1578 def __isub__(*args, **kwargs):
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___isub__(*args, **kwargs)
1581
1582 def __imul__(*args, **kwargs):
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_.Point2D___imul__(*args, **kwargs)
1585
1586 def __idiv__(*args, **kwargs):
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_.Point2D___idiv__(*args, **kwargs)
1589
1590 def __eq__(*args, **kwargs):
1591 """
1592 __eq__(self, PyObject other) -> bool
1593
1594 Test for equality of wx.Point2D objects.
1595 """
1596 return _core_.Point2D___eq__(*args, **kwargs)
1597
1598 def __ne__(*args, **kwargs):
1599 """
1600 __ne__(self, PyObject other) -> bool
1601
1602 Test for inequality of wx.Point2D objects.
1603 """
1604 return _core_.Point2D___ne__(*args, **kwargs)
1605
1606 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1607 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1608 def Set(*args, **kwargs):
1609 """Set(self, double x=0, double y=0)"""
1610 return _core_.Point2D_Set(*args, **kwargs)
1611
1612 def Get(*args, **kwargs):
1613 """
1614 Get() -> (x,y)
1615
1616 Return x and y properties as a tuple.
1617 """
1618 return _core_.Point2D_Get(*args, **kwargs)
1619
1620 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1621 def __str__(self): return str(self.Get())
1622 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1623 def __len__(self): return len(self.Get())
1624 def __getitem__(self, index): return self.Get()[index]
1625 def __setitem__(self, index, val):
1626 if index == 0: self.x = val
1627 elif index == 1: self.y = val
1628 else: raise IndexError
1629 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1630 __safe_for_unpickling__ = True
1631 def __reduce__(self): return (wx.Point2D, self.Get())
1632
1633 Floor = property(GetFloor,doc="See `GetFloor`")
1634 Rounded = property(GetRounded,doc="See `GetRounded`")
1635 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
1637 _core_.Point2D_swigregister(Point2D)
1638
1639 def Point2DCopy(*args, **kwargs):
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
1642
1643 Create a w.Point2D object.
1644 """
1645 val = _core_.new_Point2DCopy(*args, **kwargs)
1646 return val
1647
1648 def Point2DFromPoint(*args, **kwargs):
1649 """
1650 Point2DFromPoint(Point pt) -> Point2D
1651
1652 Create a w.Point2D object.
1653 """
1654 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1655 return val
1656
1657 #---------------------------------------------------------------------------
1658
1659 Inside = _core_.Inside
1660 OutLeft = _core_.OutLeft
1661 OutRight = _core_.OutRight
1662 OutTop = _core_.OutTop
1663 OutBottom = _core_.OutBottom
1664 class Rect2D(object):
1665 """
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1668 """
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 __repr__ = _swig_repr
1671 def __init__(self, *args, **kwargs):
1672 """
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1674
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1677 """
1678 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1679 __swig_destroy__ = _core_.delete_Rect2D
1680 __del__ = lambda self : None;
1681 def GetPosition(*args, **kwargs):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_.Rect2D_GetPosition(*args, **kwargs)
1684
1685 def GetSize(*args, **kwargs):
1686 """GetSize(self) -> Size"""
1687 return _core_.Rect2D_GetSize(*args, **kwargs)
1688
1689 def GetLeft(*args, **kwargs):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_.Rect2D_GetLeft(*args, **kwargs)
1692
1693 def SetLeft(*args, **kwargs):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_.Rect2D_SetLeft(*args, **kwargs)
1696
1697 def MoveLeftTo(*args, **kwargs):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1700
1701 def GetTop(*args, **kwargs):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_.Rect2D_GetTop(*args, **kwargs)
1704
1705 def SetTop(*args, **kwargs):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_.Rect2D_SetTop(*args, **kwargs)
1708
1709 def MoveTopTo(*args, **kwargs):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1712
1713 def GetBottom(*args, **kwargs):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_.Rect2D_GetBottom(*args, **kwargs)
1716
1717 def SetBottom(*args, **kwargs):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_.Rect2D_SetBottom(*args, **kwargs)
1720
1721 def MoveBottomTo(*args, **kwargs):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1724
1725 def GetRight(*args, **kwargs):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_.Rect2D_GetRight(*args, **kwargs)
1728
1729 def SetRight(*args, **kwargs):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_.Rect2D_SetRight(*args, **kwargs)
1732
1733 def MoveRightTo(*args, **kwargs):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1736
1737 def GetLeftTop(*args, **kwargs):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1740
1741 def SetLeftTop(*args, **kwargs):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1744
1745 def MoveLeftTopTo(*args, **kwargs):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1748
1749 def GetLeftBottom(*args, **kwargs):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1752
1753 def SetLeftBottom(*args, **kwargs):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1756
1757 def MoveLeftBottomTo(*args, **kwargs):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1760
1761 def GetRightTop(*args, **kwargs):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1764
1765 def SetRightTop(*args, **kwargs):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1768
1769 def MoveRightTopTo(*args, **kwargs):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1772
1773 def GetRightBottom(*args, **kwargs):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1776
1777 def SetRightBottom(*args, **kwargs):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1780
1781 def MoveRightBottomTo(*args, **kwargs):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1784
1785 def GetCentre(*args, **kwargs):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_.Rect2D_GetCentre(*args, **kwargs)
1788
1789 def SetCentre(*args, **kwargs):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_.Rect2D_SetCentre(*args, **kwargs)
1792
1793 def MoveCentreTo(*args, **kwargs):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1796
1797 def GetOutcode(*args, **kwargs):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1800
1801 def Contains(*args, **kwargs):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_.Rect2D_Contains(*args, **kwargs)
1804
1805 def ContainsRect(*args, **kwargs):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1808
1809 def IsEmpty(*args, **kwargs):
1810 """IsEmpty(self) -> bool"""
1811 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1812
1813 def HaveEqualSize(*args, **kwargs):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1816
1817 def Inset(*args):
1818 """
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1821 """
1822 return _core_.Rect2D_Inset(*args)
1823
1824 def Offset(*args, **kwargs):
1825 """Offset(self, Point2D pt)"""
1826 return _core_.Rect2D_Offset(*args, **kwargs)
1827
1828 def ConstrainTo(*args, **kwargs):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1831
1832 def Interpolate(*args, **kwargs):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_.Rect2D_Interpolate(*args, **kwargs)
1835
1836 def Intersect(*args, **kwargs):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_.Rect2D_Intersect(*args, **kwargs)
1839
1840 def CreateIntersection(*args, **kwargs):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1843
1844 def Intersects(*args, **kwargs):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_.Rect2D_Intersects(*args, **kwargs)
1847
1848 def Union(*args, **kwargs):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_.Rect2D_Union(*args, **kwargs)
1851
1852 def CreateUnion(*args, **kwargs):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1855
1856 def Scale(*args):
1857 """
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1860 """
1861 return _core_.Rect2D_Scale(*args)
1862
1863 def __eq__(*args, **kwargs):
1864 """
1865 __eq__(self, PyObject other) -> bool
1866
1867 Test for equality of wx.Rect2D objects.
1868 """
1869 return _core_.Rect2D___eq__(*args, **kwargs)
1870
1871 def __ne__(*args, **kwargs):
1872 """
1873 __ne__(self, PyObject other) -> bool
1874
1875 Test for inequality of wx.Rect2D objects.
1876 """
1877 return _core_.Rect2D___ne__(*args, **kwargs)
1878
1879 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1880 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1881 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1882 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1883 def Set(*args, **kwargs):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_.Rect2D_Set(*args, **kwargs)
1886
1887 def Get(*args, **kwargs):
1888 """
1889 Get() -> (x,y, width, height)
1890
1891 Return x, y, width and height y properties as a tuple.
1892 """
1893 return _core_.Rect2D_Get(*args, **kwargs)
1894
1895 def __str__(self): return str(self.Get())
1896 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1897 def __len__(self): return len(self.Get())
1898 def __getitem__(self, index): return self.Get()[index]
1899 def __setitem__(self, index, val):
1900 if index == 0: self.x = val
1901 elif index == 1: self.y = val
1902 elif index == 2: self.width = val
1903 elif index == 3: self.height = val
1904 else: raise IndexError
1905 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__ = True
1907 def __reduce__(self): return (wx.Rect2D, self.Get())
1908
1909 _core_.Rect2D_swigregister(Rect2D)
1910
1911 class Position(object):
1912 """Proxy of C++ Position class"""
1913 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1914 __repr__ = _swig_repr
1915 def __init__(self, *args, **kwargs):
1916 """__init__(self, int row=0, int col=0) -> Position"""
1917 _core_.Position_swiginit(self,_core_.new_Position(*args, **kwargs))
1918 __swig_destroy__ = _core_.delete_Position
1919 __del__ = lambda self : None;
1920 def GetRow(*args, **kwargs):
1921 """GetRow(self) -> int"""
1922 return _core_.Position_GetRow(*args, **kwargs)
1923
1924 def GetColumn(*args, **kwargs):
1925 """GetColumn(self) -> int"""
1926 return _core_.Position_GetColumn(*args, **kwargs)
1927
1928 def GetCol(*args, **kwargs):
1929 """GetCol(self) -> int"""
1930 return _core_.Position_GetCol(*args, **kwargs)
1931
1932 def SetRow(*args, **kwargs):
1933 """SetRow(self, int row)"""
1934 return _core_.Position_SetRow(*args, **kwargs)
1935
1936 def SetColumn(*args, **kwargs):
1937 """SetColumn(self, int column)"""
1938 return _core_.Position_SetColumn(*args, **kwargs)
1939
1940 def SetCol(*args, **kwargs):
1941 """SetCol(self, int column)"""
1942 return _core_.Position_SetCol(*args, **kwargs)
1943
1944 def __eq__(*args, **kwargs):
1945 """
1946 __eq__(self, PyObject other) -> bool
1947
1948 Test for equality of wx.Position objects.
1949 """
1950 return _core_.Position___eq__(*args, **kwargs)
1951
1952 def __ne__(*args, **kwargs):
1953 """
1954 __ne__(self, PyObject other) -> bool
1955
1956 Test for inequality of wx.Position objects.
1957 """
1958 return _core_.Position___ne__(*args, **kwargs)
1959
1960 def __add__(*args):
1961 """
1962 __add__(self, Position p) -> Position
1963 __add__(self, Size s) -> Position
1964 """
1965 return _core_.Position___add__(*args)
1966
1967 def __sub__(*args):
1968 """
1969 __sub__(self, Position p) -> Position
1970 __sub__(self, Size s) -> Position
1971 """
1972 return _core_.Position___sub__(*args)
1973
1974 row = property(GetRow,SetRow)
1975 col = property(GetCol,SetCol)
1976 _core_.Position_swigregister(Position)
1977
1978 #---------------------------------------------------------------------------
1979
1980 FromStart = _core_.FromStart
1981 FromCurrent = _core_.FromCurrent
1982 FromEnd = _core_.FromEnd
1983 class InputStream(object):
1984 """Proxy of C++ InputStream class"""
1985 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1986 __repr__ = _swig_repr
1987 def __init__(self, *args, **kwargs):
1988 """__init__(self, PyObject p) -> InputStream"""
1989 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1990 __swig_destroy__ = _core_.delete_InputStream
1991 __del__ = lambda self : None;
1992 def close(*args, **kwargs):
1993 """close(self)"""
1994 return _core_.InputStream_close(*args, **kwargs)
1995
1996 def flush(*args, **kwargs):
1997 """flush(self)"""
1998 return _core_.InputStream_flush(*args, **kwargs)
1999
2000 def eof(*args, **kwargs):
2001 """eof(self) -> bool"""
2002 return _core_.InputStream_eof(*args, **kwargs)
2003
2004 def read(*args, **kwargs):
2005 """read(self, int size=-1) -> PyObject"""
2006 return _core_.InputStream_read(*args, **kwargs)
2007
2008 def readline(*args, **kwargs):
2009 """readline(self, int size=-1) -> PyObject"""
2010 return _core_.InputStream_readline(*args, **kwargs)
2011
2012 def readlines(*args, **kwargs):
2013 """readlines(self, int sizehint=-1) -> PyObject"""
2014 return _core_.InputStream_readlines(*args, **kwargs)
2015
2016 def seek(*args, **kwargs):
2017 """seek(self, int offset, int whence=0)"""
2018 return _core_.InputStream_seek(*args, **kwargs)
2019
2020 def tell(*args, **kwargs):
2021 """tell(self) -> int"""
2022 return _core_.InputStream_tell(*args, **kwargs)
2023
2024 def Peek(*args, **kwargs):
2025 """Peek(self) -> char"""
2026 return _core_.InputStream_Peek(*args, **kwargs)
2027
2028 def GetC(*args, **kwargs):
2029 """GetC(self) -> char"""
2030 return _core_.InputStream_GetC(*args, **kwargs)
2031
2032 def LastRead(*args, **kwargs):
2033 """LastRead(self) -> size_t"""
2034 return _core_.InputStream_LastRead(*args, **kwargs)
2035
2036 def CanRead(*args, **kwargs):
2037 """CanRead(self) -> bool"""
2038 return _core_.InputStream_CanRead(*args, **kwargs)
2039
2040 def Eof(*args, **kwargs):
2041 """Eof(self) -> bool"""
2042 return _core_.InputStream_Eof(*args, **kwargs)
2043
2044 def Ungetch(*args, **kwargs):
2045 """Ungetch(self, char c) -> bool"""
2046 return _core_.InputStream_Ungetch(*args, **kwargs)
2047
2048 def SeekI(*args, **kwargs):
2049 """SeekI(self, long pos, int mode=FromStart) -> long"""
2050 return _core_.InputStream_SeekI(*args, **kwargs)
2051
2052 def TellI(*args, **kwargs):
2053 """TellI(self) -> long"""
2054 return _core_.InputStream_TellI(*args, **kwargs)
2055
2056 _core_.InputStream_swigregister(InputStream)
2057 DefaultPosition = cvar.DefaultPosition
2058 DefaultSize = cvar.DefaultSize
2059
2060 class OutputStream(object):
2061 """Proxy of C++ OutputStream class"""
2062 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2063 def __init__(self): raise AttributeError, "No constructor defined"
2064 __repr__ = _swig_repr
2065 def write(*args, **kwargs):
2066 """write(self, PyObject obj)"""
2067 return _core_.OutputStream_write(*args, **kwargs)
2068
2069 def LastWrite(*args, **kwargs):
2070 """LastWrite(self) -> size_t"""
2071 return _core_.OutputStream_LastWrite(*args, **kwargs)
2072
2073 _core_.OutputStream_swigregister(OutputStream)
2074
2075 #---------------------------------------------------------------------------
2076
2077 class FSFile(Object):
2078 """Proxy of C++ FSFile class"""
2079 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2080 __repr__ = _swig_repr
2081 def __init__(self, *args, **kwargs):
2082 """
2083 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2084 DateTime modif) -> FSFile
2085 """
2086 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
2087 __swig_destroy__ = _core_.delete_FSFile
2088 __del__ = lambda self : None;
2089 def GetStream(*args, **kwargs):
2090 """GetStream(self) -> InputStream"""
2091 return _core_.FSFile_GetStream(*args, **kwargs)
2092
2093 def DetachStream(*args, **kwargs):
2094 """DetachStream(self)"""
2095 return _core_.FSFile_DetachStream(*args, **kwargs)
2096
2097 def GetMimeType(*args, **kwargs):
2098 """GetMimeType(self) -> String"""
2099 return _core_.FSFile_GetMimeType(*args, **kwargs)
2100
2101 def GetLocation(*args, **kwargs):
2102 """GetLocation(self) -> String"""
2103 return _core_.FSFile_GetLocation(*args, **kwargs)
2104
2105 def GetAnchor(*args, **kwargs):
2106 """GetAnchor(self) -> String"""
2107 return _core_.FSFile_GetAnchor(*args, **kwargs)
2108
2109 def GetModificationTime(*args, **kwargs):
2110 """GetModificationTime(self) -> DateTime"""
2111 return _core_.FSFile_GetModificationTime(*args, **kwargs)
2112
2113 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2114 Location = property(GetLocation,doc="See `GetLocation`")
2115 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2116 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2117 Stream = property(GetStream,doc="See `GetStream`")
2118 _core_.FSFile_swigregister(FSFile)
2119
2120 class CPPFileSystemHandler(object):
2121 """Proxy of C++ CPPFileSystemHandler class"""
2122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2123 def __init__(self): raise AttributeError, "No constructor defined"
2124 __repr__ = _swig_repr
2125 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2126 __del__ = lambda self : None;
2127 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
2128
2129 class FileSystemHandler(CPPFileSystemHandler):
2130 """Proxy of C++ FileSystemHandler class"""
2131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2132 __repr__ = _swig_repr
2133 def __init__(self, *args, **kwargs):
2134 """__init__(self) -> FileSystemHandler"""
2135 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
2136 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
2137
2138 def _setCallbackInfo(*args, **kwargs):
2139 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2140 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
2141
2142 def CanOpen(*args, **kwargs):
2143 """CanOpen(self, String location) -> bool"""
2144 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
2145
2146 def OpenFile(*args, **kwargs):
2147 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2148 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
2149
2150 def FindFirst(*args, **kwargs):
2151 """FindFirst(self, String spec, int flags=0) -> String"""
2152 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
2153
2154 def FindNext(*args, **kwargs):
2155 """FindNext(self) -> String"""
2156 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
2157
2158 def GetProtocol(*args, **kwargs):
2159 """GetProtocol(self, String location) -> String"""
2160 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
2161
2162 def GetLeftLocation(*args, **kwargs):
2163 """GetLeftLocation(self, String location) -> String"""
2164 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
2165
2166 def GetAnchor(*args, **kwargs):
2167 """GetAnchor(self, String location) -> String"""
2168 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
2169
2170 def GetRightLocation(*args, **kwargs):
2171 """GetRightLocation(self, String location) -> String"""
2172 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
2173
2174 def GetMimeTypeFromExt(*args, **kwargs):
2175 """GetMimeTypeFromExt(self, String location) -> String"""
2176 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
2177
2178 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2179 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2180 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2181 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2182 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2183 _core_.FileSystemHandler_swigregister(FileSystemHandler)
2184
2185 class FileSystem(Object):
2186 """Proxy of C++ FileSystem class"""
2187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2188 __repr__ = _swig_repr
2189 def __init__(self, *args, **kwargs):
2190 """__init__(self) -> FileSystem"""
2191 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2192 __swig_destroy__ = _core_.delete_FileSystem
2193 __del__ = lambda self : None;
2194 def ChangePathTo(*args, **kwargs):
2195 """ChangePathTo(self, String location, bool is_dir=False)"""
2196 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
2197
2198 def GetPath(*args, **kwargs):
2199 """GetPath(self) -> String"""
2200 return _core_.FileSystem_GetPath(*args, **kwargs)
2201
2202 def OpenFile(*args, **kwargs):
2203 """OpenFile(self, String location) -> FSFile"""
2204 return _core_.FileSystem_OpenFile(*args, **kwargs)
2205
2206 def FindFirst(*args, **kwargs):
2207 """FindFirst(self, String spec, int flags=0) -> String"""
2208 return _core_.FileSystem_FindFirst(*args, **kwargs)
2209
2210 def FindNext(*args, **kwargs):
2211 """FindNext(self) -> String"""
2212 return _core_.FileSystem_FindNext(*args, **kwargs)
2213
2214 def AddHandler(*args, **kwargs):
2215 """AddHandler(CPPFileSystemHandler handler)"""
2216 return _core_.FileSystem_AddHandler(*args, **kwargs)
2217
2218 AddHandler = staticmethod(AddHandler)
2219 def RemoveHandler(*args, **kwargs):
2220 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2221 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2222
2223 RemoveHandler = staticmethod(RemoveHandler)
2224 def CleanUpHandlers(*args, **kwargs):
2225 """CleanUpHandlers()"""
2226 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
2227
2228 CleanUpHandlers = staticmethod(CleanUpHandlers)
2229 def FileNameToURL(*args, **kwargs):
2230 """FileNameToURL(String filename) -> String"""
2231 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
2232
2233 FileNameToURL = staticmethod(FileNameToURL)
2234 def URLToFileName(*args, **kwargs):
2235 """URLToFileName(String url) -> String"""
2236 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2237
2238 URLToFileName = staticmethod(URLToFileName)
2239 Path = property(GetPath,doc="See `GetPath`")
2240 _core_.FileSystem_swigregister(FileSystem)
2241
2242 def FileSystem_AddHandler(*args, **kwargs):
2243 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2244 return _core_.FileSystem_AddHandler(*args, **kwargs)
2245
2246 def FileSystem_RemoveHandler(*args, **kwargs):
2247 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2248 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2249
2250 def FileSystem_CleanUpHandlers(*args):
2251 """FileSystem_CleanUpHandlers()"""
2252 return _core_.FileSystem_CleanUpHandlers(*args)
2253
2254 def FileSystem_FileNameToURL(*args, **kwargs):
2255 """FileSystem_FileNameToURL(String filename) -> String"""
2256 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
2257
2258 def FileSystem_URLToFileName(*args, **kwargs):
2259 """FileSystem_URLToFileName(String url) -> String"""
2260 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2261
2262 class InternetFSHandler(CPPFileSystemHandler):
2263 """Proxy of C++ InternetFSHandler class"""
2264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2265 __repr__ = _swig_repr
2266 def __init__(self, *args, **kwargs):
2267 """__init__(self) -> InternetFSHandler"""
2268 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
2269 def CanOpen(*args, **kwargs):
2270 """CanOpen(self, String location) -> bool"""
2271 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
2272
2273 def OpenFile(*args, **kwargs):
2274 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2275 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
2276
2277 _core_.InternetFSHandler_swigregister(InternetFSHandler)
2278
2279 class ZipFSHandler(CPPFileSystemHandler):
2280 """Proxy of C++ ZipFSHandler class"""
2281 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2282 __repr__ = _swig_repr
2283 def __init__(self, *args, **kwargs):
2284 """__init__(self) -> ZipFSHandler"""
2285 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
2286 def CanOpen(*args, **kwargs):
2287 """CanOpen(self, String location) -> bool"""
2288 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
2289
2290 def OpenFile(*args, **kwargs):
2291 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2292 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
2293
2294 def FindFirst(*args, **kwargs):
2295 """FindFirst(self, String spec, int flags=0) -> String"""
2296 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
2297
2298 def FindNext(*args, **kwargs):
2299 """FindNext(self) -> String"""
2300 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
2301
2302 _core_.ZipFSHandler_swigregister(ZipFSHandler)
2303
2304
2305 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
2306 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2307 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
2308
2309 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
2310 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2311 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
2312
2313 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
2314 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2315 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2316 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2317 """
2318 Add 'file' to the memory filesystem. The dataItem parameter can
2319 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2320 arbitrary data. If a bitmap or image is used then the imgType
2321 parameter should specify what kind of image file it should be
2322 written as, wx.BITMAP_TYPE_PNG, etc.
2323 """
2324 if isinstance(dataItem, wx.Image):
2325 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2326 elif isinstance(dataItem, wx.Bitmap):
2327 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2328 elif type(dataItem) == str:
2329 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2330 else:
2331 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2332
2333 class MemoryFSHandler(CPPFileSystemHandler):
2334 """Proxy of C++ MemoryFSHandler class"""
2335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2336 __repr__ = _swig_repr
2337 def __init__(self, *args, **kwargs):
2338 """__init__(self) -> MemoryFSHandler"""
2339 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
2340 def RemoveFile(*args, **kwargs):
2341 """RemoveFile(String filename)"""
2342 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2343
2344 RemoveFile = staticmethod(RemoveFile)
2345 AddFile = staticmethod(MemoryFSHandler_AddFile)
2346 def CanOpen(*args, **kwargs):
2347 """CanOpen(self, String location) -> bool"""
2348 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2349
2350 def OpenFile(*args, **kwargs):
2351 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2352 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2353
2354 def FindFirst(*args, **kwargs):
2355 """FindFirst(self, String spec, int flags=0) -> String"""
2356 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2357
2358 def FindNext(*args, **kwargs):
2359 """FindNext(self) -> String"""
2360 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2361
2362 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
2363
2364 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2365 """MemoryFSHandler_RemoveFile(String filename)"""
2366 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2367
2368 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2369 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2370 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2371 IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2372 IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
2373 #---------------------------------------------------------------------------
2374
2375 class ImageHandler(Object):
2376 """
2377 This is the base class for implementing image file loading/saving, and
2378 image creation from data. It is used within `wx.Image` and is not
2379 normally seen by the application.
2380 """
2381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2382 def __init__(self): raise AttributeError, "No constructor defined"
2383 __repr__ = _swig_repr
2384 def GetName(*args, **kwargs):
2385 """GetName(self) -> String"""
2386 return _core_.ImageHandler_GetName(*args, **kwargs)
2387
2388 def GetExtension(*args, **kwargs):
2389 """GetExtension(self) -> String"""
2390 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2391
2392 def GetType(*args, **kwargs):
2393 """GetType(self) -> long"""
2394 return _core_.ImageHandler_GetType(*args, **kwargs)
2395
2396 def GetMimeType(*args, **kwargs):
2397 """GetMimeType(self) -> String"""
2398 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2399
2400 def CanRead(*args, **kwargs):
2401 """CanRead(self, String name) -> bool"""
2402 return _core_.ImageHandler_CanRead(*args, **kwargs)
2403
2404 def CanReadStream(*args, **kwargs):
2405 """CanReadStream(self, InputStream stream) -> bool"""
2406 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2407
2408 def SetName(*args, **kwargs):
2409 """SetName(self, String name)"""
2410 return _core_.ImageHandler_SetName(*args, **kwargs)
2411
2412 def SetExtension(*args, **kwargs):
2413 """SetExtension(self, String extension)"""
2414 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2415
2416 def SetType(*args, **kwargs):
2417 """SetType(self, long type)"""
2418 return _core_.ImageHandler_SetType(*args, **kwargs)
2419
2420 def SetMimeType(*args, **kwargs):
2421 """SetMimeType(self, String mimetype)"""
2422 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2423
2424 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2425 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2426 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2427 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2428 _core_.ImageHandler_swigregister(ImageHandler)
2429
2430 class PyImageHandler(ImageHandler):
2431 """
2432 This is the base class for implementing image file loading/saving, and
2433 image creation from data, all written in Python. To create a custom
2434 image handler derive a new class from wx.PyImageHandler and provide
2435 the following methods::
2436
2437 def DoCanRead(self, stream) --> bool
2438 '''Check if this handler can read the image on the stream'''
2439
2440 def LoadFile(self, image, stream, verbose, index) --> bool
2441 '''Load image data from the stream and load it into image.'''
2442
2443 def SaveFile(self, image, stream, verbose) --> bool
2444 '''Save the iamge data in image to the stream using
2445 this handler's image file format.'''
2446
2447 def GetImageCount(self, stream) --> int
2448 '''If this image format can hold more than one image,
2449 how many does the image on the stream have?'''
2450
2451 To activate your handler create an instance of it and pass it to
2452 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2453 `SetExtension` from your constructor.
2454
2455 """
2456 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2457 __repr__ = _swig_repr
2458 def __init__(self, *args, **kwargs):
2459 """
2460 __init__(self) -> PyImageHandler
2461
2462 This is the base class for implementing image file loading/saving, and
2463 image creation from data, all written in Python. To create a custom
2464 image handler derive a new class from wx.PyImageHandler and provide
2465 the following methods::
2466
2467 def DoCanRead(self, stream) --> bool
2468 '''Check if this handler can read the image on the stream'''
2469
2470 def LoadFile(self, image, stream, verbose, index) --> bool
2471 '''Load image data from the stream and load it into image.'''
2472
2473 def SaveFile(self, image, stream, verbose) --> bool
2474 '''Save the iamge data in image to the stream using
2475 this handler's image file format.'''
2476
2477 def GetImageCount(self, stream) --> int
2478 '''If this image format can hold more than one image,
2479 how many does the image on the stream have?'''
2480
2481 To activate your handler create an instance of it and pass it to
2482 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2483 `SetExtension` from your constructor.
2484
2485 """
2486 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2487 self._SetSelf(self)
2488
2489 def _SetSelf(*args, **kwargs):
2490 """_SetSelf(self, PyObject self)"""
2491 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2492
2493 _core_.PyImageHandler_swigregister(PyImageHandler)
2494
2495 class ImageHistogram(object):
2496 """Proxy of C++ ImageHistogram class"""
2497 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2498 __repr__ = _swig_repr
2499 def __init__(self, *args, **kwargs):
2500 """__init__(self) -> ImageHistogram"""
2501 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2502 def MakeKey(*args, **kwargs):
2503 """
2504 MakeKey(byte r, byte g, byte b) -> unsigned long
2505
2506 Get the key in the histogram for the given RGB values
2507 """
2508 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2509
2510 MakeKey = staticmethod(MakeKey)
2511 def FindFirstUnusedColour(*args, **kwargs):
2512 """
2513 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2514
2515 Find first colour that is not used in the image and has higher RGB
2516 values than startR, startG, startB. Returns a tuple consisting of a
2517 success flag and rgb values.
2518 """
2519 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2520
2521 def GetCount(*args, **kwargs):
2522 """
2523 GetCount(self, unsigned long key) -> unsigned long
2524
2525 Returns the pixel count for the given key. Use `MakeKey` to create a
2526 key value from a RGB tripple.
2527 """
2528 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2529
2530 def GetCountRGB(*args, **kwargs):
2531 """
2532 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2533
2534 Returns the pixel count for the given RGB values.
2535 """
2536 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2537
2538 def GetCountColour(*args, **kwargs):
2539 """
2540 GetCountColour(self, Colour colour) -> unsigned long
2541
2542 Returns the pixel count for the given `wx.Colour` value.
2543 """
2544 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2545
2546 _core_.ImageHistogram_swigregister(ImageHistogram)
2547
2548 def ImageHistogram_MakeKey(*args, **kwargs):
2549 """
2550 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2551
2552 Get the key in the histogram for the given RGB values
2553 """
2554 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2555
2556 class Image_RGBValue(object):
2557 """
2558 An object that contains values for red, green and blue which represent
2559 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2560 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2561 color space.
2562 """
2563 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2564 __repr__ = _swig_repr
2565 def __init__(self, *args, **kwargs):
2566 """
2567 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2568
2569 Constructor.
2570 """
2571 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2572 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2573 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2574 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2575 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2576
2577 class Image_HSVValue(object):
2578 """
2579 An object that contains values for hue, saturation and value which
2580 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2581 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2582 color space.
2583 """
2584 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2585 __repr__ = _swig_repr
2586 def __init__(self, *args, **kwargs):
2587 """
2588 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2589
2590 Constructor.
2591 """
2592 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2593 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2594 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2595 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2596 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2597
2598 class Image(Object):
2599 """
2600 A platform-independent image class. An image can be created from
2601 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2602 variety of formats. Functions are available to set and get image
2603 bits, so it can be used for basic image manipulation.
2604
2605 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2606 platform-specific `wx.Bitmap` object must be created from it using the
2607 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2608 device context, using `wx.DC.DrawBitmap`.
2609
2610 One colour value of the image may be used as a mask colour which will
2611 lead to the automatic creation of a `wx.Mask` object associated to the
2612 bitmap object.
2613
2614 wx.Image supports alpha channel data, that is in addition to a byte
2615 for the red, green and blue colour components for each pixel it also
2616 stores a byte representing the pixel opacity. An alpha value of 0
2617 corresponds to a transparent pixel (null opacity) while a value of 255
2618 means that the pixel is 100% opaque.
2619
2620 Unlike RGB data, not all images have an alpha channel and before using
2621 `GetAlpha` you should check if this image contains an alpha channel
2622 with `HasAlpha`. Note that currently only images loaded from PNG files
2623 with transparency information will have an alpha channel.
2624 """
2625 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2626 __repr__ = _swig_repr
2627 def __init__(self, *args, **kwargs):
2628 """
2629 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2630
2631 Loads an image from a file.
2632 """
2633 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2634 __swig_destroy__ = _core_.delete_Image
2635 __del__ = lambda self : None;
2636 def Create(*args, **kwargs):
2637 """
2638 Create(self, int width, int height, bool clear=True)
2639
2640 Creates a fresh image. If clear is ``True``, the new image will be
2641 initialized to black. Otherwise, the image data will be uninitialized.
2642 """
2643 return _core_.Image_Create(*args, **kwargs)
2644
2645 def Destroy(*args, **kwargs):
2646 """
2647 Destroy(self)
2648
2649 Destroys the image data.
2650 """
2651 args[0].this.own(False)
2652 return _core_.Image_Destroy(*args, **kwargs)
2653
2654 def Scale(*args, **kwargs):
2655 """
2656 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2657
2658 Returns a scaled version of the image. This is also useful for scaling
2659 bitmaps in general as the only other way to scale bitmaps is to blit a
2660 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2661 specifies what method to use for resampling the image. It can be
2662 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2663 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2664 bicubic and box averaging resampling methods for upsampling and
2665 downsampling respectively.
2666 """
2667 return _core_.Image_Scale(*args, **kwargs)
2668
2669 def ResampleBox(*args, **kwargs):
2670 """ResampleBox(self, int width, int height) -> Image"""
2671 return _core_.Image_ResampleBox(*args, **kwargs)
2672
2673 def ResampleBicubic(*args, **kwargs):
2674 """ResampleBicubic(self, int width, int height) -> Image"""
2675 return _core_.Image_ResampleBicubic(*args, **kwargs)
2676
2677 def Blur(*args, **kwargs):
2678 """
2679 Blur(self, int radius) -> Image
2680
2681 Blurs the image in both horizontal and vertical directions by the
2682 specified pixel ``radius``. This should not be used when using a
2683 single mask colour for transparency.
2684 """
2685 return _core_.Image_Blur(*args, **kwargs)
2686
2687 def BlurHorizontal(*args, **kwargs):
2688 """
2689 BlurHorizontal(self, int radius) -> Image
2690
2691 Blurs the image in the horizontal direction only. This should not be
2692 used when using a single mask colour for transparency.
2693
2694 """
2695 return _core_.Image_BlurHorizontal(*args, **kwargs)
2696
2697 def BlurVertical(*args, **kwargs):
2698 """
2699 BlurVertical(self, int radius) -> Image
2700
2701 Blurs the image in the vertical direction only. This should not be
2702 used when using a single mask colour for transparency.
2703 """
2704 return _core_.Image_BlurVertical(*args, **kwargs)
2705
2706 def ShrinkBy(*args, **kwargs):
2707 """
2708 ShrinkBy(self, int xFactor, int yFactor) -> Image
2709
2710 Return a version of the image scaled smaller by the given factors.
2711 """
2712 return _core_.Image_ShrinkBy(*args, **kwargs)
2713
2714 def Rescale(*args, **kwargs):
2715 """
2716 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2717
2718 Changes the size of the image in-place by scaling it: after a call to
2719 this function, the image will have the given width and height.
2720
2721 Returns the (modified) image itself.
2722 """
2723 return _core_.Image_Rescale(*args, **kwargs)
2724
2725 def Resize(*args, **kwargs):
2726 """
2727 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2728
2729 Changes the size of the image in-place without scaling it, by adding
2730 either a border with the given colour or cropping as necessary. The
2731 image is pasted into a new image with the given size and background
2732 colour at the position pos relative to the upper left of the new
2733 image. If red = green = blue = -1 then use either the current mask
2734 colour if set or find, use, and set a suitable mask colour for any
2735 newly exposed areas.
2736
2737 Returns the (modified) image itself.
2738 """
2739 return _core_.Image_Resize(*args, **kwargs)
2740
2741 def SetRGB(*args, **kwargs):
2742 """
2743 SetRGB(self, int x, int y, byte r, byte g, byte b)
2744
2745 Sets the pixel at the given coordinate. This routine performs
2746 bounds-checks for the coordinate so it can be considered a safe way to
2747 manipulate the data, but in some cases this might be too slow so that
2748 the data will have to be set directly. In that case you will have to
2749 get access to the image data using the `GetData` method.
2750 """
2751 return _core_.Image_SetRGB(*args, **kwargs)
2752
2753 def SetRGBRect(*args, **kwargs):
2754 """
2755 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2756
2757 Sets the colour of the pixels within the given rectangle. This routine
2758 performs bounds-checks for the rectangle so it can be considered a
2759 safe way to manipulate the data.
2760 """
2761 return _core_.Image_SetRGBRect(*args, **kwargs)
2762
2763 def GetRed(*args, **kwargs):
2764 """
2765 GetRed(self, int x, int y) -> byte
2766
2767 Returns the red intensity at the given coordinate.
2768 """
2769 return _core_.Image_GetRed(*args, **kwargs)
2770
2771 def GetGreen(*args, **kwargs):
2772 """
2773 GetGreen(self, int x, int y) -> byte
2774
2775 Returns the green intensity at the given coordinate.
2776 """
2777 return _core_.Image_GetGreen(*args, **kwargs)
2778
2779 def GetBlue(*args, **kwargs):
2780 """
2781 GetBlue(self, int x, int y) -> byte
2782
2783 Returns the blue intensity at the given coordinate.
2784 """
2785 return _core_.Image_GetBlue(*args, **kwargs)
2786
2787 def SetAlpha(*args, **kwargs):
2788 """
2789 SetAlpha(self, int x, int y, byte alpha)
2790
2791 Sets the alpha value for the given pixel. This function should only be
2792 called if the image has alpha channel data, use `HasAlpha` to check
2793 for this.
2794 """
2795 return _core_.Image_SetAlpha(*args, **kwargs)
2796
2797 def GetAlpha(*args, **kwargs):
2798 """
2799 GetAlpha(self, int x, int y) -> byte
2800
2801 Returns the alpha value for the given pixel. This function may only be
2802 called for the images with alpha channel, use `HasAlpha` to check for
2803 this.
2804
2805 The returned value is the *opacity* of the image, i.e. the value of 0
2806 corresponds to the fully transparent pixels while the value of 255 to
2807 the fully opaque pixels.
2808 """
2809 return _core_.Image_GetAlpha(*args, **kwargs)
2810
2811 def HasAlpha(*args, **kwargs):
2812 """
2813 HasAlpha(self) -> bool
2814
2815 Returns true if this image has alpha channel, false otherwise.
2816 """
2817 return _core_.Image_HasAlpha(*args, **kwargs)
2818
2819 def InitAlpha(*args, **kwargs):
2820 """
2821 InitAlpha(self)
2822
2823 Initializes the image alpha channel data. It is an error to call it if
2824 the image already has alpha data. If it doesn't, alpha data will be by
2825 default initialized to all pixels being fully opaque. But if the image
2826 has a a mask colour, all mask pixels will be completely transparent.
2827 """
2828 return _core_.Image_InitAlpha(*args, **kwargs)
2829
2830 def IsTransparent(*args, **kwargs):
2831 """
2832 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2833
2834 Returns ``True`` if this pixel is masked or has an alpha value less
2835 than the spcified threshold.
2836 """
2837 return _core_.Image_IsTransparent(*args, **kwargs)
2838
2839 def FindFirstUnusedColour(*args, **kwargs):
2840 """
2841 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2842
2843 Find first colour that is not used in the image and has higher RGB
2844 values than startR, startG, startB. Returns a tuple consisting of a
2845 success flag and rgb values.
2846 """
2847 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2848
2849 def ConvertAlphaToMask(*args, **kwargs):
2850 """
2851 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2852
2853 If the image has alpha channel, this method converts it to mask. All
2854 pixels with alpha value less than ``threshold`` are replaced with the
2855 mask colour and the alpha channel is removed. The mask colour is
2856 chosen automatically using `FindFirstUnusedColour`.
2857
2858 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2859 nothing.
2860 """
2861 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2862
2863 def ConvertColourToAlpha(*args, **kwargs):
2864 """
2865 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2866
2867 This method converts an image where the original alpha information is
2868 only available as a shades of a colour (actually shades of grey)
2869 typically when you draw anti-aliased text into a bitmap. The DC
2870 drawing routines draw grey values on the black background although
2871 they actually mean to draw white with differnt alpha values. This
2872 method reverses it, assuming a black (!) background and white text.
2873 The method will then fill up the whole image with the colour given.
2874 """
2875 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2876
2877 def SetMaskFromImage(*args, **kwargs):
2878 """
2879 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2880
2881 Sets the image's mask so that the pixels that have RGB value of
2882 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2883 by first finding an unused colour in the image, setting this colour as
2884 the mask colour and then using this colour to draw all pixels in the
2885 image who corresponding pixel in mask has given RGB value.
2886
2887 Returns ``False`` if ``mask`` does not have same dimensions as the
2888 image or if there is no unused colour left. Returns ``True`` if the
2889 mask was successfully applied.
2890
2891 Note that this method involves computing the histogram, which is
2892 computationally intensive operation.
2893 """
2894 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2895
2896 def CanRead(*args, **kwargs):
2897 """
2898 CanRead(String filename) -> bool
2899
2900 Returns True if the image handlers can read this file.
2901 """
2902 return _core_.Image_CanRead(*args, **kwargs)
2903
2904 CanRead = staticmethod(CanRead)
2905 def GetImageCount(*args, **kwargs):
2906 """
2907 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2908
2909 If the image file contains more than one image and the image handler
2910 is capable of retrieving these individually, this function will return
2911 the number of available images.
2912 """
2913 return _core_.Image_GetImageCount(*args, **kwargs)
2914
2915 GetImageCount = staticmethod(GetImageCount)
2916 def LoadFile(*args, **kwargs):
2917 """
2918 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2919
2920 Loads an image from a file. If no handler type is provided, the
2921 library will try to autodetect the format.
2922 """
2923 return _core_.Image_LoadFile(*args, **kwargs)
2924
2925 def LoadMimeFile(*args, **kwargs):
2926 """
2927 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2928
2929 Loads an image from a file, specifying the image type with a MIME type
2930 string.
2931 """
2932 return _core_.Image_LoadMimeFile(*args, **kwargs)
2933
2934 def SaveFile(*args, **kwargs):
2935 """
2936 SaveFile(self, String name, int type) -> bool
2937
2938 Saves an image in the named file.
2939 """
2940 return _core_.Image_SaveFile(*args, **kwargs)
2941
2942 def SaveMimeFile(*args, **kwargs):
2943 """
2944 SaveMimeFile(self, String name, String mimetype) -> bool
2945
2946 Saves an image in the named file.
2947 """
2948 return _core_.Image_SaveMimeFile(*args, **kwargs)
2949
2950 def CanReadStream(*args, **kwargs):
2951 """
2952 CanReadStream(InputStream stream) -> bool
2953
2954 Returns True if the image handlers can read an image file from the
2955 data currently on the input stream, or a readable Python file-like
2956 object.
2957 """
2958 return _core_.Image_CanReadStream(*args, **kwargs)
2959
2960 CanReadStream = staticmethod(CanReadStream)
2961 def LoadStream(*args, **kwargs):
2962 """
2963 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2964
2965 Loads an image from an input stream or a readable Python file-like
2966 object. If no handler type is provided, the library will try to
2967 autodetect the format.
2968 """
2969 return _core_.Image_LoadStream(*args, **kwargs)
2970
2971 def LoadMimeStream(*args, **kwargs):
2972 """
2973 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2974
2975 Loads an image from an input stream or a readable Python file-like
2976 object, using a MIME type string to specify the image file format.
2977 """
2978 return _core_.Image_LoadMimeStream(*args, **kwargs)
2979
2980 def IsOk(*args, **kwargs):
2981 """
2982 IsOk(self) -> bool
2983
2984 Returns true if image data is present.
2985 """
2986 return _core_.Image_IsOk(*args, **kwargs)
2987
2988 Ok = IsOk
2989 def GetWidth(*args, **kwargs):
2990 """
2991 GetWidth(self) -> int
2992
2993 Gets the width of the image in pixels.
2994 """
2995 return _core_.Image_GetWidth(*args, **kwargs)
2996
2997 def GetHeight(*args, **kwargs):
2998 """
2999 GetHeight(self) -> int
3000
3001 Gets the height of the image in pixels.
3002 """
3003 return _core_.Image_GetHeight(*args, **kwargs)
3004
3005 def GetSize(*args, **kwargs):
3006 """
3007 GetSize(self) -> Size
3008
3009 Returns the size of the image in pixels.
3010 """
3011 return _core_.Image_GetSize(*args, **kwargs)
3012
3013 def GetSubImage(*args, **kwargs):
3014 """
3015 GetSubImage(self, Rect rect) -> Image
3016
3017 Returns a sub image of the current one as long as the rect belongs
3018 entirely to the image.
3019 """
3020 return _core_.Image_GetSubImage(*args, **kwargs)
3021
3022 def Size(*args, **kwargs):
3023 """
3024 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
3025
3026 Returns a resized version of this image without scaling it by adding
3027 either a border with the given colour or cropping as necessary. The
3028 image is pasted into a new image with the given size and background
3029 colour at the position ``pos`` relative to the upper left of the new
3030 image. If red = green = blue = -1 then use either the current mask
3031 colour if set or find, use, and set a suitable mask colour for any
3032 newly exposed areas.
3033 """
3034 return _core_.Image_Size(*args, **kwargs)
3035
3036 def Copy(*args, **kwargs):
3037 """
3038 Copy(self) -> Image
3039
3040 Returns an identical copy of the image.
3041 """
3042 return _core_.Image_Copy(*args, **kwargs)
3043
3044 def Paste(*args, **kwargs):
3045 """
3046 Paste(self, Image image, int x, int y)
3047
3048 Pastes ``image`` into this instance and takes care of the mask colour
3049 and any out of bounds problems.
3050 """
3051 return _core_.Image_Paste(*args, **kwargs)
3052
3053 def GetData(*args, **kwargs):
3054 """
3055 GetData(self) -> PyObject
3056
3057 Returns a string containing a copy of the RGB bytes of the image.
3058 """
3059 return _core_.Image_GetData(*args, **kwargs)
3060
3061 def SetData(*args, **kwargs):
3062 """
3063 SetData(self, buffer data)
3064
3065 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3066 either a string or a buffer object holding the data and the length of
3067 the data must be width*height*3.
3068 """
3069 return _core_.Image_SetData(*args, **kwargs)
3070
3071 def GetDataBuffer(*args, **kwargs):
3072 """
3073 GetDataBuffer(self) -> PyObject
3074
3075 Returns a writable Python buffer object that is pointing at the RGB
3076 image data buffer inside the wx.Image. You need to ensure that you do
3077 not use this buffer object after the image has been destroyed.
3078 """
3079 return _core_.Image_GetDataBuffer(*args, **kwargs)
3080
3081 def SetDataBuffer(*args, **kwargs):
3082 """
3083 SetDataBuffer(self, buffer data)
3084
3085 Sets the internal image data pointer to point at a Python buffer
3086 object. This can save making an extra copy of the data but you must
3087 ensure that the buffer object lives longer than the wx.Image does.
3088 """
3089 return _core_.Image_SetDataBuffer(*args, **kwargs)
3090
3091 def GetAlphaData(*args, **kwargs):
3092 """
3093 GetAlphaData(self) -> PyObject
3094
3095 Returns a string containing a copy of the alpha bytes of the image.
3096 """
3097 return _core_.Image_GetAlphaData(*args, **kwargs)
3098
3099 def SetAlphaData(*args, **kwargs):
3100 """
3101 SetAlphaData(self, buffer alpha)
3102
3103 Resets the Image's alpha data from a buffer of bytes. Accepts either
3104 a string or a buffer object holding the data and the length of the
3105 data must be width*height.
3106 """
3107 return _core_.Image_SetAlphaData(*args, **kwargs)
3108
3109 def GetAlphaBuffer(*args, **kwargs):
3110 """
3111 GetAlphaBuffer(self) -> PyObject
3112
3113 Returns a writable Python buffer object that is pointing at the Alpha
3114 data buffer inside the wx.Image. You need to ensure that you do not
3115 use this buffer object after the image has been destroyed.
3116 """
3117 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
3118
3119 def SetAlphaBuffer(*args, **kwargs):
3120 """
3121 SetAlphaBuffer(self, buffer alpha)
3122
3123 Sets the internal image alpha pointer to point at a Python buffer
3124 object. This can save making an extra copy of the data but you must
3125 ensure that the buffer object lives as long as the wx.Image does.
3126 """
3127 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
3128
3129 def SetMaskColour(*args, **kwargs):
3130 """
3131 SetMaskColour(self, byte r, byte g, byte b)
3132
3133 Sets the mask colour for this image (and tells the image to use the
3134 mask).
3135 """
3136 return _core_.Image_SetMaskColour(*args, **kwargs)
3137
3138 def GetOrFindMaskColour(*args, **kwargs):
3139 """
3140 GetOrFindMaskColour() -> (r,g,b)
3141
3142 Get the current mask colour or find a suitable colour.
3143 """
3144 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
3145
3146 def GetMaskRed(*args, **kwargs):
3147 """
3148 GetMaskRed(self) -> byte
3149
3150 Gets the red component of the mask colour.
3151 """
3152 return _core_.Image_GetMaskRed(*args, **kwargs)
3153
3154 def GetMaskGreen(*args, **kwargs):
3155 """
3156 GetMaskGreen(self) -> byte
3157
3158 Gets the green component of the mask colour.
3159 """
3160 return _core_.Image_GetMaskGreen(*args, **kwargs)
3161
3162 def GetMaskBlue(*args, **kwargs):
3163 """
3164 GetMaskBlue(self) -> byte
3165
3166 Gets the blue component of the mask colour.
3167 """
3168 return _core_.Image_GetMaskBlue(*args, **kwargs)
3169
3170 def SetMask(*args, **kwargs):
3171 """
3172 SetMask(self, bool mask=True)
3173
3174 Specifies whether there is a mask or not. The area of the mask is
3175 determined by the current mask colour.
3176 """
3177 return _core_.Image_SetMask(*args, **kwargs)
3178
3179 def HasMask(*args, **kwargs):
3180 """
3181 HasMask(self) -> bool
3182
3183 Returns ``True`` if there is a mask active, ``False`` otherwise.
3184 """
3185 return _core_.Image_HasMask(*args, **kwargs)
3186
3187 def Rotate(*args, **kwargs):
3188 """
3189 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3190 Point offset_after_rotation=None) -> Image
3191
3192 Rotates the image about the given point, by ``angle`` radians. Passing
3193 ``True`` to ``interpolating`` results in better image quality, but is
3194 slower. If the image has a mask, then the mask colour is used for the
3195 uncovered pixels in the rotated image background. Otherwise, black
3196 will be used as the fill colour.
3197
3198 Returns the rotated image, leaving this image intact.
3199 """
3200 return _core_.Image_Rotate(*args, **kwargs)
3201
3202 def Rotate90(*args, **kwargs):
3203 """
3204 Rotate90(self, bool clockwise=True) -> Image
3205
3206 Returns a copy of the image rotated 90 degrees in the direction
3207 indicated by ``clockwise``.
3208 """
3209 return _core_.Image_Rotate90(*args, **kwargs)
3210
3211 def Mirror(*args, **kwargs):
3212 """
3213 Mirror(self, bool horizontally=True) -> Image
3214
3215 Returns a mirrored copy of the image. The parameter ``horizontally``
3216 indicates the orientation.
3217 """
3218 return _core_.Image_Mirror(*args, **kwargs)
3219
3220 def Replace(*args, **kwargs):
3221 """
3222 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3223
3224 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3225 ``(r2,g2,b2)``.
3226 """
3227 return _core_.Image_Replace(*args, **kwargs)
3228
3229 def ConvertToGreyscale(*args, **kwargs):
3230 """
3231 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3232
3233 Convert to greyscale image. Uses the luminance component (Y) of the
3234 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3235 defaults to ITU-T BT.601
3236 """
3237 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3238
3239 def ConvertToMono(*args, **kwargs):
3240 """
3241 ConvertToMono(self, byte r, byte g, byte b) -> Image
3242
3243 Returns monochromatic version of the image. The returned image has
3244 white colour where the original has ``(r,g,b)`` colour and black
3245 colour everywhere else.
3246 """
3247 return _core_.Image_ConvertToMono(*args, **kwargs)
3248
3249 def SetOption(*args, **kwargs):
3250 """
3251 SetOption(self, String name, String value)
3252
3253 Sets an image handler defined option. For example, when saving as a
3254 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3255 number between 0 and 100 (0 is terrible, 100 is very good).
3256 """
3257 return _core_.Image_SetOption(*args, **kwargs)
3258
3259 def SetOptionInt(*args, **kwargs):
3260 """
3261 SetOptionInt(self, String name, int value)
3262
3263 Sets an image option as an integer.
3264 """
3265 return _core_.Image_SetOptionInt(*args, **kwargs)
3266
3267 def GetOption(*args, **kwargs):
3268 """
3269 GetOption(self, String name) -> String
3270
3271 Gets the value of an image handler option.
3272 """
3273 return _core_.Image_GetOption(*args, **kwargs)
3274
3275 def GetOptionInt(*args, **kwargs):
3276 """
3277 GetOptionInt(self, String name) -> int
3278
3279 Gets the value of an image handler option as an integer. If the given
3280 option is not present, the function returns 0.
3281 """
3282 return _core_.Image_GetOptionInt(*args, **kwargs)
3283
3284 def HasOption(*args, **kwargs):
3285 """
3286 HasOption(self, String name) -> bool
3287
3288 Returns true if the given option is present.
3289 """
3290 return _core_.Image_HasOption(*args, **kwargs)
3291
3292 def CountColours(*args, **kwargs):
3293 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3294 return _core_.Image_CountColours(*args, **kwargs)
3295
3296 def ComputeHistogram(*args, **kwargs):
3297 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3298 return _core_.Image_ComputeHistogram(*args, **kwargs)
3299
3300 def AddHandler(*args, **kwargs):
3301 """AddHandler(ImageHandler handler)"""
3302 return _core_.Image_AddHandler(*args, **kwargs)
3303
3304 AddHandler = staticmethod(AddHandler)
3305 def InsertHandler(*args, **kwargs):
3306 """InsertHandler(ImageHandler handler)"""
3307 return _core_.Image_InsertHandler(*args, **kwargs)
3308
3309 InsertHandler = staticmethod(InsertHandler)
3310 def RemoveHandler(*args, **kwargs):
3311 """RemoveHandler(String name) -> bool"""
3312 return _core_.Image_RemoveHandler(*args, **kwargs)
3313
3314 RemoveHandler = staticmethod(RemoveHandler)
3315 def GetHandlers(*args, **kwargs):
3316 """GetHandlers() -> PyObject"""
3317 return _core_.Image_GetHandlers(*args, **kwargs)
3318
3319 GetHandlers = staticmethod(GetHandlers)
3320 def GetImageExtWildcard(*args, **kwargs):
3321 """
3322 GetImageExtWildcard() -> String
3323
3324 Iterates all registered wxImageHandler objects, and returns a string
3325 containing file extension masks suitable for passing to file open/save
3326 dialog boxes.
3327 """
3328 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3329
3330 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3331 def ConvertToBitmap(*args, **kwargs):
3332 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3333 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3334
3335 def ConvertToMonoBitmap(*args, **kwargs):
3336 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3337 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3338
3339 def RotateHue(*args, **kwargs):
3340 """
3341 RotateHue(self, double angle)
3342
3343 Rotates the hue of each pixel of the image. Hue is a double in the
3344 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3345 """
3346 return _core_.Image_RotateHue(*args, **kwargs)
3347
3348 def RGBtoHSV(*args, **kwargs):
3349 """
3350 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3351
3352 Converts a color in RGB color space to HSV color space.
3353 """
3354 return _core_.Image_RGBtoHSV(*args, **kwargs)
3355
3356 RGBtoHSV = staticmethod(RGBtoHSV)
3357 def HSVtoRGB(*args, **kwargs):
3358 """
3359 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3360
3361 Converts a color in HSV color space to RGB color space.
3362 """
3363 return _core_.Image_HSVtoRGB(*args, **kwargs)
3364
3365 HSVtoRGB = staticmethod(HSVtoRGB)
3366 def __nonzero__(self): return self.IsOk()
3367 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3368 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3369 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3370 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3371 Height = property(GetHeight,doc="See `GetHeight`")
3372 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3373 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3374 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3375 Width = property(GetWidth,doc="See `GetWidth`")
3376 _core_.Image_swigregister(Image)
3377
3378 def ImageFromMime(*args, **kwargs):
3379 """
3380 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3381
3382 Loads an image from a file, using a MIME type string (such as
3383 'image/jpeg') to specify image type.
3384 """
3385 val = _core_.new_ImageFromMime(*args, **kwargs)
3386 return val
3387
3388 def ImageFromStream(*args, **kwargs):
3389 """
3390 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3391
3392 Loads an image from an input stream, or any readable Python file-like
3393 object.
3394 """
3395 val = _core_.new_ImageFromStream(*args, **kwargs)
3396 return val
3397
3398 def ImageFromStreamMime(*args, **kwargs):
3399 """
3400 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3401
3402 Loads an image from an input stream, or any readable Python file-like
3403 object, specifying the image format with a MIME type string.
3404 """
3405 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3406 return val
3407
3408 def EmptyImage(*args, **kwargs):
3409 """
3410 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3411
3412 Construct an empty image of a given size, optionally setting all
3413 pixels to black.
3414 """
3415 val = _core_.new_EmptyImage(*args, **kwargs)
3416 return val
3417
3418 def ImageFromBitmap(*args, **kwargs):
3419 """
3420 ImageFromBitmap(Bitmap bitmap) -> Image
3421
3422 Construct an Image from a `wx.Bitmap`.
3423 """
3424 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3425 return val
3426
3427 def ImageFromData(*args, **kwargs):
3428 """
3429 ImageFromData(int width, int height, buffer data) -> Image
3430
3431 Construct an Image from a buffer of RGB bytes. Accepts either a
3432 string or a buffer object holding the data and the length of the data
3433 must be width*height*3.
3434 """
3435 val = _core_.new_ImageFromData(*args, **kwargs)
3436 return val
3437
3438 def ImageFromDataWithAlpha(*args, **kwargs):
3439 """
3440 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3441
3442 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3443 Accepts either a string or a buffer object holding the data and the
3444 length of the data must be width*height*3 bytes, and the length of the
3445 alpha data must be width*height bytes.
3446 """
3447 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3448 return val
3449
3450 def Image_CanRead(*args, **kwargs):
3451 """
3452 Image_CanRead(String filename) -> bool
3453
3454 Returns True if the image handlers can read this file.
3455 """
3456 return _core_.Image_CanRead(*args, **kwargs)
3457
3458 def Image_GetImageCount(*args, **kwargs):
3459 """
3460 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3461
3462 If the image file contains more than one image and the image handler
3463 is capable of retrieving these individually, this function will return
3464 the number of available images.
3465 """
3466 return _core_.Image_GetImageCount(*args, **kwargs)
3467
3468 def Image_CanReadStream(*args, **kwargs):
3469 """
3470 Image_CanReadStream(InputStream stream) -> bool
3471
3472 Returns True if the image handlers can read an image file from the
3473 data currently on the input stream, or a readable Python file-like
3474 object.
3475 """
3476 return _core_.Image_CanReadStream(*args, **kwargs)
3477
3478 def Image_AddHandler(*args, **kwargs):
3479 """Image_AddHandler(ImageHandler handler)"""
3480 return _core_.Image_AddHandler(*args, **kwargs)
3481
3482 def Image_InsertHandler(*args, **kwargs):
3483 """Image_InsertHandler(ImageHandler handler)"""
3484 return _core_.Image_InsertHandler(*args, **kwargs)
3485
3486 def Image_RemoveHandler(*args, **kwargs):
3487 """Image_RemoveHandler(String name) -> bool"""
3488 return _core_.Image_RemoveHandler(*args, **kwargs)
3489
3490 def Image_GetHandlers(*args):
3491 """Image_GetHandlers() -> PyObject"""
3492 return _core_.Image_GetHandlers(*args)
3493
3494 def Image_GetImageExtWildcard(*args):
3495 """
3496 Image_GetImageExtWildcard() -> String
3497
3498 Iterates all registered wxImageHandler objects, and returns a string
3499 containing file extension masks suitable for passing to file open/save
3500 dialog boxes.
3501 """
3502 return _core_.Image_GetImageExtWildcard(*args)
3503
3504 def Image_RGBtoHSV(*args, **kwargs):
3505 """
3506 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3507
3508 Converts a color in RGB color space to HSV color space.
3509 """
3510 return _core_.Image_RGBtoHSV(*args, **kwargs)
3511
3512 def Image_HSVtoRGB(*args, **kwargs):
3513 """
3514 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3515
3516 Converts a color in HSV color space to RGB color space.
3517 """
3518 return _core_.Image_HSVtoRGB(*args, **kwargs)
3519
3520
3521 def _ImageFromBuffer(*args, **kwargs):
3522 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3523 return _core_._ImageFromBuffer(*args, **kwargs)
3524 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3525 """
3526 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3527 parameter must be a Python object that implements the buffer interface,
3528 such as a string, array, etc. The dataBuffer object is expected to
3529 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3530 object can optionally be supplied for the image's alpha channel data, and
3531 it is expected to be width*height bytes long.
3532
3533 The wx.Image will be created with its data and alpha pointers initialized
3534 to the memory address pointed to by the buffer objects, thus saving the
3535 time needed to copy the image data from the buffer object to the wx.Image.
3536 While this has advantages, it also has the shoot-yourself-in-the-foot
3537 risks associated with sharing a C pointer between two objects.
3538
3539 To help alleviate the risk a reference to the data and alpha buffer
3540 objects are kept with the wx.Image, so that they won't get deleted until
3541 after the wx.Image is deleted. However please be aware that it is not
3542 guaranteed that an object won't move its memory buffer to a new location
3543 when it needs to resize its contents. If that happens then the wx.Image
3544 will end up referring to an invalid memory location and could cause the
3545 application to crash. Therefore care should be taken to not manipulate
3546 the objects used for the data and alpha buffers in a way that would cause
3547 them to change size.
3548 """
3549 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3550 image._buffer = dataBuffer
3551 image._alpha = alphaBuffer
3552 return image
3553
3554 def InitAllImageHandlers():
3555 """
3556 The former functionality of InitAllImageHanders is now done internal to
3557 the _core_ extension module and so this function has become a simple NOP.
3558 """
3559 pass
3560
3561 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3562 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3563 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3564 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3565 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3566 BMP_24BPP = _core_.BMP_24BPP
3567 BMP_8BPP = _core_.BMP_8BPP
3568 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3569 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3570 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3571 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3572 BMP_4BPP = _core_.BMP_4BPP
3573 BMP_1BPP = _core_.BMP_1BPP
3574 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3575 class BMPHandler(ImageHandler):
3576 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3577 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3578 __repr__ = _swig_repr
3579 def __init__(self, *args, **kwargs):
3580 """
3581 __init__(self) -> BMPHandler
3582
3583 A `wx.ImageHandler` for \*.bmp bitmap files.
3584 """
3585 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3586 _core_.BMPHandler_swigregister(BMPHandler)
3587 NullImage = cvar.NullImage
3588 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3589 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3590 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3591 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3592 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3593 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3594 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3595 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3596 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3597 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3598 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3599 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3600 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3601 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3602 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3603
3604 class ICOHandler(BMPHandler):
3605 """A `wx.ImageHandler` for \*.ico icon files."""
3606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3607 __repr__ = _swig_repr
3608 def __init__(self, *args, **kwargs):
3609 """
3610 __init__(self) -> ICOHandler
3611
3612 A `wx.ImageHandler` for \*.ico icon files.
3613 """
3614 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3615 _core_.ICOHandler_swigregister(ICOHandler)
3616
3617 class CURHandler(ICOHandler):
3618 """A `wx.ImageHandler` for \*.cur cursor files."""
3619 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3620 __repr__ = _swig_repr
3621 def __init__(self, *args, **kwargs):
3622 """
3623 __init__(self) -> CURHandler
3624
3625 A `wx.ImageHandler` for \*.cur cursor files.
3626 """
3627 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3628 _core_.CURHandler_swigregister(CURHandler)
3629
3630 class ANIHandler(CURHandler):
3631 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3632 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3633 __repr__ = _swig_repr
3634 def __init__(self, *args, **kwargs):
3635 """
3636 __init__(self) -> ANIHandler
3637
3638 A `wx.ImageHandler` for \*.ani animated cursor files.
3639 """
3640 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3641 _core_.ANIHandler_swigregister(ANIHandler)
3642
3643 class PNGHandler(ImageHandler):
3644 """A `wx.ImageHandler` for PNG image files."""
3645 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3646 __repr__ = _swig_repr
3647 def __init__(self, *args, **kwargs):
3648 """
3649 __init__(self) -> PNGHandler
3650
3651 A `wx.ImageHandler` for PNG image files.
3652 """
3653 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3654 _core_.PNGHandler_swigregister(PNGHandler)
3655
3656 class GIFHandler(ImageHandler):
3657 """A `wx.ImageHandler` for GIF image files."""
3658 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3659 __repr__ = _swig_repr
3660 def __init__(self, *args, **kwargs):
3661 """
3662 __init__(self) -> GIFHandler
3663
3664 A `wx.ImageHandler` for GIF image files.
3665 """
3666 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3667 _core_.GIFHandler_swigregister(GIFHandler)
3668
3669 class PCXHandler(ImageHandler):
3670 """A `wx.ImageHandler` for PCX imager files."""
3671 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3672 __repr__ = _swig_repr
3673 def __init__(self, *args, **kwargs):
3674 """
3675 __init__(self) -> PCXHandler
3676
3677 A `wx.ImageHandler` for PCX imager files.
3678 """
3679 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3680 _core_.PCXHandler_swigregister(PCXHandler)
3681
3682 class JPEGHandler(ImageHandler):
3683 """A `wx.ImageHandler` for JPEG/JPG image files."""
3684 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3685 __repr__ = _swig_repr
3686 def __init__(self, *args, **kwargs):
3687 """
3688 __init__(self) -> JPEGHandler
3689
3690 A `wx.ImageHandler` for JPEG/JPG image files.
3691 """
3692 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3693 _core_.JPEGHandler_swigregister(JPEGHandler)
3694
3695 class PNMHandler(ImageHandler):
3696 """A `wx.ImageHandler` for PNM image files."""
3697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3698 __repr__ = _swig_repr
3699 def __init__(self, *args, **kwargs):
3700 """
3701 __init__(self) -> PNMHandler
3702
3703 A `wx.ImageHandler` for PNM image files.
3704 """
3705 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3706 _core_.PNMHandler_swigregister(PNMHandler)
3707
3708 class XPMHandler(ImageHandler):
3709 """A `wx.ImageHandler` for XPM image."""
3710 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3711 __repr__ = _swig_repr
3712 def __init__(self, *args, **kwargs):
3713 """
3714 __init__(self) -> XPMHandler
3715
3716 A `wx.ImageHandler` for XPM image.
3717 """
3718 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3719 _core_.XPMHandler_swigregister(XPMHandler)
3720
3721 class TIFFHandler(ImageHandler):
3722 """A `wx.ImageHandler` for TIFF image files."""
3723 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3724 __repr__ = _swig_repr
3725 def __init__(self, *args, **kwargs):
3726 """
3727 __init__(self) -> TIFFHandler
3728
3729 A `wx.ImageHandler` for TIFF image files.
3730 """
3731 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3732 _core_.TIFFHandler_swigregister(TIFFHandler)
3733
3734 class TGAHandler(ImageHandler):
3735 """A `wx.ImageHandler` for TGA image files."""
3736 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3737 __repr__ = _swig_repr
3738 def __init__(self, *args, **kwargs):
3739 """
3740 __init__(self) -> TGAHandler
3741
3742 A `wx.ImageHandler` for TGA image files.
3743 """
3744 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3745 _core_.TGAHandler_swigregister(TGAHandler)
3746
3747 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3748 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3749 class Quantize(object):
3750 """Performs quantization, or colour reduction, on a wxImage."""
3751 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3752 def __init__(self): raise AttributeError, "No constructor defined"
3753 __repr__ = _swig_repr
3754 def Quantize(*args, **kwargs):
3755 """
3756 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3757
3758 Reduce the colours in the source image and put the result into the
3759 destination image, setting the palette in the destination if
3760 needed. Both images may be the same, to overwrite the source image.
3761 """
3762 return _core_.Quantize_Quantize(*args, **kwargs)
3763
3764 Quantize = staticmethod(Quantize)
3765 _core_.Quantize_swigregister(Quantize)
3766
3767 def Quantize_Quantize(*args, **kwargs):
3768 """
3769 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3770
3771 Reduce the colours in the source image and put the result into the
3772 destination image, setting the palette in the destination if
3773 needed. Both images may be the same, to overwrite the source image.
3774 """
3775 return _core_.Quantize_Quantize(*args, **kwargs)
3776
3777 #---------------------------------------------------------------------------
3778
3779 class EvtHandler(Object):
3780 """Proxy of C++ EvtHandler class"""
3781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3782 __repr__ = _swig_repr
3783 def __init__(self, *args, **kwargs):
3784 """__init__(self) -> EvtHandler"""
3785 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3786 self._setOORInfo(self)
3787
3788 def GetNextHandler(*args, **kwargs):
3789 """GetNextHandler(self) -> EvtHandler"""
3790 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3791
3792 def GetPreviousHandler(*args, **kwargs):
3793 """GetPreviousHandler(self) -> EvtHandler"""
3794 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3795
3796 def SetNextHandler(*args, **kwargs):
3797 """SetNextHandler(self, EvtHandler handler)"""
3798 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3799
3800 def SetPreviousHandler(*args, **kwargs):
3801 """SetPreviousHandler(self, EvtHandler handler)"""
3802 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3803
3804 def GetEvtHandlerEnabled(*args, **kwargs):
3805 """GetEvtHandlerEnabled(self) -> bool"""
3806 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3807
3808 def SetEvtHandlerEnabled(*args, **kwargs):
3809 """SetEvtHandlerEnabled(self, bool enabled)"""
3810 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3811
3812 def ProcessEvent(*args, **kwargs):
3813 """ProcessEvent(self, Event event) -> bool"""
3814 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3815
3816 def AddPendingEvent(*args, **kwargs):
3817 """AddPendingEvent(self, Event event)"""
3818 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3819
3820 def ProcessPendingEvents(*args, **kwargs):
3821 """ProcessPendingEvents(self)"""
3822 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3823
3824 def Connect(*args, **kwargs):
3825 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3826 return _core_.EvtHandler_Connect(*args, **kwargs)
3827
3828 def Disconnect(*args, **kwargs):
3829 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3830 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3831
3832 def _setOORInfo(*args, **kwargs):
3833 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3834 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3835 args[0].this.own(False)
3836 return val
3837
3838 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3839 """
3840 Bind an event to an event handler.
3841
3842 :param event: One of the EVT_* objects that specifies the
3843 type of event to bind,
3844
3845 :param handler: A callable object to be invoked when the
3846 event is delivered to self. Pass None to
3847 disconnect an event handler.
3848
3849 :param source: Sometimes the event originates from a
3850 different window than self, but you still
3851 want to catch it in self. (For example, a
3852 button event delivered to a frame.) By
3853 passing the source of the event, the event
3854 handling system is able to differentiate
3855 between the same event type from different
3856 controls.
3857
3858 :param id: Used to spcify the event source by ID instead
3859 of instance.
3860
3861 :param id2: Used when it is desirable to bind a handler
3862 to a range of IDs, such as with EVT_MENU_RANGE.
3863 """
3864 if source is not None:
3865 id = source.GetId()
3866 event.Bind(self, id, id2, handler)
3867
3868 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3869 """
3870 Disconencts the event handler binding for event from self.
3871 Returns True if successful.
3872 """
3873 if source is not None:
3874 id = source.GetId()
3875 return event.Unbind(self, id, id2)
3876
3877 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3878 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3879 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3880 _core_.EvtHandler_swigregister(EvtHandler)
3881
3882 #---------------------------------------------------------------------------
3883
3884 class PyEventBinder(object):
3885 """
3886 Instances of this class are used to bind specific events to event
3887 handlers.
3888 """
3889 def __init__(self, evtType, expectedIDs=0):
3890 if expectedIDs not in [0, 1, 2]:
3891 raise ValueError, "Invalid number of expectedIDs"
3892 self.expectedIDs = expectedIDs
3893
3894 if type(evtType) == list or type(evtType) == tuple:
3895 self.evtType = evtType
3896 else:
3897 self.evtType = [evtType]
3898
3899
3900 def Bind(self, target, id1, id2, function):
3901 """Bind this set of event types to target."""
3902 for et in self.evtType:
3903 target.Connect(id1, id2, et, function)
3904
3905
3906 def Unbind(self, target, id1, id2):
3907 """Remove an event binding."""
3908 success = 0
3909 for et in self.evtType:
3910 success += target.Disconnect(id1, id2, et)
3911 return success != 0
3912
3913 def _getEvtType(self):
3914 """
3915 Make it easy to get to the default wxEventType typeID for this
3916 event binder.
3917 """
3918 return self.evtType[0]
3919
3920 typeId = property(_getEvtType)
3921
3922
3923 def __call__(self, *args):
3924 """
3925 For backwards compatibility with the old EVT_* functions.
3926 Should be called with either (window, func), (window, ID,
3927 func) or (window, ID1, ID2, func) parameters depending on the
3928 type of the event.
3929 """
3930 assert len(args) == 2 + self.expectedIDs
3931 id1 = wx.ID_ANY
3932 id2 = wx.ID_ANY
3933 target = args[0]
3934 if self.expectedIDs == 0:
3935 func = args[1]
3936 elif self.expectedIDs == 1:
3937 id1 = args[1]
3938 func = args[2]
3939 elif self.expectedIDs == 2:
3940 id1 = args[1]
3941 id2 = args[2]
3942 func = args[3]
3943 else:
3944 raise ValueError, "Unexpected number of IDs"
3945
3946 self.Bind(target, id1, id2, func)
3947
3948
3949 # These two are square pegs that don't fit the PyEventBinder hole...
3950 def EVT_COMMAND(win, id, cmd, func):
3951 win.Connect(id, -1, cmd, func)
3952 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3953 win.Connect(id1, id2, cmd, func)
3954
3955
3956 #---------------------------------------------------------------------------
3957
3958 #---------------------------------------------------------------------------
3959
3960 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3961 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3962
3963 def NewEventType(*args):
3964 """NewEventType() -> EventType"""
3965 return _core_.NewEventType(*args)
3966 wxEVT_ANY = _core_.wxEVT_ANY
3967 wxEVT_NULL = _core_.wxEVT_NULL
3968 wxEVT_FIRST = _core_.wxEVT_FIRST
3969 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3970 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3971 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3972 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3973 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3974 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3975 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3976 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3977 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3978 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3979 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3980 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3981 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3982 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3983 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3984 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3985 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3986 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3987 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3988 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3989 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3990 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3991 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3992 wxEVT_MOTION = _core_.wxEVT_MOTION
3993 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3994 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3995 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3996 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3997 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3998 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3999 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
4000 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
4001 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
4002 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
4003 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
4004 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
4005 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
4006 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
4007 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
4008 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
4009 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
4010 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
4011 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
4012 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
4013 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
4014 wxEVT_CHAR = _core_.wxEVT_CHAR
4015 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
4016 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
4017 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
4018 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
4019 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
4020 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
4021 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
4022 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
4023 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
4024 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
4025 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
4026 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
4027 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
4028 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4029 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
4030 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
4031 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
4032 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
4033 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
4034 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
4035 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
4036 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
4037 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
4038 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
4039 wxEVT_SIZE = _core_.wxEVT_SIZE
4040 wxEVT_MOVE = _core_.wxEVT_MOVE
4041 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
4042 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
4043 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
4044 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
4045 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
4046 wxEVT_CREATE = _core_.wxEVT_CREATE
4047 wxEVT_DESTROY = _core_.wxEVT_DESTROY
4048 wxEVT_SHOW = _core_.wxEVT_SHOW
4049 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
4050 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
4051 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
4052 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
4053 wxEVT_PAINT = _core_.wxEVT_PAINT
4054 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
4055 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
4056 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
4057 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
4058 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
4059 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
4060 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
4061 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
4062 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
4063 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
4064 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
4065 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
4066 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4067 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4068 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4069 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4070 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4071 wxEVT_IDLE = _core_.wxEVT_IDLE
4072 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4073 wxEVT_SIZING = _core_.wxEVT_SIZING
4074 wxEVT_MOVING = _core_.wxEVT_MOVING
4075 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
4076 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4077 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4078 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
4079 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4080 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4081 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4082 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4083 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4084 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4085 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
4086 #
4087 # Create some event binders
4088 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4089 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4090 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4091 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4092 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4093 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4094 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4095 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4096 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4097 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4098 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4099 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4100 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
4101 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
4102 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4103 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4104 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4105 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4106 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4107 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4108 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4109 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4110 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4111 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
4112 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
4113 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4114 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4115 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4116 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4117 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4118 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4119 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4120 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4121 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4122 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4123 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4124 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4125 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4126 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4127 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4128 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
4129 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
4130
4131 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4132 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4133 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4134 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4135 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4136 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4137 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4138 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4139 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4140 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4141 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4142 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4143 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4144
4145 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4146 wxEVT_LEFT_UP,
4147 wxEVT_MIDDLE_DOWN,
4148 wxEVT_MIDDLE_UP,
4149 wxEVT_RIGHT_DOWN,
4150 wxEVT_RIGHT_UP,
4151 wxEVT_MOTION,
4152 wxEVT_LEFT_DCLICK,
4153 wxEVT_MIDDLE_DCLICK,
4154 wxEVT_RIGHT_DCLICK,
4155 wxEVT_ENTER_WINDOW,
4156 wxEVT_LEAVE_WINDOW,
4157 wxEVT_MOUSEWHEEL
4158 ])
4159
4160
4161 # Scrolling from wxWindow (sent to wxScrolledWindow)
4162 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
4163 wxEVT_SCROLLWIN_BOTTOM,
4164 wxEVT_SCROLLWIN_LINEUP,
4165 wxEVT_SCROLLWIN_LINEDOWN,
4166 wxEVT_SCROLLWIN_PAGEUP,
4167 wxEVT_SCROLLWIN_PAGEDOWN,
4168 wxEVT_SCROLLWIN_THUMBTRACK,
4169 wxEVT_SCROLLWIN_THUMBRELEASE,
4170 ])
4171
4172 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4173 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4174 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4175 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4176 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4177 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4178 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4179 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4180
4181 # Scrolling from wx.Slider and wx.ScrollBar
4182 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4183 wxEVT_SCROLL_BOTTOM,
4184 wxEVT_SCROLL_LINEUP,
4185 wxEVT_SCROLL_LINEDOWN,
4186 wxEVT_SCROLL_PAGEUP,
4187 wxEVT_SCROLL_PAGEDOWN,
4188 wxEVT_SCROLL_THUMBTRACK,
4189 wxEVT_SCROLL_THUMBRELEASE,
4190 wxEVT_SCROLL_CHANGED,
4191 ])
4192
4193 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4194 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4195 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4196 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4197 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4198 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4199 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4200 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4201 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4202 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
4203
4204 # Scrolling from wx.Slider and wx.ScrollBar, with an id
4205 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4206 wxEVT_SCROLL_BOTTOM,
4207 wxEVT_SCROLL_LINEUP,
4208 wxEVT_SCROLL_LINEDOWN,
4209 wxEVT_SCROLL_PAGEUP,
4210 wxEVT_SCROLL_PAGEDOWN,
4211 wxEVT_SCROLL_THUMBTRACK,
4212 wxEVT_SCROLL_THUMBRELEASE,
4213 wxEVT_SCROLL_CHANGED,
4214 ], 1)
4215
4216 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4217 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4218 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4219 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4220 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4221 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4222 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4223 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4224 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4225 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
4226
4227 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4228 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4229 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4230 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4231 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4232 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4233 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4234 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4235 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4236 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4237
4238 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4239 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4240 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4241 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4242 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4243 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4244 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4245 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4246 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4247
4248
4249 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4250 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4251 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4252 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4253 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4254 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4255 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4256
4257 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4258
4259 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4260 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4261
4262 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4263
4264 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4265 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4266 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
4267
4268
4269 #---------------------------------------------------------------------------
4270
4271 class Event(Object):
4272 """
4273 An event is a structure holding information about an event passed to a
4274 callback or member function. wx.Event is an abstract base class for
4275 other event classes
4276 """
4277 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4278 def __init__(self): raise AttributeError, "No constructor defined"
4279 __repr__ = _swig_repr
4280 __swig_destroy__ = _core_.delete_Event
4281 __del__ = lambda self : None;
4282 def SetEventType(*args, **kwargs):
4283 """
4284 SetEventType(self, EventType typ)
4285
4286 Sets the specific type of the event.
4287 """
4288 return _core_.Event_SetEventType(*args, **kwargs)
4289
4290 def GetEventType(*args, **kwargs):
4291 """
4292 GetEventType(self) -> EventType
4293
4294 Returns the identifier of the given event type, such as
4295 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4296 """
4297 return _core_.Event_GetEventType(*args, **kwargs)
4298
4299 def GetEventObject(*args, **kwargs):
4300 """
4301 GetEventObject(self) -> Object
4302
4303 Returns the object (usually a window) associated with the event, if
4304 any.
4305 """
4306 return _core_.Event_GetEventObject(*args, **kwargs)
4307
4308 def SetEventObject(*args, **kwargs):
4309 """
4310 SetEventObject(self, Object obj)
4311
4312 Sets the originating object, or in other words, obj is normally the
4313 object that is sending the event.
4314 """
4315 return _core_.Event_SetEventObject(*args, **kwargs)
4316
4317 def GetTimestamp(*args, **kwargs):
4318 """GetTimestamp(self) -> long"""
4319 return _core_.Event_GetTimestamp(*args, **kwargs)
4320
4321 def SetTimestamp(*args, **kwargs):
4322 """SetTimestamp(self, long ts=0)"""
4323 return _core_.Event_SetTimestamp(*args, **kwargs)
4324
4325 def GetId(*args, **kwargs):
4326 """
4327 GetId(self) -> int
4328
4329 Returns the identifier associated with this event, such as a button
4330 command id.
4331 """
4332 return _core_.Event_GetId(*args, **kwargs)
4333
4334 def SetId(*args, **kwargs):
4335 """
4336 SetId(self, int Id)
4337
4338 Set's the ID for the event. This is usually the ID of the window that
4339 is sending the event, but it can also be a command id from a menu
4340 item, etc.
4341 """
4342 return _core_.Event_SetId(*args, **kwargs)
4343
4344 def IsCommandEvent(*args, **kwargs):
4345 """
4346 IsCommandEvent(self) -> bool
4347
4348 Returns true if the event is or is derived from `wx.CommandEvent` else
4349 it returns false. Note: Exists only for optimization purposes.
4350 """
4351 return _core_.Event_IsCommandEvent(*args, **kwargs)
4352
4353 def Skip(*args, **kwargs):
4354 """
4355 Skip(self, bool skip=True)
4356
4357 This method can be used inside an event handler to control whether
4358 further event handlers bound to this event will be called after the
4359 current one returns. Without Skip() (or equivalently if Skip(False) is
4360 used), the event will not be processed any more. If Skip(True) is
4361 called, the event processing system continues searching for a further
4362 handler function for this event, even though it has been processed
4363 already in the current handler.
4364 """
4365 return _core_.Event_Skip(*args, **kwargs)
4366
4367 def GetSkipped(*args, **kwargs):
4368 """
4369 GetSkipped(self) -> bool
4370
4371 Returns true if the event handler should be skipped, false otherwise.
4372 :see: `Skip`
4373 """
4374 return _core_.Event_GetSkipped(*args, **kwargs)
4375
4376 def ShouldPropagate(*args, **kwargs):
4377 """
4378 ShouldPropagate(self) -> bool
4379
4380 Test if this event should be propagated to the parent window or not,
4381 i.e. if the propagation level is currently greater than 0.
4382 """
4383 return _core_.Event_ShouldPropagate(*args, **kwargs)
4384
4385 def StopPropagation(*args, **kwargs):
4386 """
4387 StopPropagation(self) -> int
4388
4389 Stop the event from propagating to its parent window. Returns the old
4390 propagation level value which may be later passed to
4391 `ResumePropagation` to allow propagating the event again.
4392 """
4393 return _core_.Event_StopPropagation(*args, **kwargs)
4394
4395 def ResumePropagation(*args, **kwargs):
4396 """
4397 ResumePropagation(self, int propagationLevel)
4398
4399 Resume the event propagation by restoring the propagation level. (For
4400 example, you can use the value returned by an earlier call to
4401 `StopPropagation`.)
4402
4403 """
4404 return _core_.Event_ResumePropagation(*args, **kwargs)
4405
4406 def Clone(*args, **kwargs):
4407 """Clone(self) -> Event"""
4408 return _core_.Event_Clone(*args, **kwargs)
4409
4410 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4411 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4412 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4413 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4414 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
4415 _core_.Event_swigregister(Event)
4416
4417 #---------------------------------------------------------------------------
4418
4419 class PropagationDisabler(object):
4420 """
4421 Helper class to temporarily change an event not to propagate. Simply
4422 create an instance of this class and then whe it is destroyed the
4423 propogation of the event will be restored.
4424 """
4425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4426 __repr__ = _swig_repr
4427 def __init__(self, *args, **kwargs):
4428 """
4429 __init__(self, Event event) -> PropagationDisabler
4430
4431 Helper class to temporarily change an event not to propagate. Simply
4432 create an instance of this class and then whe it is destroyed the
4433 propogation of the event will be restored.
4434 """
4435 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4436 __swig_destroy__ = _core_.delete_PropagationDisabler
4437 __del__ = lambda self : None;
4438 _core_.PropagationDisabler_swigregister(PropagationDisabler)
4439
4440 class PropagateOnce(object):
4441 """
4442 A helper class that will temporarily lower propagation level of an
4443 event. Simply create an instance of this class and then whe it is
4444 destroyed the propogation of the event will be restored.
4445 """
4446 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4447 __repr__ = _swig_repr
4448 def __init__(self, *args, **kwargs):
4449 """
4450 __init__(self, Event event) -> PropagateOnce
4451
4452 A helper class that will temporarily lower propagation level of an
4453 event. Simply create an instance of this class and then whe it is
4454 destroyed the propogation of the event will be restored.
4455 """
4456 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4457 __swig_destroy__ = _core_.delete_PropagateOnce
4458 __del__ = lambda self : None;
4459 _core_.PropagateOnce_swigregister(PropagateOnce)
4460
4461 #---------------------------------------------------------------------------
4462
4463 class CommandEvent(Event):
4464 """
4465 This event class contains information about command events, which
4466 originate from a variety of simple controls, as well as menus and
4467 toolbars.
4468 """
4469 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4470 __repr__ = _swig_repr
4471 def __init__(self, *args, **kwargs):
4472 """
4473 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4474
4475 This event class contains information about command events, which
4476 originate from a variety of simple controls, as well as menus and
4477 toolbars.
4478 """
4479 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4480 def GetSelection(*args, **kwargs):
4481 """
4482 GetSelection(self) -> int
4483
4484 Returns item index for a listbox or choice selection event (not valid
4485 for a deselection).
4486 """
4487 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4488
4489 def SetString(*args, **kwargs):
4490 """SetString(self, String s)"""
4491 return _core_.CommandEvent_SetString(*args, **kwargs)
4492
4493 def GetString(*args, **kwargs):
4494 """
4495 GetString(self) -> String
4496
4497 Returns item string for a listbox or choice selection event (not valid
4498 for a deselection).
4499 """
4500 return _core_.CommandEvent_GetString(*args, **kwargs)
4501
4502 def IsChecked(*args, **kwargs):
4503 """
4504 IsChecked(self) -> bool
4505
4506 This method can be used with checkbox and menu events: for the
4507 checkboxes, the method returns true for a selection event and false
4508 for a deselection one. For the menu events, this method indicates if
4509 the menu item just has become checked or unchecked (and thus only
4510 makes sense for checkable menu items).
4511 """
4512 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4513
4514 Checked = IsChecked
4515 def IsSelection(*args, **kwargs):
4516 """
4517 IsSelection(self) -> bool
4518
4519 For a listbox or similar event, returns true if it is a selection,
4520 false if it is a deselection.
4521 """
4522 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4523
4524 def SetExtraLong(*args, **kwargs):
4525 """SetExtraLong(self, long extraLong)"""
4526 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4527
4528 def GetExtraLong(*args, **kwargs):
4529 """
4530 GetExtraLong(self) -> long
4531
4532 Returns extra information dependant on the event objects type. If the
4533 event comes from a listbox selection, it is a boolean determining
4534 whether the event was a selection (true) or a deselection (false). A
4535 listbox deselection only occurs for multiple-selection boxes, and in
4536 this case the index and string values are indeterminate and the
4537 listbox must be examined by the application.
4538 """
4539 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4540
4541 def SetInt(*args, **kwargs):
4542 """SetInt(self, int i)"""
4543 return _core_.CommandEvent_SetInt(*args, **kwargs)
4544
4545 def GetInt(*args, **kwargs):
4546 """
4547 GetInt(self) -> int
4548
4549 Returns the integer identifier corresponding to a listbox, choice or
4550 radiobox selection (only if the event was a selection, not a
4551 deselection), or a boolean value representing the value of a checkbox.
4552 """
4553 return _core_.CommandEvent_GetInt(*args, **kwargs)
4554
4555 def GetClientData(*args, **kwargs):
4556 """
4557 GetClientData(self) -> PyObject
4558
4559 Returns the client data object for a listbox or choice selection event, (if any.)
4560 """
4561 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4562
4563 def SetClientData(*args, **kwargs):
4564 """
4565 SetClientData(self, PyObject clientData)
4566
4567 Associate the given client data with the item at position n.
4568 """
4569 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4570
4571 GetClientObject = GetClientData
4572 SetClientObject = SetClientData
4573
4574 def Clone(*args, **kwargs):
4575 """Clone(self) -> Event"""
4576 return _core_.CommandEvent_Clone(*args, **kwargs)
4577
4578 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4579 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4580 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4581 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4582 Selection = property(GetSelection,doc="See `GetSelection`")
4583 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4584 _core_.CommandEvent_swigregister(CommandEvent)
4585
4586 #---------------------------------------------------------------------------
4587
4588 class NotifyEvent(CommandEvent):
4589 """
4590 An instance of this class (or one of its derived classes) is sent from
4591 a control when the control's state is being changed and the control
4592 allows that change to be prevented from happening. The event handler
4593 can call `Veto` or `Allow` to tell the control what to do.
4594 """
4595 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4596 __repr__ = _swig_repr
4597 def __init__(self, *args, **kwargs):
4598 """
4599 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4600
4601 An instance of this class (or one of its derived classes) is sent from
4602 a control when the control's state is being changed and the control
4603 allows that change to be prevented from happening. The event handler
4604 can call `Veto` or `Allow` to tell the control what to do.
4605 """
4606 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4607 def Veto(*args, **kwargs):
4608 """
4609 Veto(self)
4610
4611 Prevents the change announced by this event from happening.
4612
4613 It is in general a good idea to notify the user about the reasons for
4614 vetoing the change because otherwise the applications behaviour (which
4615 just refuses to do what the user wants) might be quite surprising.
4616 """
4617 return _core_.NotifyEvent_Veto(*args, **kwargs)
4618
4619 def Allow(*args, **kwargs):
4620 """
4621 Allow(self)
4622
4623 This is the opposite of `Veto`: it explicitly allows the event to be
4624 processed. For most events it is not necessary to call this method as
4625 the events are allowed anyhow but some are forbidden by default (this
4626 will be mentioned in the corresponding event description).
4627 """
4628 return _core_.NotifyEvent_Allow(*args, **kwargs)
4629
4630 def IsAllowed(*args, **kwargs):
4631 """
4632 IsAllowed(self) -> bool
4633
4634 Returns true if the change is allowed (`Veto` hasn't been called) or
4635 false otherwise (if it was).
4636 """
4637 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4638
4639 _core_.NotifyEvent_swigregister(NotifyEvent)
4640
4641 #---------------------------------------------------------------------------
4642
4643 class ScrollEvent(CommandEvent):
4644 """
4645 A scroll event holds information about events sent from stand-alone
4646 scrollbars and sliders. Note that scrolled windows do not send
4647 instances of this event class, but send the `wx.ScrollWinEvent`
4648 instead.
4649 """
4650 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4651 __repr__ = _swig_repr
4652 def __init__(self, *args, **kwargs):
4653 """
4654 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4655 int orient=0) -> ScrollEvent
4656 """
4657 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4658 def GetOrientation(*args, **kwargs):
4659 """
4660 GetOrientation(self) -> int
4661
4662 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4663 the scrollbar.
4664 """
4665 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4666
4667 def GetPosition(*args, **kwargs):
4668 """
4669 GetPosition(self) -> int
4670
4671 Returns the position of the scrollbar.
4672 """
4673 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4674
4675 def SetOrientation(*args, **kwargs):
4676 """SetOrientation(self, int orient)"""
4677 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4678
4679 def SetPosition(*args, **kwargs):
4680 """SetPosition(self, int pos)"""
4681 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4682
4683 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4684 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4685 _core_.ScrollEvent_swigregister(ScrollEvent)
4686
4687 #---------------------------------------------------------------------------
4688
4689 class ScrollWinEvent(Event):
4690 """
4691 A wx.ScrollWinEvent holds information about scrolling and is sent from
4692 scrolling windows.
4693 """
4694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4695 __repr__ = _swig_repr
4696 def __init__(self, *args, **kwargs):
4697 """
4698 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4699
4700 A wx.ScrollWinEvent holds information about scrolling and is sent from
4701 scrolling windows.
4702 """
4703 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4704 def GetOrientation(*args, **kwargs):
4705 """
4706 GetOrientation(self) -> int
4707
4708 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4709 the scrollbar.
4710 """
4711 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4712
4713 def GetPosition(*args, **kwargs):
4714 """
4715 GetPosition(self) -> int
4716
4717 Returns the position of the scrollbar for the thumb track and release
4718 events. Note that this field can't be used for the other events, you
4719 need to query the window itself for the current position in that case.
4720 """
4721 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4722
4723 def SetOrientation(*args, **kwargs):
4724 """SetOrientation(self, int orient)"""
4725 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4726
4727 def SetPosition(*args, **kwargs):
4728 """SetPosition(self, int pos)"""
4729 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4730
4731 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4732 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4733 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4734
4735 #---------------------------------------------------------------------------
4736
4737 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4738 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4739 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4740 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4741 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4742 class MouseEvent(Event):
4743 """
4744 This event class contains information about the events generated by
4745 the mouse: they include mouse buttons press and release events and
4746 mouse move events.
4747
4748 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4749 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4750 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4751 a middle button so a portable application should avoid relying on the
4752 events from it.
4753
4754 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4755 the former returns true when the event corresponds to the left mouse
4756 button click while the latter returns true if the left mouse button is
4757 currently being pressed. For example, when the user is dragging the
4758 mouse you can use `LeftIsDown` to test whether the left mouse button
4759 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4760 `LeftIsDown` will also return true in wxWidgets whatever the
4761 underlying GUI behaviour is (which is platform-dependent). The same
4762 applies, of course, to other mouse buttons as well.
4763 """
4764 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4765 __repr__ = _swig_repr
4766 def __init__(self, *args, **kwargs):
4767 """
4768 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4769
4770 Constructs a wx.MouseEvent. Valid event types are:
4771
4772 * wxEVT_ENTER_WINDOW
4773 * wxEVT_LEAVE_WINDOW
4774 * wxEVT_LEFT_DOWN
4775 * wxEVT_LEFT_UP
4776 * wxEVT_LEFT_DCLICK
4777 * wxEVT_MIDDLE_DOWN
4778 * wxEVT_MIDDLE_UP
4779 * wxEVT_MIDDLE_DCLICK
4780 * wxEVT_RIGHT_DOWN
4781 * wxEVT_RIGHT_UP
4782 * wxEVT_RIGHT_DCLICK
4783 * wxEVT_MOTION
4784 * wxEVT_MOUSEWHEEL
4785 """
4786 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4787 def IsButton(*args, **kwargs):
4788 """
4789 IsButton(self) -> bool
4790
4791 Returns true if the event was a mouse button event (not necessarily a
4792 button down event - that may be tested using `ButtonDown`).
4793 """
4794 return _core_.MouseEvent_IsButton(*args, **kwargs)
4795
4796 def ButtonDown(*args, **kwargs):
4797 """
4798 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4799
4800 If the argument is omitted, this returns true if the event was any
4801 mouse button down event. Otherwise the argument specifies which
4802 button-down event shold be checked for (see `Button` for the possible
4803 values).
4804 """
4805 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4806
4807 def ButtonDClick(*args, **kwargs):
4808 """
4809 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4810
4811 If the argument is omitted, this returns true if the event was any
4812 mouse double click event. Otherwise the argument specifies which
4813 double click event to check for (see `Button` for the possible
4814 values).
4815 """
4816 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4817
4818 def ButtonUp(*args, **kwargs):
4819 """
4820 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4821
4822 If the argument is omitted, this returns true if the event was any
4823 mouse button up event. Otherwise the argument specifies which button
4824 up event to check for (see `Button` for the possible values).
4825 """
4826 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4827
4828 def Button(*args, **kwargs):
4829 """
4830 Button(self, int button) -> bool
4831
4832 Returns true if the identified mouse button is changing state. Valid
4833 values of button are:
4834
4835 ==================== =====================================
4836 wx.MOUSE_BTN_LEFT check if left button was pressed
4837 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4838 wx.MOUSE_BTN_RIGHT check if right button was pressed
4839 wx.MOUSE_BTN_ANY check if any button was pressed
4840 ==================== =====================================
4841
4842 """
4843 return _core_.MouseEvent_Button(*args, **kwargs)
4844
4845 def ButtonIsDown(*args, **kwargs):
4846 """ButtonIsDown(self, int but) -> bool"""
4847 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4848
4849 def GetButton(*args, **kwargs):
4850 """
4851 GetButton(self) -> int
4852
4853 Returns the mouse button which generated this event or
4854 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4855 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4856 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4857 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4858 right buttons respectively.
4859 """
4860 return _core_.MouseEvent_GetButton(*args, **kwargs)
4861
4862 def ControlDown(*args, **kwargs):
4863 """
4864 ControlDown(self) -> bool
4865
4866 Returns true if the control key was down at the time of the event.
4867 """
4868 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4869
4870 def MetaDown(*args, **kwargs):
4871 """
4872 MetaDown(self) -> bool
4873
4874 Returns true if the Meta key was down at the time of the event.
4875 """
4876 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4877
4878 def AltDown(*args, **kwargs):
4879 """
4880 AltDown(self) -> bool
4881
4882 Returns true if the Alt key was down at the time of the event.
4883 """
4884 return _core_.MouseEvent_AltDown(*args, **kwargs)
4885
4886 def ShiftDown(*args, **kwargs):
4887 """
4888 ShiftDown(self) -> bool
4889
4890 Returns true if the Shift key was down at the time of the event.
4891 """
4892 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4893
4894 def CmdDown(*args, **kwargs):
4895 """
4896 CmdDown(self) -> bool
4897
4898 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4899 platforms but the special "Apple" (a.k.a as "Command") key on
4900 Macs. It often makes sense to use it instead of, say, `ControlDown`
4901 because Cmd key is used for the same thing under Mac as Ctrl
4902 elsewhere. The Ctrl key still exists, it's just not used for this
4903 purpose. So for non-Mac platforms this is the same as `ControlDown`
4904 and Macs this is the same as `MetaDown`.
4905 """
4906 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4907
4908 def LeftDown(*args, **kwargs):
4909 """
4910 LeftDown(self) -> bool
4911
4912 Returns true if the left mouse button state changed to down.
4913 """
4914 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4915
4916 def MiddleDown(*args, **kwargs):
4917 """
4918 MiddleDown(self) -> bool
4919
4920 Returns true if the middle mouse button state changed to down.
4921 """
4922 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4923
4924 def RightDown(*args, **kwargs):
4925 """
4926 RightDown(self) -> bool
4927
4928 Returns true if the right mouse button state changed to down.
4929 """
4930 return _core_.MouseEvent_RightDown(*args, **kwargs)
4931
4932 def LeftUp(*args, **kwargs):
4933 """
4934 LeftUp(self) -> bool
4935
4936 Returns true if the left mouse button state changed to up.
4937 """
4938 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4939
4940 def MiddleUp(*args, **kwargs):
4941 """
4942 MiddleUp(self) -> bool
4943
4944 Returns true if the middle mouse button state changed to up.
4945 """
4946 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4947
4948 def RightUp(*args, **kwargs):
4949 """
4950 RightUp(self) -> bool
4951
4952 Returns true if the right mouse button state changed to up.
4953 """
4954 return _core_.MouseEvent_RightUp(*args, **kwargs)
4955
4956 def LeftDClick(*args, **kwargs):
4957 """
4958 LeftDClick(self) -> bool
4959
4960 Returns true if the event was a left button double click.
4961 """
4962 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4963
4964 def MiddleDClick(*args, **kwargs):
4965 """
4966 MiddleDClick(self) -> bool
4967
4968 Returns true if the event was a middle button double click.
4969 """
4970 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4971
4972 def RightDClick(*args, **kwargs):
4973 """
4974 RightDClick(self) -> bool
4975
4976 Returns true if the event was a right button double click.
4977 """
4978 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4979
4980 def LeftIsDown(*args, **kwargs):
4981 """
4982 LeftIsDown(self) -> bool
4983
4984 Returns true if the left mouse button is currently down, independent
4985 of the current event type.
4986
4987 Please notice that it is not the same as LeftDown which returns true
4988 if the left mouse button was just pressed. Rather, it describes the
4989 state of the mouse button before the event happened.
4990
4991 This event is usually used in the mouse event handlers which process
4992 "move mouse" messages to determine whether the user is (still)
4993 dragging the mouse.
4994 """
4995 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4996
4997 def MiddleIsDown(*args, **kwargs):
4998 """
4999 MiddleIsDown(self) -> bool
5000
5001 Returns true if the middle mouse button is currently down, independent
5002 of the current event type.
5003 """
5004 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
5005
5006 def RightIsDown(*args, **kwargs):
5007 """
5008 RightIsDown(self) -> bool
5009
5010 Returns true if the right mouse button is currently down, independent
5011 of the current event type.
5012 """
5013 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
5014
5015 def Dragging(*args, **kwargs):
5016 """
5017 Dragging(self) -> bool
5018
5019 Returns true if this was a dragging event (motion while a button is
5020 depressed).
5021 """
5022 return _core_.MouseEvent_Dragging(*args, **kwargs)
5023
5024 def Moving(*args, **kwargs):
5025 """
5026 Moving(self) -> bool
5027
5028 Returns true if this was a motion event and no mouse buttons were
5029 pressed. If any mouse button is held pressed, then this method returns
5030 false and Dragging returns true.
5031 """
5032 return _core_.MouseEvent_Moving(*args, **kwargs)
5033
5034 def Entering(*args, **kwargs):
5035 """
5036 Entering(self) -> bool
5037
5038 Returns true if the mouse was entering the window.
5039 """
5040 return _core_.MouseEvent_Entering(*args, **kwargs)
5041
5042 def Leaving(*args, **kwargs):
5043 """
5044 Leaving(self) -> bool
5045
5046 Returns true if the mouse was leaving the window.
5047 """
5048 return _core_.MouseEvent_Leaving(*args, **kwargs)
5049
5050 def GetPosition(*args, **kwargs):
5051 """
5052 GetPosition(self) -> Point
5053
5054 Returns the pixel position of the mouse in window coordinates when the
5055 event happened.
5056 """
5057 return _core_.MouseEvent_GetPosition(*args, **kwargs)
5058
5059 def GetPositionTuple(*args, **kwargs):
5060 """
5061 GetPositionTuple() -> (x,y)
5062
5063 Returns the pixel position of the mouse in window coordinates when the
5064 event happened.
5065 """
5066 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
5067
5068 def GetLogicalPosition(*args, **kwargs):
5069 """
5070 GetLogicalPosition(self, DC dc) -> Point
5071
5072 Returns the logical mouse position in pixels (i.e. translated
5073 according to the translation set for the DC, which usually indicates
5074 that the window has been scrolled).
5075 """
5076 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
5077
5078 def GetX(*args, **kwargs):
5079 """
5080 GetX(self) -> int
5081
5082 Returns X coordinate of the physical mouse event position.
5083 """
5084 return _core_.MouseEvent_GetX(*args, **kwargs)
5085
5086 def GetY(*args, **kwargs):
5087 """
5088 GetY(self) -> int
5089
5090 Returns Y coordinate of the physical mouse event position.
5091 """
5092 return _core_.MouseEvent_GetY(*args, **kwargs)
5093
5094 def GetWheelRotation(*args, **kwargs):
5095 """
5096 GetWheelRotation(self) -> int
5097
5098 Get wheel rotation, positive or negative indicates direction of
5099 rotation. Current devices all send an event when rotation is equal to
5100 +/-WheelDelta, but this allows for finer resolution devices to be
5101 created in the future. Because of this you shouldn't assume that one
5102 event is equal to 1 line or whatever, but you should be able to either
5103 do partial line scrolling or wait until +/-WheelDelta rotation values
5104 have been accumulated before scrolling.
5105 """
5106 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
5107
5108 def GetWheelDelta(*args, **kwargs):
5109 """
5110 GetWheelDelta(self) -> int
5111
5112 Get wheel delta, normally 120. This is the threshold for action to be
5113 taken, and one such action (for example, scrolling one increment)
5114 should occur for each delta.
5115 """
5116 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
5117
5118 def GetWheelAxis(*args, **kwargs):
5119 """
5120 GetWheelAxis(self) -> int
5121
5122 Gets the axis the wheel operation concerns, 0 being the y axis as on
5123 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5124 or horizontal trackpad scrolling.
5125 """
5126 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5127
5128 def GetLinesPerAction(*args, **kwargs):
5129 """
5130 GetLinesPerAction(self) -> int
5131
5132 Returns the configured number of lines (or whatever) to be scrolled
5133 per wheel action. Defaults to three.
5134 """
5135 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
5136
5137 def IsPageScroll(*args, **kwargs):
5138 """
5139 IsPageScroll(self) -> bool
5140
5141 Returns true if the system has been setup to do page scrolling with
5142 the mouse wheel instead of line scrolling.
5143 """
5144 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5145
5146 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5147 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5148 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5149 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5150 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5151 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5152 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5153 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5154 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5155 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5156 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5157 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
5158 Button = property(GetButton,doc="See `GetButton`")
5159 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5160 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5161 Position = property(GetPosition,doc="See `GetPosition`")
5162 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5163 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5164 X = property(GetX,doc="See `GetX`")
5165 Y = property(GetY,doc="See `GetY`")
5166 _core_.MouseEvent_swigregister(MouseEvent)
5167
5168 #---------------------------------------------------------------------------
5169
5170 class SetCursorEvent(Event):
5171 """
5172 A SetCursorEvent is generated when the mouse cursor is about to be set
5173 as a result of mouse motion. This event gives the application the
5174 chance to perform specific mouse cursor processing based on the
5175 current position of the mouse within the window. Use the `SetCursor`
5176 method to specify the cursor you want to be displayed.
5177 """
5178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5179 __repr__ = _swig_repr
5180 def __init__(self, *args, **kwargs):
5181 """
5182 __init__(self, int x=0, int y=0) -> SetCursorEvent
5183
5184 Construct a new `wx.SetCursorEvent`.
5185 """
5186 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
5187 def GetX(*args, **kwargs):
5188 """
5189 GetX(self) -> int
5190
5191 Returns the X coordinate of the mouse in client coordinates.
5192 """
5193 return _core_.SetCursorEvent_GetX(*args, **kwargs)
5194
5195 def GetY(*args, **kwargs):
5196 """
5197 GetY(self) -> int
5198
5199 Returns the Y coordinate of the mouse in client coordinates.
5200 """
5201 return _core_.SetCursorEvent_GetY(*args, **kwargs)
5202
5203 def SetCursor(*args, **kwargs):
5204 """
5205 SetCursor(self, Cursor cursor)
5206
5207 Sets the cursor associated with this event.
5208 """
5209 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
5210
5211 def GetCursor(*args, **kwargs):
5212 """
5213 GetCursor(self) -> Cursor
5214
5215 Returns a reference to the cursor specified by this event.
5216 """
5217 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
5218
5219 def HasCursor(*args, **kwargs):
5220 """
5221 HasCursor(self) -> bool
5222
5223 Returns true if the cursor specified by this event is a valid cursor.
5224 """
5225 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
5226
5227 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5228 X = property(GetX,doc="See `GetX`")
5229 Y = property(GetY,doc="See `GetY`")
5230 _core_.SetCursorEvent_swigregister(SetCursorEvent)
5231
5232 #---------------------------------------------------------------------------
5233
5234 class KeyEvent(Event):
5235 """
5236 This event class contains information about keypress and character
5237 events. These events are only sent to the widget that currently has
5238 the keyboard focus.
5239
5240 Notice that there are three different kinds of keyboard events in
5241 wxWidgets: key down and up events and char events. The difference
5242 between the first two is clear - the first corresponds to a key press
5243 and the second to a key release - otherwise they are identical. Just
5244 note that if the key is maintained in a pressed state you will
5245 typically get a lot of (automatically generated) down events but only
5246 one up so it is wrong to assume that there is one up event
5247 corresponding to each down one.
5248
5249 Both key events provide untranslated key codes while the char event
5250 carries the translated one. The untranslated code for alphanumeric
5251 keys is always an upper case value. For the other keys it is one of
5252 WXK_XXX values from the keycodes table. The translated key is, in
5253 general, the character the user expects to appear as the result of the
5254 key combination when typing the text into a text entry zone, for
5255 example.
5256
5257 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5258 and the standard US keyboard): when the 'A' key is pressed, the key
5259 down event key code is equal to ASCII A == 65. But the char event key
5260 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5261 'A' keys simultaneously , the key code in key down event will still be
5262 just 'A' while the char event key code parameter will now be 'A' as
5263 well.
5264
5265 Although in this simple case it is clear that the correct key code
5266 could be found in the key down event handler by checking the value
5267 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5268 as for non alphanumeric keys or non-US keyboard layouts the
5269 translation is keyboard-layout dependent and can only be done properly
5270 by the system itself.
5271
5272 Another kind of translation is done when the control key is pressed:
5273 for example, for CTRL-A key press the key down event still carries the
5274 same key code 'A' as usual but the char event will have key code of 1,
5275 the ASCII value of this key combination.
5276
5277 You may discover how the other keys on your system behave
5278 interactively by running the KeyEvents sample in the wxPython demo and
5279 pressing some keys while the blue box at the top has the keyboard
5280 focus.
5281
5282 **Note**: If a key down event is caught and the event handler does not
5283 call event.Skip() then the coresponding char event will not
5284 happen. This is by design and enables the programs that handle both
5285 types of events to be a bit simpler.
5286
5287 **Note for Windows programmers**: The key and char events in wxWidgets
5288 are similar to but slightly different from Windows WM_KEYDOWN and
5289 WM_CHAR events. In particular, Alt-x combination will generate a char
5290 event in wxWidgets (unless it is used as an accelerator).
5291
5292 **Tip**: be sure to call event.Skip() for events that you don't
5293 process in key event function, otherwise menu shortcuts may cease to
5294 work under Windows.
5295
5296 """
5297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5298 __repr__ = _swig_repr
5299 def __init__(self, *args, **kwargs):
5300 """
5301 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5302
5303 Construct a new `wx.KeyEvent`. Valid event types are:
5304 *
5305 """
5306 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
5307 def GetModifiers(*args, **kwargs):
5308 """
5309 GetModifiers(self) -> int
5310
5311 Returns a bitmask of the current modifier settings. Can be used to
5312 check if the key event has exactly the given modifiers without having
5313 to explicitly check that the other modifiers are not down. For
5314 example::
5315
5316 if event.GetModifers() == wx.MOD_CONTROL:
5317 DoSomething()
5318
5319 """
5320 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5321
5322 def ControlDown(*args, **kwargs):
5323 """
5324 ControlDown(self) -> bool
5325
5326 Returns ``True`` if the Control key was down at the time of the event.
5327 """
5328 return _core_.KeyEvent_ControlDown(*args, **kwargs)
5329
5330 def MetaDown(*args, **kwargs):
5331 """
5332 MetaDown(self) -> bool
5333
5334 Returns ``True`` if the Meta key was down at the time of the event.
5335 """
5336 return _core_.KeyEvent_MetaDown(*args, **kwargs)
5337
5338 def AltDown(*args, **kwargs):
5339 """
5340 AltDown(self) -> bool
5341
5342 Returns ``True`` if the Alt key was down at the time of the event.
5343 """
5344 return _core_.KeyEvent_AltDown(*args, **kwargs)
5345
5346 def ShiftDown(*args, **kwargs):
5347 """
5348 ShiftDown(self) -> bool
5349
5350 Returns ``True`` if the Shift key was down at the time of the event.
5351 """
5352 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
5353
5354 def CmdDown(*args, **kwargs):
5355 """
5356 CmdDown(self) -> bool
5357
5358 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5359 platforms but the special "Apple" (a.k.a as "Command") key on
5360 Macs. It makes often sense to use it instead of, say, `ControlDown`
5361 because Cmd key is used for the same thing under Mac as Ctrl
5362 elsewhere. The Ctrl still exists, it's just not used for this
5363 purpose. So for non-Mac platforms this is the same as `ControlDown`
5364 and Macs this is the same as `MetaDown`.
5365 """
5366 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5367
5368 def HasModifiers(*args, **kwargs):
5369 """
5370 HasModifiers(self) -> bool
5371
5372 Returns true if either CTRL or ALT keys was down at the time of the
5373 key event. Note that this function does not take into account neither
5374 SHIFT nor META key states (the reason for ignoring the latter is that
5375 it is common for NUMLOCK key to be configured as META under X but the
5376 key presses even while NUMLOCK is on should be still processed
5377 normally).
5378 """
5379 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5380
5381 def GetKeyCode(*args, **kwargs):
5382 """
5383 GetKeyCode(self) -> int
5384
5385 Returns the virtual key code. ASCII events return normal ASCII values,
5386 while non-ASCII events return values such as WXK_LEFT for the left
5387 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5388 codes.
5389
5390 Note that in Unicode build, the returned value is meaningful only if
5391 the user entered a character that can be represented in current
5392 locale's default charset. You can obtain the corresponding Unicode
5393 character using `GetUnicodeKey`.
5394 """
5395 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5396
5397 def GetUnicodeKey(*args, **kwargs):
5398 """
5399 GetUnicodeKey(self) -> int
5400
5401 Returns the Unicode character corresponding to this key event. This
5402 function is only meaningfule in a Unicode build of wxPython.
5403 """
5404 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
5405
5406 GetUniChar = GetUnicodeKey
5407 def SetUnicodeKey(*args, **kwargs):
5408 """
5409 SetUnicodeKey(self, int uniChar)
5410
5411 Set the Unicode value of the key event, but only if this is a Unicode
5412 build of wxPython.
5413 """
5414 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5415
5416 def GetRawKeyCode(*args, **kwargs):
5417 """
5418 GetRawKeyCode(self) -> unsigned int
5419
5420 Returns the raw key code for this event. This is a platform-dependent
5421 scan code which should only be used in advanced
5422 applications. Currently the raw key codes are not supported by all
5423 ports.
5424 """
5425 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5426
5427 def GetRawKeyFlags(*args, **kwargs):
5428 """
5429 GetRawKeyFlags(self) -> unsigned int
5430
5431 Returns the low level key flags for this event. The flags are
5432 platform-dependent and should only be used in advanced applications.
5433 Currently the raw key flags are not supported by all ports.
5434 """
5435 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5436
5437 def GetPosition(*args, **kwargs):
5438 """
5439 GetPosition(self) -> Point
5440
5441 Find the position of the event, if applicable.
5442 """
5443 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5444
5445 def GetPositionTuple(*args, **kwargs):
5446 """
5447 GetPositionTuple() -> (x,y)
5448
5449 Find the position of the event, if applicable.
5450 """
5451 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5452
5453 def GetX(*args, **kwargs):
5454 """
5455 GetX(self) -> int
5456
5457 Returns the X position (in client coordinates) of the event, if
5458 applicable.
5459 """
5460 return _core_.KeyEvent_GetX(*args, **kwargs)
5461
5462 def GetY(*args, **kwargs):
5463 """
5464 GetY(self) -> int
5465
5466 Returns the Y position (in client coordinates) of the event, if
5467 applicable.
5468 """
5469 return _core_.KeyEvent_GetY(*args, **kwargs)
5470
5471 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5472 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5473 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5474 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5475 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5476 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5477 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5478 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5479 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5480 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5481 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5482 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5483 Position = property(GetPosition,doc="See `GetPosition`")
5484 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5485 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5486 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5487 X = property(GetX,doc="See `GetX`")
5488 Y = property(GetY,doc="See `GetY`")
5489 _core_.KeyEvent_swigregister(KeyEvent)
5490
5491 #---------------------------------------------------------------------------
5492
5493 class SizeEvent(Event):
5494 """
5495 A size event holds information about size change events. The EVT_SIZE
5496 handler function will be called when the window it is bound to has
5497 been resized.
5498
5499 Note that the size passed is of the whole window: call
5500 `wx.Window.GetClientSize` for the area which may be used by the
5501 application.
5502
5503 When a window is resized, usually only a small part of the window is
5504 damaged and and that area is all that is in the update region for the
5505 next paint event. However, if your drawing depends on the size of the
5506 window, you may need to clear the DC explicitly and repaint the whole
5507 window. In which case, you may need to call `wx.Window.Refresh` to
5508 invalidate the entire window.
5509
5510 """
5511 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5512 __repr__ = _swig_repr
5513 def __init__(self, *args, **kwargs):
5514 """
5515 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5516
5517 Construct a new ``wx.SizeEvent``.
5518 """
5519 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5520 def GetSize(*args, **kwargs):
5521 """
5522 GetSize(self) -> Size
5523
5524 Returns the entire size of the window generating the size change
5525 event.
5526 """
5527 return _core_.SizeEvent_GetSize(*args, **kwargs)
5528
5529 def GetRect(*args, **kwargs):
5530 """GetRect(self) -> Rect"""
5531 return _core_.SizeEvent_GetRect(*args, **kwargs)
5532
5533 def SetRect(*args, **kwargs):
5534 """SetRect(self, Rect rect)"""
5535 return _core_.SizeEvent_SetRect(*args, **kwargs)
5536
5537 def SetSize(*args, **kwargs):
5538 """SetSize(self, Size size)"""
5539 return _core_.SizeEvent_SetSize(*args, **kwargs)
5540
5541 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5542 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5543 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5544 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
5545 _core_.SizeEvent_swigregister(SizeEvent)
5546
5547 #---------------------------------------------------------------------------
5548
5549 class MoveEvent(Event):
5550 """
5551 This event object is sent for EVT_MOVE event bindings when a window is
5552 moved to a new position.
5553 """
5554 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5555 __repr__ = _swig_repr
5556 def __init__(self, *args, **kwargs):
5557 """
5558 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5559
5560 Constructor.
5561 """
5562 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5563 def GetPosition(*args, **kwargs):
5564 """
5565 GetPosition(self) -> Point
5566
5567 Returns the position of the window generating the move change event.
5568 """
5569 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5570
5571 def GetRect(*args, **kwargs):
5572 """GetRect(self) -> Rect"""
5573 return _core_.MoveEvent_GetRect(*args, **kwargs)
5574
5575 def SetRect(*args, **kwargs):
5576 """SetRect(self, Rect rect)"""
5577 return _core_.MoveEvent_SetRect(*args, **kwargs)
5578
5579 def SetPosition(*args, **kwargs):
5580 """SetPosition(self, Point pos)"""
5581 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5582
5583 m_pos = property(GetPosition, SetPosition)
5584 m_rect = property(GetRect, SetRect)
5585
5586 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5587 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5588 _core_.MoveEvent_swigregister(MoveEvent)
5589
5590 #---------------------------------------------------------------------------
5591
5592 class PaintEvent(Event):
5593 """
5594 A paint event is sent when a window's contents needs to be repainted.
5595 Note that in an EVT_PAINT handler the application must *always* create
5596 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5597 Windows assumes that the window has not been painted yet and will send
5598 the event again, causing endless refreshes.
5599
5600 You can optimize painting by retrieving the rectangles that have been
5601 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5602 and only repainting these rectangles. The rectangles are in terms of
5603 the client area, and are unscrolled, so you will need to do some
5604 calculations using the current view position to obtain logical,
5605 scrolled units.
5606
5607 """
5608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5609 __repr__ = _swig_repr
5610 def __init__(self, *args, **kwargs):
5611 """__init__(self, int Id=0) -> PaintEvent"""
5612 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5613 _core_.PaintEvent_swigregister(PaintEvent)
5614
5615 class NcPaintEvent(Event):
5616 """Proxy of C++ NcPaintEvent class"""
5617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5618 __repr__ = _swig_repr
5619 def __init__(self, *args, **kwargs):
5620 """__init__(self, int winid=0) -> NcPaintEvent"""
5621 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5622 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5623
5624 #---------------------------------------------------------------------------
5625
5626 class EraseEvent(Event):
5627 """
5628 An erase event is sent whenever the background of a window needs to be
5629 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5630 binder. On some platforms, such as GTK+, this event is simulated
5631 (simply generated just before the paint event) and may cause flicker.
5632
5633 To paint a custom background use the `GetDC` method and use the returned
5634 device context if it is not ``None``, otherwise create a temporary
5635 `wx.ClientDC` and draw on that.
5636
5637 """
5638 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5639 __repr__ = _swig_repr
5640 def __init__(self, *args, **kwargs):
5641 """
5642 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5643
5644 Constructor
5645 """
5646 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5647 def GetDC(*args, **kwargs):
5648 """
5649 GetDC(self) -> DC
5650
5651 Returns the device context the event handler should draw upon. If
5652 ``None`` is returned then create a temporary `wx.ClientDC` and use
5653 that instead.
5654 """
5655 return _core_.EraseEvent_GetDC(*args, **kwargs)
5656
5657 DC = property(GetDC,doc="See `GetDC`")
5658 _core_.EraseEvent_swigregister(EraseEvent)
5659
5660 #---------------------------------------------------------------------------
5661
5662 class FocusEvent(Event):
5663 """
5664 A focus event is sent when a window's focus changes. The window losing
5665 focus receives an EVT_KILL_FOCUS event while the window gaining it
5666 gets an EVT_SET_FOCUS event.
5667
5668 Notice that the set focus event happens both when the user gives focus
5669 to the window (whether using the mouse or keyboard) and when it is
5670 done from the program itself using `wx.Window.SetFocus`.
5671
5672 """
5673 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5674 __repr__ = _swig_repr
5675 def __init__(self, *args, **kwargs):
5676 """
5677 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5678
5679 Constructor
5680 """
5681 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5682 def GetWindow(*args, **kwargs):
5683 """
5684 GetWindow(self) -> Window
5685
5686 Returns the other window associated with this event, that is the
5687 window which had the focus before for the EVT_SET_FOCUS event and the
5688 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5689
5690 Warning: the window returned may be None!
5691 """
5692 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5693
5694 def SetWindow(*args, **kwargs):
5695 """SetWindow(self, Window win)"""
5696 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5697
5698 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5699 _core_.FocusEvent_swigregister(FocusEvent)
5700
5701 #---------------------------------------------------------------------------
5702
5703 class ChildFocusEvent(CommandEvent):
5704 """
5705 A child focus event is sent to a (parent-)window when one of its child
5706 windows gains focus, so that the window could restore the focus back
5707 to its corresponding child if it loses it now and regains later.
5708
5709 Notice that child window is the direct child of the window receiving
5710 the event, and so may not be the actual widget recieving focus if it
5711 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5712 to get the widget that is actually receiving focus.
5713 """
5714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5715 __repr__ = _swig_repr
5716 def __init__(self, *args, **kwargs):
5717 """
5718 __init__(self, Window win=None) -> ChildFocusEvent
5719
5720 Constructor
5721 """
5722 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5723 def GetWindow(*args, **kwargs):
5724 """
5725 GetWindow(self) -> Window
5726
5727 The window, or (grand)parent of the window which has just received the
5728 focus.
5729 """
5730 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5731
5732 Window = property(GetWindow,doc="See `GetWindow`")
5733 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5734
5735 #---------------------------------------------------------------------------
5736
5737 class ActivateEvent(Event):
5738 """
5739 An activate event is sent when a top-level window or the entire
5740 application is being activated or deactivated.
5741
5742 A top-level window (a dialog or frame) receives an activate event when
5743 is being activated or deactivated. This is indicated visually by the
5744 title bar changing colour, and a subwindow gaining the keyboard focus.
5745 An application is activated or deactivated when one of its frames
5746 becomes activated, or a frame becomes inactivate resulting in all
5747 application frames being inactive.
5748
5749 Please note that usually you should call event.Skip() in your handlers
5750 for these events so the default handlers will still be called, as not
5751 doing so can result in strange effects.
5752
5753 """
5754 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5755 __repr__ = _swig_repr
5756 def __init__(self, *args, **kwargs):
5757 """
5758 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5759
5760 Constructor
5761 """
5762 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5763 def GetActive(*args, **kwargs):
5764 """
5765 GetActive(self) -> bool
5766
5767 Returns true if the application or window is being activated, false
5768 otherwise.
5769 """
5770 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5771
5772 Active = property(GetActive,doc="See `GetActive`")
5773 _core_.ActivateEvent_swigregister(ActivateEvent)
5774
5775 #---------------------------------------------------------------------------
5776
5777 class InitDialogEvent(Event):
5778 """
5779 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5780 any window when `wx.Window.InitDialog` is called. Handlers for this
5781 event can transfer data to the window, or anything else that should be
5782 done before the user begins editing the form. The default handler
5783 calls `wx.Window.TransferDataToWindow`.
5784 """
5785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5786 __repr__ = _swig_repr
5787 def __init__(self, *args, **kwargs):
5788 """
5789 __init__(self, int Id=0) -> InitDialogEvent
5790
5791 Constructor
5792 """
5793 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5794 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5795
5796 #---------------------------------------------------------------------------
5797
5798 class MenuEvent(Event):
5799 """
5800 This class is used for a variety of menu-related events. Note that
5801 these do not include menu command events, which are handled by sending
5802 `wx.CommandEvent` objects.
5803
5804 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5805 text in the first field of the status bar.
5806 """
5807 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5808 __repr__ = _swig_repr
5809 def __init__(self, *args, **kwargs):
5810 """
5811 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5812
5813 Constructor
5814 """
5815 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5816 def GetMenuId(*args, **kwargs):
5817 """
5818 GetMenuId(self) -> int
5819
5820 Returns the menu identifier associated with the event. This method
5821 should be only used with the HIGHLIGHT events.
5822 """
5823 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5824
5825 def IsPopup(*args, **kwargs):
5826 """
5827 IsPopup(self) -> bool
5828
5829 Returns ``True`` if the menu which is being opened or closed is a
5830 popup menu, ``False`` if it is a normal one. This method should only
5831 be used with the OPEN and CLOSE events.
5832 """
5833 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5834
5835 def GetMenu(*args, **kwargs):
5836 """
5837 GetMenu(self) -> Menu
5838
5839 Returns the menu which is being opened or closed. This method should
5840 only be used with the OPEN and CLOSE events.
5841 """
5842 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5843
5844 Menu = property(GetMenu,doc="See `GetMenu`")
5845 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5846 _core_.MenuEvent_swigregister(MenuEvent)
5847
5848 #---------------------------------------------------------------------------
5849
5850 class CloseEvent(Event):
5851 """
5852 This event class contains information about window and session close
5853 events.
5854
5855 The handler function for EVT_CLOSE is called when the user has tried
5856 to close a a frame or dialog box using the window manager controls or
5857 the system menu. It can also be invoked by the application itself
5858 programmatically, for example by calling the `wx.Window.Close`
5859 function.
5860
5861 You should check whether the application is forcing the deletion of
5862 the window using `CanVeto`. If it returns ``False``, you must destroy
5863 the window using `wx.Window.Destroy`. If the return value is ``True``,
5864 it is up to you whether you respond by destroying the window or not.
5865 For example you may wish to display a message dialog prompting to save
5866 files or to cancel the close.
5867
5868 If you don't destroy the window, you should call `Veto` to let the
5869 calling code know that you did not destroy the window. This allows the
5870 `wx.Window.Close` function to return ``True`` or ``False`` depending
5871 on whether the close instruction was honored or not.
5872 """
5873 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5874 __repr__ = _swig_repr
5875 def __init__(self, *args, **kwargs):
5876 """
5877 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5878
5879 Constructor.
5880 """
5881 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5882 def SetLoggingOff(*args, **kwargs):
5883 """
5884 SetLoggingOff(self, bool logOff)
5885
5886 Sets the 'logging off' flag.
5887 """
5888 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5889
5890 def GetLoggingOff(*args, **kwargs):
5891 """
5892 GetLoggingOff(self) -> bool
5893
5894 Returns ``True`` if the user is logging off or ``False`` if the
5895 system is shutting down. This method can only be called for end
5896 session and query end session events, it doesn't make sense for close
5897 window event.
5898 """
5899 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5900
5901 def Veto(*args, **kwargs):
5902 """
5903 Veto(self, bool veto=True)
5904
5905 Call this from your event handler to veto a system shutdown or to
5906 signal to the calling application that a window close did not happen.
5907
5908 You can only veto a shutdown or close if `CanVeto` returns true.
5909 """
5910 return _core_.CloseEvent_Veto(*args, **kwargs)
5911
5912 def GetVeto(*args, **kwargs):
5913 """GetVeto(self) -> bool"""
5914 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5915
5916 def SetCanVeto(*args, **kwargs):
5917 """
5918 SetCanVeto(self, bool canVeto)
5919
5920 Sets the 'can veto' flag.
5921 """
5922 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5923
5924 def CanVeto(*args, **kwargs):
5925 """
5926 CanVeto(self) -> bool
5927
5928 Returns true if you can veto a system shutdown or a window close
5929 event. Vetoing a window close event is not possible if the calling
5930 code wishes to force the application to exit, and so this function
5931 must be called to check this.
5932 """
5933 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5934
5935 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5936 _core_.CloseEvent_swigregister(CloseEvent)
5937
5938 #---------------------------------------------------------------------------
5939
5940 class ShowEvent(Event):
5941 """An EVT_SHOW event is sent when a window is shown or hidden."""
5942 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5943 __repr__ = _swig_repr
5944 def __init__(self, *args, **kwargs):
5945 """
5946 __init__(self, int winid=0, bool show=False) -> ShowEvent
5947
5948 An EVT_SHOW event is sent when a window is shown or hidden.
5949 """
5950 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5951 def SetShow(*args, **kwargs):
5952 """SetShow(self, bool show)"""
5953 return _core_.ShowEvent_SetShow(*args, **kwargs)
5954
5955 def GetShow(*args, **kwargs):
5956 """GetShow(self) -> bool"""
5957 return _core_.ShowEvent_GetShow(*args, **kwargs)
5958
5959 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
5960 _core_.ShowEvent_swigregister(ShowEvent)
5961
5962 #---------------------------------------------------------------------------
5963
5964 class IconizeEvent(Event):
5965 """
5966 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5967 restored.
5968 """
5969 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5970 __repr__ = _swig_repr
5971 def __init__(self, *args, **kwargs):
5972 """
5973 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5974
5975 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5976 restored.
5977 """
5978 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5979 def Iconized(*args, **kwargs):
5980 """
5981 Iconized(self) -> bool
5982
5983 Returns ``True`` if the frame has been iconized, ``False`` if it has
5984 been restored.
5985 """
5986 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5987
5988 _core_.IconizeEvent_swigregister(IconizeEvent)
5989
5990 #---------------------------------------------------------------------------
5991
5992 class MaximizeEvent(Event):
5993 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5994 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5995 __repr__ = _swig_repr
5996 def __init__(self, *args, **kwargs):
5997 """
5998 __init__(self, int id=0) -> MaximizeEvent
5999
6000 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
6001 """
6002 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
6003 _core_.MaximizeEvent_swigregister(MaximizeEvent)
6004
6005 #---------------------------------------------------------------------------
6006
6007 class DropFilesEvent(Event):
6008 """
6009 This class is used for drop files events, that is, when files have
6010 been dropped onto the window. This functionality is only available
6011 under Windows. The window must have previously been enabled for
6012 dropping by calling `wx.Window.DragAcceptFiles`.
6013
6014 Important note: this is a separate implementation to the more general
6015 drag and drop implementation using `wx.FileDropTarget`, and etc. This
6016 implementation uses the older, Windows message-based approach of
6017 dropping files.
6018
6019 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
6020 events.
6021
6022 """
6023 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6024 def __init__(self): raise AttributeError, "No constructor defined"
6025 __repr__ = _swig_repr
6026 def GetPosition(*args, **kwargs):
6027 """
6028 GetPosition(self) -> Point
6029
6030 Returns the position at which the files were dropped.
6031 """
6032 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
6033
6034 def GetNumberOfFiles(*args, **kwargs):
6035 """
6036 GetNumberOfFiles(self) -> int
6037
6038 Returns the number of files dropped.
6039 """
6040 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
6041
6042 def GetFiles(*args, **kwargs):
6043 """
6044 GetFiles(self) -> PyObject
6045
6046 Returns a list of the filenames that were dropped.
6047 """
6048 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
6049
6050 Files = property(GetFiles,doc="See `GetFiles`")
6051 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
6052 Position = property(GetPosition,doc="See `GetPosition`")
6053 _core_.DropFilesEvent_swigregister(DropFilesEvent)
6054
6055 #---------------------------------------------------------------------------
6056
6057 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
6058 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
6059 class UpdateUIEvent(CommandEvent):
6060 """
6061 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
6062 wxWidgets to give an application the chance to update various user
6063 interface elements.
6064
6065 Without update UI events, an application has to work hard to
6066 check/uncheck, enable/disable, and set the text for elements such as
6067 menu items and toolbar buttons. The code for doing this has to be
6068 mixed up with the code that is invoked when an action is invoked for a
6069 menu item or button.
6070
6071 With update UI events, you define an event handler to look at the
6072 state of the application and change UI elements accordingly. wxWidgets
6073 will call your handler functions in idle time, so you don't have to
6074 worry where to call this code. In addition to being a clearer and more
6075 declarative method, it also means you don't have to worry whether
6076 you're updating a toolbar or menubar identifier. The same handler can
6077 update a menu item and toolbar button, if the ID values are the same.
6078
6079 Instead of directly manipulating the menu or button, you call
6080 functions in the event object, such as `Check`. wxWidgets will
6081 determine whether such a call has been made, and which UI element to
6082 update.
6083
6084 These events will work for popup menus as well as menubars. Just
6085 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6086 any UI events for the window that owns the menu.
6087
6088 If you find that the overhead of UI update processing is affecting
6089 your application, you can do one or both of the following:
6090
6091 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6092 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6093 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6094 receive update events. No other windows will receive update
6095 events.
6096
6097 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6098 value to set the delay between updates. You may need to call
6099 `wx.Window.UpdateWindowUI` at critical points, for example when
6100 a dialog is about to be shown, in case the user sees a slight
6101 delay before windows are updated.
6102
6103 Note that although events are sent in idle time, defining a EVT_IDLE
6104 handler for a window does not affect this because the events are sent
6105 from an internal idle handler.
6106
6107 wxWidgets tries to optimize update events on some platforms. On
6108 Windows and GTK+, events for menubar items are only sent when the menu
6109 is about to be shown, and not in idle time.
6110
6111 """
6112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6113 __repr__ = _swig_repr
6114 def __init__(self, *args, **kwargs):
6115 """
6116 __init__(self, int commandId=0) -> UpdateUIEvent
6117
6118 Constructor
6119 """
6120 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
6121 def GetChecked(*args, **kwargs):
6122 """
6123 GetChecked(self) -> bool
6124
6125 Returns ``True`` if the UI element should be checked.
6126 """
6127 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
6128
6129 def GetEnabled(*args, **kwargs):
6130 """
6131 GetEnabled(self) -> bool
6132
6133 Returns ``True`` if the UI element should be enabled.
6134 """
6135 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
6136
6137 def GetShown(*args, **kwargs):
6138 """
6139 GetShown(self) -> bool
6140
6141 Returns ``True`` if the UI element should be shown.
6142 """
6143 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6144
6145 def GetText(*args, **kwargs):
6146 """
6147 GetText(self) -> String
6148
6149 Returns the text that should be set for the UI element.
6150 """
6151 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
6152
6153 def GetSetText(*args, **kwargs):
6154 """
6155 GetSetText(self) -> bool
6156
6157 Returns ``True`` if the application has called `SetText`. For
6158 wxWidgets internal use only.
6159 """
6160 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
6161
6162 def GetSetChecked(*args, **kwargs):
6163 """
6164 GetSetChecked(self) -> bool
6165
6166 Returns ``True`` if the application has called `Check`. For wxWidgets
6167 internal use only.
6168 """
6169 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
6170
6171 def GetSetEnabled(*args, **kwargs):
6172 """
6173 GetSetEnabled(self) -> bool
6174
6175 Returns ``True`` if the application has called `Enable`. For wxWidgets
6176 internal use only.
6177 """
6178 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
6179
6180 def GetSetShown(*args, **kwargs):
6181 """
6182 GetSetShown(self) -> bool
6183
6184 Returns ``True`` if the application has called `Show`. For wxWidgets
6185 internal use only.
6186 """
6187 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6188
6189 def Check(*args, **kwargs):
6190 """
6191 Check(self, bool check)
6192
6193 Check or uncheck the UI element.
6194 """
6195 return _core_.UpdateUIEvent_Check(*args, **kwargs)
6196
6197 def Enable(*args, **kwargs):
6198 """
6199 Enable(self, bool enable)
6200
6201 Enable or disable the UI element.
6202 """
6203 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
6204
6205 def Show(*args, **kwargs):
6206 """
6207 Show(self, bool show)
6208
6209 Show or hide the UI element.
6210 """
6211 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6212
6213 def SetText(*args, **kwargs):
6214 """
6215 SetText(self, String text)
6216
6217 Sets the text for this UI element.
6218 """
6219 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
6220
6221 def SetUpdateInterval(*args, **kwargs):
6222 """
6223 SetUpdateInterval(long updateInterval)
6224
6225 Sets the interval between updates in milliseconds. Set to -1 to
6226 disable updates, or to 0 to update as frequently as possible. The
6227 default is 0.
6228
6229 Use this to reduce the overhead of UI update events if your
6230 application has a lot of windows. If you set the value to -1 or
6231 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6232 at appropriate points in your application, such as when a dialog is
6233 about to be shown.
6234 """
6235 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6236
6237 SetUpdateInterval = staticmethod(SetUpdateInterval)
6238 def GetUpdateInterval(*args, **kwargs):
6239 """
6240 GetUpdateInterval() -> long
6241
6242 Returns the current interval between updates in milliseconds. -1
6243 disables updates, 0 updates as frequently as possible.
6244 """
6245 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6246
6247 GetUpdateInterval = staticmethod(GetUpdateInterval)
6248 def CanUpdate(*args, **kwargs):
6249 """
6250 CanUpdate(Window win) -> bool
6251
6252 Returns ``True`` if it is appropriate to update (send UI update events
6253 to) this window.
6254
6255 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6256 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6257 events were last sent in idle time, and the update interval, to
6258 determine whether events should be sent to this window now. By default
6259 this will always return true because the update mode is initially
6260 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6261 events will be sent as often as possible. You can reduce the frequency
6262 that events are sent by changing the mode and/or setting an update
6263 interval.
6264
6265 """
6266 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6267
6268 CanUpdate = staticmethod(CanUpdate)
6269 def ResetUpdateTime(*args, **kwargs):
6270 """
6271 ResetUpdateTime()
6272
6273 Used internally to reset the last-updated time to the current time. It
6274 is assumed that update events are normally sent in idle time, so this
6275 is called at the end of idle processing.
6276 """
6277 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6278
6279 ResetUpdateTime = staticmethod(ResetUpdateTime)
6280 def SetMode(*args, **kwargs):
6281 """
6282 SetMode(int mode)
6283
6284 Specify how wxWidgets will send update events: to all windows, or only
6285 to those which specify that they will process the events.
6286
6287 The mode may be one of the following values:
6288
6289 ============================= ==========================================
6290 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6291 is the default setting.
6292 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6293 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6294 style set.
6295 ============================= ==========================================
6296
6297 """
6298 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6299
6300 SetMode = staticmethod(SetMode)
6301 def GetMode(*args, **kwargs):
6302 """
6303 GetMode() -> int
6304
6305 Returns a value specifying how wxWidgets will send update events: to
6306 all windows, or only to those which specify that they will process the
6307 events.
6308 """
6309 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6310
6311 GetMode = staticmethod(GetMode)
6312 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6313 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6314 Shown = property(GetShown,Show,doc="See `GetShown`")
6315 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
6316 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
6317
6318 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
6319 """
6320 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6321
6322 Sets the interval between updates in milliseconds. Set to -1 to
6323 disable updates, or to 0 to update as frequently as possible. The
6324 default is 0.
6325
6326 Use this to reduce the overhead of UI update events if your
6327 application has a lot of windows. If you set the value to -1 or
6328 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6329 at appropriate points in your application, such as when a dialog is
6330 about to be shown.
6331 """
6332 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6333
6334 def UpdateUIEvent_GetUpdateInterval(*args):
6335 """
6336 UpdateUIEvent_GetUpdateInterval() -> long
6337
6338 Returns the current interval between updates in milliseconds. -1
6339 disables updates, 0 updates as frequently as possible.
6340 """
6341 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
6342
6343 def UpdateUIEvent_CanUpdate(*args, **kwargs):
6344 """
6345 UpdateUIEvent_CanUpdate(Window win) -> bool
6346
6347 Returns ``True`` if it is appropriate to update (send UI update events
6348 to) this window.
6349
6350 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6351 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6352 events were last sent in idle time, and the update interval, to
6353 determine whether events should be sent to this window now. By default
6354 this will always return true because the update mode is initially
6355 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6356 events will be sent as often as possible. You can reduce the frequency
6357 that events are sent by changing the mode and/or setting an update
6358 interval.
6359
6360 """
6361 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6362
6363 def UpdateUIEvent_ResetUpdateTime(*args):
6364 """
6365 UpdateUIEvent_ResetUpdateTime()
6366
6367 Used internally to reset the last-updated time to the current time. It
6368 is assumed that update events are normally sent in idle time, so this
6369 is called at the end of idle processing.
6370 """
6371 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
6372
6373 def UpdateUIEvent_SetMode(*args, **kwargs):
6374 """
6375 UpdateUIEvent_SetMode(int mode)
6376
6377 Specify how wxWidgets will send update events: to all windows, or only
6378 to those which specify that they will process the events.
6379
6380 The mode may be one of the following values:
6381
6382 ============================= ==========================================
6383 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6384 is the default setting.
6385 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6386 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6387 style set.
6388 ============================= ==========================================
6389
6390 """
6391 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6392
6393 def UpdateUIEvent_GetMode(*args):
6394 """
6395 UpdateUIEvent_GetMode() -> int
6396
6397 Returns a value specifying how wxWidgets will send update events: to
6398 all windows, or only to those which specify that they will process the
6399 events.
6400 """
6401 return _core_.UpdateUIEvent_GetMode(*args)
6402
6403 #---------------------------------------------------------------------------
6404
6405 class SysColourChangedEvent(Event):
6406 """
6407 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6408 when the user changes the colour settings using the control
6409 panel. This is only applicable under Windows.
6410
6411 The default event handler for this event propagates the event to child
6412 windows, since Windows only sends the events to top-level windows. If
6413 intercepting this event for a top-level window, remember to call
6414 `Skip` so the the base class handler will still be executed, or to
6415 pass the event on to the window's children explicitly.
6416
6417 """
6418 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6419 __repr__ = _swig_repr
6420 def __init__(self, *args, **kwargs):
6421 """
6422 __init__(self) -> SysColourChangedEvent
6423
6424 Constructor
6425 """
6426 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
6427 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
6428
6429 #---------------------------------------------------------------------------
6430
6431 class MouseCaptureChangedEvent(Event):
6432 """
6433 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6434 a window that loses its mouse capture. This is called even if
6435 `wx.Window.ReleaseMouse` was called by the application code. Handling
6436 this event allows an application to cater for unexpected capture
6437 releases which might otherwise confuse mouse handling code.
6438
6439 This event is implemented under Windows only.
6440 """
6441 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6442 __repr__ = _swig_repr
6443 def __init__(self, *args, **kwargs):
6444 """
6445 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6446
6447 Constructor
6448 """
6449 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
6450 def GetCapturedWindow(*args, **kwargs):
6451 """
6452 GetCapturedWindow(self) -> Window
6453
6454 Returns the window that gained the capture, or ``None`` if it was a
6455 non-wxWidgets window.
6456 """
6457 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6458
6459 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
6460 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
6461
6462 #---------------------------------------------------------------------------
6463
6464 class MouseCaptureLostEvent(Event):
6465 """
6466 A mouse capture lost event is sent to a window that obtained mouse
6467 capture, which was subsequently loss due to "external" event, for
6468 example when a dialog box is shown or if another application captures
6469 the mouse.
6470
6471 If this happens, this event is sent to all windows that are on the
6472 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6473 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6474 if the capture changes because of a call to CaptureMouse or
6475 ReleaseMouse.
6476
6477 This event is currently emitted under Windows only.
6478
6479 """
6480 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6481 __repr__ = _swig_repr
6482 def __init__(self, *args, **kwargs):
6483 """
6484 __init__(self, int winid=0) -> MouseCaptureLostEvent
6485
6486 A mouse capture lost event is sent to a window that obtained mouse
6487 capture, which was subsequently loss due to "external" event, for
6488 example when a dialog box is shown or if another application captures
6489 the mouse.
6490
6491 If this happens, this event is sent to all windows that are on the
6492 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6493 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6494 if the capture changes because of a call to CaptureMouse or
6495 ReleaseMouse.
6496
6497 This event is currently emitted under Windows only.
6498
6499 """
6500 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6501 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6502
6503 #---------------------------------------------------------------------------
6504
6505 class DisplayChangedEvent(Event):
6506 """
6507 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6508 resolution has changed.
6509
6510 This event is implemented under Windows only.
6511 """
6512 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6513 __repr__ = _swig_repr
6514 def __init__(self, *args, **kwargs):
6515 """__init__(self) -> DisplayChangedEvent"""
6516 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6517 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6518
6519 #---------------------------------------------------------------------------
6520
6521 class PaletteChangedEvent(Event):
6522 """
6523 An EVT_PALETTE_CHANGED event is sent when the system palette has
6524 changed, thereby giving each window a chance to redo their own to
6525 match.
6526
6527 This event is implemented under Windows only.
6528 """
6529 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6530 __repr__ = _swig_repr
6531 def __init__(self, *args, **kwargs):
6532 """
6533 __init__(self, int id=0) -> PaletteChangedEvent
6534
6535 An EVT_PALETTE_CHANGED event is sent when the system palette has
6536 changed, thereby giving each window a chance to redo their own to
6537 match.
6538
6539 This event is implemented under Windows only.
6540 """
6541 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6542 def SetChangedWindow(*args, **kwargs):
6543 """SetChangedWindow(self, Window win)"""
6544 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6545
6546 def GetChangedWindow(*args, **kwargs):
6547 """GetChangedWindow(self) -> Window"""
6548 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6549
6550 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
6551 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6552
6553 #---------------------------------------------------------------------------
6554
6555 class QueryNewPaletteEvent(Event):
6556 """
6557 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6558 focus and should re-do its palette.
6559
6560 This event is implemented under Windows only.
6561 """
6562 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6563 __repr__ = _swig_repr
6564 def __init__(self, *args, **kwargs):
6565 """
6566 __init__(self, int winid=0) -> QueryNewPaletteEvent
6567
6568 Constructor.
6569 """
6570 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6571 def SetPaletteRealized(*args, **kwargs):
6572 """
6573 SetPaletteRealized(self, bool realized)
6574
6575 App should set this if it changes the palette.
6576 """
6577 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6578
6579 def GetPaletteRealized(*args, **kwargs):
6580 """GetPaletteRealized(self) -> bool"""
6581 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6582
6583 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
6584 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6585
6586 #---------------------------------------------------------------------------
6587
6588 class NavigationKeyEvent(Event):
6589 """
6590 EVT_NAVIGATION_KEY events are used to control moving the focus between
6591 widgets, otherwise known as tab-traversal. You woudl normally not
6592 catch navigation events in applications as there are already
6593 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6594 it useful to send navigation events in certain situations to change
6595 the focus in certain ways, although it's probably easier to just call
6596 `wx.Window.Navigate`.
6597 """
6598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6599 __repr__ = _swig_repr
6600 def __init__(self, *args, **kwargs):
6601 """__init__(self) -> NavigationKeyEvent"""
6602 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6603 def GetDirection(*args, **kwargs):
6604 """
6605 GetDirection(self) -> bool
6606
6607 Returns ``True`` if the direction is forward, ``False`` otherwise.
6608 """
6609 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6610
6611 def SetDirection(*args, **kwargs):
6612 """
6613 SetDirection(self, bool forward)
6614
6615 Specify the direction that the navigation should take. Usually the
6616 difference between using Tab and Shift-Tab.
6617 """
6618 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6619
6620 def IsWindowChange(*args, **kwargs):
6621 """
6622 IsWindowChange(self) -> bool
6623
6624 Returns ``True`` if window change is allowed.
6625 """
6626 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6627
6628 def SetWindowChange(*args, **kwargs):
6629 """
6630 SetWindowChange(self, bool ischange)
6631
6632 Specify if the navigation should be able to change parent windows.
6633 For example, changing notebook pages, etc. This is usually implemented
6634 by using Control-Tab.
6635 """
6636 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6637
6638 def IsFromTab(*args, **kwargs):
6639 """
6640 IsFromTab(self) -> bool
6641
6642 Returns ``True`` if the navigation event is originated from the Tab
6643 key.
6644 """
6645 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6646
6647 def SetFromTab(*args, **kwargs):
6648 """
6649 SetFromTab(self, bool bIs)
6650
6651 Set to true under MSW if the event was generated using the tab key.
6652 This is required for proper navogation over radio buttons.
6653 """
6654 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6655
6656 def SetFlags(*args, **kwargs):
6657 """
6658 SetFlags(self, long flags)
6659
6660 Set the navigation flags to a combination of the following:
6661
6662 * wx.NavigationKeyEvent.IsBackward
6663 * wx.NavigationKeyEvent.IsForward
6664 * wx.NavigationKeyEvent.WinChange
6665 * wx.NavigationKeyEvent.FromTab
6666
6667 """
6668 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6669
6670 def GetCurrentFocus(*args, **kwargs):
6671 """
6672 GetCurrentFocus(self) -> Window
6673
6674 Returns the child window which currenty has the focus. May be
6675 ``None``.
6676 """
6677 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6678
6679 def SetCurrentFocus(*args, **kwargs):
6680 """
6681 SetCurrentFocus(self, Window win)
6682
6683 Set the window that has the focus.
6684 """
6685 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6686
6687 IsBackward = _core_.NavigationKeyEvent_IsBackward
6688 IsForward = _core_.NavigationKeyEvent_IsForward
6689 WinChange = _core_.NavigationKeyEvent_WinChange
6690 FromTab = _core_.NavigationKeyEvent_FromTab
6691 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6692 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6693 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6694
6695 #---------------------------------------------------------------------------
6696
6697 class WindowCreateEvent(CommandEvent):
6698 """
6699 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6700 underlying GUI object) exists.
6701 """
6702 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6703 __repr__ = _swig_repr
6704 def __init__(self, *args, **kwargs):
6705 """
6706 __init__(self, Window win=None) -> WindowCreateEvent
6707
6708 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6709 underlying GUI object) exists.
6710 """
6711 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6712 def GetWindow(*args, **kwargs):
6713 """
6714 GetWindow(self) -> Window
6715
6716 Returns the window that this event refers to.
6717 """
6718 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6719
6720 Window = property(GetWindow,doc="See `GetWindow`")
6721 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6722
6723 class WindowDestroyEvent(CommandEvent):
6724 """
6725 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6726 when the GUI window is destroyed.
6727
6728 When a class derived from `wx.Window` is destroyed its destructor will
6729 have already run by the time this event is sent. Therefore this event
6730 will not usually be received at all by the window itself. Since it is
6731 received after the destructor has run, an object should not try to
6732 handle its own wx.WindowDestroyEvent, but it can be used to get
6733 notification of the destruction of another window.
6734 """
6735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6736 __repr__ = _swig_repr
6737 def __init__(self, *args, **kwargs):
6738 """
6739 __init__(self, Window win=None) -> WindowDestroyEvent
6740
6741 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6742 when the GUI window is destroyed.
6743
6744 When a class derived from `wx.Window` is destroyed its destructor will
6745 have already run by the time this event is sent. Therefore this event
6746 will not usually be received at all by the window itself. Since it is
6747 received after the destructor has run, an object should not try to
6748 handle its own wx.WindowDestroyEvent, but it can be used to get
6749 notification of the destruction of another window.
6750 """
6751 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6752 def GetWindow(*args, **kwargs):
6753 """
6754 GetWindow(self) -> Window
6755
6756 Returns the window that this event refers to.
6757 """
6758 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6759
6760 Window = property(GetWindow,doc="See `GetWindow`")
6761 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6762
6763 #---------------------------------------------------------------------------
6764
6765 class ContextMenuEvent(CommandEvent):
6766 """
6767 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6768 give the application a chance to show a context (popup) menu.
6769 """
6770 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6771 __repr__ = _swig_repr
6772 def __init__(self, *args, **kwargs):
6773 """
6774 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6775
6776 Constructor.
6777 """
6778 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6779 def GetPosition(*args, **kwargs):
6780 """
6781 GetPosition(self) -> Point
6782
6783 Returns the position (in screen coordinants) at which the menu should
6784 be shown.
6785 """
6786 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6787
6788 def SetPosition(*args, **kwargs):
6789 """
6790 SetPosition(self, Point pos)
6791
6792 Sets the position at which the menu should be shown.
6793 """
6794 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6795
6796 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6797 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6798
6799 #---------------------------------------------------------------------------
6800
6801 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6802 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6803 class IdleEvent(Event):
6804 """
6805 This class is used for EVT_IDLE events, which are generated and sent
6806 when the application *becomes* idle. In other words, the when the
6807 event queue becomes empty then idle events are sent to all windows (by
6808 default) and as long as none of them call `RequestMore` then there are
6809 no more idle events until after the system event queue has some normal
6810 events and then becomes empty again.
6811
6812 By default, idle events are sent to all windows. If this is causing a
6813 significant overhead in your application, you can call
6814 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6815 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6816 which should receive idle events. Then idle events will only be sent
6817 to those windows and not to any others.
6818 """
6819 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6820 __repr__ = _swig_repr
6821 def __init__(self, *args, **kwargs):
6822 """
6823 __init__(self) -> IdleEvent
6824
6825 Constructor
6826 """
6827 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6828 def RequestMore(*args, **kwargs):
6829 """
6830 RequestMore(self, bool needMore=True)
6831
6832 Tells wxWidgets that more processing is required. This function can be
6833 called by an EVT_IDLE handler for a window to indicate that the
6834 application should forward the EVT_IDLE event once more to the
6835 application windows. If no window calls this function during its
6836 EVT_IDLE handler, then the application will remain in a passive event
6837 loop until a new event is posted to the application by the windowing
6838 system.
6839 """
6840 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6841
6842 def MoreRequested(*args, **kwargs):
6843 """
6844 MoreRequested(self) -> bool
6845
6846 Returns ``True`` if the OnIdle function processing this event
6847 requested more processing time.
6848 """
6849 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6850
6851 def SetMode(*args, **kwargs):
6852 """
6853 SetMode(int mode)
6854
6855 Static method for specifying how wxWidgets will send idle events: to
6856 all windows, or only to those which specify that they will process the
6857 events.
6858
6859 The mode can be one of the following values:
6860
6861 ========================= ========================================
6862 wx.IDLE_PROCESS_ALL Send idle events to all windows
6863 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6864 the wx.WS_EX_PROCESS_IDLE extra style
6865 flag set.
6866 ========================= ========================================
6867
6868 """
6869 return _core_.IdleEvent_SetMode(*args, **kwargs)
6870
6871 SetMode = staticmethod(SetMode)
6872 def GetMode(*args, **kwargs):
6873 """
6874 GetMode() -> int
6875
6876 Static method returning a value specifying how wxWidgets will send
6877 idle events: to all windows, or only to those which specify that they
6878 will process the events.
6879 """
6880 return _core_.IdleEvent_GetMode(*args, **kwargs)
6881
6882 GetMode = staticmethod(GetMode)
6883 def CanSend(*args, **kwargs):
6884 """
6885 CanSend(Window win) -> bool
6886
6887 Returns ``True`` if it is appropriate to send idle events to this
6888 window.
6889
6890 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6891 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6892 events should be sent to this window now. By default this will always
6893 return ``True`` because the update mode is initially
6894 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6895 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6896 """
6897 return _core_.IdleEvent_CanSend(*args, **kwargs)
6898
6899 CanSend = staticmethod(CanSend)
6900 _core_.IdleEvent_swigregister(IdleEvent)
6901
6902 def IdleEvent_SetMode(*args, **kwargs):
6903 """
6904 IdleEvent_SetMode(int mode)
6905
6906 Static method for specifying how wxWidgets will send idle events: to
6907 all windows, or only to those which specify that they will process the
6908 events.
6909
6910 The mode can be one of the following values:
6911
6912 ========================= ========================================
6913 wx.IDLE_PROCESS_ALL Send idle events to all windows
6914 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6915 the wx.WS_EX_PROCESS_IDLE extra style
6916 flag set.
6917 ========================= ========================================
6918
6919 """
6920 return _core_.IdleEvent_SetMode(*args, **kwargs)
6921
6922 def IdleEvent_GetMode(*args):
6923 """
6924 IdleEvent_GetMode() -> int
6925
6926 Static method returning a value specifying how wxWidgets will send
6927 idle events: to all windows, or only to those which specify that they
6928 will process the events.
6929 """
6930 return _core_.IdleEvent_GetMode(*args)
6931
6932 def IdleEvent_CanSend(*args, **kwargs):
6933 """
6934 IdleEvent_CanSend(Window win) -> bool
6935
6936 Returns ``True`` if it is appropriate to send idle events to this
6937 window.
6938
6939 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6940 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6941 events should be sent to this window now. By default this will always
6942 return ``True`` because the update mode is initially
6943 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6944 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6945 """
6946 return _core_.IdleEvent_CanSend(*args, **kwargs)
6947
6948 #---------------------------------------------------------------------------
6949
6950 class ClipboardTextEvent(CommandEvent):
6951 """
6952 A Clipboard Text event is sent when a window intercepts a text
6953 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6954 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6955 popup menu command, etc. NOTE : under windows these events are *NOT*
6956 generated automatically for a Rich Edit text control.
6957 """
6958 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6959 __repr__ = _swig_repr
6960 def __init__(self, *args, **kwargs):
6961 """
6962 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6963
6964 A Clipboard Text event is sent when a window intercepts a text
6965 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6966 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6967 popup menu command, etc. NOTE : under windows these events are *NOT*
6968 generated automatically for a Rich Edit text control.
6969 """
6970 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6971 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6972
6973 #---------------------------------------------------------------------------
6974
6975 class PyEvent(Event):
6976 """
6977 wx.PyEvent can be used as a base class for implementing custom event
6978 types in Python. You should derived from this class instead of
6979 `wx.Event` because this class is Python-aware and is able to transport
6980 its Python bits safely through the wxWidgets event system and have
6981 them still be there when the event handler is invoked.
6982
6983 :see: `wx.PyCommandEvent`
6984
6985 """
6986 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6987 __repr__ = _swig_repr
6988 def __init__(self, *args, **kwargs):
6989 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6990 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6991 self._SetSelf(self)
6992
6993 __swig_destroy__ = _core_.delete_PyEvent
6994 __del__ = lambda self : None;
6995 def _SetSelf(*args, **kwargs):
6996 """_SetSelf(self, PyObject self)"""
6997 return _core_.PyEvent__SetSelf(*args, **kwargs)
6998
6999 def _GetSelf(*args, **kwargs):
7000 """_GetSelf(self) -> PyObject"""
7001 return _core_.PyEvent__GetSelf(*args, **kwargs)
7002
7003 _core_.PyEvent_swigregister(PyEvent)
7004
7005 class PyCommandEvent(CommandEvent):
7006 """
7007 wx.PyCommandEvent can be used as a base class for implementing custom
7008 event types in Python, where the event shoudl travel up to parent
7009 windows looking for a handler. You should derived from this class
7010 instead of `wx.CommandEvent` because this class is Python-aware and is
7011 able to transport its Python bits safely through the wxWidgets event
7012 system and have them still be there when the event handler is invoked.
7013
7014 :see: `wx.PyEvent`
7015
7016 """
7017 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7018 __repr__ = _swig_repr
7019 def __init__(self, *args, **kwargs):
7020 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
7021 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
7022 self._SetSelf(self)
7023
7024 __swig_destroy__ = _core_.delete_PyCommandEvent
7025 __del__ = lambda self : None;
7026 def _SetSelf(*args, **kwargs):
7027 """_SetSelf(self, PyObject self)"""
7028 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
7029
7030 def _GetSelf(*args, **kwargs):
7031 """_GetSelf(self) -> PyObject"""
7032 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
7033
7034 _core_.PyCommandEvent_swigregister(PyCommandEvent)
7035
7036 class DateEvent(CommandEvent):
7037 """
7038 This event class holds information about a date change event and is
7039 used together with `wx.DatePickerCtrl`. It also serves as a base class
7040 for `wx.calendar.CalendarEvent`. Bind these event types with
7041 EVT_DATE_CHANGED.
7042 """
7043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7044 __repr__ = _swig_repr
7045 def __init__(self, *args, **kwargs):
7046 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
7047 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
7048 def GetDate(*args, **kwargs):
7049 """
7050 GetDate(self) -> DateTime
7051
7052 Returns the date.
7053 """
7054 return _core_.DateEvent_GetDate(*args, **kwargs)
7055
7056 def SetDate(*args, **kwargs):
7057 """
7058 SetDate(self, DateTime date)
7059
7060 Sets the date carried by the event, normally only used by the library
7061 internally.
7062 """
7063 return _core_.DateEvent_SetDate(*args, **kwargs)
7064
7065 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
7066 _core_.DateEvent_swigregister(DateEvent)
7067
7068 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7069 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7070
7071 class EventBlocker(EvtHandler):
7072 """Helper class to temporarily disable event handling for a window."""
7073 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7074 __repr__ = _swig_repr
7075 def __init__(self, *args, **kwargs):
7076 """
7077 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7078
7079 Helper class to temporarily disable event handling for a window.
7080 """
7081 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7082 __swig_destroy__ = _core_.delete_EventBlocker
7083 __del__ = lambda self : None;
7084 def Block(*args, **kwargs):
7085 """Block(self, EventType type)"""
7086 return _core_.EventBlocker_Block(*args, **kwargs)
7087
7088 _core_.EventBlocker_swigregister(EventBlocker)
7089
7090 #---------------------------------------------------------------------------
7091
7092 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7093 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7094 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7095 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7096 PRINT_WINDOWS = _core_.PRINT_WINDOWS
7097 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
7098 class PyApp(EvtHandler):
7099 """
7100 The ``wx.PyApp`` class is an *implementation detail*, please use the
7101 `wx.App` class (or some other derived class) instead.
7102 """
7103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7104 __repr__ = _swig_repr
7105 def __init__(self, *args, **kwargs):
7106 """
7107 __init__(self) -> PyApp
7108
7109 Create a new application object, starting the bootstrap process.
7110 """
7111 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7112 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
7113
7114 __swig_destroy__ = _core_.delete_PyApp
7115 __del__ = lambda self : None;
7116 def _setCallbackInfo(*args, **kwargs):
7117 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
7118 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
7119
7120 def GetAppName(*args, **kwargs):
7121 """
7122 GetAppName(self) -> String
7123
7124 Get the application name.
7125 """
7126 return _core_.PyApp_GetAppName(*args, **kwargs)
7127
7128 def SetAppName(*args, **kwargs):
7129 """
7130 SetAppName(self, String name)
7131
7132 Set the application name. This value may be used automatically by
7133 `wx.Config` and such.
7134 """
7135 return _core_.PyApp_SetAppName(*args, **kwargs)
7136
7137 def GetClassName(*args, **kwargs):
7138 """
7139 GetClassName(self) -> String
7140
7141 Get the application's class name.
7142 """
7143 return _core_.PyApp_GetClassName(*args, **kwargs)
7144
7145 def SetClassName(*args, **kwargs):
7146 """
7147 SetClassName(self, String name)
7148
7149 Set the application's class name. This value may be used for
7150 X-resources if applicable for the platform
7151 """
7152 return _core_.PyApp_SetClassName(*args, **kwargs)
7153
7154 def GetVendorName(*args, **kwargs):
7155 """
7156 GetVendorName(self) -> String
7157
7158 Get the application's vendor name.
7159 """
7160 return _core_.PyApp_GetVendorName(*args, **kwargs)
7161
7162 def SetVendorName(*args, **kwargs):
7163 """
7164 SetVendorName(self, String name)
7165
7166 Set the application's vendor name. This value may be used
7167 automatically by `wx.Config` and such.
7168 """
7169 return _core_.PyApp_SetVendorName(*args, **kwargs)
7170
7171 def GetTraits(*args, **kwargs):
7172 """
7173 GetTraits(self) -> wxAppTraits
7174
7175 Return (and create if necessary) the app traits object to which we
7176 delegate for everything which either should be configurable by the
7177 user (then he can change the default behaviour simply by overriding
7178 CreateTraits() and returning his own traits object) or which is
7179 GUI/console dependent as then wx.AppTraits allows us to abstract the
7180 differences behind the common facade.
7181
7182 :todo: Add support for overriding CreateAppTraits in wxPython.
7183 """
7184 return _core_.PyApp_GetTraits(*args, **kwargs)
7185
7186 def ProcessPendingEvents(*args, **kwargs):
7187 """
7188 ProcessPendingEvents(self)
7189
7190 Process all events in the Pending Events list -- it is necessary to
7191 call this function to process posted events. This normally happens
7192 during each event loop iteration.
7193 """
7194 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
7195
7196 def Yield(*args, **kwargs):
7197 """
7198 Yield(self, bool onlyIfNeeded=False) -> bool
7199
7200 Process all currently pending events right now, instead of waiting
7201 until return to the event loop. It is an error to call ``Yield``
7202 recursively unless the value of ``onlyIfNeeded`` is True.
7203
7204 :warning: This function is dangerous as it can lead to unexpected
7205 reentrancies (i.e. when called from an event handler it may
7206 result in calling the same event handler again), use with
7207 extreme care or, better, don't use at all!
7208
7209 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
7210
7211 """
7212 return _core_.PyApp_Yield(*args, **kwargs)
7213
7214 def WakeUpIdle(*args, **kwargs):
7215 """
7216 WakeUpIdle(self)
7217
7218 Make sure that idle events are sent again.
7219 :see: `wx.WakeUpIdle`
7220 """
7221 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
7222
7223 def IsMainLoopRunning(*args, **kwargs):
7224 """
7225 IsMainLoopRunning() -> bool
7226
7227 Returns True if we're running the main loop, i.e. if the events can
7228 currently be dispatched.
7229 """
7230 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7231
7232 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
7233 def MainLoop(*args, **kwargs):
7234 """
7235 MainLoop(self) -> int
7236
7237 Execute the main GUI loop, the function doesn't normally return until
7238 all top level windows have been closed and destroyed.
7239 """
7240 return _core_.PyApp_MainLoop(*args, **kwargs)
7241
7242 def Exit(*args, **kwargs):
7243 """
7244 Exit(self)
7245
7246 Exit the main loop thus terminating the application.
7247 :see: `wx.Exit`
7248 """
7249 return _core_.PyApp_Exit(*args, **kwargs)
7250
7251 def GetLayoutDirection(*args, **kwargs):
7252 """
7253 GetLayoutDirection(self) -> int
7254
7255 Return the layout direction for the current locale.
7256 """
7257 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7258
7259 def ExitMainLoop(*args, **kwargs):
7260 """
7261 ExitMainLoop(self)
7262
7263 Exit the main GUI loop during the next iteration of the main
7264 loop, (i.e. it does not stop the program immediately!)
7265 """
7266 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
7267
7268 def Pending(*args, **kwargs):
7269 """
7270 Pending(self) -> bool
7271
7272 Returns True if there are unprocessed events in the event queue.
7273 """
7274 return _core_.PyApp_Pending(*args, **kwargs)
7275
7276 def Dispatch(*args, **kwargs):
7277 """
7278 Dispatch(self) -> bool
7279
7280 Process the first event in the event queue (blocks until an event
7281 appears if there are none currently)
7282 """
7283 return _core_.PyApp_Dispatch(*args, **kwargs)
7284
7285 def ProcessIdle(*args, **kwargs):
7286 """
7287 ProcessIdle(self) -> bool
7288
7289 Called from the MainLoop when the application becomes idle (there are
7290 no pending events) and sends a `wx.IdleEvent` to all interested
7291 parties. Returns True if more idle events are needed, False if not.
7292 """
7293 return _core_.PyApp_ProcessIdle(*args, **kwargs)
7294
7295 def SendIdleEvents(*args, **kwargs):
7296 """
7297 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7298
7299 Send idle event to window and all subwindows. Returns True if more
7300 idle time is requested.
7301 """
7302 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
7303
7304 def IsActive(*args, **kwargs):
7305 """
7306 IsActive(self) -> bool
7307
7308 Return True if our app has focus.
7309 """
7310 return _core_.PyApp_IsActive(*args, **kwargs)
7311
7312 def SetTopWindow(*args, **kwargs):
7313 """
7314 SetTopWindow(self, Window win)
7315
7316 Set the *main* top level window
7317 """
7318 return _core_.PyApp_SetTopWindow(*args, **kwargs)
7319
7320 def GetTopWindow(*args, **kwargs):
7321 """
7322 GetTopWindow(self) -> Window
7323
7324 Return the *main* top level window (if it hadn't been set previously
7325 with SetTopWindow(), will return just some top level window and, if
7326 there not any, will return None)
7327 """
7328 return _core_.PyApp_GetTopWindow(*args, **kwargs)
7329
7330 def SetExitOnFrameDelete(*args, **kwargs):
7331 """
7332 SetExitOnFrameDelete(self, bool flag)
7333
7334 Control the exit behaviour: by default, the program will exit the main
7335 loop (and so, usually, terminate) when the last top-level program
7336 window is deleted. Beware that if you disable this behaviour (with
7337 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7338 explicitly from somewhere.
7339 """
7340 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
7341
7342 def GetExitOnFrameDelete(*args, **kwargs):
7343 """
7344 GetExitOnFrameDelete(self) -> bool
7345
7346 Get the current exit behaviour setting.
7347 """
7348 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
7349
7350 def SetUseBestVisual(*args, **kwargs):
7351 """
7352 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
7353
7354 Set whether the app should try to use the best available visual on
7355 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7356 """
7357 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
7358
7359 def GetUseBestVisual(*args, **kwargs):
7360 """
7361 GetUseBestVisual(self) -> bool
7362
7363 Get current UseBestVisual setting.
7364 """
7365 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
7366
7367 def SetPrintMode(*args, **kwargs):
7368 """SetPrintMode(self, int mode)"""
7369 return _core_.PyApp_SetPrintMode(*args, **kwargs)
7370
7371 def GetPrintMode(*args, **kwargs):
7372 """GetPrintMode(self) -> int"""
7373 return _core_.PyApp_GetPrintMode(*args, **kwargs)
7374
7375 def SetAssertMode(*args, **kwargs):
7376 """
7377 SetAssertMode(self, int mode)
7378
7379 Set the OnAssert behaviour for debug and hybrid builds.
7380 """
7381 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7382
7383 def GetAssertMode(*args, **kwargs):
7384 """
7385 GetAssertMode(self) -> int
7386
7387 Get the current OnAssert behaviour setting.
7388 """
7389 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7390
7391 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
7392 """GetMacSupportPCMenuShortcuts() -> bool"""
7393 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7394
7395 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7396 def GetMacAboutMenuItemId(*args, **kwargs):
7397 """GetMacAboutMenuItemId() -> long"""
7398 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7399
7400 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7401 def GetMacPreferencesMenuItemId(*args, **kwargs):
7402 """GetMacPreferencesMenuItemId() -> long"""
7403 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7404
7405 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7406 def GetMacExitMenuItemId(*args, **kwargs):
7407 """GetMacExitMenuItemId() -> long"""
7408 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7409
7410 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7411 def GetMacHelpMenuTitleName(*args, **kwargs):
7412 """GetMacHelpMenuTitleName() -> String"""
7413 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7414
7415 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7416 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
7417 """SetMacSupportPCMenuShortcuts(bool val)"""
7418 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7419
7420 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7421 def SetMacAboutMenuItemId(*args, **kwargs):
7422 """SetMacAboutMenuItemId(long val)"""
7423 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7424
7425 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7426 def SetMacPreferencesMenuItemId(*args, **kwargs):
7427 """SetMacPreferencesMenuItemId(long val)"""
7428 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7429
7430 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7431 def SetMacExitMenuItemId(*args, **kwargs):
7432 """SetMacExitMenuItemId(long val)"""
7433 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7434
7435 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7436 def SetMacHelpMenuTitleName(*args, **kwargs):
7437 """SetMacHelpMenuTitleName(String val)"""
7438 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7439
7440 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7441 def _BootstrapApp(*args, **kwargs):
7442 """
7443 _BootstrapApp(self)
7444
7445 For internal use only
7446 """
7447 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7448
7449 def GetComCtl32Version(*args, **kwargs):
7450 """
7451 GetComCtl32Version() -> int
7452
7453 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7454 it wasn't found at all. Raises an exception on non-Windows platforms.
7455 """
7456 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7457
7458 GetComCtl32Version = staticmethod(GetComCtl32Version)
7459 def IsDisplayAvailable(*args, **kwargs):
7460 """
7461 IsDisplayAvailable() -> bool
7462
7463 Tests if it is possible to create a GUI in the current environment.
7464 This will mean different things on the different platforms.
7465
7466 * On X Windows systems this function will return ``False`` if it is
7467 not able to open a connection to the X display, which can happen
7468 if $DISPLAY is not set, or is not set correctly.
7469
7470 * On Mac OS X a ``False`` return value will mean that wx is not
7471 able to access the window manager, which can happen if logged in
7472 remotely or if running from the normal version of python instead
7473 of the framework version, (i.e., pythonw.)
7474
7475 * On MS Windows...
7476
7477 """
7478 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7479
7480 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7481 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7482 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7483 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7484 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7485 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7486 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7487 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7488 Traits = property(GetTraits,doc="See `GetTraits`")
7489 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7490 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7491 Active = property(IsActive)
7492 _core_.PyApp_swigregister(PyApp)
7493
7494 def PyApp_IsMainLoopRunning(*args):
7495 """
7496 PyApp_IsMainLoopRunning() -> bool
7497
7498 Returns True if we're running the main loop, i.e. if the events can
7499 currently be dispatched.
7500 """
7501 return _core_.PyApp_IsMainLoopRunning(*args)
7502
7503 def PyApp_GetMacSupportPCMenuShortcuts(*args):
7504 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7505 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
7506
7507 def PyApp_GetMacAboutMenuItemId(*args):
7508 """PyApp_GetMacAboutMenuItemId() -> long"""
7509 return _core_.PyApp_GetMacAboutMenuItemId(*args)
7510
7511 def PyApp_GetMacPreferencesMenuItemId(*args):
7512 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7513 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7514
7515 def PyApp_GetMacExitMenuItemId(*args):
7516 """PyApp_GetMacExitMenuItemId() -> long"""
7517 return _core_.PyApp_GetMacExitMenuItemId(*args)
7518
7519 def PyApp_GetMacHelpMenuTitleName(*args):
7520 """PyApp_GetMacHelpMenuTitleName() -> String"""
7521 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7522
7523 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7524 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7525 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7526
7527 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7528 """PyApp_SetMacAboutMenuItemId(long val)"""
7529 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7530
7531 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7532 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7533 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7534
7535 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7536 """PyApp_SetMacExitMenuItemId(long val)"""
7537 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7538
7539 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7540 """PyApp_SetMacHelpMenuTitleName(String val)"""
7541 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7542
7543 def PyApp_GetComCtl32Version(*args):
7544 """
7545 PyApp_GetComCtl32Version() -> int
7546
7547 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7548 it wasn't found at all. Raises an exception on non-Windows platforms.
7549 """
7550 return _core_.PyApp_GetComCtl32Version(*args)
7551
7552 def PyApp_IsDisplayAvailable(*args):
7553 """
7554 PyApp_IsDisplayAvailable() -> bool
7555
7556 Tests if it is possible to create a GUI in the current environment.
7557 This will mean different things on the different platforms.
7558
7559 * On X Windows systems this function will return ``False`` if it is
7560 not able to open a connection to the X display, which can happen
7561 if $DISPLAY is not set, or is not set correctly.
7562
7563 * On Mac OS X a ``False`` return value will mean that wx is not
7564 able to access the window manager, which can happen if logged in
7565 remotely or if running from the normal version of python instead
7566 of the framework version, (i.e., pythonw.)
7567
7568 * On MS Windows...
7569
7570 """
7571 return _core_.PyApp_IsDisplayAvailable(*args)
7572
7573 #---------------------------------------------------------------------------
7574
7575
7576 def Exit(*args):
7577 """
7578 Exit()
7579
7580 Force an exit of the application. Convenience for wx.GetApp().Exit()
7581 """
7582 return _core_.Exit(*args)
7583
7584 def Yield(*args):
7585 """
7586 Yield() -> bool
7587
7588 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7589 """
7590 return _core_.Yield(*args)
7591
7592 def YieldIfNeeded(*args):
7593 """
7594 YieldIfNeeded() -> bool
7595
7596 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7597 """
7598 return _core_.YieldIfNeeded(*args)
7599
7600 def SafeYield(*args, **kwargs):
7601 """
7602 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7603
7604 This function is similar to `wx.Yield`, except that it disables the
7605 user input to all program windows before calling `wx.Yield` and
7606 re-enables it again afterwards. If ``win`` is not None, this window
7607 will remain enabled, allowing the implementation of some limited user
7608 interaction.
7609
7610 :Returns: the result of the call to `wx.Yield`.
7611 """
7612 return _core_.SafeYield(*args, **kwargs)
7613
7614 def WakeUpIdle(*args):
7615 """
7616 WakeUpIdle()
7617
7618 Cause the message queue to become empty again, so idle events will be
7619 sent.
7620 """
7621 return _core_.WakeUpIdle(*args)
7622
7623 def PostEvent(*args, **kwargs):
7624 """
7625 PostEvent(EvtHandler dest, Event event)
7626
7627 Send an event to a window or other wx.EvtHandler to be processed
7628 later.
7629 """
7630 return _core_.PostEvent(*args, **kwargs)
7631
7632 def App_CleanUp(*args):
7633 """
7634 App_CleanUp()
7635
7636 For internal use only, it is used to cleanup after wxWidgets when
7637 Python shuts down.
7638 """
7639 return _core_.App_CleanUp(*args)
7640
7641 def GetApp(*args):
7642 """
7643 GetApp() -> PyApp
7644
7645 Return a reference to the current wx.App object.
7646 """
7647 return _core_.GetApp(*args)
7648
7649 def SetDefaultPyEncoding(*args, **kwargs):
7650 """
7651 SetDefaultPyEncoding(string encoding)
7652
7653 Sets the encoding that wxPython will use when it needs to convert a
7654 Python string or unicode object to or from a wxString.
7655
7656 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7657 but please be aware that the default encoding within the same locale
7658 may be slightly different on different platforms. For example, please
7659 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7660 between the common latin/roman encodings.
7661 """
7662 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7663
7664 def GetDefaultPyEncoding(*args):
7665 """
7666 GetDefaultPyEncoding() -> string
7667
7668 Gets the current encoding that wxPython will use when it needs to
7669 convert a Python string or unicode object to or from a wxString.
7670 """
7671 return _core_.GetDefaultPyEncoding(*args)
7672 #----------------------------------------------------------------------
7673
7674 class PyOnDemandOutputWindow:
7675 """
7676 A class that can be used for redirecting Python's stdout and
7677 stderr streams. It will do nothing until something is wrriten to
7678 the stream at which point it will create a Frame with a text area
7679 and write the text there.
7680 """
7681 def __init__(self, title = "wxPython: stdout/stderr"):
7682 self.frame = None
7683 self.title = title
7684 self.pos = wx.DefaultPosition
7685 self.size = (450, 300)
7686 self.parent = None
7687
7688 def SetParent(self, parent):
7689 """Set the window to be used as the popup Frame's parent."""
7690 self.parent = parent
7691
7692
7693 def CreateOutputWindow(self, st):
7694 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7695 style=wx.DEFAULT_FRAME_STYLE)
7696 self.text = wx.TextCtrl(self.frame, -1, "",
7697 style=wx.TE_MULTILINE|wx.TE_READONLY)
7698 self.text.AppendText(st)
7699 self.frame.Show(True)
7700 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7701
7702
7703 def OnCloseWindow(self, event):
7704 if self.frame is not None:
7705 self.frame.Destroy()
7706 self.frame = None
7707 self.text = None
7708
7709
7710 # These methods provide the file-like output behaviour.
7711 def write(self, text):
7712 """
7713 Create the output window if needed and write the string to it.
7714 If not called in the context of the gui thread then uses
7715 CallAfter to do the work there.
7716 """
7717 if self.frame is None:
7718 if not wx.Thread_IsMain():
7719 wx.CallAfter(self.CreateOutputWindow, text)
7720 else:
7721 self.CreateOutputWindow(text)
7722 else:
7723 if not wx.Thread_IsMain():
7724 wx.CallAfter(self.text.AppendText, text)
7725 else:
7726 self.text.AppendText(text)
7727
7728
7729 def close(self):
7730 if self.frame is not None:
7731 wx.CallAfter(self.frame.Close)
7732
7733
7734 def flush(self):
7735 pass
7736
7737
7738
7739 #----------------------------------------------------------------------
7740
7741 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7742
7743 class App(wx.PyApp):
7744 """
7745 The ``wx.App`` class represents the application and is used to:
7746
7747 * bootstrap the wxPython system and initialize the underlying
7748 gui toolkit
7749 * set and get application-wide properties
7750 * implement the windowing system main message or event loop,
7751 and to dispatch events to window instances
7752 * etc.
7753
7754 Every application must have a ``wx.App`` instance, and all
7755 creation of UI objects should be delayed until after the
7756 ``wx.App`` object has been created in order to ensure that the gui
7757 platform and wxWidgets have been fully initialized.
7758
7759 Normally you would derive from this class and implement an
7760 ``OnInit`` method that creates a frame and then calls
7761 ``self.SetTopWindow(frame)``.
7762
7763 :see: `wx.PySimpleApp` for a simpler app class that can be used
7764 directly.
7765 """
7766
7767 outputWindowClass = PyOnDemandOutputWindow
7768
7769 def __init__(self, redirect=_defRedirect, filename=None,
7770 useBestVisual=False, clearSigInt=True):
7771 """
7772 Construct a ``wx.App`` object.
7773
7774 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7775 redirected? Defaults to True on Windows and Mac, False
7776 otherwise. If `filename` is None then output will be
7777 redirected to a window that pops up as needed. (You can
7778 control what kind of window is created for the output by
7779 resetting the class variable ``outputWindowClass`` to a
7780 class of your choosing.)
7781
7782 :param filename: The name of a file to redirect output to, if
7783 redirect is True.
7784
7785 :param useBestVisual: Should the app try to use the best
7786 available visual provided by the system (only relevant on
7787 systems that have more than one visual.) This parameter
7788 must be used instead of calling `SetUseBestVisual` later
7789 on because it must be set before the underlying GUI
7790 toolkit is initialized.
7791
7792 :param clearSigInt: Should SIGINT be cleared? This allows the
7793 app to terminate upon a Ctrl-C in the console like other
7794 GUI apps will.
7795
7796 :note: You should override OnInit to do applicaition
7797 initialization to ensure that the system, toolkit and
7798 wxWidgets are fully initialized.
7799 """
7800
7801 wx.PyApp.__init__(self)
7802
7803 # make sure we can create a GUI
7804 if not self.IsDisplayAvailable():
7805
7806 if wx.Platform == "__WXMAC__":
7807 msg = """This program needs access to the screen.
7808 Please run with 'pythonw', not 'python', and only when you are logged
7809 in on the main display of your Mac."""
7810
7811 elif wx.Platform == "__WXGTK__":
7812 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7813
7814 else:
7815 msg = "Unable to create GUI"
7816 # TODO: more description is needed for wxMSW...
7817
7818 raise SystemExit(msg)
7819
7820 # This has to be done before OnInit
7821 self.SetUseBestVisual(useBestVisual)
7822
7823 # Set the default handler for SIGINT. This fixes a problem
7824 # where if Ctrl-C is pressed in the console that started this
7825 # app then it will not appear to do anything, (not even send
7826 # KeyboardInterrupt???) but will later segfault on exit. By
7827 # setting the default handler then the app will exit, as
7828 # expected (depending on platform.)
7829 if clearSigInt:
7830 try:
7831 import signal
7832 signal.signal(signal.SIGINT, signal.SIG_DFL)
7833 except:
7834 pass
7835
7836 # Save and redirect the stdio to a window?
7837 self.stdioWin = None
7838 self.saveStdio = (_sys.stdout, _sys.stderr)
7839 if redirect:
7840 self.RedirectStdio(filename)
7841
7842 # Use Python's install prefix as the default
7843 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7844
7845 # Until the new native control for wxMac is up to par, still use the generic one.
7846 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7847
7848 # This finishes the initialization of wxWindows and then calls
7849 # the OnInit that should be present in the derived class
7850 self._BootstrapApp()
7851
7852
7853 def OnPreInit(self):
7854 """
7855 Things that must be done after _BootstrapApp has done its
7856 thing, but would be nice if they were already done by the time
7857 that OnInit is called.
7858 """
7859 wx.StockGDI._initStockObjects()
7860
7861
7862 def __del__(self, destroy=wx.PyApp.__del__):
7863 self.RestoreStdio() # Just in case the MainLoop was overridden
7864 destroy(self)
7865
7866 def Destroy(self):
7867 self.this.own(False)
7868 wx.PyApp.Destroy(self)
7869
7870 def SetTopWindow(self, frame):
7871 """Set the \"main\" top level window"""
7872 if self.stdioWin:
7873 self.stdioWin.SetParent(frame)
7874 wx.PyApp.SetTopWindow(self, frame)
7875
7876
7877 def MainLoop(self):
7878 """Execute the main GUI event loop"""
7879 wx.PyApp.MainLoop(self)
7880 self.RestoreStdio()
7881
7882
7883 def RedirectStdio(self, filename=None):
7884 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7885 if filename:
7886 _sys.stdout = _sys.stderr = open(filename, 'a')
7887 else:
7888 self.stdioWin = self.outputWindowClass()
7889 _sys.stdout = _sys.stderr = self.stdioWin
7890
7891
7892 def RestoreStdio(self):
7893 try:
7894 _sys.stdout, _sys.stderr = self.saveStdio
7895 except:
7896 pass
7897
7898
7899 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7900 """
7901 Set the title, position and/or size of the output window if
7902 the stdio has been redirected. This should be called before
7903 any output would cause the output window to be created.
7904 """
7905 if self.stdioWin:
7906 if title is not None:
7907 self.stdioWin.title = title
7908 if pos is not None:
7909 self.stdioWin.pos = pos
7910 if size is not None:
7911 self.stdioWin.size = size
7912
7913
7914
7915
7916 # change from wx.PyApp_XX to wx.App_XX
7917 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7918 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7919 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7920 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7921 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7922 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7923 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7924 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7925 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7926 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7927 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7928
7929 #----------------------------------------------------------------------------
7930
7931 class PySimpleApp(wx.App):
7932 """
7933 A simple application class. You can just create one of these and
7934 then then make your top level windows later, and not have to worry
7935 about OnInit. For example::
7936
7937 app = wx.PySimpleApp()
7938 frame = wx.Frame(None, title='Hello World')
7939 frame.Show()
7940 app.MainLoop()
7941
7942 :see: `wx.App`
7943 """
7944
7945 def __init__(self, redirect=False, filename=None,
7946 useBestVisual=False, clearSigInt=True):
7947 """
7948 :see: `wx.App.__init__`
7949 """
7950 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7951
7952 def OnInit(self):
7953 return True
7954
7955
7956
7957 # Is anybody using this one?
7958 class PyWidgetTester(wx.App):
7959 def __init__(self, size = (250, 100)):
7960 self.size = size
7961 wx.App.__init__(self, 0)
7962
7963 def OnInit(self):
7964 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7965 self.SetTopWindow(self.frame)
7966 return True
7967
7968 def SetWidget(self, widgetClass, *args, **kwargs):
7969 w = widgetClass(self.frame, *args, **kwargs)
7970 self.frame.Show(True)
7971
7972 #----------------------------------------------------------------------------
7973 # DO NOT hold any other references to this object. This is how we
7974 # know when to cleanup system resources that wxWidgets is holding. When
7975 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7976 # goes to zero and it calls the wx.App_CleanUp function.
7977
7978 class __wxPyCleanup:
7979 def __init__(self):
7980 self.cleanup = _core_.App_CleanUp
7981 def __del__(self):
7982 self.cleanup()
7983
7984 _sys.__wxPythonCleanup = __wxPyCleanup()
7985
7986 ## # another possible solution, but it gets called too early...
7987 ## import atexit
7988 ## atexit.register(_core_.wxApp_CleanUp)
7989
7990
7991 #----------------------------------------------------------------------------
7992
7993 #---------------------------------------------------------------------------
7994
7995 class EventLoop(object):
7996 """Proxy of C++ EventLoop class"""
7997 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7998 __repr__ = _swig_repr
7999 def __init__(self, *args, **kwargs):
8000 """__init__(self) -> EventLoop"""
8001 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
8002 __swig_destroy__ = _core_.delete_EventLoop
8003 __del__ = lambda self : None;
8004 def Run(*args, **kwargs):
8005 """Run(self) -> int"""
8006 return _core_.EventLoop_Run(*args, **kwargs)
8007
8008 def Exit(*args, **kwargs):
8009 """Exit(self, int rc=0)"""
8010 return _core_.EventLoop_Exit(*args, **kwargs)
8011
8012 def Pending(*args, **kwargs):
8013 """Pending(self) -> bool"""
8014 return _core_.EventLoop_Pending(*args, **kwargs)
8015
8016 def Dispatch(*args, **kwargs):
8017 """Dispatch(self) -> bool"""
8018 return _core_.EventLoop_Dispatch(*args, **kwargs)
8019
8020 def IsRunning(*args, **kwargs):
8021 """IsRunning(self) -> bool"""
8022 return _core_.EventLoop_IsRunning(*args, **kwargs)
8023
8024 def GetActive(*args, **kwargs):
8025 """GetActive() -> EventLoop"""
8026 return _core_.EventLoop_GetActive(*args, **kwargs)
8027
8028 GetActive = staticmethod(GetActive)
8029 def SetActive(*args, **kwargs):
8030 """SetActive(EventLoop loop)"""
8031 return _core_.EventLoop_SetActive(*args, **kwargs)
8032
8033 SetActive = staticmethod(SetActive)
8034 _core_.EventLoop_swigregister(EventLoop)
8035
8036 def EventLoop_GetActive(*args):
8037 """EventLoop_GetActive() -> EventLoop"""
8038 return _core_.EventLoop_GetActive(*args)
8039
8040 def EventLoop_SetActive(*args, **kwargs):
8041 """EventLoop_SetActive(EventLoop loop)"""
8042 return _core_.EventLoop_SetActive(*args, **kwargs)
8043
8044 class EventLoopActivator(object):
8045 """Proxy of C++ EventLoopActivator class"""
8046 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8047 __repr__ = _swig_repr
8048 def __init__(self, *args, **kwargs):
8049 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
8050 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
8051 __swig_destroy__ = _core_.delete_EventLoopActivator
8052 __del__ = lambda self : None;
8053 _core_.EventLoopActivator_swigregister(EventLoopActivator)
8054
8055 #---------------------------------------------------------------------------
8056
8057 ACCEL_ALT = _core_.ACCEL_ALT
8058 ACCEL_CTRL = _core_.ACCEL_CTRL
8059 ACCEL_SHIFT = _core_.ACCEL_SHIFT
8060 ACCEL_NORMAL = _core_.ACCEL_NORMAL
8061 ACCEL_CMD = _core_.ACCEL_CMD
8062 class AcceleratorEntry(object):
8063 """
8064 A class used to define items in an `wx.AcceleratorTable`. wxPython
8065 programs can choose to use wx.AcceleratorEntry objects, but using a
8066 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
8067 as well. See `__init__` for of the tuple values.
8068
8069 :see: `wx.AcceleratorTable`
8070 """
8071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8072 __repr__ = _swig_repr
8073 def __init__(self, *args, **kwargs):
8074 """
8075 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8076
8077 Construct a wx.AcceleratorEntry.
8078 """
8079 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8080 __swig_destroy__ = _core_.delete_AcceleratorEntry
8081 __del__ = lambda self : None;
8082 def Set(*args, **kwargs):
8083 """
8084 Set(self, int flags, int keyCode, int cmd)
8085
8086 (Re)set the attributes of a wx.AcceleratorEntry.
8087 :see `__init__`
8088 """
8089 return _core_.AcceleratorEntry_Set(*args, **kwargs)
8090
8091 def Create(*args, **kwargs):
8092 """
8093 Create(String str) -> AcceleratorEntry
8094
8095 Create accelerator corresponding to the specified string, or None if
8096 it coulnd't be parsed.
8097 """
8098 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8099
8100 Create = staticmethod(Create)
8101 def GetFlags(*args, **kwargs):
8102 """
8103 GetFlags(self) -> int
8104
8105 Get the AcceleratorEntry's flags.
8106 """
8107 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
8108
8109 def GetKeyCode(*args, **kwargs):
8110 """
8111 GetKeyCode(self) -> int
8112
8113 Get the AcceleratorEntry's keycode.
8114 """
8115 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
8116
8117 def GetCommand(*args, **kwargs):
8118 """
8119 GetCommand(self) -> int
8120
8121 Get the AcceleratorEntry's command ID.
8122 """
8123 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
8124
8125 def IsOk(*args, **kwargs):
8126 """IsOk(self) -> bool"""
8127 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8128
8129 def ToString(*args, **kwargs):
8130 """
8131 ToString(self) -> String
8132
8133 Returns a string representation for the this accelerator. The string
8134 is formatted using the <flags>-<keycode> format where <flags> maybe a
8135 hyphen-separed list of "shift|alt|ctrl"
8136
8137 """
8138 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8139
8140 def FromString(*args, **kwargs):
8141 """
8142 FromString(self, String str) -> bool
8143
8144 Returns true if the given string correctly initialized this object.
8145 """
8146 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8147
8148 Command = property(GetCommand,doc="See `GetCommand`")
8149 Flags = property(GetFlags,doc="See `GetFlags`")
8150 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
8151 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
8152
8153 def AcceleratorEntry_Create(*args, **kwargs):
8154 """
8155 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8156
8157 Create accelerator corresponding to the specified string, or None if
8158 it coulnd't be parsed.
8159 """
8160 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8161
8162 class AcceleratorTable(Object):
8163 """
8164 An accelerator table allows the application to specify a table of
8165 keyboard shortcuts for menus or other commands. On Windows, menu or
8166 button commands are supported; on GTK, only menu commands are
8167 supported.
8168 """
8169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8170 __repr__ = _swig_repr
8171 def __init__(self, *args, **kwargs):
8172 """
8173 __init__(entries) -> AcceleratorTable
8174
8175 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8176 items or or of 3-tuples (flags, keyCode, cmdID)
8177
8178 :see: `wx.AcceleratorEntry`
8179 """
8180 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8181 __swig_destroy__ = _core_.delete_AcceleratorTable
8182 __del__ = lambda self : None;
8183 def IsOk(*args, **kwargs):
8184 """IsOk(self) -> bool"""
8185 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
8186
8187 Ok = IsOk
8188 _core_.AcceleratorTable_swigregister(AcceleratorTable)
8189
8190 def GetAccelFromString(label):
8191 entry = AcceleratorEntry()
8192 entry.FromString(label)
8193 return entry
8194
8195 #---------------------------------------------------------------------------
8196
8197 class VisualAttributes(object):
8198 """struct containing all the visual attributes of a control"""
8199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8200 __repr__ = _swig_repr
8201 def __init__(self, *args, **kwargs):
8202 """
8203 __init__(self) -> VisualAttributes
8204
8205 struct containing all the visual attributes of a control
8206 """
8207 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8208 __swig_destroy__ = _core_.delete_VisualAttributes
8209 __del__ = lambda self : None;
8210 def _get_font(*args, **kwargs):
8211 """_get_font(self) -> Font"""
8212 return _core_.VisualAttributes__get_font(*args, **kwargs)
8213
8214 def _get_colFg(*args, **kwargs):
8215 """_get_colFg(self) -> Colour"""
8216 return _core_.VisualAttributes__get_colFg(*args, **kwargs)
8217
8218 def _get_colBg(*args, **kwargs):
8219 """_get_colBg(self) -> Colour"""
8220 return _core_.VisualAttributes__get_colBg(*args, **kwargs)
8221
8222 font = property(_get_font)
8223 colFg = property(_get_colFg)
8224 colBg = property(_get_colBg)
8225 _core_.VisualAttributes_swigregister(VisualAttributes)
8226 NullAcceleratorTable = cvar.NullAcceleratorTable
8227 PanelNameStr = cvar.PanelNameStr
8228
8229 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8230 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8231 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8232 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8233 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8234 class Window(EvtHandler):
8235 """
8236 wx.Window is the base class for all windows and represents any visible
8237 object on the screen. All controls, top level windows and so on are
8238 wx.Windows. Sizers and device contexts are not however, as they don't
8239 appear on screen themselves.
8240
8241 """
8242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8243 __repr__ = _swig_repr
8244 def __init__(self, *args, **kwargs):
8245 """
8246 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8247 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8248
8249 Construct and show a generic Window.
8250 """
8251 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
8252 self._setOORInfo(self)
8253
8254 def Create(*args, **kwargs):
8255 """
8256 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8257 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8258
8259 Create the GUI part of the Window for 2-phase creation mode.
8260 """
8261 return _core_.Window_Create(*args, **kwargs)
8262
8263 def Close(*args, **kwargs):
8264 """
8265 Close(self, bool force=False) -> bool
8266
8267 This function simply generates a EVT_CLOSE event whose handler usually
8268 tries to close the window. It doesn't close the window itself,
8269 however. If force is False (the default) then the window's close
8270 handler will be allowed to veto the destruction of the window.
8271 """
8272 return _core_.Window_Close(*args, **kwargs)
8273
8274 def Destroy(*args, **kwargs):
8275 """
8276 Destroy(self) -> bool
8277
8278 Destroys the window safely. Frames and dialogs are not destroyed
8279 immediately when this function is called -- they are added to a list
8280 of windows to be deleted on idle time, when all the window's events
8281 have been processed. This prevents problems with events being sent to
8282 non-existent windows.
8283
8284 Returns True if the window has either been successfully deleted, or it
8285 has been added to the list of windows pending real deletion.
8286 """
8287 args[0].this.own(False)
8288 return _core_.Window_Destroy(*args, **kwargs)
8289
8290 def DestroyChildren(*args, **kwargs):
8291 """
8292 DestroyChildren(self) -> bool
8293
8294 Destroys all children of a window. Called automatically by the
8295 destructor.
8296 """
8297 return _core_.Window_DestroyChildren(*args, **kwargs)
8298
8299 def IsBeingDeleted(*args, **kwargs):
8300 """
8301 IsBeingDeleted(self) -> bool
8302
8303 Is the window in the process of being deleted?
8304 """
8305 return _core_.Window_IsBeingDeleted(*args, **kwargs)
8306
8307 def SetLabel(*args, **kwargs):
8308 """
8309 SetLabel(self, String label)
8310
8311 Set the text which the window shows in its label if applicable.
8312 """
8313 return _core_.Window_SetLabel(*args, **kwargs)
8314
8315 def GetLabel(*args, **kwargs):
8316 """
8317 GetLabel(self) -> String
8318
8319 Generic way of getting a label from any window, for identification
8320 purposes. The interpretation of this function differs from class to
8321 class. For frames and dialogs, the value returned is the title. For
8322 buttons or static text controls, it is the button text. This function
8323 can be useful for meta-programs such as testing tools or special-needs
8324 access programs)which need to identify windows by name.
8325 """
8326 return _core_.Window_GetLabel(*args, **kwargs)
8327
8328 def SetName(*args, **kwargs):
8329 """
8330 SetName(self, String name)
8331
8332 Sets the window's name. The window name is used for ressource setting
8333 in X, it is not the same as the window title/label
8334 """
8335 return _core_.Window_SetName(*args, **kwargs)
8336
8337 def GetName(*args, **kwargs):
8338 """
8339 GetName(self) -> String
8340
8341 Returns the windows name. This name is not guaranteed to be unique;
8342 it is up to the programmer to supply an appropriate name in the window
8343 constructor or via wx.Window.SetName.
8344 """
8345 return _core_.Window_GetName(*args, **kwargs)
8346
8347 def SetWindowVariant(*args, **kwargs):
8348 """
8349 SetWindowVariant(self, int variant)
8350
8351 Sets the variant of the window/font size to use for this window, if
8352 the platform supports variants, for example, wxMac.
8353 """
8354 return _core_.Window_SetWindowVariant(*args, **kwargs)
8355
8356 def GetWindowVariant(*args, **kwargs):
8357 """GetWindowVariant(self) -> int"""
8358 return _core_.Window_GetWindowVariant(*args, **kwargs)
8359
8360 def SetId(*args, **kwargs):
8361 """
8362 SetId(self, int winid)
8363
8364 Sets the identifier of the window. Each window has an integer
8365 identifier. If the application has not provided one, an identifier
8366 will be generated. Normally, the identifier should be provided on
8367 creation and should not be modified subsequently.
8368 """
8369 return _core_.Window_SetId(*args, **kwargs)
8370
8371 def GetId(*args, **kwargs):
8372 """
8373 GetId(self) -> int
8374
8375 Returns the identifier of the window. Each window has an integer
8376 identifier. If the application has not provided one (or the default Id
8377 -1 is used) then an unique identifier with a negative value will be
8378 generated.
8379 """
8380 return _core_.Window_GetId(*args, **kwargs)
8381
8382 def NewControlId(*args, **kwargs):
8383 """
8384 NewControlId() -> int
8385
8386 Generate a control id for the controls which were not given one.
8387 """
8388 return _core_.Window_NewControlId(*args, **kwargs)
8389
8390 NewControlId = staticmethod(NewControlId)
8391 def NextControlId(*args, **kwargs):
8392 """
8393 NextControlId(int winid) -> int
8394
8395 Get the id of the control following the one with the given
8396 autogenerated) id
8397 """
8398 return _core_.Window_NextControlId(*args, **kwargs)
8399
8400 NextControlId = staticmethod(NextControlId)
8401 def PrevControlId(*args, **kwargs):
8402 """
8403 PrevControlId(int winid) -> int
8404
8405 Get the id of the control preceding the one with the given
8406 autogenerated) id
8407 """
8408 return _core_.Window_PrevControlId(*args, **kwargs)
8409
8410 PrevControlId = staticmethod(PrevControlId)
8411 def GetLayoutDirection(*args, **kwargs):
8412 """
8413 GetLayoutDirection(self) -> int
8414
8415 Get the layout direction (LTR or RTL) for this window. Returns
8416 ``wx.Layout_Default`` if layout direction is not supported.
8417 """
8418 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8419
8420 def SetLayoutDirection(*args, **kwargs):
8421 """
8422 SetLayoutDirection(self, int dir)
8423
8424 Set the layout direction (LTR or RTL) for this window.
8425 """
8426 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8427
8428 def AdjustForLayoutDirection(*args, **kwargs):
8429 """
8430 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8431
8432 Mirror coordinates for RTL layout if this window uses it and if the
8433 mirroring is not done automatically like Win32.
8434 """
8435 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8436
8437 def SetSize(*args, **kwargs):
8438 """
8439 SetSize(self, Size size)
8440
8441 Sets the size of the window in pixels.
8442 """
8443 return _core_.Window_SetSize(*args, **kwargs)
8444
8445 def SetDimensions(*args, **kwargs):
8446 """
8447 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8448
8449 Sets the position and size of the window in pixels. The sizeFlags
8450 parameter indicates the interpretation of the other params if they are
8451 equal to -1.
8452
8453 ======================== ======================================
8454 wx.SIZE_AUTO A -1 indicates that a class-specific
8455 default should be used.
8456 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8457 -1 values are supplied.
8458 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8459 interpreted as real dimensions, not
8460 default values.
8461 ======================== ======================================
8462
8463 """
8464 return _core_.Window_SetDimensions(*args, **kwargs)
8465
8466 def SetRect(*args, **kwargs):
8467 """
8468 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8469
8470 Sets the position and size of the window in pixels using a wx.Rect.
8471 """
8472 return _core_.Window_SetRect(*args, **kwargs)
8473
8474 def SetSizeWH(*args, **kwargs):
8475 """
8476 SetSizeWH(self, int width, int height)
8477
8478 Sets the size of the window in pixels.
8479 """
8480 return _core_.Window_SetSizeWH(*args, **kwargs)
8481
8482 def Move(*args, **kwargs):
8483 """
8484 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8485
8486 Moves the window to the given position.
8487 """
8488 return _core_.Window_Move(*args, **kwargs)
8489
8490 SetPosition = Move
8491 def MoveXY(*args, **kwargs):
8492 """
8493 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8494
8495 Moves the window to the given position.
8496 """
8497 return _core_.Window_MoveXY(*args, **kwargs)
8498
8499 def SetInitialSize(*args, **kwargs):
8500 """
8501 SetInitialSize(self, Size size=DefaultSize)
8502
8503 A 'Smart' SetSize that will fill in default size components with the
8504 window's *best size* values. Also set's the minsize for use with sizers.
8505 """
8506 return _core_.Window_SetInitialSize(*args, **kwargs)
8507
8508 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
8509 def Raise(*args, **kwargs):
8510 """
8511 Raise(self)
8512
8513 Raises the window to the top of the window hierarchy. In current
8514 version of wxWidgets this works both for managed and child windows.
8515 """
8516 return _core_.Window_Raise(*args, **kwargs)
8517
8518 def Lower(*args, **kwargs):
8519 """
8520 Lower(self)
8521
8522 Lowers the window to the bottom of the window hierarchy. In current
8523 version of wxWidgets this works both for managed and child windows.
8524 """
8525 return _core_.Window_Lower(*args, **kwargs)
8526
8527 def SetClientSize(*args, **kwargs):
8528 """
8529 SetClientSize(self, Size size)
8530
8531 This sets the size of the window client area in pixels. Using this
8532 function to size a window tends to be more device-independent than
8533 wx.Window.SetSize, since the application need not worry about what
8534 dimensions the border or title bar have when trying to fit the window
8535 around panel items, for example.
8536 """
8537 return _core_.Window_SetClientSize(*args, **kwargs)
8538
8539 def SetClientSizeWH(*args, **kwargs):
8540 """
8541 SetClientSizeWH(self, int width, int height)
8542
8543 This sets the size of the window client area in pixels. Using this
8544 function to size a window tends to be more device-independent than
8545 wx.Window.SetSize, since the application need not worry about what
8546 dimensions the border or title bar have when trying to fit the window
8547 around panel items, for example.
8548 """
8549 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8550
8551 def SetClientRect(*args, **kwargs):
8552 """
8553 SetClientRect(self, Rect rect)
8554
8555 This sets the size of the window client area in pixels. Using this
8556 function to size a window tends to be more device-independent than
8557 wx.Window.SetSize, since the application need not worry about what
8558 dimensions the border or title bar have when trying to fit the window
8559 around panel items, for example.
8560 """
8561 return _core_.Window_SetClientRect(*args, **kwargs)
8562
8563 def GetPosition(*args, **kwargs):
8564 """
8565 GetPosition(self) -> Point
8566
8567 Get the window's position. Notice that the position is in client
8568 coordinates for child windows and screen coordinates for the top level
8569 ones, use `GetScreenPosition` if you need screen coordinates for all
8570 kinds of windows.
8571 """
8572 return _core_.Window_GetPosition(*args, **kwargs)
8573
8574 def GetPositionTuple(*args, **kwargs):
8575 """
8576 GetPositionTuple() -> (x,y)
8577
8578 Get the window's position. Notice that the position is in client
8579 coordinates for child windows and screen coordinates for the top level
8580 ones, use `GetScreenPosition` if you need screen coordinates for all
8581 kinds of windows.
8582 """
8583 return _core_.Window_GetPositionTuple(*args, **kwargs)
8584
8585 def GetScreenPosition(*args, **kwargs):
8586 """
8587 GetScreenPosition(self) -> Point
8588
8589 Get the position of the window in screen coordinantes.
8590 """
8591 return _core_.Window_GetScreenPosition(*args, **kwargs)
8592
8593 def GetScreenPositionTuple(*args, **kwargs):
8594 """
8595 GetScreenPositionTuple() -> (x,y)
8596
8597 Get the position of the window in screen coordinantes.
8598 """
8599 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8600
8601 def GetScreenRect(*args, **kwargs):
8602 """
8603 GetScreenRect(self) -> Rect
8604
8605 Returns the size and position of the window in screen coordinantes as
8606 a `wx.Rect` object.
8607 """
8608 return _core_.Window_GetScreenRect(*args, **kwargs)
8609
8610 def GetSize(*args, **kwargs):
8611 """
8612 GetSize(self) -> Size
8613
8614 Get the window size.
8615 """
8616 return _core_.Window_GetSize(*args, **kwargs)
8617
8618 def GetSizeTuple(*args, **kwargs):
8619 """
8620 GetSizeTuple() -> (width, height)
8621
8622 Get the window size.
8623 """
8624 return _core_.Window_GetSizeTuple(*args, **kwargs)
8625
8626 def GetRect(*args, **kwargs):
8627 """
8628 GetRect(self) -> Rect
8629
8630 Returns the size and position of the window as a `wx.Rect` object.
8631 """
8632 return _core_.Window_GetRect(*args, **kwargs)
8633
8634 def GetClientSize(*args, **kwargs):
8635 """
8636 GetClientSize(self) -> Size
8637
8638 This gets the size of the window's 'client area' in pixels. The client
8639 area is the area which may be drawn on by the programmer, excluding
8640 title bar, border, scrollbars, etc.
8641 """
8642 return _core_.Window_GetClientSize(*args, **kwargs)
8643
8644 def GetClientSizeTuple(*args, **kwargs):
8645 """
8646 GetClientSizeTuple() -> (width, height)
8647
8648 This gets the size of the window's 'client area' in pixels. The client
8649 area is the area which may be drawn on by the programmer, excluding
8650 title bar, border, scrollbars, etc.
8651 """
8652 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8653
8654 def GetClientAreaOrigin(*args, **kwargs):
8655 """
8656 GetClientAreaOrigin(self) -> Point
8657
8658 Get the origin of the client area of the window relative to the
8659 window's top left corner (the client area may be shifted because of
8660 the borders, scrollbars, other decorations...)
8661 """
8662 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8663
8664 def GetClientRect(*args, **kwargs):
8665 """
8666 GetClientRect(self) -> Rect
8667
8668 Get the client area position and size as a `wx.Rect` object.
8669 """
8670 return _core_.Window_GetClientRect(*args, **kwargs)
8671
8672 def GetBestSize(*args, **kwargs):
8673 """
8674 GetBestSize(self) -> Size
8675
8676 This function returns the best acceptable minimal size for the
8677 window, if applicable. For example, for a static text control, it will
8678 be the minimal size such that the control label is not truncated. For
8679 windows containing subwindows (suzh aswx.Panel), the size returned by
8680 this function will be the same as the size the window would have had
8681 after calling Fit.
8682 """
8683 return _core_.Window_GetBestSize(*args, **kwargs)
8684
8685 def GetBestSizeTuple(*args, **kwargs):
8686 """
8687 GetBestSizeTuple() -> (width, height)
8688
8689 This function returns the best acceptable minimal size for the
8690 window, if applicable. For example, for a static text control, it will
8691 be the minimal size such that the control label is not truncated. For
8692 windows containing subwindows (suzh aswx.Panel), the size returned by
8693 this function will be the same as the size the window would have had
8694 after calling Fit.
8695 """
8696 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8697
8698 def InvalidateBestSize(*args, **kwargs):
8699 """
8700 InvalidateBestSize(self)
8701
8702 Reset the cached best size value so it will be recalculated the next
8703 time it is needed.
8704 """
8705 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8706
8707 def CacheBestSize(*args, **kwargs):
8708 """
8709 CacheBestSize(self, Size size)
8710
8711 Cache the best size so it doesn't need to be calculated again, (at least until
8712 some properties of the window change.)
8713 """
8714 return _core_.Window_CacheBestSize(*args, **kwargs)
8715
8716 def GetEffectiveMinSize(*args, **kwargs):
8717 """
8718 GetEffectiveMinSize(self) -> Size
8719
8720 This function will merge the window's best size into the window's
8721 minimum size, giving priority to the min size components, and returns
8722 the results.
8723
8724 """
8725 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
8726
8727 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8728 def GetAdjustedBestSize(self):
8729 s = self.GetBestSize()
8730 return wx.Size(max(s.width, self.GetMinWidth()),
8731 max(s.height, self.GetMinHeight()))
8732 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
8733
8734 def Center(*args, **kwargs):
8735 """
8736 Center(self, int direction=BOTH)
8737
8738 Centers the window. The parameter specifies the direction for
8739 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8740 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8741 on the entire screen and not on its parent window. If it is a
8742 top-level window and has no parent then it will always be centered
8743 relative to the screen.
8744 """
8745 return _core_.Window_Center(*args, **kwargs)
8746
8747 Centre = Center
8748 def CenterOnParent(*args, **kwargs):
8749 """
8750 CenterOnParent(self, int dir=BOTH)
8751
8752 Center with respect to the the parent window
8753 """
8754 return _core_.Window_CenterOnParent(*args, **kwargs)
8755
8756 CentreOnParent = CenterOnParent
8757 def Fit(*args, **kwargs):
8758 """
8759 Fit(self)
8760
8761 Sizes the window so that it fits around its subwindows. This function
8762 won't do anything if there are no subwindows and will only really work
8763 correctly if sizers are used for the subwindows layout. Also, if the
8764 window has exactly one subwindow it is better (faster and the result
8765 is more precise as Fit adds some margin to account for fuzziness of
8766 its calculations) to call window.SetClientSize(child.GetSize())
8767 instead of calling Fit.
8768 """
8769 return _core_.Window_Fit(*args, **kwargs)
8770
8771 def FitInside(*args, **kwargs):
8772 """
8773 FitInside(self)
8774
8775 Similar to Fit, but sizes the interior (virtual) size of a
8776 window. Mainly useful with scrolled windows to reset scrollbars after
8777 sizing changes that do not trigger a size event, and/or scrolled
8778 windows without an interior sizer. This function similarly won't do
8779 anything if there are no subwindows.
8780 """
8781 return _core_.Window_FitInside(*args, **kwargs)
8782
8783 def SetSizeHints(*args, **kwargs):
8784 """
8785 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8786 int incH=-1)
8787
8788 Allows specification of minimum and maximum window sizes, and window
8789 size increments. If a pair of values is not set (or set to -1), the
8790 default values will be used. If this function is called, the user
8791 will not be able to size the window outside the given bounds (if it is
8792 a top-level window.) Sizers will also inspect the minimum window size
8793 and will use that value if set when calculating layout.
8794
8795 The resizing increments are only significant under Motif or Xt.
8796 """
8797 return _core_.Window_SetSizeHints(*args, **kwargs)
8798
8799 def SetSizeHintsSz(*args, **kwargs):
8800 """
8801 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8802
8803 Allows specification of minimum and maximum window sizes, and window
8804 size increments. If a pair of values is not set (or set to -1), the
8805 default values will be used. If this function is called, the user
8806 will not be able to size the window outside the given bounds (if it is
8807 a top-level window.) Sizers will also inspect the minimum window size
8808 and will use that value if set when calculating layout.
8809
8810 The resizing increments are only significant under Motif or Xt.
8811 """
8812 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8813
8814 def SetVirtualSizeHints(*args, **kwargs):
8815 """
8816 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8817
8818 Allows specification of minimum and maximum virtual window sizes. If a
8819 pair of values is not set (or set to -1), the default values will be
8820 used. If this function is called, the user will not be able to size
8821 the virtual area of the window outside the given bounds.
8822 """
8823 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8824
8825 def SetVirtualSizeHintsSz(*args, **kwargs):
8826 """
8827 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8828
8829 Allows specification of minimum and maximum virtual window sizes. If a
8830 pair of values is not set (or set to -1), the default values will be
8831 used. If this function is called, the user will not be able to size
8832 the virtual area of the window outside the given bounds.
8833 """
8834 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8835
8836 def GetMaxSize(*args, **kwargs):
8837 """GetMaxSize(self) -> Size"""
8838 return _core_.Window_GetMaxSize(*args, **kwargs)
8839
8840 def GetMinSize(*args, **kwargs):
8841 """GetMinSize(self) -> Size"""
8842 return _core_.Window_GetMinSize(*args, **kwargs)
8843
8844 def SetMinSize(*args, **kwargs):
8845 """
8846 SetMinSize(self, Size minSize)
8847
8848 A more convenient method than `SetSizeHints` for setting just the
8849 min size.
8850 """
8851 return _core_.Window_SetMinSize(*args, **kwargs)
8852
8853 def SetMaxSize(*args, **kwargs):
8854 """
8855 SetMaxSize(self, Size maxSize)
8856
8857 A more convenient method than `SetSizeHints` for setting just the
8858 max size.
8859 """
8860 return _core_.Window_SetMaxSize(*args, **kwargs)
8861
8862 def GetMinWidth(*args, **kwargs):
8863 """GetMinWidth(self) -> int"""
8864 return _core_.Window_GetMinWidth(*args, **kwargs)
8865
8866 def GetMinHeight(*args, **kwargs):
8867 """GetMinHeight(self) -> int"""
8868 return _core_.Window_GetMinHeight(*args, **kwargs)
8869
8870 def GetMaxWidth(*args, **kwargs):
8871 """GetMaxWidth(self) -> int"""
8872 return _core_.Window_GetMaxWidth(*args, **kwargs)
8873
8874 def GetMaxHeight(*args, **kwargs):
8875 """GetMaxHeight(self) -> int"""
8876 return _core_.Window_GetMaxHeight(*args, **kwargs)
8877
8878 def SetVirtualSize(*args, **kwargs):
8879 """
8880 SetVirtualSize(self, Size size)
8881
8882 Set the the virtual size of a window in pixels. For most windows this
8883 is just the client area of the window, but for some like scrolled
8884 windows it is more or less independent of the screen window size.
8885 """
8886 return _core_.Window_SetVirtualSize(*args, **kwargs)
8887
8888 def SetVirtualSizeWH(*args, **kwargs):
8889 """
8890 SetVirtualSizeWH(self, int w, int h)
8891
8892 Set the the virtual size of a window in pixels. For most windows this
8893 is just the client area of the window, but for some like scrolled
8894 windows it is more or less independent of the screen window size.
8895 """
8896 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8897
8898 def GetVirtualSize(*args, **kwargs):
8899 """
8900 GetVirtualSize(self) -> Size
8901
8902 Get the the virtual size of the window in pixels. For most windows
8903 this is just the client area of the window, but for some like scrolled
8904 windows it is more or less independent of the screen window size.
8905 """
8906 return _core_.Window_GetVirtualSize(*args, **kwargs)
8907
8908 def GetVirtualSizeTuple(*args, **kwargs):
8909 """
8910 GetVirtualSizeTuple() -> (width, height)
8911
8912 Get the the virtual size of the window in pixels. For most windows
8913 this is just the client area of the window, but for some like scrolled
8914 windows it is more or less independent of the screen window size.
8915 """
8916 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8917
8918 def GetWindowBorderSize(*args, **kwargs):
8919 """
8920 GetWindowBorderSize(self) -> Size
8921
8922 Return the size of the left/right and top/bottom borders.
8923 """
8924 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8925
8926 def GetBestVirtualSize(*args, **kwargs):
8927 """
8928 GetBestVirtualSize(self) -> Size
8929
8930 Return the largest of ClientSize and BestSize (as determined by a
8931 sizer, interior children, or other means)
8932 """
8933 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8934
8935 def Show(*args, **kwargs):
8936 """
8937 Show(self, bool show=True) -> bool
8938
8939 Shows or hides the window. You may need to call Raise for a top level
8940 window if you want to bring it to top, although this is not needed if
8941 Show is called immediately after the frame creation. Returns True if
8942 the window has been shown or hidden or False if nothing was done
8943 because it already was in the requested state.
8944 """
8945 return _core_.Window_Show(*args, **kwargs)
8946
8947 def Hide(*args, **kwargs):
8948 """
8949 Hide(self) -> bool
8950
8951 Equivalent to calling Show(False).
8952 """
8953 return _core_.Window_Hide(*args, **kwargs)
8954
8955 def Enable(*args, **kwargs):
8956 """
8957 Enable(self, bool enable=True) -> bool
8958
8959 Enable or disable the window for user input. Note that when a parent
8960 window is disabled, all of its children are disabled as well and they
8961 are reenabled again when the parent is. Returns true if the window
8962 has been enabled or disabled, false if nothing was done, i.e. if the
8963 window had already been in the specified state.
8964 """
8965 return _core_.Window_Enable(*args, **kwargs)
8966
8967 def Disable(*args, **kwargs):
8968 """
8969 Disable(self) -> bool
8970
8971 Disables the window, same as Enable(false).
8972 """
8973 return _core_.Window_Disable(*args, **kwargs)
8974
8975 def IsShown(*args, **kwargs):
8976 """
8977 IsShown(self) -> bool
8978
8979 Returns true if the window is shown, false if it has been hidden.
8980 """
8981 return _core_.Window_IsShown(*args, **kwargs)
8982
8983 def IsEnabled(*args, **kwargs):
8984 """
8985 IsEnabled(self) -> bool
8986
8987 Returns true if the window is enabled for input, false otherwise.
8988 This method takes into account the enabled state of parent windows up
8989 to the top-level window.
8990 """
8991 return _core_.Window_IsEnabled(*args, **kwargs)
8992
8993 def IsThisEnabled(*args, **kwargs):
8994 """
8995 IsThisEnabled(self) -> bool
8996
8997 Returns the internal enabled state independent of the parent(s) state,
8998 i.e. the state in which the window would be if all of its parents are
8999 enabled. Use `IsEnabled` to get the effective window state.
9000 """
9001 return _core_.Window_IsThisEnabled(*args, **kwargs)
9002
9003 def IsShownOnScreen(*args, **kwargs):
9004 """
9005 IsShownOnScreen(self) -> bool
9006
9007 Returns ``True`` if the window is physically visible on the screen,
9008 i.e. it is shown and all its parents up to the toplevel window are
9009 shown as well.
9010 """
9011 return _core_.Window_IsShownOnScreen(*args, **kwargs)
9012
9013 def SetWindowStyleFlag(*args, **kwargs):
9014 """
9015 SetWindowStyleFlag(self, long style)
9016
9017 Sets the style of the window. Please note that some styles cannot be
9018 changed after the window creation and that Refresh() might need to be
9019 called after changing the others for the change to take place
9020 immediately.
9021 """
9022 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
9023
9024 def GetWindowStyleFlag(*args, **kwargs):
9025 """
9026 GetWindowStyleFlag(self) -> long
9027
9028 Gets the window style that was passed to the constructor or Create
9029 method.
9030 """
9031 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
9032
9033 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
9034 def HasFlag(*args, **kwargs):
9035 """
9036 HasFlag(self, int flag) -> bool
9037
9038 Test if the given style is set for this window.
9039 """
9040 return _core_.Window_HasFlag(*args, **kwargs)
9041
9042 def IsRetained(*args, **kwargs):
9043 """
9044 IsRetained(self) -> bool
9045
9046 Returns true if the window is retained, false otherwise. Retained
9047 windows are only available on X platforms.
9048 """
9049 return _core_.Window_IsRetained(*args, **kwargs)
9050
9051 def ToggleWindowStyle(*args, **kwargs):
9052 """
9053 ToggleWindowStyle(self, int flag) -> bool
9054
9055 Turn the flag on if it had been turned off before and vice versa,
9056 returns True if the flag is turned on by this function call.
9057 """
9058 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
9059
9060 def SetExtraStyle(*args, **kwargs):
9061 """
9062 SetExtraStyle(self, long exStyle)
9063
9064 Sets the extra style bits for the window. Extra styles are the less
9065 often used style bits which can't be set with the constructor or with
9066 SetWindowStyleFlag()
9067 """
9068 return _core_.Window_SetExtraStyle(*args, **kwargs)
9069
9070 def GetExtraStyle(*args, **kwargs):
9071 """
9072 GetExtraStyle(self) -> long
9073
9074 Returns the extra style bits for the window.
9075 """
9076 return _core_.Window_GetExtraStyle(*args, **kwargs)
9077
9078 def MakeModal(*args, **kwargs):
9079 """
9080 MakeModal(self, bool modal=True)
9081
9082 Disables all other windows in the application so that the user can
9083 only interact with this window. Passing False will reverse this
9084 effect.
9085 """
9086 return _core_.Window_MakeModal(*args, **kwargs)
9087
9088 def SetThemeEnabled(*args, **kwargs):
9089 """
9090 SetThemeEnabled(self, bool enableTheme)
9091
9092 This function tells a window if it should use the system's "theme"
9093 code to draw the windows' background instead if its own background
9094 drawing code. This will only have an effect on platforms that support
9095 the notion of themes in user defined windows. One such platform is
9096 GTK+ where windows can have (very colourful) backgrounds defined by a
9097 user's selected theme.
9098
9099 Dialogs, notebook pages and the status bar have this flag set to true
9100 by default so that the default look and feel is simulated best.
9101 """
9102 return _core_.Window_SetThemeEnabled(*args, **kwargs)
9103
9104 def GetThemeEnabled(*args, **kwargs):
9105 """
9106 GetThemeEnabled(self) -> bool
9107
9108 Return the themeEnabled flag.
9109 """
9110 return _core_.Window_GetThemeEnabled(*args, **kwargs)
9111
9112 def SetFocus(*args, **kwargs):
9113 """
9114 SetFocus(self)
9115
9116 Set's the focus to this window, allowing it to receive keyboard input.
9117 """
9118 return _core_.Window_SetFocus(*args, **kwargs)
9119
9120 def SetFocusFromKbd(*args, **kwargs):
9121 """
9122 SetFocusFromKbd(self)
9123
9124 Set focus to this window as the result of a keyboard action. Normally
9125 only called internally.
9126 """
9127 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
9128
9129 def FindFocus(*args, **kwargs):
9130 """
9131 FindFocus() -> Window
9132
9133 Returns the window or control that currently has the keyboard focus,
9134 or None.
9135 """
9136 return _core_.Window_FindFocus(*args, **kwargs)
9137
9138 FindFocus = staticmethod(FindFocus)
9139 def AcceptsFocus(*args, **kwargs):
9140 """
9141 AcceptsFocus(self) -> bool
9142
9143 Can this window have focus?
9144 """
9145 return _core_.Window_AcceptsFocus(*args, **kwargs)
9146
9147 def CanAcceptFocus(*args, **kwargs):
9148 """
9149 CanAcceptFocus(self) -> bool
9150
9151 Can this window have focus right now?
9152 """
9153 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9154
9155 def AcceptsFocusFromKeyboard(*args, **kwargs):
9156 """
9157 AcceptsFocusFromKeyboard(self) -> bool
9158
9159 Can this window be given focus by keyboard navigation? if not, the
9160 only way to give it focus (provided it accepts it at all) is to click
9161 it.
9162 """
9163 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
9164
9165 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9166 """
9167 CanAcceptFocusFromKeyboard(self) -> bool
9168
9169 Can this window be assigned focus from keyboard right now?
9170 """
9171 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9172
9173 def SetCanFocus(*args, **kwargs):
9174 """SetCanFocus(self, bool canFocus)"""
9175 return _core_.Window_SetCanFocus(*args, **kwargs)
9176
9177 def NavigateIn(*args, **kwargs):
9178 """
9179 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9180
9181 Navigates inside this window.
9182 """
9183 return _core_.Window_NavigateIn(*args, **kwargs)
9184
9185 def Navigate(*args, **kwargs):
9186 """
9187 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9188
9189 Does keyboard navigation starting from this window to another. This is
9190 equivalient to self.GetParent().NavigateIn().
9191 """
9192 return _core_.Window_Navigate(*args, **kwargs)
9193
9194 def MoveAfterInTabOrder(*args, **kwargs):
9195 """
9196 MoveAfterInTabOrder(self, Window win)
9197
9198 Moves this window in the tab navigation order after the specified
9199 sibling window. This means that when the user presses the TAB key on
9200 that other window, the focus switches to this window.
9201
9202 The default tab order is the same as creation order. This function
9203 and `MoveBeforeInTabOrder` allow to change it after creating all the
9204 windows.
9205
9206 """
9207 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
9208
9209 def MoveBeforeInTabOrder(*args, **kwargs):
9210 """
9211 MoveBeforeInTabOrder(self, Window win)
9212
9213 Same as `MoveAfterInTabOrder` except that it inserts this window just
9214 before win instead of putting it right after it.
9215 """
9216 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9217
9218 def GetChildren(*args, **kwargs):
9219 """
9220 GetChildren(self) -> PyObject
9221
9222 Returns a list of the window's children. NOTE: Currently this is a
9223 copy of the child window list maintained by the window, so the return
9224 value of this function is only valid as long as the window's children
9225 do not change.
9226 """
9227 return _core_.Window_GetChildren(*args, **kwargs)
9228
9229 def GetParent(*args, **kwargs):
9230 """
9231 GetParent(self) -> Window
9232
9233 Returns the parent window of this window, or None if there isn't one.
9234 """
9235 return _core_.Window_GetParent(*args, **kwargs)
9236
9237 def GetGrandParent(*args, **kwargs):
9238 """
9239 GetGrandParent(self) -> Window
9240
9241 Returns the parent of the parent of this window, or None if there
9242 isn't one.
9243 """
9244 return _core_.Window_GetGrandParent(*args, **kwargs)
9245
9246 def GetTopLevelParent(*args, **kwargs):
9247 """
9248 GetTopLevelParent(self) -> Window
9249
9250 Returns the first frame or dialog in this window's parental hierarchy.
9251 """
9252 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9253
9254 def IsTopLevel(*args, **kwargs):
9255 """
9256 IsTopLevel(self) -> bool
9257
9258 Returns true if the given window is a top-level one. Currently all
9259 frames and dialogs are always considered to be top-level windows (even
9260 if they have a parent window).
9261 """
9262 return _core_.Window_IsTopLevel(*args, **kwargs)
9263
9264 def Reparent(*args, **kwargs):
9265 """
9266 Reparent(self, Window newParent) -> bool
9267
9268 Reparents the window, i.e the window will be removed from its current
9269 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9270 re-inserted into another. Available on Windows and GTK. Returns True
9271 if the parent was changed, False otherwise (error or newParent ==
9272 oldParent)
9273 """
9274 return _core_.Window_Reparent(*args, **kwargs)
9275
9276 def AddChild(*args, **kwargs):
9277 """
9278 AddChild(self, Window child)
9279
9280 Adds a child window. This is called automatically by window creation
9281 functions so should not be required by the application programmer.
9282 """
9283 return _core_.Window_AddChild(*args, **kwargs)
9284
9285 def RemoveChild(*args, **kwargs):
9286 """
9287 RemoveChild(self, Window child)
9288
9289 Removes a child window. This is called automatically by window
9290 deletion functions so should not be required by the application
9291 programmer.
9292 """
9293 return _core_.Window_RemoveChild(*args, **kwargs)
9294
9295 def SetDoubleBuffered(*args, **kwargs):
9296 """
9297 SetDoubleBuffered(self, bool on)
9298
9299 Currently wxGTK2 only.
9300 """
9301 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9302
9303 def FindWindowById(*args, **kwargs):
9304 """
9305 FindWindowById(self, long winid) -> Window
9306
9307 Find a chld of this window by window ID
9308 """
9309 return _core_.Window_FindWindowById(*args, **kwargs)
9310
9311 def FindWindowByName(*args, **kwargs):
9312 """
9313 FindWindowByName(self, String name) -> Window
9314
9315 Find a child of this window by name
9316 """
9317 return _core_.Window_FindWindowByName(*args, **kwargs)
9318
9319 def GetEventHandler(*args, **kwargs):
9320 """
9321 GetEventHandler(self) -> EvtHandler
9322
9323 Returns the event handler for this window. By default, the window is
9324 its own event handler.
9325 """
9326 return _core_.Window_GetEventHandler(*args, **kwargs)
9327
9328 def SetEventHandler(*args, **kwargs):
9329 """
9330 SetEventHandler(self, EvtHandler handler)
9331
9332 Sets the event handler for this window. An event handler is an object
9333 that is capable of processing the events sent to a window. (In other
9334 words, is able to dispatch the events to handler function.) By
9335 default, the window is its own event handler, but an application may
9336 wish to substitute another, for example to allow central
9337 implementation of event-handling for a variety of different window
9338 classes.
9339
9340 It is usually better to use `wx.Window.PushEventHandler` since this sets
9341 up a chain of event handlers, where an event not handled by one event
9342 handler is handed off to the next one in the chain.
9343 """
9344 return _core_.Window_SetEventHandler(*args, **kwargs)
9345
9346 def PushEventHandler(*args, **kwargs):
9347 """
9348 PushEventHandler(self, EvtHandler handler)
9349
9350 Pushes this event handler onto the event handler stack for the window.
9351 An event handler is an object that is capable of processing the events
9352 sent to a window. (In other words, is able to dispatch the events to
9353 handler function.) By default, the window is its own event handler,
9354 but an application may wish to substitute another, for example to
9355 allow central implementation of event-handling for a variety of
9356 different window classes.
9357
9358 wx.Window.PushEventHandler allows an application to set up a chain of
9359 event handlers, where an event not handled by one event handler is
9360 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9361 to remove the event handler. Ownership of the handler is *not* given
9362 to the window, so you should be sure to pop the handler before the
9363 window is destroyed and either let PopEventHandler destroy it, or call
9364 its Destroy method yourself.
9365 """
9366 return _core_.Window_PushEventHandler(*args, **kwargs)
9367
9368 def PopEventHandler(*args, **kwargs):
9369 """
9370 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9371
9372 Removes and returns the top-most event handler on the event handler
9373 stack. If deleteHandler is True then the wx.EvtHandler object will be
9374 destroyed after it is popped, and ``None`` will be returned instead.
9375 """
9376 return _core_.Window_PopEventHandler(*args, **kwargs)
9377
9378 def RemoveEventHandler(*args, **kwargs):
9379 """
9380 RemoveEventHandler(self, EvtHandler handler) -> bool
9381
9382 Find the given handler in the event handler chain and remove (but not
9383 delete) it from the event handler chain, returns True if it was found
9384 and False otherwise (this also results in an assert failure so this
9385 function should only be called when the handler is supposed to be
9386 there.)
9387 """
9388 return _core_.Window_RemoveEventHandler(*args, **kwargs)
9389
9390 def SetValidator(*args, **kwargs):
9391 """
9392 SetValidator(self, Validator validator)
9393
9394 Deletes the current validator (if any) and sets the window validator,
9395 having called wx.Validator.Clone to create a new validator of this
9396 type.
9397 """
9398 return _core_.Window_SetValidator(*args, **kwargs)
9399
9400 def GetValidator(*args, **kwargs):
9401 """
9402 GetValidator(self) -> Validator
9403
9404 Returns a pointer to the current validator for the window, or None if
9405 there is none.
9406 """
9407 return _core_.Window_GetValidator(*args, **kwargs)
9408
9409 def Validate(*args, **kwargs):
9410 """
9411 Validate(self) -> bool
9412
9413 Validates the current values of the child controls using their
9414 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9415 style flag set, the method will also call Validate() of all child
9416 windows. Returns false if any of the validations failed.
9417 """
9418 return _core_.Window_Validate(*args, **kwargs)
9419
9420 def TransferDataToWindow(*args, **kwargs):
9421 """
9422 TransferDataToWindow(self) -> bool
9423
9424 Transfers values to child controls from data areas specified by their
9425 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9426 style flag set, the method will also call TransferDataToWindow() of
9427 all child windows.
9428 """
9429 return _core_.Window_TransferDataToWindow(*args, **kwargs)
9430
9431 def TransferDataFromWindow(*args, **kwargs):
9432 """
9433 TransferDataFromWindow(self) -> bool
9434
9435 Transfers values from child controls to data areas specified by their
9436 validators. Returns false if a transfer failed. If the window has
9437 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9438 also call TransferDataFromWindow() of all child windows.
9439 """
9440 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
9441
9442 def InitDialog(*args, **kwargs):
9443 """
9444 InitDialog(self)
9445
9446 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9447 to the dialog via validators.
9448 """
9449 return _core_.Window_InitDialog(*args, **kwargs)
9450
9451 def SetAcceleratorTable(*args, **kwargs):
9452 """
9453 SetAcceleratorTable(self, AcceleratorTable accel)
9454
9455 Sets the accelerator table for this window.
9456 """
9457 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9458
9459 def GetAcceleratorTable(*args, **kwargs):
9460 """
9461 GetAcceleratorTable(self) -> AcceleratorTable
9462
9463 Gets the accelerator table for this window.
9464 """
9465 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9466
9467 def RegisterHotKey(*args, **kwargs):
9468 """
9469 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9470
9471 Registers a system wide hotkey. Every time the user presses the hotkey
9472 registered here, this window will receive a hotkey event. It will
9473 receive the event even if the application is in the background and
9474 does not have the input focus because the user is working with some
9475 other application. To bind an event handler function to this hotkey
9476 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9477 hotkey was registered successfully.
9478 """
9479 return _core_.Window_RegisterHotKey(*args, **kwargs)
9480
9481 def UnregisterHotKey(*args, **kwargs):
9482 """
9483 UnregisterHotKey(self, int hotkeyId) -> bool
9484
9485 Unregisters a system wide hotkey.
9486 """
9487 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9488
9489 def ConvertDialogPointToPixels(*args, **kwargs):
9490 """
9491 ConvertDialogPointToPixels(self, Point pt) -> Point
9492
9493 Converts a point or size from dialog units to pixels. Dialog units
9494 are used for maintaining a dialog's proportions even if the font
9495 changes. For the x dimension, the dialog units are multiplied by the
9496 average character width and then divided by 4. For the y dimension,
9497 the dialog units are multiplied by the average character height and
9498 then divided by 8.
9499 """
9500 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9501
9502 def ConvertDialogSizeToPixels(*args, **kwargs):
9503 """
9504 ConvertDialogSizeToPixels(self, Size sz) -> Size
9505
9506 Converts a point or size from dialog units to pixels. Dialog units
9507 are used for maintaining a dialog's proportions even if the font
9508 changes. For the x dimension, the dialog units are multiplied by the
9509 average character width and then divided by 4. For the y dimension,
9510 the dialog units are multiplied by the average character height and
9511 then divided by 8.
9512 """
9513 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9514
9515 def DLG_PNT(*args, **kwargs):
9516 """
9517 DLG_PNT(self, Point pt) -> Point
9518
9519 Converts a point or size from dialog units to pixels. Dialog units
9520 are used for maintaining a dialog's proportions even if the font
9521 changes. For the x dimension, the dialog units are multiplied by the
9522 average character width and then divided by 4. For the y dimension,
9523 the dialog units are multiplied by the average character height and
9524 then divided by 8.
9525 """
9526 return _core_.Window_DLG_PNT(*args, **kwargs)
9527
9528 def DLG_SZE(*args, **kwargs):
9529 """
9530 DLG_SZE(self, Size sz) -> Size
9531
9532 Converts a point or size from dialog units to pixels. Dialog units
9533 are used for maintaining a dialog's proportions even if the font
9534 changes. For the x dimension, the dialog units are multiplied by the
9535 average character width and then divided by 4. For the y dimension,
9536 the dialog units are multiplied by the average character height and
9537 then divided by 8.
9538 """
9539 return _core_.Window_DLG_SZE(*args, **kwargs)
9540
9541 def ConvertPixelPointToDialog(*args, **kwargs):
9542 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9543 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9544
9545 def ConvertPixelSizeToDialog(*args, **kwargs):
9546 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9547 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9548
9549 def WarpPointer(*args, **kwargs):
9550 """
9551 WarpPointer(self, int x, int y)
9552
9553 Moves the pointer to the given position on the window.
9554
9555 NOTE: This function is not supported under Mac because Apple Human
9556 Interface Guidelines forbid moving the mouse cursor programmatically.
9557 """
9558 return _core_.Window_WarpPointer(*args, **kwargs)
9559
9560 def CaptureMouse(*args, **kwargs):
9561 """
9562 CaptureMouse(self)
9563
9564 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9565 release the capture.
9566
9567 Note that wxWindows maintains the stack of windows having captured the
9568 mouse and when the mouse is released the capture returns to the window
9569 which had had captured it previously and it is only really released if
9570 there were no previous window. In particular, this means that you must
9571 release the mouse as many times as you capture it, unless the window
9572 receives the `wx.MouseCaptureLostEvent` event.
9573
9574 Any application which captures the mouse in the beginning of some
9575 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9576 operation when it receives the event. The event handler must not
9577 recapture mouse.
9578 """
9579 return _core_.Window_CaptureMouse(*args, **kwargs)
9580
9581 def ReleaseMouse(*args, **kwargs):
9582 """
9583 ReleaseMouse(self)
9584
9585 Releases mouse input captured with wx.Window.CaptureMouse.
9586 """
9587 return _core_.Window_ReleaseMouse(*args, **kwargs)
9588
9589 def GetCapture(*args, **kwargs):
9590 """
9591 GetCapture() -> Window
9592
9593 Returns the window which currently captures the mouse or None
9594 """
9595 return _core_.Window_GetCapture(*args, **kwargs)
9596
9597 GetCapture = staticmethod(GetCapture)
9598 def HasCapture(*args, **kwargs):
9599 """
9600 HasCapture(self) -> bool
9601
9602 Returns true if this window has the current mouse capture.
9603 """
9604 return _core_.Window_HasCapture(*args, **kwargs)
9605
9606 def Refresh(*args, **kwargs):
9607 """
9608 Refresh(self, bool eraseBackground=True, Rect rect=None)
9609
9610 Mark the specified rectangle (or the whole window) as "dirty" so it
9611 will be repainted. Causes an EVT_PAINT event to be generated and sent
9612 to the window.
9613 """
9614 return _core_.Window_Refresh(*args, **kwargs)
9615
9616 def RefreshRect(*args, **kwargs):
9617 """
9618 RefreshRect(self, Rect rect, bool eraseBackground=True)
9619
9620 Redraws the contents of the given rectangle: the area inside it will
9621 be repainted. This is the same as Refresh but has a nicer syntax.
9622 """
9623 return _core_.Window_RefreshRect(*args, **kwargs)
9624
9625 def Update(*args, **kwargs):
9626 """
9627 Update(self)
9628
9629 Calling this method immediately repaints the invalidated area of the
9630 window instead of waiting for the EVT_PAINT event to happen, (normally
9631 this would usually only happen when the flow of control returns to the
9632 event loop.) Notice that this function doesn't refresh the window and
9633 does nothing if the window has been already repainted. Use `Refresh`
9634 first if you want to immediately redraw the window (or some portion of
9635 it) unconditionally.
9636 """
9637 return _core_.Window_Update(*args, **kwargs)
9638
9639 def ClearBackground(*args, **kwargs):
9640 """
9641 ClearBackground(self)
9642
9643 Clears the window by filling it with the current background
9644 colour. Does not cause an erase background event to be generated.
9645 """
9646 return _core_.Window_ClearBackground(*args, **kwargs)
9647
9648 def Freeze(*args, **kwargs):
9649 """
9650 Freeze(self)
9651
9652 Freezes the window or, in other words, prevents any updates from
9653 taking place on screen, the window is not redrawn at all. Thaw must be
9654 called to reenable window redrawing. Calls to Freeze/Thaw may be
9655 nested, with the actual Thaw being delayed until all the nesting has
9656 been undone.
9657
9658 This method is useful for visual appearance optimization (for example,
9659 it is a good idea to use it before inserting large amount of text into
9660 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9661 for all controls so it is mostly just a hint to wxWindows and not a
9662 mandatory directive.
9663 """
9664 return _core_.Window_Freeze(*args, **kwargs)
9665
9666 def IsFrozen(*args, **kwargs):
9667 """
9668 IsFrozen(self) -> bool
9669
9670 Returns ``True`` if the window has been frozen and not thawed yet.
9671
9672 :see: `Freeze` and `Thaw`
9673 """
9674 return _core_.Window_IsFrozen(*args, **kwargs)
9675
9676 def Thaw(*args, **kwargs):
9677 """
9678 Thaw(self)
9679
9680 Reenables window updating after a previous call to Freeze. Calls to
9681 Freeze/Thaw may be nested, so Thaw must be called the same number of
9682 times that Freeze was before the window will be updated.
9683 """
9684 return _core_.Window_Thaw(*args, **kwargs)
9685
9686 def PrepareDC(*args, **kwargs):
9687 """
9688 PrepareDC(self, DC dc)
9689
9690 Call this function to prepare the device context for drawing a
9691 scrolled image. It sets the device origin according to the current
9692 scroll position.
9693 """
9694 return _core_.Window_PrepareDC(*args, **kwargs)
9695
9696 def IsDoubleBuffered(*args, **kwargs):
9697 """
9698 IsDoubleBuffered(self) -> bool
9699
9700 Returns ``True`` if the window contents is double-buffered by the
9701 system, i.e. if any drawing done on the window is really done on a
9702 temporary backing surface and transferred to the screen all at once
9703 later.
9704 """
9705 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9706
9707 def GetUpdateRegion(*args, **kwargs):
9708 """
9709 GetUpdateRegion(self) -> Region
9710
9711 Returns the region specifying which parts of the window have been
9712 damaged. Should only be called within an EVT_PAINT handler.
9713 """
9714 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9715
9716 def GetUpdateClientRect(*args, **kwargs):
9717 """
9718 GetUpdateClientRect(self) -> Rect
9719
9720 Get the update rectangle region bounding box in client coords.
9721 """
9722 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9723
9724 def IsExposed(*args, **kwargs):
9725 """
9726 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9727
9728 Returns true if the given point or rectangle area has been exposed
9729 since the last repaint. Call this in an paint event handler to
9730 optimize redrawing by only redrawing those areas, which have been
9731 exposed.
9732 """
9733 return _core_.Window_IsExposed(*args, **kwargs)
9734
9735 def IsExposedPoint(*args, **kwargs):
9736 """
9737 IsExposedPoint(self, Point pt) -> bool
9738
9739 Returns true if the given point or rectangle area has been exposed
9740 since the last repaint. Call this in an paint event handler to
9741 optimize redrawing by only redrawing those areas, which have been
9742 exposed.
9743 """
9744 return _core_.Window_IsExposedPoint(*args, **kwargs)
9745
9746 def IsExposedRect(*args, **kwargs):
9747 """
9748 IsExposedRect(self, Rect rect) -> bool
9749
9750 Returns true if the given point or rectangle area has been exposed
9751 since the last repaint. Call this in an paint event handler to
9752 optimize redrawing by only redrawing those areas, which have been
9753 exposed.
9754 """
9755 return _core_.Window_IsExposedRect(*args, **kwargs)
9756
9757 def GetDefaultAttributes(*args, **kwargs):
9758 """
9759 GetDefaultAttributes(self) -> VisualAttributes
9760
9761 Get the default attributes for an instance of this class. This is
9762 useful if you want to use the same font or colour in your own control
9763 as in a standard control -- which is a much better idea than hard
9764 coding specific colours or fonts which might look completely out of
9765 place on the user's system, especially if it uses themes.
9766 """
9767 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9768
9769 def GetClassDefaultAttributes(*args, **kwargs):
9770 """
9771 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9772
9773 Get the default attributes for this class. This is useful if you want
9774 to use the same font or colour in your own control as in a standard
9775 control -- which is a much better idea than hard coding specific
9776 colours or fonts which might look completely out of place on the
9777 user's system, especially if it uses themes.
9778
9779 The variant parameter is only relevant under Mac currently and is
9780 ignore under other platforms. Under Mac, it will change the size of
9781 the returned font. See `wx.Window.SetWindowVariant` for more about
9782 this.
9783 """
9784 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9785
9786 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9787 def SetBackgroundColour(*args, **kwargs):
9788 """
9789 SetBackgroundColour(self, Colour colour) -> bool
9790
9791 Sets the background colour of the window. Returns True if the colour
9792 was changed. The background colour is usually painted by the default
9793 EVT_ERASE_BACKGROUND event handler function under Windows and
9794 automatically under GTK. Using `wx.NullColour` will reset the window
9795 to the default background colour.
9796
9797 Note that setting the background colour may not cause an immediate
9798 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9799 calling this function.
9800
9801 Using this function will disable attempts to use themes for this
9802 window, if the system supports them. Use with care since usually the
9803 themes represent the appearance chosen by the user to be used for all
9804 applications on the system.
9805 """
9806 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9807
9808 def SetOwnBackgroundColour(*args, **kwargs):
9809 """SetOwnBackgroundColour(self, Colour colour)"""
9810 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9811
9812 def SetForegroundColour(*args, **kwargs):
9813 """
9814 SetForegroundColour(self, Colour colour) -> bool
9815
9816 Sets the foreground colour of the window. Returns True is the colour
9817 was changed. The interpretation of foreground colour is dependent on
9818 the window class; it may be the text colour or other colour, or it may
9819 not be used at all.
9820 """
9821 return _core_.Window_SetForegroundColour(*args, **kwargs)
9822
9823 def SetOwnForegroundColour(*args, **kwargs):
9824 """SetOwnForegroundColour(self, Colour colour)"""
9825 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9826
9827 def GetBackgroundColour(*args, **kwargs):
9828 """
9829 GetBackgroundColour(self) -> Colour
9830
9831 Returns the background colour of the window.
9832 """
9833 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9834
9835 def GetForegroundColour(*args, **kwargs):
9836 """
9837 GetForegroundColour(self) -> Colour
9838
9839 Returns the foreground colour of the window. The interpretation of
9840 foreground colour is dependent on the window class; it may be the text
9841 colour or other colour, or it may not be used at all.
9842 """
9843 return _core_.Window_GetForegroundColour(*args, **kwargs)
9844
9845 def InheritsBackgroundColour(*args, **kwargs):
9846 """InheritsBackgroundColour(self) -> bool"""
9847 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9848
9849 def UseBgCol(*args, **kwargs):
9850 """UseBgCol(self) -> bool"""
9851 return _core_.Window_UseBgCol(*args, **kwargs)
9852
9853 def SetBackgroundStyle(*args, **kwargs):
9854 """
9855 SetBackgroundStyle(self, int style) -> bool
9856
9857 Returns the background style of the window. The background style
9858 indicates how the background of the window is drawn.
9859
9860 ====================== ========================================
9861 wx.BG_STYLE_SYSTEM The background colour or pattern should
9862 be determined by the system
9863 wx.BG_STYLE_COLOUR The background should be a solid colour
9864 wx.BG_STYLE_CUSTOM The background will be implemented by the
9865 application.
9866 ====================== ========================================
9867
9868 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9869 a custom background, such as a tiled bitmap. Currently the style has
9870 no effect on other platforms.
9871
9872 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9873 """
9874 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9875
9876 def GetBackgroundStyle(*args, **kwargs):
9877 """
9878 GetBackgroundStyle(self) -> int
9879
9880 Returns the background style of the window.
9881
9882 :see: `SetBackgroundStyle`
9883 """
9884 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9885
9886 def HasTransparentBackground(*args, **kwargs):
9887 """
9888 HasTransparentBackground(self) -> bool
9889
9890 Returns True if this window's background is transparent (as, for
9891 example, for `wx.StaticText`) and should show the parent window's
9892 background.
9893
9894 This method is mostly used internally by the library itself and you
9895 normally shouldn't have to call it. You may, however, have to override
9896 it in your custom control classes to ensure that background is painted
9897 correctly.
9898 """
9899 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9900
9901 def SetCursor(*args, **kwargs):
9902 """
9903 SetCursor(self, Cursor cursor) -> bool
9904
9905 Sets the window's cursor. Notice that the window cursor also sets it
9906 for the children of the window implicitly.
9907
9908 The cursor may be wx.NullCursor in which case the window cursor will
9909 be reset back to default.
9910 """
9911 return _core_.Window_SetCursor(*args, **kwargs)
9912
9913 def GetCursor(*args, **kwargs):
9914 """
9915 GetCursor(self) -> Cursor
9916
9917 Return the cursor associated with this window.
9918 """
9919 return _core_.Window_GetCursor(*args, **kwargs)
9920
9921 def SetFont(*args, **kwargs):
9922 """
9923 SetFont(self, Font font) -> bool
9924
9925 Sets the font for this window.
9926 """
9927 return _core_.Window_SetFont(*args, **kwargs)
9928
9929 def SetOwnFont(*args, **kwargs):
9930 """SetOwnFont(self, Font font)"""
9931 return _core_.Window_SetOwnFont(*args, **kwargs)
9932
9933 def GetFont(*args, **kwargs):
9934 """
9935 GetFont(self) -> Font
9936
9937 Returns the default font used for this window.
9938 """
9939 return _core_.Window_GetFont(*args, **kwargs)
9940
9941 def SetCaret(*args, **kwargs):
9942 """
9943 SetCaret(self, Caret caret)
9944
9945 Sets the caret associated with the window.
9946 """
9947 return _core_.Window_SetCaret(*args, **kwargs)
9948
9949 def GetCaret(*args, **kwargs):
9950 """
9951 GetCaret(self) -> Caret
9952
9953 Returns the caret associated with the window.
9954 """
9955 return _core_.Window_GetCaret(*args, **kwargs)
9956
9957 def GetCharHeight(*args, **kwargs):
9958 """
9959 GetCharHeight(self) -> int
9960
9961 Get the (average) character size for the current font.
9962 """
9963 return _core_.Window_GetCharHeight(*args, **kwargs)
9964
9965 def GetCharWidth(*args, **kwargs):
9966 """
9967 GetCharWidth(self) -> int
9968
9969 Get the (average) character size for the current font.
9970 """
9971 return _core_.Window_GetCharWidth(*args, **kwargs)
9972
9973 def GetTextExtent(*args, **kwargs):
9974 """
9975 GetTextExtent(String string) -> (width, height)
9976
9977 Get the width and height of the text using the current font.
9978 """
9979 return _core_.Window_GetTextExtent(*args, **kwargs)
9980
9981 def GetFullTextExtent(*args, **kwargs):
9982 """
9983 GetFullTextExtent(String string, Font font=None) ->
9984 (width, height, descent, externalLeading)
9985
9986 Get the width, height, decent and leading of the text using the
9987 current or specified font.
9988 """
9989 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9990
9991 def ClientToScreenXY(*args, **kwargs):
9992 """
9993 ClientToScreenXY(int x, int y) -> (x,y)
9994
9995 Converts to screen coordinates from coordinates relative to this window.
9996 """
9997 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9998
9999 def ScreenToClientXY(*args, **kwargs):
10000 """
10001 ScreenToClientXY(int x, int y) -> (x,y)
10002
10003 Converts from screen to client window coordinates.
10004 """
10005 return _core_.Window_ScreenToClientXY(*args, **kwargs)
10006
10007 def ClientToScreen(*args, **kwargs):
10008 """
10009 ClientToScreen(self, Point pt) -> Point
10010
10011 Converts to screen coordinates from coordinates relative to this window.
10012 """
10013 return _core_.Window_ClientToScreen(*args, **kwargs)
10014
10015 def ScreenToClient(*args, **kwargs):
10016 """
10017 ScreenToClient(self, Point pt) -> Point
10018
10019 Converts from screen to client window coordinates.
10020 """
10021 return _core_.Window_ScreenToClient(*args, **kwargs)
10022
10023 def HitTestXY(*args, **kwargs):
10024 """
10025 HitTestXY(self, int x, int y) -> int
10026
10027 Test where the given (in client coords) point lies
10028 """
10029 return _core_.Window_HitTestXY(*args, **kwargs)
10030
10031 def HitTest(*args, **kwargs):
10032 """
10033 HitTest(self, Point pt) -> int
10034
10035 Test where the given (in client coords) point lies
10036 """
10037 return _core_.Window_HitTest(*args, **kwargs)
10038
10039 def GetBorder(*args):
10040 """
10041 GetBorder(self, long flags) -> int
10042 GetBorder(self) -> int
10043
10044 Get border for the flags of this window
10045 """
10046 return _core_.Window_GetBorder(*args)
10047
10048 def UpdateWindowUI(*args, **kwargs):
10049 """
10050 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
10051
10052 This function sends EVT_UPDATE_UI events to the window. The particular
10053 implementation depends on the window; for example a wx.ToolBar will
10054 send an update UI event for each toolbar button, and a wx.Frame will
10055 send an update UI event for each menubar menu item. You can call this
10056 function from your application to ensure that your UI is up-to-date at
10057 a particular point in time (as far as your EVT_UPDATE_UI handlers are
10058 concerned). This may be necessary if you have called
10059 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
10060 limit the overhead that wxWindows incurs by sending update UI events
10061 in idle time.
10062 """
10063 return _core_.Window_UpdateWindowUI(*args, **kwargs)
10064
10065 def PopupMenuXY(*args, **kwargs):
10066 """
10067 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
10068
10069 Pops up the given menu at the specified coordinates, relative to this window,
10070 and returns control when the user has dismissed the menu. If a menu item is
10071 selected, the corresponding menu event is generated and will be processed as
10072 usual. If the default position is given then the current position of the
10073 mouse cursor will be used.
10074 """
10075 return _core_.Window_PopupMenuXY(*args, **kwargs)
10076
10077 def PopupMenu(*args, **kwargs):
10078 """
10079 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
10080
10081 Pops up the given menu at the specified coordinates, relative to this window,
10082 and returns control when the user has dismissed the menu. If a menu item is
10083 selected, the corresponding menu event is generated and will be processed as
10084 usual. If the default position is given then the current position of the
10085 mouse cursor will be used.
10086 """
10087 return _core_.Window_PopupMenu(*args, **kwargs)
10088
10089 def HasMultiplePages(*args, **kwargs):
10090 """HasMultiplePages(self) -> bool"""
10091 return _core_.Window_HasMultiplePages(*args, **kwargs)
10092
10093 def GetHandle(*args, **kwargs):
10094 """
10095 GetHandle(self) -> long
10096
10097 Returns the platform-specific handle (as a long integer) of the
10098 physical window. Currently on wxMac it returns the handle of the
10099 toplevel parent of the window.
10100 """
10101 return _core_.Window_GetHandle(*args, **kwargs)
10102
10103 def AssociateHandle(*args, **kwargs):
10104 """
10105 AssociateHandle(self, long handle)
10106
10107 Associate the window with a new native handle
10108 """
10109 return _core_.Window_AssociateHandle(*args, **kwargs)
10110
10111 def DissociateHandle(*args, **kwargs):
10112 """
10113 DissociateHandle(self)
10114
10115 Dissociate the current native handle from the window
10116 """
10117 return _core_.Window_DissociateHandle(*args, **kwargs)
10118
10119 def HasScrollbar(*args, **kwargs):
10120 """
10121 HasScrollbar(self, int orient) -> bool
10122
10123 Does the window have the scrollbar for this orientation?
10124 """
10125 return _core_.Window_HasScrollbar(*args, **kwargs)
10126
10127 def SetScrollbar(*args, **kwargs):
10128 """
10129 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
10130 bool refresh=True)
10131
10132 Sets the scrollbar properties of a built-in scrollbar.
10133 """
10134 return _core_.Window_SetScrollbar(*args, **kwargs)
10135
10136 def SetScrollPos(*args, **kwargs):
10137 """
10138 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10139
10140 Sets the position of one of the built-in scrollbars.
10141 """
10142 return _core_.Window_SetScrollPos(*args, **kwargs)
10143
10144 def GetScrollPos(*args, **kwargs):
10145 """
10146 GetScrollPos(self, int orientation) -> int
10147
10148 Returns the built-in scrollbar position.
10149 """
10150 return _core_.Window_GetScrollPos(*args, **kwargs)
10151
10152 def GetScrollThumb(*args, **kwargs):
10153 """
10154 GetScrollThumb(self, int orientation) -> int
10155
10156 Returns the built-in scrollbar thumb size.
10157 """
10158 return _core_.Window_GetScrollThumb(*args, **kwargs)
10159
10160 def GetScrollRange(*args, **kwargs):
10161 """
10162 GetScrollRange(self, int orientation) -> int
10163
10164 Returns the built-in scrollbar range.
10165 """
10166 return _core_.Window_GetScrollRange(*args, **kwargs)
10167
10168 def ScrollWindow(*args, **kwargs):
10169 """
10170 ScrollWindow(self, int dx, int dy, Rect rect=None)
10171
10172 Physically scrolls the pixels in the window and move child windows
10173 accordingly. Use this function to optimise your scrolling
10174 implementations, to minimise the area that must be redrawn. Note that
10175 it is rarely required to call this function from a user program.
10176 """
10177 return _core_.Window_ScrollWindow(*args, **kwargs)
10178
10179 def ScrollLines(*args, **kwargs):
10180 """
10181 ScrollLines(self, int lines) -> bool
10182
10183 If the platform and window class supports it, scrolls the window by
10184 the given number of lines down, if lines is positive, or up if lines
10185 is negative. Returns True if the window was scrolled, False if it was
10186 already on top/bottom and nothing was done.
10187 """
10188 return _core_.Window_ScrollLines(*args, **kwargs)
10189
10190 def ScrollPages(*args, **kwargs):
10191 """
10192 ScrollPages(self, int pages) -> bool
10193
10194 If the platform and window class supports it, scrolls the window by
10195 the given number of pages down, if pages is positive, or up if pages
10196 is negative. Returns True if the window was scrolled, False if it was
10197 already on top/bottom and nothing was done.
10198 """
10199 return _core_.Window_ScrollPages(*args, **kwargs)
10200
10201 def LineUp(*args, **kwargs):
10202 """
10203 LineUp(self) -> bool
10204
10205 This is just a wrapper for ScrollLines(-1).
10206 """
10207 return _core_.Window_LineUp(*args, **kwargs)
10208
10209 def LineDown(*args, **kwargs):
10210 """
10211 LineDown(self) -> bool
10212
10213 This is just a wrapper for ScrollLines(1).
10214 """
10215 return _core_.Window_LineDown(*args, **kwargs)
10216
10217 def PageUp(*args, **kwargs):
10218 """
10219 PageUp(self) -> bool
10220
10221 This is just a wrapper for ScrollPages(-1).
10222 """
10223 return _core_.Window_PageUp(*args, **kwargs)
10224
10225 def PageDown(*args, **kwargs):
10226 """
10227 PageDown(self) -> bool
10228
10229 This is just a wrapper for ScrollPages(1).
10230 """
10231 return _core_.Window_PageDown(*args, **kwargs)
10232
10233 def SetHelpText(*args, **kwargs):
10234 """
10235 SetHelpText(self, String text)
10236
10237 Sets the help text to be used as context-sensitive help for this
10238 window. Note that the text is actually stored by the current
10239 `wx.HelpProvider` implementation, and not in the window object itself.
10240 """
10241 return _core_.Window_SetHelpText(*args, **kwargs)
10242
10243 def SetHelpTextForId(*args, **kwargs):
10244 """
10245 SetHelpTextForId(self, String text)
10246
10247 Associate this help text with all windows with the same id as this
10248 one.
10249 """
10250 return _core_.Window_SetHelpTextForId(*args, **kwargs)
10251
10252 def GetHelpTextAtPoint(*args, **kwargs):
10253 """
10254 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10255
10256 Get the help string associated with the given position in this window.
10257
10258 Notice that pt may be invalid if event origin is keyboard or unknown
10259 and this method should return the global window help text then
10260
10261 """
10262 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10263
10264 def GetHelpText(*args, **kwargs):
10265 """
10266 GetHelpText(self) -> String
10267
10268 Gets the help text to be used as context-sensitive help for this
10269 window. Note that the text is actually stored by the current
10270 `wx.HelpProvider` implementation, and not in the window object itself.
10271 """
10272 return _core_.Window_GetHelpText(*args, **kwargs)
10273
10274 def SetToolTipString(*args, **kwargs):
10275 """
10276 SetToolTipString(self, String tip)
10277
10278 Attach a tooltip to the window.
10279 """
10280 return _core_.Window_SetToolTipString(*args, **kwargs)
10281
10282 def SetToolTip(*args, **kwargs):
10283 """
10284 SetToolTip(self, ToolTip tip)
10285
10286 Attach a tooltip to the window.
10287 """
10288 return _core_.Window_SetToolTip(*args, **kwargs)
10289
10290 def GetToolTip(*args, **kwargs):
10291 """
10292 GetToolTip(self) -> ToolTip
10293
10294 get the associated tooltip or None if none
10295 """
10296 return _core_.Window_GetToolTip(*args, **kwargs)
10297
10298 def SetDropTarget(*args, **kwargs):
10299 """
10300 SetDropTarget(self, DropTarget dropTarget)
10301
10302 Associates a drop target with this window. If the window already has
10303 a drop target, it is deleted.
10304 """
10305 return _core_.Window_SetDropTarget(*args, **kwargs)
10306
10307 def GetDropTarget(*args, **kwargs):
10308 """
10309 GetDropTarget(self) -> DropTarget
10310
10311 Returns the associated drop target, which may be None.
10312 """
10313 return _core_.Window_GetDropTarget(*args, **kwargs)
10314
10315 def DragAcceptFiles(*args, **kwargs):
10316 """
10317 DragAcceptFiles(self, bool accept)
10318
10319 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10320 Only functional on Windows.
10321 """
10322 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10323
10324 def SetConstraints(*args, **kwargs):
10325 """
10326 SetConstraints(self, LayoutConstraints constraints)
10327
10328 Sets the window to have the given layout constraints. If an existing
10329 layout constraints object is already owned by the window, it will be
10330 deleted. Pass None to disassociate and delete the window's current
10331 constraints.
10332
10333 You must call SetAutoLayout to tell a window to use the constraints
10334 automatically in its default EVT_SIZE handler; otherwise, you must
10335 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10336 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10337 effect.
10338 """
10339 return _core_.Window_SetConstraints(*args, **kwargs)
10340
10341 def GetConstraints(*args, **kwargs):
10342 """
10343 GetConstraints(self) -> LayoutConstraints
10344
10345 Returns a pointer to the window's layout constraints, or None if there
10346 are none.
10347 """
10348 return _core_.Window_GetConstraints(*args, **kwargs)
10349
10350 def SetAutoLayout(*args, **kwargs):
10351 """
10352 SetAutoLayout(self, bool autoLayout)
10353
10354 Determines whether the Layout function will be called automatically
10355 when the window is resized. lease note that this only happens for the
10356 windows usually used to contain children, namely `wx.Panel` and
10357 `wx.TopLevelWindow` (and the classes deriving from them).
10358
10359 This method is called implicitly by `SetSizer` but if you use
10360 `SetConstraints` you should call it manually or otherwise the window
10361 layout won't be correctly updated when its size changes.
10362 """
10363 return _core_.Window_SetAutoLayout(*args, **kwargs)
10364
10365 def GetAutoLayout(*args, **kwargs):
10366 """
10367 GetAutoLayout(self) -> bool
10368
10369 Returns the current autoLayout setting
10370 """
10371 return _core_.Window_GetAutoLayout(*args, **kwargs)
10372
10373 def Layout(*args, **kwargs):
10374 """
10375 Layout(self) -> bool
10376
10377 Invokes the constraint-based layout algorithm or the sizer-based
10378 algorithm for this window. See SetAutoLayout: when auto layout is on,
10379 this function gets called automatically by the default EVT_SIZE
10380 handler when the window is resized.
10381 """
10382 return _core_.Window_Layout(*args, **kwargs)
10383
10384 def SetSizer(*args, **kwargs):
10385 """
10386 SetSizer(self, Sizer sizer, bool deleteOld=True)
10387
10388 Sets the window to have the given layout sizer. The window will then
10389 own the object, and will take care of its deletion. If an existing
10390 layout sizer object is already owned by the window, it will be deleted
10391 if the deleteOld parameter is true. Note that this function will also
10392 call SetAutoLayout implicitly with a True parameter if the sizer is
10393 non-None, and False otherwise.
10394 """
10395 return _core_.Window_SetSizer(*args, **kwargs)
10396
10397 def SetSizerAndFit(*args, **kwargs):
10398 """
10399 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10400
10401 The same as SetSizer, except it also sets the size hints for the
10402 window based on the sizer's minimum size.
10403 """
10404 return _core_.Window_SetSizerAndFit(*args, **kwargs)
10405
10406 def GetSizer(*args, **kwargs):
10407 """
10408 GetSizer(self) -> Sizer
10409
10410 Return the sizer associated with the window by a previous call to
10411 SetSizer or None if there isn't one.
10412 """
10413 return _core_.Window_GetSizer(*args, **kwargs)
10414
10415 def SetContainingSizer(*args, **kwargs):
10416 """
10417 SetContainingSizer(self, Sizer sizer)
10418
10419 This normally does not need to be called by application code. It is
10420 called internally when a window is added to a sizer, and is used so
10421 the window can remove itself from the sizer when it is destroyed.
10422 """
10423 return _core_.Window_SetContainingSizer(*args, **kwargs)
10424
10425 def GetContainingSizer(*args, **kwargs):
10426 """
10427 GetContainingSizer(self) -> Sizer
10428
10429 Return the sizer that this window is a member of, if any, otherwise None.
10430 """
10431 return _core_.Window_GetContainingSizer(*args, **kwargs)
10432
10433 def InheritAttributes(*args, **kwargs):
10434 """
10435 InheritAttributes(self)
10436
10437 This function is (or should be, in case of custom controls) called
10438 during window creation to intelligently set up the window visual
10439 attributes, that is the font and the foreground and background
10440 colours.
10441
10442 By 'intelligently' the following is meant: by default, all windows use
10443 their own default attributes. However if some of the parent's
10444 attributes are explicitly changed (that is, using SetFont and not
10445 SetOwnFont) and if the corresponding attribute hadn't been
10446 explicitly set for this window itself, then this window takes the same
10447 value as used by the parent. In addition, if the window overrides
10448 ShouldInheritColours to return false, the colours will not be changed
10449 no matter what and only the font might.
10450
10451 This rather complicated logic is necessary in order to accommodate the
10452 different usage scenarios. The most common one is when all default
10453 attributes are used and in this case, nothing should be inherited as
10454 in modern GUIs different controls use different fonts (and colours)
10455 than their siblings so they can't inherit the same value from the
10456 parent. However it was also deemed desirable to allow to simply change
10457 the attributes of all children at once by just changing the font or
10458 colour of their common parent, hence in this case we do inherit the
10459 parents attributes.
10460
10461 """
10462 return _core_.Window_InheritAttributes(*args, **kwargs)
10463
10464 def ShouldInheritColours(*args, **kwargs):
10465 """
10466 ShouldInheritColours(self) -> bool
10467
10468 Return true from here to allow the colours of this window to be
10469 changed by InheritAttributes, returning false forbids inheriting them
10470 from the parent window.
10471
10472 The base class version returns false, but this method is overridden in
10473 wxControl where it returns true.
10474 """
10475 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10476
10477 def CanSetTransparent(*args, **kwargs):
10478 """
10479 CanSetTransparent(self) -> bool
10480
10481 Returns ``True`` if the platform supports setting the transparency for
10482 this window. Note that this method will err on the side of caution,
10483 so it is possible that this will return ``False`` when it is in fact
10484 possible to set the transparency.
10485
10486 NOTE: On X-windows systems the X server must have the composite
10487 extension loaded, and there must be a composite manager program (such
10488 as xcompmgr) running.
10489 """
10490 return _core_.Window_CanSetTransparent(*args, **kwargs)
10491
10492 def SetTransparent(*args, **kwargs):
10493 """
10494 SetTransparent(self, byte alpha) -> bool
10495
10496 Attempt to set the transparency of this window to the ``alpha`` value,
10497 returns True on success. The ``alpha`` value is an integer in the
10498 range of 0 to 255, where 0 is fully transparent and 255 is fully
10499 opaque.
10500 """
10501 return _core_.Window_SetTransparent(*args, **kwargs)
10502
10503 def PostCreate(self, pre):
10504 """
10505 Phase 3 of the 2-phase create <wink!>
10506 Call this method after precreating the window with the 2-phase create method.
10507 """
10508 self.this = pre.this
10509 self.thisown = pre.thisown
10510 pre.thisown = 0
10511 if hasattr(self, '_setOORInfo'):
10512 try:
10513 self._setOORInfo(self)
10514 except TypeError:
10515 pass
10516 if hasattr(self, '_setCallbackInfo'):
10517 try:
10518 self._setCallbackInfo(self, pre.__class__)
10519 except TypeError:
10520 pass
10521
10522 def SendSizeEvent(self):
10523 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10524
10525 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10526 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10527 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10528 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10529 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
10530 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10531 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10532 Border = property(GetBorder,doc="See `GetBorder`")
10533 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10534 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10535 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10536 Children = property(GetChildren,doc="See `GetChildren`")
10537 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10538 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10539 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10540 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10541 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10542 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10543 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10544 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10545 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10546 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10547 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10548 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
10549 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10550 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
10551 Handle = property(GetHandle,doc="See `GetHandle`")
10552 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
10553 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10554 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
10555 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
10556 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10557 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10558 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10559 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10560 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10561 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10562 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10563 Parent = property(GetParent,doc="See `GetParent`")
10564 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10565 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10566 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10567 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
10568 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10569 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
10570 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10571 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10572 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10573 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10574 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10575 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10576 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10577 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10578 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
10579 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10580 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10581 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
10582 _core_.Window_swigregister(Window)
10583
10584 def PreWindow(*args, **kwargs):
10585 """
10586 PreWindow() -> Window
10587
10588 Precreate a Window for 2-phase creation.
10589 """
10590 val = _core_.new_PreWindow(*args, **kwargs)
10591 return val
10592
10593 def Window_NewControlId(*args):
10594 """
10595 Window_NewControlId() -> int
10596
10597 Generate a control id for the controls which were not given one.
10598 """
10599 return _core_.Window_NewControlId(*args)
10600
10601 def Window_NextControlId(*args, **kwargs):
10602 """
10603 Window_NextControlId(int winid) -> int
10604
10605 Get the id of the control following the one with the given
10606 autogenerated) id
10607 """
10608 return _core_.Window_NextControlId(*args, **kwargs)
10609
10610 def Window_PrevControlId(*args, **kwargs):
10611 """
10612 Window_PrevControlId(int winid) -> int
10613
10614 Get the id of the control preceding the one with the given
10615 autogenerated) id
10616 """
10617 return _core_.Window_PrevControlId(*args, **kwargs)
10618
10619 def Window_FindFocus(*args):
10620 """
10621 Window_FindFocus() -> Window
10622
10623 Returns the window or control that currently has the keyboard focus,
10624 or None.
10625 """
10626 return _core_.Window_FindFocus(*args)
10627
10628 def Window_GetCapture(*args):
10629 """
10630 Window_GetCapture() -> Window
10631
10632 Returns the window which currently captures the mouse or None
10633 """
10634 return _core_.Window_GetCapture(*args)
10635
10636 def Window_GetClassDefaultAttributes(*args, **kwargs):
10637 """
10638 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10639
10640 Get the default attributes for this class. This is useful if you want
10641 to use the same font or colour in your own control as in a standard
10642 control -- which is a much better idea than hard coding specific
10643 colours or fonts which might look completely out of place on the
10644 user's system, especially if it uses themes.
10645
10646 The variant parameter is only relevant under Mac currently and is
10647 ignore under other platforms. Under Mac, it will change the size of
10648 the returned font. See `wx.Window.SetWindowVariant` for more about
10649 this.
10650 """
10651 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10652
10653 def DLG_PNT(win, point_or_x, y=None):
10654 """
10655 Convenience function for converting a Point or (x,y) in
10656 dialog units to pixel units.
10657 """
10658 if y is None:
10659 return win.ConvertDialogPointToPixels(point_or_x)
10660 else:
10661 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10662
10663 def DLG_SZE(win, size_width, height=None):
10664 """
10665 Convenience function for converting a Size or (w,h) in
10666 dialog units to pixel units.
10667 """
10668 if height is None:
10669 return win.ConvertDialogSizeToPixels(size_width)
10670 else:
10671 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10672
10673
10674 def FindWindowById(*args, **kwargs):
10675 """
10676 FindWindowById(long id, Window parent=None) -> Window
10677
10678 Find the first window in the application with the given id. If parent
10679 is None, the search will start from all top-level frames and dialog
10680 boxes; if non-None, the search will be limited to the given window
10681 hierarchy. The search is recursive in both cases.
10682 """
10683 return _core_.FindWindowById(*args, **kwargs)
10684
10685 def FindWindowByName(*args, **kwargs):
10686 """
10687 FindWindowByName(String name, Window parent=None) -> Window
10688
10689 Find a window by its name (as given in a window constructor or Create
10690 function call). If parent is None, the search will start from all
10691 top-level frames and dialog boxes; if non-None, the search will be
10692 limited to the given window hierarchy. The search is recursive in both
10693 cases.
10694
10695 If no window with such name is found, wx.FindWindowByLabel is called.
10696 """
10697 return _core_.FindWindowByName(*args, **kwargs)
10698
10699 def FindWindowByLabel(*args, **kwargs):
10700 """
10701 FindWindowByLabel(String label, Window parent=None) -> Window
10702
10703 Find a window by its label. Depending on the type of window, the label
10704 may be a window title or panel item label. If parent is None, the
10705 search will start from all top-level frames and dialog boxes; if
10706 non-None, the search will be limited to the given window
10707 hierarchy. The search is recursive in both cases.
10708 """
10709 return _core_.FindWindowByLabel(*args, **kwargs)
10710
10711 def Window_FromHWND(*args, **kwargs):
10712 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10713 return _core_.Window_FromHWND(*args, **kwargs)
10714
10715 def GetTopLevelWindows(*args):
10716 """
10717 GetTopLevelWindows() -> PyObject
10718
10719 Returns a list of the the application's top-level windows, (frames,
10720 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10721 by wxWidgets, and so it is only valid as long as no top-level windows
10722 are closed or new top-level windows are created.
10723
10724 """
10725 return _core_.GetTopLevelWindows(*args)
10726 #---------------------------------------------------------------------------
10727
10728 class Validator(EvtHandler):
10729 """Proxy of C++ Validator class"""
10730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10731 __repr__ = _swig_repr
10732 def __init__(self, *args, **kwargs):
10733 """__init__(self) -> Validator"""
10734 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10735 self._setOORInfo(self)
10736
10737 def Clone(*args, **kwargs):
10738 """Clone(self) -> Validator"""
10739 return _core_.Validator_Clone(*args, **kwargs)
10740
10741 def Validate(*args, **kwargs):
10742 """Validate(self, Window parent) -> bool"""
10743 return _core_.Validator_Validate(*args, **kwargs)
10744
10745 def TransferToWindow(*args, **kwargs):
10746 """TransferToWindow(self) -> bool"""
10747 return _core_.Validator_TransferToWindow(*args, **kwargs)
10748
10749 def TransferFromWindow(*args, **kwargs):
10750 """TransferFromWindow(self) -> bool"""
10751 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10752
10753 def GetWindow(*args, **kwargs):
10754 """GetWindow(self) -> Window"""
10755 return _core_.Validator_GetWindow(*args, **kwargs)
10756
10757 def SetWindow(*args, **kwargs):
10758 """SetWindow(self, Window window)"""
10759 return _core_.Validator_SetWindow(*args, **kwargs)
10760
10761 def IsSilent(*args, **kwargs):
10762 """IsSilent() -> bool"""
10763 return _core_.Validator_IsSilent(*args, **kwargs)
10764
10765 IsSilent = staticmethod(IsSilent)
10766 def SetBellOnError(*args, **kwargs):
10767 """SetBellOnError(int doIt=True)"""
10768 return _core_.Validator_SetBellOnError(*args, **kwargs)
10769
10770 SetBellOnError = staticmethod(SetBellOnError)
10771 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
10772 _core_.Validator_swigregister(Validator)
10773
10774 def Validator_IsSilent(*args):
10775 """Validator_IsSilent() -> bool"""
10776 return _core_.Validator_IsSilent(*args)
10777
10778 def Validator_SetBellOnError(*args, **kwargs):
10779 """Validator_SetBellOnError(int doIt=True)"""
10780 return _core_.Validator_SetBellOnError(*args, **kwargs)
10781
10782 class PyValidator(Validator):
10783 """Proxy of C++ PyValidator class"""
10784 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10785 __repr__ = _swig_repr
10786 def __init__(self, *args, **kwargs):
10787 """__init__(self) -> PyValidator"""
10788 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10789 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
10790
10791 def _setCallbackInfo(*args, **kwargs):
10792 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
10793 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10794
10795 _core_.PyValidator_swigregister(PyValidator)
10796
10797 #---------------------------------------------------------------------------
10798
10799 class Menu(EvtHandler):
10800 """Proxy of C++ Menu class"""
10801 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10802 __repr__ = _swig_repr
10803 def __init__(self, *args, **kwargs):
10804 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10805 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10806 self._setOORInfo(self)
10807
10808 def Append(*args, **kwargs):
10809 """
10810 Append(self, int id, String text=EmptyString, String help=EmptyString,
10811 int kind=ITEM_NORMAL) -> MenuItem
10812 """
10813 return _core_.Menu_Append(*args, **kwargs)
10814
10815 def AppendSeparator(*args, **kwargs):
10816 """AppendSeparator(self) -> MenuItem"""
10817 return _core_.Menu_AppendSeparator(*args, **kwargs)
10818
10819 def AppendCheckItem(*args, **kwargs):
10820 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10821 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10822
10823 def AppendRadioItem(*args, **kwargs):
10824 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10825 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10826
10827 def AppendMenu(*args, **kwargs):
10828 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10829 return _core_.Menu_AppendMenu(*args, **kwargs)
10830
10831 def AppendSubMenu(*args, **kwargs):
10832 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10833 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10834
10835 def AppendItem(*args, **kwargs):
10836 """AppendItem(self, MenuItem item) -> MenuItem"""
10837 return _core_.Menu_AppendItem(*args, **kwargs)
10838
10839 def InsertItem(*args, **kwargs):
10840 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10841 return _core_.Menu_InsertItem(*args, **kwargs)
10842
10843 def PrependItem(*args, **kwargs):
10844 """PrependItem(self, MenuItem item) -> MenuItem"""
10845 return _core_.Menu_PrependItem(*args, **kwargs)
10846
10847 def Break(*args, **kwargs):
10848 """Break(self)"""
10849 return _core_.Menu_Break(*args, **kwargs)
10850
10851 def Insert(*args, **kwargs):
10852 """
10853 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10854 int kind=ITEM_NORMAL) -> MenuItem
10855 """
10856 return _core_.Menu_Insert(*args, **kwargs)
10857
10858 def InsertSeparator(*args, **kwargs):
10859 """InsertSeparator(self, size_t pos) -> MenuItem"""
10860 return _core_.Menu_InsertSeparator(*args, **kwargs)
10861
10862 def InsertCheckItem(*args, **kwargs):
10863 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10864 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10865
10866 def InsertRadioItem(*args, **kwargs):
10867 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10868 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10869
10870 def InsertMenu(*args, **kwargs):
10871 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10872 return _core_.Menu_InsertMenu(*args, **kwargs)
10873
10874 def Prepend(*args, **kwargs):
10875 """
10876 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10877 int kind=ITEM_NORMAL) -> MenuItem
10878 """
10879 return _core_.Menu_Prepend(*args, **kwargs)
10880
10881 def PrependSeparator(*args, **kwargs):
10882 """PrependSeparator(self) -> MenuItem"""
10883 return _core_.Menu_PrependSeparator(*args, **kwargs)
10884
10885 def PrependCheckItem(*args, **kwargs):
10886 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10887 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10888
10889 def PrependRadioItem(*args, **kwargs):
10890 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10891 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10892
10893 def PrependMenu(*args, **kwargs):
10894 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10895 return _core_.Menu_PrependMenu(*args, **kwargs)
10896
10897 def Remove(*args, **kwargs):
10898 """Remove(self, int id) -> MenuItem"""
10899 return _core_.Menu_Remove(*args, **kwargs)
10900
10901 def RemoveItem(self, item):
10902 """RemoveItem(self, MenuItem item) -> MenuItem"""
10903 #// The return object is always the parameter, so return that
10904 #// proxy instead of the new one
10905 val = _core_.Menu_RemoveItem(self, item)
10906 item.this.own(val.this.own())
10907 val.this.disown()
10908 return item
10909
10910
10911 def Delete(*args, **kwargs):
10912 """Delete(self, int id) -> bool"""
10913 return _core_.Menu_Delete(*args, **kwargs)
10914
10915 def DeleteItem(*args, **kwargs):
10916 """DeleteItem(self, MenuItem item) -> bool"""
10917 return _core_.Menu_DeleteItem(*args, **kwargs)
10918
10919 def Destroy(*args, **kwargs):
10920 """
10921 Destroy(self)
10922
10923 Deletes the C++ object this Python object is a proxy for.
10924 """
10925 args[0].this.own(False)
10926 return _core_.Menu_Destroy(*args, **kwargs)
10927
10928 def DestroyId(*args, **kwargs):
10929 """DestroyId(self, int id) -> bool"""
10930 return _core_.Menu_DestroyId(*args, **kwargs)
10931
10932 def DestroyItem(*args, **kwargs):
10933 """DestroyItem(self, MenuItem item) -> bool"""
10934 return _core_.Menu_DestroyItem(*args, **kwargs)
10935
10936 def GetMenuItemCount(*args, **kwargs):
10937 """GetMenuItemCount(self) -> size_t"""
10938 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10939
10940 def GetMenuItems(*args, **kwargs):
10941 """GetMenuItems(self) -> PyObject"""
10942 return _core_.Menu_GetMenuItems(*args, **kwargs)
10943
10944 def FindItem(*args, **kwargs):
10945 """FindItem(self, String item) -> int"""
10946 return _core_.Menu_FindItem(*args, **kwargs)
10947
10948 def FindItemById(*args, **kwargs):
10949 """FindItemById(self, int id) -> MenuItem"""
10950 return _core_.Menu_FindItemById(*args, **kwargs)
10951
10952 def FindItemByPosition(*args, **kwargs):
10953 """FindItemByPosition(self, size_t position) -> MenuItem"""
10954 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10955
10956 def Enable(*args, **kwargs):
10957 """Enable(self, int id, bool enable)"""
10958 return _core_.Menu_Enable(*args, **kwargs)
10959
10960 def IsEnabled(*args, **kwargs):
10961 """IsEnabled(self, int id) -> bool"""
10962 return _core_.Menu_IsEnabled(*args, **kwargs)
10963
10964 def Check(*args, **kwargs):
10965 """Check(self, int id, bool check)"""
10966 return _core_.Menu_Check(*args, **kwargs)
10967
10968 def IsChecked(*args, **kwargs):
10969 """IsChecked(self, int id) -> bool"""
10970 return _core_.Menu_IsChecked(*args, **kwargs)
10971
10972 def SetLabel(*args, **kwargs):
10973 """SetLabel(self, int id, String label)"""
10974 return _core_.Menu_SetLabel(*args, **kwargs)
10975
10976 def GetLabel(*args, **kwargs):
10977 """GetLabel(self, int id) -> String"""
10978 return _core_.Menu_GetLabel(*args, **kwargs)
10979
10980 def SetHelpString(*args, **kwargs):
10981 """SetHelpString(self, int id, String helpString)"""
10982 return _core_.Menu_SetHelpString(*args, **kwargs)
10983
10984 def GetHelpString(*args, **kwargs):
10985 """GetHelpString(self, int id) -> String"""
10986 return _core_.Menu_GetHelpString(*args, **kwargs)
10987
10988 def SetTitle(*args, **kwargs):
10989 """SetTitle(self, String title)"""
10990 return _core_.Menu_SetTitle(*args, **kwargs)
10991
10992 def GetTitle(*args, **kwargs):
10993 """GetTitle(self) -> String"""
10994 return _core_.Menu_GetTitle(*args, **kwargs)
10995
10996 def SetEventHandler(*args, **kwargs):
10997 """SetEventHandler(self, EvtHandler handler)"""
10998 return _core_.Menu_SetEventHandler(*args, **kwargs)
10999
11000 def GetEventHandler(*args, **kwargs):
11001 """GetEventHandler(self) -> EvtHandler"""
11002 return _core_.Menu_GetEventHandler(*args, **kwargs)
11003
11004 def SetInvokingWindow(*args, **kwargs):
11005 """SetInvokingWindow(self, Window win)"""
11006 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
11007
11008 def GetInvokingWindow(*args, **kwargs):
11009 """GetInvokingWindow(self) -> Window"""
11010 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
11011
11012 def GetStyle(*args, **kwargs):
11013 """GetStyle(self) -> long"""
11014 return _core_.Menu_GetStyle(*args, **kwargs)
11015
11016 def UpdateUI(*args, **kwargs):
11017 """UpdateUI(self, EvtHandler source=None)"""
11018 return _core_.Menu_UpdateUI(*args, **kwargs)
11019
11020 def GetMenuBar(*args, **kwargs):
11021 """GetMenuBar(self) -> MenuBar"""
11022 return _core_.Menu_GetMenuBar(*args, **kwargs)
11023
11024 def Attach(*args, **kwargs):
11025 """Attach(self, wxMenuBarBase menubar)"""
11026 return _core_.Menu_Attach(*args, **kwargs)
11027
11028 def Detach(*args, **kwargs):
11029 """Detach(self)"""
11030 return _core_.Menu_Detach(*args, **kwargs)
11031
11032 def IsAttached(*args, **kwargs):
11033 """IsAttached(self) -> bool"""
11034 return _core_.Menu_IsAttached(*args, **kwargs)
11035
11036 def SetParent(*args, **kwargs):
11037 """SetParent(self, Menu parent)"""
11038 return _core_.Menu_SetParent(*args, **kwargs)
11039
11040 def GetParent(*args, **kwargs):
11041 """GetParent(self) -> Menu"""
11042 return _core_.Menu_GetParent(*args, **kwargs)
11043
11044 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
11045 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
11046 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
11047 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
11048 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
11049 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
11050 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
11051 Style = property(GetStyle,doc="See `GetStyle`")
11052 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
11053 _core_.Menu_swigregister(Menu)
11054 DefaultValidator = cvar.DefaultValidator
11055
11056 #---------------------------------------------------------------------------
11057
11058 class MenuBar(Window):
11059 """Proxy of C++ MenuBar class"""
11060 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11061 __repr__ = _swig_repr
11062 def __init__(self, *args, **kwargs):
11063 """__init__(self, long style=0) -> MenuBar"""
11064 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
11065 self._setOORInfo(self)
11066
11067 def Append(*args, **kwargs):
11068 """Append(self, Menu menu, String title) -> bool"""
11069 return _core_.MenuBar_Append(*args, **kwargs)
11070
11071 def Insert(*args, **kwargs):
11072 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
11073 return _core_.MenuBar_Insert(*args, **kwargs)
11074
11075 def GetMenuCount(*args, **kwargs):
11076 """GetMenuCount(self) -> size_t"""
11077 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
11078
11079 def GetMenu(*args, **kwargs):
11080 """GetMenu(self, size_t pos) -> Menu"""
11081 return _core_.MenuBar_GetMenu(*args, **kwargs)
11082
11083 def Replace(*args, **kwargs):
11084 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11085 return _core_.MenuBar_Replace(*args, **kwargs)
11086
11087 def Remove(*args, **kwargs):
11088 """Remove(self, size_t pos) -> Menu"""
11089 return _core_.MenuBar_Remove(*args, **kwargs)
11090
11091 def EnableTop(*args, **kwargs):
11092 """EnableTop(self, size_t pos, bool enable)"""
11093 return _core_.MenuBar_EnableTop(*args, **kwargs)
11094
11095 def IsEnabledTop(*args, **kwargs):
11096 """IsEnabledTop(self, size_t pos) -> bool"""
11097 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
11098
11099 def SetLabelTop(*args, **kwargs):
11100 """SetLabelTop(self, size_t pos, String label)"""
11101 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
11102
11103 def GetLabelTop(*args, **kwargs):
11104 """GetLabelTop(self, size_t pos) -> String"""
11105 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
11106
11107 def FindMenuItem(*args, **kwargs):
11108 """FindMenuItem(self, String menu, String item) -> int"""
11109 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
11110
11111 def FindItemById(*args, **kwargs):
11112 """FindItemById(self, int id) -> MenuItem"""
11113 return _core_.MenuBar_FindItemById(*args, **kwargs)
11114
11115 def FindMenu(*args, **kwargs):
11116 """FindMenu(self, String title) -> int"""
11117 return _core_.MenuBar_FindMenu(*args, **kwargs)
11118
11119 def Enable(*args, **kwargs):
11120 """Enable(self, int id, bool enable)"""
11121 return _core_.MenuBar_Enable(*args, **kwargs)
11122
11123 def Check(*args, **kwargs):
11124 """Check(self, int id, bool check)"""
11125 return _core_.MenuBar_Check(*args, **kwargs)
11126
11127 def IsChecked(*args, **kwargs):
11128 """IsChecked(self, int id) -> bool"""
11129 return _core_.MenuBar_IsChecked(*args, **kwargs)
11130
11131 def IsEnabled(*args, **kwargs):
11132 """IsEnabled(self, int id) -> bool"""
11133 return _core_.MenuBar_IsEnabled(*args, **kwargs)
11134
11135 def SetLabel(*args, **kwargs):
11136 """SetLabel(self, int id, String label)"""
11137 return _core_.MenuBar_SetLabel(*args, **kwargs)
11138
11139 def GetLabel(*args, **kwargs):
11140 """GetLabel(self, int id) -> String"""
11141 return _core_.MenuBar_GetLabel(*args, **kwargs)
11142
11143 def SetHelpString(*args, **kwargs):
11144 """SetHelpString(self, int id, String helpString)"""
11145 return _core_.MenuBar_SetHelpString(*args, **kwargs)
11146
11147 def GetHelpString(*args, **kwargs):
11148 """GetHelpString(self, int id) -> String"""
11149 return _core_.MenuBar_GetHelpString(*args, **kwargs)
11150
11151 def GetFrame(*args, **kwargs):
11152 """GetFrame(self) -> wxFrame"""
11153 return _core_.MenuBar_GetFrame(*args, **kwargs)
11154
11155 def IsAttached(*args, **kwargs):
11156 """IsAttached(self) -> bool"""
11157 return _core_.MenuBar_IsAttached(*args, **kwargs)
11158
11159 def Attach(*args, **kwargs):
11160 """Attach(self, wxFrame frame)"""
11161 return _core_.MenuBar_Attach(*args, **kwargs)
11162
11163 def Detach(*args, **kwargs):
11164 """Detach(self)"""
11165 return _core_.MenuBar_Detach(*args, **kwargs)
11166
11167 def UpdateMenus(*args, **kwargs):
11168 """UpdateMenus(self)"""
11169 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11170
11171 def SetAutoWindowMenu(*args, **kwargs):
11172 """SetAutoWindowMenu(bool enable)"""
11173 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11174
11175 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11176 def GetAutoWindowMenu(*args, **kwargs):
11177 """GetAutoWindowMenu() -> bool"""
11178 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11179
11180 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
11181 def GetMenus(self):
11182 """Return a list of (menu, label) items for the menus in the MenuBar. """
11183 return [(self.GetMenu(i), self.GetLabelTop(i))
11184 for i in range(self.GetMenuCount())]
11185
11186 def SetMenus(self, items):
11187 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11188 for i in range(self.GetMenuCount()-1, -1, -1):
11189 self.Remove(i)
11190 for m, l in items:
11191 self.Append(m, l)
11192
11193 Frame = property(GetFrame,doc="See `GetFrame`")
11194 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11195 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
11196 _core_.MenuBar_swigregister(MenuBar)
11197
11198 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
11199 """MenuBar_SetAutoWindowMenu(bool enable)"""
11200 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11201
11202 def MenuBar_GetAutoWindowMenu(*args):
11203 """MenuBar_GetAutoWindowMenu() -> bool"""
11204 return _core_.MenuBar_GetAutoWindowMenu(*args)
11205
11206 #---------------------------------------------------------------------------
11207
11208 class MenuItem(Object):
11209 """Proxy of C++ MenuItem class"""
11210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11211 __repr__ = _swig_repr
11212 def __init__(self, *args, **kwargs):
11213 """
11214 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
11215 String help=EmptyString, int kind=ITEM_NORMAL,
11216 Menu subMenu=None) -> MenuItem
11217 """
11218 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11219 __swig_destroy__ = _core_.delete_MenuItem
11220 __del__ = lambda self : None;
11221 def Destroy(self): pass
11222 def GetMenu(*args, **kwargs):
11223 """GetMenu(self) -> Menu"""
11224 return _core_.MenuItem_GetMenu(*args, **kwargs)
11225
11226 def SetMenu(*args, **kwargs):
11227 """SetMenu(self, Menu menu)"""
11228 return _core_.MenuItem_SetMenu(*args, **kwargs)
11229
11230 def SetId(*args, **kwargs):
11231 """SetId(self, int id)"""
11232 return _core_.MenuItem_SetId(*args, **kwargs)
11233
11234 def GetId(*args, **kwargs):
11235 """GetId(self) -> int"""
11236 return _core_.MenuItem_GetId(*args, **kwargs)
11237
11238 def IsSeparator(*args, **kwargs):
11239 """IsSeparator(self) -> bool"""
11240 return _core_.MenuItem_IsSeparator(*args, **kwargs)
11241
11242 def SetText(*args, **kwargs):
11243 """SetText(self, String str)"""
11244 return _core_.MenuItem_SetText(*args, **kwargs)
11245
11246 def GetLabel(*args, **kwargs):
11247 """GetLabel(self) -> String"""
11248 return _core_.MenuItem_GetLabel(*args, **kwargs)
11249
11250 def GetText(*args, **kwargs):
11251 """GetText(self) -> String"""
11252 return _core_.MenuItem_GetText(*args, **kwargs)
11253
11254 def GetLabelFromText(*args, **kwargs):
11255 """GetLabelFromText(String text) -> String"""
11256 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11257
11258 GetLabelFromText = staticmethod(GetLabelFromText)
11259 def GetKind(*args, **kwargs):
11260 """GetKind(self) -> int"""
11261 return _core_.MenuItem_GetKind(*args, **kwargs)
11262
11263 def SetKind(*args, **kwargs):
11264 """SetKind(self, int kind)"""
11265 return _core_.MenuItem_SetKind(*args, **kwargs)
11266
11267 def SetCheckable(*args, **kwargs):
11268 """SetCheckable(self, bool checkable)"""
11269 return _core_.MenuItem_SetCheckable(*args, **kwargs)
11270
11271 def IsCheckable(*args, **kwargs):
11272 """IsCheckable(self) -> bool"""
11273 return _core_.MenuItem_IsCheckable(*args, **kwargs)
11274
11275 def IsSubMenu(*args, **kwargs):
11276 """IsSubMenu(self) -> bool"""
11277 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
11278
11279 def SetSubMenu(*args, **kwargs):
11280 """SetSubMenu(self, Menu menu)"""
11281 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
11282
11283 def GetSubMenu(*args, **kwargs):
11284 """GetSubMenu(self) -> Menu"""
11285 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
11286
11287 def Enable(*args, **kwargs):
11288 """Enable(self, bool enable=True)"""
11289 return _core_.MenuItem_Enable(*args, **kwargs)
11290
11291 def IsEnabled(*args, **kwargs):
11292 """IsEnabled(self) -> bool"""
11293 return _core_.MenuItem_IsEnabled(*args, **kwargs)
11294
11295 def Check(*args, **kwargs):
11296 """Check(self, bool check=True)"""
11297 return _core_.MenuItem_Check(*args, **kwargs)
11298
11299 def IsChecked(*args, **kwargs):
11300 """IsChecked(self) -> bool"""
11301 return _core_.MenuItem_IsChecked(*args, **kwargs)
11302
11303 def Toggle(*args, **kwargs):
11304 """Toggle(self)"""
11305 return _core_.MenuItem_Toggle(*args, **kwargs)
11306
11307 def SetHelp(*args, **kwargs):
11308 """SetHelp(self, String str)"""
11309 return _core_.MenuItem_SetHelp(*args, **kwargs)
11310
11311 def GetHelp(*args, **kwargs):
11312 """GetHelp(self) -> String"""
11313 return _core_.MenuItem_GetHelp(*args, **kwargs)
11314
11315 def GetAccel(*args, **kwargs):
11316 """GetAccel(self) -> AcceleratorEntry"""
11317 return _core_.MenuItem_GetAccel(*args, **kwargs)
11318
11319 def SetAccel(*args, **kwargs):
11320 """SetAccel(self, AcceleratorEntry accel)"""
11321 return _core_.MenuItem_SetAccel(*args, **kwargs)
11322
11323 def SetBitmap(*args, **kwargs):
11324 """SetBitmap(self, Bitmap bitmap)"""
11325 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11326
11327 def GetBitmap(*args, **kwargs):
11328 """GetBitmap(self) -> Bitmap"""
11329 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11330
11331 def SetFont(*args, **kwargs):
11332 """SetFont(self, Font font)"""
11333 return _core_.MenuItem_SetFont(*args, **kwargs)
11334
11335 def GetFont(*args, **kwargs):
11336 """GetFont(self) -> Font"""
11337 return _core_.MenuItem_GetFont(*args, **kwargs)
11338
11339 def SetTextColour(*args, **kwargs):
11340 """SetTextColour(self, Colour colText)"""
11341 return _core_.MenuItem_SetTextColour(*args, **kwargs)
11342
11343 def GetTextColour(*args, **kwargs):
11344 """GetTextColour(self) -> Colour"""
11345 return _core_.MenuItem_GetTextColour(*args, **kwargs)
11346
11347 def SetBackgroundColour(*args, **kwargs):
11348 """SetBackgroundColour(self, Colour colBack)"""
11349 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
11350
11351 def GetBackgroundColour(*args, **kwargs):
11352 """GetBackgroundColour(self) -> Colour"""
11353 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11354
11355 def SetBitmaps(*args, **kwargs):
11356 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11357 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11358
11359 def SetDisabledBitmap(*args, **kwargs):
11360 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11361 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11362
11363 def GetDisabledBitmap(*args, **kwargs):
11364 """GetDisabledBitmap(self) -> Bitmap"""
11365 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11366
11367 def SetMarginWidth(*args, **kwargs):
11368 """SetMarginWidth(self, int nWidth)"""
11369 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11370
11371 def GetMarginWidth(*args, **kwargs):
11372 """GetMarginWidth(self) -> int"""
11373 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11374
11375 def GetDefaultMarginWidth(*args, **kwargs):
11376 """GetDefaultMarginWidth() -> int"""
11377 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
11378
11379 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
11380 def IsOwnerDrawn(*args, **kwargs):
11381 """IsOwnerDrawn(self) -> bool"""
11382 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11383
11384 def SetOwnerDrawn(*args, **kwargs):
11385 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11386 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11387
11388 def ResetOwnerDrawn(*args, **kwargs):
11389 """ResetOwnerDrawn(self)"""
11390 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11391
11392 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11393 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11394 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11395 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11396 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11397 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11398 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11399 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11400 Label = property(GetLabel,doc="See `GetLabel`")
11401 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11402 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11403 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11404 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11405 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
11406 _core_.MenuItem_swigregister(MenuItem)
11407
11408 def MenuItem_GetLabelFromText(*args, **kwargs):
11409 """MenuItem_GetLabelFromText(String text) -> String"""
11410 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11411
11412 def MenuItem_GetDefaultMarginWidth(*args):
11413 """MenuItem_GetDefaultMarginWidth() -> int"""
11414 return _core_.MenuItem_GetDefaultMarginWidth(*args)
11415
11416 #---------------------------------------------------------------------------
11417
11418 class Control(Window):
11419 """
11420 This is the base class for a control or 'widget'.
11421
11422 A control is generally a small window which processes user input
11423 and/or displays one or more item of data.
11424 """
11425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11426 __repr__ = _swig_repr
11427 def __init__(self, *args, **kwargs):
11428 """
11429 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11430 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11431 String name=ControlNameStr) -> Control
11432
11433 Create a Control. Normally you should only call this from a subclass'
11434 __init__ as a plain old wx.Control is not very useful.
11435 """
11436 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
11437 self._setOORInfo(self)
11438
11439 def Create(*args, **kwargs):
11440 """
11441 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11442 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11443 String name=ControlNameStr) -> bool
11444
11445 Do the 2nd phase and create the GUI control.
11446 """
11447 return _core_.Control_Create(*args, **kwargs)
11448
11449 def GetAlignment(*args, **kwargs):
11450 """
11451 GetAlignment(self) -> int
11452
11453 Get the control alignment (left/right/centre, top/bottom/centre)
11454 """
11455 return _core_.Control_GetAlignment(*args, **kwargs)
11456
11457 def GetLabelText(*args, **kwargs):
11458 """
11459 GetLabelText(self) -> String
11460
11461 Get just the text of the label, without mnemonic characters ('&')
11462 """
11463 return _core_.Control_GetLabelText(*args, **kwargs)
11464
11465 def Command(*args, **kwargs):
11466 """
11467 Command(self, CommandEvent event)
11468
11469 Simulates the effect of the user issuing a command to the item.
11470
11471 :see: `wx.CommandEvent`
11472
11473 """
11474 return _core_.Control_Command(*args, **kwargs)
11475
11476 def RemoveMnemonics(*args, **kwargs):
11477 """
11478 RemoveMnemonics(String str) -> String
11479
11480 removes the mnemonics characters
11481 """
11482 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11483
11484 RemoveMnemonics = staticmethod(RemoveMnemonics)
11485 def GetClassDefaultAttributes(*args, **kwargs):
11486 """
11487 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11488
11489 Get the default attributes for this class. This is useful if you want
11490 to use the same font or colour in your own control as in a standard
11491 control -- which is a much better idea than hard coding specific
11492 colours or fonts which might look completely out of place on the
11493 user's system, especially if it uses themes.
11494
11495 The variant parameter is only relevant under Mac currently and is
11496 ignore under other platforms. Under Mac, it will change the size of
11497 the returned font. See `wx.Window.SetWindowVariant` for more about
11498 this.
11499 """
11500 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11501
11502 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11503 Alignment = property(GetAlignment,doc="See `GetAlignment`")
11504 LabelText = property(GetLabelText,doc="See `GetLabelText`")
11505 _core_.Control_swigregister(Control)
11506 ControlNameStr = cvar.ControlNameStr
11507
11508 def PreControl(*args, **kwargs):
11509 """
11510 PreControl() -> Control
11511
11512 Precreate a Control control for 2-phase creation
11513 """
11514 val = _core_.new_PreControl(*args, **kwargs)
11515 return val
11516
11517 def Control_RemoveMnemonics(*args, **kwargs):
11518 """
11519 Control_RemoveMnemonics(String str) -> String
11520
11521 removes the mnemonics characters
11522 """
11523 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11524
11525 def Control_GetClassDefaultAttributes(*args, **kwargs):
11526 """
11527 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11528
11529 Get the default attributes for this class. This is useful if you want
11530 to use the same font or colour in your own control as in a standard
11531 control -- which is a much better idea than hard coding specific
11532 colours or fonts which might look completely out of place on the
11533 user's system, especially if it uses themes.
11534
11535 The variant parameter is only relevant under Mac currently and is
11536 ignore under other platforms. Under Mac, it will change the size of
11537 the returned font. See `wx.Window.SetWindowVariant` for more about
11538 this.
11539 """
11540 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11541
11542 #---------------------------------------------------------------------------
11543
11544 class ItemContainer(object):
11545 """
11546 The wx.ItemContainer class defines an interface which is implemented
11547 by all controls which have string subitems, each of which may be
11548 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11549 as `wx.ComboBox` which implements an extended interface deriving from
11550 this one.
11551
11552 It defines the methods for accessing the control's items and although
11553 each of the derived classes implements them differently, they still
11554 all conform to the same interface.
11555
11556 The items in a wx.ItemContainer have (non empty) string labels and,
11557 optionally, client data associated with them.
11558
11559 """
11560 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11561 def __init__(self): raise AttributeError, "No constructor defined"
11562 __repr__ = _swig_repr
11563 def Append(*args, **kwargs):
11564 """
11565 Append(self, String item, PyObject clientData=None) -> int
11566
11567 Adds the item to the control, associating the given data with the item
11568 if not None. The return value is the index of the newly added item
11569 which may be different from the last one if the control is sorted (e.g.
11570 has wx.LB_SORT or wx.CB_SORT style).
11571 """
11572 return _core_.ItemContainer_Append(*args, **kwargs)
11573
11574 def AppendItems(*args, **kwargs):
11575 """
11576 AppendItems(self, List strings)
11577
11578 Apend several items at once to the control. Notice that calling this
11579 method may be much faster than appending the items one by one if you
11580 need to add a lot of items.
11581 """
11582 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11583
11584 def Insert(*args, **kwargs):
11585 """
11586 Insert(self, String item, int pos, PyObject clientData=None) -> int
11587
11588 Insert an item into the control before the item at the ``pos`` index,
11589 optionally associating some data object with the item.
11590 """
11591 return _core_.ItemContainer_Insert(*args, **kwargs)
11592
11593 def Clear(*args, **kwargs):
11594 """
11595 Clear(self)
11596
11597 Removes all items from the control.
11598 """
11599 return _core_.ItemContainer_Clear(*args, **kwargs)
11600
11601 def Delete(*args, **kwargs):
11602 """
11603 Delete(self, int n)
11604
11605 Deletes the item at the zero-based index 'n' from the control. Note
11606 that it is an error (signalled by a `wx.PyAssertionError` exception if
11607 enabled) to remove an item with the index negative or greater or equal
11608 than the number of items in the control.
11609 """
11610 return _core_.ItemContainer_Delete(*args, **kwargs)
11611
11612 def GetClientData(*args, **kwargs):
11613 """
11614 GetClientData(self, int n) -> PyObject
11615
11616 Returns the client data associated with the given item, (if any.)
11617 """
11618 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11619
11620 def SetClientData(*args, **kwargs):
11621 """
11622 SetClientData(self, int n, PyObject clientData)
11623
11624 Associate the given client data with the item at position n.
11625 """
11626 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11627
11628 def GetCount(*args, **kwargs):
11629 """
11630 GetCount(self) -> int
11631
11632 Returns the number of items in the control.
11633 """
11634 return _core_.ItemContainer_GetCount(*args, **kwargs)
11635
11636 def IsEmpty(*args, **kwargs):
11637 """
11638 IsEmpty(self) -> bool
11639
11640 Returns True if the control is empty or False if it has some items.
11641 """
11642 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11643
11644 def GetString(*args, **kwargs):
11645 """
11646 GetString(self, int n) -> String
11647
11648 Returns the label of the item with the given index.
11649 """
11650 return _core_.ItemContainer_GetString(*args, **kwargs)
11651
11652 def GetStrings(*args, **kwargs):
11653 """GetStrings(self) -> wxArrayString"""
11654 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11655
11656 def SetString(*args, **kwargs):
11657 """
11658 SetString(self, int n, String s)
11659
11660 Sets the label for the given item.
11661 """
11662 return _core_.ItemContainer_SetString(*args, **kwargs)
11663
11664 def FindString(*args, **kwargs):
11665 """
11666 FindString(self, String s) -> int
11667
11668 Finds an item whose label matches the given string. Returns the
11669 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11670 found.
11671 """
11672 return _core_.ItemContainer_FindString(*args, **kwargs)
11673
11674 def SetSelection(*args, **kwargs):
11675 """
11676 SetSelection(self, int n)
11677
11678 Sets the item at index 'n' to be the selected item.
11679 """
11680 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11681
11682 def GetSelection(*args, **kwargs):
11683 """
11684 GetSelection(self) -> int
11685
11686 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11687 is selected.
11688 """
11689 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11690
11691 def SetStringSelection(*args, **kwargs):
11692 """SetStringSelection(self, String s) -> bool"""
11693 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11694
11695 def GetStringSelection(*args, **kwargs):
11696 """
11697 GetStringSelection(self) -> String
11698
11699 Returns the label of the selected item or an empty string if no item
11700 is selected.
11701 """
11702 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11703
11704 def Select(*args, **kwargs):
11705 """
11706 Select(self, int n)
11707
11708 This is the same as `SetSelection` and exists only because it is
11709 slightly more natural for controls which support multiple selection.
11710 """
11711 return _core_.ItemContainer_Select(*args, **kwargs)
11712
11713 def GetItems(self):
11714 """Return a list of the strings in the control"""
11715 return [self.GetString(i) for i in xrange(self.GetCount())]
11716
11717 def SetItems(self, items):
11718 """Clear and set the strings in the control from a list"""
11719 self.Clear()
11720 for i in items:
11721 self.Append(i)
11722
11723 Count = property(GetCount,doc="See `GetCount`")
11724 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11725 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11726 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11727 Strings = property(GetStrings,doc="See `GetStrings`")
11728 _core_.ItemContainer_swigregister(ItemContainer)
11729
11730 #---------------------------------------------------------------------------
11731
11732 class ControlWithItems(Control,ItemContainer):
11733 """
11734 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11735 wx.Control class, and is used for the base class of various controls
11736 that have items.
11737 """
11738 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11739 def __init__(self): raise AttributeError, "No constructor defined"
11740 __repr__ = _swig_repr
11741 _core_.ControlWithItems_swigregister(ControlWithItems)
11742
11743 #---------------------------------------------------------------------------
11744
11745 class SizerFlags(object):
11746 """
11747 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11748 to specify a lot of flags and parameters which can be unwieldy. This
11749 is where wx.SizerFlags comes in: it allows you to specify all
11750 parameters using the named methods instead. For example, instead of::
11751
11752 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11753
11754 you can now write::
11755
11756 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11757
11758 This is more readable and also allows you to create wx.SizerFlags
11759 objects which can be reused for several sizer items.::
11760
11761 flagsExpand = wx.SizerFlags(1)
11762 flagsExpand.Expand().Border(wx.ALL, 10)
11763 sizer.AddF(ctrl1, flagsExpand)
11764 sizer.AddF(ctrl2, flagsExpand)
11765
11766 Note that by specification, all methods of wx.SizerFlags return the
11767 wx.SizerFlags object itself allowing chaining multiple method calls
11768 like in the examples above.
11769 """
11770 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11771 __repr__ = _swig_repr
11772 def __init__(self, *args, **kwargs):
11773 """
11774 __init__(self, int proportion=0) -> SizerFlags
11775
11776 Constructs the flags object with the specified proportion.
11777 """
11778 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11779 __swig_destroy__ = _core_.delete_SizerFlags
11780 __del__ = lambda self : None;
11781 def Proportion(*args, **kwargs):
11782 """
11783 Proportion(self, int proportion) -> SizerFlags
11784
11785 Sets the item's proportion value.
11786 """
11787 return _core_.SizerFlags_Proportion(*args, **kwargs)
11788
11789 def Align(*args, **kwargs):
11790 """
11791 Align(self, int alignment) -> SizerFlags
11792
11793 Sets the item's alignment
11794 """
11795 return _core_.SizerFlags_Align(*args, **kwargs)
11796
11797 def Expand(*args, **kwargs):
11798 """
11799 Expand(self) -> SizerFlags
11800
11801 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11802 fill as much space as it is given by the sizer.
11803 """
11804 return _core_.SizerFlags_Expand(*args, **kwargs)
11805
11806 def Centre(*args, **kwargs):
11807 """
11808 Centre(self) -> SizerFlags
11809
11810 Same as `Center` for those with an alternate dialect of English.
11811 """
11812 return _core_.SizerFlags_Centre(*args, **kwargs)
11813
11814 def Center(*args, **kwargs):
11815 """
11816 Center(self) -> SizerFlags
11817
11818 Sets the centering alignment flags.
11819 """
11820 return _core_.SizerFlags_Center(*args, **kwargs)
11821
11822 def Left(*args, **kwargs):
11823 """
11824 Left(self) -> SizerFlags
11825
11826 Aligns the object to the left, a shortcut for calling
11827 Align(wx.ALIGN_LEFT)
11828 """
11829 return _core_.SizerFlags_Left(*args, **kwargs)
11830
11831 def Right(*args, **kwargs):
11832 """
11833 Right(self) -> SizerFlags
11834
11835 Aligns the object to the right, a shortcut for calling
11836 Align(wx.ALIGN_RIGHT)
11837 """
11838 return _core_.SizerFlags_Right(*args, **kwargs)
11839
11840 def Top(*args, **kwargs):
11841 """
11842 Top(self) -> SizerFlags
11843
11844 Aligns the object to the top of the available space, a shortcut for
11845 calling Align(wx.ALIGN_TOP)
11846 """
11847 return _core_.SizerFlags_Top(*args, **kwargs)
11848
11849 def Bottom(*args, **kwargs):
11850 """
11851 Bottom(self) -> SizerFlags
11852
11853 Aligns the object to the bottom of the available space, a shortcut for
11854 calling Align(wx.ALIGN_BOTTOM)
11855 """
11856 return _core_.SizerFlags_Bottom(*args, **kwargs)
11857
11858 def Shaped(*args, **kwargs):
11859 """
11860 Shaped(self) -> SizerFlags
11861
11862 Sets the wx.SHAPED flag.
11863 """
11864 return _core_.SizerFlags_Shaped(*args, **kwargs)
11865
11866 def FixedMinSize(*args, **kwargs):
11867 """
11868 FixedMinSize(self) -> SizerFlags
11869
11870 Sets the wx.FIXED_MINSIZE flag.
11871 """
11872 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11873
11874 def Border(*args, **kwargs):
11875 """
11876 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11877
11878 Sets the border of the item in the direction(s) or sides given by the
11879 direction parameter. If the borderInPixels value is not given then
11880 the default border size (see `GetDefaultBorder`) will be used.
11881 """
11882 return _core_.SizerFlags_Border(*args, **kwargs)
11883
11884 def DoubleBorder(*args, **kwargs):
11885 """
11886 DoubleBorder(self, int direction=ALL) -> SizerFlags
11887
11888 Sets the border in the given direction to twice the default border
11889 size.
11890 """
11891 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11892
11893 def TripleBorder(*args, **kwargs):
11894 """
11895 TripleBorder(self, int direction=ALL) -> SizerFlags
11896
11897 Sets the border in the given direction to three times the default
11898 border size.
11899 """
11900 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11901
11902 def HorzBorder(*args, **kwargs):
11903 """
11904 HorzBorder(self) -> SizerFlags
11905
11906 Sets the left and right borders to the default border size.
11907 """
11908 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11909
11910 def DoubleHorzBorder(*args, **kwargs):
11911 """
11912 DoubleHorzBorder(self) -> SizerFlags
11913
11914 Sets the left and right borders to twice the default border size.
11915 """
11916 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11917
11918 def GetDefaultBorder(*args, **kwargs):
11919 """
11920 GetDefaultBorder() -> int
11921
11922 Returns the default border size used by the other border methods
11923 """
11924 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11925
11926 GetDefaultBorder = staticmethod(GetDefaultBorder)
11927 def GetProportion(*args, **kwargs):
11928 """
11929 GetProportion(self) -> int
11930
11931 Returns the proportion value to be used in the sizer item.
11932 """
11933 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11934
11935 def GetFlags(*args, **kwargs):
11936 """
11937 GetFlags(self) -> int
11938
11939 Returns the flags value to be used in the sizer item.
11940 """
11941 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11942
11943 def GetBorderInPixels(*args, **kwargs):
11944 """
11945 GetBorderInPixels(self) -> int
11946
11947 Returns the border value in pixels to be used in the sizer item.
11948 """
11949 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11950
11951 _core_.SizerFlags_swigregister(SizerFlags)
11952
11953 def SizerFlags_GetDefaultBorder(*args):
11954 """
11955 SizerFlags_GetDefaultBorder() -> int
11956
11957 Returns the default border size used by the other border methods
11958 """
11959 return _core_.SizerFlags_GetDefaultBorder(*args)
11960
11961 class SizerItem(Object):
11962 """
11963 The wx.SizerItem class is used to track the position, size and other
11964 attributes of each item managed by a `wx.Sizer`. It is not usually
11965 necessary to use this class because the sizer elements can also be
11966 identified by their positions or window or sizer references but
11967 sometimes it may be more convenient to use wx.SizerItem directly.
11968 Also, custom classes derived from `wx.PySizer` will probably need to
11969 use the collection of wx.SizerItems held by wx.Sizer when calculating
11970 layout.
11971
11972 :see: `wx.Sizer`, `wx.GBSizerItem`
11973 """
11974 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11975 __repr__ = _swig_repr
11976 def __init__(self, *args, **kwargs):
11977 """
11978 __init__(self) -> SizerItem
11979
11980 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11981 size will need to be set before this item can be used in a Sizer.
11982
11983 You will probably never need to create a wx.SizerItem directly as they
11984 are created automatically when the sizer's Add, Insert or Prepend
11985 methods are called.
11986
11987 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11988 """
11989 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11990 __swig_destroy__ = _core_.delete_SizerItem
11991 __del__ = lambda self : None;
11992 def DeleteWindows(*args, **kwargs):
11993 """
11994 DeleteWindows(self)
11995
11996 Destroy the window or the windows in a subsizer, depending on the type
11997 of item.
11998 """
11999 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
12000
12001 def DetachSizer(*args, **kwargs):
12002 """
12003 DetachSizer(self)
12004
12005 Enable deleting the SizerItem without destroying the contained sizer.
12006 """
12007 return _core_.SizerItem_DetachSizer(*args, **kwargs)
12008
12009 def GetSize(*args, **kwargs):
12010 """
12011 GetSize(self) -> Size
12012
12013 Get the current size of the item, as set in the last Layout.
12014 """
12015 return _core_.SizerItem_GetSize(*args, **kwargs)
12016
12017 def CalcMin(*args, **kwargs):
12018 """
12019 CalcMin(self) -> Size
12020
12021 Calculates the minimum desired size for the item, including any space
12022 needed by borders.
12023 """
12024 return _core_.SizerItem_CalcMin(*args, **kwargs)
12025
12026 def SetDimension(*args, **kwargs):
12027 """
12028 SetDimension(self, Point pos, Size size)
12029
12030 Set the position and size of the space allocated for this item by the
12031 sizer, and adjust the position and size of the item (window or
12032 subsizer) to be within that space taking alignment and borders into
12033 account.
12034 """
12035 return _core_.SizerItem_SetDimension(*args, **kwargs)
12036
12037 def GetMinSize(*args, **kwargs):
12038 """
12039 GetMinSize(self) -> Size
12040
12041 Get the minimum size needed for the item.
12042 """
12043 return _core_.SizerItem_GetMinSize(*args, **kwargs)
12044
12045 def GetMinSizeWithBorder(*args, **kwargs):
12046 """
12047 GetMinSizeWithBorder(self) -> Size
12048
12049 Get the minimum size needed for the item with space for the borders
12050 added, if needed.
12051 """
12052 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
12053
12054 def SetInitSize(*args, **kwargs):
12055 """SetInitSize(self, int x, int y)"""
12056 return _core_.SizerItem_SetInitSize(*args, **kwargs)
12057
12058 def SetRatioWH(*args, **kwargs):
12059 """
12060 SetRatioWH(self, int width, int height)
12061
12062 Set the ratio item attribute.
12063 """
12064 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
12065
12066 def SetRatioSize(*args, **kwargs):
12067 """
12068 SetRatioSize(self, Size size)
12069
12070 Set the ratio item attribute.
12071 """
12072 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
12073
12074 def SetRatio(*args, **kwargs):
12075 """
12076 SetRatio(self, float ratio)
12077
12078 Set the ratio item attribute.
12079 """
12080 return _core_.SizerItem_SetRatio(*args, **kwargs)
12081
12082 def GetRatio(*args, **kwargs):
12083 """
12084 GetRatio(self) -> float
12085
12086 Set the ratio item attribute.
12087 """
12088 return _core_.SizerItem_GetRatio(*args, **kwargs)
12089
12090 def GetRect(*args, **kwargs):
12091 """
12092 GetRect(self) -> Rect
12093
12094 Returns the rectangle that the sizer item should occupy
12095 """
12096 return _core_.SizerItem_GetRect(*args, **kwargs)
12097
12098 def IsWindow(*args, **kwargs):
12099 """
12100 IsWindow(self) -> bool
12101
12102 Is this sizer item a window?
12103 """
12104 return _core_.SizerItem_IsWindow(*args, **kwargs)
12105
12106 def IsSizer(*args, **kwargs):
12107 """
12108 IsSizer(self) -> bool
12109
12110 Is this sizer item a subsizer?
12111 """
12112 return _core_.SizerItem_IsSizer(*args, **kwargs)
12113
12114 def IsSpacer(*args, **kwargs):
12115 """
12116 IsSpacer(self) -> bool
12117
12118 Is this sizer item a spacer?
12119 """
12120 return _core_.SizerItem_IsSpacer(*args, **kwargs)
12121
12122 def SetProportion(*args, **kwargs):
12123 """
12124 SetProportion(self, int proportion)
12125
12126 Set the proportion value for this item.
12127 """
12128 return _core_.SizerItem_SetProportion(*args, **kwargs)
12129
12130 def GetProportion(*args, **kwargs):
12131 """
12132 GetProportion(self) -> int
12133
12134 Get the proportion value for this item.
12135 """
12136 return _core_.SizerItem_GetProportion(*args, **kwargs)
12137
12138 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12139 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
12140 def SetFlag(*args, **kwargs):
12141 """
12142 SetFlag(self, int flag)
12143
12144 Set the flag value for this item.
12145 """
12146 return _core_.SizerItem_SetFlag(*args, **kwargs)
12147
12148 def GetFlag(*args, **kwargs):
12149 """
12150 GetFlag(self) -> int
12151
12152 Get the flag value for this item.
12153 """
12154 return _core_.SizerItem_GetFlag(*args, **kwargs)
12155
12156 def SetBorder(*args, **kwargs):
12157 """
12158 SetBorder(self, int border)
12159
12160 Set the border value for this item.
12161 """
12162 return _core_.SizerItem_SetBorder(*args, **kwargs)
12163
12164 def GetBorder(*args, **kwargs):
12165 """
12166 GetBorder(self) -> int
12167
12168 Get the border value for this item.
12169 """
12170 return _core_.SizerItem_GetBorder(*args, **kwargs)
12171
12172 def GetWindow(*args, **kwargs):
12173 """
12174 GetWindow(self) -> Window
12175
12176 Get the window (if any) that is managed by this sizer item.
12177 """
12178 return _core_.SizerItem_GetWindow(*args, **kwargs)
12179
12180 def GetSizer(*args, **kwargs):
12181 """
12182 GetSizer(self) -> Sizer
12183
12184 Get the subsizer (if any) that is managed by this sizer item.
12185 """
12186 return _core_.SizerItem_GetSizer(*args, **kwargs)
12187
12188 def GetSpacer(*args, **kwargs):
12189 """
12190 GetSpacer(self) -> Size
12191
12192 Get the size of the spacer managed by this sizer item.
12193 """
12194 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12195
12196 def SetWindow(*args, **kwargs):
12197 """
12198 SetWindow(self, Window window)
12199
12200 Set the window to be managed by this sizer item.
12201 """
12202 return _core_.SizerItem_SetWindow(*args, **kwargs)
12203
12204 def SetSizer(*args, **kwargs):
12205 """
12206 SetSizer(self, Sizer sizer)
12207
12208 Set the subsizer to be managed by this sizer item.
12209 """
12210 return _core_.SizerItem_SetSizer(*args, **kwargs)
12211
12212 def SetSpacer(*args, **kwargs):
12213 """
12214 SetSpacer(self, Size size)
12215
12216 Set the size of the spacer to be managed by this sizer item.
12217 """
12218 return _core_.SizerItem_SetSpacer(*args, **kwargs)
12219
12220 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12221 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12222 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12223
12224 def AssignWindow(*args, **kwargs):
12225 """
12226 AssignWindow(self, Window window)
12227
12228 Set the window to be managed by this sizer item.
12229 """
12230 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12231
12232 def AssignSizer(*args, **kwargs):
12233 """
12234 AssignSizer(self, Sizer sizer)
12235
12236 Set the subsizer to be managed by this sizer item.
12237 """
12238 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12239
12240 def AssignSpacer(*args, **kwargs):
12241 """
12242 AssignSpacer(self, Size size)
12243
12244 Set the size of the spacer to be managed by this sizer item.
12245 """
12246 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
12247
12248 def Show(*args, **kwargs):
12249 """
12250 Show(self, bool show)
12251
12252 Set the show item attribute, which sizers use to determine if the item
12253 is to be made part of the layout or not. If the item is tracking a
12254 window then it is shown or hidden as needed.
12255 """
12256 return _core_.SizerItem_Show(*args, **kwargs)
12257
12258 def IsShown(*args, **kwargs):
12259 """
12260 IsShown(self) -> bool
12261
12262 Is the item to be shown in the layout?
12263 """
12264 return _core_.SizerItem_IsShown(*args, **kwargs)
12265
12266 def GetPosition(*args, **kwargs):
12267 """
12268 GetPosition(self) -> Point
12269
12270 Returns the current position of the item, as set in the last Layout.
12271 """
12272 return _core_.SizerItem_GetPosition(*args, **kwargs)
12273
12274 def GetUserData(*args, **kwargs):
12275 """
12276 GetUserData(self) -> PyObject
12277
12278 Returns the userData associated with this sizer item, or None if there
12279 isn't any.
12280 """
12281 return _core_.SizerItem_GetUserData(*args, **kwargs)
12282
12283 def SetUserData(*args, **kwargs):
12284 """
12285 SetUserData(self, PyObject userData)
12286
12287 Associate a Python object with this sizer item.
12288 """
12289 return _core_.SizerItem_SetUserData(*args, **kwargs)
12290
12291 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12292 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12293 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12294 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12295 Position = property(GetPosition,doc="See `GetPosition`")
12296 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12297 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12298 Rect = property(GetRect,doc="See `GetRect`")
12299 Size = property(GetSize,doc="See `GetSize`")
12300 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12301 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
12302 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
12303 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
12304 _core_.SizerItem_swigregister(SizerItem)
12305
12306 def SizerItemWindow(*args, **kwargs):
12307 """
12308 SizerItemWindow(Window window, int proportion, int flag, int border,
12309 PyObject userData=None) -> SizerItem
12310
12311 Constructs a `wx.SizerItem` for tracking a window.
12312 """
12313 val = _core_.new_SizerItemWindow(*args, **kwargs)
12314 return val
12315
12316 def SizerItemSpacer(*args, **kwargs):
12317 """
12318 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12319 PyObject userData=None) -> SizerItem
12320
12321 Constructs a `wx.SizerItem` for tracking a spacer.
12322 """
12323 val = _core_.new_SizerItemSpacer(*args, **kwargs)
12324 return val
12325
12326 def SizerItemSizer(*args, **kwargs):
12327 """
12328 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12329 PyObject userData=None) -> SizerItem
12330
12331 Constructs a `wx.SizerItem` for tracking a subsizer
12332 """
12333 val = _core_.new_SizerItemSizer(*args, **kwargs)
12334 return val
12335
12336 class Sizer(Object):
12337 """
12338 wx.Sizer is the abstract base class used for laying out subwindows in
12339 a window. You cannot use wx.Sizer directly; instead, you will have to
12340 use one of the sizer classes derived from it such as `wx.BoxSizer`,
12341 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12342 `wx.GridBagSizer`.
12343
12344 The concept implemented by sizers in wxWidgets is closely related to
12345 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12346 toolkit or the Qt toolkit. It is based upon the idea of the individual
12347 subwindows reporting their minimal required size and their ability to
12348 get stretched if the size of the parent window has changed. This will
12349 most often mean that the programmer does not set the original size of
12350 a dialog in the beginning, rather the dialog will assigned a sizer and
12351 this sizer will be queried about the recommended size. The sizer in
12352 turn will query its children, which can be normal windows or contorls,
12353 empty space or other sizers, so that a hierarchy of sizers can be
12354 constructed. Note that wxSizer does not derive from wxWindow and thus
12355 do not interfere with tab ordering and requires very little resources
12356 compared to a real window on screen.
12357
12358 What makes sizers so well fitted for use in wxWidgets is the fact that
12359 every control reports its own minimal size and the algorithm can
12360 handle differences in font sizes or different window (dialog item)
12361 sizes on different platforms without problems. If for example the
12362 standard font as well as the overall design of Mac widgets requires
12363 more space than on Windows, then the initial size of a dialog using a
12364 sizer will automatically be bigger on Mac than on Windows.
12365 """
12366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12367 def __init__(self): raise AttributeError, "No constructor defined"
12368 __repr__ = _swig_repr
12369 __swig_destroy__ = _core_.delete_Sizer
12370 __del__ = lambda self : None;
12371 def _setOORInfo(*args, **kwargs):
12372 """_setOORInfo(self, PyObject _self)"""
12373 return _core_.Sizer__setOORInfo(*args, **kwargs)
12374
12375 def Add(*args, **kwargs):
12376 """
12377 Add(self, item, int proportion=0, int flag=0, int border=0,
12378 PyObject userData=None) -> wx.SizerItem
12379
12380 Appends a child item to the sizer.
12381 """
12382 return _core_.Sizer_Add(*args, **kwargs)
12383
12384 def AddF(*args, **kwargs):
12385 """
12386 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12387
12388 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12389 setting the various flags, options and borders.
12390 """
12391 return _core_.Sizer_AddF(*args, **kwargs)
12392
12393 def Insert(*args, **kwargs):
12394 """
12395 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
12396 PyObject userData=None) -> wx.SizerItem
12397
12398 Inserts a new item into the list of items managed by this sizer before
12399 the item at index *before*. See `Add` for a description of the parameters.
12400 """
12401 return _core_.Sizer_Insert(*args, **kwargs)
12402
12403 def InsertF(*args, **kwargs):
12404 """
12405 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12406
12407 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12408 for setting the various flags, options and borders.
12409 """
12410 return _core_.Sizer_InsertF(*args, **kwargs)
12411
12412 def Prepend(*args, **kwargs):
12413 """
12414 Prepend(self, item, int proportion=0, int flag=0, int border=0,
12415 PyObject userData=None) -> wx.SizerItem
12416
12417 Adds a new item to the begining of the list of sizer items managed by
12418 this sizer. See `Add` for a description of the parameters.
12419 """
12420 return _core_.Sizer_Prepend(*args, **kwargs)
12421
12422 def PrependF(*args, **kwargs):
12423 """
12424 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12425
12426 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12427 for setting the various flags, options and borders.
12428 """
12429 return _core_.Sizer_PrependF(*args, **kwargs)
12430
12431 def Remove(*args, **kwargs):
12432 """
12433 Remove(self, item) -> bool
12434
12435 Removes an item from the sizer and destroys it. This method does not
12436 cause any layout or resizing to take place, call `Layout` to update
12437 the layout on screen after removing a child from the sizer. The
12438 *item* parameter can be either a window, a sizer, or the zero-based
12439 index of an item to remove. Returns True if the child item was found
12440 and removed.
12441 """
12442 return _core_.Sizer_Remove(*args, **kwargs)
12443
12444 def Detach(*args, **kwargs):
12445 """
12446 Detach(self, item) -> bool
12447
12448 Detaches an item from the sizer without destroying it. This method
12449 does not cause any layout or resizing to take place, call `Layout` to
12450 do so. The *item* parameter can be either a window, a sizer, or the
12451 zero-based index of the item to be detached. Returns True if the child item
12452 was found and detached.
12453 """
12454 return _core_.Sizer_Detach(*args, **kwargs)
12455
12456 def GetItem(*args, **kwargs):
12457 """
12458 GetItem(self, item, recursive=False) -> wx.SizerItem
12459
12460 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12461 parameter can be either a window, a sizer, or the zero-based index of
12462 the item to be found.
12463 """
12464 return _core_.Sizer_GetItem(*args, **kwargs)
12465
12466 def _SetItemMinSize(*args, **kwargs):
12467 """_SetItemMinSize(self, PyObject item, Size size)"""
12468 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
12469
12470 def _ReplaceWin(*args, **kwargs):
12471 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12472 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12473
12474 def _ReplaceSizer(*args, **kwargs):
12475 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12476 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12477
12478 def _ReplaceItem(*args, **kwargs):
12479 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12480 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12481
12482 def Replace(self, olditem, item, recursive=False):
12483 """
12484 Detaches the given ``olditem`` from the sizer and replaces it with
12485 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12486 detached child is destroyed only if it is not a window, (because
12487 windows are owned by their parent, not the sizer.) The
12488 ``recursive`` parameter can be used to search for the given
12489 element recursivly in subsizers.
12490
12491 This method does not cause any layout or resizing to take place,
12492 call `Layout` to do so.
12493
12494 Returns ``True`` if the child item was found and removed.
12495 """
12496 if isinstance(olditem, wx.Window):
12497 return self._ReplaceWin(olditem, item, recursive)
12498 elif isinstance(olditem, wx.Sizer):
12499 return self._ReplaceSizer(olditem, item, recursive)
12500 elif isinstance(olditem, int):
12501 return self._ReplaceItem(olditem, item)
12502 else:
12503 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12504
12505 def SetContainingWindow(*args, **kwargs):
12506 """
12507 SetContainingWindow(self, Window window)
12508
12509 Set (or unset) the window this sizer is used in.
12510 """
12511 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12512
12513 def GetContainingWindow(*args, **kwargs):
12514 """
12515 GetContainingWindow(self) -> Window
12516
12517 Get the window this sizer is used in.
12518 """
12519 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12520
12521 def SetItemMinSize(self, item, *args):
12522 """
12523 SetItemMinSize(self, item, Size size)
12524
12525 Sets the minimum size that will be allocated for an item in the sizer.
12526 The *item* parameter can be either a window, a sizer, or the
12527 zero-based index of the item. If a window or sizer is given then it
12528 will be searched for recursivly in subsizers if neccessary.
12529 """
12530 if len(args) == 2:
12531 # for backward compatibility accept separate width,height args too
12532 return self._SetItemMinSize(item, args)
12533 else:
12534 return self._SetItemMinSize(item, args[0])
12535
12536 def AddItem(*args, **kwargs):
12537 """
12538 AddItem(self, SizerItem item)
12539
12540 Adds a `wx.SizerItem` to the sizer.
12541 """
12542 return _core_.Sizer_AddItem(*args, **kwargs)
12543
12544 def InsertItem(*args, **kwargs):
12545 """
12546 InsertItem(self, int index, SizerItem item)
12547
12548 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12549 """
12550 return _core_.Sizer_InsertItem(*args, **kwargs)
12551
12552 def PrependItem(*args, **kwargs):
12553 """
12554 PrependItem(self, SizerItem item)
12555
12556 Prepends a `wx.SizerItem` to the sizer.
12557 """
12558 return _core_.Sizer_PrependItem(*args, **kwargs)
12559
12560 def AddMany(self, items):
12561 """
12562 AddMany is a convenience method for adding several items
12563 to a sizer at one time. Simply pass it a list of tuples,
12564 where each tuple consists of the parameters that you
12565 would normally pass to the `Add` method.
12566 """
12567 for item in items:
12568 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12569 item = (item, )
12570 self.Add(*item)
12571
12572 def AddSpacer(self, *args, **kw):
12573 """AddSpacer(int size) --> SizerItem
12574
12575 Add a spacer that is (size,size) pixels.
12576 """
12577 if args and type(args[0]) == int:
12578 return self.Add( (args[0],args[0] ), 0)
12579 else: # otherwise stay compatible with old AddSpacer
12580 return self.Add(*args, **kw)
12581 def PrependSpacer(self, *args, **kw):
12582 """PrependSpacer(int size) --> SizerItem
12583
12584 Prepend a spacer that is (size, size) pixels."""
12585 if args and type(args[0]) == int:
12586 return self.Prepend( (args[0],args[0] ), 0)
12587 else: # otherwise stay compatible with old PrependSpacer
12588 return self.Prepend(*args, **kw)
12589 def InsertSpacer(self, index, *args, **kw):
12590 """InsertSpacer(int index, int size) --> SizerItem
12591
12592 Insert a spacer at position index that is (size, size) pixels."""
12593 if args and type(args[0]) == int:
12594 return self.Insert( index, (args[0],args[0] ), 0)
12595 else: # otherwise stay compatible with old InsertSpacer
12596 return self.Insert(index, *args, **kw)
12597
12598
12599 def AddStretchSpacer(self, prop=1):
12600 """AddStretchSpacer(int prop=1) --> SizerItem
12601
12602 Add a stretchable spacer."""
12603 return self.Add((0,0), prop)
12604 def PrependStretchSpacer(self, prop=1):
12605 """PrependStretchSpacer(int prop=1) --> SizerItem
12606
12607 Prepend a stretchable spacer."""
12608 return self.Prepend((0,0), prop)
12609 def InsertStretchSpacer(self, index, prop=1):
12610 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12611
12612 Insert a stretchable spacer."""
12613 return self.Insert(index, (0,0), prop)
12614
12615
12616 # for backwards compatibility only, please do not use in new code
12617 def AddWindow(self, *args, **kw):
12618 """Compatibility alias for `Add`."""
12619 return self.Add(*args, **kw)
12620 def AddSizer(self, *args, **kw):
12621 """Compatibility alias for `Add`."""
12622 return self.Add(*args, **kw)
12623
12624 def PrependWindow(self, *args, **kw):
12625 """Compatibility alias for `Prepend`."""
12626 return self.Prepend(*args, **kw)
12627 def PrependSizer(self, *args, **kw):
12628 """Compatibility alias for `Prepend`."""
12629 return self.Prepend(*args, **kw)
12630
12631 def InsertWindow(self, *args, **kw):
12632 """Compatibility alias for `Insert`."""
12633 return self.Insert(*args, **kw)
12634 def InsertSizer(self, *args, **kw):
12635 """Compatibility alias for `Insert`."""
12636 return self.Insert(*args, **kw)
12637
12638 def RemoveWindow(self, *args, **kw):
12639 """Compatibility alias for `Remove`."""
12640 return self.Remove(*args, **kw)
12641 def RemoveSizer(self, *args, **kw):
12642 """Compatibility alias for `Remove`."""
12643 return self.Remove(*args, **kw)
12644 def RemovePos(self, *args, **kw):
12645 """Compatibility alias for `Remove`."""
12646 return self.Remove(*args, **kw)
12647
12648
12649 def SetDimension(*args, **kwargs):
12650 """
12651 SetDimension(self, int x, int y, int width, int height)
12652
12653 Call this to force the sizer to take the given dimension and thus
12654 force the items owned by the sizer to resize themselves according to
12655 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12656 methods.
12657 """
12658 return _core_.Sizer_SetDimension(*args, **kwargs)
12659
12660 def SetMinSize(*args, **kwargs):
12661 """
12662 SetMinSize(self, Size size)
12663
12664 Call this to give the sizer a minimal size. Normally, the sizer will
12665 calculate its minimal size based purely on how much space its children
12666 need. After calling this method `GetMinSize` will return either the
12667 minimal size as requested by its children or the minimal size set
12668 here, depending on which is bigger.
12669 """
12670 return _core_.Sizer_SetMinSize(*args, **kwargs)
12671
12672 def GetSize(*args, **kwargs):
12673 """
12674 GetSize(self) -> Size
12675
12676 Returns the current size of the space managed by the sizer.
12677 """
12678 return _core_.Sizer_GetSize(*args, **kwargs)
12679
12680 def GetPosition(*args, **kwargs):
12681 """
12682 GetPosition(self) -> Point
12683
12684 Returns the current position of the sizer's managed space.
12685 """
12686 return _core_.Sizer_GetPosition(*args, **kwargs)
12687
12688 def GetMinSize(*args, **kwargs):
12689 """
12690 GetMinSize(self) -> Size
12691
12692 Returns the minimal size of the sizer. This is either the combined
12693 minimal size of all the children and their borders or the minimal size
12694 set by SetMinSize, depending on which is bigger.
12695 """
12696 return _core_.Sizer_GetMinSize(*args, **kwargs)
12697
12698 def GetSizeTuple(self):
12699 return self.GetSize().Get()
12700 def GetPositionTuple(self):
12701 return self.GetPosition().Get()
12702 def GetMinSizeTuple(self):
12703 return self.GetMinSize().Get()
12704
12705 def RecalcSizes(*args, **kwargs):
12706 """
12707 RecalcSizes(self)
12708
12709 Using the sizes calculated by `CalcMin` reposition and resize all the
12710 items managed by this sizer. You should not need to call this directly as
12711 it is called by `Layout`.
12712 """
12713 return _core_.Sizer_RecalcSizes(*args, **kwargs)
12714
12715 def CalcMin(*args, **kwargs):
12716 """
12717 CalcMin(self) -> Size
12718
12719 This method is where the sizer will do the actual calculation of its
12720 children's minimal sizes. You should not need to call this directly as
12721 it is called by `Layout`.
12722 """
12723 return _core_.Sizer_CalcMin(*args, **kwargs)
12724
12725 def Layout(*args, **kwargs):
12726 """
12727 Layout(self)
12728
12729 This method will force the recalculation and layout of the items
12730 controlled by the sizer using the current space allocated to the
12731 sizer. Normally this is called automatically from the owning window's
12732 EVT_SIZE handler, but it is also useful to call it from user code when
12733 one of the items in a sizer change size, or items are added or
12734 removed.
12735 """
12736 return _core_.Sizer_Layout(*args, **kwargs)
12737
12738 def Fit(*args, **kwargs):
12739 """
12740 Fit(self, Window window) -> Size
12741
12742 Tell the sizer to resize the *window* to match the sizer's minimal
12743 size. This is commonly done in the constructor of the window itself in
12744 order to set its initial size to match the needs of the children as
12745 determined by the sizer. Returns the new size.
12746
12747 For a top level window this is the total window size, not the client size.
12748 """
12749 return _core_.Sizer_Fit(*args, **kwargs)
12750
12751 def FitInside(*args, **kwargs):
12752 """
12753 FitInside(self, Window window)
12754
12755 Tell the sizer to resize the *virtual size* of the *window* to match the
12756 sizer's minimal size. This will not alter the on screen size of the
12757 window, but may cause the addition/removal/alteration of scrollbars
12758 required to view the virtual area in windows which manage it.
12759
12760 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12761
12762 """
12763 return _core_.Sizer_FitInside(*args, **kwargs)
12764
12765 def SetSizeHints(*args, **kwargs):
12766 """
12767 SetSizeHints(self, Window window)
12768
12769 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12770 match the sizer's minimal size. This is commonly done in the
12771 constructor of the window itself if the window is resizable (as are
12772 many dialogs under Unix and frames on probably all platforms) in order
12773 to prevent the window from being sized smaller than the minimal size
12774 required by the sizer.
12775 """
12776 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12777
12778 def SetVirtualSizeHints(*args, **kwargs):
12779 """
12780 SetVirtualSizeHints(self, Window window)
12781
12782 Tell the sizer to set the minimal size of the window virtual area to
12783 match the sizer's minimal size. For windows with managed scrollbars
12784 this will set them appropriately.
12785
12786 :see: `wx.ScrolledWindow.SetScrollbars`
12787
12788 """
12789 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12790
12791 def Clear(*args, **kwargs):
12792 """
12793 Clear(self, bool deleteWindows=False)
12794
12795 Clear all items from the sizer, optionally destroying the window items
12796 as well.
12797 """
12798 return _core_.Sizer_Clear(*args, **kwargs)
12799
12800 def DeleteWindows(*args, **kwargs):
12801 """
12802 DeleteWindows(self)
12803
12804 Destroy all windows managed by the sizer.
12805 """
12806 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12807
12808 def GetChildren(*args, **kwargs):
12809 """
12810 GetChildren(self) -> list
12811
12812 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12813 """
12814 return _core_.Sizer_GetChildren(*args, **kwargs)
12815
12816 def Show(*args, **kwargs):
12817 """
12818 Show(self, item, bool show=True, bool recursive=false) -> bool
12819
12820 Shows or hides an item managed by the sizer. To make a sizer item
12821 disappear or reappear, use Show followed by `Layout`. The *item*
12822 parameter can be either a window, a sizer, or the zero-based index of
12823 the item. Use the recursive parameter to show or hide an item in a
12824 subsizer. Returns True if the item was found.
12825 """
12826 return _core_.Sizer_Show(*args, **kwargs)
12827
12828 def IsShown(*args, **kwargs):
12829 """
12830 IsShown(self, item)
12831
12832 Determines if the item is currently shown. To make a sizer
12833 item disappear or reappear, use Show followed by `Layout`. The *item*
12834 parameter can be either a window, a sizer, or the zero-based index of
12835 the item.
12836 """
12837 return _core_.Sizer_IsShown(*args, **kwargs)
12838
12839 def Hide(self, item, recursive=False):
12840 """
12841 A convenience method for `Show` (item, False, recursive).
12842 """
12843 return self.Show(item, False, recursive)
12844
12845 def ShowItems(*args, **kwargs):
12846 """
12847 ShowItems(self, bool show)
12848
12849 Recursively call `wx.SizerItem.Show` on all sizer items.
12850 """
12851 return _core_.Sizer_ShowItems(*args, **kwargs)
12852
12853 Children = property(GetChildren,doc="See `GetChildren`")
12854 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12855 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12856 Position = property(GetPosition,doc="See `GetPosition`")
12857 Size = property(GetSize,doc="See `GetSize`")
12858 _core_.Sizer_swigregister(Sizer)
12859
12860 class PySizer(Sizer):
12861 """
12862 wx.PySizer is a special version of `wx.Sizer` that has been
12863 instrumented to allow the C++ virtual methods to be overloaded in
12864 Python derived classes. You would derive from this class if you are
12865 wanting to implement a custom sizer in Python code. Simply implement
12866 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12867 For example::
12868
12869 class MySizer(wx.PySizer):
12870 def __init__(self):
12871 wx.PySizer.__init__(self)
12872
12873 def CalcMin(self):
12874 for item in self.GetChildren():
12875 # calculate the total minimum width and height needed
12876 # by all items in the sizer according to this sizer's
12877 # layout algorithm.
12878 ...
12879 return wx.Size(width, height)
12880
12881 def RecalcSizes(self):
12882 # find the space allotted to this sizer
12883 pos = self.GetPosition()
12884 size = self.GetSize()
12885 for item in self.GetChildren():
12886 # Recalculate (if necessary) the position and size of
12887 # each item and then call item.SetDimension to do the
12888 # actual positioning and sizing of the items within the
12889 # space alloted to this sizer.
12890 ...
12891 item.SetDimension(itemPos, itemSize)
12892
12893
12894 When `Layout` is called it first calls `CalcMin` followed by
12895 `RecalcSizes` so you can optimize a bit by saving the results of
12896 `CalcMin` and reusing them in `RecalcSizes`.
12897
12898 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12899
12900
12901 """
12902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12903 __repr__ = _swig_repr
12904 def __init__(self, *args, **kwargs):
12905 """
12906 __init__(self) -> PySizer
12907
12908 Creates a wx.PySizer. Must be called from the __init__ in the derived
12909 class.
12910 """
12911 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
12912 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
12913
12914 def _setCallbackInfo(*args, **kwargs):
12915 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12916 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12917
12918 _core_.PySizer_swigregister(PySizer)
12919
12920 #---------------------------------------------------------------------------
12921
12922 class BoxSizer(Sizer):
12923 """
12924 The basic idea behind a box sizer is that windows will most often be
12925 laid out in rather simple basic geometry, typically in a row or a
12926 column or nested hierarchies of either. A wx.BoxSizer will lay out
12927 its items in a simple row or column, depending on the orientation
12928 parameter passed to the constructor.
12929 """
12930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12931 __repr__ = _swig_repr
12932 def __init__(self, *args, **kwargs):
12933 """
12934 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12935
12936 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12937 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12938 sizer.
12939 """
12940 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12941 self._setOORInfo(self)
12942
12943 def GetOrientation(*args, **kwargs):
12944 """
12945 GetOrientation(self) -> int
12946
12947 Returns the current orientation of the sizer.
12948 """
12949 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12950
12951 def SetOrientation(*args, **kwargs):
12952 """
12953 SetOrientation(self, int orient)
12954
12955 Resets the orientation of the sizer.
12956 """
12957 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12958
12959 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12960 _core_.BoxSizer_swigregister(BoxSizer)
12961
12962 #---------------------------------------------------------------------------
12963
12964 class StaticBoxSizer(BoxSizer):
12965 """
12966 wx.StaticBoxSizer derives from and functions identically to the
12967 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12968 manages. Note that this static box must be created separately and
12969 passed to the sizer constructor.
12970 """
12971 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12972 __repr__ = _swig_repr
12973 def __init__(self, *args, **kwargs):
12974 """
12975 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12976
12977 Constructor. It takes an associated static box and the orientation
12978 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12979 ``wx.HORIZONTAL``.
12980 """
12981 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12982 self._setOORInfo(self)
12983
12984 def GetStaticBox(*args, **kwargs):
12985 """
12986 GetStaticBox(self) -> StaticBox
12987
12988 Returns the static box associated with this sizer.
12989 """
12990 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12991
12992 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
12993 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12994
12995 #---------------------------------------------------------------------------
12996
12997 class GridSizer(Sizer):
12998 """
12999 A grid sizer is a sizer which lays out its children in a
13000 two-dimensional table with all cells having the same size. In other
13001 words, the width of each cell within the grid is the width of the
13002 widest item added to the sizer and the height of each grid cell is the
13003 height of the tallest item. An optional vertical and/or horizontal
13004 gap between items can also be specified (in pixels.)
13005
13006 Items are placed in the cells of the grid in the order they are added,
13007 in row-major order. In other words, the first row is filled first,
13008 then the second, and so on until all items have been added. (If
13009 neccessary, additional rows will be added as items are added.) If you
13010 need to have greater control over the cells that items are placed in
13011 then use the `wx.GridBagSizer`.
13012
13013 """
13014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13015 __repr__ = _swig_repr
13016 def __init__(self, *args, **kwargs):
13017 """
13018 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
13019
13020 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
13021 of columns and rows in the sizer - if either of the parameters is
13022 zero, it will be calculated to from the total number of children in
13023 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13024 define extra space between all children.
13025 """
13026 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
13027 self._setOORInfo(self)
13028
13029 def SetCols(*args, **kwargs):
13030 """
13031 SetCols(self, int cols)
13032
13033 Sets the number of columns in the sizer.
13034 """
13035 return _core_.GridSizer_SetCols(*args, **kwargs)
13036
13037 def SetRows(*args, **kwargs):
13038 """
13039 SetRows(self, int rows)
13040
13041 Sets the number of rows in the sizer.
13042 """
13043 return _core_.GridSizer_SetRows(*args, **kwargs)
13044
13045 def SetVGap(*args, **kwargs):
13046 """
13047 SetVGap(self, int gap)
13048
13049 Sets the vertical gap (in pixels) between the cells in the sizer.
13050 """
13051 return _core_.GridSizer_SetVGap(*args, **kwargs)
13052
13053 def SetHGap(*args, **kwargs):
13054 """
13055 SetHGap(self, int gap)
13056
13057 Sets the horizontal gap (in pixels) between cells in the sizer
13058 """
13059 return _core_.GridSizer_SetHGap(*args, **kwargs)
13060
13061 def GetCols(*args, **kwargs):
13062 """
13063 GetCols(self) -> int
13064
13065 Returns the number of columns in the sizer.
13066 """
13067 return _core_.GridSizer_GetCols(*args, **kwargs)
13068
13069 def GetRows(*args, **kwargs):
13070 """
13071 GetRows(self) -> int
13072
13073 Returns the number of rows in the sizer.
13074 """
13075 return _core_.GridSizer_GetRows(*args, **kwargs)
13076
13077 def GetVGap(*args, **kwargs):
13078 """
13079 GetVGap(self) -> int
13080
13081 Returns the vertical gap (in pixels) between the cells in the sizer.
13082 """
13083 return _core_.GridSizer_GetVGap(*args, **kwargs)
13084
13085 def GetHGap(*args, **kwargs):
13086 """
13087 GetHGap(self) -> int
13088
13089 Returns the horizontal gap (in pixels) between cells in the sizer.
13090 """
13091 return _core_.GridSizer_GetHGap(*args, **kwargs)
13092
13093 def CalcRowsCols(self):
13094 """
13095 CalcRowsCols() -> (rows, cols)
13096
13097 Calculates how many rows and columns will be in the sizer based
13098 on the current number of items and also the rows, cols specified
13099 in the constructor.
13100 """
13101 nitems = len(self.GetChildren())
13102 rows = self.GetRows()
13103 cols = self.GetCols()
13104 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13105 if cols != 0:
13106 rows = (nitems + cols - 1) / cols
13107 elif rows != 0:
13108 cols = (nitems + rows - 1) / rows
13109 return (rows, cols)
13110
13111 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13112 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13113 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13114 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
13115 _core_.GridSizer_swigregister(GridSizer)
13116
13117 #---------------------------------------------------------------------------
13118
13119 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13120 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13121 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
13122 class FlexGridSizer(GridSizer):
13123 """
13124 A flex grid sizer is a sizer which lays out its children in a
13125 two-dimensional table with all table cells in one row having the same
13126 height and all cells in one column having the same width, but all
13127 rows or all columns are not necessarily the same height or width as in
13128 the `wx.GridSizer`.
13129
13130 wx.FlexGridSizer can also size items equally in one direction but
13131 unequally ("flexibly") in the other. If the sizer is only flexible
13132 in one direction (this can be changed using `SetFlexibleDirection`), it
13133 needs to be decided how the sizer should grow in the other ("non
13134 flexible") direction in order to fill the available space. The
13135 `SetNonFlexibleGrowMode` method serves this purpose.
13136
13137
13138 """
13139 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13140 __repr__ = _swig_repr
13141 def __init__(self, *args, **kwargs):
13142 """
13143 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13144
13145 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13146 number of columns and rows in the sizer - if either of the parameters
13147 is zero, it will be calculated to from the total number of children in
13148 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13149 define extra space between all children.
13150 """
13151 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
13152 self._setOORInfo(self)
13153
13154 def AddGrowableRow(*args, **kwargs):
13155 """
13156 AddGrowableRow(self, size_t idx, int proportion=0)
13157
13158 Specifies that row *idx* (starting from zero) should be grown if there
13159 is extra space available to the sizer.
13160
13161 The *proportion* parameter has the same meaning as the stretch factor
13162 for the box sizers except that if all proportions are 0, then all
13163 columns are resized equally (instead of not being resized at all).
13164 """
13165 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
13166
13167 def RemoveGrowableRow(*args, **kwargs):
13168 """
13169 RemoveGrowableRow(self, size_t idx)
13170
13171 Specifies that row *idx* is no longer growable.
13172 """
13173 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
13174
13175 def AddGrowableCol(*args, **kwargs):
13176 """
13177 AddGrowableCol(self, size_t idx, int proportion=0)
13178
13179 Specifies that column *idx* (starting from zero) should be grown if
13180 there is extra space available to the sizer.
13181
13182 The *proportion* parameter has the same meaning as the stretch factor
13183 for the box sizers except that if all proportions are 0, then all
13184 columns are resized equally (instead of not being resized at all).
13185 """
13186 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
13187
13188 def RemoveGrowableCol(*args, **kwargs):
13189 """
13190 RemoveGrowableCol(self, size_t idx)
13191
13192 Specifies that column *idx* is no longer growable.
13193 """
13194 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
13195
13196 def SetFlexibleDirection(*args, **kwargs):
13197 """
13198 SetFlexibleDirection(self, int direction)
13199
13200 Specifies whether the sizer should flexibly resize its columns, rows,
13201 or both. Argument *direction* can be one of the following values. Any
13202 other value is ignored.
13203
13204 ============== =======================================
13205 wx.VERTICAL Rows are flexibly sized.
13206 wx.HORIZONTAL Columns are flexibly sized.
13207 wx.BOTH Both rows and columns are flexibly sized
13208 (this is the default value).
13209 ============== =======================================
13210
13211 Note that this method does not trigger relayout.
13212
13213 """
13214 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
13215
13216 def GetFlexibleDirection(*args, **kwargs):
13217 """
13218 GetFlexibleDirection(self) -> int
13219
13220 Returns a value that specifies whether the sizer
13221 flexibly resizes its columns, rows, or both (default).
13222
13223 :see: `SetFlexibleDirection`
13224 """
13225 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
13226
13227 def SetNonFlexibleGrowMode(*args, **kwargs):
13228 """
13229 SetNonFlexibleGrowMode(self, int mode)
13230
13231 Specifies how the sizer should grow in the non-flexible direction if
13232 there is one (so `SetFlexibleDirection` must have been called
13233 previously). Argument *mode* can be one of the following values:
13234
13235 ========================== =================================================
13236 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13237 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13238 `AddGrowableCol` and `AddGrowableRow`. In this
13239 case equal sizing applies to minimum sizes of
13240 columns or rows (this is the default value).
13241 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13242 the non flexible direction, whether they are
13243 growable or not in the flexbile direction.
13244 ========================== =================================================
13245
13246 Note that this method does not trigger relayout.
13247 """
13248 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
13249
13250 def GetNonFlexibleGrowMode(*args, **kwargs):
13251 """
13252 GetNonFlexibleGrowMode(self) -> int
13253
13254 Returns the value that specifies how the sizer grows in the
13255 non-flexible direction if there is one.
13256
13257 :see: `SetNonFlexibleGrowMode`
13258 """
13259 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
13260
13261 def GetRowHeights(*args, **kwargs):
13262 """
13263 GetRowHeights(self) -> list
13264
13265 Returns a list of integers representing the heights of each of the
13266 rows in the sizer.
13267 """
13268 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
13269
13270 def GetColWidths(*args, **kwargs):
13271 """
13272 GetColWidths(self) -> list
13273
13274 Returns a list of integers representing the widths of each of the
13275 columns in the sizer.
13276 """
13277 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
13278
13279 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13280 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13281 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13282 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
13283 _core_.FlexGridSizer_swigregister(FlexGridSizer)
13284
13285 class StdDialogButtonSizer(BoxSizer):
13286 """
13287 A special sizer that knows how to order and position standard buttons
13288 in order to conform to the current platform's standards. You simply
13289 need to add each `wx.Button` to the sizer, and be sure to create the
13290 buttons using the standard ID's. Then call `Realize` and the sizer
13291 will take care of the rest.
13292
13293 """
13294 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13295 __repr__ = _swig_repr
13296 def __init__(self, *args, **kwargs):
13297 """__init__(self) -> StdDialogButtonSizer"""
13298 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
13299 def AddButton(*args, **kwargs):
13300 """
13301 AddButton(self, wxButton button)
13302
13303 Use this to add the buttons to this sizer. Do not use the `Add`
13304 method in the base class.
13305 """
13306 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
13307
13308 def Realize(*args, **kwargs):
13309 """
13310 Realize(self)
13311
13312 This funciton needs to be called after all the buttons have been added
13313 to the sizer. It will reorder them and position them in a platform
13314 specifc manner.
13315 """
13316 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
13317
13318 def SetAffirmativeButton(*args, **kwargs):
13319 """SetAffirmativeButton(self, wxButton button)"""
13320 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
13321
13322 def SetNegativeButton(*args, **kwargs):
13323 """SetNegativeButton(self, wxButton button)"""
13324 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
13325
13326 def SetCancelButton(*args, **kwargs):
13327 """SetCancelButton(self, wxButton button)"""
13328 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
13329
13330 def GetAffirmativeButton(*args, **kwargs):
13331 """GetAffirmativeButton(self) -> wxButton"""
13332 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
13333
13334 def GetApplyButton(*args, **kwargs):
13335 """GetApplyButton(self) -> wxButton"""
13336 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
13337
13338 def GetNegativeButton(*args, **kwargs):
13339 """GetNegativeButton(self) -> wxButton"""
13340 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
13341
13342 def GetCancelButton(*args, **kwargs):
13343 """GetCancelButton(self) -> wxButton"""
13344 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
13345
13346 def GetHelpButton(*args, **kwargs):
13347 """GetHelpButton(self) -> wxButton"""
13348 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
13349
13350 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13351 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13352 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13353 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13354 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
13355 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
13356
13357 #---------------------------------------------------------------------------
13358
13359 class GBPosition(object):
13360 """
13361 This class represents the position of an item in a virtual grid of
13362 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13363 typemaps that will automatically convert from a 2-element sequence of
13364 integers to a wx.GBPosition, so you can use the more pythonic
13365 representation of the position nearly transparently in Python code.
13366 """
13367 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13368 __repr__ = _swig_repr
13369 def __init__(self, *args, **kwargs):
13370 """
13371 __init__(self, int row=0, int col=0) -> GBPosition
13372
13373 This class represents the position of an item in a virtual grid of
13374 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13375 typemaps that will automatically convert from a 2-element sequence of
13376 integers to a wx.GBPosition, so you can use the more pythonic
13377 representation of the position nearly transparently in Python code.
13378 """
13379 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13380 __swig_destroy__ = _core_.delete_GBPosition
13381 __del__ = lambda self : None;
13382 def GetRow(*args, **kwargs):
13383 """GetRow(self) -> int"""
13384 return _core_.GBPosition_GetRow(*args, **kwargs)
13385
13386 def GetCol(*args, **kwargs):
13387 """GetCol(self) -> int"""
13388 return _core_.GBPosition_GetCol(*args, **kwargs)
13389
13390 def SetRow(*args, **kwargs):
13391 """SetRow(self, int row)"""
13392 return _core_.GBPosition_SetRow(*args, **kwargs)
13393
13394 def SetCol(*args, **kwargs):
13395 """SetCol(self, int col)"""
13396 return _core_.GBPosition_SetCol(*args, **kwargs)
13397
13398 def __eq__(*args, **kwargs):
13399 """
13400 __eq__(self, PyObject other) -> bool
13401
13402 Compare GBPosition for equality.
13403 """
13404 return _core_.GBPosition___eq__(*args, **kwargs)
13405
13406 def __ne__(*args, **kwargs):
13407 """
13408 __ne__(self, PyObject other) -> bool
13409
13410 Compare GBPosition for inequality.
13411 """
13412 return _core_.GBPosition___ne__(*args, **kwargs)
13413
13414 def Set(*args, **kwargs):
13415 """Set(self, int row=0, int col=0)"""
13416 return _core_.GBPosition_Set(*args, **kwargs)
13417
13418 def Get(*args, **kwargs):
13419 """Get(self) -> PyObject"""
13420 return _core_.GBPosition_Get(*args, **kwargs)
13421
13422 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
13423 def __str__(self): return str(self.Get())
13424 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13425 def __len__(self): return len(self.Get())
13426 def __getitem__(self, index): return self.Get()[index]
13427 def __setitem__(self, index, val):
13428 if index == 0: self.SetRow(val)
13429 elif index == 1: self.SetCol(val)
13430 else: raise IndexError
13431 def __nonzero__(self): return self.Get() != (0,0)
13432 __safe_for_unpickling__ = True
13433 def __reduce__(self): return (wx.GBPosition, self.Get())
13434
13435 row = property(GetRow, SetRow)
13436 col = property(GetCol, SetCol)
13437
13438 _core_.GBPosition_swigregister(GBPosition)
13439
13440 class GBSpan(object):
13441 """
13442 This class is used to hold the row and column spanning attributes of
13443 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13444 automatically convert from a 2-element sequence of integers to a
13445 wx.GBSpan, so you can use the more pythonic representation of the span
13446 nearly transparently in Python code.
13447
13448 """
13449 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13450 __repr__ = _swig_repr
13451 def __init__(self, *args, **kwargs):
13452 """
13453 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13454
13455 Construct a new wxGBSpan, optionally setting the rowspan and
13456 colspan. The default is (1,1). (Meaning that the item occupies one
13457 cell in each direction.
13458 """
13459 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13460 __swig_destroy__ = _core_.delete_GBSpan
13461 __del__ = lambda self : None;
13462 def GetRowspan(*args, **kwargs):
13463 """GetRowspan(self) -> int"""
13464 return _core_.GBSpan_GetRowspan(*args, **kwargs)
13465
13466 def GetColspan(*args, **kwargs):
13467 """GetColspan(self) -> int"""
13468 return _core_.GBSpan_GetColspan(*args, **kwargs)
13469
13470 def SetRowspan(*args, **kwargs):
13471 """SetRowspan(self, int rowspan)"""
13472 return _core_.GBSpan_SetRowspan(*args, **kwargs)
13473
13474 def SetColspan(*args, **kwargs):
13475 """SetColspan(self, int colspan)"""
13476 return _core_.GBSpan_SetColspan(*args, **kwargs)
13477
13478 def __eq__(*args, **kwargs):
13479 """
13480 __eq__(self, PyObject other) -> bool
13481
13482 Compare wxGBSpan for equality.
13483 """
13484 return _core_.GBSpan___eq__(*args, **kwargs)
13485
13486 def __ne__(*args, **kwargs):
13487 """
13488 __ne__(self, PyObject other) -> bool
13489
13490 Compare GBSpan for inequality.
13491 """
13492 return _core_.GBSpan___ne__(*args, **kwargs)
13493
13494 def Set(*args, **kwargs):
13495 """Set(self, int rowspan=1, int colspan=1)"""
13496 return _core_.GBSpan_Set(*args, **kwargs)
13497
13498 def Get(*args, **kwargs):
13499 """Get(self) -> PyObject"""
13500 return _core_.GBSpan_Get(*args, **kwargs)
13501
13502 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
13503 def __str__(self): return str(self.Get())
13504 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13505 def __len__(self): return len(self.Get())
13506 def __getitem__(self, index): return self.Get()[index]
13507 def __setitem__(self, index, val):
13508 if index == 0: self.SetRowspan(val)
13509 elif index == 1: self.SetColspan(val)
13510 else: raise IndexError
13511 def __nonzero__(self): return self.Get() != (0,0)
13512 __safe_for_unpickling__ = True
13513 def __reduce__(self): return (wx.GBSpan, self.Get())
13514
13515 rowspan = property(GetRowspan, SetRowspan)
13516 colspan = property(GetColspan, SetColspan)
13517
13518 _core_.GBSpan_swigregister(GBSpan)
13519
13520 class GBSizerItem(SizerItem):
13521 """
13522 The wx.GBSizerItem class is used to track the additional data about
13523 items in a `wx.GridBagSizer` such as the item's position in the grid
13524 and how many rows or columns it spans.
13525
13526 """
13527 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13528 __repr__ = _swig_repr
13529 def __init__(self, *args, **kwargs):
13530 """
13531 __init__(self) -> GBSizerItem
13532
13533 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13534 size will need to be set, as well as a position and span before this
13535 item can be used in a Sizer.
13536
13537 You will probably never need to create a wx.GBSizerItem directly as they
13538 are created automatically when the sizer's Add method is called.
13539 """
13540 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13541 __swig_destroy__ = _core_.delete_GBSizerItem
13542 __del__ = lambda self : None;
13543 def GetPos(*args, **kwargs):
13544 """
13545 GetPos(self) -> GBPosition
13546
13547 Get the grid position of the item
13548 """
13549 return _core_.GBSizerItem_GetPos(*args, **kwargs)
13550
13551 def GetPosTuple(self): return self.GetPos().Get()
13552 def GetSpan(*args, **kwargs):
13553 """
13554 GetSpan(self) -> GBSpan
13555
13556 Get the row and column spanning of the item
13557 """
13558 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
13559
13560 def GetSpanTuple(self): return self.GetSpan().Get()
13561 def SetPos(*args, **kwargs):
13562 """
13563 SetPos(self, GBPosition pos) -> bool
13564
13565 If the item is already a member of a sizer then first ensure that
13566 there is no other item that would intersect with this one at the new
13567 position, then set the new position. Returns True if the change is
13568 successful and after the next Layout() the item will be moved.
13569 """
13570 return _core_.GBSizerItem_SetPos(*args, **kwargs)
13571
13572 def SetSpan(*args, **kwargs):
13573 """
13574 SetSpan(self, GBSpan span) -> bool
13575
13576 If the item is already a member of a sizer then first ensure that
13577 there is no other item that would intersect with this one with its new
13578 spanning size, then set the new spanning. Returns True if the change
13579 is successful and after the next Layout() the item will be resized.
13580
13581 """
13582 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
13583
13584 def Intersects(*args, **kwargs):
13585 """
13586 Intersects(self, GBSizerItem other) -> bool
13587
13588 Returns True if this item and the other item instersect.
13589 """
13590 return _core_.GBSizerItem_Intersects(*args, **kwargs)
13591
13592 def IntersectsPos(*args, **kwargs):
13593 """
13594 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13595
13596 Returns True if the given pos/span would intersect with this item.
13597 """
13598 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
13599
13600 def GetEndPos(*args, **kwargs):
13601 """
13602 GetEndPos(self) -> GBPosition
13603
13604 Get the row and column of the endpoint of this item.
13605 """
13606 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
13607
13608 def GetGBSizer(*args, **kwargs):
13609 """
13610 GetGBSizer(self) -> GridBagSizer
13611
13612 Get the sizer this item is a member of.
13613 """
13614 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
13615
13616 def SetGBSizer(*args, **kwargs):
13617 """
13618 SetGBSizer(self, GridBagSizer sizer)
13619
13620 Set the sizer this item is a member of.
13621 """
13622 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
13623
13624 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13625 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13626 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13627 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
13628 _core_.GBSizerItem_swigregister(GBSizerItem)
13629 DefaultSpan = cvar.DefaultSpan
13630
13631 def GBSizerItemWindow(*args, **kwargs):
13632 """
13633 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13634 int border, PyObject userData=None) -> GBSizerItem
13635
13636 Construct a `wx.GBSizerItem` for a window.
13637 """
13638 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
13639 return val
13640
13641 def GBSizerItemSizer(*args, **kwargs):
13642 """
13643 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13644 int border, PyObject userData=None) -> GBSizerItem
13645
13646 Construct a `wx.GBSizerItem` for a sizer
13647 """
13648 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
13649 return val
13650
13651 def GBSizerItemSpacer(*args, **kwargs):
13652 """
13653 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13654 int flag, int border, PyObject userData=None) -> GBSizerItem
13655
13656 Construct a `wx.GBSizerItem` for a spacer.
13657 """
13658 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
13659 return val
13660
13661 class GridBagSizer(FlexGridSizer):
13662 """
13663 A `wx.Sizer` that can lay out items in a virtual grid like a
13664 `wx.FlexGridSizer` but in this case explicit positioning of the items
13665 is allowed using `wx.GBPosition`, and items can optionally span more
13666 than one row and/or column using `wx.GBSpan`. The total size of the
13667 virtual grid is determined by the largest row and column that items are
13668 positioned at, adjusted for spanning.
13669
13670 """
13671 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13672 __repr__ = _swig_repr
13673 def __init__(self, *args, **kwargs):
13674 """
13675 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13676
13677 Constructor, with optional parameters to specify the gap between the
13678 rows and columns.
13679 """
13680 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
13681 self._setOORInfo(self)
13682
13683 def Add(*args, **kwargs):
13684 """
13685 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
13686 int border=0, userData=None) -> wx.GBSizerItem
13687
13688 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13689 more than one row or column as specified with *span*. The remaining
13690 args behave similarly to `wx.Sizer.Add`.
13691
13692 Returns True if the item was successfully placed at the given cell
13693 position, False if something was already there.
13694
13695 """
13696 return _core_.GridBagSizer_Add(*args, **kwargs)
13697
13698 def AddItem(*args, **kwargs):
13699 """
13700 Add(self, GBSizerItem item) -> wx.GBSizerItem
13701
13702 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13703 the item was successfully placed at its given cell position, False if
13704 something was already there.
13705 """
13706 return _core_.GridBagSizer_AddItem(*args, **kwargs)
13707
13708 def GetCellSize(*args, **kwargs):
13709 """
13710 GetCellSize(self, int row, int col) -> Size
13711
13712 Get the size of the specified cell, including hgap and
13713 vgap. Only valid after a Layout.
13714 """
13715 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13716
13717 def GetEmptyCellSize(*args, **kwargs):
13718 """
13719 GetEmptyCellSize(self) -> Size
13720
13721 Get the size used for cells in the grid with no item.
13722 """
13723 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
13724
13725 def SetEmptyCellSize(*args, **kwargs):
13726 """
13727 SetEmptyCellSize(self, Size sz)
13728
13729 Set the size used for cells in the grid with no item.
13730 """
13731 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
13732
13733 def GetItemPosition(*args):
13734 """
13735 GetItemPosition(self, item) -> GBPosition
13736
13737 Get the grid position of the specified *item* where *item* is either a
13738 window or subsizer that is a member of this sizer, or a zero-based
13739 index of an item.
13740 """
13741 return _core_.GridBagSizer_GetItemPosition(*args)
13742
13743 def SetItemPosition(*args):
13744 """
13745 SetItemPosition(self, item, GBPosition pos) -> bool
13746
13747 Set the grid position of the specified *item* where *item* is either a
13748 window or subsizer that is a member of this sizer, or a zero-based
13749 index of an item. Returns True on success. If the move is not
13750 allowed (because an item is already there) then False is returned.
13751
13752 """
13753 return _core_.GridBagSizer_SetItemPosition(*args)
13754
13755 def GetItemSpan(*args):
13756 """
13757 GetItemSpan(self, item) -> GBSpan
13758
13759 Get the row/col spanning of the specified *item* where *item* is
13760 either a window or subsizer that is a member of this sizer, or a
13761 zero-based index of an item.
13762 """
13763 return _core_.GridBagSizer_GetItemSpan(*args)
13764
13765 def SetItemSpan(*args):
13766 """
13767 SetItemSpan(self, item, GBSpan span) -> bool
13768
13769 Set the row/col spanning of the specified *item* where *item* is
13770 either a window or subsizer that is a member of this sizer, or a
13771 zero-based index of an item. Returns True on success. If the move is
13772 not allowed (because an item is already there) then False is returned.
13773 """
13774 return _core_.GridBagSizer_SetItemSpan(*args)
13775
13776 def FindItem(*args):
13777 """
13778 FindItem(self, item) -> GBSizerItem
13779
13780 Find the sizer item for the given window or subsizer, returns None if
13781 not found. (non-recursive)
13782 """
13783 return _core_.GridBagSizer_FindItem(*args)
13784
13785 def GetItem(self, item):
13786 gbsi = None
13787 si = wx.FlexGridSizer.GetItem(self, item)
13788 if not si:
13789 return None
13790 if type(item) is not int:
13791 gbsi = self.FindItem(item)
13792 if gbsi: return gbsi
13793 return si
13794
13795 def FindItemAtPosition(*args, **kwargs):
13796 """
13797 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13798
13799 Return the sizer item for the given grid cell, or None if there is no
13800 item at that position. (non-recursive)
13801 """
13802 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13803
13804 def FindItemAtPoint(*args, **kwargs):
13805 """
13806 FindItemAtPoint(self, Point pt) -> GBSizerItem
13807
13808 Return the sizer item located at the point given in *pt*, or None if
13809 there is no item at that point. The (x,y) coordinates in pt correspond
13810 to the client coordinates of the window using the sizer for
13811 layout. (non-recursive)
13812 """
13813 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13814
13815 def CheckForIntersection(*args, **kwargs):
13816 """
13817 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13818
13819 Look at all items and see if any intersect (or would overlap) the
13820 given *item*. Returns True if so, False if there would be no overlap.
13821 If an *excludeItem* is given then it will not be checked for
13822 intersection, for example it may be the item we are checking the
13823 position of.
13824
13825 """
13826 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
13827
13828 def CheckForIntersectionPos(*args, **kwargs):
13829 """
13830 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13831
13832 Look at all items and see if any intersect (or would overlap) the
13833 given position and span. Returns True if so, False if there would be
13834 no overlap. If an *excludeItem* is given then it will not be checked
13835 for intersection, for example it may be the item we are checking the
13836 position of.
13837 """
13838 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
13839
13840 _core_.GridBagSizer_swigregister(GridBagSizer)
13841
13842 #---------------------------------------------------------------------------
13843
13844 Left = _core_.Left
13845 Top = _core_.Top
13846 Right = _core_.Right
13847 Bottom = _core_.Bottom
13848 Width = _core_.Width
13849 Height = _core_.Height
13850 Centre = _core_.Centre
13851 Center = _core_.Center
13852 CentreX = _core_.CentreX
13853 CentreY = _core_.CentreY
13854 Unconstrained = _core_.Unconstrained
13855 AsIs = _core_.AsIs
13856 PercentOf = _core_.PercentOf
13857 Above = _core_.Above
13858 Below = _core_.Below
13859 LeftOf = _core_.LeftOf
13860 RightOf = _core_.RightOf
13861 SameAs = _core_.SameAs
13862 Absolute = _core_.Absolute
13863 class IndividualLayoutConstraint(Object):
13864 """
13865 Objects of this class are stored in the `wx.LayoutConstraints` class as
13866 one of eight possible constraints that a window can be involved in.
13867 You will never need to create an instance of
13868 wx.IndividualLayoutConstraint, rather you should create a
13869 `wx.LayoutConstraints` instance and use the individual contstraints
13870 that it contains.
13871 """
13872 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13873 def __init__(self): raise AttributeError, "No constructor defined"
13874 __repr__ = _swig_repr
13875 def Set(*args, **kwargs):
13876 """
13877 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13878
13879 Sets the properties of the constraint. Normally called by one of the
13880 convenience functions such as Above, RightOf, SameAs.
13881 """
13882 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13883
13884 def LeftOf(*args, **kwargs):
13885 """
13886 LeftOf(self, Window sibling, int marg=0)
13887
13888 Constrains this edge to be to the left of the given window, with an
13889 optional margin. Implicitly, this is relative to the left edge of the
13890 other window.
13891 """
13892 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13893
13894 def RightOf(*args, **kwargs):
13895 """
13896 RightOf(self, Window sibling, int marg=0)
13897
13898 Constrains this edge to be to the right of the given window, with an
13899 optional margin. Implicitly, this is relative to the right edge of the
13900 other window.
13901 """
13902 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13903
13904 def Above(*args, **kwargs):
13905 """
13906 Above(self, Window sibling, int marg=0)
13907
13908 Constrains this edge to be above the given window, with an optional
13909 margin. Implicitly, this is relative to the top edge of the other
13910 window.
13911 """
13912 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13913
13914 def Below(*args, **kwargs):
13915 """
13916 Below(self, Window sibling, int marg=0)
13917
13918 Constrains this edge to be below the given window, with an optional
13919 margin. Implicitly, this is relative to the bottom edge of the other
13920 window.
13921 """
13922 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13923
13924 def SameAs(*args, **kwargs):
13925 """
13926 SameAs(self, Window otherW, int edge, int marg=0)
13927
13928 Constrains this edge or dimension to be to the same as the edge of the
13929 given window, with an optional margin.
13930 """
13931 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13932
13933 def PercentOf(*args, **kwargs):
13934 """
13935 PercentOf(self, Window otherW, int wh, int per)
13936
13937 Constrains this edge or dimension to be to a percentage of the given
13938 window, with an optional margin.
13939 """
13940 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13941
13942 def Absolute(*args, **kwargs):
13943 """
13944 Absolute(self, int val)
13945
13946 Constrains this edge or dimension to be the given absolute value.
13947 """
13948 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13949
13950 def Unconstrained(*args, **kwargs):
13951 """
13952 Unconstrained(self)
13953
13954 Sets this edge or dimension to be unconstrained, that is, dependent on
13955 other edges and dimensions from which this value can be deduced.
13956 """
13957 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13958
13959 def AsIs(*args, **kwargs):
13960 """
13961 AsIs(self)
13962
13963 Sets this edge or constraint to be whatever the window's value is at
13964 the moment. If either of the width and height constraints are *as is*,
13965 the window will not be resized, but moved instead. This is important
13966 when considering panel items which are intended to have a default
13967 size, such as a button, which may take its size from the size of the
13968 button label.
13969 """
13970 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13971
13972 def GetOtherWindow(*args, **kwargs):
13973 """GetOtherWindow(self) -> Window"""
13974 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13975
13976 def GetMyEdge(*args, **kwargs):
13977 """GetMyEdge(self) -> int"""
13978 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13979
13980 def SetEdge(*args, **kwargs):
13981 """SetEdge(self, int which)"""
13982 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13983
13984 def SetValue(*args, **kwargs):
13985 """SetValue(self, int v)"""
13986 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13987
13988 def GetMargin(*args, **kwargs):
13989 """GetMargin(self) -> int"""
13990 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13991
13992 def SetMargin(*args, **kwargs):
13993 """SetMargin(self, int m)"""
13994 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13995
13996 def GetValue(*args, **kwargs):
13997 """GetValue(self) -> int"""
13998 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13999
14000 def GetPercent(*args, **kwargs):
14001 """GetPercent(self) -> int"""
14002 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
14003
14004 def GetOtherEdge(*args, **kwargs):
14005 """GetOtherEdge(self) -> int"""
14006 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
14007
14008 def GetDone(*args, **kwargs):
14009 """GetDone(self) -> bool"""
14010 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
14011
14012 def SetDone(*args, **kwargs):
14013 """SetDone(self, bool d)"""
14014 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
14015
14016 def GetRelationship(*args, **kwargs):
14017 """GetRelationship(self) -> int"""
14018 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
14019
14020 def SetRelationship(*args, **kwargs):
14021 """SetRelationship(self, int r)"""
14022 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
14023
14024 def ResetIfWin(*args, **kwargs):
14025 """
14026 ResetIfWin(self, Window otherW) -> bool
14027
14028 Reset constraint if it mentions otherWin
14029 """
14030 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
14031
14032 def SatisfyConstraint(*args, **kwargs):
14033 """
14034 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
14035
14036 Try to satisfy constraint
14037 """
14038 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
14039
14040 def GetEdge(*args, **kwargs):
14041 """
14042 GetEdge(self, int which, Window thisWin, Window other) -> int
14043
14044 Get the value of this edge or dimension, or if this
14045 is not determinable, -1.
14046 """
14047 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
14048
14049 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
14050 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
14051 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
14052 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
14053 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
14054 Percent = property(GetPercent,doc="See `GetPercent`")
14055 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
14056 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
14057 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
14058
14059 class LayoutConstraints(Object):
14060 """
14061 **Note:** constraints are now deprecated and you should use sizers
14062 instead.
14063
14064 Objects of this class can be associated with a window to define its
14065 layout constraints, with respect to siblings or its parent.
14066
14067 The class consists of the following eight constraints of class
14068 wx.IndividualLayoutConstraint, some or all of which should be accessed
14069 directly to set the appropriate constraints.
14070
14071 * left: represents the left hand edge of the window
14072 * right: represents the right hand edge of the window
14073 * top: represents the top edge of the window
14074 * bottom: represents the bottom edge of the window
14075 * width: represents the width of the window
14076 * height: represents the height of the window
14077 * centreX: represents the horizontal centre point of the window
14078 * centreY: represents the vertical centre point of the window
14079
14080 Most constraints are initially set to have the relationship
14081 wxUnconstrained, which means that their values should be calculated by
14082 looking at known constraints. The exceptions are width and height,
14083 which are set to wxAsIs to ensure that if the user does not specify a
14084 constraint, the existing width and height will be used, to be
14085 compatible with panel items which often have take a default size. If
14086 the constraint is ``wx.AsIs``, the dimension will not be changed.
14087
14088 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
14089
14090 """
14091 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14092 __repr__ = _swig_repr
14093 left = property(_core_.LayoutConstraints_left_get)
14094 top = property(_core_.LayoutConstraints_top_get)
14095 right = property(_core_.LayoutConstraints_right_get)
14096 bottom = property(_core_.LayoutConstraints_bottom_get)
14097 width = property(_core_.LayoutConstraints_width_get)
14098 height = property(_core_.LayoutConstraints_height_get)
14099 centreX = property(_core_.LayoutConstraints_centreX_get)
14100 centreY = property(_core_.LayoutConstraints_centreY_get)
14101 def __init__(self, *args, **kwargs):
14102 """__init__(self) -> LayoutConstraints"""
14103 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14104 __swig_destroy__ = _core_.delete_LayoutConstraints
14105 __del__ = lambda self : None;
14106 def SatisfyConstraints(*args, **kwargs):
14107 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
14108 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
14109
14110 def AreSatisfied(*args, **kwargs):
14111 """AreSatisfied(self) -> bool"""
14112 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
14113
14114 _core_.LayoutConstraints_swigregister(LayoutConstraints)
14115
14116 #----------------------------------------------------------------------------
14117
14118 # Use Python's bool constants if available, make some if not
14119 try:
14120 True
14121 except NameError:
14122 __builtins__.True = 1==1
14123 __builtins__.False = 1==0
14124 def bool(value): return not not value
14125 __builtins__.bool = bool
14126
14127
14128
14129 # workarounds for bad wxRTTI names
14130 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14131 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14132 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14133
14134
14135 #----------------------------------------------------------------------------
14136 # Load version numbers from __version__... Ensure that major and minor
14137 # versions are the same for both wxPython and wxWidgets.
14138
14139 from __version__ import *
14140 __version__ = VERSION_STRING
14141
14142 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14143 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
14144 if RELEASE_VERSION != _core_.RELEASE_VERSION:
14145 import warnings
14146 warnings.warn("wxPython/wxWidgets release number mismatch")
14147
14148
14149 def version():
14150 """Returns a string containing version and port info"""
14151 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14152 if wx.Platform == '__WXMSW__':
14153 port = 'msw'
14154 elif wx.Platform == '__WXMAC__':
14155 port = 'mac'
14156 elif wx.Platform == '__WXGTK__':
14157 port = 'gtk'
14158 if 'gtk2' in wx.PlatformInfo:
14159 port = 'gtk2'
14160 else:
14161 port = '?'
14162
14163 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14164
14165
14166 #----------------------------------------------------------------------------
14167
14168 # Set wxPython's default string<-->unicode conversion encoding from
14169 # the locale, but only if Python's default hasn't been changed. (We
14170 # assume that if the user has customized it already then that is the
14171 # encoding we need to use as well.)
14172 #
14173 # The encoding selected here is used when string or unicode objects
14174 # need to be converted in order to pass them to wxWidgets. Please be
14175 # aware that the default encoding within the same locale may be
14176 # slightly different on different platforms. For example, please see
14177 # http://www.alanwood.net/demos/charsetdiffs.html for differences
14178 # between the common latin/roman encodings.
14179
14180 default = _sys.getdefaultencoding()
14181 if default == 'ascii':
14182 import locale
14183 import codecs
14184 try:
14185 if hasattr(locale, 'getpreferredencoding'):
14186 default = locale.getpreferredencoding()
14187 else:
14188 default = locale.getdefaultlocale()[1]
14189 codecs.lookup(default)
14190 except (ValueError, LookupError, TypeError):
14191 default = _sys.getdefaultencoding()
14192 del locale
14193 del codecs
14194 if default:
14195 wx.SetDefaultPyEncoding(default)
14196 del default
14197
14198 #----------------------------------------------------------------------------
14199
14200 class PyDeadObjectError(AttributeError):
14201 pass
14202
14203 class _wxPyDeadObject(object):
14204 """
14205 Instances of wx objects that are OOR capable will have their __class__
14206 changed to this class when the C++ object is deleted. This should help
14207 prevent crashes due to referencing a bogus C++ pointer.
14208 """
14209 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14210 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14211
14212 def __repr__(self):
14213 if not hasattr(self, "_name"):
14214 self._name = "[unknown]"
14215 return self.reprStr % self._name
14216
14217 def __getattr__(self, *args):
14218 if not hasattr(self, "_name"):
14219 self._name = "[unknown]"
14220 raise PyDeadObjectError(self.attrStr % self._name)
14221
14222 def __nonzero__(self):
14223 return 0
14224
14225
14226
14227 class PyUnbornObjectError(AttributeError):
14228 pass
14229
14230 class _wxPyUnbornObject(object):
14231 """
14232 Some stock objects are created when the wx._core module is
14233 imported, but their C++ instance is not created until the wx.App
14234 object is created and initialized. These object instances will
14235 temporarily have their __class__ changed to this class so an
14236 exception will be raised if they are used before the C++ instance
14237 is ready.
14238 """
14239
14240 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14241 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14242
14243 def __repr__(self):
14244 #if not hasattr(self, "_name"):
14245 # self._name = "[unknown]"
14246 return self.reprStr #% self._name
14247
14248 def __getattr__(self, *args):
14249 #if not hasattr(self, "_name"):
14250 # self._name = "[unknown]"
14251 raise PyUnbornObjectError(self.attrStr) # % self._name )
14252
14253 def __nonzero__(self):
14254 return 0
14255
14256
14257 #----------------------------------------------------------------------------
14258
14259 def CallAfter(callable, *args, **kw):
14260 """
14261 Call the specified function after the current and pending event
14262 handlers have been completed. This is also good for making GUI
14263 method calls from non-GUI threads. Any extra positional or
14264 keyword args are passed on to the callable when it is called.
14265
14266 :see: `wx.CallLater`
14267 """
14268 app = wx.GetApp()
14269 assert app is not None, 'No wx.App created yet'
14270
14271 if not hasattr(app, "_CallAfterId"):
14272 app._CallAfterId = wx.NewEventType()
14273 app.Connect(-1, -1, app._CallAfterId,
14274 lambda event: event.callable(*event.args, **event.kw) )
14275 evt = wx.PyEvent()
14276 evt.SetEventType(app._CallAfterId)
14277 evt.callable = callable
14278 evt.args = args
14279 evt.kw = kw
14280 wx.PostEvent(app, evt)
14281
14282 #----------------------------------------------------------------------------
14283
14284
14285 class CallLater:
14286 """
14287 A convenience class for `wx.Timer`, that calls the given callable
14288 object once after the given amount of milliseconds, passing any
14289 positional or keyword args. The return value of the callable is
14290 availbale after it has been run with the `GetResult` method.
14291
14292 If you don't need to get the return value or restart the timer
14293 then there is no need to hold a reference to this object. It will
14294 hold a reference to itself while the timer is running (the timer
14295 has a reference to self.Notify) but the cycle will be broken when
14296 the timer completes, automatically cleaning up the wx.CallLater
14297 object.
14298
14299 :see: `wx.CallAfter`
14300 """
14301 def __init__(self, millis, callable, *args, **kwargs):
14302 self.millis = millis
14303 self.callable = callable
14304 self.SetArgs(*args, **kwargs)
14305 self.runCount = 0
14306 self.running = False
14307 self.hasRun = False
14308 self.result = None
14309 self.timer = None
14310 self.Start()
14311
14312 def __del__(self):
14313 self.Stop()
14314
14315
14316 def Start(self, millis=None, *args, **kwargs):
14317 """
14318 (Re)start the timer
14319 """
14320 self.hasRun = False
14321 if millis is not None:
14322 self.millis = millis
14323 if args or kwargs:
14324 self.SetArgs(*args, **kwargs)
14325 self.Stop()
14326 self.timer = wx.PyTimer(self.Notify)
14327 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
14328 self.running = True
14329 Restart = Start
14330
14331
14332 def Stop(self):
14333 """
14334 Stop and destroy the timer.
14335 """
14336 if self.timer is not None:
14337 self.timer.Stop()
14338 self.timer = None
14339
14340
14341 def GetInterval(self):
14342 if self.timer is not None:
14343 return self.timer.GetInterval()
14344 else:
14345 return 0
14346
14347
14348 def IsRunning(self):
14349 return self.timer is not None and self.timer.IsRunning()
14350
14351
14352 def SetArgs(self, *args, **kwargs):
14353 """
14354 (Re)set the args passed to the callable object. This is
14355 useful in conjunction with Restart if you want to schedule a
14356 new call to the same callable object but with different
14357 parameters.
14358 """
14359 self.args = args
14360 self.kwargs = kwargs
14361
14362
14363 def HasRun(self):
14364 return self.hasRun
14365
14366 def GetResult(self):
14367 return self.result
14368
14369 def Notify(self):
14370 """
14371 The timer has expired so call the callable.
14372 """
14373 if self.callable and getattr(self.callable, 'im_self', True):
14374 self.runCount += 1
14375 self.running = False
14376 self.result = self.callable(*self.args, **self.kwargs)
14377 self.hasRun = True
14378 if not self.running:
14379 # if it wasn't restarted, then cleanup
14380 wx.CallAfter(self.Stop)
14381
14382 Interval = property(GetInterval)
14383 Result = property(GetResult)
14384
14385
14386 class FutureCall(CallLater):
14387 """A compatibility alias for `CallLater`."""
14388
14389 #----------------------------------------------------------------------------
14390 # Control which items in this module should be documented by epydoc.
14391 # We allow only classes and functions, which will help reduce the size
14392 # of the docs by filtering out the zillions of constants, EVT objects,
14393 # and etc that don't make much sense by themselves, but are instead
14394 # documented (or will be) as part of the classes/functions/methods
14395 # where they should be used.
14396
14397 class __DocFilter:
14398 """
14399 A filter for epydoc that only allows non-Ptr classes and
14400 functions, in order to reduce the clutter in the API docs.
14401 """
14402 def __init__(self, globals):
14403 self._globals = globals
14404
14405 def __call__(self, name):
14406 import types
14407 obj = self._globals.get(name, None)
14408
14409 # only document classes and function
14410 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14411 return False
14412
14413 # skip other things that are private or will be documented as part of somethign else
14414 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
14415 return False
14416
14417 # skip functions that are duplicates of static functions in a class
14418 if name.find('_') != -1:
14419 cls = self._globals.get(name.split('_')[0], None)
14420 methname = name.split('_')[1]
14421 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14422 return False
14423
14424 return True
14425
14426 #----------------------------------------------------------------------------
14427 #----------------------------------------------------------------------------
14428
14429 # Import other modules in this package that should show up in the
14430 # "core" wx namespace
14431 from _gdi import *
14432 from _windows import *
14433 from _controls import *
14434 from _misc import *
14435
14436 #----------------------------------------------------------------------------
14437 #----------------------------------------------------------------------------
14438
14439
14440