]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
Build fix for motif.
[wxWidgets.git] / wxPython / src / mac / _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 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106 RETAINED = _core_.RETAINED
107 BACKINGSTORE = _core_.BACKINGSTORE
108 COLOURED = _core_.COLOURED
109 FIXED_LENGTH = _core_.FIXED_LENGTH
110 LB_NEEDED_SB = _core_.LB_NEEDED_SB
111 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112 LB_SORT = _core_.LB_SORT
113 LB_SINGLE = _core_.LB_SINGLE
114 LB_MULTIPLE = _core_.LB_MULTIPLE
115 LB_EXTENDED = _core_.LB_EXTENDED
116 LB_OWNERDRAW = _core_.LB_OWNERDRAW
117 LB_HSCROLL = _core_.LB_HSCROLL
118 PROCESS_ENTER = _core_.PROCESS_ENTER
119 PASSWORD = _core_.PASSWORD
120 CB_SIMPLE = _core_.CB_SIMPLE
121 CB_DROPDOWN = _core_.CB_DROPDOWN
122 CB_SORT = _core_.CB_SORT
123 CB_READONLY = _core_.CB_READONLY
124 RA_HORIZONTAL = _core_.RA_HORIZONTAL
125 RA_VERTICAL = _core_.RA_VERTICAL
126 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
128 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
129 RB_GROUP = _core_.RB_GROUP
130 RB_SINGLE = _core_.RB_SINGLE
131 SB_HORIZONTAL = _core_.SB_HORIZONTAL
132 SB_VERTICAL = _core_.SB_VERTICAL
133 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
134 ST_SIZEGRIP = _core_.ST_SIZEGRIP
135 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
136 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137 ST_DOTS_END = _core_.ST_DOTS_END
138 FLOOD_SURFACE = _core_.FLOOD_SURFACE
139 FLOOD_BORDER = _core_.FLOOD_BORDER
140 ODDEVEN_RULE = _core_.ODDEVEN_RULE
141 WINDING_RULE = _core_.WINDING_RULE
142 TOOL_TOP = _core_.TOOL_TOP
143 TOOL_BOTTOM = _core_.TOOL_BOTTOM
144 TOOL_LEFT = _core_.TOOL_LEFT
145 TOOL_RIGHT = _core_.TOOL_RIGHT
146 OK = _core_.OK
147 YES_NO = _core_.YES_NO
148 CANCEL = _core_.CANCEL
149 YES = _core_.YES
150 NO = _core_.NO
151 NO_DEFAULT = _core_.NO_DEFAULT
152 YES_DEFAULT = _core_.YES_DEFAULT
153 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154 ICON_HAND = _core_.ICON_HAND
155 ICON_QUESTION = _core_.ICON_QUESTION
156 ICON_INFORMATION = _core_.ICON_INFORMATION
157 ICON_STOP = _core_.ICON_STOP
158 ICON_ASTERISK = _core_.ICON_ASTERISK
159 ICON_MASK = _core_.ICON_MASK
160 ICON_WARNING = _core_.ICON_WARNING
161 ICON_ERROR = _core_.ICON_ERROR
162 FORWARD = _core_.FORWARD
163 BACKWARD = _core_.BACKWARD
164 RESET = _core_.RESET
165 HELP = _core_.HELP
166 MORE = _core_.MORE
167 SETUP = _core_.SETUP
168 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170 SIZE_AUTO = _core_.SIZE_AUTO
171 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
173 SIZE_FORCE = _core_.SIZE_FORCE
174 PORTRAIT = _core_.PORTRAIT
175 LANDSCAPE = _core_.LANDSCAPE
176 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180 ID_ANY = _core_.ID_ANY
181 ID_SEPARATOR = _core_.ID_SEPARATOR
182 ID_NONE = _core_.ID_NONE
183 ID_LOWEST = _core_.ID_LOWEST
184 ID_OPEN = _core_.ID_OPEN
185 ID_CLOSE = _core_.ID_CLOSE
186 ID_NEW = _core_.ID_NEW
187 ID_SAVE = _core_.ID_SAVE
188 ID_SAVEAS = _core_.ID_SAVEAS
189 ID_REVERT = _core_.ID_REVERT
190 ID_EXIT = _core_.ID_EXIT
191 ID_UNDO = _core_.ID_UNDO
192 ID_REDO = _core_.ID_REDO
193 ID_HELP = _core_.ID_HELP
194 ID_PRINT = _core_.ID_PRINT
195 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196 ID_PREVIEW = _core_.ID_PREVIEW
197 ID_ABOUT = _core_.ID_ABOUT
198 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203 ID_PREFERENCES = _core_.ID_PREFERENCES
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_FILE1 = _core_.ID_FILE1
224 ID_FILE2 = _core_.ID_FILE2
225 ID_FILE3 = _core_.ID_FILE3
226 ID_FILE4 = _core_.ID_FILE4
227 ID_FILE5 = _core_.ID_FILE5
228 ID_FILE6 = _core_.ID_FILE6
229 ID_FILE7 = _core_.ID_FILE7
230 ID_FILE8 = _core_.ID_FILE8
231 ID_FILE9 = _core_.ID_FILE9
232 ID_OK = _core_.ID_OK
233 ID_CANCEL = _core_.ID_CANCEL
234 ID_APPLY = _core_.ID_APPLY
235 ID_YES = _core_.ID_YES
236 ID_NO = _core_.ID_NO
237 ID_STATIC = _core_.ID_STATIC
238 ID_FORWARD = _core_.ID_FORWARD
239 ID_BACKWARD = _core_.ID_BACKWARD
240 ID_DEFAULT = _core_.ID_DEFAULT
241 ID_MORE = _core_.ID_MORE
242 ID_SETUP = _core_.ID_SETUP
243 ID_RESET = _core_.ID_RESET
244 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245 ID_YESTOALL = _core_.ID_YESTOALL
246 ID_NOTOALL = _core_.ID_NOTOALL
247 ID_ABORT = _core_.ID_ABORT
248 ID_RETRY = _core_.ID_RETRY
249 ID_IGNORE = _core_.ID_IGNORE
250 ID_ADD = _core_.ID_ADD
251 ID_REMOVE = _core_.ID_REMOVE
252 ID_UP = _core_.ID_UP
253 ID_DOWN = _core_.ID_DOWN
254 ID_HOME = _core_.ID_HOME
255 ID_REFRESH = _core_.ID_REFRESH
256 ID_STOP = _core_.ID_STOP
257 ID_INDEX = _core_.ID_INDEX
258 ID_BOLD = _core_.ID_BOLD
259 ID_ITALIC = _core_.ID_ITALIC
260 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264 ID_UNDERLINE = _core_.ID_UNDERLINE
265 ID_INDENT = _core_.ID_INDENT
266 ID_UNINDENT = _core_.ID_UNINDENT
267 ID_ZOOM_100 = _core_.ID_ZOOM_100
268 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269 ID_ZOOM_IN = _core_.ID_ZOOM_IN
270 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271 ID_UNDELETE = _core_.ID_UNDELETE
272 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
273 ID_HIGHEST = _core_.ID_HIGHEST
274 ACCEL_ALT = _core_.ACCEL_ALT
275 ACCEL_CTRL = _core_.ACCEL_CTRL
276 ACCEL_SHIFT = _core_.ACCEL_SHIFT
277 ACCEL_NORMAL = _core_.ACCEL_NORMAL
278 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
279 PD_APP_MODAL = _core_.PD_APP_MODAL
280 PD_CAN_ABORT = _core_.PD_CAN_ABORT
281 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
282 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
283 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
284 PD_SMOOTH = _core_.PD_SMOOTH
285 PD_CAN_SKIP = _core_.PD_CAN_SKIP
286 MENU_TEAROFF = _core_.MENU_TEAROFF
287 MB_DOCKABLE = _core_.MB_DOCKABLE
288 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290 LI_HORIZONTAL = _core_.LI_HORIZONTAL
291 LI_VERTICAL = _core_.LI_VERTICAL
292 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298 MM_TEXT = _core_.MM_TEXT
299 MM_LOMETRIC = _core_.MM_LOMETRIC
300 MM_HIMETRIC = _core_.MM_HIMETRIC
301 MM_LOENGLISH = _core_.MM_LOENGLISH
302 MM_HIENGLISH = _core_.MM_HIENGLISH
303 MM_TWIPS = _core_.MM_TWIPS
304 MM_ISOTROPIC = _core_.MM_ISOTROPIC
305 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306 MM_POINTS = _core_.MM_POINTS
307 MM_METRIC = _core_.MM_METRIC
308 CENTRE = _core_.CENTRE
309 CENTER = _core_.CENTER
310 HORIZONTAL = _core_.HORIZONTAL
311 VERTICAL = _core_.VERTICAL
312 BOTH = _core_.BOTH
313 LEFT = _core_.LEFT
314 RIGHT = _core_.RIGHT
315 UP = _core_.UP
316 DOWN = _core_.DOWN
317 TOP = _core_.TOP
318 BOTTOM = _core_.BOTTOM
319 NORTH = _core_.NORTH
320 SOUTH = _core_.SOUTH
321 WEST = _core_.WEST
322 EAST = _core_.EAST
323 ALL = _core_.ALL
324 ALIGN_NOT = _core_.ALIGN_NOT
325 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327 ALIGN_LEFT = _core_.ALIGN_LEFT
328 ALIGN_TOP = _core_.ALIGN_TOP
329 ALIGN_RIGHT = _core_.ALIGN_RIGHT
330 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333 ALIGN_CENTER = _core_.ALIGN_CENTER
334 ALIGN_CENTRE = _core_.ALIGN_CENTRE
335 ALIGN_MASK = _core_.ALIGN_MASK
336 STRETCH_NOT = _core_.STRETCH_NOT
337 SHRINK = _core_.SHRINK
338 GROW = _core_.GROW
339 EXPAND = _core_.EXPAND
340 SHAPED = _core_.SHAPED
341 FIXED_MINSIZE = _core_.FIXED_MINSIZE
342 TILE = _core_.TILE
343 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344 BORDER_DEFAULT = _core_.BORDER_DEFAULT
345 BORDER_NONE = _core_.BORDER_NONE
346 BORDER_STATIC = _core_.BORDER_STATIC
347 BORDER_SIMPLE = _core_.BORDER_SIMPLE
348 BORDER_RAISED = _core_.BORDER_RAISED
349 BORDER_SUNKEN = _core_.BORDER_SUNKEN
350 BORDER_DOUBLE = _core_.BORDER_DOUBLE
351 BORDER_MASK = _core_.BORDER_MASK
352 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
355 DEFAULT = _core_.DEFAULT
356 DECORATIVE = _core_.DECORATIVE
357 ROMAN = _core_.ROMAN
358 SCRIPT = _core_.SCRIPT
359 SWISS = _core_.SWISS
360 MODERN = _core_.MODERN
361 TELETYPE = _core_.TELETYPE
362 VARIABLE = _core_.VARIABLE
363 FIXED = _core_.FIXED
364 NORMAL = _core_.NORMAL
365 LIGHT = _core_.LIGHT
366 BOLD = _core_.BOLD
367 ITALIC = _core_.ITALIC
368 SLANT = _core_.SLANT
369 SOLID = _core_.SOLID
370 DOT = _core_.DOT
371 LONG_DASH = _core_.LONG_DASH
372 SHORT_DASH = _core_.SHORT_DASH
373 DOT_DASH = _core_.DOT_DASH
374 USER_DASH = _core_.USER_DASH
375 TRANSPARENT = _core_.TRANSPARENT
376 STIPPLE = _core_.STIPPLE
377 STIPPLE_MASK = _core_.STIPPLE_MASK
378 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
379 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382 CROSS_HATCH = _core_.CROSS_HATCH
383 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384 VERTICAL_HATCH = _core_.VERTICAL_HATCH
385 JOIN_BEVEL = _core_.JOIN_BEVEL
386 JOIN_MITER = _core_.JOIN_MITER
387 JOIN_ROUND = _core_.JOIN_ROUND
388 CAP_ROUND = _core_.CAP_ROUND
389 CAP_PROJECTING = _core_.CAP_PROJECTING
390 CAP_BUTT = _core_.CAP_BUTT
391 CLEAR = _core_.CLEAR
392 XOR = _core_.XOR
393 INVERT = _core_.INVERT
394 OR_REVERSE = _core_.OR_REVERSE
395 AND_REVERSE = _core_.AND_REVERSE
396 COPY = _core_.COPY
397 AND = _core_.AND
398 AND_INVERT = _core_.AND_INVERT
399 NO_OP = _core_.NO_OP
400 NOR = _core_.NOR
401 EQUIV = _core_.EQUIV
402 SRC_INVERT = _core_.SRC_INVERT
403 OR_INVERT = _core_.OR_INVERT
404 NAND = _core_.NAND
405 OR = _core_.OR
406 SET = _core_.SET
407 WXK_BACK = _core_.WXK_BACK
408 WXK_TAB = _core_.WXK_TAB
409 WXK_RETURN = _core_.WXK_RETURN
410 WXK_ESCAPE = _core_.WXK_ESCAPE
411 WXK_SPACE = _core_.WXK_SPACE
412 WXK_DELETE = _core_.WXK_DELETE
413 WXK_START = _core_.WXK_START
414 WXK_LBUTTON = _core_.WXK_LBUTTON
415 WXK_RBUTTON = _core_.WXK_RBUTTON
416 WXK_CANCEL = _core_.WXK_CANCEL
417 WXK_MBUTTON = _core_.WXK_MBUTTON
418 WXK_CLEAR = _core_.WXK_CLEAR
419 WXK_SHIFT = _core_.WXK_SHIFT
420 WXK_ALT = _core_.WXK_ALT
421 WXK_CONTROL = _core_.WXK_CONTROL
422 WXK_MENU = _core_.WXK_MENU
423 WXK_PAUSE = _core_.WXK_PAUSE
424 WXK_CAPITAL = _core_.WXK_CAPITAL
425 WXK_PRIOR = _core_.WXK_PRIOR
426 WXK_NEXT = _core_.WXK_NEXT
427 WXK_END = _core_.WXK_END
428 WXK_HOME = _core_.WXK_HOME
429 WXK_LEFT = _core_.WXK_LEFT
430 WXK_UP = _core_.WXK_UP
431 WXK_RIGHT = _core_.WXK_RIGHT
432 WXK_DOWN = _core_.WXK_DOWN
433 WXK_SELECT = _core_.WXK_SELECT
434 WXK_PRINT = _core_.WXK_PRINT
435 WXK_EXECUTE = _core_.WXK_EXECUTE
436 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437 WXK_INSERT = _core_.WXK_INSERT
438 WXK_HELP = _core_.WXK_HELP
439 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449 WXK_MULTIPLY = _core_.WXK_MULTIPLY
450 WXK_ADD = _core_.WXK_ADD
451 WXK_SEPARATOR = _core_.WXK_SEPARATOR
452 WXK_SUBTRACT = _core_.WXK_SUBTRACT
453 WXK_DECIMAL = _core_.WXK_DECIMAL
454 WXK_DIVIDE = _core_.WXK_DIVIDE
455 WXK_F1 = _core_.WXK_F1
456 WXK_F2 = _core_.WXK_F2
457 WXK_F3 = _core_.WXK_F3
458 WXK_F4 = _core_.WXK_F4
459 WXK_F5 = _core_.WXK_F5
460 WXK_F6 = _core_.WXK_F6
461 WXK_F7 = _core_.WXK_F7
462 WXK_F8 = _core_.WXK_F8
463 WXK_F9 = _core_.WXK_F9
464 WXK_F10 = _core_.WXK_F10
465 WXK_F11 = _core_.WXK_F11
466 WXK_F12 = _core_.WXK_F12
467 WXK_F13 = _core_.WXK_F13
468 WXK_F14 = _core_.WXK_F14
469 WXK_F15 = _core_.WXK_F15
470 WXK_F16 = _core_.WXK_F16
471 WXK_F17 = _core_.WXK_F17
472 WXK_F18 = _core_.WXK_F18
473 WXK_F19 = _core_.WXK_F19
474 WXK_F20 = _core_.WXK_F20
475 WXK_F21 = _core_.WXK_F21
476 WXK_F22 = _core_.WXK_F22
477 WXK_F23 = _core_.WXK_F23
478 WXK_F24 = _core_.WXK_F24
479 WXK_NUMLOCK = _core_.WXK_NUMLOCK
480 WXK_SCROLL = _core_.WXK_SCROLL
481 WXK_PAGEUP = _core_.WXK_PAGEUP
482 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
513 WXK_COMMAND = _core_.WXK_COMMAND
514 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
534 PAPER_NONE = _core_.PAPER_NONE
535 PAPER_LETTER = _core_.PAPER_LETTER
536 PAPER_LEGAL = _core_.PAPER_LEGAL
537 PAPER_A4 = _core_.PAPER_A4
538 PAPER_CSHEET = _core_.PAPER_CSHEET
539 PAPER_DSHEET = _core_.PAPER_DSHEET
540 PAPER_ESHEET = _core_.PAPER_ESHEET
541 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542 PAPER_TABLOID = _core_.PAPER_TABLOID
543 PAPER_LEDGER = _core_.PAPER_LEDGER
544 PAPER_STATEMENT = _core_.PAPER_STATEMENT
545 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546 PAPER_A3 = _core_.PAPER_A3
547 PAPER_A4SMALL = _core_.PAPER_A4SMALL
548 PAPER_A5 = _core_.PAPER_A5
549 PAPER_B4 = _core_.PAPER_B4
550 PAPER_B5 = _core_.PAPER_B5
551 PAPER_FOLIO = _core_.PAPER_FOLIO
552 PAPER_QUARTO = _core_.PAPER_QUARTO
553 PAPER_10X14 = _core_.PAPER_10X14
554 PAPER_11X17 = _core_.PAPER_11X17
555 PAPER_NOTE = _core_.PAPER_NOTE
556 PAPER_ENV_9 = _core_.PAPER_ENV_9
557 PAPER_ENV_10 = _core_.PAPER_ENV_10
558 PAPER_ENV_11 = _core_.PAPER_ENV_11
559 PAPER_ENV_12 = _core_.PAPER_ENV_12
560 PAPER_ENV_14 = _core_.PAPER_ENV_14
561 PAPER_ENV_DL = _core_.PAPER_ENV_DL
562 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578 PAPER_9X11 = _core_.PAPER_9X11
579 PAPER_10X11 = _core_.PAPER_10X11
580 PAPER_15X11 = _core_.PAPER_15X11
581 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589 PAPER_A_PLUS = _core_.PAPER_A_PLUS
590 PAPER_B_PLUS = _core_.PAPER_B_PLUS
591 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598 PAPER_A2 = _core_.PAPER_A2
599 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
601 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602 PAPER_A6 = _core_.PAPER_A6
603 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620 PAPER_B6_JIS = _core_.PAPER_B6_JIS
621 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622 PAPER_12X11 = _core_.PAPER_12X11
623 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625 PAPER_P16K = _core_.PAPER_P16K
626 PAPER_P32K = _core_.PAPER_P32K
627 PAPER_P32KBIG = _core_.PAPER_P32KBIG
628 PAPER_PENV_1 = _core_.PAPER_PENV_1
629 PAPER_PENV_2 = _core_.PAPER_PENV_2
630 PAPER_PENV_3 = _core_.PAPER_PENV_3
631 PAPER_PENV_4 = _core_.PAPER_PENV_4
632 PAPER_PENV_5 = _core_.PAPER_PENV_5
633 PAPER_PENV_6 = _core_.PAPER_PENV_6
634 PAPER_PENV_7 = _core_.PAPER_PENV_7
635 PAPER_PENV_8 = _core_.PAPER_PENV_8
636 PAPER_PENV_9 = _core_.PAPER_PENV_9
637 PAPER_PENV_10 = _core_.PAPER_PENV_10
638 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
651 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655 ITEM_NORMAL = _core_.ITEM_NORMAL
656 ITEM_CHECK = _core_.ITEM_CHECK
657 ITEM_RADIO = _core_.ITEM_RADIO
658 ITEM_MAX = _core_.ITEM_MAX
659 HT_NOWHERE = _core_.HT_NOWHERE
660 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674 HT_MAX = _core_.HT_MAX
675 MOD_NONE = _core_.MOD_NONE
676 MOD_ALT = _core_.MOD_ALT
677 MOD_CONTROL = _core_.MOD_CONTROL
678 MOD_ALTGR = _core_.MOD_ALTGR
679 MOD_SHIFT = _core_.MOD_SHIFT
680 MOD_META = _core_.MOD_META
681 MOD_WIN = _core_.MOD_WIN
682 MOD_CMD = _core_.MOD_CMD
683 MOD_ALL = _core_.MOD_ALL
684 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
687 #---------------------------------------------------------------------------
688
689 class Object(object):
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
695 def __init__(self): raise AttributeError, "No constructor defined"
696 __repr__ = _swig_repr
697 def GetClassName(*args, **kwargs):
698 """
699 GetClassName(self) -> String
700
701 Returns the class name of the C++ class using wxRTTI.
702 """
703 return _core_.Object_GetClassName(*args, **kwargs)
704
705 def Destroy(*args, **kwargs):
706 """
707 Destroy(self)
708
709 Deletes the C++ object this Python object is a proxy for.
710 """
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
714
715 _core_.Object_swigregister(Object)
716 _wxPySetDictionary = _core_._wxPySetDictionary
717 cvar = _core_.cvar
718 EmptyString = cvar.EmptyString
719
720 #---------------------------------------------------------------------------
721
722 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
723 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
724 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
725 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
726 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
727 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
728 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
729 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
730 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
731 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
732 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
733 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
734 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
735 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
736 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
737 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
738 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
739 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
740 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
741 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
742 CURSOR_NONE = _core_.CURSOR_NONE
743 CURSOR_ARROW = _core_.CURSOR_ARROW
744 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
745 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
746 CURSOR_CHAR = _core_.CURSOR_CHAR
747 CURSOR_CROSS = _core_.CURSOR_CROSS
748 CURSOR_HAND = _core_.CURSOR_HAND
749 CURSOR_IBEAM = _core_.CURSOR_IBEAM
750 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
751 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
752 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
753 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
754 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
755 CURSOR_PENCIL = _core_.CURSOR_PENCIL
756 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
757 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
758 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
759 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
760 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
761 CURSOR_SIZENS = _core_.CURSOR_SIZENS
762 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
763 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
764 CURSOR_SIZING = _core_.CURSOR_SIZING
765 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
766 CURSOR_WAIT = _core_.CURSOR_WAIT
767 CURSOR_WATCH = _core_.CURSOR_WATCH
768 CURSOR_BLANK = _core_.CURSOR_BLANK
769 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
770 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
771 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
772 CURSOR_MAX = _core_.CURSOR_MAX
773 #---------------------------------------------------------------------------
774
775 class Size(object):
776 """
777 wx.Size is a useful data structure used to represent the size of
778 something. It simply contains integer width and height
779 properties. In most places in wxPython where a wx.Size is
780 expected a (width, height) tuple can be used instead.
781 """
782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
783 __repr__ = _swig_repr
784 width = property(_core_.Size_width_get, _core_.Size_width_set)
785 height = property(_core_.Size_height_get, _core_.Size_height_set)
786 x = width; y = height
787 def __init__(self, *args, **kwargs):
788 """
789 __init__(self, int w=0, int h=0) -> Size
790
791 Creates a size object.
792 """
793 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
794 __swig_destroy__ = _core_.delete_Size
795 __del__ = lambda self : None;
796 def __eq__(*args, **kwargs):
797 """
798 __eq__(self, PyObject other) -> bool
799
800 Test for equality of wx.Size objects.
801 """
802 return _core_.Size___eq__(*args, **kwargs)
803
804 def __ne__(*args, **kwargs):
805 """
806 __ne__(self, PyObject other) -> bool
807
808 Test for inequality of wx.Size objects.
809 """
810 return _core_.Size___ne__(*args, **kwargs)
811
812 def __add__(*args, **kwargs):
813 """
814 __add__(self, Size sz) -> Size
815
816 Add sz's proprties to this and return the result.
817 """
818 return _core_.Size___add__(*args, **kwargs)
819
820 def __sub__(*args, **kwargs):
821 """
822 __sub__(self, Size sz) -> Size
823
824 Subtract sz's properties from this and return the result.
825 """
826 return _core_.Size___sub__(*args, **kwargs)
827
828 def IncTo(*args, **kwargs):
829 """
830 IncTo(self, Size sz)
831
832 Increments this object so that both of its dimensions are not less
833 than the corresponding dimensions of the size.
834 """
835 return _core_.Size_IncTo(*args, **kwargs)
836
837 def DecTo(*args, **kwargs):
838 """
839 DecTo(self, Size sz)
840
841 Decrements this object so that both of its dimensions are not greater
842 than the corresponding dimensions of the size.
843 """
844 return _core_.Size_DecTo(*args, **kwargs)
845
846 def Set(*args, **kwargs):
847 """
848 Set(self, int w, int h)
849
850 Set both width and height.
851 """
852 return _core_.Size_Set(*args, **kwargs)
853
854 def SetWidth(*args, **kwargs):
855 """SetWidth(self, int w)"""
856 return _core_.Size_SetWidth(*args, **kwargs)
857
858 def SetHeight(*args, **kwargs):
859 """SetHeight(self, int h)"""
860 return _core_.Size_SetHeight(*args, **kwargs)
861
862 def GetWidth(*args, **kwargs):
863 """GetWidth(self) -> int"""
864 return _core_.Size_GetWidth(*args, **kwargs)
865
866 def GetHeight(*args, **kwargs):
867 """GetHeight(self) -> int"""
868 return _core_.Size_GetHeight(*args, **kwargs)
869
870 def IsFullySpecified(*args, **kwargs):
871 """
872 IsFullySpecified(self) -> bool
873
874 Returns True if both components of the size are non-default values.
875 """
876 return _core_.Size_IsFullySpecified(*args, **kwargs)
877
878 def SetDefaults(*args, **kwargs):
879 """
880 SetDefaults(self, Size size)
881
882 Combine this size with the other one replacing the default components
883 of this object (i.e. equal to -1) with those of the other.
884 """
885 return _core_.Size_SetDefaults(*args, **kwargs)
886
887 def Get(*args, **kwargs):
888 """
889 Get() -> (width,height)
890
891 Returns the width and height properties as a tuple.
892 """
893 return _core_.Size_Get(*args, **kwargs)
894
895 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
896 def __str__(self): return str(self.Get())
897 def __repr__(self): return 'wx.Size'+str(self.Get())
898 def __len__(self): return len(self.Get())
899 def __getitem__(self, index): return self.Get()[index]
900 def __setitem__(self, index, val):
901 if index == 0: self.width = val
902 elif index == 1: self.height = val
903 else: raise IndexError
904 def __nonzero__(self): return self.Get() != (0,0)
905 __safe_for_unpickling__ = True
906 def __reduce__(self): return (wx.Size, self.Get())
907
908 _core_.Size_swigregister(Size)
909
910 #---------------------------------------------------------------------------
911
912 class RealPoint(object):
913 """
914 A data structure for representing a point or position with floating
915 point x and y properties. In wxPython most places that expect a
916 wx.RealPoint can also accept a (x,y) tuple.
917 """
918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
919 __repr__ = _swig_repr
920 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
921 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
922 def __init__(self, *args, **kwargs):
923 """
924 __init__(self, double x=0.0, double y=0.0) -> RealPoint
925
926 Create a wx.RealPoint object
927 """
928 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
929 __swig_destroy__ = _core_.delete_RealPoint
930 __del__ = lambda self : None;
931 def __eq__(*args, **kwargs):
932 """
933 __eq__(self, PyObject other) -> bool
934
935 Test for equality of wx.RealPoint objects.
936 """
937 return _core_.RealPoint___eq__(*args, **kwargs)
938
939 def __ne__(*args, **kwargs):
940 """
941 __ne__(self, PyObject other) -> bool
942
943 Test for inequality of wx.RealPoint objects.
944 """
945 return _core_.RealPoint___ne__(*args, **kwargs)
946
947 def __add__(*args, **kwargs):
948 """
949 __add__(self, RealPoint pt) -> RealPoint
950
951 Add pt's proprties to this and return the result.
952 """
953 return _core_.RealPoint___add__(*args, **kwargs)
954
955 def __sub__(*args, **kwargs):
956 """
957 __sub__(self, RealPoint pt) -> RealPoint
958
959 Subtract pt's proprties from this and return the result
960 """
961 return _core_.RealPoint___sub__(*args, **kwargs)
962
963 def Set(*args, **kwargs):
964 """
965 Set(self, double x, double y)
966
967 Set both the x and y properties
968 """
969 return _core_.RealPoint_Set(*args, **kwargs)
970
971 def Get(*args, **kwargs):
972 """
973 Get() -> (x,y)
974
975 Return the x and y properties as a tuple.
976 """
977 return _core_.RealPoint_Get(*args, **kwargs)
978
979 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
980 def __str__(self): return str(self.Get())
981 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
982 def __len__(self): return len(self.Get())
983 def __getitem__(self, index): return self.Get()[index]
984 def __setitem__(self, index, val):
985 if index == 0: self.x = val
986 elif index == 1: self.y = val
987 else: raise IndexError
988 def __nonzero__(self): return self.Get() != (0.0, 0.0)
989 __safe_for_unpickling__ = True
990 def __reduce__(self): return (wx.RealPoint, self.Get())
991
992 _core_.RealPoint_swigregister(RealPoint)
993
994 #---------------------------------------------------------------------------
995
996 class Point(object):
997 """
998 A data structure for representing a point or position with integer x
999 and y properties. Most places in wxPython that expect a wx.Point can
1000 also accept a (x,y) tuple.
1001 """
1002 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1003 __repr__ = _swig_repr
1004 x = property(_core_.Point_x_get, _core_.Point_x_set)
1005 y = property(_core_.Point_y_get, _core_.Point_y_set)
1006 def __init__(self, *args, **kwargs):
1007 """
1008 __init__(self, int x=0, int y=0) -> Point
1009
1010 Create a wx.Point object
1011 """
1012 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1013 __swig_destroy__ = _core_.delete_Point
1014 __del__ = lambda self : None;
1015 def __eq__(*args, **kwargs):
1016 """
1017 __eq__(self, PyObject other) -> bool
1018
1019 Test for equality of wx.Point objects.
1020 """
1021 return _core_.Point___eq__(*args, **kwargs)
1022
1023 def __ne__(*args, **kwargs):
1024 """
1025 __ne__(self, PyObject other) -> bool
1026
1027 Test for inequality of wx.Point objects.
1028 """
1029 return _core_.Point___ne__(*args, **kwargs)
1030
1031 def __add__(*args, **kwargs):
1032 """
1033 __add__(self, Point pt) -> Point
1034
1035 Add pt's proprties to this and return the result.
1036 """
1037 return _core_.Point___add__(*args, **kwargs)
1038
1039 def __sub__(*args, **kwargs):
1040 """
1041 __sub__(self, Point pt) -> Point
1042
1043 Subtract pt's proprties from this and return the result
1044 """
1045 return _core_.Point___sub__(*args, **kwargs)
1046
1047 def __iadd__(*args, **kwargs):
1048 """
1049 __iadd__(self, Point pt) -> Point
1050
1051 Add pt to this object.
1052 """
1053 return _core_.Point___iadd__(*args, **kwargs)
1054
1055 def __isub__(*args, **kwargs):
1056 """
1057 __isub__(self, Point pt) -> Point
1058
1059 Subtract pt from this object.
1060 """
1061 return _core_.Point___isub__(*args, **kwargs)
1062
1063 def Set(*args, **kwargs):
1064 """
1065 Set(self, long x, long y)
1066
1067 Set both the x and y properties
1068 """
1069 return _core_.Point_Set(*args, **kwargs)
1070
1071 def Get(*args, **kwargs):
1072 """
1073 Get() -> (x,y)
1074
1075 Return the x and y properties as a tuple.
1076 """
1077 return _core_.Point_Get(*args, **kwargs)
1078
1079 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1080 def __str__(self): return str(self.Get())
1081 def __repr__(self): return 'wx.Point'+str(self.Get())
1082 def __len__(self): return len(self.Get())
1083 def __getitem__(self, index): return self.Get()[index]
1084 def __setitem__(self, index, val):
1085 if index == 0: self.x = val
1086 elif index == 1: self.y = val
1087 else: raise IndexError
1088 def __nonzero__(self): return self.Get() != (0,0)
1089 __safe_for_unpickling__ = True
1090 def __reduce__(self): return (wx.Point, self.Get())
1091
1092 _core_.Point_swigregister(Point)
1093
1094 #---------------------------------------------------------------------------
1095
1096 class Rect(object):
1097 """
1098 A class for representing and manipulating rectangles. It has x, y,
1099 width and height properties. In wxPython most palces that expect a
1100 wx.Rect can also accept a (x,y,width,height) tuple.
1101 """
1102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1103 __repr__ = _swig_repr
1104 def __init__(self, *args, **kwargs):
1105 """
1106 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1107
1108 Create a new Rect object.
1109 """
1110 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1111 __swig_destroy__ = _core_.delete_Rect
1112 __del__ = lambda self : None;
1113 def GetX(*args, **kwargs):
1114 """GetX(self) -> int"""
1115 return _core_.Rect_GetX(*args, **kwargs)
1116
1117 def SetX(*args, **kwargs):
1118 """SetX(self, int x)"""
1119 return _core_.Rect_SetX(*args, **kwargs)
1120
1121 def GetY(*args, **kwargs):
1122 """GetY(self) -> int"""
1123 return _core_.Rect_GetY(*args, **kwargs)
1124
1125 def SetY(*args, **kwargs):
1126 """SetY(self, int y)"""
1127 return _core_.Rect_SetY(*args, **kwargs)
1128
1129 def GetWidth(*args, **kwargs):
1130 """GetWidth(self) -> int"""
1131 return _core_.Rect_GetWidth(*args, **kwargs)
1132
1133 def SetWidth(*args, **kwargs):
1134 """SetWidth(self, int w)"""
1135 return _core_.Rect_SetWidth(*args, **kwargs)
1136
1137 def GetHeight(*args, **kwargs):
1138 """GetHeight(self) -> int"""
1139 return _core_.Rect_GetHeight(*args, **kwargs)
1140
1141 def SetHeight(*args, **kwargs):
1142 """SetHeight(self, int h)"""
1143 return _core_.Rect_SetHeight(*args, **kwargs)
1144
1145 def GetPosition(*args, **kwargs):
1146 """GetPosition(self) -> Point"""
1147 return _core_.Rect_GetPosition(*args, **kwargs)
1148
1149 def SetPosition(*args, **kwargs):
1150 """SetPosition(self, Point p)"""
1151 return _core_.Rect_SetPosition(*args, **kwargs)
1152
1153 def GetSize(*args, **kwargs):
1154 """GetSize(self) -> Size"""
1155 return _core_.Rect_GetSize(*args, **kwargs)
1156
1157 def SetSize(*args, **kwargs):
1158 """SetSize(self, Size s)"""
1159 return _core_.Rect_SetSize(*args, **kwargs)
1160
1161 def IsEmpty(*args, **kwargs):
1162 """IsEmpty(self) -> bool"""
1163 return _core_.Rect_IsEmpty(*args, **kwargs)
1164
1165 def GetTopLeft(*args, **kwargs):
1166 """GetTopLeft(self) -> Point"""
1167 return _core_.Rect_GetTopLeft(*args, **kwargs)
1168
1169 def SetTopLeft(*args, **kwargs):
1170 """SetTopLeft(self, Point p)"""
1171 return _core_.Rect_SetTopLeft(*args, **kwargs)
1172
1173 def GetBottomRight(*args, **kwargs):
1174 """GetBottomRight(self) -> Point"""
1175 return _core_.Rect_GetBottomRight(*args, **kwargs)
1176
1177 def SetBottomRight(*args, **kwargs):
1178 """SetBottomRight(self, Point p)"""
1179 return _core_.Rect_SetBottomRight(*args, **kwargs)
1180
1181 def GetLeft(*args, **kwargs):
1182 """GetLeft(self) -> int"""
1183 return _core_.Rect_GetLeft(*args, **kwargs)
1184
1185 def GetTop(*args, **kwargs):
1186 """GetTop(self) -> int"""
1187 return _core_.Rect_GetTop(*args, **kwargs)
1188
1189 def GetBottom(*args, **kwargs):
1190 """GetBottom(self) -> int"""
1191 return _core_.Rect_GetBottom(*args, **kwargs)
1192
1193 def GetRight(*args, **kwargs):
1194 """GetRight(self) -> int"""
1195 return _core_.Rect_GetRight(*args, **kwargs)
1196
1197 def SetLeft(*args, **kwargs):
1198 """SetLeft(self, int left)"""
1199 return _core_.Rect_SetLeft(*args, **kwargs)
1200
1201 def SetRight(*args, **kwargs):
1202 """SetRight(self, int right)"""
1203 return _core_.Rect_SetRight(*args, **kwargs)
1204
1205 def SetTop(*args, **kwargs):
1206 """SetTop(self, int top)"""
1207 return _core_.Rect_SetTop(*args, **kwargs)
1208
1209 def SetBottom(*args, **kwargs):
1210 """SetBottom(self, int bottom)"""
1211 return _core_.Rect_SetBottom(*args, **kwargs)
1212
1213 position = property(GetPosition, SetPosition)
1214 size = property(GetSize, SetSize)
1215 left = property(GetLeft, SetLeft)
1216 right = property(GetRight, SetRight)
1217 top = property(GetTop, SetTop)
1218 bottom = property(GetBottom, SetBottom)
1219
1220 def Inflate(*args, **kwargs):
1221 """
1222 Inflate(self, int dx, int dy) -> Rect
1223
1224 Increases the size of the rectangle.
1225
1226 The left border is moved farther left and the right border is moved
1227 farther right by ``dx``. The upper border is moved farther up and the
1228 bottom border is moved farther down by ``dy``. (Note the the width and
1229 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1230 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1231 opposite happens: the rectangle size decreases in the respective
1232 direction.
1233
1234 The change is made to the rectangle inplace, if instead you need a
1235 copy that is inflated, preserving the original then make the copy
1236 first::
1237
1238 copy = wx.Rect(*original)
1239 copy.Inflate(10,15)
1240
1241
1242 """
1243 return _core_.Rect_Inflate(*args, **kwargs)
1244
1245 def Deflate(*args, **kwargs):
1246 """
1247 Deflate(self, int dx, int dy) -> Rect
1248
1249 Decrease the rectangle size. This method is the opposite of `Inflate`
1250 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1251 `Inflate` for a full description.
1252 """
1253 return _core_.Rect_Deflate(*args, **kwargs)
1254
1255 def OffsetXY(*args, **kwargs):
1256 """
1257 OffsetXY(self, int dx, int dy)
1258
1259 Moves the rectangle by the specified offset. If dx is positive, the
1260 rectangle is moved to the right, if dy is positive, it is moved to the
1261 bottom, otherwise it is moved to the left or top respectively.
1262 """
1263 return _core_.Rect_OffsetXY(*args, **kwargs)
1264
1265 def Offset(*args, **kwargs):
1266 """
1267 Offset(self, Point pt)
1268
1269 Same as `OffsetXY` but uses dx,dy from Point
1270 """
1271 return _core_.Rect_Offset(*args, **kwargs)
1272
1273 def Intersect(*args, **kwargs):
1274 """
1275 Intersect(self, Rect rect) -> Rect
1276
1277 Returns the intersectsion of this rectangle and rect.
1278 """
1279 return _core_.Rect_Intersect(*args, **kwargs)
1280
1281 def Union(*args, **kwargs):
1282 """
1283 Union(self, Rect rect) -> Rect
1284
1285 Returns the union of this rectangle and rect.
1286 """
1287 return _core_.Rect_Union(*args, **kwargs)
1288
1289 def __add__(*args, **kwargs):
1290 """
1291 __add__(self, Rect rect) -> Rect
1292
1293 Add the properties of rect to this rectangle and return the result.
1294 """
1295 return _core_.Rect___add__(*args, **kwargs)
1296
1297 def __iadd__(*args, **kwargs):
1298 """
1299 __iadd__(self, Rect rect) -> Rect
1300
1301 Add the properties of rect to this rectangle, updating this rectangle.
1302 """
1303 return _core_.Rect___iadd__(*args, **kwargs)
1304
1305 def __eq__(*args, **kwargs):
1306 """
1307 __eq__(self, PyObject other) -> bool
1308
1309 Test for equality of wx.Rect objects.
1310 """
1311 return _core_.Rect___eq__(*args, **kwargs)
1312
1313 def __ne__(*args, **kwargs):
1314 """
1315 __ne__(self, PyObject other) -> bool
1316
1317 Test for inequality of wx.Rect objects.
1318 """
1319 return _core_.Rect___ne__(*args, **kwargs)
1320
1321 def InsideXY(*args, **kwargs):
1322 """
1323 InsideXY(self, int x, int y) -> bool
1324
1325 Return True if the point is (not strcitly) inside the rect.
1326 """
1327 return _core_.Rect_InsideXY(*args, **kwargs)
1328
1329 def Inside(*args, **kwargs):
1330 """
1331 Inside(self, Point pt) -> bool
1332
1333 Return True if the point is (not strcitly) inside the rect.
1334 """
1335 return _core_.Rect_Inside(*args, **kwargs)
1336
1337 def Intersects(*args, **kwargs):
1338 """
1339 Intersects(self, Rect rect) -> bool
1340
1341 Returns True if the rectangles have a non empty intersection.
1342 """
1343 return _core_.Rect_Intersects(*args, **kwargs)
1344
1345 def CenterIn(*args, **kwargs):
1346 """
1347 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1348
1349 Center this rectangle within the one passed to the method, which is
1350 usually, but not necessarily, the larger one.
1351 """
1352 return _core_.Rect_CenterIn(*args, **kwargs)
1353
1354 CentreIn = CenterIn
1355 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1356 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1357 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1358 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1359 def Set(*args, **kwargs):
1360 """
1361 Set(self, int x=0, int y=0, int width=0, int height=0)
1362
1363 Set all rectangle properties.
1364 """
1365 return _core_.Rect_Set(*args, **kwargs)
1366
1367 def Get(*args, **kwargs):
1368 """
1369 Get() -> (x,y,width,height)
1370
1371 Return the rectangle properties as a tuple.
1372 """
1373 return _core_.Rect_Get(*args, **kwargs)
1374
1375 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1376 def __str__(self): return str(self.Get())
1377 def __repr__(self): return 'wx.Rect'+str(self.Get())
1378 def __len__(self): return len(self.Get())
1379 def __getitem__(self, index): return self.Get()[index]
1380 def __setitem__(self, index, val):
1381 if index == 0: self.x = val
1382 elif index == 1: self.y = val
1383 elif index == 2: self.width = val
1384 elif index == 3: self.height = val
1385 else: raise IndexError
1386 def __nonzero__(self): return self.Get() != (0,0,0,0)
1387 __safe_for_unpickling__ = True
1388 def __reduce__(self): return (wx.Rect, self.Get())
1389
1390 _core_.Rect_swigregister(Rect)
1391
1392 def RectPP(*args, **kwargs):
1393 """
1394 RectPP(Point topLeft, Point bottomRight) -> Rect
1395
1396 Create a new Rect object from Points representing two corners.
1397 """
1398 val = _core_.new_RectPP(*args, **kwargs)
1399 return val
1400
1401 def RectPS(*args, **kwargs):
1402 """
1403 RectPS(Point pos, Size size) -> Rect
1404
1405 Create a new Rect from a position and size.
1406 """
1407 val = _core_.new_RectPS(*args, **kwargs)
1408 return val
1409
1410 def RectS(*args, **kwargs):
1411 """
1412 RectS(Size size) -> Rect
1413
1414 Create a new Rect from a size only.
1415 """
1416 val = _core_.new_RectS(*args, **kwargs)
1417 return val
1418
1419
1420 def IntersectRect(*args, **kwargs):
1421 """
1422 IntersectRect(Rect r1, Rect r2) -> Rect
1423
1424 Calculate and return the intersection of r1 and r2.
1425 """
1426 return _core_.IntersectRect(*args, **kwargs)
1427 #---------------------------------------------------------------------------
1428
1429 class Point2D(object):
1430 """
1431 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1432 with floating point values.
1433 """
1434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1435 __repr__ = _swig_repr
1436 def __init__(self, *args, **kwargs):
1437 """
1438 __init__(self, double x=0.0, double y=0.0) -> Point2D
1439
1440 Create a w.Point2D object.
1441 """
1442 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1443 def GetFloor(*args, **kwargs):
1444 """
1445 GetFloor() -> (x,y)
1446
1447 Convert to integer
1448 """
1449 return _core_.Point2D_GetFloor(*args, **kwargs)
1450
1451 def GetRounded(*args, **kwargs):
1452 """
1453 GetRounded() -> (x,y)
1454
1455 Convert to integer
1456 """
1457 return _core_.Point2D_GetRounded(*args, **kwargs)
1458
1459 def GetVectorLength(*args, **kwargs):
1460 """GetVectorLength(self) -> double"""
1461 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1462
1463 def GetVectorAngle(*args, **kwargs):
1464 """GetVectorAngle(self) -> double"""
1465 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1466
1467 def SetVectorLength(*args, **kwargs):
1468 """SetVectorLength(self, double length)"""
1469 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1470
1471 def SetVectorAngle(*args, **kwargs):
1472 """SetVectorAngle(self, double degrees)"""
1473 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1474
1475 def SetPolarCoordinates(self, angle, length):
1476 self.SetVectorLength(length)
1477 self.SetVectorAngle(angle)
1478 def Normalize(self):
1479 self.SetVectorLength(1.0)
1480
1481 def GetDistance(*args, **kwargs):
1482 """GetDistance(self, Point2D pt) -> double"""
1483 return _core_.Point2D_GetDistance(*args, **kwargs)
1484
1485 def GetDistanceSquare(*args, **kwargs):
1486 """GetDistanceSquare(self, Point2D pt) -> double"""
1487 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1488
1489 def GetDotProduct(*args, **kwargs):
1490 """GetDotProduct(self, Point2D vec) -> double"""
1491 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1492
1493 def GetCrossProduct(*args, **kwargs):
1494 """GetCrossProduct(self, Point2D vec) -> double"""
1495 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1496
1497 def __neg__(*args, **kwargs):
1498 """
1499 __neg__(self) -> Point2D
1500
1501 the reflection of this point
1502 """
1503 return _core_.Point2D___neg__(*args, **kwargs)
1504
1505 def __iadd__(*args, **kwargs):
1506 """__iadd__(self, Point2D pt) -> Point2D"""
1507 return _core_.Point2D___iadd__(*args, **kwargs)
1508
1509 def __isub__(*args, **kwargs):
1510 """__isub__(self, Point2D pt) -> Point2D"""
1511 return _core_.Point2D___isub__(*args, **kwargs)
1512
1513 def __imul__(*args, **kwargs):
1514 """__imul__(self, Point2D pt) -> Point2D"""
1515 return _core_.Point2D___imul__(*args, **kwargs)
1516
1517 def __idiv__(*args, **kwargs):
1518 """__idiv__(self, Point2D pt) -> Point2D"""
1519 return _core_.Point2D___idiv__(*args, **kwargs)
1520
1521 def __eq__(*args, **kwargs):
1522 """
1523 __eq__(self, PyObject other) -> bool
1524
1525 Test for equality of wx.Point2D objects.
1526 """
1527 return _core_.Point2D___eq__(*args, **kwargs)
1528
1529 def __ne__(*args, **kwargs):
1530 """
1531 __ne__(self, PyObject other) -> bool
1532
1533 Test for inequality of wx.Point2D objects.
1534 """
1535 return _core_.Point2D___ne__(*args, **kwargs)
1536
1537 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1538 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1539 def Set(*args, **kwargs):
1540 """Set(self, double x=0, double y=0)"""
1541 return _core_.Point2D_Set(*args, **kwargs)
1542
1543 def Get(*args, **kwargs):
1544 """
1545 Get() -> (x,y)
1546
1547 Return x and y properties as a tuple.
1548 """
1549 return _core_.Point2D_Get(*args, **kwargs)
1550
1551 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1552 def __str__(self): return str(self.Get())
1553 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1554 def __len__(self): return len(self.Get())
1555 def __getitem__(self, index): return self.Get()[index]
1556 def __setitem__(self, index, val):
1557 if index == 0: self.x = val
1558 elif index == 1: self.y = val
1559 else: raise IndexError
1560 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1561 __safe_for_unpickling__ = True
1562 def __reduce__(self): return (wx.Point2D, self.Get())
1563
1564 _core_.Point2D_swigregister(Point2D)
1565
1566 def Point2DCopy(*args, **kwargs):
1567 """
1568 Point2DCopy(Point2D pt) -> Point2D
1569
1570 Create a w.Point2D object.
1571 """
1572 val = _core_.new_Point2DCopy(*args, **kwargs)
1573 return val
1574
1575 def Point2DFromPoint(*args, **kwargs):
1576 """
1577 Point2DFromPoint(Point pt) -> Point2D
1578
1579 Create a w.Point2D object.
1580 """
1581 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1582 return val
1583
1584 #---------------------------------------------------------------------------
1585
1586 FromStart = _core_.FromStart
1587 FromCurrent = _core_.FromCurrent
1588 FromEnd = _core_.FromEnd
1589 class InputStream(object):
1590 """Proxy of C++ InputStream class"""
1591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1592 __repr__ = _swig_repr
1593 def __init__(self, *args, **kwargs):
1594 """__init__(self, PyObject p) -> InputStream"""
1595 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1596 __swig_destroy__ = _core_.delete_InputStream
1597 __del__ = lambda self : None;
1598 def close(*args, **kwargs):
1599 """close(self)"""
1600 return _core_.InputStream_close(*args, **kwargs)
1601
1602 def flush(*args, **kwargs):
1603 """flush(self)"""
1604 return _core_.InputStream_flush(*args, **kwargs)
1605
1606 def eof(*args, **kwargs):
1607 """eof(self) -> bool"""
1608 return _core_.InputStream_eof(*args, **kwargs)
1609
1610 def read(*args, **kwargs):
1611 """read(self, int size=-1) -> PyObject"""
1612 return _core_.InputStream_read(*args, **kwargs)
1613
1614 def readline(*args, **kwargs):
1615 """readline(self, int size=-1) -> PyObject"""
1616 return _core_.InputStream_readline(*args, **kwargs)
1617
1618 def readlines(*args, **kwargs):
1619 """readlines(self, int sizehint=-1) -> PyObject"""
1620 return _core_.InputStream_readlines(*args, **kwargs)
1621
1622 def seek(*args, **kwargs):
1623 """seek(self, int offset, int whence=0)"""
1624 return _core_.InputStream_seek(*args, **kwargs)
1625
1626 def tell(*args, **kwargs):
1627 """tell(self) -> int"""
1628 return _core_.InputStream_tell(*args, **kwargs)
1629
1630 def Peek(*args, **kwargs):
1631 """Peek(self) -> char"""
1632 return _core_.InputStream_Peek(*args, **kwargs)
1633
1634 def GetC(*args, **kwargs):
1635 """GetC(self) -> char"""
1636 return _core_.InputStream_GetC(*args, **kwargs)
1637
1638 def LastRead(*args, **kwargs):
1639 """LastRead(self) -> size_t"""
1640 return _core_.InputStream_LastRead(*args, **kwargs)
1641
1642 def CanRead(*args, **kwargs):
1643 """CanRead(self) -> bool"""
1644 return _core_.InputStream_CanRead(*args, **kwargs)
1645
1646 def Eof(*args, **kwargs):
1647 """Eof(self) -> bool"""
1648 return _core_.InputStream_Eof(*args, **kwargs)
1649
1650 def Ungetch(*args, **kwargs):
1651 """Ungetch(self, char c) -> bool"""
1652 return _core_.InputStream_Ungetch(*args, **kwargs)
1653
1654 def SeekI(*args, **kwargs):
1655 """SeekI(self, long pos, int mode=FromStart) -> long"""
1656 return _core_.InputStream_SeekI(*args, **kwargs)
1657
1658 def TellI(*args, **kwargs):
1659 """TellI(self) -> long"""
1660 return _core_.InputStream_TellI(*args, **kwargs)
1661
1662 _core_.InputStream_swigregister(InputStream)
1663 DefaultPosition = cvar.DefaultPosition
1664 DefaultSize = cvar.DefaultSize
1665
1666 class OutputStream(object):
1667 """Proxy of C++ OutputStream class"""
1668 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1669 def __init__(self): raise AttributeError, "No constructor defined"
1670 __repr__ = _swig_repr
1671 def write(*args, **kwargs):
1672 """write(self, PyObject obj)"""
1673 return _core_.OutputStream_write(*args, **kwargs)
1674
1675 def LastWrite(*args, **kwargs):
1676 """LastWrite(self) -> size_t"""
1677 return _core_.OutputStream_LastWrite(*args, **kwargs)
1678
1679 _core_.OutputStream_swigregister(OutputStream)
1680
1681 #---------------------------------------------------------------------------
1682
1683 class FSFile(Object):
1684 """Proxy of C++ FSFile class"""
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 __repr__ = _swig_repr
1687 def __init__(self, *args, **kwargs):
1688 """
1689 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1690 DateTime modif) -> FSFile
1691 """
1692 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1693 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1694
1695 __swig_destroy__ = _core_.delete_FSFile
1696 __del__ = lambda self : None;
1697 def GetStream(*args, **kwargs):
1698 """GetStream(self) -> InputStream"""
1699 return _core_.FSFile_GetStream(*args, **kwargs)
1700
1701 def GetMimeType(*args, **kwargs):
1702 """GetMimeType(self) -> String"""
1703 return _core_.FSFile_GetMimeType(*args, **kwargs)
1704
1705 def GetLocation(*args, **kwargs):
1706 """GetLocation(self) -> String"""
1707 return _core_.FSFile_GetLocation(*args, **kwargs)
1708
1709 def GetAnchor(*args, **kwargs):
1710 """GetAnchor(self) -> String"""
1711 return _core_.FSFile_GetAnchor(*args, **kwargs)
1712
1713 def GetModificationTime(*args, **kwargs):
1714 """GetModificationTime(self) -> DateTime"""
1715 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1716
1717 _core_.FSFile_swigregister(FSFile)
1718
1719 class CPPFileSystemHandler(object):
1720 """Proxy of C++ CPPFileSystemHandler class"""
1721 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1722 def __init__(self): raise AttributeError, "No constructor defined"
1723 __repr__ = _swig_repr
1724 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1725 __del__ = lambda self : None;
1726 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1727
1728 class FileSystemHandler(CPPFileSystemHandler):
1729 """Proxy of C++ FileSystemHandler class"""
1730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1731 __repr__ = _swig_repr
1732 def __init__(self, *args, **kwargs):
1733 """__init__(self) -> FileSystemHandler"""
1734 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1735 self._setCallbackInfo(self, FileSystemHandler)
1736
1737 def _setCallbackInfo(*args, **kwargs):
1738 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1739 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1740
1741 def CanOpen(*args, **kwargs):
1742 """CanOpen(self, String location) -> bool"""
1743 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1744
1745 def OpenFile(*args, **kwargs):
1746 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1747 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1748
1749 def FindFirst(*args, **kwargs):
1750 """FindFirst(self, String spec, int flags=0) -> String"""
1751 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1752
1753 def FindNext(*args, **kwargs):
1754 """FindNext(self) -> String"""
1755 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1756
1757 def GetProtocol(*args, **kwargs):
1758 """GetProtocol(self, String location) -> String"""
1759 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1760
1761 def GetLeftLocation(*args, **kwargs):
1762 """GetLeftLocation(self, String location) -> String"""
1763 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1764
1765 def GetAnchor(*args, **kwargs):
1766 """GetAnchor(self, String location) -> String"""
1767 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1768
1769 def GetRightLocation(*args, **kwargs):
1770 """GetRightLocation(self, String location) -> String"""
1771 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1772
1773 def GetMimeTypeFromExt(*args, **kwargs):
1774 """GetMimeTypeFromExt(self, String location) -> String"""
1775 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1776
1777 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1778
1779 class FileSystem(Object):
1780 """Proxy of C++ FileSystem class"""
1781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1782 __repr__ = _swig_repr
1783 def __init__(self, *args, **kwargs):
1784 """__init__(self) -> FileSystem"""
1785 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1786 __swig_destroy__ = _core_.delete_FileSystem
1787 __del__ = lambda self : None;
1788 def ChangePathTo(*args, **kwargs):
1789 """ChangePathTo(self, String location, bool is_dir=False)"""
1790 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1791
1792 def GetPath(*args, **kwargs):
1793 """GetPath(self) -> String"""
1794 return _core_.FileSystem_GetPath(*args, **kwargs)
1795
1796 def OpenFile(*args, **kwargs):
1797 """OpenFile(self, String location) -> FSFile"""
1798 return _core_.FileSystem_OpenFile(*args, **kwargs)
1799
1800 def FindFirst(*args, **kwargs):
1801 """FindFirst(self, String spec, int flags=0) -> String"""
1802 return _core_.FileSystem_FindFirst(*args, **kwargs)
1803
1804 def FindNext(*args, **kwargs):
1805 """FindNext(self) -> String"""
1806 return _core_.FileSystem_FindNext(*args, **kwargs)
1807
1808 def AddHandler(*args, **kwargs):
1809 """AddHandler(CPPFileSystemHandler handler)"""
1810 return _core_.FileSystem_AddHandler(*args, **kwargs)
1811
1812 AddHandler = staticmethod(AddHandler)
1813 def CleanUpHandlers(*args, **kwargs):
1814 """CleanUpHandlers()"""
1815 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1816
1817 CleanUpHandlers = staticmethod(CleanUpHandlers)
1818 def FileNameToURL(*args, **kwargs):
1819 """FileNameToURL(String filename) -> String"""
1820 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1821
1822 FileNameToURL = staticmethod(FileNameToURL)
1823 def URLToFileName(*args, **kwargs):
1824 """URLToFileName(String url) -> String"""
1825 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1826
1827 URLToFileName = staticmethod(URLToFileName)
1828 _core_.FileSystem_swigregister(FileSystem)
1829
1830 def FileSystem_AddHandler(*args, **kwargs):
1831 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1832 return _core_.FileSystem_AddHandler(*args, **kwargs)
1833
1834 def FileSystem_CleanUpHandlers(*args):
1835 """FileSystem_CleanUpHandlers()"""
1836 return _core_.FileSystem_CleanUpHandlers(*args)
1837
1838 def FileSystem_FileNameToURL(*args, **kwargs):
1839 """FileSystem_FileNameToURL(String filename) -> String"""
1840 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1841
1842 def FileSystem_URLToFileName(*args, **kwargs):
1843 """FileSystem_URLToFileName(String url) -> String"""
1844 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1845
1846 class InternetFSHandler(CPPFileSystemHandler):
1847 """Proxy of C++ InternetFSHandler class"""
1848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1849 __repr__ = _swig_repr
1850 def __init__(self, *args, **kwargs):
1851 """__init__(self) -> InternetFSHandler"""
1852 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1853 def CanOpen(*args, **kwargs):
1854 """CanOpen(self, String location) -> bool"""
1855 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1856
1857 def OpenFile(*args, **kwargs):
1858 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1859 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1860
1861 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1862
1863 class ZipFSHandler(CPPFileSystemHandler):
1864 """Proxy of C++ ZipFSHandler class"""
1865 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1866 __repr__ = _swig_repr
1867 def __init__(self, *args, **kwargs):
1868 """__init__(self) -> ZipFSHandler"""
1869 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1870 def CanOpen(*args, **kwargs):
1871 """CanOpen(self, String location) -> bool"""
1872 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1873
1874 def OpenFile(*args, **kwargs):
1875 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1876 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1877
1878 def FindFirst(*args, **kwargs):
1879 """FindFirst(self, String spec, int flags=0) -> String"""
1880 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1881
1882 def FindNext(*args, **kwargs):
1883 """FindNext(self) -> String"""
1884 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1885
1886 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1887
1888
1889 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1890 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1891 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1892
1893 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1894 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1895 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1896
1897 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1898 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1899 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1900 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1901 """
1902 Add 'file' to the memory filesystem. The dataItem parameter can
1903 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1904 arbitrary data. If a bitmap or image is used then the imgType
1905 parameter should specify what kind of image file it should be
1906 written as, wx.BITMAP_TYPE_PNG, etc.
1907 """
1908 if isinstance(dataItem, wx.Image):
1909 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1910 elif isinstance(dataItem, wx.Bitmap):
1911 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1912 elif type(dataItem) == str:
1913 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1914 else:
1915 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1916
1917 class MemoryFSHandler(CPPFileSystemHandler):
1918 """Proxy of C++ MemoryFSHandler class"""
1919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1920 __repr__ = _swig_repr
1921 def __init__(self, *args, **kwargs):
1922 """__init__(self) -> MemoryFSHandler"""
1923 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1924 def RemoveFile(*args, **kwargs):
1925 """RemoveFile(String filename)"""
1926 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1927
1928 RemoveFile = staticmethod(RemoveFile)
1929 AddFile = staticmethod(MemoryFSHandler_AddFile)
1930 def CanOpen(*args, **kwargs):
1931 """CanOpen(self, String location) -> bool"""
1932 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1933
1934 def OpenFile(*args, **kwargs):
1935 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1936 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1937
1938 def FindFirst(*args, **kwargs):
1939 """FindFirst(self, String spec, int flags=0) -> String"""
1940 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1941
1942 def FindNext(*args, **kwargs):
1943 """FindNext(self) -> String"""
1944 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1945
1946 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1947
1948 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1949 """MemoryFSHandler_RemoveFile(String filename)"""
1950 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1951
1952 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1953 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1954 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1955 #---------------------------------------------------------------------------
1956
1957 class ImageHandler(Object):
1958 """
1959 This is the base class for implementing image file loading/saving, and
1960 image creation from data. It is used within `wx.Image` and is not
1961 normally seen by the application.
1962 """
1963 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1964 def __init__(self): raise AttributeError, "No constructor defined"
1965 __repr__ = _swig_repr
1966 def GetName(*args, **kwargs):
1967 """GetName(self) -> String"""
1968 return _core_.ImageHandler_GetName(*args, **kwargs)
1969
1970 def GetExtension(*args, **kwargs):
1971 """GetExtension(self) -> String"""
1972 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1973
1974 def GetType(*args, **kwargs):
1975 """GetType(self) -> long"""
1976 return _core_.ImageHandler_GetType(*args, **kwargs)
1977
1978 def GetMimeType(*args, **kwargs):
1979 """GetMimeType(self) -> String"""
1980 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1981
1982 def CanRead(*args, **kwargs):
1983 """CanRead(self, String name) -> bool"""
1984 return _core_.ImageHandler_CanRead(*args, **kwargs)
1985
1986 def SetName(*args, **kwargs):
1987 """SetName(self, String name)"""
1988 return _core_.ImageHandler_SetName(*args, **kwargs)
1989
1990 def SetExtension(*args, **kwargs):
1991 """SetExtension(self, String extension)"""
1992 return _core_.ImageHandler_SetExtension(*args, **kwargs)
1993
1994 def SetType(*args, **kwargs):
1995 """SetType(self, long type)"""
1996 return _core_.ImageHandler_SetType(*args, **kwargs)
1997
1998 def SetMimeType(*args, **kwargs):
1999 """SetMimeType(self, String mimetype)"""
2000 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2001
2002 _core_.ImageHandler_swigregister(ImageHandler)
2003
2004 class PyImageHandler(ImageHandler):
2005 """
2006 This is the base class for implementing image file loading/saving, and
2007 image creation from data, all written in Python. To create a custom
2008 image handler derive a new class from wx.PyImageHandler and provide
2009 the following methods::
2010
2011 def DoCanRead(self, stream) --> bool
2012 '''Check if this handler can read the image on the stream'''
2013
2014 def LoadFile(self, image, stream, verbose, index) --> bool
2015 '''Load image data from the stream and load it into image.'''
2016
2017 def SaveFile(self, image, stream, verbose) --> bool
2018 '''Save the iamge data in image to the stream using
2019 this handler's image file format.'''
2020
2021 def GetImageCount(self, stream) --> int
2022 '''If this image format can hold more than one image,
2023 how many does the image on the stream have?'''
2024
2025 To activate your handler create an instance of it and pass it to
2026 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2027 `SetExtension` from your constructor.
2028
2029 """
2030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2031 __repr__ = _swig_repr
2032 def __init__(self, *args, **kwargs):
2033 """
2034 __init__(self) -> PyImageHandler
2035
2036 This is the base class for implementing image file loading/saving, and
2037 image creation from data, all written in Python. To create a custom
2038 image handler derive a new class from wx.PyImageHandler and provide
2039 the following methods::
2040
2041 def DoCanRead(self, stream) --> bool
2042 '''Check if this handler can read the image on the stream'''
2043
2044 def LoadFile(self, image, stream, verbose, index) --> bool
2045 '''Load image data from the stream and load it into image.'''
2046
2047 def SaveFile(self, image, stream, verbose) --> bool
2048 '''Save the iamge data in image to the stream using
2049 this handler's image file format.'''
2050
2051 def GetImageCount(self, stream) --> int
2052 '''If this image format can hold more than one image,
2053 how many does the image on the stream have?'''
2054
2055 To activate your handler create an instance of it and pass it to
2056 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2057 `SetExtension` from your constructor.
2058
2059 """
2060 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2061 self._SetSelf(self)
2062
2063 def _SetSelf(*args, **kwargs):
2064 """_SetSelf(self, PyObject self)"""
2065 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2066
2067 _core_.PyImageHandler_swigregister(PyImageHandler)
2068
2069 class ImageHistogram(object):
2070 """Proxy of C++ ImageHistogram class"""
2071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2072 __repr__ = _swig_repr
2073 def __init__(self, *args, **kwargs):
2074 """__init__(self) -> ImageHistogram"""
2075 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2076 def MakeKey(*args, **kwargs):
2077 """
2078 MakeKey(byte r, byte g, byte b) -> unsigned long
2079
2080 Get the key in the histogram for the given RGB values
2081 """
2082 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2083
2084 MakeKey = staticmethod(MakeKey)
2085 def FindFirstUnusedColour(*args, **kwargs):
2086 """
2087 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2088
2089 Find first colour that is not used in the image and has higher RGB
2090 values than startR, startG, startB. Returns a tuple consisting of a
2091 success flag and rgb values.
2092 """
2093 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2094
2095 def GetCount(*args, **kwargs):
2096 """
2097 GetCount(self, unsigned long key) -> unsigned long
2098
2099 Returns the pixel count for the given key. Use `MakeKey` to create a
2100 key value from a RGB tripple.
2101 """
2102 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2103
2104 def GetCountRGB(*args, **kwargs):
2105 """
2106 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2107
2108 Returns the pixel count for the given RGB values.
2109 """
2110 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2111
2112 def GetCountColour(*args, **kwargs):
2113 """
2114 GetCountColour(self, Colour colour) -> unsigned long
2115
2116 Returns the pixel count for the given `wx.Colour` value.
2117 """
2118 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2119
2120 _core_.ImageHistogram_swigregister(ImageHistogram)
2121
2122 def ImageHistogram_MakeKey(*args, **kwargs):
2123 """
2124 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2125
2126 Get the key in the histogram for the given RGB values
2127 """
2128 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2129
2130 class Image_RGBValue(object):
2131 """
2132 An object that contains values for red, green and blue which represent
2133 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2134 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2135 color space.
2136 """
2137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2138 __repr__ = _swig_repr
2139 def __init__(self, *args, **kwargs):
2140 """
2141 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2142
2143 Constructor.
2144 """
2145 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2146 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2147 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2148 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2149 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2150
2151 class Image_HSVValue(object):
2152 """
2153 An object that contains values for hue, saturation and value which
2154 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2155 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2156 color space.
2157 """
2158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2159 __repr__ = _swig_repr
2160 def __init__(self, *args, **kwargs):
2161 """
2162 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2163
2164 Constructor.
2165 """
2166 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2167 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2168 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2169 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2170 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2171
2172 class Image(Object):
2173 """
2174 A platform-independent image class. An image can be created from
2175 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2176 variety of formats. Functions are available to set and get image
2177 bits, so it can be used for basic image manipulation.
2178
2179 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2180 platform-specific `wx.Bitmap` object must be created from it using the
2181 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2182 device context, using `wx.DC.DrawBitmap`.
2183
2184 One colour value of the image may be used as a mask colour which will
2185 lead to the automatic creation of a `wx.Mask` object associated to the
2186 bitmap object.
2187
2188 wx.Image supports alpha channel data, that is in addition to a byte
2189 for the red, green and blue colour components for each pixel it also
2190 stores a byte representing the pixel opacity. An alpha value of 0
2191 corresponds to a transparent pixel (null opacity) while a value of 255
2192 means that the pixel is 100% opaque.
2193
2194 Unlike RGB data, not all images have an alpha channel and before using
2195 `GetAlpha` you should check if this image contains an alpha channel
2196 with `HasAlpha`. Note that currently only images loaded from PNG files
2197 with transparency information will have an alpha channel.
2198 """
2199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2200 __repr__ = _swig_repr
2201 def __init__(self, *args, **kwargs):
2202 """
2203 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2204
2205 Loads an image from a file.
2206 """
2207 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2208 __swig_destroy__ = _core_.delete_Image
2209 __del__ = lambda self : None;
2210 def Create(*args, **kwargs):
2211 """
2212 Create(self, int width, int height, bool clear=True)
2213
2214 Creates a fresh image. If clear is ``True``, the new image will be
2215 initialized to black. Otherwise, the image data will be uninitialized.
2216 """
2217 return _core_.Image_Create(*args, **kwargs)
2218
2219 def Destroy(*args, **kwargs):
2220 """
2221 Destroy(self)
2222
2223 Destroys the image data.
2224 """
2225 val = _core_.Image_Destroy(*args, **kwargs)
2226 args[0].thisown = 0
2227 return val
2228
2229 def Scale(*args, **kwargs):
2230 """
2231 Scale(self, int width, int height) -> Image
2232
2233 Returns a scaled version of the image. This is also useful for scaling
2234 bitmaps in general as the only other way to scale bitmaps is to blit a
2235 `wx.MemoryDC` into another `wx.MemoryDC`.
2236 """
2237 return _core_.Image_Scale(*args, **kwargs)
2238
2239 def ShrinkBy(*args, **kwargs):
2240 """
2241 ShrinkBy(self, int xFactor, int yFactor) -> Image
2242
2243 Return a version of the image scaled smaller by the given factors.
2244 """
2245 return _core_.Image_ShrinkBy(*args, **kwargs)
2246
2247 def Rescale(*args, **kwargs):
2248 """
2249 Rescale(self, int width, int height) -> Image
2250
2251 Changes the size of the image in-place by scaling it: after a call to
2252 this function, the image will have the given width and height.
2253
2254 Returns the (modified) image itself.
2255 """
2256 return _core_.Image_Rescale(*args, **kwargs)
2257
2258 def Resize(*args, **kwargs):
2259 """
2260 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2261
2262 Changes the size of the image in-place without scaling it, by adding
2263 either a border with the given colour or cropping as necessary. The
2264 image is pasted into a new image with the given size and background
2265 colour at the position pos relative to the upper left of the new
2266 image. If red = green = blue = -1 then use either the current mask
2267 colour if set or find, use, and set a suitable mask colour for any
2268 newly exposed areas.
2269
2270 Returns the (modified) image itself.
2271 """
2272 return _core_.Image_Resize(*args, **kwargs)
2273
2274 def SetRGB(*args, **kwargs):
2275 """
2276 SetRGB(self, int x, int y, byte r, byte g, byte b)
2277
2278 Sets the pixel at the given coordinate. This routine performs
2279 bounds-checks for the coordinate so it can be considered a safe way to
2280 manipulate the data, but in some cases this might be too slow so that
2281 the data will have to be set directly. In that case you will have to
2282 get access to the image data using the `GetData` method.
2283 """
2284 return _core_.Image_SetRGB(*args, **kwargs)
2285
2286 def SetRGBRect(*args, **kwargs):
2287 """
2288 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2289
2290 Sets the colour of the pixels within the given rectangle. This routine
2291 performs bounds-checks for the rectangle so it can be considered a
2292 safe way to manipulate the data.
2293 """
2294 return _core_.Image_SetRGBRect(*args, **kwargs)
2295
2296 def GetRed(*args, **kwargs):
2297 """
2298 GetRed(self, int x, int y) -> byte
2299
2300 Returns the red intensity at the given coordinate.
2301 """
2302 return _core_.Image_GetRed(*args, **kwargs)
2303
2304 def GetGreen(*args, **kwargs):
2305 """
2306 GetGreen(self, int x, int y) -> byte
2307
2308 Returns the green intensity at the given coordinate.
2309 """
2310 return _core_.Image_GetGreen(*args, **kwargs)
2311
2312 def GetBlue(*args, **kwargs):
2313 """
2314 GetBlue(self, int x, int y) -> byte
2315
2316 Returns the blue intensity at the given coordinate.
2317 """
2318 return _core_.Image_GetBlue(*args, **kwargs)
2319
2320 def SetAlpha(*args, **kwargs):
2321 """
2322 SetAlpha(self, int x, int y, byte alpha)
2323
2324 Sets the alpha value for the given pixel. This function should only be
2325 called if the image has alpha channel data, use `HasAlpha` to check
2326 for this.
2327 """
2328 return _core_.Image_SetAlpha(*args, **kwargs)
2329
2330 def GetAlpha(*args, **kwargs):
2331 """
2332 GetAlpha(self, int x, int y) -> byte
2333
2334 Returns the alpha value for the given pixel. This function may only be
2335 called for the images with alpha channel, use `HasAlpha` to check for
2336 this.
2337
2338 The returned value is the *opacity* of the image, i.e. the value of 0
2339 corresponds to the fully transparent pixels while the value of 255 to
2340 the fully opaque pixels.
2341 """
2342 return _core_.Image_GetAlpha(*args, **kwargs)
2343
2344 def HasAlpha(*args, **kwargs):
2345 """
2346 HasAlpha(self) -> bool
2347
2348 Returns true if this image has alpha channel, false otherwise.
2349 """
2350 return _core_.Image_HasAlpha(*args, **kwargs)
2351
2352 def InitAlpha(*args, **kwargs):
2353 """
2354 InitAlpha(self)
2355
2356 Initializes the image alpha channel data. It is an error to call it if
2357 the image already has alpha data. If it doesn't, alpha data will be by
2358 default initialized to all pixels being fully opaque. But if the image
2359 has a a mask colour, all mask pixels will be completely transparent.
2360 """
2361 return _core_.Image_InitAlpha(*args, **kwargs)
2362
2363 def IsTransparent(*args, **kwargs):
2364 """
2365 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2366
2367 Returns ``True`` if this pixel is masked or has an alpha value less
2368 than the spcified threshold.
2369 """
2370 return _core_.Image_IsTransparent(*args, **kwargs)
2371
2372 def FindFirstUnusedColour(*args, **kwargs):
2373 """
2374 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2375
2376 Find first colour that is not used in the image and has higher RGB
2377 values than startR, startG, startB. Returns a tuple consisting of a
2378 success flag and rgb values.
2379 """
2380 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2381
2382 def ConvertAlphaToMask(*args, **kwargs):
2383 """
2384 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2385
2386 If the image has alpha channel, this method converts it to mask. All
2387 pixels with alpha value less than ``threshold`` are replaced with the
2388 mask colour and the alpha channel is removed. The mask colour is
2389 chosen automatically using `FindFirstUnusedColour`.
2390
2391 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2392 nothing.
2393 """
2394 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2395
2396 def ConvertColourToAlpha(*args, **kwargs):
2397 """
2398 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2399
2400 This method converts an image where the original alpha information is
2401 only available as a shades of a colour (actually shades of grey)
2402 typically when you draw anti-aliased text into a bitmap. The DC
2403 drawing routines draw grey values on the black background although
2404 they actually mean to draw white with differnt alpha values. This
2405 method reverses it, assuming a black (!) background and white text.
2406 The method will then fill up the whole image with the colour given.
2407 """
2408 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2409
2410 def SetMaskFromImage(*args, **kwargs):
2411 """
2412 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2413
2414 Sets the image's mask so that the pixels that have RGB value of
2415 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2416 by first finding an unused colour in the image, setting this colour as
2417 the mask colour and then using this colour to draw all pixels in the
2418 image who corresponding pixel in mask has given RGB value.
2419
2420 Returns ``False`` if ``mask`` does not have same dimensions as the
2421 image or if there is no unused colour left. Returns ``True`` if the
2422 mask was successfully applied.
2423
2424 Note that this method involves computing the histogram, which is
2425 computationally intensive operation.
2426 """
2427 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2428
2429 def CanRead(*args, **kwargs):
2430 """
2431 CanRead(String filename) -> bool
2432
2433 Returns True if the image handlers can read this file.
2434 """
2435 return _core_.Image_CanRead(*args, **kwargs)
2436
2437 CanRead = staticmethod(CanRead)
2438 def GetImageCount(*args, **kwargs):
2439 """
2440 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2441
2442 If the image file contains more than one image and the image handler
2443 is capable of retrieving these individually, this function will return
2444 the number of available images.
2445 """
2446 return _core_.Image_GetImageCount(*args, **kwargs)
2447
2448 GetImageCount = staticmethod(GetImageCount)
2449 def LoadFile(*args, **kwargs):
2450 """
2451 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2452
2453 Loads an image from a file. If no handler type is provided, the
2454 library will try to autodetect the format.
2455 """
2456 return _core_.Image_LoadFile(*args, **kwargs)
2457
2458 def LoadMimeFile(*args, **kwargs):
2459 """
2460 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2461
2462 Loads an image from a file, specifying the image type with a MIME type
2463 string.
2464 """
2465 return _core_.Image_LoadMimeFile(*args, **kwargs)
2466
2467 def SaveFile(*args, **kwargs):
2468 """
2469 SaveFile(self, String name, int type) -> bool
2470
2471 Saves an image in the named file.
2472 """
2473 return _core_.Image_SaveFile(*args, **kwargs)
2474
2475 def SaveMimeFile(*args, **kwargs):
2476 """
2477 SaveMimeFile(self, String name, String mimetype) -> bool
2478
2479 Saves an image in the named file.
2480 """
2481 return _core_.Image_SaveMimeFile(*args, **kwargs)
2482
2483 def CanReadStream(*args, **kwargs):
2484 """
2485 CanReadStream(InputStream stream) -> bool
2486
2487 Returns True if the image handlers can read an image file from the
2488 data currently on the input stream, or a readable Python file-like
2489 object.
2490 """
2491 return _core_.Image_CanReadStream(*args, **kwargs)
2492
2493 CanReadStream = staticmethod(CanReadStream)
2494 def LoadStream(*args, **kwargs):
2495 """
2496 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2497
2498 Loads an image from an input stream or a readable Python file-like
2499 object. If no handler type is provided, the library will try to
2500 autodetect the format.
2501 """
2502 return _core_.Image_LoadStream(*args, **kwargs)
2503
2504 def LoadMimeStream(*args, **kwargs):
2505 """
2506 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2507
2508 Loads an image from an input stream or a readable Python file-like
2509 object, using a MIME type string to specify the image file format.
2510 """
2511 return _core_.Image_LoadMimeStream(*args, **kwargs)
2512
2513 def Ok(*args, **kwargs):
2514 """
2515 Ok(self) -> bool
2516
2517 Returns true if image data is present.
2518 """
2519 return _core_.Image_Ok(*args, **kwargs)
2520
2521 def GetWidth(*args, **kwargs):
2522 """
2523 GetWidth(self) -> int
2524
2525 Gets the width of the image in pixels.
2526 """
2527 return _core_.Image_GetWidth(*args, **kwargs)
2528
2529 def GetHeight(*args, **kwargs):
2530 """
2531 GetHeight(self) -> int
2532
2533 Gets the height of the image in pixels.
2534 """
2535 return _core_.Image_GetHeight(*args, **kwargs)
2536
2537 def GetSize(*args, **kwargs):
2538 """
2539 GetSize(self) -> Size
2540
2541 Returns the size of the image in pixels.
2542 """
2543 return _core_.Image_GetSize(*args, **kwargs)
2544
2545 def GetSubImage(*args, **kwargs):
2546 """
2547 GetSubImage(self, Rect rect) -> Image
2548
2549 Returns a sub image of the current one as long as the rect belongs
2550 entirely to the image.
2551 """
2552 return _core_.Image_GetSubImage(*args, **kwargs)
2553
2554 def Size(*args, **kwargs):
2555 """
2556 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2557
2558 Returns a resized version of this image without scaling it by adding
2559 either a border with the given colour or cropping as necessary. The
2560 image is pasted into a new image with the given size and background
2561 colour at the position ``pos`` relative to the upper left of the new
2562 image. If red = green = blue = -1 then use either the current mask
2563 colour if set or find, use, and set a suitable mask colour for any
2564 newly exposed areas.
2565 """
2566 return _core_.Image_Size(*args, **kwargs)
2567
2568 def Copy(*args, **kwargs):
2569 """
2570 Copy(self) -> Image
2571
2572 Returns an identical copy of the image.
2573 """
2574 return _core_.Image_Copy(*args, **kwargs)
2575
2576 def Paste(*args, **kwargs):
2577 """
2578 Paste(self, Image image, int x, int y)
2579
2580 Pastes ``image`` into this instance and takes care of the mask colour
2581 and any out of bounds problems.
2582 """
2583 return _core_.Image_Paste(*args, **kwargs)
2584
2585 def GetData(*args, **kwargs):
2586 """
2587 GetData(self) -> PyObject
2588
2589 Returns a string containing a copy of the RGB bytes of the image.
2590 """
2591 return _core_.Image_GetData(*args, **kwargs)
2592
2593 def SetData(*args, **kwargs):
2594 """
2595 SetData(self, buffer data)
2596
2597 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2598 either a string or a buffer object holding the data and the length of
2599 the data must be width*height*3.
2600 """
2601 return _core_.Image_SetData(*args, **kwargs)
2602
2603 def GetDataBuffer(*args, **kwargs):
2604 """
2605 GetDataBuffer(self) -> PyObject
2606
2607 Returns a writable Python buffer object that is pointing at the RGB
2608 image data buffer inside the wx.Image. You need to ensure that you do
2609 not use this buffer object after the image has been destroyed.
2610 """
2611 return _core_.Image_GetDataBuffer(*args, **kwargs)
2612
2613 def SetDataBuffer(*args, **kwargs):
2614 """
2615 SetDataBuffer(self, buffer data)
2616
2617 Sets the internal image data pointer to point at a Python buffer
2618 object. This can save making an extra copy of the data but you must
2619 ensure that the buffer object lives longer than the wx.Image does.
2620 """
2621 return _core_.Image_SetDataBuffer(*args, **kwargs)
2622
2623 def GetAlphaData(*args, **kwargs):
2624 """
2625 GetAlphaData(self) -> PyObject
2626
2627 Returns a string containing a copy of the alpha bytes of the image.
2628 """
2629 return _core_.Image_GetAlphaData(*args, **kwargs)
2630
2631 def SetAlphaData(*args, **kwargs):
2632 """
2633 SetAlphaData(self, buffer alpha)
2634
2635 Resets the Image's alpha data from a buffer of bytes. Accepts either
2636 a string or a buffer object holding the data and the length of the
2637 data must be width*height.
2638 """
2639 return _core_.Image_SetAlphaData(*args, **kwargs)
2640
2641 def GetAlphaBuffer(*args, **kwargs):
2642 """GetAlphaBuffer(self) -> PyObject"""
2643 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2644
2645 def SetAlphaBuffer(*args, **kwargs):
2646 """SetAlphaBuffer(self, buffer alpha)"""
2647 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2648
2649 def SetMaskColour(*args, **kwargs):
2650 """
2651 SetMaskColour(self, byte r, byte g, byte b)
2652
2653 Sets the mask colour for this image (and tells the image to use the
2654 mask).
2655 """
2656 return _core_.Image_SetMaskColour(*args, **kwargs)
2657
2658 def GetOrFindMaskColour(*args, **kwargs):
2659 """
2660 GetOrFindMaskColour() -> (r,g,b)
2661
2662 Get the current mask colour or find a suitable colour.
2663 """
2664 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2665
2666 def GetMaskRed(*args, **kwargs):
2667 """
2668 GetMaskRed(self) -> byte
2669
2670 Gets the red component of the mask colour.
2671 """
2672 return _core_.Image_GetMaskRed(*args, **kwargs)
2673
2674 def GetMaskGreen(*args, **kwargs):
2675 """
2676 GetMaskGreen(self) -> byte
2677
2678 Gets the green component of the mask colour.
2679 """
2680 return _core_.Image_GetMaskGreen(*args, **kwargs)
2681
2682 def GetMaskBlue(*args, **kwargs):
2683 """
2684 GetMaskBlue(self) -> byte
2685
2686 Gets the blue component of the mask colour.
2687 """
2688 return _core_.Image_GetMaskBlue(*args, **kwargs)
2689
2690 def SetMask(*args, **kwargs):
2691 """
2692 SetMask(self, bool mask=True)
2693
2694 Specifies whether there is a mask or not. The area of the mask is
2695 determined by the current mask colour.
2696 """
2697 return _core_.Image_SetMask(*args, **kwargs)
2698
2699 def HasMask(*args, **kwargs):
2700 """
2701 HasMask(self) -> bool
2702
2703 Returns ``True`` if there is a mask active, ``False`` otherwise.
2704 """
2705 return _core_.Image_HasMask(*args, **kwargs)
2706
2707 def Rotate(*args, **kwargs):
2708 """
2709 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2710 Point offset_after_rotation=None) -> Image
2711
2712 Rotates the image about the given point, by ``angle`` radians. Passing
2713 ``True`` to ``interpolating`` results in better image quality, but is
2714 slower. If the image has a mask, then the mask colour is used for the
2715 uncovered pixels in the rotated image background. Otherwise, black
2716 will be used as the fill colour.
2717
2718 Returns the rotated image, leaving this image intact.
2719 """
2720 return _core_.Image_Rotate(*args, **kwargs)
2721
2722 def Rotate90(*args, **kwargs):
2723 """
2724 Rotate90(self, bool clockwise=True) -> Image
2725
2726 Returns a copy of the image rotated 90 degrees in the direction
2727 indicated by ``clockwise``.
2728 """
2729 return _core_.Image_Rotate90(*args, **kwargs)
2730
2731 def Mirror(*args, **kwargs):
2732 """
2733 Mirror(self, bool horizontally=True) -> Image
2734
2735 Returns a mirrored copy of the image. The parameter ``horizontally``
2736 indicates the orientation.
2737 """
2738 return _core_.Image_Mirror(*args, **kwargs)
2739
2740 def Replace(*args, **kwargs):
2741 """
2742 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2743
2744 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2745 ``(r2,g2,b2)``.
2746 """
2747 return _core_.Image_Replace(*args, **kwargs)
2748
2749 def ConvertToGreyscale(*args, **kwargs):
2750 """
2751 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2752
2753 Convert to greyscale image. Uses the luminance component (Y) of the
2754 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2755 defaults to ITU-T BT.601
2756 """
2757 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2758
2759 def ConvertToMono(*args, **kwargs):
2760 """
2761 ConvertToMono(self, byte r, byte g, byte b) -> Image
2762
2763 Returns monochromatic version of the image. The returned image has
2764 white colour where the original has ``(r,g,b)`` colour and black
2765 colour everywhere else.
2766 """
2767 return _core_.Image_ConvertToMono(*args, **kwargs)
2768
2769 def SetOption(*args, **kwargs):
2770 """
2771 SetOption(self, String name, String value)
2772
2773 Sets an image handler defined option. For example, when saving as a
2774 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2775 number between 0 and 100 (0 is terrible, 100 is very good).
2776 """
2777 return _core_.Image_SetOption(*args, **kwargs)
2778
2779 def SetOptionInt(*args, **kwargs):
2780 """
2781 SetOptionInt(self, String name, int value)
2782
2783 Sets an image option as an integer.
2784 """
2785 return _core_.Image_SetOptionInt(*args, **kwargs)
2786
2787 def GetOption(*args, **kwargs):
2788 """
2789 GetOption(self, String name) -> String
2790
2791 Gets the value of an image handler option.
2792 """
2793 return _core_.Image_GetOption(*args, **kwargs)
2794
2795 def GetOptionInt(*args, **kwargs):
2796 """
2797 GetOptionInt(self, String name) -> int
2798
2799 Gets the value of an image handler option as an integer. If the given
2800 option is not present, the function returns 0.
2801 """
2802 return _core_.Image_GetOptionInt(*args, **kwargs)
2803
2804 def HasOption(*args, **kwargs):
2805 """
2806 HasOption(self, String name) -> bool
2807
2808 Returns true if the given option is present.
2809 """
2810 return _core_.Image_HasOption(*args, **kwargs)
2811
2812 def CountColours(*args, **kwargs):
2813 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2814 return _core_.Image_CountColours(*args, **kwargs)
2815
2816 def ComputeHistogram(*args, **kwargs):
2817 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2818 return _core_.Image_ComputeHistogram(*args, **kwargs)
2819
2820 def AddHandler(*args, **kwargs):
2821 """AddHandler(ImageHandler handler)"""
2822 return _core_.Image_AddHandler(*args, **kwargs)
2823
2824 AddHandler = staticmethod(AddHandler)
2825 def InsertHandler(*args, **kwargs):
2826 """InsertHandler(ImageHandler handler)"""
2827 return _core_.Image_InsertHandler(*args, **kwargs)
2828
2829 InsertHandler = staticmethod(InsertHandler)
2830 def RemoveHandler(*args, **kwargs):
2831 """RemoveHandler(String name) -> bool"""
2832 return _core_.Image_RemoveHandler(*args, **kwargs)
2833
2834 RemoveHandler = staticmethod(RemoveHandler)
2835 def GetHandlers(*args, **kwargs):
2836 """GetHandlers() -> PyObject"""
2837 return _core_.Image_GetHandlers(*args, **kwargs)
2838
2839 GetHandlers = staticmethod(GetHandlers)
2840 def GetImageExtWildcard(*args, **kwargs):
2841 """
2842 GetImageExtWildcard() -> String
2843
2844 Iterates all registered wxImageHandler objects, and returns a string
2845 containing file extension masks suitable for passing to file open/save
2846 dialog boxes.
2847 """
2848 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2849
2850 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2851 def ConvertToBitmap(*args, **kwargs):
2852 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2853 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2854
2855 def ConvertToMonoBitmap(*args, **kwargs):
2856 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2857 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2858
2859 def RotateHue(*args, **kwargs):
2860 """
2861 RotateHue(self, double angle)
2862
2863 Rotates the hue of each pixel of the image. Hue is a double in the
2864 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2865 """
2866 return _core_.Image_RotateHue(*args, **kwargs)
2867
2868 def RGBtoHSV(*args, **kwargs):
2869 """
2870 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2871
2872 Converts a color in RGB color space to HSV color space.
2873 """
2874 return _core_.Image_RGBtoHSV(*args, **kwargs)
2875
2876 RGBtoHSV = staticmethod(RGBtoHSV)
2877 def HSVtoRGB(*args, **kwargs):
2878 """
2879 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2880
2881 Converts a color in HSV color space to RGB color space.
2882 """
2883 return _core_.Image_HSVtoRGB(*args, **kwargs)
2884
2885 HSVtoRGB = staticmethod(HSVtoRGB)
2886 def __nonzero__(self): return self.Ok()
2887 _core_.Image_swigregister(Image)
2888
2889 def ImageFromMime(*args, **kwargs):
2890 """
2891 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2892
2893 Loads an image from a file, using a MIME type string (such as
2894 'image/jpeg') to specify image type.
2895 """
2896 val = _core_.new_ImageFromMime(*args, **kwargs)
2897 return val
2898
2899 def ImageFromStream(*args, **kwargs):
2900 """
2901 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2902
2903 Loads an image from an input stream, or any readable Python file-like
2904 object.
2905 """
2906 val = _core_.new_ImageFromStream(*args, **kwargs)
2907 return val
2908
2909 def ImageFromStreamMime(*args, **kwargs):
2910 """
2911 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2912
2913 Loads an image from an input stream, or any readable Python file-like
2914 object, specifying the image format with a MIME type string.
2915 """
2916 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2917 return val
2918
2919 def EmptyImage(*args, **kwargs):
2920 """
2921 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2922
2923 Construct an empty image of a given size, optionally setting all
2924 pixels to black.
2925 """
2926 val = _core_.new_EmptyImage(*args, **kwargs)
2927 return val
2928
2929 def ImageFromBitmap(*args, **kwargs):
2930 """
2931 ImageFromBitmap(Bitmap bitmap) -> Image
2932
2933 Construct an Image from a `wx.Bitmap`.
2934 """
2935 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2936 return val
2937
2938 def ImageFromData(*args, **kwargs):
2939 """
2940 ImageFromData(int width, int height, buffer data) -> Image
2941
2942 Construct an Image from a buffer of RGB bytes. Accepts either a
2943 string or a buffer object holding the data and the length of the data
2944 must be width*height*3.
2945 """
2946 val = _core_.new_ImageFromData(*args, **kwargs)
2947 return val
2948
2949 def ImageFromDataWithAlpha(*args, **kwargs):
2950 """
2951 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2952
2953 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2954 Accepts either a string or a buffer object holding the data and the
2955 length of the data must be width*height*3 bytes, and the length of the
2956 alpha data must be width*height bytes.
2957 """
2958 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2959 return val
2960
2961 def Image_CanRead(*args, **kwargs):
2962 """
2963 Image_CanRead(String filename) -> bool
2964
2965 Returns True if the image handlers can read this file.
2966 """
2967 return _core_.Image_CanRead(*args, **kwargs)
2968
2969 def Image_GetImageCount(*args, **kwargs):
2970 """
2971 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2972
2973 If the image file contains more than one image and the image handler
2974 is capable of retrieving these individually, this function will return
2975 the number of available images.
2976 """
2977 return _core_.Image_GetImageCount(*args, **kwargs)
2978
2979 def Image_CanReadStream(*args, **kwargs):
2980 """
2981 Image_CanReadStream(InputStream stream) -> bool
2982
2983 Returns True if the image handlers can read an image file from the
2984 data currently on the input stream, or a readable Python file-like
2985 object.
2986 """
2987 return _core_.Image_CanReadStream(*args, **kwargs)
2988
2989 def Image_AddHandler(*args, **kwargs):
2990 """Image_AddHandler(ImageHandler handler)"""
2991 return _core_.Image_AddHandler(*args, **kwargs)
2992
2993 def Image_InsertHandler(*args, **kwargs):
2994 """Image_InsertHandler(ImageHandler handler)"""
2995 return _core_.Image_InsertHandler(*args, **kwargs)
2996
2997 def Image_RemoveHandler(*args, **kwargs):
2998 """Image_RemoveHandler(String name) -> bool"""
2999 return _core_.Image_RemoveHandler(*args, **kwargs)
3000
3001 def Image_GetHandlers(*args):
3002 """Image_GetHandlers() -> PyObject"""
3003 return _core_.Image_GetHandlers(*args)
3004
3005 def Image_GetImageExtWildcard(*args):
3006 """
3007 Image_GetImageExtWildcard() -> String
3008
3009 Iterates all registered wxImageHandler objects, and returns a string
3010 containing file extension masks suitable for passing to file open/save
3011 dialog boxes.
3012 """
3013 return _core_.Image_GetImageExtWildcard(*args)
3014
3015 def Image_RGBtoHSV(*args, **kwargs):
3016 """
3017 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3018
3019 Converts a color in RGB color space to HSV color space.
3020 """
3021 return _core_.Image_RGBtoHSV(*args, **kwargs)
3022
3023 def Image_HSVtoRGB(*args, **kwargs):
3024 """
3025 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3026
3027 Converts a color in HSV color space to RGB color space.
3028 """
3029 return _core_.Image_HSVtoRGB(*args, **kwargs)
3030
3031 def InitAllImageHandlers():
3032 """
3033 The former functionality of InitAllImageHanders is now done internal to
3034 the _core_ extension module and so this function has become a simple NOP.
3035 """
3036 pass
3037
3038 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3039 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3040 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3041 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3042 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3043 BMP_24BPP = _core_.BMP_24BPP
3044 BMP_8BPP = _core_.BMP_8BPP
3045 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3046 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3047 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3048 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3049 BMP_4BPP = _core_.BMP_4BPP
3050 BMP_1BPP = _core_.BMP_1BPP
3051 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3052 class BMPHandler(ImageHandler):
3053 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3054 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3055 __repr__ = _swig_repr
3056 def __init__(self, *args, **kwargs):
3057 """
3058 __init__(self) -> BMPHandler
3059
3060 A `wx.ImageHandler` for \*.bmp bitmap files.
3061 """
3062 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3063 _core_.BMPHandler_swigregister(BMPHandler)
3064 NullImage = cvar.NullImage
3065 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3066 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3067 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3068 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3069 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3070 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3071 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3072 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3073 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3074 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3075 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3076 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3077 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3078 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3079 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3080
3081 class ICOHandler(BMPHandler):
3082 """A `wx.ImageHandler` for \*.ico icon files."""
3083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3084 __repr__ = _swig_repr
3085 def __init__(self, *args, **kwargs):
3086 """
3087 __init__(self) -> ICOHandler
3088
3089 A `wx.ImageHandler` for \*.ico icon files.
3090 """
3091 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3092 _core_.ICOHandler_swigregister(ICOHandler)
3093
3094 class CURHandler(ICOHandler):
3095 """A `wx.ImageHandler` for \*.cur cursor files."""
3096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3097 __repr__ = _swig_repr
3098 def __init__(self, *args, **kwargs):
3099 """
3100 __init__(self) -> CURHandler
3101
3102 A `wx.ImageHandler` for \*.cur cursor files.
3103 """
3104 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3105 _core_.CURHandler_swigregister(CURHandler)
3106
3107 class ANIHandler(CURHandler):
3108 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3110 __repr__ = _swig_repr
3111 def __init__(self, *args, **kwargs):
3112 """
3113 __init__(self) -> ANIHandler
3114
3115 A `wx.ImageHandler` for \*.ani animated cursor files.
3116 """
3117 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3118 _core_.ANIHandler_swigregister(ANIHandler)
3119
3120 class PNGHandler(ImageHandler):
3121 """A `wx.ImageHandler` for PNG image files."""
3122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3123 __repr__ = _swig_repr
3124 def __init__(self, *args, **kwargs):
3125 """
3126 __init__(self) -> PNGHandler
3127
3128 A `wx.ImageHandler` for PNG image files.
3129 """
3130 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3131 _core_.PNGHandler_swigregister(PNGHandler)
3132
3133 class GIFHandler(ImageHandler):
3134 """A `wx.ImageHandler` for GIF image files."""
3135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3136 __repr__ = _swig_repr
3137 def __init__(self, *args, **kwargs):
3138 """
3139 __init__(self) -> GIFHandler
3140
3141 A `wx.ImageHandler` for GIF image files.
3142 """
3143 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3144 _core_.GIFHandler_swigregister(GIFHandler)
3145
3146 class PCXHandler(ImageHandler):
3147 """A `wx.ImageHandler` for PCX imager files."""
3148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3149 __repr__ = _swig_repr
3150 def __init__(self, *args, **kwargs):
3151 """
3152 __init__(self) -> PCXHandler
3153
3154 A `wx.ImageHandler` for PCX imager files.
3155 """
3156 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3157 _core_.PCXHandler_swigregister(PCXHandler)
3158
3159 class JPEGHandler(ImageHandler):
3160 """A `wx.ImageHandler` for JPEG/JPG image files."""
3161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3162 __repr__ = _swig_repr
3163 def __init__(self, *args, **kwargs):
3164 """
3165 __init__(self) -> JPEGHandler
3166
3167 A `wx.ImageHandler` for JPEG/JPG image files.
3168 """
3169 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3170 _core_.JPEGHandler_swigregister(JPEGHandler)
3171
3172 class PNMHandler(ImageHandler):
3173 """A `wx.ImageHandler` for PNM image files."""
3174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3175 __repr__ = _swig_repr
3176 def __init__(self, *args, **kwargs):
3177 """
3178 __init__(self) -> PNMHandler
3179
3180 A `wx.ImageHandler` for PNM image files.
3181 """
3182 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3183 _core_.PNMHandler_swigregister(PNMHandler)
3184
3185 class XPMHandler(ImageHandler):
3186 """A `wx.ImageHandler` for XPM image."""
3187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3188 __repr__ = _swig_repr
3189 def __init__(self, *args, **kwargs):
3190 """
3191 __init__(self) -> XPMHandler
3192
3193 A `wx.ImageHandler` for XPM image.
3194 """
3195 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3196 _core_.XPMHandler_swigregister(XPMHandler)
3197
3198 class TIFFHandler(ImageHandler):
3199 """A `wx.ImageHandler` for TIFF image files."""
3200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3201 __repr__ = _swig_repr
3202 def __init__(self, *args, **kwargs):
3203 """
3204 __init__(self) -> TIFFHandler
3205
3206 A `wx.ImageHandler` for TIFF image files.
3207 """
3208 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3209 _core_.TIFFHandler_swigregister(TIFFHandler)
3210
3211 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3212 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3213 class Quantize(object):
3214 """Performs quantization, or colour reduction, on a wxImage."""
3215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3216 def __init__(self): raise AttributeError, "No constructor defined"
3217 __repr__ = _swig_repr
3218 def Quantize(*args, **kwargs):
3219 """
3220 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3221
3222 Reduce the colours in the source image and put the result into the
3223 destination image, setting the palette in the destination if
3224 needed. Both images may be the same, to overwrite the source image.
3225 """
3226 return _core_.Quantize_Quantize(*args, **kwargs)
3227
3228 Quantize = staticmethod(Quantize)
3229 _core_.Quantize_swigregister(Quantize)
3230
3231 def Quantize_Quantize(*args, **kwargs):
3232 """
3233 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3234
3235 Reduce the colours in the source image and put the result into the
3236 destination image, setting the palette in the destination if
3237 needed. Both images may be the same, to overwrite the source image.
3238 """
3239 return _core_.Quantize_Quantize(*args, **kwargs)
3240
3241 #---------------------------------------------------------------------------
3242
3243 class EvtHandler(Object):
3244 """Proxy of C++ EvtHandler class"""
3245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3246 __repr__ = _swig_repr
3247 def __init__(self, *args, **kwargs):
3248 """__init__(self) -> EvtHandler"""
3249 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3250 def GetNextHandler(*args, **kwargs):
3251 """GetNextHandler(self) -> EvtHandler"""
3252 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3253
3254 def GetPreviousHandler(*args, **kwargs):
3255 """GetPreviousHandler(self) -> EvtHandler"""
3256 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3257
3258 def SetNextHandler(*args, **kwargs):
3259 """SetNextHandler(self, EvtHandler handler)"""
3260 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3261
3262 def SetPreviousHandler(*args, **kwargs):
3263 """SetPreviousHandler(self, EvtHandler handler)"""
3264 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3265
3266 def GetEvtHandlerEnabled(*args, **kwargs):
3267 """GetEvtHandlerEnabled(self) -> bool"""
3268 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3269
3270 def SetEvtHandlerEnabled(*args, **kwargs):
3271 """SetEvtHandlerEnabled(self, bool enabled)"""
3272 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3273
3274 def ProcessEvent(*args, **kwargs):
3275 """ProcessEvent(self, Event event) -> bool"""
3276 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3277
3278 def AddPendingEvent(*args, **kwargs):
3279 """AddPendingEvent(self, Event event)"""
3280 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3281
3282 def ProcessPendingEvents(*args, **kwargs):
3283 """ProcessPendingEvents(self)"""
3284 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3285
3286 def Connect(*args, **kwargs):
3287 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3288 return _core_.EvtHandler_Connect(*args, **kwargs)
3289
3290 def Disconnect(*args, **kwargs):
3291 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3292 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3293
3294 def _setOORInfo(*args, **kwargs):
3295 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3296 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3297 args[0].thisown = 0
3298 return val
3299
3300 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3301 """
3302 Bind an event to an event handler.
3303
3304 :param event: One of the EVT_* objects that specifies the
3305 type of event to bind,
3306
3307 :param handler: A callable object to be invoked when the
3308 event is delivered to self. Pass None to
3309 disconnect an event handler.
3310
3311 :param source: Sometimes the event originates from a
3312 different window than self, but you still
3313 want to catch it in self. (For example, a
3314 button event delivered to a frame.) By
3315 passing the source of the event, the event
3316 handling system is able to differentiate
3317 between the same event type from different
3318 controls.
3319
3320 :param id: Used to spcify the event source by ID instead
3321 of instance.
3322
3323 :param id2: Used when it is desirable to bind a handler
3324 to a range of IDs, such as with EVT_MENU_RANGE.
3325 """
3326 if source is not None:
3327 id = source.GetId()
3328 event.Bind(self, id, id2, handler)
3329
3330 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3331 """
3332 Disconencts the event handler binding for event from self.
3333 Returns True if successful.
3334 """
3335 if source is not None:
3336 id = source.GetId()
3337 return event.Unbind(self, id, id2)
3338
3339 _core_.EvtHandler_swigregister(EvtHandler)
3340
3341 #---------------------------------------------------------------------------
3342
3343 class PyEventBinder(object):
3344 """
3345 Instances of this class are used to bind specific events to event
3346 handlers.
3347 """
3348 def __init__(self, evtType, expectedIDs=0):
3349 if expectedIDs not in [0, 1, 2]:
3350 raise ValueError, "Invalid number of expectedIDs"
3351 self.expectedIDs = expectedIDs
3352
3353 if type(evtType) == list or type(evtType) == tuple:
3354 self.evtType = evtType
3355 else:
3356 self.evtType = [evtType]
3357
3358
3359 def Bind(self, target, id1, id2, function):
3360 """Bind this set of event types to target."""
3361 for et in self.evtType:
3362 target.Connect(id1, id2, et, function)
3363
3364
3365 def Unbind(self, target, id1, id2):
3366 """Remove an event binding."""
3367 success = 0
3368 for et in self.evtType:
3369 success += target.Disconnect(id1, id2, et)
3370 return success != 0
3371
3372
3373 def __call__(self, *args):
3374 """
3375 For backwards compatibility with the old EVT_* functions.
3376 Should be called with either (window, func), (window, ID,
3377 func) or (window, ID1, ID2, func) parameters depending on the
3378 type of the event.
3379 """
3380 assert len(args) == 2 + self.expectedIDs
3381 id1 = wx.ID_ANY
3382 id2 = wx.ID_ANY
3383 target = args[0]
3384 if self.expectedIDs == 0:
3385 func = args[1]
3386 elif self.expectedIDs == 1:
3387 id1 = args[1]
3388 func = args[2]
3389 elif self.expectedIDs == 2:
3390 id1 = args[1]
3391 id2 = args[2]
3392 func = args[3]
3393 else:
3394 raise ValueError, "Unexpected number of IDs"
3395
3396 self.Bind(target, id1, id2, func)
3397
3398
3399 # These two are square pegs that don't fit the PyEventBinder hole...
3400 def EVT_COMMAND(win, id, cmd, func):
3401 win.Connect(id, -1, cmd, func)
3402 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3403 win.Connect(id1, id2, cmd, func)
3404
3405
3406 #---------------------------------------------------------------------------
3407
3408 #---------------------------------------------------------------------------
3409
3410 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3411 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3412
3413 def NewEventType(*args):
3414 """NewEventType() -> EventType"""
3415 return _core_.NewEventType(*args)
3416 wxEVT_NULL = _core_.wxEVT_NULL
3417 wxEVT_FIRST = _core_.wxEVT_FIRST
3418 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3419 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3420 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3421 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3422 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3423 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3424 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3425 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3426 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3427 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3428 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3429 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3430 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3431 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3432 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3433 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3434 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3435 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3436 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3437 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3438 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3439 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3440 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3441 wxEVT_MOTION = _core_.wxEVT_MOTION
3442 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3443 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3444 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3445 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3446 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3447 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3448 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3449 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3450 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3451 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3452 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3453 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3454 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3455 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3456 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3457 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3458 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3459 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3460 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3461 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3462 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3463 wxEVT_CHAR = _core_.wxEVT_CHAR
3464 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3465 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3466 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3467 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3468 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3469 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3470 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3471 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3472 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3473 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3474 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3475 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3476 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3477 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3478 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3479 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3480 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3481 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3482 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3483 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3484 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3485 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3486 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3487 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3488 wxEVT_SIZE = _core_.wxEVT_SIZE
3489 wxEVT_MOVE = _core_.wxEVT_MOVE
3490 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3491 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3492 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3493 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3494 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3495 wxEVT_CREATE = _core_.wxEVT_CREATE
3496 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3497 wxEVT_SHOW = _core_.wxEVT_SHOW
3498 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3499 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3500 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3501 wxEVT_PAINT = _core_.wxEVT_PAINT
3502 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3503 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3504 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3505 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3506 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3507 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3508 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3509 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3510 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3511 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3512 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3513 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3514 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3515 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3516 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3517 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3518 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3519 wxEVT_IDLE = _core_.wxEVT_IDLE
3520 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3521 wxEVT_SIZING = _core_.wxEVT_SIZING
3522 wxEVT_MOVING = _core_.wxEVT_MOVING
3523 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3524 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3525 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3526 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3527 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3528 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3529 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3530 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3531 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3532 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3533 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3534 #
3535 # Create some event binders
3536 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3537 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3538 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3539 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3540 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3541 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3542 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3543 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3544 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3545 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3546 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3547 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3548 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3549 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3550 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3551 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3552 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3553 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3554 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3555 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3556 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3557 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3558 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3559 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3560 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3561 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3562 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3563 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3564 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3565 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3566 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3567 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3568 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3569 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3570 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3571 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3572 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3573 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3574 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3575 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3576 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3577
3578 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3579 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3580 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3581 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3582 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3583 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3584 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3585 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3586 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3587 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3588 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3589 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3590 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3591
3592 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3593 wxEVT_LEFT_UP,
3594 wxEVT_MIDDLE_DOWN,
3595 wxEVT_MIDDLE_UP,
3596 wxEVT_RIGHT_DOWN,
3597 wxEVT_RIGHT_UP,
3598 wxEVT_MOTION,
3599 wxEVT_LEFT_DCLICK,
3600 wxEVT_MIDDLE_DCLICK,
3601 wxEVT_RIGHT_DCLICK,
3602 wxEVT_ENTER_WINDOW,
3603 wxEVT_LEAVE_WINDOW,
3604 wxEVT_MOUSEWHEEL
3605 ])
3606
3607
3608 # Scrolling from wxWindow (sent to wxScrolledWindow)
3609 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3610 wxEVT_SCROLLWIN_BOTTOM,
3611 wxEVT_SCROLLWIN_LINEUP,
3612 wxEVT_SCROLLWIN_LINEDOWN,
3613 wxEVT_SCROLLWIN_PAGEUP,
3614 wxEVT_SCROLLWIN_PAGEDOWN,
3615 wxEVT_SCROLLWIN_THUMBTRACK,
3616 wxEVT_SCROLLWIN_THUMBRELEASE,
3617 ])
3618
3619 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3620 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3621 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3622 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3623 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3624 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3625 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3626 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3627
3628 # Scrolling from wx.Slider and wx.ScrollBar
3629 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3630 wxEVT_SCROLL_BOTTOM,
3631 wxEVT_SCROLL_LINEUP,
3632 wxEVT_SCROLL_LINEDOWN,
3633 wxEVT_SCROLL_PAGEUP,
3634 wxEVT_SCROLL_PAGEDOWN,
3635 wxEVT_SCROLL_THUMBTRACK,
3636 wxEVT_SCROLL_THUMBRELEASE,
3637 wxEVT_SCROLL_CHANGED,
3638 ])
3639
3640 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3641 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3642 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3643 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3644 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3645 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3646 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3647 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3648 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3649 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3650
3651 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3652 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3653 wxEVT_SCROLL_BOTTOM,
3654 wxEVT_SCROLL_LINEUP,
3655 wxEVT_SCROLL_LINEDOWN,
3656 wxEVT_SCROLL_PAGEUP,
3657 wxEVT_SCROLL_PAGEDOWN,
3658 wxEVT_SCROLL_THUMBTRACK,
3659 wxEVT_SCROLL_THUMBRELEASE,
3660 wxEVT_SCROLL_CHANGED,
3661 ], 1)
3662
3663 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3664 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3665 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3666 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3667 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3668 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3669 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3670 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3671 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3672 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3673
3674 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3675 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3676 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3677 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3678 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3679 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3680 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3681 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3682 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3683 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3684
3685 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3686 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3687 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3688 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3689 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3690 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3691 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3692 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3693 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3694
3695
3696 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3697 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3698 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3699 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3700 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3701 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3702 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3703
3704 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3705
3706 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3707 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3708
3709 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3710
3711 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3712 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3713 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3714
3715
3716 #---------------------------------------------------------------------------
3717
3718 class Event(Object):
3719 """
3720 An event is a structure holding information about an event passed to a
3721 callback or member function. wx.Event is an abstract base class for
3722 other event classes
3723 """
3724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3725 def __init__(self): raise AttributeError, "No constructor defined"
3726 __repr__ = _swig_repr
3727 __swig_destroy__ = _core_.delete_Event
3728 __del__ = lambda self : None;
3729 def SetEventType(*args, **kwargs):
3730 """
3731 SetEventType(self, EventType typ)
3732
3733 Sets the specific type of the event.
3734 """
3735 return _core_.Event_SetEventType(*args, **kwargs)
3736
3737 def GetEventType(*args, **kwargs):
3738 """
3739 GetEventType(self) -> EventType
3740
3741 Returns the identifier of the given event type, such as
3742 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3743 """
3744 return _core_.Event_GetEventType(*args, **kwargs)
3745
3746 def GetEventObject(*args, **kwargs):
3747 """
3748 GetEventObject(self) -> Object
3749
3750 Returns the object (usually a window) associated with the event, if
3751 any.
3752 """
3753 return _core_.Event_GetEventObject(*args, **kwargs)
3754
3755 def SetEventObject(*args, **kwargs):
3756 """
3757 SetEventObject(self, Object obj)
3758
3759 Sets the originating object, or in other words, obj is normally the
3760 object that is sending the event.
3761 """
3762 return _core_.Event_SetEventObject(*args, **kwargs)
3763
3764 def GetTimestamp(*args, **kwargs):
3765 """GetTimestamp(self) -> long"""
3766 return _core_.Event_GetTimestamp(*args, **kwargs)
3767
3768 def SetTimestamp(*args, **kwargs):
3769 """SetTimestamp(self, long ts=0)"""
3770 return _core_.Event_SetTimestamp(*args, **kwargs)
3771
3772 def GetId(*args, **kwargs):
3773 """
3774 GetId(self) -> int
3775
3776 Returns the identifier associated with this event, such as a button
3777 command id.
3778 """
3779 return _core_.Event_GetId(*args, **kwargs)
3780
3781 def SetId(*args, **kwargs):
3782 """
3783 SetId(self, int Id)
3784
3785 Set's the ID for the event. This is usually the ID of the window that
3786 is sending the event, but it can also be a command id from a menu
3787 item, etc.
3788 """
3789 return _core_.Event_SetId(*args, **kwargs)
3790
3791 def IsCommandEvent(*args, **kwargs):
3792 """
3793 IsCommandEvent(self) -> bool
3794
3795 Returns true if the event is or is derived from `wx.CommandEvent` else
3796 it returns false. Note: Exists only for optimization purposes.
3797 """
3798 return _core_.Event_IsCommandEvent(*args, **kwargs)
3799
3800 def Skip(*args, **kwargs):
3801 """
3802 Skip(self, bool skip=True)
3803
3804 Called by an event handler, it controls whether additional event
3805 handlers bound to this event will be called after the current event
3806 handler returns. Skip(false) (the default setting) will prevent
3807 additional event handlers from being called and control will be
3808 returned to the sender of the event immediately after the current
3809 handler has finished. Skip(True) will cause the event processing
3810 system to continue searching for a handler function for this event.
3811
3812 """
3813 return _core_.Event_Skip(*args, **kwargs)
3814
3815 def GetSkipped(*args, **kwargs):
3816 """
3817 GetSkipped(self) -> bool
3818
3819 Returns true if the event handler should be skipped, false otherwise.
3820 :see: `Skip`
3821 """
3822 return _core_.Event_GetSkipped(*args, **kwargs)
3823
3824 def ShouldPropagate(*args, **kwargs):
3825 """
3826 ShouldPropagate(self) -> bool
3827
3828 Test if this event should be propagated to the parent window or not,
3829 i.e. if the propagation level is currently greater than 0.
3830 """
3831 return _core_.Event_ShouldPropagate(*args, **kwargs)
3832
3833 def StopPropagation(*args, **kwargs):
3834 """
3835 StopPropagation(self) -> int
3836
3837 Stop the event from propagating to its parent window. Returns the old
3838 propagation level value which may be later passed to
3839 `ResumePropagation` to allow propagating the event again.
3840 """
3841 return _core_.Event_StopPropagation(*args, **kwargs)
3842
3843 def ResumePropagation(*args, **kwargs):
3844 """
3845 ResumePropagation(self, int propagationLevel)
3846
3847 Resume the event propagation by restoring the propagation level. (For
3848 example, you can use the value returned by an earlier call to
3849 `StopPropagation`.)
3850
3851 """
3852 return _core_.Event_ResumePropagation(*args, **kwargs)
3853
3854 def Clone(*args, **kwargs):
3855 """Clone(self) -> Event"""
3856 return _core_.Event_Clone(*args, **kwargs)
3857
3858 _core_.Event_swigregister(Event)
3859
3860 #---------------------------------------------------------------------------
3861
3862 class PropagationDisabler(object):
3863 """
3864 Helper class to temporarily change an event not to propagate. Simply
3865 create an instance of this class and then whe it is destroyed the
3866 propogation of the event will be restored.
3867 """
3868 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3869 __repr__ = _swig_repr
3870 def __init__(self, *args, **kwargs):
3871 """
3872 __init__(self, Event event) -> PropagationDisabler
3873
3874 Helper class to temporarily change an event not to propagate. Simply
3875 create an instance of this class and then whe it is destroyed the
3876 propogation of the event will be restored.
3877 """
3878 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3879 __swig_destroy__ = _core_.delete_PropagationDisabler
3880 __del__ = lambda self : None;
3881 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3882
3883 class PropagateOnce(object):
3884 """
3885 A helper class that will temporarily lower propagation level of an
3886 event. Simply create an instance of this class and then whe it is
3887 destroyed the propogation of the event will be restored.
3888 """
3889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3890 __repr__ = _swig_repr
3891 def __init__(self, *args, **kwargs):
3892 """
3893 __init__(self, Event event) -> PropagateOnce
3894
3895 A helper class that will temporarily lower propagation level of an
3896 event. Simply create an instance of this class and then whe it is
3897 destroyed the propogation of the event will be restored.
3898 """
3899 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3900 __swig_destroy__ = _core_.delete_PropagateOnce
3901 __del__ = lambda self : None;
3902 _core_.PropagateOnce_swigregister(PropagateOnce)
3903
3904 #---------------------------------------------------------------------------
3905
3906 class CommandEvent(Event):
3907 """
3908 This event class contains information about command events, which
3909 originate from a variety of simple controls, as well as menus and
3910 toolbars.
3911 """
3912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3913 __repr__ = _swig_repr
3914 def __init__(self, *args, **kwargs):
3915 """
3916 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3917
3918 This event class contains information about command events, which
3919 originate from a variety of simple controls, as well as menus and
3920 toolbars.
3921 """
3922 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3923 def GetSelection(*args, **kwargs):
3924 """
3925 GetSelection(self) -> int
3926
3927 Returns item index for a listbox or choice selection event (not valid
3928 for a deselection).
3929 """
3930 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3931
3932 def SetString(*args, **kwargs):
3933 """SetString(self, String s)"""
3934 return _core_.CommandEvent_SetString(*args, **kwargs)
3935
3936 def GetString(*args, **kwargs):
3937 """
3938 GetString(self) -> String
3939
3940 Returns item string for a listbox or choice selection event (not valid
3941 for a deselection).
3942 """
3943 return _core_.CommandEvent_GetString(*args, **kwargs)
3944
3945 def IsChecked(*args, **kwargs):
3946 """
3947 IsChecked(self) -> bool
3948
3949 This method can be used with checkbox and menu events: for the
3950 checkboxes, the method returns true for a selection event and false
3951 for a deselection one. For the menu events, this method indicates if
3952 the menu item just has become checked or unchecked (and thus only
3953 makes sense for checkable menu items).
3954 """
3955 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3956
3957 Checked = IsChecked
3958 def IsSelection(*args, **kwargs):
3959 """
3960 IsSelection(self) -> bool
3961
3962 For a listbox or similar event, returns true if it is a selection,
3963 false if it is a deselection.
3964 """
3965 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3966
3967 def SetExtraLong(*args, **kwargs):
3968 """SetExtraLong(self, long extraLong)"""
3969 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3970
3971 def GetExtraLong(*args, **kwargs):
3972 """
3973 GetExtraLong(self) -> long
3974
3975 Returns extra information dependant on the event objects type. If the
3976 event comes from a listbox selection, it is a boolean determining
3977 whether the event was a selection (true) or a deselection (false). A
3978 listbox deselection only occurs for multiple-selection boxes, and in
3979 this case the index and string values are indeterminate and the
3980 listbox must be examined by the application.
3981 """
3982 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3983
3984 def SetInt(*args, **kwargs):
3985 """SetInt(self, int i)"""
3986 return _core_.CommandEvent_SetInt(*args, **kwargs)
3987
3988 def GetInt(*args, **kwargs):
3989 """
3990 GetInt(self) -> int
3991
3992 Returns the integer identifier corresponding to a listbox, choice or
3993 radiobox selection (only if the event was a selection, not a
3994 deselection), or a boolean value representing the value of a checkbox.
3995 """
3996 return _core_.CommandEvent_GetInt(*args, **kwargs)
3997
3998 def GetClientData(*args, **kwargs):
3999 """
4000 GetClientData(self) -> PyObject
4001
4002 Returns the client data object for a listbox or choice selection event, (if any.)
4003 """
4004 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4005
4006 def SetClientData(*args, **kwargs):
4007 """
4008 SetClientData(self, PyObject clientData)
4009
4010 Associate the given client data with the item at position n.
4011 """
4012 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4013
4014 GetClientObject = GetClientData
4015 SetClientObject = SetClientData
4016
4017 def Clone(*args, **kwargs):
4018 """Clone(self) -> Event"""
4019 return _core_.CommandEvent_Clone(*args, **kwargs)
4020
4021 _core_.CommandEvent_swigregister(CommandEvent)
4022
4023 #---------------------------------------------------------------------------
4024
4025 class NotifyEvent(CommandEvent):
4026 """
4027 An instance of this class (or one of its derived classes) is sent from
4028 a control when the control's state is being changed and the control
4029 allows that change to be prevented from happening. The event handler
4030 can call `Veto` or `Allow` to tell the control what to do.
4031 """
4032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4033 __repr__ = _swig_repr
4034 def __init__(self, *args, **kwargs):
4035 """
4036 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4037
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4042 """
4043 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4044 def Veto(*args, **kwargs):
4045 """
4046 Veto(self)
4047
4048 Prevents the change announced by this event from happening.
4049
4050 It is in general a good idea to notify the user about the reasons for
4051 vetoing the change because otherwise the applications behaviour (which
4052 just refuses to do what the user wants) might be quite surprising.
4053 """
4054 return _core_.NotifyEvent_Veto(*args, **kwargs)
4055
4056 def Allow(*args, **kwargs):
4057 """
4058 Allow(self)
4059
4060 This is the opposite of `Veto`: it explicitly allows the event to be
4061 processed. For most events it is not necessary to call this method as
4062 the events are allowed anyhow but some are forbidden by default (this
4063 will be mentioned in the corresponding event description).
4064 """
4065 return _core_.NotifyEvent_Allow(*args, **kwargs)
4066
4067 def IsAllowed(*args, **kwargs):
4068 """
4069 IsAllowed(self) -> bool
4070
4071 Returns true if the change is allowed (`Veto` hasn't been called) or
4072 false otherwise (if it was).
4073 """
4074 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4075
4076 _core_.NotifyEvent_swigregister(NotifyEvent)
4077
4078 #---------------------------------------------------------------------------
4079
4080 class ScrollEvent(CommandEvent):
4081 """
4082 A scroll event holds information about events sent from stand-alone
4083 scrollbars and sliders. Note that scrolled windows do not send
4084 instnaces of this event class, but send the `wx.ScrollWinEvent`
4085 instead.
4086 """
4087 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4088 __repr__ = _swig_repr
4089 def __init__(self, *args, **kwargs):
4090 """
4091 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4092 int orient=0) -> ScrollEvent
4093 """
4094 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4095 def GetOrientation(*args, **kwargs):
4096 """
4097 GetOrientation(self) -> int
4098
4099 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4100 the scrollbar.
4101 """
4102 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4103
4104 def GetPosition(*args, **kwargs):
4105 """
4106 GetPosition(self) -> int
4107
4108 Returns the position of the scrollbar.
4109 """
4110 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4111
4112 def SetOrientation(*args, **kwargs):
4113 """SetOrientation(self, int orient)"""
4114 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4115
4116 def SetPosition(*args, **kwargs):
4117 """SetPosition(self, int pos)"""
4118 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4119
4120 _core_.ScrollEvent_swigregister(ScrollEvent)
4121
4122 #---------------------------------------------------------------------------
4123
4124 class ScrollWinEvent(Event):
4125 """
4126 A wx.ScrollWinEvent holds information about scrolling and is sent from
4127 scrolling windows.
4128 """
4129 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4130 __repr__ = _swig_repr
4131 def __init__(self, *args, **kwargs):
4132 """
4133 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4134
4135 A wx.ScrollWinEvent holds information about scrolling and is sent from
4136 scrolling windows.
4137 """
4138 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4139 def GetOrientation(*args, **kwargs):
4140 """
4141 GetOrientation(self) -> int
4142
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4144 the scrollbar.
4145 """
4146 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4147
4148 def GetPosition(*args, **kwargs):
4149 """
4150 GetPosition(self) -> int
4151
4152 Returns the position of the scrollbar for the thumb track and release
4153 events. Note that this field can't be used for the other events, you
4154 need to query the window itself for the current position in that case.
4155 """
4156 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4157
4158 def SetOrientation(*args, **kwargs):
4159 """SetOrientation(self, int orient)"""
4160 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4161
4162 def SetPosition(*args, **kwargs):
4163 """SetPosition(self, int pos)"""
4164 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4165
4166 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4167
4168 #---------------------------------------------------------------------------
4169
4170 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4171 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4172 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4173 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4174 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4175 class MouseEvent(Event):
4176 """
4177 This event class contains information about the events generated by
4178 the mouse: they include mouse buttons press and release events and
4179 mouse move events.
4180
4181 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4182 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4183 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4184 a middle button so a portable application should avoid relying on the
4185 events from it.
4186
4187 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4188 the former returns true when the event corresponds to the left mouse
4189 button click while the latter returns true if the left mouse button is
4190 currently being pressed. For example, when the user is dragging the
4191 mouse you can use `LeftIsDown` to test whether the left mouse button
4192 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4193 `LeftIsDown` will also return true in wxWidgets whatever the
4194 underlying GUI behaviour is (which is platform-dependent). The same
4195 applies, of course, to other mouse buttons as well.
4196 """
4197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4198 __repr__ = _swig_repr
4199 def __init__(self, *args, **kwargs):
4200 """
4201 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4202
4203 Constructs a wx.MouseEvent. Valid event types are:
4204
4205 * wxEVT_ENTER_WINDOW
4206 * wxEVT_LEAVE_WINDOW
4207 * wxEVT_LEFT_DOWN
4208 * wxEVT_LEFT_UP
4209 * wxEVT_LEFT_DCLICK
4210 * wxEVT_MIDDLE_DOWN
4211 * wxEVT_MIDDLE_UP
4212 * wxEVT_MIDDLE_DCLICK
4213 * wxEVT_RIGHT_DOWN
4214 * wxEVT_RIGHT_UP
4215 * wxEVT_RIGHT_DCLICK
4216 * wxEVT_MOTION
4217 * wxEVT_MOUSEWHEEL
4218 """
4219 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4220 def IsButton(*args, **kwargs):
4221 """
4222 IsButton(self) -> bool
4223
4224 Returns true if the event was a mouse button event (not necessarily a
4225 button down event - that may be tested using `ButtonDown`).
4226 """
4227 return _core_.MouseEvent_IsButton(*args, **kwargs)
4228
4229 def ButtonDown(*args, **kwargs):
4230 """
4231 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4232
4233 If the argument is omitted, this returns true if the event was any
4234 mouse button down event. Otherwise the argument specifies which
4235 button-down event shold be checked for (see `Button` for the possible
4236 values).
4237 """
4238 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4239
4240 def ButtonDClick(*args, **kwargs):
4241 """
4242 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4243
4244 If the argument is omitted, this returns true if the event was any
4245 mouse double click event. Otherwise the argument specifies which
4246 double click event to check for (see `Button` for the possible
4247 values).
4248 """
4249 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4250
4251 def ButtonUp(*args, **kwargs):
4252 """
4253 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4254
4255 If the argument is omitted, this returns true if the event was any
4256 mouse button up event. Otherwise the argument specifies which button
4257 up event to check for (see `Button` for the possible values).
4258 """
4259 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4260
4261 def Button(*args, **kwargs):
4262 """
4263 Button(self, int button) -> bool
4264
4265 Returns true if the identified mouse button is changing state. Valid
4266 values of button are:
4267
4268 ==================== =====================================
4269 wx.MOUSE_BTN_LEFT check if left button was pressed
4270 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4271 wx.MOUSE_BTN_RIGHT check if right button was pressed
4272 wx.MOUSE_BTN_ANY check if any button was pressed
4273 ==================== =====================================
4274
4275 """
4276 return _core_.MouseEvent_Button(*args, **kwargs)
4277
4278 def ButtonIsDown(*args, **kwargs):
4279 """ButtonIsDown(self, int but) -> bool"""
4280 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4281
4282 def GetButton(*args, **kwargs):
4283 """
4284 GetButton(self) -> int
4285
4286 Returns the mouse button which generated this event or
4287 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4288 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4289 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4290 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4291 right buttons respectively.
4292 """
4293 return _core_.MouseEvent_GetButton(*args, **kwargs)
4294
4295 def ControlDown(*args, **kwargs):
4296 """
4297 ControlDown(self) -> bool
4298
4299 Returns true if the control key was down at the time of the event.
4300 """
4301 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4302
4303 def MetaDown(*args, **kwargs):
4304 """
4305 MetaDown(self) -> bool
4306
4307 Returns true if the Meta key was down at the time of the event.
4308 """
4309 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4310
4311 def AltDown(*args, **kwargs):
4312 """
4313 AltDown(self) -> bool
4314
4315 Returns true if the Alt key was down at the time of the event.
4316 """
4317 return _core_.MouseEvent_AltDown(*args, **kwargs)
4318
4319 def ShiftDown(*args, **kwargs):
4320 """
4321 ShiftDown(self) -> bool
4322
4323 Returns true if the Shift key was down at the time of the event.
4324 """
4325 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4326
4327 def CmdDown(*args, **kwargs):
4328 """
4329 CmdDown(self) -> bool
4330
4331 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4332 platforms but the special "Apple" (a.k.a as "Command") key on
4333 Macs. It often makes sense to use it instead of, say, `ControlDown`
4334 because Cmd key is used for the same thing under Mac as Ctrl
4335 elsewhere. The Ctrl key still exists, it's just not used for this
4336 purpose. So for non-Mac platforms this is the same as `ControlDown`
4337 and Macs this is the same as `MetaDown`.
4338 """
4339 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4340
4341 def LeftDown(*args, **kwargs):
4342 """
4343 LeftDown(self) -> bool
4344
4345 Returns true if the left mouse button state changed to down.
4346 """
4347 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4348
4349 def MiddleDown(*args, **kwargs):
4350 """
4351 MiddleDown(self) -> bool
4352
4353 Returns true if the middle mouse button state changed to down.
4354 """
4355 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4356
4357 def RightDown(*args, **kwargs):
4358 """
4359 RightDown(self) -> bool
4360
4361 Returns true if the right mouse button state changed to down.
4362 """
4363 return _core_.MouseEvent_RightDown(*args, **kwargs)
4364
4365 def LeftUp(*args, **kwargs):
4366 """
4367 LeftUp(self) -> bool
4368
4369 Returns true if the left mouse button state changed to up.
4370 """
4371 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4372
4373 def MiddleUp(*args, **kwargs):
4374 """
4375 MiddleUp(self) -> bool
4376
4377 Returns true if the middle mouse button state changed to up.
4378 """
4379 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4380
4381 def RightUp(*args, **kwargs):
4382 """
4383 RightUp(self) -> bool
4384
4385 Returns true if the right mouse button state changed to up.
4386 """
4387 return _core_.MouseEvent_RightUp(*args, **kwargs)
4388
4389 def LeftDClick(*args, **kwargs):
4390 """
4391 LeftDClick(self) -> bool
4392
4393 Returns true if the event was a left button double click.
4394 """
4395 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4396
4397 def MiddleDClick(*args, **kwargs):
4398 """
4399 MiddleDClick(self) -> bool
4400
4401 Returns true if the event was a middle button double click.
4402 """
4403 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4404
4405 def RightDClick(*args, **kwargs):
4406 """
4407 RightDClick(self) -> bool
4408
4409 Returns true if the event was a right button double click.
4410 """
4411 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4412
4413 def LeftIsDown(*args, **kwargs):
4414 """
4415 LeftIsDown(self) -> bool
4416
4417 Returns true if the left mouse button is currently down, independent
4418 of the current event type.
4419
4420 Please notice that it is not the same as LeftDown which returns true
4421 if the left mouse button was just pressed. Rather, it describes the
4422 state of the mouse button before the event happened.
4423
4424 This event is usually used in the mouse event handlers which process
4425 "move mouse" messages to determine whether the user is (still)
4426 dragging the mouse.
4427 """
4428 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4429
4430 def MiddleIsDown(*args, **kwargs):
4431 """
4432 MiddleIsDown(self) -> bool
4433
4434 Returns true if the middle mouse button is currently down, independent
4435 of the current event type.
4436 """
4437 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4438
4439 def RightIsDown(*args, **kwargs):
4440 """
4441 RightIsDown(self) -> bool
4442
4443 Returns true if the right mouse button is currently down, independent
4444 of the current event type.
4445 """
4446 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4447
4448 def Dragging(*args, **kwargs):
4449 """
4450 Dragging(self) -> bool
4451
4452 Returns true if this was a dragging event (motion while a button is
4453 depressed).
4454 """
4455 return _core_.MouseEvent_Dragging(*args, **kwargs)
4456
4457 def Moving(*args, **kwargs):
4458 """
4459 Moving(self) -> bool
4460
4461 Returns true if this was a motion event and no mouse buttons were
4462 pressed. If any mouse button is held pressed, then this method returns
4463 false and Dragging returns true.
4464 """
4465 return _core_.MouseEvent_Moving(*args, **kwargs)
4466
4467 def Entering(*args, **kwargs):
4468 """
4469 Entering(self) -> bool
4470
4471 Returns true if the mouse was entering the window.
4472 """
4473 return _core_.MouseEvent_Entering(*args, **kwargs)
4474
4475 def Leaving(*args, **kwargs):
4476 """
4477 Leaving(self) -> bool
4478
4479 Returns true if the mouse was leaving the window.
4480 """
4481 return _core_.MouseEvent_Leaving(*args, **kwargs)
4482
4483 def GetPosition(*args, **kwargs):
4484 """
4485 GetPosition(self) -> Point
4486
4487 Returns the pixel position of the mouse in window coordinates when the
4488 event happened.
4489 """
4490 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4491
4492 def GetPositionTuple(*args, **kwargs):
4493 """
4494 GetPositionTuple() -> (x,y)
4495
4496 Returns the pixel position of the mouse in window coordinates when the
4497 event happened.
4498 """
4499 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4500
4501 def GetLogicalPosition(*args, **kwargs):
4502 """
4503 GetLogicalPosition(self, DC dc) -> Point
4504
4505 Returns the logical mouse position in pixels (i.e. translated
4506 according to the translation set for the DC, which usually indicates
4507 that the window has been scrolled).
4508 """
4509 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4510
4511 def GetX(*args, **kwargs):
4512 """
4513 GetX(self) -> int
4514
4515 Returns X coordinate of the physical mouse event position.
4516 """
4517 return _core_.MouseEvent_GetX(*args, **kwargs)
4518
4519 def GetY(*args, **kwargs):
4520 """
4521 GetY(self) -> int
4522
4523 Returns Y coordinate of the physical mouse event position.
4524 """
4525 return _core_.MouseEvent_GetY(*args, **kwargs)
4526
4527 def GetWheelRotation(*args, **kwargs):
4528 """
4529 GetWheelRotation(self) -> int
4530
4531 Get wheel rotation, positive or negative indicates direction of
4532 rotation. Current devices all send an event when rotation is equal to
4533 +/-WheelDelta, but this allows for finer resolution devices to be
4534 created in the future. Because of this you shouldn't assume that one
4535 event is equal to 1 line or whatever, but you should be able to either
4536 do partial line scrolling or wait until +/-WheelDelta rotation values
4537 have been accumulated before scrolling.
4538 """
4539 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4540
4541 def GetWheelDelta(*args, **kwargs):
4542 """
4543 GetWheelDelta(self) -> int
4544
4545 Get wheel delta, normally 120. This is the threshold for action to be
4546 taken, and one such action (for example, scrolling one increment)
4547 should occur for each delta.
4548 """
4549 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4550
4551 def GetLinesPerAction(*args, **kwargs):
4552 """
4553 GetLinesPerAction(self) -> int
4554
4555 Returns the configured number of lines (or whatever) to be scrolled
4556 per wheel action. Defaults to three.
4557 """
4558 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4559
4560 def IsPageScroll(*args, **kwargs):
4561 """
4562 IsPageScroll(self) -> bool
4563
4564 Returns true if the system has been setup to do page scrolling with
4565 the mouse wheel instead of line scrolling.
4566 """
4567 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4568
4569 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4570 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4571 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4572 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4573 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4574 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4575 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4576 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4577 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4578 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4579 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4580 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4581 _core_.MouseEvent_swigregister(MouseEvent)
4582
4583 #---------------------------------------------------------------------------
4584
4585 class SetCursorEvent(Event):
4586 """
4587 A SetCursorEvent is generated when the mouse cursor is about to be set
4588 as a result of mouse motion. This event gives the application the
4589 chance to perform specific mouse cursor processing based on the
4590 current position of the mouse within the window. Use the `SetCursor`
4591 method to specify the cursor you want to be displayed.
4592 """
4593 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4594 __repr__ = _swig_repr
4595 def __init__(self, *args, **kwargs):
4596 """
4597 __init__(self, int x=0, int y=0) -> SetCursorEvent
4598
4599 Construct a new `wx.SetCursorEvent`.
4600 """
4601 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4602 def GetX(*args, **kwargs):
4603 """
4604 GetX(self) -> int
4605
4606 Returns the X coordinate of the mouse in client coordinates.
4607 """
4608 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4609
4610 def GetY(*args, **kwargs):
4611 """
4612 GetY(self) -> int
4613
4614 Returns the Y coordinate of the mouse in client coordinates.
4615 """
4616 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4617
4618 def SetCursor(*args, **kwargs):
4619 """
4620 SetCursor(self, Cursor cursor)
4621
4622 Sets the cursor associated with this event.
4623 """
4624 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4625
4626 def GetCursor(*args, **kwargs):
4627 """
4628 GetCursor(self) -> Cursor
4629
4630 Returns a reference to the cursor specified by this event.
4631 """
4632 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4633
4634 def HasCursor(*args, **kwargs):
4635 """
4636 HasCursor(self) -> bool
4637
4638 Returns true if the cursor specified by this event is a valid cursor.
4639 """
4640 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4641
4642 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4643
4644 #---------------------------------------------------------------------------
4645
4646 class KeyEvent(Event):
4647 """
4648 This event class contains information about keypress and character
4649 events. These events are only sent to the widget that currently has
4650 the keyboard focus.
4651
4652 Notice that there are three different kinds of keyboard events in
4653 wxWidgets: key down and up events and char events. The difference
4654 between the first two is clear - the first corresponds to a key press
4655 and the second to a key release - otherwise they are identical. Just
4656 note that if the key is maintained in a pressed state you will
4657 typically get a lot of (automatically generated) down events but only
4658 one up so it is wrong to assume that there is one up event
4659 corresponding to each down one.
4660
4661 Both key events provide untranslated key codes while the char event
4662 carries the translated one. The untranslated code for alphanumeric
4663 keys is always an upper case value. For the other keys it is one of
4664 WXK_XXX values from the keycodes table. The translated key is, in
4665 general, the character the user expects to appear as the result of the
4666 key combination when typing the text into a text entry zone, for
4667 example.
4668
4669 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4670 and the standard US keyboard): when the 'A' key is pressed, the key
4671 down event key code is equal to ASCII A == 65. But the char event key
4672 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4673 'A' keys simultaneously , the key code in key down event will still be
4674 just 'A' while the char event key code parameter will now be 'A' as
4675 well.
4676
4677 Although in this simple case it is clear that the correct key code
4678 could be found in the key down event handler by checking the value
4679 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4680 as for non alphanumeric keys or non-US keyboard layouts the
4681 translation is keyboard-layout dependent and can only be done properly
4682 by the system itself.
4683
4684 Another kind of translation is done when the control key is pressed:
4685 for example, for CTRL-A key press the key down event still carries the
4686 same key code 'A' as usual but the char event will have key code of 1,
4687 the ASCII value of this key combination.
4688
4689 You may discover how the other keys on your system behave
4690 interactively by running the KeyEvents sample in the wxPython demo and
4691 pressing some keys while the blue box at the top has the keyboard
4692 focus.
4693
4694 **Note**: If a key down event is caught and the event handler does not
4695 call event.Skip() then the coresponding char event will not
4696 happen. This is by design and enables the programs that handle both
4697 types of events to be a bit simpler.
4698
4699 **Note for Windows programmers**: The key and char events in wxWidgets
4700 are similar to but slightly different from Windows WM_KEYDOWN and
4701 WM_CHAR events. In particular, Alt-x combination will generate a char
4702 event in wxWidgets (unless it is used as an accelerator).
4703
4704 **Tip**: be sure to call event.Skip() for events that you don't
4705 process in key event function, otherwise menu shortcuts may cease to
4706 work under Windows.
4707
4708 """
4709 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4710 __repr__ = _swig_repr
4711 def __init__(self, *args, **kwargs):
4712 """
4713 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4714
4715 Construct a new `wx.KeyEvent`. Valid event types are:
4716 *
4717 """
4718 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4719 def GetModifiers(*args, **kwargs):
4720 """
4721 GetModifiers(self) -> int
4722
4723 Returns a bitmask of the current modifier settings. Can be used to
4724 check if the key event has exactly the given modifiers without having
4725 to explicitly check that the other modifiers are not down. For
4726 example::
4727
4728 if event.GetModifers() == wx.MOD_CONTROL:
4729 DoSomething()
4730
4731 """
4732 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4733
4734 def ControlDown(*args, **kwargs):
4735 """
4736 ControlDown(self) -> bool
4737
4738 Returns ``True`` if the Control key was down at the time of the event.
4739 """
4740 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4741
4742 def MetaDown(*args, **kwargs):
4743 """
4744 MetaDown(self) -> bool
4745
4746 Returns ``True`` if the Meta key was down at the time of the event.
4747 """
4748 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4749
4750 def AltDown(*args, **kwargs):
4751 """
4752 AltDown(self) -> bool
4753
4754 Returns ``True`` if the Alt key was down at the time of the event.
4755 """
4756 return _core_.KeyEvent_AltDown(*args, **kwargs)
4757
4758 def ShiftDown(*args, **kwargs):
4759 """
4760 ShiftDown(self) -> bool
4761
4762 Returns ``True`` if the Shift key was down at the time of the event.
4763 """
4764 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4765
4766 def CmdDown(*args, **kwargs):
4767 """
4768 CmdDown(self) -> bool
4769
4770 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4771 platforms but the special "Apple" (a.k.a as "Command") key on
4772 Macs. It makes often sense to use it instead of, say, `ControlDown`
4773 because Cmd key is used for the same thing under Mac as Ctrl
4774 elsewhere. The Ctrl still exists, it's just not used for this
4775 purpose. So for non-Mac platforms this is the same as `ControlDown`
4776 and Macs this is the same as `MetaDown`.
4777 """
4778 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4779
4780 def HasModifiers(*args, **kwargs):
4781 """
4782 HasModifiers(self) -> bool
4783
4784 Returns true if either CTRL or ALT keys was down at the time of the
4785 key event. Note that this function does not take into account neither
4786 SHIFT nor META key states (the reason for ignoring the latter is that
4787 it is common for NUMLOCK key to be configured as META under X but the
4788 key presses even while NUMLOCK is on should be still processed
4789 normally).
4790 """
4791 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4792
4793 def GetKeyCode(*args, **kwargs):
4794 """
4795 GetKeyCode(self) -> int
4796
4797 Returns the virtual key code. ASCII events return normal ASCII values,
4798 while non-ASCII events return values such as WXK_LEFT for the left
4799 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4800 codes.
4801
4802 Note that in Unicode build, the returned value is meaningful only if
4803 the user entered a character that can be represented in current
4804 locale's default charset. You can obtain the corresponding Unicode
4805 character using `GetUnicodeKey`.
4806 """
4807 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4808
4809 KeyCode = GetKeyCode
4810 def GetUnicodeKey(*args, **kwargs):
4811 """
4812 GetUnicodeKey(self) -> int
4813
4814 Returns the Unicode character corresponding to this key event. This
4815 function is only meaningfule in a Unicode build of wxPython.
4816 """
4817 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4818
4819 GetUniChar = GetUnicodeKey
4820 def GetRawKeyCode(*args, **kwargs):
4821 """
4822 GetRawKeyCode(self) -> unsigned int
4823
4824 Returns the raw key code for this event. This is a platform-dependent
4825 scan code which should only be used in advanced
4826 applications. Currently the raw key codes are not supported by all
4827 ports.
4828 """
4829 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4830
4831 def GetRawKeyFlags(*args, **kwargs):
4832 """
4833 GetRawKeyFlags(self) -> unsigned int
4834
4835 Returns the low level key flags for this event. The flags are
4836 platform-dependent and should only be used in advanced applications.
4837 Currently the raw key flags are not supported by all ports.
4838 """
4839 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4840
4841 def GetPosition(*args, **kwargs):
4842 """
4843 GetPosition(self) -> Point
4844
4845 Find the position of the event, if applicable.
4846 """
4847 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4848
4849 def GetPositionTuple(*args, **kwargs):
4850 """
4851 GetPositionTuple() -> (x,y)
4852
4853 Find the position of the event, if applicable.
4854 """
4855 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4856
4857 def GetX(*args, **kwargs):
4858 """
4859 GetX(self) -> int
4860
4861 Returns the X position (in client coordinates) of the event, if
4862 applicable.
4863 """
4864 return _core_.KeyEvent_GetX(*args, **kwargs)
4865
4866 def GetY(*args, **kwargs):
4867 """
4868 GetY(self) -> int
4869
4870 Returns the Y position (in client coordinates) of the event, if
4871 applicable.
4872 """
4873 return _core_.KeyEvent_GetY(*args, **kwargs)
4874
4875 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4876 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4877 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4878 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4879 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4880 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4881 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4882 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4883 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4884 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4885 _core_.KeyEvent_swigregister(KeyEvent)
4886
4887 #---------------------------------------------------------------------------
4888
4889 class SizeEvent(Event):
4890 """
4891 A size event holds information about size change events. The EVT_SIZE
4892 handler function will be called when the window it is bound to has
4893 been resized.
4894
4895 Note that the size passed is of the whole window: call
4896 `wx.Window.GetClientSize` for the area which may be used by the
4897 application.
4898
4899 When a window is resized, usually only a small part of the window is
4900 damaged and and that area is all that is in the update region for the
4901 next paint event. However, if your drawing depends on the size of the
4902 window, you may need to clear the DC explicitly and repaint the whole
4903 window. In which case, you may need to call `wx.Window.Refresh` to
4904 invalidate the entire window.
4905
4906 """
4907 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4908 __repr__ = _swig_repr
4909 def __init__(self, *args, **kwargs):
4910 """
4911 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4912
4913 Construct a new ``wx.SizeEvent``.
4914 """
4915 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4916 def GetSize(*args, **kwargs):
4917 """
4918 GetSize(self) -> Size
4919
4920 Returns the entire size of the window generating the size change
4921 event.
4922 """
4923 return _core_.SizeEvent_GetSize(*args, **kwargs)
4924
4925 def GetRect(*args, **kwargs):
4926 """GetRect(self) -> Rect"""
4927 return _core_.SizeEvent_GetRect(*args, **kwargs)
4928
4929 def SetRect(*args, **kwargs):
4930 """SetRect(self, Rect rect)"""
4931 return _core_.SizeEvent_SetRect(*args, **kwargs)
4932
4933 def SetSize(*args, **kwargs):
4934 """SetSize(self, Size size)"""
4935 return _core_.SizeEvent_SetSize(*args, **kwargs)
4936
4937 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4938 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4939 _core_.SizeEvent_swigregister(SizeEvent)
4940
4941 #---------------------------------------------------------------------------
4942
4943 class MoveEvent(Event):
4944 """
4945 This event object is sent for EVT_MOVE event bindings when a window is
4946 moved to a new position.
4947 """
4948 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4949 __repr__ = _swig_repr
4950 def __init__(self, *args, **kwargs):
4951 """
4952 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4953
4954 Constructor.
4955 """
4956 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
4957 def GetPosition(*args, **kwargs):
4958 """
4959 GetPosition(self) -> Point
4960
4961 Returns the position of the window generating the move change event.
4962 """
4963 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4964
4965 def GetRect(*args, **kwargs):
4966 """GetRect(self) -> Rect"""
4967 return _core_.MoveEvent_GetRect(*args, **kwargs)
4968
4969 def SetRect(*args, **kwargs):
4970 """SetRect(self, Rect rect)"""
4971 return _core_.MoveEvent_SetRect(*args, **kwargs)
4972
4973 def SetPosition(*args, **kwargs):
4974 """SetPosition(self, Point pos)"""
4975 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4976
4977 m_pos = property(GetPosition, SetPosition)
4978 m_rect = property(GetRect, SetRect)
4979
4980 _core_.MoveEvent_swigregister(MoveEvent)
4981
4982 #---------------------------------------------------------------------------
4983
4984 class PaintEvent(Event):
4985 """
4986 A paint event is sent when a window's contents needs to be repainted.
4987 Note that in an EVT_PAINT handler the application must *always* create
4988 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4989 Windows assumes that the window has not been painted yet and will send
4990 the event again, causing endless refreshes.
4991
4992 You can optimize painting by retrieving the rectangles that have been
4993 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
4994 and only repainting these rectangles. The rectangles are in terms of
4995 the client area, and are unscrolled, so you will need to do some
4996 calculations using the current view position to obtain logical,
4997 scrolled units.
4998
4999 """
5000 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5001 __repr__ = _swig_repr
5002 def __init__(self, *args, **kwargs):
5003 """__init__(self, int Id=0) -> PaintEvent"""
5004 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5005 _core_.PaintEvent_swigregister(PaintEvent)
5006
5007 class NcPaintEvent(Event):
5008 """Proxy of C++ NcPaintEvent class"""
5009 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5010 __repr__ = _swig_repr
5011 def __init__(self, *args, **kwargs):
5012 """__init__(self, int winid=0) -> NcPaintEvent"""
5013 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5014 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5015
5016 #---------------------------------------------------------------------------
5017
5018 class EraseEvent(Event):
5019 """
5020 An erase event is sent whenever the background of a window needs to be
5021 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5022 binder. On some platforms, such as GTK+, this event is simulated
5023 (simply generated just before the paint event) and may cause flicker.
5024
5025 To paint a custom background use the `GetDC` method and use the returned
5026 device context if it is not ``None``, otherwise create a temporary
5027 `wx.ClientDC` and draw on that.
5028
5029 """
5030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5031 __repr__ = _swig_repr
5032 def __init__(self, *args, **kwargs):
5033 """
5034 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5035
5036 Constructor
5037 """
5038 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5039 def GetDC(*args, **kwargs):
5040 """
5041 GetDC(self) -> DC
5042
5043 Returns the device context the event handler should draw upon. If
5044 ``None`` is returned then create a temporary `wx.ClientDC` and use
5045 that instead.
5046 """
5047 return _core_.EraseEvent_GetDC(*args, **kwargs)
5048
5049 _core_.EraseEvent_swigregister(EraseEvent)
5050
5051 #---------------------------------------------------------------------------
5052
5053 class FocusEvent(Event):
5054 """
5055 A focus event is sent when a window's focus changes. The window losing
5056 focus receives an EVT_KILL_FOCUS event while the window gaining it
5057 gets an EVT_SET_FOCUS event.
5058
5059 Notice that the set focus event happens both when the user gives focus
5060 to the window (whether using the mouse or keyboard) and when it is
5061 done from the program itself using `wx.Window.SetFocus`.
5062
5063 """
5064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5065 __repr__ = _swig_repr
5066 def __init__(self, *args, **kwargs):
5067 """
5068 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5069
5070 Constructor
5071 """
5072 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5073 def GetWindow(*args, **kwargs):
5074 """
5075 GetWindow(self) -> Window
5076
5077 Returns the other window associated with this event, that is the
5078 window which had the focus before for the EVT_SET_FOCUS event and the
5079 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5080
5081 Warning: the window returned may be None!
5082 """
5083 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5084
5085 def SetWindow(*args, **kwargs):
5086 """SetWindow(self, Window win)"""
5087 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5088
5089 _core_.FocusEvent_swigregister(FocusEvent)
5090
5091 #---------------------------------------------------------------------------
5092
5093 class ChildFocusEvent(CommandEvent):
5094 """
5095 wx.ChildFocusEvent notifies the parent that a child has received the
5096 focus. Unlike `wx.FocusEvent` it is propagated up the window
5097 heirarchy.
5098 """
5099 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5100 __repr__ = _swig_repr
5101 def __init__(self, *args, **kwargs):
5102 """
5103 __init__(self, Window win=None) -> ChildFocusEvent
5104
5105 Constructor
5106 """
5107 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5108 def GetWindow(*args, **kwargs):
5109 """
5110 GetWindow(self) -> Window
5111
5112 The window which has just received the focus.
5113 """
5114 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5115
5116 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5117
5118 #---------------------------------------------------------------------------
5119
5120 class ActivateEvent(Event):
5121 """
5122 An activate event is sent when a top-level window or the entire
5123 application is being activated or deactivated.
5124
5125 A top-level window (a dialog or frame) receives an activate event when
5126 is being activated or deactivated. This is indicated visually by the
5127 title bar changing colour, and a subwindow gaining the keyboard focus.
5128 An application is activated or deactivated when one of its frames
5129 becomes activated, or a frame becomes inactivate resulting in all
5130 application frames being inactive.
5131
5132 Please note that usually you should call event.Skip() in your handlers
5133 for these events so the default handlers will still be called, as not
5134 doing so can result in strange effects.
5135
5136 """
5137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5138 __repr__ = _swig_repr
5139 def __init__(self, *args, **kwargs):
5140 """
5141 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5142
5143 Constructor
5144 """
5145 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5146 def GetActive(*args, **kwargs):
5147 """
5148 GetActive(self) -> bool
5149
5150 Returns true if the application or window is being activated, false
5151 otherwise.
5152 """
5153 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5154
5155 _core_.ActivateEvent_swigregister(ActivateEvent)
5156
5157 #---------------------------------------------------------------------------
5158
5159 class InitDialogEvent(Event):
5160 """
5161 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5162 any window when `wx.Window.InitDialog` is called. Handlers for this
5163 event can transfer data to the window, or anything else that should be
5164 done before the user begins editing the form. The default handler
5165 calls `wx.Window.TransferDataToWindow`.
5166 """
5167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5168 __repr__ = _swig_repr
5169 def __init__(self, *args, **kwargs):
5170 """
5171 __init__(self, int Id=0) -> InitDialogEvent
5172
5173 Constructor
5174 """
5175 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5176 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5177
5178 #---------------------------------------------------------------------------
5179
5180 class MenuEvent(Event):
5181 """
5182 This class is used for a variety of menu-related events. Note that
5183 these do not include menu command events, which are handled by sending
5184 `wx.CommandEvent` objects.
5185
5186 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5187 text in the first field of the status bar.
5188 """
5189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5190 __repr__ = _swig_repr
5191 def __init__(self, *args, **kwargs):
5192 """
5193 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5194
5195 Constructor
5196 """
5197 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5198 def GetMenuId(*args, **kwargs):
5199 """
5200 GetMenuId(self) -> int
5201
5202 Returns the menu identifier associated with the event. This method
5203 should be only used with the HIGHLIGHT events.
5204 """
5205 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5206
5207 def IsPopup(*args, **kwargs):
5208 """
5209 IsPopup(self) -> bool
5210
5211 Returns ``True`` if the menu which is being opened or closed is a
5212 popup menu, ``False`` if it is a normal one. This method should only
5213 be used with the OPEN and CLOSE events.
5214 """
5215 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5216
5217 def GetMenu(*args, **kwargs):
5218 """
5219 GetMenu(self) -> Menu
5220
5221 Returns the menu which is being opened or closed. This method should
5222 only be used with the OPEN and CLOSE events.
5223 """
5224 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5225
5226 _core_.MenuEvent_swigregister(MenuEvent)
5227
5228 #---------------------------------------------------------------------------
5229
5230 class CloseEvent(Event):
5231 """
5232 This event class contains information about window and session close
5233 events.
5234
5235 The handler function for EVT_CLOSE is called when the user has tried
5236 to close a a frame or dialog box using the window manager controls or
5237 the system menu. It can also be invoked by the application itself
5238 programmatically, for example by calling the `wx.Window.Close`
5239 function.
5240
5241 You should check whether the application is forcing the deletion of
5242 the window using `CanVeto`. If it returns ``False``, you must destroy
5243 the window using `wx.Window.Destroy`. If the return value is ``True``,
5244 it is up to you whether you respond by destroying the window or not.
5245 For example you may wish to display a message dialog prompting to save
5246 files or to cancel the close.
5247
5248 If you don't destroy the window, you should call `Veto` to let the
5249 calling code know that you did not destroy the window. This allows the
5250 `wx.Window.Close` function to return ``True`` or ``False`` depending
5251 on whether the close instruction was honored or not.
5252 """
5253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5254 __repr__ = _swig_repr
5255 def __init__(self, *args, **kwargs):
5256 """
5257 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5258
5259 Constructor.
5260 """
5261 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5262 def SetLoggingOff(*args, **kwargs):
5263 """
5264 SetLoggingOff(self, bool logOff)
5265
5266 Sets the 'logging off' flag.
5267 """
5268 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5269
5270 def GetLoggingOff(*args, **kwargs):
5271 """
5272 GetLoggingOff(self) -> bool
5273
5274 Returns ``True`` if the user is logging off or ``False`` if the
5275 system is shutting down. This method can only be called for end
5276 session and query end session events, it doesn't make sense for close
5277 window event.
5278 """
5279 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5280
5281 def Veto(*args, **kwargs):
5282 """
5283 Veto(self, bool veto=True)
5284
5285 Call this from your event handler to veto a system shutdown or to
5286 signal to the calling application that a window close did not happen.
5287
5288 You can only veto a shutdown or close if `CanVeto` returns true.
5289 """
5290 return _core_.CloseEvent_Veto(*args, **kwargs)
5291
5292 def GetVeto(*args, **kwargs):
5293 """GetVeto(self) -> bool"""
5294 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5295
5296 def SetCanVeto(*args, **kwargs):
5297 """
5298 SetCanVeto(self, bool canVeto)
5299
5300 Sets the 'can veto' flag.
5301 """
5302 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5303
5304 def CanVeto(*args, **kwargs):
5305 """
5306 CanVeto(self) -> bool
5307
5308 Returns true if you can veto a system shutdown or a window close
5309 event. Vetoing a window close event is not possible if the calling
5310 code wishes to force the application to exit, and so this function
5311 must be called to check this.
5312 """
5313 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5314
5315 _core_.CloseEvent_swigregister(CloseEvent)
5316
5317 #---------------------------------------------------------------------------
5318
5319 class ShowEvent(Event):
5320 """An EVT_SHOW event is sent when a window is shown or hidden."""
5321 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5322 __repr__ = _swig_repr
5323 def __init__(self, *args, **kwargs):
5324 """
5325 __init__(self, int winid=0, bool show=False) -> ShowEvent
5326
5327 An EVT_SHOW event is sent when a window is shown or hidden.
5328 """
5329 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5330 def SetShow(*args, **kwargs):
5331 """SetShow(self, bool show)"""
5332 return _core_.ShowEvent_SetShow(*args, **kwargs)
5333
5334 def GetShow(*args, **kwargs):
5335 """GetShow(self) -> bool"""
5336 return _core_.ShowEvent_GetShow(*args, **kwargs)
5337
5338 _core_.ShowEvent_swigregister(ShowEvent)
5339
5340 #---------------------------------------------------------------------------
5341
5342 class IconizeEvent(Event):
5343 """
5344 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5345 restored.
5346 """
5347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5348 __repr__ = _swig_repr
5349 def __init__(self, *args, **kwargs):
5350 """
5351 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5352
5353 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5354 restored.
5355 """
5356 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5357 def Iconized(*args, **kwargs):
5358 """
5359 Iconized(self) -> bool
5360
5361 Returns ``True`` if the frame has been iconized, ``False`` if it has
5362 been restored.
5363 """
5364 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5365
5366 _core_.IconizeEvent_swigregister(IconizeEvent)
5367
5368 #---------------------------------------------------------------------------
5369
5370 class MaximizeEvent(Event):
5371 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5372 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5373 __repr__ = _swig_repr
5374 def __init__(self, *args, **kwargs):
5375 """
5376 __init__(self, int id=0) -> MaximizeEvent
5377
5378 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5379 """
5380 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5381 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5382
5383 #---------------------------------------------------------------------------
5384
5385 class DropFilesEvent(Event):
5386 """
5387 This class is used for drop files events, that is, when files have
5388 been dropped onto the window. This functionality is only available
5389 under Windows. The window must have previously been enabled for
5390 dropping by calling `wx.Window.DragAcceptFiles`.
5391
5392 Important note: this is a separate implementation to the more general
5393 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5394 implementation uses the older, Windows message-based approach of
5395 dropping files.
5396
5397 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5398 events.
5399
5400 """
5401 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5402 def __init__(self): raise AttributeError, "No constructor defined"
5403 __repr__ = _swig_repr
5404 def GetPosition(*args, **kwargs):
5405 """
5406 GetPosition(self) -> Point
5407
5408 Returns the position at which the files were dropped.
5409 """
5410 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5411
5412 def GetNumberOfFiles(*args, **kwargs):
5413 """
5414 GetNumberOfFiles(self) -> int
5415
5416 Returns the number of files dropped.
5417 """
5418 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5419
5420 def GetFiles(*args, **kwargs):
5421 """
5422 GetFiles(self) -> PyObject
5423
5424 Returns a list of the filenames that were dropped.
5425 """
5426 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5427
5428 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5429
5430 #---------------------------------------------------------------------------
5431
5432 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5433 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5434 class UpdateUIEvent(CommandEvent):
5435 """
5436 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5437 wxWidgets to give an application the chance to update various user
5438 interface elements.
5439
5440 Without update UI events, an application has to work hard to
5441 check/uncheck, enable/disable, and set the text for elements such as
5442 menu items and toolbar buttons. The code for doing this has to be
5443 mixed up with the code that is invoked when an action is invoked for a
5444 menu item or button.
5445
5446 With update UI events, you define an event handler to look at the
5447 state of the application and change UI elements accordingly. wxWidgets
5448 will call your handler functions in idle time, so you don't have to
5449 worry where to call this code. In addition to being a clearer and more
5450 declarative method, it also means you don't have to worry whether
5451 you're updating a toolbar or menubar identifier. The same handler can
5452 update a menu item and toolbar button, if the ID values are the same.
5453
5454 Instead of directly manipulating the menu or button, you call
5455 functions in the event object, such as `Check`. wxWidgets will
5456 determine whether such a call has been made, and which UI element to
5457 update.
5458
5459 These events will work for popup menus as well as menubars. Just
5460 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5461 any UI events for the window that owns the menu.
5462
5463 If you find that the overhead of UI update processing is affecting
5464 your application, you can do one or both of the following:
5465
5466 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5467 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5468 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5469 receive update events. No other windows will receive update
5470 events.
5471
5472 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5473 value to set the delay between updates. You may need to call
5474 `wx.Window.UpdateWindowUI` at critical points, for example when
5475 a dialog is about to be shown, in case the user sees a slight
5476 delay before windows are updated.
5477
5478 Note that although events are sent in idle time, defining a EVT_IDLE
5479 handler for a window does not affect this because the events are sent
5480 from an internal idle handler.
5481
5482 wxWidgets tries to optimize update events on some platforms. On
5483 Windows and GTK+, events for menubar items are only sent when the menu
5484 is about to be shown, and not in idle time.
5485
5486 """
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 __repr__ = _swig_repr
5489 def __init__(self, *args, **kwargs):
5490 """
5491 __init__(self, int commandId=0) -> UpdateUIEvent
5492
5493 Constructor
5494 """
5495 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5496 def GetChecked(*args, **kwargs):
5497 """
5498 GetChecked(self) -> bool
5499
5500 Returns ``True`` if the UI element should be checked.
5501 """
5502 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5503
5504 def GetEnabled(*args, **kwargs):
5505 """
5506 GetEnabled(self) -> bool
5507
5508 Returns ``True`` if the UI element should be enabled.
5509 """
5510 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5511
5512 def GetShown(*args, **kwargs):
5513 """
5514 GetShown(self) -> bool
5515
5516 Returns ``True`` if the UI element should be shown.
5517 """
5518 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5519
5520 def GetText(*args, **kwargs):
5521 """
5522 GetText(self) -> String
5523
5524 Returns the text that should be set for the UI element.
5525 """
5526 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5527
5528 def GetSetText(*args, **kwargs):
5529 """
5530 GetSetText(self) -> bool
5531
5532 Returns ``True`` if the application has called `SetText`. For
5533 wxWidgets internal use only.
5534 """
5535 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5536
5537 def GetSetChecked(*args, **kwargs):
5538 """
5539 GetSetChecked(self) -> bool
5540
5541 Returns ``True`` if the application has called `Check`. For wxWidgets
5542 internal use only.
5543 """
5544 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5545
5546 def GetSetEnabled(*args, **kwargs):
5547 """
5548 GetSetEnabled(self) -> bool
5549
5550 Returns ``True`` if the application has called `Enable`. For wxWidgets
5551 internal use only.
5552 """
5553 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5554
5555 def GetSetShown(*args, **kwargs):
5556 """
5557 GetSetShown(self) -> bool
5558
5559 Returns ``True`` if the application has called `Show`. For wxWidgets
5560 internal use only.
5561 """
5562 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5563
5564 def Check(*args, **kwargs):
5565 """
5566 Check(self, bool check)
5567
5568 Check or uncheck the UI element.
5569 """
5570 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5571
5572 def Enable(*args, **kwargs):
5573 """
5574 Enable(self, bool enable)
5575
5576 Enable or disable the UI element.
5577 """
5578 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5579
5580 def Show(*args, **kwargs):
5581 """
5582 Show(self, bool show)
5583
5584 Show or hide the UI element.
5585 """
5586 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5587
5588 def SetText(*args, **kwargs):
5589 """
5590 SetText(self, String text)
5591
5592 Sets the text for this UI element.
5593 """
5594 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5595
5596 def SetUpdateInterval(*args, **kwargs):
5597 """
5598 SetUpdateInterval(long updateInterval)
5599
5600 Sets the interval between updates in milliseconds. Set to -1 to
5601 disable updates, or to 0 to update as frequently as possible. The
5602 default is 0.
5603
5604 Use this to reduce the overhead of UI update events if your
5605 application has a lot of windows. If you set the value to -1 or
5606 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5607 at appropriate points in your application, such as when a dialog is
5608 about to be shown.
5609 """
5610 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5611
5612 SetUpdateInterval = staticmethod(SetUpdateInterval)
5613 def GetUpdateInterval(*args, **kwargs):
5614 """
5615 GetUpdateInterval() -> long
5616
5617 Returns the current interval between updates in milliseconds. -1
5618 disables updates, 0 updates as frequently as possible.
5619 """
5620 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5621
5622 GetUpdateInterval = staticmethod(GetUpdateInterval)
5623 def CanUpdate(*args, **kwargs):
5624 """
5625 CanUpdate(Window win) -> bool
5626
5627 Returns ``True`` if it is appropriate to update (send UI update events
5628 to) this window.
5629
5630 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5631 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5632 events were last sent in idle time, and the update interval, to
5633 determine whether events should be sent to this window now. By default
5634 this will always return true because the update mode is initially
5635 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5636 events will be sent as often as possible. You can reduce the frequency
5637 that events are sent by changing the mode and/or setting an update
5638 interval.
5639
5640 """
5641 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5642
5643 CanUpdate = staticmethod(CanUpdate)
5644 def ResetUpdateTime(*args, **kwargs):
5645 """
5646 ResetUpdateTime()
5647
5648 Used internally to reset the last-updated time to the current time. It
5649 is assumed that update events are normally sent in idle time, so this
5650 is called at the end of idle processing.
5651 """
5652 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5653
5654 ResetUpdateTime = staticmethod(ResetUpdateTime)
5655 def SetMode(*args, **kwargs):
5656 """
5657 SetMode(int mode)
5658
5659 Specify how wxWidgets will send update events: to all windows, or only
5660 to those which specify that they will process the events.
5661
5662 The mode may be one of the following values:
5663
5664 ============================= ==========================================
5665 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5666 is the default setting.
5667 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5668 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5669 style set.
5670 ============================= ==========================================
5671
5672 """
5673 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5674
5675 SetMode = staticmethod(SetMode)
5676 def GetMode(*args, **kwargs):
5677 """
5678 GetMode() -> int
5679
5680 Returns a value specifying how wxWidgets will send update events: to
5681 all windows, or only to those which specify that they will process the
5682 events.
5683 """
5684 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5685
5686 GetMode = staticmethod(GetMode)
5687 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5688
5689 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5690 """
5691 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5692
5693 Sets the interval between updates in milliseconds. Set to -1 to
5694 disable updates, or to 0 to update as frequently as possible. The
5695 default is 0.
5696
5697 Use this to reduce the overhead of UI update events if your
5698 application has a lot of windows. If you set the value to -1 or
5699 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5700 at appropriate points in your application, such as when a dialog is
5701 about to be shown.
5702 """
5703 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5704
5705 def UpdateUIEvent_GetUpdateInterval(*args):
5706 """
5707 UpdateUIEvent_GetUpdateInterval() -> long
5708
5709 Returns the current interval between updates in milliseconds. -1
5710 disables updates, 0 updates as frequently as possible.
5711 """
5712 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5713
5714 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5715 """
5716 UpdateUIEvent_CanUpdate(Window win) -> bool
5717
5718 Returns ``True`` if it is appropriate to update (send UI update events
5719 to) this window.
5720
5721 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5722 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5723 events were last sent in idle time, and the update interval, to
5724 determine whether events should be sent to this window now. By default
5725 this will always return true because the update mode is initially
5726 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5727 events will be sent as often as possible. You can reduce the frequency
5728 that events are sent by changing the mode and/or setting an update
5729 interval.
5730
5731 """
5732 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5733
5734 def UpdateUIEvent_ResetUpdateTime(*args):
5735 """
5736 UpdateUIEvent_ResetUpdateTime()
5737
5738 Used internally to reset the last-updated time to the current time. It
5739 is assumed that update events are normally sent in idle time, so this
5740 is called at the end of idle processing.
5741 """
5742 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5743
5744 def UpdateUIEvent_SetMode(*args, **kwargs):
5745 """
5746 UpdateUIEvent_SetMode(int mode)
5747
5748 Specify how wxWidgets will send update events: to all windows, or only
5749 to those which specify that they will process the events.
5750
5751 The mode may be one of the following values:
5752
5753 ============================= ==========================================
5754 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5755 is the default setting.
5756 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5757 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5758 style set.
5759 ============================= ==========================================
5760
5761 """
5762 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5763
5764 def UpdateUIEvent_GetMode(*args):
5765 """
5766 UpdateUIEvent_GetMode() -> int
5767
5768 Returns a value specifying how wxWidgets will send update events: to
5769 all windows, or only to those which specify that they will process the
5770 events.
5771 """
5772 return _core_.UpdateUIEvent_GetMode(*args)
5773
5774 #---------------------------------------------------------------------------
5775
5776 class SysColourChangedEvent(Event):
5777 """
5778 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5779 when the user changes the colour settings using the control
5780 panel. This is only applicable under Windows.
5781
5782 The default event handler for this event propagates the event to child
5783 windows, since Windows only sends the events to top-level windows. If
5784 intercepting this event for a top-level window, remember to call
5785 `Skip` so the the base class handler will still be executed, or to
5786 pass the event on to the window's children explicitly.
5787
5788 """
5789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5790 __repr__ = _swig_repr
5791 def __init__(self, *args, **kwargs):
5792 """
5793 __init__(self) -> SysColourChangedEvent
5794
5795 Constructor
5796 """
5797 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5798 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5799
5800 #---------------------------------------------------------------------------
5801
5802 class MouseCaptureChangedEvent(Event):
5803 """
5804 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5805 a window that loses its mouse capture. This is called even if
5806 `wx.Window.ReleaseMouse` was called by the application code. Handling
5807 this event allows an application to cater for unexpected capture
5808 releases which might otherwise confuse mouse handling code.
5809
5810 This event is implemented under Windows only.
5811 """
5812 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5813 __repr__ = _swig_repr
5814 def __init__(self, *args, **kwargs):
5815 """
5816 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5817
5818 Constructor
5819 """
5820 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5821 def GetCapturedWindow(*args, **kwargs):
5822 """
5823 GetCapturedWindow(self) -> Window
5824
5825 Returns the window that gained the capture, or ``None`` if it was a
5826 non-wxWidgets window.
5827 """
5828 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5829
5830 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5831
5832 #---------------------------------------------------------------------------
5833
5834 class DisplayChangedEvent(Event):
5835 """
5836 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5837 resolution has changed.
5838
5839 This event is implemented under Windows only.
5840 """
5841 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5842 __repr__ = _swig_repr
5843 def __init__(self, *args, **kwargs):
5844 """__init__(self) -> DisplayChangedEvent"""
5845 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5846 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
5847
5848 #---------------------------------------------------------------------------
5849
5850 class PaletteChangedEvent(Event):
5851 """
5852 An EVT_PALETTE_CHANGED event is sent when the system palette has
5853 changed, thereby giving each window a chance to redo their own to
5854 match.
5855
5856 This event is implemented under Windows only.
5857 """
5858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5859 __repr__ = _swig_repr
5860 def __init__(self, *args, **kwargs):
5861 """
5862 __init__(self, int id=0) -> PaletteChangedEvent
5863
5864 An EVT_PALETTE_CHANGED event is sent when the system palette has
5865 changed, thereby giving each window a chance to redo their own to
5866 match.
5867
5868 This event is implemented under Windows only.
5869 """
5870 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5871 def SetChangedWindow(*args, **kwargs):
5872 """SetChangedWindow(self, Window win)"""
5873 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5874
5875 def GetChangedWindow(*args, **kwargs):
5876 """GetChangedWindow(self) -> Window"""
5877 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5878
5879 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
5880
5881 #---------------------------------------------------------------------------
5882
5883 class QueryNewPaletteEvent(Event):
5884 """
5885 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5886 focus and should re-do its palette.
5887
5888 This event is implemented under Windows only.
5889 """
5890 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5891 __repr__ = _swig_repr
5892 def __init__(self, *args, **kwargs):
5893 """
5894 __init__(self, int winid=0) -> QueryNewPaletteEvent
5895
5896 Constructor.
5897 """
5898 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
5899 def SetPaletteRealized(*args, **kwargs):
5900 """
5901 SetPaletteRealized(self, bool realized)
5902
5903 App should set this if it changes the palette.
5904 """
5905 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5906
5907 def GetPaletteRealized(*args, **kwargs):
5908 """GetPaletteRealized(self) -> bool"""
5909 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5910
5911 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
5912
5913 #---------------------------------------------------------------------------
5914
5915 class NavigationKeyEvent(Event):
5916 """
5917 EVT_NAVIGATION_KEY events are used to control moving the focus between
5918 widgets, otherwise known as tab-traversal. You woudl normally not
5919 catch navigation events in applications as there are already
5920 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5921 it useful to send navigation events in certain situations to change
5922 the focus in certain ways, although it's probably easier to just call
5923 `wx.Window.Navigate`.
5924 """
5925 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5926 __repr__ = _swig_repr
5927 def __init__(self, *args, **kwargs):
5928 """__init__(self) -> NavigationKeyEvent"""
5929 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
5930 def GetDirection(*args, **kwargs):
5931 """
5932 GetDirection(self) -> bool
5933
5934 Returns ``True`` if the direction is forward, ``False`` otherwise.
5935 """
5936 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5937
5938 def SetDirection(*args, **kwargs):
5939 """
5940 SetDirection(self, bool forward)
5941
5942 Specify the direction that the navigation should take. Usually the
5943 difference between using Tab and Shift-Tab.
5944 """
5945 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5946
5947 def IsWindowChange(*args, **kwargs):
5948 """
5949 IsWindowChange(self) -> bool
5950
5951 Returns ``True`` if window change is allowed.
5952 """
5953 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5954
5955 def SetWindowChange(*args, **kwargs):
5956 """
5957 SetWindowChange(self, bool ischange)
5958
5959 Specify if the navigation should be able to change parent windows.
5960 For example, changing notebook pages, etc. This is usually implemented
5961 by using Control-Tab.
5962 """
5963 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5964
5965 def IsFromTab(*args, **kwargs):
5966 """
5967 IsFromTab(self) -> bool
5968
5969 Returns ``True`` if the navigation event is originated from the Tab
5970 key.
5971 """
5972 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5973
5974 def SetFromTab(*args, **kwargs):
5975 """
5976 SetFromTab(self, bool bIs)
5977
5978 Set to true under MSW if the event was generated using the tab key.
5979 This is required for proper navogation over radio buttons.
5980 """
5981 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5982
5983 def SetFlags(*args, **kwargs):
5984 """
5985 SetFlags(self, long flags)
5986
5987 Set the navigation flags to a combination of the following:
5988
5989 * wx.NavigationKeyEvent.IsBackward
5990 * wx.NavigationKeyEvent.IsForward
5991 * wx.NavigationKeyEvent.WinChange
5992 * wx.NavigationKeyEvent.FromTab
5993
5994 """
5995 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
5996
5997 def GetCurrentFocus(*args, **kwargs):
5998 """
5999 GetCurrentFocus(self) -> Window
6000
6001 Returns the child window which currenty has the focus. May be
6002 ``None``.
6003 """
6004 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6005
6006 def SetCurrentFocus(*args, **kwargs):
6007 """
6008 SetCurrentFocus(self, Window win)
6009
6010 Set the window that has the focus.
6011 """
6012 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6013
6014 IsBackward = _core_.NavigationKeyEvent_IsBackward
6015 IsForward = _core_.NavigationKeyEvent_IsForward
6016 WinChange = _core_.NavigationKeyEvent_WinChange
6017 FromTab = _core_.NavigationKeyEvent_FromTab
6018 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6019
6020 #---------------------------------------------------------------------------
6021
6022 class WindowCreateEvent(CommandEvent):
6023 """
6024 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6025 underlying GUI object) exists.
6026 """
6027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6028 __repr__ = _swig_repr
6029 def __init__(self, *args, **kwargs):
6030 """
6031 __init__(self, Window win=None) -> WindowCreateEvent
6032
6033 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6034 underlying GUI object) exists.
6035 """
6036 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6037 def GetWindow(*args, **kwargs):
6038 """
6039 GetWindow(self) -> Window
6040
6041 Returns the window that this event refers to.
6042 """
6043 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6044
6045 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6046
6047 class WindowDestroyEvent(CommandEvent):
6048 """
6049 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6050 when the GUI window is destroyed.
6051
6052 When a class derived from `wx.Window` is destroyed its destructor will
6053 have already run by the time this event is sent. Therefore this event
6054 will not usually be received at all by the window itself. Since it is
6055 received after the destructor has run, an object should not try to
6056 handle its own wx.WindowDestroyEvent, but it can be used to get
6057 notification of the destruction of another window.
6058 """
6059 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6060 __repr__ = _swig_repr
6061 def __init__(self, *args, **kwargs):
6062 """
6063 __init__(self, Window win=None) -> WindowDestroyEvent
6064
6065 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6066 when the GUI window is destroyed.
6067
6068 When a class derived from `wx.Window` is destroyed its destructor will
6069 have already run by the time this event is sent. Therefore this event
6070 will not usually be received at all by the window itself. Since it is
6071 received after the destructor has run, an object should not try to
6072 handle its own wx.WindowDestroyEvent, but it can be used to get
6073 notification of the destruction of another window.
6074 """
6075 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6076 def GetWindow(*args, **kwargs):
6077 """
6078 GetWindow(self) -> Window
6079
6080 Returns the window that this event refers to.
6081 """
6082 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6083
6084 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6085
6086 #---------------------------------------------------------------------------
6087
6088 class ContextMenuEvent(CommandEvent):
6089 """
6090 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6091 give the application a chance to show a context (popup) menu.
6092 """
6093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6094 __repr__ = _swig_repr
6095 def __init__(self, *args, **kwargs):
6096 """
6097 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6098
6099 Constructor.
6100 """
6101 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6102 def GetPosition(*args, **kwargs):
6103 """
6104 GetPosition(self) -> Point
6105
6106 Returns the position (in screen coordinants) at which the menu should
6107 be shown.
6108 """
6109 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6110
6111 def SetPosition(*args, **kwargs):
6112 """
6113 SetPosition(self, Point pos)
6114
6115 Sets the position at which the menu should be shown.
6116 """
6117 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6118
6119 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6120
6121 #---------------------------------------------------------------------------
6122
6123 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6124 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6125 class IdleEvent(Event):
6126 """
6127 This class is used for EVT_IDLE events, which are generated and sent
6128 when the application *becomes* idle. In other words, the when the
6129 event queue becomes empty then idle events are sent to all windows (by
6130 default) and as long as none of them call `RequestMore` then there are
6131 no more idle events until after the system event queue has some normal
6132 events and then becomes empty again.
6133
6134 By default, idle events are sent to all windows. If this is causing a
6135 significant overhead in your application, you can call
6136 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6137 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6138 which should receive idle events. Then idle events will only be sent
6139 to those windows and not to any others.
6140 """
6141 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6142 __repr__ = _swig_repr
6143 def __init__(self, *args, **kwargs):
6144 """
6145 __init__(self) -> IdleEvent
6146
6147 Constructor
6148 """
6149 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6150 def RequestMore(*args, **kwargs):
6151 """
6152 RequestMore(self, bool needMore=True)
6153
6154 Tells wxWidgets that more processing is required. This function can be
6155 called by an EVT_IDLE handler for a window to indicate that the
6156 application should forward the EVT_IDLE event once more to the
6157 application windows. If no window calls this function during its
6158 EVT_IDLE handler, then the application will remain in a passive event
6159 loop until a new event is posted to the application by the windowing
6160 system.
6161 """
6162 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6163
6164 def MoreRequested(*args, **kwargs):
6165 """
6166 MoreRequested(self) -> bool
6167
6168 Returns ``True`` if the OnIdle function processing this event
6169 requested more processing time.
6170 """
6171 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6172
6173 def SetMode(*args, **kwargs):
6174 """
6175 SetMode(int mode)
6176
6177 Static method for specifying how wxWidgets will send idle events: to
6178 all windows, or only to those which specify that they will process the
6179 events.
6180
6181 The mode can be one of the following values:
6182
6183 ========================= ========================================
6184 wx.IDLE_PROCESS_ALL Send idle events to all windows
6185 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6186 the wx.WS_EX_PROCESS_IDLE extra style
6187 flag set.
6188 ========================= ========================================
6189
6190 """
6191 return _core_.IdleEvent_SetMode(*args, **kwargs)
6192
6193 SetMode = staticmethod(SetMode)
6194 def GetMode(*args, **kwargs):
6195 """
6196 GetMode() -> int
6197
6198 Static method returning a value specifying how wxWidgets will send
6199 idle events: to all windows, or only to those which specify that they
6200 will process the events.
6201 """
6202 return _core_.IdleEvent_GetMode(*args, **kwargs)
6203
6204 GetMode = staticmethod(GetMode)
6205 def CanSend(*args, **kwargs):
6206 """
6207 CanSend(Window win) -> bool
6208
6209 Returns ``True`` if it is appropriate to send idle events to this
6210 window.
6211
6212 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6213 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6214 events should be sent to this window now. By default this will always
6215 return ``True`` because the update mode is initially
6216 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6217 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6218 """
6219 return _core_.IdleEvent_CanSend(*args, **kwargs)
6220
6221 CanSend = staticmethod(CanSend)
6222 _core_.IdleEvent_swigregister(IdleEvent)
6223
6224 def IdleEvent_SetMode(*args, **kwargs):
6225 """
6226 IdleEvent_SetMode(int mode)
6227
6228 Static method for specifying how wxWidgets will send idle events: to
6229 all windows, or only to those which specify that they will process the
6230 events.
6231
6232 The mode can be one of the following values:
6233
6234 ========================= ========================================
6235 wx.IDLE_PROCESS_ALL Send idle events to all windows
6236 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6237 the wx.WS_EX_PROCESS_IDLE extra style
6238 flag set.
6239 ========================= ========================================
6240
6241 """
6242 return _core_.IdleEvent_SetMode(*args, **kwargs)
6243
6244 def IdleEvent_GetMode(*args):
6245 """
6246 IdleEvent_GetMode() -> int
6247
6248 Static method returning a value specifying how wxWidgets will send
6249 idle events: to all windows, or only to those which specify that they
6250 will process the events.
6251 """
6252 return _core_.IdleEvent_GetMode(*args)
6253
6254 def IdleEvent_CanSend(*args, **kwargs):
6255 """
6256 IdleEvent_CanSend(Window win) -> bool
6257
6258 Returns ``True`` if it is appropriate to send idle events to this
6259 window.
6260
6261 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6262 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6263 events should be sent to this window now. By default this will always
6264 return ``True`` because the update mode is initially
6265 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6266 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6267 """
6268 return _core_.IdleEvent_CanSend(*args, **kwargs)
6269
6270 #---------------------------------------------------------------------------
6271
6272 class ClipboardTextEvent(CommandEvent):
6273 """
6274 A Clipboard Text event is sent when a window intercepts a text
6275 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6276 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6277 popup menu command, etc. NOTE : under windows these events are *NOT*
6278 generated automatically for a Rich Edit text control.
6279 """
6280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6281 __repr__ = _swig_repr
6282 def __init__(self, *args, **kwargs):
6283 """
6284 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6285
6286 A Clipboard Text event is sent when a window intercepts a text
6287 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6288 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6289 popup menu command, etc. NOTE : under windows these events are *NOT*
6290 generated automatically for a Rich Edit text control.
6291 """
6292 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6293 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6294
6295 #---------------------------------------------------------------------------
6296
6297 class PyEvent(Event):
6298 """
6299 wx.PyEvent can be used as a base class for implementing custom event
6300 types in Python. You should derived from this class instead of
6301 `wx.Event` because this class is Python-aware and is able to transport
6302 its Python bits safely through the wxWidgets event system and have
6303 them still be there when the event handler is invoked.
6304
6305 :see: `wx.PyCommandEvent`
6306
6307 """
6308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6309 __repr__ = _swig_repr
6310 def __init__(self, *args, **kwargs):
6311 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6312 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6313 self._SetSelf(self)
6314
6315 __swig_destroy__ = _core_.delete_PyEvent
6316 __del__ = lambda self : None;
6317 def _SetSelf(*args, **kwargs):
6318 """_SetSelf(self, PyObject self)"""
6319 return _core_.PyEvent__SetSelf(*args, **kwargs)
6320
6321 def _GetSelf(*args, **kwargs):
6322 """_GetSelf(self) -> PyObject"""
6323 return _core_.PyEvent__GetSelf(*args, **kwargs)
6324
6325 _core_.PyEvent_swigregister(PyEvent)
6326
6327 class PyCommandEvent(CommandEvent):
6328 """
6329 wx.PyCommandEvent can be used as a base class for implementing custom
6330 event types in Python, where the event shoudl travel up to parent
6331 windows looking for a handler. You should derived from this class
6332 instead of `wx.CommandEvent` because this class is Python-aware and is
6333 able to transport its Python bits safely through the wxWidgets event
6334 system and have them still be there when the event handler is invoked.
6335
6336 :see: `wx.PyEvent`
6337
6338 """
6339 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6340 __repr__ = _swig_repr
6341 def __init__(self, *args, **kwargs):
6342 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6343 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6344 self._SetSelf(self)
6345
6346 __swig_destroy__ = _core_.delete_PyCommandEvent
6347 __del__ = lambda self : None;
6348 def _SetSelf(*args, **kwargs):
6349 """_SetSelf(self, PyObject self)"""
6350 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6351
6352 def _GetSelf(*args, **kwargs):
6353 """_GetSelf(self) -> PyObject"""
6354 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6355
6356 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6357
6358 class DateEvent(CommandEvent):
6359 """
6360 This event class holds information about a date change event and is
6361 used together with `wx.DatePickerCtrl`. It also serves as a base class
6362 for `wx.calendar.CalendarEvent`. Bind these event types with
6363 EVT_DATE_CHANGED.
6364 """
6365 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6366 __repr__ = _swig_repr
6367 def __init__(self, *args, **kwargs):
6368 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6369 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6370 def GetDate(*args, **kwargs):
6371 """
6372 GetDate(self) -> DateTime
6373
6374 Returns the date.
6375 """
6376 return _core_.DateEvent_GetDate(*args, **kwargs)
6377
6378 def SetDate(*args, **kwargs):
6379 """
6380 SetDate(self, DateTime date)
6381
6382 Sets the date carried by the event, normally only used by the library
6383 internally.
6384 """
6385 return _core_.DateEvent_SetDate(*args, **kwargs)
6386
6387 _core_.DateEvent_swigregister(DateEvent)
6388
6389 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6390 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6391
6392 #---------------------------------------------------------------------------
6393
6394 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6395 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6396 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6397 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6398 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6399 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6400 class PyApp(EvtHandler):
6401 """
6402 The ``wx.PyApp`` class is an *implementation detail*, please use the
6403 `wx.App` class (or some other derived class) instead.
6404 """
6405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6406 __repr__ = _swig_repr
6407 def __init__(self, *args, **kwargs):
6408 """
6409 __init__(self) -> PyApp
6410
6411 Create a new application object, starting the bootstrap process.
6412 """
6413 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6414 self._setCallbackInfo(self, PyApp, False)
6415 self._setOORInfo(self, False)
6416
6417 __swig_destroy__ = _core_.delete_PyApp
6418 __del__ = lambda self : None;
6419 def _setCallbackInfo(*args, **kwargs):
6420 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6421 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6422
6423 def GetAppName(*args, **kwargs):
6424 """
6425 GetAppName(self) -> String
6426
6427 Get the application name.
6428 """
6429 return _core_.PyApp_GetAppName(*args, **kwargs)
6430
6431 def SetAppName(*args, **kwargs):
6432 """
6433 SetAppName(self, String name)
6434
6435 Set the application name. This value may be used automatically by
6436 `wx.Config` and such.
6437 """
6438 return _core_.PyApp_SetAppName(*args, **kwargs)
6439
6440 def GetClassName(*args, **kwargs):
6441 """
6442 GetClassName(self) -> String
6443
6444 Get the application's class name.
6445 """
6446 return _core_.PyApp_GetClassName(*args, **kwargs)
6447
6448 def SetClassName(*args, **kwargs):
6449 """
6450 SetClassName(self, String name)
6451
6452 Set the application's class name. This value may be used for
6453 X-resources if applicable for the platform
6454 """
6455 return _core_.PyApp_SetClassName(*args, **kwargs)
6456
6457 def GetVendorName(*args, **kwargs):
6458 """
6459 GetVendorName(self) -> String
6460
6461 Get the application's vendor name.
6462 """
6463 return _core_.PyApp_GetVendorName(*args, **kwargs)
6464
6465 def SetVendorName(*args, **kwargs):
6466 """
6467 SetVendorName(self, String name)
6468
6469 Set the application's vendor name. This value may be used
6470 automatically by `wx.Config` and such.
6471 """
6472 return _core_.PyApp_SetVendorName(*args, **kwargs)
6473
6474 def GetTraits(*args, **kwargs):
6475 """
6476 GetTraits(self) -> wxAppTraits
6477
6478 Return (and create if necessary) the app traits object to which we
6479 delegate for everything which either should be configurable by the
6480 user (then he can change the default behaviour simply by overriding
6481 CreateTraits() and returning his own traits object) or which is
6482 GUI/console dependent as then wx.AppTraits allows us to abstract the
6483 differences behind the common facade.
6484
6485 :todo: Add support for overriding CreateAppTraits in wxPython.
6486 """
6487 return _core_.PyApp_GetTraits(*args, **kwargs)
6488
6489 def ProcessPendingEvents(*args, **kwargs):
6490 """
6491 ProcessPendingEvents(self)
6492
6493 Process all events in the Pending Events list -- it is necessary to
6494 call this function to process posted events. This normally happens
6495 during each event loop iteration.
6496 """
6497 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6498
6499 def Yield(*args, **kwargs):
6500 """
6501 Yield(self, bool onlyIfNeeded=False) -> bool
6502
6503 Process all currently pending events right now, instead of waiting
6504 until return to the event loop. It is an error to call ``Yield``
6505 recursively unless the value of ``onlyIfNeeded`` is True.
6506
6507 :warning: This function is dangerous as it can lead to unexpected
6508 reentrancies (i.e. when called from an event handler it may
6509 result in calling the same event handler again), use with
6510 extreme care or, better, don't use at all!
6511
6512 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6513
6514 """
6515 return _core_.PyApp_Yield(*args, **kwargs)
6516
6517 def WakeUpIdle(*args, **kwargs):
6518 """
6519 WakeUpIdle(self)
6520
6521 Make sure that idle events are sent again.
6522 :see: `wx.WakeUpIdle`
6523 """
6524 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6525
6526 def IsMainLoopRunning(*args, **kwargs):
6527 """
6528 IsMainLoopRunning() -> bool
6529
6530 Returns True if we're running the main loop, i.e. if the events can
6531 currently be dispatched.
6532 """
6533 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6534
6535 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6536 def MainLoop(*args, **kwargs):
6537 """
6538 MainLoop(self) -> int
6539
6540 Execute the main GUI loop, the function doesn't normally return until
6541 all top level windows have been closed and destroyed.
6542 """
6543 return _core_.PyApp_MainLoop(*args, **kwargs)
6544
6545 def Exit(*args, **kwargs):
6546 """
6547 Exit(self)
6548
6549 Exit the main loop thus terminating the application.
6550 :see: `wx.Exit`
6551 """
6552 return _core_.PyApp_Exit(*args, **kwargs)
6553
6554 def ExitMainLoop(*args, **kwargs):
6555 """
6556 ExitMainLoop(self)
6557
6558 Exit the main GUI loop during the next iteration of the main
6559 loop, (i.e. it does not stop the program immediately!)
6560 """
6561 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6562
6563 def Pending(*args, **kwargs):
6564 """
6565 Pending(self) -> bool
6566
6567 Returns True if there are unprocessed events in the event queue.
6568 """
6569 return _core_.PyApp_Pending(*args, **kwargs)
6570
6571 def Dispatch(*args, **kwargs):
6572 """
6573 Dispatch(self) -> bool
6574
6575 Process the first event in the event queue (blocks until an event
6576 appears if there are none currently)
6577 """
6578 return _core_.PyApp_Dispatch(*args, **kwargs)
6579
6580 def ProcessIdle(*args, **kwargs):
6581 """
6582 ProcessIdle(self) -> bool
6583
6584 Called from the MainLoop when the application becomes idle (there are
6585 no pending events) and sends a `wx.IdleEvent` to all interested
6586 parties. Returns True if more idle events are needed, False if not.
6587 """
6588 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6589
6590 def SendIdleEvents(*args, **kwargs):
6591 """
6592 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6593
6594 Send idle event to window and all subwindows. Returns True if more
6595 idle time is requested.
6596 """
6597 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6598
6599 def IsActive(*args, **kwargs):
6600 """
6601 IsActive(self) -> bool
6602
6603 Return True if our app has focus.
6604 """
6605 return _core_.PyApp_IsActive(*args, **kwargs)
6606
6607 def SetTopWindow(*args, **kwargs):
6608 """
6609 SetTopWindow(self, Window win)
6610
6611 Set the *main* top level window
6612 """
6613 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6614
6615 def GetTopWindow(*args, **kwargs):
6616 """
6617 GetTopWindow(self) -> Window
6618
6619 Return the *main* top level window (if it hadn't been set previously
6620 with SetTopWindow(), will return just some top level window and, if
6621 there not any, will return None)
6622 """
6623 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6624
6625 def SetExitOnFrameDelete(*args, **kwargs):
6626 """
6627 SetExitOnFrameDelete(self, bool flag)
6628
6629 Control the exit behaviour: by default, the program will exit the main
6630 loop (and so, usually, terminate) when the last top-level program
6631 window is deleted. Beware that if you disable this behaviour (with
6632 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6633 explicitly from somewhere.
6634 """
6635 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6636
6637 def GetExitOnFrameDelete(*args, **kwargs):
6638 """
6639 GetExitOnFrameDelete(self) -> bool
6640
6641 Get the current exit behaviour setting.
6642 """
6643 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6644
6645 def SetUseBestVisual(*args, **kwargs):
6646 """
6647 SetUseBestVisual(self, bool flag)
6648
6649 Set whether the app should try to use the best available visual on
6650 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6651 """
6652 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6653
6654 def GetUseBestVisual(*args, **kwargs):
6655 """
6656 GetUseBestVisual(self) -> bool
6657
6658 Get current UseBestVisual setting.
6659 """
6660 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6661
6662 def SetPrintMode(*args, **kwargs):
6663 """SetPrintMode(self, int mode)"""
6664 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6665
6666 def GetPrintMode(*args, **kwargs):
6667 """GetPrintMode(self) -> int"""
6668 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6669
6670 def SetAssertMode(*args, **kwargs):
6671 """
6672 SetAssertMode(self, int mode)
6673
6674 Set the OnAssert behaviour for debug and hybrid builds.
6675 """
6676 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6677
6678 def GetAssertMode(*args, **kwargs):
6679 """
6680 GetAssertMode(self) -> int
6681
6682 Get the current OnAssert behaviour setting.
6683 """
6684 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6685
6686 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6687 """GetMacSupportPCMenuShortcuts() -> bool"""
6688 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6689
6690 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6691 def GetMacAboutMenuItemId(*args, **kwargs):
6692 """GetMacAboutMenuItemId() -> long"""
6693 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6694
6695 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6696 def GetMacPreferencesMenuItemId(*args, **kwargs):
6697 """GetMacPreferencesMenuItemId() -> long"""
6698 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6699
6700 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6701 def GetMacExitMenuItemId(*args, **kwargs):
6702 """GetMacExitMenuItemId() -> long"""
6703 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6704
6705 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6706 def GetMacHelpMenuTitleName(*args, **kwargs):
6707 """GetMacHelpMenuTitleName() -> String"""
6708 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6709
6710 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6711 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6712 """SetMacSupportPCMenuShortcuts(bool val)"""
6713 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6714
6715 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6716 def SetMacAboutMenuItemId(*args, **kwargs):
6717 """SetMacAboutMenuItemId(long val)"""
6718 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6719
6720 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6721 def SetMacPreferencesMenuItemId(*args, **kwargs):
6722 """SetMacPreferencesMenuItemId(long val)"""
6723 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6724
6725 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6726 def SetMacExitMenuItemId(*args, **kwargs):
6727 """SetMacExitMenuItemId(long val)"""
6728 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6729
6730 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6731 def SetMacHelpMenuTitleName(*args, **kwargs):
6732 """SetMacHelpMenuTitleName(String val)"""
6733 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6734
6735 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6736 def _BootstrapApp(*args, **kwargs):
6737 """
6738 _BootstrapApp(self)
6739
6740 For internal use only
6741 """
6742 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6743
6744 def GetComCtl32Version(*args, **kwargs):
6745 """
6746 GetComCtl32Version() -> int
6747
6748 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6749 it wasn't found at all. Raises an exception on non-Windows platforms.
6750 """
6751 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6752
6753 GetComCtl32Version = staticmethod(GetComCtl32Version)
6754 _core_.PyApp_swigregister(PyApp)
6755
6756 def PyApp_IsMainLoopRunning(*args):
6757 """
6758 PyApp_IsMainLoopRunning() -> bool
6759
6760 Returns True if we're running the main loop, i.e. if the events can
6761 currently be dispatched.
6762 """
6763 return _core_.PyApp_IsMainLoopRunning(*args)
6764
6765 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6766 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6767 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6768
6769 def PyApp_GetMacAboutMenuItemId(*args):
6770 """PyApp_GetMacAboutMenuItemId() -> long"""
6771 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6772
6773 def PyApp_GetMacPreferencesMenuItemId(*args):
6774 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6775 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6776
6777 def PyApp_GetMacExitMenuItemId(*args):
6778 """PyApp_GetMacExitMenuItemId() -> long"""
6779 return _core_.PyApp_GetMacExitMenuItemId(*args)
6780
6781 def PyApp_GetMacHelpMenuTitleName(*args):
6782 """PyApp_GetMacHelpMenuTitleName() -> String"""
6783 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6784
6785 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6786 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6787 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6788
6789 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6790 """PyApp_SetMacAboutMenuItemId(long val)"""
6791 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6792
6793 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6794 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6795 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6796
6797 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6798 """PyApp_SetMacExitMenuItemId(long val)"""
6799 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6800
6801 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6802 """PyApp_SetMacHelpMenuTitleName(String val)"""
6803 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6804
6805 def PyApp_GetComCtl32Version(*args):
6806 """
6807 PyApp_GetComCtl32Version() -> int
6808
6809 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6810 it wasn't found at all. Raises an exception on non-Windows platforms.
6811 """
6812 return _core_.PyApp_GetComCtl32Version(*args)
6813
6814 #---------------------------------------------------------------------------
6815
6816
6817 def Exit(*args):
6818 """
6819 Exit()
6820
6821 Force an exit of the application. Convenience for wx.GetApp().Exit()
6822 """
6823 return _core_.Exit(*args)
6824
6825 def Yield(*args):
6826 """
6827 Yield() -> bool
6828
6829 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6830 """
6831 return _core_.Yield(*args)
6832
6833 def YieldIfNeeded(*args):
6834 """
6835 YieldIfNeeded() -> bool
6836
6837 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6838 """
6839 return _core_.YieldIfNeeded(*args)
6840
6841 def SafeYield(*args, **kwargs):
6842 """
6843 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6844
6845 This function is similar to `wx.Yield`, except that it disables the
6846 user input to all program windows before calling `wx.Yield` and
6847 re-enables it again afterwards. If ``win`` is not None, this window
6848 will remain enabled, allowing the implementation of some limited user
6849 interaction.
6850
6851 :Returns: the result of the call to `wx.Yield`.
6852 """
6853 return _core_.SafeYield(*args, **kwargs)
6854
6855 def WakeUpIdle(*args):
6856 """
6857 WakeUpIdle()
6858
6859 Cause the message queue to become empty again, so idle events will be
6860 sent.
6861 """
6862 return _core_.WakeUpIdle(*args)
6863
6864 def PostEvent(*args, **kwargs):
6865 """
6866 PostEvent(EvtHandler dest, Event event)
6867
6868 Send an event to a window or other wx.EvtHandler to be processed
6869 later.
6870 """
6871 return _core_.PostEvent(*args, **kwargs)
6872
6873 def App_CleanUp(*args):
6874 """
6875 App_CleanUp()
6876
6877 For internal use only, it is used to cleanup after wxWidgets when
6878 Python shuts down.
6879 """
6880 return _core_.App_CleanUp(*args)
6881
6882 def GetApp(*args):
6883 """
6884 GetApp() -> PyApp
6885
6886 Return a reference to the current wx.App object.
6887 """
6888 return _core_.GetApp(*args)
6889
6890 def SetDefaultPyEncoding(*args, **kwargs):
6891 """
6892 SetDefaultPyEncoding(string encoding)
6893
6894 Sets the encoding that wxPython will use when it needs to convert a
6895 Python string or unicode object to or from a wxString.
6896
6897 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6898 but please be aware that the default encoding within the same locale
6899 may be slightly different on different platforms. For example, please
6900 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6901 between the common latin/roman encodings.
6902 """
6903 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6904
6905 def GetDefaultPyEncoding(*args):
6906 """
6907 GetDefaultPyEncoding() -> string
6908
6909 Gets the current encoding that wxPython will use when it needs to
6910 convert a Python string or unicode object to or from a wxString.
6911 """
6912 return _core_.GetDefaultPyEncoding(*args)
6913 #----------------------------------------------------------------------
6914
6915 class PyOnDemandOutputWindow:
6916 """
6917 A class that can be used for redirecting Python's stdout and
6918 stderr streams. It will do nothing until something is wrriten to
6919 the stream at which point it will create a Frame with a text area
6920 and write the text there.
6921 """
6922 def __init__(self, title = "wxPython: stdout/stderr"):
6923 self.frame = None
6924 self.title = title
6925 self.pos = wx.DefaultPosition
6926 self.size = (450, 300)
6927 self.parent = None
6928
6929 def SetParent(self, parent):
6930 """Set the window to be used as the popup Frame's parent."""
6931 self.parent = parent
6932
6933
6934 def CreateOutputWindow(self, st):
6935 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6936 style=wx.DEFAULT_FRAME_STYLE)
6937 self.text = wx.TextCtrl(self.frame, -1, "",
6938 style=wx.TE_MULTILINE|wx.TE_READONLY)
6939 self.text.AppendText(st)
6940 self.frame.Show(True)
6941 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6942
6943
6944 def OnCloseWindow(self, event):
6945 if self.frame is not None:
6946 self.frame.Destroy()
6947 self.frame = None
6948 self.text = None
6949
6950
6951 # These methods provide the file-like output behaviour.
6952 def write(self, text):
6953 """
6954 Create the output window if needed and write the string to it.
6955 If not called in the context of the gui thread then uses
6956 CallAfter to do the work there.
6957 """
6958 if self.frame is None:
6959 if not wx.Thread_IsMain():
6960 wx.CallAfter(self.CreateOutputWindow, text)
6961 else:
6962 self.CreateOutputWindow(text)
6963 else:
6964 if not wx.Thread_IsMain():
6965 wx.CallAfter(self.text.AppendText, text)
6966 else:
6967 self.text.AppendText(text)
6968
6969
6970 def close(self):
6971 if self.frame is not None:
6972 wx.CallAfter(self.frame.Close)
6973
6974
6975 def flush(self):
6976 pass
6977
6978
6979
6980 #----------------------------------------------------------------------
6981
6982 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6983
6984 class App(wx.PyApp):
6985 """
6986 The ``wx.App`` class represents the application and is used to:
6987
6988 * bootstrap the wxPython system and initialize the underlying
6989 gui toolkit
6990 * set and get application-wide properties
6991 * implement the windowing system main message or event loop,
6992 and to dispatch events to window instances
6993 * etc.
6994
6995 Every application must have a ``wx.App`` instance, and all
6996 creation of UI objects should be delayed until after the
6997 ``wx.App`` object has been created in order to ensure that the gui
6998 platform and wxWidgets have been fully initialized.
6999
7000 Normally you would derive from this class and implement an
7001 ``OnInit`` method that creates a frame and then calls
7002 ``self.SetTopWindow(frame)``.
7003
7004 :see: `wx.PySimpleApp` for a simpler app class that can be used
7005 directly.
7006 """
7007
7008 outputWindowClass = PyOnDemandOutputWindow
7009
7010 def __init__(self, redirect=_defRedirect, filename=None,
7011 useBestVisual=False, clearSigInt=True):
7012 """
7013 Construct a ``wx.App`` object.
7014
7015 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7016 redirected? Defaults to True on Windows and Mac, False
7017 otherwise. If `filename` is None then output will be
7018 redirected to a window that pops up as needed. (You can
7019 control what kind of window is created for the output by
7020 resetting the class variable ``outputWindowClass`` to a
7021 class of your choosing.)
7022
7023 :param filename: The name of a file to redirect output to, if
7024 redirect is True.
7025
7026 :param useBestVisual: Should the app try to use the best
7027 available visual provided by the system (only relevant on
7028 systems that have more than one visual.) This parameter
7029 must be used instead of calling `SetUseBestVisual` later
7030 on because it must be set before the underlying GUI
7031 toolkit is initialized.
7032
7033 :param clearSigInt: Should SIGINT be cleared? This allows the
7034 app to terminate upon a Ctrl-C in the console like other
7035 GUI apps will.
7036
7037 :note: You should override OnInit to do applicaition
7038 initialization to ensure that the system, toolkit and
7039 wxWidgets are fully initialized.
7040 """
7041 wx.PyApp.__init__(self)
7042
7043 if wx.Platform == "__WXMAC__":
7044 try:
7045 import MacOS
7046 if not MacOS.WMAvailable():
7047 print """\
7048 This program needs access to the screen. Please run with 'pythonw',
7049 not 'python', and only when you are logged in on the main display of
7050 your Mac."""
7051 _sys.exit(1)
7052 except SystemExit:
7053 raise
7054 except:
7055 pass
7056
7057 # This has to be done before OnInit
7058 self.SetUseBestVisual(useBestVisual)
7059
7060 # Set the default handler for SIGINT. This fixes a problem
7061 # where if Ctrl-C is pressed in the console that started this
7062 # app then it will not appear to do anything, (not even send
7063 # KeyboardInterrupt???) but will later segfault on exit. By
7064 # setting the default handler then the app will exit, as
7065 # expected (depending on platform.)
7066 if clearSigInt:
7067 try:
7068 import signal
7069 signal.signal(signal.SIGINT, signal.SIG_DFL)
7070 except:
7071 pass
7072
7073 # Save and redirect the stdio to a window?
7074 self.stdioWin = None
7075 self.saveStdio = (_sys.stdout, _sys.stderr)
7076 if redirect:
7077 self.RedirectStdio(filename)
7078
7079 # Use Python's install prefix as the default
7080 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7081
7082 # This finishes the initialization of wxWindows and then calls
7083 # the OnInit that should be present in the derived class
7084 self._BootstrapApp()
7085
7086
7087 def OnPreInit(self):
7088 """
7089 Things that must be done after _BootstrapApp has done its
7090 thing, but would be nice if they were already done by the time
7091 that OnInit is called.
7092 """
7093 wx.StockGDI._initStockObjects()
7094
7095
7096 def __del__(self, destroy=wx.PyApp.__del__):
7097 self.RestoreStdio() # Just in case the MainLoop was overridden
7098 destroy(self)
7099
7100 def Destroy(self):
7101 wx.PyApp.Destroy(self)
7102 self.thisown = 0
7103
7104 def SetTopWindow(self, frame):
7105 """Set the \"main\" top level window"""
7106 if self.stdioWin:
7107 self.stdioWin.SetParent(frame)
7108 wx.PyApp.SetTopWindow(self, frame)
7109
7110
7111 def MainLoop(self):
7112 """Execute the main GUI event loop"""
7113 wx.PyApp.MainLoop(self)
7114 self.RestoreStdio()
7115
7116
7117 def RedirectStdio(self, filename=None):
7118 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7119 if filename:
7120 _sys.stdout = _sys.stderr = open(filename, 'a')
7121 else:
7122 self.stdioWin = self.outputWindowClass()
7123 _sys.stdout = _sys.stderr = self.stdioWin
7124
7125
7126 def RestoreStdio(self):
7127 try:
7128 _sys.stdout, _sys.stderr = self.saveStdio
7129 except:
7130 pass
7131
7132
7133 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7134 """
7135 Set the title, position and/or size of the output window if
7136 the stdio has been redirected. This should be called before
7137 any output would cause the output window to be created.
7138 """
7139 if self.stdioWin:
7140 if title is not None:
7141 self.stdioWin.title = title
7142 if pos is not None:
7143 self.stdioWin.pos = pos
7144 if size is not None:
7145 self.stdioWin.size = size
7146
7147
7148
7149
7150 # change from wx.PyApp_XX to wx.App_XX
7151 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7152 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7153 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7154 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7155 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7156 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7157 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7158 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7159 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7160 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7161 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7162
7163 #----------------------------------------------------------------------------
7164
7165 class PySimpleApp(wx.App):
7166 """
7167 A simple application class. You can just create one of these and
7168 then then make your top level windows later, and not have to worry
7169 about OnInit. For example::
7170
7171 app = wx.PySimpleApp()
7172 frame = wx.Frame(None, title='Hello World')
7173 frame.Show()
7174 app.MainLoop()
7175
7176 :see: `wx.App`
7177 """
7178
7179 def __init__(self, redirect=False, filename=None,
7180 useBestVisual=False, clearSigInt=True):
7181 """
7182 :see: `wx.App.__init__`
7183 """
7184 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7185
7186 def OnInit(self):
7187 return True
7188
7189
7190
7191 # Is anybody using this one?
7192 class PyWidgetTester(wx.App):
7193 def __init__(self, size = (250, 100)):
7194 self.size = size
7195 wx.App.__init__(self, 0)
7196
7197 def OnInit(self):
7198 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7199 self.SetTopWindow(self.frame)
7200 return True
7201
7202 def SetWidget(self, widgetClass, *args, **kwargs):
7203 w = widgetClass(self.frame, *args, **kwargs)
7204 self.frame.Show(True)
7205
7206 #----------------------------------------------------------------------------
7207 # DO NOT hold any other references to this object. This is how we
7208 # know when to cleanup system resources that wxWidgets is holding. When
7209 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7210 # goes to zero and it calls the wx.App_CleanUp function.
7211
7212 class __wxPyCleanup:
7213 def __init__(self):
7214 self.cleanup = _core_.App_CleanUp
7215 def __del__(self):
7216 self.cleanup()
7217
7218 _sys.__wxPythonCleanup = __wxPyCleanup()
7219
7220 ## # another possible solution, but it gets called too early...
7221 ## import atexit
7222 ## atexit.register(_core_.wxApp_CleanUp)
7223
7224
7225 #----------------------------------------------------------------------------
7226
7227 #---------------------------------------------------------------------------
7228
7229 class EventLoop(object):
7230 """Proxy of C++ EventLoop class"""
7231 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7232 __repr__ = _swig_repr
7233 def __init__(self, *args, **kwargs):
7234 """__init__(self) -> EventLoop"""
7235 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7236 __swig_destroy__ = _core_.delete_EventLoop
7237 __del__ = lambda self : None;
7238 def Run(*args, **kwargs):
7239 """Run(self) -> int"""
7240 return _core_.EventLoop_Run(*args, **kwargs)
7241
7242 def Exit(*args, **kwargs):
7243 """Exit(self, int rc=0)"""
7244 return _core_.EventLoop_Exit(*args, **kwargs)
7245
7246 def Pending(*args, **kwargs):
7247 """Pending(self) -> bool"""
7248 return _core_.EventLoop_Pending(*args, **kwargs)
7249
7250 def Dispatch(*args, **kwargs):
7251 """Dispatch(self) -> bool"""
7252 return _core_.EventLoop_Dispatch(*args, **kwargs)
7253
7254 def IsRunning(*args, **kwargs):
7255 """IsRunning(self) -> bool"""
7256 return _core_.EventLoop_IsRunning(*args, **kwargs)
7257
7258 def GetActive(*args, **kwargs):
7259 """GetActive() -> EventLoop"""
7260 return _core_.EventLoop_GetActive(*args, **kwargs)
7261
7262 GetActive = staticmethod(GetActive)
7263 def SetActive(*args, **kwargs):
7264 """SetActive(EventLoop loop)"""
7265 return _core_.EventLoop_SetActive(*args, **kwargs)
7266
7267 SetActive = staticmethod(SetActive)
7268 _core_.EventLoop_swigregister(EventLoop)
7269
7270 def EventLoop_GetActive(*args):
7271 """EventLoop_GetActive() -> EventLoop"""
7272 return _core_.EventLoop_GetActive(*args)
7273
7274 def EventLoop_SetActive(*args, **kwargs):
7275 """EventLoop_SetActive(EventLoop loop)"""
7276 return _core_.EventLoop_SetActive(*args, **kwargs)
7277
7278 class EventLoopActivator(object):
7279 """Proxy of C++ EventLoopActivator class"""
7280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7281 __repr__ = _swig_repr
7282 def __init__(self, *args, **kwargs):
7283 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7284 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7285 __swig_destroy__ = _core_.delete_EventLoopActivator
7286 __del__ = lambda self : None;
7287 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7288
7289 #---------------------------------------------------------------------------
7290
7291 class AcceleratorEntry(object):
7292 """
7293 A class used to define items in an `wx.AcceleratorTable`. wxPython
7294 programs can choose to use wx.AcceleratorEntry objects, but using a
7295 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7296 as well. See `__init__` for of the tuple values.
7297
7298 :see: `wx.AcceleratorTable`
7299 """
7300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7301 __repr__ = _swig_repr
7302 def __init__(self, *args, **kwargs):
7303 """
7304 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7305
7306 Construct a wx.AcceleratorEntry.
7307 """
7308 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7309 __swig_destroy__ = _core_.delete_AcceleratorEntry
7310 __del__ = lambda self : None;
7311 def Set(*args, **kwargs):
7312 """
7313 Set(self, int flags, int keyCode, int cmd)
7314
7315 (Re)set the attributes of a wx.AcceleratorEntry.
7316 :see `__init__`
7317 """
7318 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7319
7320 def GetFlags(*args, **kwargs):
7321 """
7322 GetFlags(self) -> int
7323
7324 Get the AcceleratorEntry's flags.
7325 """
7326 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7327
7328 def GetKeyCode(*args, **kwargs):
7329 """
7330 GetKeyCode(self) -> int
7331
7332 Get the AcceleratorEntry's keycode.
7333 """
7334 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7335
7336 def GetCommand(*args, **kwargs):
7337 """
7338 GetCommand(self) -> int
7339
7340 Get the AcceleratorEntry's command ID.
7341 """
7342 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7343
7344 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7345
7346 class AcceleratorTable(Object):
7347 """
7348 An accelerator table allows the application to specify a table of
7349 keyboard shortcuts for menus or other commands. On Windows, menu or
7350 button commands are supported; on GTK, only menu commands are
7351 supported.
7352 """
7353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7354 __repr__ = _swig_repr
7355 def __init__(self, *args, **kwargs):
7356 """
7357 __init__(entries) -> AcceleratorTable
7358
7359 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7360 items or or of 3-tuples (flags, keyCode, cmdID)
7361
7362 :see: `wx.AcceleratorEntry`
7363 """
7364 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7365 __swig_destroy__ = _core_.delete_AcceleratorTable
7366 __del__ = lambda self : None;
7367 def Ok(*args, **kwargs):
7368 """Ok(self) -> bool"""
7369 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7370
7371 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7372
7373
7374 def GetAccelFromString(*args, **kwargs):
7375 """GetAccelFromString(String label) -> AcceleratorEntry"""
7376 return _core_.GetAccelFromString(*args, **kwargs)
7377 #---------------------------------------------------------------------------
7378
7379 class VisualAttributes(object):
7380 """struct containing all the visual attributes of a control"""
7381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7382 __repr__ = _swig_repr
7383 def __init__(self, *args, **kwargs):
7384 """
7385 __init__(self) -> VisualAttributes
7386
7387 struct containing all the visual attributes of a control
7388 """
7389 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7390 __swig_destroy__ = _core_.delete_VisualAttributes
7391 __del__ = lambda self : None;
7392 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7393 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7394 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7395 _core_.VisualAttributes_swigregister(VisualAttributes)
7396 NullAcceleratorTable = cvar.NullAcceleratorTable
7397 PanelNameStr = cvar.PanelNameStr
7398
7399 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7400 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7401 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7402 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7403 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7404 class Window(EvtHandler):
7405 """
7406 wx.Window is the base class for all windows and represents any visible
7407 object on the screen. All controls, top level windows and so on are
7408 wx.Windows. Sizers and device contexts are not however, as they don't
7409 appear on screen themselves.
7410
7411 """
7412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7413 __repr__ = _swig_repr
7414 def __init__(self, *args, **kwargs):
7415 """
7416 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7417 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7418
7419 Construct and show a generic Window.
7420 """
7421 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7422 self._setOORInfo(self)
7423
7424 def Create(*args, **kwargs):
7425 """
7426 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7427 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7428
7429 Create the GUI part of the Window for 2-phase creation mode.
7430 """
7431 return _core_.Window_Create(*args, **kwargs)
7432
7433 def Close(*args, **kwargs):
7434 """
7435 Close(self, bool force=False) -> bool
7436
7437 This function simply generates a EVT_CLOSE event whose handler usually
7438 tries to close the window. It doesn't close the window itself,
7439 however. If force is False (the default) then the window's close
7440 handler will be allowed to veto the destruction of the window.
7441 """
7442 return _core_.Window_Close(*args, **kwargs)
7443
7444 def Destroy(*args, **kwargs):
7445 """
7446 Destroy(self) -> bool
7447
7448 Destroys the window safely. Frames and dialogs are not destroyed
7449 immediately when this function is called -- they are added to a list
7450 of windows to be deleted on idle time, when all the window's events
7451 have been processed. This prevents problems with events being sent to
7452 non-existent windows.
7453
7454 Returns True if the window has either been successfully deleted, or it
7455 has been added to the list of windows pending real deletion.
7456 """
7457 val = _core_.Window_Destroy(*args, **kwargs)
7458 args[0].thisown = 0
7459 return val
7460
7461 def DestroyChildren(*args, **kwargs):
7462 """
7463 DestroyChildren(self) -> bool
7464
7465 Destroys all children of a window. Called automatically by the
7466 destructor.
7467 """
7468 return _core_.Window_DestroyChildren(*args, **kwargs)
7469
7470 def IsBeingDeleted(*args, **kwargs):
7471 """
7472 IsBeingDeleted(self) -> bool
7473
7474 Is the window in the process of being deleted?
7475 """
7476 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7477
7478 def SetLabel(*args, **kwargs):
7479 """
7480 SetLabel(self, String label)
7481
7482 Set the text which the window shows in its label if applicable.
7483 """
7484 return _core_.Window_SetLabel(*args, **kwargs)
7485
7486 def GetLabel(*args, **kwargs):
7487 """
7488 GetLabel(self) -> String
7489
7490 Generic way of getting a label from any window, for identification
7491 purposes. The interpretation of this function differs from class to
7492 class. For frames and dialogs, the value returned is the title. For
7493 buttons or static text controls, it is the button text. This function
7494 can be useful for meta-programs such as testing tools or special-needs
7495 access programs)which need to identify windows by name.
7496 """
7497 return _core_.Window_GetLabel(*args, **kwargs)
7498
7499 def SetName(*args, **kwargs):
7500 """
7501 SetName(self, String name)
7502
7503 Sets the window's name. The window name is used for ressource setting
7504 in X, it is not the same as the window title/label
7505 """
7506 return _core_.Window_SetName(*args, **kwargs)
7507
7508 def GetName(*args, **kwargs):
7509 """
7510 GetName(self) -> String
7511
7512 Returns the windows name. This name is not guaranteed to be unique;
7513 it is up to the programmer to supply an appropriate name in the window
7514 constructor or via wx.Window.SetName.
7515 """
7516 return _core_.Window_GetName(*args, **kwargs)
7517
7518 def SetWindowVariant(*args, **kwargs):
7519 """
7520 SetWindowVariant(self, int variant)
7521
7522 Sets the variant of the window/font size to use for this window, if
7523 the platform supports variants, for example, wxMac.
7524 """
7525 return _core_.Window_SetWindowVariant(*args, **kwargs)
7526
7527 def GetWindowVariant(*args, **kwargs):
7528 """GetWindowVariant(self) -> int"""
7529 return _core_.Window_GetWindowVariant(*args, **kwargs)
7530
7531 def SetId(*args, **kwargs):
7532 """
7533 SetId(self, int winid)
7534
7535 Sets the identifier of the window. Each window has an integer
7536 identifier. If the application has not provided one, an identifier
7537 will be generated. Normally, the identifier should be provided on
7538 creation and should not be modified subsequently.
7539 """
7540 return _core_.Window_SetId(*args, **kwargs)
7541
7542 def GetId(*args, **kwargs):
7543 """
7544 GetId(self) -> int
7545
7546 Returns the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one (or the default Id
7548 -1 is used) then an unique identifier with a negative value will be
7549 generated.
7550 """
7551 return _core_.Window_GetId(*args, **kwargs)
7552
7553 def NewControlId(*args, **kwargs):
7554 """
7555 NewControlId() -> int
7556
7557 Generate a control id for the controls which were not given one.
7558 """
7559 return _core_.Window_NewControlId(*args, **kwargs)
7560
7561 NewControlId = staticmethod(NewControlId)
7562 def NextControlId(*args, **kwargs):
7563 """
7564 NextControlId(int winid) -> int
7565
7566 Get the id of the control following the one with the given
7567 autogenerated) id
7568 """
7569 return _core_.Window_NextControlId(*args, **kwargs)
7570
7571 NextControlId = staticmethod(NextControlId)
7572 def PrevControlId(*args, **kwargs):
7573 """
7574 PrevControlId(int winid) -> int
7575
7576 Get the id of the control preceding the one with the given
7577 autogenerated) id
7578 """
7579 return _core_.Window_PrevControlId(*args, **kwargs)
7580
7581 PrevControlId = staticmethod(PrevControlId)
7582 def SetSize(*args, **kwargs):
7583 """
7584 SetSize(self, Size size)
7585
7586 Sets the size of the window in pixels.
7587 """
7588 return _core_.Window_SetSize(*args, **kwargs)
7589
7590 def SetDimensions(*args, **kwargs):
7591 """
7592 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7593
7594 Sets the position and size of the window in pixels. The sizeFlags
7595 parameter indicates the interpretation of the other params if they are
7596 equal to -1.
7597
7598 ======================== ======================================
7599 wx.SIZE_AUTO A -1 indicates that a class-specific
7600 default should be used.
7601 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7602 -1 values are supplied.
7603 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7604 interpreted as real dimensions, not
7605 default values.
7606 ======================== ======================================
7607
7608 """
7609 return _core_.Window_SetDimensions(*args, **kwargs)
7610
7611 def SetRect(*args, **kwargs):
7612 """
7613 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7614
7615 Sets the position and size of the window in pixels using a wx.Rect.
7616 """
7617 return _core_.Window_SetRect(*args, **kwargs)
7618
7619 def SetSizeWH(*args, **kwargs):
7620 """
7621 SetSizeWH(self, int width, int height)
7622
7623 Sets the size of the window in pixels.
7624 """
7625 return _core_.Window_SetSizeWH(*args, **kwargs)
7626
7627 def Move(*args, **kwargs):
7628 """
7629 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7630
7631 Moves the window to the given position.
7632 """
7633 return _core_.Window_Move(*args, **kwargs)
7634
7635 SetPosition = Move
7636 def MoveXY(*args, **kwargs):
7637 """
7638 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7639
7640 Moves the window to the given position.
7641 """
7642 return _core_.Window_MoveXY(*args, **kwargs)
7643
7644 def SetBestFittingSize(*args, **kwargs):
7645 """
7646 SetBestFittingSize(self, Size size=DefaultSize)
7647
7648 A 'Smart' SetSize that will fill in default size components with the
7649 window's *best size* values. Also set's the minsize for use with sizers.
7650 """
7651 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7652
7653 def Raise(*args, **kwargs):
7654 """
7655 Raise(self)
7656
7657 Raises the window to the top of the window hierarchy. In current
7658 version of wxWidgets this works both for manage and child windows.
7659 """
7660 return _core_.Window_Raise(*args, **kwargs)
7661
7662 def Lower(*args, **kwargs):
7663 """
7664 Lower(self)
7665
7666 Lowers the window to the bottom of the window hierarchy. In current
7667 version of wxWidgets this works both for manage and child windows.
7668 """
7669 return _core_.Window_Lower(*args, **kwargs)
7670
7671 def SetClientSize(*args, **kwargs):
7672 """
7673 SetClientSize(self, Size size)
7674
7675 This sets the size of the window client area in pixels. Using this
7676 function to size a window tends to be more device-independent than
7677 wx.Window.SetSize, since the application need not worry about what
7678 dimensions the border or title bar have when trying to fit the window
7679 around panel items, for example.
7680 """
7681 return _core_.Window_SetClientSize(*args, **kwargs)
7682
7683 def SetClientSizeWH(*args, **kwargs):
7684 """
7685 SetClientSizeWH(self, int width, int height)
7686
7687 This sets the size of the window client area in pixels. Using this
7688 function to size a window tends to be more device-independent than
7689 wx.Window.SetSize, since the application need not worry about what
7690 dimensions the border or title bar have when trying to fit the window
7691 around panel items, for example.
7692 """
7693 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7694
7695 def SetClientRect(*args, **kwargs):
7696 """
7697 SetClientRect(self, Rect rect)
7698
7699 This sets the size of the window client area in pixels. Using this
7700 function to size a window tends to be more device-independent than
7701 wx.Window.SetSize, since the application need not worry about what
7702 dimensions the border or title bar have when trying to fit the window
7703 around panel items, for example.
7704 """
7705 return _core_.Window_SetClientRect(*args, **kwargs)
7706
7707 def GetPosition(*args, **kwargs):
7708 """
7709 GetPosition(self) -> Point
7710
7711 Get the window's position. Notice that the position is in client
7712 coordinates for child windows and screen coordinates for the top level
7713 ones, use `GetScreenPosition` if you need screen coordinates for all
7714 kinds of windows.
7715 """
7716 return _core_.Window_GetPosition(*args, **kwargs)
7717
7718 def GetPositionTuple(*args, **kwargs):
7719 """
7720 GetPositionTuple() -> (x,y)
7721
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7725 kinds of windows.
7726 """
7727 return _core_.Window_GetPositionTuple(*args, **kwargs)
7728
7729 def GetScreenPosition(*args, **kwargs):
7730 """
7731 GetScreenPosition(self) -> Point
7732
7733 Get the position of the window in screen coordinantes.
7734 """
7735 return _core_.Window_GetScreenPosition(*args, **kwargs)
7736
7737 def GetScreenPositionTuple(*args, **kwargs):
7738 """
7739 GetScreenPositionTuple() -> (x,y)
7740
7741 Get the position of the window in screen coordinantes.
7742 """
7743 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7744
7745 def GetScreenRect(*args, **kwargs):
7746 """
7747 GetScreenRect(self) -> Rect
7748
7749 Returns the size and position of the window in screen coordinantes as
7750 a `wx.Rect` object.
7751 """
7752 return _core_.Window_GetScreenRect(*args, **kwargs)
7753
7754 def GetSize(*args, **kwargs):
7755 """
7756 GetSize(self) -> Size
7757
7758 Get the window size.
7759 """
7760 return _core_.Window_GetSize(*args, **kwargs)
7761
7762 def GetSizeTuple(*args, **kwargs):
7763 """
7764 GetSizeTuple() -> (width, height)
7765
7766 Get the window size.
7767 """
7768 return _core_.Window_GetSizeTuple(*args, **kwargs)
7769
7770 def GetRect(*args, **kwargs):
7771 """
7772 GetRect(self) -> Rect
7773
7774 Returns the size and position of the window as a `wx.Rect` object.
7775 """
7776 return _core_.Window_GetRect(*args, **kwargs)
7777
7778 def GetClientSize(*args, **kwargs):
7779 """
7780 GetClientSize(self) -> Size
7781
7782 This gets the size of the window's 'client area' in pixels. The client
7783 area is the area which may be drawn on by the programmer, excluding
7784 title bar, border, scrollbars, etc.
7785 """
7786 return _core_.Window_GetClientSize(*args, **kwargs)
7787
7788 def GetClientSizeTuple(*args, **kwargs):
7789 """
7790 GetClientSizeTuple() -> (width, height)
7791
7792 This gets the size of the window's 'client area' in pixels. The client
7793 area is the area which may be drawn on by the programmer, excluding
7794 title bar, border, scrollbars, etc.
7795 """
7796 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7797
7798 def GetClientAreaOrigin(*args, **kwargs):
7799 """
7800 GetClientAreaOrigin(self) -> Point
7801
7802 Get the origin of the client area of the window relative to the
7803 window's top left corner (the client area may be shifted because of
7804 the borders, scrollbars, other decorations...)
7805 """
7806 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7807
7808 def GetClientRect(*args, **kwargs):
7809 """
7810 GetClientRect(self) -> Rect
7811
7812 Get the client area position and size as a `wx.Rect` object.
7813 """
7814 return _core_.Window_GetClientRect(*args, **kwargs)
7815
7816 def GetBestSize(*args, **kwargs):
7817 """
7818 GetBestSize(self) -> Size
7819
7820 This function returns the best acceptable minimal size for the
7821 window, if applicable. For example, for a static text control, it will
7822 be the minimal size such that the control label is not truncated. For
7823 windows containing subwindows (suzh aswx.Panel), the size returned by
7824 this function will be the same as the size the window would have had
7825 after calling Fit.
7826 """
7827 return _core_.Window_GetBestSize(*args, **kwargs)
7828
7829 def GetBestSizeTuple(*args, **kwargs):
7830 """
7831 GetBestSizeTuple() -> (width, height)
7832
7833 This function returns the best acceptable minimal size for the
7834 window, if applicable. For example, for a static text control, it will
7835 be the minimal size such that the control label is not truncated. For
7836 windows containing subwindows (suzh aswx.Panel), the size returned by
7837 this function will be the same as the size the window would have had
7838 after calling Fit.
7839 """
7840 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7841
7842 def InvalidateBestSize(*args, **kwargs):
7843 """
7844 InvalidateBestSize(self)
7845
7846 Reset the cached best size value so it will be recalculated the next
7847 time it is needed.
7848 """
7849 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7850
7851 def CacheBestSize(*args, **kwargs):
7852 """
7853 CacheBestSize(self, Size size)
7854
7855 Cache the best size so it doesn't need to be calculated again, (at least until
7856 some properties of the window change.)
7857 """
7858 return _core_.Window_CacheBestSize(*args, **kwargs)
7859
7860 def GetBestFittingSize(*args, **kwargs):
7861 """
7862 GetBestFittingSize(self) -> Size
7863
7864 This function will merge the window's best size into the window's
7865 minimum size, giving priority to the min size components, and returns
7866 the results.
7867
7868 """
7869 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7870
7871 def GetAdjustedBestSize(*args, **kwargs):
7872 """
7873 GetAdjustedBestSize(self) -> Size
7874
7875 This method is similar to GetBestSize, except in one
7876 thing. GetBestSize should return the minimum untruncated size of the
7877 window, while this method will return the largest of BestSize and any
7878 user specified minimum size. ie. it is the minimum size the window
7879 should currently be drawn at, not the minimal size it can possibly
7880 tolerate.
7881 """
7882 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7883
7884 def Center(*args, **kwargs):
7885 """
7886 Center(self, int direction=BOTH)
7887
7888 Centers the window. The parameter specifies the direction for
7889 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7890 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7891 on the entire screen and not on its parent window. If it is a
7892 top-level window and has no parent then it will always be centered
7893 relative to the screen.
7894 """
7895 return _core_.Window_Center(*args, **kwargs)
7896
7897 Centre = Center
7898 def CenterOnParent(*args, **kwargs):
7899 """
7900 CenterOnParent(self, int dir=BOTH)
7901
7902 Center with respect to the the parent window
7903 """
7904 return _core_.Window_CenterOnParent(*args, **kwargs)
7905
7906 CentreOnParent = CenterOnParent
7907 def Fit(*args, **kwargs):
7908 """
7909 Fit(self)
7910
7911 Sizes the window so that it fits around its subwindows. This function
7912 won't do anything if there are no subwindows and will only really work
7913 correctly if sizers are used for the subwindows layout. Also, if the
7914 window has exactly one subwindow it is better (faster and the result
7915 is more precise as Fit adds some margin to account for fuzziness of
7916 its calculations) to call window.SetClientSize(child.GetSize())
7917 instead of calling Fit.
7918 """
7919 return _core_.Window_Fit(*args, **kwargs)
7920
7921 def FitInside(*args, **kwargs):
7922 """
7923 FitInside(self)
7924
7925 Similar to Fit, but sizes the interior (virtual) size of a
7926 window. Mainly useful with scrolled windows to reset scrollbars after
7927 sizing changes that do not trigger a size event, and/or scrolled
7928 windows without an interior sizer. This function similarly won't do
7929 anything if there are no subwindows.
7930 """
7931 return _core_.Window_FitInside(*args, **kwargs)
7932
7933 def SetSizeHints(*args, **kwargs):
7934 """
7935 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7936 int incH=-1)
7937
7938 Allows specification of minimum and maximum window sizes, and window
7939 size increments. If a pair of values is not set (or set to -1), the
7940 default values will be used. If this function is called, the user
7941 will not be able to size the window outside the given bounds (if it is
7942 a top-level window.) Sizers will also inspect the minimum window size
7943 and will use that value if set when calculating layout.
7944
7945 The resizing increments are only significant under Motif or Xt.
7946 """
7947 return _core_.Window_SetSizeHints(*args, **kwargs)
7948
7949 def SetSizeHintsSz(*args, **kwargs):
7950 """
7951 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7952
7953 Allows specification of minimum and maximum window sizes, and window
7954 size increments. If a pair of values is not set (or set to -1), the
7955 default values will be used. If this function is called, the user
7956 will not be able to size the window outside the given bounds (if it is
7957 a top-level window.) Sizers will also inspect the minimum window size
7958 and will use that value if set when calculating layout.
7959
7960 The resizing increments are only significant under Motif or Xt.
7961 """
7962 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7963
7964 def SetVirtualSizeHints(*args, **kwargs):
7965 """
7966 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7967
7968 Allows specification of minimum and maximum virtual window sizes. If a
7969 pair of values is not set (or set to -1), the default values will be
7970 used. If this function is called, the user will not be able to size
7971 the virtual area of the window outside the given bounds.
7972 """
7973 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7974
7975 def SetVirtualSizeHintsSz(*args, **kwargs):
7976 """
7977 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7978
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7983 """
7984 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
7985
7986 def GetMaxSize(*args, **kwargs):
7987 """GetMaxSize(self) -> Size"""
7988 return _core_.Window_GetMaxSize(*args, **kwargs)
7989
7990 def GetMinSize(*args, **kwargs):
7991 """GetMinSize(self) -> Size"""
7992 return _core_.Window_GetMinSize(*args, **kwargs)
7993
7994 def SetMinSize(*args, **kwargs):
7995 """
7996 SetMinSize(self, Size minSize)
7997
7998 A more convenient method than `SetSizeHints` for setting just the
7999 min size.
8000 """
8001 return _core_.Window_SetMinSize(*args, **kwargs)
8002
8003 def SetMaxSize(*args, **kwargs):
8004 """
8005 SetMaxSize(self, Size maxSize)
8006
8007 A more convenient method than `SetSizeHints` for setting just the
8008 max size.
8009 """
8010 return _core_.Window_SetMaxSize(*args, **kwargs)
8011
8012 def GetMinWidth(*args, **kwargs):
8013 """GetMinWidth(self) -> int"""
8014 return _core_.Window_GetMinWidth(*args, **kwargs)
8015
8016 def GetMinHeight(*args, **kwargs):
8017 """GetMinHeight(self) -> int"""
8018 return _core_.Window_GetMinHeight(*args, **kwargs)
8019
8020 def GetMaxWidth(*args, **kwargs):
8021 """GetMaxWidth(self) -> int"""
8022 return _core_.Window_GetMaxWidth(*args, **kwargs)
8023
8024 def GetMaxHeight(*args, **kwargs):
8025 """GetMaxHeight(self) -> int"""
8026 return _core_.Window_GetMaxHeight(*args, **kwargs)
8027
8028 def SetVirtualSize(*args, **kwargs):
8029 """
8030 SetVirtualSize(self, Size size)
8031
8032 Set the the virtual size of a window in pixels. For most windows this
8033 is just the client area of the window, but for some like scrolled
8034 windows it is more or less independent of the screen window size.
8035 """
8036 return _core_.Window_SetVirtualSize(*args, **kwargs)
8037
8038 def SetVirtualSizeWH(*args, **kwargs):
8039 """
8040 SetVirtualSizeWH(self, int w, int h)
8041
8042 Set the the virtual size of a window in pixels. For most windows this
8043 is just the client area of the window, but for some like scrolled
8044 windows it is more or less independent of the screen window size.
8045 """
8046 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8047
8048 def GetVirtualSize(*args, **kwargs):
8049 """
8050 GetVirtualSize(self) -> Size
8051
8052 Get the the virtual size of the window in pixels. For most windows
8053 this is just the client area of the window, but for some like scrolled
8054 windows it is more or less independent of the screen window size.
8055 """
8056 return _core_.Window_GetVirtualSize(*args, **kwargs)
8057
8058 def GetVirtualSizeTuple(*args, **kwargs):
8059 """
8060 GetVirtualSizeTuple() -> (width, height)
8061
8062 Get the the virtual size of the window in pixels. For most windows
8063 this is just the client area of the window, but for some like scrolled
8064 windows it is more or less independent of the screen window size.
8065 """
8066 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8067
8068 def GetBestVirtualSize(*args, **kwargs):
8069 """
8070 GetBestVirtualSize(self) -> Size
8071
8072 Return the largest of ClientSize and BestSize (as determined by a
8073 sizer, interior children, or other means)
8074 """
8075 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8076
8077 def Show(*args, **kwargs):
8078 """
8079 Show(self, bool show=True) -> bool
8080
8081 Shows or hides the window. You may need to call Raise for a top level
8082 window if you want to bring it to top, although this is not needed if
8083 Show is called immediately after the frame creation. Returns True if
8084 the window has been shown or hidden or False if nothing was done
8085 because it already was in the requested state.
8086 """
8087 return _core_.Window_Show(*args, **kwargs)
8088
8089 def Hide(*args, **kwargs):
8090 """
8091 Hide(self) -> bool
8092
8093 Equivalent to calling Show(False).
8094 """
8095 return _core_.Window_Hide(*args, **kwargs)
8096
8097 def Enable(*args, **kwargs):
8098 """
8099 Enable(self, bool enable=True) -> bool
8100
8101 Enable or disable the window for user input. Note that when a parent
8102 window is disabled, all of its children are disabled as well and they
8103 are reenabled again when the parent is. Returns true if the window
8104 has been enabled or disabled, false if nothing was done, i.e. if the
8105 window had already been in the specified state.
8106 """
8107 return _core_.Window_Enable(*args, **kwargs)
8108
8109 def Disable(*args, **kwargs):
8110 """
8111 Disable(self) -> bool
8112
8113 Disables the window, same as Enable(false).
8114 """
8115 return _core_.Window_Disable(*args, **kwargs)
8116
8117 def IsShown(*args, **kwargs):
8118 """
8119 IsShown(self) -> bool
8120
8121 Returns true if the window is shown, false if it has been hidden.
8122 """
8123 return _core_.Window_IsShown(*args, **kwargs)
8124
8125 def IsEnabled(*args, **kwargs):
8126 """
8127 IsEnabled(self) -> bool
8128
8129 Returns true if the window is enabled for input, false otherwise.
8130 """
8131 return _core_.Window_IsEnabled(*args, **kwargs)
8132
8133 def SetWindowStyleFlag(*args, **kwargs):
8134 """
8135 SetWindowStyleFlag(self, long style)
8136
8137 Sets the style of the window. Please note that some styles cannot be
8138 changed after the window creation and that Refresh() might need to be
8139 called after changing the others for the change to take place
8140 immediately.
8141 """
8142 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8143
8144 def GetWindowStyleFlag(*args, **kwargs):
8145 """
8146 GetWindowStyleFlag(self) -> long
8147
8148 Gets the window style that was passed to the constructor or Create
8149 method.
8150 """
8151 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8152
8153 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8154 def HasFlag(*args, **kwargs):
8155 """
8156 HasFlag(self, int flag) -> bool
8157
8158 Test if the given style is set for this window.
8159 """
8160 return _core_.Window_HasFlag(*args, **kwargs)
8161
8162 def IsRetained(*args, **kwargs):
8163 """
8164 IsRetained(self) -> bool
8165
8166 Returns true if the window is retained, false otherwise. Retained
8167 windows are only available on X platforms.
8168 """
8169 return _core_.Window_IsRetained(*args, **kwargs)
8170
8171 def SetExtraStyle(*args, **kwargs):
8172 """
8173 SetExtraStyle(self, long exStyle)
8174
8175 Sets the extra style bits for the window. Extra styles are the less
8176 often used style bits which can't be set with the constructor or with
8177 SetWindowStyleFlag()
8178 """
8179 return _core_.Window_SetExtraStyle(*args, **kwargs)
8180
8181 def GetExtraStyle(*args, **kwargs):
8182 """
8183 GetExtraStyle(self) -> long
8184
8185 Returns the extra style bits for the window.
8186 """
8187 return _core_.Window_GetExtraStyle(*args, **kwargs)
8188
8189 def MakeModal(*args, **kwargs):
8190 """
8191 MakeModal(self, bool modal=True)
8192
8193 Disables all other windows in the application so that the user can
8194 only interact with this window. Passing False will reverse this
8195 effect.
8196 """
8197 return _core_.Window_MakeModal(*args, **kwargs)
8198
8199 def SetThemeEnabled(*args, **kwargs):
8200 """
8201 SetThemeEnabled(self, bool enableTheme)
8202
8203 This function tells a window if it should use the system's "theme"
8204 code to draw the windows' background instead if its own background
8205 drawing code. This will only have an effect on platforms that support
8206 the notion of themes in user defined windows. One such platform is
8207 GTK+ where windows can have (very colourful) backgrounds defined by a
8208 user's selected theme.
8209
8210 Dialogs, notebook pages and the status bar have this flag set to true
8211 by default so that the default look and feel is simulated best.
8212 """
8213 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8214
8215 def GetThemeEnabled(*args, **kwargs):
8216 """
8217 GetThemeEnabled(self) -> bool
8218
8219 Return the themeEnabled flag.
8220 """
8221 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8222
8223 def SetFocus(*args, **kwargs):
8224 """
8225 SetFocus(self)
8226
8227 Set's the focus to this window, allowing it to receive keyboard input.
8228 """
8229 return _core_.Window_SetFocus(*args, **kwargs)
8230
8231 def SetFocusFromKbd(*args, **kwargs):
8232 """
8233 SetFocusFromKbd(self)
8234
8235 Set focus to this window as the result of a keyboard action. Normally
8236 only called internally.
8237 """
8238 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8239
8240 def FindFocus(*args, **kwargs):
8241 """
8242 FindFocus() -> Window
8243
8244 Returns the window or control that currently has the keyboard focus,
8245 or None.
8246 """
8247 return _core_.Window_FindFocus(*args, **kwargs)
8248
8249 FindFocus = staticmethod(FindFocus)
8250 def AcceptsFocus(*args, **kwargs):
8251 """
8252 AcceptsFocus(self) -> bool
8253
8254 Can this window have focus?
8255 """
8256 return _core_.Window_AcceptsFocus(*args, **kwargs)
8257
8258 def AcceptsFocusFromKeyboard(*args, **kwargs):
8259 """
8260 AcceptsFocusFromKeyboard(self) -> bool
8261
8262 Can this window be given focus by keyboard navigation? if not, the
8263 only way to give it focus (provided it accepts it at all) is to click
8264 it.
8265 """
8266 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8267
8268 def GetDefaultItem(*args, **kwargs):
8269 """
8270 GetDefaultItem(self) -> Window
8271
8272 Get the default child of this parent, i.e. the one which is activated
8273 by pressing <Enter> such as the OK button on a wx.Dialog.
8274 """
8275 return _core_.Window_GetDefaultItem(*args, **kwargs)
8276
8277 def SetDefaultItem(*args, **kwargs):
8278 """
8279 SetDefaultItem(self, Window child) -> Window
8280
8281 Set this child as default, return the old default.
8282 """
8283 return _core_.Window_SetDefaultItem(*args, **kwargs)
8284
8285 def SetTmpDefaultItem(*args, **kwargs):
8286 """
8287 SetTmpDefaultItem(self, Window win)
8288
8289 Set this child as temporary default
8290 """
8291 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8292
8293 def Navigate(*args, **kwargs):
8294 """
8295 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8296
8297 Does keyboard navigation from this window to another, by sending a
8298 `wx.NavigationKeyEvent`.
8299 """
8300 return _core_.Window_Navigate(*args, **kwargs)
8301
8302 def MoveAfterInTabOrder(*args, **kwargs):
8303 """
8304 MoveAfterInTabOrder(self, Window win)
8305
8306 Moves this window in the tab navigation order after the specified
8307 sibling window. This means that when the user presses the TAB key on
8308 that other window, the focus switches to this window.
8309
8310 The default tab order is the same as creation order. This function
8311 and `MoveBeforeInTabOrder` allow to change it after creating all the
8312 windows.
8313
8314 """
8315 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8316
8317 def MoveBeforeInTabOrder(*args, **kwargs):
8318 """
8319 MoveBeforeInTabOrder(self, Window win)
8320
8321 Same as `MoveAfterInTabOrder` except that it inserts this window just
8322 before win instead of putting it right after it.
8323 """
8324 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8325
8326 def GetChildren(*args, **kwargs):
8327 """
8328 GetChildren(self) -> PyObject
8329
8330 Returns a list of the window's children. NOTE: Currently this is a
8331 copy of the child window list maintained by the window, so the return
8332 value of this function is only valid as long as the window's children
8333 do not change.
8334 """
8335 return _core_.Window_GetChildren(*args, **kwargs)
8336
8337 def GetParent(*args, **kwargs):
8338 """
8339 GetParent(self) -> Window
8340
8341 Returns the parent window of this window, or None if there isn't one.
8342 """
8343 return _core_.Window_GetParent(*args, **kwargs)
8344
8345 def GetGrandParent(*args, **kwargs):
8346 """
8347 GetGrandParent(self) -> Window
8348
8349 Returns the parent of the parent of this window, or None if there
8350 isn't one.
8351 """
8352 return _core_.Window_GetGrandParent(*args, **kwargs)
8353
8354 def IsTopLevel(*args, **kwargs):
8355 """
8356 IsTopLevel(self) -> bool
8357
8358 Returns true if the given window is a top-level one. Currently all
8359 frames and dialogs are always considered to be top-level windows (even
8360 if they have a parent window).
8361 """
8362 return _core_.Window_IsTopLevel(*args, **kwargs)
8363
8364 def Reparent(*args, **kwargs):
8365 """
8366 Reparent(self, Window newParent) -> bool
8367
8368 Reparents the window, i.e the window will be removed from its current
8369 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8370 re-inserted into another. Available on Windows and GTK. Returns True
8371 if the parent was changed, False otherwise (error or newParent ==
8372 oldParent)
8373 """
8374 return _core_.Window_Reparent(*args, **kwargs)
8375
8376 def AddChild(*args, **kwargs):
8377 """
8378 AddChild(self, Window child)
8379
8380 Adds a child window. This is called automatically by window creation
8381 functions so should not be required by the application programmer.
8382 """
8383 return _core_.Window_AddChild(*args, **kwargs)
8384
8385 def RemoveChild(*args, **kwargs):
8386 """
8387 RemoveChild(self, Window child)
8388
8389 Removes a child window. This is called automatically by window
8390 deletion functions so should not be required by the application
8391 programmer.
8392 """
8393 return _core_.Window_RemoveChild(*args, **kwargs)
8394
8395 def SetDoubleBuffered(*args, **kwargs):
8396 """
8397 SetDoubleBuffered(self, bool on)
8398
8399 Currently wxGTK2 only.
8400 """
8401 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8402
8403 def FindWindowById(*args, **kwargs):
8404 """
8405 FindWindowById(self, long winid) -> Window
8406
8407 Find a chld of this window by window ID
8408 """
8409 return _core_.Window_FindWindowById(*args, **kwargs)
8410
8411 def FindWindowByName(*args, **kwargs):
8412 """
8413 FindWindowByName(self, String name) -> Window
8414
8415 Find a child of this window by name
8416 """
8417 return _core_.Window_FindWindowByName(*args, **kwargs)
8418
8419 def GetEventHandler(*args, **kwargs):
8420 """
8421 GetEventHandler(self) -> EvtHandler
8422
8423 Returns the event handler for this window. By default, the window is
8424 its own event handler.
8425 """
8426 return _core_.Window_GetEventHandler(*args, **kwargs)
8427
8428 def SetEventHandler(*args, **kwargs):
8429 """
8430 SetEventHandler(self, EvtHandler handler)
8431
8432 Sets the event handler for this window. An event handler is an object
8433 that is capable of processing the events sent to a window. By default,
8434 the window is its own event handler, but an application may wish to
8435 substitute another, for example to allow central implementation of
8436 event-handling for a variety of different window classes.
8437
8438 It is usually better to use `wx.Window.PushEventHandler` since this sets
8439 up a chain of event handlers, where an event not handled by one event
8440 handler is handed to the next one in the chain.
8441 """
8442 return _core_.Window_SetEventHandler(*args, **kwargs)
8443
8444 def PushEventHandler(*args, **kwargs):
8445 """
8446 PushEventHandler(self, EvtHandler handler)
8447
8448 Pushes this event handler onto the event handler stack for the window.
8449 An event handler is an object that is capable of processing the events
8450 sent to a window. By default, the window is its own event handler, but
8451 an application may wish to substitute another, for example to allow
8452 central implementation of event-handling for a variety of different
8453 window classes.
8454
8455 wx.Window.PushEventHandler allows an application to set up a chain of
8456 event handlers, where an event not handled by one event handler is
8457 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8458 remove the event handler.
8459 """
8460 return _core_.Window_PushEventHandler(*args, **kwargs)
8461
8462 def PopEventHandler(*args, **kwargs):
8463 """
8464 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8465
8466 Removes and returns the top-most event handler on the event handler
8467 stack. If deleteHandler is True then the wx.EvtHandler object will be
8468 destroyed after it is popped.
8469 """
8470 return _core_.Window_PopEventHandler(*args, **kwargs)
8471
8472 def RemoveEventHandler(*args, **kwargs):
8473 """
8474 RemoveEventHandler(self, EvtHandler handler) -> bool
8475
8476 Find the given handler in the event handler chain and remove (but not
8477 delete) it from the event handler chain, return True if it was found
8478 and False otherwise (this also results in an assert failure so this
8479 function should only be called when the handler is supposed to be
8480 there.)
8481 """
8482 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8483
8484 def SetValidator(*args, **kwargs):
8485 """
8486 SetValidator(self, Validator validator)
8487
8488 Deletes the current validator (if any) and sets the window validator,
8489 having called wx.Validator.Clone to create a new validator of this
8490 type.
8491 """
8492 return _core_.Window_SetValidator(*args, **kwargs)
8493
8494 def GetValidator(*args, **kwargs):
8495 """
8496 GetValidator(self) -> Validator
8497
8498 Returns a pointer to the current validator for the window, or None if
8499 there is none.
8500 """
8501 return _core_.Window_GetValidator(*args, **kwargs)
8502
8503 def Validate(*args, **kwargs):
8504 """
8505 Validate(self) -> bool
8506
8507 Validates the current values of the child controls using their
8508 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8509 style flag set, the method will also call Validate() of all child
8510 windows. Returns false if any of the validations failed.
8511 """
8512 return _core_.Window_Validate(*args, **kwargs)
8513
8514 def TransferDataToWindow(*args, **kwargs):
8515 """
8516 TransferDataToWindow(self) -> bool
8517
8518 Transfers values to child controls from data areas specified by their
8519 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8520 style flag set, the method will also call TransferDataToWindow() of
8521 all child windows.
8522 """
8523 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8524
8525 def TransferDataFromWindow(*args, **kwargs):
8526 """
8527 TransferDataFromWindow(self) -> bool
8528
8529 Transfers values from child controls to data areas specified by their
8530 validators. Returns false if a transfer failed. If the window has
8531 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8532 also call TransferDataFromWindow() of all child windows.
8533 """
8534 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8535
8536 def InitDialog(*args, **kwargs):
8537 """
8538 InitDialog(self)
8539
8540 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8541 to the dialog via validators.
8542 """
8543 return _core_.Window_InitDialog(*args, **kwargs)
8544
8545 def SetAcceleratorTable(*args, **kwargs):
8546 """
8547 SetAcceleratorTable(self, AcceleratorTable accel)
8548
8549 Sets the accelerator table for this window.
8550 """
8551 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8552
8553 def GetAcceleratorTable(*args, **kwargs):
8554 """
8555 GetAcceleratorTable(self) -> AcceleratorTable
8556
8557 Gets the accelerator table for this window.
8558 """
8559 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8560
8561 def RegisterHotKey(*args, **kwargs):
8562 """
8563 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8564
8565 Registers a system wide hotkey. Every time the user presses the hotkey
8566 registered here, this window will receive a hotkey event. It will
8567 receive the event even if the application is in the background and
8568 does not have the input focus because the user is working with some
8569 other application. To bind an event handler function to this hotkey
8570 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8571 hotkey was registered successfully.
8572 """
8573 return _core_.Window_RegisterHotKey(*args, **kwargs)
8574
8575 def UnregisterHotKey(*args, **kwargs):
8576 """
8577 UnregisterHotKey(self, int hotkeyId) -> bool
8578
8579 Unregisters a system wide hotkey.
8580 """
8581 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8582
8583 def ConvertDialogPointToPixels(*args, **kwargs):
8584 """
8585 ConvertDialogPointToPixels(self, Point pt) -> Point
8586
8587 Converts a point or size from dialog units to pixels. Dialog units
8588 are used for maintaining a dialog's proportions even if the font
8589 changes. For the x dimension, the dialog units are multiplied by the
8590 average character width and then divided by 4. For the y dimension,
8591 the dialog units are multiplied by the average character height and
8592 then divided by 8.
8593 """
8594 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8595
8596 def ConvertDialogSizeToPixels(*args, **kwargs):
8597 """
8598 ConvertDialogSizeToPixels(self, Size sz) -> Size
8599
8600 Converts a point or size from dialog units to pixels. Dialog units
8601 are used for maintaining a dialog's proportions even if the font
8602 changes. For the x dimension, the dialog units are multiplied by the
8603 average character width and then divided by 4. For the y dimension,
8604 the dialog units are multiplied by the average character height and
8605 then divided by 8.
8606 """
8607 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8608
8609 def DLG_PNT(*args, **kwargs):
8610 """
8611 DLG_PNT(self, Point pt) -> Point
8612
8613 Converts a point or size from dialog units to pixels. Dialog units
8614 are used for maintaining a dialog's proportions even if the font
8615 changes. For the x dimension, the dialog units are multiplied by the
8616 average character width and then divided by 4. For the y dimension,
8617 the dialog units are multiplied by the average character height and
8618 then divided by 8.
8619 """
8620 return _core_.Window_DLG_PNT(*args, **kwargs)
8621
8622 def DLG_SZE(*args, **kwargs):
8623 """
8624 DLG_SZE(self, Size sz) -> Size
8625
8626 Converts a point or size from dialog units to pixels. Dialog units
8627 are used for maintaining a dialog's proportions even if the font
8628 changes. For the x dimension, the dialog units are multiplied by the
8629 average character width and then divided by 4. For the y dimension,
8630 the dialog units are multiplied by the average character height and
8631 then divided by 8.
8632 """
8633 return _core_.Window_DLG_SZE(*args, **kwargs)
8634
8635 def ConvertPixelPointToDialog(*args, **kwargs):
8636 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8637 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8638
8639 def ConvertPixelSizeToDialog(*args, **kwargs):
8640 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8641 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8642
8643 def WarpPointer(*args, **kwargs):
8644 """
8645 WarpPointer(self, int x, int y)
8646
8647 Moves the pointer to the given position on the window.
8648
8649 NOTE: This function is not supported under Mac because Apple Human
8650 Interface Guidelines forbid moving the mouse cursor programmatically.
8651 """
8652 return _core_.Window_WarpPointer(*args, **kwargs)
8653
8654 def CaptureMouse(*args, **kwargs):
8655 """
8656 CaptureMouse(self)
8657
8658 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8659 release the capture.
8660
8661 Note that wxWindows maintains the stack of windows having captured the
8662 mouse and when the mouse is released the capture returns to the window
8663 which had had captured it previously and it is only really released if
8664 there were no previous window. In particular, this means that you must
8665 release the mouse as many times as you capture it.
8666 """
8667 return _core_.Window_CaptureMouse(*args, **kwargs)
8668
8669 def ReleaseMouse(*args, **kwargs):
8670 """
8671 ReleaseMouse(self)
8672
8673 Releases mouse input captured with wx.Window.CaptureMouse.
8674 """
8675 return _core_.Window_ReleaseMouse(*args, **kwargs)
8676
8677 def GetCapture(*args, **kwargs):
8678 """
8679 GetCapture() -> Window
8680
8681 Returns the window which currently captures the mouse or None
8682 """
8683 return _core_.Window_GetCapture(*args, **kwargs)
8684
8685 GetCapture = staticmethod(GetCapture)
8686 def HasCapture(*args, **kwargs):
8687 """
8688 HasCapture(self) -> bool
8689
8690 Returns true if this window has the current mouse capture.
8691 """
8692 return _core_.Window_HasCapture(*args, **kwargs)
8693
8694 def Refresh(*args, **kwargs):
8695 """
8696 Refresh(self, bool eraseBackground=True, Rect rect=None)
8697
8698 Mark the specified rectangle (or the whole window) as "dirty" so it
8699 will be repainted. Causes an EVT_PAINT event to be generated and sent
8700 to the window.
8701 """
8702 return _core_.Window_Refresh(*args, **kwargs)
8703
8704 def RefreshRect(*args, **kwargs):
8705 """
8706 RefreshRect(self, Rect rect, bool eraseBackground=True)
8707
8708 Redraws the contents of the given rectangle: the area inside it will
8709 be repainted. This is the same as Refresh but has a nicer syntax.
8710 """
8711 return _core_.Window_RefreshRect(*args, **kwargs)
8712
8713 def Update(*args, **kwargs):
8714 """
8715 Update(self)
8716
8717 Calling this method immediately repaints the invalidated area of the
8718 window instead of waiting for the EVT_PAINT event to happen, (normally
8719 this would usually only happen when the flow of control returns to the
8720 event loop.) Notice that this function doesn't refresh the window and
8721 does nothing if the window has been already repainted. Use Refresh
8722 first if you want to immediately redraw the window (or some portion of
8723 it) unconditionally.
8724 """
8725 return _core_.Window_Update(*args, **kwargs)
8726
8727 def ClearBackground(*args, **kwargs):
8728 """
8729 ClearBackground(self)
8730
8731 Clears the window by filling it with the current background
8732 colour. Does not cause an erase background event to be generated.
8733 """
8734 return _core_.Window_ClearBackground(*args, **kwargs)
8735
8736 def Freeze(*args, **kwargs):
8737 """
8738 Freeze(self)
8739
8740 Freezes the window or, in other words, prevents any updates from
8741 taking place on screen, the window is not redrawn at all. Thaw must be
8742 called to reenable window redrawing. Calls to Freeze/Thaw may be
8743 nested, with the actual Thaw being delayed until all the nesting has
8744 been undone.
8745
8746 This method is useful for visual appearance optimization (for example,
8747 it is a good idea to use it before inserting large amount of text into
8748 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8749 for all controls so it is mostly just a hint to wxWindows and not a
8750 mandatory directive.
8751 """
8752 return _core_.Window_Freeze(*args, **kwargs)
8753
8754 def Thaw(*args, **kwargs):
8755 """
8756 Thaw(self)
8757
8758 Reenables window updating after a previous call to Freeze. Calls to
8759 Freeze/Thaw may be nested, so Thaw must be called the same number of
8760 times that Freeze was before the window will be updated.
8761 """
8762 return _core_.Window_Thaw(*args, **kwargs)
8763
8764 def PrepareDC(*args, **kwargs):
8765 """
8766 PrepareDC(self, DC dc)
8767
8768 Call this function to prepare the device context for drawing a
8769 scrolled image. It sets the device origin according to the current
8770 scroll position.
8771 """
8772 return _core_.Window_PrepareDC(*args, **kwargs)
8773
8774 def GetUpdateRegion(*args, **kwargs):
8775 """
8776 GetUpdateRegion(self) -> Region
8777
8778 Returns the region specifying which parts of the window have been
8779 damaged. Should only be called within an EVT_PAINT handler.
8780 """
8781 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8782
8783 def GetUpdateClientRect(*args, **kwargs):
8784 """
8785 GetUpdateClientRect(self) -> Rect
8786
8787 Get the update rectangle region bounding box in client coords.
8788 """
8789 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8790
8791 def IsExposed(*args, **kwargs):
8792 """
8793 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8794
8795 Returns true if the given point or rectangle area has been exposed
8796 since the last repaint. Call this in an paint event handler to
8797 optimize redrawing by only redrawing those areas, which have been
8798 exposed.
8799 """
8800 return _core_.Window_IsExposed(*args, **kwargs)
8801
8802 def IsExposedPoint(*args, **kwargs):
8803 """
8804 IsExposedPoint(self, Point pt) -> bool
8805
8806 Returns true if the given point or rectangle area has been exposed
8807 since the last repaint. Call this in an paint event handler to
8808 optimize redrawing by only redrawing those areas, which have been
8809 exposed.
8810 """
8811 return _core_.Window_IsExposedPoint(*args, **kwargs)
8812
8813 def IsExposedRect(*args, **kwargs):
8814 """
8815 IsExposedRect(self, Rect rect) -> bool
8816
8817 Returns true if the given point or rectangle area has been exposed
8818 since the last repaint. Call this in an paint event handler to
8819 optimize redrawing by only redrawing those areas, which have been
8820 exposed.
8821 """
8822 return _core_.Window_IsExposedRect(*args, **kwargs)
8823
8824 def GetDefaultAttributes(*args, **kwargs):
8825 """
8826 GetDefaultAttributes(self) -> VisualAttributes
8827
8828 Get the default attributes for an instance of this class. This is
8829 useful if you want to use the same font or colour in your own control
8830 as in a standard control -- which is a much better idea than hard
8831 coding specific colours or fonts which might look completely out of
8832 place on the user's system, especially if it uses themes.
8833 """
8834 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8835
8836 def GetClassDefaultAttributes(*args, **kwargs):
8837 """
8838 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8839
8840 Get the default attributes for this class. This is useful if you want
8841 to use the same font or colour in your own control as in a standard
8842 control -- which is a much better idea than hard coding specific
8843 colours or fonts which might look completely out of place on the
8844 user's system, especially if it uses themes.
8845
8846 The variant parameter is only relevant under Mac currently and is
8847 ignore under other platforms. Under Mac, it will change the size of
8848 the returned font. See `wx.Window.SetWindowVariant` for more about
8849 this.
8850 """
8851 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8852
8853 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8854 def SetBackgroundColour(*args, **kwargs):
8855 """
8856 SetBackgroundColour(self, Colour colour) -> bool
8857
8858 Sets the background colour of the window. Returns True if the colour
8859 was changed. The background colour is usually painted by the default
8860 EVT_ERASE_BACKGROUND event handler function under Windows and
8861 automatically under GTK. Using `wx.NullColour` will reset the window
8862 to the default background colour.
8863
8864 Note that setting the background colour may not cause an immediate
8865 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8866 calling this function.
8867
8868 Using this function will disable attempts to use themes for this
8869 window, if the system supports them. Use with care since usually the
8870 themes represent the appearance chosen by the user to be used for all
8871 applications on the system.
8872 """
8873 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8874
8875 def SetOwnBackgroundColour(*args, **kwargs):
8876 """SetOwnBackgroundColour(self, Colour colour)"""
8877 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8878
8879 def SetForegroundColour(*args, **kwargs):
8880 """
8881 SetForegroundColour(self, Colour colour) -> bool
8882
8883 Sets the foreground colour of the window. Returns True is the colour
8884 was changed. The interpretation of foreground colour is dependent on
8885 the window class; it may be the text colour or other colour, or it may
8886 not be used at all.
8887 """
8888 return _core_.Window_SetForegroundColour(*args, **kwargs)
8889
8890 def SetOwnForegroundColour(*args, **kwargs):
8891 """SetOwnForegroundColour(self, Colour colour)"""
8892 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8893
8894 def GetBackgroundColour(*args, **kwargs):
8895 """
8896 GetBackgroundColour(self) -> Colour
8897
8898 Returns the background colour of the window.
8899 """
8900 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8901
8902 def GetForegroundColour(*args, **kwargs):
8903 """
8904 GetForegroundColour(self) -> Colour
8905
8906 Returns the foreground colour of the window. The interpretation of
8907 foreground colour is dependent on the window class; it may be the text
8908 colour or other colour, or it may not be used at all.
8909 """
8910 return _core_.Window_GetForegroundColour(*args, **kwargs)
8911
8912 def InheritsBackgroundColour(*args, **kwargs):
8913 """InheritsBackgroundColour(self) -> bool"""
8914 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8915
8916 def UseBgCol(*args, **kwargs):
8917 """UseBgCol(self) -> bool"""
8918 return _core_.Window_UseBgCol(*args, **kwargs)
8919
8920 def SetBackgroundStyle(*args, **kwargs):
8921 """
8922 SetBackgroundStyle(self, int style) -> bool
8923
8924 Returns the background style of the window. The background style
8925 indicates how the background of the window is drawn.
8926
8927 ====================== ========================================
8928 wx.BG_STYLE_SYSTEM The background colour or pattern should
8929 be determined by the system
8930 wx.BG_STYLE_COLOUR The background should be a solid colour
8931 wx.BG_STYLE_CUSTOM The background will be implemented by the
8932 application.
8933 ====================== ========================================
8934
8935 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8936 a custom background, such as a tiled bitmap. Currently the style has
8937 no effect on other platforms.
8938
8939 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8940 """
8941 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8942
8943 def GetBackgroundStyle(*args, **kwargs):
8944 """
8945 GetBackgroundStyle(self) -> int
8946
8947 Returns the background style of the window.
8948
8949 :see: `SetBackgroundStyle`
8950 """
8951 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8952
8953 def HasTransparentBackground(*args, **kwargs):
8954 """
8955 HasTransparentBackground(self) -> bool
8956
8957 Returns True if this window's background is transparent (as, for
8958 example, for `wx.StaticText`) and should show the parent window's
8959 background.
8960
8961 This method is mostly used internally by the library itself and you
8962 normally shouldn't have to call it. You may, however, have to override
8963 it in your custom control classes to ensure that background is painted
8964 correctly.
8965 """
8966 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8967
8968 def SetCursor(*args, **kwargs):
8969 """
8970 SetCursor(self, Cursor cursor) -> bool
8971
8972 Sets the window's cursor. Notice that the window cursor also sets it
8973 for the children of the window implicitly.
8974
8975 The cursor may be wx.NullCursor in which case the window cursor will
8976 be reset back to default.
8977 """
8978 return _core_.Window_SetCursor(*args, **kwargs)
8979
8980 def GetCursor(*args, **kwargs):
8981 """
8982 GetCursor(self) -> Cursor
8983
8984 Return the cursor associated with this window.
8985 """
8986 return _core_.Window_GetCursor(*args, **kwargs)
8987
8988 def SetFont(*args, **kwargs):
8989 """
8990 SetFont(self, Font font) -> bool
8991
8992 Sets the font for this window.
8993 """
8994 return _core_.Window_SetFont(*args, **kwargs)
8995
8996 def SetOwnFont(*args, **kwargs):
8997 """SetOwnFont(self, Font font)"""
8998 return _core_.Window_SetOwnFont(*args, **kwargs)
8999
9000 def GetFont(*args, **kwargs):
9001 """
9002 GetFont(self) -> Font
9003
9004 Returns the default font used for this window.
9005 """
9006 return _core_.Window_GetFont(*args, **kwargs)
9007
9008 def SetCaret(*args, **kwargs):
9009 """
9010 SetCaret(self, Caret caret)
9011
9012 Sets the caret associated with the window.
9013 """
9014 return _core_.Window_SetCaret(*args, **kwargs)
9015
9016 def GetCaret(*args, **kwargs):
9017 """
9018 GetCaret(self) -> Caret
9019
9020 Returns the caret associated with the window.
9021 """
9022 return _core_.Window_GetCaret(*args, **kwargs)
9023
9024 def GetCharHeight(*args, **kwargs):
9025 """
9026 GetCharHeight(self) -> int
9027
9028 Get the (average) character size for the current font.
9029 """
9030 return _core_.Window_GetCharHeight(*args, **kwargs)
9031
9032 def GetCharWidth(*args, **kwargs):
9033 """
9034 GetCharWidth(self) -> int
9035
9036 Get the (average) character size for the current font.
9037 """
9038 return _core_.Window_GetCharWidth(*args, **kwargs)
9039
9040 def GetTextExtent(*args, **kwargs):
9041 """
9042 GetTextExtent(String string) -> (width, height)
9043
9044 Get the width and height of the text using the current font.
9045 """
9046 return _core_.Window_GetTextExtent(*args, **kwargs)
9047
9048 def GetFullTextExtent(*args, **kwargs):
9049 """
9050 GetFullTextExtent(String string, Font font=None) ->
9051 (width, height, descent, externalLeading)
9052
9053 Get the width, height, decent and leading of the text using the
9054 current or specified font.
9055 """
9056 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9057
9058 def ClientToScreenXY(*args, **kwargs):
9059 """
9060 ClientToScreenXY(int x, int y) -> (x,y)
9061
9062 Converts to screen coordinates from coordinates relative to this window.
9063 """
9064 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9065
9066 def ScreenToClientXY(*args, **kwargs):
9067 """
9068 ScreenToClientXY(int x, int y) -> (x,y)
9069
9070 Converts from screen to client window coordinates.
9071 """
9072 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9073
9074 def ClientToScreen(*args, **kwargs):
9075 """
9076 ClientToScreen(self, Point pt) -> Point
9077
9078 Converts to screen coordinates from coordinates relative to this window.
9079 """
9080 return _core_.Window_ClientToScreen(*args, **kwargs)
9081
9082 def ScreenToClient(*args, **kwargs):
9083 """
9084 ScreenToClient(self, Point pt) -> Point
9085
9086 Converts from screen to client window coordinates.
9087 """
9088 return _core_.Window_ScreenToClient(*args, **kwargs)
9089
9090 def HitTestXY(*args, **kwargs):
9091 """
9092 HitTestXY(self, int x, int y) -> int
9093
9094 Test where the given (in client coords) point lies
9095 """
9096 return _core_.Window_HitTestXY(*args, **kwargs)
9097
9098 def HitTest(*args, **kwargs):
9099 """
9100 HitTest(self, Point pt) -> int
9101
9102 Test where the given (in client coords) point lies
9103 """
9104 return _core_.Window_HitTest(*args, **kwargs)
9105
9106 def GetBorder(*args):
9107 """
9108 GetBorder(self, long flags) -> int
9109 GetBorder(self) -> int
9110
9111 Get border for the flags of this window
9112 """
9113 return _core_.Window_GetBorder(*args)
9114
9115 def UpdateWindowUI(*args, **kwargs):
9116 """
9117 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9118
9119 This function sends EVT_UPDATE_UI events to the window. The particular
9120 implementation depends on the window; for example a wx.ToolBar will
9121 send an update UI event for each toolbar button, and a wx.Frame will
9122 send an update UI event for each menubar menu item. You can call this
9123 function from your application to ensure that your UI is up-to-date at
9124 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9125 concerned). This may be necessary if you have called
9126 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9127 limit the overhead that wxWindows incurs by sending update UI events
9128 in idle time.
9129 """
9130 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9131
9132 def PopupMenuXY(*args, **kwargs):
9133 """
9134 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9135
9136 Pops up the given menu at the specified coordinates, relative to this window,
9137 and returns control when the user has dismissed the menu. If a menu item is
9138 selected, the corresponding menu event is generated and will be processed as
9139 usual. If the default position is given then the current position of the
9140 mouse cursor will be used.
9141 """
9142 return _core_.Window_PopupMenuXY(*args, **kwargs)
9143
9144 def PopupMenu(*args, **kwargs):
9145 """
9146 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9147
9148 Pops up the given menu at the specified coordinates, relative to this window,
9149 and returns control when the user has dismissed the menu. If a menu item is
9150 selected, the corresponding menu event is generated and will be processed as
9151 usual. If the default position is given then the current position of the
9152 mouse cursor will be used.
9153 """
9154 return _core_.Window_PopupMenu(*args, **kwargs)
9155
9156 def GetHandle(*args, **kwargs):
9157 """
9158 GetHandle(self) -> long
9159
9160 Returns the platform-specific handle (as a long integer) of the
9161 physical window. Currently on wxMac it returns the handle of the
9162 toplevel parent of the window.
9163 """
9164 return _core_.Window_GetHandle(*args, **kwargs)
9165
9166 def AssociateHandle(*args, **kwargs):
9167 """
9168 AssociateHandle(self, long handle)
9169
9170 Associate the window with a new native handle
9171 """
9172 return _core_.Window_AssociateHandle(*args, **kwargs)
9173
9174 def DissociateHandle(*args, **kwargs):
9175 """
9176 DissociateHandle(self)
9177
9178 Dissociate the current native handle from the window
9179 """
9180 return _core_.Window_DissociateHandle(*args, **kwargs)
9181
9182 def HasScrollbar(*args, **kwargs):
9183 """
9184 HasScrollbar(self, int orient) -> bool
9185
9186 Does the window have the scrollbar for this orientation?
9187 """
9188 return _core_.Window_HasScrollbar(*args, **kwargs)
9189
9190 def SetScrollbar(*args, **kwargs):
9191 """
9192 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9193 bool refresh=True)
9194
9195 Sets the scrollbar properties of a built-in scrollbar.
9196 """
9197 return _core_.Window_SetScrollbar(*args, **kwargs)
9198
9199 def SetScrollPos(*args, **kwargs):
9200 """
9201 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9202
9203 Sets the position of one of the built-in scrollbars.
9204 """
9205 return _core_.Window_SetScrollPos(*args, **kwargs)
9206
9207 def GetScrollPos(*args, **kwargs):
9208 """
9209 GetScrollPos(self, int orientation) -> int
9210
9211 Returns the built-in scrollbar position.
9212 """
9213 return _core_.Window_GetScrollPos(*args, **kwargs)
9214
9215 def GetScrollThumb(*args, **kwargs):
9216 """
9217 GetScrollThumb(self, int orientation) -> int
9218
9219 Returns the built-in scrollbar thumb size.
9220 """
9221 return _core_.Window_GetScrollThumb(*args, **kwargs)
9222
9223 def GetScrollRange(*args, **kwargs):
9224 """
9225 GetScrollRange(self, int orientation) -> int
9226
9227 Returns the built-in scrollbar range.
9228 """
9229 return _core_.Window_GetScrollRange(*args, **kwargs)
9230
9231 def ScrollWindow(*args, **kwargs):
9232 """
9233 ScrollWindow(self, int dx, int dy, Rect rect=None)
9234
9235 Physically scrolls the pixels in the window and move child windows
9236 accordingly. Use this function to optimise your scrolling
9237 implementations, to minimise the area that must be redrawn. Note that
9238 it is rarely required to call this function from a user program.
9239 """
9240 return _core_.Window_ScrollWindow(*args, **kwargs)
9241
9242 def ScrollLines(*args, **kwargs):
9243 """
9244 ScrollLines(self, int lines) -> bool
9245
9246 If the platform and window class supports it, scrolls the window by
9247 the given number of lines down, if lines is positive, or up if lines
9248 is negative. Returns True if the window was scrolled, False if it was
9249 already on top/bottom and nothing was done.
9250 """
9251 return _core_.Window_ScrollLines(*args, **kwargs)
9252
9253 def ScrollPages(*args, **kwargs):
9254 """
9255 ScrollPages(self, int pages) -> bool
9256
9257 If the platform and window class supports it, scrolls the window by
9258 the given number of pages down, if pages is positive, or up if pages
9259 is negative. Returns True if the window was scrolled, False if it was
9260 already on top/bottom and nothing was done.
9261 """
9262 return _core_.Window_ScrollPages(*args, **kwargs)
9263
9264 def LineUp(*args, **kwargs):
9265 """
9266 LineUp(self) -> bool
9267
9268 This is just a wrapper for ScrollLines(-1).
9269 """
9270 return _core_.Window_LineUp(*args, **kwargs)
9271
9272 def LineDown(*args, **kwargs):
9273 """
9274 LineDown(self) -> bool
9275
9276 This is just a wrapper for ScrollLines(1).
9277 """
9278 return _core_.Window_LineDown(*args, **kwargs)
9279
9280 def PageUp(*args, **kwargs):
9281 """
9282 PageUp(self) -> bool
9283
9284 This is just a wrapper for ScrollPages(-1).
9285 """
9286 return _core_.Window_PageUp(*args, **kwargs)
9287
9288 def PageDown(*args, **kwargs):
9289 """
9290 PageDown(self) -> bool
9291
9292 This is just a wrapper for ScrollPages(1).
9293 """
9294 return _core_.Window_PageDown(*args, **kwargs)
9295
9296 def SetHelpText(*args, **kwargs):
9297 """
9298 SetHelpText(self, String text)
9299
9300 Sets the help text to be used as context-sensitive help for this
9301 window. Note that the text is actually stored by the current
9302 `wx.HelpProvider` implementation, and not in the window object itself.
9303 """
9304 return _core_.Window_SetHelpText(*args, **kwargs)
9305
9306 def SetHelpTextForId(*args, **kwargs):
9307 """
9308 SetHelpTextForId(self, String text)
9309
9310 Associate this help text with all windows with the same id as this
9311 one.
9312 """
9313 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9314
9315 def GetHelpText(*args, **kwargs):
9316 """
9317 GetHelpText(self) -> String
9318
9319 Gets the help text to be used as context-sensitive help for this
9320 window. Note that the text is actually stored by the current
9321 `wx.HelpProvider` implementation, and not in the window object itself.
9322 """
9323 return _core_.Window_GetHelpText(*args, **kwargs)
9324
9325 def SetToolTipString(*args, **kwargs):
9326 """
9327 SetToolTipString(self, String tip)
9328
9329 Attach a tooltip to the window.
9330 """
9331 return _core_.Window_SetToolTipString(*args, **kwargs)
9332
9333 def SetToolTip(*args, **kwargs):
9334 """
9335 SetToolTip(self, ToolTip tip)
9336
9337 Attach a tooltip to the window.
9338 """
9339 return _core_.Window_SetToolTip(*args, **kwargs)
9340
9341 def GetToolTip(*args, **kwargs):
9342 """
9343 GetToolTip(self) -> ToolTip
9344
9345 get the associated tooltip or None if none
9346 """
9347 return _core_.Window_GetToolTip(*args, **kwargs)
9348
9349 def SetDropTarget(*args, **kwargs):
9350 """
9351 SetDropTarget(self, DropTarget dropTarget)
9352
9353 Associates a drop target with this window. If the window already has
9354 a drop target, it is deleted.
9355 """
9356 return _core_.Window_SetDropTarget(*args, **kwargs)
9357
9358 def GetDropTarget(*args, **kwargs):
9359 """
9360 GetDropTarget(self) -> DropTarget
9361
9362 Returns the associated drop target, which may be None.
9363 """
9364 return _core_.Window_GetDropTarget(*args, **kwargs)
9365
9366 def DragAcceptFiles(*args, **kwargs):
9367 """
9368 DragAcceptFiles(self, bool accept)
9369
9370 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9371 Only functional on Windows.
9372 """
9373 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9374
9375 def SetConstraints(*args, **kwargs):
9376 """
9377 SetConstraints(self, LayoutConstraints constraints)
9378
9379 Sets the window to have the given layout constraints. If an existing
9380 layout constraints object is already owned by the window, it will be
9381 deleted. Pass None to disassociate and delete the window's current
9382 constraints.
9383
9384 You must call SetAutoLayout to tell a window to use the constraints
9385 automatically in its default EVT_SIZE handler; otherwise, you must
9386 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9387 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9388 effect.
9389 """
9390 return _core_.Window_SetConstraints(*args, **kwargs)
9391
9392 def GetConstraints(*args, **kwargs):
9393 """
9394 GetConstraints(self) -> LayoutConstraints
9395
9396 Returns a pointer to the window's layout constraints, or None if there
9397 are none.
9398 """
9399 return _core_.Window_GetConstraints(*args, **kwargs)
9400
9401 def SetAutoLayout(*args, **kwargs):
9402 """
9403 SetAutoLayout(self, bool autoLayout)
9404
9405 Determines whether the Layout function will be called automatically
9406 when the window is resized. lease note that this only happens for the
9407 windows usually used to contain children, namely `wx.Panel` and
9408 `wx.TopLevelWindow` (and the classes deriving from them).
9409
9410 This method is called implicitly by `SetSizer` but if you use
9411 `SetConstraints` you should call it manually or otherwise the window
9412 layout won't be correctly updated when its size changes.
9413 """
9414 return _core_.Window_SetAutoLayout(*args, **kwargs)
9415
9416 def GetAutoLayout(*args, **kwargs):
9417 """
9418 GetAutoLayout(self) -> bool
9419
9420 Returns the current autoLayout setting
9421 """
9422 return _core_.Window_GetAutoLayout(*args, **kwargs)
9423
9424 def Layout(*args, **kwargs):
9425 """
9426 Layout(self) -> bool
9427
9428 Invokes the constraint-based layout algorithm or the sizer-based
9429 algorithm for this window. See SetAutoLayout: when auto layout is on,
9430 this function gets called automatically by the default EVT_SIZE
9431 handler when the window is resized.
9432 """
9433 return _core_.Window_Layout(*args, **kwargs)
9434
9435 def SetSizer(*args, **kwargs):
9436 """
9437 SetSizer(self, Sizer sizer, bool deleteOld=True)
9438
9439 Sets the window to have the given layout sizer. The window will then
9440 own the object, and will take care of its deletion. If an existing
9441 layout sizer object is already owned by the window, it will be deleted
9442 if the deleteOld parameter is true. Note that this function will also
9443 call SetAutoLayout implicitly with a True parameter if the sizer is
9444 non-None, and False otherwise.
9445 """
9446 return _core_.Window_SetSizer(*args, **kwargs)
9447
9448 def SetSizerAndFit(*args, **kwargs):
9449 """
9450 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9451
9452 The same as SetSizer, except it also sets the size hints for the
9453 window based on the sizer's minimum size.
9454 """
9455 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9456
9457 def GetSizer(*args, **kwargs):
9458 """
9459 GetSizer(self) -> Sizer
9460
9461 Return the sizer associated with the window by a previous call to
9462 SetSizer or None if there isn't one.
9463 """
9464 return _core_.Window_GetSizer(*args, **kwargs)
9465
9466 def SetContainingSizer(*args, **kwargs):
9467 """
9468 SetContainingSizer(self, Sizer sizer)
9469
9470 This normally does not need to be called by application code. It is
9471 called internally when a window is added to a sizer, and is used so
9472 the window can remove itself from the sizer when it is destroyed.
9473 """
9474 return _core_.Window_SetContainingSizer(*args, **kwargs)
9475
9476 def GetContainingSizer(*args, **kwargs):
9477 """
9478 GetContainingSizer(self) -> Sizer
9479
9480 Return the sizer that this window is a member of, if any, otherwise None.
9481 """
9482 return _core_.Window_GetContainingSizer(*args, **kwargs)
9483
9484 def InheritAttributes(*args, **kwargs):
9485 """
9486 InheritAttributes(self)
9487
9488 This function is (or should be, in case of custom controls) called
9489 during window creation to intelligently set up the window visual
9490 attributes, that is the font and the foreground and background
9491 colours.
9492
9493 By 'intelligently' the following is meant: by default, all windows use
9494 their own default attributes. However if some of the parent's
9495 attributes are explicitly changed (that is, using SetFont and not
9496 SetOwnFont) and if the corresponding attribute hadn't been
9497 explicitly set for this window itself, then this window takes the same
9498 value as used by the parent. In addition, if the window overrides
9499 ShouldInheritColours to return false, the colours will not be changed
9500 no matter what and only the font might.
9501
9502 This rather complicated logic is necessary in order to accommodate the
9503 different usage scenarios. The most common one is when all default
9504 attributes are used and in this case, nothing should be inherited as
9505 in modern GUIs different controls use different fonts (and colours)
9506 than their siblings so they can't inherit the same value from the
9507 parent. However it was also deemed desirable to allow to simply change
9508 the attributes of all children at once by just changing the font or
9509 colour of their common parent, hence in this case we do inherit the
9510 parents attributes.
9511
9512 """
9513 return _core_.Window_InheritAttributes(*args, **kwargs)
9514
9515 def ShouldInheritColours(*args, **kwargs):
9516 """
9517 ShouldInheritColours(self) -> bool
9518
9519 Return true from here to allow the colours of this window to be
9520 changed by InheritAttributes, returning false forbids inheriting them
9521 from the parent window.
9522
9523 The base class version returns false, but this method is overridden in
9524 wxControl where it returns true.
9525 """
9526 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9527
9528 def PostCreate(self, pre):
9529 """
9530 Phase 3 of the 2-phase create <wink!>
9531 Call this method after precreating the window with the 2-phase create method.
9532 """
9533 self.this = pre.this
9534 self.thisown = pre.thisown
9535 pre.thisown = 0
9536 if hasattr(self, '_setOORInfo'):
9537 self._setOORInfo(self)
9538 if hasattr(self, '_setCallbackInfo'):
9539 self._setCallbackInfo(self, self.__class__)
9540
9541 def SendSizeEvent(self):
9542 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9543
9544 _core_.Window_swigregister(Window)
9545
9546 def PreWindow(*args, **kwargs):
9547 """
9548 PreWindow() -> Window
9549
9550 Precreate a Window for 2-phase creation.
9551 """
9552 val = _core_.new_PreWindow(*args, **kwargs)
9553 return val
9554
9555 def Window_NewControlId(*args):
9556 """
9557 Window_NewControlId() -> int
9558
9559 Generate a control id for the controls which were not given one.
9560 """
9561 return _core_.Window_NewControlId(*args)
9562
9563 def Window_NextControlId(*args, **kwargs):
9564 """
9565 Window_NextControlId(int winid) -> int
9566
9567 Get the id of the control following the one with the given
9568 autogenerated) id
9569 """
9570 return _core_.Window_NextControlId(*args, **kwargs)
9571
9572 def Window_PrevControlId(*args, **kwargs):
9573 """
9574 Window_PrevControlId(int winid) -> int
9575
9576 Get the id of the control preceding the one with the given
9577 autogenerated) id
9578 """
9579 return _core_.Window_PrevControlId(*args, **kwargs)
9580
9581 def Window_FindFocus(*args):
9582 """
9583 Window_FindFocus() -> Window
9584
9585 Returns the window or control that currently has the keyboard focus,
9586 or None.
9587 """
9588 return _core_.Window_FindFocus(*args)
9589
9590 def Window_GetCapture(*args):
9591 """
9592 Window_GetCapture() -> Window
9593
9594 Returns the window which currently captures the mouse or None
9595 """
9596 return _core_.Window_GetCapture(*args)
9597
9598 def Window_GetClassDefaultAttributes(*args, **kwargs):
9599 """
9600 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9601
9602 Get the default attributes for this class. This is useful if you want
9603 to use the same font or colour in your own control as in a standard
9604 control -- which is a much better idea than hard coding specific
9605 colours or fonts which might look completely out of place on the
9606 user's system, especially if it uses themes.
9607
9608 The variant parameter is only relevant under Mac currently and is
9609 ignore under other platforms. Under Mac, it will change the size of
9610 the returned font. See `wx.Window.SetWindowVariant` for more about
9611 this.
9612 """
9613 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9614
9615 def DLG_PNT(win, point_or_x, y=None):
9616 """
9617 Convenience function for converting a Point or (x,y) in
9618 dialog units to pixel units.
9619 """
9620 if y is None:
9621 return win.ConvertDialogPointToPixels(point_or_x)
9622 else:
9623 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9624
9625 def DLG_SZE(win, size_width, height=None):
9626 """
9627 Convenience function for converting a Size or (w,h) in
9628 dialog units to pixel units.
9629 """
9630 if height is None:
9631 return win.ConvertDialogSizeToPixels(size_width)
9632 else:
9633 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9634
9635
9636 def FindWindowById(*args, **kwargs):
9637 """
9638 FindWindowById(long id, Window parent=None) -> Window
9639
9640 Find the first window in the application with the given id. If parent
9641 is None, the search will start from all top-level frames and dialog
9642 boxes; if non-None, the search will be limited to the given window
9643 hierarchy. The search is recursive in both cases.
9644 """
9645 return _core_.FindWindowById(*args, **kwargs)
9646
9647 def FindWindowByName(*args, **kwargs):
9648 """
9649 FindWindowByName(String name, Window parent=None) -> Window
9650
9651 Find a window by its name (as given in a window constructor or Create
9652 function call). If parent is None, the search will start from all
9653 top-level frames and dialog boxes; if non-None, the search will be
9654 limited to the given window hierarchy. The search is recursive in both
9655 cases.
9656
9657 If no window with such name is found, wx.FindWindowByLabel is called.
9658 """
9659 return _core_.FindWindowByName(*args, **kwargs)
9660
9661 def FindWindowByLabel(*args, **kwargs):
9662 """
9663 FindWindowByLabel(String label, Window parent=None) -> Window
9664
9665 Find a window by its label. Depending on the type of window, the label
9666 may be a window title or panel item label. If parent is None, the
9667 search will start from all top-level frames and dialog boxes; if
9668 non-None, the search will be limited to the given window
9669 hierarchy. The search is recursive in both cases.
9670 """
9671 return _core_.FindWindowByLabel(*args, **kwargs)
9672
9673 def Window_FromHWND(*args, **kwargs):
9674 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9675 return _core_.Window_FromHWND(*args, **kwargs)
9676
9677 def GetTopLevelWindows(*args):
9678 """
9679 GetTopLevelWindows() -> PyObject
9680
9681 Returns a list of the the application's top-level windows, (frames,
9682 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9683 by wxWidgets, and so it is only valid as long as no top-level windows
9684 are closed or new top-level windows are created.
9685
9686 """
9687 return _core_.GetTopLevelWindows(*args)
9688 #---------------------------------------------------------------------------
9689
9690 class Validator(EvtHandler):
9691 """Proxy of C++ Validator class"""
9692 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9693 __repr__ = _swig_repr
9694 def __init__(self, *args, **kwargs):
9695 """__init__(self) -> Validator"""
9696 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9697 self._setOORInfo(self)
9698
9699 def Clone(*args, **kwargs):
9700 """Clone(self) -> Validator"""
9701 return _core_.Validator_Clone(*args, **kwargs)
9702
9703 def Validate(*args, **kwargs):
9704 """Validate(self, Window parent) -> bool"""
9705 return _core_.Validator_Validate(*args, **kwargs)
9706
9707 def TransferToWindow(*args, **kwargs):
9708 """TransferToWindow(self) -> bool"""
9709 return _core_.Validator_TransferToWindow(*args, **kwargs)
9710
9711 def TransferFromWindow(*args, **kwargs):
9712 """TransferFromWindow(self) -> bool"""
9713 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9714
9715 def GetWindow(*args, **kwargs):
9716 """GetWindow(self) -> Window"""
9717 return _core_.Validator_GetWindow(*args, **kwargs)
9718
9719 def SetWindow(*args, **kwargs):
9720 """SetWindow(self, Window window)"""
9721 return _core_.Validator_SetWindow(*args, **kwargs)
9722
9723 def IsSilent(*args, **kwargs):
9724 """IsSilent() -> bool"""
9725 return _core_.Validator_IsSilent(*args, **kwargs)
9726
9727 IsSilent = staticmethod(IsSilent)
9728 def SetBellOnError(*args, **kwargs):
9729 """SetBellOnError(int doIt=True)"""
9730 return _core_.Validator_SetBellOnError(*args, **kwargs)
9731
9732 SetBellOnError = staticmethod(SetBellOnError)
9733 _core_.Validator_swigregister(Validator)
9734
9735 def Validator_IsSilent(*args):
9736 """Validator_IsSilent() -> bool"""
9737 return _core_.Validator_IsSilent(*args)
9738
9739 def Validator_SetBellOnError(*args, **kwargs):
9740 """Validator_SetBellOnError(int doIt=True)"""
9741 return _core_.Validator_SetBellOnError(*args, **kwargs)
9742
9743 class PyValidator(Validator):
9744 """Proxy of C++ PyValidator class"""
9745 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9746 __repr__ = _swig_repr
9747 def __init__(self, *args, **kwargs):
9748 """__init__(self) -> PyValidator"""
9749 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9750
9751 self._setCallbackInfo(self, PyValidator, 1)
9752 self._setOORInfo(self)
9753
9754 def _setCallbackInfo(*args, **kwargs):
9755 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9756 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9757
9758 _core_.PyValidator_swigregister(PyValidator)
9759
9760 #---------------------------------------------------------------------------
9761
9762 class Menu(EvtHandler):
9763 """Proxy of C++ Menu class"""
9764 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9765 __repr__ = _swig_repr
9766 def __init__(self, *args, **kwargs):
9767 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9768 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9769 self._setOORInfo(self)
9770
9771 def Append(*args, **kwargs):
9772 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9773 return _core_.Menu_Append(*args, **kwargs)
9774
9775 def AppendSeparator(*args, **kwargs):
9776 """AppendSeparator(self) -> MenuItem"""
9777 return _core_.Menu_AppendSeparator(*args, **kwargs)
9778
9779 def AppendCheckItem(*args, **kwargs):
9780 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9781 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9782
9783 def AppendRadioItem(*args, **kwargs):
9784 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9785 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9786
9787 def AppendMenu(*args, **kwargs):
9788 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9789 return _core_.Menu_AppendMenu(*args, **kwargs)
9790
9791 def AppendSubMenu(*args, **kwargs):
9792 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9793 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9794
9795 def AppendItem(*args, **kwargs):
9796 """AppendItem(self, MenuItem item) -> MenuItem"""
9797 return _core_.Menu_AppendItem(*args, **kwargs)
9798
9799 def InsertItem(*args, **kwargs):
9800 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9801 return _core_.Menu_InsertItem(*args, **kwargs)
9802
9803 def PrependItem(*args, **kwargs):
9804 """PrependItem(self, MenuItem item) -> MenuItem"""
9805 return _core_.Menu_PrependItem(*args, **kwargs)
9806
9807 def Break(*args, **kwargs):
9808 """Break(self)"""
9809 return _core_.Menu_Break(*args, **kwargs)
9810
9811 def Insert(*args, **kwargs):
9812 """
9813 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9814 int kind=ITEM_NORMAL) -> MenuItem
9815 """
9816 return _core_.Menu_Insert(*args, **kwargs)
9817
9818 def InsertSeparator(*args, **kwargs):
9819 """InsertSeparator(self, size_t pos) -> MenuItem"""
9820 return _core_.Menu_InsertSeparator(*args, **kwargs)
9821
9822 def InsertCheckItem(*args, **kwargs):
9823 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9824 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9825
9826 def InsertRadioItem(*args, **kwargs):
9827 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9828 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9829
9830 def InsertMenu(*args, **kwargs):
9831 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9832 return _core_.Menu_InsertMenu(*args, **kwargs)
9833
9834 def Prepend(*args, **kwargs):
9835 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9836 return _core_.Menu_Prepend(*args, **kwargs)
9837
9838 def PrependSeparator(*args, **kwargs):
9839 """PrependSeparator(self) -> MenuItem"""
9840 return _core_.Menu_PrependSeparator(*args, **kwargs)
9841
9842 def PrependCheckItem(*args, **kwargs):
9843 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9844 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9845
9846 def PrependRadioItem(*args, **kwargs):
9847 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9849
9850 def PrependMenu(*args, **kwargs):
9851 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_PrependMenu(*args, **kwargs)
9853
9854 def Remove(*args, **kwargs):
9855 """Remove(self, int id) -> MenuItem"""
9856 return _core_.Menu_Remove(*args, **kwargs)
9857
9858 def RemoveItem(*args, **kwargs):
9859 """RemoveItem(self, MenuItem item) -> MenuItem"""
9860 return _core_.Menu_RemoveItem(*args, **kwargs)
9861
9862 def Delete(*args, **kwargs):
9863 """Delete(self, int id) -> bool"""
9864 return _core_.Menu_Delete(*args, **kwargs)
9865
9866 def DeleteItem(*args, **kwargs):
9867 """DeleteItem(self, MenuItem item) -> bool"""
9868 return _core_.Menu_DeleteItem(*args, **kwargs)
9869
9870 def Destroy(*args, **kwargs):
9871 """
9872 Destroy(self)
9873
9874 Deletes the C++ object this Python object is a proxy for.
9875 """
9876 val = _core_.Menu_Destroy(*args, **kwargs)
9877 args[0].thisown = 0
9878 return val
9879
9880 def DestroyId(*args, **kwargs):
9881 """
9882 DestroyId(self, int id) -> bool
9883
9884 Deletes the C++ object this Python object is a proxy for.
9885 """
9886 val = _core_.Menu_DestroyId(*args, **kwargs)
9887 args[0].thisown = 0
9888 return val
9889
9890 def DestroyItem(*args, **kwargs):
9891 """
9892 DestroyItem(self, MenuItem item) -> bool
9893
9894 Deletes the C++ object this Python object is a proxy for.
9895 """
9896 val = _core_.Menu_DestroyItem(*args, **kwargs)
9897 args[0].thisown = 0
9898 return val
9899
9900 def GetMenuItemCount(*args, **kwargs):
9901 """GetMenuItemCount(self) -> size_t"""
9902 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9903
9904 def GetMenuItems(*args, **kwargs):
9905 """GetMenuItems(self) -> PyObject"""
9906 return _core_.Menu_GetMenuItems(*args, **kwargs)
9907
9908 def FindItem(*args, **kwargs):
9909 """FindItem(self, String item) -> int"""
9910 return _core_.Menu_FindItem(*args, **kwargs)
9911
9912 def FindItemById(*args, **kwargs):
9913 """FindItemById(self, int id) -> MenuItem"""
9914 return _core_.Menu_FindItemById(*args, **kwargs)
9915
9916 def FindItemByPosition(*args, **kwargs):
9917 """FindItemByPosition(self, size_t position) -> MenuItem"""
9918 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9919
9920 def Enable(*args, **kwargs):
9921 """Enable(self, int id, bool enable)"""
9922 return _core_.Menu_Enable(*args, **kwargs)
9923
9924 def IsEnabled(*args, **kwargs):
9925 """IsEnabled(self, int id) -> bool"""
9926 return _core_.Menu_IsEnabled(*args, **kwargs)
9927
9928 def Check(*args, **kwargs):
9929 """Check(self, int id, bool check)"""
9930 return _core_.Menu_Check(*args, **kwargs)
9931
9932 def IsChecked(*args, **kwargs):
9933 """IsChecked(self, int id) -> bool"""
9934 return _core_.Menu_IsChecked(*args, **kwargs)
9935
9936 def SetLabel(*args, **kwargs):
9937 """SetLabel(self, int id, String label)"""
9938 return _core_.Menu_SetLabel(*args, **kwargs)
9939
9940 def GetLabel(*args, **kwargs):
9941 """GetLabel(self, int id) -> String"""
9942 return _core_.Menu_GetLabel(*args, **kwargs)
9943
9944 def SetHelpString(*args, **kwargs):
9945 """SetHelpString(self, int id, String helpString)"""
9946 return _core_.Menu_SetHelpString(*args, **kwargs)
9947
9948 def GetHelpString(*args, **kwargs):
9949 """GetHelpString(self, int id) -> String"""
9950 return _core_.Menu_GetHelpString(*args, **kwargs)
9951
9952 def SetTitle(*args, **kwargs):
9953 """SetTitle(self, String title)"""
9954 return _core_.Menu_SetTitle(*args, **kwargs)
9955
9956 def GetTitle(*args, **kwargs):
9957 """GetTitle(self) -> String"""
9958 return _core_.Menu_GetTitle(*args, **kwargs)
9959
9960 def SetEventHandler(*args, **kwargs):
9961 """SetEventHandler(self, EvtHandler handler)"""
9962 return _core_.Menu_SetEventHandler(*args, **kwargs)
9963
9964 def GetEventHandler(*args, **kwargs):
9965 """GetEventHandler(self) -> EvtHandler"""
9966 return _core_.Menu_GetEventHandler(*args, **kwargs)
9967
9968 def SetInvokingWindow(*args, **kwargs):
9969 """SetInvokingWindow(self, Window win)"""
9970 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9971
9972 def GetInvokingWindow(*args, **kwargs):
9973 """GetInvokingWindow(self) -> Window"""
9974 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9975
9976 def GetStyle(*args, **kwargs):
9977 """GetStyle(self) -> long"""
9978 return _core_.Menu_GetStyle(*args, **kwargs)
9979
9980 def UpdateUI(*args, **kwargs):
9981 """UpdateUI(self, EvtHandler source=None)"""
9982 return _core_.Menu_UpdateUI(*args, **kwargs)
9983
9984 def GetMenuBar(*args, **kwargs):
9985 """GetMenuBar(self) -> MenuBar"""
9986 return _core_.Menu_GetMenuBar(*args, **kwargs)
9987
9988 def Attach(*args, **kwargs):
9989 """Attach(self, wxMenuBarBase menubar)"""
9990 return _core_.Menu_Attach(*args, **kwargs)
9991
9992 def Detach(*args, **kwargs):
9993 """Detach(self)"""
9994 return _core_.Menu_Detach(*args, **kwargs)
9995
9996 def IsAttached(*args, **kwargs):
9997 """IsAttached(self) -> bool"""
9998 return _core_.Menu_IsAttached(*args, **kwargs)
9999
10000 def SetParent(*args, **kwargs):
10001 """SetParent(self, Menu parent)"""
10002 return _core_.Menu_SetParent(*args, **kwargs)
10003
10004 def GetParent(*args, **kwargs):
10005 """GetParent(self) -> Menu"""
10006 return _core_.Menu_GetParent(*args, **kwargs)
10007
10008 _core_.Menu_swigregister(Menu)
10009 DefaultValidator = cvar.DefaultValidator
10010
10011 #---------------------------------------------------------------------------
10012
10013 class MenuBar(Window):
10014 """Proxy of C++ MenuBar class"""
10015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10016 __repr__ = _swig_repr
10017 def __init__(self, *args, **kwargs):
10018 """__init__(self, long style=0) -> MenuBar"""
10019 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10020 self._setOORInfo(self)
10021
10022 def Append(*args, **kwargs):
10023 """Append(self, Menu menu, String title) -> bool"""
10024 return _core_.MenuBar_Append(*args, **kwargs)
10025
10026 def Insert(*args, **kwargs):
10027 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10028 return _core_.MenuBar_Insert(*args, **kwargs)
10029
10030 def GetMenuCount(*args, **kwargs):
10031 """GetMenuCount(self) -> size_t"""
10032 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10033
10034 def GetMenu(*args, **kwargs):
10035 """GetMenu(self, size_t pos) -> Menu"""
10036 return _core_.MenuBar_GetMenu(*args, **kwargs)
10037
10038 def Replace(*args, **kwargs):
10039 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10040 return _core_.MenuBar_Replace(*args, **kwargs)
10041
10042 def Remove(*args, **kwargs):
10043 """Remove(self, size_t pos) -> Menu"""
10044 return _core_.MenuBar_Remove(*args, **kwargs)
10045
10046 def EnableTop(*args, **kwargs):
10047 """EnableTop(self, size_t pos, bool enable)"""
10048 return _core_.MenuBar_EnableTop(*args, **kwargs)
10049
10050 def IsEnabledTop(*args, **kwargs):
10051 """IsEnabledTop(self, size_t pos) -> bool"""
10052 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10053
10054 def SetLabelTop(*args, **kwargs):
10055 """SetLabelTop(self, size_t pos, String label)"""
10056 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10057
10058 def GetLabelTop(*args, **kwargs):
10059 """GetLabelTop(self, size_t pos) -> String"""
10060 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10061
10062 def FindMenuItem(*args, **kwargs):
10063 """FindMenuItem(self, String menu, String item) -> int"""
10064 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10065
10066 def FindItemById(*args, **kwargs):
10067 """FindItemById(self, int id) -> MenuItem"""
10068 return _core_.MenuBar_FindItemById(*args, **kwargs)
10069
10070 def FindMenu(*args, **kwargs):
10071 """FindMenu(self, String title) -> int"""
10072 return _core_.MenuBar_FindMenu(*args, **kwargs)
10073
10074 def Enable(*args, **kwargs):
10075 """Enable(self, int id, bool enable)"""
10076 return _core_.MenuBar_Enable(*args, **kwargs)
10077
10078 def Check(*args, **kwargs):
10079 """Check(self, int id, bool check)"""
10080 return _core_.MenuBar_Check(*args, **kwargs)
10081
10082 def IsChecked(*args, **kwargs):
10083 """IsChecked(self, int id) -> bool"""
10084 return _core_.MenuBar_IsChecked(*args, **kwargs)
10085
10086 def IsEnabled(*args, **kwargs):
10087 """IsEnabled(self, int id) -> bool"""
10088 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10089
10090 def SetLabel(*args, **kwargs):
10091 """SetLabel(self, int id, String label)"""
10092 return _core_.MenuBar_SetLabel(*args, **kwargs)
10093
10094 def GetLabel(*args, **kwargs):
10095 """GetLabel(self, int id) -> String"""
10096 return _core_.MenuBar_GetLabel(*args, **kwargs)
10097
10098 def SetHelpString(*args, **kwargs):
10099 """SetHelpString(self, int id, String helpString)"""
10100 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10101
10102 def GetHelpString(*args, **kwargs):
10103 """GetHelpString(self, int id) -> String"""
10104 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10105
10106 def GetFrame(*args, **kwargs):
10107 """GetFrame(self) -> wxFrame"""
10108 return _core_.MenuBar_GetFrame(*args, **kwargs)
10109
10110 def IsAttached(*args, **kwargs):
10111 """IsAttached(self) -> bool"""
10112 return _core_.MenuBar_IsAttached(*args, **kwargs)
10113
10114 def Attach(*args, **kwargs):
10115 """Attach(self, wxFrame frame)"""
10116 return _core_.MenuBar_Attach(*args, **kwargs)
10117
10118 def Detach(*args, **kwargs):
10119 """Detach(self)"""
10120 return _core_.MenuBar_Detach(*args, **kwargs)
10121
10122 def SetAutoWindowMenu(*args, **kwargs):
10123 """SetAutoWindowMenu(bool enable)"""
10124 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10125
10126 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10127 def GetAutoWindowMenu(*args, **kwargs):
10128 """GetAutoWindowMenu() -> bool"""
10129 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10130
10131 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10132 _core_.MenuBar_swigregister(MenuBar)
10133
10134 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10135 """MenuBar_SetAutoWindowMenu(bool enable)"""
10136 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10137
10138 def MenuBar_GetAutoWindowMenu(*args):
10139 """MenuBar_GetAutoWindowMenu() -> bool"""
10140 return _core_.MenuBar_GetAutoWindowMenu(*args)
10141
10142 #---------------------------------------------------------------------------
10143
10144 class MenuItem(Object):
10145 """Proxy of C++ MenuItem class"""
10146 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10147 __repr__ = _swig_repr
10148 def __init__(self, *args, **kwargs):
10149 """
10150 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10151 String help=EmptyString, int kind=ITEM_NORMAL,
10152 Menu subMenu=None) -> MenuItem
10153 """
10154 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10155 __swig_destroy__ = _core_.delete_MenuItem
10156 __del__ = lambda self : None;
10157 def GetMenu(*args, **kwargs):
10158 """GetMenu(self) -> Menu"""
10159 return _core_.MenuItem_GetMenu(*args, **kwargs)
10160
10161 def SetMenu(*args, **kwargs):
10162 """SetMenu(self, Menu menu)"""
10163 return _core_.MenuItem_SetMenu(*args, **kwargs)
10164
10165 def SetId(*args, **kwargs):
10166 """SetId(self, int id)"""
10167 return _core_.MenuItem_SetId(*args, **kwargs)
10168
10169 def GetId(*args, **kwargs):
10170 """GetId(self) -> int"""
10171 return _core_.MenuItem_GetId(*args, **kwargs)
10172
10173 def IsSeparator(*args, **kwargs):
10174 """IsSeparator(self) -> bool"""
10175 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10176
10177 def SetText(*args, **kwargs):
10178 """SetText(self, String str)"""
10179 return _core_.MenuItem_SetText(*args, **kwargs)
10180
10181 def GetLabel(*args, **kwargs):
10182 """GetLabel(self) -> String"""
10183 return _core_.MenuItem_GetLabel(*args, **kwargs)
10184
10185 def GetText(*args, **kwargs):
10186 """GetText(self) -> String"""
10187 return _core_.MenuItem_GetText(*args, **kwargs)
10188
10189 def GetLabelFromText(*args, **kwargs):
10190 """GetLabelFromText(String text) -> String"""
10191 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10192
10193 GetLabelFromText = staticmethod(GetLabelFromText)
10194 def GetKind(*args, **kwargs):
10195 """GetKind(self) -> int"""
10196 return _core_.MenuItem_GetKind(*args, **kwargs)
10197
10198 def SetKind(*args, **kwargs):
10199 """SetKind(self, int kind)"""
10200 return _core_.MenuItem_SetKind(*args, **kwargs)
10201
10202 def SetCheckable(*args, **kwargs):
10203 """SetCheckable(self, bool checkable)"""
10204 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10205
10206 def IsCheckable(*args, **kwargs):
10207 """IsCheckable(self) -> bool"""
10208 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10209
10210 def IsSubMenu(*args, **kwargs):
10211 """IsSubMenu(self) -> bool"""
10212 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10213
10214 def SetSubMenu(*args, **kwargs):
10215 """SetSubMenu(self, Menu menu)"""
10216 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10217
10218 def GetSubMenu(*args, **kwargs):
10219 """GetSubMenu(self) -> Menu"""
10220 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10221
10222 def Enable(*args, **kwargs):
10223 """Enable(self, bool enable=True)"""
10224 return _core_.MenuItem_Enable(*args, **kwargs)
10225
10226 def IsEnabled(*args, **kwargs):
10227 """IsEnabled(self) -> bool"""
10228 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10229
10230 def Check(*args, **kwargs):
10231 """Check(self, bool check=True)"""
10232 return _core_.MenuItem_Check(*args, **kwargs)
10233
10234 def IsChecked(*args, **kwargs):
10235 """IsChecked(self) -> bool"""
10236 return _core_.MenuItem_IsChecked(*args, **kwargs)
10237
10238 def Toggle(*args, **kwargs):
10239 """Toggle(self)"""
10240 return _core_.MenuItem_Toggle(*args, **kwargs)
10241
10242 def SetHelp(*args, **kwargs):
10243 """SetHelp(self, String str)"""
10244 return _core_.MenuItem_SetHelp(*args, **kwargs)
10245
10246 def GetHelp(*args, **kwargs):
10247 """GetHelp(self) -> String"""
10248 return _core_.MenuItem_GetHelp(*args, **kwargs)
10249
10250 def GetAccel(*args, **kwargs):
10251 """GetAccel(self) -> AcceleratorEntry"""
10252 return _core_.MenuItem_GetAccel(*args, **kwargs)
10253
10254 def SetAccel(*args, **kwargs):
10255 """SetAccel(self, AcceleratorEntry accel)"""
10256 return _core_.MenuItem_SetAccel(*args, **kwargs)
10257
10258 def SetBitmap(*args, **kwargs):
10259 """SetBitmap(self, Bitmap bitmap)"""
10260 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10261
10262 def GetBitmap(*args, **kwargs):
10263 """GetBitmap(self) -> Bitmap"""
10264 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10265
10266 def SetFont(*args, **kwargs):
10267 """SetFont(self, Font font)"""
10268 return _core_.MenuItem_SetFont(*args, **kwargs)
10269
10270 def GetFont(*args, **kwargs):
10271 """GetFont(self) -> Font"""
10272 return _core_.MenuItem_GetFont(*args, **kwargs)
10273
10274 def SetTextColour(*args, **kwargs):
10275 """SetTextColour(self, Colour colText)"""
10276 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10277
10278 def GetTextColour(*args, **kwargs):
10279 """GetTextColour(self) -> Colour"""
10280 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10281
10282 def SetBackgroundColour(*args, **kwargs):
10283 """SetBackgroundColour(self, Colour colBack)"""
10284 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10285
10286 def GetBackgroundColour(*args, **kwargs):
10287 """GetBackgroundColour(self) -> Colour"""
10288 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10289
10290 def SetBitmaps(*args, **kwargs):
10291 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10292 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10293
10294 def SetDisabledBitmap(*args, **kwargs):
10295 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10296 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10297
10298 def GetDisabledBitmap(*args, **kwargs):
10299 """GetDisabledBitmap(self) -> Bitmap"""
10300 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10301
10302 def SetMarginWidth(*args, **kwargs):
10303 """SetMarginWidth(self, int nWidth)"""
10304 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10305
10306 def GetMarginWidth(*args, **kwargs):
10307 """GetMarginWidth(self) -> int"""
10308 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10309
10310 def GetDefaultMarginWidth(*args, **kwargs):
10311 """GetDefaultMarginWidth() -> int"""
10312 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10313
10314 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10315 def IsOwnerDrawn(*args, **kwargs):
10316 """IsOwnerDrawn(self) -> bool"""
10317 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10318
10319 def SetOwnerDrawn(*args, **kwargs):
10320 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10321 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10322
10323 def ResetOwnerDrawn(*args, **kwargs):
10324 """ResetOwnerDrawn(self)"""
10325 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10326
10327 _core_.MenuItem_swigregister(MenuItem)
10328
10329 def MenuItem_GetLabelFromText(*args, **kwargs):
10330 """MenuItem_GetLabelFromText(String text) -> String"""
10331 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10332
10333 def MenuItem_GetDefaultMarginWidth(*args):
10334 """MenuItem_GetDefaultMarginWidth() -> int"""
10335 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10336
10337 #---------------------------------------------------------------------------
10338
10339 class Control(Window):
10340 """
10341 This is the base class for a control or 'widget'.
10342
10343 A control is generally a small window which processes user input
10344 and/or displays one or more item of data.
10345 """
10346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10347 __repr__ = _swig_repr
10348 def __init__(self, *args, **kwargs):
10349 """
10350 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10351 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10352 String name=ControlNameStr) -> Control
10353
10354 Create a Control. Normally you should only call this from a subclass'
10355 __init__ as a plain old wx.Control is not very useful.
10356 """
10357 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10358 self._setOORInfo(self)
10359
10360 def Create(*args, **kwargs):
10361 """
10362 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10363 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10364 String name=ControlNameStr) -> bool
10365
10366 Do the 2nd phase and create the GUI control.
10367 """
10368 return _core_.Control_Create(*args, **kwargs)
10369
10370 def Command(*args, **kwargs):
10371 """
10372 Command(self, CommandEvent event)
10373
10374 Simulates the effect of the user issuing a command to the item.
10375
10376 :see: `wx.CommandEvent`
10377
10378 """
10379 return _core_.Control_Command(*args, **kwargs)
10380
10381 def GetLabel(*args, **kwargs):
10382 """
10383 GetLabel(self) -> String
10384
10385 Return a control's text.
10386 """
10387 return _core_.Control_GetLabel(*args, **kwargs)
10388
10389 def GetClassDefaultAttributes(*args, **kwargs):
10390 """
10391 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10392
10393 Get the default attributes for this class. This is useful if you want
10394 to use the same font or colour in your own control as in a standard
10395 control -- which is a much better idea than hard coding specific
10396 colours or fonts which might look completely out of place on the
10397 user's system, especially if it uses themes.
10398
10399 The variant parameter is only relevant under Mac currently and is
10400 ignore under other platforms. Under Mac, it will change the size of
10401 the returned font. See `wx.Window.SetWindowVariant` for more about
10402 this.
10403 """
10404 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10405
10406 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10407 _core_.Control_swigregister(Control)
10408 ControlNameStr = cvar.ControlNameStr
10409
10410 def PreControl(*args, **kwargs):
10411 """
10412 PreControl() -> Control
10413
10414 Precreate a Control control for 2-phase creation
10415 """
10416 val = _core_.new_PreControl(*args, **kwargs)
10417 return val
10418
10419 def Control_GetClassDefaultAttributes(*args, **kwargs):
10420 """
10421 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10422
10423 Get the default attributes for this class. This is useful if you want
10424 to use the same font or colour in your own control as in a standard
10425 control -- which is a much better idea than hard coding specific
10426 colours or fonts which might look completely out of place on the
10427 user's system, especially if it uses themes.
10428
10429 The variant parameter is only relevant under Mac currently and is
10430 ignore under other platforms. Under Mac, it will change the size of
10431 the returned font. See `wx.Window.SetWindowVariant` for more about
10432 this.
10433 """
10434 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10435
10436 #---------------------------------------------------------------------------
10437
10438 class ItemContainer(object):
10439 """
10440 The wx.ItemContainer class defines an interface which is implemented
10441 by all controls which have string subitems, each of which may be
10442 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10443 as `wx.ComboBox` which implements an extended interface deriving from
10444 this one.
10445
10446 It defines the methods for accessing the control's items and although
10447 each of the derived classes implements them differently, they still
10448 all conform to the same interface.
10449
10450 The items in a wx.ItemContainer have (non empty) string labels and,
10451 optionally, client data associated with them.
10452
10453 """
10454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10455 def __init__(self): raise AttributeError, "No constructor defined"
10456 __repr__ = _swig_repr
10457 def Append(*args, **kwargs):
10458 """
10459 Append(self, String item, PyObject clientData=None) -> int
10460
10461 Adds the item to the control, associating the given data with the item
10462 if not None. The return value is the index of the newly added item
10463 which may be different from the last one if the control is sorted (e.g.
10464 has wx.LB_SORT or wx.CB_SORT style).
10465 """
10466 return _core_.ItemContainer_Append(*args, **kwargs)
10467
10468 def AppendItems(*args, **kwargs):
10469 """
10470 AppendItems(self, List strings)
10471
10472 Apend several items at once to the control. Notice that calling this
10473 method may be much faster than appending the items one by one if you
10474 need to add a lot of items.
10475 """
10476 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10477
10478 def Insert(*args, **kwargs):
10479 """
10480 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10481
10482 Insert an item into the control before the item at the ``pos`` index,
10483 optionally associating some data object with the item.
10484 """
10485 return _core_.ItemContainer_Insert(*args, **kwargs)
10486
10487 def Clear(*args, **kwargs):
10488 """
10489 Clear(self)
10490
10491 Removes all items from the control.
10492 """
10493 return _core_.ItemContainer_Clear(*args, **kwargs)
10494
10495 def Delete(*args, **kwargs):
10496 """
10497 Delete(self, unsigned int n)
10498
10499 Deletes the item at the zero-based index 'n' from the control. Note
10500 that it is an error (signalled by a `wx.PyAssertionError` exception if
10501 enabled) to remove an item with the index negative or greater or equal
10502 than the number of items in the control.
10503 """
10504 return _core_.ItemContainer_Delete(*args, **kwargs)
10505
10506 def GetClientData(*args, **kwargs):
10507 """
10508 GetClientData(self, unsigned int n) -> PyObject
10509
10510 Returns the client data associated with the given item, (if any.)
10511 """
10512 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10513
10514 def SetClientData(*args, **kwargs):
10515 """
10516 SetClientData(self, unsigned int n, PyObject clientData)
10517
10518 Associate the given client data with the item at position n.
10519 """
10520 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10521
10522 def GetCount(*args, **kwargs):
10523 """
10524 GetCount(self) -> unsigned int
10525
10526 Returns the number of items in the control.
10527 """
10528 return _core_.ItemContainer_GetCount(*args, **kwargs)
10529
10530 def IsEmpty(*args, **kwargs):
10531 """
10532 IsEmpty(self) -> bool
10533
10534 Returns True if the control is empty or False if it has some items.
10535 """
10536 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10537
10538 def GetString(*args, **kwargs):
10539 """
10540 GetString(self, unsigned int n) -> String
10541
10542 Returns the label of the item with the given index.
10543 """
10544 return _core_.ItemContainer_GetString(*args, **kwargs)
10545
10546 def GetStrings(*args, **kwargs):
10547 """GetStrings(self) -> wxArrayString"""
10548 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10549
10550 def SetString(*args, **kwargs):
10551 """
10552 SetString(self, unsigned int n, String s)
10553
10554 Sets the label for the given item.
10555 """
10556 return _core_.ItemContainer_SetString(*args, **kwargs)
10557
10558 def FindString(*args, **kwargs):
10559 """
10560 FindString(self, String s) -> int
10561
10562 Finds an item whose label matches the given string. Returns the
10563 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10564 found.
10565 """
10566 return _core_.ItemContainer_FindString(*args, **kwargs)
10567
10568 def SetSelection(*args, **kwargs):
10569 """
10570 SetSelection(self, int n)
10571
10572 Sets the item at index 'n' to be the selected item.
10573 """
10574 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10575
10576 def GetSelection(*args, **kwargs):
10577 """
10578 GetSelection(self) -> int
10579
10580 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10581 is selected.
10582 """
10583 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10584
10585 def SetStringSelection(*args, **kwargs):
10586 """SetStringSelection(self, String s) -> bool"""
10587 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10588
10589 def GetStringSelection(*args, **kwargs):
10590 """
10591 GetStringSelection(self) -> String
10592
10593 Returns the label of the selected item or an empty string if no item
10594 is selected.
10595 """
10596 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10597
10598 def Select(*args, **kwargs):
10599 """
10600 Select(self, int n)
10601
10602 This is the same as `SetSelection` and exists only because it is
10603 slightly more natural for controls which support multiple selection.
10604 """
10605 return _core_.ItemContainer_Select(*args, **kwargs)
10606
10607 _core_.ItemContainer_swigregister(ItemContainer)
10608
10609 #---------------------------------------------------------------------------
10610
10611 class ControlWithItems(Control,ItemContainer):
10612 """
10613 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10614 wx.Control class, and is used for the base class of various controls
10615 that have items.
10616 """
10617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10618 def __init__(self): raise AttributeError, "No constructor defined"
10619 __repr__ = _swig_repr
10620 _core_.ControlWithItems_swigregister(ControlWithItems)
10621
10622 #---------------------------------------------------------------------------
10623
10624 class SizerItem(Object):
10625 """
10626 The wx.SizerItem class is used to track the position, size and other
10627 attributes of each item managed by a `wx.Sizer`. It is not usually
10628 necessary to use this class because the sizer elements can also be
10629 identified by their positions or window or sizer references but
10630 sometimes it may be more convenient to use wx.SizerItem directly.
10631 Also, custom classes derived from `wx.PySizer` will probably need to
10632 use the collection of wx.SizerItems held by wx.Sizer when calculating
10633 layout.
10634
10635 :see: `wx.Sizer`, `wx.GBSizerItem`
10636 """
10637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10638 __repr__ = _swig_repr
10639 def __init__(self, *args, **kwargs):
10640 """
10641 __init__(self) -> SizerItem
10642
10643 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10644 size will need to be set before this item can be used in a Sizer.
10645
10646 You will probably never need to create a wx.SizerItem directly as they
10647 are created automatically when the sizer's Add, Insert or Prepend
10648 methods are called.
10649
10650 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10651 """
10652 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10653 __swig_destroy__ = _core_.delete_SizerItem
10654 __del__ = lambda self : None;
10655 def DeleteWindows(*args, **kwargs):
10656 """
10657 DeleteWindows(self)
10658
10659 Destroy the window or the windows in a subsizer, depending on the type
10660 of item.
10661 """
10662 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10663
10664 def DetachSizer(*args, **kwargs):
10665 """
10666 DetachSizer(self)
10667
10668 Enable deleting the SizerItem without destroying the contained sizer.
10669 """
10670 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10671
10672 def GetSize(*args, **kwargs):
10673 """
10674 GetSize(self) -> Size
10675
10676 Get the current size of the item, as set in the last Layout.
10677 """
10678 return _core_.SizerItem_GetSize(*args, **kwargs)
10679
10680 def CalcMin(*args, **kwargs):
10681 """
10682 CalcMin(self) -> Size
10683
10684 Calculates the minimum desired size for the item, including any space
10685 needed by borders.
10686 """
10687 return _core_.SizerItem_CalcMin(*args, **kwargs)
10688
10689 def SetDimension(*args, **kwargs):
10690 """
10691 SetDimension(self, Point pos, Size size)
10692
10693 Set the position and size of the space allocated for this item by the
10694 sizer, and adjust the position and size of the item (window or
10695 subsizer) to be within that space taking alignment and borders into
10696 account.
10697 """
10698 return _core_.SizerItem_SetDimension(*args, **kwargs)
10699
10700 def GetMinSize(*args, **kwargs):
10701 """
10702 GetMinSize(self) -> Size
10703
10704 Get the minimum size needed for the item.
10705 """
10706 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10707
10708 def GetMinSizeWithBorder(*args, **kwargs):
10709 """
10710 GetMinSizeWithBorder(self) -> Size
10711
10712 Get the minimum size needed for the item with space for the borders
10713 added, if needed.
10714 """
10715 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10716
10717 def SetInitSize(*args, **kwargs):
10718 """SetInitSize(self, int x, int y)"""
10719 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10720
10721 def SetRatioWH(*args, **kwargs):
10722 """
10723 SetRatioWH(self, int width, int height)
10724
10725 Set the ratio item attribute.
10726 """
10727 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10728
10729 def SetRatioSize(*args, **kwargs):
10730 """
10731 SetRatioSize(self, Size size)
10732
10733 Set the ratio item attribute.
10734 """
10735 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10736
10737 def SetRatio(*args, **kwargs):
10738 """
10739 SetRatio(self, float ratio)
10740
10741 Set the ratio item attribute.
10742 """
10743 return _core_.SizerItem_SetRatio(*args, **kwargs)
10744
10745 def GetRatio(*args, **kwargs):
10746 """
10747 GetRatio(self) -> float
10748
10749 Set the ratio item attribute.
10750 """
10751 return _core_.SizerItem_GetRatio(*args, **kwargs)
10752
10753 def GetRect(*args, **kwargs):
10754 """
10755 GetRect(self) -> Rect
10756
10757 Returns the rectangle that the sizer item should occupy
10758 """
10759 return _core_.SizerItem_GetRect(*args, **kwargs)
10760
10761 def IsWindow(*args, **kwargs):
10762 """
10763 IsWindow(self) -> bool
10764
10765 Is this sizer item a window?
10766 """
10767 return _core_.SizerItem_IsWindow(*args, **kwargs)
10768
10769 def IsSizer(*args, **kwargs):
10770 """
10771 IsSizer(self) -> bool
10772
10773 Is this sizer item a subsizer?
10774 """
10775 return _core_.SizerItem_IsSizer(*args, **kwargs)
10776
10777 def IsSpacer(*args, **kwargs):
10778 """
10779 IsSpacer(self) -> bool
10780
10781 Is this sizer item a spacer?
10782 """
10783 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10784
10785 def SetProportion(*args, **kwargs):
10786 """
10787 SetProportion(self, int proportion)
10788
10789 Set the proportion value for this item.
10790 """
10791 return _core_.SizerItem_SetProportion(*args, **kwargs)
10792
10793 def GetProportion(*args, **kwargs):
10794 """
10795 GetProportion(self) -> int
10796
10797 Get the proportion value for this item.
10798 """
10799 return _core_.SizerItem_GetProportion(*args, **kwargs)
10800
10801 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10802 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10803 def SetFlag(*args, **kwargs):
10804 """
10805 SetFlag(self, int flag)
10806
10807 Set the flag value for this item.
10808 """
10809 return _core_.SizerItem_SetFlag(*args, **kwargs)
10810
10811 def GetFlag(*args, **kwargs):
10812 """
10813 GetFlag(self) -> int
10814
10815 Get the flag value for this item.
10816 """
10817 return _core_.SizerItem_GetFlag(*args, **kwargs)
10818
10819 def SetBorder(*args, **kwargs):
10820 """
10821 SetBorder(self, int border)
10822
10823 Set the border value for this item.
10824 """
10825 return _core_.SizerItem_SetBorder(*args, **kwargs)
10826
10827 def GetBorder(*args, **kwargs):
10828 """
10829 GetBorder(self) -> int
10830
10831 Get the border value for this item.
10832 """
10833 return _core_.SizerItem_GetBorder(*args, **kwargs)
10834
10835 def GetWindow(*args, **kwargs):
10836 """
10837 GetWindow(self) -> Window
10838
10839 Get the window (if any) that is managed by this sizer item.
10840 """
10841 return _core_.SizerItem_GetWindow(*args, **kwargs)
10842
10843 def SetWindow(*args, **kwargs):
10844 """
10845 SetWindow(self, Window window)
10846
10847 Set the window to be managed by this sizer item.
10848 """
10849 return _core_.SizerItem_SetWindow(*args, **kwargs)
10850
10851 def GetSizer(*args, **kwargs):
10852 """
10853 GetSizer(self) -> Sizer
10854
10855 Get the subsizer (if any) that is managed by this sizer item.
10856 """
10857 return _core_.SizerItem_GetSizer(*args, **kwargs)
10858
10859 def SetSizer(*args, **kwargs):
10860 """
10861 SetSizer(self, Sizer sizer)
10862
10863 Set the subsizer to be managed by this sizer item.
10864 """
10865 return _core_.SizerItem_SetSizer(*args, **kwargs)
10866
10867 def GetSpacer(*args, **kwargs):
10868 """
10869 GetSpacer(self) -> Size
10870
10871 Get the size of the spacer managed by this sizer item.
10872 """
10873 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10874
10875 def SetSpacer(*args, **kwargs):
10876 """
10877 SetSpacer(self, Size size)
10878
10879 Set the size of the spacer to be managed by this sizer item.
10880 """
10881 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10882
10883 def Show(*args, **kwargs):
10884 """
10885 Show(self, bool show)
10886
10887 Set the show item attribute, which sizers use to determine if the item
10888 is to be made part of the layout or not. If the item is tracking a
10889 window then it is shown or hidden as needed.
10890 """
10891 return _core_.SizerItem_Show(*args, **kwargs)
10892
10893 def IsShown(*args, **kwargs):
10894 """
10895 IsShown(self) -> bool
10896
10897 Is the item to be shown in the layout?
10898 """
10899 return _core_.SizerItem_IsShown(*args, **kwargs)
10900
10901 def GetPosition(*args, **kwargs):
10902 """
10903 GetPosition(self) -> Point
10904
10905 Returns the current position of the item, as set in the last Layout.
10906 """
10907 return _core_.SizerItem_GetPosition(*args, **kwargs)
10908
10909 def GetUserData(*args, **kwargs):
10910 """
10911 GetUserData(self) -> PyObject
10912
10913 Returns the userData associated with this sizer item, or None if there
10914 isn't any.
10915 """
10916 return _core_.SizerItem_GetUserData(*args, **kwargs)
10917
10918 def SetUserData(*args, **kwargs):
10919 """
10920 SetUserData(self, PyObject userData)
10921
10922 Associate a Python object with this sizer item.
10923 """
10924 return _core_.SizerItem_SetUserData(*args, **kwargs)
10925
10926 _core_.SizerItem_swigregister(SizerItem)
10927
10928 def SizerItemWindow(*args, **kwargs):
10929 """
10930 SizerItemWindow(Window window, int proportion, int flag, int border,
10931 PyObject userData=None) -> SizerItem
10932
10933 Constructs a `wx.SizerItem` for tracking a window.
10934 """
10935 val = _core_.new_SizerItemWindow(*args, **kwargs)
10936 return val
10937
10938 def SizerItemSpacer(*args, **kwargs):
10939 """
10940 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10941 PyObject userData=None) -> SizerItem
10942
10943 Constructs a `wx.SizerItem` for tracking a spacer.
10944 """
10945 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10946 return val
10947
10948 def SizerItemSizer(*args, **kwargs):
10949 """
10950 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10951 PyObject userData=None) -> SizerItem
10952
10953 Constructs a `wx.SizerItem` for tracking a subsizer
10954 """
10955 val = _core_.new_SizerItemSizer(*args, **kwargs)
10956 return val
10957
10958 class Sizer(Object):
10959 """
10960 wx.Sizer is the abstract base class used for laying out subwindows in
10961 a window. You cannot use wx.Sizer directly; instead, you will have to
10962 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10963 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10964 and `wx.GridBagSizer`.
10965
10966 The concept implemented by sizers in wxWidgets is closely related to
10967 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10968 toolkit or the Qt toolkit. It is based upon the idea of the individual
10969 subwindows reporting their minimal required size and their ability to
10970 get stretched if the size of the parent window has changed. This will
10971 most often mean that the programmer does not set the original size of
10972 a dialog in the beginning, rather the dialog will assigned a sizer and
10973 this sizer will be queried about the recommended size. The sizer in
10974 turn will query its children, which can be normal windows or contorls,
10975 empty space or other sizers, so that a hierarchy of sizers can be
10976 constructed. Note that wxSizer does not derive from wxWindow and thus
10977 do not interfere with tab ordering and requires very little resources
10978 compared to a real window on screen.
10979
10980 What makes sizers so well fitted for use in wxWidgets is the fact that
10981 every control reports its own minimal size and the algorithm can
10982 handle differences in font sizes or different window (dialog item)
10983 sizes on different platforms without problems. If for example the
10984 standard font as well as the overall design of Mac widgets requires
10985 more space than on Windows, then the initial size of a dialog using a
10986 sizer will automatically be bigger on Mac than on Windows.
10987 """
10988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10989 def __init__(self): raise AttributeError, "No constructor defined"
10990 __repr__ = _swig_repr
10991 __swig_destroy__ = _core_.delete_Sizer
10992 __del__ = lambda self : None;
10993 def _setOORInfo(*args, **kwargs):
10994 """_setOORInfo(self, PyObject _self)"""
10995 return _core_.Sizer__setOORInfo(*args, **kwargs)
10996
10997 def Add(*args, **kwargs):
10998 """
10999 Add(self, item, int proportion=0, int flag=0, int border=0,
11000 PyObject userData=None) -> wx.SizerItem
11001
11002 Appends a child item to the sizer.
11003 """
11004 return _core_.Sizer_Add(*args, **kwargs)
11005
11006 def Insert(*args, **kwargs):
11007 """
11008 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11009 PyObject userData=None) -> wx.SizerItem
11010
11011 Inserts a new item into the list of items managed by this sizer before
11012 the item at index *before*. See `Add` for a description of the parameters.
11013 """
11014 return _core_.Sizer_Insert(*args, **kwargs)
11015
11016 def Prepend(*args, **kwargs):
11017 """
11018 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11019 PyObject userData=None) -> wx.SizerItem
11020
11021 Adds a new item to the begining of the list of sizer items managed by
11022 this sizer. See `Add` for a description of the parameters.
11023 """
11024 return _core_.Sizer_Prepend(*args, **kwargs)
11025
11026 def Remove(*args, **kwargs):
11027 """
11028 Remove(self, item) -> bool
11029
11030 Removes an item from the sizer and destroys it. This method does not
11031 cause any layout or resizing to take place, call `Layout` to update
11032 the layout on screen after removing a child from the sizer. The
11033 *item* parameter can be either a window, a sizer, or the zero-based
11034 index of an item to remove. Returns True if the child item was found
11035 and removed.
11036 """
11037 return _core_.Sizer_Remove(*args, **kwargs)
11038
11039 def Detach(*args, **kwargs):
11040 """
11041 Detach(self, item) -> bool
11042
11043 Detaches an item from the sizer without destroying it. This method
11044 does not cause any layout or resizing to take place, call `Layout` to
11045 do so. The *item* parameter can be either a window, a sizer, or the
11046 zero-based index of the item to be detached. Returns True if the child item
11047 was found and detached.
11048 """
11049 return _core_.Sizer_Detach(*args, **kwargs)
11050
11051 def GetItem(*args, **kwargs):
11052 """
11053 GetItem(self, item) -> wx.SizerItem
11054
11055 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11056 parameter can be either a window, a sizer, or the zero-based index of
11057 the item to be found.
11058 """
11059 return _core_.Sizer_GetItem(*args, **kwargs)
11060
11061 def _SetItemMinSize(*args, **kwargs):
11062 """_SetItemMinSize(self, PyObject item, Size size)"""
11063 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11064
11065 def SetItemMinSize(self, item, *args):
11066 """
11067 SetItemMinSize(self, item, Size size)
11068
11069 Sets the minimum size that will be allocated for an item in the sizer.
11070 The *item* parameter can be either a window, a sizer, or the
11071 zero-based index of the item. If a window or sizer is given then it
11072 will be searched for recursivly in subsizers if neccessary.
11073 """
11074 if len(args) == 2:
11075 # for backward compatibility accept separate width,height args too
11076 return self._SetItemMinSize(item, args)
11077 else:
11078 return self._SetItemMinSize(item, args[0])
11079
11080 def AddItem(*args, **kwargs):
11081 """
11082 AddItem(self, SizerItem item)
11083
11084 Adds a `wx.SizerItem` to the sizer.
11085 """
11086 return _core_.Sizer_AddItem(*args, **kwargs)
11087
11088 def InsertItem(*args, **kwargs):
11089 """
11090 InsertItem(self, int index, SizerItem item)
11091
11092 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11093 """
11094 return _core_.Sizer_InsertItem(*args, **kwargs)
11095
11096 def PrependItem(*args, **kwargs):
11097 """
11098 PrependItem(self, SizerItem item)
11099
11100 Prepends a `wx.SizerItem` to the sizer.
11101 """
11102 return _core_.Sizer_PrependItem(*args, **kwargs)
11103
11104 def AddMany(self, items):
11105 """
11106 AddMany is a convenience method for adding several items
11107 to a sizer at one time. Simply pass it a list of tuples,
11108 where each tuple consists of the parameters that you
11109 would normally pass to the `Add` method.
11110 """
11111 for item in items:
11112 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11113 item = (item, )
11114 self.Add(*item)
11115
11116 # for backwards compatibility only, please do not use in new code
11117 def AddWindow(self, *args, **kw):
11118 """Compatibility alias for `Add`."""
11119 return self.Add(*args, **kw)
11120 def AddSizer(self, *args, **kw):
11121 """Compatibility alias for `Add`."""
11122 return self.Add(*args, **kw)
11123 def AddSpacer(self, *args, **kw):
11124 """Compatibility alias for `Add`."""
11125 return self.Add(*args, **kw)
11126
11127 def PrependWindow(self, *args, **kw):
11128 """Compatibility alias for `Prepend`."""
11129 return self.Prepend(*args, **kw)
11130 def PrependSizer(self, *args, **kw):
11131 """Compatibility alias for `Prepend`."""
11132 return self.Prepend(*args, **kw)
11133 def PrependSpacer(self, *args, **kw):
11134 """Compatibility alias for `Prepend`."""
11135 return self.Prepend(*args, **kw)
11136
11137 def InsertWindow(self, *args, **kw):
11138 """Compatibility alias for `Insert`."""
11139 return self.Insert(*args, **kw)
11140 def InsertSizer(self, *args, **kw):
11141 """Compatibility alias for `Insert`."""
11142 return self.Insert(*args, **kw)
11143 def InsertSpacer(self, *args, **kw):
11144 """Compatibility alias for `Insert`."""
11145 return self.Insert(*args, **kw)
11146
11147 def RemoveWindow(self, *args, **kw):
11148 """Compatibility alias for `Remove`."""
11149 return self.Remove(*args, **kw)
11150 def RemoveSizer(self, *args, **kw):
11151 """Compatibility alias for `Remove`."""
11152 return self.Remove(*args, **kw)
11153 def RemovePos(self, *args, **kw):
11154 """Compatibility alias for `Remove`."""
11155 return self.Remove(*args, **kw)
11156
11157
11158 def SetDimension(*args, **kwargs):
11159 """
11160 SetDimension(self, int x, int y, int width, int height)
11161
11162 Call this to force the sizer to take the given dimension and thus
11163 force the items owned by the sizer to resize themselves according to
11164 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11165 methods.
11166 """
11167 return _core_.Sizer_SetDimension(*args, **kwargs)
11168
11169 def SetMinSize(*args, **kwargs):
11170 """
11171 SetMinSize(self, Size size)
11172
11173 Call this to give the sizer a minimal size. Normally, the sizer will
11174 calculate its minimal size based purely on how much space its children
11175 need. After calling this method `GetMinSize` will return either the
11176 minimal size as requested by its children or the minimal size set
11177 here, depending on which is bigger.
11178 """
11179 return _core_.Sizer_SetMinSize(*args, **kwargs)
11180
11181 def GetSize(*args, **kwargs):
11182 """
11183 GetSize(self) -> Size
11184
11185 Returns the current size of the space managed by the sizer.
11186 """
11187 return _core_.Sizer_GetSize(*args, **kwargs)
11188
11189 def GetPosition(*args, **kwargs):
11190 """
11191 GetPosition(self) -> Point
11192
11193 Returns the current position of the sizer's managed space.
11194 """
11195 return _core_.Sizer_GetPosition(*args, **kwargs)
11196
11197 def GetMinSize(*args, **kwargs):
11198 """
11199 GetMinSize(self) -> Size
11200
11201 Returns the minimal size of the sizer. This is either the combined
11202 minimal size of all the children and their borders or the minimal size
11203 set by SetMinSize, depending on which is bigger.
11204 """
11205 return _core_.Sizer_GetMinSize(*args, **kwargs)
11206
11207 def GetSizeTuple(self):
11208 return self.GetSize().Get()
11209 def GetPositionTuple(self):
11210 return self.GetPosition().Get()
11211 def GetMinSizeTuple(self):
11212 return self.GetMinSize().Get()
11213
11214 def RecalcSizes(*args, **kwargs):
11215 """
11216 RecalcSizes(self)
11217
11218 Using the sizes calculated by `CalcMin` reposition and resize all the
11219 items managed by this sizer. You should not need to call this directly as
11220 it is called by `Layout`.
11221 """
11222 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11223
11224 def CalcMin(*args, **kwargs):
11225 """
11226 CalcMin(self) -> Size
11227
11228 This method is where the sizer will do the actual calculation of its
11229 children's minimal sizes. You should not need to call this directly as
11230 it is called by `Layout`.
11231 """
11232 return _core_.Sizer_CalcMin(*args, **kwargs)
11233
11234 def Layout(*args, **kwargs):
11235 """
11236 Layout(self)
11237
11238 This method will force the recalculation and layout of the items
11239 controlled by the sizer using the current space allocated to the
11240 sizer. Normally this is called automatically from the owning window's
11241 EVT_SIZE handler, but it is also useful to call it from user code when
11242 one of the items in a sizer change size, or items are added or
11243 removed.
11244 """
11245 return _core_.Sizer_Layout(*args, **kwargs)
11246
11247 def Fit(*args, **kwargs):
11248 """
11249 Fit(self, Window window) -> Size
11250
11251 Tell the sizer to resize the *window* to match the sizer's minimal
11252 size. This is commonly done in the constructor of the window itself in
11253 order to set its initial size to match the needs of the children as
11254 determined by the sizer. Returns the new size.
11255
11256 For a top level window this is the total window size, not the client size.
11257 """
11258 return _core_.Sizer_Fit(*args, **kwargs)
11259
11260 def FitInside(*args, **kwargs):
11261 """
11262 FitInside(self, Window window)
11263
11264 Tell the sizer to resize the *virtual size* of the *window* to match the
11265 sizer's minimal size. This will not alter the on screen size of the
11266 window, but may cause the addition/removal/alteration of scrollbars
11267 required to view the virtual area in windows which manage it.
11268
11269 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11270
11271 """
11272 return _core_.Sizer_FitInside(*args, **kwargs)
11273
11274 def SetSizeHints(*args, **kwargs):
11275 """
11276 SetSizeHints(self, Window window)
11277
11278 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11279 match the sizer's minimal size. This is commonly done in the
11280 constructor of the window itself if the window is resizable (as are
11281 many dialogs under Unix and frames on probably all platforms) in order
11282 to prevent the window from being sized smaller than the minimal size
11283 required by the sizer.
11284 """
11285 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11286
11287 def SetVirtualSizeHints(*args, **kwargs):
11288 """
11289 SetVirtualSizeHints(self, Window window)
11290
11291 Tell the sizer to set the minimal size of the window virtual area to
11292 match the sizer's minimal size. For windows with managed scrollbars
11293 this will set them appropriately.
11294
11295 :see: `wx.ScrolledWindow.SetScrollbars`
11296
11297 """
11298 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11299
11300 def Clear(*args, **kwargs):
11301 """
11302 Clear(self, bool deleteWindows=False)
11303
11304 Clear all items from the sizer, optionally destroying the window items
11305 as well.
11306 """
11307 return _core_.Sizer_Clear(*args, **kwargs)
11308
11309 def DeleteWindows(*args, **kwargs):
11310 """
11311 DeleteWindows(self)
11312
11313 Destroy all windows managed by the sizer.
11314 """
11315 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11316
11317 def GetChildren(*args, **kwargs):
11318 """
11319 GetChildren(self) -> list
11320
11321 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11322 """
11323 return _core_.Sizer_GetChildren(*args, **kwargs)
11324
11325 def Show(*args, **kwargs):
11326 """
11327 Show(self, item, bool show=True, bool recursive=false) -> bool
11328
11329 Shows or hides an item managed by the sizer. To make a sizer item
11330 disappear or reappear, use Show followed by `Layout`. The *item*
11331 parameter can be either a window, a sizer, or the zero-based index of
11332 the item. Use the recursive parameter to show or hide an item in a
11333 subsizer. Returns True if the item was found.
11334 """
11335 return _core_.Sizer_Show(*args, **kwargs)
11336
11337 def IsShown(*args, **kwargs):
11338 """
11339 IsShown(self, item)
11340
11341 Determines if the item is currently shown. To make a sizer
11342 item disappear or reappear, use Show followed by `Layout`. The *item*
11343 parameter can be either a window, a sizer, or the zero-based index of
11344 the item.
11345 """
11346 return _core_.Sizer_IsShown(*args, **kwargs)
11347
11348 def Hide(self, item, recursive=False):
11349 """
11350 A convenience method for `Show` (item, False, recursive).
11351 """
11352 return self.Show(item, False, recursive)
11353
11354 def ShowItems(*args, **kwargs):
11355 """
11356 ShowItems(self, bool show)
11357
11358 Recursively call `wx.SizerItem.Show` on all sizer items.
11359 """
11360 return _core_.Sizer_ShowItems(*args, **kwargs)
11361
11362 _core_.Sizer_swigregister(Sizer)
11363
11364 class PySizer(Sizer):
11365 """
11366 wx.PySizer is a special version of `wx.Sizer` that has been
11367 instrumented to allow the C++ virtual methods to be overloaded in
11368 Python derived classes. You would derive from this class if you are
11369 wanting to implement a custom sizer in Python code. Simply implement
11370 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11371 For example::
11372
11373 class MySizer(wx.PySizer):
11374 def __init__(self):
11375 wx.PySizer.__init__(self)
11376
11377 def CalcMin(self):
11378 for item in self.GetChildren():
11379 # calculate the total minimum width and height needed
11380 # by all items in the sizer according to this sizer's
11381 # layout algorithm.
11382 ...
11383 return wx.Size(width, height)
11384
11385 def RecalcSizes(self):
11386 # find the space allotted to this sizer
11387 pos = self.GetPosition()
11388 size = self.GetSize()
11389 for item in self.GetChildren():
11390 # Recalculate (if necessary) the position and size of
11391 # each item and then call item.SetDimension to do the
11392 # actual positioning and sizing of the items within the
11393 # space alloted to this sizer.
11394 ...
11395 item.SetDimension(itemPos, itemSize)
11396
11397
11398 When `Layout` is called it first calls `CalcMin` followed by
11399 `RecalcSizes` so you can optimize a bit by saving the results of
11400 `CalcMin` and reusing them in `RecalcSizes`.
11401
11402 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11403
11404
11405 """
11406 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11407 __repr__ = _swig_repr
11408 def __init__(self, *args, **kwargs):
11409 """
11410 __init__(self) -> PySizer
11411
11412 Creates a wx.PySizer. Must be called from the __init__ in the derived
11413 class.
11414 """
11415 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11416 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11417
11418 def _setCallbackInfo(*args, **kwargs):
11419 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11420 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11421
11422 _core_.PySizer_swigregister(PySizer)
11423
11424 #---------------------------------------------------------------------------
11425
11426 class BoxSizer(Sizer):
11427 """
11428 The basic idea behind a box sizer is that windows will most often be
11429 laid out in rather simple basic geometry, typically in a row or a
11430 column or nested hierarchies of either. A wx.BoxSizer will lay out
11431 its items in a simple row or column, depending on the orientation
11432 parameter passed to the constructor.
11433 """
11434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11435 __repr__ = _swig_repr
11436 def __init__(self, *args, **kwargs):
11437 """
11438 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11439
11440 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11441 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11442 sizer.
11443 """
11444 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11445 self._setOORInfo(self)
11446
11447 def GetOrientation(*args, **kwargs):
11448 """
11449 GetOrientation(self) -> int
11450
11451 Returns the current orientation of the sizer.
11452 """
11453 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11454
11455 def SetOrientation(*args, **kwargs):
11456 """
11457 SetOrientation(self, int orient)
11458
11459 Resets the orientation of the sizer.
11460 """
11461 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11462
11463 _core_.BoxSizer_swigregister(BoxSizer)
11464
11465 #---------------------------------------------------------------------------
11466
11467 class StaticBoxSizer(BoxSizer):
11468 """
11469 wx.StaticBoxSizer derives from and functions identically to the
11470 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11471 manages. Note that this static box must be created separately and
11472 passed to the sizer constructor.
11473 """
11474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11475 __repr__ = _swig_repr
11476 def __init__(self, *args, **kwargs):
11477 """
11478 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11479
11480 Constructor. It takes an associated static box and the orientation
11481 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11482 ``wx.HORIZONTAL``.
11483 """
11484 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11485 self._setOORInfo(self)
11486
11487 def GetStaticBox(*args, **kwargs):
11488 """
11489 GetStaticBox(self) -> StaticBox
11490
11491 Returns the static box associated with this sizer.
11492 """
11493 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11494
11495 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11496
11497 #---------------------------------------------------------------------------
11498
11499 class GridSizer(Sizer):
11500 """
11501 A grid sizer is a sizer which lays out its children in a
11502 two-dimensional table with all cells having the same size. In other
11503 words, the width of each cell within the grid is the width of the
11504 widest item added to the sizer and the height of each grid cell is the
11505 height of the tallest item. An optional vertical and/or horizontal
11506 gap between items can also be specified (in pixels.)
11507
11508 Items are placed in the cells of the grid in the order they are added,
11509 in row-major order. In other words, the first row is filled first,
11510 then the second, and so on until all items have been added. (If
11511 neccessary, additional rows will be added as items are added.) If you
11512 need to have greater control over the cells that items are placed in
11513 then use the `wx.GridBagSizer`.
11514
11515 """
11516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11517 __repr__ = _swig_repr
11518 def __init__(self, *args, **kwargs):
11519 """
11520 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11521
11522 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11523 of columns and rows in the sizer - if either of the parameters is
11524 zero, it will be calculated to from the total number of children in
11525 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11526 define extra space between all children.
11527 """
11528 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11529 self._setOORInfo(self)
11530
11531 def SetCols(*args, **kwargs):
11532 """
11533 SetCols(self, int cols)
11534
11535 Sets the number of columns in the sizer.
11536 """
11537 return _core_.GridSizer_SetCols(*args, **kwargs)
11538
11539 def SetRows(*args, **kwargs):
11540 """
11541 SetRows(self, int rows)
11542
11543 Sets the number of rows in the sizer.
11544 """
11545 return _core_.GridSizer_SetRows(*args, **kwargs)
11546
11547 def SetVGap(*args, **kwargs):
11548 """
11549 SetVGap(self, int gap)
11550
11551 Sets the vertical gap (in pixels) between the cells in the sizer.
11552 """
11553 return _core_.GridSizer_SetVGap(*args, **kwargs)
11554
11555 def SetHGap(*args, **kwargs):
11556 """
11557 SetHGap(self, int gap)
11558
11559 Sets the horizontal gap (in pixels) between cells in the sizer
11560 """
11561 return _core_.GridSizer_SetHGap(*args, **kwargs)
11562
11563 def GetCols(*args, **kwargs):
11564 """
11565 GetCols(self) -> int
11566
11567 Returns the number of columns in the sizer.
11568 """
11569 return _core_.GridSizer_GetCols(*args, **kwargs)
11570
11571 def GetRows(*args, **kwargs):
11572 """
11573 GetRows(self) -> int
11574
11575 Returns the number of rows in the sizer.
11576 """
11577 return _core_.GridSizer_GetRows(*args, **kwargs)
11578
11579 def GetVGap(*args, **kwargs):
11580 """
11581 GetVGap(self) -> int
11582
11583 Returns the vertical gap (in pixels) between the cells in the sizer.
11584 """
11585 return _core_.GridSizer_GetVGap(*args, **kwargs)
11586
11587 def GetHGap(*args, **kwargs):
11588 """
11589 GetHGap(self) -> int
11590
11591 Returns the horizontal gap (in pixels) between cells in the sizer.
11592 """
11593 return _core_.GridSizer_GetHGap(*args, **kwargs)
11594
11595 def CalcRowsCols(self):
11596 """
11597 CalcRowsCols() -> (rows, cols)
11598
11599 Calculates how many rows and columns will be in the sizer based
11600 on the current number of items and also the rows, cols specified
11601 in the constructor.
11602 """
11603 nitems = len(self.GetChildren())
11604 rows = self.GetRows()
11605 cols = self.GetCols()
11606 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11607 if cols != 0:
11608 rows = (nitems + cols - 1) / cols
11609 elif rows != 0:
11610 cols = (nitems + rows - 1) / rows
11611 return (rows, cols)
11612
11613 _core_.GridSizer_swigregister(GridSizer)
11614
11615 #---------------------------------------------------------------------------
11616
11617 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11618 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11619 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11620 class FlexGridSizer(GridSizer):
11621 """
11622 A flex grid sizer is a sizer which lays out its children in a
11623 two-dimensional table with all table cells in one row having the same
11624 height and all cells in one column having the same width, but all
11625 rows or all columns are not necessarily the same height or width as in
11626 the `wx.GridSizer`.
11627
11628 wx.FlexGridSizer can also size items equally in one direction but
11629 unequally ("flexibly") in the other. If the sizer is only flexible
11630 in one direction (this can be changed using `SetFlexibleDirection`), it
11631 needs to be decided how the sizer should grow in the other ("non
11632 flexible") direction in order to fill the available space. The
11633 `SetNonFlexibleGrowMode` method serves this purpose.
11634
11635
11636 """
11637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11638 __repr__ = _swig_repr
11639 def __init__(self, *args, **kwargs):
11640 """
11641 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11642
11643 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11644 number of columns and rows in the sizer - if either of the parameters
11645 is zero, it will be calculated to from the total number of children in
11646 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11647 define extra space between all children.
11648 """
11649 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11650 self._setOORInfo(self)
11651
11652 def AddGrowableRow(*args, **kwargs):
11653 """
11654 AddGrowableRow(self, size_t idx, int proportion=0)
11655
11656 Specifies that row *idx* (starting from zero) should be grown if there
11657 is extra space available to the sizer.
11658
11659 The *proportion* parameter has the same meaning as the stretch factor
11660 for the box sizers except that if all proportions are 0, then all
11661 columns are resized equally (instead of not being resized at all).
11662 """
11663 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11664
11665 def RemoveGrowableRow(*args, **kwargs):
11666 """
11667 RemoveGrowableRow(self, size_t idx)
11668
11669 Specifies that row *idx* is no longer growable.
11670 """
11671 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11672
11673 def AddGrowableCol(*args, **kwargs):
11674 """
11675 AddGrowableCol(self, size_t idx, int proportion=0)
11676
11677 Specifies that column *idx* (starting from zero) should be grown if
11678 there is extra space available to the sizer.
11679
11680 The *proportion* parameter has the same meaning as the stretch factor
11681 for the box sizers except that if all proportions are 0, then all
11682 columns are resized equally (instead of not being resized at all).
11683 """
11684 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11685
11686 def RemoveGrowableCol(*args, **kwargs):
11687 """
11688 RemoveGrowableCol(self, size_t idx)
11689
11690 Specifies that column *idx* is no longer growable.
11691 """
11692 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11693
11694 def SetFlexibleDirection(*args, **kwargs):
11695 """
11696 SetFlexibleDirection(self, int direction)
11697
11698 Specifies whether the sizer should flexibly resize its columns, rows,
11699 or both. Argument *direction* can be one of the following values. Any
11700 other value is ignored.
11701
11702 ============== =======================================
11703 wx.VERTICAL Rows are flexibly sized.
11704 wx.HORIZONTAL Columns are flexibly sized.
11705 wx.BOTH Both rows and columns are flexibly sized
11706 (this is the default value).
11707 ============== =======================================
11708
11709 Note that this method does not trigger relayout.
11710
11711 """
11712 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11713
11714 def GetFlexibleDirection(*args, **kwargs):
11715 """
11716 GetFlexibleDirection(self) -> int
11717
11718 Returns a value that specifies whether the sizer
11719 flexibly resizes its columns, rows, or both (default).
11720
11721 :see: `SetFlexibleDirection`
11722 """
11723 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11724
11725 def SetNonFlexibleGrowMode(*args, **kwargs):
11726 """
11727 SetNonFlexibleGrowMode(self, int mode)
11728
11729 Specifies how the sizer should grow in the non-flexible direction if
11730 there is one (so `SetFlexibleDirection` must have been called
11731 previously). Argument *mode* can be one of the following values:
11732
11733 ========================== =================================================
11734 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11735 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11736 `AddGrowableCol` and `AddGrowableRow`. In this
11737 case equal sizing applies to minimum sizes of
11738 columns or rows (this is the default value).
11739 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11740 the non flexible direction, whether they are
11741 growable or not in the flexbile direction.
11742 ========================== =================================================
11743
11744 Note that this method does not trigger relayout.
11745
11746
11747 """
11748 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11749
11750 def GetNonFlexibleGrowMode(*args, **kwargs):
11751 """
11752 GetNonFlexibleGrowMode(self) -> int
11753
11754 Returns the value that specifies how the sizer grows in the
11755 non-flexible direction if there is one.
11756
11757 :see: `SetNonFlexibleGrowMode`
11758 """
11759 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11760
11761 def GetRowHeights(*args, **kwargs):
11762 """
11763 GetRowHeights(self) -> list
11764
11765 Returns a list of integers representing the heights of each of the
11766 rows in the sizer.
11767 """
11768 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11769
11770 def GetColWidths(*args, **kwargs):
11771 """
11772 GetColWidths(self) -> list
11773
11774 Returns a list of integers representing the widths of each of the
11775 columns in the sizer.
11776 """
11777 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11778
11779 _core_.FlexGridSizer_swigregister(FlexGridSizer)
11780
11781 class StdDialogButtonSizer(BoxSizer):
11782 """
11783 A special sizer that knows how to order and position standard buttons
11784 in order to conform to the current platform's standards. You simply
11785 need to add each `wx.Button` to the sizer, and be sure to create the
11786 buttons using the standard ID's. Then call `Realize` and the sizer
11787 will take care of the rest.
11788
11789 """
11790 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11791 __repr__ = _swig_repr
11792 def __init__(self, *args, **kwargs):
11793 """__init__(self) -> StdDialogButtonSizer"""
11794 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11795 def AddButton(*args, **kwargs):
11796 """
11797 AddButton(self, wxButton button)
11798
11799 Use this to add the buttons to this sizer. Do not use the `Add`
11800 method in the base class.
11801 """
11802 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11803
11804 def Realize(*args, **kwargs):
11805 """
11806 Realize(self)
11807
11808 This funciton needs to be called after all the buttons have been added
11809 to the sizer. It will reorder them and position them in a platform
11810 specifc manner.
11811 """
11812 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11813
11814 def SetAffirmativeButton(*args, **kwargs):
11815 """SetAffirmativeButton(self, wxButton button)"""
11816 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11817
11818 def SetNegativeButton(*args, **kwargs):
11819 """SetNegativeButton(self, wxButton button)"""
11820 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11821
11822 def SetCancelButton(*args, **kwargs):
11823 """SetCancelButton(self, wxButton button)"""
11824 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11825
11826 def GetAffirmativeButton(*args, **kwargs):
11827 """GetAffirmativeButton(self) -> wxButton"""
11828 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11829
11830 def GetApplyButton(*args, **kwargs):
11831 """GetApplyButton(self) -> wxButton"""
11832 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11833
11834 def GetNegativeButton(*args, **kwargs):
11835 """GetNegativeButton(self) -> wxButton"""
11836 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11837
11838 def GetCancelButton(*args, **kwargs):
11839 """GetCancelButton(self) -> wxButton"""
11840 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11841
11842 def GetHelpButton(*args, **kwargs):
11843 """GetHelpButton(self) -> wxButton"""
11844 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11845
11846 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11847
11848 #---------------------------------------------------------------------------
11849
11850 class GBPosition(object):
11851 """
11852 This class represents the position of an item in a virtual grid of
11853 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11854 typemaps that will automatically convert from a 2-element sequence of
11855 integers to a wx.GBPosition, so you can use the more pythonic
11856 representation of the position nearly transparently in Python code.
11857 """
11858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11859 __repr__ = _swig_repr
11860 def __init__(self, *args, **kwargs):
11861 """
11862 __init__(self, int row=0, int col=0) -> GBPosition
11863
11864 This class represents the position of an item in a virtual grid of
11865 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11866 typemaps that will automatically convert from a 2-element sequence of
11867 integers to a wx.GBPosition, so you can use the more pythonic
11868 representation of the position nearly transparently in Python code.
11869 """
11870 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11871 __swig_destroy__ = _core_.delete_GBPosition
11872 __del__ = lambda self : None;
11873 def GetRow(*args, **kwargs):
11874 """GetRow(self) -> int"""
11875 return _core_.GBPosition_GetRow(*args, **kwargs)
11876
11877 def GetCol(*args, **kwargs):
11878 """GetCol(self) -> int"""
11879 return _core_.GBPosition_GetCol(*args, **kwargs)
11880
11881 def SetRow(*args, **kwargs):
11882 """SetRow(self, int row)"""
11883 return _core_.GBPosition_SetRow(*args, **kwargs)
11884
11885 def SetCol(*args, **kwargs):
11886 """SetCol(self, int col)"""
11887 return _core_.GBPosition_SetCol(*args, **kwargs)
11888
11889 def __eq__(*args, **kwargs):
11890 """
11891 __eq__(self, PyObject other) -> bool
11892
11893 Compare GBPosition for equality.
11894 """
11895 return _core_.GBPosition___eq__(*args, **kwargs)
11896
11897 def __ne__(*args, **kwargs):
11898 """
11899 __ne__(self, PyObject other) -> bool
11900
11901 Compare GBPosition for inequality.
11902 """
11903 return _core_.GBPosition___ne__(*args, **kwargs)
11904
11905 def Set(*args, **kwargs):
11906 """Set(self, int row=0, int col=0)"""
11907 return _core_.GBPosition_Set(*args, **kwargs)
11908
11909 def Get(*args, **kwargs):
11910 """Get(self) -> PyObject"""
11911 return _core_.GBPosition_Get(*args, **kwargs)
11912
11913 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11914 def __str__(self): return str(self.Get())
11915 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11916 def __len__(self): return len(self.Get())
11917 def __getitem__(self, index): return self.Get()[index]
11918 def __setitem__(self, index, val):
11919 if index == 0: self.SetRow(val)
11920 elif index == 1: self.SetCol(val)
11921 else: raise IndexError
11922 def __nonzero__(self): return self.Get() != (0,0)
11923 __safe_for_unpickling__ = True
11924 def __reduce__(self): return (wx.GBPosition, self.Get())
11925
11926 row = property(GetRow, SetRow)
11927 col = property(GetCol, SetCol)
11928
11929 _core_.GBPosition_swigregister(GBPosition)
11930
11931 class GBSpan(object):
11932 """
11933 This class is used to hold the row and column spanning attributes of
11934 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11935 automatically convert from a 2-element sequence of integers to a
11936 wx.GBSpan, so you can use the more pythonic representation of the span
11937 nearly transparently in Python code.
11938
11939 """
11940 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11941 __repr__ = _swig_repr
11942 def __init__(self, *args, **kwargs):
11943 """
11944 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11945
11946 Construct a new wxGBSpan, optionally setting the rowspan and
11947 colspan. The default is (1,1). (Meaning that the item occupies one
11948 cell in each direction.
11949 """
11950 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11951 __swig_destroy__ = _core_.delete_GBSpan
11952 __del__ = lambda self : None;
11953 def GetRowspan(*args, **kwargs):
11954 """GetRowspan(self) -> int"""
11955 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11956
11957 def GetColspan(*args, **kwargs):
11958 """GetColspan(self) -> int"""
11959 return _core_.GBSpan_GetColspan(*args, **kwargs)
11960
11961 def SetRowspan(*args, **kwargs):
11962 """SetRowspan(self, int rowspan)"""
11963 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11964
11965 def SetColspan(*args, **kwargs):
11966 """SetColspan(self, int colspan)"""
11967 return _core_.GBSpan_SetColspan(*args, **kwargs)
11968
11969 def __eq__(*args, **kwargs):
11970 """
11971 __eq__(self, PyObject other) -> bool
11972
11973 Compare wxGBSpan for equality.
11974 """
11975 return _core_.GBSpan___eq__(*args, **kwargs)
11976
11977 def __ne__(*args, **kwargs):
11978 """
11979 __ne__(self, PyObject other) -> bool
11980
11981 Compare GBSpan for inequality.
11982 """
11983 return _core_.GBSpan___ne__(*args, **kwargs)
11984
11985 def Set(*args, **kwargs):
11986 """Set(self, int rowspan=1, int colspan=1)"""
11987 return _core_.GBSpan_Set(*args, **kwargs)
11988
11989 def Get(*args, **kwargs):
11990 """Get(self) -> PyObject"""
11991 return _core_.GBSpan_Get(*args, **kwargs)
11992
11993 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11994 def __str__(self): return str(self.Get())
11995 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11996 def __len__(self): return len(self.Get())
11997 def __getitem__(self, index): return self.Get()[index]
11998 def __setitem__(self, index, val):
11999 if index == 0: self.SetRowspan(val)
12000 elif index == 1: self.SetColspan(val)
12001 else: raise IndexError
12002 def __nonzero__(self): return self.Get() != (0,0)
12003 __safe_for_unpickling__ = True
12004 def __reduce__(self): return (wx.GBSpan, self.Get())
12005
12006 rowspan = property(GetRowspan, SetRowspan)
12007 colspan = property(GetColspan, SetColspan)
12008
12009 _core_.GBSpan_swigregister(GBSpan)
12010
12011 class GBSizerItem(SizerItem):
12012 """
12013 The wx.GBSizerItem class is used to track the additional data about
12014 items in a `wx.GridBagSizer` such as the item's position in the grid
12015 and how many rows or columns it spans.
12016
12017 """
12018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12019 __repr__ = _swig_repr
12020 def __init__(self, *args, **kwargs):
12021 """
12022 __init__(self) -> GBSizerItem
12023
12024 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12025 size will need to be set, as well as a position and span before this
12026 item can be used in a Sizer.
12027
12028 You will probably never need to create a wx.GBSizerItem directly as they
12029 are created automatically when the sizer's Add method is called.
12030 """
12031 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12032 __swig_destroy__ = _core_.delete_GBSizerItem
12033 __del__ = lambda self : None;
12034 def GetPos(*args, **kwargs):
12035 """
12036 GetPos(self) -> GBPosition
12037
12038 Get the grid position of the item
12039 """
12040 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12041
12042 def GetPosTuple(self): return self.GetPos().Get()
12043 def GetSpan(*args, **kwargs):
12044 """
12045 GetSpan(self) -> GBSpan
12046
12047 Get the row and column spanning of the item
12048 """
12049 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12050
12051 def GetSpanTuple(self): return self.GetSpan().Get()
12052 def SetPos(*args, **kwargs):
12053 """
12054 SetPos(self, GBPosition pos) -> bool
12055
12056 If the item is already a member of a sizer then first ensure that
12057 there is no other item that would intersect with this one at the new
12058 position, then set the new position. Returns True if the change is
12059 successful and after the next Layout() the item will be moved.
12060 """
12061 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12062
12063 def SetSpan(*args, **kwargs):
12064 """
12065 SetSpan(self, GBSpan span) -> bool
12066
12067 If the item is already a member of a sizer then first ensure that
12068 there is no other item that would intersect with this one with its new
12069 spanning size, then set the new spanning. Returns True if the change
12070 is successful and after the next Layout() the item will be resized.
12071
12072 """
12073 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12074
12075 def Intersects(*args, **kwargs):
12076 """
12077 Intersects(self, GBSizerItem other) -> bool
12078
12079 Returns True if this item and the other item instersect.
12080 """
12081 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12082
12083 def IntersectsPos(*args, **kwargs):
12084 """
12085 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12086
12087 Returns True if the given pos/span would intersect with this item.
12088 """
12089 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12090
12091 def GetEndPos(*args, **kwargs):
12092 """
12093 GetEndPos(self) -> GBPosition
12094
12095 Get the row and column of the endpoint of this item.
12096 """
12097 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12098
12099 def GetGBSizer(*args, **kwargs):
12100 """
12101 GetGBSizer(self) -> GridBagSizer
12102
12103 Get the sizer this item is a member of.
12104 """
12105 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12106
12107 def SetGBSizer(*args, **kwargs):
12108 """
12109 SetGBSizer(self, GridBagSizer sizer)
12110
12111 Set the sizer this item is a member of.
12112 """
12113 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12114
12115 _core_.GBSizerItem_swigregister(GBSizerItem)
12116 DefaultSpan = cvar.DefaultSpan
12117
12118 def GBSizerItemWindow(*args, **kwargs):
12119 """
12120 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12121 int border, PyObject userData=None) -> GBSizerItem
12122
12123 Construct a `wx.GBSizerItem` for a window.
12124 """
12125 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12126 return val
12127
12128 def GBSizerItemSizer(*args, **kwargs):
12129 """
12130 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12131 int border, PyObject userData=None) -> GBSizerItem
12132
12133 Construct a `wx.GBSizerItem` for a sizer
12134 """
12135 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12136 return val
12137
12138 def GBSizerItemSpacer(*args, **kwargs):
12139 """
12140 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12141 int flag, int border, PyObject userData=None) -> GBSizerItem
12142
12143 Construct a `wx.GBSizerItem` for a spacer.
12144 """
12145 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12146 return val
12147
12148 class GridBagSizer(FlexGridSizer):
12149 """
12150 A `wx.Sizer` that can lay out items in a virtual grid like a
12151 `wx.FlexGridSizer` but in this case explicit positioning of the items
12152 is allowed using `wx.GBPosition`, and items can optionally span more
12153 than one row and/or column using `wx.GBSpan`. The total size of the
12154 virtual grid is determined by the largest row and column that items are
12155 positioned at, adjusted for spanning.
12156
12157 """
12158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12159 __repr__ = _swig_repr
12160 def __init__(self, *args, **kwargs):
12161 """
12162 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12163
12164 Constructor, with optional parameters to specify the gap between the
12165 rows and columns.
12166 """
12167 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12168 self._setOORInfo(self)
12169
12170 def Add(*args, **kwargs):
12171 """
12172 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12173 int border=0, userData=None) -> wx.GBSizerItem
12174
12175 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12176 more than one row or column as specified with *span*. The remaining
12177 args behave similarly to `wx.Sizer.Add`.
12178
12179 Returns True if the item was successfully placed at the given cell
12180 position, False if something was already there.
12181
12182 """
12183 return _core_.GridBagSizer_Add(*args, **kwargs)
12184
12185 def AddItem(*args, **kwargs):
12186 """
12187 Add(self, GBSizerItem item) -> wx.GBSizerItem
12188
12189 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12190 the item was successfully placed at its given cell position, False if
12191 something was already there.
12192 """
12193 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12194
12195 def GetCellSize(*args, **kwargs):
12196 """
12197 GetCellSize(self, int row, int col) -> Size
12198
12199 Get the size of the specified cell, including hgap and
12200 vgap. Only valid after a Layout.
12201 """
12202 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12203
12204 def GetEmptyCellSize(*args, **kwargs):
12205 """
12206 GetEmptyCellSize(self) -> Size
12207
12208 Get the size used for cells in the grid with no item.
12209 """
12210 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12211
12212 def SetEmptyCellSize(*args, **kwargs):
12213 """
12214 SetEmptyCellSize(self, Size sz)
12215
12216 Set the size used for cells in the grid with no item.
12217 """
12218 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12219
12220 def GetItemPosition(*args):
12221 """
12222 GetItemPosition(self, item) -> GBPosition
12223
12224 Get the grid position of the specified *item* where *item* is either a
12225 window or subsizer that is a member of this sizer, or a zero-based
12226 index of an item.
12227 """
12228 return _core_.GridBagSizer_GetItemPosition(*args)
12229
12230 def SetItemPosition(*args):
12231 """
12232 SetItemPosition(self, item, GBPosition pos) -> bool
12233
12234 Set the grid position of the specified *item* where *item* is either a
12235 window or subsizer that is a member of this sizer, or a zero-based
12236 index of an item. Returns True on success. If the move is not
12237 allowed (because an item is already there) then False is returned.
12238
12239 """
12240 return _core_.GridBagSizer_SetItemPosition(*args)
12241
12242 def GetItemSpan(*args):
12243 """
12244 GetItemSpan(self, item) -> GBSpan
12245
12246 Get the row/col spanning of the specified *item* where *item* is
12247 either a window or subsizer that is a member of this sizer, or a
12248 zero-based index of an item.
12249 """
12250 return _core_.GridBagSizer_GetItemSpan(*args)
12251
12252 def SetItemSpan(*args):
12253 """
12254 SetItemSpan(self, item, GBSpan span) -> bool
12255
12256 Set the row/col spanning of the specified *item* where *item* is
12257 either a window or subsizer that is a member of this sizer, or a
12258 zero-based index of an item. Returns True on success. If the move is
12259 not allowed (because an item is already there) then False is returned.
12260 """
12261 return _core_.GridBagSizer_SetItemSpan(*args)
12262
12263 def FindItem(*args):
12264 """
12265 FindItem(self, item) -> GBSizerItem
12266
12267 Find the sizer item for the given window or subsizer, returns None if
12268 not found. (non-recursive)
12269 """
12270 return _core_.GridBagSizer_FindItem(*args)
12271
12272 def FindItemAtPosition(*args, **kwargs):
12273 """
12274 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12275
12276 Return the sizer item for the given grid cell, or None if there is no
12277 item at that position. (non-recursive)
12278 """
12279 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12280
12281 def FindItemAtPoint(*args, **kwargs):
12282 """
12283 FindItemAtPoint(self, Point pt) -> GBSizerItem
12284
12285 Return the sizer item located at the point given in *pt*, or None if
12286 there is no item at that point. The (x,y) coordinates in pt correspond
12287 to the client coordinates of the window using the sizer for
12288 layout. (non-recursive)
12289 """
12290 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12291
12292 def CheckForIntersection(*args, **kwargs):
12293 """
12294 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12295
12296 Look at all items and see if any intersect (or would overlap) the
12297 given *item*. Returns True if so, False if there would be no overlap.
12298 If an *excludeItem* is given then it will not be checked for
12299 intersection, for example it may be the item we are checking the
12300 position of.
12301
12302 """
12303 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12304
12305 def CheckForIntersectionPos(*args, **kwargs):
12306 """
12307 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12308
12309 Look at all items and see if any intersect (or would overlap) the
12310 given position and span. Returns True if so, False if there would be
12311 no overlap. If an *excludeItem* is given then it will not be checked
12312 for intersection, for example it may be the item we are checking the
12313 position of.
12314 """
12315 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12316
12317 _core_.GridBagSizer_swigregister(GridBagSizer)
12318
12319 #---------------------------------------------------------------------------
12320
12321 Left = _core_.Left
12322 Top = _core_.Top
12323 Right = _core_.Right
12324 Bottom = _core_.Bottom
12325 Width = _core_.Width
12326 Height = _core_.Height
12327 Centre = _core_.Centre
12328 Center = _core_.Center
12329 CentreX = _core_.CentreX
12330 CentreY = _core_.CentreY
12331 Unconstrained = _core_.Unconstrained
12332 AsIs = _core_.AsIs
12333 PercentOf = _core_.PercentOf
12334 Above = _core_.Above
12335 Below = _core_.Below
12336 LeftOf = _core_.LeftOf
12337 RightOf = _core_.RightOf
12338 SameAs = _core_.SameAs
12339 Absolute = _core_.Absolute
12340 class IndividualLayoutConstraint(Object):
12341 """
12342 Objects of this class are stored in the `wx.LayoutConstraints` class as
12343 one of eight possible constraints that a window can be involved in.
12344 You will never need to create an instance of
12345 wx.IndividualLayoutConstraint, rather you should create a
12346 `wx.LayoutConstraints` instance and use the individual contstraints
12347 that it contains.
12348 """
12349 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12350 def __init__(self): raise AttributeError, "No constructor defined"
12351 __repr__ = _swig_repr
12352 def Set(*args, **kwargs):
12353 """
12354 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12355
12356 Sets the properties of the constraint. Normally called by one of the
12357 convenience functions such as Above, RightOf, SameAs.
12358 """
12359 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12360
12361 def LeftOf(*args, **kwargs):
12362 """
12363 LeftOf(self, Window sibling, int marg=0)
12364
12365 Constrains this edge to be to the left of the given window, with an
12366 optional margin. Implicitly, this is relative to the left edge of the
12367 other window.
12368 """
12369 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12370
12371 def RightOf(*args, **kwargs):
12372 """
12373 RightOf(self, Window sibling, int marg=0)
12374
12375 Constrains this edge to be to the right of the given window, with an
12376 optional margin. Implicitly, this is relative to the right edge of the
12377 other window.
12378 """
12379 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12380
12381 def Above(*args, **kwargs):
12382 """
12383 Above(self, Window sibling, int marg=0)
12384
12385 Constrains this edge to be above the given window, with an optional
12386 margin. Implicitly, this is relative to the top edge of the other
12387 window.
12388 """
12389 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12390
12391 def Below(*args, **kwargs):
12392 """
12393 Below(self, Window sibling, int marg=0)
12394
12395 Constrains this edge to be below the given window, with an optional
12396 margin. Implicitly, this is relative to the bottom edge of the other
12397 window.
12398 """
12399 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12400
12401 def SameAs(*args, **kwargs):
12402 """
12403 SameAs(self, Window otherW, int edge, int marg=0)
12404
12405 Constrains this edge or dimension to be to the same as the edge of the
12406 given window, with an optional margin.
12407 """
12408 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12409
12410 def PercentOf(*args, **kwargs):
12411 """
12412 PercentOf(self, Window otherW, int wh, int per)
12413
12414 Constrains this edge or dimension to be to a percentage of the given
12415 window, with an optional margin.
12416 """
12417 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12418
12419 def Absolute(*args, **kwargs):
12420 """
12421 Absolute(self, int val)
12422
12423 Constrains this edge or dimension to be the given absolute value.
12424 """
12425 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12426
12427 def Unconstrained(*args, **kwargs):
12428 """
12429 Unconstrained(self)
12430
12431 Sets this edge or dimension to be unconstrained, that is, dependent on
12432 other edges and dimensions from which this value can be deduced.
12433 """
12434 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12435
12436 def AsIs(*args, **kwargs):
12437 """
12438 AsIs(self)
12439
12440 Sets this edge or constraint to be whatever the window's value is at
12441 the moment. If either of the width and height constraints are *as is*,
12442 the window will not be resized, but moved instead. This is important
12443 when considering panel items which are intended to have a default
12444 size, such as a button, which may take its size from the size of the
12445 button label.
12446 """
12447 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12448
12449 def GetOtherWindow(*args, **kwargs):
12450 """GetOtherWindow(self) -> Window"""
12451 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12452
12453 def GetMyEdge(*args, **kwargs):
12454 """GetMyEdge(self) -> int"""
12455 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12456
12457 def SetEdge(*args, **kwargs):
12458 """SetEdge(self, int which)"""
12459 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12460
12461 def SetValue(*args, **kwargs):
12462 """SetValue(self, int v)"""
12463 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12464
12465 def GetMargin(*args, **kwargs):
12466 """GetMargin(self) -> int"""
12467 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12468
12469 def SetMargin(*args, **kwargs):
12470 """SetMargin(self, int m)"""
12471 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12472
12473 def GetValue(*args, **kwargs):
12474 """GetValue(self) -> int"""
12475 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12476
12477 def GetPercent(*args, **kwargs):
12478 """GetPercent(self) -> int"""
12479 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12480
12481 def GetOtherEdge(*args, **kwargs):
12482 """GetOtherEdge(self) -> int"""
12483 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12484
12485 def GetDone(*args, **kwargs):
12486 """GetDone(self) -> bool"""
12487 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12488
12489 def SetDone(*args, **kwargs):
12490 """SetDone(self, bool d)"""
12491 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12492
12493 def GetRelationship(*args, **kwargs):
12494 """GetRelationship(self) -> int"""
12495 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12496
12497 def SetRelationship(*args, **kwargs):
12498 """SetRelationship(self, int r)"""
12499 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12500
12501 def ResetIfWin(*args, **kwargs):
12502 """
12503 ResetIfWin(self, Window otherW) -> bool
12504
12505 Reset constraint if it mentions otherWin
12506 """
12507 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12508
12509 def SatisfyConstraint(*args, **kwargs):
12510 """
12511 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12512
12513 Try to satisfy constraint
12514 """
12515 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12516
12517 def GetEdge(*args, **kwargs):
12518 """
12519 GetEdge(self, int which, Window thisWin, Window other) -> int
12520
12521 Get the value of this edge or dimension, or if this
12522 is not determinable, -1.
12523 """
12524 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12525
12526 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12527
12528 class LayoutConstraints(Object):
12529 """
12530 **Note:** constraints are now deprecated and you should use sizers
12531 instead.
12532
12533 Objects of this class can be associated with a window to define its
12534 layout constraints, with respect to siblings or its parent.
12535
12536 The class consists of the following eight constraints of class
12537 wx.IndividualLayoutConstraint, some or all of which should be accessed
12538 directly to set the appropriate constraints.
12539
12540 * left: represents the left hand edge of the window
12541 * right: represents the right hand edge of the window
12542 * top: represents the top edge of the window
12543 * bottom: represents the bottom edge of the window
12544 * width: represents the width of the window
12545 * height: represents the height of the window
12546 * centreX: represents the horizontal centre point of the window
12547 * centreY: represents the vertical centre point of the window
12548
12549 Most constraints are initially set to have the relationship
12550 wxUnconstrained, which means that their values should be calculated by
12551 looking at known constraints. The exceptions are width and height,
12552 which are set to wxAsIs to ensure that if the user does not specify a
12553 constraint, the existing width and height will be used, to be
12554 compatible with panel items which often have take a default size. If
12555 the constraint is ``wx.AsIs``, the dimension will not be changed.
12556
12557 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12558
12559 """
12560 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12561 __repr__ = _swig_repr
12562 left = property(_core_.LayoutConstraints_left_get)
12563 top = property(_core_.LayoutConstraints_top_get)
12564 right = property(_core_.LayoutConstraints_right_get)
12565 bottom = property(_core_.LayoutConstraints_bottom_get)
12566 width = property(_core_.LayoutConstraints_width_get)
12567 height = property(_core_.LayoutConstraints_height_get)
12568 centreX = property(_core_.LayoutConstraints_centreX_get)
12569 centreY = property(_core_.LayoutConstraints_centreY_get)
12570 def __init__(self, *args, **kwargs):
12571 """__init__(self) -> LayoutConstraints"""
12572 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12573 __swig_destroy__ = _core_.delete_LayoutConstraints
12574 __del__ = lambda self : None;
12575 def SatisfyConstraints(*args, **kwargs):
12576 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12577 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12578
12579 def AreSatisfied(*args, **kwargs):
12580 """AreSatisfied(self) -> bool"""
12581 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12582
12583 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12584
12585 #----------------------------------------------------------------------------
12586
12587 # Use Python's bool constants if available, make some if not
12588 try:
12589 True
12590 except NameError:
12591 __builtins__.True = 1==1
12592 __builtins__.False = 1==0
12593 def bool(value): return not not value
12594 __builtins__.bool = bool
12595
12596
12597
12598 # workarounds for bad wxRTTI names
12599 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12600 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12601 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12602
12603
12604 #----------------------------------------------------------------------------
12605 # Load version numbers from __version__... Ensure that major and minor
12606 # versions are the same for both wxPython and wxWidgets.
12607
12608 from __version__ import *
12609 __version__ = VERSION_STRING
12610
12611 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12612 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12613 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12614 import warnings
12615 warnings.warn("wxPython/wxWidgets release number mismatch")
12616
12617 #----------------------------------------------------------------------------
12618
12619 # Set wxPython's default string<-->unicode conversion encoding from
12620 # the locale, but only if Python's default hasn't been changed. (We
12621 # assume that if the user has customized it already then that is the
12622 # encoding we need to use as well.)
12623 #
12624 # The encoding selected here is used when string or unicode objects
12625 # need to be converted in order to pass them to wxWidgets. Please be
12626 # aware that the default encoding within the same locale may be
12627 # slightly different on different platforms. For example, please see
12628 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12629 # between the common latin/roman encodings.
12630
12631 default = _sys.getdefaultencoding()
12632 if default == 'ascii':
12633 import locale
12634 import codecs
12635 try:
12636 default = locale.getdefaultlocale()[1]
12637 codecs.lookup(default)
12638 except (ValueError, LookupError, TypeError):
12639 default = _sys.getdefaultencoding()
12640 del locale
12641 del codecs
12642 if default:
12643 wx.SetDefaultPyEncoding(default)
12644 del default
12645
12646 #----------------------------------------------------------------------------
12647
12648 class PyDeadObjectError(AttributeError):
12649 pass
12650
12651 class _wxPyDeadObject(object):
12652 """
12653 Instances of wx objects that are OOR capable will have their __class__
12654 changed to this class when the C++ object is deleted. This should help
12655 prevent crashes due to referencing a bogus C++ pointer.
12656 """
12657 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12658 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12659
12660 def __repr__(self):
12661 if not hasattr(self, "_name"):
12662 self._name = "[unknown]"
12663 return self.reprStr % self._name
12664
12665 def __getattr__(self, *args):
12666 if not hasattr(self, "_name"):
12667 self._name = "[unknown]"
12668 raise PyDeadObjectError(self.attrStr % self._name)
12669
12670 def __nonzero__(self):
12671 return 0
12672
12673
12674
12675 class PyUnbornObjectError(AttributeError):
12676 pass
12677
12678 class _wxPyUnbornObject(object):
12679 """
12680 Some stock objects are created when the wx._core module is
12681 imported, but their C++ instance is not created until the wx.App
12682 object is created and initialized. These object instances will
12683 temporarily have their __class__ changed to this class so an
12684 exception will be raised if they are used before the C++ instance
12685 is ready.
12686 """
12687
12688 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12689 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12690
12691 def __repr__(self):
12692 #if not hasattr(self, "_name"):
12693 # self._name = "[unknown]"
12694 return self.reprStr #% self._name
12695
12696 def __getattr__(self, *args):
12697 #if not hasattr(self, "_name"):
12698 # self._name = "[unknown]"
12699 raise PyUnbornObjectError(self.attrStr) # % self._name )
12700
12701 def __nonzero__(self):
12702 return 0
12703
12704
12705 #----------------------------------------------------------------------------
12706
12707 def CallAfter(callable, *args, **kw):
12708 """
12709 Call the specified function after the current and pending event
12710 handlers have been completed. This is also good for making GUI
12711 method calls from non-GUI threads. Any extra positional or
12712 keyword args are passed on to the callable when it is called.
12713
12714 :see: `wx.FutureCall`
12715 """
12716 app = wx.GetApp()
12717 assert app is not None, 'No wx.App created yet'
12718
12719 if not hasattr(app, "_CallAfterId"):
12720 app._CallAfterId = wx.NewEventType()
12721 app.Connect(-1, -1, app._CallAfterId,
12722 lambda event: event.callable(*event.args, **event.kw) )
12723 evt = wx.PyEvent()
12724 evt.SetEventType(app._CallAfterId)
12725 evt.callable = callable
12726 evt.args = args
12727 evt.kw = kw
12728 wx.PostEvent(app, evt)
12729
12730 #----------------------------------------------------------------------------
12731
12732
12733 class FutureCall:
12734 """
12735 A convenience class for `wx.Timer`, that calls the given callable
12736 object once after the given amount of milliseconds, passing any
12737 positional or keyword args. The return value of the callable is
12738 availbale after it has been run with the `GetResult` method.
12739
12740 If you don't need to get the return value or restart the timer
12741 then there is no need to hold a reference to this object. It will
12742 hold a reference to itself while the timer is running (the timer
12743 has a reference to self.Notify) but the cycle will be broken when
12744 the timer completes, automatically cleaning up the wx.FutureCall
12745 object.
12746
12747 :see: `wx.CallAfter`
12748 """
12749 def __init__(self, millis, callable, *args, **kwargs):
12750 self.millis = millis
12751 self.callable = callable
12752 self.SetArgs(*args, **kwargs)
12753 self.runCount = 0
12754 self.running = False
12755 self.hasRun = False
12756 self.result = None
12757 self.timer = None
12758 self.Start()
12759
12760 def __del__(self):
12761 self.Stop()
12762
12763
12764 def Start(self, millis=None, *args, **kwargs):
12765 """
12766 (Re)start the timer
12767 """
12768 self.hasRun = False
12769 if millis is not None:
12770 self.millis = millis
12771 if args or kwargs:
12772 self.SetArgs(*args, **kwargs)
12773 self.Stop()
12774 self.timer = wx.PyTimer(self.Notify)
12775 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12776 self.running = True
12777 Restart = Start
12778
12779
12780 def Stop(self):
12781 """
12782 Stop and destroy the timer.
12783 """
12784 if self.timer is not None:
12785 self.timer.Stop()
12786 self.timer = None
12787
12788
12789 def GetInterval(self):
12790 if self.timer is not None:
12791 return self.timer.GetInterval()
12792 else:
12793 return 0
12794
12795
12796 def IsRunning(self):
12797 return self.timer is not None and self.timer.IsRunning()
12798
12799
12800 def SetArgs(self, *args, **kwargs):
12801 """
12802 (Re)set the args passed to the callable object. This is
12803 useful in conjunction with Restart if you want to schedule a
12804 new call to the same callable object but with different
12805 parameters.
12806 """
12807 self.args = args
12808 self.kwargs = kwargs
12809
12810
12811 def HasRun(self):
12812 return self.hasRun
12813
12814 def GetResult(self):
12815 return self.result
12816
12817 def Notify(self):
12818 """
12819 The timer has expired so call the callable.
12820 """
12821 if self.callable and getattr(self.callable, 'im_self', True):
12822 self.runCount += 1
12823 self.running = False
12824 self.result = self.callable(*self.args, **self.kwargs)
12825 self.hasRun = True
12826 if not self.running:
12827 # if it wasn't restarted, then cleanup
12828 wx.CallAfter(self.Stop)
12829
12830
12831
12832 #----------------------------------------------------------------------------
12833 # Control which items in this module should be documented by epydoc.
12834 # We allow only classes and functions, which will help reduce the size
12835 # of the docs by filtering out the zillions of constants, EVT objects,
12836 # and etc that don't make much sense by themselves, but are instead
12837 # documented (or will be) as part of the classes/functions/methods
12838 # where they should be used.
12839
12840 class __DocFilter:
12841 """
12842 A filter for epydoc that only allows non-Ptr classes and
12843 fucntions, in order to reduce the clutter in the API docs.
12844 """
12845 def __init__(self, globals):
12846 self._globals = globals
12847
12848 def __call__(self, name):
12849 import types
12850 obj = self._globals.get(name, None)
12851 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12852 return False
12853 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12854 return False
12855 return True
12856
12857 #----------------------------------------------------------------------------
12858 #----------------------------------------------------------------------------
12859
12860 # Import other modules in this package that should show up in the
12861 # "core" wx namespace
12862 from _gdi import *
12863 from _windows import *
12864 from _controls import *
12865 from _misc import *
12866
12867 #----------------------------------------------------------------------------
12868 #----------------------------------------------------------------------------
12869
12870
12871