]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
Compilation fix for Mac
[wxWidgets.git] / wxPython / src / msw / _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 OnPaint(*args, **kwargs):
9183 """OnPaint(self, PaintEvent event)"""
9184 return _core_.Window_OnPaint(*args, **kwargs)
9185
9186 def HasScrollbar(*args, **kwargs):
9187 """
9188 HasScrollbar(self, int orient) -> bool
9189
9190 Does the window have the scrollbar for this orientation?
9191 """
9192 return _core_.Window_HasScrollbar(*args, **kwargs)
9193
9194 def SetScrollbar(*args, **kwargs):
9195 """
9196 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9197 bool refresh=True)
9198
9199 Sets the scrollbar properties of a built-in scrollbar.
9200 """
9201 return _core_.Window_SetScrollbar(*args, **kwargs)
9202
9203 def SetScrollPos(*args, **kwargs):
9204 """
9205 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9206
9207 Sets the position of one of the built-in scrollbars.
9208 """
9209 return _core_.Window_SetScrollPos(*args, **kwargs)
9210
9211 def GetScrollPos(*args, **kwargs):
9212 """
9213 GetScrollPos(self, int orientation) -> int
9214
9215 Returns the built-in scrollbar position.
9216 """
9217 return _core_.Window_GetScrollPos(*args, **kwargs)
9218
9219 def GetScrollThumb(*args, **kwargs):
9220 """
9221 GetScrollThumb(self, int orientation) -> int
9222
9223 Returns the built-in scrollbar thumb size.
9224 """
9225 return _core_.Window_GetScrollThumb(*args, **kwargs)
9226
9227 def GetScrollRange(*args, **kwargs):
9228 """
9229 GetScrollRange(self, int orientation) -> int
9230
9231 Returns the built-in scrollbar range.
9232 """
9233 return _core_.Window_GetScrollRange(*args, **kwargs)
9234
9235 def ScrollWindow(*args, **kwargs):
9236 """
9237 ScrollWindow(self, int dx, int dy, Rect rect=None)
9238
9239 Physically scrolls the pixels in the window and move child windows
9240 accordingly. Use this function to optimise your scrolling
9241 implementations, to minimise the area that must be redrawn. Note that
9242 it is rarely required to call this function from a user program.
9243 """
9244 return _core_.Window_ScrollWindow(*args, **kwargs)
9245
9246 def ScrollLines(*args, **kwargs):
9247 """
9248 ScrollLines(self, int lines) -> bool
9249
9250 If the platform and window class supports it, scrolls the window by
9251 the given number of lines down, if lines is positive, or up if lines
9252 is negative. Returns True if the window was scrolled, False if it was
9253 already on top/bottom and nothing was done.
9254 """
9255 return _core_.Window_ScrollLines(*args, **kwargs)
9256
9257 def ScrollPages(*args, **kwargs):
9258 """
9259 ScrollPages(self, int pages) -> bool
9260
9261 If the platform and window class supports it, scrolls the window by
9262 the given number of pages down, if pages is positive, or up if pages
9263 is negative. Returns True if the window was scrolled, False if it was
9264 already on top/bottom and nothing was done.
9265 """
9266 return _core_.Window_ScrollPages(*args, **kwargs)
9267
9268 def LineUp(*args, **kwargs):
9269 """
9270 LineUp(self) -> bool
9271
9272 This is just a wrapper for ScrollLines(-1).
9273 """
9274 return _core_.Window_LineUp(*args, **kwargs)
9275
9276 def LineDown(*args, **kwargs):
9277 """
9278 LineDown(self) -> bool
9279
9280 This is just a wrapper for ScrollLines(1).
9281 """
9282 return _core_.Window_LineDown(*args, **kwargs)
9283
9284 def PageUp(*args, **kwargs):
9285 """
9286 PageUp(self) -> bool
9287
9288 This is just a wrapper for ScrollPages(-1).
9289 """
9290 return _core_.Window_PageUp(*args, **kwargs)
9291
9292 def PageDown(*args, **kwargs):
9293 """
9294 PageDown(self) -> bool
9295
9296 This is just a wrapper for ScrollPages(1).
9297 """
9298 return _core_.Window_PageDown(*args, **kwargs)
9299
9300 def SetHelpText(*args, **kwargs):
9301 """
9302 SetHelpText(self, String text)
9303
9304 Sets the help text to be used as context-sensitive help for this
9305 window. Note that the text is actually stored by the current
9306 `wx.HelpProvider` implementation, and not in the window object itself.
9307 """
9308 return _core_.Window_SetHelpText(*args, **kwargs)
9309
9310 def SetHelpTextForId(*args, **kwargs):
9311 """
9312 SetHelpTextForId(self, String text)
9313
9314 Associate this help text with all windows with the same id as this
9315 one.
9316 """
9317 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9318
9319 def GetHelpText(*args, **kwargs):
9320 """
9321 GetHelpText(self) -> String
9322
9323 Gets the help text to be used as context-sensitive help for this
9324 window. Note that the text is actually stored by the current
9325 `wx.HelpProvider` implementation, and not in the window object itself.
9326 """
9327 return _core_.Window_GetHelpText(*args, **kwargs)
9328
9329 def SetToolTipString(*args, **kwargs):
9330 """
9331 SetToolTipString(self, String tip)
9332
9333 Attach a tooltip to the window.
9334 """
9335 return _core_.Window_SetToolTipString(*args, **kwargs)
9336
9337 def SetToolTip(*args, **kwargs):
9338 """
9339 SetToolTip(self, ToolTip tip)
9340
9341 Attach a tooltip to the window.
9342 """
9343 return _core_.Window_SetToolTip(*args, **kwargs)
9344
9345 def GetToolTip(*args, **kwargs):
9346 """
9347 GetToolTip(self) -> ToolTip
9348
9349 get the associated tooltip or None if none
9350 """
9351 return _core_.Window_GetToolTip(*args, **kwargs)
9352
9353 def SetDropTarget(*args, **kwargs):
9354 """
9355 SetDropTarget(self, DropTarget dropTarget)
9356
9357 Associates a drop target with this window. If the window already has
9358 a drop target, it is deleted.
9359 """
9360 return _core_.Window_SetDropTarget(*args, **kwargs)
9361
9362 def GetDropTarget(*args, **kwargs):
9363 """
9364 GetDropTarget(self) -> DropTarget
9365
9366 Returns the associated drop target, which may be None.
9367 """
9368 return _core_.Window_GetDropTarget(*args, **kwargs)
9369
9370 def DragAcceptFiles(*args, **kwargs):
9371 """
9372 DragAcceptFiles(self, bool accept)
9373
9374 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9375 Only functional on Windows.
9376 """
9377 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9378
9379 def SetConstraints(*args, **kwargs):
9380 """
9381 SetConstraints(self, LayoutConstraints constraints)
9382
9383 Sets the window to have the given layout constraints. If an existing
9384 layout constraints object is already owned by the window, it will be
9385 deleted. Pass None to disassociate and delete the window's current
9386 constraints.
9387
9388 You must call SetAutoLayout to tell a window to use the constraints
9389 automatically in its default EVT_SIZE handler; otherwise, you must
9390 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9391 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9392 effect.
9393 """
9394 return _core_.Window_SetConstraints(*args, **kwargs)
9395
9396 def GetConstraints(*args, **kwargs):
9397 """
9398 GetConstraints(self) -> LayoutConstraints
9399
9400 Returns a pointer to the window's layout constraints, or None if there
9401 are none.
9402 """
9403 return _core_.Window_GetConstraints(*args, **kwargs)
9404
9405 def SetAutoLayout(*args, **kwargs):
9406 """
9407 SetAutoLayout(self, bool autoLayout)
9408
9409 Determines whether the Layout function will be called automatically
9410 when the window is resized. lease note that this only happens for the
9411 windows usually used to contain children, namely `wx.Panel` and
9412 `wx.TopLevelWindow` (and the classes deriving from them).
9413
9414 This method is called implicitly by `SetSizer` but if you use
9415 `SetConstraints` you should call it manually or otherwise the window
9416 layout won't be correctly updated when its size changes.
9417 """
9418 return _core_.Window_SetAutoLayout(*args, **kwargs)
9419
9420 def GetAutoLayout(*args, **kwargs):
9421 """
9422 GetAutoLayout(self) -> bool
9423
9424 Returns the current autoLayout setting
9425 """
9426 return _core_.Window_GetAutoLayout(*args, **kwargs)
9427
9428 def Layout(*args, **kwargs):
9429 """
9430 Layout(self) -> bool
9431
9432 Invokes the constraint-based layout algorithm or the sizer-based
9433 algorithm for this window. See SetAutoLayout: when auto layout is on,
9434 this function gets called automatically by the default EVT_SIZE
9435 handler when the window is resized.
9436 """
9437 return _core_.Window_Layout(*args, **kwargs)
9438
9439 def SetSizer(*args, **kwargs):
9440 """
9441 SetSizer(self, Sizer sizer, bool deleteOld=True)
9442
9443 Sets the window to have the given layout sizer. The window will then
9444 own the object, and will take care of its deletion. If an existing
9445 layout sizer object is already owned by the window, it will be deleted
9446 if the deleteOld parameter is true. Note that this function will also
9447 call SetAutoLayout implicitly with a True parameter if the sizer is
9448 non-None, and False otherwise.
9449 """
9450 return _core_.Window_SetSizer(*args, **kwargs)
9451
9452 def SetSizerAndFit(*args, **kwargs):
9453 """
9454 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9455
9456 The same as SetSizer, except it also sets the size hints for the
9457 window based on the sizer's minimum size.
9458 """
9459 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9460
9461 def GetSizer(*args, **kwargs):
9462 """
9463 GetSizer(self) -> Sizer
9464
9465 Return the sizer associated with the window by a previous call to
9466 SetSizer or None if there isn't one.
9467 """
9468 return _core_.Window_GetSizer(*args, **kwargs)
9469
9470 def SetContainingSizer(*args, **kwargs):
9471 """
9472 SetContainingSizer(self, Sizer sizer)
9473
9474 This normally does not need to be called by application code. It is
9475 called internally when a window is added to a sizer, and is used so
9476 the window can remove itself from the sizer when it is destroyed.
9477 """
9478 return _core_.Window_SetContainingSizer(*args, **kwargs)
9479
9480 def GetContainingSizer(*args, **kwargs):
9481 """
9482 GetContainingSizer(self) -> Sizer
9483
9484 Return the sizer that this window is a member of, if any, otherwise None.
9485 """
9486 return _core_.Window_GetContainingSizer(*args, **kwargs)
9487
9488 def InheritAttributes(*args, **kwargs):
9489 """
9490 InheritAttributes(self)
9491
9492 This function is (or should be, in case of custom controls) called
9493 during window creation to intelligently set up the window visual
9494 attributes, that is the font and the foreground and background
9495 colours.
9496
9497 By 'intelligently' the following is meant: by default, all windows use
9498 their own default attributes. However if some of the parent's
9499 attributes are explicitly changed (that is, using SetFont and not
9500 SetOwnFont) and if the corresponding attribute hadn't been
9501 explicitly set for this window itself, then this window takes the same
9502 value as used by the parent. In addition, if the window overrides
9503 ShouldInheritColours to return false, the colours will not be changed
9504 no matter what and only the font might.
9505
9506 This rather complicated logic is necessary in order to accommodate the
9507 different usage scenarios. The most common one is when all default
9508 attributes are used and in this case, nothing should be inherited as
9509 in modern GUIs different controls use different fonts (and colours)
9510 than their siblings so they can't inherit the same value from the
9511 parent. However it was also deemed desirable to allow to simply change
9512 the attributes of all children at once by just changing the font or
9513 colour of their common parent, hence in this case we do inherit the
9514 parents attributes.
9515
9516 """
9517 return _core_.Window_InheritAttributes(*args, **kwargs)
9518
9519 def ShouldInheritColours(*args, **kwargs):
9520 """
9521 ShouldInheritColours(self) -> bool
9522
9523 Return true from here to allow the colours of this window to be
9524 changed by InheritAttributes, returning false forbids inheriting them
9525 from the parent window.
9526
9527 The base class version returns false, but this method is overridden in
9528 wxControl where it returns true.
9529 """
9530 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9531
9532 def PostCreate(self, pre):
9533 """
9534 Phase 3 of the 2-phase create <wink!>
9535 Call this method after precreating the window with the 2-phase create method.
9536 """
9537 self.this = pre.this
9538 self.thisown = pre.thisown
9539 pre.thisown = 0
9540 if hasattr(self, '_setOORInfo'):
9541 self._setOORInfo(self)
9542 if hasattr(self, '_setCallbackInfo'):
9543 self._setCallbackInfo(self, self.__class__)
9544
9545 def SendSizeEvent(self):
9546 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9547
9548 _core_.Window_swigregister(Window)
9549
9550 def PreWindow(*args, **kwargs):
9551 """
9552 PreWindow() -> Window
9553
9554 Precreate a Window for 2-phase creation.
9555 """
9556 val = _core_.new_PreWindow(*args, **kwargs)
9557 return val
9558
9559 def Window_NewControlId(*args):
9560 """
9561 Window_NewControlId() -> int
9562
9563 Generate a control id for the controls which were not given one.
9564 """
9565 return _core_.Window_NewControlId(*args)
9566
9567 def Window_NextControlId(*args, **kwargs):
9568 """
9569 Window_NextControlId(int winid) -> int
9570
9571 Get the id of the control following the one with the given
9572 autogenerated) id
9573 """
9574 return _core_.Window_NextControlId(*args, **kwargs)
9575
9576 def Window_PrevControlId(*args, **kwargs):
9577 """
9578 Window_PrevControlId(int winid) -> int
9579
9580 Get the id of the control preceding the one with the given
9581 autogenerated) id
9582 """
9583 return _core_.Window_PrevControlId(*args, **kwargs)
9584
9585 def Window_FindFocus(*args):
9586 """
9587 Window_FindFocus() -> Window
9588
9589 Returns the window or control that currently has the keyboard focus,
9590 or None.
9591 """
9592 return _core_.Window_FindFocus(*args)
9593
9594 def Window_GetCapture(*args):
9595 """
9596 Window_GetCapture() -> Window
9597
9598 Returns the window which currently captures the mouse or None
9599 """
9600 return _core_.Window_GetCapture(*args)
9601
9602 def Window_GetClassDefaultAttributes(*args, **kwargs):
9603 """
9604 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9605
9606 Get the default attributes for this class. This is useful if you want
9607 to use the same font or colour in your own control as in a standard
9608 control -- which is a much better idea than hard coding specific
9609 colours or fonts which might look completely out of place on the
9610 user's system, especially if it uses themes.
9611
9612 The variant parameter is only relevant under Mac currently and is
9613 ignore under other platforms. Under Mac, it will change the size of
9614 the returned font. See `wx.Window.SetWindowVariant` for more about
9615 this.
9616 """
9617 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9618
9619 def DLG_PNT(win, point_or_x, y=None):
9620 """
9621 Convenience function for converting a Point or (x,y) in
9622 dialog units to pixel units.
9623 """
9624 if y is None:
9625 return win.ConvertDialogPointToPixels(point_or_x)
9626 else:
9627 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9628
9629 def DLG_SZE(win, size_width, height=None):
9630 """
9631 Convenience function for converting a Size or (w,h) in
9632 dialog units to pixel units.
9633 """
9634 if height is None:
9635 return win.ConvertDialogSizeToPixels(size_width)
9636 else:
9637 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9638
9639
9640 def FindWindowById(*args, **kwargs):
9641 """
9642 FindWindowById(long id, Window parent=None) -> Window
9643
9644 Find the first window in the application with the given id. If parent
9645 is None, the search will start from all top-level frames and dialog
9646 boxes; if non-None, the search will be limited to the given window
9647 hierarchy. The search is recursive in both cases.
9648 """
9649 return _core_.FindWindowById(*args, **kwargs)
9650
9651 def FindWindowByName(*args, **kwargs):
9652 """
9653 FindWindowByName(String name, Window parent=None) -> Window
9654
9655 Find a window by its name (as given in a window constructor or Create
9656 function call). If parent is None, the search will start from all
9657 top-level frames and dialog boxes; if non-None, the search will be
9658 limited to the given window hierarchy. The search is recursive in both
9659 cases.
9660
9661 If no window with such name is found, wx.FindWindowByLabel is called.
9662 """
9663 return _core_.FindWindowByName(*args, **kwargs)
9664
9665 def FindWindowByLabel(*args, **kwargs):
9666 """
9667 FindWindowByLabel(String label, Window parent=None) -> Window
9668
9669 Find a window by its label. Depending on the type of window, the label
9670 may be a window title or panel item label. If parent is None, the
9671 search will start from all top-level frames and dialog boxes; if
9672 non-None, the search will be limited to the given window
9673 hierarchy. The search is recursive in both cases.
9674 """
9675 return _core_.FindWindowByLabel(*args, **kwargs)
9676
9677 def Window_FromHWND(*args, **kwargs):
9678 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9679 return _core_.Window_FromHWND(*args, **kwargs)
9680
9681 def GetTopLevelWindows(*args):
9682 """
9683 GetTopLevelWindows() -> PyObject
9684
9685 Returns a list of the the application's top-level windows, (frames,
9686 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9687 by wxWidgets, and so it is only valid as long as no top-level windows
9688 are closed or new top-level windows are created.
9689
9690 """
9691 return _core_.GetTopLevelWindows(*args)
9692 #---------------------------------------------------------------------------
9693
9694 class Validator(EvtHandler):
9695 """Proxy of C++ Validator class"""
9696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9697 __repr__ = _swig_repr
9698 def __init__(self, *args, **kwargs):
9699 """__init__(self) -> Validator"""
9700 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9701 self._setOORInfo(self)
9702
9703 def Clone(*args, **kwargs):
9704 """Clone(self) -> Validator"""
9705 return _core_.Validator_Clone(*args, **kwargs)
9706
9707 def Validate(*args, **kwargs):
9708 """Validate(self, Window parent) -> bool"""
9709 return _core_.Validator_Validate(*args, **kwargs)
9710
9711 def TransferToWindow(*args, **kwargs):
9712 """TransferToWindow(self) -> bool"""
9713 return _core_.Validator_TransferToWindow(*args, **kwargs)
9714
9715 def TransferFromWindow(*args, **kwargs):
9716 """TransferFromWindow(self) -> bool"""
9717 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9718
9719 def GetWindow(*args, **kwargs):
9720 """GetWindow(self) -> Window"""
9721 return _core_.Validator_GetWindow(*args, **kwargs)
9722
9723 def SetWindow(*args, **kwargs):
9724 """SetWindow(self, Window window)"""
9725 return _core_.Validator_SetWindow(*args, **kwargs)
9726
9727 def IsSilent(*args, **kwargs):
9728 """IsSilent() -> bool"""
9729 return _core_.Validator_IsSilent(*args, **kwargs)
9730
9731 IsSilent = staticmethod(IsSilent)
9732 def SetBellOnError(*args, **kwargs):
9733 """SetBellOnError(int doIt=True)"""
9734 return _core_.Validator_SetBellOnError(*args, **kwargs)
9735
9736 SetBellOnError = staticmethod(SetBellOnError)
9737 _core_.Validator_swigregister(Validator)
9738
9739 def Validator_IsSilent(*args):
9740 """Validator_IsSilent() -> bool"""
9741 return _core_.Validator_IsSilent(*args)
9742
9743 def Validator_SetBellOnError(*args, **kwargs):
9744 """Validator_SetBellOnError(int doIt=True)"""
9745 return _core_.Validator_SetBellOnError(*args, **kwargs)
9746
9747 class PyValidator(Validator):
9748 """Proxy of C++ PyValidator class"""
9749 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9750 __repr__ = _swig_repr
9751 def __init__(self, *args, **kwargs):
9752 """__init__(self) -> PyValidator"""
9753 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9754
9755 self._setCallbackInfo(self, PyValidator, 1)
9756 self._setOORInfo(self)
9757
9758 def _setCallbackInfo(*args, **kwargs):
9759 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9760 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9761
9762 _core_.PyValidator_swigregister(PyValidator)
9763
9764 #---------------------------------------------------------------------------
9765
9766 class Menu(EvtHandler):
9767 """Proxy of C++ Menu class"""
9768 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9769 __repr__ = _swig_repr
9770 def __init__(self, *args, **kwargs):
9771 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9772 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9773 self._setOORInfo(self)
9774
9775 def Append(*args, **kwargs):
9776 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9777 return _core_.Menu_Append(*args, **kwargs)
9778
9779 def AppendSeparator(*args, **kwargs):
9780 """AppendSeparator(self) -> MenuItem"""
9781 return _core_.Menu_AppendSeparator(*args, **kwargs)
9782
9783 def AppendCheckItem(*args, **kwargs):
9784 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9785 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9786
9787 def AppendRadioItem(*args, **kwargs):
9788 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9789 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9790
9791 def AppendMenu(*args, **kwargs):
9792 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9793 return _core_.Menu_AppendMenu(*args, **kwargs)
9794
9795 def AppendSubMenu(*args, **kwargs):
9796 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9797 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9798
9799 def AppendItem(*args, **kwargs):
9800 """AppendItem(self, MenuItem item) -> MenuItem"""
9801 return _core_.Menu_AppendItem(*args, **kwargs)
9802
9803 def InsertItem(*args, **kwargs):
9804 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9805 return _core_.Menu_InsertItem(*args, **kwargs)
9806
9807 def PrependItem(*args, **kwargs):
9808 """PrependItem(self, MenuItem item) -> MenuItem"""
9809 return _core_.Menu_PrependItem(*args, **kwargs)
9810
9811 def Break(*args, **kwargs):
9812 """Break(self)"""
9813 return _core_.Menu_Break(*args, **kwargs)
9814
9815 def Insert(*args, **kwargs):
9816 """
9817 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9818 int kind=ITEM_NORMAL) -> MenuItem
9819 """
9820 return _core_.Menu_Insert(*args, **kwargs)
9821
9822 def InsertSeparator(*args, **kwargs):
9823 """InsertSeparator(self, size_t pos) -> MenuItem"""
9824 return _core_.Menu_InsertSeparator(*args, **kwargs)
9825
9826 def InsertCheckItem(*args, **kwargs):
9827 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9828 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9829
9830 def InsertRadioItem(*args, **kwargs):
9831 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9832 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9833
9834 def InsertMenu(*args, **kwargs):
9835 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9836 return _core_.Menu_InsertMenu(*args, **kwargs)
9837
9838 def Prepend(*args, **kwargs):
9839 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9840 return _core_.Menu_Prepend(*args, **kwargs)
9841
9842 def PrependSeparator(*args, **kwargs):
9843 """PrependSeparator(self) -> MenuItem"""
9844 return _core_.Menu_PrependSeparator(*args, **kwargs)
9845
9846 def PrependCheckItem(*args, **kwargs):
9847 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9849
9850 def PrependRadioItem(*args, **kwargs):
9851 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9853
9854 def PrependMenu(*args, **kwargs):
9855 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9856 return _core_.Menu_PrependMenu(*args, **kwargs)
9857
9858 def Remove(*args, **kwargs):
9859 """Remove(self, int id) -> MenuItem"""
9860 return _core_.Menu_Remove(*args, **kwargs)
9861
9862 def RemoveItem(*args, **kwargs):
9863 """RemoveItem(self, MenuItem item) -> MenuItem"""
9864 return _core_.Menu_RemoveItem(*args, **kwargs)
9865
9866 def Delete(*args, **kwargs):
9867 """Delete(self, int id) -> bool"""
9868 return _core_.Menu_Delete(*args, **kwargs)
9869
9870 def DeleteItem(*args, **kwargs):
9871 """DeleteItem(self, MenuItem item) -> bool"""
9872 return _core_.Menu_DeleteItem(*args, **kwargs)
9873
9874 def Destroy(*args, **kwargs):
9875 """
9876 Destroy(self)
9877
9878 Deletes the C++ object this Python object is a proxy for.
9879 """
9880 val = _core_.Menu_Destroy(*args, **kwargs)
9881 args[0].thisown = 0
9882 return val
9883
9884 def DestroyId(*args, **kwargs):
9885 """
9886 DestroyId(self, int id) -> bool
9887
9888 Deletes the C++ object this Python object is a proxy for.
9889 """
9890 val = _core_.Menu_DestroyId(*args, **kwargs)
9891 args[0].thisown = 0
9892 return val
9893
9894 def DestroyItem(*args, **kwargs):
9895 """
9896 DestroyItem(self, MenuItem item) -> bool
9897
9898 Deletes the C++ object this Python object is a proxy for.
9899 """
9900 val = _core_.Menu_DestroyItem(*args, **kwargs)
9901 args[0].thisown = 0
9902 return val
9903
9904 def GetMenuItemCount(*args, **kwargs):
9905 """GetMenuItemCount(self) -> size_t"""
9906 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9907
9908 def GetMenuItems(*args, **kwargs):
9909 """GetMenuItems(self) -> PyObject"""
9910 return _core_.Menu_GetMenuItems(*args, **kwargs)
9911
9912 def FindItem(*args, **kwargs):
9913 """FindItem(self, String item) -> int"""
9914 return _core_.Menu_FindItem(*args, **kwargs)
9915
9916 def FindItemById(*args, **kwargs):
9917 """FindItemById(self, int id) -> MenuItem"""
9918 return _core_.Menu_FindItemById(*args, **kwargs)
9919
9920 def FindItemByPosition(*args, **kwargs):
9921 """FindItemByPosition(self, size_t position) -> MenuItem"""
9922 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9923
9924 def Enable(*args, **kwargs):
9925 """Enable(self, int id, bool enable)"""
9926 return _core_.Menu_Enable(*args, **kwargs)
9927
9928 def IsEnabled(*args, **kwargs):
9929 """IsEnabled(self, int id) -> bool"""
9930 return _core_.Menu_IsEnabled(*args, **kwargs)
9931
9932 def Check(*args, **kwargs):
9933 """Check(self, int id, bool check)"""
9934 return _core_.Menu_Check(*args, **kwargs)
9935
9936 def IsChecked(*args, **kwargs):
9937 """IsChecked(self, int id) -> bool"""
9938 return _core_.Menu_IsChecked(*args, **kwargs)
9939
9940 def SetLabel(*args, **kwargs):
9941 """SetLabel(self, int id, String label)"""
9942 return _core_.Menu_SetLabel(*args, **kwargs)
9943
9944 def GetLabel(*args, **kwargs):
9945 """GetLabel(self, int id) -> String"""
9946 return _core_.Menu_GetLabel(*args, **kwargs)
9947
9948 def SetHelpString(*args, **kwargs):
9949 """SetHelpString(self, int id, String helpString)"""
9950 return _core_.Menu_SetHelpString(*args, **kwargs)
9951
9952 def GetHelpString(*args, **kwargs):
9953 """GetHelpString(self, int id) -> String"""
9954 return _core_.Menu_GetHelpString(*args, **kwargs)
9955
9956 def SetTitle(*args, **kwargs):
9957 """SetTitle(self, String title)"""
9958 return _core_.Menu_SetTitle(*args, **kwargs)
9959
9960 def GetTitle(*args, **kwargs):
9961 """GetTitle(self) -> String"""
9962 return _core_.Menu_GetTitle(*args, **kwargs)
9963
9964 def SetEventHandler(*args, **kwargs):
9965 """SetEventHandler(self, EvtHandler handler)"""
9966 return _core_.Menu_SetEventHandler(*args, **kwargs)
9967
9968 def GetEventHandler(*args, **kwargs):
9969 """GetEventHandler(self) -> EvtHandler"""
9970 return _core_.Menu_GetEventHandler(*args, **kwargs)
9971
9972 def SetInvokingWindow(*args, **kwargs):
9973 """SetInvokingWindow(self, Window win)"""
9974 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9975
9976 def GetInvokingWindow(*args, **kwargs):
9977 """GetInvokingWindow(self) -> Window"""
9978 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9979
9980 def GetStyle(*args, **kwargs):
9981 """GetStyle(self) -> long"""
9982 return _core_.Menu_GetStyle(*args, **kwargs)
9983
9984 def UpdateUI(*args, **kwargs):
9985 """UpdateUI(self, EvtHandler source=None)"""
9986 return _core_.Menu_UpdateUI(*args, **kwargs)
9987
9988 def GetMenuBar(*args, **kwargs):
9989 """GetMenuBar(self) -> MenuBar"""
9990 return _core_.Menu_GetMenuBar(*args, **kwargs)
9991
9992 def Attach(*args, **kwargs):
9993 """Attach(self, wxMenuBarBase menubar)"""
9994 return _core_.Menu_Attach(*args, **kwargs)
9995
9996 def Detach(*args, **kwargs):
9997 """Detach(self)"""
9998 return _core_.Menu_Detach(*args, **kwargs)
9999
10000 def IsAttached(*args, **kwargs):
10001 """IsAttached(self) -> bool"""
10002 return _core_.Menu_IsAttached(*args, **kwargs)
10003
10004 def SetParent(*args, **kwargs):
10005 """SetParent(self, Menu parent)"""
10006 return _core_.Menu_SetParent(*args, **kwargs)
10007
10008 def GetParent(*args, **kwargs):
10009 """GetParent(self) -> Menu"""
10010 return _core_.Menu_GetParent(*args, **kwargs)
10011
10012 _core_.Menu_swigregister(Menu)
10013 DefaultValidator = cvar.DefaultValidator
10014
10015 #---------------------------------------------------------------------------
10016
10017 class MenuBar(Window):
10018 """Proxy of C++ MenuBar class"""
10019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10020 __repr__ = _swig_repr
10021 def __init__(self, *args, **kwargs):
10022 """__init__(self, long style=0) -> MenuBar"""
10023 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10024 self._setOORInfo(self)
10025
10026 def Append(*args, **kwargs):
10027 """Append(self, Menu menu, String title) -> bool"""
10028 return _core_.MenuBar_Append(*args, **kwargs)
10029
10030 def Insert(*args, **kwargs):
10031 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10032 return _core_.MenuBar_Insert(*args, **kwargs)
10033
10034 def GetMenuCount(*args, **kwargs):
10035 """GetMenuCount(self) -> size_t"""
10036 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10037
10038 def GetMenu(*args, **kwargs):
10039 """GetMenu(self, size_t pos) -> Menu"""
10040 return _core_.MenuBar_GetMenu(*args, **kwargs)
10041
10042 def Replace(*args, **kwargs):
10043 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10044 return _core_.MenuBar_Replace(*args, **kwargs)
10045
10046 def Remove(*args, **kwargs):
10047 """Remove(self, size_t pos) -> Menu"""
10048 return _core_.MenuBar_Remove(*args, **kwargs)
10049
10050 def EnableTop(*args, **kwargs):
10051 """EnableTop(self, size_t pos, bool enable)"""
10052 return _core_.MenuBar_EnableTop(*args, **kwargs)
10053
10054 def IsEnabledTop(*args, **kwargs):
10055 """IsEnabledTop(self, size_t pos) -> bool"""
10056 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10057
10058 def SetLabelTop(*args, **kwargs):
10059 """SetLabelTop(self, size_t pos, String label)"""
10060 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10061
10062 def GetLabelTop(*args, **kwargs):
10063 """GetLabelTop(self, size_t pos) -> String"""
10064 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10065
10066 def FindMenuItem(*args, **kwargs):
10067 """FindMenuItem(self, String menu, String item) -> int"""
10068 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10069
10070 def FindItemById(*args, **kwargs):
10071 """FindItemById(self, int id) -> MenuItem"""
10072 return _core_.MenuBar_FindItemById(*args, **kwargs)
10073
10074 def FindMenu(*args, **kwargs):
10075 """FindMenu(self, String title) -> int"""
10076 return _core_.MenuBar_FindMenu(*args, **kwargs)
10077
10078 def Enable(*args, **kwargs):
10079 """Enable(self, int id, bool enable)"""
10080 return _core_.MenuBar_Enable(*args, **kwargs)
10081
10082 def Check(*args, **kwargs):
10083 """Check(self, int id, bool check)"""
10084 return _core_.MenuBar_Check(*args, **kwargs)
10085
10086 def IsChecked(*args, **kwargs):
10087 """IsChecked(self, int id) -> bool"""
10088 return _core_.MenuBar_IsChecked(*args, **kwargs)
10089
10090 def IsEnabled(*args, **kwargs):
10091 """IsEnabled(self, int id) -> bool"""
10092 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10093
10094 def SetLabel(*args, **kwargs):
10095 """SetLabel(self, int id, String label)"""
10096 return _core_.MenuBar_SetLabel(*args, **kwargs)
10097
10098 def GetLabel(*args, **kwargs):
10099 """GetLabel(self, int id) -> String"""
10100 return _core_.MenuBar_GetLabel(*args, **kwargs)
10101
10102 def SetHelpString(*args, **kwargs):
10103 """SetHelpString(self, int id, String helpString)"""
10104 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10105
10106 def GetHelpString(*args, **kwargs):
10107 """GetHelpString(self, int id) -> String"""
10108 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10109
10110 def GetFrame(*args, **kwargs):
10111 """GetFrame(self) -> wxFrame"""
10112 return _core_.MenuBar_GetFrame(*args, **kwargs)
10113
10114 def IsAttached(*args, **kwargs):
10115 """IsAttached(self) -> bool"""
10116 return _core_.MenuBar_IsAttached(*args, **kwargs)
10117
10118 def Attach(*args, **kwargs):
10119 """Attach(self, wxFrame frame)"""
10120 return _core_.MenuBar_Attach(*args, **kwargs)
10121
10122 def Detach(*args, **kwargs):
10123 """Detach(self)"""
10124 return _core_.MenuBar_Detach(*args, **kwargs)
10125
10126 def SetAutoWindowMenu(*args, **kwargs):
10127 """SetAutoWindowMenu(bool enable)"""
10128 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10129
10130 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10131 def GetAutoWindowMenu(*args, **kwargs):
10132 """GetAutoWindowMenu() -> bool"""
10133 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10134
10135 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10136 _core_.MenuBar_swigregister(MenuBar)
10137
10138 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10139 """MenuBar_SetAutoWindowMenu(bool enable)"""
10140 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10141
10142 def MenuBar_GetAutoWindowMenu(*args):
10143 """MenuBar_GetAutoWindowMenu() -> bool"""
10144 return _core_.MenuBar_GetAutoWindowMenu(*args)
10145
10146 #---------------------------------------------------------------------------
10147
10148 class MenuItem(Object):
10149 """Proxy of C++ MenuItem class"""
10150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10151 __repr__ = _swig_repr
10152 def __init__(self, *args, **kwargs):
10153 """
10154 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10155 String help=EmptyString, int kind=ITEM_NORMAL,
10156 Menu subMenu=None) -> MenuItem
10157 """
10158 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10159 __swig_destroy__ = _core_.delete_MenuItem
10160 __del__ = lambda self : None;
10161 def GetMenu(*args, **kwargs):
10162 """GetMenu(self) -> Menu"""
10163 return _core_.MenuItem_GetMenu(*args, **kwargs)
10164
10165 def SetMenu(*args, **kwargs):
10166 """SetMenu(self, Menu menu)"""
10167 return _core_.MenuItem_SetMenu(*args, **kwargs)
10168
10169 def SetId(*args, **kwargs):
10170 """SetId(self, int id)"""
10171 return _core_.MenuItem_SetId(*args, **kwargs)
10172
10173 def GetId(*args, **kwargs):
10174 """GetId(self) -> int"""
10175 return _core_.MenuItem_GetId(*args, **kwargs)
10176
10177 def IsSeparator(*args, **kwargs):
10178 """IsSeparator(self) -> bool"""
10179 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10180
10181 def SetText(*args, **kwargs):
10182 """SetText(self, String str)"""
10183 return _core_.MenuItem_SetText(*args, **kwargs)
10184
10185 def GetLabel(*args, **kwargs):
10186 """GetLabel(self) -> String"""
10187 return _core_.MenuItem_GetLabel(*args, **kwargs)
10188
10189 def GetText(*args, **kwargs):
10190 """GetText(self) -> String"""
10191 return _core_.MenuItem_GetText(*args, **kwargs)
10192
10193 def GetLabelFromText(*args, **kwargs):
10194 """GetLabelFromText(String text) -> String"""
10195 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10196
10197 GetLabelFromText = staticmethod(GetLabelFromText)
10198 def GetKind(*args, **kwargs):
10199 """GetKind(self) -> int"""
10200 return _core_.MenuItem_GetKind(*args, **kwargs)
10201
10202 def SetKind(*args, **kwargs):
10203 """SetKind(self, int kind)"""
10204 return _core_.MenuItem_SetKind(*args, **kwargs)
10205
10206 def SetCheckable(*args, **kwargs):
10207 """SetCheckable(self, bool checkable)"""
10208 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10209
10210 def IsCheckable(*args, **kwargs):
10211 """IsCheckable(self) -> bool"""
10212 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10213
10214 def IsSubMenu(*args, **kwargs):
10215 """IsSubMenu(self) -> bool"""
10216 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10217
10218 def SetSubMenu(*args, **kwargs):
10219 """SetSubMenu(self, Menu menu)"""
10220 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10221
10222 def GetSubMenu(*args, **kwargs):
10223 """GetSubMenu(self) -> Menu"""
10224 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10225
10226 def Enable(*args, **kwargs):
10227 """Enable(self, bool enable=True)"""
10228 return _core_.MenuItem_Enable(*args, **kwargs)
10229
10230 def IsEnabled(*args, **kwargs):
10231 """IsEnabled(self) -> bool"""
10232 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10233
10234 def Check(*args, **kwargs):
10235 """Check(self, bool check=True)"""
10236 return _core_.MenuItem_Check(*args, **kwargs)
10237
10238 def IsChecked(*args, **kwargs):
10239 """IsChecked(self) -> bool"""
10240 return _core_.MenuItem_IsChecked(*args, **kwargs)
10241
10242 def Toggle(*args, **kwargs):
10243 """Toggle(self)"""
10244 return _core_.MenuItem_Toggle(*args, **kwargs)
10245
10246 def SetHelp(*args, **kwargs):
10247 """SetHelp(self, String str)"""
10248 return _core_.MenuItem_SetHelp(*args, **kwargs)
10249
10250 def GetHelp(*args, **kwargs):
10251 """GetHelp(self) -> String"""
10252 return _core_.MenuItem_GetHelp(*args, **kwargs)
10253
10254 def GetAccel(*args, **kwargs):
10255 """GetAccel(self) -> AcceleratorEntry"""
10256 return _core_.MenuItem_GetAccel(*args, **kwargs)
10257
10258 def SetAccel(*args, **kwargs):
10259 """SetAccel(self, AcceleratorEntry accel)"""
10260 return _core_.MenuItem_SetAccel(*args, **kwargs)
10261
10262 def SetBitmap(*args, **kwargs):
10263 """SetBitmap(self, Bitmap bitmap)"""
10264 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10265
10266 def GetBitmap(*args, **kwargs):
10267 """GetBitmap(self) -> Bitmap"""
10268 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10269
10270 def SetFont(*args, **kwargs):
10271 """SetFont(self, Font font)"""
10272 return _core_.MenuItem_SetFont(*args, **kwargs)
10273
10274 def GetFont(*args, **kwargs):
10275 """GetFont(self) -> Font"""
10276 return _core_.MenuItem_GetFont(*args, **kwargs)
10277
10278 def SetTextColour(*args, **kwargs):
10279 """SetTextColour(self, Colour colText)"""
10280 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10281
10282 def GetTextColour(*args, **kwargs):
10283 """GetTextColour(self) -> Colour"""
10284 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10285
10286 def SetBackgroundColour(*args, **kwargs):
10287 """SetBackgroundColour(self, Colour colBack)"""
10288 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10289
10290 def GetBackgroundColour(*args, **kwargs):
10291 """GetBackgroundColour(self) -> Colour"""
10292 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10293
10294 def SetBitmaps(*args, **kwargs):
10295 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10296 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10297
10298 def SetDisabledBitmap(*args, **kwargs):
10299 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10300 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10301
10302 def GetDisabledBitmap(*args, **kwargs):
10303 """GetDisabledBitmap(self) -> Bitmap"""
10304 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10305
10306 def SetMarginWidth(*args, **kwargs):
10307 """SetMarginWidth(self, int nWidth)"""
10308 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10309
10310 def GetMarginWidth(*args, **kwargs):
10311 """GetMarginWidth(self) -> int"""
10312 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10313
10314 def GetDefaultMarginWidth(*args, **kwargs):
10315 """GetDefaultMarginWidth() -> int"""
10316 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10317
10318 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10319 def IsOwnerDrawn(*args, **kwargs):
10320 """IsOwnerDrawn(self) -> bool"""
10321 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10322
10323 def SetOwnerDrawn(*args, **kwargs):
10324 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10325 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10326
10327 def ResetOwnerDrawn(*args, **kwargs):
10328 """ResetOwnerDrawn(self)"""
10329 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10330
10331 _core_.MenuItem_swigregister(MenuItem)
10332
10333 def MenuItem_GetLabelFromText(*args, **kwargs):
10334 """MenuItem_GetLabelFromText(String text) -> String"""
10335 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10336
10337 def MenuItem_GetDefaultMarginWidth(*args):
10338 """MenuItem_GetDefaultMarginWidth() -> int"""
10339 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10340
10341 #---------------------------------------------------------------------------
10342
10343 class Control(Window):
10344 """
10345 This is the base class for a control or 'widget'.
10346
10347 A control is generally a small window which processes user input
10348 and/or displays one or more item of data.
10349 """
10350 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10351 __repr__ = _swig_repr
10352 def __init__(self, *args, **kwargs):
10353 """
10354 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10355 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10356 String name=ControlNameStr) -> Control
10357
10358 Create a Control. Normally you should only call this from a subclass'
10359 __init__ as a plain old wx.Control is not very useful.
10360 """
10361 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10362 self._setOORInfo(self)
10363
10364 def Create(*args, **kwargs):
10365 """
10366 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10367 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10368 String name=ControlNameStr) -> bool
10369
10370 Do the 2nd phase and create the GUI control.
10371 """
10372 return _core_.Control_Create(*args, **kwargs)
10373
10374 def Command(*args, **kwargs):
10375 """
10376 Command(self, CommandEvent event)
10377
10378 Simulates the effect of the user issuing a command to the item.
10379
10380 :see: `wx.CommandEvent`
10381
10382 """
10383 return _core_.Control_Command(*args, **kwargs)
10384
10385 def GetLabel(*args, **kwargs):
10386 """
10387 GetLabel(self) -> String
10388
10389 Return a control's text.
10390 """
10391 return _core_.Control_GetLabel(*args, **kwargs)
10392
10393 def GetClassDefaultAttributes(*args, **kwargs):
10394 """
10395 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10396
10397 Get the default attributes for this class. This is useful if you want
10398 to use the same font or colour in your own control as in a standard
10399 control -- which is a much better idea than hard coding specific
10400 colours or fonts which might look completely out of place on the
10401 user's system, especially if it uses themes.
10402
10403 The variant parameter is only relevant under Mac currently and is
10404 ignore under other platforms. Under Mac, it will change the size of
10405 the returned font. See `wx.Window.SetWindowVariant` for more about
10406 this.
10407 """
10408 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10409
10410 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10411 _core_.Control_swigregister(Control)
10412 ControlNameStr = cvar.ControlNameStr
10413
10414 def PreControl(*args, **kwargs):
10415 """
10416 PreControl() -> Control
10417
10418 Precreate a Control control for 2-phase creation
10419 """
10420 val = _core_.new_PreControl(*args, **kwargs)
10421 return val
10422
10423 def Control_GetClassDefaultAttributes(*args, **kwargs):
10424 """
10425 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10426
10427 Get the default attributes for this class. This is useful if you want
10428 to use the same font or colour in your own control as in a standard
10429 control -- which is a much better idea than hard coding specific
10430 colours or fonts which might look completely out of place on the
10431 user's system, especially if it uses themes.
10432
10433 The variant parameter is only relevant under Mac currently and is
10434 ignore under other platforms. Under Mac, it will change the size of
10435 the returned font. See `wx.Window.SetWindowVariant` for more about
10436 this.
10437 """
10438 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10439
10440 #---------------------------------------------------------------------------
10441
10442 class ItemContainer(object):
10443 """
10444 The wx.ItemContainer class defines an interface which is implemented
10445 by all controls which have string subitems, each of which may be
10446 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10447 as `wx.ComboBox` which implements an extended interface deriving from
10448 this one.
10449
10450 It defines the methods for accessing the control's items and although
10451 each of the derived classes implements them differently, they still
10452 all conform to the same interface.
10453
10454 The items in a wx.ItemContainer have (non empty) string labels and,
10455 optionally, client data associated with them.
10456
10457 """
10458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10459 def __init__(self): raise AttributeError, "No constructor defined"
10460 __repr__ = _swig_repr
10461 def Append(*args, **kwargs):
10462 """
10463 Append(self, String item, PyObject clientData=None) -> int
10464
10465 Adds the item to the control, associating the given data with the item
10466 if not None. The return value is the index of the newly added item
10467 which may be different from the last one if the control is sorted (e.g.
10468 has wx.LB_SORT or wx.CB_SORT style).
10469 """
10470 return _core_.ItemContainer_Append(*args, **kwargs)
10471
10472 def AppendItems(*args, **kwargs):
10473 """
10474 AppendItems(self, List strings)
10475
10476 Apend several items at once to the control. Notice that calling this
10477 method may be much faster than appending the items one by one if you
10478 need to add a lot of items.
10479 """
10480 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10481
10482 def Insert(*args, **kwargs):
10483 """
10484 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10485
10486 Insert an item into the control before the item at the ``pos`` index,
10487 optionally associating some data object with the item.
10488 """
10489 return _core_.ItemContainer_Insert(*args, **kwargs)
10490
10491 def Clear(*args, **kwargs):
10492 """
10493 Clear(self)
10494
10495 Removes all items from the control.
10496 """
10497 return _core_.ItemContainer_Clear(*args, **kwargs)
10498
10499 def Delete(*args, **kwargs):
10500 """
10501 Delete(self, unsigned int n)
10502
10503 Deletes the item at the zero-based index 'n' from the control. Note
10504 that it is an error (signalled by a `wx.PyAssertionError` exception if
10505 enabled) to remove an item with the index negative or greater or equal
10506 than the number of items in the control.
10507 """
10508 return _core_.ItemContainer_Delete(*args, **kwargs)
10509
10510 def GetClientData(*args, **kwargs):
10511 """
10512 GetClientData(self, unsigned int n) -> PyObject
10513
10514 Returns the client data associated with the given item, (if any.)
10515 """
10516 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10517
10518 def SetClientData(*args, **kwargs):
10519 """
10520 SetClientData(self, unsigned int n, PyObject clientData)
10521
10522 Associate the given client data with the item at position n.
10523 """
10524 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10525
10526 def GetCount(*args, **kwargs):
10527 """
10528 GetCount(self) -> unsigned int
10529
10530 Returns the number of items in the control.
10531 """
10532 return _core_.ItemContainer_GetCount(*args, **kwargs)
10533
10534 def IsEmpty(*args, **kwargs):
10535 """
10536 IsEmpty(self) -> bool
10537
10538 Returns True if the control is empty or False if it has some items.
10539 """
10540 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10541
10542 def GetString(*args, **kwargs):
10543 """
10544 GetString(self, unsigned int n) -> String
10545
10546 Returns the label of the item with the given index.
10547 """
10548 return _core_.ItemContainer_GetString(*args, **kwargs)
10549
10550 def GetStrings(*args, **kwargs):
10551 """GetStrings(self) -> wxArrayString"""
10552 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10553
10554 def SetString(*args, **kwargs):
10555 """
10556 SetString(self, unsigned int n, String s)
10557
10558 Sets the label for the given item.
10559 """
10560 return _core_.ItemContainer_SetString(*args, **kwargs)
10561
10562 def FindString(*args, **kwargs):
10563 """
10564 FindString(self, String s) -> int
10565
10566 Finds an item whose label matches the given string. Returns the
10567 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10568 found.
10569 """
10570 return _core_.ItemContainer_FindString(*args, **kwargs)
10571
10572 def SetSelection(*args, **kwargs):
10573 """
10574 SetSelection(self, int n)
10575
10576 Sets the item at index 'n' to be the selected item.
10577 """
10578 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10579
10580 def GetSelection(*args, **kwargs):
10581 """
10582 GetSelection(self) -> int
10583
10584 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10585 is selected.
10586 """
10587 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10588
10589 def SetStringSelection(*args, **kwargs):
10590 """SetStringSelection(self, String s) -> bool"""
10591 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10592
10593 def GetStringSelection(*args, **kwargs):
10594 """
10595 GetStringSelection(self) -> String
10596
10597 Returns the label of the selected item or an empty string if no item
10598 is selected.
10599 """
10600 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10601
10602 def Select(*args, **kwargs):
10603 """
10604 Select(self, int n)
10605
10606 This is the same as `SetSelection` and exists only because it is
10607 slightly more natural for controls which support multiple selection.
10608 """
10609 return _core_.ItemContainer_Select(*args, **kwargs)
10610
10611 _core_.ItemContainer_swigregister(ItemContainer)
10612
10613 #---------------------------------------------------------------------------
10614
10615 class ControlWithItems(Control,ItemContainer):
10616 """
10617 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10618 wx.Control class, and is used for the base class of various controls
10619 that have items.
10620 """
10621 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10622 def __init__(self): raise AttributeError, "No constructor defined"
10623 __repr__ = _swig_repr
10624 _core_.ControlWithItems_swigregister(ControlWithItems)
10625
10626 #---------------------------------------------------------------------------
10627
10628 class SizerItem(Object):
10629 """
10630 The wx.SizerItem class is used to track the position, size and other
10631 attributes of each item managed by a `wx.Sizer`. It is not usually
10632 necessary to use this class because the sizer elements can also be
10633 identified by their positions or window or sizer references but
10634 sometimes it may be more convenient to use wx.SizerItem directly.
10635 Also, custom classes derived from `wx.PySizer` will probably need to
10636 use the collection of wx.SizerItems held by wx.Sizer when calculating
10637 layout.
10638
10639 :see: `wx.Sizer`, `wx.GBSizerItem`
10640 """
10641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10642 __repr__ = _swig_repr
10643 def __init__(self, *args, **kwargs):
10644 """
10645 __init__(self) -> SizerItem
10646
10647 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10648 size will need to be set before this item can be used in a Sizer.
10649
10650 You will probably never need to create a wx.SizerItem directly as they
10651 are created automatically when the sizer's Add, Insert or Prepend
10652 methods are called.
10653
10654 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10655 """
10656 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10657 __swig_destroy__ = _core_.delete_SizerItem
10658 __del__ = lambda self : None;
10659 def DeleteWindows(*args, **kwargs):
10660 """
10661 DeleteWindows(self)
10662
10663 Destroy the window or the windows in a subsizer, depending on the type
10664 of item.
10665 """
10666 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10667
10668 def DetachSizer(*args, **kwargs):
10669 """
10670 DetachSizer(self)
10671
10672 Enable deleting the SizerItem without destroying the contained sizer.
10673 """
10674 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10675
10676 def GetSize(*args, **kwargs):
10677 """
10678 GetSize(self) -> Size
10679
10680 Get the current size of the item, as set in the last Layout.
10681 """
10682 return _core_.SizerItem_GetSize(*args, **kwargs)
10683
10684 def CalcMin(*args, **kwargs):
10685 """
10686 CalcMin(self) -> Size
10687
10688 Calculates the minimum desired size for the item, including any space
10689 needed by borders.
10690 """
10691 return _core_.SizerItem_CalcMin(*args, **kwargs)
10692
10693 def SetDimension(*args, **kwargs):
10694 """
10695 SetDimension(self, Point pos, Size size)
10696
10697 Set the position and size of the space allocated for this item by the
10698 sizer, and adjust the position and size of the item (window or
10699 subsizer) to be within that space taking alignment and borders into
10700 account.
10701 """
10702 return _core_.SizerItem_SetDimension(*args, **kwargs)
10703
10704 def GetMinSize(*args, **kwargs):
10705 """
10706 GetMinSize(self) -> Size
10707
10708 Get the minimum size needed for the item.
10709 """
10710 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10711
10712 def GetMinSizeWithBorder(*args, **kwargs):
10713 """
10714 GetMinSizeWithBorder(self) -> Size
10715
10716 Get the minimum size needed for the item with space for the borders
10717 added, if needed.
10718 """
10719 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10720
10721 def SetInitSize(*args, **kwargs):
10722 """SetInitSize(self, int x, int y)"""
10723 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10724
10725 def SetRatioWH(*args, **kwargs):
10726 """
10727 SetRatioWH(self, int width, int height)
10728
10729 Set the ratio item attribute.
10730 """
10731 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10732
10733 def SetRatioSize(*args, **kwargs):
10734 """
10735 SetRatioSize(self, Size size)
10736
10737 Set the ratio item attribute.
10738 """
10739 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10740
10741 def SetRatio(*args, **kwargs):
10742 """
10743 SetRatio(self, float ratio)
10744
10745 Set the ratio item attribute.
10746 """
10747 return _core_.SizerItem_SetRatio(*args, **kwargs)
10748
10749 def GetRatio(*args, **kwargs):
10750 """
10751 GetRatio(self) -> float
10752
10753 Set the ratio item attribute.
10754 """
10755 return _core_.SizerItem_GetRatio(*args, **kwargs)
10756
10757 def GetRect(*args, **kwargs):
10758 """
10759 GetRect(self) -> Rect
10760
10761 Returns the rectangle that the sizer item should occupy
10762 """
10763 return _core_.SizerItem_GetRect(*args, **kwargs)
10764
10765 def IsWindow(*args, **kwargs):
10766 """
10767 IsWindow(self) -> bool
10768
10769 Is this sizer item a window?
10770 """
10771 return _core_.SizerItem_IsWindow(*args, **kwargs)
10772
10773 def IsSizer(*args, **kwargs):
10774 """
10775 IsSizer(self) -> bool
10776
10777 Is this sizer item a subsizer?
10778 """
10779 return _core_.SizerItem_IsSizer(*args, **kwargs)
10780
10781 def IsSpacer(*args, **kwargs):
10782 """
10783 IsSpacer(self) -> bool
10784
10785 Is this sizer item a spacer?
10786 """
10787 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10788
10789 def SetProportion(*args, **kwargs):
10790 """
10791 SetProportion(self, int proportion)
10792
10793 Set the proportion value for this item.
10794 """
10795 return _core_.SizerItem_SetProportion(*args, **kwargs)
10796
10797 def GetProportion(*args, **kwargs):
10798 """
10799 GetProportion(self) -> int
10800
10801 Get the proportion value for this item.
10802 """
10803 return _core_.SizerItem_GetProportion(*args, **kwargs)
10804
10805 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10806 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10807 def SetFlag(*args, **kwargs):
10808 """
10809 SetFlag(self, int flag)
10810
10811 Set the flag value for this item.
10812 """
10813 return _core_.SizerItem_SetFlag(*args, **kwargs)
10814
10815 def GetFlag(*args, **kwargs):
10816 """
10817 GetFlag(self) -> int
10818
10819 Get the flag value for this item.
10820 """
10821 return _core_.SizerItem_GetFlag(*args, **kwargs)
10822
10823 def SetBorder(*args, **kwargs):
10824 """
10825 SetBorder(self, int border)
10826
10827 Set the border value for this item.
10828 """
10829 return _core_.SizerItem_SetBorder(*args, **kwargs)
10830
10831 def GetBorder(*args, **kwargs):
10832 """
10833 GetBorder(self) -> int
10834
10835 Get the border value for this item.
10836 """
10837 return _core_.SizerItem_GetBorder(*args, **kwargs)
10838
10839 def GetWindow(*args, **kwargs):
10840 """
10841 GetWindow(self) -> Window
10842
10843 Get the window (if any) that is managed by this sizer item.
10844 """
10845 return _core_.SizerItem_GetWindow(*args, **kwargs)
10846
10847 def SetWindow(*args, **kwargs):
10848 """
10849 SetWindow(self, Window window)
10850
10851 Set the window to be managed by this sizer item.
10852 """
10853 return _core_.SizerItem_SetWindow(*args, **kwargs)
10854
10855 def GetSizer(*args, **kwargs):
10856 """
10857 GetSizer(self) -> Sizer
10858
10859 Get the subsizer (if any) that is managed by this sizer item.
10860 """
10861 return _core_.SizerItem_GetSizer(*args, **kwargs)
10862
10863 def SetSizer(*args, **kwargs):
10864 """
10865 SetSizer(self, Sizer sizer)
10866
10867 Set the subsizer to be managed by this sizer item.
10868 """
10869 return _core_.SizerItem_SetSizer(*args, **kwargs)
10870
10871 def GetSpacer(*args, **kwargs):
10872 """
10873 GetSpacer(self) -> Size
10874
10875 Get the size of the spacer managed by this sizer item.
10876 """
10877 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10878
10879 def SetSpacer(*args, **kwargs):
10880 """
10881 SetSpacer(self, Size size)
10882
10883 Set the size of the spacer to be managed by this sizer item.
10884 """
10885 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10886
10887 def Show(*args, **kwargs):
10888 """
10889 Show(self, bool show)
10890
10891 Set the show item attribute, which sizers use to determine if the item
10892 is to be made part of the layout or not. If the item is tracking a
10893 window then it is shown or hidden as needed.
10894 """
10895 return _core_.SizerItem_Show(*args, **kwargs)
10896
10897 def IsShown(*args, **kwargs):
10898 """
10899 IsShown(self) -> bool
10900
10901 Is the item to be shown in the layout?
10902 """
10903 return _core_.SizerItem_IsShown(*args, **kwargs)
10904
10905 def GetPosition(*args, **kwargs):
10906 """
10907 GetPosition(self) -> Point
10908
10909 Returns the current position of the item, as set in the last Layout.
10910 """
10911 return _core_.SizerItem_GetPosition(*args, **kwargs)
10912
10913 def GetUserData(*args, **kwargs):
10914 """
10915 GetUserData(self) -> PyObject
10916
10917 Returns the userData associated with this sizer item, or None if there
10918 isn't any.
10919 """
10920 return _core_.SizerItem_GetUserData(*args, **kwargs)
10921
10922 def SetUserData(*args, **kwargs):
10923 """
10924 SetUserData(self, PyObject userData)
10925
10926 Associate a Python object with this sizer item.
10927 """
10928 return _core_.SizerItem_SetUserData(*args, **kwargs)
10929
10930 _core_.SizerItem_swigregister(SizerItem)
10931
10932 def SizerItemWindow(*args, **kwargs):
10933 """
10934 SizerItemWindow(Window window, int proportion, int flag, int border,
10935 PyObject userData=None) -> SizerItem
10936
10937 Constructs a `wx.SizerItem` for tracking a window.
10938 """
10939 val = _core_.new_SizerItemWindow(*args, **kwargs)
10940 return val
10941
10942 def SizerItemSpacer(*args, **kwargs):
10943 """
10944 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10945 PyObject userData=None) -> SizerItem
10946
10947 Constructs a `wx.SizerItem` for tracking a spacer.
10948 """
10949 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10950 return val
10951
10952 def SizerItemSizer(*args, **kwargs):
10953 """
10954 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10955 PyObject userData=None) -> SizerItem
10956
10957 Constructs a `wx.SizerItem` for tracking a subsizer
10958 """
10959 val = _core_.new_SizerItemSizer(*args, **kwargs)
10960 return val
10961
10962 class Sizer(Object):
10963 """
10964 wx.Sizer is the abstract base class used for laying out subwindows in
10965 a window. You cannot use wx.Sizer directly; instead, you will have to
10966 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10967 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10968 and `wx.GridBagSizer`.
10969
10970 The concept implemented by sizers in wxWidgets is closely related to
10971 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10972 toolkit or the Qt toolkit. It is based upon the idea of the individual
10973 subwindows reporting their minimal required size and their ability to
10974 get stretched if the size of the parent window has changed. This will
10975 most often mean that the programmer does not set the original size of
10976 a dialog in the beginning, rather the dialog will assigned a sizer and
10977 this sizer will be queried about the recommended size. The sizer in
10978 turn will query its children, which can be normal windows or contorls,
10979 empty space or other sizers, so that a hierarchy of sizers can be
10980 constructed. Note that wxSizer does not derive from wxWindow and thus
10981 do not interfere with tab ordering and requires very little resources
10982 compared to a real window on screen.
10983
10984 What makes sizers so well fitted for use in wxWidgets is the fact that
10985 every control reports its own minimal size and the algorithm can
10986 handle differences in font sizes or different window (dialog item)
10987 sizes on different platforms without problems. If for example the
10988 standard font as well as the overall design of Mac widgets requires
10989 more space than on Windows, then the initial size of a dialog using a
10990 sizer will automatically be bigger on Mac than on Windows.
10991 """
10992 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10993 def __init__(self): raise AttributeError, "No constructor defined"
10994 __repr__ = _swig_repr
10995 __swig_destroy__ = _core_.delete_Sizer
10996 __del__ = lambda self : None;
10997 def _setOORInfo(*args, **kwargs):
10998 """_setOORInfo(self, PyObject _self)"""
10999 return _core_.Sizer__setOORInfo(*args, **kwargs)
11000
11001 def Add(*args, **kwargs):
11002 """
11003 Add(self, item, int proportion=0, int flag=0, int border=0,
11004 PyObject userData=None) -> wx.SizerItem
11005
11006 Appends a child item to the sizer.
11007 """
11008 return _core_.Sizer_Add(*args, **kwargs)
11009
11010 def Insert(*args, **kwargs):
11011 """
11012 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11013 PyObject userData=None) -> wx.SizerItem
11014
11015 Inserts a new item into the list of items managed by this sizer before
11016 the item at index *before*. See `Add` for a description of the parameters.
11017 """
11018 return _core_.Sizer_Insert(*args, **kwargs)
11019
11020 def Prepend(*args, **kwargs):
11021 """
11022 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11023 PyObject userData=None) -> wx.SizerItem
11024
11025 Adds a new item to the begining of the list of sizer items managed by
11026 this sizer. See `Add` for a description of the parameters.
11027 """
11028 return _core_.Sizer_Prepend(*args, **kwargs)
11029
11030 def Remove(*args, **kwargs):
11031 """
11032 Remove(self, item) -> bool
11033
11034 Removes an item from the sizer and destroys it. This method does not
11035 cause any layout or resizing to take place, call `Layout` to update
11036 the layout on screen after removing a child from the sizer. The
11037 *item* parameter can be either a window, a sizer, or the zero-based
11038 index of an item to remove. Returns True if the child item was found
11039 and removed.
11040 """
11041 return _core_.Sizer_Remove(*args, **kwargs)
11042
11043 def Detach(*args, **kwargs):
11044 """
11045 Detach(self, item) -> bool
11046
11047 Detaches an item from the sizer without destroying it. This method
11048 does not cause any layout or resizing to take place, call `Layout` to
11049 do so. The *item* parameter can be either a window, a sizer, or the
11050 zero-based index of the item to be detached. Returns True if the child item
11051 was found and detached.
11052 """
11053 return _core_.Sizer_Detach(*args, **kwargs)
11054
11055 def GetItem(*args, **kwargs):
11056 """
11057 GetItem(self, item) -> wx.SizerItem
11058
11059 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11060 parameter can be either a window, a sizer, or the zero-based index of
11061 the item to be found.
11062 """
11063 return _core_.Sizer_GetItem(*args, **kwargs)
11064
11065 def _SetItemMinSize(*args, **kwargs):
11066 """_SetItemMinSize(self, PyObject item, Size size)"""
11067 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11068
11069 def SetItemMinSize(self, item, *args):
11070 """
11071 SetItemMinSize(self, item, Size size)
11072
11073 Sets the minimum size that will be allocated for an item in the sizer.
11074 The *item* parameter can be either a window, a sizer, or the
11075 zero-based index of the item. If a window or sizer is given then it
11076 will be searched for recursivly in subsizers if neccessary.
11077 """
11078 if len(args) == 2:
11079 # for backward compatibility accept separate width,height args too
11080 return self._SetItemMinSize(item, args)
11081 else:
11082 return self._SetItemMinSize(item, args[0])
11083
11084 def AddItem(*args, **kwargs):
11085 """
11086 AddItem(self, SizerItem item)
11087
11088 Adds a `wx.SizerItem` to the sizer.
11089 """
11090 return _core_.Sizer_AddItem(*args, **kwargs)
11091
11092 def InsertItem(*args, **kwargs):
11093 """
11094 InsertItem(self, int index, SizerItem item)
11095
11096 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11097 """
11098 return _core_.Sizer_InsertItem(*args, **kwargs)
11099
11100 def PrependItem(*args, **kwargs):
11101 """
11102 PrependItem(self, SizerItem item)
11103
11104 Prepends a `wx.SizerItem` to the sizer.
11105 """
11106 return _core_.Sizer_PrependItem(*args, **kwargs)
11107
11108 def AddMany(self, items):
11109 """
11110 AddMany is a convenience method for adding several items
11111 to a sizer at one time. Simply pass it a list of tuples,
11112 where each tuple consists of the parameters that you
11113 would normally pass to the `Add` method.
11114 """
11115 for item in items:
11116 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11117 item = (item, )
11118 self.Add(*item)
11119
11120 # for backwards compatibility only, please do not use in new code
11121 def AddWindow(self, *args, **kw):
11122 """Compatibility alias for `Add`."""
11123 return self.Add(*args, **kw)
11124 def AddSizer(self, *args, **kw):
11125 """Compatibility alias for `Add`."""
11126 return self.Add(*args, **kw)
11127 def AddSpacer(self, *args, **kw):
11128 """Compatibility alias for `Add`."""
11129 return self.Add(*args, **kw)
11130
11131 def PrependWindow(self, *args, **kw):
11132 """Compatibility alias for `Prepend`."""
11133 return self.Prepend(*args, **kw)
11134 def PrependSizer(self, *args, **kw):
11135 """Compatibility alias for `Prepend`."""
11136 return self.Prepend(*args, **kw)
11137 def PrependSpacer(self, *args, **kw):
11138 """Compatibility alias for `Prepend`."""
11139 return self.Prepend(*args, **kw)
11140
11141 def InsertWindow(self, *args, **kw):
11142 """Compatibility alias for `Insert`."""
11143 return self.Insert(*args, **kw)
11144 def InsertSizer(self, *args, **kw):
11145 """Compatibility alias for `Insert`."""
11146 return self.Insert(*args, **kw)
11147 def InsertSpacer(self, *args, **kw):
11148 """Compatibility alias for `Insert`."""
11149 return self.Insert(*args, **kw)
11150
11151 def RemoveWindow(self, *args, **kw):
11152 """Compatibility alias for `Remove`."""
11153 return self.Remove(*args, **kw)
11154 def RemoveSizer(self, *args, **kw):
11155 """Compatibility alias for `Remove`."""
11156 return self.Remove(*args, **kw)
11157 def RemovePos(self, *args, **kw):
11158 """Compatibility alias for `Remove`."""
11159 return self.Remove(*args, **kw)
11160
11161
11162 def SetDimension(*args, **kwargs):
11163 """
11164 SetDimension(self, int x, int y, int width, int height)
11165
11166 Call this to force the sizer to take the given dimension and thus
11167 force the items owned by the sizer to resize themselves according to
11168 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11169 methods.
11170 """
11171 return _core_.Sizer_SetDimension(*args, **kwargs)
11172
11173 def SetMinSize(*args, **kwargs):
11174 """
11175 SetMinSize(self, Size size)
11176
11177 Call this to give the sizer a minimal size. Normally, the sizer will
11178 calculate its minimal size based purely on how much space its children
11179 need. After calling this method `GetMinSize` will return either the
11180 minimal size as requested by its children or the minimal size set
11181 here, depending on which is bigger.
11182 """
11183 return _core_.Sizer_SetMinSize(*args, **kwargs)
11184
11185 def GetSize(*args, **kwargs):
11186 """
11187 GetSize(self) -> Size
11188
11189 Returns the current size of the space managed by the sizer.
11190 """
11191 return _core_.Sizer_GetSize(*args, **kwargs)
11192
11193 def GetPosition(*args, **kwargs):
11194 """
11195 GetPosition(self) -> Point
11196
11197 Returns the current position of the sizer's managed space.
11198 """
11199 return _core_.Sizer_GetPosition(*args, **kwargs)
11200
11201 def GetMinSize(*args, **kwargs):
11202 """
11203 GetMinSize(self) -> Size
11204
11205 Returns the minimal size of the sizer. This is either the combined
11206 minimal size of all the children and their borders or the minimal size
11207 set by SetMinSize, depending on which is bigger.
11208 """
11209 return _core_.Sizer_GetMinSize(*args, **kwargs)
11210
11211 def GetSizeTuple(self):
11212 return self.GetSize().Get()
11213 def GetPositionTuple(self):
11214 return self.GetPosition().Get()
11215 def GetMinSizeTuple(self):
11216 return self.GetMinSize().Get()
11217
11218 def RecalcSizes(*args, **kwargs):
11219 """
11220 RecalcSizes(self)
11221
11222 Using the sizes calculated by `CalcMin` reposition and resize all the
11223 items managed by this sizer. You should not need to call this directly as
11224 it is called by `Layout`.
11225 """
11226 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11227
11228 def CalcMin(*args, **kwargs):
11229 """
11230 CalcMin(self) -> Size
11231
11232 This method is where the sizer will do the actual calculation of its
11233 children's minimal sizes. You should not need to call this directly as
11234 it is called by `Layout`.
11235 """
11236 return _core_.Sizer_CalcMin(*args, **kwargs)
11237
11238 def Layout(*args, **kwargs):
11239 """
11240 Layout(self)
11241
11242 This method will force the recalculation and layout of the items
11243 controlled by the sizer using the current space allocated to the
11244 sizer. Normally this is called automatically from the owning window's
11245 EVT_SIZE handler, but it is also useful to call it from user code when
11246 one of the items in a sizer change size, or items are added or
11247 removed.
11248 """
11249 return _core_.Sizer_Layout(*args, **kwargs)
11250
11251 def Fit(*args, **kwargs):
11252 """
11253 Fit(self, Window window) -> Size
11254
11255 Tell the sizer to resize the *window* to match the sizer's minimal
11256 size. This is commonly done in the constructor of the window itself in
11257 order to set its initial size to match the needs of the children as
11258 determined by the sizer. Returns the new size.
11259
11260 For a top level window this is the total window size, not the client size.
11261 """
11262 return _core_.Sizer_Fit(*args, **kwargs)
11263
11264 def FitInside(*args, **kwargs):
11265 """
11266 FitInside(self, Window window)
11267
11268 Tell the sizer to resize the *virtual size* of the *window* to match the
11269 sizer's minimal size. This will not alter the on screen size of the
11270 window, but may cause the addition/removal/alteration of scrollbars
11271 required to view the virtual area in windows which manage it.
11272
11273 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11274
11275 """
11276 return _core_.Sizer_FitInside(*args, **kwargs)
11277
11278 def SetSizeHints(*args, **kwargs):
11279 """
11280 SetSizeHints(self, Window window)
11281
11282 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11283 match the sizer's minimal size. This is commonly done in the
11284 constructor of the window itself if the window is resizable (as are
11285 many dialogs under Unix and frames on probably all platforms) in order
11286 to prevent the window from being sized smaller than the minimal size
11287 required by the sizer.
11288 """
11289 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11290
11291 def SetVirtualSizeHints(*args, **kwargs):
11292 """
11293 SetVirtualSizeHints(self, Window window)
11294
11295 Tell the sizer to set the minimal size of the window virtual area to
11296 match the sizer's minimal size. For windows with managed scrollbars
11297 this will set them appropriately.
11298
11299 :see: `wx.ScrolledWindow.SetScrollbars`
11300
11301 """
11302 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11303
11304 def Clear(*args, **kwargs):
11305 """
11306 Clear(self, bool deleteWindows=False)
11307
11308 Clear all items from the sizer, optionally destroying the window items
11309 as well.
11310 """
11311 return _core_.Sizer_Clear(*args, **kwargs)
11312
11313 def DeleteWindows(*args, **kwargs):
11314 """
11315 DeleteWindows(self)
11316
11317 Destroy all windows managed by the sizer.
11318 """
11319 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11320
11321 def GetChildren(*args, **kwargs):
11322 """
11323 GetChildren(self) -> list
11324
11325 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11326 """
11327 return _core_.Sizer_GetChildren(*args, **kwargs)
11328
11329 def Show(*args, **kwargs):
11330 """
11331 Show(self, item, bool show=True, bool recursive=false) -> bool
11332
11333 Shows or hides an item managed by the sizer. To make a sizer item
11334 disappear or reappear, use Show followed by `Layout`. The *item*
11335 parameter can be either a window, a sizer, or the zero-based index of
11336 the item. Use the recursive parameter to show or hide an item in a
11337 subsizer. Returns True if the item was found.
11338 """
11339 return _core_.Sizer_Show(*args, **kwargs)
11340
11341 def IsShown(*args, **kwargs):
11342 """
11343 IsShown(self, item)
11344
11345 Determines if the item is currently shown. To make a sizer
11346 item disappear or reappear, use Show followed by `Layout`. The *item*
11347 parameter can be either a window, a sizer, or the zero-based index of
11348 the item.
11349 """
11350 return _core_.Sizer_IsShown(*args, **kwargs)
11351
11352 def Hide(self, item, recursive=False):
11353 """
11354 A convenience method for `Show` (item, False, recursive).
11355 """
11356 return self.Show(item, False, recursive)
11357
11358 def ShowItems(*args, **kwargs):
11359 """
11360 ShowItems(self, bool show)
11361
11362 Recursively call `wx.SizerItem.Show` on all sizer items.
11363 """
11364 return _core_.Sizer_ShowItems(*args, **kwargs)
11365
11366 _core_.Sizer_swigregister(Sizer)
11367
11368 class PySizer(Sizer):
11369 """
11370 wx.PySizer is a special version of `wx.Sizer` that has been
11371 instrumented to allow the C++ virtual methods to be overloaded in
11372 Python derived classes. You would derive from this class if you are
11373 wanting to implement a custom sizer in Python code. Simply implement
11374 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11375 For example::
11376
11377 class MySizer(wx.PySizer):
11378 def __init__(self):
11379 wx.PySizer.__init__(self)
11380
11381 def CalcMin(self):
11382 for item in self.GetChildren():
11383 # calculate the total minimum width and height needed
11384 # by all items in the sizer according to this sizer's
11385 # layout algorithm.
11386 ...
11387 return wx.Size(width, height)
11388
11389 def RecalcSizes(self):
11390 # find the space allotted to this sizer
11391 pos = self.GetPosition()
11392 size = self.GetSize()
11393 for item in self.GetChildren():
11394 # Recalculate (if necessary) the position and size of
11395 # each item and then call item.SetDimension to do the
11396 # actual positioning and sizing of the items within the
11397 # space alloted to this sizer.
11398 ...
11399 item.SetDimension(itemPos, itemSize)
11400
11401
11402 When `Layout` is called it first calls `CalcMin` followed by
11403 `RecalcSizes` so you can optimize a bit by saving the results of
11404 `CalcMin` and reusing them in `RecalcSizes`.
11405
11406 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11407
11408
11409 """
11410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11411 __repr__ = _swig_repr
11412 def __init__(self, *args, **kwargs):
11413 """
11414 __init__(self) -> PySizer
11415
11416 Creates a wx.PySizer. Must be called from the __init__ in the derived
11417 class.
11418 """
11419 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11420 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11421
11422 def _setCallbackInfo(*args, **kwargs):
11423 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11424 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11425
11426 _core_.PySizer_swigregister(PySizer)
11427
11428 #---------------------------------------------------------------------------
11429
11430 class BoxSizer(Sizer):
11431 """
11432 The basic idea behind a box sizer is that windows will most often be
11433 laid out in rather simple basic geometry, typically in a row or a
11434 column or nested hierarchies of either. A wx.BoxSizer will lay out
11435 its items in a simple row or column, depending on the orientation
11436 parameter passed to the constructor.
11437 """
11438 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11439 __repr__ = _swig_repr
11440 def __init__(self, *args, **kwargs):
11441 """
11442 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11443
11444 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11445 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11446 sizer.
11447 """
11448 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11449 self._setOORInfo(self)
11450
11451 def GetOrientation(*args, **kwargs):
11452 """
11453 GetOrientation(self) -> int
11454
11455 Returns the current orientation of the sizer.
11456 """
11457 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11458
11459 def SetOrientation(*args, **kwargs):
11460 """
11461 SetOrientation(self, int orient)
11462
11463 Resets the orientation of the sizer.
11464 """
11465 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11466
11467 _core_.BoxSizer_swigregister(BoxSizer)
11468
11469 #---------------------------------------------------------------------------
11470
11471 class StaticBoxSizer(BoxSizer):
11472 """
11473 wx.StaticBoxSizer derives from and functions identically to the
11474 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11475 manages. Note that this static box must be created separately and
11476 passed to the sizer constructor.
11477 """
11478 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11479 __repr__ = _swig_repr
11480 def __init__(self, *args, **kwargs):
11481 """
11482 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11483
11484 Constructor. It takes an associated static box and the orientation
11485 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11486 ``wx.HORIZONTAL``.
11487 """
11488 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11489 self._setOORInfo(self)
11490
11491 def GetStaticBox(*args, **kwargs):
11492 """
11493 GetStaticBox(self) -> StaticBox
11494
11495 Returns the static box associated with this sizer.
11496 """
11497 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11498
11499 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11500
11501 #---------------------------------------------------------------------------
11502
11503 class GridSizer(Sizer):
11504 """
11505 A grid sizer is a sizer which lays out its children in a
11506 two-dimensional table with all cells having the same size. In other
11507 words, the width of each cell within the grid is the width of the
11508 widest item added to the sizer and the height of each grid cell is the
11509 height of the tallest item. An optional vertical and/or horizontal
11510 gap between items can also be specified (in pixels.)
11511
11512 Items are placed in the cells of the grid in the order they are added,
11513 in row-major order. In other words, the first row is filled first,
11514 then the second, and so on until all items have been added. (If
11515 neccessary, additional rows will be added as items are added.) If you
11516 need to have greater control over the cells that items are placed in
11517 then use the `wx.GridBagSizer`.
11518
11519 """
11520 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11521 __repr__ = _swig_repr
11522 def __init__(self, *args, **kwargs):
11523 """
11524 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11525
11526 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11527 of columns and rows in the sizer - if either of the parameters is
11528 zero, it will be calculated to from the total number of children in
11529 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11530 define extra space between all children.
11531 """
11532 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11533 self._setOORInfo(self)
11534
11535 def SetCols(*args, **kwargs):
11536 """
11537 SetCols(self, int cols)
11538
11539 Sets the number of columns in the sizer.
11540 """
11541 return _core_.GridSizer_SetCols(*args, **kwargs)
11542
11543 def SetRows(*args, **kwargs):
11544 """
11545 SetRows(self, int rows)
11546
11547 Sets the number of rows in the sizer.
11548 """
11549 return _core_.GridSizer_SetRows(*args, **kwargs)
11550
11551 def SetVGap(*args, **kwargs):
11552 """
11553 SetVGap(self, int gap)
11554
11555 Sets the vertical gap (in pixels) between the cells in the sizer.
11556 """
11557 return _core_.GridSizer_SetVGap(*args, **kwargs)
11558
11559 def SetHGap(*args, **kwargs):
11560 """
11561 SetHGap(self, int gap)
11562
11563 Sets the horizontal gap (in pixels) between cells in the sizer
11564 """
11565 return _core_.GridSizer_SetHGap(*args, **kwargs)
11566
11567 def GetCols(*args, **kwargs):
11568 """
11569 GetCols(self) -> int
11570
11571 Returns the number of columns in the sizer.
11572 """
11573 return _core_.GridSizer_GetCols(*args, **kwargs)
11574
11575 def GetRows(*args, **kwargs):
11576 """
11577 GetRows(self) -> int
11578
11579 Returns the number of rows in the sizer.
11580 """
11581 return _core_.GridSizer_GetRows(*args, **kwargs)
11582
11583 def GetVGap(*args, **kwargs):
11584 """
11585 GetVGap(self) -> int
11586
11587 Returns the vertical gap (in pixels) between the cells in the sizer.
11588 """
11589 return _core_.GridSizer_GetVGap(*args, **kwargs)
11590
11591 def GetHGap(*args, **kwargs):
11592 """
11593 GetHGap(self) -> int
11594
11595 Returns the horizontal gap (in pixels) between cells in the sizer.
11596 """
11597 return _core_.GridSizer_GetHGap(*args, **kwargs)
11598
11599 def CalcRowsCols(self):
11600 """
11601 CalcRowsCols() -> (rows, cols)
11602
11603 Calculates how many rows and columns will be in the sizer based
11604 on the current number of items and also the rows, cols specified
11605 in the constructor.
11606 """
11607 nitems = len(self.GetChildren())
11608 rows = self.GetRows()
11609 cols = self.GetCols()
11610 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11611 if cols != 0:
11612 rows = (nitems + cols - 1) / cols
11613 elif rows != 0:
11614 cols = (nitems + rows - 1) / rows
11615 return (rows, cols)
11616
11617 _core_.GridSizer_swigregister(GridSizer)
11618
11619 #---------------------------------------------------------------------------
11620
11621 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11622 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11623 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11624 class FlexGridSizer(GridSizer):
11625 """
11626 A flex grid sizer is a sizer which lays out its children in a
11627 two-dimensional table with all table cells in one row having the same
11628 height and all cells in one column having the same width, but all
11629 rows or all columns are not necessarily the same height or width as in
11630 the `wx.GridSizer`.
11631
11632 wx.FlexGridSizer can also size items equally in one direction but
11633 unequally ("flexibly") in the other. If the sizer is only flexible
11634 in one direction (this can be changed using `SetFlexibleDirection`), it
11635 needs to be decided how the sizer should grow in the other ("non
11636 flexible") direction in order to fill the available space. The
11637 `SetNonFlexibleGrowMode` method serves this purpose.
11638
11639
11640 """
11641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11642 __repr__ = _swig_repr
11643 def __init__(self, *args, **kwargs):
11644 """
11645 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11646
11647 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11648 number of columns and rows in the sizer - if either of the parameters
11649 is zero, it will be calculated to from the total number of children in
11650 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11651 define extra space between all children.
11652 """
11653 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11654 self._setOORInfo(self)
11655
11656 def AddGrowableRow(*args, **kwargs):
11657 """
11658 AddGrowableRow(self, size_t idx, int proportion=0)
11659
11660 Specifies that row *idx* (starting from zero) should be grown if there
11661 is extra space available to the sizer.
11662
11663 The *proportion* parameter has the same meaning as the stretch factor
11664 for the box sizers except that if all proportions are 0, then all
11665 columns are resized equally (instead of not being resized at all).
11666 """
11667 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11668
11669 def RemoveGrowableRow(*args, **kwargs):
11670 """
11671 RemoveGrowableRow(self, size_t idx)
11672
11673 Specifies that row *idx* is no longer growable.
11674 """
11675 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11676
11677 def AddGrowableCol(*args, **kwargs):
11678 """
11679 AddGrowableCol(self, size_t idx, int proportion=0)
11680
11681 Specifies that column *idx* (starting from zero) should be grown if
11682 there is extra space available to the sizer.
11683
11684 The *proportion* parameter has the same meaning as the stretch factor
11685 for the box sizers except that if all proportions are 0, then all
11686 columns are resized equally (instead of not being resized at all).
11687 """
11688 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11689
11690 def RemoveGrowableCol(*args, **kwargs):
11691 """
11692 RemoveGrowableCol(self, size_t idx)
11693
11694 Specifies that column *idx* is no longer growable.
11695 """
11696 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11697
11698 def SetFlexibleDirection(*args, **kwargs):
11699 """
11700 SetFlexibleDirection(self, int direction)
11701
11702 Specifies whether the sizer should flexibly resize its columns, rows,
11703 or both. Argument *direction* can be one of the following values. Any
11704 other value is ignored.
11705
11706 ============== =======================================
11707 wx.VERTICAL Rows are flexibly sized.
11708 wx.HORIZONTAL Columns are flexibly sized.
11709 wx.BOTH Both rows and columns are flexibly sized
11710 (this is the default value).
11711 ============== =======================================
11712
11713 Note that this method does not trigger relayout.
11714
11715 """
11716 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11717
11718 def GetFlexibleDirection(*args, **kwargs):
11719 """
11720 GetFlexibleDirection(self) -> int
11721
11722 Returns a value that specifies whether the sizer
11723 flexibly resizes its columns, rows, or both (default).
11724
11725 :see: `SetFlexibleDirection`
11726 """
11727 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11728
11729 def SetNonFlexibleGrowMode(*args, **kwargs):
11730 """
11731 SetNonFlexibleGrowMode(self, int mode)
11732
11733 Specifies how the sizer should grow in the non-flexible direction if
11734 there is one (so `SetFlexibleDirection` must have been called
11735 previously). Argument *mode* can be one of the following values:
11736
11737 ========================== =================================================
11738 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11739 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11740 `AddGrowableCol` and `AddGrowableRow`. In this
11741 case equal sizing applies to minimum sizes of
11742 columns or rows (this is the default value).
11743 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11744 the non flexible direction, whether they are
11745 growable or not in the flexbile direction.
11746 ========================== =================================================
11747
11748 Note that this method does not trigger relayout.
11749
11750
11751 """
11752 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11753
11754 def GetNonFlexibleGrowMode(*args, **kwargs):
11755 """
11756 GetNonFlexibleGrowMode(self) -> int
11757
11758 Returns the value that specifies how the sizer grows in the
11759 non-flexible direction if there is one.
11760
11761 :see: `SetNonFlexibleGrowMode`
11762 """
11763 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11764
11765 def GetRowHeights(*args, **kwargs):
11766 """
11767 GetRowHeights(self) -> list
11768
11769 Returns a list of integers representing the heights of each of the
11770 rows in the sizer.
11771 """
11772 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11773
11774 def GetColWidths(*args, **kwargs):
11775 """
11776 GetColWidths(self) -> list
11777
11778 Returns a list of integers representing the widths of each of the
11779 columns in the sizer.
11780 """
11781 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11782
11783 _core_.FlexGridSizer_swigregister(FlexGridSizer)
11784
11785 class StdDialogButtonSizer(BoxSizer):
11786 """
11787 A special sizer that knows how to order and position standard buttons
11788 in order to conform to the current platform's standards. You simply
11789 need to add each `wx.Button` to the sizer, and be sure to create the
11790 buttons using the standard ID's. Then call `Realize` and the sizer
11791 will take care of the rest.
11792
11793 """
11794 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11795 __repr__ = _swig_repr
11796 def __init__(self, *args, **kwargs):
11797 """__init__(self) -> StdDialogButtonSizer"""
11798 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11799 def AddButton(*args, **kwargs):
11800 """
11801 AddButton(self, wxButton button)
11802
11803 Use this to add the buttons to this sizer. Do not use the `Add`
11804 method in the base class.
11805 """
11806 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11807
11808 def Realize(*args, **kwargs):
11809 """
11810 Realize(self)
11811
11812 This funciton needs to be called after all the buttons have been added
11813 to the sizer. It will reorder them and position them in a platform
11814 specifc manner.
11815 """
11816 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11817
11818 def SetAffirmativeButton(*args, **kwargs):
11819 """SetAffirmativeButton(self, wxButton button)"""
11820 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11821
11822 def SetNegativeButton(*args, **kwargs):
11823 """SetNegativeButton(self, wxButton button)"""
11824 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11825
11826 def SetCancelButton(*args, **kwargs):
11827 """SetCancelButton(self, wxButton button)"""
11828 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11829
11830 def GetAffirmativeButton(*args, **kwargs):
11831 """GetAffirmativeButton(self) -> wxButton"""
11832 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11833
11834 def GetApplyButton(*args, **kwargs):
11835 """GetApplyButton(self) -> wxButton"""
11836 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11837
11838 def GetNegativeButton(*args, **kwargs):
11839 """GetNegativeButton(self) -> wxButton"""
11840 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11841
11842 def GetCancelButton(*args, **kwargs):
11843 """GetCancelButton(self) -> wxButton"""
11844 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11845
11846 def GetHelpButton(*args, **kwargs):
11847 """GetHelpButton(self) -> wxButton"""
11848 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11849
11850 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11851
11852 #---------------------------------------------------------------------------
11853
11854 class GBPosition(object):
11855 """
11856 This class represents the position of an item in a virtual grid of
11857 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11858 typemaps that will automatically convert from a 2-element sequence of
11859 integers to a wx.GBPosition, so you can use the more pythonic
11860 representation of the position nearly transparently in Python code.
11861 """
11862 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11863 __repr__ = _swig_repr
11864 def __init__(self, *args, **kwargs):
11865 """
11866 __init__(self, int row=0, int col=0) -> GBPosition
11867
11868 This class represents the position of an item in a virtual grid of
11869 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11870 typemaps that will automatically convert from a 2-element sequence of
11871 integers to a wx.GBPosition, so you can use the more pythonic
11872 representation of the position nearly transparently in Python code.
11873 """
11874 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11875 __swig_destroy__ = _core_.delete_GBPosition
11876 __del__ = lambda self : None;
11877 def GetRow(*args, **kwargs):
11878 """GetRow(self) -> int"""
11879 return _core_.GBPosition_GetRow(*args, **kwargs)
11880
11881 def GetCol(*args, **kwargs):
11882 """GetCol(self) -> int"""
11883 return _core_.GBPosition_GetCol(*args, **kwargs)
11884
11885 def SetRow(*args, **kwargs):
11886 """SetRow(self, int row)"""
11887 return _core_.GBPosition_SetRow(*args, **kwargs)
11888
11889 def SetCol(*args, **kwargs):
11890 """SetCol(self, int col)"""
11891 return _core_.GBPosition_SetCol(*args, **kwargs)
11892
11893 def __eq__(*args, **kwargs):
11894 """
11895 __eq__(self, PyObject other) -> bool
11896
11897 Compare GBPosition for equality.
11898 """
11899 return _core_.GBPosition___eq__(*args, **kwargs)
11900
11901 def __ne__(*args, **kwargs):
11902 """
11903 __ne__(self, PyObject other) -> bool
11904
11905 Compare GBPosition for inequality.
11906 """
11907 return _core_.GBPosition___ne__(*args, **kwargs)
11908
11909 def Set(*args, **kwargs):
11910 """Set(self, int row=0, int col=0)"""
11911 return _core_.GBPosition_Set(*args, **kwargs)
11912
11913 def Get(*args, **kwargs):
11914 """Get(self) -> PyObject"""
11915 return _core_.GBPosition_Get(*args, **kwargs)
11916
11917 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11918 def __str__(self): return str(self.Get())
11919 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11920 def __len__(self): return len(self.Get())
11921 def __getitem__(self, index): return self.Get()[index]
11922 def __setitem__(self, index, val):
11923 if index == 0: self.SetRow(val)
11924 elif index == 1: self.SetCol(val)
11925 else: raise IndexError
11926 def __nonzero__(self): return self.Get() != (0,0)
11927 __safe_for_unpickling__ = True
11928 def __reduce__(self): return (wx.GBPosition, self.Get())
11929
11930 row = property(GetRow, SetRow)
11931 col = property(GetCol, SetCol)
11932
11933 _core_.GBPosition_swigregister(GBPosition)
11934
11935 class GBSpan(object):
11936 """
11937 This class is used to hold the row and column spanning attributes of
11938 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11939 automatically convert from a 2-element sequence of integers to a
11940 wx.GBSpan, so you can use the more pythonic representation of the span
11941 nearly transparently in Python code.
11942
11943 """
11944 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11945 __repr__ = _swig_repr
11946 def __init__(self, *args, **kwargs):
11947 """
11948 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11949
11950 Construct a new wxGBSpan, optionally setting the rowspan and
11951 colspan. The default is (1,1). (Meaning that the item occupies one
11952 cell in each direction.
11953 """
11954 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11955 __swig_destroy__ = _core_.delete_GBSpan
11956 __del__ = lambda self : None;
11957 def GetRowspan(*args, **kwargs):
11958 """GetRowspan(self) -> int"""
11959 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11960
11961 def GetColspan(*args, **kwargs):
11962 """GetColspan(self) -> int"""
11963 return _core_.GBSpan_GetColspan(*args, **kwargs)
11964
11965 def SetRowspan(*args, **kwargs):
11966 """SetRowspan(self, int rowspan)"""
11967 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11968
11969 def SetColspan(*args, **kwargs):
11970 """SetColspan(self, int colspan)"""
11971 return _core_.GBSpan_SetColspan(*args, **kwargs)
11972
11973 def __eq__(*args, **kwargs):
11974 """
11975 __eq__(self, PyObject other) -> bool
11976
11977 Compare wxGBSpan for equality.
11978 """
11979 return _core_.GBSpan___eq__(*args, **kwargs)
11980
11981 def __ne__(*args, **kwargs):
11982 """
11983 __ne__(self, PyObject other) -> bool
11984
11985 Compare GBSpan for inequality.
11986 """
11987 return _core_.GBSpan___ne__(*args, **kwargs)
11988
11989 def Set(*args, **kwargs):
11990 """Set(self, int rowspan=1, int colspan=1)"""
11991 return _core_.GBSpan_Set(*args, **kwargs)
11992
11993 def Get(*args, **kwargs):
11994 """Get(self) -> PyObject"""
11995 return _core_.GBSpan_Get(*args, **kwargs)
11996
11997 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11998 def __str__(self): return str(self.Get())
11999 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12000 def __len__(self): return len(self.Get())
12001 def __getitem__(self, index): return self.Get()[index]
12002 def __setitem__(self, index, val):
12003 if index == 0: self.SetRowspan(val)
12004 elif index == 1: self.SetColspan(val)
12005 else: raise IndexError
12006 def __nonzero__(self): return self.Get() != (0,0)
12007 __safe_for_unpickling__ = True
12008 def __reduce__(self): return (wx.GBSpan, self.Get())
12009
12010 rowspan = property(GetRowspan, SetRowspan)
12011 colspan = property(GetColspan, SetColspan)
12012
12013 _core_.GBSpan_swigregister(GBSpan)
12014
12015 class GBSizerItem(SizerItem):
12016 """
12017 The wx.GBSizerItem class is used to track the additional data about
12018 items in a `wx.GridBagSizer` such as the item's position in the grid
12019 and how many rows or columns it spans.
12020
12021 """
12022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12023 __repr__ = _swig_repr
12024 def __init__(self, *args, **kwargs):
12025 """
12026 __init__(self) -> GBSizerItem
12027
12028 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12029 size will need to be set, as well as a position and span before this
12030 item can be used in a Sizer.
12031
12032 You will probably never need to create a wx.GBSizerItem directly as they
12033 are created automatically when the sizer's Add method is called.
12034 """
12035 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12036 __swig_destroy__ = _core_.delete_GBSizerItem
12037 __del__ = lambda self : None;
12038 def GetPos(*args, **kwargs):
12039 """
12040 GetPos(self) -> GBPosition
12041
12042 Get the grid position of the item
12043 """
12044 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12045
12046 def GetPosTuple(self): return self.GetPos().Get()
12047 def GetSpan(*args, **kwargs):
12048 """
12049 GetSpan(self) -> GBSpan
12050
12051 Get the row and column spanning of the item
12052 """
12053 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12054
12055 def GetSpanTuple(self): return self.GetSpan().Get()
12056 def SetPos(*args, **kwargs):
12057 """
12058 SetPos(self, GBPosition pos) -> bool
12059
12060 If the item is already a member of a sizer then first ensure that
12061 there is no other item that would intersect with this one at the new
12062 position, then set the new position. Returns True if the change is
12063 successful and after the next Layout() the item will be moved.
12064 """
12065 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12066
12067 def SetSpan(*args, **kwargs):
12068 """
12069 SetSpan(self, GBSpan span) -> bool
12070
12071 If the item is already a member of a sizer then first ensure that
12072 there is no other item that would intersect with this one with its new
12073 spanning size, then set the new spanning. Returns True if the change
12074 is successful and after the next Layout() the item will be resized.
12075
12076 """
12077 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12078
12079 def Intersects(*args, **kwargs):
12080 """
12081 Intersects(self, GBSizerItem other) -> bool
12082
12083 Returns True if this item and the other item instersect.
12084 """
12085 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12086
12087 def IntersectsPos(*args, **kwargs):
12088 """
12089 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12090
12091 Returns True if the given pos/span would intersect with this item.
12092 """
12093 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12094
12095 def GetEndPos(*args, **kwargs):
12096 """
12097 GetEndPos(self) -> GBPosition
12098
12099 Get the row and column of the endpoint of this item.
12100 """
12101 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12102
12103 def GetGBSizer(*args, **kwargs):
12104 """
12105 GetGBSizer(self) -> GridBagSizer
12106
12107 Get the sizer this item is a member of.
12108 """
12109 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12110
12111 def SetGBSizer(*args, **kwargs):
12112 """
12113 SetGBSizer(self, GridBagSizer sizer)
12114
12115 Set the sizer this item is a member of.
12116 """
12117 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12118
12119 _core_.GBSizerItem_swigregister(GBSizerItem)
12120 DefaultSpan = cvar.DefaultSpan
12121
12122 def GBSizerItemWindow(*args, **kwargs):
12123 """
12124 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12125 int border, PyObject userData=None) -> GBSizerItem
12126
12127 Construct a `wx.GBSizerItem` for a window.
12128 """
12129 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12130 return val
12131
12132 def GBSizerItemSizer(*args, **kwargs):
12133 """
12134 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12135 int border, PyObject userData=None) -> GBSizerItem
12136
12137 Construct a `wx.GBSizerItem` for a sizer
12138 """
12139 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12140 return val
12141
12142 def GBSizerItemSpacer(*args, **kwargs):
12143 """
12144 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12145 int flag, int border, PyObject userData=None) -> GBSizerItem
12146
12147 Construct a `wx.GBSizerItem` for a spacer.
12148 """
12149 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12150 return val
12151
12152 class GridBagSizer(FlexGridSizer):
12153 """
12154 A `wx.Sizer` that can lay out items in a virtual grid like a
12155 `wx.FlexGridSizer` but in this case explicit positioning of the items
12156 is allowed using `wx.GBPosition`, and items can optionally span more
12157 than one row and/or column using `wx.GBSpan`. The total size of the
12158 virtual grid is determined by the largest row and column that items are
12159 positioned at, adjusted for spanning.
12160
12161 """
12162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12163 __repr__ = _swig_repr
12164 def __init__(self, *args, **kwargs):
12165 """
12166 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12167
12168 Constructor, with optional parameters to specify the gap between the
12169 rows and columns.
12170 """
12171 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12172 self._setOORInfo(self)
12173
12174 def Add(*args, **kwargs):
12175 """
12176 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12177 int border=0, userData=None) -> wx.GBSizerItem
12178
12179 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12180 more than one row or column as specified with *span*. The remaining
12181 args behave similarly to `wx.Sizer.Add`.
12182
12183 Returns True if the item was successfully placed at the given cell
12184 position, False if something was already there.
12185
12186 """
12187 return _core_.GridBagSizer_Add(*args, **kwargs)
12188
12189 def AddItem(*args, **kwargs):
12190 """
12191 Add(self, GBSizerItem item) -> wx.GBSizerItem
12192
12193 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12194 the item was successfully placed at its given cell position, False if
12195 something was already there.
12196 """
12197 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12198
12199 def GetCellSize(*args, **kwargs):
12200 """
12201 GetCellSize(self, int row, int col) -> Size
12202
12203 Get the size of the specified cell, including hgap and
12204 vgap. Only valid after a Layout.
12205 """
12206 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12207
12208 def GetEmptyCellSize(*args, **kwargs):
12209 """
12210 GetEmptyCellSize(self) -> Size
12211
12212 Get the size used for cells in the grid with no item.
12213 """
12214 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12215
12216 def SetEmptyCellSize(*args, **kwargs):
12217 """
12218 SetEmptyCellSize(self, Size sz)
12219
12220 Set the size used for cells in the grid with no item.
12221 """
12222 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12223
12224 def GetItemPosition(*args):
12225 """
12226 GetItemPosition(self, item) -> GBPosition
12227
12228 Get the grid position of the specified *item* where *item* is either a
12229 window or subsizer that is a member of this sizer, or a zero-based
12230 index of an item.
12231 """
12232 return _core_.GridBagSizer_GetItemPosition(*args)
12233
12234 def SetItemPosition(*args):
12235 """
12236 SetItemPosition(self, item, GBPosition pos) -> bool
12237
12238 Set the grid position of the specified *item* where *item* is either a
12239 window or subsizer that is a member of this sizer, or a zero-based
12240 index of an item. Returns True on success. If the move is not
12241 allowed (because an item is already there) then False is returned.
12242
12243 """
12244 return _core_.GridBagSizer_SetItemPosition(*args)
12245
12246 def GetItemSpan(*args):
12247 """
12248 GetItemSpan(self, item) -> GBSpan
12249
12250 Get the row/col spanning of the specified *item* where *item* is
12251 either a window or subsizer that is a member of this sizer, or a
12252 zero-based index of an item.
12253 """
12254 return _core_.GridBagSizer_GetItemSpan(*args)
12255
12256 def SetItemSpan(*args):
12257 """
12258 SetItemSpan(self, item, GBSpan span) -> bool
12259
12260 Set the row/col spanning of the specified *item* where *item* is
12261 either a window or subsizer that is a member of this sizer, or a
12262 zero-based index of an item. Returns True on success. If the move is
12263 not allowed (because an item is already there) then False is returned.
12264 """
12265 return _core_.GridBagSizer_SetItemSpan(*args)
12266
12267 def FindItem(*args):
12268 """
12269 FindItem(self, item) -> GBSizerItem
12270
12271 Find the sizer item for the given window or subsizer, returns None if
12272 not found. (non-recursive)
12273 """
12274 return _core_.GridBagSizer_FindItem(*args)
12275
12276 def FindItemAtPosition(*args, **kwargs):
12277 """
12278 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12279
12280 Return the sizer item for the given grid cell, or None if there is no
12281 item at that position. (non-recursive)
12282 """
12283 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12284
12285 def FindItemAtPoint(*args, **kwargs):
12286 """
12287 FindItemAtPoint(self, Point pt) -> GBSizerItem
12288
12289 Return the sizer item located at the point given in *pt*, or None if
12290 there is no item at that point. The (x,y) coordinates in pt correspond
12291 to the client coordinates of the window using the sizer for
12292 layout. (non-recursive)
12293 """
12294 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12295
12296 def CheckForIntersection(*args, **kwargs):
12297 """
12298 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12299
12300 Look at all items and see if any intersect (or would overlap) the
12301 given *item*. Returns True if so, False if there would be no overlap.
12302 If an *excludeItem* is given then it will not be checked for
12303 intersection, for example it may be the item we are checking the
12304 position of.
12305
12306 """
12307 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12308
12309 def CheckForIntersectionPos(*args, **kwargs):
12310 """
12311 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12312
12313 Look at all items and see if any intersect (or would overlap) the
12314 given position and span. Returns True if so, False if there would be
12315 no overlap. If an *excludeItem* is given then it will not be checked
12316 for intersection, for example it may be the item we are checking the
12317 position of.
12318 """
12319 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12320
12321 _core_.GridBagSizer_swigregister(GridBagSizer)
12322
12323 #---------------------------------------------------------------------------
12324
12325 Left = _core_.Left
12326 Top = _core_.Top
12327 Right = _core_.Right
12328 Bottom = _core_.Bottom
12329 Width = _core_.Width
12330 Height = _core_.Height
12331 Centre = _core_.Centre
12332 Center = _core_.Center
12333 CentreX = _core_.CentreX
12334 CentreY = _core_.CentreY
12335 Unconstrained = _core_.Unconstrained
12336 AsIs = _core_.AsIs
12337 PercentOf = _core_.PercentOf
12338 Above = _core_.Above
12339 Below = _core_.Below
12340 LeftOf = _core_.LeftOf
12341 RightOf = _core_.RightOf
12342 SameAs = _core_.SameAs
12343 Absolute = _core_.Absolute
12344 class IndividualLayoutConstraint(Object):
12345 """
12346 Objects of this class are stored in the `wx.LayoutConstraints` class as
12347 one of eight possible constraints that a window can be involved in.
12348 You will never need to create an instance of
12349 wx.IndividualLayoutConstraint, rather you should create a
12350 `wx.LayoutConstraints` instance and use the individual contstraints
12351 that it contains.
12352 """
12353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12354 def __init__(self): raise AttributeError, "No constructor defined"
12355 __repr__ = _swig_repr
12356 def Set(*args, **kwargs):
12357 """
12358 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12359
12360 Sets the properties of the constraint. Normally called by one of the
12361 convenience functions such as Above, RightOf, SameAs.
12362 """
12363 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12364
12365 def LeftOf(*args, **kwargs):
12366 """
12367 LeftOf(self, Window sibling, int marg=0)
12368
12369 Constrains this edge to be to the left of the given window, with an
12370 optional margin. Implicitly, this is relative to the left edge of the
12371 other window.
12372 """
12373 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12374
12375 def RightOf(*args, **kwargs):
12376 """
12377 RightOf(self, Window sibling, int marg=0)
12378
12379 Constrains this edge to be to the right of the given window, with an
12380 optional margin. Implicitly, this is relative to the right edge of the
12381 other window.
12382 """
12383 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12384
12385 def Above(*args, **kwargs):
12386 """
12387 Above(self, Window sibling, int marg=0)
12388
12389 Constrains this edge to be above the given window, with an optional
12390 margin. Implicitly, this is relative to the top edge of the other
12391 window.
12392 """
12393 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12394
12395 def Below(*args, **kwargs):
12396 """
12397 Below(self, Window sibling, int marg=0)
12398
12399 Constrains this edge to be below the given window, with an optional
12400 margin. Implicitly, this is relative to the bottom edge of the other
12401 window.
12402 """
12403 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12404
12405 def SameAs(*args, **kwargs):
12406 """
12407 SameAs(self, Window otherW, int edge, int marg=0)
12408
12409 Constrains this edge or dimension to be to the same as the edge of the
12410 given window, with an optional margin.
12411 """
12412 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12413
12414 def PercentOf(*args, **kwargs):
12415 """
12416 PercentOf(self, Window otherW, int wh, int per)
12417
12418 Constrains this edge or dimension to be to a percentage of the given
12419 window, with an optional margin.
12420 """
12421 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12422
12423 def Absolute(*args, **kwargs):
12424 """
12425 Absolute(self, int val)
12426
12427 Constrains this edge or dimension to be the given absolute value.
12428 """
12429 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12430
12431 def Unconstrained(*args, **kwargs):
12432 """
12433 Unconstrained(self)
12434
12435 Sets this edge or dimension to be unconstrained, that is, dependent on
12436 other edges and dimensions from which this value can be deduced.
12437 """
12438 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12439
12440 def AsIs(*args, **kwargs):
12441 """
12442 AsIs(self)
12443
12444 Sets this edge or constraint to be whatever the window's value is at
12445 the moment. If either of the width and height constraints are *as is*,
12446 the window will not be resized, but moved instead. This is important
12447 when considering panel items which are intended to have a default
12448 size, such as a button, which may take its size from the size of the
12449 button label.
12450 """
12451 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12452
12453 def GetOtherWindow(*args, **kwargs):
12454 """GetOtherWindow(self) -> Window"""
12455 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12456
12457 def GetMyEdge(*args, **kwargs):
12458 """GetMyEdge(self) -> int"""
12459 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12460
12461 def SetEdge(*args, **kwargs):
12462 """SetEdge(self, int which)"""
12463 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12464
12465 def SetValue(*args, **kwargs):
12466 """SetValue(self, int v)"""
12467 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12468
12469 def GetMargin(*args, **kwargs):
12470 """GetMargin(self) -> int"""
12471 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12472
12473 def SetMargin(*args, **kwargs):
12474 """SetMargin(self, int m)"""
12475 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12476
12477 def GetValue(*args, **kwargs):
12478 """GetValue(self) -> int"""
12479 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12480
12481 def GetPercent(*args, **kwargs):
12482 """GetPercent(self) -> int"""
12483 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12484
12485 def GetOtherEdge(*args, **kwargs):
12486 """GetOtherEdge(self) -> int"""
12487 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12488
12489 def GetDone(*args, **kwargs):
12490 """GetDone(self) -> bool"""
12491 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12492
12493 def SetDone(*args, **kwargs):
12494 """SetDone(self, bool d)"""
12495 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12496
12497 def GetRelationship(*args, **kwargs):
12498 """GetRelationship(self) -> int"""
12499 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12500
12501 def SetRelationship(*args, **kwargs):
12502 """SetRelationship(self, int r)"""
12503 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12504
12505 def ResetIfWin(*args, **kwargs):
12506 """
12507 ResetIfWin(self, Window otherW) -> bool
12508
12509 Reset constraint if it mentions otherWin
12510 """
12511 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12512
12513 def SatisfyConstraint(*args, **kwargs):
12514 """
12515 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12516
12517 Try to satisfy constraint
12518 """
12519 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12520
12521 def GetEdge(*args, **kwargs):
12522 """
12523 GetEdge(self, int which, Window thisWin, Window other) -> int
12524
12525 Get the value of this edge or dimension, or if this
12526 is not determinable, -1.
12527 """
12528 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12529
12530 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12531
12532 class LayoutConstraints(Object):
12533 """
12534 **Note:** constraints are now deprecated and you should use sizers
12535 instead.
12536
12537 Objects of this class can be associated with a window to define its
12538 layout constraints, with respect to siblings or its parent.
12539
12540 The class consists of the following eight constraints of class
12541 wx.IndividualLayoutConstraint, some or all of which should be accessed
12542 directly to set the appropriate constraints.
12543
12544 * left: represents the left hand edge of the window
12545 * right: represents the right hand edge of the window
12546 * top: represents the top edge of the window
12547 * bottom: represents the bottom edge of the window
12548 * width: represents the width of the window
12549 * height: represents the height of the window
12550 * centreX: represents the horizontal centre point of the window
12551 * centreY: represents the vertical centre point of the window
12552
12553 Most constraints are initially set to have the relationship
12554 wxUnconstrained, which means that their values should be calculated by
12555 looking at known constraints. The exceptions are width and height,
12556 which are set to wxAsIs to ensure that if the user does not specify a
12557 constraint, the existing width and height will be used, to be
12558 compatible with panel items which often have take a default size. If
12559 the constraint is ``wx.AsIs``, the dimension will not be changed.
12560
12561 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12562
12563 """
12564 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12565 __repr__ = _swig_repr
12566 left = property(_core_.LayoutConstraints_left_get)
12567 top = property(_core_.LayoutConstraints_top_get)
12568 right = property(_core_.LayoutConstraints_right_get)
12569 bottom = property(_core_.LayoutConstraints_bottom_get)
12570 width = property(_core_.LayoutConstraints_width_get)
12571 height = property(_core_.LayoutConstraints_height_get)
12572 centreX = property(_core_.LayoutConstraints_centreX_get)
12573 centreY = property(_core_.LayoutConstraints_centreY_get)
12574 def __init__(self, *args, **kwargs):
12575 """__init__(self) -> LayoutConstraints"""
12576 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12577 __swig_destroy__ = _core_.delete_LayoutConstraints
12578 __del__ = lambda self : None;
12579 def SatisfyConstraints(*args, **kwargs):
12580 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12581 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12582
12583 def AreSatisfied(*args, **kwargs):
12584 """AreSatisfied(self) -> bool"""
12585 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12586
12587 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12588
12589 #----------------------------------------------------------------------------
12590
12591 # Use Python's bool constants if available, make some if not
12592 try:
12593 True
12594 except NameError:
12595 __builtins__.True = 1==1
12596 __builtins__.False = 1==0
12597 def bool(value): return not not value
12598 __builtins__.bool = bool
12599
12600
12601
12602 # workarounds for bad wxRTTI names
12603 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12604 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12605 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12606
12607
12608 #----------------------------------------------------------------------------
12609 # Load version numbers from __version__... Ensure that major and minor
12610 # versions are the same for both wxPython and wxWidgets.
12611
12612 from __version__ import *
12613 __version__ = VERSION_STRING
12614
12615 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12616 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12617 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12618 import warnings
12619 warnings.warn("wxPython/wxWidgets release number mismatch")
12620
12621 #----------------------------------------------------------------------------
12622
12623 # Set wxPython's default string<-->unicode conversion encoding from
12624 # the locale, but only if Python's default hasn't been changed. (We
12625 # assume that if the user has customized it already then that is the
12626 # encoding we need to use as well.)
12627 #
12628 # The encoding selected here is used when string or unicode objects
12629 # need to be converted in order to pass them to wxWidgets. Please be
12630 # aware that the default encoding within the same locale may be
12631 # slightly different on different platforms. For example, please see
12632 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12633 # between the common latin/roman encodings.
12634
12635 default = _sys.getdefaultencoding()
12636 if default == 'ascii':
12637 import locale
12638 import codecs
12639 try:
12640 default = locale.getdefaultlocale()[1]
12641 codecs.lookup(default)
12642 except (ValueError, LookupError, TypeError):
12643 default = _sys.getdefaultencoding()
12644 del locale
12645 del codecs
12646 if default:
12647 wx.SetDefaultPyEncoding(default)
12648 del default
12649
12650 #----------------------------------------------------------------------------
12651
12652 class PyDeadObjectError(AttributeError):
12653 pass
12654
12655 class _wxPyDeadObject(object):
12656 """
12657 Instances of wx objects that are OOR capable will have their __class__
12658 changed to this class when the C++ object is deleted. This should help
12659 prevent crashes due to referencing a bogus C++ pointer.
12660 """
12661 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12662 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12663
12664 def __repr__(self):
12665 if not hasattr(self, "_name"):
12666 self._name = "[unknown]"
12667 return self.reprStr % self._name
12668
12669 def __getattr__(self, *args):
12670 if not hasattr(self, "_name"):
12671 self._name = "[unknown]"
12672 raise PyDeadObjectError(self.attrStr % self._name)
12673
12674 def __nonzero__(self):
12675 return 0
12676
12677
12678
12679 class PyUnbornObjectError(AttributeError):
12680 pass
12681
12682 class _wxPyUnbornObject(object):
12683 """
12684 Some stock objects are created when the wx._core module is
12685 imported, but their C++ instance is not created until the wx.App
12686 object is created and initialized. These object instances will
12687 temporarily have their __class__ changed to this class so an
12688 exception will be raised if they are used before the C++ instance
12689 is ready.
12690 """
12691
12692 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12693 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12694
12695 def __repr__(self):
12696 #if not hasattr(self, "_name"):
12697 # self._name = "[unknown]"
12698 return self.reprStr #% self._name
12699
12700 def __getattr__(self, *args):
12701 #if not hasattr(self, "_name"):
12702 # self._name = "[unknown]"
12703 raise PyUnbornObjectError(self.attrStr) # % self._name )
12704
12705 def __nonzero__(self):
12706 return 0
12707
12708
12709 #----------------------------------------------------------------------------
12710
12711 def CallAfter(callable, *args, **kw):
12712 """
12713 Call the specified function after the current and pending event
12714 handlers have been completed. This is also good for making GUI
12715 method calls from non-GUI threads. Any extra positional or
12716 keyword args are passed on to the callable when it is called.
12717
12718 :see: `wx.FutureCall`
12719 """
12720 app = wx.GetApp()
12721 assert app is not None, 'No wx.App created yet'
12722
12723 if not hasattr(app, "_CallAfterId"):
12724 app._CallAfterId = wx.NewEventType()
12725 app.Connect(-1, -1, app._CallAfterId,
12726 lambda event: event.callable(*event.args, **event.kw) )
12727 evt = wx.PyEvent()
12728 evt.SetEventType(app._CallAfterId)
12729 evt.callable = callable
12730 evt.args = args
12731 evt.kw = kw
12732 wx.PostEvent(app, evt)
12733
12734 #----------------------------------------------------------------------------
12735
12736
12737 class FutureCall:
12738 """
12739 A convenience class for `wx.Timer`, that calls the given callable
12740 object once after the given amount of milliseconds, passing any
12741 positional or keyword args. The return value of the callable is
12742 availbale after it has been run with the `GetResult` method.
12743
12744 If you don't need to get the return value or restart the timer
12745 then there is no need to hold a reference to this object. It will
12746 hold a reference to itself while the timer is running (the timer
12747 has a reference to self.Notify) but the cycle will be broken when
12748 the timer completes, automatically cleaning up the wx.FutureCall
12749 object.
12750
12751 :see: `wx.CallAfter`
12752 """
12753 def __init__(self, millis, callable, *args, **kwargs):
12754 self.millis = millis
12755 self.callable = callable
12756 self.SetArgs(*args, **kwargs)
12757 self.runCount = 0
12758 self.running = False
12759 self.hasRun = False
12760 self.result = None
12761 self.timer = None
12762 self.Start()
12763
12764 def __del__(self):
12765 self.Stop()
12766
12767
12768 def Start(self, millis=None, *args, **kwargs):
12769 """
12770 (Re)start the timer
12771 """
12772 self.hasRun = False
12773 if millis is not None:
12774 self.millis = millis
12775 if args or kwargs:
12776 self.SetArgs(*args, **kwargs)
12777 self.Stop()
12778 self.timer = wx.PyTimer(self.Notify)
12779 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12780 self.running = True
12781 Restart = Start
12782
12783
12784 def Stop(self):
12785 """
12786 Stop and destroy the timer.
12787 """
12788 if self.timer is not None:
12789 self.timer.Stop()
12790 self.timer = None
12791
12792
12793 def GetInterval(self):
12794 if self.timer is not None:
12795 return self.timer.GetInterval()
12796 else:
12797 return 0
12798
12799
12800 def IsRunning(self):
12801 return self.timer is not None and self.timer.IsRunning()
12802
12803
12804 def SetArgs(self, *args, **kwargs):
12805 """
12806 (Re)set the args passed to the callable object. This is
12807 useful in conjunction with Restart if you want to schedule a
12808 new call to the same callable object but with different
12809 parameters.
12810 """
12811 self.args = args
12812 self.kwargs = kwargs
12813
12814
12815 def HasRun(self):
12816 return self.hasRun
12817
12818 def GetResult(self):
12819 return self.result
12820
12821 def Notify(self):
12822 """
12823 The timer has expired so call the callable.
12824 """
12825 if self.callable and getattr(self.callable, 'im_self', True):
12826 self.runCount += 1
12827 self.running = False
12828 self.result = self.callable(*self.args, **self.kwargs)
12829 self.hasRun = True
12830 if not self.running:
12831 # if it wasn't restarted, then cleanup
12832 wx.CallAfter(self.Stop)
12833
12834
12835
12836 #----------------------------------------------------------------------------
12837 # Control which items in this module should be documented by epydoc.
12838 # We allow only classes and functions, which will help reduce the size
12839 # of the docs by filtering out the zillions of constants, EVT objects,
12840 # and etc that don't make much sense by themselves, but are instead
12841 # documented (or will be) as part of the classes/functions/methods
12842 # where they should be used.
12843
12844 class __DocFilter:
12845 """
12846 A filter for epydoc that only allows non-Ptr classes and
12847 fucntions, in order to reduce the clutter in the API docs.
12848 """
12849 def __init__(self, globals):
12850 self._globals = globals
12851
12852 def __call__(self, name):
12853 import types
12854 obj = self._globals.get(name, None)
12855 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12856 return False
12857 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12858 return False
12859 return True
12860
12861 #----------------------------------------------------------------------------
12862 #----------------------------------------------------------------------------
12863
12864 # Import other modules in this package that should show up in the
12865 # "core" wx namespace
12866 from _gdi import *
12867 from _windows import *
12868 from _controls import *
12869 from _misc import *
12870
12871 #----------------------------------------------------------------------------
12872 #----------------------------------------------------------------------------
12873
12874
12875