]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
Added wxCB_FILENAME
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 PROCESS_ENTER = _core_.PROCESS_ENTER
120 PASSWORD = _core_.PASSWORD
121 CB_SIMPLE = _core_.CB_SIMPLE
122 CB_DROPDOWN = _core_.CB_DROPDOWN
123 CB_SORT = _core_.CB_SORT
124 CB_READONLY = _core_.CB_READONLY
125 RA_HORIZONTAL = _core_.RA_HORIZONTAL
126 RA_VERTICAL = _core_.RA_VERTICAL
127 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130 RB_GROUP = _core_.RB_GROUP
131 RB_SINGLE = _core_.RB_SINGLE
132 SB_HORIZONTAL = _core_.SB_HORIZONTAL
133 SB_VERTICAL = _core_.SB_VERTICAL
134 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135 ST_SIZEGRIP = _core_.ST_SIZEGRIP
136 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138 ST_DOTS_END = _core_.ST_DOTS_END
139 FLOOD_SURFACE = _core_.FLOOD_SURFACE
140 FLOOD_BORDER = _core_.FLOOD_BORDER
141 ODDEVEN_RULE = _core_.ODDEVEN_RULE
142 WINDING_RULE = _core_.WINDING_RULE
143 TOOL_TOP = _core_.TOOL_TOP
144 TOOL_BOTTOM = _core_.TOOL_BOTTOM
145 TOOL_LEFT = _core_.TOOL_LEFT
146 TOOL_RIGHT = _core_.TOOL_RIGHT
147 OK = _core_.OK
148 YES_NO = _core_.YES_NO
149 CANCEL = _core_.CANCEL
150 YES = _core_.YES
151 NO = _core_.NO
152 NO_DEFAULT = _core_.NO_DEFAULT
153 YES_DEFAULT = _core_.YES_DEFAULT
154 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155 ICON_HAND = _core_.ICON_HAND
156 ICON_QUESTION = _core_.ICON_QUESTION
157 ICON_INFORMATION = _core_.ICON_INFORMATION
158 ICON_STOP = _core_.ICON_STOP
159 ICON_ASTERISK = _core_.ICON_ASTERISK
160 ICON_MASK = _core_.ICON_MASK
161 ICON_WARNING = _core_.ICON_WARNING
162 ICON_ERROR = _core_.ICON_ERROR
163 FORWARD = _core_.FORWARD
164 BACKWARD = _core_.BACKWARD
165 RESET = _core_.RESET
166 HELP = _core_.HELP
167 MORE = _core_.MORE
168 SETUP = _core_.SETUP
169 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171 SIZE_AUTO = _core_.SIZE_AUTO
172 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE = _core_.SIZE_FORCE
175 PORTRAIT = _core_.PORTRAIT
176 LANDSCAPE = _core_.LANDSCAPE
177 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181 ID_ANY = _core_.ID_ANY
182 ID_SEPARATOR = _core_.ID_SEPARATOR
183 ID_NONE = _core_.ID_NONE
184 ID_LOWEST = _core_.ID_LOWEST
185 ID_OPEN = _core_.ID_OPEN
186 ID_CLOSE = _core_.ID_CLOSE
187 ID_NEW = _core_.ID_NEW
188 ID_SAVE = _core_.ID_SAVE
189 ID_SAVEAS = _core_.ID_SAVEAS
190 ID_REVERT = _core_.ID_REVERT
191 ID_EXIT = _core_.ID_EXIT
192 ID_UNDO = _core_.ID_UNDO
193 ID_REDO = _core_.ID_REDO
194 ID_HELP = _core_.ID_HELP
195 ID_PRINT = _core_.ID_PRINT
196 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197 ID_PREVIEW = _core_.ID_PREVIEW
198 ID_ABOUT = _core_.ID_ABOUT
199 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
200 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
201 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
202 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
203 ID_HELP_INDEX = _core_.ID_HELP_INDEX
204 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
205 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
206 ID_PREFERENCES = _core_.ID_PREFERENCES
207 ID_CUT = _core_.ID_CUT
208 ID_COPY = _core_.ID_COPY
209 ID_PASTE = _core_.ID_PASTE
210 ID_CLEAR = _core_.ID_CLEAR
211 ID_FIND = _core_.ID_FIND
212 ID_DUPLICATE = _core_.ID_DUPLICATE
213 ID_SELECTALL = _core_.ID_SELECTALL
214 ID_DELETE = _core_.ID_DELETE
215 ID_REPLACE = _core_.ID_REPLACE
216 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
217 ID_PROPERTIES = _core_.ID_PROPERTIES
218 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
219 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
220 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
221 ID_VIEW_LIST = _core_.ID_VIEW_LIST
222 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
223 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
224 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
225 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
226 ID_FILE1 = _core_.ID_FILE1
227 ID_FILE2 = _core_.ID_FILE2
228 ID_FILE3 = _core_.ID_FILE3
229 ID_FILE4 = _core_.ID_FILE4
230 ID_FILE5 = _core_.ID_FILE5
231 ID_FILE6 = _core_.ID_FILE6
232 ID_FILE7 = _core_.ID_FILE7
233 ID_FILE8 = _core_.ID_FILE8
234 ID_FILE9 = _core_.ID_FILE9
235 ID_OK = _core_.ID_OK
236 ID_CANCEL = _core_.ID_CANCEL
237 ID_APPLY = _core_.ID_APPLY
238 ID_YES = _core_.ID_YES
239 ID_NO = _core_.ID_NO
240 ID_STATIC = _core_.ID_STATIC
241 ID_FORWARD = _core_.ID_FORWARD
242 ID_BACKWARD = _core_.ID_BACKWARD
243 ID_DEFAULT = _core_.ID_DEFAULT
244 ID_MORE = _core_.ID_MORE
245 ID_SETUP = _core_.ID_SETUP
246 ID_RESET = _core_.ID_RESET
247 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
248 ID_YESTOALL = _core_.ID_YESTOALL
249 ID_NOTOALL = _core_.ID_NOTOALL
250 ID_ABORT = _core_.ID_ABORT
251 ID_RETRY = _core_.ID_RETRY
252 ID_IGNORE = _core_.ID_IGNORE
253 ID_ADD = _core_.ID_ADD
254 ID_REMOVE = _core_.ID_REMOVE
255 ID_UP = _core_.ID_UP
256 ID_DOWN = _core_.ID_DOWN
257 ID_HOME = _core_.ID_HOME
258 ID_REFRESH = _core_.ID_REFRESH
259 ID_STOP = _core_.ID_STOP
260 ID_INDEX = _core_.ID_INDEX
261 ID_BOLD = _core_.ID_BOLD
262 ID_ITALIC = _core_.ID_ITALIC
263 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
264 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
265 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
266 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
267 ID_UNDERLINE = _core_.ID_UNDERLINE
268 ID_INDENT = _core_.ID_INDENT
269 ID_UNINDENT = _core_.ID_UNINDENT
270 ID_ZOOM_100 = _core_.ID_ZOOM_100
271 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
272 ID_ZOOM_IN = _core_.ID_ZOOM_IN
273 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
274 ID_UNDELETE = _core_.ID_UNDELETE
275 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
276 ID_HIGHEST = _core_.ID_HIGHEST
277 ACCEL_ALT = _core_.ACCEL_ALT
278 ACCEL_CTRL = _core_.ACCEL_CTRL
279 ACCEL_SHIFT = _core_.ACCEL_SHIFT
280 ACCEL_NORMAL = _core_.ACCEL_NORMAL
281 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
282 PD_APP_MODAL = _core_.PD_APP_MODAL
283 PD_CAN_ABORT = _core_.PD_CAN_ABORT
284 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
285 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
286 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
287 PD_SMOOTH = _core_.PD_SMOOTH
288 PD_CAN_SKIP = _core_.PD_CAN_SKIP
289 MENU_TEAROFF = _core_.MENU_TEAROFF
290 MB_DOCKABLE = _core_.MB_DOCKABLE
291 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
292 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
293 LI_HORIZONTAL = _core_.LI_HORIZONTAL
294 LI_VERTICAL = _core_.LI_VERTICAL
295 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
296 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
297 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
298 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
299 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
300 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
301 MM_TEXT = _core_.MM_TEXT
302 MM_LOMETRIC = _core_.MM_LOMETRIC
303 MM_HIMETRIC = _core_.MM_HIMETRIC
304 MM_LOENGLISH = _core_.MM_LOENGLISH
305 MM_HIENGLISH = _core_.MM_HIENGLISH
306 MM_TWIPS = _core_.MM_TWIPS
307 MM_ISOTROPIC = _core_.MM_ISOTROPIC
308 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
309 MM_POINTS = _core_.MM_POINTS
310 MM_METRIC = _core_.MM_METRIC
311 CENTRE = _core_.CENTRE
312 CENTER = _core_.CENTER
313 HORIZONTAL = _core_.HORIZONTAL
314 VERTICAL = _core_.VERTICAL
315 BOTH = _core_.BOTH
316 LEFT = _core_.LEFT
317 RIGHT = _core_.RIGHT
318 UP = _core_.UP
319 DOWN = _core_.DOWN
320 TOP = _core_.TOP
321 BOTTOM = _core_.BOTTOM
322 NORTH = _core_.NORTH
323 SOUTH = _core_.SOUTH
324 WEST = _core_.WEST
325 EAST = _core_.EAST
326 ALL = _core_.ALL
327 ALIGN_NOT = _core_.ALIGN_NOT
328 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
329 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
330 ALIGN_LEFT = _core_.ALIGN_LEFT
331 ALIGN_TOP = _core_.ALIGN_TOP
332 ALIGN_RIGHT = _core_.ALIGN_RIGHT
333 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
334 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
335 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
336 ALIGN_CENTER = _core_.ALIGN_CENTER
337 ALIGN_CENTRE = _core_.ALIGN_CENTRE
338 ALIGN_MASK = _core_.ALIGN_MASK
339 STRETCH_NOT = _core_.STRETCH_NOT
340 SHRINK = _core_.SHRINK
341 GROW = _core_.GROW
342 EXPAND = _core_.EXPAND
343 SHAPED = _core_.SHAPED
344 FIXED_MINSIZE = _core_.FIXED_MINSIZE
345 TILE = _core_.TILE
346 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
347 BORDER_DEFAULT = _core_.BORDER_DEFAULT
348 BORDER_NONE = _core_.BORDER_NONE
349 BORDER_STATIC = _core_.BORDER_STATIC
350 BORDER_SIMPLE = _core_.BORDER_SIMPLE
351 BORDER_RAISED = _core_.BORDER_RAISED
352 BORDER_SUNKEN = _core_.BORDER_SUNKEN
353 BORDER_DOUBLE = _core_.BORDER_DOUBLE
354 BORDER_MASK = _core_.BORDER_MASK
355 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
356 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
357 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
358 DEFAULT = _core_.DEFAULT
359 DECORATIVE = _core_.DECORATIVE
360 ROMAN = _core_.ROMAN
361 SCRIPT = _core_.SCRIPT
362 SWISS = _core_.SWISS
363 MODERN = _core_.MODERN
364 TELETYPE = _core_.TELETYPE
365 VARIABLE = _core_.VARIABLE
366 FIXED = _core_.FIXED
367 NORMAL = _core_.NORMAL
368 LIGHT = _core_.LIGHT
369 BOLD = _core_.BOLD
370 ITALIC = _core_.ITALIC
371 SLANT = _core_.SLANT
372 SOLID = _core_.SOLID
373 DOT = _core_.DOT
374 LONG_DASH = _core_.LONG_DASH
375 SHORT_DASH = _core_.SHORT_DASH
376 DOT_DASH = _core_.DOT_DASH
377 USER_DASH = _core_.USER_DASH
378 TRANSPARENT = _core_.TRANSPARENT
379 STIPPLE = _core_.STIPPLE
380 STIPPLE_MASK = _core_.STIPPLE_MASK
381 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
382 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
383 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
384 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
385 CROSS_HATCH = _core_.CROSS_HATCH
386 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
387 VERTICAL_HATCH = _core_.VERTICAL_HATCH
388 JOIN_BEVEL = _core_.JOIN_BEVEL
389 JOIN_MITER = _core_.JOIN_MITER
390 JOIN_ROUND = _core_.JOIN_ROUND
391 CAP_ROUND = _core_.CAP_ROUND
392 CAP_PROJECTING = _core_.CAP_PROJECTING
393 CAP_BUTT = _core_.CAP_BUTT
394 CLEAR = _core_.CLEAR
395 XOR = _core_.XOR
396 INVERT = _core_.INVERT
397 OR_REVERSE = _core_.OR_REVERSE
398 AND_REVERSE = _core_.AND_REVERSE
399 COPY = _core_.COPY
400 AND = _core_.AND
401 AND_INVERT = _core_.AND_INVERT
402 NO_OP = _core_.NO_OP
403 NOR = _core_.NOR
404 EQUIV = _core_.EQUIV
405 SRC_INVERT = _core_.SRC_INVERT
406 OR_INVERT = _core_.OR_INVERT
407 NAND = _core_.NAND
408 OR = _core_.OR
409 SET = _core_.SET
410 WXK_BACK = _core_.WXK_BACK
411 WXK_TAB = _core_.WXK_TAB
412 WXK_RETURN = _core_.WXK_RETURN
413 WXK_ESCAPE = _core_.WXK_ESCAPE
414 WXK_SPACE = _core_.WXK_SPACE
415 WXK_DELETE = _core_.WXK_DELETE
416 WXK_START = _core_.WXK_START
417 WXK_LBUTTON = _core_.WXK_LBUTTON
418 WXK_RBUTTON = _core_.WXK_RBUTTON
419 WXK_CANCEL = _core_.WXK_CANCEL
420 WXK_MBUTTON = _core_.WXK_MBUTTON
421 WXK_CLEAR = _core_.WXK_CLEAR
422 WXK_SHIFT = _core_.WXK_SHIFT
423 WXK_ALT = _core_.WXK_ALT
424 WXK_CONTROL = _core_.WXK_CONTROL
425 WXK_MENU = _core_.WXK_MENU
426 WXK_PAUSE = _core_.WXK_PAUSE
427 WXK_CAPITAL = _core_.WXK_CAPITAL
428 WXK_PRIOR = _core_.WXK_PRIOR
429 WXK_NEXT = _core_.WXK_NEXT
430 WXK_END = _core_.WXK_END
431 WXK_HOME = _core_.WXK_HOME
432 WXK_LEFT = _core_.WXK_LEFT
433 WXK_UP = _core_.WXK_UP
434 WXK_RIGHT = _core_.WXK_RIGHT
435 WXK_DOWN = _core_.WXK_DOWN
436 WXK_SELECT = _core_.WXK_SELECT
437 WXK_PRINT = _core_.WXK_PRINT
438 WXK_EXECUTE = _core_.WXK_EXECUTE
439 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
440 WXK_INSERT = _core_.WXK_INSERT
441 WXK_HELP = _core_.WXK_HELP
442 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
443 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
444 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
445 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
446 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
447 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
448 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
449 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
450 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
451 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
452 WXK_MULTIPLY = _core_.WXK_MULTIPLY
453 WXK_ADD = _core_.WXK_ADD
454 WXK_SEPARATOR = _core_.WXK_SEPARATOR
455 WXK_SUBTRACT = _core_.WXK_SUBTRACT
456 WXK_DECIMAL = _core_.WXK_DECIMAL
457 WXK_DIVIDE = _core_.WXK_DIVIDE
458 WXK_F1 = _core_.WXK_F1
459 WXK_F2 = _core_.WXK_F2
460 WXK_F3 = _core_.WXK_F3
461 WXK_F4 = _core_.WXK_F4
462 WXK_F5 = _core_.WXK_F5
463 WXK_F6 = _core_.WXK_F6
464 WXK_F7 = _core_.WXK_F7
465 WXK_F8 = _core_.WXK_F8
466 WXK_F9 = _core_.WXK_F9
467 WXK_F10 = _core_.WXK_F10
468 WXK_F11 = _core_.WXK_F11
469 WXK_F12 = _core_.WXK_F12
470 WXK_F13 = _core_.WXK_F13
471 WXK_F14 = _core_.WXK_F14
472 WXK_F15 = _core_.WXK_F15
473 WXK_F16 = _core_.WXK_F16
474 WXK_F17 = _core_.WXK_F17
475 WXK_F18 = _core_.WXK_F18
476 WXK_F19 = _core_.WXK_F19
477 WXK_F20 = _core_.WXK_F20
478 WXK_F21 = _core_.WXK_F21
479 WXK_F22 = _core_.WXK_F22
480 WXK_F23 = _core_.WXK_F23
481 WXK_F24 = _core_.WXK_F24
482 WXK_NUMLOCK = _core_.WXK_NUMLOCK
483 WXK_SCROLL = _core_.WXK_SCROLL
484 WXK_PAGEUP = _core_.WXK_PAGEUP
485 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
486 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
487 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
488 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
489 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
490 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
491 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
492 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
493 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
494 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
495 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
496 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
497 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
498 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
499 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
500 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
501 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
502 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
503 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
504 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
505 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
506 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
507 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
508 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
509 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
510 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
511 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
512 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
513 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
514 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
515 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
516 WXK_COMMAND = _core_.WXK_COMMAND
517 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
518 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
519 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
520 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
521 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
522 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
523 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
524 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
525 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
526 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
527 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
528 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
529 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
530 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
531 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
532 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
533 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
534 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
535 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
536 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
537 PAPER_NONE = _core_.PAPER_NONE
538 PAPER_LETTER = _core_.PAPER_LETTER
539 PAPER_LEGAL = _core_.PAPER_LEGAL
540 PAPER_A4 = _core_.PAPER_A4
541 PAPER_CSHEET = _core_.PAPER_CSHEET
542 PAPER_DSHEET = _core_.PAPER_DSHEET
543 PAPER_ESHEET = _core_.PAPER_ESHEET
544 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
545 PAPER_TABLOID = _core_.PAPER_TABLOID
546 PAPER_LEDGER = _core_.PAPER_LEDGER
547 PAPER_STATEMENT = _core_.PAPER_STATEMENT
548 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
549 PAPER_A3 = _core_.PAPER_A3
550 PAPER_A4SMALL = _core_.PAPER_A4SMALL
551 PAPER_A5 = _core_.PAPER_A5
552 PAPER_B4 = _core_.PAPER_B4
553 PAPER_B5 = _core_.PAPER_B5
554 PAPER_FOLIO = _core_.PAPER_FOLIO
555 PAPER_QUARTO = _core_.PAPER_QUARTO
556 PAPER_10X14 = _core_.PAPER_10X14
557 PAPER_11X17 = _core_.PAPER_11X17
558 PAPER_NOTE = _core_.PAPER_NOTE
559 PAPER_ENV_9 = _core_.PAPER_ENV_9
560 PAPER_ENV_10 = _core_.PAPER_ENV_10
561 PAPER_ENV_11 = _core_.PAPER_ENV_11
562 PAPER_ENV_12 = _core_.PAPER_ENV_12
563 PAPER_ENV_14 = _core_.PAPER_ENV_14
564 PAPER_ENV_DL = _core_.PAPER_ENV_DL
565 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
566 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
567 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
568 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
569 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
570 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
571 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
572 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
573 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
574 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
575 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
576 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
577 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
578 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
579 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
580 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
581 PAPER_9X11 = _core_.PAPER_9X11
582 PAPER_10X11 = _core_.PAPER_10X11
583 PAPER_15X11 = _core_.PAPER_15X11
584 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
585 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
586 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
587 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
588 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
589 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
590 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
591 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
592 PAPER_A_PLUS = _core_.PAPER_A_PLUS
593 PAPER_B_PLUS = _core_.PAPER_B_PLUS
594 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
595 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
596 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
597 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
598 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
599 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
600 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
601 PAPER_A2 = _core_.PAPER_A2
602 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
603 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
604 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
605 PAPER_A6 = _core_.PAPER_A6
606 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
607 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
608 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
609 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
610 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
611 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
612 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
613 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
614 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
615 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
616 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
617 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
618 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
619 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
620 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
621 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
622 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
623 PAPER_B6_JIS = _core_.PAPER_B6_JIS
624 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
625 PAPER_12X11 = _core_.PAPER_12X11
626 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
627 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
628 PAPER_P16K = _core_.PAPER_P16K
629 PAPER_P32K = _core_.PAPER_P32K
630 PAPER_P32KBIG = _core_.PAPER_P32KBIG
631 PAPER_PENV_1 = _core_.PAPER_PENV_1
632 PAPER_PENV_2 = _core_.PAPER_PENV_2
633 PAPER_PENV_3 = _core_.PAPER_PENV_3
634 PAPER_PENV_4 = _core_.PAPER_PENV_4
635 PAPER_PENV_5 = _core_.PAPER_PENV_5
636 PAPER_PENV_6 = _core_.PAPER_PENV_6
637 PAPER_PENV_7 = _core_.PAPER_PENV_7
638 PAPER_PENV_8 = _core_.PAPER_PENV_8
639 PAPER_PENV_9 = _core_.PAPER_PENV_9
640 PAPER_PENV_10 = _core_.PAPER_PENV_10
641 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
642 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
643 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
644 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
645 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
646 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
647 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
648 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
649 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
650 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
651 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
652 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
653 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
654 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
655 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
656 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
657 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
658 ITEM_NORMAL = _core_.ITEM_NORMAL
659 ITEM_CHECK = _core_.ITEM_CHECK
660 ITEM_RADIO = _core_.ITEM_RADIO
661 ITEM_MAX = _core_.ITEM_MAX
662 HT_NOWHERE = _core_.HT_NOWHERE
663 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
664 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
665 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
666 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
667 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
668 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
669 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
670 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
671 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
672 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
673 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
674 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
675 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
676 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
677 HT_MAX = _core_.HT_MAX
678 MOD_NONE = _core_.MOD_NONE
679 MOD_ALT = _core_.MOD_ALT
680 MOD_CONTROL = _core_.MOD_CONTROL
681 MOD_ALTGR = _core_.MOD_ALTGR
682 MOD_SHIFT = _core_.MOD_SHIFT
683 MOD_META = _core_.MOD_META
684 MOD_WIN = _core_.MOD_WIN
685 MOD_CMD = _core_.MOD_CMD
686 MOD_ALL = _core_.MOD_ALL
687 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
688 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
689 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
690 #---------------------------------------------------------------------------
691
692 class Object(object):
693 """
694 The base class for most wx objects, although in wxPython not
695 much functionality is needed nor exposed.
696 """
697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
698 def __init__(self): raise AttributeError, "No constructor defined"
699 __repr__ = _swig_repr
700 def GetClassName(*args, **kwargs):
701 """
702 GetClassName(self) -> String
703
704 Returns the class name of the C++ class using wxRTTI.
705 """
706 return _core_.Object_GetClassName(*args, **kwargs)
707
708 def Destroy(*args, **kwargs):
709 """
710 Destroy(self)
711
712 Deletes the C++ object this Python object is a proxy for.
713 """
714 val = _core_.Object_Destroy(*args, **kwargs)
715 args[0].thisown = 0
716 return val
717
718 _core_.Object_swigregister(Object)
719 _wxPySetDictionary = _core_._wxPySetDictionary
720 cvar = _core_.cvar
721 EmptyString = cvar.EmptyString
722
723 #---------------------------------------------------------------------------
724
725 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
743 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
744 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
745 CURSOR_NONE = _core_.CURSOR_NONE
746 CURSOR_ARROW = _core_.CURSOR_ARROW
747 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
748 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
749 CURSOR_CHAR = _core_.CURSOR_CHAR
750 CURSOR_CROSS = _core_.CURSOR_CROSS
751 CURSOR_HAND = _core_.CURSOR_HAND
752 CURSOR_IBEAM = _core_.CURSOR_IBEAM
753 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
754 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
755 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
756 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
757 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
758 CURSOR_PENCIL = _core_.CURSOR_PENCIL
759 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
760 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
761 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
762 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
763 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
764 CURSOR_SIZENS = _core_.CURSOR_SIZENS
765 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
766 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
767 CURSOR_SIZING = _core_.CURSOR_SIZING
768 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
769 CURSOR_WAIT = _core_.CURSOR_WAIT
770 CURSOR_WATCH = _core_.CURSOR_WATCH
771 CURSOR_BLANK = _core_.CURSOR_BLANK
772 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
773 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
774 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
775 CURSOR_MAX = _core_.CURSOR_MAX
776 #---------------------------------------------------------------------------
777
778 class Size(object):
779 """
780 wx.Size is a useful data structure used to represent the size of
781 something. It simply contains integer width and height
782 properties. In most places in wxPython where a wx.Size is
783 expected a (width, height) tuple can be used instead.
784 """
785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
786 __repr__ = _swig_repr
787 width = property(_core_.Size_width_get, _core_.Size_width_set)
788 height = property(_core_.Size_height_get, _core_.Size_height_set)
789 x = width; y = height
790 def __init__(self, *args, **kwargs):
791 """
792 __init__(self, int w=0, int h=0) -> Size
793
794 Creates a size object.
795 """
796 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
797 __swig_destroy__ = _core_.delete_Size
798 __del__ = lambda self : None;
799 def __eq__(*args, **kwargs):
800 """
801 __eq__(self, PyObject other) -> bool
802
803 Test for equality of wx.Size objects.
804 """
805 return _core_.Size___eq__(*args, **kwargs)
806
807 def __ne__(*args, **kwargs):
808 """
809 __ne__(self, PyObject other) -> bool
810
811 Test for inequality of wx.Size objects.
812 """
813 return _core_.Size___ne__(*args, **kwargs)
814
815 def __add__(*args, **kwargs):
816 """
817 __add__(self, Size sz) -> Size
818
819 Add sz's proprties to this and return the result.
820 """
821 return _core_.Size___add__(*args, **kwargs)
822
823 def __sub__(*args, **kwargs):
824 """
825 __sub__(self, Size sz) -> Size
826
827 Subtract sz's properties from this and return the result.
828 """
829 return _core_.Size___sub__(*args, **kwargs)
830
831 def IncTo(*args, **kwargs):
832 """
833 IncTo(self, Size sz)
834
835 Increments this object so that both of its dimensions are not less
836 than the corresponding dimensions of the size.
837 """
838 return _core_.Size_IncTo(*args, **kwargs)
839
840 def DecTo(*args, **kwargs):
841 """
842 DecTo(self, Size sz)
843
844 Decrements this object so that both of its dimensions are not greater
845 than the corresponding dimensions of the size.
846 """
847 return _core_.Size_DecTo(*args, **kwargs)
848
849 def Scale(*args, **kwargs):
850 """
851 Scale(self, float xscale, float yscale)
852
853 Scales the dimensions of this object by the given factors.
854 """
855 return _core_.Size_Scale(*args, **kwargs)
856
857 def Set(*args, **kwargs):
858 """
859 Set(self, int w, int h)
860
861 Set both width and height.
862 """
863 return _core_.Size_Set(*args, **kwargs)
864
865 def SetWidth(*args, **kwargs):
866 """SetWidth(self, int w)"""
867 return _core_.Size_SetWidth(*args, **kwargs)
868
869 def SetHeight(*args, **kwargs):
870 """SetHeight(self, int h)"""
871 return _core_.Size_SetHeight(*args, **kwargs)
872
873 def GetWidth(*args, **kwargs):
874 """GetWidth(self) -> int"""
875 return _core_.Size_GetWidth(*args, **kwargs)
876
877 def GetHeight(*args, **kwargs):
878 """GetHeight(self) -> int"""
879 return _core_.Size_GetHeight(*args, **kwargs)
880
881 def IsFullySpecified(*args, **kwargs):
882 """
883 IsFullySpecified(self) -> bool
884
885 Returns True if both components of the size are non-default values.
886 """
887 return _core_.Size_IsFullySpecified(*args, **kwargs)
888
889 def SetDefaults(*args, **kwargs):
890 """
891 SetDefaults(self, Size size)
892
893 Combine this size with the other one replacing the default components
894 of this object (i.e. equal to -1) with those of the other.
895 """
896 return _core_.Size_SetDefaults(*args, **kwargs)
897
898 def Get(*args, **kwargs):
899 """
900 Get() -> (width,height)
901
902 Returns the width and height properties as a tuple.
903 """
904 return _core_.Size_Get(*args, **kwargs)
905
906 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
907 def __str__(self): return str(self.Get())
908 def __repr__(self): return 'wx.Size'+str(self.Get())
909 def __len__(self): return len(self.Get())
910 def __getitem__(self, index): return self.Get()[index]
911 def __setitem__(self, index, val):
912 if index == 0: self.width = val
913 elif index == 1: self.height = val
914 else: raise IndexError
915 def __nonzero__(self): return self.Get() != (0,0)
916 __safe_for_unpickling__ = True
917 def __reduce__(self): return (wx.Size, self.Get())
918
919 _core_.Size_swigregister(Size)
920
921 #---------------------------------------------------------------------------
922
923 class RealPoint(object):
924 """
925 A data structure for representing a point or position with floating
926 point x and y properties. In wxPython most places that expect a
927 wx.RealPoint can also accept a (x,y) tuple.
928 """
929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
930 __repr__ = _swig_repr
931 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
932 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
933 def __init__(self, *args, **kwargs):
934 """
935 __init__(self, double x=0.0, double y=0.0) -> RealPoint
936
937 Create a wx.RealPoint object
938 """
939 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
940 __swig_destroy__ = _core_.delete_RealPoint
941 __del__ = lambda self : None;
942 def __eq__(*args, **kwargs):
943 """
944 __eq__(self, PyObject other) -> bool
945
946 Test for equality of wx.RealPoint objects.
947 """
948 return _core_.RealPoint___eq__(*args, **kwargs)
949
950 def __ne__(*args, **kwargs):
951 """
952 __ne__(self, PyObject other) -> bool
953
954 Test for inequality of wx.RealPoint objects.
955 """
956 return _core_.RealPoint___ne__(*args, **kwargs)
957
958 def __add__(*args, **kwargs):
959 """
960 __add__(self, RealPoint pt) -> RealPoint
961
962 Add pt's proprties to this and return the result.
963 """
964 return _core_.RealPoint___add__(*args, **kwargs)
965
966 def __sub__(*args, **kwargs):
967 """
968 __sub__(self, RealPoint pt) -> RealPoint
969
970 Subtract pt's proprties from this and return the result
971 """
972 return _core_.RealPoint___sub__(*args, **kwargs)
973
974 def Set(*args, **kwargs):
975 """
976 Set(self, double x, double y)
977
978 Set both the x and y properties
979 """
980 return _core_.RealPoint_Set(*args, **kwargs)
981
982 def Get(*args, **kwargs):
983 """
984 Get() -> (x,y)
985
986 Return the x and y properties as a tuple.
987 """
988 return _core_.RealPoint_Get(*args, **kwargs)
989
990 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
991 def __str__(self): return str(self.Get())
992 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
993 def __len__(self): return len(self.Get())
994 def __getitem__(self, index): return self.Get()[index]
995 def __setitem__(self, index, val):
996 if index == 0: self.x = val
997 elif index == 1: self.y = val
998 else: raise IndexError
999 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1000 __safe_for_unpickling__ = True
1001 def __reduce__(self): return (wx.RealPoint, self.Get())
1002
1003 _core_.RealPoint_swigregister(RealPoint)
1004
1005 #---------------------------------------------------------------------------
1006
1007 class Point(object):
1008 """
1009 A data structure for representing a point or position with integer x
1010 and y properties. Most places in wxPython that expect a wx.Point can
1011 also accept a (x,y) tuple.
1012 """
1013 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1014 __repr__ = _swig_repr
1015 x = property(_core_.Point_x_get, _core_.Point_x_set)
1016 y = property(_core_.Point_y_get, _core_.Point_y_set)
1017 def __init__(self, *args, **kwargs):
1018 """
1019 __init__(self, int x=0, int y=0) -> Point
1020
1021 Create a wx.Point object
1022 """
1023 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1024 __swig_destroy__ = _core_.delete_Point
1025 __del__ = lambda self : None;
1026 def __eq__(*args, **kwargs):
1027 """
1028 __eq__(self, PyObject other) -> bool
1029
1030 Test for equality of wx.Point objects.
1031 """
1032 return _core_.Point___eq__(*args, **kwargs)
1033
1034 def __ne__(*args, **kwargs):
1035 """
1036 __ne__(self, PyObject other) -> bool
1037
1038 Test for inequality of wx.Point objects.
1039 """
1040 return _core_.Point___ne__(*args, **kwargs)
1041
1042 def __add__(*args, **kwargs):
1043 """
1044 __add__(self, Point pt) -> Point
1045
1046 Add pt's proprties to this and return the result.
1047 """
1048 return _core_.Point___add__(*args, **kwargs)
1049
1050 def __sub__(*args, **kwargs):
1051 """
1052 __sub__(self, Point pt) -> Point
1053
1054 Subtract pt's proprties from this and return the result
1055 """
1056 return _core_.Point___sub__(*args, **kwargs)
1057
1058 def __iadd__(*args, **kwargs):
1059 """
1060 __iadd__(self, Point pt) -> Point
1061
1062 Add pt to this object.
1063 """
1064 return _core_.Point___iadd__(*args, **kwargs)
1065
1066 def __isub__(*args, **kwargs):
1067 """
1068 __isub__(self, Point pt) -> Point
1069
1070 Subtract pt from this object.
1071 """
1072 return _core_.Point___isub__(*args, **kwargs)
1073
1074 def Set(*args, **kwargs):
1075 """
1076 Set(self, long x, long y)
1077
1078 Set both the x and y properties
1079 """
1080 return _core_.Point_Set(*args, **kwargs)
1081
1082 def Get(*args, **kwargs):
1083 """
1084 Get() -> (x,y)
1085
1086 Return the x and y properties as a tuple.
1087 """
1088 return _core_.Point_Get(*args, **kwargs)
1089
1090 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1091 def __str__(self): return str(self.Get())
1092 def __repr__(self): return 'wx.Point'+str(self.Get())
1093 def __len__(self): return len(self.Get())
1094 def __getitem__(self, index): return self.Get()[index]
1095 def __setitem__(self, index, val):
1096 if index == 0: self.x = val
1097 elif index == 1: self.y = val
1098 else: raise IndexError
1099 def __nonzero__(self): return self.Get() != (0,0)
1100 __safe_for_unpickling__ = True
1101 def __reduce__(self): return (wx.Point, self.Get())
1102
1103 _core_.Point_swigregister(Point)
1104
1105 #---------------------------------------------------------------------------
1106
1107 class Rect(object):
1108 """
1109 A class for representing and manipulating rectangles. It has x, y,
1110 width and height properties. In wxPython most palces that expect a
1111 wx.Rect can also accept a (x,y,width,height) tuple.
1112 """
1113 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1114 __repr__ = _swig_repr
1115 def __init__(self, *args, **kwargs):
1116 """
1117 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1118
1119 Create a new Rect object.
1120 """
1121 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1122 __swig_destroy__ = _core_.delete_Rect
1123 __del__ = lambda self : None;
1124 def GetX(*args, **kwargs):
1125 """GetX(self) -> int"""
1126 return _core_.Rect_GetX(*args, **kwargs)
1127
1128 def SetX(*args, **kwargs):
1129 """SetX(self, int x)"""
1130 return _core_.Rect_SetX(*args, **kwargs)
1131
1132 def GetY(*args, **kwargs):
1133 """GetY(self) -> int"""
1134 return _core_.Rect_GetY(*args, **kwargs)
1135
1136 def SetY(*args, **kwargs):
1137 """SetY(self, int y)"""
1138 return _core_.Rect_SetY(*args, **kwargs)
1139
1140 def GetWidth(*args, **kwargs):
1141 """GetWidth(self) -> int"""
1142 return _core_.Rect_GetWidth(*args, **kwargs)
1143
1144 def SetWidth(*args, **kwargs):
1145 """SetWidth(self, int w)"""
1146 return _core_.Rect_SetWidth(*args, **kwargs)
1147
1148 def GetHeight(*args, **kwargs):
1149 """GetHeight(self) -> int"""
1150 return _core_.Rect_GetHeight(*args, **kwargs)
1151
1152 def SetHeight(*args, **kwargs):
1153 """SetHeight(self, int h)"""
1154 return _core_.Rect_SetHeight(*args, **kwargs)
1155
1156 def GetPosition(*args, **kwargs):
1157 """GetPosition(self) -> Point"""
1158 return _core_.Rect_GetPosition(*args, **kwargs)
1159
1160 def SetPosition(*args, **kwargs):
1161 """SetPosition(self, Point p)"""
1162 return _core_.Rect_SetPosition(*args, **kwargs)
1163
1164 def GetSize(*args, **kwargs):
1165 """GetSize(self) -> Size"""
1166 return _core_.Rect_GetSize(*args, **kwargs)
1167
1168 def SetSize(*args, **kwargs):
1169 """SetSize(self, Size s)"""
1170 return _core_.Rect_SetSize(*args, **kwargs)
1171
1172 def IsEmpty(*args, **kwargs):
1173 """IsEmpty(self) -> bool"""
1174 return _core_.Rect_IsEmpty(*args, **kwargs)
1175
1176 def GetTopLeft(*args, **kwargs):
1177 """GetTopLeft(self) -> Point"""
1178 return _core_.Rect_GetTopLeft(*args, **kwargs)
1179
1180 def SetTopLeft(*args, **kwargs):
1181 """SetTopLeft(self, Point p)"""
1182 return _core_.Rect_SetTopLeft(*args, **kwargs)
1183
1184 def GetBottomRight(*args, **kwargs):
1185 """GetBottomRight(self) -> Point"""
1186 return _core_.Rect_GetBottomRight(*args, **kwargs)
1187
1188 def SetBottomRight(*args, **kwargs):
1189 """SetBottomRight(self, Point p)"""
1190 return _core_.Rect_SetBottomRight(*args, **kwargs)
1191
1192 def GetLeft(*args, **kwargs):
1193 """GetLeft(self) -> int"""
1194 return _core_.Rect_GetLeft(*args, **kwargs)
1195
1196 def GetTop(*args, **kwargs):
1197 """GetTop(self) -> int"""
1198 return _core_.Rect_GetTop(*args, **kwargs)
1199
1200 def GetBottom(*args, **kwargs):
1201 """GetBottom(self) -> int"""
1202 return _core_.Rect_GetBottom(*args, **kwargs)
1203
1204 def GetRight(*args, **kwargs):
1205 """GetRight(self) -> int"""
1206 return _core_.Rect_GetRight(*args, **kwargs)
1207
1208 def SetLeft(*args, **kwargs):
1209 """SetLeft(self, int left)"""
1210 return _core_.Rect_SetLeft(*args, **kwargs)
1211
1212 def SetRight(*args, **kwargs):
1213 """SetRight(self, int right)"""
1214 return _core_.Rect_SetRight(*args, **kwargs)
1215
1216 def SetTop(*args, **kwargs):
1217 """SetTop(self, int top)"""
1218 return _core_.Rect_SetTop(*args, **kwargs)
1219
1220 def SetBottom(*args, **kwargs):
1221 """SetBottom(self, int bottom)"""
1222 return _core_.Rect_SetBottom(*args, **kwargs)
1223
1224 position = property(GetPosition, SetPosition)
1225 size = property(GetSize, SetSize)
1226 left = property(GetLeft, SetLeft)
1227 right = property(GetRight, SetRight)
1228 top = property(GetTop, SetTop)
1229 bottom = property(GetBottom, SetBottom)
1230
1231 def Inflate(*args, **kwargs):
1232 """
1233 Inflate(self, int dx, int dy) -> Rect
1234
1235 Increases the size of the rectangle.
1236
1237 The left border is moved farther left and the right border is moved
1238 farther right by ``dx``. The upper border is moved farther up and the
1239 bottom border is moved farther down by ``dy``. (Note the the width and
1240 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1241 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1242 opposite happens: the rectangle size decreases in the respective
1243 direction.
1244
1245 The change is made to the rectangle inplace, if instead you need a
1246 copy that is inflated, preserving the original then make the copy
1247 first::
1248
1249 copy = wx.Rect(*original)
1250 copy.Inflate(10,15)
1251
1252
1253 """
1254 return _core_.Rect_Inflate(*args, **kwargs)
1255
1256 def Deflate(*args, **kwargs):
1257 """
1258 Deflate(self, int dx, int dy) -> Rect
1259
1260 Decrease the rectangle size. This method is the opposite of `Inflate`
1261 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1262 `Inflate` for a full description.
1263 """
1264 return _core_.Rect_Deflate(*args, **kwargs)
1265
1266 def OffsetXY(*args, **kwargs):
1267 """
1268 OffsetXY(self, int dx, int dy)
1269
1270 Moves the rectangle by the specified offset. If dx is positive, the
1271 rectangle is moved to the right, if dy is positive, it is moved to the
1272 bottom, otherwise it is moved to the left or top respectively.
1273 """
1274 return _core_.Rect_OffsetXY(*args, **kwargs)
1275
1276 def Offset(*args, **kwargs):
1277 """
1278 Offset(self, Point pt)
1279
1280 Same as `OffsetXY` but uses dx,dy from Point
1281 """
1282 return _core_.Rect_Offset(*args, **kwargs)
1283
1284 def Intersect(*args, **kwargs):
1285 """
1286 Intersect(self, Rect rect) -> Rect
1287
1288 Returns the intersectsion of this rectangle and rect.
1289 """
1290 return _core_.Rect_Intersect(*args, **kwargs)
1291
1292 def Union(*args, **kwargs):
1293 """
1294 Union(self, Rect rect) -> Rect
1295
1296 Returns the union of this rectangle and rect.
1297 """
1298 return _core_.Rect_Union(*args, **kwargs)
1299
1300 def __add__(*args, **kwargs):
1301 """
1302 __add__(self, Rect rect) -> Rect
1303
1304 Add the properties of rect to this rectangle and return the result.
1305 """
1306 return _core_.Rect___add__(*args, **kwargs)
1307
1308 def __iadd__(*args, **kwargs):
1309 """
1310 __iadd__(self, Rect rect) -> Rect
1311
1312 Add the properties of rect to this rectangle, updating this rectangle.
1313 """
1314 return _core_.Rect___iadd__(*args, **kwargs)
1315
1316 def __eq__(*args, **kwargs):
1317 """
1318 __eq__(self, PyObject other) -> bool
1319
1320 Test for equality of wx.Rect objects.
1321 """
1322 return _core_.Rect___eq__(*args, **kwargs)
1323
1324 def __ne__(*args, **kwargs):
1325 """
1326 __ne__(self, PyObject other) -> bool
1327
1328 Test for inequality of wx.Rect objects.
1329 """
1330 return _core_.Rect___ne__(*args, **kwargs)
1331
1332 def InsideXY(*args, **kwargs):
1333 """
1334 InsideXY(self, int x, int y) -> bool
1335
1336 Return True if the point is (not strcitly) inside the rect.
1337 """
1338 return _core_.Rect_InsideXY(*args, **kwargs)
1339
1340 def Inside(*args, **kwargs):
1341 """
1342 Inside(self, Point pt) -> bool
1343
1344 Return True if the point is (not strcitly) inside the rect.
1345 """
1346 return _core_.Rect_Inside(*args, **kwargs)
1347
1348 def Intersects(*args, **kwargs):
1349 """
1350 Intersects(self, Rect rect) -> bool
1351
1352 Returns True if the rectangles have a non empty intersection.
1353 """
1354 return _core_.Rect_Intersects(*args, **kwargs)
1355
1356 def CenterIn(*args, **kwargs):
1357 """
1358 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1359
1360 Center this rectangle within the one passed to the method, which is
1361 usually, but not necessarily, the larger one.
1362 """
1363 return _core_.Rect_CenterIn(*args, **kwargs)
1364
1365 CentreIn = CenterIn
1366 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1367 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1368 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1369 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1370 def Set(*args, **kwargs):
1371 """
1372 Set(self, int x=0, int y=0, int width=0, int height=0)
1373
1374 Set all rectangle properties.
1375 """
1376 return _core_.Rect_Set(*args, **kwargs)
1377
1378 def Get(*args, **kwargs):
1379 """
1380 Get() -> (x,y,width,height)
1381
1382 Return the rectangle properties as a tuple.
1383 """
1384 return _core_.Rect_Get(*args, **kwargs)
1385
1386 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1387 def __str__(self): return str(self.Get())
1388 def __repr__(self): return 'wx.Rect'+str(self.Get())
1389 def __len__(self): return len(self.Get())
1390 def __getitem__(self, index): return self.Get()[index]
1391 def __setitem__(self, index, val):
1392 if index == 0: self.x = val
1393 elif index == 1: self.y = val
1394 elif index == 2: self.width = val
1395 elif index == 3: self.height = val
1396 else: raise IndexError
1397 def __nonzero__(self): return self.Get() != (0,0,0,0)
1398 __safe_for_unpickling__ = True
1399 def __reduce__(self): return (wx.Rect, self.Get())
1400
1401 _core_.Rect_swigregister(Rect)
1402
1403 def RectPP(*args, **kwargs):
1404 """
1405 RectPP(Point topLeft, Point bottomRight) -> Rect
1406
1407 Create a new Rect object from Points representing two corners.
1408 """
1409 val = _core_.new_RectPP(*args, **kwargs)
1410 return val
1411
1412 def RectPS(*args, **kwargs):
1413 """
1414 RectPS(Point pos, Size size) -> Rect
1415
1416 Create a new Rect from a position and size.
1417 """
1418 val = _core_.new_RectPS(*args, **kwargs)
1419 return val
1420
1421 def RectS(*args, **kwargs):
1422 """
1423 RectS(Size size) -> Rect
1424
1425 Create a new Rect from a size only.
1426 """
1427 val = _core_.new_RectS(*args, **kwargs)
1428 return val
1429
1430
1431 def IntersectRect(*args, **kwargs):
1432 """
1433 IntersectRect(Rect r1, Rect r2) -> Rect
1434
1435 Calculate and return the intersection of r1 and r2.
1436 """
1437 return _core_.IntersectRect(*args, **kwargs)
1438 #---------------------------------------------------------------------------
1439
1440 class Point2D(object):
1441 """
1442 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1443 with floating point values.
1444 """
1445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1446 __repr__ = _swig_repr
1447 def __init__(self, *args, **kwargs):
1448 """
1449 __init__(self, double x=0.0, double y=0.0) -> Point2D
1450
1451 Create a w.Point2D object.
1452 """
1453 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1454 def GetFloor(*args, **kwargs):
1455 """
1456 GetFloor() -> (x,y)
1457
1458 Convert to integer
1459 """
1460 return _core_.Point2D_GetFloor(*args, **kwargs)
1461
1462 def GetRounded(*args, **kwargs):
1463 """
1464 GetRounded() -> (x,y)
1465
1466 Convert to integer
1467 """
1468 return _core_.Point2D_GetRounded(*args, **kwargs)
1469
1470 def GetVectorLength(*args, **kwargs):
1471 """GetVectorLength(self) -> double"""
1472 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1473
1474 def GetVectorAngle(*args, **kwargs):
1475 """GetVectorAngle(self) -> double"""
1476 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1477
1478 def SetVectorLength(*args, **kwargs):
1479 """SetVectorLength(self, double length)"""
1480 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1481
1482 def SetVectorAngle(*args, **kwargs):
1483 """SetVectorAngle(self, double degrees)"""
1484 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1485
1486 def SetPolarCoordinates(self, angle, length):
1487 self.SetVectorLength(length)
1488 self.SetVectorAngle(angle)
1489 def Normalize(self):
1490 self.SetVectorLength(1.0)
1491
1492 def GetDistance(*args, **kwargs):
1493 """GetDistance(self, Point2D pt) -> double"""
1494 return _core_.Point2D_GetDistance(*args, **kwargs)
1495
1496 def GetDistanceSquare(*args, **kwargs):
1497 """GetDistanceSquare(self, Point2D pt) -> double"""
1498 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1499
1500 def GetDotProduct(*args, **kwargs):
1501 """GetDotProduct(self, Point2D vec) -> double"""
1502 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1503
1504 def GetCrossProduct(*args, **kwargs):
1505 """GetCrossProduct(self, Point2D vec) -> double"""
1506 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1507
1508 def __neg__(*args, **kwargs):
1509 """
1510 __neg__(self) -> Point2D
1511
1512 the reflection of this point
1513 """
1514 return _core_.Point2D___neg__(*args, **kwargs)
1515
1516 def __iadd__(*args, **kwargs):
1517 """__iadd__(self, Point2D pt) -> Point2D"""
1518 return _core_.Point2D___iadd__(*args, **kwargs)
1519
1520 def __isub__(*args, **kwargs):
1521 """__isub__(self, Point2D pt) -> Point2D"""
1522 return _core_.Point2D___isub__(*args, **kwargs)
1523
1524 def __imul__(*args, **kwargs):
1525 """__imul__(self, Point2D pt) -> Point2D"""
1526 return _core_.Point2D___imul__(*args, **kwargs)
1527
1528 def __idiv__(*args, **kwargs):
1529 """__idiv__(self, Point2D pt) -> Point2D"""
1530 return _core_.Point2D___idiv__(*args, **kwargs)
1531
1532 def __eq__(*args, **kwargs):
1533 """
1534 __eq__(self, PyObject other) -> bool
1535
1536 Test for equality of wx.Point2D objects.
1537 """
1538 return _core_.Point2D___eq__(*args, **kwargs)
1539
1540 def __ne__(*args, **kwargs):
1541 """
1542 __ne__(self, PyObject other) -> bool
1543
1544 Test for inequality of wx.Point2D objects.
1545 """
1546 return _core_.Point2D___ne__(*args, **kwargs)
1547
1548 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1549 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1550 def Set(*args, **kwargs):
1551 """Set(self, double x=0, double y=0)"""
1552 return _core_.Point2D_Set(*args, **kwargs)
1553
1554 def Get(*args, **kwargs):
1555 """
1556 Get() -> (x,y)
1557
1558 Return x and y properties as a tuple.
1559 """
1560 return _core_.Point2D_Get(*args, **kwargs)
1561
1562 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1563 def __str__(self): return str(self.Get())
1564 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1565 def __len__(self): return len(self.Get())
1566 def __getitem__(self, index): return self.Get()[index]
1567 def __setitem__(self, index, val):
1568 if index == 0: self.x = val
1569 elif index == 1: self.y = val
1570 else: raise IndexError
1571 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1572 __safe_for_unpickling__ = True
1573 def __reduce__(self): return (wx.Point2D, self.Get())
1574
1575 _core_.Point2D_swigregister(Point2D)
1576
1577 def Point2DCopy(*args, **kwargs):
1578 """
1579 Point2DCopy(Point2D pt) -> Point2D
1580
1581 Create a w.Point2D object.
1582 """
1583 val = _core_.new_Point2DCopy(*args, **kwargs)
1584 return val
1585
1586 def Point2DFromPoint(*args, **kwargs):
1587 """
1588 Point2DFromPoint(Point pt) -> Point2D
1589
1590 Create a w.Point2D object.
1591 """
1592 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1593 return val
1594
1595 #---------------------------------------------------------------------------
1596
1597 FromStart = _core_.FromStart
1598 FromCurrent = _core_.FromCurrent
1599 FromEnd = _core_.FromEnd
1600 class InputStream(object):
1601 """Proxy of C++ InputStream class"""
1602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1603 __repr__ = _swig_repr
1604 def __init__(self, *args, **kwargs):
1605 """__init__(self, PyObject p) -> InputStream"""
1606 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1607 __swig_destroy__ = _core_.delete_InputStream
1608 __del__ = lambda self : None;
1609 def close(*args, **kwargs):
1610 """close(self)"""
1611 return _core_.InputStream_close(*args, **kwargs)
1612
1613 def flush(*args, **kwargs):
1614 """flush(self)"""
1615 return _core_.InputStream_flush(*args, **kwargs)
1616
1617 def eof(*args, **kwargs):
1618 """eof(self) -> bool"""
1619 return _core_.InputStream_eof(*args, **kwargs)
1620
1621 def read(*args, **kwargs):
1622 """read(self, int size=-1) -> PyObject"""
1623 return _core_.InputStream_read(*args, **kwargs)
1624
1625 def readline(*args, **kwargs):
1626 """readline(self, int size=-1) -> PyObject"""
1627 return _core_.InputStream_readline(*args, **kwargs)
1628
1629 def readlines(*args, **kwargs):
1630 """readlines(self, int sizehint=-1) -> PyObject"""
1631 return _core_.InputStream_readlines(*args, **kwargs)
1632
1633 def seek(*args, **kwargs):
1634 """seek(self, int offset, int whence=0)"""
1635 return _core_.InputStream_seek(*args, **kwargs)
1636
1637 def tell(*args, **kwargs):
1638 """tell(self) -> int"""
1639 return _core_.InputStream_tell(*args, **kwargs)
1640
1641 def Peek(*args, **kwargs):
1642 """Peek(self) -> char"""
1643 return _core_.InputStream_Peek(*args, **kwargs)
1644
1645 def GetC(*args, **kwargs):
1646 """GetC(self) -> char"""
1647 return _core_.InputStream_GetC(*args, **kwargs)
1648
1649 def LastRead(*args, **kwargs):
1650 """LastRead(self) -> size_t"""
1651 return _core_.InputStream_LastRead(*args, **kwargs)
1652
1653 def CanRead(*args, **kwargs):
1654 """CanRead(self) -> bool"""
1655 return _core_.InputStream_CanRead(*args, **kwargs)
1656
1657 def Eof(*args, **kwargs):
1658 """Eof(self) -> bool"""
1659 return _core_.InputStream_Eof(*args, **kwargs)
1660
1661 def Ungetch(*args, **kwargs):
1662 """Ungetch(self, char c) -> bool"""
1663 return _core_.InputStream_Ungetch(*args, **kwargs)
1664
1665 def SeekI(*args, **kwargs):
1666 """SeekI(self, long pos, int mode=FromStart) -> long"""
1667 return _core_.InputStream_SeekI(*args, **kwargs)
1668
1669 def TellI(*args, **kwargs):
1670 """TellI(self) -> long"""
1671 return _core_.InputStream_TellI(*args, **kwargs)
1672
1673 _core_.InputStream_swigregister(InputStream)
1674 DefaultPosition = cvar.DefaultPosition
1675 DefaultSize = cvar.DefaultSize
1676
1677 class OutputStream(object):
1678 """Proxy of C++ OutputStream class"""
1679 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1680 def __init__(self): raise AttributeError, "No constructor defined"
1681 __repr__ = _swig_repr
1682 def write(*args, **kwargs):
1683 """write(self, PyObject obj)"""
1684 return _core_.OutputStream_write(*args, **kwargs)
1685
1686 def LastWrite(*args, **kwargs):
1687 """LastWrite(self) -> size_t"""
1688 return _core_.OutputStream_LastWrite(*args, **kwargs)
1689
1690 _core_.OutputStream_swigregister(OutputStream)
1691
1692 #---------------------------------------------------------------------------
1693
1694 class FSFile(Object):
1695 """Proxy of C++ FSFile class"""
1696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1697 __repr__ = _swig_repr
1698 def __init__(self, *args, **kwargs):
1699 """
1700 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1701 DateTime modif) -> FSFile
1702 """
1703 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1704 __swig_destroy__ = _core_.delete_FSFile
1705 __del__ = lambda self : None;
1706 def GetStream(*args, **kwargs):
1707 """GetStream(self) -> InputStream"""
1708 return _core_.FSFile_GetStream(*args, **kwargs)
1709
1710 def GetMimeType(*args, **kwargs):
1711 """GetMimeType(self) -> String"""
1712 return _core_.FSFile_GetMimeType(*args, **kwargs)
1713
1714 def GetLocation(*args, **kwargs):
1715 """GetLocation(self) -> String"""
1716 return _core_.FSFile_GetLocation(*args, **kwargs)
1717
1718 def GetAnchor(*args, **kwargs):
1719 """GetAnchor(self) -> String"""
1720 return _core_.FSFile_GetAnchor(*args, **kwargs)
1721
1722 def GetModificationTime(*args, **kwargs):
1723 """GetModificationTime(self) -> DateTime"""
1724 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1725
1726 _core_.FSFile_swigregister(FSFile)
1727
1728 class CPPFileSystemHandler(object):
1729 """Proxy of C++ CPPFileSystemHandler class"""
1730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1731 def __init__(self): raise AttributeError, "No constructor defined"
1732 __repr__ = _swig_repr
1733 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1734 __del__ = lambda self : None;
1735 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1736
1737 class FileSystemHandler(CPPFileSystemHandler):
1738 """Proxy of C++ FileSystemHandler class"""
1739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1740 __repr__ = _swig_repr
1741 def __init__(self, *args, **kwargs):
1742 """__init__(self) -> FileSystemHandler"""
1743 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1744 self._setCallbackInfo(self, FileSystemHandler)
1745
1746 def _setCallbackInfo(*args, **kwargs):
1747 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1748 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1749
1750 def CanOpen(*args, **kwargs):
1751 """CanOpen(self, String location) -> bool"""
1752 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1753
1754 def OpenFile(*args, **kwargs):
1755 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1756 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1757
1758 def FindFirst(*args, **kwargs):
1759 """FindFirst(self, String spec, int flags=0) -> String"""
1760 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1761
1762 def FindNext(*args, **kwargs):
1763 """FindNext(self) -> String"""
1764 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1765
1766 def GetProtocol(*args, **kwargs):
1767 """GetProtocol(self, String location) -> String"""
1768 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1769
1770 def GetLeftLocation(*args, **kwargs):
1771 """GetLeftLocation(self, String location) -> String"""
1772 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1773
1774 def GetAnchor(*args, **kwargs):
1775 """GetAnchor(self, String location) -> String"""
1776 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1777
1778 def GetRightLocation(*args, **kwargs):
1779 """GetRightLocation(self, String location) -> String"""
1780 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1781
1782 def GetMimeTypeFromExt(*args, **kwargs):
1783 """GetMimeTypeFromExt(self, String location) -> String"""
1784 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1785
1786 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1787
1788 class FileSystem(Object):
1789 """Proxy of C++ FileSystem class"""
1790 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1791 __repr__ = _swig_repr
1792 def __init__(self, *args, **kwargs):
1793 """__init__(self) -> FileSystem"""
1794 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1795 __swig_destroy__ = _core_.delete_FileSystem
1796 __del__ = lambda self : None;
1797 def ChangePathTo(*args, **kwargs):
1798 """ChangePathTo(self, String location, bool is_dir=False)"""
1799 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1800
1801 def GetPath(*args, **kwargs):
1802 """GetPath(self) -> String"""
1803 return _core_.FileSystem_GetPath(*args, **kwargs)
1804
1805 def OpenFile(*args, **kwargs):
1806 """OpenFile(self, String location) -> FSFile"""
1807 return _core_.FileSystem_OpenFile(*args, **kwargs)
1808
1809 def FindFirst(*args, **kwargs):
1810 """FindFirst(self, String spec, int flags=0) -> String"""
1811 return _core_.FileSystem_FindFirst(*args, **kwargs)
1812
1813 def FindNext(*args, **kwargs):
1814 """FindNext(self) -> String"""
1815 return _core_.FileSystem_FindNext(*args, **kwargs)
1816
1817 def AddHandler(*args, **kwargs):
1818 """AddHandler(CPPFileSystemHandler handler)"""
1819 return _core_.FileSystem_AddHandler(*args, **kwargs)
1820
1821 AddHandler = staticmethod(AddHandler)
1822 def CleanUpHandlers(*args, **kwargs):
1823 """CleanUpHandlers()"""
1824 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1825
1826 CleanUpHandlers = staticmethod(CleanUpHandlers)
1827 def FileNameToURL(*args, **kwargs):
1828 """FileNameToURL(String filename) -> String"""
1829 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1830
1831 FileNameToURL = staticmethod(FileNameToURL)
1832 def URLToFileName(*args, **kwargs):
1833 """URLToFileName(String url) -> String"""
1834 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1835
1836 URLToFileName = staticmethod(URLToFileName)
1837 _core_.FileSystem_swigregister(FileSystem)
1838
1839 def FileSystem_AddHandler(*args, **kwargs):
1840 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1841 return _core_.FileSystem_AddHandler(*args, **kwargs)
1842
1843 def FileSystem_CleanUpHandlers(*args):
1844 """FileSystem_CleanUpHandlers()"""
1845 return _core_.FileSystem_CleanUpHandlers(*args)
1846
1847 def FileSystem_FileNameToURL(*args, **kwargs):
1848 """FileSystem_FileNameToURL(String filename) -> String"""
1849 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1850
1851 def FileSystem_URLToFileName(*args, **kwargs):
1852 """FileSystem_URLToFileName(String url) -> String"""
1853 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1854
1855 class InternetFSHandler(CPPFileSystemHandler):
1856 """Proxy of C++ InternetFSHandler class"""
1857 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1858 __repr__ = _swig_repr
1859 def __init__(self, *args, **kwargs):
1860 """__init__(self) -> InternetFSHandler"""
1861 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1862 def CanOpen(*args, **kwargs):
1863 """CanOpen(self, String location) -> bool"""
1864 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1865
1866 def OpenFile(*args, **kwargs):
1867 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1868 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1869
1870 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1871
1872 class ZipFSHandler(CPPFileSystemHandler):
1873 """Proxy of C++ ZipFSHandler class"""
1874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1875 __repr__ = _swig_repr
1876 def __init__(self, *args, **kwargs):
1877 """__init__(self) -> ZipFSHandler"""
1878 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1879 def CanOpen(*args, **kwargs):
1880 """CanOpen(self, String location) -> bool"""
1881 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1882
1883 def OpenFile(*args, **kwargs):
1884 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1885 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1886
1887 def FindFirst(*args, **kwargs):
1888 """FindFirst(self, String spec, int flags=0) -> String"""
1889 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1890
1891 def FindNext(*args, **kwargs):
1892 """FindNext(self) -> String"""
1893 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1894
1895 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1896
1897
1898 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1899 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1900 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1901
1902 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1903 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1904 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1905
1906 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1907 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1908 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1909 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1910 """
1911 Add 'file' to the memory filesystem. The dataItem parameter can
1912 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1913 arbitrary data. If a bitmap or image is used then the imgType
1914 parameter should specify what kind of image file it should be
1915 written as, wx.BITMAP_TYPE_PNG, etc.
1916 """
1917 if isinstance(dataItem, wx.Image):
1918 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1919 elif isinstance(dataItem, wx.Bitmap):
1920 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1921 elif type(dataItem) == str:
1922 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1923 else:
1924 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1925
1926 class MemoryFSHandler(CPPFileSystemHandler):
1927 """Proxy of C++ MemoryFSHandler class"""
1928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1929 __repr__ = _swig_repr
1930 def __init__(self, *args, **kwargs):
1931 """__init__(self) -> MemoryFSHandler"""
1932 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1933 def RemoveFile(*args, **kwargs):
1934 """RemoveFile(String filename)"""
1935 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1936
1937 RemoveFile = staticmethod(RemoveFile)
1938 AddFile = staticmethod(MemoryFSHandler_AddFile)
1939 def CanOpen(*args, **kwargs):
1940 """CanOpen(self, String location) -> bool"""
1941 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1942
1943 def OpenFile(*args, **kwargs):
1944 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1945 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1946
1947 def FindFirst(*args, **kwargs):
1948 """FindFirst(self, String spec, int flags=0) -> String"""
1949 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1950
1951 def FindNext(*args, **kwargs):
1952 """FindNext(self) -> String"""
1953 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1954
1955 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1956
1957 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1958 """MemoryFSHandler_RemoveFile(String filename)"""
1959 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1960
1961 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1962 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1963 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1964 #---------------------------------------------------------------------------
1965
1966 class ImageHandler(Object):
1967 """
1968 This is the base class for implementing image file loading/saving, and
1969 image creation from data. It is used within `wx.Image` and is not
1970 normally seen by the application.
1971 """
1972 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1973 def __init__(self): raise AttributeError, "No constructor defined"
1974 __repr__ = _swig_repr
1975 def GetName(*args, **kwargs):
1976 """GetName(self) -> String"""
1977 return _core_.ImageHandler_GetName(*args, **kwargs)
1978
1979 def GetExtension(*args, **kwargs):
1980 """GetExtension(self) -> String"""
1981 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1982
1983 def GetType(*args, **kwargs):
1984 """GetType(self) -> long"""
1985 return _core_.ImageHandler_GetType(*args, **kwargs)
1986
1987 def GetMimeType(*args, **kwargs):
1988 """GetMimeType(self) -> String"""
1989 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1990
1991 def CanRead(*args, **kwargs):
1992 """CanRead(self, String name) -> bool"""
1993 return _core_.ImageHandler_CanRead(*args, **kwargs)
1994
1995 def CanReadStream(*args, **kwargs):
1996 """CanReadStream(self, InputStream stream) -> bool"""
1997 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
1998
1999 def SetName(*args, **kwargs):
2000 """SetName(self, String name)"""
2001 return _core_.ImageHandler_SetName(*args, **kwargs)
2002
2003 def SetExtension(*args, **kwargs):
2004 """SetExtension(self, String extension)"""
2005 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2006
2007 def SetType(*args, **kwargs):
2008 """SetType(self, long type)"""
2009 return _core_.ImageHandler_SetType(*args, **kwargs)
2010
2011 def SetMimeType(*args, **kwargs):
2012 """SetMimeType(self, String mimetype)"""
2013 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2014
2015 _core_.ImageHandler_swigregister(ImageHandler)
2016
2017 class PyImageHandler(ImageHandler):
2018 """
2019 This is the base class for implementing image file loading/saving, and
2020 image creation from data, all written in Python. To create a custom
2021 image handler derive a new class from wx.PyImageHandler and provide
2022 the following methods::
2023
2024 def DoCanRead(self, stream) --> bool
2025 '''Check if this handler can read the image on the stream'''
2026
2027 def LoadFile(self, image, stream, verbose, index) --> bool
2028 '''Load image data from the stream and load it into image.'''
2029
2030 def SaveFile(self, image, stream, verbose) --> bool
2031 '''Save the iamge data in image to the stream using
2032 this handler's image file format.'''
2033
2034 def GetImageCount(self, stream) --> int
2035 '''If this image format can hold more than one image,
2036 how many does the image on the stream have?'''
2037
2038 To activate your handler create an instance of it and pass it to
2039 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2040 `SetExtension` from your constructor.
2041
2042 """
2043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2044 __repr__ = _swig_repr
2045 def __init__(self, *args, **kwargs):
2046 """
2047 __init__(self) -> PyImageHandler
2048
2049 This is the base class for implementing image file loading/saving, and
2050 image creation from data, all written in Python. To create a custom
2051 image handler derive a new class from wx.PyImageHandler and provide
2052 the following methods::
2053
2054 def DoCanRead(self, stream) --> bool
2055 '''Check if this handler can read the image on the stream'''
2056
2057 def LoadFile(self, image, stream, verbose, index) --> bool
2058 '''Load image data from the stream and load it into image.'''
2059
2060 def SaveFile(self, image, stream, verbose) --> bool
2061 '''Save the iamge data in image to the stream using
2062 this handler's image file format.'''
2063
2064 def GetImageCount(self, stream) --> int
2065 '''If this image format can hold more than one image,
2066 how many does the image on the stream have?'''
2067
2068 To activate your handler create an instance of it and pass it to
2069 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2070 `SetExtension` from your constructor.
2071
2072 """
2073 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2074 self._SetSelf(self)
2075
2076 def _SetSelf(*args, **kwargs):
2077 """_SetSelf(self, PyObject self)"""
2078 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2079
2080 _core_.PyImageHandler_swigregister(PyImageHandler)
2081
2082 class ImageHistogram(object):
2083 """Proxy of C++ ImageHistogram class"""
2084 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2085 __repr__ = _swig_repr
2086 def __init__(self, *args, **kwargs):
2087 """__init__(self) -> ImageHistogram"""
2088 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2089 def MakeKey(*args, **kwargs):
2090 """
2091 MakeKey(byte r, byte g, byte b) -> unsigned long
2092
2093 Get the key in the histogram for the given RGB values
2094 """
2095 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2096
2097 MakeKey = staticmethod(MakeKey)
2098 def FindFirstUnusedColour(*args, **kwargs):
2099 """
2100 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2101
2102 Find first colour that is not used in the image and has higher RGB
2103 values than startR, startG, startB. Returns a tuple consisting of a
2104 success flag and rgb values.
2105 """
2106 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2107
2108 def GetCount(*args, **kwargs):
2109 """
2110 GetCount(self, unsigned long key) -> unsigned long
2111
2112 Returns the pixel count for the given key. Use `MakeKey` to create a
2113 key value from a RGB tripple.
2114 """
2115 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2116
2117 def GetCountRGB(*args, **kwargs):
2118 """
2119 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2120
2121 Returns the pixel count for the given RGB values.
2122 """
2123 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2124
2125 def GetCountColour(*args, **kwargs):
2126 """
2127 GetCountColour(self, Colour colour) -> unsigned long
2128
2129 Returns the pixel count for the given `wx.Colour` value.
2130 """
2131 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2132
2133 _core_.ImageHistogram_swigregister(ImageHistogram)
2134
2135 def ImageHistogram_MakeKey(*args, **kwargs):
2136 """
2137 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2138
2139 Get the key in the histogram for the given RGB values
2140 """
2141 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2142
2143 class Image_RGBValue(object):
2144 """
2145 An object that contains values for red, green and blue which represent
2146 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2147 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2148 color space.
2149 """
2150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2151 __repr__ = _swig_repr
2152 def __init__(self, *args, **kwargs):
2153 """
2154 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2155
2156 Constructor.
2157 """
2158 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2159 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2160 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2161 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2162 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2163
2164 class Image_HSVValue(object):
2165 """
2166 An object that contains values for hue, saturation and value which
2167 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2168 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2169 color space.
2170 """
2171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2172 __repr__ = _swig_repr
2173 def __init__(self, *args, **kwargs):
2174 """
2175 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2176
2177 Constructor.
2178 """
2179 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2180 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2181 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2182 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2183 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2184
2185 class Image(Object):
2186 """
2187 A platform-independent image class. An image can be created from
2188 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2189 variety of formats. Functions are available to set and get image
2190 bits, so it can be used for basic image manipulation.
2191
2192 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2193 platform-specific `wx.Bitmap` object must be created from it using the
2194 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2195 device context, using `wx.DC.DrawBitmap`.
2196
2197 One colour value of the image may be used as a mask colour which will
2198 lead to the automatic creation of a `wx.Mask` object associated to the
2199 bitmap object.
2200
2201 wx.Image supports alpha channel data, that is in addition to a byte
2202 for the red, green and blue colour components for each pixel it also
2203 stores a byte representing the pixel opacity. An alpha value of 0
2204 corresponds to a transparent pixel (null opacity) while a value of 255
2205 means that the pixel is 100% opaque.
2206
2207 Unlike RGB data, not all images have an alpha channel and before using
2208 `GetAlpha` you should check if this image contains an alpha channel
2209 with `HasAlpha`. Note that currently only images loaded from PNG files
2210 with transparency information will have an alpha channel.
2211 """
2212 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2213 __repr__ = _swig_repr
2214 def __init__(self, *args, **kwargs):
2215 """
2216 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2217
2218 Loads an image from a file.
2219 """
2220 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2221 __swig_destroy__ = _core_.delete_Image
2222 __del__ = lambda self : None;
2223 def Create(*args, **kwargs):
2224 """
2225 Create(self, int width, int height, bool clear=True)
2226
2227 Creates a fresh image. If clear is ``True``, the new image will be
2228 initialized to black. Otherwise, the image data will be uninitialized.
2229 """
2230 return _core_.Image_Create(*args, **kwargs)
2231
2232 def Destroy(*args, **kwargs):
2233 """
2234 Destroy(self)
2235
2236 Destroys the image data.
2237 """
2238 val = _core_.Image_Destroy(*args, **kwargs)
2239 args[0].thisown = 0
2240 return val
2241
2242 def Scale(*args, **kwargs):
2243 """
2244 Scale(self, int width, int height) -> Image
2245
2246 Returns a scaled version of the image. This is also useful for scaling
2247 bitmaps in general as the only other way to scale bitmaps is to blit a
2248 `wx.MemoryDC` into another `wx.MemoryDC`.
2249 """
2250 return _core_.Image_Scale(*args, **kwargs)
2251
2252 def ShrinkBy(*args, **kwargs):
2253 """
2254 ShrinkBy(self, int xFactor, int yFactor) -> Image
2255
2256 Return a version of the image scaled smaller by the given factors.
2257 """
2258 return _core_.Image_ShrinkBy(*args, **kwargs)
2259
2260 def Rescale(*args, **kwargs):
2261 """
2262 Rescale(self, int width, int height) -> Image
2263
2264 Changes the size of the image in-place by scaling it: after a call to
2265 this function, the image will have the given width and height.
2266
2267 Returns the (modified) image itself.
2268 """
2269 return _core_.Image_Rescale(*args, **kwargs)
2270
2271 def Resize(*args, **kwargs):
2272 """
2273 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2274
2275 Changes the size of the image in-place without scaling it, by adding
2276 either a border with the given colour or cropping as necessary. The
2277 image is pasted into a new image with the given size and background
2278 colour at the position pos relative to the upper left of the new
2279 image. If red = green = blue = -1 then use either the current mask
2280 colour if set or find, use, and set a suitable mask colour for any
2281 newly exposed areas.
2282
2283 Returns the (modified) image itself.
2284 """
2285 return _core_.Image_Resize(*args, **kwargs)
2286
2287 def SetRGB(*args, **kwargs):
2288 """
2289 SetRGB(self, int x, int y, byte r, byte g, byte b)
2290
2291 Sets the pixel at the given coordinate. This routine performs
2292 bounds-checks for the coordinate so it can be considered a safe way to
2293 manipulate the data, but in some cases this might be too slow so that
2294 the data will have to be set directly. In that case you will have to
2295 get access to the image data using the `GetData` method.
2296 """
2297 return _core_.Image_SetRGB(*args, **kwargs)
2298
2299 def SetRGBRect(*args, **kwargs):
2300 """
2301 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2302
2303 Sets the colour of the pixels within the given rectangle. This routine
2304 performs bounds-checks for the rectangle so it can be considered a
2305 safe way to manipulate the data.
2306 """
2307 return _core_.Image_SetRGBRect(*args, **kwargs)
2308
2309 def GetRed(*args, **kwargs):
2310 """
2311 GetRed(self, int x, int y) -> byte
2312
2313 Returns the red intensity at the given coordinate.
2314 """
2315 return _core_.Image_GetRed(*args, **kwargs)
2316
2317 def GetGreen(*args, **kwargs):
2318 """
2319 GetGreen(self, int x, int y) -> byte
2320
2321 Returns the green intensity at the given coordinate.
2322 """
2323 return _core_.Image_GetGreen(*args, **kwargs)
2324
2325 def GetBlue(*args, **kwargs):
2326 """
2327 GetBlue(self, int x, int y) -> byte
2328
2329 Returns the blue intensity at the given coordinate.
2330 """
2331 return _core_.Image_GetBlue(*args, **kwargs)
2332
2333 def SetAlpha(*args, **kwargs):
2334 """
2335 SetAlpha(self, int x, int y, byte alpha)
2336
2337 Sets the alpha value for the given pixel. This function should only be
2338 called if the image has alpha channel data, use `HasAlpha` to check
2339 for this.
2340 """
2341 return _core_.Image_SetAlpha(*args, **kwargs)
2342
2343 def GetAlpha(*args, **kwargs):
2344 """
2345 GetAlpha(self, int x, int y) -> byte
2346
2347 Returns the alpha value for the given pixel. This function may only be
2348 called for the images with alpha channel, use `HasAlpha` to check for
2349 this.
2350
2351 The returned value is the *opacity* of the image, i.e. the value of 0
2352 corresponds to the fully transparent pixels while the value of 255 to
2353 the fully opaque pixels.
2354 """
2355 return _core_.Image_GetAlpha(*args, **kwargs)
2356
2357 def HasAlpha(*args, **kwargs):
2358 """
2359 HasAlpha(self) -> bool
2360
2361 Returns true if this image has alpha channel, false otherwise.
2362 """
2363 return _core_.Image_HasAlpha(*args, **kwargs)
2364
2365 def InitAlpha(*args, **kwargs):
2366 """
2367 InitAlpha(self)
2368
2369 Initializes the image alpha channel data. It is an error to call it if
2370 the image already has alpha data. If it doesn't, alpha data will be by
2371 default initialized to all pixels being fully opaque. But if the image
2372 has a a mask colour, all mask pixels will be completely transparent.
2373 """
2374 return _core_.Image_InitAlpha(*args, **kwargs)
2375
2376 def IsTransparent(*args, **kwargs):
2377 """
2378 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2379
2380 Returns ``True`` if this pixel is masked or has an alpha value less
2381 than the spcified threshold.
2382 """
2383 return _core_.Image_IsTransparent(*args, **kwargs)
2384
2385 def FindFirstUnusedColour(*args, **kwargs):
2386 """
2387 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2388
2389 Find first colour that is not used in the image and has higher RGB
2390 values than startR, startG, startB. Returns a tuple consisting of a
2391 success flag and rgb values.
2392 """
2393 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2394
2395 def ConvertAlphaToMask(*args, **kwargs):
2396 """
2397 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2398
2399 If the image has alpha channel, this method converts it to mask. All
2400 pixels with alpha value less than ``threshold`` are replaced with the
2401 mask colour and the alpha channel is removed. The mask colour is
2402 chosen automatically using `FindFirstUnusedColour`.
2403
2404 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2405 nothing.
2406 """
2407 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2408
2409 def ConvertColourToAlpha(*args, **kwargs):
2410 """
2411 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2412
2413 This method converts an image where the original alpha information is
2414 only available as a shades of a colour (actually shades of grey)
2415 typically when you draw anti-aliased text into a bitmap. The DC
2416 drawing routines draw grey values on the black background although
2417 they actually mean to draw white with differnt alpha values. This
2418 method reverses it, assuming a black (!) background and white text.
2419 The method will then fill up the whole image with the colour given.
2420 """
2421 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2422
2423 def SetMaskFromImage(*args, **kwargs):
2424 """
2425 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2426
2427 Sets the image's mask so that the pixels that have RGB value of
2428 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2429 by first finding an unused colour in the image, setting this colour as
2430 the mask colour and then using this colour to draw all pixels in the
2431 image who corresponding pixel in mask has given RGB value.
2432
2433 Returns ``False`` if ``mask`` does not have same dimensions as the
2434 image or if there is no unused colour left. Returns ``True`` if the
2435 mask was successfully applied.
2436
2437 Note that this method involves computing the histogram, which is
2438 computationally intensive operation.
2439 """
2440 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2441
2442 def CanRead(*args, **kwargs):
2443 """
2444 CanRead(String filename) -> bool
2445
2446 Returns True if the image handlers can read this file.
2447 """
2448 return _core_.Image_CanRead(*args, **kwargs)
2449
2450 CanRead = staticmethod(CanRead)
2451 def GetImageCount(*args, **kwargs):
2452 """
2453 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2454
2455 If the image file contains more than one image and the image handler
2456 is capable of retrieving these individually, this function will return
2457 the number of available images.
2458 """
2459 return _core_.Image_GetImageCount(*args, **kwargs)
2460
2461 GetImageCount = staticmethod(GetImageCount)
2462 def LoadFile(*args, **kwargs):
2463 """
2464 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2465
2466 Loads an image from a file. If no handler type is provided, the
2467 library will try to autodetect the format.
2468 """
2469 return _core_.Image_LoadFile(*args, **kwargs)
2470
2471 def LoadMimeFile(*args, **kwargs):
2472 """
2473 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2474
2475 Loads an image from a file, specifying the image type with a MIME type
2476 string.
2477 """
2478 return _core_.Image_LoadMimeFile(*args, **kwargs)
2479
2480 def SaveFile(*args, **kwargs):
2481 """
2482 SaveFile(self, String name, int type) -> bool
2483
2484 Saves an image in the named file.
2485 """
2486 return _core_.Image_SaveFile(*args, **kwargs)
2487
2488 def SaveMimeFile(*args, **kwargs):
2489 """
2490 SaveMimeFile(self, String name, String mimetype) -> bool
2491
2492 Saves an image in the named file.
2493 """
2494 return _core_.Image_SaveMimeFile(*args, **kwargs)
2495
2496 def CanReadStream(*args, **kwargs):
2497 """
2498 CanReadStream(InputStream stream) -> bool
2499
2500 Returns True if the image handlers can read an image file from the
2501 data currently on the input stream, or a readable Python file-like
2502 object.
2503 """
2504 return _core_.Image_CanReadStream(*args, **kwargs)
2505
2506 CanReadStream = staticmethod(CanReadStream)
2507 def LoadStream(*args, **kwargs):
2508 """
2509 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2510
2511 Loads an image from an input stream or a readable Python file-like
2512 object. If no handler type is provided, the library will try to
2513 autodetect the format.
2514 """
2515 return _core_.Image_LoadStream(*args, **kwargs)
2516
2517 def LoadMimeStream(*args, **kwargs):
2518 """
2519 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2520
2521 Loads an image from an input stream or a readable Python file-like
2522 object, using a MIME type string to specify the image file format.
2523 """
2524 return _core_.Image_LoadMimeStream(*args, **kwargs)
2525
2526 def Ok(*args, **kwargs):
2527 """
2528 Ok(self) -> bool
2529
2530 Returns true if image data is present.
2531 """
2532 return _core_.Image_Ok(*args, **kwargs)
2533
2534 def GetWidth(*args, **kwargs):
2535 """
2536 GetWidth(self) -> int
2537
2538 Gets the width of the image in pixels.
2539 """
2540 return _core_.Image_GetWidth(*args, **kwargs)
2541
2542 def GetHeight(*args, **kwargs):
2543 """
2544 GetHeight(self) -> int
2545
2546 Gets the height of the image in pixels.
2547 """
2548 return _core_.Image_GetHeight(*args, **kwargs)
2549
2550 def GetSize(*args, **kwargs):
2551 """
2552 GetSize(self) -> Size
2553
2554 Returns the size of the image in pixels.
2555 """
2556 return _core_.Image_GetSize(*args, **kwargs)
2557
2558 def GetSubImage(*args, **kwargs):
2559 """
2560 GetSubImage(self, Rect rect) -> Image
2561
2562 Returns a sub image of the current one as long as the rect belongs
2563 entirely to the image.
2564 """
2565 return _core_.Image_GetSubImage(*args, **kwargs)
2566
2567 def Size(*args, **kwargs):
2568 """
2569 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2570
2571 Returns a resized version of this image without scaling it by adding
2572 either a border with the given colour or cropping as necessary. The
2573 image is pasted into a new image with the given size and background
2574 colour at the position ``pos`` relative to the upper left of the new
2575 image. If red = green = blue = -1 then use either the current mask
2576 colour if set or find, use, and set a suitable mask colour for any
2577 newly exposed areas.
2578 """
2579 return _core_.Image_Size(*args, **kwargs)
2580
2581 def Copy(*args, **kwargs):
2582 """
2583 Copy(self) -> Image
2584
2585 Returns an identical copy of the image.
2586 """
2587 return _core_.Image_Copy(*args, **kwargs)
2588
2589 def Paste(*args, **kwargs):
2590 """
2591 Paste(self, Image image, int x, int y)
2592
2593 Pastes ``image`` into this instance and takes care of the mask colour
2594 and any out of bounds problems.
2595 """
2596 return _core_.Image_Paste(*args, **kwargs)
2597
2598 def GetData(*args, **kwargs):
2599 """
2600 GetData(self) -> PyObject
2601
2602 Returns a string containing a copy of the RGB bytes of the image.
2603 """
2604 return _core_.Image_GetData(*args, **kwargs)
2605
2606 def SetData(*args, **kwargs):
2607 """
2608 SetData(self, buffer data)
2609
2610 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2611 either a string or a buffer object holding the data and the length of
2612 the data must be width*height*3.
2613 """
2614 return _core_.Image_SetData(*args, **kwargs)
2615
2616 def GetDataBuffer(*args, **kwargs):
2617 """
2618 GetDataBuffer(self) -> PyObject
2619
2620 Returns a writable Python buffer object that is pointing at the RGB
2621 image data buffer inside the wx.Image. You need to ensure that you do
2622 not use this buffer object after the image has been destroyed.
2623 """
2624 return _core_.Image_GetDataBuffer(*args, **kwargs)
2625
2626 def SetDataBuffer(*args, **kwargs):
2627 """
2628 SetDataBuffer(self, buffer data)
2629
2630 Sets the internal image data pointer to point at a Python buffer
2631 object. This can save making an extra copy of the data but you must
2632 ensure that the buffer object lives longer than the wx.Image does.
2633 """
2634 return _core_.Image_SetDataBuffer(*args, **kwargs)
2635
2636 def GetAlphaData(*args, **kwargs):
2637 """
2638 GetAlphaData(self) -> PyObject
2639
2640 Returns a string containing a copy of the alpha bytes of the image.
2641 """
2642 return _core_.Image_GetAlphaData(*args, **kwargs)
2643
2644 def SetAlphaData(*args, **kwargs):
2645 """
2646 SetAlphaData(self, buffer alpha)
2647
2648 Resets the Image's alpha data from a buffer of bytes. Accepts either
2649 a string or a buffer object holding the data and the length of the
2650 data must be width*height.
2651 """
2652 return _core_.Image_SetAlphaData(*args, **kwargs)
2653
2654 def GetAlphaBuffer(*args, **kwargs):
2655 """GetAlphaBuffer(self) -> PyObject"""
2656 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2657
2658 def SetAlphaBuffer(*args, **kwargs):
2659 """SetAlphaBuffer(self, buffer alpha)"""
2660 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2661
2662 def SetMaskColour(*args, **kwargs):
2663 """
2664 SetMaskColour(self, byte r, byte g, byte b)
2665
2666 Sets the mask colour for this image (and tells the image to use the
2667 mask).
2668 """
2669 return _core_.Image_SetMaskColour(*args, **kwargs)
2670
2671 def GetOrFindMaskColour(*args, **kwargs):
2672 """
2673 GetOrFindMaskColour() -> (r,g,b)
2674
2675 Get the current mask colour or find a suitable colour.
2676 """
2677 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2678
2679 def GetMaskRed(*args, **kwargs):
2680 """
2681 GetMaskRed(self) -> byte
2682
2683 Gets the red component of the mask colour.
2684 """
2685 return _core_.Image_GetMaskRed(*args, **kwargs)
2686
2687 def GetMaskGreen(*args, **kwargs):
2688 """
2689 GetMaskGreen(self) -> byte
2690
2691 Gets the green component of the mask colour.
2692 """
2693 return _core_.Image_GetMaskGreen(*args, **kwargs)
2694
2695 def GetMaskBlue(*args, **kwargs):
2696 """
2697 GetMaskBlue(self) -> byte
2698
2699 Gets the blue component of the mask colour.
2700 """
2701 return _core_.Image_GetMaskBlue(*args, **kwargs)
2702
2703 def SetMask(*args, **kwargs):
2704 """
2705 SetMask(self, bool mask=True)
2706
2707 Specifies whether there is a mask or not. The area of the mask is
2708 determined by the current mask colour.
2709 """
2710 return _core_.Image_SetMask(*args, **kwargs)
2711
2712 def HasMask(*args, **kwargs):
2713 """
2714 HasMask(self) -> bool
2715
2716 Returns ``True`` if there is a mask active, ``False`` otherwise.
2717 """
2718 return _core_.Image_HasMask(*args, **kwargs)
2719
2720 def Rotate(*args, **kwargs):
2721 """
2722 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2723 Point offset_after_rotation=None) -> Image
2724
2725 Rotates the image about the given point, by ``angle`` radians. Passing
2726 ``True`` to ``interpolating`` results in better image quality, but is
2727 slower. If the image has a mask, then the mask colour is used for the
2728 uncovered pixels in the rotated image background. Otherwise, black
2729 will be used as the fill colour.
2730
2731 Returns the rotated image, leaving this image intact.
2732 """
2733 return _core_.Image_Rotate(*args, **kwargs)
2734
2735 def Rotate90(*args, **kwargs):
2736 """
2737 Rotate90(self, bool clockwise=True) -> Image
2738
2739 Returns a copy of the image rotated 90 degrees in the direction
2740 indicated by ``clockwise``.
2741 """
2742 return _core_.Image_Rotate90(*args, **kwargs)
2743
2744 def Mirror(*args, **kwargs):
2745 """
2746 Mirror(self, bool horizontally=True) -> Image
2747
2748 Returns a mirrored copy of the image. The parameter ``horizontally``
2749 indicates the orientation.
2750 """
2751 return _core_.Image_Mirror(*args, **kwargs)
2752
2753 def Replace(*args, **kwargs):
2754 """
2755 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2756
2757 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2758 ``(r2,g2,b2)``.
2759 """
2760 return _core_.Image_Replace(*args, **kwargs)
2761
2762 def ConvertToGreyscale(*args, **kwargs):
2763 """
2764 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2765
2766 Convert to greyscale image. Uses the luminance component (Y) of the
2767 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2768 defaults to ITU-T BT.601
2769 """
2770 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2771
2772 def ConvertToMono(*args, **kwargs):
2773 """
2774 ConvertToMono(self, byte r, byte g, byte b) -> Image
2775
2776 Returns monochromatic version of the image. The returned image has
2777 white colour where the original has ``(r,g,b)`` colour and black
2778 colour everywhere else.
2779 """
2780 return _core_.Image_ConvertToMono(*args, **kwargs)
2781
2782 def SetOption(*args, **kwargs):
2783 """
2784 SetOption(self, String name, String value)
2785
2786 Sets an image handler defined option. For example, when saving as a
2787 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2788 number between 0 and 100 (0 is terrible, 100 is very good).
2789 """
2790 return _core_.Image_SetOption(*args, **kwargs)
2791
2792 def SetOptionInt(*args, **kwargs):
2793 """
2794 SetOptionInt(self, String name, int value)
2795
2796 Sets an image option as an integer.
2797 """
2798 return _core_.Image_SetOptionInt(*args, **kwargs)
2799
2800 def GetOption(*args, **kwargs):
2801 """
2802 GetOption(self, String name) -> String
2803
2804 Gets the value of an image handler option.
2805 """
2806 return _core_.Image_GetOption(*args, **kwargs)
2807
2808 def GetOptionInt(*args, **kwargs):
2809 """
2810 GetOptionInt(self, String name) -> int
2811
2812 Gets the value of an image handler option as an integer. If the given
2813 option is not present, the function returns 0.
2814 """
2815 return _core_.Image_GetOptionInt(*args, **kwargs)
2816
2817 def HasOption(*args, **kwargs):
2818 """
2819 HasOption(self, String name) -> bool
2820
2821 Returns true if the given option is present.
2822 """
2823 return _core_.Image_HasOption(*args, **kwargs)
2824
2825 def CountColours(*args, **kwargs):
2826 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2827 return _core_.Image_CountColours(*args, **kwargs)
2828
2829 def ComputeHistogram(*args, **kwargs):
2830 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2831 return _core_.Image_ComputeHistogram(*args, **kwargs)
2832
2833 def AddHandler(*args, **kwargs):
2834 """AddHandler(ImageHandler handler)"""
2835 return _core_.Image_AddHandler(*args, **kwargs)
2836
2837 AddHandler = staticmethod(AddHandler)
2838 def InsertHandler(*args, **kwargs):
2839 """InsertHandler(ImageHandler handler)"""
2840 return _core_.Image_InsertHandler(*args, **kwargs)
2841
2842 InsertHandler = staticmethod(InsertHandler)
2843 def RemoveHandler(*args, **kwargs):
2844 """RemoveHandler(String name) -> bool"""
2845 return _core_.Image_RemoveHandler(*args, **kwargs)
2846
2847 RemoveHandler = staticmethod(RemoveHandler)
2848 def GetHandlers(*args, **kwargs):
2849 """GetHandlers() -> PyObject"""
2850 return _core_.Image_GetHandlers(*args, **kwargs)
2851
2852 GetHandlers = staticmethod(GetHandlers)
2853 def GetImageExtWildcard(*args, **kwargs):
2854 """
2855 GetImageExtWildcard() -> String
2856
2857 Iterates all registered wxImageHandler objects, and returns a string
2858 containing file extension masks suitable for passing to file open/save
2859 dialog boxes.
2860 """
2861 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2862
2863 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2864 def ConvertToBitmap(*args, **kwargs):
2865 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2866 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2867
2868 def ConvertToMonoBitmap(*args, **kwargs):
2869 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2870 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2871
2872 def RotateHue(*args, **kwargs):
2873 """
2874 RotateHue(self, double angle)
2875
2876 Rotates the hue of each pixel of the image. Hue is a double in the
2877 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2878 """
2879 return _core_.Image_RotateHue(*args, **kwargs)
2880
2881 def RGBtoHSV(*args, **kwargs):
2882 """
2883 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2884
2885 Converts a color in RGB color space to HSV color space.
2886 """
2887 return _core_.Image_RGBtoHSV(*args, **kwargs)
2888
2889 RGBtoHSV = staticmethod(RGBtoHSV)
2890 def HSVtoRGB(*args, **kwargs):
2891 """
2892 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2893
2894 Converts a color in HSV color space to RGB color space.
2895 """
2896 return _core_.Image_HSVtoRGB(*args, **kwargs)
2897
2898 HSVtoRGB = staticmethod(HSVtoRGB)
2899 def __nonzero__(self): return self.Ok()
2900 _core_.Image_swigregister(Image)
2901
2902 def ImageFromMime(*args, **kwargs):
2903 """
2904 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2905
2906 Loads an image from a file, using a MIME type string (such as
2907 'image/jpeg') to specify image type.
2908 """
2909 val = _core_.new_ImageFromMime(*args, **kwargs)
2910 return val
2911
2912 def ImageFromStream(*args, **kwargs):
2913 """
2914 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2915
2916 Loads an image from an input stream, or any readable Python file-like
2917 object.
2918 """
2919 val = _core_.new_ImageFromStream(*args, **kwargs)
2920 return val
2921
2922 def ImageFromStreamMime(*args, **kwargs):
2923 """
2924 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2925
2926 Loads an image from an input stream, or any readable Python file-like
2927 object, specifying the image format with a MIME type string.
2928 """
2929 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2930 return val
2931
2932 def EmptyImage(*args, **kwargs):
2933 """
2934 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2935
2936 Construct an empty image of a given size, optionally setting all
2937 pixels to black.
2938 """
2939 val = _core_.new_EmptyImage(*args, **kwargs)
2940 return val
2941
2942 def ImageFromBitmap(*args, **kwargs):
2943 """
2944 ImageFromBitmap(Bitmap bitmap) -> Image
2945
2946 Construct an Image from a `wx.Bitmap`.
2947 """
2948 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2949 return val
2950
2951 def ImageFromData(*args, **kwargs):
2952 """
2953 ImageFromData(int width, int height, buffer data) -> Image
2954
2955 Construct an Image from a buffer of RGB bytes. Accepts either a
2956 string or a buffer object holding the data and the length of the data
2957 must be width*height*3.
2958 """
2959 val = _core_.new_ImageFromData(*args, **kwargs)
2960 return val
2961
2962 def ImageFromDataWithAlpha(*args, **kwargs):
2963 """
2964 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2965
2966 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2967 Accepts either a string or a buffer object holding the data and the
2968 length of the data must be width*height*3 bytes, and the length of the
2969 alpha data must be width*height bytes.
2970 """
2971 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2972 return val
2973
2974 def Image_CanRead(*args, **kwargs):
2975 """
2976 Image_CanRead(String filename) -> bool
2977
2978 Returns True if the image handlers can read this file.
2979 """
2980 return _core_.Image_CanRead(*args, **kwargs)
2981
2982 def Image_GetImageCount(*args, **kwargs):
2983 """
2984 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2985
2986 If the image file contains more than one image and the image handler
2987 is capable of retrieving these individually, this function will return
2988 the number of available images.
2989 """
2990 return _core_.Image_GetImageCount(*args, **kwargs)
2991
2992 def Image_CanReadStream(*args, **kwargs):
2993 """
2994 Image_CanReadStream(InputStream stream) -> bool
2995
2996 Returns True if the image handlers can read an image file from the
2997 data currently on the input stream, or a readable Python file-like
2998 object.
2999 """
3000 return _core_.Image_CanReadStream(*args, **kwargs)
3001
3002 def Image_AddHandler(*args, **kwargs):
3003 """Image_AddHandler(ImageHandler handler)"""
3004 return _core_.Image_AddHandler(*args, **kwargs)
3005
3006 def Image_InsertHandler(*args, **kwargs):
3007 """Image_InsertHandler(ImageHandler handler)"""
3008 return _core_.Image_InsertHandler(*args, **kwargs)
3009
3010 def Image_RemoveHandler(*args, **kwargs):
3011 """Image_RemoveHandler(String name) -> bool"""
3012 return _core_.Image_RemoveHandler(*args, **kwargs)
3013
3014 def Image_GetHandlers(*args):
3015 """Image_GetHandlers() -> PyObject"""
3016 return _core_.Image_GetHandlers(*args)
3017
3018 def Image_GetImageExtWildcard(*args):
3019 """
3020 Image_GetImageExtWildcard() -> String
3021
3022 Iterates all registered wxImageHandler objects, and returns a string
3023 containing file extension masks suitable for passing to file open/save
3024 dialog boxes.
3025 """
3026 return _core_.Image_GetImageExtWildcard(*args)
3027
3028 def Image_RGBtoHSV(*args, **kwargs):
3029 """
3030 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3031
3032 Converts a color in RGB color space to HSV color space.
3033 """
3034 return _core_.Image_RGBtoHSV(*args, **kwargs)
3035
3036 def Image_HSVtoRGB(*args, **kwargs):
3037 """
3038 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3039
3040 Converts a color in HSV color space to RGB color space.
3041 """
3042 return _core_.Image_HSVtoRGB(*args, **kwargs)
3043
3044 def InitAllImageHandlers():
3045 """
3046 The former functionality of InitAllImageHanders is now done internal to
3047 the _core_ extension module and so this function has become a simple NOP.
3048 """
3049 pass
3050
3051 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3052 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3053 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3054 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3055 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3056 BMP_24BPP = _core_.BMP_24BPP
3057 BMP_8BPP = _core_.BMP_8BPP
3058 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3059 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3060 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3061 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3062 BMP_4BPP = _core_.BMP_4BPP
3063 BMP_1BPP = _core_.BMP_1BPP
3064 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3065 class BMPHandler(ImageHandler):
3066 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3067 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3068 __repr__ = _swig_repr
3069 def __init__(self, *args, **kwargs):
3070 """
3071 __init__(self) -> BMPHandler
3072
3073 A `wx.ImageHandler` for \*.bmp bitmap files.
3074 """
3075 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3076 _core_.BMPHandler_swigregister(BMPHandler)
3077 NullImage = cvar.NullImage
3078 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3079 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3080 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3081 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3082 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3083 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3084 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3085 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3086 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3087 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3088 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3089 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3090 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3091 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3092 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3093
3094 class ICOHandler(BMPHandler):
3095 """A `wx.ImageHandler` for \*.ico icon 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) -> ICOHandler
3101
3102 A `wx.ImageHandler` for \*.ico icon files.
3103 """
3104 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3105 _core_.ICOHandler_swigregister(ICOHandler)
3106
3107 class CURHandler(ICOHandler):
3108 """A `wx.ImageHandler` for \*.cur 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) -> CURHandler
3114
3115 A `wx.ImageHandler` for \*.cur cursor files.
3116 """
3117 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3118 _core_.CURHandler_swigregister(CURHandler)
3119
3120 class ANIHandler(CURHandler):
3121 """A `wx.ImageHandler` for \*.ani animated cursor 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) -> ANIHandler
3127
3128 A `wx.ImageHandler` for \*.ani animated cursor files.
3129 """
3130 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3131 _core_.ANIHandler_swigregister(ANIHandler)
3132
3133 class PNGHandler(ImageHandler):
3134 """A `wx.ImageHandler` for PNG 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) -> PNGHandler
3140
3141 A `wx.ImageHandler` for PNG image files.
3142 """
3143 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3144 _core_.PNGHandler_swigregister(PNGHandler)
3145
3146 class GIFHandler(ImageHandler):
3147 """A `wx.ImageHandler` for GIF image 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) -> GIFHandler
3153
3154 A `wx.ImageHandler` for GIF image files.
3155 """
3156 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3157 _core_.GIFHandler_swigregister(GIFHandler)
3158
3159 class PCXHandler(ImageHandler):
3160 """A `wx.ImageHandler` for PCX imager 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) -> PCXHandler
3166
3167 A `wx.ImageHandler` for PCX imager files.
3168 """
3169 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3170 _core_.PCXHandler_swigregister(PCXHandler)
3171
3172 class JPEGHandler(ImageHandler):
3173 """A `wx.ImageHandler` for JPEG/JPG 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) -> JPEGHandler
3179
3180 A `wx.ImageHandler` for JPEG/JPG image files.
3181 """
3182 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3183 _core_.JPEGHandler_swigregister(JPEGHandler)
3184
3185 class PNMHandler(ImageHandler):
3186 """A `wx.ImageHandler` for PNM image files."""
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) -> PNMHandler
3192
3193 A `wx.ImageHandler` for PNM image files.
3194 """
3195 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3196 _core_.PNMHandler_swigregister(PNMHandler)
3197
3198 class XPMHandler(ImageHandler):
3199 """A `wx.ImageHandler` for XPM image."""
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) -> XPMHandler
3205
3206 A `wx.ImageHandler` for XPM image.
3207 """
3208 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3209 _core_.XPMHandler_swigregister(XPMHandler)
3210
3211 class TIFFHandler(ImageHandler):
3212 """A `wx.ImageHandler` for TIFF image files."""
3213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3214 __repr__ = _swig_repr
3215 def __init__(self, *args, **kwargs):
3216 """
3217 __init__(self) -> TIFFHandler
3218
3219 A `wx.ImageHandler` for TIFF image files.
3220 """
3221 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3222 _core_.TIFFHandler_swigregister(TIFFHandler)
3223
3224 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3225 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3226 class Quantize(object):
3227 """Performs quantization, or colour reduction, on a wxImage."""
3228 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3229 def __init__(self): raise AttributeError, "No constructor defined"
3230 __repr__ = _swig_repr
3231 def Quantize(*args, **kwargs):
3232 """
3233 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 Quantize = staticmethod(Quantize)
3242 _core_.Quantize_swigregister(Quantize)
3243
3244 def Quantize_Quantize(*args, **kwargs):
3245 """
3246 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3247
3248 Reduce the colours in the source image and put the result into the
3249 destination image, setting the palette in the destination if
3250 needed. Both images may be the same, to overwrite the source image.
3251 """
3252 return _core_.Quantize_Quantize(*args, **kwargs)
3253
3254 #---------------------------------------------------------------------------
3255
3256 class EvtHandler(Object):
3257 """Proxy of C++ EvtHandler class"""
3258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3259 __repr__ = _swig_repr
3260 def __init__(self, *args, **kwargs):
3261 """__init__(self) -> EvtHandler"""
3262 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3263 def GetNextHandler(*args, **kwargs):
3264 """GetNextHandler(self) -> EvtHandler"""
3265 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3266
3267 def GetPreviousHandler(*args, **kwargs):
3268 """GetPreviousHandler(self) -> EvtHandler"""
3269 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3270
3271 def SetNextHandler(*args, **kwargs):
3272 """SetNextHandler(self, EvtHandler handler)"""
3273 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3274
3275 def SetPreviousHandler(*args, **kwargs):
3276 """SetPreviousHandler(self, EvtHandler handler)"""
3277 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3278
3279 def GetEvtHandlerEnabled(*args, **kwargs):
3280 """GetEvtHandlerEnabled(self) -> bool"""
3281 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3282
3283 def SetEvtHandlerEnabled(*args, **kwargs):
3284 """SetEvtHandlerEnabled(self, bool enabled)"""
3285 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3286
3287 def ProcessEvent(*args, **kwargs):
3288 """ProcessEvent(self, Event event) -> bool"""
3289 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3290
3291 def AddPendingEvent(*args, **kwargs):
3292 """AddPendingEvent(self, Event event)"""
3293 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3294
3295 def ProcessPendingEvents(*args, **kwargs):
3296 """ProcessPendingEvents(self)"""
3297 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3298
3299 def Connect(*args, **kwargs):
3300 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3301 return _core_.EvtHandler_Connect(*args, **kwargs)
3302
3303 def Disconnect(*args, **kwargs):
3304 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3305 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3306
3307 def _setOORInfo(*args, **kwargs):
3308 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3309 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3310 args[0].thisown = 0
3311 return val
3312
3313 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3314 """
3315 Bind an event to an event handler.
3316
3317 :param event: One of the EVT_* objects that specifies the
3318 type of event to bind,
3319
3320 :param handler: A callable object to be invoked when the
3321 event is delivered to self. Pass None to
3322 disconnect an event handler.
3323
3324 :param source: Sometimes the event originates from a
3325 different window than self, but you still
3326 want to catch it in self. (For example, a
3327 button event delivered to a frame.) By
3328 passing the source of the event, the event
3329 handling system is able to differentiate
3330 between the same event type from different
3331 controls.
3332
3333 :param id: Used to spcify the event source by ID instead
3334 of instance.
3335
3336 :param id2: Used when it is desirable to bind a handler
3337 to a range of IDs, such as with EVT_MENU_RANGE.
3338 """
3339 if source is not None:
3340 id = source.GetId()
3341 event.Bind(self, id, id2, handler)
3342
3343 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3344 """
3345 Disconencts the event handler binding for event from self.
3346 Returns True if successful.
3347 """
3348 if source is not None:
3349 id = source.GetId()
3350 return event.Unbind(self, id, id2)
3351
3352 _core_.EvtHandler_swigregister(EvtHandler)
3353
3354 #---------------------------------------------------------------------------
3355
3356 class PyEventBinder(object):
3357 """
3358 Instances of this class are used to bind specific events to event
3359 handlers.
3360 """
3361 def __init__(self, evtType, expectedIDs=0):
3362 if expectedIDs not in [0, 1, 2]:
3363 raise ValueError, "Invalid number of expectedIDs"
3364 self.expectedIDs = expectedIDs
3365
3366 if type(evtType) == list or type(evtType) == tuple:
3367 self.evtType = evtType
3368 else:
3369 self.evtType = [evtType]
3370
3371
3372 def Bind(self, target, id1, id2, function):
3373 """Bind this set of event types to target."""
3374 for et in self.evtType:
3375 target.Connect(id1, id2, et, function)
3376
3377
3378 def Unbind(self, target, id1, id2):
3379 """Remove an event binding."""
3380 success = 0
3381 for et in self.evtType:
3382 success += target.Disconnect(id1, id2, et)
3383 return success != 0
3384
3385
3386 def __call__(self, *args):
3387 """
3388 For backwards compatibility with the old EVT_* functions.
3389 Should be called with either (window, func), (window, ID,
3390 func) or (window, ID1, ID2, func) parameters depending on the
3391 type of the event.
3392 """
3393 assert len(args) == 2 + self.expectedIDs
3394 id1 = wx.ID_ANY
3395 id2 = wx.ID_ANY
3396 target = args[0]
3397 if self.expectedIDs == 0:
3398 func = args[1]
3399 elif self.expectedIDs == 1:
3400 id1 = args[1]
3401 func = args[2]
3402 elif self.expectedIDs == 2:
3403 id1 = args[1]
3404 id2 = args[2]
3405 func = args[3]
3406 else:
3407 raise ValueError, "Unexpected number of IDs"
3408
3409 self.Bind(target, id1, id2, func)
3410
3411
3412 # These two are square pegs that don't fit the PyEventBinder hole...
3413 def EVT_COMMAND(win, id, cmd, func):
3414 win.Connect(id, -1, cmd, func)
3415 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3416 win.Connect(id1, id2, cmd, func)
3417
3418
3419 #---------------------------------------------------------------------------
3420
3421 #---------------------------------------------------------------------------
3422
3423 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3424 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3425
3426 def NewEventType(*args):
3427 """NewEventType() -> EventType"""
3428 return _core_.NewEventType(*args)
3429 wxEVT_NULL = _core_.wxEVT_NULL
3430 wxEVT_FIRST = _core_.wxEVT_FIRST
3431 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3432 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3433 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3434 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3435 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3436 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3437 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3438 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3439 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3440 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3441 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3442 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3443 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3444 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3445 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3446 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3447 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3448 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3449 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3450 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3451 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3452 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3453 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3454 wxEVT_MOTION = _core_.wxEVT_MOTION
3455 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3456 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3457 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3458 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3459 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3460 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3461 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3462 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3463 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3464 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3465 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3466 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3467 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3468 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3469 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3470 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3471 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3472 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3473 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3474 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3475 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3476 wxEVT_CHAR = _core_.wxEVT_CHAR
3477 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3478 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3479 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3480 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3481 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3482 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3483 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3484 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3485 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3486 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3487 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3488 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3489 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3490 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3491 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3492 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3493 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3494 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3495 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3496 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3497 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3498 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3499 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3500 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3501 wxEVT_SIZE = _core_.wxEVT_SIZE
3502 wxEVT_MOVE = _core_.wxEVT_MOVE
3503 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3504 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3505 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3506 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3507 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3508 wxEVT_CREATE = _core_.wxEVT_CREATE
3509 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3510 wxEVT_SHOW = _core_.wxEVT_SHOW
3511 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3512 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3513 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3514 wxEVT_PAINT = _core_.wxEVT_PAINT
3515 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3516 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3517 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3518 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3519 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3520 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3521 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3522 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3523 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3524 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3525 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3526 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3527 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3528 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3529 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3530 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3531 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3532 wxEVT_IDLE = _core_.wxEVT_IDLE
3533 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3534 wxEVT_SIZING = _core_.wxEVT_SIZING
3535 wxEVT_MOVING = _core_.wxEVT_MOVING
3536 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3537 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3538 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3539 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3540 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3541 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3542 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3543 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3544 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3545 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3546 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3547 #
3548 # Create some event binders
3549 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3550 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3551 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3552 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3553 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3554 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3555 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3556 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3557 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3558 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3559 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3560 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3561 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3562 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3563 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3564 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3565 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3566 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3567 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3568 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3569 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3570 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3571 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3572 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3573 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3574 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3575 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3576 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3577 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3578 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3579 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3580 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3581 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3582 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3583 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3584 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3585 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3586 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3587 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3588 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3589 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3590
3591 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3592 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3593 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3594 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3595 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3596 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3597 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3598 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3599 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3600 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3601 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3602 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3603 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3604
3605 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3606 wxEVT_LEFT_UP,
3607 wxEVT_MIDDLE_DOWN,
3608 wxEVT_MIDDLE_UP,
3609 wxEVT_RIGHT_DOWN,
3610 wxEVT_RIGHT_UP,
3611 wxEVT_MOTION,
3612 wxEVT_LEFT_DCLICK,
3613 wxEVT_MIDDLE_DCLICK,
3614 wxEVT_RIGHT_DCLICK,
3615 wxEVT_ENTER_WINDOW,
3616 wxEVT_LEAVE_WINDOW,
3617 wxEVT_MOUSEWHEEL
3618 ])
3619
3620
3621 # Scrolling from wxWindow (sent to wxScrolledWindow)
3622 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3623 wxEVT_SCROLLWIN_BOTTOM,
3624 wxEVT_SCROLLWIN_LINEUP,
3625 wxEVT_SCROLLWIN_LINEDOWN,
3626 wxEVT_SCROLLWIN_PAGEUP,
3627 wxEVT_SCROLLWIN_PAGEDOWN,
3628 wxEVT_SCROLLWIN_THUMBTRACK,
3629 wxEVT_SCROLLWIN_THUMBRELEASE,
3630 ])
3631
3632 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3633 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3634 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3635 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3636 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3637 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3638 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3639 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3640
3641 # Scrolling from wx.Slider and wx.ScrollBar
3642 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3643 wxEVT_SCROLL_BOTTOM,
3644 wxEVT_SCROLL_LINEUP,
3645 wxEVT_SCROLL_LINEDOWN,
3646 wxEVT_SCROLL_PAGEUP,
3647 wxEVT_SCROLL_PAGEDOWN,
3648 wxEVT_SCROLL_THUMBTRACK,
3649 wxEVT_SCROLL_THUMBRELEASE,
3650 wxEVT_SCROLL_CHANGED,
3651 ])
3652
3653 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3654 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3655 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3656 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3657 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3658 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3659 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3660 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3661 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3662 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3663
3664 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3665 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3666 wxEVT_SCROLL_BOTTOM,
3667 wxEVT_SCROLL_LINEUP,
3668 wxEVT_SCROLL_LINEDOWN,
3669 wxEVT_SCROLL_PAGEUP,
3670 wxEVT_SCROLL_PAGEDOWN,
3671 wxEVT_SCROLL_THUMBTRACK,
3672 wxEVT_SCROLL_THUMBRELEASE,
3673 wxEVT_SCROLL_CHANGED,
3674 ], 1)
3675
3676 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3677 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3678 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3679 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3680 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3681 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3682 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3683 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3684 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3685 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3686
3687 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3688 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3689 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3690 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3691 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3692 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3693 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3694 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3695 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3696 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3697
3698 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3699 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3700 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3701 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3702 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3703 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3704 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3705 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3706 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3707
3708
3709 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3710 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3711 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3712 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3713 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3714 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3715 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3716
3717 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3718
3719 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3720 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3721
3722 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3723
3724 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3725 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3726 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3727
3728
3729 #---------------------------------------------------------------------------
3730
3731 class Event(Object):
3732 """
3733 An event is a structure holding information about an event passed to a
3734 callback or member function. wx.Event is an abstract base class for
3735 other event classes
3736 """
3737 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3738 def __init__(self): raise AttributeError, "No constructor defined"
3739 __repr__ = _swig_repr
3740 __swig_destroy__ = _core_.delete_Event
3741 __del__ = lambda self : None;
3742 def SetEventType(*args, **kwargs):
3743 """
3744 SetEventType(self, EventType typ)
3745
3746 Sets the specific type of the event.
3747 """
3748 return _core_.Event_SetEventType(*args, **kwargs)
3749
3750 def GetEventType(*args, **kwargs):
3751 """
3752 GetEventType(self) -> EventType
3753
3754 Returns the identifier of the given event type, such as
3755 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3756 """
3757 return _core_.Event_GetEventType(*args, **kwargs)
3758
3759 def GetEventObject(*args, **kwargs):
3760 """
3761 GetEventObject(self) -> Object
3762
3763 Returns the object (usually a window) associated with the event, if
3764 any.
3765 """
3766 return _core_.Event_GetEventObject(*args, **kwargs)
3767
3768 def SetEventObject(*args, **kwargs):
3769 """
3770 SetEventObject(self, Object obj)
3771
3772 Sets the originating object, or in other words, obj is normally the
3773 object that is sending the event.
3774 """
3775 return _core_.Event_SetEventObject(*args, **kwargs)
3776
3777 def GetTimestamp(*args, **kwargs):
3778 """GetTimestamp(self) -> long"""
3779 return _core_.Event_GetTimestamp(*args, **kwargs)
3780
3781 def SetTimestamp(*args, **kwargs):
3782 """SetTimestamp(self, long ts=0)"""
3783 return _core_.Event_SetTimestamp(*args, **kwargs)
3784
3785 def GetId(*args, **kwargs):
3786 """
3787 GetId(self) -> int
3788
3789 Returns the identifier associated with this event, such as a button
3790 command id.
3791 """
3792 return _core_.Event_GetId(*args, **kwargs)
3793
3794 def SetId(*args, **kwargs):
3795 """
3796 SetId(self, int Id)
3797
3798 Set's the ID for the event. This is usually the ID of the window that
3799 is sending the event, but it can also be a command id from a menu
3800 item, etc.
3801 """
3802 return _core_.Event_SetId(*args, **kwargs)
3803
3804 def IsCommandEvent(*args, **kwargs):
3805 """
3806 IsCommandEvent(self) -> bool
3807
3808 Returns true if the event is or is derived from `wx.CommandEvent` else
3809 it returns false. Note: Exists only for optimization purposes.
3810 """
3811 return _core_.Event_IsCommandEvent(*args, **kwargs)
3812
3813 def Skip(*args, **kwargs):
3814 """
3815 Skip(self, bool skip=True)
3816
3817 Called by an event handler, it controls whether additional event
3818 handlers bound to this event will be called after the current event
3819 handler returns. Skip(false) (the default setting) will prevent
3820 additional event handlers from being called and control will be
3821 returned to the sender of the event immediately after the current
3822 handler has finished. Skip(True) will cause the event processing
3823 system to continue searching for a handler function for this event.
3824
3825 """
3826 return _core_.Event_Skip(*args, **kwargs)
3827
3828 def GetSkipped(*args, **kwargs):
3829 """
3830 GetSkipped(self) -> bool
3831
3832 Returns true if the event handler should be skipped, false otherwise.
3833 :see: `Skip`
3834 """
3835 return _core_.Event_GetSkipped(*args, **kwargs)
3836
3837 def ShouldPropagate(*args, **kwargs):
3838 """
3839 ShouldPropagate(self) -> bool
3840
3841 Test if this event should be propagated to the parent window or not,
3842 i.e. if the propagation level is currently greater than 0.
3843 """
3844 return _core_.Event_ShouldPropagate(*args, **kwargs)
3845
3846 def StopPropagation(*args, **kwargs):
3847 """
3848 StopPropagation(self) -> int
3849
3850 Stop the event from propagating to its parent window. Returns the old
3851 propagation level value which may be later passed to
3852 `ResumePropagation` to allow propagating the event again.
3853 """
3854 return _core_.Event_StopPropagation(*args, **kwargs)
3855
3856 def ResumePropagation(*args, **kwargs):
3857 """
3858 ResumePropagation(self, int propagationLevel)
3859
3860 Resume the event propagation by restoring the propagation level. (For
3861 example, you can use the value returned by an earlier call to
3862 `StopPropagation`.)
3863
3864 """
3865 return _core_.Event_ResumePropagation(*args, **kwargs)
3866
3867 def Clone(*args, **kwargs):
3868 """Clone(self) -> Event"""
3869 return _core_.Event_Clone(*args, **kwargs)
3870
3871 _core_.Event_swigregister(Event)
3872
3873 #---------------------------------------------------------------------------
3874
3875 class PropagationDisabler(object):
3876 """
3877 Helper class to temporarily change an event not to propagate. Simply
3878 create an instance of this class and then whe it is destroyed the
3879 propogation of the event will be restored.
3880 """
3881 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3882 __repr__ = _swig_repr
3883 def __init__(self, *args, **kwargs):
3884 """
3885 __init__(self, Event event) -> PropagationDisabler
3886
3887 Helper class to temporarily change an event not to propagate. Simply
3888 create an instance of this class and then whe it is destroyed the
3889 propogation of the event will be restored.
3890 """
3891 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3892 __swig_destroy__ = _core_.delete_PropagationDisabler
3893 __del__ = lambda self : None;
3894 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3895
3896 class PropagateOnce(object):
3897 """
3898 A helper class that will temporarily lower propagation level of an
3899 event. Simply create an instance of this class and then whe it is
3900 destroyed the propogation of the event will be restored.
3901 """
3902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3903 __repr__ = _swig_repr
3904 def __init__(self, *args, **kwargs):
3905 """
3906 __init__(self, Event event) -> PropagateOnce
3907
3908 A helper class that will temporarily lower propagation level of an
3909 event. Simply create an instance of this class and then whe it is
3910 destroyed the propogation of the event will be restored.
3911 """
3912 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3913 __swig_destroy__ = _core_.delete_PropagateOnce
3914 __del__ = lambda self : None;
3915 _core_.PropagateOnce_swigregister(PropagateOnce)
3916
3917 #---------------------------------------------------------------------------
3918
3919 class CommandEvent(Event):
3920 """
3921 This event class contains information about command events, which
3922 originate from a variety of simple controls, as well as menus and
3923 toolbars.
3924 """
3925 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3926 __repr__ = _swig_repr
3927 def __init__(self, *args, **kwargs):
3928 """
3929 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3930
3931 This event class contains information about command events, which
3932 originate from a variety of simple controls, as well as menus and
3933 toolbars.
3934 """
3935 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3936 def GetSelection(*args, **kwargs):
3937 """
3938 GetSelection(self) -> int
3939
3940 Returns item index for a listbox or choice selection event (not valid
3941 for a deselection).
3942 """
3943 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3944
3945 def SetString(*args, **kwargs):
3946 """SetString(self, String s)"""
3947 return _core_.CommandEvent_SetString(*args, **kwargs)
3948
3949 def GetString(*args, **kwargs):
3950 """
3951 GetString(self) -> String
3952
3953 Returns item string for a listbox or choice selection event (not valid
3954 for a deselection).
3955 """
3956 return _core_.CommandEvent_GetString(*args, **kwargs)
3957
3958 def IsChecked(*args, **kwargs):
3959 """
3960 IsChecked(self) -> bool
3961
3962 This method can be used with checkbox and menu events: for the
3963 checkboxes, the method returns true for a selection event and false
3964 for a deselection one. For the menu events, this method indicates if
3965 the menu item just has become checked or unchecked (and thus only
3966 makes sense for checkable menu items).
3967 """
3968 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3969
3970 Checked = IsChecked
3971 def IsSelection(*args, **kwargs):
3972 """
3973 IsSelection(self) -> bool
3974
3975 For a listbox or similar event, returns true if it is a selection,
3976 false if it is a deselection.
3977 """
3978 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3979
3980 def SetExtraLong(*args, **kwargs):
3981 """SetExtraLong(self, long extraLong)"""
3982 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3983
3984 def GetExtraLong(*args, **kwargs):
3985 """
3986 GetExtraLong(self) -> long
3987
3988 Returns extra information dependant on the event objects type. If the
3989 event comes from a listbox selection, it is a boolean determining
3990 whether the event was a selection (true) or a deselection (false). A
3991 listbox deselection only occurs for multiple-selection boxes, and in
3992 this case the index and string values are indeterminate and the
3993 listbox must be examined by the application.
3994 """
3995 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3996
3997 def SetInt(*args, **kwargs):
3998 """SetInt(self, int i)"""
3999 return _core_.CommandEvent_SetInt(*args, **kwargs)
4000
4001 def GetInt(*args, **kwargs):
4002 """
4003 GetInt(self) -> int
4004
4005 Returns the integer identifier corresponding to a listbox, choice or
4006 radiobox selection (only if the event was a selection, not a
4007 deselection), or a boolean value representing the value of a checkbox.
4008 """
4009 return _core_.CommandEvent_GetInt(*args, **kwargs)
4010
4011 def GetClientData(*args, **kwargs):
4012 """
4013 GetClientData(self) -> PyObject
4014
4015 Returns the client data object for a listbox or choice selection event, (if any.)
4016 """
4017 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4018
4019 def SetClientData(*args, **kwargs):
4020 """
4021 SetClientData(self, PyObject clientData)
4022
4023 Associate the given client data with the item at position n.
4024 """
4025 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4026
4027 GetClientObject = GetClientData
4028 SetClientObject = SetClientData
4029
4030 def Clone(*args, **kwargs):
4031 """Clone(self) -> Event"""
4032 return _core_.CommandEvent_Clone(*args, **kwargs)
4033
4034 _core_.CommandEvent_swigregister(CommandEvent)
4035
4036 #---------------------------------------------------------------------------
4037
4038 class NotifyEvent(CommandEvent):
4039 """
4040 An instance of this class (or one of its derived classes) is sent from
4041 a control when the control's state is being changed and the control
4042 allows that change to be prevented from happening. The event handler
4043 can call `Veto` or `Allow` to tell the control what to do.
4044 """
4045 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4046 __repr__ = _swig_repr
4047 def __init__(self, *args, **kwargs):
4048 """
4049 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4050
4051 An instance of this class (or one of its derived classes) is sent from
4052 a control when the control's state is being changed and the control
4053 allows that change to be prevented from happening. The event handler
4054 can call `Veto` or `Allow` to tell the control what to do.
4055 """
4056 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4057 def Veto(*args, **kwargs):
4058 """
4059 Veto(self)
4060
4061 Prevents the change announced by this event from happening.
4062
4063 It is in general a good idea to notify the user about the reasons for
4064 vetoing the change because otherwise the applications behaviour (which
4065 just refuses to do what the user wants) might be quite surprising.
4066 """
4067 return _core_.NotifyEvent_Veto(*args, **kwargs)
4068
4069 def Allow(*args, **kwargs):
4070 """
4071 Allow(self)
4072
4073 This is the opposite of `Veto`: it explicitly allows the event to be
4074 processed. For most events it is not necessary to call this method as
4075 the events are allowed anyhow but some are forbidden by default (this
4076 will be mentioned in the corresponding event description).
4077 """
4078 return _core_.NotifyEvent_Allow(*args, **kwargs)
4079
4080 def IsAllowed(*args, **kwargs):
4081 """
4082 IsAllowed(self) -> bool
4083
4084 Returns true if the change is allowed (`Veto` hasn't been called) or
4085 false otherwise (if it was).
4086 """
4087 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4088
4089 _core_.NotifyEvent_swigregister(NotifyEvent)
4090
4091 #---------------------------------------------------------------------------
4092
4093 class ScrollEvent(CommandEvent):
4094 """
4095 A scroll event holds information about events sent from stand-alone
4096 scrollbars and sliders. Note that scrolled windows do not send
4097 instnaces of this event class, but send the `wx.ScrollWinEvent`
4098 instead.
4099 """
4100 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4101 __repr__ = _swig_repr
4102 def __init__(self, *args, **kwargs):
4103 """
4104 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4105 int orient=0) -> ScrollEvent
4106 """
4107 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4108 def GetOrientation(*args, **kwargs):
4109 """
4110 GetOrientation(self) -> int
4111
4112 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4113 the scrollbar.
4114 """
4115 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4116
4117 def GetPosition(*args, **kwargs):
4118 """
4119 GetPosition(self) -> int
4120
4121 Returns the position of the scrollbar.
4122 """
4123 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4124
4125 def SetOrientation(*args, **kwargs):
4126 """SetOrientation(self, int orient)"""
4127 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4128
4129 def SetPosition(*args, **kwargs):
4130 """SetPosition(self, int pos)"""
4131 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4132
4133 _core_.ScrollEvent_swigregister(ScrollEvent)
4134
4135 #---------------------------------------------------------------------------
4136
4137 class ScrollWinEvent(Event):
4138 """
4139 A wx.ScrollWinEvent holds information about scrolling and is sent from
4140 scrolling windows.
4141 """
4142 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4143 __repr__ = _swig_repr
4144 def __init__(self, *args, **kwargs):
4145 """
4146 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4147
4148 A wx.ScrollWinEvent holds information about scrolling and is sent from
4149 scrolling windows.
4150 """
4151 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4152 def GetOrientation(*args, **kwargs):
4153 """
4154 GetOrientation(self) -> int
4155
4156 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4157 the scrollbar.
4158 """
4159 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4160
4161 def GetPosition(*args, **kwargs):
4162 """
4163 GetPosition(self) -> int
4164
4165 Returns the position of the scrollbar for the thumb track and release
4166 events. Note that this field can't be used for the other events, you
4167 need to query the window itself for the current position in that case.
4168 """
4169 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4170
4171 def SetOrientation(*args, **kwargs):
4172 """SetOrientation(self, int orient)"""
4173 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4174
4175 def SetPosition(*args, **kwargs):
4176 """SetPosition(self, int pos)"""
4177 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4178
4179 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4180
4181 #---------------------------------------------------------------------------
4182
4183 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4184 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4185 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4186 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4187 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4188 class MouseEvent(Event):
4189 """
4190 This event class contains information about the events generated by
4191 the mouse: they include mouse buttons press and release events and
4192 mouse move events.
4193
4194 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4195 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4196 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4197 a middle button so a portable application should avoid relying on the
4198 events from it.
4199
4200 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4201 the former returns true when the event corresponds to the left mouse
4202 button click while the latter returns true if the left mouse button is
4203 currently being pressed. For example, when the user is dragging the
4204 mouse you can use `LeftIsDown` to test whether the left mouse button
4205 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4206 `LeftIsDown` will also return true in wxWidgets whatever the
4207 underlying GUI behaviour is (which is platform-dependent). The same
4208 applies, of course, to other mouse buttons as well.
4209 """
4210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4211 __repr__ = _swig_repr
4212 def __init__(self, *args, **kwargs):
4213 """
4214 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4215
4216 Constructs a wx.MouseEvent. Valid event types are:
4217
4218 * wxEVT_ENTER_WINDOW
4219 * wxEVT_LEAVE_WINDOW
4220 * wxEVT_LEFT_DOWN
4221 * wxEVT_LEFT_UP
4222 * wxEVT_LEFT_DCLICK
4223 * wxEVT_MIDDLE_DOWN
4224 * wxEVT_MIDDLE_UP
4225 * wxEVT_MIDDLE_DCLICK
4226 * wxEVT_RIGHT_DOWN
4227 * wxEVT_RIGHT_UP
4228 * wxEVT_RIGHT_DCLICK
4229 * wxEVT_MOTION
4230 * wxEVT_MOUSEWHEEL
4231 """
4232 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4233 def IsButton(*args, **kwargs):
4234 """
4235 IsButton(self) -> bool
4236
4237 Returns true if the event was a mouse button event (not necessarily a
4238 button down event - that may be tested using `ButtonDown`).
4239 """
4240 return _core_.MouseEvent_IsButton(*args, **kwargs)
4241
4242 def ButtonDown(*args, **kwargs):
4243 """
4244 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4245
4246 If the argument is omitted, this returns true if the event was any
4247 mouse button down event. Otherwise the argument specifies which
4248 button-down event shold be checked for (see `Button` for the possible
4249 values).
4250 """
4251 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4252
4253 def ButtonDClick(*args, **kwargs):
4254 """
4255 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4256
4257 If the argument is omitted, this returns true if the event was any
4258 mouse double click event. Otherwise the argument specifies which
4259 double click event to check for (see `Button` for the possible
4260 values).
4261 """
4262 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4263
4264 def ButtonUp(*args, **kwargs):
4265 """
4266 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4267
4268 If the argument is omitted, this returns true if the event was any
4269 mouse button up event. Otherwise the argument specifies which button
4270 up event to check for (see `Button` for the possible values).
4271 """
4272 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4273
4274 def Button(*args, **kwargs):
4275 """
4276 Button(self, int button) -> bool
4277
4278 Returns true if the identified mouse button is changing state. Valid
4279 values of button are:
4280
4281 ==================== =====================================
4282 wx.MOUSE_BTN_LEFT check if left button was pressed
4283 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4284 wx.MOUSE_BTN_RIGHT check if right button was pressed
4285 wx.MOUSE_BTN_ANY check if any button was pressed
4286 ==================== =====================================
4287
4288 """
4289 return _core_.MouseEvent_Button(*args, **kwargs)
4290
4291 def ButtonIsDown(*args, **kwargs):
4292 """ButtonIsDown(self, int but) -> bool"""
4293 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4294
4295 def GetButton(*args, **kwargs):
4296 """
4297 GetButton(self) -> int
4298
4299 Returns the mouse button which generated this event or
4300 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4301 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4302 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4303 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4304 right buttons respectively.
4305 """
4306 return _core_.MouseEvent_GetButton(*args, **kwargs)
4307
4308 def ControlDown(*args, **kwargs):
4309 """
4310 ControlDown(self) -> bool
4311
4312 Returns true if the control key was down at the time of the event.
4313 """
4314 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4315
4316 def MetaDown(*args, **kwargs):
4317 """
4318 MetaDown(self) -> bool
4319
4320 Returns true if the Meta key was down at the time of the event.
4321 """
4322 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4323
4324 def AltDown(*args, **kwargs):
4325 """
4326 AltDown(self) -> bool
4327
4328 Returns true if the Alt key was down at the time of the event.
4329 """
4330 return _core_.MouseEvent_AltDown(*args, **kwargs)
4331
4332 def ShiftDown(*args, **kwargs):
4333 """
4334 ShiftDown(self) -> bool
4335
4336 Returns true if the Shift key was down at the time of the event.
4337 """
4338 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4339
4340 def CmdDown(*args, **kwargs):
4341 """
4342 CmdDown(self) -> bool
4343
4344 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4345 platforms but the special "Apple" (a.k.a as "Command") key on
4346 Macs. It often makes sense to use it instead of, say, `ControlDown`
4347 because Cmd key is used for the same thing under Mac as Ctrl
4348 elsewhere. The Ctrl key still exists, it's just not used for this
4349 purpose. So for non-Mac platforms this is the same as `ControlDown`
4350 and Macs this is the same as `MetaDown`.
4351 """
4352 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4353
4354 def LeftDown(*args, **kwargs):
4355 """
4356 LeftDown(self) -> bool
4357
4358 Returns true if the left mouse button state changed to down.
4359 """
4360 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4361
4362 def MiddleDown(*args, **kwargs):
4363 """
4364 MiddleDown(self) -> bool
4365
4366 Returns true if the middle mouse button state changed to down.
4367 """
4368 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4369
4370 def RightDown(*args, **kwargs):
4371 """
4372 RightDown(self) -> bool
4373
4374 Returns true if the right mouse button state changed to down.
4375 """
4376 return _core_.MouseEvent_RightDown(*args, **kwargs)
4377
4378 def LeftUp(*args, **kwargs):
4379 """
4380 LeftUp(self) -> bool
4381
4382 Returns true if the left mouse button state changed to up.
4383 """
4384 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4385
4386 def MiddleUp(*args, **kwargs):
4387 """
4388 MiddleUp(self) -> bool
4389
4390 Returns true if the middle mouse button state changed to up.
4391 """
4392 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4393
4394 def RightUp(*args, **kwargs):
4395 """
4396 RightUp(self) -> bool
4397
4398 Returns true if the right mouse button state changed to up.
4399 """
4400 return _core_.MouseEvent_RightUp(*args, **kwargs)
4401
4402 def LeftDClick(*args, **kwargs):
4403 """
4404 LeftDClick(self) -> bool
4405
4406 Returns true if the event was a left button double click.
4407 """
4408 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4409
4410 def MiddleDClick(*args, **kwargs):
4411 """
4412 MiddleDClick(self) -> bool
4413
4414 Returns true if the event was a middle button double click.
4415 """
4416 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4417
4418 def RightDClick(*args, **kwargs):
4419 """
4420 RightDClick(self) -> bool
4421
4422 Returns true if the event was a right button double click.
4423 """
4424 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4425
4426 def LeftIsDown(*args, **kwargs):
4427 """
4428 LeftIsDown(self) -> bool
4429
4430 Returns true if the left mouse button is currently down, independent
4431 of the current event type.
4432
4433 Please notice that it is not the same as LeftDown which returns true
4434 if the left mouse button was just pressed. Rather, it describes the
4435 state of the mouse button before the event happened.
4436
4437 This event is usually used in the mouse event handlers which process
4438 "move mouse" messages to determine whether the user is (still)
4439 dragging the mouse.
4440 """
4441 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4442
4443 def MiddleIsDown(*args, **kwargs):
4444 """
4445 MiddleIsDown(self) -> bool
4446
4447 Returns true if the middle mouse button is currently down, independent
4448 of the current event type.
4449 """
4450 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4451
4452 def RightIsDown(*args, **kwargs):
4453 """
4454 RightIsDown(self) -> bool
4455
4456 Returns true if the right mouse button is currently down, independent
4457 of the current event type.
4458 """
4459 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4460
4461 def Dragging(*args, **kwargs):
4462 """
4463 Dragging(self) -> bool
4464
4465 Returns true if this was a dragging event (motion while a button is
4466 depressed).
4467 """
4468 return _core_.MouseEvent_Dragging(*args, **kwargs)
4469
4470 def Moving(*args, **kwargs):
4471 """
4472 Moving(self) -> bool
4473
4474 Returns true if this was a motion event and no mouse buttons were
4475 pressed. If any mouse button is held pressed, then this method returns
4476 false and Dragging returns true.
4477 """
4478 return _core_.MouseEvent_Moving(*args, **kwargs)
4479
4480 def Entering(*args, **kwargs):
4481 """
4482 Entering(self) -> bool
4483
4484 Returns true if the mouse was entering the window.
4485 """
4486 return _core_.MouseEvent_Entering(*args, **kwargs)
4487
4488 def Leaving(*args, **kwargs):
4489 """
4490 Leaving(self) -> bool
4491
4492 Returns true if the mouse was leaving the window.
4493 """
4494 return _core_.MouseEvent_Leaving(*args, **kwargs)
4495
4496 def GetPosition(*args, **kwargs):
4497 """
4498 GetPosition(self) -> Point
4499
4500 Returns the pixel position of the mouse in window coordinates when the
4501 event happened.
4502 """
4503 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4504
4505 def GetPositionTuple(*args, **kwargs):
4506 """
4507 GetPositionTuple() -> (x,y)
4508
4509 Returns the pixel position of the mouse in window coordinates when the
4510 event happened.
4511 """
4512 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4513
4514 def GetLogicalPosition(*args, **kwargs):
4515 """
4516 GetLogicalPosition(self, DC dc) -> Point
4517
4518 Returns the logical mouse position in pixels (i.e. translated
4519 according to the translation set for the DC, which usually indicates
4520 that the window has been scrolled).
4521 """
4522 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4523
4524 def GetX(*args, **kwargs):
4525 """
4526 GetX(self) -> int
4527
4528 Returns X coordinate of the physical mouse event position.
4529 """
4530 return _core_.MouseEvent_GetX(*args, **kwargs)
4531
4532 def GetY(*args, **kwargs):
4533 """
4534 GetY(self) -> int
4535
4536 Returns Y coordinate of the physical mouse event position.
4537 """
4538 return _core_.MouseEvent_GetY(*args, **kwargs)
4539
4540 def GetWheelRotation(*args, **kwargs):
4541 """
4542 GetWheelRotation(self) -> int
4543
4544 Get wheel rotation, positive or negative indicates direction of
4545 rotation. Current devices all send an event when rotation is equal to
4546 +/-WheelDelta, but this allows for finer resolution devices to be
4547 created in the future. Because of this you shouldn't assume that one
4548 event is equal to 1 line or whatever, but you should be able to either
4549 do partial line scrolling or wait until +/-WheelDelta rotation values
4550 have been accumulated before scrolling.
4551 """
4552 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4553
4554 def GetWheelDelta(*args, **kwargs):
4555 """
4556 GetWheelDelta(self) -> int
4557
4558 Get wheel delta, normally 120. This is the threshold for action to be
4559 taken, and one such action (for example, scrolling one increment)
4560 should occur for each delta.
4561 """
4562 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4563
4564 def GetLinesPerAction(*args, **kwargs):
4565 """
4566 GetLinesPerAction(self) -> int
4567
4568 Returns the configured number of lines (or whatever) to be scrolled
4569 per wheel action. Defaults to three.
4570 """
4571 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4572
4573 def IsPageScroll(*args, **kwargs):
4574 """
4575 IsPageScroll(self) -> bool
4576
4577 Returns true if the system has been setup to do page scrolling with
4578 the mouse wheel instead of line scrolling.
4579 """
4580 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4581
4582 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4583 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4584 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4585 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4586 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4587 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4588 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4589 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4590 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4591 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4592 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4593 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4594 _core_.MouseEvent_swigregister(MouseEvent)
4595
4596 #---------------------------------------------------------------------------
4597
4598 class SetCursorEvent(Event):
4599 """
4600 A SetCursorEvent is generated when the mouse cursor is about to be set
4601 as a result of mouse motion. This event gives the application the
4602 chance to perform specific mouse cursor processing based on the
4603 current position of the mouse within the window. Use the `SetCursor`
4604 method to specify the cursor you want to be displayed.
4605 """
4606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4607 __repr__ = _swig_repr
4608 def __init__(self, *args, **kwargs):
4609 """
4610 __init__(self, int x=0, int y=0) -> SetCursorEvent
4611
4612 Construct a new `wx.SetCursorEvent`.
4613 """
4614 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4615 def GetX(*args, **kwargs):
4616 """
4617 GetX(self) -> int
4618
4619 Returns the X coordinate of the mouse in client coordinates.
4620 """
4621 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4622
4623 def GetY(*args, **kwargs):
4624 """
4625 GetY(self) -> int
4626
4627 Returns the Y coordinate of the mouse in client coordinates.
4628 """
4629 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4630
4631 def SetCursor(*args, **kwargs):
4632 """
4633 SetCursor(self, Cursor cursor)
4634
4635 Sets the cursor associated with this event.
4636 """
4637 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4638
4639 def GetCursor(*args, **kwargs):
4640 """
4641 GetCursor(self) -> Cursor
4642
4643 Returns a reference to the cursor specified by this event.
4644 """
4645 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4646
4647 def HasCursor(*args, **kwargs):
4648 """
4649 HasCursor(self) -> bool
4650
4651 Returns true if the cursor specified by this event is a valid cursor.
4652 """
4653 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4654
4655 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4656
4657 #---------------------------------------------------------------------------
4658
4659 class KeyEvent(Event):
4660 """
4661 This event class contains information about keypress and character
4662 events. These events are only sent to the widget that currently has
4663 the keyboard focus.
4664
4665 Notice that there are three different kinds of keyboard events in
4666 wxWidgets: key down and up events and char events. The difference
4667 between the first two is clear - the first corresponds to a key press
4668 and the second to a key release - otherwise they are identical. Just
4669 note that if the key is maintained in a pressed state you will
4670 typically get a lot of (automatically generated) down events but only
4671 one up so it is wrong to assume that there is one up event
4672 corresponding to each down one.
4673
4674 Both key events provide untranslated key codes while the char event
4675 carries the translated one. The untranslated code for alphanumeric
4676 keys is always an upper case value. For the other keys it is one of
4677 WXK_XXX values from the keycodes table. The translated key is, in
4678 general, the character the user expects to appear as the result of the
4679 key combination when typing the text into a text entry zone, for
4680 example.
4681
4682 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4683 and the standard US keyboard): when the 'A' key is pressed, the key
4684 down event key code is equal to ASCII A == 65. But the char event key
4685 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4686 'A' keys simultaneously , the key code in key down event will still be
4687 just 'A' while the char event key code parameter will now be 'A' as
4688 well.
4689
4690 Although in this simple case it is clear that the correct key code
4691 could be found in the key down event handler by checking the value
4692 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4693 as for non alphanumeric keys or non-US keyboard layouts the
4694 translation is keyboard-layout dependent and can only be done properly
4695 by the system itself.
4696
4697 Another kind of translation is done when the control key is pressed:
4698 for example, for CTRL-A key press the key down event still carries the
4699 same key code 'A' as usual but the char event will have key code of 1,
4700 the ASCII value of this key combination.
4701
4702 You may discover how the other keys on your system behave
4703 interactively by running the KeyEvents sample in the wxPython demo and
4704 pressing some keys while the blue box at the top has the keyboard
4705 focus.
4706
4707 **Note**: If a key down event is caught and the event handler does not
4708 call event.Skip() then the coresponding char event will not
4709 happen. This is by design and enables the programs that handle both
4710 types of events to be a bit simpler.
4711
4712 **Note for Windows programmers**: The key and char events in wxWidgets
4713 are similar to but slightly different from Windows WM_KEYDOWN and
4714 WM_CHAR events. In particular, Alt-x combination will generate a char
4715 event in wxWidgets (unless it is used as an accelerator).
4716
4717 **Tip**: be sure to call event.Skip() for events that you don't
4718 process in key event function, otherwise menu shortcuts may cease to
4719 work under Windows.
4720
4721 """
4722 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4723 __repr__ = _swig_repr
4724 def __init__(self, *args, **kwargs):
4725 """
4726 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4727
4728 Construct a new `wx.KeyEvent`. Valid event types are:
4729 *
4730 """
4731 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4732 def GetModifiers(*args, **kwargs):
4733 """
4734 GetModifiers(self) -> int
4735
4736 Returns a bitmask of the current modifier settings. Can be used to
4737 check if the key event has exactly the given modifiers without having
4738 to explicitly check that the other modifiers are not down. For
4739 example::
4740
4741 if event.GetModifers() == wx.MOD_CONTROL:
4742 DoSomething()
4743
4744 """
4745 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4746
4747 def ControlDown(*args, **kwargs):
4748 """
4749 ControlDown(self) -> bool
4750
4751 Returns ``True`` if the Control key was down at the time of the event.
4752 """
4753 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4754
4755 def MetaDown(*args, **kwargs):
4756 """
4757 MetaDown(self) -> bool
4758
4759 Returns ``True`` if the Meta key was down at the time of the event.
4760 """
4761 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4762
4763 def AltDown(*args, **kwargs):
4764 """
4765 AltDown(self) -> bool
4766
4767 Returns ``True`` if the Alt key was down at the time of the event.
4768 """
4769 return _core_.KeyEvent_AltDown(*args, **kwargs)
4770
4771 def ShiftDown(*args, **kwargs):
4772 """
4773 ShiftDown(self) -> bool
4774
4775 Returns ``True`` if the Shift key was down at the time of the event.
4776 """
4777 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4778
4779 def CmdDown(*args, **kwargs):
4780 """
4781 CmdDown(self) -> bool
4782
4783 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4784 platforms but the special "Apple" (a.k.a as "Command") key on
4785 Macs. It makes often sense to use it instead of, say, `ControlDown`
4786 because Cmd key is used for the same thing under Mac as Ctrl
4787 elsewhere. The Ctrl still exists, it's just not used for this
4788 purpose. So for non-Mac platforms this is the same as `ControlDown`
4789 and Macs this is the same as `MetaDown`.
4790 """
4791 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4792
4793 def HasModifiers(*args, **kwargs):
4794 """
4795 HasModifiers(self) -> bool
4796
4797 Returns true if either CTRL or ALT keys was down at the time of the
4798 key event. Note that this function does not take into account neither
4799 SHIFT nor META key states (the reason for ignoring the latter is that
4800 it is common for NUMLOCK key to be configured as META under X but the
4801 key presses even while NUMLOCK is on should be still processed
4802 normally).
4803 """
4804 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4805
4806 def GetKeyCode(*args, **kwargs):
4807 """
4808 GetKeyCode(self) -> int
4809
4810 Returns the virtual key code. ASCII events return normal ASCII values,
4811 while non-ASCII events return values such as WXK_LEFT for the left
4812 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4813 codes.
4814
4815 Note that in Unicode build, the returned value is meaningful only if
4816 the user entered a character that can be represented in current
4817 locale's default charset. You can obtain the corresponding Unicode
4818 character using `GetUnicodeKey`.
4819 """
4820 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4821
4822 KeyCode = GetKeyCode
4823 def GetUnicodeKey(*args, **kwargs):
4824 """
4825 GetUnicodeKey(self) -> int
4826
4827 Returns the Unicode character corresponding to this key event. This
4828 function is only meaningfule in a Unicode build of wxPython.
4829 """
4830 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4831
4832 GetUniChar = GetUnicodeKey
4833 def SetUnicodeKey(*args, **kwargs):
4834 """
4835 SetUnicodeKey(self, int uniChar)
4836
4837 Set the Unicode value of the key event, but only if this is a Unicode
4838 build of wxPython.
4839 """
4840 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4841
4842 def GetRawKeyCode(*args, **kwargs):
4843 """
4844 GetRawKeyCode(self) -> unsigned int
4845
4846 Returns the raw key code for this event. This is a platform-dependent
4847 scan code which should only be used in advanced
4848 applications. Currently the raw key codes are not supported by all
4849 ports.
4850 """
4851 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4852
4853 def GetRawKeyFlags(*args, **kwargs):
4854 """
4855 GetRawKeyFlags(self) -> unsigned int
4856
4857 Returns the low level key flags for this event. The flags are
4858 platform-dependent and should only be used in advanced applications.
4859 Currently the raw key flags are not supported by all ports.
4860 """
4861 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4862
4863 def GetPosition(*args, **kwargs):
4864 """
4865 GetPosition(self) -> Point
4866
4867 Find the position of the event, if applicable.
4868 """
4869 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4870
4871 def GetPositionTuple(*args, **kwargs):
4872 """
4873 GetPositionTuple() -> (x,y)
4874
4875 Find the position of the event, if applicable.
4876 """
4877 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4878
4879 def GetX(*args, **kwargs):
4880 """
4881 GetX(self) -> int
4882
4883 Returns the X position (in client coordinates) of the event, if
4884 applicable.
4885 """
4886 return _core_.KeyEvent_GetX(*args, **kwargs)
4887
4888 def GetY(*args, **kwargs):
4889 """
4890 GetY(self) -> int
4891
4892 Returns the Y position (in client coordinates) of the event, if
4893 applicable.
4894 """
4895 return _core_.KeyEvent_GetY(*args, **kwargs)
4896
4897 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4898 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4899 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4900 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4901 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4902 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4903 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4904 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4905 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4906 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4907 _core_.KeyEvent_swigregister(KeyEvent)
4908
4909 #---------------------------------------------------------------------------
4910
4911 class SizeEvent(Event):
4912 """
4913 A size event holds information about size change events. The EVT_SIZE
4914 handler function will be called when the window it is bound to has
4915 been resized.
4916
4917 Note that the size passed is of the whole window: call
4918 `wx.Window.GetClientSize` for the area which may be used by the
4919 application.
4920
4921 When a window is resized, usually only a small part of the window is
4922 damaged and and that area is all that is in the update region for the
4923 next paint event. However, if your drawing depends on the size of the
4924 window, you may need to clear the DC explicitly and repaint the whole
4925 window. In which case, you may need to call `wx.Window.Refresh` to
4926 invalidate the entire window.
4927
4928 """
4929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4930 __repr__ = _swig_repr
4931 def __init__(self, *args, **kwargs):
4932 """
4933 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4934
4935 Construct a new ``wx.SizeEvent``.
4936 """
4937 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4938 def GetSize(*args, **kwargs):
4939 """
4940 GetSize(self) -> Size
4941
4942 Returns the entire size of the window generating the size change
4943 event.
4944 """
4945 return _core_.SizeEvent_GetSize(*args, **kwargs)
4946
4947 def GetRect(*args, **kwargs):
4948 """GetRect(self) -> Rect"""
4949 return _core_.SizeEvent_GetRect(*args, **kwargs)
4950
4951 def SetRect(*args, **kwargs):
4952 """SetRect(self, Rect rect)"""
4953 return _core_.SizeEvent_SetRect(*args, **kwargs)
4954
4955 def SetSize(*args, **kwargs):
4956 """SetSize(self, Size size)"""
4957 return _core_.SizeEvent_SetSize(*args, **kwargs)
4958
4959 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4960 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4961 _core_.SizeEvent_swigregister(SizeEvent)
4962
4963 #---------------------------------------------------------------------------
4964
4965 class MoveEvent(Event):
4966 """
4967 This event object is sent for EVT_MOVE event bindings when a window is
4968 moved to a new position.
4969 """
4970 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4971 __repr__ = _swig_repr
4972 def __init__(self, *args, **kwargs):
4973 """
4974 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4975
4976 Constructor.
4977 """
4978 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
4979 def GetPosition(*args, **kwargs):
4980 """
4981 GetPosition(self) -> Point
4982
4983 Returns the position of the window generating the move change event.
4984 """
4985 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4986
4987 def GetRect(*args, **kwargs):
4988 """GetRect(self) -> Rect"""
4989 return _core_.MoveEvent_GetRect(*args, **kwargs)
4990
4991 def SetRect(*args, **kwargs):
4992 """SetRect(self, Rect rect)"""
4993 return _core_.MoveEvent_SetRect(*args, **kwargs)
4994
4995 def SetPosition(*args, **kwargs):
4996 """SetPosition(self, Point pos)"""
4997 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4998
4999 m_pos = property(GetPosition, SetPosition)
5000 m_rect = property(GetRect, SetRect)
5001
5002 _core_.MoveEvent_swigregister(MoveEvent)
5003
5004 #---------------------------------------------------------------------------
5005
5006 class PaintEvent(Event):
5007 """
5008 A paint event is sent when a window's contents needs to be repainted.
5009 Note that in an EVT_PAINT handler the application must *always* create
5010 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5011 Windows assumes that the window has not been painted yet and will send
5012 the event again, causing endless refreshes.
5013
5014 You can optimize painting by retrieving the rectangles that have been
5015 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5016 and only repainting these rectangles. The rectangles are in terms of
5017 the client area, and are unscrolled, so you will need to do some
5018 calculations using the current view position to obtain logical,
5019 scrolled units.
5020
5021 """
5022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5023 __repr__ = _swig_repr
5024 def __init__(self, *args, **kwargs):
5025 """__init__(self, int Id=0) -> PaintEvent"""
5026 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5027 _core_.PaintEvent_swigregister(PaintEvent)
5028
5029 class NcPaintEvent(Event):
5030 """Proxy of C++ NcPaintEvent class"""
5031 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5032 __repr__ = _swig_repr
5033 def __init__(self, *args, **kwargs):
5034 """__init__(self, int winid=0) -> NcPaintEvent"""
5035 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5036 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5037
5038 #---------------------------------------------------------------------------
5039
5040 class EraseEvent(Event):
5041 """
5042 An erase event is sent whenever the background of a window needs to be
5043 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5044 binder. On some platforms, such as GTK+, this event is simulated
5045 (simply generated just before the paint event) and may cause flicker.
5046
5047 To paint a custom background use the `GetDC` method and use the returned
5048 device context if it is not ``None``, otherwise create a temporary
5049 `wx.ClientDC` and draw on that.
5050
5051 """
5052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5053 __repr__ = _swig_repr
5054 def __init__(self, *args, **kwargs):
5055 """
5056 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5057
5058 Constructor
5059 """
5060 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5061 def GetDC(*args, **kwargs):
5062 """
5063 GetDC(self) -> DC
5064
5065 Returns the device context the event handler should draw upon. If
5066 ``None`` is returned then create a temporary `wx.ClientDC` and use
5067 that instead.
5068 """
5069 return _core_.EraseEvent_GetDC(*args, **kwargs)
5070
5071 _core_.EraseEvent_swigregister(EraseEvent)
5072
5073 #---------------------------------------------------------------------------
5074
5075 class FocusEvent(Event):
5076 """
5077 A focus event is sent when a window's focus changes. The window losing
5078 focus receives an EVT_KILL_FOCUS event while the window gaining it
5079 gets an EVT_SET_FOCUS event.
5080
5081 Notice that the set focus event happens both when the user gives focus
5082 to the window (whether using the mouse or keyboard) and when it is
5083 done from the program itself using `wx.Window.SetFocus`.
5084
5085 """
5086 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5087 __repr__ = _swig_repr
5088 def __init__(self, *args, **kwargs):
5089 """
5090 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5091
5092 Constructor
5093 """
5094 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5095 def GetWindow(*args, **kwargs):
5096 """
5097 GetWindow(self) -> Window
5098
5099 Returns the other window associated with this event, that is the
5100 window which had the focus before for the EVT_SET_FOCUS event and the
5101 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5102
5103 Warning: the window returned may be None!
5104 """
5105 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5106
5107 def SetWindow(*args, **kwargs):
5108 """SetWindow(self, Window win)"""
5109 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5110
5111 _core_.FocusEvent_swigregister(FocusEvent)
5112
5113 #---------------------------------------------------------------------------
5114
5115 class ChildFocusEvent(CommandEvent):
5116 """
5117 wx.ChildFocusEvent notifies the parent that a child has received the
5118 focus. Unlike `wx.FocusEvent` it is propagated up the window
5119 heirarchy.
5120 """
5121 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5122 __repr__ = _swig_repr
5123 def __init__(self, *args, **kwargs):
5124 """
5125 __init__(self, Window win=None) -> ChildFocusEvent
5126
5127 Constructor
5128 """
5129 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5130 def GetWindow(*args, **kwargs):
5131 """
5132 GetWindow(self) -> Window
5133
5134 The window which has just received the focus.
5135 """
5136 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5137
5138 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5139
5140 #---------------------------------------------------------------------------
5141
5142 class ActivateEvent(Event):
5143 """
5144 An activate event is sent when a top-level window or the entire
5145 application is being activated or deactivated.
5146
5147 A top-level window (a dialog or frame) receives an activate event when
5148 is being activated or deactivated. This is indicated visually by the
5149 title bar changing colour, and a subwindow gaining the keyboard focus.
5150 An application is activated or deactivated when one of its frames
5151 becomes activated, or a frame becomes inactivate resulting in all
5152 application frames being inactive.
5153
5154 Please note that usually you should call event.Skip() in your handlers
5155 for these events so the default handlers will still be called, as not
5156 doing so can result in strange effects.
5157
5158 """
5159 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5160 __repr__ = _swig_repr
5161 def __init__(self, *args, **kwargs):
5162 """
5163 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5164
5165 Constructor
5166 """
5167 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5168 def GetActive(*args, **kwargs):
5169 """
5170 GetActive(self) -> bool
5171
5172 Returns true if the application or window is being activated, false
5173 otherwise.
5174 """
5175 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5176
5177 _core_.ActivateEvent_swigregister(ActivateEvent)
5178
5179 #---------------------------------------------------------------------------
5180
5181 class InitDialogEvent(Event):
5182 """
5183 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5184 any window when `wx.Window.InitDialog` is called. Handlers for this
5185 event can transfer data to the window, or anything else that should be
5186 done before the user begins editing the form. The default handler
5187 calls `wx.Window.TransferDataToWindow`.
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, int Id=0) -> InitDialogEvent
5194
5195 Constructor
5196 """
5197 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5198 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5199
5200 #---------------------------------------------------------------------------
5201
5202 class MenuEvent(Event):
5203 """
5204 This class is used for a variety of menu-related events. Note that
5205 these do not include menu command events, which are handled by sending
5206 `wx.CommandEvent` objects.
5207
5208 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5209 text in the first field of the status bar.
5210 """
5211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5212 __repr__ = _swig_repr
5213 def __init__(self, *args, **kwargs):
5214 """
5215 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5216
5217 Constructor
5218 """
5219 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5220 def GetMenuId(*args, **kwargs):
5221 """
5222 GetMenuId(self) -> int
5223
5224 Returns the menu identifier associated with the event. This method
5225 should be only used with the HIGHLIGHT events.
5226 """
5227 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5228
5229 def IsPopup(*args, **kwargs):
5230 """
5231 IsPopup(self) -> bool
5232
5233 Returns ``True`` if the menu which is being opened or closed is a
5234 popup menu, ``False`` if it is a normal one. This method should only
5235 be used with the OPEN and CLOSE events.
5236 """
5237 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5238
5239 def GetMenu(*args, **kwargs):
5240 """
5241 GetMenu(self) -> Menu
5242
5243 Returns the menu which is being opened or closed. This method should
5244 only be used with the OPEN and CLOSE events.
5245 """
5246 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5247
5248 _core_.MenuEvent_swigregister(MenuEvent)
5249
5250 #---------------------------------------------------------------------------
5251
5252 class CloseEvent(Event):
5253 """
5254 This event class contains information about window and session close
5255 events.
5256
5257 The handler function for EVT_CLOSE is called when the user has tried
5258 to close a a frame or dialog box using the window manager controls or
5259 the system menu. It can also be invoked by the application itself
5260 programmatically, for example by calling the `wx.Window.Close`
5261 function.
5262
5263 You should check whether the application is forcing the deletion of
5264 the window using `CanVeto`. If it returns ``False``, you must destroy
5265 the window using `wx.Window.Destroy`. If the return value is ``True``,
5266 it is up to you whether you respond by destroying the window or not.
5267 For example you may wish to display a message dialog prompting to save
5268 files or to cancel the close.
5269
5270 If you don't destroy the window, you should call `Veto` to let the
5271 calling code know that you did not destroy the window. This allows the
5272 `wx.Window.Close` function to return ``True`` or ``False`` depending
5273 on whether the close instruction was honored or not.
5274 """
5275 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5276 __repr__ = _swig_repr
5277 def __init__(self, *args, **kwargs):
5278 """
5279 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5280
5281 Constructor.
5282 """
5283 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5284 def SetLoggingOff(*args, **kwargs):
5285 """
5286 SetLoggingOff(self, bool logOff)
5287
5288 Sets the 'logging off' flag.
5289 """
5290 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5291
5292 def GetLoggingOff(*args, **kwargs):
5293 """
5294 GetLoggingOff(self) -> bool
5295
5296 Returns ``True`` if the user is logging off or ``False`` if the
5297 system is shutting down. This method can only be called for end
5298 session and query end session events, it doesn't make sense for close
5299 window event.
5300 """
5301 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5302
5303 def Veto(*args, **kwargs):
5304 """
5305 Veto(self, bool veto=True)
5306
5307 Call this from your event handler to veto a system shutdown or to
5308 signal to the calling application that a window close did not happen.
5309
5310 You can only veto a shutdown or close if `CanVeto` returns true.
5311 """
5312 return _core_.CloseEvent_Veto(*args, **kwargs)
5313
5314 def GetVeto(*args, **kwargs):
5315 """GetVeto(self) -> bool"""
5316 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5317
5318 def SetCanVeto(*args, **kwargs):
5319 """
5320 SetCanVeto(self, bool canVeto)
5321
5322 Sets the 'can veto' flag.
5323 """
5324 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5325
5326 def CanVeto(*args, **kwargs):
5327 """
5328 CanVeto(self) -> bool
5329
5330 Returns true if you can veto a system shutdown or a window close
5331 event. Vetoing a window close event is not possible if the calling
5332 code wishes to force the application to exit, and so this function
5333 must be called to check this.
5334 """
5335 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5336
5337 _core_.CloseEvent_swigregister(CloseEvent)
5338
5339 #---------------------------------------------------------------------------
5340
5341 class ShowEvent(Event):
5342 """An EVT_SHOW event is sent when a window is shown or hidden."""
5343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5344 __repr__ = _swig_repr
5345 def __init__(self, *args, **kwargs):
5346 """
5347 __init__(self, int winid=0, bool show=False) -> ShowEvent
5348
5349 An EVT_SHOW event is sent when a window is shown or hidden.
5350 """
5351 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5352 def SetShow(*args, **kwargs):
5353 """SetShow(self, bool show)"""
5354 return _core_.ShowEvent_SetShow(*args, **kwargs)
5355
5356 def GetShow(*args, **kwargs):
5357 """GetShow(self) -> bool"""
5358 return _core_.ShowEvent_GetShow(*args, **kwargs)
5359
5360 _core_.ShowEvent_swigregister(ShowEvent)
5361
5362 #---------------------------------------------------------------------------
5363
5364 class IconizeEvent(Event):
5365 """
5366 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5367 restored.
5368 """
5369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5370 __repr__ = _swig_repr
5371 def __init__(self, *args, **kwargs):
5372 """
5373 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5374
5375 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5376 restored.
5377 """
5378 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5379 def Iconized(*args, **kwargs):
5380 """
5381 Iconized(self) -> bool
5382
5383 Returns ``True`` if the frame has been iconized, ``False`` if it has
5384 been restored.
5385 """
5386 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5387
5388 _core_.IconizeEvent_swigregister(IconizeEvent)
5389
5390 #---------------------------------------------------------------------------
5391
5392 class MaximizeEvent(Event):
5393 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5394 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5395 __repr__ = _swig_repr
5396 def __init__(self, *args, **kwargs):
5397 """
5398 __init__(self, int id=0) -> MaximizeEvent
5399
5400 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5401 """
5402 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5403 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5404
5405 #---------------------------------------------------------------------------
5406
5407 class DropFilesEvent(Event):
5408 """
5409 This class is used for drop files events, that is, when files have
5410 been dropped onto the window. This functionality is only available
5411 under Windows. The window must have previously been enabled for
5412 dropping by calling `wx.Window.DragAcceptFiles`.
5413
5414 Important note: this is a separate implementation to the more general
5415 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5416 implementation uses the older, Windows message-based approach of
5417 dropping files.
5418
5419 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5420 events.
5421
5422 """
5423 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5424 def __init__(self): raise AttributeError, "No constructor defined"
5425 __repr__ = _swig_repr
5426 def GetPosition(*args, **kwargs):
5427 """
5428 GetPosition(self) -> Point
5429
5430 Returns the position at which the files were dropped.
5431 """
5432 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5433
5434 def GetNumberOfFiles(*args, **kwargs):
5435 """
5436 GetNumberOfFiles(self) -> int
5437
5438 Returns the number of files dropped.
5439 """
5440 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5441
5442 def GetFiles(*args, **kwargs):
5443 """
5444 GetFiles(self) -> PyObject
5445
5446 Returns a list of the filenames that were dropped.
5447 """
5448 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5449
5450 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5451
5452 #---------------------------------------------------------------------------
5453
5454 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5455 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5456 class UpdateUIEvent(CommandEvent):
5457 """
5458 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5459 wxWidgets to give an application the chance to update various user
5460 interface elements.
5461
5462 Without update UI events, an application has to work hard to
5463 check/uncheck, enable/disable, and set the text for elements such as
5464 menu items and toolbar buttons. The code for doing this has to be
5465 mixed up with the code that is invoked when an action is invoked for a
5466 menu item or button.
5467
5468 With update UI events, you define an event handler to look at the
5469 state of the application and change UI elements accordingly. wxWidgets
5470 will call your handler functions in idle time, so you don't have to
5471 worry where to call this code. In addition to being a clearer and more
5472 declarative method, it also means you don't have to worry whether
5473 you're updating a toolbar or menubar identifier. The same handler can
5474 update a menu item and toolbar button, if the ID values are the same.
5475
5476 Instead of directly manipulating the menu or button, you call
5477 functions in the event object, such as `Check`. wxWidgets will
5478 determine whether such a call has been made, and which UI element to
5479 update.
5480
5481 These events will work for popup menus as well as menubars. Just
5482 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5483 any UI events for the window that owns the menu.
5484
5485 If you find that the overhead of UI update processing is affecting
5486 your application, you can do one or both of the following:
5487
5488 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5489 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5490 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5491 receive update events. No other windows will receive update
5492 events.
5493
5494 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5495 value to set the delay between updates. You may need to call
5496 `wx.Window.UpdateWindowUI` at critical points, for example when
5497 a dialog is about to be shown, in case the user sees a slight
5498 delay before windows are updated.
5499
5500 Note that although events are sent in idle time, defining a EVT_IDLE
5501 handler for a window does not affect this because the events are sent
5502 from an internal idle handler.
5503
5504 wxWidgets tries to optimize update events on some platforms. On
5505 Windows and GTK+, events for menubar items are only sent when the menu
5506 is about to be shown, and not in idle time.
5507
5508 """
5509 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5510 __repr__ = _swig_repr
5511 def __init__(self, *args, **kwargs):
5512 """
5513 __init__(self, int commandId=0) -> UpdateUIEvent
5514
5515 Constructor
5516 """
5517 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5518 def GetChecked(*args, **kwargs):
5519 """
5520 GetChecked(self) -> bool
5521
5522 Returns ``True`` if the UI element should be checked.
5523 """
5524 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5525
5526 def GetEnabled(*args, **kwargs):
5527 """
5528 GetEnabled(self) -> bool
5529
5530 Returns ``True`` if the UI element should be enabled.
5531 """
5532 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5533
5534 def GetShown(*args, **kwargs):
5535 """
5536 GetShown(self) -> bool
5537
5538 Returns ``True`` if the UI element should be shown.
5539 """
5540 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5541
5542 def GetText(*args, **kwargs):
5543 """
5544 GetText(self) -> String
5545
5546 Returns the text that should be set for the UI element.
5547 """
5548 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5549
5550 def GetSetText(*args, **kwargs):
5551 """
5552 GetSetText(self) -> bool
5553
5554 Returns ``True`` if the application has called `SetText`. For
5555 wxWidgets internal use only.
5556 """
5557 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5558
5559 def GetSetChecked(*args, **kwargs):
5560 """
5561 GetSetChecked(self) -> bool
5562
5563 Returns ``True`` if the application has called `Check`. For wxWidgets
5564 internal use only.
5565 """
5566 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5567
5568 def GetSetEnabled(*args, **kwargs):
5569 """
5570 GetSetEnabled(self) -> bool
5571
5572 Returns ``True`` if the application has called `Enable`. For wxWidgets
5573 internal use only.
5574 """
5575 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5576
5577 def GetSetShown(*args, **kwargs):
5578 """
5579 GetSetShown(self) -> bool
5580
5581 Returns ``True`` if the application has called `Show`. For wxWidgets
5582 internal use only.
5583 """
5584 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5585
5586 def Check(*args, **kwargs):
5587 """
5588 Check(self, bool check)
5589
5590 Check or uncheck the UI element.
5591 """
5592 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5593
5594 def Enable(*args, **kwargs):
5595 """
5596 Enable(self, bool enable)
5597
5598 Enable or disable the UI element.
5599 """
5600 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5601
5602 def Show(*args, **kwargs):
5603 """
5604 Show(self, bool show)
5605
5606 Show or hide the UI element.
5607 """
5608 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5609
5610 def SetText(*args, **kwargs):
5611 """
5612 SetText(self, String text)
5613
5614 Sets the text for this UI element.
5615 """
5616 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5617
5618 def SetUpdateInterval(*args, **kwargs):
5619 """
5620 SetUpdateInterval(long updateInterval)
5621
5622 Sets the interval between updates in milliseconds. Set to -1 to
5623 disable updates, or to 0 to update as frequently as possible. The
5624 default is 0.
5625
5626 Use this to reduce the overhead of UI update events if your
5627 application has a lot of windows. If you set the value to -1 or
5628 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5629 at appropriate points in your application, such as when a dialog is
5630 about to be shown.
5631 """
5632 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5633
5634 SetUpdateInterval = staticmethod(SetUpdateInterval)
5635 def GetUpdateInterval(*args, **kwargs):
5636 """
5637 GetUpdateInterval() -> long
5638
5639 Returns the current interval between updates in milliseconds. -1
5640 disables updates, 0 updates as frequently as possible.
5641 """
5642 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5643
5644 GetUpdateInterval = staticmethod(GetUpdateInterval)
5645 def CanUpdate(*args, **kwargs):
5646 """
5647 CanUpdate(Window win) -> bool
5648
5649 Returns ``True`` if it is appropriate to update (send UI update events
5650 to) this window.
5651
5652 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5653 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5654 events were last sent in idle time, and the update interval, to
5655 determine whether events should be sent to this window now. By default
5656 this will always return true because the update mode is initially
5657 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5658 events will be sent as often as possible. You can reduce the frequency
5659 that events are sent by changing the mode and/or setting an update
5660 interval.
5661
5662 """
5663 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5664
5665 CanUpdate = staticmethod(CanUpdate)
5666 def ResetUpdateTime(*args, **kwargs):
5667 """
5668 ResetUpdateTime()
5669
5670 Used internally to reset the last-updated time to the current time. It
5671 is assumed that update events are normally sent in idle time, so this
5672 is called at the end of idle processing.
5673 """
5674 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5675
5676 ResetUpdateTime = staticmethod(ResetUpdateTime)
5677 def SetMode(*args, **kwargs):
5678 """
5679 SetMode(int mode)
5680
5681 Specify how wxWidgets will send update events: to all windows, or only
5682 to those which specify that they will process the events.
5683
5684 The mode may be one of the following values:
5685
5686 ============================= ==========================================
5687 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5688 is the default setting.
5689 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5690 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5691 style set.
5692 ============================= ==========================================
5693
5694 """
5695 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5696
5697 SetMode = staticmethod(SetMode)
5698 def GetMode(*args, **kwargs):
5699 """
5700 GetMode() -> int
5701
5702 Returns a value specifying how wxWidgets will send update events: to
5703 all windows, or only to those which specify that they will process the
5704 events.
5705 """
5706 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5707
5708 GetMode = staticmethod(GetMode)
5709 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5710
5711 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5712 """
5713 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5714
5715 Sets the interval between updates in milliseconds. Set to -1 to
5716 disable updates, or to 0 to update as frequently as possible. The
5717 default is 0.
5718
5719 Use this to reduce the overhead of UI update events if your
5720 application has a lot of windows. If you set the value to -1 or
5721 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5722 at appropriate points in your application, such as when a dialog is
5723 about to be shown.
5724 """
5725 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5726
5727 def UpdateUIEvent_GetUpdateInterval(*args):
5728 """
5729 UpdateUIEvent_GetUpdateInterval() -> long
5730
5731 Returns the current interval between updates in milliseconds. -1
5732 disables updates, 0 updates as frequently as possible.
5733 """
5734 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5735
5736 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5737 """
5738 UpdateUIEvent_CanUpdate(Window win) -> bool
5739
5740 Returns ``True`` if it is appropriate to update (send UI update events
5741 to) this window.
5742
5743 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5744 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5745 events were last sent in idle time, and the update interval, to
5746 determine whether events should be sent to this window now. By default
5747 this will always return true because the update mode is initially
5748 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5749 events will be sent as often as possible. You can reduce the frequency
5750 that events are sent by changing the mode and/or setting an update
5751 interval.
5752
5753 """
5754 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5755
5756 def UpdateUIEvent_ResetUpdateTime(*args):
5757 """
5758 UpdateUIEvent_ResetUpdateTime()
5759
5760 Used internally to reset the last-updated time to the current time. It
5761 is assumed that update events are normally sent in idle time, so this
5762 is called at the end of idle processing.
5763 """
5764 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5765
5766 def UpdateUIEvent_SetMode(*args, **kwargs):
5767 """
5768 UpdateUIEvent_SetMode(int mode)
5769
5770 Specify how wxWidgets will send update events: to all windows, or only
5771 to those which specify that they will process the events.
5772
5773 The mode may be one of the following values:
5774
5775 ============================= ==========================================
5776 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5777 is the default setting.
5778 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5779 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5780 style set.
5781 ============================= ==========================================
5782
5783 """
5784 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5785
5786 def UpdateUIEvent_GetMode(*args):
5787 """
5788 UpdateUIEvent_GetMode() -> int
5789
5790 Returns a value specifying how wxWidgets will send update events: to
5791 all windows, or only to those which specify that they will process the
5792 events.
5793 """
5794 return _core_.UpdateUIEvent_GetMode(*args)
5795
5796 #---------------------------------------------------------------------------
5797
5798 class SysColourChangedEvent(Event):
5799 """
5800 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5801 when the user changes the colour settings using the control
5802 panel. This is only applicable under Windows.
5803
5804 The default event handler for this event propagates the event to child
5805 windows, since Windows only sends the events to top-level windows. If
5806 intercepting this event for a top-level window, remember to call
5807 `Skip` so the the base class handler will still be executed, or to
5808 pass the event on to the window's children explicitly.
5809
5810 """
5811 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5812 __repr__ = _swig_repr
5813 def __init__(self, *args, **kwargs):
5814 """
5815 __init__(self) -> SysColourChangedEvent
5816
5817 Constructor
5818 """
5819 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5820 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5821
5822 #---------------------------------------------------------------------------
5823
5824 class MouseCaptureChangedEvent(Event):
5825 """
5826 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5827 a window that loses its mouse capture. This is called even if
5828 `wx.Window.ReleaseMouse` was called by the application code. Handling
5829 this event allows an application to cater for unexpected capture
5830 releases which might otherwise confuse mouse handling code.
5831
5832 This event is implemented under Windows only.
5833 """
5834 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5835 __repr__ = _swig_repr
5836 def __init__(self, *args, **kwargs):
5837 """
5838 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5839
5840 Constructor
5841 """
5842 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5843 def GetCapturedWindow(*args, **kwargs):
5844 """
5845 GetCapturedWindow(self) -> Window
5846
5847 Returns the window that gained the capture, or ``None`` if it was a
5848 non-wxWidgets window.
5849 """
5850 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5851
5852 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5853
5854 #---------------------------------------------------------------------------
5855
5856 class DisplayChangedEvent(Event):
5857 """
5858 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5859 resolution has changed.
5860
5861 This event is implemented under Windows only.
5862 """
5863 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5864 __repr__ = _swig_repr
5865 def __init__(self, *args, **kwargs):
5866 """__init__(self) -> DisplayChangedEvent"""
5867 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5868 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
5869
5870 #---------------------------------------------------------------------------
5871
5872 class PaletteChangedEvent(Event):
5873 """
5874 An EVT_PALETTE_CHANGED event is sent when the system palette has
5875 changed, thereby giving each window a chance to redo their own to
5876 match.
5877
5878 This event is implemented under Windows only.
5879 """
5880 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5881 __repr__ = _swig_repr
5882 def __init__(self, *args, **kwargs):
5883 """
5884 __init__(self, int id=0) -> PaletteChangedEvent
5885
5886 An EVT_PALETTE_CHANGED event is sent when the system palette has
5887 changed, thereby giving each window a chance to redo their own to
5888 match.
5889
5890 This event is implemented under Windows only.
5891 """
5892 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5893 def SetChangedWindow(*args, **kwargs):
5894 """SetChangedWindow(self, Window win)"""
5895 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5896
5897 def GetChangedWindow(*args, **kwargs):
5898 """GetChangedWindow(self) -> Window"""
5899 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5900
5901 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
5902
5903 #---------------------------------------------------------------------------
5904
5905 class QueryNewPaletteEvent(Event):
5906 """
5907 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5908 focus and should re-do its palette.
5909
5910 This event is implemented under Windows only.
5911 """
5912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5913 __repr__ = _swig_repr
5914 def __init__(self, *args, **kwargs):
5915 """
5916 __init__(self, int winid=0) -> QueryNewPaletteEvent
5917
5918 Constructor.
5919 """
5920 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
5921 def SetPaletteRealized(*args, **kwargs):
5922 """
5923 SetPaletteRealized(self, bool realized)
5924
5925 App should set this if it changes the palette.
5926 """
5927 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5928
5929 def GetPaletteRealized(*args, **kwargs):
5930 """GetPaletteRealized(self) -> bool"""
5931 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5932
5933 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
5934
5935 #---------------------------------------------------------------------------
5936
5937 class NavigationKeyEvent(Event):
5938 """
5939 EVT_NAVIGATION_KEY events are used to control moving the focus between
5940 widgets, otherwise known as tab-traversal. You woudl normally not
5941 catch navigation events in applications as there are already
5942 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5943 it useful to send navigation events in certain situations to change
5944 the focus in certain ways, although it's probably easier to just call
5945 `wx.Window.Navigate`.
5946 """
5947 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5948 __repr__ = _swig_repr
5949 def __init__(self, *args, **kwargs):
5950 """__init__(self) -> NavigationKeyEvent"""
5951 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
5952 def GetDirection(*args, **kwargs):
5953 """
5954 GetDirection(self) -> bool
5955
5956 Returns ``True`` if the direction is forward, ``False`` otherwise.
5957 """
5958 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5959
5960 def SetDirection(*args, **kwargs):
5961 """
5962 SetDirection(self, bool forward)
5963
5964 Specify the direction that the navigation should take. Usually the
5965 difference between using Tab and Shift-Tab.
5966 """
5967 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5968
5969 def IsWindowChange(*args, **kwargs):
5970 """
5971 IsWindowChange(self) -> bool
5972
5973 Returns ``True`` if window change is allowed.
5974 """
5975 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5976
5977 def SetWindowChange(*args, **kwargs):
5978 """
5979 SetWindowChange(self, bool ischange)
5980
5981 Specify if the navigation should be able to change parent windows.
5982 For example, changing notebook pages, etc. This is usually implemented
5983 by using Control-Tab.
5984 """
5985 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5986
5987 def IsFromTab(*args, **kwargs):
5988 """
5989 IsFromTab(self) -> bool
5990
5991 Returns ``True`` if the navigation event is originated from the Tab
5992 key.
5993 """
5994 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5995
5996 def SetFromTab(*args, **kwargs):
5997 """
5998 SetFromTab(self, bool bIs)
5999
6000 Set to true under MSW if the event was generated using the tab key.
6001 This is required for proper navogation over radio buttons.
6002 """
6003 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6004
6005 def SetFlags(*args, **kwargs):
6006 """
6007 SetFlags(self, long flags)
6008
6009 Set the navigation flags to a combination of the following:
6010
6011 * wx.NavigationKeyEvent.IsBackward
6012 * wx.NavigationKeyEvent.IsForward
6013 * wx.NavigationKeyEvent.WinChange
6014 * wx.NavigationKeyEvent.FromTab
6015
6016 """
6017 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6018
6019 def GetCurrentFocus(*args, **kwargs):
6020 """
6021 GetCurrentFocus(self) -> Window
6022
6023 Returns the child window which currenty has the focus. May be
6024 ``None``.
6025 """
6026 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6027
6028 def SetCurrentFocus(*args, **kwargs):
6029 """
6030 SetCurrentFocus(self, Window win)
6031
6032 Set the window that has the focus.
6033 """
6034 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6035
6036 IsBackward = _core_.NavigationKeyEvent_IsBackward
6037 IsForward = _core_.NavigationKeyEvent_IsForward
6038 WinChange = _core_.NavigationKeyEvent_WinChange
6039 FromTab = _core_.NavigationKeyEvent_FromTab
6040 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6041
6042 #---------------------------------------------------------------------------
6043
6044 class WindowCreateEvent(CommandEvent):
6045 """
6046 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6047 underlying GUI object) exists.
6048 """
6049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6050 __repr__ = _swig_repr
6051 def __init__(self, *args, **kwargs):
6052 """
6053 __init__(self, Window win=None) -> WindowCreateEvent
6054
6055 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6056 underlying GUI object) exists.
6057 """
6058 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6059 def GetWindow(*args, **kwargs):
6060 """
6061 GetWindow(self) -> Window
6062
6063 Returns the window that this event refers to.
6064 """
6065 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6066
6067 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6068
6069 class WindowDestroyEvent(CommandEvent):
6070 """
6071 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6072 when the GUI window is destroyed.
6073
6074 When a class derived from `wx.Window` is destroyed its destructor will
6075 have already run by the time this event is sent. Therefore this event
6076 will not usually be received at all by the window itself. Since it is
6077 received after the destructor has run, an object should not try to
6078 handle its own wx.WindowDestroyEvent, but it can be used to get
6079 notification of the destruction of another window.
6080 """
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
6084 """
6085 __init__(self, Window win=None) -> WindowDestroyEvent
6086
6087 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6088 when the GUI window is destroyed.
6089
6090 When a class derived from `wx.Window` is destroyed its destructor will
6091 have already run by the time this event is sent. Therefore this event
6092 will not usually be received at all by the window itself. Since it is
6093 received after the destructor has run, an object should not try to
6094 handle its own wx.WindowDestroyEvent, but it can be used to get
6095 notification of the destruction of another window.
6096 """
6097 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6098 def GetWindow(*args, **kwargs):
6099 """
6100 GetWindow(self) -> Window
6101
6102 Returns the window that this event refers to.
6103 """
6104 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6105
6106 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6107
6108 #---------------------------------------------------------------------------
6109
6110 class ContextMenuEvent(CommandEvent):
6111 """
6112 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6113 give the application a chance to show a context (popup) menu.
6114 """
6115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6116 __repr__ = _swig_repr
6117 def __init__(self, *args, **kwargs):
6118 """
6119 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6120
6121 Constructor.
6122 """
6123 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6124 def GetPosition(*args, **kwargs):
6125 """
6126 GetPosition(self) -> Point
6127
6128 Returns the position (in screen coordinants) at which the menu should
6129 be shown.
6130 """
6131 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6132
6133 def SetPosition(*args, **kwargs):
6134 """
6135 SetPosition(self, Point pos)
6136
6137 Sets the position at which the menu should be shown.
6138 """
6139 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6140
6141 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6142
6143 #---------------------------------------------------------------------------
6144
6145 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6146 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6147 class IdleEvent(Event):
6148 """
6149 This class is used for EVT_IDLE events, which are generated and sent
6150 when the application *becomes* idle. In other words, the when the
6151 event queue becomes empty then idle events are sent to all windows (by
6152 default) and as long as none of them call `RequestMore` then there are
6153 no more idle events until after the system event queue has some normal
6154 events and then becomes empty again.
6155
6156 By default, idle events are sent to all windows. If this is causing a
6157 significant overhead in your application, you can call
6158 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6159 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6160 which should receive idle events. Then idle events will only be sent
6161 to those windows and not to any others.
6162 """
6163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6164 __repr__ = _swig_repr
6165 def __init__(self, *args, **kwargs):
6166 """
6167 __init__(self) -> IdleEvent
6168
6169 Constructor
6170 """
6171 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6172 def RequestMore(*args, **kwargs):
6173 """
6174 RequestMore(self, bool needMore=True)
6175
6176 Tells wxWidgets that more processing is required. This function can be
6177 called by an EVT_IDLE handler for a window to indicate that the
6178 application should forward the EVT_IDLE event once more to the
6179 application windows. If no window calls this function during its
6180 EVT_IDLE handler, then the application will remain in a passive event
6181 loop until a new event is posted to the application by the windowing
6182 system.
6183 """
6184 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6185
6186 def MoreRequested(*args, **kwargs):
6187 """
6188 MoreRequested(self) -> bool
6189
6190 Returns ``True`` if the OnIdle function processing this event
6191 requested more processing time.
6192 """
6193 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6194
6195 def SetMode(*args, **kwargs):
6196 """
6197 SetMode(int mode)
6198
6199 Static method for specifying how wxWidgets will send idle events: to
6200 all windows, or only to those which specify that they will process the
6201 events.
6202
6203 The mode can be one of the following values:
6204
6205 ========================= ========================================
6206 wx.IDLE_PROCESS_ALL Send idle events to all windows
6207 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6208 the wx.WS_EX_PROCESS_IDLE extra style
6209 flag set.
6210 ========================= ========================================
6211
6212 """
6213 return _core_.IdleEvent_SetMode(*args, **kwargs)
6214
6215 SetMode = staticmethod(SetMode)
6216 def GetMode(*args, **kwargs):
6217 """
6218 GetMode() -> int
6219
6220 Static method returning a value specifying how wxWidgets will send
6221 idle events: to all windows, or only to those which specify that they
6222 will process the events.
6223 """
6224 return _core_.IdleEvent_GetMode(*args, **kwargs)
6225
6226 GetMode = staticmethod(GetMode)
6227 def CanSend(*args, **kwargs):
6228 """
6229 CanSend(Window win) -> bool
6230
6231 Returns ``True`` if it is appropriate to send idle events to this
6232 window.
6233
6234 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6235 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6236 events should be sent to this window now. By default this will always
6237 return ``True`` because the update mode is initially
6238 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6239 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6240 """
6241 return _core_.IdleEvent_CanSend(*args, **kwargs)
6242
6243 CanSend = staticmethod(CanSend)
6244 _core_.IdleEvent_swigregister(IdleEvent)
6245
6246 def IdleEvent_SetMode(*args, **kwargs):
6247 """
6248 IdleEvent_SetMode(int mode)
6249
6250 Static method for specifying how wxWidgets will send idle events: to
6251 all windows, or only to those which specify that they will process the
6252 events.
6253
6254 The mode can be one of the following values:
6255
6256 ========================= ========================================
6257 wx.IDLE_PROCESS_ALL Send idle events to all windows
6258 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6259 the wx.WS_EX_PROCESS_IDLE extra style
6260 flag set.
6261 ========================= ========================================
6262
6263 """
6264 return _core_.IdleEvent_SetMode(*args, **kwargs)
6265
6266 def IdleEvent_GetMode(*args):
6267 """
6268 IdleEvent_GetMode() -> int
6269
6270 Static method returning a value specifying how wxWidgets will send
6271 idle events: to all windows, or only to those which specify that they
6272 will process the events.
6273 """
6274 return _core_.IdleEvent_GetMode(*args)
6275
6276 def IdleEvent_CanSend(*args, **kwargs):
6277 """
6278 IdleEvent_CanSend(Window win) -> bool
6279
6280 Returns ``True`` if it is appropriate to send idle events to this
6281 window.
6282
6283 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6284 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6285 events should be sent to this window now. By default this will always
6286 return ``True`` because the update mode is initially
6287 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6288 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6289 """
6290 return _core_.IdleEvent_CanSend(*args, **kwargs)
6291
6292 #---------------------------------------------------------------------------
6293
6294 class ClipboardTextEvent(CommandEvent):
6295 """
6296 A Clipboard Text event is sent when a window intercepts a text
6297 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6298 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6299 popup menu command, etc. NOTE : under windows these events are *NOT*
6300 generated automatically for a Rich Edit text control.
6301 """
6302 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6303 __repr__ = _swig_repr
6304 def __init__(self, *args, **kwargs):
6305 """
6306 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6307
6308 A Clipboard Text event is sent when a window intercepts a text
6309 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6310 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6311 popup menu command, etc. NOTE : under windows these events are *NOT*
6312 generated automatically for a Rich Edit text control.
6313 """
6314 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6315 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6316
6317 #---------------------------------------------------------------------------
6318
6319 class PyEvent(Event):
6320 """
6321 wx.PyEvent can be used as a base class for implementing custom event
6322 types in Python. You should derived from this class instead of
6323 `wx.Event` because this class is Python-aware and is able to transport
6324 its Python bits safely through the wxWidgets event system and have
6325 them still be there when the event handler is invoked.
6326
6327 :see: `wx.PyCommandEvent`
6328
6329 """
6330 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6331 __repr__ = _swig_repr
6332 def __init__(self, *args, **kwargs):
6333 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6334 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6335 self._SetSelf(self)
6336
6337 __swig_destroy__ = _core_.delete_PyEvent
6338 __del__ = lambda self : None;
6339 def _SetSelf(*args, **kwargs):
6340 """_SetSelf(self, PyObject self)"""
6341 return _core_.PyEvent__SetSelf(*args, **kwargs)
6342
6343 def _GetSelf(*args, **kwargs):
6344 """_GetSelf(self) -> PyObject"""
6345 return _core_.PyEvent__GetSelf(*args, **kwargs)
6346
6347 _core_.PyEvent_swigregister(PyEvent)
6348
6349 class PyCommandEvent(CommandEvent):
6350 """
6351 wx.PyCommandEvent can be used as a base class for implementing custom
6352 event types in Python, where the event shoudl travel up to parent
6353 windows looking for a handler. You should derived from this class
6354 instead of `wx.CommandEvent` because this class is Python-aware and is
6355 able to transport its Python bits safely through the wxWidgets event
6356 system and have them still be there when the event handler is invoked.
6357
6358 :see: `wx.PyEvent`
6359
6360 """
6361 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6362 __repr__ = _swig_repr
6363 def __init__(self, *args, **kwargs):
6364 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6365 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6366 self._SetSelf(self)
6367
6368 __swig_destroy__ = _core_.delete_PyCommandEvent
6369 __del__ = lambda self : None;
6370 def _SetSelf(*args, **kwargs):
6371 """_SetSelf(self, PyObject self)"""
6372 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6373
6374 def _GetSelf(*args, **kwargs):
6375 """_GetSelf(self) -> PyObject"""
6376 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6377
6378 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6379
6380 class DateEvent(CommandEvent):
6381 """
6382 This event class holds information about a date change event and is
6383 used together with `wx.DatePickerCtrl`. It also serves as a base class
6384 for `wx.calendar.CalendarEvent`. Bind these event types with
6385 EVT_DATE_CHANGED.
6386 """
6387 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6388 __repr__ = _swig_repr
6389 def __init__(self, *args, **kwargs):
6390 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6391 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6392 def GetDate(*args, **kwargs):
6393 """
6394 GetDate(self) -> DateTime
6395
6396 Returns the date.
6397 """
6398 return _core_.DateEvent_GetDate(*args, **kwargs)
6399
6400 def SetDate(*args, **kwargs):
6401 """
6402 SetDate(self, DateTime date)
6403
6404 Sets the date carried by the event, normally only used by the library
6405 internally.
6406 """
6407 return _core_.DateEvent_SetDate(*args, **kwargs)
6408
6409 _core_.DateEvent_swigregister(DateEvent)
6410
6411 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6412 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6413
6414 #---------------------------------------------------------------------------
6415
6416 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6417 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6418 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6419 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6420 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6421 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6422 class PyApp(EvtHandler):
6423 """
6424 The ``wx.PyApp`` class is an *implementation detail*, please use the
6425 `wx.App` class (or some other derived class) instead.
6426 """
6427 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6428 __repr__ = _swig_repr
6429 def __init__(self, *args, **kwargs):
6430 """
6431 __init__(self) -> PyApp
6432
6433 Create a new application object, starting the bootstrap process.
6434 """
6435 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6436 self._setCallbackInfo(self, PyApp, False)
6437 self._setOORInfo(self, False)
6438
6439 __swig_destroy__ = _core_.delete_PyApp
6440 __del__ = lambda self : None;
6441 def _setCallbackInfo(*args, **kwargs):
6442 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6443 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6444
6445 def GetAppName(*args, **kwargs):
6446 """
6447 GetAppName(self) -> String
6448
6449 Get the application name.
6450 """
6451 return _core_.PyApp_GetAppName(*args, **kwargs)
6452
6453 def SetAppName(*args, **kwargs):
6454 """
6455 SetAppName(self, String name)
6456
6457 Set the application name. This value may be used automatically by
6458 `wx.Config` and such.
6459 """
6460 return _core_.PyApp_SetAppName(*args, **kwargs)
6461
6462 def GetClassName(*args, **kwargs):
6463 """
6464 GetClassName(self) -> String
6465
6466 Get the application's class name.
6467 """
6468 return _core_.PyApp_GetClassName(*args, **kwargs)
6469
6470 def SetClassName(*args, **kwargs):
6471 """
6472 SetClassName(self, String name)
6473
6474 Set the application's class name. This value may be used for
6475 X-resources if applicable for the platform
6476 """
6477 return _core_.PyApp_SetClassName(*args, **kwargs)
6478
6479 def GetVendorName(*args, **kwargs):
6480 """
6481 GetVendorName(self) -> String
6482
6483 Get the application's vendor name.
6484 """
6485 return _core_.PyApp_GetVendorName(*args, **kwargs)
6486
6487 def SetVendorName(*args, **kwargs):
6488 """
6489 SetVendorName(self, String name)
6490
6491 Set the application's vendor name. This value may be used
6492 automatically by `wx.Config` and such.
6493 """
6494 return _core_.PyApp_SetVendorName(*args, **kwargs)
6495
6496 def GetTraits(*args, **kwargs):
6497 """
6498 GetTraits(self) -> wxAppTraits
6499
6500 Return (and create if necessary) the app traits object to which we
6501 delegate for everything which either should be configurable by the
6502 user (then he can change the default behaviour simply by overriding
6503 CreateTraits() and returning his own traits object) or which is
6504 GUI/console dependent as then wx.AppTraits allows us to abstract the
6505 differences behind the common facade.
6506
6507 :todo: Add support for overriding CreateAppTraits in wxPython.
6508 """
6509 return _core_.PyApp_GetTraits(*args, **kwargs)
6510
6511 def ProcessPendingEvents(*args, **kwargs):
6512 """
6513 ProcessPendingEvents(self)
6514
6515 Process all events in the Pending Events list -- it is necessary to
6516 call this function to process posted events. This normally happens
6517 during each event loop iteration.
6518 """
6519 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6520
6521 def Yield(*args, **kwargs):
6522 """
6523 Yield(self, bool onlyIfNeeded=False) -> bool
6524
6525 Process all currently pending events right now, instead of waiting
6526 until return to the event loop. It is an error to call ``Yield``
6527 recursively unless the value of ``onlyIfNeeded`` is True.
6528
6529 :warning: This function is dangerous as it can lead to unexpected
6530 reentrancies (i.e. when called from an event handler it may
6531 result in calling the same event handler again), use with
6532 extreme care or, better, don't use at all!
6533
6534 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6535
6536 """
6537 return _core_.PyApp_Yield(*args, **kwargs)
6538
6539 def WakeUpIdle(*args, **kwargs):
6540 """
6541 WakeUpIdle(self)
6542
6543 Make sure that idle events are sent again.
6544 :see: `wx.WakeUpIdle`
6545 """
6546 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6547
6548 def IsMainLoopRunning(*args, **kwargs):
6549 """
6550 IsMainLoopRunning() -> bool
6551
6552 Returns True if we're running the main loop, i.e. if the events can
6553 currently be dispatched.
6554 """
6555 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6556
6557 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6558 def MainLoop(*args, **kwargs):
6559 """
6560 MainLoop(self) -> int
6561
6562 Execute the main GUI loop, the function doesn't normally return until
6563 all top level windows have been closed and destroyed.
6564 """
6565 return _core_.PyApp_MainLoop(*args, **kwargs)
6566
6567 def Exit(*args, **kwargs):
6568 """
6569 Exit(self)
6570
6571 Exit the main loop thus terminating the application.
6572 :see: `wx.Exit`
6573 """
6574 return _core_.PyApp_Exit(*args, **kwargs)
6575
6576 def ExitMainLoop(*args, **kwargs):
6577 """
6578 ExitMainLoop(self)
6579
6580 Exit the main GUI loop during the next iteration of the main
6581 loop, (i.e. it does not stop the program immediately!)
6582 """
6583 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6584
6585 def Pending(*args, **kwargs):
6586 """
6587 Pending(self) -> bool
6588
6589 Returns True if there are unprocessed events in the event queue.
6590 """
6591 return _core_.PyApp_Pending(*args, **kwargs)
6592
6593 def Dispatch(*args, **kwargs):
6594 """
6595 Dispatch(self) -> bool
6596
6597 Process the first event in the event queue (blocks until an event
6598 appears if there are none currently)
6599 """
6600 return _core_.PyApp_Dispatch(*args, **kwargs)
6601
6602 def ProcessIdle(*args, **kwargs):
6603 """
6604 ProcessIdle(self) -> bool
6605
6606 Called from the MainLoop when the application becomes idle (there are
6607 no pending events) and sends a `wx.IdleEvent` to all interested
6608 parties. Returns True if more idle events are needed, False if not.
6609 """
6610 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6611
6612 def SendIdleEvents(*args, **kwargs):
6613 """
6614 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6615
6616 Send idle event to window and all subwindows. Returns True if more
6617 idle time is requested.
6618 """
6619 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6620
6621 def IsActive(*args, **kwargs):
6622 """
6623 IsActive(self) -> bool
6624
6625 Return True if our app has focus.
6626 """
6627 return _core_.PyApp_IsActive(*args, **kwargs)
6628
6629 def SetTopWindow(*args, **kwargs):
6630 """
6631 SetTopWindow(self, Window win)
6632
6633 Set the *main* top level window
6634 """
6635 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6636
6637 def GetTopWindow(*args, **kwargs):
6638 """
6639 GetTopWindow(self) -> Window
6640
6641 Return the *main* top level window (if it hadn't been set previously
6642 with SetTopWindow(), will return just some top level window and, if
6643 there not any, will return None)
6644 """
6645 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6646
6647 def SetExitOnFrameDelete(*args, **kwargs):
6648 """
6649 SetExitOnFrameDelete(self, bool flag)
6650
6651 Control the exit behaviour: by default, the program will exit the main
6652 loop (and so, usually, terminate) when the last top-level program
6653 window is deleted. Beware that if you disable this behaviour (with
6654 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6655 explicitly from somewhere.
6656 """
6657 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6658
6659 def GetExitOnFrameDelete(*args, **kwargs):
6660 """
6661 GetExitOnFrameDelete(self) -> bool
6662
6663 Get the current exit behaviour setting.
6664 """
6665 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6666
6667 def SetUseBestVisual(*args, **kwargs):
6668 """
6669 SetUseBestVisual(self, bool flag)
6670
6671 Set whether the app should try to use the best available visual on
6672 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6673 """
6674 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6675
6676 def GetUseBestVisual(*args, **kwargs):
6677 """
6678 GetUseBestVisual(self) -> bool
6679
6680 Get current UseBestVisual setting.
6681 """
6682 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6683
6684 def SetPrintMode(*args, **kwargs):
6685 """SetPrintMode(self, int mode)"""
6686 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6687
6688 def GetPrintMode(*args, **kwargs):
6689 """GetPrintMode(self) -> int"""
6690 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6691
6692 def SetAssertMode(*args, **kwargs):
6693 """
6694 SetAssertMode(self, int mode)
6695
6696 Set the OnAssert behaviour for debug and hybrid builds.
6697 """
6698 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6699
6700 def GetAssertMode(*args, **kwargs):
6701 """
6702 GetAssertMode(self) -> int
6703
6704 Get the current OnAssert behaviour setting.
6705 """
6706 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6707
6708 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6709 """GetMacSupportPCMenuShortcuts() -> bool"""
6710 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6711
6712 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6713 def GetMacAboutMenuItemId(*args, **kwargs):
6714 """GetMacAboutMenuItemId() -> long"""
6715 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6716
6717 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6718 def GetMacPreferencesMenuItemId(*args, **kwargs):
6719 """GetMacPreferencesMenuItemId() -> long"""
6720 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6721
6722 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6723 def GetMacExitMenuItemId(*args, **kwargs):
6724 """GetMacExitMenuItemId() -> long"""
6725 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6726
6727 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6728 def GetMacHelpMenuTitleName(*args, **kwargs):
6729 """GetMacHelpMenuTitleName() -> String"""
6730 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6731
6732 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6733 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6734 """SetMacSupportPCMenuShortcuts(bool val)"""
6735 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6736
6737 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6738 def SetMacAboutMenuItemId(*args, **kwargs):
6739 """SetMacAboutMenuItemId(long val)"""
6740 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6741
6742 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6743 def SetMacPreferencesMenuItemId(*args, **kwargs):
6744 """SetMacPreferencesMenuItemId(long val)"""
6745 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6746
6747 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6748 def SetMacExitMenuItemId(*args, **kwargs):
6749 """SetMacExitMenuItemId(long val)"""
6750 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6751
6752 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6753 def SetMacHelpMenuTitleName(*args, **kwargs):
6754 """SetMacHelpMenuTitleName(String val)"""
6755 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6756
6757 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6758 def _BootstrapApp(*args, **kwargs):
6759 """
6760 _BootstrapApp(self)
6761
6762 For internal use only
6763 """
6764 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6765
6766 def GetComCtl32Version(*args, **kwargs):
6767 """
6768 GetComCtl32Version() -> int
6769
6770 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6771 it wasn't found at all. Raises an exception on non-Windows platforms.
6772 """
6773 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6774
6775 GetComCtl32Version = staticmethod(GetComCtl32Version)
6776 _core_.PyApp_swigregister(PyApp)
6777
6778 def PyApp_IsMainLoopRunning(*args):
6779 """
6780 PyApp_IsMainLoopRunning() -> bool
6781
6782 Returns True if we're running the main loop, i.e. if the events can
6783 currently be dispatched.
6784 """
6785 return _core_.PyApp_IsMainLoopRunning(*args)
6786
6787 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6788 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6789 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6790
6791 def PyApp_GetMacAboutMenuItemId(*args):
6792 """PyApp_GetMacAboutMenuItemId() -> long"""
6793 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6794
6795 def PyApp_GetMacPreferencesMenuItemId(*args):
6796 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6797 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6798
6799 def PyApp_GetMacExitMenuItemId(*args):
6800 """PyApp_GetMacExitMenuItemId() -> long"""
6801 return _core_.PyApp_GetMacExitMenuItemId(*args)
6802
6803 def PyApp_GetMacHelpMenuTitleName(*args):
6804 """PyApp_GetMacHelpMenuTitleName() -> String"""
6805 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6806
6807 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6808 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6809 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6810
6811 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6812 """PyApp_SetMacAboutMenuItemId(long val)"""
6813 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6814
6815 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6816 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6817 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6818
6819 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6820 """PyApp_SetMacExitMenuItemId(long val)"""
6821 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6822
6823 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6824 """PyApp_SetMacHelpMenuTitleName(String val)"""
6825 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6826
6827 def PyApp_GetComCtl32Version(*args):
6828 """
6829 PyApp_GetComCtl32Version() -> int
6830
6831 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6832 it wasn't found at all. Raises an exception on non-Windows platforms.
6833 """
6834 return _core_.PyApp_GetComCtl32Version(*args)
6835
6836 #---------------------------------------------------------------------------
6837
6838
6839 def Exit(*args):
6840 """
6841 Exit()
6842
6843 Force an exit of the application. Convenience for wx.GetApp().Exit()
6844 """
6845 return _core_.Exit(*args)
6846
6847 def Yield(*args):
6848 """
6849 Yield() -> bool
6850
6851 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6852 """
6853 return _core_.Yield(*args)
6854
6855 def YieldIfNeeded(*args):
6856 """
6857 YieldIfNeeded() -> bool
6858
6859 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6860 """
6861 return _core_.YieldIfNeeded(*args)
6862
6863 def SafeYield(*args, **kwargs):
6864 """
6865 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6866
6867 This function is similar to `wx.Yield`, except that it disables the
6868 user input to all program windows before calling `wx.Yield` and
6869 re-enables it again afterwards. If ``win`` is not None, this window
6870 will remain enabled, allowing the implementation of some limited user
6871 interaction.
6872
6873 :Returns: the result of the call to `wx.Yield`.
6874 """
6875 return _core_.SafeYield(*args, **kwargs)
6876
6877 def WakeUpIdle(*args):
6878 """
6879 WakeUpIdle()
6880
6881 Cause the message queue to become empty again, so idle events will be
6882 sent.
6883 """
6884 return _core_.WakeUpIdle(*args)
6885
6886 def PostEvent(*args, **kwargs):
6887 """
6888 PostEvent(EvtHandler dest, Event event)
6889
6890 Send an event to a window or other wx.EvtHandler to be processed
6891 later.
6892 """
6893 return _core_.PostEvent(*args, **kwargs)
6894
6895 def App_CleanUp(*args):
6896 """
6897 App_CleanUp()
6898
6899 For internal use only, it is used to cleanup after wxWidgets when
6900 Python shuts down.
6901 """
6902 return _core_.App_CleanUp(*args)
6903
6904 def GetApp(*args):
6905 """
6906 GetApp() -> PyApp
6907
6908 Return a reference to the current wx.App object.
6909 """
6910 return _core_.GetApp(*args)
6911
6912 def SetDefaultPyEncoding(*args, **kwargs):
6913 """
6914 SetDefaultPyEncoding(string encoding)
6915
6916 Sets the encoding that wxPython will use when it needs to convert a
6917 Python string or unicode object to or from a wxString.
6918
6919 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6920 but please be aware that the default encoding within the same locale
6921 may be slightly different on different platforms. For example, please
6922 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6923 between the common latin/roman encodings.
6924 """
6925 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6926
6927 def GetDefaultPyEncoding(*args):
6928 """
6929 GetDefaultPyEncoding() -> string
6930
6931 Gets the current encoding that wxPython will use when it needs to
6932 convert a Python string or unicode object to or from a wxString.
6933 """
6934 return _core_.GetDefaultPyEncoding(*args)
6935 #----------------------------------------------------------------------
6936
6937 class PyOnDemandOutputWindow:
6938 """
6939 A class that can be used for redirecting Python's stdout and
6940 stderr streams. It will do nothing until something is wrriten to
6941 the stream at which point it will create a Frame with a text area
6942 and write the text there.
6943 """
6944 def __init__(self, title = "wxPython: stdout/stderr"):
6945 self.frame = None
6946 self.title = title
6947 self.pos = wx.DefaultPosition
6948 self.size = (450, 300)
6949 self.parent = None
6950
6951 def SetParent(self, parent):
6952 """Set the window to be used as the popup Frame's parent."""
6953 self.parent = parent
6954
6955
6956 def CreateOutputWindow(self, st):
6957 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6958 style=wx.DEFAULT_FRAME_STYLE)
6959 self.text = wx.TextCtrl(self.frame, -1, "",
6960 style=wx.TE_MULTILINE|wx.TE_READONLY)
6961 self.text.AppendText(st)
6962 self.frame.Show(True)
6963 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6964
6965
6966 def OnCloseWindow(self, event):
6967 if self.frame is not None:
6968 self.frame.Destroy()
6969 self.frame = None
6970 self.text = None
6971
6972
6973 # These methods provide the file-like output behaviour.
6974 def write(self, text):
6975 """
6976 Create the output window if needed and write the string to it.
6977 If not called in the context of the gui thread then uses
6978 CallAfter to do the work there.
6979 """
6980 if self.frame is None:
6981 if not wx.Thread_IsMain():
6982 wx.CallAfter(self.CreateOutputWindow, text)
6983 else:
6984 self.CreateOutputWindow(text)
6985 else:
6986 if not wx.Thread_IsMain():
6987 wx.CallAfter(self.text.AppendText, text)
6988 else:
6989 self.text.AppendText(text)
6990
6991
6992 def close(self):
6993 if self.frame is not None:
6994 wx.CallAfter(self.frame.Close)
6995
6996
6997 def flush(self):
6998 pass
6999
7000
7001
7002 #----------------------------------------------------------------------
7003
7004 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7005
7006 class App(wx.PyApp):
7007 """
7008 The ``wx.App`` class represents the application and is used to:
7009
7010 * bootstrap the wxPython system and initialize the underlying
7011 gui toolkit
7012 * set and get application-wide properties
7013 * implement the windowing system main message or event loop,
7014 and to dispatch events to window instances
7015 * etc.
7016
7017 Every application must have a ``wx.App`` instance, and all
7018 creation of UI objects should be delayed until after the
7019 ``wx.App`` object has been created in order to ensure that the gui
7020 platform and wxWidgets have been fully initialized.
7021
7022 Normally you would derive from this class and implement an
7023 ``OnInit`` method that creates a frame and then calls
7024 ``self.SetTopWindow(frame)``.
7025
7026 :see: `wx.PySimpleApp` for a simpler app class that can be used
7027 directly.
7028 """
7029
7030 outputWindowClass = PyOnDemandOutputWindow
7031
7032 def __init__(self, redirect=_defRedirect, filename=None,
7033 useBestVisual=False, clearSigInt=True):
7034 """
7035 Construct a ``wx.App`` object.
7036
7037 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7038 redirected? Defaults to True on Windows and Mac, False
7039 otherwise. If `filename` is None then output will be
7040 redirected to a window that pops up as needed. (You can
7041 control what kind of window is created for the output by
7042 resetting the class variable ``outputWindowClass`` to a
7043 class of your choosing.)
7044
7045 :param filename: The name of a file to redirect output to, if
7046 redirect is True.
7047
7048 :param useBestVisual: Should the app try to use the best
7049 available visual provided by the system (only relevant on
7050 systems that have more than one visual.) This parameter
7051 must be used instead of calling `SetUseBestVisual` later
7052 on because it must be set before the underlying GUI
7053 toolkit is initialized.
7054
7055 :param clearSigInt: Should SIGINT be cleared? This allows the
7056 app to terminate upon a Ctrl-C in the console like other
7057 GUI apps will.
7058
7059 :note: You should override OnInit to do applicaition
7060 initialization to ensure that the system, toolkit and
7061 wxWidgets are fully initialized.
7062 """
7063 wx.PyApp.__init__(self)
7064
7065 if wx.Platform == "__WXMAC__":
7066 try:
7067 import MacOS
7068 if not MacOS.WMAvailable():
7069 print """\
7070 This program needs access to the screen. Please run with 'pythonw',
7071 not 'python', and only when you are logged in on the main display of
7072 your Mac."""
7073 _sys.exit(1)
7074 except SystemExit:
7075 raise
7076 except:
7077 pass
7078
7079 # This has to be done before OnInit
7080 self.SetUseBestVisual(useBestVisual)
7081
7082 # Set the default handler for SIGINT. This fixes a problem
7083 # where if Ctrl-C is pressed in the console that started this
7084 # app then it will not appear to do anything, (not even send
7085 # KeyboardInterrupt???) but will later segfault on exit. By
7086 # setting the default handler then the app will exit, as
7087 # expected (depending on platform.)
7088 if clearSigInt:
7089 try:
7090 import signal
7091 signal.signal(signal.SIGINT, signal.SIG_DFL)
7092 except:
7093 pass
7094
7095 # Save and redirect the stdio to a window?
7096 self.stdioWin = None
7097 self.saveStdio = (_sys.stdout, _sys.stderr)
7098 if redirect:
7099 self.RedirectStdio(filename)
7100
7101 # Use Python's install prefix as the default
7102 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7103
7104 # This finishes the initialization of wxWindows and then calls
7105 # the OnInit that should be present in the derived class
7106 self._BootstrapApp()
7107
7108
7109 def OnPreInit(self):
7110 """
7111 Things that must be done after _BootstrapApp has done its
7112 thing, but would be nice if they were already done by the time
7113 that OnInit is called.
7114 """
7115 wx.StockGDI._initStockObjects()
7116
7117
7118 def __del__(self, destroy=wx.PyApp.__del__):
7119 self.RestoreStdio() # Just in case the MainLoop was overridden
7120 destroy(self)
7121
7122 def Destroy(self):
7123 wx.PyApp.Destroy(self)
7124 self.thisown = 0
7125
7126 def SetTopWindow(self, frame):
7127 """Set the \"main\" top level window"""
7128 if self.stdioWin:
7129 self.stdioWin.SetParent(frame)
7130 wx.PyApp.SetTopWindow(self, frame)
7131
7132
7133 def MainLoop(self):
7134 """Execute the main GUI event loop"""
7135 wx.PyApp.MainLoop(self)
7136 self.RestoreStdio()
7137
7138
7139 def RedirectStdio(self, filename=None):
7140 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7141 if filename:
7142 _sys.stdout = _sys.stderr = open(filename, 'a')
7143 else:
7144 self.stdioWin = self.outputWindowClass()
7145 _sys.stdout = _sys.stderr = self.stdioWin
7146
7147
7148 def RestoreStdio(self):
7149 try:
7150 _sys.stdout, _sys.stderr = self.saveStdio
7151 except:
7152 pass
7153
7154
7155 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7156 """
7157 Set the title, position and/or size of the output window if
7158 the stdio has been redirected. This should be called before
7159 any output would cause the output window to be created.
7160 """
7161 if self.stdioWin:
7162 if title is not None:
7163 self.stdioWin.title = title
7164 if pos is not None:
7165 self.stdioWin.pos = pos
7166 if size is not None:
7167 self.stdioWin.size = size
7168
7169
7170
7171
7172 # change from wx.PyApp_XX to wx.App_XX
7173 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7174 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7175 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7176 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7177 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7178 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7179 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7180 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7181 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7182 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7183 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7184
7185 #----------------------------------------------------------------------------
7186
7187 class PySimpleApp(wx.App):
7188 """
7189 A simple application class. You can just create one of these and
7190 then then make your top level windows later, and not have to worry
7191 about OnInit. For example::
7192
7193 app = wx.PySimpleApp()
7194 frame = wx.Frame(None, title='Hello World')
7195 frame.Show()
7196 app.MainLoop()
7197
7198 :see: `wx.App`
7199 """
7200
7201 def __init__(self, redirect=False, filename=None,
7202 useBestVisual=False, clearSigInt=True):
7203 """
7204 :see: `wx.App.__init__`
7205 """
7206 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7207
7208 def OnInit(self):
7209 return True
7210
7211
7212
7213 # Is anybody using this one?
7214 class PyWidgetTester(wx.App):
7215 def __init__(self, size = (250, 100)):
7216 self.size = size
7217 wx.App.__init__(self, 0)
7218
7219 def OnInit(self):
7220 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7221 self.SetTopWindow(self.frame)
7222 return True
7223
7224 def SetWidget(self, widgetClass, *args, **kwargs):
7225 w = widgetClass(self.frame, *args, **kwargs)
7226 self.frame.Show(True)
7227
7228 #----------------------------------------------------------------------------
7229 # DO NOT hold any other references to this object. This is how we
7230 # know when to cleanup system resources that wxWidgets is holding. When
7231 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7232 # goes to zero and it calls the wx.App_CleanUp function.
7233
7234 class __wxPyCleanup:
7235 def __init__(self):
7236 self.cleanup = _core_.App_CleanUp
7237 def __del__(self):
7238 self.cleanup()
7239
7240 _sys.__wxPythonCleanup = __wxPyCleanup()
7241
7242 ## # another possible solution, but it gets called too early...
7243 ## import atexit
7244 ## atexit.register(_core_.wxApp_CleanUp)
7245
7246
7247 #----------------------------------------------------------------------------
7248
7249 #---------------------------------------------------------------------------
7250
7251 class EventLoop(object):
7252 """Proxy of C++ EventLoop class"""
7253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7254 __repr__ = _swig_repr
7255 def __init__(self, *args, **kwargs):
7256 """__init__(self) -> EventLoop"""
7257 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7258 __swig_destroy__ = _core_.delete_EventLoop
7259 __del__ = lambda self : None;
7260 def Run(*args, **kwargs):
7261 """Run(self) -> int"""
7262 return _core_.EventLoop_Run(*args, **kwargs)
7263
7264 def Exit(*args, **kwargs):
7265 """Exit(self, int rc=0)"""
7266 return _core_.EventLoop_Exit(*args, **kwargs)
7267
7268 def Pending(*args, **kwargs):
7269 """Pending(self) -> bool"""
7270 return _core_.EventLoop_Pending(*args, **kwargs)
7271
7272 def Dispatch(*args, **kwargs):
7273 """Dispatch(self) -> bool"""
7274 return _core_.EventLoop_Dispatch(*args, **kwargs)
7275
7276 def IsRunning(*args, **kwargs):
7277 """IsRunning(self) -> bool"""
7278 return _core_.EventLoop_IsRunning(*args, **kwargs)
7279
7280 def GetActive(*args, **kwargs):
7281 """GetActive() -> EventLoop"""
7282 return _core_.EventLoop_GetActive(*args, **kwargs)
7283
7284 GetActive = staticmethod(GetActive)
7285 def SetActive(*args, **kwargs):
7286 """SetActive(EventLoop loop)"""
7287 return _core_.EventLoop_SetActive(*args, **kwargs)
7288
7289 SetActive = staticmethod(SetActive)
7290 _core_.EventLoop_swigregister(EventLoop)
7291
7292 def EventLoop_GetActive(*args):
7293 """EventLoop_GetActive() -> EventLoop"""
7294 return _core_.EventLoop_GetActive(*args)
7295
7296 def EventLoop_SetActive(*args, **kwargs):
7297 """EventLoop_SetActive(EventLoop loop)"""
7298 return _core_.EventLoop_SetActive(*args, **kwargs)
7299
7300 class EventLoopActivator(object):
7301 """Proxy of C++ EventLoopActivator class"""
7302 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7303 __repr__ = _swig_repr
7304 def __init__(self, *args, **kwargs):
7305 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7306 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7307 __swig_destroy__ = _core_.delete_EventLoopActivator
7308 __del__ = lambda self : None;
7309 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7310
7311 #---------------------------------------------------------------------------
7312
7313 class AcceleratorEntry(object):
7314 """
7315 A class used to define items in an `wx.AcceleratorTable`. wxPython
7316 programs can choose to use wx.AcceleratorEntry objects, but using a
7317 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7318 as well. See `__init__` for of the tuple values.
7319
7320 :see: `wx.AcceleratorTable`
7321 """
7322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7323 __repr__ = _swig_repr
7324 def __init__(self, *args, **kwargs):
7325 """
7326 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7327
7328 Construct a wx.AcceleratorEntry.
7329 """
7330 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7331 __swig_destroy__ = _core_.delete_AcceleratorEntry
7332 __del__ = lambda self : None;
7333 def Set(*args, **kwargs):
7334 """
7335 Set(self, int flags, int keyCode, int cmd)
7336
7337 (Re)set the attributes of a wx.AcceleratorEntry.
7338 :see `__init__`
7339 """
7340 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7341
7342 def GetFlags(*args, **kwargs):
7343 """
7344 GetFlags(self) -> int
7345
7346 Get the AcceleratorEntry's flags.
7347 """
7348 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7349
7350 def GetKeyCode(*args, **kwargs):
7351 """
7352 GetKeyCode(self) -> int
7353
7354 Get the AcceleratorEntry's keycode.
7355 """
7356 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7357
7358 def GetCommand(*args, **kwargs):
7359 """
7360 GetCommand(self) -> int
7361
7362 Get the AcceleratorEntry's command ID.
7363 """
7364 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7365
7366 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7367
7368 class AcceleratorTable(Object):
7369 """
7370 An accelerator table allows the application to specify a table of
7371 keyboard shortcuts for menus or other commands. On Windows, menu or
7372 button commands are supported; on GTK, only menu commands are
7373 supported.
7374 """
7375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7376 __repr__ = _swig_repr
7377 def __init__(self, *args, **kwargs):
7378 """
7379 __init__(entries) -> AcceleratorTable
7380
7381 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7382 items or or of 3-tuples (flags, keyCode, cmdID)
7383
7384 :see: `wx.AcceleratorEntry`
7385 """
7386 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7387 __swig_destroy__ = _core_.delete_AcceleratorTable
7388 __del__ = lambda self : None;
7389 def Ok(*args, **kwargs):
7390 """Ok(self) -> bool"""
7391 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7392
7393 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7394
7395
7396 def GetAccelFromString(*args, **kwargs):
7397 """GetAccelFromString(String label) -> AcceleratorEntry"""
7398 return _core_.GetAccelFromString(*args, **kwargs)
7399 #---------------------------------------------------------------------------
7400
7401 class VisualAttributes(object):
7402 """struct containing all the visual attributes of a control"""
7403 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7404 __repr__ = _swig_repr
7405 def __init__(self, *args, **kwargs):
7406 """
7407 __init__(self) -> VisualAttributes
7408
7409 struct containing all the visual attributes of a control
7410 """
7411 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7412 __swig_destroy__ = _core_.delete_VisualAttributes
7413 __del__ = lambda self : None;
7414 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7415 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7416 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7417 _core_.VisualAttributes_swigregister(VisualAttributes)
7418 NullAcceleratorTable = cvar.NullAcceleratorTable
7419 PanelNameStr = cvar.PanelNameStr
7420
7421 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7422 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7423 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7424 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7425 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7426 class Window(EvtHandler):
7427 """
7428 wx.Window is the base class for all windows and represents any visible
7429 object on the screen. All controls, top level windows and so on are
7430 wx.Windows. Sizers and device contexts are not however, as they don't
7431 appear on screen themselves.
7432
7433 """
7434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7435 __repr__ = _swig_repr
7436 def __init__(self, *args, **kwargs):
7437 """
7438 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7439 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7440
7441 Construct and show a generic Window.
7442 """
7443 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7444 self._setOORInfo(self)
7445
7446 def Create(*args, **kwargs):
7447 """
7448 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7449 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7450
7451 Create the GUI part of the Window for 2-phase creation mode.
7452 """
7453 return _core_.Window_Create(*args, **kwargs)
7454
7455 def Close(*args, **kwargs):
7456 """
7457 Close(self, bool force=False) -> bool
7458
7459 This function simply generates a EVT_CLOSE event whose handler usually
7460 tries to close the window. It doesn't close the window itself,
7461 however. If force is False (the default) then the window's close
7462 handler will be allowed to veto the destruction of the window.
7463 """
7464 return _core_.Window_Close(*args, **kwargs)
7465
7466 def Destroy(*args, **kwargs):
7467 """
7468 Destroy(self) -> bool
7469
7470 Destroys the window safely. Frames and dialogs are not destroyed
7471 immediately when this function is called -- they are added to a list
7472 of windows to be deleted on idle time, when all the window's events
7473 have been processed. This prevents problems with events being sent to
7474 non-existent windows.
7475
7476 Returns True if the window has either been successfully deleted, or it
7477 has been added to the list of windows pending real deletion.
7478 """
7479 val = _core_.Window_Destroy(*args, **kwargs)
7480 args[0].thisown = 0
7481 return val
7482
7483 def DestroyChildren(*args, **kwargs):
7484 """
7485 DestroyChildren(self) -> bool
7486
7487 Destroys all children of a window. Called automatically by the
7488 destructor.
7489 """
7490 return _core_.Window_DestroyChildren(*args, **kwargs)
7491
7492 def IsBeingDeleted(*args, **kwargs):
7493 """
7494 IsBeingDeleted(self) -> bool
7495
7496 Is the window in the process of being deleted?
7497 """
7498 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7499
7500 def SetLabel(*args, **kwargs):
7501 """
7502 SetLabel(self, String label)
7503
7504 Set the text which the window shows in its label if applicable.
7505 """
7506 return _core_.Window_SetLabel(*args, **kwargs)
7507
7508 def GetLabel(*args, **kwargs):
7509 """
7510 GetLabel(self) -> String
7511
7512 Generic way of getting a label from any window, for identification
7513 purposes. The interpretation of this function differs from class to
7514 class. For frames and dialogs, the value returned is the title. For
7515 buttons or static text controls, it is the button text. This function
7516 can be useful for meta-programs such as testing tools or special-needs
7517 access programs)which need to identify windows by name.
7518 """
7519 return _core_.Window_GetLabel(*args, **kwargs)
7520
7521 def SetName(*args, **kwargs):
7522 """
7523 SetName(self, String name)
7524
7525 Sets the window's name. The window name is used for ressource setting
7526 in X, it is not the same as the window title/label
7527 """
7528 return _core_.Window_SetName(*args, **kwargs)
7529
7530 def GetName(*args, **kwargs):
7531 """
7532 GetName(self) -> String
7533
7534 Returns the windows name. This name is not guaranteed to be unique;
7535 it is up to the programmer to supply an appropriate name in the window
7536 constructor or via wx.Window.SetName.
7537 """
7538 return _core_.Window_GetName(*args, **kwargs)
7539
7540 def SetWindowVariant(*args, **kwargs):
7541 """
7542 SetWindowVariant(self, int variant)
7543
7544 Sets the variant of the window/font size to use for this window, if
7545 the platform supports variants, for example, wxMac.
7546 """
7547 return _core_.Window_SetWindowVariant(*args, **kwargs)
7548
7549 def GetWindowVariant(*args, **kwargs):
7550 """GetWindowVariant(self) -> int"""
7551 return _core_.Window_GetWindowVariant(*args, **kwargs)
7552
7553 def SetId(*args, **kwargs):
7554 """
7555 SetId(self, int winid)
7556
7557 Sets the identifier of the window. Each window has an integer
7558 identifier. If the application has not provided one, an identifier
7559 will be generated. Normally, the identifier should be provided on
7560 creation and should not be modified subsequently.
7561 """
7562 return _core_.Window_SetId(*args, **kwargs)
7563
7564 def GetId(*args, **kwargs):
7565 """
7566 GetId(self) -> int
7567
7568 Returns the identifier of the window. Each window has an integer
7569 identifier. If the application has not provided one (or the default Id
7570 -1 is used) then an unique identifier with a negative value will be
7571 generated.
7572 """
7573 return _core_.Window_GetId(*args, **kwargs)
7574
7575 def NewControlId(*args, **kwargs):
7576 """
7577 NewControlId() -> int
7578
7579 Generate a control id for the controls which were not given one.
7580 """
7581 return _core_.Window_NewControlId(*args, **kwargs)
7582
7583 NewControlId = staticmethod(NewControlId)
7584 def NextControlId(*args, **kwargs):
7585 """
7586 NextControlId(int winid) -> int
7587
7588 Get the id of the control following the one with the given
7589 autogenerated) id
7590 """
7591 return _core_.Window_NextControlId(*args, **kwargs)
7592
7593 NextControlId = staticmethod(NextControlId)
7594 def PrevControlId(*args, **kwargs):
7595 """
7596 PrevControlId(int winid) -> int
7597
7598 Get the id of the control preceding the one with the given
7599 autogenerated) id
7600 """
7601 return _core_.Window_PrevControlId(*args, **kwargs)
7602
7603 PrevControlId = staticmethod(PrevControlId)
7604 def SetSize(*args, **kwargs):
7605 """
7606 SetSize(self, Size size)
7607
7608 Sets the size of the window in pixels.
7609 """
7610 return _core_.Window_SetSize(*args, **kwargs)
7611
7612 def SetDimensions(*args, **kwargs):
7613 """
7614 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7615
7616 Sets the position and size of the window in pixels. The sizeFlags
7617 parameter indicates the interpretation of the other params if they are
7618 equal to -1.
7619
7620 ======================== ======================================
7621 wx.SIZE_AUTO A -1 indicates that a class-specific
7622 default should be used.
7623 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7624 -1 values are supplied.
7625 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7626 interpreted as real dimensions, not
7627 default values.
7628 ======================== ======================================
7629
7630 """
7631 return _core_.Window_SetDimensions(*args, **kwargs)
7632
7633 def SetRect(*args, **kwargs):
7634 """
7635 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7636
7637 Sets the position and size of the window in pixels using a wx.Rect.
7638 """
7639 return _core_.Window_SetRect(*args, **kwargs)
7640
7641 def SetSizeWH(*args, **kwargs):
7642 """
7643 SetSizeWH(self, int width, int height)
7644
7645 Sets the size of the window in pixels.
7646 """
7647 return _core_.Window_SetSizeWH(*args, **kwargs)
7648
7649 def Move(*args, **kwargs):
7650 """
7651 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7652
7653 Moves the window to the given position.
7654 """
7655 return _core_.Window_Move(*args, **kwargs)
7656
7657 SetPosition = Move
7658 def MoveXY(*args, **kwargs):
7659 """
7660 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7661
7662 Moves the window to the given position.
7663 """
7664 return _core_.Window_MoveXY(*args, **kwargs)
7665
7666 def SetBestFittingSize(*args, **kwargs):
7667 """
7668 SetBestFittingSize(self, Size size=DefaultSize)
7669
7670 A 'Smart' SetSize that will fill in default size components with the
7671 window's *best size* values. Also set's the minsize for use with sizers.
7672 """
7673 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7674
7675 def Raise(*args, **kwargs):
7676 """
7677 Raise(self)
7678
7679 Raises the window to the top of the window hierarchy. In current
7680 version of wxWidgets this works both for manage and child windows.
7681 """
7682 return _core_.Window_Raise(*args, **kwargs)
7683
7684 def Lower(*args, **kwargs):
7685 """
7686 Lower(self)
7687
7688 Lowers the window to the bottom of the window hierarchy. In current
7689 version of wxWidgets this works both for manage and child windows.
7690 """
7691 return _core_.Window_Lower(*args, **kwargs)
7692
7693 def SetClientSize(*args, **kwargs):
7694 """
7695 SetClientSize(self, Size size)
7696
7697 This sets the size of the window client area in pixels. Using this
7698 function to size a window tends to be more device-independent than
7699 wx.Window.SetSize, since the application need not worry about what
7700 dimensions the border or title bar have when trying to fit the window
7701 around panel items, for example.
7702 """
7703 return _core_.Window_SetClientSize(*args, **kwargs)
7704
7705 def SetClientSizeWH(*args, **kwargs):
7706 """
7707 SetClientSizeWH(self, int width, int height)
7708
7709 This sets the size of the window client area in pixels. Using this
7710 function to size a window tends to be more device-independent than
7711 wx.Window.SetSize, since the application need not worry about what
7712 dimensions the border or title bar have when trying to fit the window
7713 around panel items, for example.
7714 """
7715 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7716
7717 def SetClientRect(*args, **kwargs):
7718 """
7719 SetClientRect(self, Rect rect)
7720
7721 This sets the size of the window client area in pixels. Using this
7722 function to size a window tends to be more device-independent than
7723 wx.Window.SetSize, since the application need not worry about what
7724 dimensions the border or title bar have when trying to fit the window
7725 around panel items, for example.
7726 """
7727 return _core_.Window_SetClientRect(*args, **kwargs)
7728
7729 def GetPosition(*args, **kwargs):
7730 """
7731 GetPosition(self) -> Point
7732
7733 Get the window's position. Notice that the position is in client
7734 coordinates for child windows and screen coordinates for the top level
7735 ones, use `GetScreenPosition` if you need screen coordinates for all
7736 kinds of windows.
7737 """
7738 return _core_.Window_GetPosition(*args, **kwargs)
7739
7740 def GetPositionTuple(*args, **kwargs):
7741 """
7742 GetPositionTuple() -> (x,y)
7743
7744 Get the window's position. Notice that the position is in client
7745 coordinates for child windows and screen coordinates for the top level
7746 ones, use `GetScreenPosition` if you need screen coordinates for all
7747 kinds of windows.
7748 """
7749 return _core_.Window_GetPositionTuple(*args, **kwargs)
7750
7751 def GetScreenPosition(*args, **kwargs):
7752 """
7753 GetScreenPosition(self) -> Point
7754
7755 Get the position of the window in screen coordinantes.
7756 """
7757 return _core_.Window_GetScreenPosition(*args, **kwargs)
7758
7759 def GetScreenPositionTuple(*args, **kwargs):
7760 """
7761 GetScreenPositionTuple() -> (x,y)
7762
7763 Get the position of the window in screen coordinantes.
7764 """
7765 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7766
7767 def GetScreenRect(*args, **kwargs):
7768 """
7769 GetScreenRect(self) -> Rect
7770
7771 Returns the size and position of the window in screen coordinantes as
7772 a `wx.Rect` object.
7773 """
7774 return _core_.Window_GetScreenRect(*args, **kwargs)
7775
7776 def GetSize(*args, **kwargs):
7777 """
7778 GetSize(self) -> Size
7779
7780 Get the window size.
7781 """
7782 return _core_.Window_GetSize(*args, **kwargs)
7783
7784 def GetSizeTuple(*args, **kwargs):
7785 """
7786 GetSizeTuple() -> (width, height)
7787
7788 Get the window size.
7789 """
7790 return _core_.Window_GetSizeTuple(*args, **kwargs)
7791
7792 def GetRect(*args, **kwargs):
7793 """
7794 GetRect(self) -> Rect
7795
7796 Returns the size and position of the window as a `wx.Rect` object.
7797 """
7798 return _core_.Window_GetRect(*args, **kwargs)
7799
7800 def GetClientSize(*args, **kwargs):
7801 """
7802 GetClientSize(self) -> Size
7803
7804 This gets the size of the window's 'client area' in pixels. The client
7805 area is the area which may be drawn on by the programmer, excluding
7806 title bar, border, scrollbars, etc.
7807 """
7808 return _core_.Window_GetClientSize(*args, **kwargs)
7809
7810 def GetClientSizeTuple(*args, **kwargs):
7811 """
7812 GetClientSizeTuple() -> (width, height)
7813
7814 This gets the size of the window's 'client area' in pixels. The client
7815 area is the area which may be drawn on by the programmer, excluding
7816 title bar, border, scrollbars, etc.
7817 """
7818 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7819
7820 def GetClientAreaOrigin(*args, **kwargs):
7821 """
7822 GetClientAreaOrigin(self) -> Point
7823
7824 Get the origin of the client area of the window relative to the
7825 window's top left corner (the client area may be shifted because of
7826 the borders, scrollbars, other decorations...)
7827 """
7828 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7829
7830 def GetClientRect(*args, **kwargs):
7831 """
7832 GetClientRect(self) -> Rect
7833
7834 Get the client area position and size as a `wx.Rect` object.
7835 """
7836 return _core_.Window_GetClientRect(*args, **kwargs)
7837
7838 def GetBestSize(*args, **kwargs):
7839 """
7840 GetBestSize(self) -> Size
7841
7842 This function returns the best acceptable minimal size for the
7843 window, if applicable. For example, for a static text control, it will
7844 be the minimal size such that the control label is not truncated. For
7845 windows containing subwindows (suzh aswx.Panel), the size returned by
7846 this function will be the same as the size the window would have had
7847 after calling Fit.
7848 """
7849 return _core_.Window_GetBestSize(*args, **kwargs)
7850
7851 def GetBestSizeTuple(*args, **kwargs):
7852 """
7853 GetBestSizeTuple() -> (width, height)
7854
7855 This function returns the best acceptable minimal size for the
7856 window, if applicable. For example, for a static text control, it will
7857 be the minimal size such that the control label is not truncated. For
7858 windows containing subwindows (suzh aswx.Panel), the size returned by
7859 this function will be the same as the size the window would have had
7860 after calling Fit.
7861 """
7862 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7863
7864 def InvalidateBestSize(*args, **kwargs):
7865 """
7866 InvalidateBestSize(self)
7867
7868 Reset the cached best size value so it will be recalculated the next
7869 time it is needed.
7870 """
7871 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7872
7873 def CacheBestSize(*args, **kwargs):
7874 """
7875 CacheBestSize(self, Size size)
7876
7877 Cache the best size so it doesn't need to be calculated again, (at least until
7878 some properties of the window change.)
7879 """
7880 return _core_.Window_CacheBestSize(*args, **kwargs)
7881
7882 def GetBestFittingSize(*args, **kwargs):
7883 """
7884 GetBestFittingSize(self) -> Size
7885
7886 This function will merge the window's best size into the window's
7887 minimum size, giving priority to the min size components, and returns
7888 the results.
7889
7890 """
7891 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7892
7893 def GetAdjustedBestSize(*args, **kwargs):
7894 """
7895 GetAdjustedBestSize(self) -> Size
7896
7897 This method is similar to GetBestSize, except in one
7898 thing. GetBestSize should return the minimum untruncated size of the
7899 window, while this method will return the largest of BestSize and any
7900 user specified minimum size. ie. it is the minimum size the window
7901 should currently be drawn at, not the minimal size it can possibly
7902 tolerate.
7903 """
7904 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7905
7906 def Center(*args, **kwargs):
7907 """
7908 Center(self, int direction=BOTH)
7909
7910 Centers the window. The parameter specifies the direction for
7911 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7912 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7913 on the entire screen and not on its parent window. If it is a
7914 top-level window and has no parent then it will always be centered
7915 relative to the screen.
7916 """
7917 return _core_.Window_Center(*args, **kwargs)
7918
7919 Centre = Center
7920 def CenterOnParent(*args, **kwargs):
7921 """
7922 CenterOnParent(self, int dir=BOTH)
7923
7924 Center with respect to the the parent window
7925 """
7926 return _core_.Window_CenterOnParent(*args, **kwargs)
7927
7928 CentreOnParent = CenterOnParent
7929 def Fit(*args, **kwargs):
7930 """
7931 Fit(self)
7932
7933 Sizes the window so that it fits around its subwindows. This function
7934 won't do anything if there are no subwindows and will only really work
7935 correctly if sizers are used for the subwindows layout. Also, if the
7936 window has exactly one subwindow it is better (faster and the result
7937 is more precise as Fit adds some margin to account for fuzziness of
7938 its calculations) to call window.SetClientSize(child.GetSize())
7939 instead of calling Fit.
7940 """
7941 return _core_.Window_Fit(*args, **kwargs)
7942
7943 def FitInside(*args, **kwargs):
7944 """
7945 FitInside(self)
7946
7947 Similar to Fit, but sizes the interior (virtual) size of a
7948 window. Mainly useful with scrolled windows to reset scrollbars after
7949 sizing changes that do not trigger a size event, and/or scrolled
7950 windows without an interior sizer. This function similarly won't do
7951 anything if there are no subwindows.
7952 """
7953 return _core_.Window_FitInside(*args, **kwargs)
7954
7955 def SetSizeHints(*args, **kwargs):
7956 """
7957 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7958 int incH=-1)
7959
7960 Allows specification of minimum and maximum window sizes, and window
7961 size increments. If a pair of values is not set (or set to -1), the
7962 default values will be used. If this function is called, the user
7963 will not be able to size the window outside the given bounds (if it is
7964 a top-level window.) Sizers will also inspect the minimum window size
7965 and will use that value if set when calculating layout.
7966
7967 The resizing increments are only significant under Motif or Xt.
7968 """
7969 return _core_.Window_SetSizeHints(*args, **kwargs)
7970
7971 def SetSizeHintsSz(*args, **kwargs):
7972 """
7973 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7974
7975 Allows specification of minimum and maximum window sizes, and window
7976 size increments. If a pair of values is not set (or set to -1), the
7977 default values will be used. If this function is called, the user
7978 will not be able to size the window outside the given bounds (if it is
7979 a top-level window.) Sizers will also inspect the minimum window size
7980 and will use that value if set when calculating layout.
7981
7982 The resizing increments are only significant under Motif or Xt.
7983 """
7984 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7985
7986 def SetVirtualSizeHints(*args, **kwargs):
7987 """
7988 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7989
7990 Allows specification of minimum and maximum virtual window sizes. If a
7991 pair of values is not set (or set to -1), the default values will be
7992 used. If this function is called, the user will not be able to size
7993 the virtual area of the window outside the given bounds.
7994 """
7995 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7996
7997 def SetVirtualSizeHintsSz(*args, **kwargs):
7998 """
7999 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8000
8001 Allows specification of minimum and maximum virtual window sizes. If a
8002 pair of values is not set (or set to -1), the default values will be
8003 used. If this function is called, the user will not be able to size
8004 the virtual area of the window outside the given bounds.
8005 """
8006 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8007
8008 def GetMaxSize(*args, **kwargs):
8009 """GetMaxSize(self) -> Size"""
8010 return _core_.Window_GetMaxSize(*args, **kwargs)
8011
8012 def GetMinSize(*args, **kwargs):
8013 """GetMinSize(self) -> Size"""
8014 return _core_.Window_GetMinSize(*args, **kwargs)
8015
8016 def SetMinSize(*args, **kwargs):
8017 """
8018 SetMinSize(self, Size minSize)
8019
8020 A more convenient method than `SetSizeHints` for setting just the
8021 min size.
8022 """
8023 return _core_.Window_SetMinSize(*args, **kwargs)
8024
8025 def SetMaxSize(*args, **kwargs):
8026 """
8027 SetMaxSize(self, Size maxSize)
8028
8029 A more convenient method than `SetSizeHints` for setting just the
8030 max size.
8031 """
8032 return _core_.Window_SetMaxSize(*args, **kwargs)
8033
8034 def GetMinWidth(*args, **kwargs):
8035 """GetMinWidth(self) -> int"""
8036 return _core_.Window_GetMinWidth(*args, **kwargs)
8037
8038 def GetMinHeight(*args, **kwargs):
8039 """GetMinHeight(self) -> int"""
8040 return _core_.Window_GetMinHeight(*args, **kwargs)
8041
8042 def GetMaxWidth(*args, **kwargs):
8043 """GetMaxWidth(self) -> int"""
8044 return _core_.Window_GetMaxWidth(*args, **kwargs)
8045
8046 def GetMaxHeight(*args, **kwargs):
8047 """GetMaxHeight(self) -> int"""
8048 return _core_.Window_GetMaxHeight(*args, **kwargs)
8049
8050 def SetVirtualSize(*args, **kwargs):
8051 """
8052 SetVirtualSize(self, Size size)
8053
8054 Set the the virtual size of a window in pixels. For most windows this
8055 is just the client area of the window, but for some like scrolled
8056 windows it is more or less independent of the screen window size.
8057 """
8058 return _core_.Window_SetVirtualSize(*args, **kwargs)
8059
8060 def SetVirtualSizeWH(*args, **kwargs):
8061 """
8062 SetVirtualSizeWH(self, int w, int h)
8063
8064 Set the the virtual size of a window in pixels. For most windows this
8065 is just the client area of the window, but for some like scrolled
8066 windows it is more or less independent of the screen window size.
8067 """
8068 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8069
8070 def GetVirtualSize(*args, **kwargs):
8071 """
8072 GetVirtualSize(self) -> Size
8073
8074 Get the the virtual size of the window in pixels. For most windows
8075 this is just the client area of the window, but for some like scrolled
8076 windows it is more or less independent of the screen window size.
8077 """
8078 return _core_.Window_GetVirtualSize(*args, **kwargs)
8079
8080 def GetVirtualSizeTuple(*args, **kwargs):
8081 """
8082 GetVirtualSizeTuple() -> (width, height)
8083
8084 Get the the virtual size of the window in pixels. For most windows
8085 this is just the client area of the window, but for some like scrolled
8086 windows it is more or less independent of the screen window size.
8087 """
8088 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8089
8090 def GetBestVirtualSize(*args, **kwargs):
8091 """
8092 GetBestVirtualSize(self) -> Size
8093
8094 Return the largest of ClientSize and BestSize (as determined by a
8095 sizer, interior children, or other means)
8096 """
8097 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8098
8099 def Show(*args, **kwargs):
8100 """
8101 Show(self, bool show=True) -> bool
8102
8103 Shows or hides the window. You may need to call Raise for a top level
8104 window if you want to bring it to top, although this is not needed if
8105 Show is called immediately after the frame creation. Returns True if
8106 the window has been shown or hidden or False if nothing was done
8107 because it already was in the requested state.
8108 """
8109 return _core_.Window_Show(*args, **kwargs)
8110
8111 def Hide(*args, **kwargs):
8112 """
8113 Hide(self) -> bool
8114
8115 Equivalent to calling Show(False).
8116 """
8117 return _core_.Window_Hide(*args, **kwargs)
8118
8119 def Enable(*args, **kwargs):
8120 """
8121 Enable(self, bool enable=True) -> bool
8122
8123 Enable or disable the window for user input. Note that when a parent
8124 window is disabled, all of its children are disabled as well and they
8125 are reenabled again when the parent is. Returns true if the window
8126 has been enabled or disabled, false if nothing was done, i.e. if the
8127 window had already been in the specified state.
8128 """
8129 return _core_.Window_Enable(*args, **kwargs)
8130
8131 def Disable(*args, **kwargs):
8132 """
8133 Disable(self) -> bool
8134
8135 Disables the window, same as Enable(false).
8136 """
8137 return _core_.Window_Disable(*args, **kwargs)
8138
8139 def IsShown(*args, **kwargs):
8140 """
8141 IsShown(self) -> bool
8142
8143 Returns true if the window is shown, false if it has been hidden.
8144 """
8145 return _core_.Window_IsShown(*args, **kwargs)
8146
8147 def IsEnabled(*args, **kwargs):
8148 """
8149 IsEnabled(self) -> bool
8150
8151 Returns true if the window is enabled for input, false otherwise.
8152 """
8153 return _core_.Window_IsEnabled(*args, **kwargs)
8154
8155 def SetWindowStyleFlag(*args, **kwargs):
8156 """
8157 SetWindowStyleFlag(self, long style)
8158
8159 Sets the style of the window. Please note that some styles cannot be
8160 changed after the window creation and that Refresh() might need to be
8161 called after changing the others for the change to take place
8162 immediately.
8163 """
8164 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8165
8166 def GetWindowStyleFlag(*args, **kwargs):
8167 """
8168 GetWindowStyleFlag(self) -> long
8169
8170 Gets the window style that was passed to the constructor or Create
8171 method.
8172 """
8173 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8174
8175 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8176 def HasFlag(*args, **kwargs):
8177 """
8178 HasFlag(self, int flag) -> bool
8179
8180 Test if the given style is set for this window.
8181 """
8182 return _core_.Window_HasFlag(*args, **kwargs)
8183
8184 def IsRetained(*args, **kwargs):
8185 """
8186 IsRetained(self) -> bool
8187
8188 Returns true if the window is retained, false otherwise. Retained
8189 windows are only available on X platforms.
8190 """
8191 return _core_.Window_IsRetained(*args, **kwargs)
8192
8193 def SetExtraStyle(*args, **kwargs):
8194 """
8195 SetExtraStyle(self, long exStyle)
8196
8197 Sets the extra style bits for the window. Extra styles are the less
8198 often used style bits which can't be set with the constructor or with
8199 SetWindowStyleFlag()
8200 """
8201 return _core_.Window_SetExtraStyle(*args, **kwargs)
8202
8203 def GetExtraStyle(*args, **kwargs):
8204 """
8205 GetExtraStyle(self) -> long
8206
8207 Returns the extra style bits for the window.
8208 """
8209 return _core_.Window_GetExtraStyle(*args, **kwargs)
8210
8211 def MakeModal(*args, **kwargs):
8212 """
8213 MakeModal(self, bool modal=True)
8214
8215 Disables all other windows in the application so that the user can
8216 only interact with this window. Passing False will reverse this
8217 effect.
8218 """
8219 return _core_.Window_MakeModal(*args, **kwargs)
8220
8221 def SetThemeEnabled(*args, **kwargs):
8222 """
8223 SetThemeEnabled(self, bool enableTheme)
8224
8225 This function tells a window if it should use the system's "theme"
8226 code to draw the windows' background instead if its own background
8227 drawing code. This will only have an effect on platforms that support
8228 the notion of themes in user defined windows. One such platform is
8229 GTK+ where windows can have (very colourful) backgrounds defined by a
8230 user's selected theme.
8231
8232 Dialogs, notebook pages and the status bar have this flag set to true
8233 by default so that the default look and feel is simulated best.
8234 """
8235 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8236
8237 def GetThemeEnabled(*args, **kwargs):
8238 """
8239 GetThemeEnabled(self) -> bool
8240
8241 Return the themeEnabled flag.
8242 """
8243 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8244
8245 def SetFocus(*args, **kwargs):
8246 """
8247 SetFocus(self)
8248
8249 Set's the focus to this window, allowing it to receive keyboard input.
8250 """
8251 return _core_.Window_SetFocus(*args, **kwargs)
8252
8253 def SetFocusFromKbd(*args, **kwargs):
8254 """
8255 SetFocusFromKbd(self)
8256
8257 Set focus to this window as the result of a keyboard action. Normally
8258 only called internally.
8259 """
8260 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8261
8262 def FindFocus(*args, **kwargs):
8263 """
8264 FindFocus() -> Window
8265
8266 Returns the window or control that currently has the keyboard focus,
8267 or None.
8268 """
8269 return _core_.Window_FindFocus(*args, **kwargs)
8270
8271 FindFocus = staticmethod(FindFocus)
8272 def AcceptsFocus(*args, **kwargs):
8273 """
8274 AcceptsFocus(self) -> bool
8275
8276 Can this window have focus?
8277 """
8278 return _core_.Window_AcceptsFocus(*args, **kwargs)
8279
8280 def AcceptsFocusFromKeyboard(*args, **kwargs):
8281 """
8282 AcceptsFocusFromKeyboard(self) -> bool
8283
8284 Can this window be given focus by keyboard navigation? if not, the
8285 only way to give it focus (provided it accepts it at all) is to click
8286 it.
8287 """
8288 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8289
8290 def Navigate(*args, **kwargs):
8291 """
8292 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8293
8294 Does keyboard navigation from this window to another, by sending a
8295 `wx.NavigationKeyEvent`.
8296 """
8297 return _core_.Window_Navigate(*args, **kwargs)
8298
8299 def MoveAfterInTabOrder(*args, **kwargs):
8300 """
8301 MoveAfterInTabOrder(self, Window win)
8302
8303 Moves this window in the tab navigation order after the specified
8304 sibling window. This means that when the user presses the TAB key on
8305 that other window, the focus switches to this window.
8306
8307 The default tab order is the same as creation order. This function
8308 and `MoveBeforeInTabOrder` allow to change it after creating all the
8309 windows.
8310
8311 """
8312 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8313
8314 def MoveBeforeInTabOrder(*args, **kwargs):
8315 """
8316 MoveBeforeInTabOrder(self, Window win)
8317
8318 Same as `MoveAfterInTabOrder` except that it inserts this window just
8319 before win instead of putting it right after it.
8320 """
8321 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8322
8323 def GetChildren(*args, **kwargs):
8324 """
8325 GetChildren(self) -> PyObject
8326
8327 Returns a list of the window's children. NOTE: Currently this is a
8328 copy of the child window list maintained by the window, so the return
8329 value of this function is only valid as long as the window's children
8330 do not change.
8331 """
8332 return _core_.Window_GetChildren(*args, **kwargs)
8333
8334 def GetParent(*args, **kwargs):
8335 """
8336 GetParent(self) -> Window
8337
8338 Returns the parent window of this window, or None if there isn't one.
8339 """
8340 return _core_.Window_GetParent(*args, **kwargs)
8341
8342 def GetGrandParent(*args, **kwargs):
8343 """
8344 GetGrandParent(self) -> Window
8345
8346 Returns the parent of the parent of this window, or None if there
8347 isn't one.
8348 """
8349 return _core_.Window_GetGrandParent(*args, **kwargs)
8350
8351 def IsTopLevel(*args, **kwargs):
8352 """
8353 IsTopLevel(self) -> bool
8354
8355 Returns true if the given window is a top-level one. Currently all
8356 frames and dialogs are always considered to be top-level windows (even
8357 if they have a parent window).
8358 """
8359 return _core_.Window_IsTopLevel(*args, **kwargs)
8360
8361 def Reparent(*args, **kwargs):
8362 """
8363 Reparent(self, Window newParent) -> bool
8364
8365 Reparents the window, i.e the window will be removed from its current
8366 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8367 re-inserted into another. Available on Windows and GTK. Returns True
8368 if the parent was changed, False otherwise (error or newParent ==
8369 oldParent)
8370 """
8371 return _core_.Window_Reparent(*args, **kwargs)
8372
8373 def AddChild(*args, **kwargs):
8374 """
8375 AddChild(self, Window child)
8376
8377 Adds a child window. This is called automatically by window creation
8378 functions so should not be required by the application programmer.
8379 """
8380 return _core_.Window_AddChild(*args, **kwargs)
8381
8382 def RemoveChild(*args, **kwargs):
8383 """
8384 RemoveChild(self, Window child)
8385
8386 Removes a child window. This is called automatically by window
8387 deletion functions so should not be required by the application
8388 programmer.
8389 """
8390 return _core_.Window_RemoveChild(*args, **kwargs)
8391
8392 def SetDoubleBuffered(*args, **kwargs):
8393 """
8394 SetDoubleBuffered(self, bool on)
8395
8396 Currently wxGTK2 only.
8397 """
8398 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8399
8400 def FindWindowById(*args, **kwargs):
8401 """
8402 FindWindowById(self, long winid) -> Window
8403
8404 Find a chld of this window by window ID
8405 """
8406 return _core_.Window_FindWindowById(*args, **kwargs)
8407
8408 def FindWindowByName(*args, **kwargs):
8409 """
8410 FindWindowByName(self, String name) -> Window
8411
8412 Find a child of this window by name
8413 """
8414 return _core_.Window_FindWindowByName(*args, **kwargs)
8415
8416 def GetEventHandler(*args, **kwargs):
8417 """
8418 GetEventHandler(self) -> EvtHandler
8419
8420 Returns the event handler for this window. By default, the window is
8421 its own event handler.
8422 """
8423 return _core_.Window_GetEventHandler(*args, **kwargs)
8424
8425 def SetEventHandler(*args, **kwargs):
8426 """
8427 SetEventHandler(self, EvtHandler handler)
8428
8429 Sets the event handler for this window. An event handler is an object
8430 that is capable of processing the events sent to a window. By default,
8431 the window is its own event handler, but an application may wish to
8432 substitute another, for example to allow central implementation of
8433 event-handling for a variety of different window classes.
8434
8435 It is usually better to use `wx.Window.PushEventHandler` since this sets
8436 up a chain of event handlers, where an event not handled by one event
8437 handler is handed to the next one in the chain.
8438 """
8439 return _core_.Window_SetEventHandler(*args, **kwargs)
8440
8441 def PushEventHandler(*args, **kwargs):
8442 """
8443 PushEventHandler(self, EvtHandler handler)
8444
8445 Pushes this event handler onto the event handler stack for the window.
8446 An event handler is an object that is capable of processing the events
8447 sent to a window. By default, the window is its own event handler, but
8448 an application may wish to substitute another, for example to allow
8449 central implementation of event-handling for a variety of different
8450 window classes.
8451
8452 wx.Window.PushEventHandler allows an application to set up a chain of
8453 event handlers, where an event not handled by one event handler is
8454 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8455 remove the event handler.
8456 """
8457 return _core_.Window_PushEventHandler(*args, **kwargs)
8458
8459 def PopEventHandler(*args, **kwargs):
8460 """
8461 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8462
8463 Removes and returns the top-most event handler on the event handler
8464 stack. If deleteHandler is True then the wx.EvtHandler object will be
8465 destroyed after it is popped.
8466 """
8467 return _core_.Window_PopEventHandler(*args, **kwargs)
8468
8469 def RemoveEventHandler(*args, **kwargs):
8470 """
8471 RemoveEventHandler(self, EvtHandler handler) -> bool
8472
8473 Find the given handler in the event handler chain and remove (but not
8474 delete) it from the event handler chain, return True if it was found
8475 and False otherwise (this also results in an assert failure so this
8476 function should only be called when the handler is supposed to be
8477 there.)
8478 """
8479 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8480
8481 def SetValidator(*args, **kwargs):
8482 """
8483 SetValidator(self, Validator validator)
8484
8485 Deletes the current validator (if any) and sets the window validator,
8486 having called wx.Validator.Clone to create a new validator of this
8487 type.
8488 """
8489 return _core_.Window_SetValidator(*args, **kwargs)
8490
8491 def GetValidator(*args, **kwargs):
8492 """
8493 GetValidator(self) -> Validator
8494
8495 Returns a pointer to the current validator for the window, or None if
8496 there is none.
8497 """
8498 return _core_.Window_GetValidator(*args, **kwargs)
8499
8500 def Validate(*args, **kwargs):
8501 """
8502 Validate(self) -> bool
8503
8504 Validates the current values of the child controls using their
8505 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8506 style flag set, the method will also call Validate() of all child
8507 windows. Returns false if any of the validations failed.
8508 """
8509 return _core_.Window_Validate(*args, **kwargs)
8510
8511 def TransferDataToWindow(*args, **kwargs):
8512 """
8513 TransferDataToWindow(self) -> bool
8514
8515 Transfers values to child controls from data areas specified by their
8516 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8517 style flag set, the method will also call TransferDataToWindow() of
8518 all child windows.
8519 """
8520 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8521
8522 def TransferDataFromWindow(*args, **kwargs):
8523 """
8524 TransferDataFromWindow(self) -> bool
8525
8526 Transfers values from child controls to data areas specified by their
8527 validators. Returns false if a transfer failed. If the window has
8528 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8529 also call TransferDataFromWindow() of all child windows.
8530 """
8531 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8532
8533 def InitDialog(*args, **kwargs):
8534 """
8535 InitDialog(self)
8536
8537 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8538 to the dialog via validators.
8539 """
8540 return _core_.Window_InitDialog(*args, **kwargs)
8541
8542 def SetAcceleratorTable(*args, **kwargs):
8543 """
8544 SetAcceleratorTable(self, AcceleratorTable accel)
8545
8546 Sets the accelerator table for this window.
8547 """
8548 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8549
8550 def GetAcceleratorTable(*args, **kwargs):
8551 """
8552 GetAcceleratorTable(self) -> AcceleratorTable
8553
8554 Gets the accelerator table for this window.
8555 """
8556 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8557
8558 def RegisterHotKey(*args, **kwargs):
8559 """
8560 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8561
8562 Registers a system wide hotkey. Every time the user presses the hotkey
8563 registered here, this window will receive a hotkey event. It will
8564 receive the event even if the application is in the background and
8565 does not have the input focus because the user is working with some
8566 other application. To bind an event handler function to this hotkey
8567 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8568 hotkey was registered successfully.
8569 """
8570 return _core_.Window_RegisterHotKey(*args, **kwargs)
8571
8572 def UnregisterHotKey(*args, **kwargs):
8573 """
8574 UnregisterHotKey(self, int hotkeyId) -> bool
8575
8576 Unregisters a system wide hotkey.
8577 """
8578 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8579
8580 def ConvertDialogPointToPixels(*args, **kwargs):
8581 """
8582 ConvertDialogPointToPixels(self, Point pt) -> Point
8583
8584 Converts a point or size from dialog units to pixels. Dialog units
8585 are used for maintaining a dialog's proportions even if the font
8586 changes. For the x dimension, the dialog units are multiplied by the
8587 average character width and then divided by 4. For the y dimension,
8588 the dialog units are multiplied by the average character height and
8589 then divided by 8.
8590 """
8591 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8592
8593 def ConvertDialogSizeToPixels(*args, **kwargs):
8594 """
8595 ConvertDialogSizeToPixels(self, Size sz) -> Size
8596
8597 Converts a point or size from dialog units to pixels. Dialog units
8598 are used for maintaining a dialog's proportions even if the font
8599 changes. For the x dimension, the dialog units are multiplied by the
8600 average character width and then divided by 4. For the y dimension,
8601 the dialog units are multiplied by the average character height and
8602 then divided by 8.
8603 """
8604 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8605
8606 def DLG_PNT(*args, **kwargs):
8607 """
8608 DLG_PNT(self, Point pt) -> Point
8609
8610 Converts a point or size from dialog units to pixels. Dialog units
8611 are used for maintaining a dialog's proportions even if the font
8612 changes. For the x dimension, the dialog units are multiplied by the
8613 average character width and then divided by 4. For the y dimension,
8614 the dialog units are multiplied by the average character height and
8615 then divided by 8.
8616 """
8617 return _core_.Window_DLG_PNT(*args, **kwargs)
8618
8619 def DLG_SZE(*args, **kwargs):
8620 """
8621 DLG_SZE(self, Size sz) -> Size
8622
8623 Converts a point or size from dialog units to pixels. Dialog units
8624 are used for maintaining a dialog's proportions even if the font
8625 changes. For the x dimension, the dialog units are multiplied by the
8626 average character width and then divided by 4. For the y dimension,
8627 the dialog units are multiplied by the average character height and
8628 then divided by 8.
8629 """
8630 return _core_.Window_DLG_SZE(*args, **kwargs)
8631
8632 def ConvertPixelPointToDialog(*args, **kwargs):
8633 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8634 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8635
8636 def ConvertPixelSizeToDialog(*args, **kwargs):
8637 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8638 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8639
8640 def WarpPointer(*args, **kwargs):
8641 """
8642 WarpPointer(self, int x, int y)
8643
8644 Moves the pointer to the given position on the window.
8645
8646 NOTE: This function is not supported under Mac because Apple Human
8647 Interface Guidelines forbid moving the mouse cursor programmatically.
8648 """
8649 return _core_.Window_WarpPointer(*args, **kwargs)
8650
8651 def CaptureMouse(*args, **kwargs):
8652 """
8653 CaptureMouse(self)
8654
8655 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8656 release the capture.
8657
8658 Note that wxWindows maintains the stack of windows having captured the
8659 mouse and when the mouse is released the capture returns to the window
8660 which had had captured it previously and it is only really released if
8661 there were no previous window. In particular, this means that you must
8662 release the mouse as many times as you capture it.
8663 """
8664 return _core_.Window_CaptureMouse(*args, **kwargs)
8665
8666 def ReleaseMouse(*args, **kwargs):
8667 """
8668 ReleaseMouse(self)
8669
8670 Releases mouse input captured with wx.Window.CaptureMouse.
8671 """
8672 return _core_.Window_ReleaseMouse(*args, **kwargs)
8673
8674 def GetCapture(*args, **kwargs):
8675 """
8676 GetCapture() -> Window
8677
8678 Returns the window which currently captures the mouse or None
8679 """
8680 return _core_.Window_GetCapture(*args, **kwargs)
8681
8682 GetCapture = staticmethod(GetCapture)
8683 def HasCapture(*args, **kwargs):
8684 """
8685 HasCapture(self) -> bool
8686
8687 Returns true if this window has the current mouse capture.
8688 """
8689 return _core_.Window_HasCapture(*args, **kwargs)
8690
8691 def Refresh(*args, **kwargs):
8692 """
8693 Refresh(self, bool eraseBackground=True, Rect rect=None)
8694
8695 Mark the specified rectangle (or the whole window) as "dirty" so it
8696 will be repainted. Causes an EVT_PAINT event to be generated and sent
8697 to the window.
8698 """
8699 return _core_.Window_Refresh(*args, **kwargs)
8700
8701 def RefreshRect(*args, **kwargs):
8702 """
8703 RefreshRect(self, Rect rect, bool eraseBackground=True)
8704
8705 Redraws the contents of the given rectangle: the area inside it will
8706 be repainted. This is the same as Refresh but has a nicer syntax.
8707 """
8708 return _core_.Window_RefreshRect(*args, **kwargs)
8709
8710 def Update(*args, **kwargs):
8711 """
8712 Update(self)
8713
8714 Calling this method immediately repaints the invalidated area of the
8715 window instead of waiting for the EVT_PAINT event to happen, (normally
8716 this would usually only happen when the flow of control returns to the
8717 event loop.) Notice that this function doesn't refresh the window and
8718 does nothing if the window has been already repainted. Use Refresh
8719 first if you want to immediately redraw the window (or some portion of
8720 it) unconditionally.
8721 """
8722 return _core_.Window_Update(*args, **kwargs)
8723
8724 def ClearBackground(*args, **kwargs):
8725 """
8726 ClearBackground(self)
8727
8728 Clears the window by filling it with the current background
8729 colour. Does not cause an erase background event to be generated.
8730 """
8731 return _core_.Window_ClearBackground(*args, **kwargs)
8732
8733 def Freeze(*args, **kwargs):
8734 """
8735 Freeze(self)
8736
8737 Freezes the window or, in other words, prevents any updates from
8738 taking place on screen, the window is not redrawn at all. Thaw must be
8739 called to reenable window redrawing. Calls to Freeze/Thaw may be
8740 nested, with the actual Thaw being delayed until all the nesting has
8741 been undone.
8742
8743 This method is useful for visual appearance optimization (for example,
8744 it is a good idea to use it before inserting large amount of text into
8745 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8746 for all controls so it is mostly just a hint to wxWindows and not a
8747 mandatory directive.
8748 """
8749 return _core_.Window_Freeze(*args, **kwargs)
8750
8751 def Thaw(*args, **kwargs):
8752 """
8753 Thaw(self)
8754
8755 Reenables window updating after a previous call to Freeze. Calls to
8756 Freeze/Thaw may be nested, so Thaw must be called the same number of
8757 times that Freeze was before the window will be updated.
8758 """
8759 return _core_.Window_Thaw(*args, **kwargs)
8760
8761 def PrepareDC(*args, **kwargs):
8762 """
8763 PrepareDC(self, DC dc)
8764
8765 Call this function to prepare the device context for drawing a
8766 scrolled image. It sets the device origin according to the current
8767 scroll position.
8768 """
8769 return _core_.Window_PrepareDC(*args, **kwargs)
8770
8771 def GetUpdateRegion(*args, **kwargs):
8772 """
8773 GetUpdateRegion(self) -> Region
8774
8775 Returns the region specifying which parts of the window have been
8776 damaged. Should only be called within an EVT_PAINT handler.
8777 """
8778 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8779
8780 def GetUpdateClientRect(*args, **kwargs):
8781 """
8782 GetUpdateClientRect(self) -> Rect
8783
8784 Get the update rectangle region bounding box in client coords.
8785 """
8786 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8787
8788 def IsExposed(*args, **kwargs):
8789 """
8790 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8791
8792 Returns true if the given point or rectangle area has been exposed
8793 since the last repaint. Call this in an paint event handler to
8794 optimize redrawing by only redrawing those areas, which have been
8795 exposed.
8796 """
8797 return _core_.Window_IsExposed(*args, **kwargs)
8798
8799 def IsExposedPoint(*args, **kwargs):
8800 """
8801 IsExposedPoint(self, Point pt) -> bool
8802
8803 Returns true if the given point or rectangle area has been exposed
8804 since the last repaint. Call this in an paint event handler to
8805 optimize redrawing by only redrawing those areas, which have been
8806 exposed.
8807 """
8808 return _core_.Window_IsExposedPoint(*args, **kwargs)
8809
8810 def IsExposedRect(*args, **kwargs):
8811 """
8812 IsExposedRect(self, Rect rect) -> bool
8813
8814 Returns true if the given point or rectangle area has been exposed
8815 since the last repaint. Call this in an paint event handler to
8816 optimize redrawing by only redrawing those areas, which have been
8817 exposed.
8818 """
8819 return _core_.Window_IsExposedRect(*args, **kwargs)
8820
8821 def GetDefaultAttributes(*args, **kwargs):
8822 """
8823 GetDefaultAttributes(self) -> VisualAttributes
8824
8825 Get the default attributes for an instance of this class. This is
8826 useful if you want to use the same font or colour in your own control
8827 as in a standard control -- which is a much better idea than hard
8828 coding specific colours or fonts which might look completely out of
8829 place on the user's system, especially if it uses themes.
8830 """
8831 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8832
8833 def GetClassDefaultAttributes(*args, **kwargs):
8834 """
8835 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8836
8837 Get the default attributes for this class. This is useful if you want
8838 to use the same font or colour in your own control as in a standard
8839 control -- which is a much better idea than hard coding specific
8840 colours or fonts which might look completely out of place on the
8841 user's system, especially if it uses themes.
8842
8843 The variant parameter is only relevant under Mac currently and is
8844 ignore under other platforms. Under Mac, it will change the size of
8845 the returned font. See `wx.Window.SetWindowVariant` for more about
8846 this.
8847 """
8848 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8849
8850 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8851 def SetBackgroundColour(*args, **kwargs):
8852 """
8853 SetBackgroundColour(self, Colour colour) -> bool
8854
8855 Sets the background colour of the window. Returns True if the colour
8856 was changed. The background colour is usually painted by the default
8857 EVT_ERASE_BACKGROUND event handler function under Windows and
8858 automatically under GTK. Using `wx.NullColour` will reset the window
8859 to the default background colour.
8860
8861 Note that setting the background colour may not cause an immediate
8862 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8863 calling this function.
8864
8865 Using this function will disable attempts to use themes for this
8866 window, if the system supports them. Use with care since usually the
8867 themes represent the appearance chosen by the user to be used for all
8868 applications on the system.
8869 """
8870 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8871
8872 def SetOwnBackgroundColour(*args, **kwargs):
8873 """SetOwnBackgroundColour(self, Colour colour)"""
8874 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8875
8876 def SetForegroundColour(*args, **kwargs):
8877 """
8878 SetForegroundColour(self, Colour colour) -> bool
8879
8880 Sets the foreground colour of the window. Returns True is the colour
8881 was changed. The interpretation of foreground colour is dependent on
8882 the window class; it may be the text colour or other colour, or it may
8883 not be used at all.
8884 """
8885 return _core_.Window_SetForegroundColour(*args, **kwargs)
8886
8887 def SetOwnForegroundColour(*args, **kwargs):
8888 """SetOwnForegroundColour(self, Colour colour)"""
8889 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8890
8891 def GetBackgroundColour(*args, **kwargs):
8892 """
8893 GetBackgroundColour(self) -> Colour
8894
8895 Returns the background colour of the window.
8896 """
8897 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8898
8899 def GetForegroundColour(*args, **kwargs):
8900 """
8901 GetForegroundColour(self) -> Colour
8902
8903 Returns the foreground colour of the window. The interpretation of
8904 foreground colour is dependent on the window class; it may be the text
8905 colour or other colour, or it may not be used at all.
8906 """
8907 return _core_.Window_GetForegroundColour(*args, **kwargs)
8908
8909 def InheritsBackgroundColour(*args, **kwargs):
8910 """InheritsBackgroundColour(self) -> bool"""
8911 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8912
8913 def UseBgCol(*args, **kwargs):
8914 """UseBgCol(self) -> bool"""
8915 return _core_.Window_UseBgCol(*args, **kwargs)
8916
8917 def SetBackgroundStyle(*args, **kwargs):
8918 """
8919 SetBackgroundStyle(self, int style) -> bool
8920
8921 Returns the background style of the window. The background style
8922 indicates how the background of the window is drawn.
8923
8924 ====================== ========================================
8925 wx.BG_STYLE_SYSTEM The background colour or pattern should
8926 be determined by the system
8927 wx.BG_STYLE_COLOUR The background should be a solid colour
8928 wx.BG_STYLE_CUSTOM The background will be implemented by the
8929 application.
8930 ====================== ========================================
8931
8932 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8933 a custom background, such as a tiled bitmap. Currently the style has
8934 no effect on other platforms.
8935
8936 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8937 """
8938 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8939
8940 def GetBackgroundStyle(*args, **kwargs):
8941 """
8942 GetBackgroundStyle(self) -> int
8943
8944 Returns the background style of the window.
8945
8946 :see: `SetBackgroundStyle`
8947 """
8948 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8949
8950 def HasTransparentBackground(*args, **kwargs):
8951 """
8952 HasTransparentBackground(self) -> bool
8953
8954 Returns True if this window's background is transparent (as, for
8955 example, for `wx.StaticText`) and should show the parent window's
8956 background.
8957
8958 This method is mostly used internally by the library itself and you
8959 normally shouldn't have to call it. You may, however, have to override
8960 it in your custom control classes to ensure that background is painted
8961 correctly.
8962 """
8963 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8964
8965 def SetCursor(*args, **kwargs):
8966 """
8967 SetCursor(self, Cursor cursor) -> bool
8968
8969 Sets the window's cursor. Notice that the window cursor also sets it
8970 for the children of the window implicitly.
8971
8972 The cursor may be wx.NullCursor in which case the window cursor will
8973 be reset back to default.
8974 """
8975 return _core_.Window_SetCursor(*args, **kwargs)
8976
8977 def GetCursor(*args, **kwargs):
8978 """
8979 GetCursor(self) -> Cursor
8980
8981 Return the cursor associated with this window.
8982 """
8983 return _core_.Window_GetCursor(*args, **kwargs)
8984
8985 def SetFont(*args, **kwargs):
8986 """
8987 SetFont(self, Font font) -> bool
8988
8989 Sets the font for this window.
8990 """
8991 return _core_.Window_SetFont(*args, **kwargs)
8992
8993 def SetOwnFont(*args, **kwargs):
8994 """SetOwnFont(self, Font font)"""
8995 return _core_.Window_SetOwnFont(*args, **kwargs)
8996
8997 def GetFont(*args, **kwargs):
8998 """
8999 GetFont(self) -> Font
9000
9001 Returns the default font used for this window.
9002 """
9003 return _core_.Window_GetFont(*args, **kwargs)
9004
9005 def SetCaret(*args, **kwargs):
9006 """
9007 SetCaret(self, Caret caret)
9008
9009 Sets the caret associated with the window.
9010 """
9011 return _core_.Window_SetCaret(*args, **kwargs)
9012
9013 def GetCaret(*args, **kwargs):
9014 """
9015 GetCaret(self) -> Caret
9016
9017 Returns the caret associated with the window.
9018 """
9019 return _core_.Window_GetCaret(*args, **kwargs)
9020
9021 def GetCharHeight(*args, **kwargs):
9022 """
9023 GetCharHeight(self) -> int
9024
9025 Get the (average) character size for the current font.
9026 """
9027 return _core_.Window_GetCharHeight(*args, **kwargs)
9028
9029 def GetCharWidth(*args, **kwargs):
9030 """
9031 GetCharWidth(self) -> int
9032
9033 Get the (average) character size for the current font.
9034 """
9035 return _core_.Window_GetCharWidth(*args, **kwargs)
9036
9037 def GetTextExtent(*args, **kwargs):
9038 """
9039 GetTextExtent(String string) -> (width, height)
9040
9041 Get the width and height of the text using the current font.
9042 """
9043 return _core_.Window_GetTextExtent(*args, **kwargs)
9044
9045 def GetFullTextExtent(*args, **kwargs):
9046 """
9047 GetFullTextExtent(String string, Font font=None) ->
9048 (width, height, descent, externalLeading)
9049
9050 Get the width, height, decent and leading of the text using the
9051 current or specified font.
9052 """
9053 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9054
9055 def ClientToScreenXY(*args, **kwargs):
9056 """
9057 ClientToScreenXY(int x, int y) -> (x,y)
9058
9059 Converts to screen coordinates from coordinates relative to this window.
9060 """
9061 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9062
9063 def ScreenToClientXY(*args, **kwargs):
9064 """
9065 ScreenToClientXY(int x, int y) -> (x,y)
9066
9067 Converts from screen to client window coordinates.
9068 """
9069 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9070
9071 def ClientToScreen(*args, **kwargs):
9072 """
9073 ClientToScreen(self, Point pt) -> Point
9074
9075 Converts to screen coordinates from coordinates relative to this window.
9076 """
9077 return _core_.Window_ClientToScreen(*args, **kwargs)
9078
9079 def ScreenToClient(*args, **kwargs):
9080 """
9081 ScreenToClient(self, Point pt) -> Point
9082
9083 Converts from screen to client window coordinates.
9084 """
9085 return _core_.Window_ScreenToClient(*args, **kwargs)
9086
9087 def HitTestXY(*args, **kwargs):
9088 """
9089 HitTestXY(self, int x, int y) -> int
9090
9091 Test where the given (in client coords) point lies
9092 """
9093 return _core_.Window_HitTestXY(*args, **kwargs)
9094
9095 def HitTest(*args, **kwargs):
9096 """
9097 HitTest(self, Point pt) -> int
9098
9099 Test where the given (in client coords) point lies
9100 """
9101 return _core_.Window_HitTest(*args, **kwargs)
9102
9103 def GetBorder(*args):
9104 """
9105 GetBorder(self, long flags) -> int
9106 GetBorder(self) -> int
9107
9108 Get border for the flags of this window
9109 """
9110 return _core_.Window_GetBorder(*args)
9111
9112 def UpdateWindowUI(*args, **kwargs):
9113 """
9114 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9115
9116 This function sends EVT_UPDATE_UI events to the window. The particular
9117 implementation depends on the window; for example a wx.ToolBar will
9118 send an update UI event for each toolbar button, and a wx.Frame will
9119 send an update UI event for each menubar menu item. You can call this
9120 function from your application to ensure that your UI is up-to-date at
9121 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9122 concerned). This may be necessary if you have called
9123 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9124 limit the overhead that wxWindows incurs by sending update UI events
9125 in idle time.
9126 """
9127 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9128
9129 def PopupMenuXY(*args, **kwargs):
9130 """
9131 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9132
9133 Pops up the given menu at the specified coordinates, relative to this window,
9134 and returns control when the user has dismissed the menu. If a menu item is
9135 selected, the corresponding menu event is generated and will be processed as
9136 usual. If the default position is given then the current position of the
9137 mouse cursor will be used.
9138 """
9139 return _core_.Window_PopupMenuXY(*args, **kwargs)
9140
9141 def PopupMenu(*args, **kwargs):
9142 """
9143 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9144
9145 Pops up the given menu at the specified coordinates, relative to this window,
9146 and returns control when the user has dismissed the menu. If a menu item is
9147 selected, the corresponding menu event is generated and will be processed as
9148 usual. If the default position is given then the current position of the
9149 mouse cursor will be used.
9150 """
9151 return _core_.Window_PopupMenu(*args, **kwargs)
9152
9153 def HasMultiplePages(*args, **kwargs):
9154 """HasMultiplePages(self) -> bool"""
9155 return _core_.Window_HasMultiplePages(*args, **kwargs)
9156
9157 def GetHandle(*args, **kwargs):
9158 """
9159 GetHandle(self) -> long
9160
9161 Returns the platform-specific handle (as a long integer) of the
9162 physical window. Currently on wxMac it returns the handle of the
9163 toplevel parent of the window.
9164 """
9165 return _core_.Window_GetHandle(*args, **kwargs)
9166
9167 def AssociateHandle(*args, **kwargs):
9168 """
9169 AssociateHandle(self, long handle)
9170
9171 Associate the window with a new native handle
9172 """
9173 return _core_.Window_AssociateHandle(*args, **kwargs)
9174
9175 def DissociateHandle(*args, **kwargs):
9176 """
9177 DissociateHandle(self)
9178
9179 Dissociate the current native handle from the window
9180 """
9181 return _core_.Window_DissociateHandle(*args, **kwargs)
9182
9183 def HasScrollbar(*args, **kwargs):
9184 """
9185 HasScrollbar(self, int orient) -> bool
9186
9187 Does the window have the scrollbar for this orientation?
9188 """
9189 return _core_.Window_HasScrollbar(*args, **kwargs)
9190
9191 def SetScrollbar(*args, **kwargs):
9192 """
9193 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9194 bool refresh=True)
9195
9196 Sets the scrollbar properties of a built-in scrollbar.
9197 """
9198 return _core_.Window_SetScrollbar(*args, **kwargs)
9199
9200 def SetScrollPos(*args, **kwargs):
9201 """
9202 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9203
9204 Sets the position of one of the built-in scrollbars.
9205 """
9206 return _core_.Window_SetScrollPos(*args, **kwargs)
9207
9208 def GetScrollPos(*args, **kwargs):
9209 """
9210 GetScrollPos(self, int orientation) -> int
9211
9212 Returns the built-in scrollbar position.
9213 """
9214 return _core_.Window_GetScrollPos(*args, **kwargs)
9215
9216 def GetScrollThumb(*args, **kwargs):
9217 """
9218 GetScrollThumb(self, int orientation) -> int
9219
9220 Returns the built-in scrollbar thumb size.
9221 """
9222 return _core_.Window_GetScrollThumb(*args, **kwargs)
9223
9224 def GetScrollRange(*args, **kwargs):
9225 """
9226 GetScrollRange(self, int orientation) -> int
9227
9228 Returns the built-in scrollbar range.
9229 """
9230 return _core_.Window_GetScrollRange(*args, **kwargs)
9231
9232 def ScrollWindow(*args, **kwargs):
9233 """
9234 ScrollWindow(self, int dx, int dy, Rect rect=None)
9235
9236 Physically scrolls the pixels in the window and move child windows
9237 accordingly. Use this function to optimise your scrolling
9238 implementations, to minimise the area that must be redrawn. Note that
9239 it is rarely required to call this function from a user program.
9240 """
9241 return _core_.Window_ScrollWindow(*args, **kwargs)
9242
9243 def ScrollLines(*args, **kwargs):
9244 """
9245 ScrollLines(self, int lines) -> bool
9246
9247 If the platform and window class supports it, scrolls the window by
9248 the given number of lines down, if lines is positive, or up if lines
9249 is negative. Returns True if the window was scrolled, False if it was
9250 already on top/bottom and nothing was done.
9251 """
9252 return _core_.Window_ScrollLines(*args, **kwargs)
9253
9254 def ScrollPages(*args, **kwargs):
9255 """
9256 ScrollPages(self, int pages) -> bool
9257
9258 If the platform and window class supports it, scrolls the window by
9259 the given number of pages down, if pages is positive, or up if pages
9260 is negative. Returns True if the window was scrolled, False if it was
9261 already on top/bottom and nothing was done.
9262 """
9263 return _core_.Window_ScrollPages(*args, **kwargs)
9264
9265 def LineUp(*args, **kwargs):
9266 """
9267 LineUp(self) -> bool
9268
9269 This is just a wrapper for ScrollLines(-1).
9270 """
9271 return _core_.Window_LineUp(*args, **kwargs)
9272
9273 def LineDown(*args, **kwargs):
9274 """
9275 LineDown(self) -> bool
9276
9277 This is just a wrapper for ScrollLines(1).
9278 """
9279 return _core_.Window_LineDown(*args, **kwargs)
9280
9281 def PageUp(*args, **kwargs):
9282 """
9283 PageUp(self) -> bool
9284
9285 This is just a wrapper for ScrollPages(-1).
9286 """
9287 return _core_.Window_PageUp(*args, **kwargs)
9288
9289 def PageDown(*args, **kwargs):
9290 """
9291 PageDown(self) -> bool
9292
9293 This is just a wrapper for ScrollPages(1).
9294 """
9295 return _core_.Window_PageDown(*args, **kwargs)
9296
9297 def SetHelpText(*args, **kwargs):
9298 """
9299 SetHelpText(self, String text)
9300
9301 Sets the help text to be used as context-sensitive help for this
9302 window. Note that the text is actually stored by the current
9303 `wx.HelpProvider` implementation, and not in the window object itself.
9304 """
9305 return _core_.Window_SetHelpText(*args, **kwargs)
9306
9307 def SetHelpTextForId(*args, **kwargs):
9308 """
9309 SetHelpTextForId(self, String text)
9310
9311 Associate this help text with all windows with the same id as this
9312 one.
9313 """
9314 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9315
9316 def GetHelpTextAtPoint(*args, **kwargs):
9317 """
9318 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9319
9320 Get the help string associated with the given position in this window.
9321
9322 Notice that pt may be invalid if event origin is keyboard or unknown
9323 and this method should return the global window help text then
9324
9325 """
9326 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9327
9328 def GetHelpText(*args, **kwargs):
9329 """
9330 GetHelpText(self) -> String
9331
9332 Gets the help text to be used as context-sensitive help for this
9333 window. Note that the text is actually stored by the current
9334 `wx.HelpProvider` implementation, and not in the window object itself.
9335 """
9336 return _core_.Window_GetHelpText(*args, **kwargs)
9337
9338 def SetToolTipString(*args, **kwargs):
9339 """
9340 SetToolTipString(self, String tip)
9341
9342 Attach a tooltip to the window.
9343 """
9344 return _core_.Window_SetToolTipString(*args, **kwargs)
9345
9346 def SetToolTip(*args, **kwargs):
9347 """
9348 SetToolTip(self, ToolTip tip)
9349
9350 Attach a tooltip to the window.
9351 """
9352 return _core_.Window_SetToolTip(*args, **kwargs)
9353
9354 def GetToolTip(*args, **kwargs):
9355 """
9356 GetToolTip(self) -> ToolTip
9357
9358 get the associated tooltip or None if none
9359 """
9360 return _core_.Window_GetToolTip(*args, **kwargs)
9361
9362 def SetDropTarget(*args, **kwargs):
9363 """
9364 SetDropTarget(self, DropTarget dropTarget)
9365
9366 Associates a drop target with this window. If the window already has
9367 a drop target, it is deleted.
9368 """
9369 return _core_.Window_SetDropTarget(*args, **kwargs)
9370
9371 def GetDropTarget(*args, **kwargs):
9372 """
9373 GetDropTarget(self) -> DropTarget
9374
9375 Returns the associated drop target, which may be None.
9376 """
9377 return _core_.Window_GetDropTarget(*args, **kwargs)
9378
9379 def DragAcceptFiles(*args, **kwargs):
9380 """
9381 DragAcceptFiles(self, bool accept)
9382
9383 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9384 Only functional on Windows.
9385 """
9386 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9387
9388 def SetConstraints(*args, **kwargs):
9389 """
9390 SetConstraints(self, LayoutConstraints constraints)
9391
9392 Sets the window to have the given layout constraints. If an existing
9393 layout constraints object is already owned by the window, it will be
9394 deleted. Pass None to disassociate and delete the window's current
9395 constraints.
9396
9397 You must call SetAutoLayout to tell a window to use the constraints
9398 automatically in its default EVT_SIZE handler; otherwise, you must
9399 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9400 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9401 effect.
9402 """
9403 return _core_.Window_SetConstraints(*args, **kwargs)
9404
9405 def GetConstraints(*args, **kwargs):
9406 """
9407 GetConstraints(self) -> LayoutConstraints
9408
9409 Returns a pointer to the window's layout constraints, or None if there
9410 are none.
9411 """
9412 return _core_.Window_GetConstraints(*args, **kwargs)
9413
9414 def SetAutoLayout(*args, **kwargs):
9415 """
9416 SetAutoLayout(self, bool autoLayout)
9417
9418 Determines whether the Layout function will be called automatically
9419 when the window is resized. lease note that this only happens for the
9420 windows usually used to contain children, namely `wx.Panel` and
9421 `wx.TopLevelWindow` (and the classes deriving from them).
9422
9423 This method is called implicitly by `SetSizer` but if you use
9424 `SetConstraints` you should call it manually or otherwise the window
9425 layout won't be correctly updated when its size changes.
9426 """
9427 return _core_.Window_SetAutoLayout(*args, **kwargs)
9428
9429 def GetAutoLayout(*args, **kwargs):
9430 """
9431 GetAutoLayout(self) -> bool
9432
9433 Returns the current autoLayout setting
9434 """
9435 return _core_.Window_GetAutoLayout(*args, **kwargs)
9436
9437 def Layout(*args, **kwargs):
9438 """
9439 Layout(self) -> bool
9440
9441 Invokes the constraint-based layout algorithm or the sizer-based
9442 algorithm for this window. See SetAutoLayout: when auto layout is on,
9443 this function gets called automatically by the default EVT_SIZE
9444 handler when the window is resized.
9445 """
9446 return _core_.Window_Layout(*args, **kwargs)
9447
9448 def SetSizer(*args, **kwargs):
9449 """
9450 SetSizer(self, Sizer sizer, bool deleteOld=True)
9451
9452 Sets the window to have the given layout sizer. The window will then
9453 own the object, and will take care of its deletion. If an existing
9454 layout sizer object is already owned by the window, it will be deleted
9455 if the deleteOld parameter is true. Note that this function will also
9456 call SetAutoLayout implicitly with a True parameter if the sizer is
9457 non-None, and False otherwise.
9458 """
9459 return _core_.Window_SetSizer(*args, **kwargs)
9460
9461 def SetSizerAndFit(*args, **kwargs):
9462 """
9463 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9464
9465 The same as SetSizer, except it also sets the size hints for the
9466 window based on the sizer's minimum size.
9467 """
9468 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9469
9470 def GetSizer(*args, **kwargs):
9471 """
9472 GetSizer(self) -> Sizer
9473
9474 Return the sizer associated with the window by a previous call to
9475 SetSizer or None if there isn't one.
9476 """
9477 return _core_.Window_GetSizer(*args, **kwargs)
9478
9479 def SetContainingSizer(*args, **kwargs):
9480 """
9481 SetContainingSizer(self, Sizer sizer)
9482
9483 This normally does not need to be called by application code. It is
9484 called internally when a window is added to a sizer, and is used so
9485 the window can remove itself from the sizer when it is destroyed.
9486 """
9487 return _core_.Window_SetContainingSizer(*args, **kwargs)
9488
9489 def GetContainingSizer(*args, **kwargs):
9490 """
9491 GetContainingSizer(self) -> Sizer
9492
9493 Return the sizer that this window is a member of, if any, otherwise None.
9494 """
9495 return _core_.Window_GetContainingSizer(*args, **kwargs)
9496
9497 def InheritAttributes(*args, **kwargs):
9498 """
9499 InheritAttributes(self)
9500
9501 This function is (or should be, in case of custom controls) called
9502 during window creation to intelligently set up the window visual
9503 attributes, that is the font and the foreground and background
9504 colours.
9505
9506 By 'intelligently' the following is meant: by default, all windows use
9507 their own default attributes. However if some of the parent's
9508 attributes are explicitly changed (that is, using SetFont and not
9509 SetOwnFont) and if the corresponding attribute hadn't been
9510 explicitly set for this window itself, then this window takes the same
9511 value as used by the parent. In addition, if the window overrides
9512 ShouldInheritColours to return false, the colours will not be changed
9513 no matter what and only the font might.
9514
9515 This rather complicated logic is necessary in order to accommodate the
9516 different usage scenarios. The most common one is when all default
9517 attributes are used and in this case, nothing should be inherited as
9518 in modern GUIs different controls use different fonts (and colours)
9519 than their siblings so they can't inherit the same value from the
9520 parent. However it was also deemed desirable to allow to simply change
9521 the attributes of all children at once by just changing the font or
9522 colour of their common parent, hence in this case we do inherit the
9523 parents attributes.
9524
9525 """
9526 return _core_.Window_InheritAttributes(*args, **kwargs)
9527
9528 def ShouldInheritColours(*args, **kwargs):
9529 """
9530 ShouldInheritColours(self) -> bool
9531
9532 Return true from here to allow the colours of this window to be
9533 changed by InheritAttributes, returning false forbids inheriting them
9534 from the parent window.
9535
9536 The base class version returns false, but this method is overridden in
9537 wxControl where it returns true.
9538 """
9539 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9540
9541 def PostCreate(self, pre):
9542 """
9543 Phase 3 of the 2-phase create <wink!>
9544 Call this method after precreating the window with the 2-phase create method.
9545 """
9546 self.this = pre.this
9547 self.thisown = pre.thisown
9548 pre.thisown = 0
9549 if hasattr(self, '_setOORInfo'):
9550 self._setOORInfo(self)
9551 if hasattr(self, '_setCallbackInfo'):
9552 self._setCallbackInfo(self, self.__class__)
9553
9554 def SendSizeEvent(self):
9555 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9556
9557 _core_.Window_swigregister(Window)
9558
9559 def PreWindow(*args, **kwargs):
9560 """
9561 PreWindow() -> Window
9562
9563 Precreate a Window for 2-phase creation.
9564 """
9565 val = _core_.new_PreWindow(*args, **kwargs)
9566 return val
9567
9568 def Window_NewControlId(*args):
9569 """
9570 Window_NewControlId() -> int
9571
9572 Generate a control id for the controls which were not given one.
9573 """
9574 return _core_.Window_NewControlId(*args)
9575
9576 def Window_NextControlId(*args, **kwargs):
9577 """
9578 Window_NextControlId(int winid) -> int
9579
9580 Get the id of the control following the one with the given
9581 autogenerated) id
9582 """
9583 return _core_.Window_NextControlId(*args, **kwargs)
9584
9585 def Window_PrevControlId(*args, **kwargs):
9586 """
9587 Window_PrevControlId(int winid) -> int
9588
9589 Get the id of the control preceding the one with the given
9590 autogenerated) id
9591 """
9592 return _core_.Window_PrevControlId(*args, **kwargs)
9593
9594 def Window_FindFocus(*args):
9595 """
9596 Window_FindFocus() -> Window
9597
9598 Returns the window or control that currently has the keyboard focus,
9599 or None.
9600 """
9601 return _core_.Window_FindFocus(*args)
9602
9603 def Window_GetCapture(*args):
9604 """
9605 Window_GetCapture() -> Window
9606
9607 Returns the window which currently captures the mouse or None
9608 """
9609 return _core_.Window_GetCapture(*args)
9610
9611 def Window_GetClassDefaultAttributes(*args, **kwargs):
9612 """
9613 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9614
9615 Get the default attributes for this class. This is useful if you want
9616 to use the same font or colour in your own control as in a standard
9617 control -- which is a much better idea than hard coding specific
9618 colours or fonts which might look completely out of place on the
9619 user's system, especially if it uses themes.
9620
9621 The variant parameter is only relevant under Mac currently and is
9622 ignore under other platforms. Under Mac, it will change the size of
9623 the returned font. See `wx.Window.SetWindowVariant` for more about
9624 this.
9625 """
9626 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9627
9628 def DLG_PNT(win, point_or_x, y=None):
9629 """
9630 Convenience function for converting a Point or (x,y) in
9631 dialog units to pixel units.
9632 """
9633 if y is None:
9634 return win.ConvertDialogPointToPixels(point_or_x)
9635 else:
9636 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9637
9638 def DLG_SZE(win, size_width, height=None):
9639 """
9640 Convenience function for converting a Size or (w,h) in
9641 dialog units to pixel units.
9642 """
9643 if height is None:
9644 return win.ConvertDialogSizeToPixels(size_width)
9645 else:
9646 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9647
9648
9649 def FindWindowById(*args, **kwargs):
9650 """
9651 FindWindowById(long id, Window parent=None) -> Window
9652
9653 Find the first window in the application with the given id. If parent
9654 is None, the search will start from all top-level frames and dialog
9655 boxes; if non-None, the search will be limited to the given window
9656 hierarchy. The search is recursive in both cases.
9657 """
9658 return _core_.FindWindowById(*args, **kwargs)
9659
9660 def FindWindowByName(*args, **kwargs):
9661 """
9662 FindWindowByName(String name, Window parent=None) -> Window
9663
9664 Find a window by its name (as given in a window constructor or Create
9665 function call). If parent is None, the search will start from all
9666 top-level frames and dialog boxes; if non-None, the search will be
9667 limited to the given window hierarchy. The search is recursive in both
9668 cases.
9669
9670 If no window with such name is found, wx.FindWindowByLabel is called.
9671 """
9672 return _core_.FindWindowByName(*args, **kwargs)
9673
9674 def FindWindowByLabel(*args, **kwargs):
9675 """
9676 FindWindowByLabel(String label, Window parent=None) -> Window
9677
9678 Find a window by its label. Depending on the type of window, the label
9679 may be a window title or panel item label. If parent is None, the
9680 search will start from all top-level frames and dialog boxes; if
9681 non-None, the search will be limited to the given window
9682 hierarchy. The search is recursive in both cases.
9683 """
9684 return _core_.FindWindowByLabel(*args, **kwargs)
9685
9686 def Window_FromHWND(*args, **kwargs):
9687 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9688 return _core_.Window_FromHWND(*args, **kwargs)
9689
9690 def GetTopLevelWindows(*args):
9691 """
9692 GetTopLevelWindows() -> PyObject
9693
9694 Returns a list of the the application's top-level windows, (frames,
9695 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9696 by wxWidgets, and so it is only valid as long as no top-level windows
9697 are closed or new top-level windows are created.
9698
9699 """
9700 return _core_.GetTopLevelWindows(*args)
9701 #---------------------------------------------------------------------------
9702
9703 class Validator(EvtHandler):
9704 """Proxy of C++ Validator class"""
9705 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9706 __repr__ = _swig_repr
9707 def __init__(self, *args, **kwargs):
9708 """__init__(self) -> Validator"""
9709 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9710 self._setOORInfo(self)
9711
9712 def Clone(*args, **kwargs):
9713 """Clone(self) -> Validator"""
9714 return _core_.Validator_Clone(*args, **kwargs)
9715
9716 def Validate(*args, **kwargs):
9717 """Validate(self, Window parent) -> bool"""
9718 return _core_.Validator_Validate(*args, **kwargs)
9719
9720 def TransferToWindow(*args, **kwargs):
9721 """TransferToWindow(self) -> bool"""
9722 return _core_.Validator_TransferToWindow(*args, **kwargs)
9723
9724 def TransferFromWindow(*args, **kwargs):
9725 """TransferFromWindow(self) -> bool"""
9726 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9727
9728 def GetWindow(*args, **kwargs):
9729 """GetWindow(self) -> Window"""
9730 return _core_.Validator_GetWindow(*args, **kwargs)
9731
9732 def SetWindow(*args, **kwargs):
9733 """SetWindow(self, Window window)"""
9734 return _core_.Validator_SetWindow(*args, **kwargs)
9735
9736 def IsSilent(*args, **kwargs):
9737 """IsSilent() -> bool"""
9738 return _core_.Validator_IsSilent(*args, **kwargs)
9739
9740 IsSilent = staticmethod(IsSilent)
9741 def SetBellOnError(*args, **kwargs):
9742 """SetBellOnError(int doIt=True)"""
9743 return _core_.Validator_SetBellOnError(*args, **kwargs)
9744
9745 SetBellOnError = staticmethod(SetBellOnError)
9746 _core_.Validator_swigregister(Validator)
9747
9748 def Validator_IsSilent(*args):
9749 """Validator_IsSilent() -> bool"""
9750 return _core_.Validator_IsSilent(*args)
9751
9752 def Validator_SetBellOnError(*args, **kwargs):
9753 """Validator_SetBellOnError(int doIt=True)"""
9754 return _core_.Validator_SetBellOnError(*args, **kwargs)
9755
9756 class PyValidator(Validator):
9757 """Proxy of C++ PyValidator class"""
9758 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9759 __repr__ = _swig_repr
9760 def __init__(self, *args, **kwargs):
9761 """__init__(self) -> PyValidator"""
9762 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9763
9764 self._setCallbackInfo(self, PyValidator, 1)
9765 self._setOORInfo(self)
9766
9767 def _setCallbackInfo(*args, **kwargs):
9768 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9769 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9770
9771 _core_.PyValidator_swigregister(PyValidator)
9772
9773 #---------------------------------------------------------------------------
9774
9775 class Menu(EvtHandler):
9776 """Proxy of C++ Menu class"""
9777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9778 __repr__ = _swig_repr
9779 def __init__(self, *args, **kwargs):
9780 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9781 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9782 self._setOORInfo(self)
9783
9784 def Append(*args, **kwargs):
9785 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9786 return _core_.Menu_Append(*args, **kwargs)
9787
9788 def AppendSeparator(*args, **kwargs):
9789 """AppendSeparator(self) -> MenuItem"""
9790 return _core_.Menu_AppendSeparator(*args, **kwargs)
9791
9792 def AppendCheckItem(*args, **kwargs):
9793 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9794 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9795
9796 def AppendRadioItem(*args, **kwargs):
9797 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9798 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9799
9800 def AppendMenu(*args, **kwargs):
9801 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9802 return _core_.Menu_AppendMenu(*args, **kwargs)
9803
9804 def AppendSubMenu(*args, **kwargs):
9805 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9806 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9807
9808 def AppendItem(*args, **kwargs):
9809 """AppendItem(self, MenuItem item) -> MenuItem"""
9810 return _core_.Menu_AppendItem(*args, **kwargs)
9811
9812 def InsertItem(*args, **kwargs):
9813 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9814 return _core_.Menu_InsertItem(*args, **kwargs)
9815
9816 def PrependItem(*args, **kwargs):
9817 """PrependItem(self, MenuItem item) -> MenuItem"""
9818 return _core_.Menu_PrependItem(*args, **kwargs)
9819
9820 def Break(*args, **kwargs):
9821 """Break(self)"""
9822 return _core_.Menu_Break(*args, **kwargs)
9823
9824 def Insert(*args, **kwargs):
9825 """
9826 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9827 int kind=ITEM_NORMAL) -> MenuItem
9828 """
9829 return _core_.Menu_Insert(*args, **kwargs)
9830
9831 def InsertSeparator(*args, **kwargs):
9832 """InsertSeparator(self, size_t pos) -> MenuItem"""
9833 return _core_.Menu_InsertSeparator(*args, **kwargs)
9834
9835 def InsertCheckItem(*args, **kwargs):
9836 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9837 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9838
9839 def InsertRadioItem(*args, **kwargs):
9840 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9841 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9842
9843 def InsertMenu(*args, **kwargs):
9844 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9845 return _core_.Menu_InsertMenu(*args, **kwargs)
9846
9847 def Prepend(*args, **kwargs):
9848 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9849 return _core_.Menu_Prepend(*args, **kwargs)
9850
9851 def PrependSeparator(*args, **kwargs):
9852 """PrependSeparator(self) -> MenuItem"""
9853 return _core_.Menu_PrependSeparator(*args, **kwargs)
9854
9855 def PrependCheckItem(*args, **kwargs):
9856 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9857 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9858
9859 def PrependRadioItem(*args, **kwargs):
9860 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9861 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9862
9863 def PrependMenu(*args, **kwargs):
9864 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9865 return _core_.Menu_PrependMenu(*args, **kwargs)
9866
9867 def Remove(*args, **kwargs):
9868 """Remove(self, int id) -> MenuItem"""
9869 return _core_.Menu_Remove(*args, **kwargs)
9870
9871 def RemoveItem(*args, **kwargs):
9872 """RemoveItem(self, MenuItem item) -> MenuItem"""
9873 return _core_.Menu_RemoveItem(*args, **kwargs)
9874
9875 def Delete(*args, **kwargs):
9876 """Delete(self, int id) -> bool"""
9877 return _core_.Menu_Delete(*args, **kwargs)
9878
9879 def DeleteItem(*args, **kwargs):
9880 """DeleteItem(self, MenuItem item) -> bool"""
9881 return _core_.Menu_DeleteItem(*args, **kwargs)
9882
9883 def Destroy(*args, **kwargs):
9884 """
9885 Destroy(self)
9886
9887 Deletes the C++ object this Python object is a proxy for.
9888 """
9889 val = _core_.Menu_Destroy(*args, **kwargs)
9890 args[0].thisown = 0
9891 return val
9892
9893 def DestroyId(*args, **kwargs):
9894 """
9895 DestroyId(self, int id) -> bool
9896
9897 Deletes the C++ object this Python object is a proxy for.
9898 """
9899 val = _core_.Menu_DestroyId(*args, **kwargs)
9900 args[0].thisown = 0
9901 return val
9902
9903 def DestroyItem(*args, **kwargs):
9904 """
9905 DestroyItem(self, MenuItem item) -> bool
9906
9907 Deletes the C++ object this Python object is a proxy for.
9908 """
9909 val = _core_.Menu_DestroyItem(*args, **kwargs)
9910 args[0].thisown = 0
9911 return val
9912
9913 def GetMenuItemCount(*args, **kwargs):
9914 """GetMenuItemCount(self) -> size_t"""
9915 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9916
9917 def GetMenuItems(*args, **kwargs):
9918 """GetMenuItems(self) -> PyObject"""
9919 return _core_.Menu_GetMenuItems(*args, **kwargs)
9920
9921 def FindItem(*args, **kwargs):
9922 """FindItem(self, String item) -> int"""
9923 return _core_.Menu_FindItem(*args, **kwargs)
9924
9925 def FindItemById(*args, **kwargs):
9926 """FindItemById(self, int id) -> MenuItem"""
9927 return _core_.Menu_FindItemById(*args, **kwargs)
9928
9929 def FindItemByPosition(*args, **kwargs):
9930 """FindItemByPosition(self, size_t position) -> MenuItem"""
9931 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9932
9933 def Enable(*args, **kwargs):
9934 """Enable(self, int id, bool enable)"""
9935 return _core_.Menu_Enable(*args, **kwargs)
9936
9937 def IsEnabled(*args, **kwargs):
9938 """IsEnabled(self, int id) -> bool"""
9939 return _core_.Menu_IsEnabled(*args, **kwargs)
9940
9941 def Check(*args, **kwargs):
9942 """Check(self, int id, bool check)"""
9943 return _core_.Menu_Check(*args, **kwargs)
9944
9945 def IsChecked(*args, **kwargs):
9946 """IsChecked(self, int id) -> bool"""
9947 return _core_.Menu_IsChecked(*args, **kwargs)
9948
9949 def SetLabel(*args, **kwargs):
9950 """SetLabel(self, int id, String label)"""
9951 return _core_.Menu_SetLabel(*args, **kwargs)
9952
9953 def GetLabel(*args, **kwargs):
9954 """GetLabel(self, int id) -> String"""
9955 return _core_.Menu_GetLabel(*args, **kwargs)
9956
9957 def SetHelpString(*args, **kwargs):
9958 """SetHelpString(self, int id, String helpString)"""
9959 return _core_.Menu_SetHelpString(*args, **kwargs)
9960
9961 def GetHelpString(*args, **kwargs):
9962 """GetHelpString(self, int id) -> String"""
9963 return _core_.Menu_GetHelpString(*args, **kwargs)
9964
9965 def SetTitle(*args, **kwargs):
9966 """SetTitle(self, String title)"""
9967 return _core_.Menu_SetTitle(*args, **kwargs)
9968
9969 def GetTitle(*args, **kwargs):
9970 """GetTitle(self) -> String"""
9971 return _core_.Menu_GetTitle(*args, **kwargs)
9972
9973 def SetEventHandler(*args, **kwargs):
9974 """SetEventHandler(self, EvtHandler handler)"""
9975 return _core_.Menu_SetEventHandler(*args, **kwargs)
9976
9977 def GetEventHandler(*args, **kwargs):
9978 """GetEventHandler(self) -> EvtHandler"""
9979 return _core_.Menu_GetEventHandler(*args, **kwargs)
9980
9981 def SetInvokingWindow(*args, **kwargs):
9982 """SetInvokingWindow(self, Window win)"""
9983 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9984
9985 def GetInvokingWindow(*args, **kwargs):
9986 """GetInvokingWindow(self) -> Window"""
9987 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9988
9989 def GetStyle(*args, **kwargs):
9990 """GetStyle(self) -> long"""
9991 return _core_.Menu_GetStyle(*args, **kwargs)
9992
9993 def UpdateUI(*args, **kwargs):
9994 """UpdateUI(self, EvtHandler source=None)"""
9995 return _core_.Menu_UpdateUI(*args, **kwargs)
9996
9997 def GetMenuBar(*args, **kwargs):
9998 """GetMenuBar(self) -> MenuBar"""
9999 return _core_.Menu_GetMenuBar(*args, **kwargs)
10000
10001 def Attach(*args, **kwargs):
10002 """Attach(self, wxMenuBarBase menubar)"""
10003 return _core_.Menu_Attach(*args, **kwargs)
10004
10005 def Detach(*args, **kwargs):
10006 """Detach(self)"""
10007 return _core_.Menu_Detach(*args, **kwargs)
10008
10009 def IsAttached(*args, **kwargs):
10010 """IsAttached(self) -> bool"""
10011 return _core_.Menu_IsAttached(*args, **kwargs)
10012
10013 def SetParent(*args, **kwargs):
10014 """SetParent(self, Menu parent)"""
10015 return _core_.Menu_SetParent(*args, **kwargs)
10016
10017 def GetParent(*args, **kwargs):
10018 """GetParent(self) -> Menu"""
10019 return _core_.Menu_GetParent(*args, **kwargs)
10020
10021 _core_.Menu_swigregister(Menu)
10022 DefaultValidator = cvar.DefaultValidator
10023
10024 #---------------------------------------------------------------------------
10025
10026 class MenuBar(Window):
10027 """Proxy of C++ MenuBar class"""
10028 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10029 __repr__ = _swig_repr
10030 def __init__(self, *args, **kwargs):
10031 """__init__(self, long style=0) -> MenuBar"""
10032 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10033 self._setOORInfo(self)
10034
10035 def Append(*args, **kwargs):
10036 """Append(self, Menu menu, String title) -> bool"""
10037 return _core_.MenuBar_Append(*args, **kwargs)
10038
10039 def Insert(*args, **kwargs):
10040 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10041 return _core_.MenuBar_Insert(*args, **kwargs)
10042
10043 def GetMenuCount(*args, **kwargs):
10044 """GetMenuCount(self) -> size_t"""
10045 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10046
10047 def GetMenu(*args, **kwargs):
10048 """GetMenu(self, size_t pos) -> Menu"""
10049 return _core_.MenuBar_GetMenu(*args, **kwargs)
10050
10051 def Replace(*args, **kwargs):
10052 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10053 return _core_.MenuBar_Replace(*args, **kwargs)
10054
10055 def Remove(*args, **kwargs):
10056 """Remove(self, size_t pos) -> Menu"""
10057 return _core_.MenuBar_Remove(*args, **kwargs)
10058
10059 def EnableTop(*args, **kwargs):
10060 """EnableTop(self, size_t pos, bool enable)"""
10061 return _core_.MenuBar_EnableTop(*args, **kwargs)
10062
10063 def IsEnabledTop(*args, **kwargs):
10064 """IsEnabledTop(self, size_t pos) -> bool"""
10065 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10066
10067 def SetLabelTop(*args, **kwargs):
10068 """SetLabelTop(self, size_t pos, String label)"""
10069 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10070
10071 def GetLabelTop(*args, **kwargs):
10072 """GetLabelTop(self, size_t pos) -> String"""
10073 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10074
10075 def FindMenuItem(*args, **kwargs):
10076 """FindMenuItem(self, String menu, String item) -> int"""
10077 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10078
10079 def FindItemById(*args, **kwargs):
10080 """FindItemById(self, int id) -> MenuItem"""
10081 return _core_.MenuBar_FindItemById(*args, **kwargs)
10082
10083 def FindMenu(*args, **kwargs):
10084 """FindMenu(self, String title) -> int"""
10085 return _core_.MenuBar_FindMenu(*args, **kwargs)
10086
10087 def Enable(*args, **kwargs):
10088 """Enable(self, int id, bool enable)"""
10089 return _core_.MenuBar_Enable(*args, **kwargs)
10090
10091 def Check(*args, **kwargs):
10092 """Check(self, int id, bool check)"""
10093 return _core_.MenuBar_Check(*args, **kwargs)
10094
10095 def IsChecked(*args, **kwargs):
10096 """IsChecked(self, int id) -> bool"""
10097 return _core_.MenuBar_IsChecked(*args, **kwargs)
10098
10099 def IsEnabled(*args, **kwargs):
10100 """IsEnabled(self, int id) -> bool"""
10101 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10102
10103 def SetLabel(*args, **kwargs):
10104 """SetLabel(self, int id, String label)"""
10105 return _core_.MenuBar_SetLabel(*args, **kwargs)
10106
10107 def GetLabel(*args, **kwargs):
10108 """GetLabel(self, int id) -> String"""
10109 return _core_.MenuBar_GetLabel(*args, **kwargs)
10110
10111 def SetHelpString(*args, **kwargs):
10112 """SetHelpString(self, int id, String helpString)"""
10113 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10114
10115 def GetHelpString(*args, **kwargs):
10116 """GetHelpString(self, int id) -> String"""
10117 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10118
10119 def GetFrame(*args, **kwargs):
10120 """GetFrame(self) -> wxFrame"""
10121 return _core_.MenuBar_GetFrame(*args, **kwargs)
10122
10123 def IsAttached(*args, **kwargs):
10124 """IsAttached(self) -> bool"""
10125 return _core_.MenuBar_IsAttached(*args, **kwargs)
10126
10127 def Attach(*args, **kwargs):
10128 """Attach(self, wxFrame frame)"""
10129 return _core_.MenuBar_Attach(*args, **kwargs)
10130
10131 def Detach(*args, **kwargs):
10132 """Detach(self)"""
10133 return _core_.MenuBar_Detach(*args, **kwargs)
10134
10135 def SetAutoWindowMenu(*args, **kwargs):
10136 """SetAutoWindowMenu(bool enable)"""
10137 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10138
10139 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10140 def GetAutoWindowMenu(*args, **kwargs):
10141 """GetAutoWindowMenu() -> bool"""
10142 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10143
10144 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10145 _core_.MenuBar_swigregister(MenuBar)
10146
10147 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10148 """MenuBar_SetAutoWindowMenu(bool enable)"""
10149 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10150
10151 def MenuBar_GetAutoWindowMenu(*args):
10152 """MenuBar_GetAutoWindowMenu() -> bool"""
10153 return _core_.MenuBar_GetAutoWindowMenu(*args)
10154
10155 #---------------------------------------------------------------------------
10156
10157 class MenuItem(Object):
10158 """Proxy of C++ MenuItem class"""
10159 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10160 __repr__ = _swig_repr
10161 def __init__(self, *args, **kwargs):
10162 """
10163 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10164 String help=EmptyString, int kind=ITEM_NORMAL,
10165 Menu subMenu=None) -> MenuItem
10166 """
10167 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10168 __swig_destroy__ = _core_.delete_MenuItem
10169 __del__ = lambda self : None;
10170 def GetMenu(*args, **kwargs):
10171 """GetMenu(self) -> Menu"""
10172 return _core_.MenuItem_GetMenu(*args, **kwargs)
10173
10174 def SetMenu(*args, **kwargs):
10175 """SetMenu(self, Menu menu)"""
10176 return _core_.MenuItem_SetMenu(*args, **kwargs)
10177
10178 def SetId(*args, **kwargs):
10179 """SetId(self, int id)"""
10180 return _core_.MenuItem_SetId(*args, **kwargs)
10181
10182 def GetId(*args, **kwargs):
10183 """GetId(self) -> int"""
10184 return _core_.MenuItem_GetId(*args, **kwargs)
10185
10186 def IsSeparator(*args, **kwargs):
10187 """IsSeparator(self) -> bool"""
10188 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10189
10190 def SetText(*args, **kwargs):
10191 """SetText(self, String str)"""
10192 return _core_.MenuItem_SetText(*args, **kwargs)
10193
10194 def GetLabel(*args, **kwargs):
10195 """GetLabel(self) -> String"""
10196 return _core_.MenuItem_GetLabel(*args, **kwargs)
10197
10198 def GetText(*args, **kwargs):
10199 """GetText(self) -> String"""
10200 return _core_.MenuItem_GetText(*args, **kwargs)
10201
10202 def GetLabelFromText(*args, **kwargs):
10203 """GetLabelFromText(String text) -> String"""
10204 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10205
10206 GetLabelFromText = staticmethod(GetLabelFromText)
10207 def GetKind(*args, **kwargs):
10208 """GetKind(self) -> int"""
10209 return _core_.MenuItem_GetKind(*args, **kwargs)
10210
10211 def SetKind(*args, **kwargs):
10212 """SetKind(self, int kind)"""
10213 return _core_.MenuItem_SetKind(*args, **kwargs)
10214
10215 def SetCheckable(*args, **kwargs):
10216 """SetCheckable(self, bool checkable)"""
10217 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10218
10219 def IsCheckable(*args, **kwargs):
10220 """IsCheckable(self) -> bool"""
10221 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10222
10223 def IsSubMenu(*args, **kwargs):
10224 """IsSubMenu(self) -> bool"""
10225 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10226
10227 def SetSubMenu(*args, **kwargs):
10228 """SetSubMenu(self, Menu menu)"""
10229 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10230
10231 def GetSubMenu(*args, **kwargs):
10232 """GetSubMenu(self) -> Menu"""
10233 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10234
10235 def Enable(*args, **kwargs):
10236 """Enable(self, bool enable=True)"""
10237 return _core_.MenuItem_Enable(*args, **kwargs)
10238
10239 def IsEnabled(*args, **kwargs):
10240 """IsEnabled(self) -> bool"""
10241 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10242
10243 def Check(*args, **kwargs):
10244 """Check(self, bool check=True)"""
10245 return _core_.MenuItem_Check(*args, **kwargs)
10246
10247 def IsChecked(*args, **kwargs):
10248 """IsChecked(self) -> bool"""
10249 return _core_.MenuItem_IsChecked(*args, **kwargs)
10250
10251 def Toggle(*args, **kwargs):
10252 """Toggle(self)"""
10253 return _core_.MenuItem_Toggle(*args, **kwargs)
10254
10255 def SetHelp(*args, **kwargs):
10256 """SetHelp(self, String str)"""
10257 return _core_.MenuItem_SetHelp(*args, **kwargs)
10258
10259 def GetHelp(*args, **kwargs):
10260 """GetHelp(self) -> String"""
10261 return _core_.MenuItem_GetHelp(*args, **kwargs)
10262
10263 def GetAccel(*args, **kwargs):
10264 """GetAccel(self) -> AcceleratorEntry"""
10265 return _core_.MenuItem_GetAccel(*args, **kwargs)
10266
10267 def SetAccel(*args, **kwargs):
10268 """SetAccel(self, AcceleratorEntry accel)"""
10269 return _core_.MenuItem_SetAccel(*args, **kwargs)
10270
10271 def SetBitmap(*args, **kwargs):
10272 """SetBitmap(self, Bitmap bitmap)"""
10273 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10274
10275 def GetBitmap(*args, **kwargs):
10276 """GetBitmap(self) -> Bitmap"""
10277 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10278
10279 def SetFont(*args, **kwargs):
10280 """SetFont(self, Font font)"""
10281 return _core_.MenuItem_SetFont(*args, **kwargs)
10282
10283 def GetFont(*args, **kwargs):
10284 """GetFont(self) -> Font"""
10285 return _core_.MenuItem_GetFont(*args, **kwargs)
10286
10287 def SetTextColour(*args, **kwargs):
10288 """SetTextColour(self, Colour colText)"""
10289 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10290
10291 def GetTextColour(*args, **kwargs):
10292 """GetTextColour(self) -> Colour"""
10293 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10294
10295 def SetBackgroundColour(*args, **kwargs):
10296 """SetBackgroundColour(self, Colour colBack)"""
10297 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10298
10299 def GetBackgroundColour(*args, **kwargs):
10300 """GetBackgroundColour(self) -> Colour"""
10301 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10302
10303 def SetBitmaps(*args, **kwargs):
10304 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10305 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10306
10307 def SetDisabledBitmap(*args, **kwargs):
10308 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10309 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10310
10311 def GetDisabledBitmap(*args, **kwargs):
10312 """GetDisabledBitmap(self) -> Bitmap"""
10313 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10314
10315 def SetMarginWidth(*args, **kwargs):
10316 """SetMarginWidth(self, int nWidth)"""
10317 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10318
10319 def GetMarginWidth(*args, **kwargs):
10320 """GetMarginWidth(self) -> int"""
10321 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10322
10323 def GetDefaultMarginWidth(*args, **kwargs):
10324 """GetDefaultMarginWidth() -> int"""
10325 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10326
10327 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10328 def IsOwnerDrawn(*args, **kwargs):
10329 """IsOwnerDrawn(self) -> bool"""
10330 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10331
10332 def SetOwnerDrawn(*args, **kwargs):
10333 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10334 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10335
10336 def ResetOwnerDrawn(*args, **kwargs):
10337 """ResetOwnerDrawn(self)"""
10338 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10339
10340 _core_.MenuItem_swigregister(MenuItem)
10341
10342 def MenuItem_GetLabelFromText(*args, **kwargs):
10343 """MenuItem_GetLabelFromText(String text) -> String"""
10344 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10345
10346 def MenuItem_GetDefaultMarginWidth(*args):
10347 """MenuItem_GetDefaultMarginWidth() -> int"""
10348 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10349
10350 #---------------------------------------------------------------------------
10351
10352 class Control(Window):
10353 """
10354 This is the base class for a control or 'widget'.
10355
10356 A control is generally a small window which processes user input
10357 and/or displays one or more item of data.
10358 """
10359 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10360 __repr__ = _swig_repr
10361 def __init__(self, *args, **kwargs):
10362 """
10363 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10364 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10365 String name=ControlNameStr) -> Control
10366
10367 Create a Control. Normally you should only call this from a subclass'
10368 __init__ as a plain old wx.Control is not very useful.
10369 """
10370 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10371 self._setOORInfo(self)
10372
10373 def Create(*args, **kwargs):
10374 """
10375 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10376 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10377 String name=ControlNameStr) -> bool
10378
10379 Do the 2nd phase and create the GUI control.
10380 """
10381 return _core_.Control_Create(*args, **kwargs)
10382
10383 def GetAlignment(*args, **kwargs):
10384 """
10385 GetAlignment(self) -> int
10386
10387 Get the control alignment (left/right/centre, top/bottom/centre)
10388 """
10389 return _core_.Control_GetAlignment(*args, **kwargs)
10390
10391 def GetLabelText(*args):
10392 """
10393 GetLabelText(self, String label) -> String
10394 GetLabelText(self) -> String
10395
10396 Get just the text of the label, without mnemonic characters ('&')
10397 """
10398 return _core_.Control_GetLabelText(*args)
10399
10400 def Command(*args, **kwargs):
10401 """
10402 Command(self, CommandEvent event)
10403
10404 Simulates the effect of the user issuing a command to the item.
10405
10406 :see: `wx.CommandEvent`
10407
10408 """
10409 return _core_.Control_Command(*args, **kwargs)
10410
10411 def GetLabel(*args, **kwargs):
10412 """
10413 GetLabel(self) -> String
10414
10415 Return a control's text.
10416 """
10417 return _core_.Control_GetLabel(*args, **kwargs)
10418
10419 def GetClassDefaultAttributes(*args, **kwargs):
10420 """
10421 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10422
10423 Get the default attributes for this class. This is useful if you want
10424 to use the same font or colour in your own control as in a standard
10425 control -- which is a much better idea than hard coding specific
10426 colours or fonts which might look completely out of place on the
10427 user's system, especially if it uses themes.
10428
10429 The variant parameter is only relevant under Mac currently and is
10430 ignore under other platforms. Under Mac, it will change the size of
10431 the returned font. See `wx.Window.SetWindowVariant` for more about
10432 this.
10433 """
10434 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10435
10436 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10437 _core_.Control_swigregister(Control)
10438 ControlNameStr = cvar.ControlNameStr
10439
10440 def PreControl(*args, **kwargs):
10441 """
10442 PreControl() -> Control
10443
10444 Precreate a Control control for 2-phase creation
10445 """
10446 val = _core_.new_PreControl(*args, **kwargs)
10447 return val
10448
10449 def Control_GetClassDefaultAttributes(*args, **kwargs):
10450 """
10451 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10452
10453 Get the default attributes for this class. This is useful if you want
10454 to use the same font or colour in your own control as in a standard
10455 control -- which is a much better idea than hard coding specific
10456 colours or fonts which might look completely out of place on the
10457 user's system, especially if it uses themes.
10458
10459 The variant parameter is only relevant under Mac currently and is
10460 ignore under other platforms. Under Mac, it will change the size of
10461 the returned font. See `wx.Window.SetWindowVariant` for more about
10462 this.
10463 """
10464 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10465
10466 #---------------------------------------------------------------------------
10467
10468 class ItemContainer(object):
10469 """
10470 The wx.ItemContainer class defines an interface which is implemented
10471 by all controls which have string subitems, each of which may be
10472 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10473 as `wx.ComboBox` which implements an extended interface deriving from
10474 this one.
10475
10476 It defines the methods for accessing the control's items and although
10477 each of the derived classes implements them differently, they still
10478 all conform to the same interface.
10479
10480 The items in a wx.ItemContainer have (non empty) string labels and,
10481 optionally, client data associated with them.
10482
10483 """
10484 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10485 def __init__(self): raise AttributeError, "No constructor defined"
10486 __repr__ = _swig_repr
10487 def Append(*args, **kwargs):
10488 """
10489 Append(self, String item, PyObject clientData=None) -> int
10490
10491 Adds the item to the control, associating the given data with the item
10492 if not None. The return value is the index of the newly added item
10493 which may be different from the last one if the control is sorted (e.g.
10494 has wx.LB_SORT or wx.CB_SORT style).
10495 """
10496 return _core_.ItemContainer_Append(*args, **kwargs)
10497
10498 def AppendItems(*args, **kwargs):
10499 """
10500 AppendItems(self, List strings)
10501
10502 Apend several items at once to the control. Notice that calling this
10503 method may be much faster than appending the items one by one if you
10504 need to add a lot of items.
10505 """
10506 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10507
10508 def Insert(*args, **kwargs):
10509 """
10510 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10511
10512 Insert an item into the control before the item at the ``pos`` index,
10513 optionally associating some data object with the item.
10514 """
10515 return _core_.ItemContainer_Insert(*args, **kwargs)
10516
10517 def Clear(*args, **kwargs):
10518 """
10519 Clear(self)
10520
10521 Removes all items from the control.
10522 """
10523 return _core_.ItemContainer_Clear(*args, **kwargs)
10524
10525 def Delete(*args, **kwargs):
10526 """
10527 Delete(self, unsigned int n)
10528
10529 Deletes the item at the zero-based index 'n' from the control. Note
10530 that it is an error (signalled by a `wx.PyAssertionError` exception if
10531 enabled) to remove an item with the index negative or greater or equal
10532 than the number of items in the control.
10533 """
10534 return _core_.ItemContainer_Delete(*args, **kwargs)
10535
10536 def GetClientData(*args, **kwargs):
10537 """
10538 GetClientData(self, unsigned int n) -> PyObject
10539
10540 Returns the client data associated with the given item, (if any.)
10541 """
10542 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10543
10544 def SetClientData(*args, **kwargs):
10545 """
10546 SetClientData(self, unsigned int n, PyObject clientData)
10547
10548 Associate the given client data with the item at position n.
10549 """
10550 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10551
10552 def GetCount(*args, **kwargs):
10553 """
10554 GetCount(self) -> unsigned int
10555
10556 Returns the number of items in the control.
10557 """
10558 return _core_.ItemContainer_GetCount(*args, **kwargs)
10559
10560 def IsEmpty(*args, **kwargs):
10561 """
10562 IsEmpty(self) -> bool
10563
10564 Returns True if the control is empty or False if it has some items.
10565 """
10566 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10567
10568 def GetString(*args, **kwargs):
10569 """
10570 GetString(self, unsigned int n) -> String
10571
10572 Returns the label of the item with the given index.
10573 """
10574 return _core_.ItemContainer_GetString(*args, **kwargs)
10575
10576 def GetStrings(*args, **kwargs):
10577 """GetStrings(self) -> wxArrayString"""
10578 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10579
10580 def SetString(*args, **kwargs):
10581 """
10582 SetString(self, unsigned int n, String s)
10583
10584 Sets the label for the given item.
10585 """
10586 return _core_.ItemContainer_SetString(*args, **kwargs)
10587
10588 def FindString(*args, **kwargs):
10589 """
10590 FindString(self, String s) -> int
10591
10592 Finds an item whose label matches the given string. Returns the
10593 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10594 found.
10595 """
10596 return _core_.ItemContainer_FindString(*args, **kwargs)
10597
10598 def SetSelection(*args, **kwargs):
10599 """
10600 SetSelection(self, int n)
10601
10602 Sets the item at index 'n' to be the selected item.
10603 """
10604 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10605
10606 def GetSelection(*args, **kwargs):
10607 """
10608 GetSelection(self) -> int
10609
10610 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10611 is selected.
10612 """
10613 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10614
10615 def SetStringSelection(*args, **kwargs):
10616 """SetStringSelection(self, String s) -> bool"""
10617 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10618
10619 def GetStringSelection(*args, **kwargs):
10620 """
10621 GetStringSelection(self) -> String
10622
10623 Returns the label of the selected item or an empty string if no item
10624 is selected.
10625 """
10626 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10627
10628 def Select(*args, **kwargs):
10629 """
10630 Select(self, int n)
10631
10632 This is the same as `SetSelection` and exists only because it is
10633 slightly more natural for controls which support multiple selection.
10634 """
10635 return _core_.ItemContainer_Select(*args, **kwargs)
10636
10637 _core_.ItemContainer_swigregister(ItemContainer)
10638
10639 #---------------------------------------------------------------------------
10640
10641 class ControlWithItems(Control,ItemContainer):
10642 """
10643 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10644 wx.Control class, and is used for the base class of various controls
10645 that have items.
10646 """
10647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10648 def __init__(self): raise AttributeError, "No constructor defined"
10649 __repr__ = _swig_repr
10650 _core_.ControlWithItems_swigregister(ControlWithItems)
10651
10652 #---------------------------------------------------------------------------
10653
10654 class SizerItem(Object):
10655 """
10656 The wx.SizerItem class is used to track the position, size and other
10657 attributes of each item managed by a `wx.Sizer`. It is not usually
10658 necessary to use this class because the sizer elements can also be
10659 identified by their positions or window or sizer references but
10660 sometimes it may be more convenient to use wx.SizerItem directly.
10661 Also, custom classes derived from `wx.PySizer` will probably need to
10662 use the collection of wx.SizerItems held by wx.Sizer when calculating
10663 layout.
10664
10665 :see: `wx.Sizer`, `wx.GBSizerItem`
10666 """
10667 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10668 __repr__ = _swig_repr
10669 def __init__(self, *args, **kwargs):
10670 """
10671 __init__(self) -> SizerItem
10672
10673 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10674 size will need to be set before this item can be used in a Sizer.
10675
10676 You will probably never need to create a wx.SizerItem directly as they
10677 are created automatically when the sizer's Add, Insert or Prepend
10678 methods are called.
10679
10680 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10681 """
10682 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10683 __swig_destroy__ = _core_.delete_SizerItem
10684 __del__ = lambda self : None;
10685 def DeleteWindows(*args, **kwargs):
10686 """
10687 DeleteWindows(self)
10688
10689 Destroy the window or the windows in a subsizer, depending on the type
10690 of item.
10691 """
10692 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10693
10694 def DetachSizer(*args, **kwargs):
10695 """
10696 DetachSizer(self)
10697
10698 Enable deleting the SizerItem without destroying the contained sizer.
10699 """
10700 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10701
10702 def GetSize(*args, **kwargs):
10703 """
10704 GetSize(self) -> Size
10705
10706 Get the current size of the item, as set in the last Layout.
10707 """
10708 return _core_.SizerItem_GetSize(*args, **kwargs)
10709
10710 def CalcMin(*args, **kwargs):
10711 """
10712 CalcMin(self) -> Size
10713
10714 Calculates the minimum desired size for the item, including any space
10715 needed by borders.
10716 """
10717 return _core_.SizerItem_CalcMin(*args, **kwargs)
10718
10719 def SetDimension(*args, **kwargs):
10720 """
10721 SetDimension(self, Point pos, Size size)
10722
10723 Set the position and size of the space allocated for this item by the
10724 sizer, and adjust the position and size of the item (window or
10725 subsizer) to be within that space taking alignment and borders into
10726 account.
10727 """
10728 return _core_.SizerItem_SetDimension(*args, **kwargs)
10729
10730 def GetMinSize(*args, **kwargs):
10731 """
10732 GetMinSize(self) -> Size
10733
10734 Get the minimum size needed for the item.
10735 """
10736 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10737
10738 def GetMinSizeWithBorder(*args, **kwargs):
10739 """
10740 GetMinSizeWithBorder(self) -> Size
10741
10742 Get the minimum size needed for the item with space for the borders
10743 added, if needed.
10744 """
10745 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10746
10747 def SetInitSize(*args, **kwargs):
10748 """SetInitSize(self, int x, int y)"""
10749 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10750
10751 def SetRatioWH(*args, **kwargs):
10752 """
10753 SetRatioWH(self, int width, int height)
10754
10755 Set the ratio item attribute.
10756 """
10757 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10758
10759 def SetRatioSize(*args, **kwargs):
10760 """
10761 SetRatioSize(self, Size size)
10762
10763 Set the ratio item attribute.
10764 """
10765 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10766
10767 def SetRatio(*args, **kwargs):
10768 """
10769 SetRatio(self, float ratio)
10770
10771 Set the ratio item attribute.
10772 """
10773 return _core_.SizerItem_SetRatio(*args, **kwargs)
10774
10775 def GetRatio(*args, **kwargs):
10776 """
10777 GetRatio(self) -> float
10778
10779 Set the ratio item attribute.
10780 """
10781 return _core_.SizerItem_GetRatio(*args, **kwargs)
10782
10783 def GetRect(*args, **kwargs):
10784 """
10785 GetRect(self) -> Rect
10786
10787 Returns the rectangle that the sizer item should occupy
10788 """
10789 return _core_.SizerItem_GetRect(*args, **kwargs)
10790
10791 def IsWindow(*args, **kwargs):
10792 """
10793 IsWindow(self) -> bool
10794
10795 Is this sizer item a window?
10796 """
10797 return _core_.SizerItem_IsWindow(*args, **kwargs)
10798
10799 def IsSizer(*args, **kwargs):
10800 """
10801 IsSizer(self) -> bool
10802
10803 Is this sizer item a subsizer?
10804 """
10805 return _core_.SizerItem_IsSizer(*args, **kwargs)
10806
10807 def IsSpacer(*args, **kwargs):
10808 """
10809 IsSpacer(self) -> bool
10810
10811 Is this sizer item a spacer?
10812 """
10813 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10814
10815 def SetProportion(*args, **kwargs):
10816 """
10817 SetProportion(self, int proportion)
10818
10819 Set the proportion value for this item.
10820 """
10821 return _core_.SizerItem_SetProportion(*args, **kwargs)
10822
10823 def GetProportion(*args, **kwargs):
10824 """
10825 GetProportion(self) -> int
10826
10827 Get the proportion value for this item.
10828 """
10829 return _core_.SizerItem_GetProportion(*args, **kwargs)
10830
10831 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10832 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10833 def SetFlag(*args, **kwargs):
10834 """
10835 SetFlag(self, int flag)
10836
10837 Set the flag value for this item.
10838 """
10839 return _core_.SizerItem_SetFlag(*args, **kwargs)
10840
10841 def GetFlag(*args, **kwargs):
10842 """
10843 GetFlag(self) -> int
10844
10845 Get the flag value for this item.
10846 """
10847 return _core_.SizerItem_GetFlag(*args, **kwargs)
10848
10849 def SetBorder(*args, **kwargs):
10850 """
10851 SetBorder(self, int border)
10852
10853 Set the border value for this item.
10854 """
10855 return _core_.SizerItem_SetBorder(*args, **kwargs)
10856
10857 def GetBorder(*args, **kwargs):
10858 """
10859 GetBorder(self) -> int
10860
10861 Get the border value for this item.
10862 """
10863 return _core_.SizerItem_GetBorder(*args, **kwargs)
10864
10865 def GetWindow(*args, **kwargs):
10866 """
10867 GetWindow(self) -> Window
10868
10869 Get the window (if any) that is managed by this sizer item.
10870 """
10871 return _core_.SizerItem_GetWindow(*args, **kwargs)
10872
10873 def SetWindow(*args, **kwargs):
10874 """
10875 SetWindow(self, Window window)
10876
10877 Set the window to be managed by this sizer item.
10878 """
10879 return _core_.SizerItem_SetWindow(*args, **kwargs)
10880
10881 def GetSizer(*args, **kwargs):
10882 """
10883 GetSizer(self) -> Sizer
10884
10885 Get the subsizer (if any) that is managed by this sizer item.
10886 """
10887 return _core_.SizerItem_GetSizer(*args, **kwargs)
10888
10889 def SetSizer(*args, **kwargs):
10890 """
10891 SetSizer(self, Sizer sizer)
10892
10893 Set the subsizer to be managed by this sizer item.
10894 """
10895 return _core_.SizerItem_SetSizer(*args, **kwargs)
10896
10897 def GetSpacer(*args, **kwargs):
10898 """
10899 GetSpacer(self) -> Size
10900
10901 Get the size of the spacer managed by this sizer item.
10902 """
10903 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10904
10905 def SetSpacer(*args, **kwargs):
10906 """
10907 SetSpacer(self, Size size)
10908
10909 Set the size of the spacer to be managed by this sizer item.
10910 """
10911 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10912
10913 def Show(*args, **kwargs):
10914 """
10915 Show(self, bool show)
10916
10917 Set the show item attribute, which sizers use to determine if the item
10918 is to be made part of the layout or not. If the item is tracking a
10919 window then it is shown or hidden as needed.
10920 """
10921 return _core_.SizerItem_Show(*args, **kwargs)
10922
10923 def IsShown(*args, **kwargs):
10924 """
10925 IsShown(self) -> bool
10926
10927 Is the item to be shown in the layout?
10928 """
10929 return _core_.SizerItem_IsShown(*args, **kwargs)
10930
10931 def GetPosition(*args, **kwargs):
10932 """
10933 GetPosition(self) -> Point
10934
10935 Returns the current position of the item, as set in the last Layout.
10936 """
10937 return _core_.SizerItem_GetPosition(*args, **kwargs)
10938
10939 def GetUserData(*args, **kwargs):
10940 """
10941 GetUserData(self) -> PyObject
10942
10943 Returns the userData associated with this sizer item, or None if there
10944 isn't any.
10945 """
10946 return _core_.SizerItem_GetUserData(*args, **kwargs)
10947
10948 def SetUserData(*args, **kwargs):
10949 """
10950 SetUserData(self, PyObject userData)
10951
10952 Associate a Python object with this sizer item.
10953 """
10954 return _core_.SizerItem_SetUserData(*args, **kwargs)
10955
10956 _core_.SizerItem_swigregister(SizerItem)
10957
10958 def SizerItemWindow(*args, **kwargs):
10959 """
10960 SizerItemWindow(Window window, int proportion, int flag, int border,
10961 PyObject userData=None) -> SizerItem
10962
10963 Constructs a `wx.SizerItem` for tracking a window.
10964 """
10965 val = _core_.new_SizerItemWindow(*args, **kwargs)
10966 return val
10967
10968 def SizerItemSpacer(*args, **kwargs):
10969 """
10970 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10971 PyObject userData=None) -> SizerItem
10972
10973 Constructs a `wx.SizerItem` for tracking a spacer.
10974 """
10975 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10976 return val
10977
10978 def SizerItemSizer(*args, **kwargs):
10979 """
10980 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10981 PyObject userData=None) -> SizerItem
10982
10983 Constructs a `wx.SizerItem` for tracking a subsizer
10984 """
10985 val = _core_.new_SizerItemSizer(*args, **kwargs)
10986 return val
10987
10988 class Sizer(Object):
10989 """
10990 wx.Sizer is the abstract base class used for laying out subwindows in
10991 a window. You cannot use wx.Sizer directly; instead, you will have to
10992 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10993 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
10994 `wx.GridBagSizer`.
10995
10996 The concept implemented by sizers in wxWidgets is closely related to
10997 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10998 toolkit or the Qt toolkit. It is based upon the idea of the individual
10999 subwindows reporting their minimal required size and their ability to
11000 get stretched if the size of the parent window has changed. This will
11001 most often mean that the programmer does not set the original size of
11002 a dialog in the beginning, rather the dialog will assigned a sizer and
11003 this sizer will be queried about the recommended size. The sizer in
11004 turn will query its children, which can be normal windows or contorls,
11005 empty space or other sizers, so that a hierarchy of sizers can be
11006 constructed. Note that wxSizer does not derive from wxWindow and thus
11007 do not interfere with tab ordering and requires very little resources
11008 compared to a real window on screen.
11009
11010 What makes sizers so well fitted for use in wxWidgets is the fact that
11011 every control reports its own minimal size and the algorithm can
11012 handle differences in font sizes or different window (dialog item)
11013 sizes on different platforms without problems. If for example the
11014 standard font as well as the overall design of Mac widgets requires
11015 more space than on Windows, then the initial size of a dialog using a
11016 sizer will automatically be bigger on Mac than on Windows.
11017 """
11018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11019 def __init__(self): raise AttributeError, "No constructor defined"
11020 __repr__ = _swig_repr
11021 __swig_destroy__ = _core_.delete_Sizer
11022 __del__ = lambda self : None;
11023 def _setOORInfo(*args, **kwargs):
11024 """_setOORInfo(self, PyObject _self)"""
11025 return _core_.Sizer__setOORInfo(*args, **kwargs)
11026
11027 def Add(*args, **kwargs):
11028 """
11029 Add(self, item, int proportion=0, int flag=0, int border=0,
11030 PyObject userData=None) -> wx.SizerItem
11031
11032 Appends a child item to the sizer.
11033 """
11034 return _core_.Sizer_Add(*args, **kwargs)
11035
11036 def Insert(*args, **kwargs):
11037 """
11038 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11039 PyObject userData=None) -> wx.SizerItem
11040
11041 Inserts a new item into the list of items managed by this sizer before
11042 the item at index *before*. See `Add` for a description of the parameters.
11043 """
11044 return _core_.Sizer_Insert(*args, **kwargs)
11045
11046 def Prepend(*args, **kwargs):
11047 """
11048 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11049 PyObject userData=None) -> wx.SizerItem
11050
11051 Adds a new item to the begining of the list of sizer items managed by
11052 this sizer. See `Add` for a description of the parameters.
11053 """
11054 return _core_.Sizer_Prepend(*args, **kwargs)
11055
11056 def Remove(*args, **kwargs):
11057 """
11058 Remove(self, item) -> bool
11059
11060 Removes an item from the sizer and destroys it. This method does not
11061 cause any layout or resizing to take place, call `Layout` to update
11062 the layout on screen after removing a child from the sizer. The
11063 *item* parameter can be either a window, a sizer, or the zero-based
11064 index of an item to remove. Returns True if the child item was found
11065 and removed.
11066 """
11067 return _core_.Sizer_Remove(*args, **kwargs)
11068
11069 def Detach(*args, **kwargs):
11070 """
11071 Detach(self, item) -> bool
11072
11073 Detaches an item from the sizer without destroying it. This method
11074 does not cause any layout or resizing to take place, call `Layout` to
11075 do so. The *item* parameter can be either a window, a sizer, or the
11076 zero-based index of the item to be detached. Returns True if the child item
11077 was found and detached.
11078 """
11079 return _core_.Sizer_Detach(*args, **kwargs)
11080
11081 def GetItem(*args, **kwargs):
11082 """
11083 GetItem(self, item) -> wx.SizerItem
11084
11085 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11086 parameter can be either a window, a sizer, or the zero-based index of
11087 the item to be found.
11088 """
11089 return _core_.Sizer_GetItem(*args, **kwargs)
11090
11091 def _SetItemMinSize(*args, **kwargs):
11092 """_SetItemMinSize(self, PyObject item, Size size)"""
11093 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11094
11095 def SetItemMinSize(self, item, *args):
11096 """
11097 SetItemMinSize(self, item, Size size)
11098
11099 Sets the minimum size that will be allocated for an item in the sizer.
11100 The *item* parameter can be either a window, a sizer, or the
11101 zero-based index of the item. If a window or sizer is given then it
11102 will be searched for recursivly in subsizers if neccessary.
11103 """
11104 if len(args) == 2:
11105 # for backward compatibility accept separate width,height args too
11106 return self._SetItemMinSize(item, args)
11107 else:
11108 return self._SetItemMinSize(item, args[0])
11109
11110 def AddItem(*args, **kwargs):
11111 """
11112 AddItem(self, SizerItem item)
11113
11114 Adds a `wx.SizerItem` to the sizer.
11115 """
11116 return _core_.Sizer_AddItem(*args, **kwargs)
11117
11118 def InsertItem(*args, **kwargs):
11119 """
11120 InsertItem(self, int index, SizerItem item)
11121
11122 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11123 """
11124 return _core_.Sizer_InsertItem(*args, **kwargs)
11125
11126 def PrependItem(*args, **kwargs):
11127 """
11128 PrependItem(self, SizerItem item)
11129
11130 Prepends a `wx.SizerItem` to the sizer.
11131 """
11132 return _core_.Sizer_PrependItem(*args, **kwargs)
11133
11134 def AddMany(self, items):
11135 """
11136 AddMany is a convenience method for adding several items
11137 to a sizer at one time. Simply pass it a list of tuples,
11138 where each tuple consists of the parameters that you
11139 would normally pass to the `Add` method.
11140 """
11141 for item in items:
11142 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11143 item = (item, )
11144 self.Add(*item)
11145
11146 # for backwards compatibility only, please do not use in new code
11147 def AddWindow(self, *args, **kw):
11148 """Compatibility alias for `Add`."""
11149 return self.Add(*args, **kw)
11150 def AddSizer(self, *args, **kw):
11151 """Compatibility alias for `Add`."""
11152 return self.Add(*args, **kw)
11153 def AddSpacer(self, *args, **kw):
11154 """Compatibility alias for `Add`."""
11155 return self.Add(*args, **kw)
11156
11157 def PrependWindow(self, *args, **kw):
11158 """Compatibility alias for `Prepend`."""
11159 return self.Prepend(*args, **kw)
11160 def PrependSizer(self, *args, **kw):
11161 """Compatibility alias for `Prepend`."""
11162 return self.Prepend(*args, **kw)
11163 def PrependSpacer(self, *args, **kw):
11164 """Compatibility alias for `Prepend`."""
11165 return self.Prepend(*args, **kw)
11166
11167 def InsertWindow(self, *args, **kw):
11168 """Compatibility alias for `Insert`."""
11169 return self.Insert(*args, **kw)
11170 def InsertSizer(self, *args, **kw):
11171 """Compatibility alias for `Insert`."""
11172 return self.Insert(*args, **kw)
11173 def InsertSpacer(self, *args, **kw):
11174 """Compatibility alias for `Insert`."""
11175 return self.Insert(*args, **kw)
11176
11177 def RemoveWindow(self, *args, **kw):
11178 """Compatibility alias for `Remove`."""
11179 return self.Remove(*args, **kw)
11180 def RemoveSizer(self, *args, **kw):
11181 """Compatibility alias for `Remove`."""
11182 return self.Remove(*args, **kw)
11183 def RemovePos(self, *args, **kw):
11184 """Compatibility alias for `Remove`."""
11185 return self.Remove(*args, **kw)
11186
11187
11188 def SetDimension(*args, **kwargs):
11189 """
11190 SetDimension(self, int x, int y, int width, int height)
11191
11192 Call this to force the sizer to take the given dimension and thus
11193 force the items owned by the sizer to resize themselves according to
11194 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11195 methods.
11196 """
11197 return _core_.Sizer_SetDimension(*args, **kwargs)
11198
11199 def SetMinSize(*args, **kwargs):
11200 """
11201 SetMinSize(self, Size size)
11202
11203 Call this to give the sizer a minimal size. Normally, the sizer will
11204 calculate its minimal size based purely on how much space its children
11205 need. After calling this method `GetMinSize` will return either the
11206 minimal size as requested by its children or the minimal size set
11207 here, depending on which is bigger.
11208 """
11209 return _core_.Sizer_SetMinSize(*args, **kwargs)
11210
11211 def GetSize(*args, **kwargs):
11212 """
11213 GetSize(self) -> Size
11214
11215 Returns the current size of the space managed by the sizer.
11216 """
11217 return _core_.Sizer_GetSize(*args, **kwargs)
11218
11219 def GetPosition(*args, **kwargs):
11220 """
11221 GetPosition(self) -> Point
11222
11223 Returns the current position of the sizer's managed space.
11224 """
11225 return _core_.Sizer_GetPosition(*args, **kwargs)
11226
11227 def GetMinSize(*args, **kwargs):
11228 """
11229 GetMinSize(self) -> Size
11230
11231 Returns the minimal size of the sizer. This is either the combined
11232 minimal size of all the children and their borders or the minimal size
11233 set by SetMinSize, depending on which is bigger.
11234 """
11235 return _core_.Sizer_GetMinSize(*args, **kwargs)
11236
11237 def GetSizeTuple(self):
11238 return self.GetSize().Get()
11239 def GetPositionTuple(self):
11240 return self.GetPosition().Get()
11241 def GetMinSizeTuple(self):
11242 return self.GetMinSize().Get()
11243
11244 def RecalcSizes(*args, **kwargs):
11245 """
11246 RecalcSizes(self)
11247
11248 Using the sizes calculated by `CalcMin` reposition and resize all the
11249 items managed by this sizer. You should not need to call this directly as
11250 it is called by `Layout`.
11251 """
11252 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11253
11254 def CalcMin(*args, **kwargs):
11255 """
11256 CalcMin(self) -> Size
11257
11258 This method is where the sizer will do the actual calculation of its
11259 children's minimal sizes. You should not need to call this directly as
11260 it is called by `Layout`.
11261 """
11262 return _core_.Sizer_CalcMin(*args, **kwargs)
11263
11264 def Layout(*args, **kwargs):
11265 """
11266 Layout(self)
11267
11268 This method will force the recalculation and layout of the items
11269 controlled by the sizer using the current space allocated to the
11270 sizer. Normally this is called automatically from the owning window's
11271 EVT_SIZE handler, but it is also useful to call it from user code when
11272 one of the items in a sizer change size, or items are added or
11273 removed.
11274 """
11275 return _core_.Sizer_Layout(*args, **kwargs)
11276
11277 def Fit(*args, **kwargs):
11278 """
11279 Fit(self, Window window) -> Size
11280
11281 Tell the sizer to resize the *window* to match the sizer's minimal
11282 size. This is commonly done in the constructor of the window itself in
11283 order to set its initial size to match the needs of the children as
11284 determined by the sizer. Returns the new size.
11285
11286 For a top level window this is the total window size, not the client size.
11287 """
11288 return _core_.Sizer_Fit(*args, **kwargs)
11289
11290 def FitInside(*args, **kwargs):
11291 """
11292 FitInside(self, Window window)
11293
11294 Tell the sizer to resize the *virtual size* of the *window* to match the
11295 sizer's minimal size. This will not alter the on screen size of the
11296 window, but may cause the addition/removal/alteration of scrollbars
11297 required to view the virtual area in windows which manage it.
11298
11299 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11300
11301 """
11302 return _core_.Sizer_FitInside(*args, **kwargs)
11303
11304 def SetSizeHints(*args, **kwargs):
11305 """
11306 SetSizeHints(self, Window window)
11307
11308 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11309 match the sizer's minimal size. This is commonly done in the
11310 constructor of the window itself if the window is resizable (as are
11311 many dialogs under Unix and frames on probably all platforms) in order
11312 to prevent the window from being sized smaller than the minimal size
11313 required by the sizer.
11314 """
11315 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11316
11317 def SetVirtualSizeHints(*args, **kwargs):
11318 """
11319 SetVirtualSizeHints(self, Window window)
11320
11321 Tell the sizer to set the minimal size of the window virtual area to
11322 match the sizer's minimal size. For windows with managed scrollbars
11323 this will set them appropriately.
11324
11325 :see: `wx.ScrolledWindow.SetScrollbars`
11326
11327 """
11328 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11329
11330 def Clear(*args, **kwargs):
11331 """
11332 Clear(self, bool deleteWindows=False)
11333
11334 Clear all items from the sizer, optionally destroying the window items
11335 as well.
11336 """
11337 return _core_.Sizer_Clear(*args, **kwargs)
11338
11339 def DeleteWindows(*args, **kwargs):
11340 """
11341 DeleteWindows(self)
11342
11343 Destroy all windows managed by the sizer.
11344 """
11345 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11346
11347 def GetChildren(*args, **kwargs):
11348 """
11349 GetChildren(self) -> list
11350
11351 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11352 """
11353 return _core_.Sizer_GetChildren(*args, **kwargs)
11354
11355 def Show(*args, **kwargs):
11356 """
11357 Show(self, item, bool show=True, bool recursive=false) -> bool
11358
11359 Shows or hides an item managed by the sizer. To make a sizer item
11360 disappear or reappear, use Show followed by `Layout`. The *item*
11361 parameter can be either a window, a sizer, or the zero-based index of
11362 the item. Use the recursive parameter to show or hide an item in a
11363 subsizer. Returns True if the item was found.
11364 """
11365 return _core_.Sizer_Show(*args, **kwargs)
11366
11367 def IsShown(*args, **kwargs):
11368 """
11369 IsShown(self, item)
11370
11371 Determines if the item is currently shown. To make a sizer
11372 item disappear or reappear, use Show followed by `Layout`. The *item*
11373 parameter can be either a window, a sizer, or the zero-based index of
11374 the item.
11375 """
11376 return _core_.Sizer_IsShown(*args, **kwargs)
11377
11378 def Hide(self, item, recursive=False):
11379 """
11380 A convenience method for `Show` (item, False, recursive).
11381 """
11382 return self.Show(item, False, recursive)
11383
11384 def ShowItems(*args, **kwargs):
11385 """
11386 ShowItems(self, bool show)
11387
11388 Recursively call `wx.SizerItem.Show` on all sizer items.
11389 """
11390 return _core_.Sizer_ShowItems(*args, **kwargs)
11391
11392 _core_.Sizer_swigregister(Sizer)
11393
11394 class PySizer(Sizer):
11395 """
11396 wx.PySizer is a special version of `wx.Sizer` that has been
11397 instrumented to allow the C++ virtual methods to be overloaded in
11398 Python derived classes. You would derive from this class if you are
11399 wanting to implement a custom sizer in Python code. Simply implement
11400 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11401 For example::
11402
11403 class MySizer(wx.PySizer):
11404 def __init__(self):
11405 wx.PySizer.__init__(self)
11406
11407 def CalcMin(self):
11408 for item in self.GetChildren():
11409 # calculate the total minimum width and height needed
11410 # by all items in the sizer according to this sizer's
11411 # layout algorithm.
11412 ...
11413 return wx.Size(width, height)
11414
11415 def RecalcSizes(self):
11416 # find the space allotted to this sizer
11417 pos = self.GetPosition()
11418 size = self.GetSize()
11419 for item in self.GetChildren():
11420 # Recalculate (if necessary) the position and size of
11421 # each item and then call item.SetDimension to do the
11422 # actual positioning and sizing of the items within the
11423 # space alloted to this sizer.
11424 ...
11425 item.SetDimension(itemPos, itemSize)
11426
11427
11428 When `Layout` is called it first calls `CalcMin` followed by
11429 `RecalcSizes` so you can optimize a bit by saving the results of
11430 `CalcMin` and reusing them in `RecalcSizes`.
11431
11432 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11433
11434
11435 """
11436 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11437 __repr__ = _swig_repr
11438 def __init__(self, *args, **kwargs):
11439 """
11440 __init__(self) -> PySizer
11441
11442 Creates a wx.PySizer. Must be called from the __init__ in the derived
11443 class.
11444 """
11445 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11446 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11447
11448 def _setCallbackInfo(*args, **kwargs):
11449 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11450 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11451
11452 _core_.PySizer_swigregister(PySizer)
11453
11454 #---------------------------------------------------------------------------
11455
11456 class BoxSizer(Sizer):
11457 """
11458 The basic idea behind a box sizer is that windows will most often be
11459 laid out in rather simple basic geometry, typically in a row or a
11460 column or nested hierarchies of either. A wx.BoxSizer will lay out
11461 its items in a simple row or column, depending on the orientation
11462 parameter passed to the constructor.
11463 """
11464 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11465 __repr__ = _swig_repr
11466 def __init__(self, *args, **kwargs):
11467 """
11468 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11469
11470 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11471 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11472 sizer.
11473 """
11474 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11475 self._setOORInfo(self)
11476
11477 def GetOrientation(*args, **kwargs):
11478 """
11479 GetOrientation(self) -> int
11480
11481 Returns the current orientation of the sizer.
11482 """
11483 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11484
11485 def SetOrientation(*args, **kwargs):
11486 """
11487 SetOrientation(self, int orient)
11488
11489 Resets the orientation of the sizer.
11490 """
11491 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11492
11493 _core_.BoxSizer_swigregister(BoxSizer)
11494
11495 #---------------------------------------------------------------------------
11496
11497 class StaticBoxSizer(BoxSizer):
11498 """
11499 wx.StaticBoxSizer derives from and functions identically to the
11500 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11501 manages. Note that this static box must be created separately and
11502 passed to the sizer constructor.
11503 """
11504 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11505 __repr__ = _swig_repr
11506 def __init__(self, *args, **kwargs):
11507 """
11508 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11509
11510 Constructor. It takes an associated static box and the orientation
11511 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11512 ``wx.HORIZONTAL``.
11513 """
11514 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11515 self._setOORInfo(self)
11516
11517 def GetStaticBox(*args, **kwargs):
11518 """
11519 GetStaticBox(self) -> StaticBox
11520
11521 Returns the static box associated with this sizer.
11522 """
11523 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11524
11525 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11526
11527 #---------------------------------------------------------------------------
11528
11529 class GridSizer(Sizer):
11530 """
11531 A grid sizer is a sizer which lays out its children in a
11532 two-dimensional table with all cells having the same size. In other
11533 words, the width of each cell within the grid is the width of the
11534 widest item added to the sizer and the height of each grid cell is the
11535 height of the tallest item. An optional vertical and/or horizontal
11536 gap between items can also be specified (in pixels.)
11537
11538 Items are placed in the cells of the grid in the order they are added,
11539 in row-major order. In other words, the first row is filled first,
11540 then the second, and so on until all items have been added. (If
11541 neccessary, additional rows will be added as items are added.) If you
11542 need to have greater control over the cells that items are placed in
11543 then use the `wx.GridBagSizer`.
11544
11545 """
11546 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11547 __repr__ = _swig_repr
11548 def __init__(self, *args, **kwargs):
11549 """
11550 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11551
11552 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11553 of columns and rows in the sizer - if either of the parameters is
11554 zero, it will be calculated to from the total number of children in
11555 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11556 define extra space between all children.
11557 """
11558 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11559 self._setOORInfo(self)
11560
11561 def SetCols(*args, **kwargs):
11562 """
11563 SetCols(self, int cols)
11564
11565 Sets the number of columns in the sizer.
11566 """
11567 return _core_.GridSizer_SetCols(*args, **kwargs)
11568
11569 def SetRows(*args, **kwargs):
11570 """
11571 SetRows(self, int rows)
11572
11573 Sets the number of rows in the sizer.
11574 """
11575 return _core_.GridSizer_SetRows(*args, **kwargs)
11576
11577 def SetVGap(*args, **kwargs):
11578 """
11579 SetVGap(self, int gap)
11580
11581 Sets the vertical gap (in pixels) between the cells in the sizer.
11582 """
11583 return _core_.GridSizer_SetVGap(*args, **kwargs)
11584
11585 def SetHGap(*args, **kwargs):
11586 """
11587 SetHGap(self, int gap)
11588
11589 Sets the horizontal gap (in pixels) between cells in the sizer
11590 """
11591 return _core_.GridSizer_SetHGap(*args, **kwargs)
11592
11593 def GetCols(*args, **kwargs):
11594 """
11595 GetCols(self) -> int
11596
11597 Returns the number of columns in the sizer.
11598 """
11599 return _core_.GridSizer_GetCols(*args, **kwargs)
11600
11601 def GetRows(*args, **kwargs):
11602 """
11603 GetRows(self) -> int
11604
11605 Returns the number of rows in the sizer.
11606 """
11607 return _core_.GridSizer_GetRows(*args, **kwargs)
11608
11609 def GetVGap(*args, **kwargs):
11610 """
11611 GetVGap(self) -> int
11612
11613 Returns the vertical gap (in pixels) between the cells in the sizer.
11614 """
11615 return _core_.GridSizer_GetVGap(*args, **kwargs)
11616
11617 def GetHGap(*args, **kwargs):
11618 """
11619 GetHGap(self) -> int
11620
11621 Returns the horizontal gap (in pixels) between cells in the sizer.
11622 """
11623 return _core_.GridSizer_GetHGap(*args, **kwargs)
11624
11625 def CalcRowsCols(self):
11626 """
11627 CalcRowsCols() -> (rows, cols)
11628
11629 Calculates how many rows and columns will be in the sizer based
11630 on the current number of items and also the rows, cols specified
11631 in the constructor.
11632 """
11633 nitems = len(self.GetChildren())
11634 rows = self.GetRows()
11635 cols = self.GetCols()
11636 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11637 if cols != 0:
11638 rows = (nitems + cols - 1) / cols
11639 elif rows != 0:
11640 cols = (nitems + rows - 1) / rows
11641 return (rows, cols)
11642
11643 _core_.GridSizer_swigregister(GridSizer)
11644
11645 #---------------------------------------------------------------------------
11646
11647 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11648 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11649 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11650 class FlexGridSizer(GridSizer):
11651 """
11652 A flex grid sizer is a sizer which lays out its children in a
11653 two-dimensional table with all table cells in one row having the same
11654 height and all cells in one column having the same width, but all
11655 rows or all columns are not necessarily the same height or width as in
11656 the `wx.GridSizer`.
11657
11658 wx.FlexGridSizer can also size items equally in one direction but
11659 unequally ("flexibly") in the other. If the sizer is only flexible
11660 in one direction (this can be changed using `SetFlexibleDirection`), it
11661 needs to be decided how the sizer should grow in the other ("non
11662 flexible") direction in order to fill the available space. The
11663 `SetNonFlexibleGrowMode` method serves this purpose.
11664
11665
11666 """
11667 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11668 __repr__ = _swig_repr
11669 def __init__(self, *args, **kwargs):
11670 """
11671 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11672
11673 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11674 number of columns and rows in the sizer - if either of the parameters
11675 is zero, it will be calculated to from the total number of children in
11676 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11677 define extra space between all children.
11678 """
11679 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11680 self._setOORInfo(self)
11681
11682 def AddGrowableRow(*args, **kwargs):
11683 """
11684 AddGrowableRow(self, size_t idx, int proportion=0)
11685
11686 Specifies that row *idx* (starting from zero) should be grown if there
11687 is extra space available to the sizer.
11688
11689 The *proportion* parameter has the same meaning as the stretch factor
11690 for the box sizers except that if all proportions are 0, then all
11691 columns are resized equally (instead of not being resized at all).
11692 """
11693 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11694
11695 def RemoveGrowableRow(*args, **kwargs):
11696 """
11697 RemoveGrowableRow(self, size_t idx)
11698
11699 Specifies that row *idx* is no longer growable.
11700 """
11701 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11702
11703 def AddGrowableCol(*args, **kwargs):
11704 """
11705 AddGrowableCol(self, size_t idx, int proportion=0)
11706
11707 Specifies that column *idx* (starting from zero) should be grown if
11708 there is extra space available to the sizer.
11709
11710 The *proportion* parameter has the same meaning as the stretch factor
11711 for the box sizers except that if all proportions are 0, then all
11712 columns are resized equally (instead of not being resized at all).
11713 """
11714 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11715
11716 def RemoveGrowableCol(*args, **kwargs):
11717 """
11718 RemoveGrowableCol(self, size_t idx)
11719
11720 Specifies that column *idx* is no longer growable.
11721 """
11722 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11723
11724 def SetFlexibleDirection(*args, **kwargs):
11725 """
11726 SetFlexibleDirection(self, int direction)
11727
11728 Specifies whether the sizer should flexibly resize its columns, rows,
11729 or both. Argument *direction* can be one of the following values. Any
11730 other value is ignored.
11731
11732 ============== =======================================
11733 wx.VERTICAL Rows are flexibly sized.
11734 wx.HORIZONTAL Columns are flexibly sized.
11735 wx.BOTH Both rows and columns are flexibly sized
11736 (this is the default value).
11737 ============== =======================================
11738
11739 Note that this method does not trigger relayout.
11740
11741 """
11742 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11743
11744 def GetFlexibleDirection(*args, **kwargs):
11745 """
11746 GetFlexibleDirection(self) -> int
11747
11748 Returns a value that specifies whether the sizer
11749 flexibly resizes its columns, rows, or both (default).
11750
11751 :see: `SetFlexibleDirection`
11752 """
11753 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11754
11755 def SetNonFlexibleGrowMode(*args, **kwargs):
11756 """
11757 SetNonFlexibleGrowMode(self, int mode)
11758
11759 Specifies how the sizer should grow in the non-flexible direction if
11760 there is one (so `SetFlexibleDirection` must have been called
11761 previously). Argument *mode* can be one of the following values:
11762
11763 ========================== =================================================
11764 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11765 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11766 `AddGrowableCol` and `AddGrowableRow`. In this
11767 case equal sizing applies to minimum sizes of
11768 columns or rows (this is the default value).
11769 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11770 the non flexible direction, whether they are
11771 growable or not in the flexbile direction.
11772 ========================== =================================================
11773
11774 Note that this method does not trigger relayout.
11775
11776
11777 """
11778 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11779
11780 def GetNonFlexibleGrowMode(*args, **kwargs):
11781 """
11782 GetNonFlexibleGrowMode(self) -> int
11783
11784 Returns the value that specifies how the sizer grows in the
11785 non-flexible direction if there is one.
11786
11787 :see: `SetNonFlexibleGrowMode`
11788 """
11789 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11790
11791 def GetRowHeights(*args, **kwargs):
11792 """
11793 GetRowHeights(self) -> list
11794
11795 Returns a list of integers representing the heights of each of the
11796 rows in the sizer.
11797 """
11798 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11799
11800 def GetColWidths(*args, **kwargs):
11801 """
11802 GetColWidths(self) -> list
11803
11804 Returns a list of integers representing the widths of each of the
11805 columns in the sizer.
11806 """
11807 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11808
11809 _core_.FlexGridSizer_swigregister(FlexGridSizer)
11810
11811 class StdDialogButtonSizer(BoxSizer):
11812 """
11813 A special sizer that knows how to order and position standard buttons
11814 in order to conform to the current platform's standards. You simply
11815 need to add each `wx.Button` to the sizer, and be sure to create the
11816 buttons using the standard ID's. Then call `Realize` and the sizer
11817 will take care of the rest.
11818
11819 """
11820 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11821 __repr__ = _swig_repr
11822 def __init__(self, *args, **kwargs):
11823 """__init__(self) -> StdDialogButtonSizer"""
11824 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11825 def AddButton(*args, **kwargs):
11826 """
11827 AddButton(self, wxButton button)
11828
11829 Use this to add the buttons to this sizer. Do not use the `Add`
11830 method in the base class.
11831 """
11832 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11833
11834 def Realize(*args, **kwargs):
11835 """
11836 Realize(self)
11837
11838 This funciton needs to be called after all the buttons have been added
11839 to the sizer. It will reorder them and position them in a platform
11840 specifc manner.
11841 """
11842 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11843
11844 def SetAffirmativeButton(*args, **kwargs):
11845 """SetAffirmativeButton(self, wxButton button)"""
11846 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11847
11848 def SetNegativeButton(*args, **kwargs):
11849 """SetNegativeButton(self, wxButton button)"""
11850 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11851
11852 def SetCancelButton(*args, **kwargs):
11853 """SetCancelButton(self, wxButton button)"""
11854 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11855
11856 def GetAffirmativeButton(*args, **kwargs):
11857 """GetAffirmativeButton(self) -> wxButton"""
11858 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11859
11860 def GetApplyButton(*args, **kwargs):
11861 """GetApplyButton(self) -> wxButton"""
11862 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11863
11864 def GetNegativeButton(*args, **kwargs):
11865 """GetNegativeButton(self) -> wxButton"""
11866 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11867
11868 def GetCancelButton(*args, **kwargs):
11869 """GetCancelButton(self) -> wxButton"""
11870 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11871
11872 def GetHelpButton(*args, **kwargs):
11873 """GetHelpButton(self) -> wxButton"""
11874 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11875
11876 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11877
11878 #---------------------------------------------------------------------------
11879
11880 class GBPosition(object):
11881 """
11882 This class represents the position of an item in a virtual grid of
11883 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11884 typemaps that will automatically convert from a 2-element sequence of
11885 integers to a wx.GBPosition, so you can use the more pythonic
11886 representation of the position nearly transparently in Python code.
11887 """
11888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11889 __repr__ = _swig_repr
11890 def __init__(self, *args, **kwargs):
11891 """
11892 __init__(self, int row=0, int col=0) -> GBPosition
11893
11894 This class represents the position of an item in a virtual grid of
11895 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11896 typemaps that will automatically convert from a 2-element sequence of
11897 integers to a wx.GBPosition, so you can use the more pythonic
11898 representation of the position nearly transparently in Python code.
11899 """
11900 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11901 __swig_destroy__ = _core_.delete_GBPosition
11902 __del__ = lambda self : None;
11903 def GetRow(*args, **kwargs):
11904 """GetRow(self) -> int"""
11905 return _core_.GBPosition_GetRow(*args, **kwargs)
11906
11907 def GetCol(*args, **kwargs):
11908 """GetCol(self) -> int"""
11909 return _core_.GBPosition_GetCol(*args, **kwargs)
11910
11911 def SetRow(*args, **kwargs):
11912 """SetRow(self, int row)"""
11913 return _core_.GBPosition_SetRow(*args, **kwargs)
11914
11915 def SetCol(*args, **kwargs):
11916 """SetCol(self, int col)"""
11917 return _core_.GBPosition_SetCol(*args, **kwargs)
11918
11919 def __eq__(*args, **kwargs):
11920 """
11921 __eq__(self, PyObject other) -> bool
11922
11923 Compare GBPosition for equality.
11924 """
11925 return _core_.GBPosition___eq__(*args, **kwargs)
11926
11927 def __ne__(*args, **kwargs):
11928 """
11929 __ne__(self, PyObject other) -> bool
11930
11931 Compare GBPosition for inequality.
11932 """
11933 return _core_.GBPosition___ne__(*args, **kwargs)
11934
11935 def Set(*args, **kwargs):
11936 """Set(self, int row=0, int col=0)"""
11937 return _core_.GBPosition_Set(*args, **kwargs)
11938
11939 def Get(*args, **kwargs):
11940 """Get(self) -> PyObject"""
11941 return _core_.GBPosition_Get(*args, **kwargs)
11942
11943 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11944 def __str__(self): return str(self.Get())
11945 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11946 def __len__(self): return len(self.Get())
11947 def __getitem__(self, index): return self.Get()[index]
11948 def __setitem__(self, index, val):
11949 if index == 0: self.SetRow(val)
11950 elif index == 1: self.SetCol(val)
11951 else: raise IndexError
11952 def __nonzero__(self): return self.Get() != (0,0)
11953 __safe_for_unpickling__ = True
11954 def __reduce__(self): return (wx.GBPosition, self.Get())
11955
11956 row = property(GetRow, SetRow)
11957 col = property(GetCol, SetCol)
11958
11959 _core_.GBPosition_swigregister(GBPosition)
11960
11961 class GBSpan(object):
11962 """
11963 This class is used to hold the row and column spanning attributes of
11964 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11965 automatically convert from a 2-element sequence of integers to a
11966 wx.GBSpan, so you can use the more pythonic representation of the span
11967 nearly transparently in Python code.
11968
11969 """
11970 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11971 __repr__ = _swig_repr
11972 def __init__(self, *args, **kwargs):
11973 """
11974 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11975
11976 Construct a new wxGBSpan, optionally setting the rowspan and
11977 colspan. The default is (1,1). (Meaning that the item occupies one
11978 cell in each direction.
11979 """
11980 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11981 __swig_destroy__ = _core_.delete_GBSpan
11982 __del__ = lambda self : None;
11983 def GetRowspan(*args, **kwargs):
11984 """GetRowspan(self) -> int"""
11985 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11986
11987 def GetColspan(*args, **kwargs):
11988 """GetColspan(self) -> int"""
11989 return _core_.GBSpan_GetColspan(*args, **kwargs)
11990
11991 def SetRowspan(*args, **kwargs):
11992 """SetRowspan(self, int rowspan)"""
11993 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11994
11995 def SetColspan(*args, **kwargs):
11996 """SetColspan(self, int colspan)"""
11997 return _core_.GBSpan_SetColspan(*args, **kwargs)
11998
11999 def __eq__(*args, **kwargs):
12000 """
12001 __eq__(self, PyObject other) -> bool
12002
12003 Compare wxGBSpan for equality.
12004 """
12005 return _core_.GBSpan___eq__(*args, **kwargs)
12006
12007 def __ne__(*args, **kwargs):
12008 """
12009 __ne__(self, PyObject other) -> bool
12010
12011 Compare GBSpan for inequality.
12012 """
12013 return _core_.GBSpan___ne__(*args, **kwargs)
12014
12015 def Set(*args, **kwargs):
12016 """Set(self, int rowspan=1, int colspan=1)"""
12017 return _core_.GBSpan_Set(*args, **kwargs)
12018
12019 def Get(*args, **kwargs):
12020 """Get(self) -> PyObject"""
12021 return _core_.GBSpan_Get(*args, **kwargs)
12022
12023 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12024 def __str__(self): return str(self.Get())
12025 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12026 def __len__(self): return len(self.Get())
12027 def __getitem__(self, index): return self.Get()[index]
12028 def __setitem__(self, index, val):
12029 if index == 0: self.SetRowspan(val)
12030 elif index == 1: self.SetColspan(val)
12031 else: raise IndexError
12032 def __nonzero__(self): return self.Get() != (0,0)
12033 __safe_for_unpickling__ = True
12034 def __reduce__(self): return (wx.GBSpan, self.Get())
12035
12036 rowspan = property(GetRowspan, SetRowspan)
12037 colspan = property(GetColspan, SetColspan)
12038
12039 _core_.GBSpan_swigregister(GBSpan)
12040
12041 class GBSizerItem(SizerItem):
12042 """
12043 The wx.GBSizerItem class is used to track the additional data about
12044 items in a `wx.GridBagSizer` such as the item's position in the grid
12045 and how many rows or columns it spans.
12046
12047 """
12048 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12049 __repr__ = _swig_repr
12050 def __init__(self, *args, **kwargs):
12051 """
12052 __init__(self) -> GBSizerItem
12053
12054 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12055 size will need to be set, as well as a position and span before this
12056 item can be used in a Sizer.
12057
12058 You will probably never need to create a wx.GBSizerItem directly as they
12059 are created automatically when the sizer's Add method is called.
12060 """
12061 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12062 __swig_destroy__ = _core_.delete_GBSizerItem
12063 __del__ = lambda self : None;
12064 def GetPos(*args, **kwargs):
12065 """
12066 GetPos(self) -> GBPosition
12067
12068 Get the grid position of the item
12069 """
12070 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12071
12072 def GetPosTuple(self): return self.GetPos().Get()
12073 def GetSpan(*args, **kwargs):
12074 """
12075 GetSpan(self) -> GBSpan
12076
12077 Get the row and column spanning of the item
12078 """
12079 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12080
12081 def GetSpanTuple(self): return self.GetSpan().Get()
12082 def SetPos(*args, **kwargs):
12083 """
12084 SetPos(self, GBPosition pos) -> bool
12085
12086 If the item is already a member of a sizer then first ensure that
12087 there is no other item that would intersect with this one at the new
12088 position, then set the new position. Returns True if the change is
12089 successful and after the next Layout() the item will be moved.
12090 """
12091 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12092
12093 def SetSpan(*args, **kwargs):
12094 """
12095 SetSpan(self, GBSpan span) -> bool
12096
12097 If the item is already a member of a sizer then first ensure that
12098 there is no other item that would intersect with this one with its new
12099 spanning size, then set the new spanning. Returns True if the change
12100 is successful and after the next Layout() the item will be resized.
12101
12102 """
12103 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12104
12105 def Intersects(*args, **kwargs):
12106 """
12107 Intersects(self, GBSizerItem other) -> bool
12108
12109 Returns True if this item and the other item instersect.
12110 """
12111 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12112
12113 def IntersectsPos(*args, **kwargs):
12114 """
12115 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12116
12117 Returns True if the given pos/span would intersect with this item.
12118 """
12119 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12120
12121 def GetEndPos(*args, **kwargs):
12122 """
12123 GetEndPos(self) -> GBPosition
12124
12125 Get the row and column of the endpoint of this item.
12126 """
12127 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12128
12129 def GetGBSizer(*args, **kwargs):
12130 """
12131 GetGBSizer(self) -> GridBagSizer
12132
12133 Get the sizer this item is a member of.
12134 """
12135 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12136
12137 def SetGBSizer(*args, **kwargs):
12138 """
12139 SetGBSizer(self, GridBagSizer sizer)
12140
12141 Set the sizer this item is a member of.
12142 """
12143 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12144
12145 _core_.GBSizerItem_swigregister(GBSizerItem)
12146 DefaultSpan = cvar.DefaultSpan
12147
12148 def GBSizerItemWindow(*args, **kwargs):
12149 """
12150 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12151 int border, PyObject userData=None) -> GBSizerItem
12152
12153 Construct a `wx.GBSizerItem` for a window.
12154 """
12155 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12156 return val
12157
12158 def GBSizerItemSizer(*args, **kwargs):
12159 """
12160 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12161 int border, PyObject userData=None) -> GBSizerItem
12162
12163 Construct a `wx.GBSizerItem` for a sizer
12164 """
12165 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12166 return val
12167
12168 def GBSizerItemSpacer(*args, **kwargs):
12169 """
12170 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12171 int flag, int border, PyObject userData=None) -> GBSizerItem
12172
12173 Construct a `wx.GBSizerItem` for a spacer.
12174 """
12175 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12176 return val
12177
12178 class GridBagSizer(FlexGridSizer):
12179 """
12180 A `wx.Sizer` that can lay out items in a virtual grid like a
12181 `wx.FlexGridSizer` but in this case explicit positioning of the items
12182 is allowed using `wx.GBPosition`, and items can optionally span more
12183 than one row and/or column using `wx.GBSpan`. The total size of the
12184 virtual grid is determined by the largest row and column that items are
12185 positioned at, adjusted for spanning.
12186
12187 """
12188 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12189 __repr__ = _swig_repr
12190 def __init__(self, *args, **kwargs):
12191 """
12192 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12193
12194 Constructor, with optional parameters to specify the gap between the
12195 rows and columns.
12196 """
12197 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12198 self._setOORInfo(self)
12199
12200 def Add(*args, **kwargs):
12201 """
12202 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12203 int border=0, userData=None) -> wx.GBSizerItem
12204
12205 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12206 more than one row or column as specified with *span*. The remaining
12207 args behave similarly to `wx.Sizer.Add`.
12208
12209 Returns True if the item was successfully placed at the given cell
12210 position, False if something was already there.
12211
12212 """
12213 return _core_.GridBagSizer_Add(*args, **kwargs)
12214
12215 def AddItem(*args, **kwargs):
12216 """
12217 Add(self, GBSizerItem item) -> wx.GBSizerItem
12218
12219 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12220 the item was successfully placed at its given cell position, False if
12221 something was already there.
12222 """
12223 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12224
12225 def GetCellSize(*args, **kwargs):
12226 """
12227 GetCellSize(self, int row, int col) -> Size
12228
12229 Get the size of the specified cell, including hgap and
12230 vgap. Only valid after a Layout.
12231 """
12232 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12233
12234 def GetEmptyCellSize(*args, **kwargs):
12235 """
12236 GetEmptyCellSize(self) -> Size
12237
12238 Get the size used for cells in the grid with no item.
12239 """
12240 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12241
12242 def SetEmptyCellSize(*args, **kwargs):
12243 """
12244 SetEmptyCellSize(self, Size sz)
12245
12246 Set the size used for cells in the grid with no item.
12247 """
12248 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12249
12250 def GetItemPosition(*args):
12251 """
12252 GetItemPosition(self, item) -> GBPosition
12253
12254 Get the grid position of the specified *item* where *item* is either a
12255 window or subsizer that is a member of this sizer, or a zero-based
12256 index of an item.
12257 """
12258 return _core_.GridBagSizer_GetItemPosition(*args)
12259
12260 def SetItemPosition(*args):
12261 """
12262 SetItemPosition(self, item, GBPosition pos) -> bool
12263
12264 Set the grid position of the specified *item* where *item* is either a
12265 window or subsizer that is a member of this sizer, or a zero-based
12266 index of an item. Returns True on success. If the move is not
12267 allowed (because an item is already there) then False is returned.
12268
12269 """
12270 return _core_.GridBagSizer_SetItemPosition(*args)
12271
12272 def GetItemSpan(*args):
12273 """
12274 GetItemSpan(self, item) -> GBSpan
12275
12276 Get the row/col spanning of the specified *item* where *item* is
12277 either a window or subsizer that is a member of this sizer, or a
12278 zero-based index of an item.
12279 """
12280 return _core_.GridBagSizer_GetItemSpan(*args)
12281
12282 def SetItemSpan(*args):
12283 """
12284 SetItemSpan(self, item, GBSpan span) -> bool
12285
12286 Set the row/col spanning of the specified *item* where *item* is
12287 either a window or subsizer that is a member of this sizer, or a
12288 zero-based index of an item. Returns True on success. If the move is
12289 not allowed (because an item is already there) then False is returned.
12290 """
12291 return _core_.GridBagSizer_SetItemSpan(*args)
12292
12293 def FindItem(*args):
12294 """
12295 FindItem(self, item) -> GBSizerItem
12296
12297 Find the sizer item for the given window or subsizer, returns None if
12298 not found. (non-recursive)
12299 """
12300 return _core_.GridBagSizer_FindItem(*args)
12301
12302 def FindItemAtPosition(*args, **kwargs):
12303 """
12304 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12305
12306 Return the sizer item for the given grid cell, or None if there is no
12307 item at that position. (non-recursive)
12308 """
12309 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12310
12311 def FindItemAtPoint(*args, **kwargs):
12312 """
12313 FindItemAtPoint(self, Point pt) -> GBSizerItem
12314
12315 Return the sizer item located at the point given in *pt*, or None if
12316 there is no item at that point. The (x,y) coordinates in pt correspond
12317 to the client coordinates of the window using the sizer for
12318 layout. (non-recursive)
12319 """
12320 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12321
12322 def CheckForIntersection(*args, **kwargs):
12323 """
12324 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12325
12326 Look at all items and see if any intersect (or would overlap) the
12327 given *item*. Returns True if so, False if there would be no overlap.
12328 If an *excludeItem* is given then it will not be checked for
12329 intersection, for example it may be the item we are checking the
12330 position of.
12331
12332 """
12333 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12334
12335 def CheckForIntersectionPos(*args, **kwargs):
12336 """
12337 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12338
12339 Look at all items and see if any intersect (or would overlap) the
12340 given position and span. Returns True if so, False if there would be
12341 no overlap. If an *excludeItem* is given then it will not be checked
12342 for intersection, for example it may be the item we are checking the
12343 position of.
12344 """
12345 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12346
12347 _core_.GridBagSizer_swigregister(GridBagSizer)
12348
12349 #---------------------------------------------------------------------------
12350
12351 Left = _core_.Left
12352 Top = _core_.Top
12353 Right = _core_.Right
12354 Bottom = _core_.Bottom
12355 Width = _core_.Width
12356 Height = _core_.Height
12357 Centre = _core_.Centre
12358 Center = _core_.Center
12359 CentreX = _core_.CentreX
12360 CentreY = _core_.CentreY
12361 Unconstrained = _core_.Unconstrained
12362 AsIs = _core_.AsIs
12363 PercentOf = _core_.PercentOf
12364 Above = _core_.Above
12365 Below = _core_.Below
12366 LeftOf = _core_.LeftOf
12367 RightOf = _core_.RightOf
12368 SameAs = _core_.SameAs
12369 Absolute = _core_.Absolute
12370 class IndividualLayoutConstraint(Object):
12371 """
12372 Objects of this class are stored in the `wx.LayoutConstraints` class as
12373 one of eight possible constraints that a window can be involved in.
12374 You will never need to create an instance of
12375 wx.IndividualLayoutConstraint, rather you should create a
12376 `wx.LayoutConstraints` instance and use the individual contstraints
12377 that it contains.
12378 """
12379 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12380 def __init__(self): raise AttributeError, "No constructor defined"
12381 __repr__ = _swig_repr
12382 def Set(*args, **kwargs):
12383 """
12384 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12385
12386 Sets the properties of the constraint. Normally called by one of the
12387 convenience functions such as Above, RightOf, SameAs.
12388 """
12389 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12390
12391 def LeftOf(*args, **kwargs):
12392 """
12393 LeftOf(self, Window sibling, int marg=0)
12394
12395 Constrains this edge to be to the left of the given window, with an
12396 optional margin. Implicitly, this is relative to the left edge of the
12397 other window.
12398 """
12399 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12400
12401 def RightOf(*args, **kwargs):
12402 """
12403 RightOf(self, Window sibling, int marg=0)
12404
12405 Constrains this edge to be to the right of the given window, with an
12406 optional margin. Implicitly, this is relative to the right edge of the
12407 other window.
12408 """
12409 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12410
12411 def Above(*args, **kwargs):
12412 """
12413 Above(self, Window sibling, int marg=0)
12414
12415 Constrains this edge to be above the given window, with an optional
12416 margin. Implicitly, this is relative to the top edge of the other
12417 window.
12418 """
12419 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12420
12421 def Below(*args, **kwargs):
12422 """
12423 Below(self, Window sibling, int marg=0)
12424
12425 Constrains this edge to be below the given window, with an optional
12426 margin. Implicitly, this is relative to the bottom edge of the other
12427 window.
12428 """
12429 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12430
12431 def SameAs(*args, **kwargs):
12432 """
12433 SameAs(self, Window otherW, int edge, int marg=0)
12434
12435 Constrains this edge or dimension to be to the same as the edge of the
12436 given window, with an optional margin.
12437 """
12438 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12439
12440 def PercentOf(*args, **kwargs):
12441 """
12442 PercentOf(self, Window otherW, int wh, int per)
12443
12444 Constrains this edge or dimension to be to a percentage of the given
12445 window, with an optional margin.
12446 """
12447 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12448
12449 def Absolute(*args, **kwargs):
12450 """
12451 Absolute(self, int val)
12452
12453 Constrains this edge or dimension to be the given absolute value.
12454 """
12455 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12456
12457 def Unconstrained(*args, **kwargs):
12458 """
12459 Unconstrained(self)
12460
12461 Sets this edge or dimension to be unconstrained, that is, dependent on
12462 other edges and dimensions from which this value can be deduced.
12463 """
12464 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12465
12466 def AsIs(*args, **kwargs):
12467 """
12468 AsIs(self)
12469
12470 Sets this edge or constraint to be whatever the window's value is at
12471 the moment. If either of the width and height constraints are *as is*,
12472 the window will not be resized, but moved instead. This is important
12473 when considering panel items which are intended to have a default
12474 size, such as a button, which may take its size from the size of the
12475 button label.
12476 """
12477 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12478
12479 def GetOtherWindow(*args, **kwargs):
12480 """GetOtherWindow(self) -> Window"""
12481 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12482
12483 def GetMyEdge(*args, **kwargs):
12484 """GetMyEdge(self) -> int"""
12485 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12486
12487 def SetEdge(*args, **kwargs):
12488 """SetEdge(self, int which)"""
12489 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12490
12491 def SetValue(*args, **kwargs):
12492 """SetValue(self, int v)"""
12493 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12494
12495 def GetMargin(*args, **kwargs):
12496 """GetMargin(self) -> int"""
12497 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12498
12499 def SetMargin(*args, **kwargs):
12500 """SetMargin(self, int m)"""
12501 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12502
12503 def GetValue(*args, **kwargs):
12504 """GetValue(self) -> int"""
12505 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12506
12507 def GetPercent(*args, **kwargs):
12508 """GetPercent(self) -> int"""
12509 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12510
12511 def GetOtherEdge(*args, **kwargs):
12512 """GetOtherEdge(self) -> int"""
12513 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12514
12515 def GetDone(*args, **kwargs):
12516 """GetDone(self) -> bool"""
12517 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12518
12519 def SetDone(*args, **kwargs):
12520 """SetDone(self, bool d)"""
12521 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12522
12523 def GetRelationship(*args, **kwargs):
12524 """GetRelationship(self) -> int"""
12525 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12526
12527 def SetRelationship(*args, **kwargs):
12528 """SetRelationship(self, int r)"""
12529 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12530
12531 def ResetIfWin(*args, **kwargs):
12532 """
12533 ResetIfWin(self, Window otherW) -> bool
12534
12535 Reset constraint if it mentions otherWin
12536 """
12537 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12538
12539 def SatisfyConstraint(*args, **kwargs):
12540 """
12541 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12542
12543 Try to satisfy constraint
12544 """
12545 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12546
12547 def GetEdge(*args, **kwargs):
12548 """
12549 GetEdge(self, int which, Window thisWin, Window other) -> int
12550
12551 Get the value of this edge or dimension, or if this
12552 is not determinable, -1.
12553 """
12554 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12555
12556 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12557
12558 class LayoutConstraints(Object):
12559 """
12560 **Note:** constraints are now deprecated and you should use sizers
12561 instead.
12562
12563 Objects of this class can be associated with a window to define its
12564 layout constraints, with respect to siblings or its parent.
12565
12566 The class consists of the following eight constraints of class
12567 wx.IndividualLayoutConstraint, some or all of which should be accessed
12568 directly to set the appropriate constraints.
12569
12570 * left: represents the left hand edge of the window
12571 * right: represents the right hand edge of the window
12572 * top: represents the top edge of the window
12573 * bottom: represents the bottom edge of the window
12574 * width: represents the width of the window
12575 * height: represents the height of the window
12576 * centreX: represents the horizontal centre point of the window
12577 * centreY: represents the vertical centre point of the window
12578
12579 Most constraints are initially set to have the relationship
12580 wxUnconstrained, which means that their values should be calculated by
12581 looking at known constraints. The exceptions are width and height,
12582 which are set to wxAsIs to ensure that if the user does not specify a
12583 constraint, the existing width and height will be used, to be
12584 compatible with panel items which often have take a default size. If
12585 the constraint is ``wx.AsIs``, the dimension will not be changed.
12586
12587 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12588
12589 """
12590 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12591 __repr__ = _swig_repr
12592 left = property(_core_.LayoutConstraints_left_get)
12593 top = property(_core_.LayoutConstraints_top_get)
12594 right = property(_core_.LayoutConstraints_right_get)
12595 bottom = property(_core_.LayoutConstraints_bottom_get)
12596 width = property(_core_.LayoutConstraints_width_get)
12597 height = property(_core_.LayoutConstraints_height_get)
12598 centreX = property(_core_.LayoutConstraints_centreX_get)
12599 centreY = property(_core_.LayoutConstraints_centreY_get)
12600 def __init__(self, *args, **kwargs):
12601 """__init__(self) -> LayoutConstraints"""
12602 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12603 __swig_destroy__ = _core_.delete_LayoutConstraints
12604 __del__ = lambda self : None;
12605 def SatisfyConstraints(*args, **kwargs):
12606 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12607 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12608
12609 def AreSatisfied(*args, **kwargs):
12610 """AreSatisfied(self) -> bool"""
12611 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12612
12613 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12614
12615 #----------------------------------------------------------------------------
12616
12617 # Use Python's bool constants if available, make some if not
12618 try:
12619 True
12620 except NameError:
12621 __builtins__.True = 1==1
12622 __builtins__.False = 1==0
12623 def bool(value): return not not value
12624 __builtins__.bool = bool
12625
12626
12627
12628 # workarounds for bad wxRTTI names
12629 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12630 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12631 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12632
12633
12634 #----------------------------------------------------------------------------
12635 # Load version numbers from __version__... Ensure that major and minor
12636 # versions are the same for both wxPython and wxWidgets.
12637
12638 from __version__ import *
12639 __version__ = VERSION_STRING
12640
12641 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12642 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12643 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12644 import warnings
12645 warnings.warn("wxPython/wxWidgets release number mismatch")
12646
12647 #----------------------------------------------------------------------------
12648
12649 # Set wxPython's default string<-->unicode conversion encoding from
12650 # the locale, but only if Python's default hasn't been changed. (We
12651 # assume that if the user has customized it already then that is the
12652 # encoding we need to use as well.)
12653 #
12654 # The encoding selected here is used when string or unicode objects
12655 # need to be converted in order to pass them to wxWidgets. Please be
12656 # aware that the default encoding within the same locale may be
12657 # slightly different on different platforms. For example, please see
12658 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12659 # between the common latin/roman encodings.
12660
12661 default = _sys.getdefaultencoding()
12662 if default == 'ascii':
12663 import locale
12664 import codecs
12665 try:
12666 default = locale.getdefaultlocale()[1]
12667 codecs.lookup(default)
12668 except (ValueError, LookupError, TypeError):
12669 default = _sys.getdefaultencoding()
12670 del locale
12671 del codecs
12672 if default:
12673 wx.SetDefaultPyEncoding(default)
12674 del default
12675
12676 #----------------------------------------------------------------------------
12677
12678 class PyDeadObjectError(AttributeError):
12679 pass
12680
12681 class _wxPyDeadObject(object):
12682 """
12683 Instances of wx objects that are OOR capable will have their __class__
12684 changed to this class when the C++ object is deleted. This should help
12685 prevent crashes due to referencing a bogus C++ pointer.
12686 """
12687 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12688 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12689
12690 def __repr__(self):
12691 if not hasattr(self, "_name"):
12692 self._name = "[unknown]"
12693 return self.reprStr % self._name
12694
12695 def __getattr__(self, *args):
12696 if not hasattr(self, "_name"):
12697 self._name = "[unknown]"
12698 raise PyDeadObjectError(self.attrStr % self._name)
12699
12700 def __nonzero__(self):
12701 return 0
12702
12703
12704
12705 class PyUnbornObjectError(AttributeError):
12706 pass
12707
12708 class _wxPyUnbornObject(object):
12709 """
12710 Some stock objects are created when the wx._core module is
12711 imported, but their C++ instance is not created until the wx.App
12712 object is created and initialized. These object instances will
12713 temporarily have their __class__ changed to this class so an
12714 exception will be raised if they are used before the C++ instance
12715 is ready.
12716 """
12717
12718 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12719 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12720
12721 def __repr__(self):
12722 #if not hasattr(self, "_name"):
12723 # self._name = "[unknown]"
12724 return self.reprStr #% self._name
12725
12726 def __getattr__(self, *args):
12727 #if not hasattr(self, "_name"):
12728 # self._name = "[unknown]"
12729 raise PyUnbornObjectError(self.attrStr) # % self._name )
12730
12731 def __nonzero__(self):
12732 return 0
12733
12734
12735 #----------------------------------------------------------------------------
12736
12737 def CallAfter(callable, *args, **kw):
12738 """
12739 Call the specified function after the current and pending event
12740 handlers have been completed. This is also good for making GUI
12741 method calls from non-GUI threads. Any extra positional or
12742 keyword args are passed on to the callable when it is called.
12743
12744 :see: `wx.FutureCall`
12745 """
12746 app = wx.GetApp()
12747 assert app is not None, 'No wx.App created yet'
12748
12749 if not hasattr(app, "_CallAfterId"):
12750 app._CallAfterId = wx.NewEventType()
12751 app.Connect(-1, -1, app._CallAfterId,
12752 lambda event: event.callable(*event.args, **event.kw) )
12753 evt = wx.PyEvent()
12754 evt.SetEventType(app._CallAfterId)
12755 evt.callable = callable
12756 evt.args = args
12757 evt.kw = kw
12758 wx.PostEvent(app, evt)
12759
12760 #----------------------------------------------------------------------------
12761
12762
12763 class FutureCall:
12764 """
12765 A convenience class for `wx.Timer`, that calls the given callable
12766 object once after the given amount of milliseconds, passing any
12767 positional or keyword args. The return value of the callable is
12768 availbale after it has been run with the `GetResult` method.
12769
12770 If you don't need to get the return value or restart the timer
12771 then there is no need to hold a reference to this object. It will
12772 hold a reference to itself while the timer is running (the timer
12773 has a reference to self.Notify) but the cycle will be broken when
12774 the timer completes, automatically cleaning up the wx.FutureCall
12775 object.
12776
12777 :see: `wx.CallAfter`
12778 """
12779 def __init__(self, millis, callable, *args, **kwargs):
12780 self.millis = millis
12781 self.callable = callable
12782 self.SetArgs(*args, **kwargs)
12783 self.runCount = 0
12784 self.running = False
12785 self.hasRun = False
12786 self.result = None
12787 self.timer = None
12788 self.Start()
12789
12790 def __del__(self):
12791 self.Stop()
12792
12793
12794 def Start(self, millis=None, *args, **kwargs):
12795 """
12796 (Re)start the timer
12797 """
12798 self.hasRun = False
12799 if millis is not None:
12800 self.millis = millis
12801 if args or kwargs:
12802 self.SetArgs(*args, **kwargs)
12803 self.Stop()
12804 self.timer = wx.PyTimer(self.Notify)
12805 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12806 self.running = True
12807 Restart = Start
12808
12809
12810 def Stop(self):
12811 """
12812 Stop and destroy the timer.
12813 """
12814 if self.timer is not None:
12815 self.timer.Stop()
12816 self.timer = None
12817
12818
12819 def GetInterval(self):
12820 if self.timer is not None:
12821 return self.timer.GetInterval()
12822 else:
12823 return 0
12824
12825
12826 def IsRunning(self):
12827 return self.timer is not None and self.timer.IsRunning()
12828
12829
12830 def SetArgs(self, *args, **kwargs):
12831 """
12832 (Re)set the args passed to the callable object. This is
12833 useful in conjunction with Restart if you want to schedule a
12834 new call to the same callable object but with different
12835 parameters.
12836 """
12837 self.args = args
12838 self.kwargs = kwargs
12839
12840
12841 def HasRun(self):
12842 return self.hasRun
12843
12844 def GetResult(self):
12845 return self.result
12846
12847 def Notify(self):
12848 """
12849 The timer has expired so call the callable.
12850 """
12851 if self.callable and getattr(self.callable, 'im_self', True):
12852 self.runCount += 1
12853 self.running = False
12854 self.result = self.callable(*self.args, **self.kwargs)
12855 self.hasRun = True
12856 if not self.running:
12857 # if it wasn't restarted, then cleanup
12858 wx.CallAfter(self.Stop)
12859
12860
12861
12862 #----------------------------------------------------------------------------
12863 # Control which items in this module should be documented by epydoc.
12864 # We allow only classes and functions, which will help reduce the size
12865 # of the docs by filtering out the zillions of constants, EVT objects,
12866 # and etc that don't make much sense by themselves, but are instead
12867 # documented (or will be) as part of the classes/functions/methods
12868 # where they should be used.
12869
12870 class __DocFilter:
12871 """
12872 A filter for epydoc that only allows non-Ptr classes and
12873 fucntions, in order to reduce the clutter in the API docs.
12874 """
12875 def __init__(self, globals):
12876 self._globals = globals
12877
12878 def __call__(self, name):
12879 import types
12880 obj = self._globals.get(name, None)
12881 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12882 return False
12883 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12884 return False
12885 return True
12886
12887 #----------------------------------------------------------------------------
12888 #----------------------------------------------------------------------------
12889
12890 # Import other modules in this package that should show up in the
12891 # "core" wx namespace
12892 from _gdi import *
12893 from _windows import *
12894 from _controls import *
12895 from _misc import *
12896
12897 #----------------------------------------------------------------------------
12898 #----------------------------------------------------------------------------
12899
12900
12901