]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / gtk / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106 RETAINED = _core_.RETAINED
107 BACKINGSTORE = _core_.BACKINGSTORE
108 COLOURED = _core_.COLOURED
109 FIXED_LENGTH = _core_.FIXED_LENGTH
110 LB_NEEDED_SB = _core_.LB_NEEDED_SB
111 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112 LB_SORT = _core_.LB_SORT
113 LB_SINGLE = _core_.LB_SINGLE
114 LB_MULTIPLE = _core_.LB_MULTIPLE
115 LB_EXTENDED = _core_.LB_EXTENDED
116 LB_OWNERDRAW = _core_.LB_OWNERDRAW
117 LB_HSCROLL = _core_.LB_HSCROLL
118 PROCESS_ENTER = _core_.PROCESS_ENTER
119 PASSWORD = _core_.PASSWORD
120 CB_SIMPLE = _core_.CB_SIMPLE
121 CB_DROPDOWN = _core_.CB_DROPDOWN
122 CB_SORT = _core_.CB_SORT
123 CB_READONLY = _core_.CB_READONLY
124 RA_HORIZONTAL = _core_.RA_HORIZONTAL
125 RA_VERTICAL = _core_.RA_VERTICAL
126 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
128 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
129 RB_GROUP = _core_.RB_GROUP
130 RB_SINGLE = _core_.RB_SINGLE
131 SB_HORIZONTAL = _core_.SB_HORIZONTAL
132 SB_VERTICAL = _core_.SB_VERTICAL
133 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
134 ST_SIZEGRIP = _core_.ST_SIZEGRIP
135 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
136 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137 ST_DOTS_END = _core_.ST_DOTS_END
138 FLOOD_SURFACE = _core_.FLOOD_SURFACE
139 FLOOD_BORDER = _core_.FLOOD_BORDER
140 ODDEVEN_RULE = _core_.ODDEVEN_RULE
141 WINDING_RULE = _core_.WINDING_RULE
142 TOOL_TOP = _core_.TOOL_TOP
143 TOOL_BOTTOM = _core_.TOOL_BOTTOM
144 TOOL_LEFT = _core_.TOOL_LEFT
145 TOOL_RIGHT = _core_.TOOL_RIGHT
146 OK = _core_.OK
147 YES_NO = _core_.YES_NO
148 CANCEL = _core_.CANCEL
149 YES = _core_.YES
150 NO = _core_.NO
151 NO_DEFAULT = _core_.NO_DEFAULT
152 YES_DEFAULT = _core_.YES_DEFAULT
153 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154 ICON_HAND = _core_.ICON_HAND
155 ICON_QUESTION = _core_.ICON_QUESTION
156 ICON_INFORMATION = _core_.ICON_INFORMATION
157 ICON_STOP = _core_.ICON_STOP
158 ICON_ASTERISK = _core_.ICON_ASTERISK
159 ICON_MASK = _core_.ICON_MASK
160 ICON_WARNING = _core_.ICON_WARNING
161 ICON_ERROR = _core_.ICON_ERROR
162 FORWARD = _core_.FORWARD
163 BACKWARD = _core_.BACKWARD
164 RESET = _core_.RESET
165 HELP = _core_.HELP
166 MORE = _core_.MORE
167 SETUP = _core_.SETUP
168 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170 SIZE_AUTO = _core_.SIZE_AUTO
171 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
173 SIZE_FORCE = _core_.SIZE_FORCE
174 PORTRAIT = _core_.PORTRAIT
175 LANDSCAPE = _core_.LANDSCAPE
176 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180 ID_ANY = _core_.ID_ANY
181 ID_SEPARATOR = _core_.ID_SEPARATOR
182 ID_NONE = _core_.ID_NONE
183 ID_LOWEST = _core_.ID_LOWEST
184 ID_OPEN = _core_.ID_OPEN
185 ID_CLOSE = _core_.ID_CLOSE
186 ID_NEW = _core_.ID_NEW
187 ID_SAVE = _core_.ID_SAVE
188 ID_SAVEAS = _core_.ID_SAVEAS
189 ID_REVERT = _core_.ID_REVERT
190 ID_EXIT = _core_.ID_EXIT
191 ID_UNDO = _core_.ID_UNDO
192 ID_REDO = _core_.ID_REDO
193 ID_HELP = _core_.ID_HELP
194 ID_PRINT = _core_.ID_PRINT
195 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196 ID_PREVIEW = _core_.ID_PREVIEW
197 ID_ABOUT = _core_.ID_ABOUT
198 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203 ID_PREFERENCES = _core_.ID_PREFERENCES
204 ID_CUT = _core_.ID_CUT
205 ID_COPY = _core_.ID_COPY
206 ID_PASTE = _core_.ID_PASTE
207 ID_CLEAR = _core_.ID_CLEAR
208 ID_FIND = _core_.ID_FIND
209 ID_DUPLICATE = _core_.ID_DUPLICATE
210 ID_SELECTALL = _core_.ID_SELECTALL
211 ID_DELETE = _core_.ID_DELETE
212 ID_REPLACE = _core_.ID_REPLACE
213 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214 ID_PROPERTIES = _core_.ID_PROPERTIES
215 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST = _core_.ID_VIEW_LIST
219 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223 ID_FILE1 = _core_.ID_FILE1
224 ID_FILE2 = _core_.ID_FILE2
225 ID_FILE3 = _core_.ID_FILE3
226 ID_FILE4 = _core_.ID_FILE4
227 ID_FILE5 = _core_.ID_FILE5
228 ID_FILE6 = _core_.ID_FILE6
229 ID_FILE7 = _core_.ID_FILE7
230 ID_FILE8 = _core_.ID_FILE8
231 ID_FILE9 = _core_.ID_FILE9
232 ID_OK = _core_.ID_OK
233 ID_CANCEL = _core_.ID_CANCEL
234 ID_APPLY = _core_.ID_APPLY
235 ID_YES = _core_.ID_YES
236 ID_NO = _core_.ID_NO
237 ID_STATIC = _core_.ID_STATIC
238 ID_FORWARD = _core_.ID_FORWARD
239 ID_BACKWARD = _core_.ID_BACKWARD
240 ID_DEFAULT = _core_.ID_DEFAULT
241 ID_MORE = _core_.ID_MORE
242 ID_SETUP = _core_.ID_SETUP
243 ID_RESET = _core_.ID_RESET
244 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245 ID_YESTOALL = _core_.ID_YESTOALL
246 ID_NOTOALL = _core_.ID_NOTOALL
247 ID_ABORT = _core_.ID_ABORT
248 ID_RETRY = _core_.ID_RETRY
249 ID_IGNORE = _core_.ID_IGNORE
250 ID_ADD = _core_.ID_ADD
251 ID_REMOVE = _core_.ID_REMOVE
252 ID_UP = _core_.ID_UP
253 ID_DOWN = _core_.ID_DOWN
254 ID_HOME = _core_.ID_HOME
255 ID_REFRESH = _core_.ID_REFRESH
256 ID_STOP = _core_.ID_STOP
257 ID_INDEX = _core_.ID_INDEX
258 ID_BOLD = _core_.ID_BOLD
259 ID_ITALIC = _core_.ID_ITALIC
260 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264 ID_UNDERLINE = _core_.ID_UNDERLINE
265 ID_INDENT = _core_.ID_INDENT
266 ID_UNINDENT = _core_.ID_UNINDENT
267 ID_ZOOM_100 = _core_.ID_ZOOM_100
268 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269 ID_ZOOM_IN = _core_.ID_ZOOM_IN
270 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271 ID_UNDELETE = _core_.ID_UNDELETE
272 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
273 ID_HIGHEST = _core_.ID_HIGHEST
274 OPEN = _core_.OPEN
275 SAVE = _core_.SAVE
276 HIDE_READONLY = _core_.HIDE_READONLY
277 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
278 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
279 MULTIPLE = _core_.MULTIPLE
280 CHANGE_DIR = _core_.CHANGE_DIR
281 ACCEL_ALT = _core_.ACCEL_ALT
282 ACCEL_CTRL = _core_.ACCEL_CTRL
283 ACCEL_SHIFT = _core_.ACCEL_SHIFT
284 ACCEL_NORMAL = _core_.ACCEL_NORMAL
285 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
286 PD_APP_MODAL = _core_.PD_APP_MODAL
287 PD_CAN_ABORT = _core_.PD_CAN_ABORT
288 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
289 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
290 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
291 PD_SMOOTH = _core_.PD_SMOOTH
292 PD_CAN_SKIP = _core_.PD_CAN_SKIP
293 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
294 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
295 DD_CHANGE_DIR = _core_.DD_CHANGE_DIR
296 MENU_TEAROFF = _core_.MENU_TEAROFF
297 MB_DOCKABLE = _core_.MB_DOCKABLE
298 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
299 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
300 LI_HORIZONTAL = _core_.LI_HORIZONTAL
301 LI_VERTICAL = _core_.LI_VERTICAL
302 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
303 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
304 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
305 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
306 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
307 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
308 MM_TEXT = _core_.MM_TEXT
309 MM_LOMETRIC = _core_.MM_LOMETRIC
310 MM_HIMETRIC = _core_.MM_HIMETRIC
311 MM_LOENGLISH = _core_.MM_LOENGLISH
312 MM_HIENGLISH = _core_.MM_HIENGLISH
313 MM_TWIPS = _core_.MM_TWIPS
314 MM_ISOTROPIC = _core_.MM_ISOTROPIC
315 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
316 MM_POINTS = _core_.MM_POINTS
317 MM_METRIC = _core_.MM_METRIC
318 CENTRE = _core_.CENTRE
319 CENTER = _core_.CENTER
320 HORIZONTAL = _core_.HORIZONTAL
321 VERTICAL = _core_.VERTICAL
322 BOTH = _core_.BOTH
323 LEFT = _core_.LEFT
324 RIGHT = _core_.RIGHT
325 UP = _core_.UP
326 DOWN = _core_.DOWN
327 TOP = _core_.TOP
328 BOTTOM = _core_.BOTTOM
329 NORTH = _core_.NORTH
330 SOUTH = _core_.SOUTH
331 WEST = _core_.WEST
332 EAST = _core_.EAST
333 ALL = _core_.ALL
334 ALIGN_NOT = _core_.ALIGN_NOT
335 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
336 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
337 ALIGN_LEFT = _core_.ALIGN_LEFT
338 ALIGN_TOP = _core_.ALIGN_TOP
339 ALIGN_RIGHT = _core_.ALIGN_RIGHT
340 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
341 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
342 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
343 ALIGN_CENTER = _core_.ALIGN_CENTER
344 ALIGN_CENTRE = _core_.ALIGN_CENTRE
345 ALIGN_MASK = _core_.ALIGN_MASK
346 STRETCH_NOT = _core_.STRETCH_NOT
347 SHRINK = _core_.SHRINK
348 GROW = _core_.GROW
349 EXPAND = _core_.EXPAND
350 SHAPED = _core_.SHAPED
351 FIXED_MINSIZE = _core_.FIXED_MINSIZE
352 TILE = _core_.TILE
353 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
354 BORDER_DEFAULT = _core_.BORDER_DEFAULT
355 BORDER_NONE = _core_.BORDER_NONE
356 BORDER_STATIC = _core_.BORDER_STATIC
357 BORDER_SIMPLE = _core_.BORDER_SIMPLE
358 BORDER_RAISED = _core_.BORDER_RAISED
359 BORDER_SUNKEN = _core_.BORDER_SUNKEN
360 BORDER_DOUBLE = _core_.BORDER_DOUBLE
361 BORDER_MASK = _core_.BORDER_MASK
362 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
363 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
364 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
365 DEFAULT = _core_.DEFAULT
366 DECORATIVE = _core_.DECORATIVE
367 ROMAN = _core_.ROMAN
368 SCRIPT = _core_.SCRIPT
369 SWISS = _core_.SWISS
370 MODERN = _core_.MODERN
371 TELETYPE = _core_.TELETYPE
372 VARIABLE = _core_.VARIABLE
373 FIXED = _core_.FIXED
374 NORMAL = _core_.NORMAL
375 LIGHT = _core_.LIGHT
376 BOLD = _core_.BOLD
377 ITALIC = _core_.ITALIC
378 SLANT = _core_.SLANT
379 SOLID = _core_.SOLID
380 DOT = _core_.DOT
381 LONG_DASH = _core_.LONG_DASH
382 SHORT_DASH = _core_.SHORT_DASH
383 DOT_DASH = _core_.DOT_DASH
384 USER_DASH = _core_.USER_DASH
385 TRANSPARENT = _core_.TRANSPARENT
386 STIPPLE = _core_.STIPPLE
387 STIPPLE_MASK = _core_.STIPPLE_MASK
388 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
389 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
390 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
391 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
392 CROSS_HATCH = _core_.CROSS_HATCH
393 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
394 VERTICAL_HATCH = _core_.VERTICAL_HATCH
395 JOIN_BEVEL = _core_.JOIN_BEVEL
396 JOIN_MITER = _core_.JOIN_MITER
397 JOIN_ROUND = _core_.JOIN_ROUND
398 CAP_ROUND = _core_.CAP_ROUND
399 CAP_PROJECTING = _core_.CAP_PROJECTING
400 CAP_BUTT = _core_.CAP_BUTT
401 CLEAR = _core_.CLEAR
402 XOR = _core_.XOR
403 INVERT = _core_.INVERT
404 OR_REVERSE = _core_.OR_REVERSE
405 AND_REVERSE = _core_.AND_REVERSE
406 COPY = _core_.COPY
407 AND = _core_.AND
408 AND_INVERT = _core_.AND_INVERT
409 NO_OP = _core_.NO_OP
410 NOR = _core_.NOR
411 EQUIV = _core_.EQUIV
412 SRC_INVERT = _core_.SRC_INVERT
413 OR_INVERT = _core_.OR_INVERT
414 NAND = _core_.NAND
415 OR = _core_.OR
416 SET = _core_.SET
417 WXK_BACK = _core_.WXK_BACK
418 WXK_TAB = _core_.WXK_TAB
419 WXK_RETURN = _core_.WXK_RETURN
420 WXK_ESCAPE = _core_.WXK_ESCAPE
421 WXK_SPACE = _core_.WXK_SPACE
422 WXK_DELETE = _core_.WXK_DELETE
423 WXK_START = _core_.WXK_START
424 WXK_LBUTTON = _core_.WXK_LBUTTON
425 WXK_RBUTTON = _core_.WXK_RBUTTON
426 WXK_CANCEL = _core_.WXK_CANCEL
427 WXK_MBUTTON = _core_.WXK_MBUTTON
428 WXK_CLEAR = _core_.WXK_CLEAR
429 WXK_SHIFT = _core_.WXK_SHIFT
430 WXK_ALT = _core_.WXK_ALT
431 WXK_CONTROL = _core_.WXK_CONTROL
432 WXK_MENU = _core_.WXK_MENU
433 WXK_PAUSE = _core_.WXK_PAUSE
434 WXK_CAPITAL = _core_.WXK_CAPITAL
435 WXK_PRIOR = _core_.WXK_PRIOR
436 WXK_NEXT = _core_.WXK_NEXT
437 WXK_END = _core_.WXK_END
438 WXK_HOME = _core_.WXK_HOME
439 WXK_LEFT = _core_.WXK_LEFT
440 WXK_UP = _core_.WXK_UP
441 WXK_RIGHT = _core_.WXK_RIGHT
442 WXK_DOWN = _core_.WXK_DOWN
443 WXK_SELECT = _core_.WXK_SELECT
444 WXK_PRINT = _core_.WXK_PRINT
445 WXK_EXECUTE = _core_.WXK_EXECUTE
446 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
447 WXK_INSERT = _core_.WXK_INSERT
448 WXK_HELP = _core_.WXK_HELP
449 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
450 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
451 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
452 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
453 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
454 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
455 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
456 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
457 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
458 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
459 WXK_MULTIPLY = _core_.WXK_MULTIPLY
460 WXK_ADD = _core_.WXK_ADD
461 WXK_SEPARATOR = _core_.WXK_SEPARATOR
462 WXK_SUBTRACT = _core_.WXK_SUBTRACT
463 WXK_DECIMAL = _core_.WXK_DECIMAL
464 WXK_DIVIDE = _core_.WXK_DIVIDE
465 WXK_F1 = _core_.WXK_F1
466 WXK_F2 = _core_.WXK_F2
467 WXK_F3 = _core_.WXK_F3
468 WXK_F4 = _core_.WXK_F4
469 WXK_F5 = _core_.WXK_F5
470 WXK_F6 = _core_.WXK_F6
471 WXK_F7 = _core_.WXK_F7
472 WXK_F8 = _core_.WXK_F8
473 WXK_F9 = _core_.WXK_F9
474 WXK_F10 = _core_.WXK_F10
475 WXK_F11 = _core_.WXK_F11
476 WXK_F12 = _core_.WXK_F12
477 WXK_F13 = _core_.WXK_F13
478 WXK_F14 = _core_.WXK_F14
479 WXK_F15 = _core_.WXK_F15
480 WXK_F16 = _core_.WXK_F16
481 WXK_F17 = _core_.WXK_F17
482 WXK_F18 = _core_.WXK_F18
483 WXK_F19 = _core_.WXK_F19
484 WXK_F20 = _core_.WXK_F20
485 WXK_F21 = _core_.WXK_F21
486 WXK_F22 = _core_.WXK_F22
487 WXK_F23 = _core_.WXK_F23
488 WXK_F24 = _core_.WXK_F24
489 WXK_NUMLOCK = _core_.WXK_NUMLOCK
490 WXK_SCROLL = _core_.WXK_SCROLL
491 WXK_PAGEUP = _core_.WXK_PAGEUP
492 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
493 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
494 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
495 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
496 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
497 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
498 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
499 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
500 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
501 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
502 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
503 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
504 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
505 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
506 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
507 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
508 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
509 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
510 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
511 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
512 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
513 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
514 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
515 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
516 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
517 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
518 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
519 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
520 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
521 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
522 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
523 WXK_COMMAND = _core_.WXK_COMMAND
524 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
525 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
526 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
527 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
528 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
529 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
530 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
531 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
532 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
533 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
534 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
535 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
536 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
537 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
538 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
539 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
540 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
541 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
542 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
543 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
544 PAPER_NONE = _core_.PAPER_NONE
545 PAPER_LETTER = _core_.PAPER_LETTER
546 PAPER_LEGAL = _core_.PAPER_LEGAL
547 PAPER_A4 = _core_.PAPER_A4
548 PAPER_CSHEET = _core_.PAPER_CSHEET
549 PAPER_DSHEET = _core_.PAPER_DSHEET
550 PAPER_ESHEET = _core_.PAPER_ESHEET
551 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
552 PAPER_TABLOID = _core_.PAPER_TABLOID
553 PAPER_LEDGER = _core_.PAPER_LEDGER
554 PAPER_STATEMENT = _core_.PAPER_STATEMENT
555 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
556 PAPER_A3 = _core_.PAPER_A3
557 PAPER_A4SMALL = _core_.PAPER_A4SMALL
558 PAPER_A5 = _core_.PAPER_A5
559 PAPER_B4 = _core_.PAPER_B4
560 PAPER_B5 = _core_.PAPER_B5
561 PAPER_FOLIO = _core_.PAPER_FOLIO
562 PAPER_QUARTO = _core_.PAPER_QUARTO
563 PAPER_10X14 = _core_.PAPER_10X14
564 PAPER_11X17 = _core_.PAPER_11X17
565 PAPER_NOTE = _core_.PAPER_NOTE
566 PAPER_ENV_9 = _core_.PAPER_ENV_9
567 PAPER_ENV_10 = _core_.PAPER_ENV_10
568 PAPER_ENV_11 = _core_.PAPER_ENV_11
569 PAPER_ENV_12 = _core_.PAPER_ENV_12
570 PAPER_ENV_14 = _core_.PAPER_ENV_14
571 PAPER_ENV_DL = _core_.PAPER_ENV_DL
572 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
573 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
574 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
575 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
576 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
577 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
578 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
579 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
580 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
581 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
582 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
583 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
584 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
585 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
586 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
587 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
588 PAPER_9X11 = _core_.PAPER_9X11
589 PAPER_10X11 = _core_.PAPER_10X11
590 PAPER_15X11 = _core_.PAPER_15X11
591 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
592 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
593 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
594 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
595 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
596 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
597 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
598 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
599 PAPER_A_PLUS = _core_.PAPER_A_PLUS
600 PAPER_B_PLUS = _core_.PAPER_B_PLUS
601 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
602 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
603 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
604 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
605 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
606 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
607 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
608 PAPER_A2 = _core_.PAPER_A2
609 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
610 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
611 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
612 PAPER_A6 = _core_.PAPER_A6
613 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
614 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
615 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
616 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
617 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
618 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
619 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
620 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
621 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
622 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
623 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
624 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
625 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
626 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
627 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
628 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
629 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
630 PAPER_B6_JIS = _core_.PAPER_B6_JIS
631 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
632 PAPER_12X11 = _core_.PAPER_12X11
633 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
634 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
635 PAPER_P16K = _core_.PAPER_P16K
636 PAPER_P32K = _core_.PAPER_P32K
637 PAPER_P32KBIG = _core_.PAPER_P32KBIG
638 PAPER_PENV_1 = _core_.PAPER_PENV_1
639 PAPER_PENV_2 = _core_.PAPER_PENV_2
640 PAPER_PENV_3 = _core_.PAPER_PENV_3
641 PAPER_PENV_4 = _core_.PAPER_PENV_4
642 PAPER_PENV_5 = _core_.PAPER_PENV_5
643 PAPER_PENV_6 = _core_.PAPER_PENV_6
644 PAPER_PENV_7 = _core_.PAPER_PENV_7
645 PAPER_PENV_8 = _core_.PAPER_PENV_8
646 PAPER_PENV_9 = _core_.PAPER_PENV_9
647 PAPER_PENV_10 = _core_.PAPER_PENV_10
648 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
649 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
650 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
651 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
652 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
653 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
654 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
655 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
656 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
657 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
658 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
659 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
660 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
661 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
662 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
663 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
664 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
665 ITEM_NORMAL = _core_.ITEM_NORMAL
666 ITEM_CHECK = _core_.ITEM_CHECK
667 ITEM_RADIO = _core_.ITEM_RADIO
668 ITEM_MAX = _core_.ITEM_MAX
669 HT_NOWHERE = _core_.HT_NOWHERE
670 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
671 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
672 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
673 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
674 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
675 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
676 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
677 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
678 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
679 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
680 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
681 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
682 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
683 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
684 HT_MAX = _core_.HT_MAX
685 MOD_NONE = _core_.MOD_NONE
686 MOD_ALT = _core_.MOD_ALT
687 MOD_CONTROL = _core_.MOD_CONTROL
688 MOD_ALTGR = _core_.MOD_ALTGR
689 MOD_SHIFT = _core_.MOD_SHIFT
690 MOD_META = _core_.MOD_META
691 MOD_WIN = _core_.MOD_WIN
692 MOD_CMD = _core_.MOD_CMD
693 MOD_ALL = _core_.MOD_ALL
694 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
695 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
696 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
697 #---------------------------------------------------------------------------
698
699 class Object(object):
700 """
701 The base class for most wx objects, although in wxPython not
702 much functionality is needed nor exposed.
703 """
704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
705 def __init__(self): raise AttributeError, "No constructor defined"
706 __repr__ = _swig_repr
707 def GetClassName(*args, **kwargs):
708 """
709 GetClassName(self) -> String
710
711 Returns the class name of the C++ class using wxRTTI.
712 """
713 return _core_.Object_GetClassName(*args, **kwargs)
714
715 def Destroy(*args, **kwargs):
716 """
717 Destroy(self)
718
719 Deletes the C++ object this Python object is a proxy for.
720 """
721 val = _core_.Object_Destroy(*args, **kwargs)
722 args[0].thisown = 0
723 return val
724
725 _core_.Object_swigregister(Object)
726 _wxPySetDictionary = _core_._wxPySetDictionary
727 cvar = _core_.cvar
728 EmptyString = cvar.EmptyString
729
730 #---------------------------------------------------------------------------
731
732 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
733 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
734 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
735 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
736 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
737 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
738 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
739 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
740 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
741 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
742 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
743 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
744 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
745 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
746 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
747 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
748 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
749 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
750 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
751 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
752 CURSOR_NONE = _core_.CURSOR_NONE
753 CURSOR_ARROW = _core_.CURSOR_ARROW
754 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
755 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
756 CURSOR_CHAR = _core_.CURSOR_CHAR
757 CURSOR_CROSS = _core_.CURSOR_CROSS
758 CURSOR_HAND = _core_.CURSOR_HAND
759 CURSOR_IBEAM = _core_.CURSOR_IBEAM
760 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
761 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
762 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
763 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
764 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
765 CURSOR_PENCIL = _core_.CURSOR_PENCIL
766 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
767 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
768 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
769 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
770 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
771 CURSOR_SIZENS = _core_.CURSOR_SIZENS
772 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
773 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
774 CURSOR_SIZING = _core_.CURSOR_SIZING
775 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
776 CURSOR_WAIT = _core_.CURSOR_WAIT
777 CURSOR_WATCH = _core_.CURSOR_WATCH
778 CURSOR_BLANK = _core_.CURSOR_BLANK
779 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
780 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
781 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
782 CURSOR_MAX = _core_.CURSOR_MAX
783 #---------------------------------------------------------------------------
784
785 class Size(object):
786 """
787 wx.Size is a useful data structure used to represent the size of
788 something. It simply contains integer width and height
789 properties. In most places in wxPython where a wx.Size is
790 expected a (width, height) tuple can be used instead.
791 """
792 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
793 __repr__ = _swig_repr
794 width = property(_core_.Size_width_get, _core_.Size_width_set)
795 height = property(_core_.Size_height_get, _core_.Size_height_set)
796 x = width; y = height
797 def __init__(self, *args, **kwargs):
798 """
799 __init__(self, int w=0, int h=0) -> Size
800
801 Creates a size object.
802 """
803 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
804 __swig_destroy__ = _core_.delete_Size
805 __del__ = lambda self : None;
806 def __eq__(*args, **kwargs):
807 """
808 __eq__(self, PyObject other) -> bool
809
810 Test for equality of wx.Size objects.
811 """
812 return _core_.Size___eq__(*args, **kwargs)
813
814 def __ne__(*args, **kwargs):
815 """
816 __ne__(self, PyObject other) -> bool
817
818 Test for inequality of wx.Size objects.
819 """
820 return _core_.Size___ne__(*args, **kwargs)
821
822 def __add__(*args, **kwargs):
823 """
824 __add__(self, Size sz) -> Size
825
826 Add sz's proprties to this and return the result.
827 """
828 return _core_.Size___add__(*args, **kwargs)
829
830 def __sub__(*args, **kwargs):
831 """
832 __sub__(self, Size sz) -> Size
833
834 Subtract sz's properties from this and return the result.
835 """
836 return _core_.Size___sub__(*args, **kwargs)
837
838 def IncTo(*args, **kwargs):
839 """
840 IncTo(self, Size sz)
841
842 Increments this object so that both of its dimensions are not less
843 than the corresponding dimensions of the size.
844 """
845 return _core_.Size_IncTo(*args, **kwargs)
846
847 def DecTo(*args, **kwargs):
848 """
849 DecTo(self, Size sz)
850
851 Decrements this object so that both of its dimensions are not greater
852 than the corresponding dimensions of the size.
853 """
854 return _core_.Size_DecTo(*args, **kwargs)
855
856 def Set(*args, **kwargs):
857 """
858 Set(self, int w, int h)
859
860 Set both width and height.
861 """
862 return _core_.Size_Set(*args, **kwargs)
863
864 def SetWidth(*args, **kwargs):
865 """SetWidth(self, int w)"""
866 return _core_.Size_SetWidth(*args, **kwargs)
867
868 def SetHeight(*args, **kwargs):
869 """SetHeight(self, int h)"""
870 return _core_.Size_SetHeight(*args, **kwargs)
871
872 def GetWidth(*args, **kwargs):
873 """GetWidth(self) -> int"""
874 return _core_.Size_GetWidth(*args, **kwargs)
875
876 def GetHeight(*args, **kwargs):
877 """GetHeight(self) -> int"""
878 return _core_.Size_GetHeight(*args, **kwargs)
879
880 def IsFullySpecified(*args, **kwargs):
881 """
882 IsFullySpecified(self) -> bool
883
884 Returns True if both components of the size are non-default values.
885 """
886 return _core_.Size_IsFullySpecified(*args, **kwargs)
887
888 def SetDefaults(*args, **kwargs):
889 """
890 SetDefaults(self, Size size)
891
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
894 """
895 return _core_.Size_SetDefaults(*args, **kwargs)
896
897 def Get(*args, **kwargs):
898 """
899 Get() -> (width,height)
900
901 Returns the width and height properties as a tuple.
902 """
903 return _core_.Size_Get(*args, **kwargs)
904
905 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
906 def __str__(self): return str(self.Get())
907 def __repr__(self): return 'wx.Size'+str(self.Get())
908 def __len__(self): return len(self.Get())
909 def __getitem__(self, index): return self.Get()[index]
910 def __setitem__(self, index, val):
911 if index == 0: self.width = val
912 elif index == 1: self.height = val
913 else: raise IndexError
914 def __nonzero__(self): return self.Get() != (0,0)
915 __safe_for_unpickling__ = True
916 def __reduce__(self): return (wx.Size, self.Get())
917
918 _core_.Size_swigregister(Size)
919
920 #---------------------------------------------------------------------------
921
922 class RealPoint(object):
923 """
924 A data structure for representing a point or position with floating
925 point x and y properties. In wxPython most places that expect a
926 wx.RealPoint can also accept a (x,y) tuple.
927 """
928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
929 __repr__ = _swig_repr
930 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
931 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
932 def __init__(self, *args, **kwargs):
933 """
934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
935
936 Create a wx.RealPoint object
937 """
938 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
939 __swig_destroy__ = _core_.delete_RealPoint
940 __del__ = lambda self : None;
941 def __eq__(*args, **kwargs):
942 """
943 __eq__(self, PyObject other) -> bool
944
945 Test for equality of wx.RealPoint objects.
946 """
947 return _core_.RealPoint___eq__(*args, **kwargs)
948
949 def __ne__(*args, **kwargs):
950 """
951 __ne__(self, PyObject other) -> bool
952
953 Test for inequality of wx.RealPoint objects.
954 """
955 return _core_.RealPoint___ne__(*args, **kwargs)
956
957 def __add__(*args, **kwargs):
958 """
959 __add__(self, RealPoint pt) -> RealPoint
960
961 Add pt's proprties to this and return the result.
962 """
963 return _core_.RealPoint___add__(*args, **kwargs)
964
965 def __sub__(*args, **kwargs):
966 """
967 __sub__(self, RealPoint pt) -> RealPoint
968
969 Subtract pt's proprties from this and return the result
970 """
971 return _core_.RealPoint___sub__(*args, **kwargs)
972
973 def Set(*args, **kwargs):
974 """
975 Set(self, double x, double y)
976
977 Set both the x and y properties
978 """
979 return _core_.RealPoint_Set(*args, **kwargs)
980
981 def Get(*args, **kwargs):
982 """
983 Get() -> (x,y)
984
985 Return the x and y properties as a tuple.
986 """
987 return _core_.RealPoint_Get(*args, **kwargs)
988
989 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
990 def __str__(self): return str(self.Get())
991 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
992 def __len__(self): return len(self.Get())
993 def __getitem__(self, index): return self.Get()[index]
994 def __setitem__(self, index, val):
995 if index == 0: self.x = val
996 elif index == 1: self.y = val
997 else: raise IndexError
998 def __nonzero__(self): return self.Get() != (0.0, 0.0)
999 __safe_for_unpickling__ = True
1000 def __reduce__(self): return (wx.RealPoint, self.Get())
1001
1002 _core_.RealPoint_swigregister(RealPoint)
1003
1004 #---------------------------------------------------------------------------
1005
1006 class Point(object):
1007 """
1008 A data structure for representing a point or position with integer x
1009 and y properties. Most places in wxPython that expect a wx.Point can
1010 also accept a (x,y) tuple.
1011 """
1012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1013 __repr__ = _swig_repr
1014 x = property(_core_.Point_x_get, _core_.Point_x_set)
1015 y = property(_core_.Point_y_get, _core_.Point_y_set)
1016 def __init__(self, *args, **kwargs):
1017 """
1018 __init__(self, int x=0, int y=0) -> Point
1019
1020 Create a wx.Point object
1021 """
1022 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1023 __swig_destroy__ = _core_.delete_Point
1024 __del__ = lambda self : None;
1025 def __eq__(*args, **kwargs):
1026 """
1027 __eq__(self, PyObject other) -> bool
1028
1029 Test for equality of wx.Point objects.
1030 """
1031 return _core_.Point___eq__(*args, **kwargs)
1032
1033 def __ne__(*args, **kwargs):
1034 """
1035 __ne__(self, PyObject other) -> bool
1036
1037 Test for inequality of wx.Point objects.
1038 """
1039 return _core_.Point___ne__(*args, **kwargs)
1040
1041 def __add__(*args, **kwargs):
1042 """
1043 __add__(self, Point pt) -> Point
1044
1045 Add pt's proprties to this and return the result.
1046 """
1047 return _core_.Point___add__(*args, **kwargs)
1048
1049 def __sub__(*args, **kwargs):
1050 """
1051 __sub__(self, Point pt) -> Point
1052
1053 Subtract pt's proprties from this and return the result
1054 """
1055 return _core_.Point___sub__(*args, **kwargs)
1056
1057 def __iadd__(*args, **kwargs):
1058 """
1059 __iadd__(self, Point pt) -> Point
1060
1061 Add pt to this object.
1062 """
1063 return _core_.Point___iadd__(*args, **kwargs)
1064
1065 def __isub__(*args, **kwargs):
1066 """
1067 __isub__(self, Point pt) -> Point
1068
1069 Subtract pt from this object.
1070 """
1071 return _core_.Point___isub__(*args, **kwargs)
1072
1073 def Set(*args, **kwargs):
1074 """
1075 Set(self, long x, long y)
1076
1077 Set both the x and y properties
1078 """
1079 return _core_.Point_Set(*args, **kwargs)
1080
1081 def Get(*args, **kwargs):
1082 """
1083 Get() -> (x,y)
1084
1085 Return the x and y properties as a tuple.
1086 """
1087 return _core_.Point_Get(*args, **kwargs)
1088
1089 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1090 def __str__(self): return str(self.Get())
1091 def __repr__(self): return 'wx.Point'+str(self.Get())
1092 def __len__(self): return len(self.Get())
1093 def __getitem__(self, index): return self.Get()[index]
1094 def __setitem__(self, index, val):
1095 if index == 0: self.x = val
1096 elif index == 1: self.y = val
1097 else: raise IndexError
1098 def __nonzero__(self): return self.Get() != (0,0)
1099 __safe_for_unpickling__ = True
1100 def __reduce__(self): return (wx.Point, self.Get())
1101
1102 _core_.Point_swigregister(Point)
1103
1104 #---------------------------------------------------------------------------
1105
1106 class Rect(object):
1107 """
1108 A class for representing and manipulating rectangles. It has x, y,
1109 width and height properties. In wxPython most palces that expect a
1110 wx.Rect can also accept a (x,y,width,height) tuple.
1111 """
1112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1113 __repr__ = _swig_repr
1114 def __init__(self, *args, **kwargs):
1115 """
1116 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1117
1118 Create a new Rect object.
1119 """
1120 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1121 __swig_destroy__ = _core_.delete_Rect
1122 __del__ = lambda self : None;
1123 def GetX(*args, **kwargs):
1124 """GetX(self) -> int"""
1125 return _core_.Rect_GetX(*args, **kwargs)
1126
1127 def SetX(*args, **kwargs):
1128 """SetX(self, int x)"""
1129 return _core_.Rect_SetX(*args, **kwargs)
1130
1131 def GetY(*args, **kwargs):
1132 """GetY(self) -> int"""
1133 return _core_.Rect_GetY(*args, **kwargs)
1134
1135 def SetY(*args, **kwargs):
1136 """SetY(self, int y)"""
1137 return _core_.Rect_SetY(*args, **kwargs)
1138
1139 def GetWidth(*args, **kwargs):
1140 """GetWidth(self) -> int"""
1141 return _core_.Rect_GetWidth(*args, **kwargs)
1142
1143 def SetWidth(*args, **kwargs):
1144 """SetWidth(self, int w)"""
1145 return _core_.Rect_SetWidth(*args, **kwargs)
1146
1147 def GetHeight(*args, **kwargs):
1148 """GetHeight(self) -> int"""
1149 return _core_.Rect_GetHeight(*args, **kwargs)
1150
1151 def SetHeight(*args, **kwargs):
1152 """SetHeight(self, int h)"""
1153 return _core_.Rect_SetHeight(*args, **kwargs)
1154
1155 def GetPosition(*args, **kwargs):
1156 """GetPosition(self) -> Point"""
1157 return _core_.Rect_GetPosition(*args, **kwargs)
1158
1159 def SetPosition(*args, **kwargs):
1160 """SetPosition(self, Point p)"""
1161 return _core_.Rect_SetPosition(*args, **kwargs)
1162
1163 def GetSize(*args, **kwargs):
1164 """GetSize(self) -> Size"""
1165 return _core_.Rect_GetSize(*args, **kwargs)
1166
1167 def SetSize(*args, **kwargs):
1168 """SetSize(self, Size s)"""
1169 return _core_.Rect_SetSize(*args, **kwargs)
1170
1171 def IsEmpty(*args, **kwargs):
1172 """IsEmpty(self) -> bool"""
1173 return _core_.Rect_IsEmpty(*args, **kwargs)
1174
1175 def GetTopLeft(*args, **kwargs):
1176 """GetTopLeft(self) -> Point"""
1177 return _core_.Rect_GetTopLeft(*args, **kwargs)
1178
1179 def SetTopLeft(*args, **kwargs):
1180 """SetTopLeft(self, Point p)"""
1181 return _core_.Rect_SetTopLeft(*args, **kwargs)
1182
1183 def GetBottomRight(*args, **kwargs):
1184 """GetBottomRight(self) -> Point"""
1185 return _core_.Rect_GetBottomRight(*args, **kwargs)
1186
1187 def SetBottomRight(*args, **kwargs):
1188 """SetBottomRight(self, Point p)"""
1189 return _core_.Rect_SetBottomRight(*args, **kwargs)
1190
1191 def GetLeft(*args, **kwargs):
1192 """GetLeft(self) -> int"""
1193 return _core_.Rect_GetLeft(*args, **kwargs)
1194
1195 def GetTop(*args, **kwargs):
1196 """GetTop(self) -> int"""
1197 return _core_.Rect_GetTop(*args, **kwargs)
1198
1199 def GetBottom(*args, **kwargs):
1200 """GetBottom(self) -> int"""
1201 return _core_.Rect_GetBottom(*args, **kwargs)
1202
1203 def GetRight(*args, **kwargs):
1204 """GetRight(self) -> int"""
1205 return _core_.Rect_GetRight(*args, **kwargs)
1206
1207 def SetLeft(*args, **kwargs):
1208 """SetLeft(self, int left)"""
1209 return _core_.Rect_SetLeft(*args, **kwargs)
1210
1211 def SetRight(*args, **kwargs):
1212 """SetRight(self, int right)"""
1213 return _core_.Rect_SetRight(*args, **kwargs)
1214
1215 def SetTop(*args, **kwargs):
1216 """SetTop(self, int top)"""
1217 return _core_.Rect_SetTop(*args, **kwargs)
1218
1219 def SetBottom(*args, **kwargs):
1220 """SetBottom(self, int bottom)"""
1221 return _core_.Rect_SetBottom(*args, **kwargs)
1222
1223 position = property(GetPosition, SetPosition)
1224 size = property(GetSize, SetSize)
1225 left = property(GetLeft, SetLeft)
1226 right = property(GetRight, SetRight)
1227 top = property(GetTop, SetTop)
1228 bottom = property(GetBottom, SetBottom)
1229
1230 def Inflate(*args, **kwargs):
1231 """
1232 Inflate(self, int dx, int dy) -> Rect
1233
1234 Increases the size of the rectangle.
1235
1236 The left border is moved farther left and the right border is moved
1237 farther right by ``dx``. The upper border is moved farther up and the
1238 bottom border is moved farther down by ``dy``. (Note the the width and
1239 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1240 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1241 opposite happens: the rectangle size decreases in the respective
1242 direction.
1243
1244 The change is made to the rectangle inplace, if instead you need a
1245 copy that is inflated, preserving the original then make the copy
1246 first::
1247
1248 copy = wx.Rect(*original)
1249 copy.Inflate(10,15)
1250
1251
1252 """
1253 return _core_.Rect_Inflate(*args, **kwargs)
1254
1255 def Deflate(*args, **kwargs):
1256 """
1257 Deflate(self, int dx, int dy) -> Rect
1258
1259 Decrease the rectangle size. This method is the opposite of `Inflate`
1260 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1261 `Inflate` for a full description.
1262 """
1263 return _core_.Rect_Deflate(*args, **kwargs)
1264
1265 def OffsetXY(*args, **kwargs):
1266 """
1267 OffsetXY(self, int dx, int dy)
1268
1269 Moves the rectangle by the specified offset. If dx is positive, the
1270 rectangle is moved to the right, if dy is positive, it is moved to the
1271 bottom, otherwise it is moved to the left or top respectively.
1272 """
1273 return _core_.Rect_OffsetXY(*args, **kwargs)
1274
1275 def Offset(*args, **kwargs):
1276 """
1277 Offset(self, Point pt)
1278
1279 Same as `OffsetXY` but uses dx,dy from Point
1280 """
1281 return _core_.Rect_Offset(*args, **kwargs)
1282
1283 def Intersect(*args, **kwargs):
1284 """
1285 Intersect(self, Rect rect) -> Rect
1286
1287 Returns the intersectsion of this rectangle and rect.
1288 """
1289 return _core_.Rect_Intersect(*args, **kwargs)
1290
1291 def Union(*args, **kwargs):
1292 """
1293 Union(self, Rect rect) -> Rect
1294
1295 Returns the union of this rectangle and rect.
1296 """
1297 return _core_.Rect_Union(*args, **kwargs)
1298
1299 def __add__(*args, **kwargs):
1300 """
1301 __add__(self, Rect rect) -> Rect
1302
1303 Add the properties of rect to this rectangle and return the result.
1304 """
1305 return _core_.Rect___add__(*args, **kwargs)
1306
1307 def __iadd__(*args, **kwargs):
1308 """
1309 __iadd__(self, Rect rect) -> Rect
1310
1311 Add the properties of rect to this rectangle, updating this rectangle.
1312 """
1313 return _core_.Rect___iadd__(*args, **kwargs)
1314
1315 def __eq__(*args, **kwargs):
1316 """
1317 __eq__(self, PyObject other) -> bool
1318
1319 Test for equality of wx.Rect objects.
1320 """
1321 return _core_.Rect___eq__(*args, **kwargs)
1322
1323 def __ne__(*args, **kwargs):
1324 """
1325 __ne__(self, PyObject other) -> bool
1326
1327 Test for inequality of wx.Rect objects.
1328 """
1329 return _core_.Rect___ne__(*args, **kwargs)
1330
1331 def InsideXY(*args, **kwargs):
1332 """
1333 InsideXY(self, int x, int y) -> bool
1334
1335 Return True if the point is (not strcitly) inside the rect.
1336 """
1337 return _core_.Rect_InsideXY(*args, **kwargs)
1338
1339 def Inside(*args, **kwargs):
1340 """
1341 Inside(self, Point pt) -> bool
1342
1343 Return True if the point is (not strcitly) inside the rect.
1344 """
1345 return _core_.Rect_Inside(*args, **kwargs)
1346
1347 def Intersects(*args, **kwargs):
1348 """
1349 Intersects(self, Rect rect) -> bool
1350
1351 Returns True if the rectangles have a non empty intersection.
1352 """
1353 return _core_.Rect_Intersects(*args, **kwargs)
1354
1355 def CenterIn(*args, **kwargs):
1356 """
1357 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1358
1359 Center this rectangle within the one passed to the method, which is
1360 usually, but not necessarily, the larger one.
1361 """
1362 return _core_.Rect_CenterIn(*args, **kwargs)
1363
1364 CentreIn = CenterIn
1365 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1366 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1367 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1368 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1369 def Set(*args, **kwargs):
1370 """
1371 Set(self, int x=0, int y=0, int width=0, int height=0)
1372
1373 Set all rectangle properties.
1374 """
1375 return _core_.Rect_Set(*args, **kwargs)
1376
1377 def Get(*args, **kwargs):
1378 """
1379 Get() -> (x,y,width,height)
1380
1381 Return the rectangle properties as a tuple.
1382 """
1383 return _core_.Rect_Get(*args, **kwargs)
1384
1385 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1386 def __str__(self): return str(self.Get())
1387 def __repr__(self): return 'wx.Rect'+str(self.Get())
1388 def __len__(self): return len(self.Get())
1389 def __getitem__(self, index): return self.Get()[index]
1390 def __setitem__(self, index, val):
1391 if index == 0: self.x = val
1392 elif index == 1: self.y = val
1393 elif index == 2: self.width = val
1394 elif index == 3: self.height = val
1395 else: raise IndexError
1396 def __nonzero__(self): return self.Get() != (0,0,0,0)
1397 __safe_for_unpickling__ = True
1398 def __reduce__(self): return (wx.Rect, self.Get())
1399
1400 _core_.Rect_swigregister(Rect)
1401
1402 def RectPP(*args, **kwargs):
1403 """
1404 RectPP(Point topLeft, Point bottomRight) -> Rect
1405
1406 Create a new Rect object from Points representing two corners.
1407 """
1408 val = _core_.new_RectPP(*args, **kwargs)
1409 return val
1410
1411 def RectPS(*args, **kwargs):
1412 """
1413 RectPS(Point pos, Size size) -> Rect
1414
1415 Create a new Rect from a position and size.
1416 """
1417 val = _core_.new_RectPS(*args, **kwargs)
1418 return val
1419
1420 def RectS(*args, **kwargs):
1421 """
1422 RectS(Size size) -> Rect
1423
1424 Create a new Rect from a size only.
1425 """
1426 val = _core_.new_RectS(*args, **kwargs)
1427 return val
1428
1429
1430 def IntersectRect(*args, **kwargs):
1431 """
1432 IntersectRect(Rect r1, Rect r2) -> Rect
1433
1434 Calculate and return the intersection of r1 and r2.
1435 """
1436 return _core_.IntersectRect(*args, **kwargs)
1437 #---------------------------------------------------------------------------
1438
1439 class Point2D(object):
1440 """
1441 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1442 with floating point values.
1443 """
1444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1445 __repr__ = _swig_repr
1446 def __init__(self, *args, **kwargs):
1447 """
1448 __init__(self, double x=0.0, double y=0.0) -> Point2D
1449
1450 Create a w.Point2D object.
1451 """
1452 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1453 def GetFloor(*args, **kwargs):
1454 """
1455 GetFloor() -> (x,y)
1456
1457 Convert to integer
1458 """
1459 return _core_.Point2D_GetFloor(*args, **kwargs)
1460
1461 def GetRounded(*args, **kwargs):
1462 """
1463 GetRounded() -> (x,y)
1464
1465 Convert to integer
1466 """
1467 return _core_.Point2D_GetRounded(*args, **kwargs)
1468
1469 def GetVectorLength(*args, **kwargs):
1470 """GetVectorLength(self) -> double"""
1471 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1472
1473 def GetVectorAngle(*args, **kwargs):
1474 """GetVectorAngle(self) -> double"""
1475 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1476
1477 def SetVectorLength(*args, **kwargs):
1478 """SetVectorLength(self, double length)"""
1479 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1480
1481 def SetVectorAngle(*args, **kwargs):
1482 """SetVectorAngle(self, double degrees)"""
1483 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1484
1485 def SetPolarCoordinates(self, angle, length):
1486 self.SetVectorLength(length)
1487 self.SetVectorAngle(angle)
1488 def Normalize(self):
1489 self.SetVectorLength(1.0)
1490
1491 def GetDistance(*args, **kwargs):
1492 """GetDistance(self, Point2D pt) -> double"""
1493 return _core_.Point2D_GetDistance(*args, **kwargs)
1494
1495 def GetDistanceSquare(*args, **kwargs):
1496 """GetDistanceSquare(self, Point2D pt) -> double"""
1497 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1498
1499 def GetDotProduct(*args, **kwargs):
1500 """GetDotProduct(self, Point2D vec) -> double"""
1501 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1502
1503 def GetCrossProduct(*args, **kwargs):
1504 """GetCrossProduct(self, Point2D vec) -> double"""
1505 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1506
1507 def __neg__(*args, **kwargs):
1508 """
1509 __neg__(self) -> Point2D
1510
1511 the reflection of this point
1512 """
1513 return _core_.Point2D___neg__(*args, **kwargs)
1514
1515 def __iadd__(*args, **kwargs):
1516 """__iadd__(self, Point2D pt) -> Point2D"""
1517 return _core_.Point2D___iadd__(*args, **kwargs)
1518
1519 def __isub__(*args, **kwargs):
1520 """__isub__(self, Point2D pt) -> Point2D"""
1521 return _core_.Point2D___isub__(*args, **kwargs)
1522
1523 def __imul__(*args, **kwargs):
1524 """__imul__(self, Point2D pt) -> Point2D"""
1525 return _core_.Point2D___imul__(*args, **kwargs)
1526
1527 def __idiv__(*args, **kwargs):
1528 """__idiv__(self, Point2D pt) -> Point2D"""
1529 return _core_.Point2D___idiv__(*args, **kwargs)
1530
1531 def __eq__(*args, **kwargs):
1532 """
1533 __eq__(self, PyObject other) -> bool
1534
1535 Test for equality of wx.Point2D objects.
1536 """
1537 return _core_.Point2D___eq__(*args, **kwargs)
1538
1539 def __ne__(*args, **kwargs):
1540 """
1541 __ne__(self, PyObject other) -> bool
1542
1543 Test for inequality of wx.Point2D objects.
1544 """
1545 return _core_.Point2D___ne__(*args, **kwargs)
1546
1547 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1548 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1549 def Set(*args, **kwargs):
1550 """Set(self, double x=0, double y=0)"""
1551 return _core_.Point2D_Set(*args, **kwargs)
1552
1553 def Get(*args, **kwargs):
1554 """
1555 Get() -> (x,y)
1556
1557 Return x and y properties as a tuple.
1558 """
1559 return _core_.Point2D_Get(*args, **kwargs)
1560
1561 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1562 def __str__(self): return str(self.Get())
1563 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1564 def __len__(self): return len(self.Get())
1565 def __getitem__(self, index): return self.Get()[index]
1566 def __setitem__(self, index, val):
1567 if index == 0: self.x = val
1568 elif index == 1: self.y = val
1569 else: raise IndexError
1570 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1571 __safe_for_unpickling__ = True
1572 def __reduce__(self): return (wx.Point2D, self.Get())
1573
1574 _core_.Point2D_swigregister(Point2D)
1575
1576 def Point2DCopy(*args, **kwargs):
1577 """
1578 Point2DCopy(Point2D pt) -> Point2D
1579
1580 Create a w.Point2D object.
1581 """
1582 val = _core_.new_Point2DCopy(*args, **kwargs)
1583 return val
1584
1585 def Point2DFromPoint(*args, **kwargs):
1586 """
1587 Point2DFromPoint(Point pt) -> Point2D
1588
1589 Create a w.Point2D object.
1590 """
1591 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1592 return val
1593
1594 #---------------------------------------------------------------------------
1595
1596 FromStart = _core_.FromStart
1597 FromCurrent = _core_.FromCurrent
1598 FromEnd = _core_.FromEnd
1599 class InputStream(object):
1600 """Proxy of C++ InputStream class"""
1601 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1602 __repr__ = _swig_repr
1603 def __init__(self, *args, **kwargs):
1604 """__init__(self, PyObject p) -> InputStream"""
1605 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1606 __swig_destroy__ = _core_.delete_InputStream
1607 __del__ = lambda self : None;
1608 def close(*args, **kwargs):
1609 """close(self)"""
1610 return _core_.InputStream_close(*args, **kwargs)
1611
1612 def flush(*args, **kwargs):
1613 """flush(self)"""
1614 return _core_.InputStream_flush(*args, **kwargs)
1615
1616 def eof(*args, **kwargs):
1617 """eof(self) -> bool"""
1618 return _core_.InputStream_eof(*args, **kwargs)
1619
1620 def read(*args, **kwargs):
1621 """read(self, int size=-1) -> PyObject"""
1622 return _core_.InputStream_read(*args, **kwargs)
1623
1624 def readline(*args, **kwargs):
1625 """readline(self, int size=-1) -> PyObject"""
1626 return _core_.InputStream_readline(*args, **kwargs)
1627
1628 def readlines(*args, **kwargs):
1629 """readlines(self, int sizehint=-1) -> PyObject"""
1630 return _core_.InputStream_readlines(*args, **kwargs)
1631
1632 def seek(*args, **kwargs):
1633 """seek(self, int offset, int whence=0)"""
1634 return _core_.InputStream_seek(*args, **kwargs)
1635
1636 def tell(*args, **kwargs):
1637 """tell(self) -> int"""
1638 return _core_.InputStream_tell(*args, **kwargs)
1639
1640 def Peek(*args, **kwargs):
1641 """Peek(self) -> char"""
1642 return _core_.InputStream_Peek(*args, **kwargs)
1643
1644 def GetC(*args, **kwargs):
1645 """GetC(self) -> char"""
1646 return _core_.InputStream_GetC(*args, **kwargs)
1647
1648 def LastRead(*args, **kwargs):
1649 """LastRead(self) -> size_t"""
1650 return _core_.InputStream_LastRead(*args, **kwargs)
1651
1652 def CanRead(*args, **kwargs):
1653 """CanRead(self) -> bool"""
1654 return _core_.InputStream_CanRead(*args, **kwargs)
1655
1656 def Eof(*args, **kwargs):
1657 """Eof(self) -> bool"""
1658 return _core_.InputStream_Eof(*args, **kwargs)
1659
1660 def Ungetch(*args, **kwargs):
1661 """Ungetch(self, char c) -> bool"""
1662 return _core_.InputStream_Ungetch(*args, **kwargs)
1663
1664 def SeekI(*args, **kwargs):
1665 """SeekI(self, long pos, int mode=FromStart) -> long"""
1666 return _core_.InputStream_SeekI(*args, **kwargs)
1667
1668 def TellI(*args, **kwargs):
1669 """TellI(self) -> long"""
1670 return _core_.InputStream_TellI(*args, **kwargs)
1671
1672 _core_.InputStream_swigregister(InputStream)
1673 DefaultPosition = cvar.DefaultPosition
1674 DefaultSize = cvar.DefaultSize
1675
1676 class OutputStream(object):
1677 """Proxy of C++ OutputStream class"""
1678 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1679 def __init__(self): raise AttributeError, "No constructor defined"
1680 __repr__ = _swig_repr
1681 def write(*args, **kwargs):
1682 """write(self, PyObject obj)"""
1683 return _core_.OutputStream_write(*args, **kwargs)
1684
1685 def LastWrite(*args, **kwargs):
1686 """LastWrite(self) -> size_t"""
1687 return _core_.OutputStream_LastWrite(*args, **kwargs)
1688
1689 _core_.OutputStream_swigregister(OutputStream)
1690
1691 #---------------------------------------------------------------------------
1692
1693 class FSFile(Object):
1694 """Proxy of C++ FSFile class"""
1695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1696 __repr__ = _swig_repr
1697 def __init__(self, *args, **kwargs):
1698 """
1699 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1700 DateTime modif) -> FSFile
1701 """
1702 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1703 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1704
1705 __swig_destroy__ = _core_.delete_FSFile
1706 __del__ = lambda self : None;
1707 def GetStream(*args, **kwargs):
1708 """GetStream(self) -> InputStream"""
1709 return _core_.FSFile_GetStream(*args, **kwargs)
1710
1711 def GetMimeType(*args, **kwargs):
1712 """GetMimeType(self) -> String"""
1713 return _core_.FSFile_GetMimeType(*args, **kwargs)
1714
1715 def GetLocation(*args, **kwargs):
1716 """GetLocation(self) -> String"""
1717 return _core_.FSFile_GetLocation(*args, **kwargs)
1718
1719 def GetAnchor(*args, **kwargs):
1720 """GetAnchor(self) -> String"""
1721 return _core_.FSFile_GetAnchor(*args, **kwargs)
1722
1723 def GetModificationTime(*args, **kwargs):
1724 """GetModificationTime(self) -> DateTime"""
1725 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1726
1727 _core_.FSFile_swigregister(FSFile)
1728
1729 class CPPFileSystemHandler(object):
1730 """Proxy of C++ CPPFileSystemHandler class"""
1731 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1732 def __init__(self): raise AttributeError, "No constructor defined"
1733 __repr__ = _swig_repr
1734 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1735 __del__ = lambda self : None;
1736 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1737
1738 class FileSystemHandler(CPPFileSystemHandler):
1739 """Proxy of C++ FileSystemHandler class"""
1740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1741 __repr__ = _swig_repr
1742 def __init__(self, *args, **kwargs):
1743 """__init__(self) -> FileSystemHandler"""
1744 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1745 self._setCallbackInfo(self, FileSystemHandler)
1746
1747 def _setCallbackInfo(*args, **kwargs):
1748 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1749 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1750
1751 def CanOpen(*args, **kwargs):
1752 """CanOpen(self, String location) -> bool"""
1753 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1754
1755 def OpenFile(*args, **kwargs):
1756 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1757 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1758
1759 def FindFirst(*args, **kwargs):
1760 """FindFirst(self, String spec, int flags=0) -> String"""
1761 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1762
1763 def FindNext(*args, **kwargs):
1764 """FindNext(self) -> String"""
1765 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1766
1767 def GetProtocol(*args, **kwargs):
1768 """GetProtocol(self, String location) -> String"""
1769 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1770
1771 def GetLeftLocation(*args, **kwargs):
1772 """GetLeftLocation(self, String location) -> String"""
1773 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1774
1775 def GetAnchor(*args, **kwargs):
1776 """GetAnchor(self, String location) -> String"""
1777 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1778
1779 def GetRightLocation(*args, **kwargs):
1780 """GetRightLocation(self, String location) -> String"""
1781 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1782
1783 def GetMimeTypeFromExt(*args, **kwargs):
1784 """GetMimeTypeFromExt(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1786
1787 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1788
1789 class FileSystem(Object):
1790 """Proxy of C++ FileSystem class"""
1791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1792 __repr__ = _swig_repr
1793 def __init__(self, *args, **kwargs):
1794 """__init__(self) -> FileSystem"""
1795 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1796 __swig_destroy__ = _core_.delete_FileSystem
1797 __del__ = lambda self : None;
1798 def ChangePathTo(*args, **kwargs):
1799 """ChangePathTo(self, String location, bool is_dir=False)"""
1800 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1801
1802 def GetPath(*args, **kwargs):
1803 """GetPath(self) -> String"""
1804 return _core_.FileSystem_GetPath(*args, **kwargs)
1805
1806 def OpenFile(*args, **kwargs):
1807 """OpenFile(self, String location) -> FSFile"""
1808 return _core_.FileSystem_OpenFile(*args, **kwargs)
1809
1810 def FindFirst(*args, **kwargs):
1811 """FindFirst(self, String spec, int flags=0) -> String"""
1812 return _core_.FileSystem_FindFirst(*args, **kwargs)
1813
1814 def FindNext(*args, **kwargs):
1815 """FindNext(self) -> String"""
1816 return _core_.FileSystem_FindNext(*args, **kwargs)
1817
1818 def AddHandler(*args, **kwargs):
1819 """AddHandler(CPPFileSystemHandler handler)"""
1820 return _core_.FileSystem_AddHandler(*args, **kwargs)
1821
1822 AddHandler = staticmethod(AddHandler)
1823 def CleanUpHandlers(*args, **kwargs):
1824 """CleanUpHandlers()"""
1825 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1826
1827 CleanUpHandlers = staticmethod(CleanUpHandlers)
1828 def FileNameToURL(*args, **kwargs):
1829 """FileNameToURL(String filename) -> String"""
1830 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1831
1832 FileNameToURL = staticmethod(FileNameToURL)
1833 def URLToFileName(*args, **kwargs):
1834 """URLToFileName(String url) -> String"""
1835 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1836
1837 URLToFileName = staticmethod(URLToFileName)
1838 _core_.FileSystem_swigregister(FileSystem)
1839
1840 def FileSystem_AddHandler(*args, **kwargs):
1841 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1842 return _core_.FileSystem_AddHandler(*args, **kwargs)
1843
1844 def FileSystem_CleanUpHandlers(*args):
1845 """FileSystem_CleanUpHandlers()"""
1846 return _core_.FileSystem_CleanUpHandlers(*args)
1847
1848 def FileSystem_FileNameToURL(*args, **kwargs):
1849 """FileSystem_FileNameToURL(String filename) -> String"""
1850 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1851
1852 def FileSystem_URLToFileName(*args, **kwargs):
1853 """FileSystem_URLToFileName(String url) -> String"""
1854 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1855
1856 class InternetFSHandler(CPPFileSystemHandler):
1857 """Proxy of C++ InternetFSHandler class"""
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
1861 """__init__(self) -> InternetFSHandler"""
1862 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1863 def CanOpen(*args, **kwargs):
1864 """CanOpen(self, String location) -> bool"""
1865 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1866
1867 def OpenFile(*args, **kwargs):
1868 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1869 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1870
1871 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1872
1873 class ZipFSHandler(CPPFileSystemHandler):
1874 """Proxy of C++ ZipFSHandler class"""
1875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1876 __repr__ = _swig_repr
1877 def __init__(self, *args, **kwargs):
1878 """__init__(self) -> ZipFSHandler"""
1879 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1880 def CanOpen(*args, **kwargs):
1881 """CanOpen(self, String location) -> bool"""
1882 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1883
1884 def OpenFile(*args, **kwargs):
1885 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1886 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1887
1888 def FindFirst(*args, **kwargs):
1889 """FindFirst(self, String spec, int flags=0) -> String"""
1890 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1891
1892 def FindNext(*args, **kwargs):
1893 """FindNext(self) -> String"""
1894 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1895
1896 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1897
1898
1899 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1900 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1901 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1902
1903 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1904 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1905 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1906
1907 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1908 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1909 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1910 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1911 """
1912 Add 'file' to the memory filesystem. The dataItem parameter can
1913 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1914 arbitrary data. If a bitmap or image is used then the imgType
1915 parameter should specify what kind of image file it should be
1916 written as, wx.BITMAP_TYPE_PNG, etc.
1917 """
1918 if isinstance(dataItem, wx.Image):
1919 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1920 elif isinstance(dataItem, wx.Bitmap):
1921 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1922 elif type(dataItem) == str:
1923 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1924 else:
1925 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1926
1927 class MemoryFSHandler(CPPFileSystemHandler):
1928 """Proxy of C++ MemoryFSHandler class"""
1929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1930 __repr__ = _swig_repr
1931 def __init__(self, *args, **kwargs):
1932 """__init__(self) -> MemoryFSHandler"""
1933 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1934 def RemoveFile(*args, **kwargs):
1935 """RemoveFile(String filename)"""
1936 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1937
1938 RemoveFile = staticmethod(RemoveFile)
1939 AddFile = staticmethod(MemoryFSHandler_AddFile)
1940 def CanOpen(*args, **kwargs):
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1943
1944 def OpenFile(*args, **kwargs):
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1947
1948 def FindFirst(*args, **kwargs):
1949 """FindFirst(self, String spec, int flags=0) -> String"""
1950 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1951
1952 def FindNext(*args, **kwargs):
1953 """FindNext(self) -> String"""
1954 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1955
1956 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1957
1958 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1959 """MemoryFSHandler_RemoveFile(String filename)"""
1960 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1961
1962 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1963 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1964 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1965 #---------------------------------------------------------------------------
1966
1967 class ImageHandler(Object):
1968 """
1969 This is the base class for implementing image file loading/saving, and
1970 image creation from data. It is used within `wx.Image` and is not
1971 normally seen by the application.
1972 """
1973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1974 def __init__(self): raise AttributeError, "No constructor defined"
1975 __repr__ = _swig_repr
1976 def GetName(*args, **kwargs):
1977 """GetName(self) -> String"""
1978 return _core_.ImageHandler_GetName(*args, **kwargs)
1979
1980 def GetExtension(*args, **kwargs):
1981 """GetExtension(self) -> String"""
1982 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1983
1984 def GetType(*args, **kwargs):
1985 """GetType(self) -> long"""
1986 return _core_.ImageHandler_GetType(*args, **kwargs)
1987
1988 def GetMimeType(*args, **kwargs):
1989 """GetMimeType(self) -> String"""
1990 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1991
1992 def CanRead(*args, **kwargs):
1993 """CanRead(self, String name) -> bool"""
1994 return _core_.ImageHandler_CanRead(*args, **kwargs)
1995
1996 def SetName(*args, **kwargs):
1997 """SetName(self, String name)"""
1998 return _core_.ImageHandler_SetName(*args, **kwargs)
1999
2000 def SetExtension(*args, **kwargs):
2001 """SetExtension(self, String extension)"""
2002 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2003
2004 def SetType(*args, **kwargs):
2005 """SetType(self, long type)"""
2006 return _core_.ImageHandler_SetType(*args, **kwargs)
2007
2008 def SetMimeType(*args, **kwargs):
2009 """SetMimeType(self, String mimetype)"""
2010 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2011
2012 _core_.ImageHandler_swigregister(ImageHandler)
2013
2014 class PyImageHandler(ImageHandler):
2015 """
2016 This is the base class for implementing image file loading/saving, and
2017 image creation from data, all written in Python. To create a custom
2018 image handler derive a new class from wx.PyImageHandler and provide
2019 the following methods::
2020
2021 def DoCanRead(self, stream) --> bool
2022 '''Check if this handler can read the image on the stream'''
2023
2024 def LoadFile(self, image, stream, verbose, index) --> bool
2025 '''Load image data from the stream and load it into image.'''
2026
2027 def SaveFile(self, image, stream, verbose) --> bool
2028 '''Save the iamge data in image to the stream using
2029 this handler's image file format.'''
2030
2031 def GetImageCount(self, stream) --> int
2032 '''If this image format can hold more than one image,
2033 how many does the image on the stream have?'''
2034
2035 To activate your handler create an instance of it and pass it to
2036 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2037 `SetExtension` from your constructor.
2038
2039 """
2040 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2041 __repr__ = _swig_repr
2042 def __init__(self, *args, **kwargs):
2043 """
2044 __init__(self) -> PyImageHandler
2045
2046 This is the base class for implementing image file loading/saving, and
2047 image creation from data, all written in Python. To create a custom
2048 image handler derive a new class from wx.PyImageHandler and provide
2049 the following methods::
2050
2051 def DoCanRead(self, stream) --> bool
2052 '''Check if this handler can read the image on the stream'''
2053
2054 def LoadFile(self, image, stream, verbose, index) --> bool
2055 '''Load image data from the stream and load it into image.'''
2056
2057 def SaveFile(self, image, stream, verbose) --> bool
2058 '''Save the iamge data in image to the stream using
2059 this handler's image file format.'''
2060
2061 def GetImageCount(self, stream) --> int
2062 '''If this image format can hold more than one image,
2063 how many does the image on the stream have?'''
2064
2065 To activate your handler create an instance of it and pass it to
2066 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2067 `SetExtension` from your constructor.
2068
2069 """
2070 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2071 self._SetSelf(self)
2072
2073 def _SetSelf(*args, **kwargs):
2074 """_SetSelf(self, PyObject self)"""
2075 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2076
2077 _core_.PyImageHandler_swigregister(PyImageHandler)
2078
2079 class ImageHistogram(object):
2080 """Proxy of C++ ImageHistogram class"""
2081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2082 __repr__ = _swig_repr
2083 def __init__(self, *args, **kwargs):
2084 """__init__(self) -> ImageHistogram"""
2085 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2086 def MakeKey(*args, **kwargs):
2087 """
2088 MakeKey(byte r, byte g, byte b) -> unsigned long
2089
2090 Get the key in the histogram for the given RGB values
2091 """
2092 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2093
2094 MakeKey = staticmethod(MakeKey)
2095 def FindFirstUnusedColour(*args, **kwargs):
2096 """
2097 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2098
2099 Find first colour that is not used in the image and has higher RGB
2100 values than startR, startG, startB. Returns a tuple consisting of a
2101 success flag and rgb values.
2102 """
2103 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2104
2105 def GetCount(*args, **kwargs):
2106 """
2107 GetCount(self, unsigned long key) -> unsigned long
2108
2109 Returns the pixel count for the given key. Use `MakeKey` to create a
2110 key value from a RGB tripple.
2111 """
2112 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2113
2114 def GetCountRGB(*args, **kwargs):
2115 """
2116 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2117
2118 Returns the pixel count for the given RGB values.
2119 """
2120 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2121
2122 def GetCountColour(*args, **kwargs):
2123 """
2124 GetCountColour(self, Colour colour) -> unsigned long
2125
2126 Returns the pixel count for the given `wx.Colour` value.
2127 """
2128 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2129
2130 _core_.ImageHistogram_swigregister(ImageHistogram)
2131
2132 def ImageHistogram_MakeKey(*args, **kwargs):
2133 """
2134 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2135
2136 Get the key in the histogram for the given RGB values
2137 """
2138 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2139
2140 class Image_RGBValue(object):
2141 """
2142 An object that contains values for red, green and blue which represent
2143 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2144 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2145 color space.
2146 """
2147 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2148 __repr__ = _swig_repr
2149 def __init__(self, *args, **kwargs):
2150 """
2151 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2152
2153 Constructor.
2154 """
2155 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2156 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2157 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2158 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2159 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2160
2161 class Image_HSVValue(object):
2162 """
2163 An object that contains values for hue, saturation and value which
2164 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2165 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2166 color space.
2167 """
2168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2169 __repr__ = _swig_repr
2170 def __init__(self, *args, **kwargs):
2171 """
2172 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2173
2174 Constructor.
2175 """
2176 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2177 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2178 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2179 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2180 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2181
2182 class Image(Object):
2183 """
2184 A platform-independent image class. An image can be created from
2185 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2186 variety of formats. Functions are available to set and get image
2187 bits, so it can be used for basic image manipulation.
2188
2189 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2190 platform-specific `wx.Bitmap` object must be created from it using the
2191 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2192 device context, using `wx.DC.DrawBitmap`.
2193
2194 One colour value of the image may be used as a mask colour which will
2195 lead to the automatic creation of a `wx.Mask` object associated to the
2196 bitmap object.
2197
2198 wx.Image supports alpha channel data, that is in addition to a byte
2199 for the red, green and blue colour components for each pixel it also
2200 stores a byte representing the pixel opacity. An alpha value of 0
2201 corresponds to a transparent pixel (null opacity) while a value of 255
2202 means that the pixel is 100% opaque.
2203
2204 Unlike RGB data, not all images have an alpha channel and before using
2205 `GetAlpha` you should check if this image contains an alpha channel
2206 with `HasAlpha`. Note that currently only images loaded from PNG files
2207 with transparency information will have an alpha channel.
2208 """
2209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2210 __repr__ = _swig_repr
2211 def __init__(self, *args, **kwargs):
2212 """
2213 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2214
2215 Loads an image from a file.
2216 """
2217 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2218 __swig_destroy__ = _core_.delete_Image
2219 __del__ = lambda self : None;
2220 def Create(*args, **kwargs):
2221 """
2222 Create(self, int width, int height, bool clear=True)
2223
2224 Creates a fresh image. If clear is ``True``, the new image will be
2225 initialized to black. Otherwise, the image data will be uninitialized.
2226 """
2227 return _core_.Image_Create(*args, **kwargs)
2228
2229 def Destroy(*args, **kwargs):
2230 """
2231 Destroy(self)
2232
2233 Destroys the image data.
2234 """
2235 val = _core_.Image_Destroy(*args, **kwargs)
2236 args[0].thisown = 0
2237 return val
2238
2239 def Scale(*args, **kwargs):
2240 """
2241 Scale(self, int width, int height) -> Image
2242
2243 Returns a scaled version of the image. This is also useful for scaling
2244 bitmaps in general as the only other way to scale bitmaps is to blit a
2245 `wx.MemoryDC` into another `wx.MemoryDC`.
2246 """
2247 return _core_.Image_Scale(*args, **kwargs)
2248
2249 def ShrinkBy(*args, **kwargs):
2250 """
2251 ShrinkBy(self, int xFactor, int yFactor) -> Image
2252
2253 Return a version of the image scaled smaller by the given factors.
2254 """
2255 return _core_.Image_ShrinkBy(*args, **kwargs)
2256
2257 def Rescale(*args, **kwargs):
2258 """
2259 Rescale(self, int width, int height) -> Image
2260
2261 Changes the size of the image in-place by scaling it: after a call to
2262 this function, the image will have the given width and height.
2263
2264 Returns the (modified) image itself.
2265 """
2266 return _core_.Image_Rescale(*args, **kwargs)
2267
2268 def Resize(*args, **kwargs):
2269 """
2270 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2271
2272 Changes the size of the image in-place without scaling it, by adding
2273 either a border with the given colour or cropping as necessary. The
2274 image is pasted into a new image with the given size and background
2275 colour at the position pos relative to the upper left of the new
2276 image. If red = green = blue = -1 then use either the current mask
2277 colour if set or find, use, and set a suitable mask colour for any
2278 newly exposed areas.
2279
2280 Returns the (modified) image itself.
2281 """
2282 return _core_.Image_Resize(*args, **kwargs)
2283
2284 def SetRGB(*args, **kwargs):
2285 """
2286 SetRGB(self, int x, int y, byte r, byte g, byte b)
2287
2288 Sets the pixel at the given coordinate. This routine performs
2289 bounds-checks for the coordinate so it can be considered a safe way to
2290 manipulate the data, but in some cases this might be too slow so that
2291 the data will have to be set directly. In that case you will have to
2292 get access to the image data using the `GetData` method.
2293 """
2294 return _core_.Image_SetRGB(*args, **kwargs)
2295
2296 def SetRGBRect(*args, **kwargs):
2297 """
2298 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2299
2300 Sets the colour of the pixels within the given rectangle. This routine
2301 performs bounds-checks for the rectangle so it can be considered a
2302 safe way to manipulate the data.
2303 """
2304 return _core_.Image_SetRGBRect(*args, **kwargs)
2305
2306 def GetRed(*args, **kwargs):
2307 """
2308 GetRed(self, int x, int y) -> byte
2309
2310 Returns the red intensity at the given coordinate.
2311 """
2312 return _core_.Image_GetRed(*args, **kwargs)
2313
2314 def GetGreen(*args, **kwargs):
2315 """
2316 GetGreen(self, int x, int y) -> byte
2317
2318 Returns the green intensity at the given coordinate.
2319 """
2320 return _core_.Image_GetGreen(*args, **kwargs)
2321
2322 def GetBlue(*args, **kwargs):
2323 """
2324 GetBlue(self, int x, int y) -> byte
2325
2326 Returns the blue intensity at the given coordinate.
2327 """
2328 return _core_.Image_GetBlue(*args, **kwargs)
2329
2330 def SetAlpha(*args, **kwargs):
2331 """
2332 SetAlpha(self, int x, int y, byte alpha)
2333
2334 Sets the alpha value for the given pixel. This function should only be
2335 called if the image has alpha channel data, use `HasAlpha` to check
2336 for this.
2337 """
2338 return _core_.Image_SetAlpha(*args, **kwargs)
2339
2340 def GetAlpha(*args, **kwargs):
2341 """
2342 GetAlpha(self, int x, int y) -> byte
2343
2344 Returns the alpha value for the given pixel. This function may only be
2345 called for the images with alpha channel, use `HasAlpha` to check for
2346 this.
2347
2348 The returned value is the *opacity* of the image, i.e. the value of 0
2349 corresponds to the fully transparent pixels while the value of 255 to
2350 the fully opaque pixels.
2351 """
2352 return _core_.Image_GetAlpha(*args, **kwargs)
2353
2354 def HasAlpha(*args, **kwargs):
2355 """
2356 HasAlpha(self) -> bool
2357
2358 Returns true if this image has alpha channel, false otherwise.
2359 """
2360 return _core_.Image_HasAlpha(*args, **kwargs)
2361
2362 def InitAlpha(*args, **kwargs):
2363 """
2364 InitAlpha(self)
2365
2366 Initializes the image alpha channel data. It is an error to call it if
2367 the image already has alpha data. If it doesn't, alpha data will be by
2368 default initialized to all pixels being fully opaque. But if the image
2369 has a a mask colour, all mask pixels will be completely transparent.
2370 """
2371 return _core_.Image_InitAlpha(*args, **kwargs)
2372
2373 def IsTransparent(*args, **kwargs):
2374 """
2375 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2376
2377 Returns ``True`` if this pixel is masked or has an alpha value less
2378 than the spcified threshold.
2379 """
2380 return _core_.Image_IsTransparent(*args, **kwargs)
2381
2382 def FindFirstUnusedColour(*args, **kwargs):
2383 """
2384 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2385
2386 Find first colour that is not used in the image and has higher RGB
2387 values than startR, startG, startB. Returns a tuple consisting of a
2388 success flag and rgb values.
2389 """
2390 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2391
2392 def ConvertAlphaToMask(*args, **kwargs):
2393 """
2394 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2395
2396 If the image has alpha channel, this method converts it to mask. All
2397 pixels with alpha value less than ``threshold`` are replaced with the
2398 mask colour and the alpha channel is removed. The mask colour is
2399 chosen automatically using `FindFirstUnusedColour`.
2400
2401 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2402 nothing.
2403 """
2404 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2405
2406 def ConvertColourToAlpha(*args, **kwargs):
2407 """
2408 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2409
2410 This method converts an image where the original alpha information is
2411 only available as a shades of a colour (actually shades of grey)
2412 typically when you draw anti-aliased text into a bitmap. The DC
2413 drawing routines draw grey values on the black background although
2414 they actually mean to draw white with differnt alpha values. This
2415 method reverses it, assuming a black (!) background and white text.
2416 The method will then fill up the whole image with the colour given.
2417 """
2418 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2419
2420 def SetMaskFromImage(*args, **kwargs):
2421 """
2422 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2423
2424 Sets the image's mask so that the pixels that have RGB value of
2425 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2426 by first finding an unused colour in the image, setting this colour as
2427 the mask colour and then using this colour to draw all pixels in the
2428 image who corresponding pixel in mask has given RGB value.
2429
2430 Returns ``False`` if ``mask`` does not have same dimensions as the
2431 image or if there is no unused colour left. Returns ``True`` if the
2432 mask was successfully applied.
2433
2434 Note that this method involves computing the histogram, which is
2435 computationally intensive operation.
2436 """
2437 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2438
2439 def CanRead(*args, **kwargs):
2440 """
2441 CanRead(String filename) -> bool
2442
2443 Returns True if the image handlers can read this file.
2444 """
2445 return _core_.Image_CanRead(*args, **kwargs)
2446
2447 CanRead = staticmethod(CanRead)
2448 def GetImageCount(*args, **kwargs):
2449 """
2450 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2451
2452 If the image file contains more than one image and the image handler
2453 is capable of retrieving these individually, this function will return
2454 the number of available images.
2455 """
2456 return _core_.Image_GetImageCount(*args, **kwargs)
2457
2458 GetImageCount = staticmethod(GetImageCount)
2459 def LoadFile(*args, **kwargs):
2460 """
2461 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2462
2463 Loads an image from a file. If no handler type is provided, the
2464 library will try to autodetect the format.
2465 """
2466 return _core_.Image_LoadFile(*args, **kwargs)
2467
2468 def LoadMimeFile(*args, **kwargs):
2469 """
2470 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2471
2472 Loads an image from a file, specifying the image type with a MIME type
2473 string.
2474 """
2475 return _core_.Image_LoadMimeFile(*args, **kwargs)
2476
2477 def SaveFile(*args, **kwargs):
2478 """
2479 SaveFile(self, String name, int type) -> bool
2480
2481 Saves an image in the named file.
2482 """
2483 return _core_.Image_SaveFile(*args, **kwargs)
2484
2485 def SaveMimeFile(*args, **kwargs):
2486 """
2487 SaveMimeFile(self, String name, String mimetype) -> bool
2488
2489 Saves an image in the named file.
2490 """
2491 return _core_.Image_SaveMimeFile(*args, **kwargs)
2492
2493 def CanReadStream(*args, **kwargs):
2494 """
2495 CanReadStream(InputStream stream) -> bool
2496
2497 Returns True if the image handlers can read an image file from the
2498 data currently on the input stream, or a readable Python file-like
2499 object.
2500 """
2501 return _core_.Image_CanReadStream(*args, **kwargs)
2502
2503 CanReadStream = staticmethod(CanReadStream)
2504 def LoadStream(*args, **kwargs):
2505 """
2506 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2507
2508 Loads an image from an input stream or a readable Python file-like
2509 object. If no handler type is provided, the library will try to
2510 autodetect the format.
2511 """
2512 return _core_.Image_LoadStream(*args, **kwargs)
2513
2514 def LoadMimeStream(*args, **kwargs):
2515 """
2516 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2517
2518 Loads an image from an input stream or a readable Python file-like
2519 object, using a MIME type string to specify the image file format.
2520 """
2521 return _core_.Image_LoadMimeStream(*args, **kwargs)
2522
2523 def Ok(*args, **kwargs):
2524 """
2525 Ok(self) -> bool
2526
2527 Returns true if image data is present.
2528 """
2529 return _core_.Image_Ok(*args, **kwargs)
2530
2531 def GetWidth(*args, **kwargs):
2532 """
2533 GetWidth(self) -> int
2534
2535 Gets the width of the image in pixels.
2536 """
2537 return _core_.Image_GetWidth(*args, **kwargs)
2538
2539 def GetHeight(*args, **kwargs):
2540 """
2541 GetHeight(self) -> int
2542
2543 Gets the height of the image in pixels.
2544 """
2545 return _core_.Image_GetHeight(*args, **kwargs)
2546
2547 def GetSize(*args, **kwargs):
2548 """
2549 GetSize(self) -> Size
2550
2551 Returns the size of the image in pixels.
2552 """
2553 return _core_.Image_GetSize(*args, **kwargs)
2554
2555 def GetSubImage(*args, **kwargs):
2556 """
2557 GetSubImage(self, Rect rect) -> Image
2558
2559 Returns a sub image of the current one as long as the rect belongs
2560 entirely to the image.
2561 """
2562 return _core_.Image_GetSubImage(*args, **kwargs)
2563
2564 def Size(*args, **kwargs):
2565 """
2566 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2567
2568 Returns a resized version of this image without scaling it by adding
2569 either a border with the given colour or cropping as necessary. The
2570 image is pasted into a new image with the given size and background
2571 colour at the position ``pos`` relative to the upper left of the new
2572 image. If red = green = blue = -1 then use either the current mask
2573 colour if set or find, use, and set a suitable mask colour for any
2574 newly exposed areas.
2575 """
2576 return _core_.Image_Size(*args, **kwargs)
2577
2578 def Copy(*args, **kwargs):
2579 """
2580 Copy(self) -> Image
2581
2582 Returns an identical copy of the image.
2583 """
2584 return _core_.Image_Copy(*args, **kwargs)
2585
2586 def Paste(*args, **kwargs):
2587 """
2588 Paste(self, Image image, int x, int y)
2589
2590 Pastes ``image`` into this instance and takes care of the mask colour
2591 and any out of bounds problems.
2592 """
2593 return _core_.Image_Paste(*args, **kwargs)
2594
2595 def GetData(*args, **kwargs):
2596 """
2597 GetData(self) -> PyObject
2598
2599 Returns a string containing a copy of the RGB bytes of the image.
2600 """
2601 return _core_.Image_GetData(*args, **kwargs)
2602
2603 def SetData(*args, **kwargs):
2604 """
2605 SetData(self, buffer data)
2606
2607 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2608 either a string or a buffer object holding the data and the length of
2609 the data must be width*height*3.
2610 """
2611 return _core_.Image_SetData(*args, **kwargs)
2612
2613 def GetDataBuffer(*args, **kwargs):
2614 """
2615 GetDataBuffer(self) -> PyObject
2616
2617 Returns a writable Python buffer object that is pointing at the RGB
2618 image data buffer inside the wx.Image. You need to ensure that you do
2619 not use this buffer object after the image has been destroyed.
2620 """
2621 return _core_.Image_GetDataBuffer(*args, **kwargs)
2622
2623 def SetDataBuffer(*args, **kwargs):
2624 """
2625 SetDataBuffer(self, buffer data)
2626
2627 Sets the internal image data pointer to point at a Python buffer
2628 object. This can save making an extra copy of the data but you must
2629 ensure that the buffer object lives longer than the wx.Image does.
2630 """
2631 return _core_.Image_SetDataBuffer(*args, **kwargs)
2632
2633 def GetAlphaData(*args, **kwargs):
2634 """
2635 GetAlphaData(self) -> PyObject
2636
2637 Returns a string containing a copy of the alpha bytes of the image.
2638 """
2639 return _core_.Image_GetAlphaData(*args, **kwargs)
2640
2641 def SetAlphaData(*args, **kwargs):
2642 """
2643 SetAlphaData(self, buffer alpha)
2644
2645 Resets the Image's alpha data from a buffer of bytes. Accepts either
2646 a string or a buffer object holding the data and the length of the
2647 data must be width*height.
2648 """
2649 return _core_.Image_SetAlphaData(*args, **kwargs)
2650
2651 def GetAlphaBuffer(*args, **kwargs):
2652 """GetAlphaBuffer(self) -> PyObject"""
2653 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2654
2655 def SetAlphaBuffer(*args, **kwargs):
2656 """SetAlphaBuffer(self, buffer alpha)"""
2657 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2658
2659 def SetMaskColour(*args, **kwargs):
2660 """
2661 SetMaskColour(self, byte r, byte g, byte b)
2662
2663 Sets the mask colour for this image (and tells the image to use the
2664 mask).
2665 """
2666 return _core_.Image_SetMaskColour(*args, **kwargs)
2667
2668 def GetOrFindMaskColour(*args, **kwargs):
2669 """
2670 GetOrFindMaskColour() -> (r,g,b)
2671
2672 Get the current mask colour or find a suitable colour.
2673 """
2674 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2675
2676 def GetMaskRed(*args, **kwargs):
2677 """
2678 GetMaskRed(self) -> byte
2679
2680 Gets the red component of the mask colour.
2681 """
2682 return _core_.Image_GetMaskRed(*args, **kwargs)
2683
2684 def GetMaskGreen(*args, **kwargs):
2685 """
2686 GetMaskGreen(self) -> byte
2687
2688 Gets the green component of the mask colour.
2689 """
2690 return _core_.Image_GetMaskGreen(*args, **kwargs)
2691
2692 def GetMaskBlue(*args, **kwargs):
2693 """
2694 GetMaskBlue(self) -> byte
2695
2696 Gets the blue component of the mask colour.
2697 """
2698 return _core_.Image_GetMaskBlue(*args, **kwargs)
2699
2700 def SetMask(*args, **kwargs):
2701 """
2702 SetMask(self, bool mask=True)
2703
2704 Specifies whether there is a mask or not. The area of the mask is
2705 determined by the current mask colour.
2706 """
2707 return _core_.Image_SetMask(*args, **kwargs)
2708
2709 def HasMask(*args, **kwargs):
2710 """
2711 HasMask(self) -> bool
2712
2713 Returns ``True`` if there is a mask active, ``False`` otherwise.
2714 """
2715 return _core_.Image_HasMask(*args, **kwargs)
2716
2717 def Rotate(*args, **kwargs):
2718 """
2719 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2720 Point offset_after_rotation=None) -> Image
2721
2722 Rotates the image about the given point, by ``angle`` radians. Passing
2723 ``True`` to ``interpolating`` results in better image quality, but is
2724 slower. If the image has a mask, then the mask colour is used for the
2725 uncovered pixels in the rotated image background. Otherwise, black
2726 will be used as the fill colour.
2727
2728 Returns the rotated image, leaving this image intact.
2729 """
2730 return _core_.Image_Rotate(*args, **kwargs)
2731
2732 def Rotate90(*args, **kwargs):
2733 """
2734 Rotate90(self, bool clockwise=True) -> Image
2735
2736 Returns a copy of the image rotated 90 degrees in the direction
2737 indicated by ``clockwise``.
2738 """
2739 return _core_.Image_Rotate90(*args, **kwargs)
2740
2741 def Mirror(*args, **kwargs):
2742 """
2743 Mirror(self, bool horizontally=True) -> Image
2744
2745 Returns a mirrored copy of the image. The parameter ``horizontally``
2746 indicates the orientation.
2747 """
2748 return _core_.Image_Mirror(*args, **kwargs)
2749
2750 def Replace(*args, **kwargs):
2751 """
2752 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2753
2754 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2755 ``(r2,g2,b2)``.
2756 """
2757 return _core_.Image_Replace(*args, **kwargs)
2758
2759 def ConvertToGreyscale(*args, **kwargs):
2760 """
2761 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2762
2763 Convert to greyscale image. Uses the luminance component (Y) of the
2764 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2765 defaults to ITU-T BT.601
2766 """
2767 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2768
2769 def ConvertToMono(*args, **kwargs):
2770 """
2771 ConvertToMono(self, byte r, byte g, byte b) -> Image
2772
2773 Returns monochromatic version of the image. The returned image has
2774 white colour where the original has ``(r,g,b)`` colour and black
2775 colour everywhere else.
2776 """
2777 return _core_.Image_ConvertToMono(*args, **kwargs)
2778
2779 def SetOption(*args, **kwargs):
2780 """
2781 SetOption(self, String name, String value)
2782
2783 Sets an image handler defined option. For example, when saving as a
2784 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2785 number between 0 and 100 (0 is terrible, 100 is very good).
2786 """
2787 return _core_.Image_SetOption(*args, **kwargs)
2788
2789 def SetOptionInt(*args, **kwargs):
2790 """
2791 SetOptionInt(self, String name, int value)
2792
2793 Sets an image option as an integer.
2794 """
2795 return _core_.Image_SetOptionInt(*args, **kwargs)
2796
2797 def GetOption(*args, **kwargs):
2798 """
2799 GetOption(self, String name) -> String
2800
2801 Gets the value of an image handler option.
2802 """
2803 return _core_.Image_GetOption(*args, **kwargs)
2804
2805 def GetOptionInt(*args, **kwargs):
2806 """
2807 GetOptionInt(self, String name) -> int
2808
2809 Gets the value of an image handler option as an integer. If the given
2810 option is not present, the function returns 0.
2811 """
2812 return _core_.Image_GetOptionInt(*args, **kwargs)
2813
2814 def HasOption(*args, **kwargs):
2815 """
2816 HasOption(self, String name) -> bool
2817
2818 Returns true if the given option is present.
2819 """
2820 return _core_.Image_HasOption(*args, **kwargs)
2821
2822 def CountColours(*args, **kwargs):
2823 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2824 return _core_.Image_CountColours(*args, **kwargs)
2825
2826 def ComputeHistogram(*args, **kwargs):
2827 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2828 return _core_.Image_ComputeHistogram(*args, **kwargs)
2829
2830 def AddHandler(*args, **kwargs):
2831 """AddHandler(ImageHandler handler)"""
2832 return _core_.Image_AddHandler(*args, **kwargs)
2833
2834 AddHandler = staticmethod(AddHandler)
2835 def InsertHandler(*args, **kwargs):
2836 """InsertHandler(ImageHandler handler)"""
2837 return _core_.Image_InsertHandler(*args, **kwargs)
2838
2839 InsertHandler = staticmethod(InsertHandler)
2840 def RemoveHandler(*args, **kwargs):
2841 """RemoveHandler(String name) -> bool"""
2842 return _core_.Image_RemoveHandler(*args, **kwargs)
2843
2844 RemoveHandler = staticmethod(RemoveHandler)
2845 def GetHandlers(*args, **kwargs):
2846 """GetHandlers() -> PyObject"""
2847 return _core_.Image_GetHandlers(*args, **kwargs)
2848
2849 GetHandlers = staticmethod(GetHandlers)
2850 def GetImageExtWildcard(*args, **kwargs):
2851 """
2852 GetImageExtWildcard() -> String
2853
2854 Iterates all registered wxImageHandler objects, and returns a string
2855 containing file extension masks suitable for passing to file open/save
2856 dialog boxes.
2857 """
2858 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2859
2860 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2861 def ConvertToBitmap(*args, **kwargs):
2862 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2863 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2864
2865 def ConvertToMonoBitmap(*args, **kwargs):
2866 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2867 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2868
2869 def RotateHue(*args, **kwargs):
2870 """
2871 RotateHue(self, double angle)
2872
2873 Rotates the hue of each pixel of the image. Hue is a double in the
2874 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2875 """
2876 return _core_.Image_RotateHue(*args, **kwargs)
2877
2878 def RGBtoHSV(*args, **kwargs):
2879 """
2880 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2881
2882 Converts a color in RGB color space to HSV color space.
2883 """
2884 return _core_.Image_RGBtoHSV(*args, **kwargs)
2885
2886 RGBtoHSV = staticmethod(RGBtoHSV)
2887 def HSVtoRGB(*args, **kwargs):
2888 """
2889 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2890
2891 Converts a color in HSV color space to RGB color space.
2892 """
2893 return _core_.Image_HSVtoRGB(*args, **kwargs)
2894
2895 HSVtoRGB = staticmethod(HSVtoRGB)
2896 def __nonzero__(self): return self.Ok()
2897 _core_.Image_swigregister(Image)
2898
2899 def ImageFromMime(*args, **kwargs):
2900 """
2901 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2902
2903 Loads an image from a file, using a MIME type string (such as
2904 'image/jpeg') to specify image type.
2905 """
2906 val = _core_.new_ImageFromMime(*args, **kwargs)
2907 return val
2908
2909 def ImageFromStream(*args, **kwargs):
2910 """
2911 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2912
2913 Loads an image from an input stream, or any readable Python file-like
2914 object.
2915 """
2916 val = _core_.new_ImageFromStream(*args, **kwargs)
2917 return val
2918
2919 def ImageFromStreamMime(*args, **kwargs):
2920 """
2921 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2922
2923 Loads an image from an input stream, or any readable Python file-like
2924 object, specifying the image format with a MIME type string.
2925 """
2926 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2927 return val
2928
2929 def EmptyImage(*args, **kwargs):
2930 """
2931 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2932
2933 Construct an empty image of a given size, optionally setting all
2934 pixels to black.
2935 """
2936 val = _core_.new_EmptyImage(*args, **kwargs)
2937 return val
2938
2939 def ImageFromBitmap(*args, **kwargs):
2940 """
2941 ImageFromBitmap(Bitmap bitmap) -> Image
2942
2943 Construct an Image from a `wx.Bitmap`.
2944 """
2945 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2946 return val
2947
2948 def ImageFromData(*args, **kwargs):
2949 """
2950 ImageFromData(int width, int height, buffer data) -> Image
2951
2952 Construct an Image from a buffer of RGB bytes. Accepts either a
2953 string or a buffer object holding the data and the length of the data
2954 must be width*height*3.
2955 """
2956 val = _core_.new_ImageFromData(*args, **kwargs)
2957 return val
2958
2959 def ImageFromDataWithAlpha(*args, **kwargs):
2960 """
2961 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2962
2963 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2964 Accepts either a string or a buffer object holding the data and the
2965 length of the data must be width*height*3 bytes, and the length of the
2966 alpha data must be width*height bytes.
2967 """
2968 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2969 return val
2970
2971 def Image_CanRead(*args, **kwargs):
2972 """
2973 Image_CanRead(String filename) -> bool
2974
2975 Returns True if the image handlers can read this file.
2976 """
2977 return _core_.Image_CanRead(*args, **kwargs)
2978
2979 def Image_GetImageCount(*args, **kwargs):
2980 """
2981 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2982
2983 If the image file contains more than one image and the image handler
2984 is capable of retrieving these individually, this function will return
2985 the number of available images.
2986 """
2987 return _core_.Image_GetImageCount(*args, **kwargs)
2988
2989 def Image_CanReadStream(*args, **kwargs):
2990 """
2991 Image_CanReadStream(InputStream stream) -> bool
2992
2993 Returns True if the image handlers can read an image file from the
2994 data currently on the input stream, or a readable Python file-like
2995 object.
2996 """
2997 return _core_.Image_CanReadStream(*args, **kwargs)
2998
2999 def Image_AddHandler(*args, **kwargs):
3000 """Image_AddHandler(ImageHandler handler)"""
3001 return _core_.Image_AddHandler(*args, **kwargs)
3002
3003 def Image_InsertHandler(*args, **kwargs):
3004 """Image_InsertHandler(ImageHandler handler)"""
3005 return _core_.Image_InsertHandler(*args, **kwargs)
3006
3007 def Image_RemoveHandler(*args, **kwargs):
3008 """Image_RemoveHandler(String name) -> bool"""
3009 return _core_.Image_RemoveHandler(*args, **kwargs)
3010
3011 def Image_GetHandlers(*args):
3012 """Image_GetHandlers() -> PyObject"""
3013 return _core_.Image_GetHandlers(*args)
3014
3015 def Image_GetImageExtWildcard(*args):
3016 """
3017 Image_GetImageExtWildcard() -> String
3018
3019 Iterates all registered wxImageHandler objects, and returns a string
3020 containing file extension masks suitable for passing to file open/save
3021 dialog boxes.
3022 """
3023 return _core_.Image_GetImageExtWildcard(*args)
3024
3025 def Image_RGBtoHSV(*args, **kwargs):
3026 """
3027 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3028
3029 Converts a color in RGB color space to HSV color space.
3030 """
3031 return _core_.Image_RGBtoHSV(*args, **kwargs)
3032
3033 def Image_HSVtoRGB(*args, **kwargs):
3034 """
3035 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3036
3037 Converts a color in HSV color space to RGB color space.
3038 """
3039 return _core_.Image_HSVtoRGB(*args, **kwargs)
3040
3041 def InitAllImageHandlers():
3042 """
3043 The former functionality of InitAllImageHanders is now done internal to
3044 the _core_ extension module and so this function has become a simple NOP.
3045 """
3046 pass
3047
3048 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3049 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3050 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3051 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3052 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3053 BMP_24BPP = _core_.BMP_24BPP
3054 BMP_8BPP = _core_.BMP_8BPP
3055 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3056 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3057 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3058 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3059 BMP_4BPP = _core_.BMP_4BPP
3060 BMP_1BPP = _core_.BMP_1BPP
3061 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3062 class BMPHandler(ImageHandler):
3063 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3065 __repr__ = _swig_repr
3066 def __init__(self, *args, **kwargs):
3067 """
3068 __init__(self) -> BMPHandler
3069
3070 A `wx.ImageHandler` for \*.bmp bitmap files.
3071 """
3072 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3073 _core_.BMPHandler_swigregister(BMPHandler)
3074 NullImage = cvar.NullImage
3075 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3076 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3077 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3078 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3079 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3080 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3081 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3082 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3083 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3084 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3085 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3086 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3087 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3088 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3089 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3090
3091 class ICOHandler(BMPHandler):
3092 """A `wx.ImageHandler` for \*.ico icon files."""
3093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3094 __repr__ = _swig_repr
3095 def __init__(self, *args, **kwargs):
3096 """
3097 __init__(self) -> ICOHandler
3098
3099 A `wx.ImageHandler` for \*.ico icon files.
3100 """
3101 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3102 _core_.ICOHandler_swigregister(ICOHandler)
3103
3104 class CURHandler(ICOHandler):
3105 """A `wx.ImageHandler` for \*.cur cursor files."""
3106 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3107 __repr__ = _swig_repr
3108 def __init__(self, *args, **kwargs):
3109 """
3110 __init__(self) -> CURHandler
3111
3112 A `wx.ImageHandler` for \*.cur cursor files.
3113 """
3114 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3115 _core_.CURHandler_swigregister(CURHandler)
3116
3117 class ANIHandler(CURHandler):
3118 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3120 __repr__ = _swig_repr
3121 def __init__(self, *args, **kwargs):
3122 """
3123 __init__(self) -> ANIHandler
3124
3125 A `wx.ImageHandler` for \*.ani animated cursor files.
3126 """
3127 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3128 _core_.ANIHandler_swigregister(ANIHandler)
3129
3130 class PNGHandler(ImageHandler):
3131 """A `wx.ImageHandler` for PNG image files."""
3132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3133 __repr__ = _swig_repr
3134 def __init__(self, *args, **kwargs):
3135 """
3136 __init__(self) -> PNGHandler
3137
3138 A `wx.ImageHandler` for PNG image files.
3139 """
3140 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3141 _core_.PNGHandler_swigregister(PNGHandler)
3142
3143 class GIFHandler(ImageHandler):
3144 """A `wx.ImageHandler` for GIF image files."""
3145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3146 __repr__ = _swig_repr
3147 def __init__(self, *args, **kwargs):
3148 """
3149 __init__(self) -> GIFHandler
3150
3151 A `wx.ImageHandler` for GIF image files.
3152 """
3153 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3154 _core_.GIFHandler_swigregister(GIFHandler)
3155
3156 class PCXHandler(ImageHandler):
3157 """A `wx.ImageHandler` for PCX imager files."""
3158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3159 __repr__ = _swig_repr
3160 def __init__(self, *args, **kwargs):
3161 """
3162 __init__(self) -> PCXHandler
3163
3164 A `wx.ImageHandler` for PCX imager files.
3165 """
3166 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3167 _core_.PCXHandler_swigregister(PCXHandler)
3168
3169 class JPEGHandler(ImageHandler):
3170 """A `wx.ImageHandler` for JPEG/JPG image files."""
3171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3172 __repr__ = _swig_repr
3173 def __init__(self, *args, **kwargs):
3174 """
3175 __init__(self) -> JPEGHandler
3176
3177 A `wx.ImageHandler` for JPEG/JPG image files.
3178 """
3179 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3180 _core_.JPEGHandler_swigregister(JPEGHandler)
3181
3182 class PNMHandler(ImageHandler):
3183 """A `wx.ImageHandler` for PNM image files."""
3184 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3185 __repr__ = _swig_repr
3186 def __init__(self, *args, **kwargs):
3187 """
3188 __init__(self) -> PNMHandler
3189
3190 A `wx.ImageHandler` for PNM image files.
3191 """
3192 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3193 _core_.PNMHandler_swigregister(PNMHandler)
3194
3195 class XPMHandler(ImageHandler):
3196 """A `wx.ImageHandler` for XPM image."""
3197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3198 __repr__ = _swig_repr
3199 def __init__(self, *args, **kwargs):
3200 """
3201 __init__(self) -> XPMHandler
3202
3203 A `wx.ImageHandler` for XPM image.
3204 """
3205 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3206 _core_.XPMHandler_swigregister(XPMHandler)
3207
3208 class TIFFHandler(ImageHandler):
3209 """A `wx.ImageHandler` for TIFF image files."""
3210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3211 __repr__ = _swig_repr
3212 def __init__(self, *args, **kwargs):
3213 """
3214 __init__(self) -> TIFFHandler
3215
3216 A `wx.ImageHandler` for TIFF image files.
3217 """
3218 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3219 _core_.TIFFHandler_swigregister(TIFFHandler)
3220
3221 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3222 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3223 class Quantize(object):
3224 """Performs quantization, or colour reduction, on a wxImage."""
3225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3226 def __init__(self): raise AttributeError, "No constructor defined"
3227 __repr__ = _swig_repr
3228 def Quantize(*args, **kwargs):
3229 """
3230 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3231
3232 Reduce the colours in the source image and put the result into the
3233 destination image, setting the palette in the destination if
3234 needed. Both images may be the same, to overwrite the source image.
3235 """
3236 return _core_.Quantize_Quantize(*args, **kwargs)
3237
3238 Quantize = staticmethod(Quantize)
3239 _core_.Quantize_swigregister(Quantize)
3240
3241 def Quantize_Quantize(*args, **kwargs):
3242 """
3243 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3244
3245 Reduce the colours in the source image and put the result into the
3246 destination image, setting the palette in the destination if
3247 needed. Both images may be the same, to overwrite the source image.
3248 """
3249 return _core_.Quantize_Quantize(*args, **kwargs)
3250
3251 #---------------------------------------------------------------------------
3252
3253 class EvtHandler(Object):
3254 """Proxy of C++ EvtHandler class"""
3255 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3256 __repr__ = _swig_repr
3257 def __init__(self, *args, **kwargs):
3258 """__init__(self) -> EvtHandler"""
3259 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3260 def GetNextHandler(*args, **kwargs):
3261 """GetNextHandler(self) -> EvtHandler"""
3262 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3263
3264 def GetPreviousHandler(*args, **kwargs):
3265 """GetPreviousHandler(self) -> EvtHandler"""
3266 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3267
3268 def SetNextHandler(*args, **kwargs):
3269 """SetNextHandler(self, EvtHandler handler)"""
3270 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3271
3272 def SetPreviousHandler(*args, **kwargs):
3273 """SetPreviousHandler(self, EvtHandler handler)"""
3274 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3275
3276 def GetEvtHandlerEnabled(*args, **kwargs):
3277 """GetEvtHandlerEnabled(self) -> bool"""
3278 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3279
3280 def SetEvtHandlerEnabled(*args, **kwargs):
3281 """SetEvtHandlerEnabled(self, bool enabled)"""
3282 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3283
3284 def ProcessEvent(*args, **kwargs):
3285 """ProcessEvent(self, Event event) -> bool"""
3286 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3287
3288 def AddPendingEvent(*args, **kwargs):
3289 """AddPendingEvent(self, Event event)"""
3290 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3291
3292 def ProcessPendingEvents(*args, **kwargs):
3293 """ProcessPendingEvents(self)"""
3294 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3295
3296 def Connect(*args, **kwargs):
3297 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3298 return _core_.EvtHandler_Connect(*args, **kwargs)
3299
3300 def Disconnect(*args, **kwargs):
3301 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3302 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3303
3304 def _setOORInfo(*args, **kwargs):
3305 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3306 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3307 args[0].thisown = 0
3308 return val
3309
3310 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3311 """
3312 Bind an event to an event handler.
3313
3314 :param event: One of the EVT_* objects that specifies the
3315 type of event to bind,
3316
3317 :param handler: A callable object to be invoked when the
3318 event is delivered to self. Pass None to
3319 disconnect an event handler.
3320
3321 :param source: Sometimes the event originates from a
3322 different window than self, but you still
3323 want to catch it in self. (For example, a
3324 button event delivered to a frame.) By
3325 passing the source of the event, the event
3326 handling system is able to differentiate
3327 between the same event type from different
3328 controls.
3329
3330 :param id: Used to spcify the event source by ID instead
3331 of instance.
3332
3333 :param id2: Used when it is desirable to bind a handler
3334 to a range of IDs, such as with EVT_MENU_RANGE.
3335 """
3336 if source is not None:
3337 id = source.GetId()
3338 event.Bind(self, id, id2, handler)
3339
3340 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3341 """
3342 Disconencts the event handler binding for event from self.
3343 Returns True if successful.
3344 """
3345 if source is not None:
3346 id = source.GetId()
3347 return event.Unbind(self, id, id2)
3348
3349 _core_.EvtHandler_swigregister(EvtHandler)
3350
3351 #---------------------------------------------------------------------------
3352
3353 class PyEventBinder(object):
3354 """
3355 Instances of this class are used to bind specific events to event
3356 handlers.
3357 """
3358 def __init__(self, evtType, expectedIDs=0):
3359 if expectedIDs not in [0, 1, 2]:
3360 raise ValueError, "Invalid number of expectedIDs"
3361 self.expectedIDs = expectedIDs
3362
3363 if type(evtType) == list or type(evtType) == tuple:
3364 self.evtType = evtType
3365 else:
3366 self.evtType = [evtType]
3367
3368
3369 def Bind(self, target, id1, id2, function):
3370 """Bind this set of event types to target."""
3371 for et in self.evtType:
3372 target.Connect(id1, id2, et, function)
3373
3374
3375 def Unbind(self, target, id1, id2):
3376 """Remove an event binding."""
3377 success = 0
3378 for et in self.evtType:
3379 success += target.Disconnect(id1, id2, et)
3380 return success != 0
3381
3382
3383 def __call__(self, *args):
3384 """
3385 For backwards compatibility with the old EVT_* functions.
3386 Should be called with either (window, func), (window, ID,
3387 func) or (window, ID1, ID2, func) parameters depending on the
3388 type of the event.
3389 """
3390 assert len(args) == 2 + self.expectedIDs
3391 id1 = wx.ID_ANY
3392 id2 = wx.ID_ANY
3393 target = args[0]
3394 if self.expectedIDs == 0:
3395 func = args[1]
3396 elif self.expectedIDs == 1:
3397 id1 = args[1]
3398 func = args[2]
3399 elif self.expectedIDs == 2:
3400 id1 = args[1]
3401 id2 = args[2]
3402 func = args[3]
3403 else:
3404 raise ValueError, "Unexpected number of IDs"
3405
3406 self.Bind(target, id1, id2, func)
3407
3408
3409 # These two are square pegs that don't fit the PyEventBinder hole...
3410 def EVT_COMMAND(win, id, cmd, func):
3411 win.Connect(id, -1, cmd, func)
3412 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3413 win.Connect(id1, id2, cmd, func)
3414
3415
3416 #---------------------------------------------------------------------------
3417
3418 #---------------------------------------------------------------------------
3419
3420 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3421 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3422
3423 def NewEventType(*args):
3424 """NewEventType() -> EventType"""
3425 return _core_.NewEventType(*args)
3426 wxEVT_NULL = _core_.wxEVT_NULL
3427 wxEVT_FIRST = _core_.wxEVT_FIRST
3428 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3429 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3430 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3431 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3432 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3433 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3434 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3435 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3436 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3437 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3438 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3439 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3440 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3441 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3442 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3443 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3444 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3445 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3446 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3447 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3448 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3449 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3450 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3451 wxEVT_MOTION = _core_.wxEVT_MOTION
3452 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3453 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3454 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3455 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3456 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3457 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3458 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3459 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3460 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3461 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3462 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3463 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3464 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3465 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3466 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3467 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3468 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3469 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3470 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3471 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3472 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3473 wxEVT_CHAR = _core_.wxEVT_CHAR
3474 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3475 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3476 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3477 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3478 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3479 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3480 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3481 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3482 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3483 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3484 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3485 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3486 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3487 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3488 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3489 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3490 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3491 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3492 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3493 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3494 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3495 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3496 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3497 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3498 wxEVT_SIZE = _core_.wxEVT_SIZE
3499 wxEVT_MOVE = _core_.wxEVT_MOVE
3500 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3501 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3502 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3503 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3504 wxEVT_POWER = _core_.wxEVT_POWER
3505 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3506 wxEVT_CREATE = _core_.wxEVT_CREATE
3507 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3508 wxEVT_SHOW = _core_.wxEVT_SHOW
3509 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3510 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3511 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3512 wxEVT_PAINT = _core_.wxEVT_PAINT
3513 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3514 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3515 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3516 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3517 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3518 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3519 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3520 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3521 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3522 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3523 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3524 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3525 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3526 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3527 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3528 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3529 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3530 wxEVT_IDLE = _core_.wxEVT_IDLE
3531 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3532 wxEVT_SIZING = _core_.wxEVT_SIZING
3533 wxEVT_MOVING = _core_.wxEVT_MOVING
3534 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3535 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3536 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3537 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3538 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3539 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3540 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3541 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3542 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3543 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3544 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3545 #
3546 # Create some event binders
3547 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3548 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3549 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3550 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3551 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3552 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3553 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3554 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3555 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3556 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3557 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3558 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3559 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3560 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3561 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3562 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3563 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3564 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3565 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3566 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3567 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3568 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3569 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3570 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3571 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3572 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3573 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3574 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3575 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3576 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3577 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3578 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3579 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3580 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3581 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3582 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3583 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3584 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3585 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3586 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3587 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3588
3589 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3590 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3591 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3592 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3593 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3594 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3595 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3596 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3597 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3598 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3599 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3600 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3601 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3602
3603 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3604 wxEVT_LEFT_UP,
3605 wxEVT_MIDDLE_DOWN,
3606 wxEVT_MIDDLE_UP,
3607 wxEVT_RIGHT_DOWN,
3608 wxEVT_RIGHT_UP,
3609 wxEVT_MOTION,
3610 wxEVT_LEFT_DCLICK,
3611 wxEVT_MIDDLE_DCLICK,
3612 wxEVT_RIGHT_DCLICK,
3613 wxEVT_ENTER_WINDOW,
3614 wxEVT_LEAVE_WINDOW,
3615 wxEVT_MOUSEWHEEL
3616 ])
3617
3618
3619 # Scrolling from wxWindow (sent to wxScrolledWindow)
3620 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3621 wxEVT_SCROLLWIN_BOTTOM,
3622 wxEVT_SCROLLWIN_LINEUP,
3623 wxEVT_SCROLLWIN_LINEDOWN,
3624 wxEVT_SCROLLWIN_PAGEUP,
3625 wxEVT_SCROLLWIN_PAGEDOWN,
3626 wxEVT_SCROLLWIN_THUMBTRACK,
3627 wxEVT_SCROLLWIN_THUMBRELEASE,
3628 ])
3629
3630 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3631 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3632 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3633 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3634 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3635 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3636 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3637 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3638
3639 # Scrolling from wx.Slider and wx.ScrollBar
3640 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3641 wxEVT_SCROLL_BOTTOM,
3642 wxEVT_SCROLL_LINEUP,
3643 wxEVT_SCROLL_LINEDOWN,
3644 wxEVT_SCROLL_PAGEUP,
3645 wxEVT_SCROLL_PAGEDOWN,
3646 wxEVT_SCROLL_THUMBTRACK,
3647 wxEVT_SCROLL_THUMBRELEASE,
3648 wxEVT_SCROLL_CHANGED,
3649 ])
3650
3651 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3652 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3653 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3654 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3655 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3656 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3657 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3658 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3659 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3660 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3661
3662 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3663 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3664 wxEVT_SCROLL_BOTTOM,
3665 wxEVT_SCROLL_LINEUP,
3666 wxEVT_SCROLL_LINEDOWN,
3667 wxEVT_SCROLL_PAGEUP,
3668 wxEVT_SCROLL_PAGEDOWN,
3669 wxEVT_SCROLL_THUMBTRACK,
3670 wxEVT_SCROLL_THUMBRELEASE,
3671 wxEVT_SCROLL_CHANGED,
3672 ], 1)
3673
3674 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3675 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3676 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3677 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3678 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3679 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3680 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3681 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3682 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3683 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3684
3685 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3686 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3687 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3688 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3689 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3690 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3691 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3692 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3693 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3694 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3695
3696 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3697 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3698 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3699 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3700 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3701 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3702 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3703 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3704 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3705
3706
3707 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3708 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3709 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3710 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3711 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3712 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3713 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3714
3715 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3716
3717 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3718 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3719
3720 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3721
3722 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3723 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3724 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3725
3726
3727 #---------------------------------------------------------------------------
3728
3729 class Event(Object):
3730 """
3731 An event is a structure holding information about an event passed to a
3732 callback or member function. wx.Event is an abstract base class for
3733 other event classes
3734 """
3735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3736 def __init__(self): raise AttributeError, "No constructor defined"
3737 __repr__ = _swig_repr
3738 __swig_destroy__ = _core_.delete_Event
3739 __del__ = lambda self : None;
3740 def SetEventType(*args, **kwargs):
3741 """
3742 SetEventType(self, EventType typ)
3743
3744 Sets the specific type of the event.
3745 """
3746 return _core_.Event_SetEventType(*args, **kwargs)
3747
3748 def GetEventType(*args, **kwargs):
3749 """
3750 GetEventType(self) -> EventType
3751
3752 Returns the identifier of the given event type, such as
3753 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3754 """
3755 return _core_.Event_GetEventType(*args, **kwargs)
3756
3757 def GetEventObject(*args, **kwargs):
3758 """
3759 GetEventObject(self) -> Object
3760
3761 Returns the object (usually a window) associated with the event, if
3762 any.
3763 """
3764 return _core_.Event_GetEventObject(*args, **kwargs)
3765
3766 def SetEventObject(*args, **kwargs):
3767 """
3768 SetEventObject(self, Object obj)
3769
3770 Sets the originating object, or in other words, obj is normally the
3771 object that is sending the event.
3772 """
3773 return _core_.Event_SetEventObject(*args, **kwargs)
3774
3775 def GetTimestamp(*args, **kwargs):
3776 """GetTimestamp(self) -> long"""
3777 return _core_.Event_GetTimestamp(*args, **kwargs)
3778
3779 def SetTimestamp(*args, **kwargs):
3780 """SetTimestamp(self, long ts=0)"""
3781 return _core_.Event_SetTimestamp(*args, **kwargs)
3782
3783 def GetId(*args, **kwargs):
3784 """
3785 GetId(self) -> int
3786
3787 Returns the identifier associated with this event, such as a button
3788 command id.
3789 """
3790 return _core_.Event_GetId(*args, **kwargs)
3791
3792 def SetId(*args, **kwargs):
3793 """
3794 SetId(self, int Id)
3795
3796 Set's the ID for the event. This is usually the ID of the window that
3797 is sending the event, but it can also be a command id from a menu
3798 item, etc.
3799 """
3800 return _core_.Event_SetId(*args, **kwargs)
3801
3802 def IsCommandEvent(*args, **kwargs):
3803 """
3804 IsCommandEvent(self) -> bool
3805
3806 Returns true if the event is or is derived from `wx.CommandEvent` else
3807 it returns false. Note: Exists only for optimization purposes.
3808 """
3809 return _core_.Event_IsCommandEvent(*args, **kwargs)
3810
3811 def Skip(*args, **kwargs):
3812 """
3813 Skip(self, bool skip=True)
3814
3815 Called by an event handler, it controls whether additional event
3816 handlers bound to this event will be called after the current event
3817 handler returns. Skip(false) (the default setting) will prevent
3818 additional event handlers from being called and control will be
3819 returned to the sender of the event immediately after the current
3820 handler has finished. Skip(True) will cause the event processing
3821 system to continue searching for a handler function for this event.
3822
3823 """
3824 return _core_.Event_Skip(*args, **kwargs)
3825
3826 def GetSkipped(*args, **kwargs):
3827 """
3828 GetSkipped(self) -> bool
3829
3830 Returns true if the event handler should be skipped, false otherwise.
3831 :see: `Skip`
3832 """
3833 return _core_.Event_GetSkipped(*args, **kwargs)
3834
3835 def ShouldPropagate(*args, **kwargs):
3836 """
3837 ShouldPropagate(self) -> bool
3838
3839 Test if this event should be propagated to the parent window or not,
3840 i.e. if the propagation level is currently greater than 0.
3841 """
3842 return _core_.Event_ShouldPropagate(*args, **kwargs)
3843
3844 def StopPropagation(*args, **kwargs):
3845 """
3846 StopPropagation(self) -> int
3847
3848 Stop the event from propagating to its parent window. Returns the old
3849 propagation level value which may be later passed to
3850 `ResumePropagation` to allow propagating the event again.
3851 """
3852 return _core_.Event_StopPropagation(*args, **kwargs)
3853
3854 def ResumePropagation(*args, **kwargs):
3855 """
3856 ResumePropagation(self, int propagationLevel)
3857
3858 Resume the event propagation by restoring the propagation level. (For
3859 example, you can use the value returned by an earlier call to
3860 `StopPropagation`.)
3861
3862 """
3863 return _core_.Event_ResumePropagation(*args, **kwargs)
3864
3865 def Clone(*args, **kwargs):
3866 """Clone(self) -> Event"""
3867 return _core_.Event_Clone(*args, **kwargs)
3868
3869 _core_.Event_swigregister(Event)
3870
3871 #---------------------------------------------------------------------------
3872
3873 class PropagationDisabler(object):
3874 """
3875 Helper class to temporarily change an event not to propagate. Simply
3876 create an instance of this class and then whe it is destroyed the
3877 propogation of the event will be restored.
3878 """
3879 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3880 __repr__ = _swig_repr
3881 def __init__(self, *args, **kwargs):
3882 """
3883 __init__(self, Event event) -> PropagationDisabler
3884
3885 Helper class to temporarily change an event not to propagate. Simply
3886 create an instance of this class and then whe it is destroyed the
3887 propogation of the event will be restored.
3888 """
3889 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3890 __swig_destroy__ = _core_.delete_PropagationDisabler
3891 __del__ = lambda self : None;
3892 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3893
3894 class PropagateOnce(object):
3895 """
3896 A helper class that will temporarily lower propagation level of an
3897 event. Simply create an instance of this class and then whe it is
3898 destroyed the propogation of the event will be restored.
3899 """
3900 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3901 __repr__ = _swig_repr
3902 def __init__(self, *args, **kwargs):
3903 """
3904 __init__(self, Event event) -> PropagateOnce
3905
3906 A helper class that will temporarily lower propagation level of an
3907 event. Simply create an instance of this class and then whe it is
3908 destroyed the propogation of the event will be restored.
3909 """
3910 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3911 __swig_destroy__ = _core_.delete_PropagateOnce
3912 __del__ = lambda self : None;
3913 _core_.PropagateOnce_swigregister(PropagateOnce)
3914
3915 #---------------------------------------------------------------------------
3916
3917 class CommandEvent(Event):
3918 """
3919 This event class contains information about command events, which
3920 originate from a variety of simple controls, as well as menus and
3921 toolbars.
3922 """
3923 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3924 __repr__ = _swig_repr
3925 def __init__(self, *args, **kwargs):
3926 """
3927 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3928
3929 This event class contains information about command events, which
3930 originate from a variety of simple controls, as well as menus and
3931 toolbars.
3932 """
3933 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3934 def GetSelection(*args, **kwargs):
3935 """
3936 GetSelection(self) -> int
3937
3938 Returns item index for a listbox or choice selection event (not valid
3939 for a deselection).
3940 """
3941 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3942
3943 def SetString(*args, **kwargs):
3944 """SetString(self, String s)"""
3945 return _core_.CommandEvent_SetString(*args, **kwargs)
3946
3947 def GetString(*args, **kwargs):
3948 """
3949 GetString(self) -> String
3950
3951 Returns item string for a listbox or choice selection event (not valid
3952 for a deselection).
3953 """
3954 return _core_.CommandEvent_GetString(*args, **kwargs)
3955
3956 def IsChecked(*args, **kwargs):
3957 """
3958 IsChecked(self) -> bool
3959
3960 This method can be used with checkbox and menu events: for the
3961 checkboxes, the method returns true for a selection event and false
3962 for a deselection one. For the menu events, this method indicates if
3963 the menu item just has become checked or unchecked (and thus only
3964 makes sense for checkable menu items).
3965 """
3966 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3967
3968 Checked = IsChecked
3969 def IsSelection(*args, **kwargs):
3970 """
3971 IsSelection(self) -> bool
3972
3973 For a listbox or similar event, returns true if it is a selection,
3974 false if it is a deselection.
3975 """
3976 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3977
3978 def SetExtraLong(*args, **kwargs):
3979 """SetExtraLong(self, long extraLong)"""
3980 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3981
3982 def GetExtraLong(*args, **kwargs):
3983 """
3984 GetExtraLong(self) -> long
3985
3986 Returns extra information dependant on the event objects type. If the
3987 event comes from a listbox selection, it is a boolean determining
3988 whether the event was a selection (true) or a deselection (false). A
3989 listbox deselection only occurs for multiple-selection boxes, and in
3990 this case the index and string values are indeterminate and the
3991 listbox must be examined by the application.
3992 """
3993 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3994
3995 def SetInt(*args, **kwargs):
3996 """SetInt(self, int i)"""
3997 return _core_.CommandEvent_SetInt(*args, **kwargs)
3998
3999 def GetInt(*args, **kwargs):
4000 """
4001 GetInt(self) -> int
4002
4003 Returns the integer identifier corresponding to a listbox, choice or
4004 radiobox selection (only if the event was a selection, not a
4005 deselection), or a boolean value representing the value of a checkbox.
4006 """
4007 return _core_.CommandEvent_GetInt(*args, **kwargs)
4008
4009 def GetClientData(*args, **kwargs):
4010 """
4011 GetClientData(self) -> PyObject
4012
4013 Returns the client data object for a listbox or choice selection event, (if any.)
4014 """
4015 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4016
4017 def SetClientData(*args, **kwargs):
4018 """
4019 SetClientData(self, PyObject clientData)
4020
4021 Associate the given client data with the item at position n.
4022 """
4023 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4024
4025 GetClientObject = GetClientData
4026 SetClientObject = SetClientData
4027
4028 def Clone(*args, **kwargs):
4029 """Clone(self) -> Event"""
4030 return _core_.CommandEvent_Clone(*args, **kwargs)
4031
4032 _core_.CommandEvent_swigregister(CommandEvent)
4033
4034 #---------------------------------------------------------------------------
4035
4036 class NotifyEvent(CommandEvent):
4037 """
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4042 """
4043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4044 __repr__ = _swig_repr
4045 def __init__(self, *args, **kwargs):
4046 """
4047 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4048
4049 An instance of this class (or one of its derived classes) is sent from
4050 a control when the control's state is being changed and the control
4051 allows that change to be prevented from happening. The event handler
4052 can call `Veto` or `Allow` to tell the control what to do.
4053 """
4054 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4055 def Veto(*args, **kwargs):
4056 """
4057 Veto(self)
4058
4059 Prevents the change announced by this event from happening.
4060
4061 It is in general a good idea to notify the user about the reasons for
4062 vetoing the change because otherwise the applications behaviour (which
4063 just refuses to do what the user wants) might be quite surprising.
4064 """
4065 return _core_.NotifyEvent_Veto(*args, **kwargs)
4066
4067 def Allow(*args, **kwargs):
4068 """
4069 Allow(self)
4070
4071 This is the opposite of `Veto`: it explicitly allows the event to be
4072 processed. For most events it is not necessary to call this method as
4073 the events are allowed anyhow but some are forbidden by default (this
4074 will be mentioned in the corresponding event description).
4075 """
4076 return _core_.NotifyEvent_Allow(*args, **kwargs)
4077
4078 def IsAllowed(*args, **kwargs):
4079 """
4080 IsAllowed(self) -> bool
4081
4082 Returns true if the change is allowed (`Veto` hasn't been called) or
4083 false otherwise (if it was).
4084 """
4085 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4086
4087 _core_.NotifyEvent_swigregister(NotifyEvent)
4088
4089 #---------------------------------------------------------------------------
4090
4091 class ScrollEvent(CommandEvent):
4092 """
4093 A scroll event holds information about events sent from stand-alone
4094 scrollbars and sliders. Note that scrolled windows do not send
4095 instnaces of this event class, but send the `wx.ScrollWinEvent`
4096 instead.
4097 """
4098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4099 __repr__ = _swig_repr
4100 def __init__(self, *args, **kwargs):
4101 """
4102 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4103 int orient=0) -> ScrollEvent
4104 """
4105 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4106 def GetOrientation(*args, **kwargs):
4107 """
4108 GetOrientation(self) -> int
4109
4110 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4111 the scrollbar.
4112 """
4113 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4114
4115 def GetPosition(*args, **kwargs):
4116 """
4117 GetPosition(self) -> int
4118
4119 Returns the position of the scrollbar.
4120 """
4121 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4122
4123 def SetOrientation(*args, **kwargs):
4124 """SetOrientation(self, int orient)"""
4125 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4126
4127 def SetPosition(*args, **kwargs):
4128 """SetPosition(self, int pos)"""
4129 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4130
4131 _core_.ScrollEvent_swigregister(ScrollEvent)
4132
4133 #---------------------------------------------------------------------------
4134
4135 class ScrollWinEvent(Event):
4136 """
4137 A wx.ScrollWinEvent holds information about scrolling and is sent from
4138 scrolling windows.
4139 """
4140 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4141 __repr__ = _swig_repr
4142 def __init__(self, *args, **kwargs):
4143 """
4144 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4145
4146 A wx.ScrollWinEvent holds information about scrolling and is sent from
4147 scrolling windows.
4148 """
4149 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4150 def GetOrientation(*args, **kwargs):
4151 """
4152 GetOrientation(self) -> int
4153
4154 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4155 the scrollbar.
4156 """
4157 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4158
4159 def GetPosition(*args, **kwargs):
4160 """
4161 GetPosition(self) -> int
4162
4163 Returns the position of the scrollbar for the thumb track and release
4164 events. Note that this field can't be used for the other events, you
4165 need to query the window itself for the current position in that case.
4166 """
4167 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4168
4169 def SetOrientation(*args, **kwargs):
4170 """SetOrientation(self, int orient)"""
4171 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4172
4173 def SetPosition(*args, **kwargs):
4174 """SetPosition(self, int pos)"""
4175 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4176
4177 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4178
4179 #---------------------------------------------------------------------------
4180
4181 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4182 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4183 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4184 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4185 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4186 class MouseEvent(Event):
4187 """
4188 This event class contains information about the events generated by
4189 the mouse: they include mouse buttons press and release events and
4190 mouse move events.
4191
4192 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4193 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4194 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4195 a middle button so a portable application should avoid relying on the
4196 events from it.
4197
4198 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4199 the former returns true when the event corresponds to the left mouse
4200 button click while the latter returns true if the left mouse button is
4201 currently being pressed. For example, when the user is dragging the
4202 mouse you can use `LeftIsDown` to test whether the left mouse button
4203 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4204 `LeftIsDown` will also return true in wxWidgets whatever the
4205 underlying GUI behaviour is (which is platform-dependent). The same
4206 applies, of course, to other mouse buttons as well.
4207 """
4208 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4209 __repr__ = _swig_repr
4210 def __init__(self, *args, **kwargs):
4211 """
4212 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4213
4214 Constructs a wx.MouseEvent. Valid event types are:
4215
4216 * wxEVT_ENTER_WINDOW
4217 * wxEVT_LEAVE_WINDOW
4218 * wxEVT_LEFT_DOWN
4219 * wxEVT_LEFT_UP
4220 * wxEVT_LEFT_DCLICK
4221 * wxEVT_MIDDLE_DOWN
4222 * wxEVT_MIDDLE_UP
4223 * wxEVT_MIDDLE_DCLICK
4224 * wxEVT_RIGHT_DOWN
4225 * wxEVT_RIGHT_UP
4226 * wxEVT_RIGHT_DCLICK
4227 * wxEVT_MOTION
4228 * wxEVT_MOUSEWHEEL
4229 """
4230 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4231 def IsButton(*args, **kwargs):
4232 """
4233 IsButton(self) -> bool
4234
4235 Returns true if the event was a mouse button event (not necessarily a
4236 button down event - that may be tested using `ButtonDown`).
4237 """
4238 return _core_.MouseEvent_IsButton(*args, **kwargs)
4239
4240 def ButtonDown(*args, **kwargs):
4241 """
4242 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4243
4244 If the argument is omitted, this returns true if the event was any
4245 mouse button down event. Otherwise the argument specifies which
4246 button-down event shold be checked for (see `Button` for the possible
4247 values).
4248 """
4249 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4250
4251 def ButtonDClick(*args, **kwargs):
4252 """
4253 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4254
4255 If the argument is omitted, this returns true if the event was any
4256 mouse double click event. Otherwise the argument specifies which
4257 double click event to check for (see `Button` for the possible
4258 values).
4259 """
4260 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4261
4262 def ButtonUp(*args, **kwargs):
4263 """
4264 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4265
4266 If the argument is omitted, this returns true if the event was any
4267 mouse button up event. Otherwise the argument specifies which button
4268 up event to check for (see `Button` for the possible values).
4269 """
4270 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4271
4272 def Button(*args, **kwargs):
4273 """
4274 Button(self, int button) -> bool
4275
4276 Returns true if the identified mouse button is changing state. Valid
4277 values of button are:
4278
4279 ==================== =====================================
4280 wx.MOUSE_BTN_LEFT check if left button was pressed
4281 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4282 wx.MOUSE_BTN_RIGHT check if right button was pressed
4283 wx.MOUSE_BTN_ANY check if any button was pressed
4284 ==================== =====================================
4285
4286 """
4287 return _core_.MouseEvent_Button(*args, **kwargs)
4288
4289 def ButtonIsDown(*args, **kwargs):
4290 """ButtonIsDown(self, int but) -> bool"""
4291 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4292
4293 def GetButton(*args, **kwargs):
4294 """
4295 GetButton(self) -> int
4296
4297 Returns the mouse button which generated this event or
4298 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4299 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4300 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4301 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4302 right buttons respectively.
4303 """
4304 return _core_.MouseEvent_GetButton(*args, **kwargs)
4305
4306 def ControlDown(*args, **kwargs):
4307 """
4308 ControlDown(self) -> bool
4309
4310 Returns true if the control key was down at the time of the event.
4311 """
4312 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4313
4314 def MetaDown(*args, **kwargs):
4315 """
4316 MetaDown(self) -> bool
4317
4318 Returns true if the Meta key was down at the time of the event.
4319 """
4320 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4321
4322 def AltDown(*args, **kwargs):
4323 """
4324 AltDown(self) -> bool
4325
4326 Returns true if the Alt key was down at the time of the event.
4327 """
4328 return _core_.MouseEvent_AltDown(*args, **kwargs)
4329
4330 def ShiftDown(*args, **kwargs):
4331 """
4332 ShiftDown(self) -> bool
4333
4334 Returns true if the Shift key was down at the time of the event.
4335 """
4336 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4337
4338 def CmdDown(*args, **kwargs):
4339 """
4340 CmdDown(self) -> bool
4341
4342 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4343 platforms but the special "Apple" (a.k.a as "Command") key on
4344 Macs. It often makes sense to use it instead of, say, `ControlDown`
4345 because Cmd key is used for the same thing under Mac as Ctrl
4346 elsewhere. The Ctrl key still exists, it's just not used for this
4347 purpose. So for non-Mac platforms this is the same as `ControlDown`
4348 and Macs this is the same as `MetaDown`.
4349 """
4350 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4351
4352 def LeftDown(*args, **kwargs):
4353 """
4354 LeftDown(self) -> bool
4355
4356 Returns true if the left mouse button state changed to down.
4357 """
4358 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4359
4360 def MiddleDown(*args, **kwargs):
4361 """
4362 MiddleDown(self) -> bool
4363
4364 Returns true if the middle mouse button state changed to down.
4365 """
4366 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4367
4368 def RightDown(*args, **kwargs):
4369 """
4370 RightDown(self) -> bool
4371
4372 Returns true if the right mouse button state changed to down.
4373 """
4374 return _core_.MouseEvent_RightDown(*args, **kwargs)
4375
4376 def LeftUp(*args, **kwargs):
4377 """
4378 LeftUp(self) -> bool
4379
4380 Returns true if the left mouse button state changed to up.
4381 """
4382 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4383
4384 def MiddleUp(*args, **kwargs):
4385 """
4386 MiddleUp(self) -> bool
4387
4388 Returns true if the middle mouse button state changed to up.
4389 """
4390 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4391
4392 def RightUp(*args, **kwargs):
4393 """
4394 RightUp(self) -> bool
4395
4396 Returns true if the right mouse button state changed to up.
4397 """
4398 return _core_.MouseEvent_RightUp(*args, **kwargs)
4399
4400 def LeftDClick(*args, **kwargs):
4401 """
4402 LeftDClick(self) -> bool
4403
4404 Returns true if the event was a left button double click.
4405 """
4406 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4407
4408 def MiddleDClick(*args, **kwargs):
4409 """
4410 MiddleDClick(self) -> bool
4411
4412 Returns true if the event was a middle button double click.
4413 """
4414 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4415
4416 def RightDClick(*args, **kwargs):
4417 """
4418 RightDClick(self) -> bool
4419
4420 Returns true if the event was a right button double click.
4421 """
4422 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4423
4424 def LeftIsDown(*args, **kwargs):
4425 """
4426 LeftIsDown(self) -> bool
4427
4428 Returns true if the left mouse button is currently down, independent
4429 of the current event type.
4430
4431 Please notice that it is not the same as LeftDown which returns true
4432 if the left mouse button was just pressed. Rather, it describes the
4433 state of the mouse button before the event happened.
4434
4435 This event is usually used in the mouse event handlers which process
4436 "move mouse" messages to determine whether the user is (still)
4437 dragging the mouse.
4438 """
4439 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4440
4441 def MiddleIsDown(*args, **kwargs):
4442 """
4443 MiddleIsDown(self) -> bool
4444
4445 Returns true if the middle mouse button is currently down, independent
4446 of the current event type.
4447 """
4448 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4449
4450 def RightIsDown(*args, **kwargs):
4451 """
4452 RightIsDown(self) -> bool
4453
4454 Returns true if the right mouse button is currently down, independent
4455 of the current event type.
4456 """
4457 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4458
4459 def Dragging(*args, **kwargs):
4460 """
4461 Dragging(self) -> bool
4462
4463 Returns true if this was a dragging event (motion while a button is
4464 depressed).
4465 """
4466 return _core_.MouseEvent_Dragging(*args, **kwargs)
4467
4468 def Moving(*args, **kwargs):
4469 """
4470 Moving(self) -> bool
4471
4472 Returns true if this was a motion event and no mouse buttons were
4473 pressed. If any mouse button is held pressed, then this method returns
4474 false and Dragging returns true.
4475 """
4476 return _core_.MouseEvent_Moving(*args, **kwargs)
4477
4478 def Entering(*args, **kwargs):
4479 """
4480 Entering(self) -> bool
4481
4482 Returns true if the mouse was entering the window.
4483 """
4484 return _core_.MouseEvent_Entering(*args, **kwargs)
4485
4486 def Leaving(*args, **kwargs):
4487 """
4488 Leaving(self) -> bool
4489
4490 Returns true if the mouse was leaving the window.
4491 """
4492 return _core_.MouseEvent_Leaving(*args, **kwargs)
4493
4494 def GetPosition(*args, **kwargs):
4495 """
4496 GetPosition(self) -> Point
4497
4498 Returns the pixel position of the mouse in window coordinates when the
4499 event happened.
4500 """
4501 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4502
4503 def GetPositionTuple(*args, **kwargs):
4504 """
4505 GetPositionTuple() -> (x,y)
4506
4507 Returns the pixel position of the mouse in window coordinates when the
4508 event happened.
4509 """
4510 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4511
4512 def GetLogicalPosition(*args, **kwargs):
4513 """
4514 GetLogicalPosition(self, DC dc) -> Point
4515
4516 Returns the logical mouse position in pixels (i.e. translated
4517 according to the translation set for the DC, which usually indicates
4518 that the window has been scrolled).
4519 """
4520 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4521
4522 def GetX(*args, **kwargs):
4523 """
4524 GetX(self) -> int
4525
4526 Returns X coordinate of the physical mouse event position.
4527 """
4528 return _core_.MouseEvent_GetX(*args, **kwargs)
4529
4530 def GetY(*args, **kwargs):
4531 """
4532 GetY(self) -> int
4533
4534 Returns Y coordinate of the physical mouse event position.
4535 """
4536 return _core_.MouseEvent_GetY(*args, **kwargs)
4537
4538 def GetWheelRotation(*args, **kwargs):
4539 """
4540 GetWheelRotation(self) -> int
4541
4542 Get wheel rotation, positive or negative indicates direction of
4543 rotation. Current devices all send an event when rotation is equal to
4544 +/-WheelDelta, but this allows for finer resolution devices to be
4545 created in the future. Because of this you shouldn't assume that one
4546 event is equal to 1 line or whatever, but you should be able to either
4547 do partial line scrolling or wait until +/-WheelDelta rotation values
4548 have been accumulated before scrolling.
4549 """
4550 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4551
4552 def GetWheelDelta(*args, **kwargs):
4553 """
4554 GetWheelDelta(self) -> int
4555
4556 Get wheel delta, normally 120. This is the threshold for action to be
4557 taken, and one such action (for example, scrolling one increment)
4558 should occur for each delta.
4559 """
4560 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4561
4562 def GetLinesPerAction(*args, **kwargs):
4563 """
4564 GetLinesPerAction(self) -> int
4565
4566 Returns the configured number of lines (or whatever) to be scrolled
4567 per wheel action. Defaults to three.
4568 """
4569 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4570
4571 def IsPageScroll(*args, **kwargs):
4572 """
4573 IsPageScroll(self) -> bool
4574
4575 Returns true if the system has been setup to do page scrolling with
4576 the mouse wheel instead of line scrolling.
4577 """
4578 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4579
4580 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4581 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4582 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4583 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4584 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4585 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4586 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4587 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4588 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4589 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4590 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4591 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4592 _core_.MouseEvent_swigregister(MouseEvent)
4593
4594 #---------------------------------------------------------------------------
4595
4596 class SetCursorEvent(Event):
4597 """
4598 A SetCursorEvent is generated when the mouse cursor is about to be set
4599 as a result of mouse motion. This event gives the application the
4600 chance to perform specific mouse cursor processing based on the
4601 current position of the mouse within the window. Use the `SetCursor`
4602 method to specify the cursor you want to be displayed.
4603 """
4604 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4605 __repr__ = _swig_repr
4606 def __init__(self, *args, **kwargs):
4607 """
4608 __init__(self, int x=0, int y=0) -> SetCursorEvent
4609
4610 Construct a new `wx.SetCursorEvent`.
4611 """
4612 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4613 def GetX(*args, **kwargs):
4614 """
4615 GetX(self) -> int
4616
4617 Returns the X coordinate of the mouse in client coordinates.
4618 """
4619 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4620
4621 def GetY(*args, **kwargs):
4622 """
4623 GetY(self) -> int
4624
4625 Returns the Y coordinate of the mouse in client coordinates.
4626 """
4627 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4628
4629 def SetCursor(*args, **kwargs):
4630 """
4631 SetCursor(self, Cursor cursor)
4632
4633 Sets the cursor associated with this event.
4634 """
4635 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4636
4637 def GetCursor(*args, **kwargs):
4638 """
4639 GetCursor(self) -> Cursor
4640
4641 Returns a reference to the cursor specified by this event.
4642 """
4643 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4644
4645 def HasCursor(*args, **kwargs):
4646 """
4647 HasCursor(self) -> bool
4648
4649 Returns true if the cursor specified by this event is a valid cursor.
4650 """
4651 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4652
4653 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4654
4655 #---------------------------------------------------------------------------
4656
4657 class KeyEvent(Event):
4658 """
4659 This event class contains information about keypress and character
4660 events. These events are only sent to the widget that currently has
4661 the keyboard focus.
4662
4663 Notice that there are three different kinds of keyboard events in
4664 wxWidgets: key down and up events and char events. The difference
4665 between the first two is clear - the first corresponds to a key press
4666 and the second to a key release - otherwise they are identical. Just
4667 note that if the key is maintained in a pressed state you will
4668 typically get a lot of (automatically generated) down events but only
4669 one up so it is wrong to assume that there is one up event
4670 corresponding to each down one.
4671
4672 Both key events provide untranslated key codes while the char event
4673 carries the translated one. The untranslated code for alphanumeric
4674 keys is always an upper case value. For the other keys it is one of
4675 WXK_XXX values from the keycodes table. The translated key is, in
4676 general, the character the user expects to appear as the result of the
4677 key combination when typing the text into a text entry zone, for
4678 example.
4679
4680 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4681 and the standard US keyboard): when the 'A' key is pressed, the key
4682 down event key code is equal to ASCII A == 65. But the char event key
4683 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4684 'A' keys simultaneously , the key code in key down event will still be
4685 just 'A' while the char event key code parameter will now be 'A' as
4686 well.
4687
4688 Although in this simple case it is clear that the correct key code
4689 could be found in the key down event handler by checking the value
4690 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4691 as for non alphanumeric keys or non-US keyboard layouts the
4692 translation is keyboard-layout dependent and can only be done properly
4693 by the system itself.
4694
4695 Another kind of translation is done when the control key is pressed:
4696 for example, for CTRL-A key press the key down event still carries the
4697 same key code 'A' as usual but the char event will have key code of 1,
4698 the ASCII value of this key combination.
4699
4700 You may discover how the other keys on your system behave
4701 interactively by running the KeyEvents sample in the wxPython demo and
4702 pressing some keys while the blue box at the top has the keyboard
4703 focus.
4704
4705 **Note**: If a key down event is caught and the event handler does not
4706 call event.Skip() then the coresponding char event will not
4707 happen. This is by design and enables the programs that handle both
4708 types of events to be a bit simpler.
4709
4710 **Note for Windows programmers**: The key and char events in wxWidgets
4711 are similar to but slightly different from Windows WM_KEYDOWN and
4712 WM_CHAR events. In particular, Alt-x combination will generate a char
4713 event in wxWidgets (unless it is used as an accelerator).
4714
4715 **Tip**: be sure to call event.Skip() for events that you don't
4716 process in key event function, otherwise menu shortcuts may cease to
4717 work under Windows.
4718
4719 """
4720 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4721 __repr__ = _swig_repr
4722 def __init__(self, *args, **kwargs):
4723 """
4724 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4725
4726 Construct a new `wx.KeyEvent`. Valid event types are:
4727 *
4728 """
4729 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4730 def GetModifiers(*args, **kwargs):
4731 """
4732 GetModifiers(self) -> int
4733
4734 Returns a bitmask of the current modifier settings. Can be used to
4735 check if the key event has exactly the given modifiers without having
4736 to explicitly check that the other modifiers are not down. For
4737 example::
4738
4739 if event.GetModifers() == wx.MOD_CONTROL:
4740 DoSomething()
4741
4742 """
4743 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4744
4745 def ControlDown(*args, **kwargs):
4746 """
4747 ControlDown(self) -> bool
4748
4749 Returns ``True`` if the Control key was down at the time of the event.
4750 """
4751 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4752
4753 def MetaDown(*args, **kwargs):
4754 """
4755 MetaDown(self) -> bool
4756
4757 Returns ``True`` if the Meta key was down at the time of the event.
4758 """
4759 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4760
4761 def AltDown(*args, **kwargs):
4762 """
4763 AltDown(self) -> bool
4764
4765 Returns ``True`` if the Alt key was down at the time of the event.
4766 """
4767 return _core_.KeyEvent_AltDown(*args, **kwargs)
4768
4769 def ShiftDown(*args, **kwargs):
4770 """
4771 ShiftDown(self) -> bool
4772
4773 Returns ``True`` if the Shift key was down at the time of the event.
4774 """
4775 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4776
4777 def CmdDown(*args, **kwargs):
4778 """
4779 CmdDown(self) -> bool
4780
4781 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4782 platforms but the special "Apple" (a.k.a as "Command") key on
4783 Macs. It makes often sense to use it instead of, say, `ControlDown`
4784 because Cmd key is used for the same thing under Mac as Ctrl
4785 elsewhere. The Ctrl still exists, it's just not used for this
4786 purpose. So for non-Mac platforms this is the same as `ControlDown`
4787 and Macs this is the same as `MetaDown`.
4788 """
4789 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4790
4791 def HasModifiers(*args, **kwargs):
4792 """
4793 HasModifiers(self) -> bool
4794
4795 Returns true if either CTRL or ALT keys was down at the time of the
4796 key event. Note that this function does not take into account neither
4797 SHIFT nor META key states (the reason for ignoring the latter is that
4798 it is common for NUMLOCK key to be configured as META under X but the
4799 key presses even while NUMLOCK is on should be still processed
4800 normally).
4801 """
4802 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4803
4804 def GetKeyCode(*args, **kwargs):
4805 """
4806 GetKeyCode(self) -> int
4807
4808 Returns the virtual key code. ASCII events return normal ASCII values,
4809 while non-ASCII events return values such as WXK_LEFT for the left
4810 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4811 codes.
4812
4813 Note that in Unicode build, the returned value is meaningful only if
4814 the user entered a character that can be represented in current
4815 locale's default charset. You can obtain the corresponding Unicode
4816 character using `GetUnicodeKey`.
4817 """
4818 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4819
4820 KeyCode = GetKeyCode
4821 def GetUnicodeKey(*args, **kwargs):
4822 """
4823 GetUnicodeKey(self) -> int
4824
4825 Returns the Unicode character corresponding to this key event. This
4826 function is only meaningfule in a Unicode build of wxPython.
4827 """
4828 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4829
4830 GetUniChar = GetUnicodeKey
4831 def GetRawKeyCode(*args, **kwargs):
4832 """
4833 GetRawKeyCode(self) -> unsigned int
4834
4835 Returns the raw key code for this event. This is a platform-dependent
4836 scan code which should only be used in advanced
4837 applications. Currently the raw key codes are not supported by all
4838 ports.
4839 """
4840 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4841
4842 def GetRawKeyFlags(*args, **kwargs):
4843 """
4844 GetRawKeyFlags(self) -> unsigned int
4845
4846 Returns the low level key flags for this event. The flags are
4847 platform-dependent and should only be used in advanced applications.
4848 Currently the raw key flags are not supported by all ports.
4849 """
4850 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4851
4852 def GetPosition(*args, **kwargs):
4853 """
4854 GetPosition(self) -> Point
4855
4856 Find the position of the event, if applicable.
4857 """
4858 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4859
4860 def GetPositionTuple(*args, **kwargs):
4861 """
4862 GetPositionTuple() -> (x,y)
4863
4864 Find the position of the event, if applicable.
4865 """
4866 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4867
4868 def GetX(*args, **kwargs):
4869 """
4870 GetX(self) -> int
4871
4872 Returns the X position (in client coordinates) of the event, if
4873 applicable.
4874 """
4875 return _core_.KeyEvent_GetX(*args, **kwargs)
4876
4877 def GetY(*args, **kwargs):
4878 """
4879 GetY(self) -> int
4880
4881 Returns the Y position (in client coordinates) of the event, if
4882 applicable.
4883 """
4884 return _core_.KeyEvent_GetY(*args, **kwargs)
4885
4886 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4887 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4888 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4889 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4890 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4891 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4892 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4893 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4894 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4895 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4896 _core_.KeyEvent_swigregister(KeyEvent)
4897
4898 #---------------------------------------------------------------------------
4899
4900 class SizeEvent(Event):
4901 """
4902 A size event holds information about size change events. The EVT_SIZE
4903 handler function will be called when the window it is bound to has
4904 been resized.
4905
4906 Note that the size passed is of the whole window: call
4907 `wx.Window.GetClientSize` for the area which may be used by the
4908 application.
4909
4910 When a window is resized, usually only a small part of the window is
4911 damaged and and that area is all that is in the update region for the
4912 next paint event. However, if your drawing depends on the size of the
4913 window, you may need to clear the DC explicitly and repaint the whole
4914 window. In which case, you may need to call `wx.Window.Refresh` to
4915 invalidate the entire window.
4916
4917 """
4918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4919 __repr__ = _swig_repr
4920 def __init__(self, *args, **kwargs):
4921 """
4922 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4923
4924 Construct a new ``wx.SizeEvent``.
4925 """
4926 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4927 def GetSize(*args, **kwargs):
4928 """
4929 GetSize(self) -> Size
4930
4931 Returns the entire size of the window generating the size change
4932 event.
4933 """
4934 return _core_.SizeEvent_GetSize(*args, **kwargs)
4935
4936 def GetRect(*args, **kwargs):
4937 """GetRect(self) -> Rect"""
4938 return _core_.SizeEvent_GetRect(*args, **kwargs)
4939
4940 def SetRect(*args, **kwargs):
4941 """SetRect(self, Rect rect)"""
4942 return _core_.SizeEvent_SetRect(*args, **kwargs)
4943
4944 def SetSize(*args, **kwargs):
4945 """SetSize(self, Size size)"""
4946 return _core_.SizeEvent_SetSize(*args, **kwargs)
4947
4948 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4949 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4950 _core_.SizeEvent_swigregister(SizeEvent)
4951
4952 #---------------------------------------------------------------------------
4953
4954 class MoveEvent(Event):
4955 """
4956 This event object is sent for EVT_MOVE event bindings when a window is
4957 moved to a new position.
4958 """
4959 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4960 __repr__ = _swig_repr
4961 def __init__(self, *args, **kwargs):
4962 """
4963 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4964
4965 Constructor.
4966 """
4967 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
4968 def GetPosition(*args, **kwargs):
4969 """
4970 GetPosition(self) -> Point
4971
4972 Returns the position of the window generating the move change event.
4973 """
4974 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4975
4976 def GetRect(*args, **kwargs):
4977 """GetRect(self) -> Rect"""
4978 return _core_.MoveEvent_GetRect(*args, **kwargs)
4979
4980 def SetRect(*args, **kwargs):
4981 """SetRect(self, Rect rect)"""
4982 return _core_.MoveEvent_SetRect(*args, **kwargs)
4983
4984 def SetPosition(*args, **kwargs):
4985 """SetPosition(self, Point pos)"""
4986 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4987
4988 m_pos = property(GetPosition, SetPosition)
4989 m_rect = property(GetRect, SetRect)
4990
4991 _core_.MoveEvent_swigregister(MoveEvent)
4992
4993 #---------------------------------------------------------------------------
4994
4995 class PaintEvent(Event):
4996 """
4997 A paint event is sent when a window's contents needs to be repainted.
4998 Note that in an EVT_PAINT handler the application must *always* create
4999 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5000 Windows assumes that the window has not been painted yet and will send
5001 the event again, causing endless refreshes.
5002
5003 You can optimize painting by retrieving the rectangles that have been
5004 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5005 and only repainting these rectangles. The rectangles are in terms of
5006 the client area, and are unscrolled, so you will need to do some
5007 calculations using the current view position to obtain logical,
5008 scrolled units.
5009
5010 """
5011 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5012 __repr__ = _swig_repr
5013 def __init__(self, *args, **kwargs):
5014 """__init__(self, int Id=0) -> PaintEvent"""
5015 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5016 _core_.PaintEvent_swigregister(PaintEvent)
5017
5018 class NcPaintEvent(Event):
5019 """Proxy of C++ NcPaintEvent class"""
5020 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5021 __repr__ = _swig_repr
5022 def __init__(self, *args, **kwargs):
5023 """__init__(self, int winid=0) -> NcPaintEvent"""
5024 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5025 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5026
5027 #---------------------------------------------------------------------------
5028
5029 class EraseEvent(Event):
5030 """
5031 An erase event is sent whenever the background of a window needs to be
5032 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5033 binder. On some platforms, such as GTK+, this event is simulated
5034 (simply generated just before the paint event) and may cause flicker.
5035
5036 To paint a custom background use the `GetDC` method and use the returned
5037 device context if it is not ``None``, otherwise create a temporary
5038 `wx.ClientDC` and draw on that.
5039
5040 """
5041 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5042 __repr__ = _swig_repr
5043 def __init__(self, *args, **kwargs):
5044 """
5045 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5046
5047 Constructor
5048 """
5049 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5050 def GetDC(*args, **kwargs):
5051 """
5052 GetDC(self) -> DC
5053
5054 Returns the device context the event handler should draw upon. If
5055 ``None`` is returned then create a temporary `wx.ClientDC` and use
5056 that instead.
5057 """
5058 return _core_.EraseEvent_GetDC(*args, **kwargs)
5059
5060 _core_.EraseEvent_swigregister(EraseEvent)
5061
5062 #---------------------------------------------------------------------------
5063
5064 class FocusEvent(Event):
5065 """
5066 A focus event is sent when a window's focus changes. The window losing
5067 focus receives an EVT_KILL_FOCUS event while the window gaining it
5068 gets an EVT_SET_FOCUS event.
5069
5070 Notice that the set focus event happens both when the user gives focus
5071 to the window (whether using the mouse or keyboard) and when it is
5072 done from the program itself using `wx.Window.SetFocus`.
5073
5074 """
5075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5076 __repr__ = _swig_repr
5077 def __init__(self, *args, **kwargs):
5078 """
5079 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5080
5081 Constructor
5082 """
5083 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5084 def GetWindow(*args, **kwargs):
5085 """
5086 GetWindow(self) -> Window
5087
5088 Returns the other window associated with this event, that is the
5089 window which had the focus before for the EVT_SET_FOCUS event and the
5090 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5091
5092 Warning: the window returned may be None!
5093 """
5094 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5095
5096 def SetWindow(*args, **kwargs):
5097 """SetWindow(self, Window win)"""
5098 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5099
5100 _core_.FocusEvent_swigregister(FocusEvent)
5101
5102 #---------------------------------------------------------------------------
5103
5104 class ChildFocusEvent(CommandEvent):
5105 """
5106 wx.ChildFocusEvent notifies the parent that a child has received the
5107 focus. Unlike `wx.FocusEvent` it is propagated up the window
5108 heirarchy.
5109 """
5110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5111 __repr__ = _swig_repr
5112 def __init__(self, *args, **kwargs):
5113 """
5114 __init__(self, Window win=None) -> ChildFocusEvent
5115
5116 Constructor
5117 """
5118 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5119 def GetWindow(*args, **kwargs):
5120 """
5121 GetWindow(self) -> Window
5122
5123 The window which has just received the focus.
5124 """
5125 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5126
5127 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5128
5129 #---------------------------------------------------------------------------
5130
5131 class ActivateEvent(Event):
5132 """
5133 An activate event is sent when a top-level window or the entire
5134 application is being activated or deactivated.
5135
5136 A top-level window (a dialog or frame) receives an activate event when
5137 is being activated or deactivated. This is indicated visually by the
5138 title bar changing colour, and a subwindow gaining the keyboard focus.
5139 An application is activated or deactivated when one of its frames
5140 becomes activated, or a frame becomes inactivate resulting in all
5141 application frames being inactive.
5142
5143 Please note that usually you should call event.Skip() in your handlers
5144 for these events so the default handlers will still be called, as not
5145 doing so can result in strange effects.
5146
5147 """
5148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5149 __repr__ = _swig_repr
5150 def __init__(self, *args, **kwargs):
5151 """
5152 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5153
5154 Constructor
5155 """
5156 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5157 def GetActive(*args, **kwargs):
5158 """
5159 GetActive(self) -> bool
5160
5161 Returns true if the application or window is being activated, false
5162 otherwise.
5163 """
5164 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5165
5166 _core_.ActivateEvent_swigregister(ActivateEvent)
5167
5168 #---------------------------------------------------------------------------
5169
5170 class InitDialogEvent(Event):
5171 """
5172 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5173 any window when `wx.Window.InitDialog` is called. Handlers for this
5174 event can transfer data to the window, or anything else that should be
5175 done before the user begins editing the form. The default handler
5176 calls `wx.Window.TransferDataToWindow`.
5177 """
5178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5179 __repr__ = _swig_repr
5180 def __init__(self, *args, **kwargs):
5181 """
5182 __init__(self, int Id=0) -> InitDialogEvent
5183
5184 Constructor
5185 """
5186 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5187 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5188
5189 #---------------------------------------------------------------------------
5190
5191 class MenuEvent(Event):
5192 """
5193 This class is used for a variety of menu-related events. Note that
5194 these do not include menu command events, which are handled by sending
5195 `wx.CommandEvent` objects.
5196
5197 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5198 text in the first field of the status bar.
5199 """
5200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5201 __repr__ = _swig_repr
5202 def __init__(self, *args, **kwargs):
5203 """
5204 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5205
5206 Constructor
5207 """
5208 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5209 def GetMenuId(*args, **kwargs):
5210 """
5211 GetMenuId(self) -> int
5212
5213 Returns the menu identifier associated with the event. This method
5214 should be only used with the HIGHLIGHT events.
5215 """
5216 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5217
5218 def IsPopup(*args, **kwargs):
5219 """
5220 IsPopup(self) -> bool
5221
5222 Returns ``True`` if the menu which is being opened or closed is a
5223 popup menu, ``False`` if it is a normal one. This method should only
5224 be used with the OPEN and CLOSE events.
5225 """
5226 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5227
5228 def GetMenu(*args, **kwargs):
5229 """
5230 GetMenu(self) -> Menu
5231
5232 Returns the menu which is being opened or closed. This method should
5233 only be used with the OPEN and CLOSE events.
5234 """
5235 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5236
5237 _core_.MenuEvent_swigregister(MenuEvent)
5238
5239 #---------------------------------------------------------------------------
5240
5241 class CloseEvent(Event):
5242 """
5243 This event class contains information about window and session close
5244 events.
5245
5246 The handler function for EVT_CLOSE is called when the user has tried
5247 to close a a frame or dialog box using the window manager controls or
5248 the system menu. It can also be invoked by the application itself
5249 programmatically, for example by calling the `wx.Window.Close`
5250 function.
5251
5252 You should check whether the application is forcing the deletion of
5253 the window using `CanVeto`. If it returns ``False``, you must destroy
5254 the window using `wx.Window.Destroy`. If the return value is ``True``,
5255 it is up to you whether you respond by destroying the window or not.
5256 For example you may wish to display a message dialog prompting to save
5257 files or to cancel the close.
5258
5259 If you don't destroy the window, you should call `Veto` to let the
5260 calling code know that you did not destroy the window. This allows the
5261 `wx.Window.Close` function to return ``True`` or ``False`` depending
5262 on whether the close instruction was honored or not.
5263 """
5264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5265 __repr__ = _swig_repr
5266 def __init__(self, *args, **kwargs):
5267 """
5268 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5269
5270 Constructor.
5271 """
5272 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5273 def SetLoggingOff(*args, **kwargs):
5274 """
5275 SetLoggingOff(self, bool logOff)
5276
5277 Sets the 'logging off' flag.
5278 """
5279 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5280
5281 def GetLoggingOff(*args, **kwargs):
5282 """
5283 GetLoggingOff(self) -> bool
5284
5285 Returns ``True`` if the user is logging off or ``False`` if the
5286 system is shutting down. This method can only be called for end
5287 session and query end session events, it doesn't make sense for close
5288 window event.
5289 """
5290 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5291
5292 def Veto(*args, **kwargs):
5293 """
5294 Veto(self, bool veto=True)
5295
5296 Call this from your event handler to veto a system shutdown or to
5297 signal to the calling application that a window close did not happen.
5298
5299 You can only veto a shutdown or close if `CanVeto` returns true.
5300 """
5301 return _core_.CloseEvent_Veto(*args, **kwargs)
5302
5303 def GetVeto(*args, **kwargs):
5304 """GetVeto(self) -> bool"""
5305 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5306
5307 def SetCanVeto(*args, **kwargs):
5308 """
5309 SetCanVeto(self, bool canVeto)
5310
5311 Sets the 'can veto' flag.
5312 """
5313 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5314
5315 def CanVeto(*args, **kwargs):
5316 """
5317 CanVeto(self) -> bool
5318
5319 Returns true if you can veto a system shutdown or a window close
5320 event. Vetoing a window close event is not possible if the calling
5321 code wishes to force the application to exit, and so this function
5322 must be called to check this.
5323 """
5324 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5325
5326 _core_.CloseEvent_swigregister(CloseEvent)
5327
5328 #---------------------------------------------------------------------------
5329
5330 class ShowEvent(Event):
5331 """An EVT_SHOW event is sent when a window is shown or hidden."""
5332 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5333 __repr__ = _swig_repr
5334 def __init__(self, *args, **kwargs):
5335 """
5336 __init__(self, int winid=0, bool show=False) -> ShowEvent
5337
5338 An EVT_SHOW event is sent when a window is shown or hidden.
5339 """
5340 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5341 def SetShow(*args, **kwargs):
5342 """SetShow(self, bool show)"""
5343 return _core_.ShowEvent_SetShow(*args, **kwargs)
5344
5345 def GetShow(*args, **kwargs):
5346 """GetShow(self) -> bool"""
5347 return _core_.ShowEvent_GetShow(*args, **kwargs)
5348
5349 _core_.ShowEvent_swigregister(ShowEvent)
5350
5351 #---------------------------------------------------------------------------
5352
5353 class IconizeEvent(Event):
5354 """
5355 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5356 restored.
5357 """
5358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5359 __repr__ = _swig_repr
5360 def __init__(self, *args, **kwargs):
5361 """
5362 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5363
5364 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5365 restored.
5366 """
5367 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5368 def Iconized(*args, **kwargs):
5369 """
5370 Iconized(self) -> bool
5371
5372 Returns ``True`` if the frame has been iconized, ``False`` if it has
5373 been restored.
5374 """
5375 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5376
5377 _core_.IconizeEvent_swigregister(IconizeEvent)
5378
5379 #---------------------------------------------------------------------------
5380
5381 class MaximizeEvent(Event):
5382 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5383 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5384 __repr__ = _swig_repr
5385 def __init__(self, *args, **kwargs):
5386 """
5387 __init__(self, int id=0) -> MaximizeEvent
5388
5389 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5390 """
5391 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5392 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5393
5394 #---------------------------------------------------------------------------
5395
5396 class DropFilesEvent(Event):
5397 """
5398 This class is used for drop files events, that is, when files have
5399 been dropped onto the window. This functionality is only available
5400 under Windows. The window must have previously been enabled for
5401 dropping by calling `wx.Window.DragAcceptFiles`.
5402
5403 Important note: this is a separate implementation to the more general
5404 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5405 implementation uses the older, Windows message-based approach of
5406 dropping files.
5407
5408 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5409 events.
5410
5411 """
5412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5413 def __init__(self): raise AttributeError, "No constructor defined"
5414 __repr__ = _swig_repr
5415 def GetPosition(*args, **kwargs):
5416 """
5417 GetPosition(self) -> Point
5418
5419 Returns the position at which the files were dropped.
5420 """
5421 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5422
5423 def GetNumberOfFiles(*args, **kwargs):
5424 """
5425 GetNumberOfFiles(self) -> int
5426
5427 Returns the number of files dropped.
5428 """
5429 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5430
5431 def GetFiles(*args, **kwargs):
5432 """
5433 GetFiles(self) -> PyObject
5434
5435 Returns a list of the filenames that were dropped.
5436 """
5437 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5438
5439 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5440
5441 #---------------------------------------------------------------------------
5442
5443 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5444 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5445 class UpdateUIEvent(CommandEvent):
5446 """
5447 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5448 wxWidgets to give an application the chance to update various user
5449 interface elements.
5450
5451 Without update UI events, an application has to work hard to
5452 check/uncheck, enable/disable, and set the text for elements such as
5453 menu items and toolbar buttons. The code for doing this has to be
5454 mixed up with the code that is invoked when an action is invoked for a
5455 menu item or button.
5456
5457 With update UI events, you define an event handler to look at the
5458 state of the application and change UI elements accordingly. wxWidgets
5459 will call your handler functions in idle time, so you don't have to
5460 worry where to call this code. In addition to being a clearer and more
5461 declarative method, it also means you don't have to worry whether
5462 you're updating a toolbar or menubar identifier. The same handler can
5463 update a menu item and toolbar button, if the ID values are the same.
5464
5465 Instead of directly manipulating the menu or button, you call
5466 functions in the event object, such as `Check`. wxWidgets will
5467 determine whether such a call has been made, and which UI element to
5468 update.
5469
5470 These events will work for popup menus as well as menubars. Just
5471 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5472 any UI events for the window that owns the menu.
5473
5474 If you find that the overhead of UI update processing is affecting
5475 your application, you can do one or both of the following:
5476
5477 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5478 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5479 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5480 receive update events. No other windows will receive update
5481 events.
5482
5483 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5484 value to set the delay between updates. You may need to call
5485 `wx.Window.UpdateWindowUI` at critical points, for example when
5486 a dialog is about to be shown, in case the user sees a slight
5487 delay before windows are updated.
5488
5489 Note that although events are sent in idle time, defining a EVT_IDLE
5490 handler for a window does not affect this because the events are sent
5491 from an internal idle handler.
5492
5493 wxWidgets tries to optimize update events on some platforms. On
5494 Windows and GTK+, events for menubar items are only sent when the menu
5495 is about to be shown, and not in idle time.
5496
5497 """
5498 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5499 __repr__ = _swig_repr
5500 def __init__(self, *args, **kwargs):
5501 """
5502 __init__(self, int commandId=0) -> UpdateUIEvent
5503
5504 Constructor
5505 """
5506 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5507 def GetChecked(*args, **kwargs):
5508 """
5509 GetChecked(self) -> bool
5510
5511 Returns ``True`` if the UI element should be checked.
5512 """
5513 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5514
5515 def GetEnabled(*args, **kwargs):
5516 """
5517 GetEnabled(self) -> bool
5518
5519 Returns ``True`` if the UI element should be enabled.
5520 """
5521 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5522
5523 def GetShown(*args, **kwargs):
5524 """
5525 GetShown(self) -> bool
5526
5527 Returns ``True`` if the UI element should be shown.
5528 """
5529 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5530
5531 def GetText(*args, **kwargs):
5532 """
5533 GetText(self) -> String
5534
5535 Returns the text that should be set for the UI element.
5536 """
5537 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5538
5539 def GetSetText(*args, **kwargs):
5540 """
5541 GetSetText(self) -> bool
5542
5543 Returns ``True`` if the application has called `SetText`. For
5544 wxWidgets internal use only.
5545 """
5546 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5547
5548 def GetSetChecked(*args, **kwargs):
5549 """
5550 GetSetChecked(self) -> bool
5551
5552 Returns ``True`` if the application has called `Check`. For wxWidgets
5553 internal use only.
5554 """
5555 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5556
5557 def GetSetEnabled(*args, **kwargs):
5558 """
5559 GetSetEnabled(self) -> bool
5560
5561 Returns ``True`` if the application has called `Enable`. For wxWidgets
5562 internal use only.
5563 """
5564 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5565
5566 def GetSetShown(*args, **kwargs):
5567 """
5568 GetSetShown(self) -> bool
5569
5570 Returns ``True`` if the application has called `Show`. For wxWidgets
5571 internal use only.
5572 """
5573 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5574
5575 def Check(*args, **kwargs):
5576 """
5577 Check(self, bool check)
5578
5579 Check or uncheck the UI element.
5580 """
5581 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5582
5583 def Enable(*args, **kwargs):
5584 """
5585 Enable(self, bool enable)
5586
5587 Enable or disable the UI element.
5588 """
5589 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5590
5591 def Show(*args, **kwargs):
5592 """
5593 Show(self, bool show)
5594
5595 Show or hide the UI element.
5596 """
5597 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5598
5599 def SetText(*args, **kwargs):
5600 """
5601 SetText(self, String text)
5602
5603 Sets the text for this UI element.
5604 """
5605 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5606
5607 def SetUpdateInterval(*args, **kwargs):
5608 """
5609 SetUpdateInterval(long updateInterval)
5610
5611 Sets the interval between updates in milliseconds. Set to -1 to
5612 disable updates, or to 0 to update as frequently as possible. The
5613 default is 0.
5614
5615 Use this to reduce the overhead of UI update events if your
5616 application has a lot of windows. If you set the value to -1 or
5617 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5618 at appropriate points in your application, such as when a dialog is
5619 about to be shown.
5620 """
5621 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5622
5623 SetUpdateInterval = staticmethod(SetUpdateInterval)
5624 def GetUpdateInterval(*args, **kwargs):
5625 """
5626 GetUpdateInterval() -> long
5627
5628 Returns the current interval between updates in milliseconds. -1
5629 disables updates, 0 updates as frequently as possible.
5630 """
5631 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5632
5633 GetUpdateInterval = staticmethod(GetUpdateInterval)
5634 def CanUpdate(*args, **kwargs):
5635 """
5636 CanUpdate(Window win) -> bool
5637
5638 Returns ``True`` if it is appropriate to update (send UI update events
5639 to) this window.
5640
5641 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5642 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5643 events were last sent in idle time, and the update interval, to
5644 determine whether events should be sent to this window now. By default
5645 this will always return true because the update mode is initially
5646 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5647 events will be sent as often as possible. You can reduce the frequency
5648 that events are sent by changing the mode and/or setting an update
5649 interval.
5650
5651 """
5652 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5653
5654 CanUpdate = staticmethod(CanUpdate)
5655 def ResetUpdateTime(*args, **kwargs):
5656 """
5657 ResetUpdateTime()
5658
5659 Used internally to reset the last-updated time to the current time. It
5660 is assumed that update events are normally sent in idle time, so this
5661 is called at the end of idle processing.
5662 """
5663 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5664
5665 ResetUpdateTime = staticmethod(ResetUpdateTime)
5666 def SetMode(*args, **kwargs):
5667 """
5668 SetMode(int mode)
5669
5670 Specify how wxWidgets will send update events: to all windows, or only
5671 to those which specify that they will process the events.
5672
5673 The mode may be one of the following values:
5674
5675 ============================= ==========================================
5676 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5677 is the default setting.
5678 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5679 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5680 style set.
5681 ============================= ==========================================
5682
5683 """
5684 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5685
5686 SetMode = staticmethod(SetMode)
5687 def GetMode(*args, **kwargs):
5688 """
5689 GetMode() -> int
5690
5691 Returns a value specifying how wxWidgets will send update events: to
5692 all windows, or only to those which specify that they will process the
5693 events.
5694 """
5695 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5696
5697 GetMode = staticmethod(GetMode)
5698 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5699
5700 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5701 """
5702 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5703
5704 Sets the interval between updates in milliseconds. Set to -1 to
5705 disable updates, or to 0 to update as frequently as possible. The
5706 default is 0.
5707
5708 Use this to reduce the overhead of UI update events if your
5709 application has a lot of windows. If you set the value to -1 or
5710 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5711 at appropriate points in your application, such as when a dialog is
5712 about to be shown.
5713 """
5714 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5715
5716 def UpdateUIEvent_GetUpdateInterval(*args):
5717 """
5718 UpdateUIEvent_GetUpdateInterval() -> long
5719
5720 Returns the current interval between updates in milliseconds. -1
5721 disables updates, 0 updates as frequently as possible.
5722 """
5723 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5724
5725 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5726 """
5727 UpdateUIEvent_CanUpdate(Window win) -> bool
5728
5729 Returns ``True`` if it is appropriate to update (send UI update events
5730 to) this window.
5731
5732 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5733 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5734 events were last sent in idle time, and the update interval, to
5735 determine whether events should be sent to this window now. By default
5736 this will always return true because the update mode is initially
5737 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5738 events will be sent as often as possible. You can reduce the frequency
5739 that events are sent by changing the mode and/or setting an update
5740 interval.
5741
5742 """
5743 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5744
5745 def UpdateUIEvent_ResetUpdateTime(*args):
5746 """
5747 UpdateUIEvent_ResetUpdateTime()
5748
5749 Used internally to reset the last-updated time to the current time. It
5750 is assumed that update events are normally sent in idle time, so this
5751 is called at the end of idle processing.
5752 """
5753 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5754
5755 def UpdateUIEvent_SetMode(*args, **kwargs):
5756 """
5757 UpdateUIEvent_SetMode(int mode)
5758
5759 Specify how wxWidgets will send update events: to all windows, or only
5760 to those which specify that they will process the events.
5761
5762 The mode may be one of the following values:
5763
5764 ============================= ==========================================
5765 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5766 is the default setting.
5767 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5768 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5769 style set.
5770 ============================= ==========================================
5771
5772 """
5773 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5774
5775 def UpdateUIEvent_GetMode(*args):
5776 """
5777 UpdateUIEvent_GetMode() -> int
5778
5779 Returns a value specifying how wxWidgets will send update events: to
5780 all windows, or only to those which specify that they will process the
5781 events.
5782 """
5783 return _core_.UpdateUIEvent_GetMode(*args)
5784
5785 #---------------------------------------------------------------------------
5786
5787 class SysColourChangedEvent(Event):
5788 """
5789 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5790 when the user changes the colour settings using the control
5791 panel. This is only applicable under Windows.
5792
5793 The default event handler for this event propagates the event to child
5794 windows, since Windows only sends the events to top-level windows. If
5795 intercepting this event for a top-level window, remember to call
5796 `Skip` so the the base class handler will still be executed, or to
5797 pass the event on to the window's children explicitly.
5798
5799 """
5800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5801 __repr__ = _swig_repr
5802 def __init__(self, *args, **kwargs):
5803 """
5804 __init__(self) -> SysColourChangedEvent
5805
5806 Constructor
5807 """
5808 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5809 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5810
5811 #---------------------------------------------------------------------------
5812
5813 class MouseCaptureChangedEvent(Event):
5814 """
5815 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5816 a window that loses its mouse capture. This is called even if
5817 `wx.Window.ReleaseMouse` was called by the application code. Handling
5818 this event allows an application to cater for unexpected capture
5819 releases which might otherwise confuse mouse handling code.
5820
5821 This event is implemented under Windows only.
5822 """
5823 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5824 __repr__ = _swig_repr
5825 def __init__(self, *args, **kwargs):
5826 """
5827 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5828
5829 Constructor
5830 """
5831 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5832 def GetCapturedWindow(*args, **kwargs):
5833 """
5834 GetCapturedWindow(self) -> Window
5835
5836 Returns the window that gained the capture, or ``None`` if it was a
5837 non-wxWidgets window.
5838 """
5839 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5840
5841 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5842
5843 #---------------------------------------------------------------------------
5844
5845 class DisplayChangedEvent(Event):
5846 """
5847 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5848 resolution has changed.
5849
5850 This event is implemented under Windows only.
5851 """
5852 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5853 __repr__ = _swig_repr
5854 def __init__(self, *args, **kwargs):
5855 """__init__(self) -> DisplayChangedEvent"""
5856 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5857 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
5858
5859 #---------------------------------------------------------------------------
5860
5861 class PaletteChangedEvent(Event):
5862 """
5863 An EVT_PALETTE_CHANGED event is sent when the system palette has
5864 changed, thereby giving each window a chance to redo their own to
5865 match.
5866
5867 This event is implemented under Windows only.
5868 """
5869 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5870 __repr__ = _swig_repr
5871 def __init__(self, *args, **kwargs):
5872 """
5873 __init__(self, int id=0) -> PaletteChangedEvent
5874
5875 An EVT_PALETTE_CHANGED event is sent when the system palette has
5876 changed, thereby giving each window a chance to redo their own to
5877 match.
5878
5879 This event is implemented under Windows only.
5880 """
5881 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5882 def SetChangedWindow(*args, **kwargs):
5883 """SetChangedWindow(self, Window win)"""
5884 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5885
5886 def GetChangedWindow(*args, **kwargs):
5887 """GetChangedWindow(self) -> Window"""
5888 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5889
5890 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
5891
5892 #---------------------------------------------------------------------------
5893
5894 class QueryNewPaletteEvent(Event):
5895 """
5896 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5897 focus and should re-do its palette.
5898
5899 This event is implemented under Windows only.
5900 """
5901 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5902 __repr__ = _swig_repr
5903 def __init__(self, *args, **kwargs):
5904 """
5905 __init__(self, int winid=0) -> QueryNewPaletteEvent
5906
5907 Constructor.
5908 """
5909 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
5910 def SetPaletteRealized(*args, **kwargs):
5911 """
5912 SetPaletteRealized(self, bool realized)
5913
5914 App should set this if it changes the palette.
5915 """
5916 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5917
5918 def GetPaletteRealized(*args, **kwargs):
5919 """GetPaletteRealized(self) -> bool"""
5920 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5921
5922 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
5923
5924 #---------------------------------------------------------------------------
5925
5926 class NavigationKeyEvent(Event):
5927 """
5928 EVT_NAVIGATION_KEY events are used to control moving the focus between
5929 widgets, otherwise known as tab-traversal. You woudl normally not
5930 catch navigation events in applications as there are already
5931 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5932 it useful to send navigation events in certain situations to change
5933 the focus in certain ways, although it's probably easier to just call
5934 `wx.Window.Navigate`.
5935 """
5936 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5937 __repr__ = _swig_repr
5938 def __init__(self, *args, **kwargs):
5939 """__init__(self) -> NavigationKeyEvent"""
5940 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
5941 def GetDirection(*args, **kwargs):
5942 """
5943 GetDirection(self) -> bool
5944
5945 Returns ``True`` if the direction is forward, ``False`` otherwise.
5946 """
5947 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5948
5949 def SetDirection(*args, **kwargs):
5950 """
5951 SetDirection(self, bool forward)
5952
5953 Specify the direction that the navigation should take. Usually the
5954 difference between using Tab and Shift-Tab.
5955 """
5956 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5957
5958 def IsWindowChange(*args, **kwargs):
5959 """
5960 IsWindowChange(self) -> bool
5961
5962 Returns ``True`` if window change is allowed.
5963 """
5964 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5965
5966 def SetWindowChange(*args, **kwargs):
5967 """
5968 SetWindowChange(self, bool ischange)
5969
5970 Specify if the navigation should be able to change parent windows.
5971 For example, changing notebook pages, etc. This is usually implemented
5972 by using Control-Tab.
5973 """
5974 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5975
5976 def IsFromTab(*args, **kwargs):
5977 """
5978 IsFromTab(self) -> bool
5979
5980 Returns ``True`` if the navigation event is originated from the Tab
5981 key.
5982 """
5983 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5984
5985 def SetFromTab(*args, **kwargs):
5986 """
5987 SetFromTab(self, bool bIs)
5988
5989 Set to true under MSW if the event was generated using the tab key.
5990 This is required for proper navogation over radio buttons.
5991 """
5992 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5993
5994 def SetFlags(*args, **kwargs):
5995 """
5996 SetFlags(self, long flags)
5997
5998 Set the navigation flags to a combination of the following:
5999
6000 * wx.NavigationKeyEvent.IsBackward
6001 * wx.NavigationKeyEvent.IsForward
6002 * wx.NavigationKeyEvent.WinChange
6003 * wx.NavigationKeyEvent.FromTab
6004
6005 """
6006 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6007
6008 def GetCurrentFocus(*args, **kwargs):
6009 """
6010 GetCurrentFocus(self) -> Window
6011
6012 Returns the child window which currenty has the focus. May be
6013 ``None``.
6014 """
6015 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6016
6017 def SetCurrentFocus(*args, **kwargs):
6018 """
6019 SetCurrentFocus(self, Window win)
6020
6021 Set the window that has the focus.
6022 """
6023 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6024
6025 IsBackward = _core_.NavigationKeyEvent_IsBackward
6026 IsForward = _core_.NavigationKeyEvent_IsForward
6027 WinChange = _core_.NavigationKeyEvent_WinChange
6028 FromTab = _core_.NavigationKeyEvent_FromTab
6029 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6030
6031 #---------------------------------------------------------------------------
6032
6033 class WindowCreateEvent(CommandEvent):
6034 """
6035 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6036 underlying GUI object) exists.
6037 """
6038 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6039 __repr__ = _swig_repr
6040 def __init__(self, *args, **kwargs):
6041 """
6042 __init__(self, Window win=None) -> WindowCreateEvent
6043
6044 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6045 underlying GUI object) exists.
6046 """
6047 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6048 def GetWindow(*args, **kwargs):
6049 """
6050 GetWindow(self) -> Window
6051
6052 Returns the window that this event refers to.
6053 """
6054 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6055
6056 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6057
6058 class WindowDestroyEvent(CommandEvent):
6059 """
6060 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6061 when the GUI window is destroyed.
6062
6063 When a class derived from `wx.Window` is destroyed its destructor will
6064 have already run by the time this event is sent. Therefore this event
6065 will not usually be received at all by the window itself. Since it is
6066 received after the destructor has run, an object should not try to
6067 handle its own wx.WindowDestroyEvent, but it can be used to get
6068 notification of the destruction of another window.
6069 """
6070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6071 __repr__ = _swig_repr
6072 def __init__(self, *args, **kwargs):
6073 """
6074 __init__(self, Window win=None) -> WindowDestroyEvent
6075
6076 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6077 when the GUI window is destroyed.
6078
6079 When a class derived from `wx.Window` is destroyed its destructor will
6080 have already run by the time this event is sent. Therefore this event
6081 will not usually be received at all by the window itself. Since it is
6082 received after the destructor has run, an object should not try to
6083 handle its own wx.WindowDestroyEvent, but it can be used to get
6084 notification of the destruction of another window.
6085 """
6086 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6087 def GetWindow(*args, **kwargs):
6088 """
6089 GetWindow(self) -> Window
6090
6091 Returns the window that this event refers to.
6092 """
6093 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6094
6095 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6096
6097 #---------------------------------------------------------------------------
6098
6099 class ContextMenuEvent(CommandEvent):
6100 """
6101 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6102 give the application a chance to show a context (popup) menu.
6103 """
6104 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6105 __repr__ = _swig_repr
6106 def __init__(self, *args, **kwargs):
6107 """
6108 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6109
6110 Constructor.
6111 """
6112 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6113 def GetPosition(*args, **kwargs):
6114 """
6115 GetPosition(self) -> Point
6116
6117 Returns the position (in screen coordinants) at which the menu should
6118 be shown.
6119 """
6120 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6121
6122 def SetPosition(*args, **kwargs):
6123 """
6124 SetPosition(self, Point pos)
6125
6126 Sets the position at which the menu should be shown.
6127 """
6128 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6129
6130 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6131
6132 #---------------------------------------------------------------------------
6133
6134 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6135 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6136 class IdleEvent(Event):
6137 """
6138 This class is used for EVT_IDLE events, which are generated and sent
6139 when the application *becomes* idle. In other words, the when the
6140 event queue becomes empty then idle events are sent to all windows (by
6141 default) and as long as none of them call `RequestMore` then there are
6142 no more idle events until after the system event queue has some normal
6143 events and then becomes empty again.
6144
6145 By default, idle events are sent to all windows. If this is causing a
6146 significant overhead in your application, you can call
6147 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6148 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6149 which should receive idle events. Then idle events will only be sent
6150 to those windows and not to any others.
6151 """
6152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6153 __repr__ = _swig_repr
6154 def __init__(self, *args, **kwargs):
6155 """
6156 __init__(self) -> IdleEvent
6157
6158 Constructor
6159 """
6160 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6161 def RequestMore(*args, **kwargs):
6162 """
6163 RequestMore(self, bool needMore=True)
6164
6165 Tells wxWidgets that more processing is required. This function can be
6166 called by an EVT_IDLE handler for a window to indicate that the
6167 application should forward the EVT_IDLE event once more to the
6168 application windows. If no window calls this function during its
6169 EVT_IDLE handler, then the application will remain in a passive event
6170 loop until a new event is posted to the application by the windowing
6171 system.
6172 """
6173 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6174
6175 def MoreRequested(*args, **kwargs):
6176 """
6177 MoreRequested(self) -> bool
6178
6179 Returns ``True`` if the OnIdle function processing this event
6180 requested more processing time.
6181 """
6182 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6183
6184 def SetMode(*args, **kwargs):
6185 """
6186 SetMode(int mode)
6187
6188 Static method for specifying how wxWidgets will send idle events: to
6189 all windows, or only to those which specify that they will process the
6190 events.
6191
6192 The mode can be one of the following values:
6193
6194 ========================= ========================================
6195 wx.IDLE_PROCESS_ALL Send idle events to all windows
6196 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6197 the wx.WS_EX_PROCESS_IDLE extra style
6198 flag set.
6199 ========================= ========================================
6200
6201 """
6202 return _core_.IdleEvent_SetMode(*args, **kwargs)
6203
6204 SetMode = staticmethod(SetMode)
6205 def GetMode(*args, **kwargs):
6206 """
6207 GetMode() -> int
6208
6209 Static method returning a value specifying how wxWidgets will send
6210 idle events: to all windows, or only to those which specify that they
6211 will process the events.
6212 """
6213 return _core_.IdleEvent_GetMode(*args, **kwargs)
6214
6215 GetMode = staticmethod(GetMode)
6216 def CanSend(*args, **kwargs):
6217 """
6218 CanSend(Window win) -> bool
6219
6220 Returns ``True`` if it is appropriate to send idle events to this
6221 window.
6222
6223 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6224 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6225 events should be sent to this window now. By default this will always
6226 return ``True`` because the update mode is initially
6227 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6228 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6229 """
6230 return _core_.IdleEvent_CanSend(*args, **kwargs)
6231
6232 CanSend = staticmethod(CanSend)
6233 _core_.IdleEvent_swigregister(IdleEvent)
6234
6235 def IdleEvent_SetMode(*args, **kwargs):
6236 """
6237 IdleEvent_SetMode(int mode)
6238
6239 Static method for specifying how wxWidgets will send idle events: to
6240 all windows, or only to those which specify that they will process the
6241 events.
6242
6243 The mode can be one of the following values:
6244
6245 ========================= ========================================
6246 wx.IDLE_PROCESS_ALL Send idle events to all windows
6247 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6248 the wx.WS_EX_PROCESS_IDLE extra style
6249 flag set.
6250 ========================= ========================================
6251
6252 """
6253 return _core_.IdleEvent_SetMode(*args, **kwargs)
6254
6255 def IdleEvent_GetMode(*args):
6256 """
6257 IdleEvent_GetMode() -> int
6258
6259 Static method returning a value specifying how wxWidgets will send
6260 idle events: to all windows, or only to those which specify that they
6261 will process the events.
6262 """
6263 return _core_.IdleEvent_GetMode(*args)
6264
6265 def IdleEvent_CanSend(*args, **kwargs):
6266 """
6267 IdleEvent_CanSend(Window win) -> bool
6268
6269 Returns ``True`` if it is appropriate to send idle events to this
6270 window.
6271
6272 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6273 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6274 events should be sent to this window now. By default this will always
6275 return ``True`` because the update mode is initially
6276 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6277 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6278 """
6279 return _core_.IdleEvent_CanSend(*args, **kwargs)
6280
6281 #---------------------------------------------------------------------------
6282
6283 class ClipboardTextEvent(CommandEvent):
6284 """
6285 A Clipboard Text event is sent when a window intercepts a text
6286 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6287 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6288 popup menu command, etc. NOTE : under windows these events are *NOT*
6289 generated automatically for a Rich Edit text control.
6290 """
6291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6292 __repr__ = _swig_repr
6293 def __init__(self, *args, **kwargs):
6294 """
6295 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6296
6297 A Clipboard Text event is sent when a window intercepts a text
6298 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6299 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6300 popup menu command, etc. NOTE : under windows these events are *NOT*
6301 generated automatically for a Rich Edit text control.
6302 """
6303 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6304 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6305
6306 #---------------------------------------------------------------------------
6307
6308 class PyEvent(Event):
6309 """
6310 wx.PyEvent can be used as a base class for implementing custom event
6311 types in Python. You should derived from this class instead of
6312 `wx.Event` because this class is Python-aware and is able to transport
6313 its Python bits safely through the wxWidgets event system and have
6314 them still be there when the event handler is invoked.
6315
6316 :see: `wx.PyCommandEvent`
6317
6318 """
6319 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6320 __repr__ = _swig_repr
6321 def __init__(self, *args, **kwargs):
6322 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6323 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6324 self._SetSelf(self)
6325
6326 __swig_destroy__ = _core_.delete_PyEvent
6327 __del__ = lambda self : None;
6328 def _SetSelf(*args, **kwargs):
6329 """_SetSelf(self, PyObject self)"""
6330 return _core_.PyEvent__SetSelf(*args, **kwargs)
6331
6332 def _GetSelf(*args, **kwargs):
6333 """_GetSelf(self) -> PyObject"""
6334 return _core_.PyEvent__GetSelf(*args, **kwargs)
6335
6336 _core_.PyEvent_swigregister(PyEvent)
6337
6338 class PyCommandEvent(CommandEvent):
6339 """
6340 wx.PyCommandEvent can be used as a base class for implementing custom
6341 event types in Python, where the event shoudl travel up to parent
6342 windows looking for a handler. You should derived from this class
6343 instead of `wx.CommandEvent` because this class is Python-aware and is
6344 able to transport its Python bits safely through the wxWidgets event
6345 system and have them still be there when the event handler is invoked.
6346
6347 :see: `wx.PyEvent`
6348
6349 """
6350 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6351 __repr__ = _swig_repr
6352 def __init__(self, *args, **kwargs):
6353 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6354 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6355 self._SetSelf(self)
6356
6357 __swig_destroy__ = _core_.delete_PyCommandEvent
6358 __del__ = lambda self : None;
6359 def _SetSelf(*args, **kwargs):
6360 """_SetSelf(self, PyObject self)"""
6361 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6362
6363 def _GetSelf(*args, **kwargs):
6364 """_GetSelf(self) -> PyObject"""
6365 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6366
6367 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6368
6369 class DateEvent(CommandEvent):
6370 """
6371 This event class holds information about a date change event and is
6372 used together with `wx.DatePickerCtrl`. It also serves as a base class
6373 for `wx.calendar.CalendarEvent`. Bind these event types with
6374 EVT_DATE_CHANGED.
6375 """
6376 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6377 __repr__ = _swig_repr
6378 def __init__(self, *args, **kwargs):
6379 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6380 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6381 def GetDate(*args, **kwargs):
6382 """
6383 GetDate(self) -> DateTime
6384
6385 Returns the date.
6386 """
6387 return _core_.DateEvent_GetDate(*args, **kwargs)
6388
6389 def SetDate(*args, **kwargs):
6390 """
6391 SetDate(self, DateTime date)
6392
6393 Sets the date carried by the event, normally only used by the library
6394 internally.
6395 """
6396 return _core_.DateEvent_SetDate(*args, **kwargs)
6397
6398 _core_.DateEvent_swigregister(DateEvent)
6399
6400 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6401 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6402
6403 #---------------------------------------------------------------------------
6404
6405 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6406 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6407 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6408 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6409 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6410 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6411 class PyApp(EvtHandler):
6412 """
6413 The ``wx.PyApp`` class is an *implementation detail*, please use the
6414 `wx.App` class (or some other derived class) instead.
6415 """
6416 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6417 __repr__ = _swig_repr
6418 def __init__(self, *args, **kwargs):
6419 """
6420 __init__(self) -> PyApp
6421
6422 Create a new application object, starting the bootstrap process.
6423 """
6424 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6425 self._setCallbackInfo(self, PyApp, False)
6426 self._setOORInfo(self, False)
6427
6428 __swig_destroy__ = _core_.delete_PyApp
6429 __del__ = lambda self : None;
6430 def _setCallbackInfo(*args, **kwargs):
6431 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6432 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6433
6434 def GetAppName(*args, **kwargs):
6435 """
6436 GetAppName(self) -> String
6437
6438 Get the application name.
6439 """
6440 return _core_.PyApp_GetAppName(*args, **kwargs)
6441
6442 def SetAppName(*args, **kwargs):
6443 """
6444 SetAppName(self, String name)
6445
6446 Set the application name. This value may be used automatically by
6447 `wx.Config` and such.
6448 """
6449 return _core_.PyApp_SetAppName(*args, **kwargs)
6450
6451 def GetClassName(*args, **kwargs):
6452 """
6453 GetClassName(self) -> String
6454
6455 Get the application's class name.
6456 """
6457 return _core_.PyApp_GetClassName(*args, **kwargs)
6458
6459 def SetClassName(*args, **kwargs):
6460 """
6461 SetClassName(self, String name)
6462
6463 Set the application's class name. This value may be used for
6464 X-resources if applicable for the platform
6465 """
6466 return _core_.PyApp_SetClassName(*args, **kwargs)
6467
6468 def GetVendorName(*args, **kwargs):
6469 """
6470 GetVendorName(self) -> String
6471
6472 Get the application's vendor name.
6473 """
6474 return _core_.PyApp_GetVendorName(*args, **kwargs)
6475
6476 def SetVendorName(*args, **kwargs):
6477 """
6478 SetVendorName(self, String name)
6479
6480 Set the application's vendor name. This value may be used
6481 automatically by `wx.Config` and such.
6482 """
6483 return _core_.PyApp_SetVendorName(*args, **kwargs)
6484
6485 def GetTraits(*args, **kwargs):
6486 """
6487 GetTraits(self) -> wxAppTraits
6488
6489 Return (and create if necessary) the app traits object to which we
6490 delegate for everything which either should be configurable by the
6491 user (then he can change the default behaviour simply by overriding
6492 CreateTraits() and returning his own traits object) or which is
6493 GUI/console dependent as then wx.AppTraits allows us to abstract the
6494 differences behind the common facade.
6495
6496 :todo: Add support for overriding CreateAppTraits in wxPython.
6497 """
6498 return _core_.PyApp_GetTraits(*args, **kwargs)
6499
6500 def ProcessPendingEvents(*args, **kwargs):
6501 """
6502 ProcessPendingEvents(self)
6503
6504 Process all events in the Pending Events list -- it is necessary to
6505 call this function to process posted events. This normally happens
6506 during each event loop iteration.
6507 """
6508 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6509
6510 def Yield(*args, **kwargs):
6511 """
6512 Yield(self, bool onlyIfNeeded=False) -> bool
6513
6514 Process all currently pending events right now, instead of waiting
6515 until return to the event loop. It is an error to call ``Yield``
6516 recursively unless the value of ``onlyIfNeeded`` is True.
6517
6518 :warning: This function is dangerous as it can lead to unexpected
6519 reentrancies (i.e. when called from an event handler it may
6520 result in calling the same event handler again), use with
6521 extreme care or, better, don't use at all!
6522
6523 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6524
6525 """
6526 return _core_.PyApp_Yield(*args, **kwargs)
6527
6528 def WakeUpIdle(*args, **kwargs):
6529 """
6530 WakeUpIdle(self)
6531
6532 Make sure that idle events are sent again.
6533 :see: `wx.WakeUpIdle`
6534 """
6535 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6536
6537 def IsMainLoopRunning(*args, **kwargs):
6538 """
6539 IsMainLoopRunning() -> bool
6540
6541 Returns True if we're running the main loop, i.e. if the events can
6542 currently be dispatched.
6543 """
6544 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6545
6546 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6547 def MainLoop(*args, **kwargs):
6548 """
6549 MainLoop(self) -> int
6550
6551 Execute the main GUI loop, the function doesn't normally return until
6552 all top level windows have been closed and destroyed.
6553 """
6554 return _core_.PyApp_MainLoop(*args, **kwargs)
6555
6556 def Exit(*args, **kwargs):
6557 """
6558 Exit(self)
6559
6560 Exit the main loop thus terminating the application.
6561 :see: `wx.Exit`
6562 """
6563 return _core_.PyApp_Exit(*args, **kwargs)
6564
6565 def ExitMainLoop(*args, **kwargs):
6566 """
6567 ExitMainLoop(self)
6568
6569 Exit the main GUI loop during the next iteration of the main
6570 loop, (i.e. it does not stop the program immediately!)
6571 """
6572 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6573
6574 def Pending(*args, **kwargs):
6575 """
6576 Pending(self) -> bool
6577
6578 Returns True if there are unprocessed events in the event queue.
6579 """
6580 return _core_.PyApp_Pending(*args, **kwargs)
6581
6582 def Dispatch(*args, **kwargs):
6583 """
6584 Dispatch(self) -> bool
6585
6586 Process the first event in the event queue (blocks until an event
6587 appears if there are none currently)
6588 """
6589 return _core_.PyApp_Dispatch(*args, **kwargs)
6590
6591 def ProcessIdle(*args, **kwargs):
6592 """
6593 ProcessIdle(self) -> bool
6594
6595 Called from the MainLoop when the application becomes idle (there are
6596 no pending events) and sends a `wx.IdleEvent` to all interested
6597 parties. Returns True if more idle events are needed, False if not.
6598 """
6599 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6600
6601 def SendIdleEvents(*args, **kwargs):
6602 """
6603 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6604
6605 Send idle event to window and all subwindows. Returns True if more
6606 idle time is requested.
6607 """
6608 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6609
6610 def IsActive(*args, **kwargs):
6611 """
6612 IsActive(self) -> bool
6613
6614 Return True if our app has focus.
6615 """
6616 return _core_.PyApp_IsActive(*args, **kwargs)
6617
6618 def SetTopWindow(*args, **kwargs):
6619 """
6620 SetTopWindow(self, Window win)
6621
6622 Set the *main* top level window
6623 """
6624 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6625
6626 def GetTopWindow(*args, **kwargs):
6627 """
6628 GetTopWindow(self) -> Window
6629
6630 Return the *main* top level window (if it hadn't been set previously
6631 with SetTopWindow(), will return just some top level window and, if
6632 there not any, will return None)
6633 """
6634 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6635
6636 def SetExitOnFrameDelete(*args, **kwargs):
6637 """
6638 SetExitOnFrameDelete(self, bool flag)
6639
6640 Control the exit behaviour: by default, the program will exit the main
6641 loop (and so, usually, terminate) when the last top-level program
6642 window is deleted. Beware that if you disable this behaviour (with
6643 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6644 explicitly from somewhere.
6645 """
6646 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6647
6648 def GetExitOnFrameDelete(*args, **kwargs):
6649 """
6650 GetExitOnFrameDelete(self) -> bool
6651
6652 Get the current exit behaviour setting.
6653 """
6654 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6655
6656 def SetUseBestVisual(*args, **kwargs):
6657 """
6658 SetUseBestVisual(self, bool flag)
6659
6660 Set whether the app should try to use the best available visual on
6661 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6662 """
6663 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6664
6665 def GetUseBestVisual(*args, **kwargs):
6666 """
6667 GetUseBestVisual(self) -> bool
6668
6669 Get current UseBestVisual setting.
6670 """
6671 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6672
6673 def SetPrintMode(*args, **kwargs):
6674 """SetPrintMode(self, int mode)"""
6675 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6676
6677 def GetPrintMode(*args, **kwargs):
6678 """GetPrintMode(self) -> int"""
6679 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6680
6681 def SetAssertMode(*args, **kwargs):
6682 """
6683 SetAssertMode(self, int mode)
6684
6685 Set the OnAssert behaviour for debug and hybrid builds.
6686 """
6687 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6688
6689 def GetAssertMode(*args, **kwargs):
6690 """
6691 GetAssertMode(self) -> int
6692
6693 Get the current OnAssert behaviour setting.
6694 """
6695 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6696
6697 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6698 """GetMacSupportPCMenuShortcuts() -> bool"""
6699 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6700
6701 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6702 def GetMacAboutMenuItemId(*args, **kwargs):
6703 """GetMacAboutMenuItemId() -> long"""
6704 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6705
6706 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6707 def GetMacPreferencesMenuItemId(*args, **kwargs):
6708 """GetMacPreferencesMenuItemId() -> long"""
6709 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6710
6711 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6712 def GetMacExitMenuItemId(*args, **kwargs):
6713 """GetMacExitMenuItemId() -> long"""
6714 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6715
6716 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6717 def GetMacHelpMenuTitleName(*args, **kwargs):
6718 """GetMacHelpMenuTitleName() -> String"""
6719 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6720
6721 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6722 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6723 """SetMacSupportPCMenuShortcuts(bool val)"""
6724 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6725
6726 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6727 def SetMacAboutMenuItemId(*args, **kwargs):
6728 """SetMacAboutMenuItemId(long val)"""
6729 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6730
6731 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6732 def SetMacPreferencesMenuItemId(*args, **kwargs):
6733 """SetMacPreferencesMenuItemId(long val)"""
6734 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6735
6736 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6737 def SetMacExitMenuItemId(*args, **kwargs):
6738 """SetMacExitMenuItemId(long val)"""
6739 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6740
6741 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6742 def SetMacHelpMenuTitleName(*args, **kwargs):
6743 """SetMacHelpMenuTitleName(String val)"""
6744 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6745
6746 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6747 def _BootstrapApp(*args, **kwargs):
6748 """
6749 _BootstrapApp(self)
6750
6751 For internal use only
6752 """
6753 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6754
6755 def GetComCtl32Version(*args, **kwargs):
6756 """
6757 GetComCtl32Version() -> int
6758
6759 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6760 it wasn't found at all. Raises an exception on non-Windows platforms.
6761 """
6762 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6763
6764 GetComCtl32Version = staticmethod(GetComCtl32Version)
6765 _core_.PyApp_swigregister(PyApp)
6766
6767 def PyApp_IsMainLoopRunning(*args):
6768 """
6769 PyApp_IsMainLoopRunning() -> bool
6770
6771 Returns True if we're running the main loop, i.e. if the events can
6772 currently be dispatched.
6773 """
6774 return _core_.PyApp_IsMainLoopRunning(*args)
6775
6776 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6777 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6778 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6779
6780 def PyApp_GetMacAboutMenuItemId(*args):
6781 """PyApp_GetMacAboutMenuItemId() -> long"""
6782 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6783
6784 def PyApp_GetMacPreferencesMenuItemId(*args):
6785 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6786 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6787
6788 def PyApp_GetMacExitMenuItemId(*args):
6789 """PyApp_GetMacExitMenuItemId() -> long"""
6790 return _core_.PyApp_GetMacExitMenuItemId(*args)
6791
6792 def PyApp_GetMacHelpMenuTitleName(*args):
6793 """PyApp_GetMacHelpMenuTitleName() -> String"""
6794 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6795
6796 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6797 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6798 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6799
6800 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6801 """PyApp_SetMacAboutMenuItemId(long val)"""
6802 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6803
6804 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6805 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6806 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6807
6808 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6809 """PyApp_SetMacExitMenuItemId(long val)"""
6810 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6811
6812 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6813 """PyApp_SetMacHelpMenuTitleName(String val)"""
6814 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6815
6816 def PyApp_GetComCtl32Version(*args):
6817 """
6818 PyApp_GetComCtl32Version() -> int
6819
6820 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6821 it wasn't found at all. Raises an exception on non-Windows platforms.
6822 """
6823 return _core_.PyApp_GetComCtl32Version(*args)
6824
6825 #---------------------------------------------------------------------------
6826
6827
6828 def Exit(*args):
6829 """
6830 Exit()
6831
6832 Force an exit of the application. Convenience for wx.GetApp().Exit()
6833 """
6834 return _core_.Exit(*args)
6835
6836 def Yield(*args):
6837 """
6838 Yield() -> bool
6839
6840 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6841 """
6842 return _core_.Yield(*args)
6843
6844 def YieldIfNeeded(*args):
6845 """
6846 YieldIfNeeded() -> bool
6847
6848 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6849 """
6850 return _core_.YieldIfNeeded(*args)
6851
6852 def SafeYield(*args, **kwargs):
6853 """
6854 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6855
6856 This function is similar to `wx.Yield`, except that it disables the
6857 user input to all program windows before calling `wx.Yield` and
6858 re-enables it again afterwards. If ``win`` is not None, this window
6859 will remain enabled, allowing the implementation of some limited user
6860 interaction.
6861
6862 :Returns: the result of the call to `wx.Yield`.
6863 """
6864 return _core_.SafeYield(*args, **kwargs)
6865
6866 def WakeUpIdle(*args):
6867 """
6868 WakeUpIdle()
6869
6870 Cause the message queue to become empty again, so idle events will be
6871 sent.
6872 """
6873 return _core_.WakeUpIdle(*args)
6874
6875 def PostEvent(*args, **kwargs):
6876 """
6877 PostEvent(EvtHandler dest, Event event)
6878
6879 Send an event to a window or other wx.EvtHandler to be processed
6880 later.
6881 """
6882 return _core_.PostEvent(*args, **kwargs)
6883
6884 def App_CleanUp(*args):
6885 """
6886 App_CleanUp()
6887
6888 For internal use only, it is used to cleanup after wxWidgets when
6889 Python shuts down.
6890 """
6891 return _core_.App_CleanUp(*args)
6892
6893 def GetApp(*args):
6894 """
6895 GetApp() -> PyApp
6896
6897 Return a reference to the current wx.App object.
6898 """
6899 return _core_.GetApp(*args)
6900
6901 def SetDefaultPyEncoding(*args, **kwargs):
6902 """
6903 SetDefaultPyEncoding(string encoding)
6904
6905 Sets the encoding that wxPython will use when it needs to convert a
6906 Python string or unicode object to or from a wxString.
6907
6908 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6909 but please be aware that the default encoding within the same locale
6910 may be slightly different on different platforms. For example, please
6911 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6912 between the common latin/roman encodings.
6913 """
6914 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6915
6916 def GetDefaultPyEncoding(*args):
6917 """
6918 GetDefaultPyEncoding() -> string
6919
6920 Gets the current encoding that wxPython will use when it needs to
6921 convert a Python string or unicode object to or from a wxString.
6922 """
6923 return _core_.GetDefaultPyEncoding(*args)
6924 #----------------------------------------------------------------------
6925
6926 class PyOnDemandOutputWindow:
6927 """
6928 A class that can be used for redirecting Python's stdout and
6929 stderr streams. It will do nothing until something is wrriten to
6930 the stream at which point it will create a Frame with a text area
6931 and write the text there.
6932 """
6933 def __init__(self, title = "wxPython: stdout/stderr"):
6934 self.frame = None
6935 self.title = title
6936 self.pos = wx.DefaultPosition
6937 self.size = (450, 300)
6938 self.parent = None
6939
6940 def SetParent(self, parent):
6941 """Set the window to be used as the popup Frame's parent."""
6942 self.parent = parent
6943
6944
6945 def CreateOutputWindow(self, st):
6946 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6947 style=wx.DEFAULT_FRAME_STYLE)
6948 self.text = wx.TextCtrl(self.frame, -1, "",
6949 style=wx.TE_MULTILINE|wx.TE_READONLY)
6950 self.text.AppendText(st)
6951 self.frame.Show(True)
6952 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6953
6954
6955 def OnCloseWindow(self, event):
6956 if self.frame is not None:
6957 self.frame.Destroy()
6958 self.frame = None
6959 self.text = None
6960
6961
6962 # These methods provide the file-like output behaviour.
6963 def write(self, text):
6964 """
6965 Create the output window if needed and write the string to it.
6966 If not called in the context of the gui thread then uses
6967 CallAfter to do the work there.
6968 """
6969 if self.frame is None:
6970 if not wx.Thread_IsMain():
6971 wx.CallAfter(self.CreateOutputWindow, text)
6972 else:
6973 self.CreateOutputWindow(text)
6974 else:
6975 if not wx.Thread_IsMain():
6976 wx.CallAfter(self.text.AppendText, text)
6977 else:
6978 self.text.AppendText(text)
6979
6980
6981 def close(self):
6982 if self.frame is not None:
6983 wx.CallAfter(self.frame.Close)
6984
6985
6986 def flush(self):
6987 pass
6988
6989
6990
6991 #----------------------------------------------------------------------
6992
6993 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6994
6995 class App(wx.PyApp):
6996 """
6997 The ``wx.App`` class represents the application and is used to:
6998
6999 * bootstrap the wxPython system and initialize the underlying
7000 gui toolkit
7001 * set and get application-wide properties
7002 * implement the windowing system main message or event loop,
7003 and to dispatch events to window instances
7004 * etc.
7005
7006 Every application must have a ``wx.App`` instance, and all
7007 creation of UI objects should be delayed until after the
7008 ``wx.App`` object has been created in order to ensure that the gui
7009 platform and wxWidgets have been fully initialized.
7010
7011 Normally you would derive from this class and implement an
7012 ``OnInit`` method that creates a frame and then calls
7013 ``self.SetTopWindow(frame)``.
7014
7015 :see: `wx.PySimpleApp` for a simpler app class that can be used
7016 directly.
7017 """
7018
7019 outputWindowClass = PyOnDemandOutputWindow
7020
7021 def __init__(self, redirect=_defRedirect, filename=None,
7022 useBestVisual=False, clearSigInt=True):
7023 """
7024 Construct a ``wx.App`` object.
7025
7026 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7027 redirected? Defaults to True on Windows and Mac, False
7028 otherwise. If `filename` is None then output will be
7029 redirected to a window that pops up as needed. (You can
7030 control what kind of window is created for the output by
7031 resetting the class variable ``outputWindowClass`` to a
7032 class of your choosing.)
7033
7034 :param filename: The name of a file to redirect output to, if
7035 redirect is True.
7036
7037 :param useBestVisual: Should the app try to use the best
7038 available visual provided by the system (only relevant on
7039 systems that have more than one visual.) This parameter
7040 must be used instead of calling `SetUseBestVisual` later
7041 on because it must be set before the underlying GUI
7042 toolkit is initialized.
7043
7044 :param clearSigInt: Should SIGINT be cleared? This allows the
7045 app to terminate upon a Ctrl-C in the console like other
7046 GUI apps will.
7047
7048 :note: You should override OnInit to do applicaition
7049 initialization to ensure that the system, toolkit and
7050 wxWidgets are fully initialized.
7051 """
7052 wx.PyApp.__init__(self)
7053
7054 if wx.Platform == "__WXMAC__":
7055 try:
7056 import MacOS
7057 if not MacOS.WMAvailable():
7058 print """\
7059 This program needs access to the screen. Please run with 'pythonw',
7060 not 'python', and only when you are logged in on the main display of
7061 your Mac."""
7062 _sys.exit(1)
7063 except SystemExit:
7064 raise
7065 except:
7066 pass
7067
7068 # This has to be done before OnInit
7069 self.SetUseBestVisual(useBestVisual)
7070
7071 # Set the default handler for SIGINT. This fixes a problem
7072 # where if Ctrl-C is pressed in the console that started this
7073 # app then it will not appear to do anything, (not even send
7074 # KeyboardInterrupt???) but will later segfault on exit. By
7075 # setting the default handler then the app will exit, as
7076 # expected (depending on platform.)
7077 if clearSigInt:
7078 try:
7079 import signal
7080 signal.signal(signal.SIGINT, signal.SIG_DFL)
7081 except:
7082 pass
7083
7084 # Save and redirect the stdio to a window?
7085 self.stdioWin = None
7086 self.saveStdio = (_sys.stdout, _sys.stderr)
7087 if redirect:
7088 self.RedirectStdio(filename)
7089
7090 # Use Python's install prefix as the default
7091 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7092
7093 # This finishes the initialization of wxWindows and then calls
7094 # the OnInit that should be present in the derived class
7095 self._BootstrapApp()
7096
7097
7098 def OnPreInit(self):
7099 """
7100 Things that must be done after _BootstrapApp has done its
7101 thing, but would be nice if they were already done by the time
7102 that OnInit is called.
7103 """
7104 wx.StockGDI._initStockObjects()
7105
7106
7107 def __del__(self, destroy=wx.PyApp.__del__):
7108 self.RestoreStdio() # Just in case the MainLoop was overridden
7109 destroy(self)
7110
7111 def Destroy(self):
7112 wx.PyApp.Destroy(self)
7113 self.thisown = 0
7114
7115 def SetTopWindow(self, frame):
7116 """Set the \"main\" top level window"""
7117 if self.stdioWin:
7118 self.stdioWin.SetParent(frame)
7119 wx.PyApp.SetTopWindow(self, frame)
7120
7121
7122 def MainLoop(self):
7123 """Execute the main GUI event loop"""
7124 wx.PyApp.MainLoop(self)
7125 self.RestoreStdio()
7126
7127
7128 def RedirectStdio(self, filename=None):
7129 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7130 if filename:
7131 _sys.stdout = _sys.stderr = open(filename, 'a')
7132 else:
7133 self.stdioWin = self.outputWindowClass()
7134 _sys.stdout = _sys.stderr = self.stdioWin
7135
7136
7137 def RestoreStdio(self):
7138 try:
7139 _sys.stdout, _sys.stderr = self.saveStdio
7140 except:
7141 pass
7142
7143
7144 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7145 """
7146 Set the title, position and/or size of the output window if
7147 the stdio has been redirected. This should be called before
7148 any output would cause the output window to be created.
7149 """
7150 if self.stdioWin:
7151 if title is not None:
7152 self.stdioWin.title = title
7153 if pos is not None:
7154 self.stdioWin.pos = pos
7155 if size is not None:
7156 self.stdioWin.size = size
7157
7158
7159
7160
7161 # change from wx.PyApp_XX to wx.App_XX
7162 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7163 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7164 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7165 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7166 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7167 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7168 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7169 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7170 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7171 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7172 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7173
7174 #----------------------------------------------------------------------------
7175
7176 class PySimpleApp(wx.App):
7177 """
7178 A simple application class. You can just create one of these and
7179 then then make your top level windows later, and not have to worry
7180 about OnInit. For example::
7181
7182 app = wx.PySimpleApp()
7183 frame = wx.Frame(None, title='Hello World')
7184 frame.Show()
7185 app.MainLoop()
7186
7187 :see: `wx.App`
7188 """
7189
7190 def __init__(self, redirect=False, filename=None,
7191 useBestVisual=False, clearSigInt=True):
7192 """
7193 :see: `wx.App.__init__`
7194 """
7195 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7196
7197 def OnInit(self):
7198 return True
7199
7200
7201
7202 # Is anybody using this one?
7203 class PyWidgetTester(wx.App):
7204 def __init__(self, size = (250, 100)):
7205 self.size = size
7206 wx.App.__init__(self, 0)
7207
7208 def OnInit(self):
7209 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7210 self.SetTopWindow(self.frame)
7211 return True
7212
7213 def SetWidget(self, widgetClass, *args, **kwargs):
7214 w = widgetClass(self.frame, *args, **kwargs)
7215 self.frame.Show(True)
7216
7217 #----------------------------------------------------------------------------
7218 # DO NOT hold any other references to this object. This is how we
7219 # know when to cleanup system resources that wxWidgets is holding. When
7220 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7221 # goes to zero and it calls the wx.App_CleanUp function.
7222
7223 class __wxPyCleanup:
7224 def __init__(self):
7225 self.cleanup = _core_.App_CleanUp
7226 def __del__(self):
7227 self.cleanup()
7228
7229 _sys.__wxPythonCleanup = __wxPyCleanup()
7230
7231 ## # another possible solution, but it gets called too early...
7232 ## import atexit
7233 ## atexit.register(_core_.wxApp_CleanUp)
7234
7235
7236 #----------------------------------------------------------------------------
7237
7238 #---------------------------------------------------------------------------
7239
7240 class EventLoop(object):
7241 """Proxy of C++ EventLoop class"""
7242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7243 __repr__ = _swig_repr
7244 def __init__(self, *args, **kwargs):
7245 """__init__(self) -> EventLoop"""
7246 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7247 __swig_destroy__ = _core_.delete_EventLoop
7248 __del__ = lambda self : None;
7249 def Run(*args, **kwargs):
7250 """Run(self) -> int"""
7251 return _core_.EventLoop_Run(*args, **kwargs)
7252
7253 def Exit(*args, **kwargs):
7254 """Exit(self, int rc=0)"""
7255 return _core_.EventLoop_Exit(*args, **kwargs)
7256
7257 def Pending(*args, **kwargs):
7258 """Pending(self) -> bool"""
7259 return _core_.EventLoop_Pending(*args, **kwargs)
7260
7261 def Dispatch(*args, **kwargs):
7262 """Dispatch(self) -> bool"""
7263 return _core_.EventLoop_Dispatch(*args, **kwargs)
7264
7265 def IsRunning(*args, **kwargs):
7266 """IsRunning(self) -> bool"""
7267 return _core_.EventLoop_IsRunning(*args, **kwargs)
7268
7269 def GetActive(*args, **kwargs):
7270 """GetActive() -> EventLoop"""
7271 return _core_.EventLoop_GetActive(*args, **kwargs)
7272
7273 GetActive = staticmethod(GetActive)
7274 def SetActive(*args, **kwargs):
7275 """SetActive(EventLoop loop)"""
7276 return _core_.EventLoop_SetActive(*args, **kwargs)
7277
7278 SetActive = staticmethod(SetActive)
7279 _core_.EventLoop_swigregister(EventLoop)
7280
7281 def EventLoop_GetActive(*args):
7282 """EventLoop_GetActive() -> EventLoop"""
7283 return _core_.EventLoop_GetActive(*args)
7284
7285 def EventLoop_SetActive(*args, **kwargs):
7286 """EventLoop_SetActive(EventLoop loop)"""
7287 return _core_.EventLoop_SetActive(*args, **kwargs)
7288
7289 class EventLoopActivator(object):
7290 """Proxy of C++ EventLoopActivator class"""
7291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7292 __repr__ = _swig_repr
7293 def __init__(self, *args, **kwargs):
7294 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7295 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7296 __swig_destroy__ = _core_.delete_EventLoopActivator
7297 __del__ = lambda self : None;
7298 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7299
7300 #---------------------------------------------------------------------------
7301
7302 class AcceleratorEntry(object):
7303 """
7304 A class used to define items in an `wx.AcceleratorTable`. wxPython
7305 programs can choose to use wx.AcceleratorEntry objects, but using a
7306 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7307 as well. See `__init__` for of the tuple values.
7308
7309 :see: `wx.AcceleratorTable`
7310 """
7311 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7312 __repr__ = _swig_repr
7313 def __init__(self, *args, **kwargs):
7314 """
7315 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7316
7317 Construct a wx.AcceleratorEntry.
7318 """
7319 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7320 __swig_destroy__ = _core_.delete_AcceleratorEntry
7321 __del__ = lambda self : None;
7322 def Set(*args, **kwargs):
7323 """
7324 Set(self, int flags, int keyCode, int cmd)
7325
7326 (Re)set the attributes of a wx.AcceleratorEntry.
7327 :see `__init__`
7328 """
7329 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7330
7331 def GetFlags(*args, **kwargs):
7332 """
7333 GetFlags(self) -> int
7334
7335 Get the AcceleratorEntry's flags.
7336 """
7337 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7338
7339 def GetKeyCode(*args, **kwargs):
7340 """
7341 GetKeyCode(self) -> int
7342
7343 Get the AcceleratorEntry's keycode.
7344 """
7345 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7346
7347 def GetCommand(*args, **kwargs):
7348 """
7349 GetCommand(self) -> int
7350
7351 Get the AcceleratorEntry's command ID.
7352 """
7353 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7354
7355 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7356
7357 class AcceleratorTable(Object):
7358 """
7359 An accelerator table allows the application to specify a table of
7360 keyboard shortcuts for menus or other commands. On Windows, menu or
7361 button commands are supported; on GTK, only menu commands are
7362 supported.
7363 """
7364 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7365 __repr__ = _swig_repr
7366 def __init__(self, *args, **kwargs):
7367 """
7368 __init__(entries) -> AcceleratorTable
7369
7370 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7371 items or or of 3-tuples (flags, keyCode, cmdID)
7372
7373 :see: `wx.AcceleratorEntry`
7374 """
7375 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7376 __swig_destroy__ = _core_.delete_AcceleratorTable
7377 __del__ = lambda self : None;
7378 def Ok(*args, **kwargs):
7379 """Ok(self) -> bool"""
7380 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7381
7382 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7383
7384
7385 def GetAccelFromString(*args, **kwargs):
7386 """GetAccelFromString(String label) -> AcceleratorEntry"""
7387 return _core_.GetAccelFromString(*args, **kwargs)
7388 #---------------------------------------------------------------------------
7389
7390 class VisualAttributes(object):
7391 """struct containing all the visual attributes of a control"""
7392 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7393 __repr__ = _swig_repr
7394 def __init__(self, *args, **kwargs):
7395 """
7396 __init__(self) -> VisualAttributes
7397
7398 struct containing all the visual attributes of a control
7399 """
7400 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7401 __swig_destroy__ = _core_.delete_VisualAttributes
7402 __del__ = lambda self : None;
7403 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7404 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7405 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7406 _core_.VisualAttributes_swigregister(VisualAttributes)
7407 NullAcceleratorTable = cvar.NullAcceleratorTable
7408 PanelNameStr = cvar.PanelNameStr
7409
7410 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7411 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7412 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7413 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7414 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7415 class Window(EvtHandler):
7416 """
7417 wx.Window is the base class for all windows and represents any visible
7418 object on the screen. All controls, top level windows and so on are
7419 wx.Windows. Sizers and device contexts are not however, as they don't
7420 appear on screen themselves.
7421
7422 """
7423 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7424 __repr__ = _swig_repr
7425 def __init__(self, *args, **kwargs):
7426 """
7427 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7428 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7429
7430 Construct and show a generic Window.
7431 """
7432 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7433 self._setOORInfo(self)
7434
7435 def Create(*args, **kwargs):
7436 """
7437 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7438 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7439
7440 Create the GUI part of the Window for 2-phase creation mode.
7441 """
7442 return _core_.Window_Create(*args, **kwargs)
7443
7444 def Close(*args, **kwargs):
7445 """
7446 Close(self, bool force=False) -> bool
7447
7448 This function simply generates a EVT_CLOSE event whose handler usually
7449 tries to close the window. It doesn't close the window itself,
7450 however. If force is False (the default) then the window's close
7451 handler will be allowed to veto the destruction of the window.
7452 """
7453 return _core_.Window_Close(*args, **kwargs)
7454
7455 def Destroy(*args, **kwargs):
7456 """
7457 Destroy(self) -> bool
7458
7459 Destroys the window safely. Frames and dialogs are not destroyed
7460 immediately when this function is called -- they are added to a list
7461 of windows to be deleted on idle time, when all the window's events
7462 have been processed. This prevents problems with events being sent to
7463 non-existent windows.
7464
7465 Returns True if the window has either been successfully deleted, or it
7466 has been added to the list of windows pending real deletion.
7467 """
7468 val = _core_.Window_Destroy(*args, **kwargs)
7469 args[0].thisown = 0
7470 return val
7471
7472 def DestroyChildren(*args, **kwargs):
7473 """
7474 DestroyChildren(self) -> bool
7475
7476 Destroys all children of a window. Called automatically by the
7477 destructor.
7478 """
7479 return _core_.Window_DestroyChildren(*args, **kwargs)
7480
7481 def IsBeingDeleted(*args, **kwargs):
7482 """
7483 IsBeingDeleted(self) -> bool
7484
7485 Is the window in the process of being deleted?
7486 """
7487 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7488
7489 def SetLabel(*args, **kwargs):
7490 """
7491 SetLabel(self, String label)
7492
7493 Set the text which the window shows in its label if applicable.
7494 """
7495 return _core_.Window_SetLabel(*args, **kwargs)
7496
7497 def GetLabel(*args, **kwargs):
7498 """
7499 GetLabel(self) -> String
7500
7501 Generic way of getting a label from any window, for identification
7502 purposes. The interpretation of this function differs from class to
7503 class. For frames and dialogs, the value returned is the title. For
7504 buttons or static text controls, it is the button text. This function
7505 can be useful for meta-programs such as testing tools or special-needs
7506 access programs)which need to identify windows by name.
7507 """
7508 return _core_.Window_GetLabel(*args, **kwargs)
7509
7510 def SetName(*args, **kwargs):
7511 """
7512 SetName(self, String name)
7513
7514 Sets the window's name. The window name is used for ressource setting
7515 in X, it is not the same as the window title/label
7516 """
7517 return _core_.Window_SetName(*args, **kwargs)
7518
7519 def GetName(*args, **kwargs):
7520 """
7521 GetName(self) -> String
7522
7523 Returns the windows name. This name is not guaranteed to be unique;
7524 it is up to the programmer to supply an appropriate name in the window
7525 constructor or via wx.Window.SetName.
7526 """
7527 return _core_.Window_GetName(*args, **kwargs)
7528
7529 def SetWindowVariant(*args, **kwargs):
7530 """
7531 SetWindowVariant(self, int variant)
7532
7533 Sets the variant of the window/font size to use for this window, if
7534 the platform supports variants, for example, wxMac.
7535 """
7536 return _core_.Window_SetWindowVariant(*args, **kwargs)
7537
7538 def GetWindowVariant(*args, **kwargs):
7539 """GetWindowVariant(self) -> int"""
7540 return _core_.Window_GetWindowVariant(*args, **kwargs)
7541
7542 def SetId(*args, **kwargs):
7543 """
7544 SetId(self, int winid)
7545
7546 Sets the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one, an identifier
7548 will be generated. Normally, the identifier should be provided on
7549 creation and should not be modified subsequently.
7550 """
7551 return _core_.Window_SetId(*args, **kwargs)
7552
7553 def GetId(*args, **kwargs):
7554 """
7555 GetId(self) -> int
7556
7557 Returns the identifier of the window. Each window has an integer
7558 identifier. If the application has not provided one (or the default Id
7559 -1 is used) then an unique identifier with a negative value will be
7560 generated.
7561 """
7562 return _core_.Window_GetId(*args, **kwargs)
7563
7564 def NewControlId(*args, **kwargs):
7565 """
7566 NewControlId() -> int
7567
7568 Generate a control id for the controls which were not given one.
7569 """
7570 return _core_.Window_NewControlId(*args, **kwargs)
7571
7572 NewControlId = staticmethod(NewControlId)
7573 def NextControlId(*args, **kwargs):
7574 """
7575 NextControlId(int winid) -> int
7576
7577 Get the id of the control following the one with the given
7578 autogenerated) id
7579 """
7580 return _core_.Window_NextControlId(*args, **kwargs)
7581
7582 NextControlId = staticmethod(NextControlId)
7583 def PrevControlId(*args, **kwargs):
7584 """
7585 PrevControlId(int winid) -> int
7586
7587 Get the id of the control preceding the one with the given
7588 autogenerated) id
7589 """
7590 return _core_.Window_PrevControlId(*args, **kwargs)
7591
7592 PrevControlId = staticmethod(PrevControlId)
7593 def SetSize(*args, **kwargs):
7594 """
7595 SetSize(self, Size size)
7596
7597 Sets the size of the window in pixels.
7598 """
7599 return _core_.Window_SetSize(*args, **kwargs)
7600
7601 def SetDimensions(*args, **kwargs):
7602 """
7603 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7604
7605 Sets the position and size of the window in pixels. The sizeFlags
7606 parameter indicates the interpretation of the other params if they are
7607 equal to -1.
7608
7609 ======================== ======================================
7610 wx.SIZE_AUTO A -1 indicates that a class-specific
7611 default should be used.
7612 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7613 -1 values are supplied.
7614 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7615 interpreted as real dimensions, not
7616 default values.
7617 ======================== ======================================
7618
7619 """
7620 return _core_.Window_SetDimensions(*args, **kwargs)
7621
7622 def SetRect(*args, **kwargs):
7623 """
7624 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7625
7626 Sets the position and size of the window in pixels using a wx.Rect.
7627 """
7628 return _core_.Window_SetRect(*args, **kwargs)
7629
7630 def SetSizeWH(*args, **kwargs):
7631 """
7632 SetSizeWH(self, int width, int height)
7633
7634 Sets the size of the window in pixels.
7635 """
7636 return _core_.Window_SetSizeWH(*args, **kwargs)
7637
7638 def Move(*args, **kwargs):
7639 """
7640 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7641
7642 Moves the window to the given position.
7643 """
7644 return _core_.Window_Move(*args, **kwargs)
7645
7646 SetPosition = Move
7647 def MoveXY(*args, **kwargs):
7648 """
7649 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7650
7651 Moves the window to the given position.
7652 """
7653 return _core_.Window_MoveXY(*args, **kwargs)
7654
7655 def SetBestFittingSize(*args, **kwargs):
7656 """
7657 SetBestFittingSize(self, Size size=DefaultSize)
7658
7659 A 'Smart' SetSize that will fill in default size components with the
7660 window's *best size* values. Also set's the minsize for use with sizers.
7661 """
7662 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7663
7664 def Raise(*args, **kwargs):
7665 """
7666 Raise(self)
7667
7668 Raises the window to the top of the window hierarchy. In current
7669 version of wxWidgets this works both for manage and child windows.
7670 """
7671 return _core_.Window_Raise(*args, **kwargs)
7672
7673 def Lower(*args, **kwargs):
7674 """
7675 Lower(self)
7676
7677 Lowers the window to the bottom of the window hierarchy. In current
7678 version of wxWidgets this works both for manage and child windows.
7679 """
7680 return _core_.Window_Lower(*args, **kwargs)
7681
7682 def SetClientSize(*args, **kwargs):
7683 """
7684 SetClientSize(self, Size size)
7685
7686 This sets the size of the window client area in pixels. Using this
7687 function to size a window tends to be more device-independent than
7688 wx.Window.SetSize, since the application need not worry about what
7689 dimensions the border or title bar have when trying to fit the window
7690 around panel items, for example.
7691 """
7692 return _core_.Window_SetClientSize(*args, **kwargs)
7693
7694 def SetClientSizeWH(*args, **kwargs):
7695 """
7696 SetClientSizeWH(self, int width, int height)
7697
7698 This sets the size of the window client area in pixels. Using this
7699 function to size a window tends to be more device-independent than
7700 wx.Window.SetSize, since the application need not worry about what
7701 dimensions the border or title bar have when trying to fit the window
7702 around panel items, for example.
7703 """
7704 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7705
7706 def SetClientRect(*args, **kwargs):
7707 """
7708 SetClientRect(self, Rect rect)
7709
7710 This sets the size of the window client area in pixels. Using this
7711 function to size a window tends to be more device-independent than
7712 wx.Window.SetSize, since the application need not worry about what
7713 dimensions the border or title bar have when trying to fit the window
7714 around panel items, for example.
7715 """
7716 return _core_.Window_SetClientRect(*args, **kwargs)
7717
7718 def GetPosition(*args, **kwargs):
7719 """
7720 GetPosition(self) -> Point
7721
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7725 kinds of windows.
7726 """
7727 return _core_.Window_GetPosition(*args, **kwargs)
7728
7729 def GetPositionTuple(*args, **kwargs):
7730 """
7731 GetPositionTuple() -> (x,y)
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_GetPositionTuple(*args, **kwargs)
7739
7740 def GetScreenPosition(*args, **kwargs):
7741 """
7742 GetScreenPosition(self) -> Point
7743
7744 Get the position of the window in screen coordinantes.
7745 """
7746 return _core_.Window_GetScreenPosition(*args, **kwargs)
7747
7748 def GetScreenPositionTuple(*args, **kwargs):
7749 """
7750 GetScreenPositionTuple() -> (x,y)
7751
7752 Get the position of the window in screen coordinantes.
7753 """
7754 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7755
7756 def GetScreenRect(*args, **kwargs):
7757 """
7758 GetScreenRect(self) -> Rect
7759
7760 Returns the size and position of the window in screen coordinantes as
7761 a `wx.Rect` object.
7762 """
7763 return _core_.Window_GetScreenRect(*args, **kwargs)
7764
7765 def GetSize(*args, **kwargs):
7766 """
7767 GetSize(self) -> Size
7768
7769 Get the window size.
7770 """
7771 return _core_.Window_GetSize(*args, **kwargs)
7772
7773 def GetSizeTuple(*args, **kwargs):
7774 """
7775 GetSizeTuple() -> (width, height)
7776
7777 Get the window size.
7778 """
7779 return _core_.Window_GetSizeTuple(*args, **kwargs)
7780
7781 def GetRect(*args, **kwargs):
7782 """
7783 GetRect(self) -> Rect
7784
7785 Returns the size and position of the window as a `wx.Rect` object.
7786 """
7787 return _core_.Window_GetRect(*args, **kwargs)
7788
7789 def GetClientSize(*args, **kwargs):
7790 """
7791 GetClientSize(self) -> Size
7792
7793 This gets the size of the window's 'client area' in pixels. The client
7794 area is the area which may be drawn on by the programmer, excluding
7795 title bar, border, scrollbars, etc.
7796 """
7797 return _core_.Window_GetClientSize(*args, **kwargs)
7798
7799 def GetClientSizeTuple(*args, **kwargs):
7800 """
7801 GetClientSizeTuple() -> (width, height)
7802
7803 This gets the size of the window's 'client area' in pixels. The client
7804 area is the area which may be drawn on by the programmer, excluding
7805 title bar, border, scrollbars, etc.
7806 """
7807 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7808
7809 def GetClientAreaOrigin(*args, **kwargs):
7810 """
7811 GetClientAreaOrigin(self) -> Point
7812
7813 Get the origin of the client area of the window relative to the
7814 window's top left corner (the client area may be shifted because of
7815 the borders, scrollbars, other decorations...)
7816 """
7817 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7818
7819 def GetClientRect(*args, **kwargs):
7820 """
7821 GetClientRect(self) -> Rect
7822
7823 Get the client area position and size as a `wx.Rect` object.
7824 """
7825 return _core_.Window_GetClientRect(*args, **kwargs)
7826
7827 def GetBestSize(*args, **kwargs):
7828 """
7829 GetBestSize(self) -> Size
7830
7831 This function returns the best acceptable minimal size for the
7832 window, if applicable. For example, for a static text control, it will
7833 be the minimal size such that the control label is not truncated. For
7834 windows containing subwindows (suzh aswx.Panel), the size returned by
7835 this function will be the same as the size the window would have had
7836 after calling Fit.
7837 """
7838 return _core_.Window_GetBestSize(*args, **kwargs)
7839
7840 def GetBestSizeTuple(*args, **kwargs):
7841 """
7842 GetBestSizeTuple() -> (width, height)
7843
7844 This function returns the best acceptable minimal size for the
7845 window, if applicable. For example, for a static text control, it will
7846 be the minimal size such that the control label is not truncated. For
7847 windows containing subwindows (suzh aswx.Panel), the size returned by
7848 this function will be the same as the size the window would have had
7849 after calling Fit.
7850 """
7851 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7852
7853 def InvalidateBestSize(*args, **kwargs):
7854 """
7855 InvalidateBestSize(self)
7856
7857 Reset the cached best size value so it will be recalculated the next
7858 time it is needed.
7859 """
7860 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7861
7862 def CacheBestSize(*args, **kwargs):
7863 """
7864 CacheBestSize(self, Size size)
7865
7866 Cache the best size so it doesn't need to be calculated again, (at least until
7867 some properties of the window change.)
7868 """
7869 return _core_.Window_CacheBestSize(*args, **kwargs)
7870
7871 def GetBestFittingSize(*args, **kwargs):
7872 """
7873 GetBestFittingSize(self) -> Size
7874
7875 This function will merge the window's best size into the window's
7876 minimum size, giving priority to the min size components, and returns
7877 the results.
7878
7879 """
7880 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7881
7882 def GetAdjustedBestSize(*args, **kwargs):
7883 """
7884 GetAdjustedBestSize(self) -> Size
7885
7886 This method is similar to GetBestSize, except in one
7887 thing. GetBestSize should return the minimum untruncated size of the
7888 window, while this method will return the largest of BestSize and any
7889 user specified minimum size. ie. it is the minimum size the window
7890 should currently be drawn at, not the minimal size it can possibly
7891 tolerate.
7892 """
7893 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7894
7895 def Center(*args, **kwargs):
7896 """
7897 Center(self, int direction=BOTH)
7898
7899 Centers the window. The parameter specifies the direction for
7900 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7901 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7902 on the entire screen and not on its parent window. If it is a
7903 top-level window and has no parent then it will always be centered
7904 relative to the screen.
7905 """
7906 return _core_.Window_Center(*args, **kwargs)
7907
7908 Centre = Center
7909 def CenterOnParent(*args, **kwargs):
7910 """
7911 CenterOnParent(self, int dir=BOTH)
7912
7913 Center with respect to the the parent window
7914 """
7915 return _core_.Window_CenterOnParent(*args, **kwargs)
7916
7917 CentreOnParent = CenterOnParent
7918 def Fit(*args, **kwargs):
7919 """
7920 Fit(self)
7921
7922 Sizes the window so that it fits around its subwindows. This function
7923 won't do anything if there are no subwindows and will only really work
7924 correctly if sizers are used for the subwindows layout. Also, if the
7925 window has exactly one subwindow it is better (faster and the result
7926 is more precise as Fit adds some margin to account for fuzziness of
7927 its calculations) to call window.SetClientSize(child.GetSize())
7928 instead of calling Fit.
7929 """
7930 return _core_.Window_Fit(*args, **kwargs)
7931
7932 def FitInside(*args, **kwargs):
7933 """
7934 FitInside(self)
7935
7936 Similar to Fit, but sizes the interior (virtual) size of a
7937 window. Mainly useful with scrolled windows to reset scrollbars after
7938 sizing changes that do not trigger a size event, and/or scrolled
7939 windows without an interior sizer. This function similarly won't do
7940 anything if there are no subwindows.
7941 """
7942 return _core_.Window_FitInside(*args, **kwargs)
7943
7944 def SetSizeHints(*args, **kwargs):
7945 """
7946 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7947 int incH=-1)
7948
7949 Allows specification of minimum and maximum window sizes, and window
7950 size increments. If a pair of values is not set (or set to -1), the
7951 default values will be used. If this function is called, the user
7952 will not be able to size the window outside the given bounds (if it is
7953 a top-level window.) Sizers will also inspect the minimum window size
7954 and will use that value if set when calculating layout.
7955
7956 The resizing increments are only significant under Motif or Xt.
7957 """
7958 return _core_.Window_SetSizeHints(*args, **kwargs)
7959
7960 def SetSizeHintsSz(*args, **kwargs):
7961 """
7962 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7963
7964 Allows specification of minimum and maximum window sizes, and window
7965 size increments. If a pair of values is not set (or set to -1), the
7966 default values will be used. If this function is called, the user
7967 will not be able to size the window outside the given bounds (if it is
7968 a top-level window.) Sizers will also inspect the minimum window size
7969 and will use that value if set when calculating layout.
7970
7971 The resizing increments are only significant under Motif or Xt.
7972 """
7973 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7974
7975 def SetVirtualSizeHints(*args, **kwargs):
7976 """
7977 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7978
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7983 """
7984 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7985
7986 def SetVirtualSizeHintsSz(*args, **kwargs):
7987 """
7988 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
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_SetVirtualSizeHintsSz(*args, **kwargs)
7996
7997 def GetMaxSize(*args, **kwargs):
7998 """GetMaxSize(self) -> Size"""
7999 return _core_.Window_GetMaxSize(*args, **kwargs)
8000
8001 def GetMinSize(*args, **kwargs):
8002 """GetMinSize(self) -> Size"""
8003 return _core_.Window_GetMinSize(*args, **kwargs)
8004
8005 def SetMinSize(*args, **kwargs):
8006 """
8007 SetMinSize(self, Size minSize)
8008
8009 A more convenient method than `SetSizeHints` for setting just the
8010 min size.
8011 """
8012 return _core_.Window_SetMinSize(*args, **kwargs)
8013
8014 def SetMaxSize(*args, **kwargs):
8015 """
8016 SetMaxSize(self, Size maxSize)
8017
8018 A more convenient method than `SetSizeHints` for setting just the
8019 max size.
8020 """
8021 return _core_.Window_SetMaxSize(*args, **kwargs)
8022
8023 def GetMinWidth(*args, **kwargs):
8024 """GetMinWidth(self) -> int"""
8025 return _core_.Window_GetMinWidth(*args, **kwargs)
8026
8027 def GetMinHeight(*args, **kwargs):
8028 """GetMinHeight(self) -> int"""
8029 return _core_.Window_GetMinHeight(*args, **kwargs)
8030
8031 def GetMaxWidth(*args, **kwargs):
8032 """GetMaxWidth(self) -> int"""
8033 return _core_.Window_GetMaxWidth(*args, **kwargs)
8034
8035 def GetMaxHeight(*args, **kwargs):
8036 """GetMaxHeight(self) -> int"""
8037 return _core_.Window_GetMaxHeight(*args, **kwargs)
8038
8039 def SetVirtualSize(*args, **kwargs):
8040 """
8041 SetVirtualSize(self, Size size)
8042
8043 Set the the virtual size of a window in pixels. For most windows this
8044 is just the client area of the window, but for some like scrolled
8045 windows it is more or less independent of the screen window size.
8046 """
8047 return _core_.Window_SetVirtualSize(*args, **kwargs)
8048
8049 def SetVirtualSizeWH(*args, **kwargs):
8050 """
8051 SetVirtualSizeWH(self, int w, int h)
8052
8053 Set the the virtual size of a window in pixels. For most windows this
8054 is just the client area of the window, but for some like scrolled
8055 windows it is more or less independent of the screen window size.
8056 """
8057 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8058
8059 def GetVirtualSize(*args, **kwargs):
8060 """
8061 GetVirtualSize(self) -> Size
8062
8063 Get the the virtual size of the window in pixels. For most windows
8064 this is just the client area of the window, but for some like scrolled
8065 windows it is more or less independent of the screen window size.
8066 """
8067 return _core_.Window_GetVirtualSize(*args, **kwargs)
8068
8069 def GetVirtualSizeTuple(*args, **kwargs):
8070 """
8071 GetVirtualSizeTuple() -> (width, height)
8072
8073 Get the the virtual size of the window in pixels. For most windows
8074 this is just the client area of the window, but for some like scrolled
8075 windows it is more or less independent of the screen window size.
8076 """
8077 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8078
8079 def GetBestVirtualSize(*args, **kwargs):
8080 """
8081 GetBestVirtualSize(self) -> Size
8082
8083 Return the largest of ClientSize and BestSize (as determined by a
8084 sizer, interior children, or other means)
8085 """
8086 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8087
8088 def Show(*args, **kwargs):
8089 """
8090 Show(self, bool show=True) -> bool
8091
8092 Shows or hides the window. You may need to call Raise for a top level
8093 window if you want to bring it to top, although this is not needed if
8094 Show is called immediately after the frame creation. Returns True if
8095 the window has been shown or hidden or False if nothing was done
8096 because it already was in the requested state.
8097 """
8098 return _core_.Window_Show(*args, **kwargs)
8099
8100 def Hide(*args, **kwargs):
8101 """
8102 Hide(self) -> bool
8103
8104 Equivalent to calling Show(False).
8105 """
8106 return _core_.Window_Hide(*args, **kwargs)
8107
8108 def Enable(*args, **kwargs):
8109 """
8110 Enable(self, bool enable=True) -> bool
8111
8112 Enable or disable the window for user input. Note that when a parent
8113 window is disabled, all of its children are disabled as well and they
8114 are reenabled again when the parent is. Returns true if the window
8115 has been enabled or disabled, false if nothing was done, i.e. if the
8116 window had already been in the specified state.
8117 """
8118 return _core_.Window_Enable(*args, **kwargs)
8119
8120 def Disable(*args, **kwargs):
8121 """
8122 Disable(self) -> bool
8123
8124 Disables the window, same as Enable(false).
8125 """
8126 return _core_.Window_Disable(*args, **kwargs)
8127
8128 def IsShown(*args, **kwargs):
8129 """
8130 IsShown(self) -> bool
8131
8132 Returns true if the window is shown, false if it has been hidden.
8133 """
8134 return _core_.Window_IsShown(*args, **kwargs)
8135
8136 def IsEnabled(*args, **kwargs):
8137 """
8138 IsEnabled(self) -> bool
8139
8140 Returns true if the window is enabled for input, false otherwise.
8141 """
8142 return _core_.Window_IsEnabled(*args, **kwargs)
8143
8144 def SetWindowStyleFlag(*args, **kwargs):
8145 """
8146 SetWindowStyleFlag(self, long style)
8147
8148 Sets the style of the window. Please note that some styles cannot be
8149 changed after the window creation and that Refresh() might need to be
8150 called after changing the others for the change to take place
8151 immediately.
8152 """
8153 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8154
8155 def GetWindowStyleFlag(*args, **kwargs):
8156 """
8157 GetWindowStyleFlag(self) -> long
8158
8159 Gets the window style that was passed to the constructor or Create
8160 method.
8161 """
8162 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8163
8164 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8165 def HasFlag(*args, **kwargs):
8166 """
8167 HasFlag(self, int flag) -> bool
8168
8169 Test if the given style is set for this window.
8170 """
8171 return _core_.Window_HasFlag(*args, **kwargs)
8172
8173 def IsRetained(*args, **kwargs):
8174 """
8175 IsRetained(self) -> bool
8176
8177 Returns true if the window is retained, false otherwise. Retained
8178 windows are only available on X platforms.
8179 """
8180 return _core_.Window_IsRetained(*args, **kwargs)
8181
8182 def SetExtraStyle(*args, **kwargs):
8183 """
8184 SetExtraStyle(self, long exStyle)
8185
8186 Sets the extra style bits for the window. Extra styles are the less
8187 often used style bits which can't be set with the constructor or with
8188 SetWindowStyleFlag()
8189 """
8190 return _core_.Window_SetExtraStyle(*args, **kwargs)
8191
8192 def GetExtraStyle(*args, **kwargs):
8193 """
8194 GetExtraStyle(self) -> long
8195
8196 Returns the extra style bits for the window.
8197 """
8198 return _core_.Window_GetExtraStyle(*args, **kwargs)
8199
8200 def MakeModal(*args, **kwargs):
8201 """
8202 MakeModal(self, bool modal=True)
8203
8204 Disables all other windows in the application so that the user can
8205 only interact with this window. Passing False will reverse this
8206 effect.
8207 """
8208 return _core_.Window_MakeModal(*args, **kwargs)
8209
8210 def SetThemeEnabled(*args, **kwargs):
8211 """
8212 SetThemeEnabled(self, bool enableTheme)
8213
8214 This function tells a window if it should use the system's "theme"
8215 code to draw the windows' background instead if its own background
8216 drawing code. This will only have an effect on platforms that support
8217 the notion of themes in user defined windows. One such platform is
8218 GTK+ where windows can have (very colourful) backgrounds defined by a
8219 user's selected theme.
8220
8221 Dialogs, notebook pages and the status bar have this flag set to true
8222 by default so that the default look and feel is simulated best.
8223 """
8224 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8225
8226 def GetThemeEnabled(*args, **kwargs):
8227 """
8228 GetThemeEnabled(self) -> bool
8229
8230 Return the themeEnabled flag.
8231 """
8232 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8233
8234 def SetFocus(*args, **kwargs):
8235 """
8236 SetFocus(self)
8237
8238 Set's the focus to this window, allowing it to receive keyboard input.
8239 """
8240 return _core_.Window_SetFocus(*args, **kwargs)
8241
8242 def SetFocusFromKbd(*args, **kwargs):
8243 """
8244 SetFocusFromKbd(self)
8245
8246 Set focus to this window as the result of a keyboard action. Normally
8247 only called internally.
8248 """
8249 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8250
8251 def FindFocus(*args, **kwargs):
8252 """
8253 FindFocus() -> Window
8254
8255 Returns the window or control that currently has the keyboard focus,
8256 or None.
8257 """
8258 return _core_.Window_FindFocus(*args, **kwargs)
8259
8260 FindFocus = staticmethod(FindFocus)
8261 def AcceptsFocus(*args, **kwargs):
8262 """
8263 AcceptsFocus(self) -> bool
8264
8265 Can this window have focus?
8266 """
8267 return _core_.Window_AcceptsFocus(*args, **kwargs)
8268
8269 def AcceptsFocusFromKeyboard(*args, **kwargs):
8270 """
8271 AcceptsFocusFromKeyboard(self) -> bool
8272
8273 Can this window be given focus by keyboard navigation? if not, the
8274 only way to give it focus (provided it accepts it at all) is to click
8275 it.
8276 """
8277 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8278
8279 def GetDefaultItem(*args, **kwargs):
8280 """
8281 GetDefaultItem(self) -> Window
8282
8283 Get the default child of this parent, i.e. the one which is activated
8284 by pressing <Enter> such as the OK button on a wx.Dialog.
8285 """
8286 return _core_.Window_GetDefaultItem(*args, **kwargs)
8287
8288 def SetDefaultItem(*args, **kwargs):
8289 """
8290 SetDefaultItem(self, Window child) -> Window
8291
8292 Set this child as default, return the old default.
8293 """
8294 return _core_.Window_SetDefaultItem(*args, **kwargs)
8295
8296 def SetTmpDefaultItem(*args, **kwargs):
8297 """
8298 SetTmpDefaultItem(self, Window win)
8299
8300 Set this child as temporary default
8301 """
8302 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8303
8304 def Navigate(*args, **kwargs):
8305 """
8306 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8307
8308 Does keyboard navigation from this window to another, by sending a
8309 `wx.NavigationKeyEvent`.
8310 """
8311 return _core_.Window_Navigate(*args, **kwargs)
8312
8313 def MoveAfterInTabOrder(*args, **kwargs):
8314 """
8315 MoveAfterInTabOrder(self, Window win)
8316
8317 Moves this window in the tab navigation order after the specified
8318 sibling window. This means that when the user presses the TAB key on
8319 that other window, the focus switches to this window.
8320
8321 The default tab order is the same as creation order. This function
8322 and `MoveBeforeInTabOrder` allow to change it after creating all the
8323 windows.
8324
8325 """
8326 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8327
8328 def MoveBeforeInTabOrder(*args, **kwargs):
8329 """
8330 MoveBeforeInTabOrder(self, Window win)
8331
8332 Same as `MoveAfterInTabOrder` except that it inserts this window just
8333 before win instead of putting it right after it.
8334 """
8335 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8336
8337 def GetChildren(*args, **kwargs):
8338 """
8339 GetChildren(self) -> PyObject
8340
8341 Returns a list of the window's children. NOTE: Currently this is a
8342 copy of the child window list maintained by the window, so the return
8343 value of this function is only valid as long as the window's children
8344 do not change.
8345 """
8346 return _core_.Window_GetChildren(*args, **kwargs)
8347
8348 def GetParent(*args, **kwargs):
8349 """
8350 GetParent(self) -> Window
8351
8352 Returns the parent window of this window, or None if there isn't one.
8353 """
8354 return _core_.Window_GetParent(*args, **kwargs)
8355
8356 def GetGrandParent(*args, **kwargs):
8357 """
8358 GetGrandParent(self) -> Window
8359
8360 Returns the parent of the parent of this window, or None if there
8361 isn't one.
8362 """
8363 return _core_.Window_GetGrandParent(*args, **kwargs)
8364
8365 def IsTopLevel(*args, **kwargs):
8366 """
8367 IsTopLevel(self) -> bool
8368
8369 Returns true if the given window is a top-level one. Currently all
8370 frames and dialogs are always considered to be top-level windows (even
8371 if they have a parent window).
8372 """
8373 return _core_.Window_IsTopLevel(*args, **kwargs)
8374
8375 def Reparent(*args, **kwargs):
8376 """
8377 Reparent(self, Window newParent) -> bool
8378
8379 Reparents the window, i.e the window will be removed from its current
8380 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8381 re-inserted into another. Available on Windows and GTK. Returns True
8382 if the parent was changed, False otherwise (error or newParent ==
8383 oldParent)
8384 """
8385 return _core_.Window_Reparent(*args, **kwargs)
8386
8387 def AddChild(*args, **kwargs):
8388 """
8389 AddChild(self, Window child)
8390
8391 Adds a child window. This is called automatically by window creation
8392 functions so should not be required by the application programmer.
8393 """
8394 return _core_.Window_AddChild(*args, **kwargs)
8395
8396 def RemoveChild(*args, **kwargs):
8397 """
8398 RemoveChild(self, Window child)
8399
8400 Removes a child window. This is called automatically by window
8401 deletion functions so should not be required by the application
8402 programmer.
8403 """
8404 return _core_.Window_RemoveChild(*args, **kwargs)
8405
8406 def FindWindowById(*args, **kwargs):
8407 """
8408 FindWindowById(self, long winid) -> Window
8409
8410 Find a chld of this window by window ID
8411 """
8412 return _core_.Window_FindWindowById(*args, **kwargs)
8413
8414 def FindWindowByName(*args, **kwargs):
8415 """
8416 FindWindowByName(self, String name) -> Window
8417
8418 Find a child of this window by name
8419 """
8420 return _core_.Window_FindWindowByName(*args, **kwargs)
8421
8422 def GetEventHandler(*args, **kwargs):
8423 """
8424 GetEventHandler(self) -> EvtHandler
8425
8426 Returns the event handler for this window. By default, the window is
8427 its own event handler.
8428 """
8429 return _core_.Window_GetEventHandler(*args, **kwargs)
8430
8431 def SetEventHandler(*args, **kwargs):
8432 """
8433 SetEventHandler(self, EvtHandler handler)
8434
8435 Sets the event handler for this window. An event handler is an object
8436 that is capable of processing the events sent to a window. By default,
8437 the window is its own event handler, but an application may wish to
8438 substitute another, for example to allow central implementation of
8439 event-handling for a variety of different window classes.
8440
8441 It is usually better to use `wx.Window.PushEventHandler` since this sets
8442 up a chain of event handlers, where an event not handled by one event
8443 handler is handed to the next one in the chain.
8444 """
8445 return _core_.Window_SetEventHandler(*args, **kwargs)
8446
8447 def PushEventHandler(*args, **kwargs):
8448 """
8449 PushEventHandler(self, EvtHandler handler)
8450
8451 Pushes this event handler onto the event handler stack for the window.
8452 An event handler is an object that is capable of processing the events
8453 sent to a window. By default, the window is its own event handler, but
8454 an application may wish to substitute another, for example to allow
8455 central implementation of event-handling for a variety of different
8456 window classes.
8457
8458 wx.Window.PushEventHandler allows an application to set up a chain of
8459 event handlers, where an event not handled by one event handler is
8460 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8461 remove the event handler.
8462 """
8463 return _core_.Window_PushEventHandler(*args, **kwargs)
8464
8465 def PopEventHandler(*args, **kwargs):
8466 """
8467 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8468
8469 Removes and returns the top-most event handler on the event handler
8470 stack. If deleteHandler is True then the wx.EvtHandler object will be
8471 destroyed after it is popped.
8472 """
8473 return _core_.Window_PopEventHandler(*args, **kwargs)
8474
8475 def RemoveEventHandler(*args, **kwargs):
8476 """
8477 RemoveEventHandler(self, EvtHandler handler) -> bool
8478
8479 Find the given handler in the event handler chain and remove (but not
8480 delete) it from the event handler chain, return True if it was found
8481 and False otherwise (this also results in an assert failure so this
8482 function should only be called when the handler is supposed to be
8483 there.)
8484 """
8485 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8486
8487 def SetValidator(*args, **kwargs):
8488 """
8489 SetValidator(self, Validator validator)
8490
8491 Deletes the current validator (if any) and sets the window validator,
8492 having called wx.Validator.Clone to create a new validator of this
8493 type.
8494 """
8495 return _core_.Window_SetValidator(*args, **kwargs)
8496
8497 def GetValidator(*args, **kwargs):
8498 """
8499 GetValidator(self) -> Validator
8500
8501 Returns a pointer to the current validator for the window, or None if
8502 there is none.
8503 """
8504 return _core_.Window_GetValidator(*args, **kwargs)
8505
8506 def Validate(*args, **kwargs):
8507 """
8508 Validate(self) -> bool
8509
8510 Validates the current values of the child controls using their
8511 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8512 style flag set, the method will also call Validate() of all child
8513 windows. Returns false if any of the validations failed.
8514 """
8515 return _core_.Window_Validate(*args, **kwargs)
8516
8517 def TransferDataToWindow(*args, **kwargs):
8518 """
8519 TransferDataToWindow(self) -> bool
8520
8521 Transfers values to child controls from data areas specified by their
8522 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8523 style flag set, the method will also call TransferDataToWindow() of
8524 all child windows.
8525 """
8526 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8527
8528 def TransferDataFromWindow(*args, **kwargs):
8529 """
8530 TransferDataFromWindow(self) -> bool
8531
8532 Transfers values from child controls to data areas specified by their
8533 validators. Returns false if a transfer failed. If the window has
8534 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8535 also call TransferDataFromWindow() of all child windows.
8536 """
8537 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8538
8539 def InitDialog(*args, **kwargs):
8540 """
8541 InitDialog(self)
8542
8543 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8544 to the dialog via validators.
8545 """
8546 return _core_.Window_InitDialog(*args, **kwargs)
8547
8548 def SetAcceleratorTable(*args, **kwargs):
8549 """
8550 SetAcceleratorTable(self, AcceleratorTable accel)
8551
8552 Sets the accelerator table for this window.
8553 """
8554 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8555
8556 def GetAcceleratorTable(*args, **kwargs):
8557 """
8558 GetAcceleratorTable(self) -> AcceleratorTable
8559
8560 Gets the accelerator table for this window.
8561 """
8562 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8563
8564 def RegisterHotKey(*args, **kwargs):
8565 """
8566 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8567
8568 Registers a system wide hotkey. Every time the user presses the hotkey
8569 registered here, this window will receive a hotkey event. It will
8570 receive the event even if the application is in the background and
8571 does not have the input focus because the user is working with some
8572 other application. To bind an event handler function to this hotkey
8573 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8574 hotkey was registered successfully.
8575 """
8576 return _core_.Window_RegisterHotKey(*args, **kwargs)
8577
8578 def UnregisterHotKey(*args, **kwargs):
8579 """
8580 UnregisterHotKey(self, int hotkeyId) -> bool
8581
8582 Unregisters a system wide hotkey.
8583 """
8584 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8585
8586 def ConvertDialogPointToPixels(*args, **kwargs):
8587 """
8588 ConvertDialogPointToPixels(self, Point pt) -> Point
8589
8590 Converts a point or size from dialog units to pixels. Dialog units
8591 are used for maintaining a dialog's proportions even if the font
8592 changes. For the x dimension, the dialog units are multiplied by the
8593 average character width and then divided by 4. For the y dimension,
8594 the dialog units are multiplied by the average character height and
8595 then divided by 8.
8596 """
8597 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8598
8599 def ConvertDialogSizeToPixels(*args, **kwargs):
8600 """
8601 ConvertDialogSizeToPixels(self, Size sz) -> Size
8602
8603 Converts a point or size from dialog units to pixels. Dialog units
8604 are used for maintaining a dialog's proportions even if the font
8605 changes. For the x dimension, the dialog units are multiplied by the
8606 average character width and then divided by 4. For the y dimension,
8607 the dialog units are multiplied by the average character height and
8608 then divided by 8.
8609 """
8610 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8611
8612 def DLG_PNT(*args, **kwargs):
8613 """
8614 DLG_PNT(self, Point pt) -> Point
8615
8616 Converts a point or size from dialog units to pixels. Dialog units
8617 are used for maintaining a dialog's proportions even if the font
8618 changes. For the x dimension, the dialog units are multiplied by the
8619 average character width and then divided by 4. For the y dimension,
8620 the dialog units are multiplied by the average character height and
8621 then divided by 8.
8622 """
8623 return _core_.Window_DLG_PNT(*args, **kwargs)
8624
8625 def DLG_SZE(*args, **kwargs):
8626 """
8627 DLG_SZE(self, Size sz) -> Size
8628
8629 Converts a point or size from dialog units to pixels. Dialog units
8630 are used for maintaining a dialog's proportions even if the font
8631 changes. For the x dimension, the dialog units are multiplied by the
8632 average character width and then divided by 4. For the y dimension,
8633 the dialog units are multiplied by the average character height and
8634 then divided by 8.
8635 """
8636 return _core_.Window_DLG_SZE(*args, **kwargs)
8637
8638 def ConvertPixelPointToDialog(*args, **kwargs):
8639 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8640 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8641
8642 def ConvertPixelSizeToDialog(*args, **kwargs):
8643 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8644 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8645
8646 def WarpPointer(*args, **kwargs):
8647 """
8648 WarpPointer(self, int x, int y)
8649
8650 Moves the pointer to the given position on the window.
8651
8652 NOTE: This function is not supported under Mac because Apple Human
8653 Interface Guidelines forbid moving the mouse cursor programmatically.
8654 """
8655 return _core_.Window_WarpPointer(*args, **kwargs)
8656
8657 def CaptureMouse(*args, **kwargs):
8658 """
8659 CaptureMouse(self)
8660
8661 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8662 release the capture.
8663
8664 Note that wxWindows maintains the stack of windows having captured the
8665 mouse and when the mouse is released the capture returns to the window
8666 which had had captured it previously and it is only really released if
8667 there were no previous window. In particular, this means that you must
8668 release the mouse as many times as you capture it.
8669 """
8670 return _core_.Window_CaptureMouse(*args, **kwargs)
8671
8672 def ReleaseMouse(*args, **kwargs):
8673 """
8674 ReleaseMouse(self)
8675
8676 Releases mouse input captured with wx.Window.CaptureMouse.
8677 """
8678 return _core_.Window_ReleaseMouse(*args, **kwargs)
8679
8680 def GetCapture(*args, **kwargs):
8681 """
8682 GetCapture() -> Window
8683
8684 Returns the window which currently captures the mouse or None
8685 """
8686 return _core_.Window_GetCapture(*args, **kwargs)
8687
8688 GetCapture = staticmethod(GetCapture)
8689 def HasCapture(*args, **kwargs):
8690 """
8691 HasCapture(self) -> bool
8692
8693 Returns true if this window has the current mouse capture.
8694 """
8695 return _core_.Window_HasCapture(*args, **kwargs)
8696
8697 def Refresh(*args, **kwargs):
8698 """
8699 Refresh(self, bool eraseBackground=True, Rect rect=None)
8700
8701 Mark the specified rectangle (or the whole window) as "dirty" so it
8702 will be repainted. Causes an EVT_PAINT event to be generated and sent
8703 to the window.
8704 """
8705 return _core_.Window_Refresh(*args, **kwargs)
8706
8707 def RefreshRect(*args, **kwargs):
8708 """
8709 RefreshRect(self, Rect rect, bool eraseBackground=True)
8710
8711 Redraws the contents of the given rectangle: the area inside it will
8712 be repainted. This is the same as Refresh but has a nicer syntax.
8713 """
8714 return _core_.Window_RefreshRect(*args, **kwargs)
8715
8716 def Update(*args, **kwargs):
8717 """
8718 Update(self)
8719
8720 Calling this method immediately repaints the invalidated area of the
8721 window instead of waiting for the EVT_PAINT event to happen, (normally
8722 this would usually only happen when the flow of control returns to the
8723 event loop.) Notice that this function doesn't refresh the window and
8724 does nothing if the window has been already repainted. Use Refresh
8725 first if you want to immediately redraw the window (or some portion of
8726 it) unconditionally.
8727 """
8728 return _core_.Window_Update(*args, **kwargs)
8729
8730 def ClearBackground(*args, **kwargs):
8731 """
8732 ClearBackground(self)
8733
8734 Clears the window by filling it with the current background
8735 colour. Does not cause an erase background event to be generated.
8736 """
8737 return _core_.Window_ClearBackground(*args, **kwargs)
8738
8739 def Freeze(*args, **kwargs):
8740 """
8741 Freeze(self)
8742
8743 Freezes the window or, in other words, prevents any updates from
8744 taking place on screen, the window is not redrawn at all. Thaw must be
8745 called to reenable window redrawing. Calls to Freeze/Thaw may be
8746 nested, with the actual Thaw being delayed until all the nesting has
8747 been undone.
8748
8749 This method is useful for visual appearance optimization (for example,
8750 it is a good idea to use it before inserting large amount of text into
8751 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8752 for all controls so it is mostly just a hint to wxWindows and not a
8753 mandatory directive.
8754 """
8755 return _core_.Window_Freeze(*args, **kwargs)
8756
8757 def Thaw(*args, **kwargs):
8758 """
8759 Thaw(self)
8760
8761 Reenables window updating after a previous call to Freeze. Calls to
8762 Freeze/Thaw may be nested, so Thaw must be called the same number of
8763 times that Freeze was before the window will be updated.
8764 """
8765 return _core_.Window_Thaw(*args, **kwargs)
8766
8767 def PrepareDC(*args, **kwargs):
8768 """
8769 PrepareDC(self, DC dc)
8770
8771 Call this function to prepare the device context for drawing a
8772 scrolled image. It sets the device origin according to the current
8773 scroll position.
8774 """
8775 return _core_.Window_PrepareDC(*args, **kwargs)
8776
8777 def GetUpdateRegion(*args, **kwargs):
8778 """
8779 GetUpdateRegion(self) -> Region
8780
8781 Returns the region specifying which parts of the window have been
8782 damaged. Should only be called within an EVT_PAINT handler.
8783 """
8784 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8785
8786 def GetUpdateClientRect(*args, **kwargs):
8787 """
8788 GetUpdateClientRect(self) -> Rect
8789
8790 Get the update rectangle region bounding box in client coords.
8791 """
8792 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8793
8794 def IsExposed(*args, **kwargs):
8795 """
8796 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8797
8798 Returns true if the given point or rectangle area has been exposed
8799 since the last repaint. Call this in an paint event handler to
8800 optimize redrawing by only redrawing those areas, which have been
8801 exposed.
8802 """
8803 return _core_.Window_IsExposed(*args, **kwargs)
8804
8805 def IsExposedPoint(*args, **kwargs):
8806 """
8807 IsExposedPoint(self, Point pt) -> bool
8808
8809 Returns true if the given point or rectangle area has been exposed
8810 since the last repaint. Call this in an paint event handler to
8811 optimize redrawing by only redrawing those areas, which have been
8812 exposed.
8813 """
8814 return _core_.Window_IsExposedPoint(*args, **kwargs)
8815
8816 def IsExposedRect(*args, **kwargs):
8817 """
8818 IsExposedRect(self, Rect rect) -> bool
8819
8820 Returns true if the given point or rectangle area has been exposed
8821 since the last repaint. Call this in an paint event handler to
8822 optimize redrawing by only redrawing those areas, which have been
8823 exposed.
8824 """
8825 return _core_.Window_IsExposedRect(*args, **kwargs)
8826
8827 def GetDefaultAttributes(*args, **kwargs):
8828 """
8829 GetDefaultAttributes(self) -> VisualAttributes
8830
8831 Get the default attributes for an instance of this class. This is
8832 useful if you want to use the same font or colour in your own control
8833 as in a standard control -- which is a much better idea than hard
8834 coding specific colours or fonts which might look completely out of
8835 place on the user's system, especially if it uses themes.
8836 """
8837 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8838
8839 def GetClassDefaultAttributes(*args, **kwargs):
8840 """
8841 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8842
8843 Get the default attributes for this class. This is useful if you want
8844 to use the same font or colour in your own control as in a standard
8845 control -- which is a much better idea than hard coding specific
8846 colours or fonts which might look completely out of place on the
8847 user's system, especially if it uses themes.
8848
8849 The variant parameter is only relevant under Mac currently and is
8850 ignore under other platforms. Under Mac, it will change the size of
8851 the returned font. See `wx.Window.SetWindowVariant` for more about
8852 this.
8853 """
8854 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8855
8856 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8857 def SetBackgroundColour(*args, **kwargs):
8858 """
8859 SetBackgroundColour(self, Colour colour) -> bool
8860
8861 Sets the background colour of the window. Returns True if the colour
8862 was changed. The background colour is usually painted by the default
8863 EVT_ERASE_BACKGROUND event handler function under Windows and
8864 automatically under GTK. Using `wx.NullColour` will reset the window
8865 to the default background colour.
8866
8867 Note that setting the background colour may not cause an immediate
8868 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8869 calling this function.
8870
8871 Using this function will disable attempts to use themes for this
8872 window, if the system supports them. Use with care since usually the
8873 themes represent the appearance chosen by the user to be used for all
8874 applications on the system.
8875 """
8876 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8877
8878 def SetOwnBackgroundColour(*args, **kwargs):
8879 """SetOwnBackgroundColour(self, Colour colour)"""
8880 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8881
8882 def SetForegroundColour(*args, **kwargs):
8883 """
8884 SetForegroundColour(self, Colour colour) -> bool
8885
8886 Sets the foreground colour of the window. Returns True is the colour
8887 was changed. The interpretation of foreground colour is dependent on
8888 the window class; it may be the text colour or other colour, or it may
8889 not be used at all.
8890 """
8891 return _core_.Window_SetForegroundColour(*args, **kwargs)
8892
8893 def SetOwnForegroundColour(*args, **kwargs):
8894 """SetOwnForegroundColour(self, Colour colour)"""
8895 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8896
8897 def GetBackgroundColour(*args, **kwargs):
8898 """
8899 GetBackgroundColour(self) -> Colour
8900
8901 Returns the background colour of the window.
8902 """
8903 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8904
8905 def GetForegroundColour(*args, **kwargs):
8906 """
8907 GetForegroundColour(self) -> Colour
8908
8909 Returns the foreground colour of the window. The interpretation of
8910 foreground colour is dependent on the window class; it may be the text
8911 colour or other colour, or it may not be used at all.
8912 """
8913 return _core_.Window_GetForegroundColour(*args, **kwargs)
8914
8915 def InheritsBackgroundColour(*args, **kwargs):
8916 """InheritsBackgroundColour(self) -> bool"""
8917 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8918
8919 def UseBgCol(*args, **kwargs):
8920 """UseBgCol(self) -> bool"""
8921 return _core_.Window_UseBgCol(*args, **kwargs)
8922
8923 def SetBackgroundStyle(*args, **kwargs):
8924 """
8925 SetBackgroundStyle(self, int style) -> bool
8926
8927 Returns the background style of the window. The background style
8928 indicates how the background of the window is drawn.
8929
8930 ====================== ========================================
8931 wx.BG_STYLE_SYSTEM The background colour or pattern should
8932 be determined by the system
8933 wx.BG_STYLE_COLOUR The background should be a solid colour
8934 wx.BG_STYLE_CUSTOM The background will be implemented by the
8935 application.
8936 ====================== ========================================
8937
8938 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8939 a custom background, such as a tiled bitmap. Currently the style has
8940 no effect on other platforms.
8941
8942 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8943 """
8944 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8945
8946 def GetBackgroundStyle(*args, **kwargs):
8947 """
8948 GetBackgroundStyle(self) -> int
8949
8950 Returns the background style of the window.
8951
8952 :see: `SetBackgroundStyle`
8953 """
8954 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8955
8956 def HasTransparentBackground(*args, **kwargs):
8957 """
8958 HasTransparentBackground(self) -> bool
8959
8960 Returns True if this window's background is transparent (as, for
8961 example, for `wx.StaticText`) and should show the parent window's
8962 background.
8963
8964 This method is mostly used internally by the library itself and you
8965 normally shouldn't have to call it. You may, however, have to override
8966 it in your custom control classes to ensure that background is painted
8967 correctly.
8968 """
8969 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8970
8971 def SetCursor(*args, **kwargs):
8972 """
8973 SetCursor(self, Cursor cursor) -> bool
8974
8975 Sets the window's cursor. Notice that the window cursor also sets it
8976 for the children of the window implicitly.
8977
8978 The cursor may be wx.NullCursor in which case the window cursor will
8979 be reset back to default.
8980 """
8981 return _core_.Window_SetCursor(*args, **kwargs)
8982
8983 def GetCursor(*args, **kwargs):
8984 """
8985 GetCursor(self) -> Cursor
8986
8987 Return the cursor associated with this window.
8988 """
8989 return _core_.Window_GetCursor(*args, **kwargs)
8990
8991 def SetFont(*args, **kwargs):
8992 """
8993 SetFont(self, Font font) -> bool
8994
8995 Sets the font for this window.
8996 """
8997 return _core_.Window_SetFont(*args, **kwargs)
8998
8999 def SetOwnFont(*args, **kwargs):
9000 """SetOwnFont(self, Font font)"""
9001 return _core_.Window_SetOwnFont(*args, **kwargs)
9002
9003 def GetFont(*args, **kwargs):
9004 """
9005 GetFont(self) -> Font
9006
9007 Returns the default font used for this window.
9008 """
9009 return _core_.Window_GetFont(*args, **kwargs)
9010
9011 def SetCaret(*args, **kwargs):
9012 """
9013 SetCaret(self, Caret caret)
9014
9015 Sets the caret associated with the window.
9016 """
9017 return _core_.Window_SetCaret(*args, **kwargs)
9018
9019 def GetCaret(*args, **kwargs):
9020 """
9021 GetCaret(self) -> Caret
9022
9023 Returns the caret associated with the window.
9024 """
9025 return _core_.Window_GetCaret(*args, **kwargs)
9026
9027 def GetCharHeight(*args, **kwargs):
9028 """
9029 GetCharHeight(self) -> int
9030
9031 Get the (average) character size for the current font.
9032 """
9033 return _core_.Window_GetCharHeight(*args, **kwargs)
9034
9035 def GetCharWidth(*args, **kwargs):
9036 """
9037 GetCharWidth(self) -> int
9038
9039 Get the (average) character size for the current font.
9040 """
9041 return _core_.Window_GetCharWidth(*args, **kwargs)
9042
9043 def GetTextExtent(*args, **kwargs):
9044 """
9045 GetTextExtent(String string) -> (width, height)
9046
9047 Get the width and height of the text using the current font.
9048 """
9049 return _core_.Window_GetTextExtent(*args, **kwargs)
9050
9051 def GetFullTextExtent(*args, **kwargs):
9052 """
9053 GetFullTextExtent(String string, Font font=None) ->
9054 (width, height, descent, externalLeading)
9055
9056 Get the width, height, decent and leading of the text using the
9057 current or specified font.
9058 """
9059 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9060
9061 def ClientToScreenXY(*args, **kwargs):
9062 """
9063 ClientToScreenXY(int x, int y) -> (x,y)
9064
9065 Converts to screen coordinates from coordinates relative to this window.
9066 """
9067 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9068
9069 def ScreenToClientXY(*args, **kwargs):
9070 """
9071 ScreenToClientXY(int x, int y) -> (x,y)
9072
9073 Converts from screen to client window coordinates.
9074 """
9075 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9076
9077 def ClientToScreen(*args, **kwargs):
9078 """
9079 ClientToScreen(self, Point pt) -> Point
9080
9081 Converts to screen coordinates from coordinates relative to this window.
9082 """
9083 return _core_.Window_ClientToScreen(*args, **kwargs)
9084
9085 def ScreenToClient(*args, **kwargs):
9086 """
9087 ScreenToClient(self, Point pt) -> Point
9088
9089 Converts from screen to client window coordinates.
9090 """
9091 return _core_.Window_ScreenToClient(*args, **kwargs)
9092
9093 def HitTestXY(*args, **kwargs):
9094 """
9095 HitTestXY(self, int x, int y) -> int
9096
9097 Test where the given (in client coords) point lies
9098 """
9099 return _core_.Window_HitTestXY(*args, **kwargs)
9100
9101 def HitTest(*args, **kwargs):
9102 """
9103 HitTest(self, Point pt) -> int
9104
9105 Test where the given (in client coords) point lies
9106 """
9107 return _core_.Window_HitTest(*args, **kwargs)
9108
9109 def GetBorder(*args):
9110 """
9111 GetBorder(self, long flags) -> int
9112 GetBorder(self) -> int
9113
9114 Get border for the flags of this window
9115 """
9116 return _core_.Window_GetBorder(*args)
9117
9118 def UpdateWindowUI(*args, **kwargs):
9119 """
9120 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9121
9122 This function sends EVT_UPDATE_UI events to the window. The particular
9123 implementation depends on the window; for example a wx.ToolBar will
9124 send an update UI event for each toolbar button, and a wx.Frame will
9125 send an update UI event for each menubar menu item. You can call this
9126 function from your application to ensure that your UI is up-to-date at
9127 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9128 concerned). This may be necessary if you have called
9129 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9130 limit the overhead that wxWindows incurs by sending update UI events
9131 in idle time.
9132 """
9133 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9134
9135 def PopupMenuXY(*args, **kwargs):
9136 """
9137 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9138
9139 Pops up the given menu at the specified coordinates, relative to this window,
9140 and returns control when the user has dismissed the menu. If a menu item is
9141 selected, the corresponding menu event is generated and will be processed as
9142 usual. If the default position is given then the current position of the
9143 mouse cursor will be used.
9144 """
9145 return _core_.Window_PopupMenuXY(*args, **kwargs)
9146
9147 def PopupMenu(*args, **kwargs):
9148 """
9149 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9150
9151 Pops up the given menu at the specified coordinates, relative to this window,
9152 and returns control when the user has dismissed the menu. If a menu item is
9153 selected, the corresponding menu event is generated and will be processed as
9154 usual. If the default position is given then the current position of the
9155 mouse cursor will be used.
9156 """
9157 return _core_.Window_PopupMenu(*args, **kwargs)
9158
9159 def GetHandle(*args, **kwargs):
9160 """
9161 GetHandle(self) -> long
9162
9163 Returns the platform-specific handle (as a long integer) of the
9164 physical window. Currently on wxMac it returns the handle of the
9165 toplevel parent of the window.
9166 """
9167 return _core_.Window_GetHandle(*args, **kwargs)
9168
9169 def AssociateHandle(*args, **kwargs):
9170 """
9171 AssociateHandle(self, long handle)
9172
9173 Associate the window with a new native handle
9174 """
9175 return _core_.Window_AssociateHandle(*args, **kwargs)
9176
9177 def DissociateHandle(*args, **kwargs):
9178 """
9179 DissociateHandle(self)
9180
9181 Dissociate the current native handle from the window
9182 """
9183 return _core_.Window_DissociateHandle(*args, **kwargs)
9184
9185 def HasScrollbar(*args, **kwargs):
9186 """
9187 HasScrollbar(self, int orient) -> bool
9188
9189 Does the window have the scrollbar for this orientation?
9190 """
9191 return _core_.Window_HasScrollbar(*args, **kwargs)
9192
9193 def SetScrollbar(*args, **kwargs):
9194 """
9195 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9196 bool refresh=True)
9197
9198 Sets the scrollbar properties of a built-in scrollbar.
9199 """
9200 return _core_.Window_SetScrollbar(*args, **kwargs)
9201
9202 def SetScrollPos(*args, **kwargs):
9203 """
9204 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9205
9206 Sets the position of one of the built-in scrollbars.
9207 """
9208 return _core_.Window_SetScrollPos(*args, **kwargs)
9209
9210 def GetScrollPos(*args, **kwargs):
9211 """
9212 GetScrollPos(self, int orientation) -> int
9213
9214 Returns the built-in scrollbar position.
9215 """
9216 return _core_.Window_GetScrollPos(*args, **kwargs)
9217
9218 def GetScrollThumb(*args, **kwargs):
9219 """
9220 GetScrollThumb(self, int orientation) -> int
9221
9222 Returns the built-in scrollbar thumb size.
9223 """
9224 return _core_.Window_GetScrollThumb(*args, **kwargs)
9225
9226 def GetScrollRange(*args, **kwargs):
9227 """
9228 GetScrollRange(self, int orientation) -> int
9229
9230 Returns the built-in scrollbar range.
9231 """
9232 return _core_.Window_GetScrollRange(*args, **kwargs)
9233
9234 def ScrollWindow(*args, **kwargs):
9235 """
9236 ScrollWindow(self, int dx, int dy, Rect rect=None)
9237
9238 Physically scrolls the pixels in the window and move child windows
9239 accordingly. Use this function to optimise your scrolling
9240 implementations, to minimise the area that must be redrawn. Note that
9241 it is rarely required to call this function from a user program.
9242 """
9243 return _core_.Window_ScrollWindow(*args, **kwargs)
9244
9245 def ScrollLines(*args, **kwargs):
9246 """
9247 ScrollLines(self, int lines) -> bool
9248
9249 If the platform and window class supports it, scrolls the window by
9250 the given number of lines down, if lines is positive, or up if lines
9251 is negative. Returns True if the window was scrolled, False if it was
9252 already on top/bottom and nothing was done.
9253 """
9254 return _core_.Window_ScrollLines(*args, **kwargs)
9255
9256 def ScrollPages(*args, **kwargs):
9257 """
9258 ScrollPages(self, int pages) -> bool
9259
9260 If the platform and window class supports it, scrolls the window by
9261 the given number of pages down, if pages is positive, or up if pages
9262 is negative. Returns True if the window was scrolled, False if it was
9263 already on top/bottom and nothing was done.
9264 """
9265 return _core_.Window_ScrollPages(*args, **kwargs)
9266
9267 def LineUp(*args, **kwargs):
9268 """
9269 LineUp(self) -> bool
9270
9271 This is just a wrapper for ScrollLines(-1).
9272 """
9273 return _core_.Window_LineUp(*args, **kwargs)
9274
9275 def LineDown(*args, **kwargs):
9276 """
9277 LineDown(self) -> bool
9278
9279 This is just a wrapper for ScrollLines(1).
9280 """
9281 return _core_.Window_LineDown(*args, **kwargs)
9282
9283 def PageUp(*args, **kwargs):
9284 """
9285 PageUp(self) -> bool
9286
9287 This is just a wrapper for ScrollPages(-1).
9288 """
9289 return _core_.Window_PageUp(*args, **kwargs)
9290
9291 def PageDown(*args, **kwargs):
9292 """
9293 PageDown(self) -> bool
9294
9295 This is just a wrapper for ScrollPages(1).
9296 """
9297 return _core_.Window_PageDown(*args, **kwargs)
9298
9299 def SetHelpText(*args, **kwargs):
9300 """
9301 SetHelpText(self, String text)
9302
9303 Sets the help text to be used as context-sensitive help for this
9304 window. Note that the text is actually stored by the current
9305 `wx.HelpProvider` implementation, and not in the window object itself.
9306 """
9307 return _core_.Window_SetHelpText(*args, **kwargs)
9308
9309 def SetHelpTextForId(*args, **kwargs):
9310 """
9311 SetHelpTextForId(self, String text)
9312
9313 Associate this help text with all windows with the same id as this
9314 one.
9315 """
9316 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9317
9318 def GetHelpText(*args, **kwargs):
9319 """
9320 GetHelpText(self) -> String
9321
9322 Gets the help text to be used as context-sensitive help for this
9323 window. Note that the text is actually stored by the current
9324 `wx.HelpProvider` implementation, and not in the window object itself.
9325 """
9326 return _core_.Window_GetHelpText(*args, **kwargs)
9327
9328 def SetToolTipString(*args, **kwargs):
9329 """
9330 SetToolTipString(self, String tip)
9331
9332 Attach a tooltip to the window.
9333 """
9334 return _core_.Window_SetToolTipString(*args, **kwargs)
9335
9336 def SetToolTip(*args, **kwargs):
9337 """
9338 SetToolTip(self, ToolTip tip)
9339
9340 Attach a tooltip to the window.
9341 """
9342 return _core_.Window_SetToolTip(*args, **kwargs)
9343
9344 def GetToolTip(*args, **kwargs):
9345 """
9346 GetToolTip(self) -> ToolTip
9347
9348 get the associated tooltip or None if none
9349 """
9350 return _core_.Window_GetToolTip(*args, **kwargs)
9351
9352 def SetDropTarget(*args, **kwargs):
9353 """
9354 SetDropTarget(self, DropTarget dropTarget)
9355
9356 Associates a drop target with this window. If the window already has
9357 a drop target, it is deleted.
9358 """
9359 return _core_.Window_SetDropTarget(*args, **kwargs)
9360
9361 def GetDropTarget(*args, **kwargs):
9362 """
9363 GetDropTarget(self) -> DropTarget
9364
9365 Returns the associated drop target, which may be None.
9366 """
9367 return _core_.Window_GetDropTarget(*args, **kwargs)
9368
9369 def DragAcceptFiles(*args, **kwargs):
9370 """
9371 DragAcceptFiles(self, bool accept)
9372
9373 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9374 Only functional on Windows.
9375 """
9376 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9377
9378 def SetConstraints(*args, **kwargs):
9379 """
9380 SetConstraints(self, LayoutConstraints constraints)
9381
9382 Sets the window to have the given layout constraints. If an existing
9383 layout constraints object is already owned by the window, it will be
9384 deleted. Pass None to disassociate and delete the window's current
9385 constraints.
9386
9387 You must call SetAutoLayout to tell a window to use the constraints
9388 automatically in its default EVT_SIZE handler; otherwise, you must
9389 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9390 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9391 effect.
9392 """
9393 return _core_.Window_SetConstraints(*args, **kwargs)
9394
9395 def GetConstraints(*args, **kwargs):
9396 """
9397 GetConstraints(self) -> LayoutConstraints
9398
9399 Returns a pointer to the window's layout constraints, or None if there
9400 are none.
9401 """
9402 return _core_.Window_GetConstraints(*args, **kwargs)
9403
9404 def SetAutoLayout(*args, **kwargs):
9405 """
9406 SetAutoLayout(self, bool autoLayout)
9407
9408 Determines whether the Layout function will be called automatically
9409 when the window is resized. lease note that this only happens for the
9410 windows usually used to contain children, namely `wx.Panel` and
9411 `wx.TopLevelWindow` (and the classes deriving from them).
9412
9413 This method is called implicitly by `SetSizer` but if you use
9414 `SetConstraints` you should call it manually or otherwise the window
9415 layout won't be correctly updated when its size changes.
9416 """
9417 return _core_.Window_SetAutoLayout(*args, **kwargs)
9418
9419 def GetAutoLayout(*args, **kwargs):
9420 """
9421 GetAutoLayout(self) -> bool
9422
9423 Returns the current autoLayout setting
9424 """
9425 return _core_.Window_GetAutoLayout(*args, **kwargs)
9426
9427 def Layout(*args, **kwargs):
9428 """
9429 Layout(self) -> bool
9430
9431 Invokes the constraint-based layout algorithm or the sizer-based
9432 algorithm for this window. See SetAutoLayout: when auto layout is on,
9433 this function gets called automatically by the default EVT_SIZE
9434 handler when the window is resized.
9435 """
9436 return _core_.Window_Layout(*args, **kwargs)
9437
9438 def SetSizer(*args, **kwargs):
9439 """
9440 SetSizer(self, Sizer sizer, bool deleteOld=True)
9441
9442 Sets the window to have the given layout sizer. The window will then
9443 own the object, and will take care of its deletion. If an existing
9444 layout sizer object is already owned by the window, it will be deleted
9445 if the deleteOld parameter is true. Note that this function will also
9446 call SetAutoLayout implicitly with a True parameter if the sizer is
9447 non-None, and False otherwise.
9448 """
9449 return _core_.Window_SetSizer(*args, **kwargs)
9450
9451 def SetSizerAndFit(*args, **kwargs):
9452 """
9453 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9454
9455 The same as SetSizer, except it also sets the size hints for the
9456 window based on the sizer's minimum size.
9457 """
9458 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9459
9460 def GetSizer(*args, **kwargs):
9461 """
9462 GetSizer(self) -> Sizer
9463
9464 Return the sizer associated with the window by a previous call to
9465 SetSizer or None if there isn't one.
9466 """
9467 return _core_.Window_GetSizer(*args, **kwargs)
9468
9469 def SetContainingSizer(*args, **kwargs):
9470 """
9471 SetContainingSizer(self, Sizer sizer)
9472
9473 This normally does not need to be called by application code. It is
9474 called internally when a window is added to a sizer, and is used so
9475 the window can remove itself from the sizer when it is destroyed.
9476 """
9477 return _core_.Window_SetContainingSizer(*args, **kwargs)
9478
9479 def GetContainingSizer(*args, **kwargs):
9480 """
9481 GetContainingSizer(self) -> Sizer
9482
9483 Return the sizer that this window is a member of, if any, otherwise None.
9484 """
9485 return _core_.Window_GetContainingSizer(*args, **kwargs)
9486
9487 def InheritAttributes(*args, **kwargs):
9488 """
9489 InheritAttributes(self)
9490
9491 This function is (or should be, in case of custom controls) called
9492 during window creation to intelligently set up the window visual
9493 attributes, that is the font and the foreground and background
9494 colours.
9495
9496 By 'intelligently' the following is meant: by default, all windows use
9497 their own default attributes. However if some of the parent's
9498 attributes are explicitly changed (that is, using SetFont and not
9499 SetOwnFont) and if the corresponding attribute hadn't been
9500 explicitly set for this window itself, then this window takes the same
9501 value as used by the parent. In addition, if the window overrides
9502 ShouldInheritColours to return false, the colours will not be changed
9503 no matter what and only the font might.
9504
9505 This rather complicated logic is necessary in order to accommodate the
9506 different usage scenarios. The most common one is when all default
9507 attributes are used and in this case, nothing should be inherited as
9508 in modern GUIs different controls use different fonts (and colours)
9509 than their siblings so they can't inherit the same value from the
9510 parent. However it was also deemed desirable to allow to simply change
9511 the attributes of all children at once by just changing the font or
9512 colour of their common parent, hence in this case we do inherit the
9513 parents attributes.
9514
9515 """
9516 return _core_.Window_InheritAttributes(*args, **kwargs)
9517
9518 def ShouldInheritColours(*args, **kwargs):
9519 """
9520 ShouldInheritColours(self) -> bool
9521
9522 Return true from here to allow the colours of this window to be
9523 changed by InheritAttributes, returning false forbids inheriting them
9524 from the parent window.
9525
9526 The base class version returns false, but this method is overridden in
9527 wxControl where it returns true.
9528 """
9529 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9530
9531 def PostCreate(self, pre):
9532 """
9533 Phase 3 of the 2-phase create <wink!>
9534 Call this method after precreating the window with the 2-phase create method.
9535 """
9536 self.this = pre.this
9537 self.thisown = pre.thisown
9538 pre.thisown = 0
9539 if hasattr(self, '_setOORInfo'):
9540 self._setOORInfo(self)
9541 if hasattr(self, '_setCallbackInfo'):
9542 self._setCallbackInfo(self, self.__class__)
9543
9544 def SendSizeEvent(self):
9545 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9546
9547 _core_.Window_swigregister(Window)
9548
9549 def PreWindow(*args, **kwargs):
9550 """
9551 PreWindow() -> Window
9552
9553 Precreate a Window for 2-phase creation.
9554 """
9555 val = _core_.new_PreWindow(*args, **kwargs)
9556 return val
9557
9558 def Window_NewControlId(*args):
9559 """
9560 Window_NewControlId() -> int
9561
9562 Generate a control id for the controls which were not given one.
9563 """
9564 return _core_.Window_NewControlId(*args)
9565
9566 def Window_NextControlId(*args, **kwargs):
9567 """
9568 Window_NextControlId(int winid) -> int
9569
9570 Get the id of the control following the one with the given
9571 autogenerated) id
9572 """
9573 return _core_.Window_NextControlId(*args, **kwargs)
9574
9575 def Window_PrevControlId(*args, **kwargs):
9576 """
9577 Window_PrevControlId(int winid) -> int
9578
9579 Get the id of the control preceding the one with the given
9580 autogenerated) id
9581 """
9582 return _core_.Window_PrevControlId(*args, **kwargs)
9583
9584 def Window_FindFocus(*args):
9585 """
9586 Window_FindFocus() -> Window
9587
9588 Returns the window or control that currently has the keyboard focus,
9589 or None.
9590 """
9591 return _core_.Window_FindFocus(*args)
9592
9593 def Window_GetCapture(*args):
9594 """
9595 Window_GetCapture() -> Window
9596
9597 Returns the window which currently captures the mouse or None
9598 """
9599 return _core_.Window_GetCapture(*args)
9600
9601 def Window_GetClassDefaultAttributes(*args, **kwargs):
9602 """
9603 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9604
9605 Get the default attributes for this class. This is useful if you want
9606 to use the same font or colour in your own control as in a standard
9607 control -- which is a much better idea than hard coding specific
9608 colours or fonts which might look completely out of place on the
9609 user's system, especially if it uses themes.
9610
9611 The variant parameter is only relevant under Mac currently and is
9612 ignore under other platforms. Under Mac, it will change the size of
9613 the returned font. See `wx.Window.SetWindowVariant` for more about
9614 this.
9615 """
9616 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9617
9618 def DLG_PNT(win, point_or_x, y=None):
9619 """
9620 Convenience function for converting a Point or (x,y) in
9621 dialog units to pixel units.
9622 """
9623 if y is None:
9624 return win.ConvertDialogPointToPixels(point_or_x)
9625 else:
9626 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9627
9628 def DLG_SZE(win, size_width, height=None):
9629 """
9630 Convenience function for converting a Size or (w,h) in
9631 dialog units to pixel units.
9632 """
9633 if height is None:
9634 return win.ConvertDialogSizeToPixels(size_width)
9635 else:
9636 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9637
9638
9639 def FindWindowById(*args, **kwargs):
9640 """
9641 FindWindowById(long id, Window parent=None) -> Window
9642
9643 Find the first window in the application with the given id. If parent
9644 is None, the search will start from all top-level frames and dialog
9645 boxes; if non-None, the search will be limited to the given window
9646 hierarchy. The search is recursive in both cases.
9647 """
9648 return _core_.FindWindowById(*args, **kwargs)
9649
9650 def FindWindowByName(*args, **kwargs):
9651 """
9652 FindWindowByName(String name, Window parent=None) -> Window
9653
9654 Find a window by its name (as given in a window constructor or Create
9655 function call). If parent is None, the search will start from all
9656 top-level frames and dialog boxes; if non-None, the search will be
9657 limited to the given window hierarchy. The search is recursive in both
9658 cases.
9659
9660 If no window with such name is found, wx.FindWindowByLabel is called.
9661 """
9662 return _core_.FindWindowByName(*args, **kwargs)
9663
9664 def FindWindowByLabel(*args, **kwargs):
9665 """
9666 FindWindowByLabel(String label, Window parent=None) -> Window
9667
9668 Find a window by its label. Depending on the type of window, the label
9669 may be a window title or panel item label. If parent is None, the
9670 search will start from all top-level frames and dialog boxes; if
9671 non-None, the search will be limited to the given window
9672 hierarchy. The search is recursive in both cases.
9673 """
9674 return _core_.FindWindowByLabel(*args, **kwargs)
9675
9676 def Window_FromHWND(*args, **kwargs):
9677 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9678 return _core_.Window_FromHWND(*args, **kwargs)
9679
9680 def GetTopLevelWindows(*args):
9681 """
9682 GetTopLevelWindows() -> PyObject
9683
9684 Returns a list of the the application's top-level windows, (frames,
9685 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9686 by wxWidgets, and so it is only valid as long as no top-level windows
9687 are closed or new top-level windows are created.
9688
9689 """
9690 return _core_.GetTopLevelWindows(*args)
9691 #---------------------------------------------------------------------------
9692
9693 class Validator(EvtHandler):
9694 """Proxy of C++ Validator class"""
9695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9696 __repr__ = _swig_repr
9697 def __init__(self, *args, **kwargs):
9698 """__init__(self) -> Validator"""
9699 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9700 self._setOORInfo(self)
9701
9702 def Clone(*args, **kwargs):
9703 """Clone(self) -> Validator"""
9704 return _core_.Validator_Clone(*args, **kwargs)
9705
9706 def Validate(*args, **kwargs):
9707 """Validate(self, Window parent) -> bool"""
9708 return _core_.Validator_Validate(*args, **kwargs)
9709
9710 def TransferToWindow(*args, **kwargs):
9711 """TransferToWindow(self) -> bool"""
9712 return _core_.Validator_TransferToWindow(*args, **kwargs)
9713
9714 def TransferFromWindow(*args, **kwargs):
9715 """TransferFromWindow(self) -> bool"""
9716 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9717
9718 def GetWindow(*args, **kwargs):
9719 """GetWindow(self) -> Window"""
9720 return _core_.Validator_GetWindow(*args, **kwargs)
9721
9722 def SetWindow(*args, **kwargs):
9723 """SetWindow(self, Window window)"""
9724 return _core_.Validator_SetWindow(*args, **kwargs)
9725
9726 def IsSilent(*args, **kwargs):
9727 """IsSilent() -> bool"""
9728 return _core_.Validator_IsSilent(*args, **kwargs)
9729
9730 IsSilent = staticmethod(IsSilent)
9731 def SetBellOnError(*args, **kwargs):
9732 """SetBellOnError(int doIt=True)"""
9733 return _core_.Validator_SetBellOnError(*args, **kwargs)
9734
9735 SetBellOnError = staticmethod(SetBellOnError)
9736 _core_.Validator_swigregister(Validator)
9737
9738 def Validator_IsSilent(*args):
9739 """Validator_IsSilent() -> bool"""
9740 return _core_.Validator_IsSilent(*args)
9741
9742 def Validator_SetBellOnError(*args, **kwargs):
9743 """Validator_SetBellOnError(int doIt=True)"""
9744 return _core_.Validator_SetBellOnError(*args, **kwargs)
9745
9746 class PyValidator(Validator):
9747 """Proxy of C++ PyValidator class"""
9748 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9749 __repr__ = _swig_repr
9750 def __init__(self, *args, **kwargs):
9751 """__init__(self) -> PyValidator"""
9752 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9753
9754 self._setCallbackInfo(self, PyValidator, 1)
9755 self._setOORInfo(self)
9756
9757 def _setCallbackInfo(*args, **kwargs):
9758 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9759 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9760
9761 _core_.PyValidator_swigregister(PyValidator)
9762
9763 #---------------------------------------------------------------------------
9764
9765 class Menu(EvtHandler):
9766 """Proxy of C++ Menu class"""
9767 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9768 __repr__ = _swig_repr
9769 def __init__(self, *args, **kwargs):
9770 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9771 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9772 self._setOORInfo(self)
9773
9774 def Append(*args, **kwargs):
9775 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9776 return _core_.Menu_Append(*args, **kwargs)
9777
9778 def AppendSeparator(*args, **kwargs):
9779 """AppendSeparator(self) -> MenuItem"""
9780 return _core_.Menu_AppendSeparator(*args, **kwargs)
9781
9782 def AppendCheckItem(*args, **kwargs):
9783 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9784 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9785
9786 def AppendRadioItem(*args, **kwargs):
9787 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9788 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9789
9790 def AppendMenu(*args, **kwargs):
9791 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9792 return _core_.Menu_AppendMenu(*args, **kwargs)
9793
9794 def AppendSubMenu(*args, **kwargs):
9795 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9796 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9797
9798 def AppendItem(*args, **kwargs):
9799 """AppendItem(self, MenuItem item) -> MenuItem"""
9800 return _core_.Menu_AppendItem(*args, **kwargs)
9801
9802 def InsertItem(*args, **kwargs):
9803 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9804 return _core_.Menu_InsertItem(*args, **kwargs)
9805
9806 def PrependItem(*args, **kwargs):
9807 """PrependItem(self, MenuItem item) -> MenuItem"""
9808 return _core_.Menu_PrependItem(*args, **kwargs)
9809
9810 def Break(*args, **kwargs):
9811 """Break(self)"""
9812 return _core_.Menu_Break(*args, **kwargs)
9813
9814 def Insert(*args, **kwargs):
9815 """
9816 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9817 int kind=ITEM_NORMAL) -> MenuItem
9818 """
9819 return _core_.Menu_Insert(*args, **kwargs)
9820
9821 def InsertSeparator(*args, **kwargs):
9822 """InsertSeparator(self, size_t pos) -> MenuItem"""
9823 return _core_.Menu_InsertSeparator(*args, **kwargs)
9824
9825 def InsertCheckItem(*args, **kwargs):
9826 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9827 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9828
9829 def InsertRadioItem(*args, **kwargs):
9830 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9831 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9832
9833 def InsertMenu(*args, **kwargs):
9834 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9835 return _core_.Menu_InsertMenu(*args, **kwargs)
9836
9837 def Prepend(*args, **kwargs):
9838 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9839 return _core_.Menu_Prepend(*args, **kwargs)
9840
9841 def PrependSeparator(*args, **kwargs):
9842 """PrependSeparator(self) -> MenuItem"""
9843 return _core_.Menu_PrependSeparator(*args, **kwargs)
9844
9845 def PrependCheckItem(*args, **kwargs):
9846 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9847 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9848
9849 def PrependRadioItem(*args, **kwargs):
9850 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9851 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9852
9853 def PrependMenu(*args, **kwargs):
9854 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9855 return _core_.Menu_PrependMenu(*args, **kwargs)
9856
9857 def Remove(*args, **kwargs):
9858 """Remove(self, int id) -> MenuItem"""
9859 return _core_.Menu_Remove(*args, **kwargs)
9860
9861 def RemoveItem(*args, **kwargs):
9862 """RemoveItem(self, MenuItem item) -> MenuItem"""
9863 return _core_.Menu_RemoveItem(*args, **kwargs)
9864
9865 def Delete(*args, **kwargs):
9866 """Delete(self, int id) -> bool"""
9867 return _core_.Menu_Delete(*args, **kwargs)
9868
9869 def DeleteItem(*args, **kwargs):
9870 """DeleteItem(self, MenuItem item) -> bool"""
9871 return _core_.Menu_DeleteItem(*args, **kwargs)
9872
9873 def Destroy(*args, **kwargs):
9874 """
9875 Destroy(self)
9876
9877 Deletes the C++ object this Python object is a proxy for.
9878 """
9879 val = _core_.Menu_Destroy(*args, **kwargs)
9880 args[0].thisown = 0
9881 return val
9882
9883 def DestroyId(*args, **kwargs):
9884 """
9885 DestroyId(self, int id) -> bool
9886
9887 Deletes the C++ object this Python object is a proxy for.
9888 """
9889 val = _core_.Menu_DestroyId(*args, **kwargs)
9890 args[0].thisown = 0
9891 return val
9892
9893 def DestroyItem(*args, **kwargs):
9894 """
9895 DestroyItem(self, MenuItem item) -> bool
9896
9897 Deletes the C++ object this Python object is a proxy for.
9898 """
9899 val = _core_.Menu_DestroyItem(*args, **kwargs)
9900 args[0].thisown = 0
9901 return val
9902
9903 def GetMenuItemCount(*args, **kwargs):
9904 """GetMenuItemCount(self) -> size_t"""
9905 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9906
9907 def GetMenuItems(*args, **kwargs):
9908 """GetMenuItems(self) -> PyObject"""
9909 return _core_.Menu_GetMenuItems(*args, **kwargs)
9910
9911 def FindItem(*args, **kwargs):
9912 """FindItem(self, String item) -> int"""
9913 return _core_.Menu_FindItem(*args, **kwargs)
9914
9915 def FindItemById(*args, **kwargs):
9916 """FindItemById(self, int id) -> MenuItem"""
9917 return _core_.Menu_FindItemById(*args, **kwargs)
9918
9919 def FindItemByPosition(*args, **kwargs):
9920 """FindItemByPosition(self, size_t position) -> MenuItem"""
9921 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9922
9923 def Enable(*args, **kwargs):
9924 """Enable(self, int id, bool enable)"""
9925 return _core_.Menu_Enable(*args, **kwargs)
9926
9927 def IsEnabled(*args, **kwargs):
9928 """IsEnabled(self, int id) -> bool"""
9929 return _core_.Menu_IsEnabled(*args, **kwargs)
9930
9931 def Check(*args, **kwargs):
9932 """Check(self, int id, bool check)"""
9933 return _core_.Menu_Check(*args, **kwargs)
9934
9935 def IsChecked(*args, **kwargs):
9936 """IsChecked(self, int id) -> bool"""
9937 return _core_.Menu_IsChecked(*args, **kwargs)
9938
9939 def SetLabel(*args, **kwargs):
9940 """SetLabel(self, int id, String label)"""
9941 return _core_.Menu_SetLabel(*args, **kwargs)
9942
9943 def GetLabel(*args, **kwargs):
9944 """GetLabel(self, int id) -> String"""
9945 return _core_.Menu_GetLabel(*args, **kwargs)
9946
9947 def SetHelpString(*args, **kwargs):
9948 """SetHelpString(self, int id, String helpString)"""
9949 return _core_.Menu_SetHelpString(*args, **kwargs)
9950
9951 def GetHelpString(*args, **kwargs):
9952 """GetHelpString(self, int id) -> String"""
9953 return _core_.Menu_GetHelpString(*args, **kwargs)
9954
9955 def SetTitle(*args, **kwargs):
9956 """SetTitle(self, String title)"""
9957 return _core_.Menu_SetTitle(*args, **kwargs)
9958
9959 def GetTitle(*args, **kwargs):
9960 """GetTitle(self) -> String"""
9961 return _core_.Menu_GetTitle(*args, **kwargs)
9962
9963 def SetEventHandler(*args, **kwargs):
9964 """SetEventHandler(self, EvtHandler handler)"""
9965 return _core_.Menu_SetEventHandler(*args, **kwargs)
9966
9967 def GetEventHandler(*args, **kwargs):
9968 """GetEventHandler(self) -> EvtHandler"""
9969 return _core_.Menu_GetEventHandler(*args, **kwargs)
9970
9971 def SetInvokingWindow(*args, **kwargs):
9972 """SetInvokingWindow(self, Window win)"""
9973 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9974
9975 def GetInvokingWindow(*args, **kwargs):
9976 """GetInvokingWindow(self) -> Window"""
9977 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9978
9979 def GetStyle(*args, **kwargs):
9980 """GetStyle(self) -> long"""
9981 return _core_.Menu_GetStyle(*args, **kwargs)
9982
9983 def UpdateUI(*args, **kwargs):
9984 """UpdateUI(self, EvtHandler source=None)"""
9985 return _core_.Menu_UpdateUI(*args, **kwargs)
9986
9987 def GetMenuBar(*args, **kwargs):
9988 """GetMenuBar(self) -> MenuBar"""
9989 return _core_.Menu_GetMenuBar(*args, **kwargs)
9990
9991 def Attach(*args, **kwargs):
9992 """Attach(self, wxMenuBarBase menubar)"""
9993 return _core_.Menu_Attach(*args, **kwargs)
9994
9995 def Detach(*args, **kwargs):
9996 """Detach(self)"""
9997 return _core_.Menu_Detach(*args, **kwargs)
9998
9999 def IsAttached(*args, **kwargs):
10000 """IsAttached(self) -> bool"""
10001 return _core_.Menu_IsAttached(*args, **kwargs)
10002
10003 def SetParent(*args, **kwargs):
10004 """SetParent(self, Menu parent)"""
10005 return _core_.Menu_SetParent(*args, **kwargs)
10006
10007 def GetParent(*args, **kwargs):
10008 """GetParent(self) -> Menu"""
10009 return _core_.Menu_GetParent(*args, **kwargs)
10010
10011 _core_.Menu_swigregister(Menu)
10012 DefaultValidator = cvar.DefaultValidator
10013
10014 #---------------------------------------------------------------------------
10015
10016 class MenuBar(Window):
10017 """Proxy of C++ MenuBar class"""
10018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10019 __repr__ = _swig_repr
10020 def __init__(self, *args, **kwargs):
10021 """__init__(self, long style=0) -> MenuBar"""
10022 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10023 self._setOORInfo(self)
10024
10025 def Append(*args, **kwargs):
10026 """Append(self, Menu menu, String title) -> bool"""
10027 return _core_.MenuBar_Append(*args, **kwargs)
10028
10029 def Insert(*args, **kwargs):
10030 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10031 return _core_.MenuBar_Insert(*args, **kwargs)
10032
10033 def GetMenuCount(*args, **kwargs):
10034 """GetMenuCount(self) -> size_t"""
10035 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10036
10037 def GetMenu(*args, **kwargs):
10038 """GetMenu(self, size_t pos) -> Menu"""
10039 return _core_.MenuBar_GetMenu(*args, **kwargs)
10040
10041 def Replace(*args, **kwargs):
10042 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10043 return _core_.MenuBar_Replace(*args, **kwargs)
10044
10045 def Remove(*args, **kwargs):
10046 """Remove(self, size_t pos) -> Menu"""
10047 return _core_.MenuBar_Remove(*args, **kwargs)
10048
10049 def EnableTop(*args, **kwargs):
10050 """EnableTop(self, size_t pos, bool enable)"""
10051 return _core_.MenuBar_EnableTop(*args, **kwargs)
10052
10053 def IsEnabledTop(*args, **kwargs):
10054 """IsEnabledTop(self, size_t pos) -> bool"""
10055 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10056
10057 def SetLabelTop(*args, **kwargs):
10058 """SetLabelTop(self, size_t pos, String label)"""
10059 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10060
10061 def GetLabelTop(*args, **kwargs):
10062 """GetLabelTop(self, size_t pos) -> String"""
10063 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10064
10065 def FindMenuItem(*args, **kwargs):
10066 """FindMenuItem(self, String menu, String item) -> int"""
10067 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10068
10069 def FindItemById(*args, **kwargs):
10070 """FindItemById(self, int id) -> MenuItem"""
10071 return _core_.MenuBar_FindItemById(*args, **kwargs)
10072
10073 def FindMenu(*args, **kwargs):
10074 """FindMenu(self, String title) -> int"""
10075 return _core_.MenuBar_FindMenu(*args, **kwargs)
10076
10077 def Enable(*args, **kwargs):
10078 """Enable(self, int id, bool enable)"""
10079 return _core_.MenuBar_Enable(*args, **kwargs)
10080
10081 def Check(*args, **kwargs):
10082 """Check(self, int id, bool check)"""
10083 return _core_.MenuBar_Check(*args, **kwargs)
10084
10085 def IsChecked(*args, **kwargs):
10086 """IsChecked(self, int id) -> bool"""
10087 return _core_.MenuBar_IsChecked(*args, **kwargs)
10088
10089 def IsEnabled(*args, **kwargs):
10090 """IsEnabled(self, int id) -> bool"""
10091 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10092
10093 def SetLabel(*args, **kwargs):
10094 """SetLabel(self, int id, String label)"""
10095 return _core_.MenuBar_SetLabel(*args, **kwargs)
10096
10097 def GetLabel(*args, **kwargs):
10098 """GetLabel(self, int id) -> String"""
10099 return _core_.MenuBar_GetLabel(*args, **kwargs)
10100
10101 def SetHelpString(*args, **kwargs):
10102 """SetHelpString(self, int id, String helpString)"""
10103 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10104
10105 def GetHelpString(*args, **kwargs):
10106 """GetHelpString(self, int id) -> String"""
10107 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10108
10109 def GetFrame(*args, **kwargs):
10110 """GetFrame(self) -> wxFrame"""
10111 return _core_.MenuBar_GetFrame(*args, **kwargs)
10112
10113 def IsAttached(*args, **kwargs):
10114 """IsAttached(self) -> bool"""
10115 return _core_.MenuBar_IsAttached(*args, **kwargs)
10116
10117 def Attach(*args, **kwargs):
10118 """Attach(self, wxFrame frame)"""
10119 return _core_.MenuBar_Attach(*args, **kwargs)
10120
10121 def Detach(*args, **kwargs):
10122 """Detach(self)"""
10123 return _core_.MenuBar_Detach(*args, **kwargs)
10124
10125 def SetAutoWindowMenu(*args, **kwargs):
10126 """SetAutoWindowMenu(bool enable)"""
10127 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10128
10129 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10130 def GetAutoWindowMenu(*args, **kwargs):
10131 """GetAutoWindowMenu() -> bool"""
10132 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10133
10134 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10135 _core_.MenuBar_swigregister(MenuBar)
10136
10137 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10138 """MenuBar_SetAutoWindowMenu(bool enable)"""
10139 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10140
10141 def MenuBar_GetAutoWindowMenu(*args):
10142 """MenuBar_GetAutoWindowMenu() -> bool"""
10143 return _core_.MenuBar_GetAutoWindowMenu(*args)
10144
10145 #---------------------------------------------------------------------------
10146
10147 class MenuItem(Object):
10148 """Proxy of C++ MenuItem class"""
10149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10150 __repr__ = _swig_repr
10151 def __init__(self, *args, **kwargs):
10152 """
10153 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10154 String help=EmptyString, int kind=ITEM_NORMAL,
10155 Menu subMenu=None) -> MenuItem
10156 """
10157 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10158 __swig_destroy__ = _core_.delete_MenuItem
10159 __del__ = lambda self : None;
10160 def GetMenu(*args, **kwargs):
10161 """GetMenu(self) -> Menu"""
10162 return _core_.MenuItem_GetMenu(*args, **kwargs)
10163
10164 def SetMenu(*args, **kwargs):
10165 """SetMenu(self, Menu menu)"""
10166 return _core_.MenuItem_SetMenu(*args, **kwargs)
10167
10168 def SetId(*args, **kwargs):
10169 """SetId(self, int id)"""
10170 return _core_.MenuItem_SetId(*args, **kwargs)
10171
10172 def GetId(*args, **kwargs):
10173 """GetId(self) -> int"""
10174 return _core_.MenuItem_GetId(*args, **kwargs)
10175
10176 def IsSeparator(*args, **kwargs):
10177 """IsSeparator(self) -> bool"""
10178 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10179
10180 def SetText(*args, **kwargs):
10181 """SetText(self, String str)"""
10182 return _core_.MenuItem_SetText(*args, **kwargs)
10183
10184 def GetLabel(*args, **kwargs):
10185 """GetLabel(self) -> String"""
10186 return _core_.MenuItem_GetLabel(*args, **kwargs)
10187
10188 def GetText(*args, **kwargs):
10189 """GetText(self) -> String"""
10190 return _core_.MenuItem_GetText(*args, **kwargs)
10191
10192 def GetLabelFromText(*args, **kwargs):
10193 """GetLabelFromText(String text) -> String"""
10194 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10195
10196 GetLabelFromText = staticmethod(GetLabelFromText)
10197 def GetKind(*args, **kwargs):
10198 """GetKind(self) -> int"""
10199 return _core_.MenuItem_GetKind(*args, **kwargs)
10200
10201 def SetKind(*args, **kwargs):
10202 """SetKind(self, int kind)"""
10203 return _core_.MenuItem_SetKind(*args, **kwargs)
10204
10205 def SetCheckable(*args, **kwargs):
10206 """SetCheckable(self, bool checkable)"""
10207 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10208
10209 def IsCheckable(*args, **kwargs):
10210 """IsCheckable(self) -> bool"""
10211 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10212
10213 def IsSubMenu(*args, **kwargs):
10214 """IsSubMenu(self) -> bool"""
10215 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10216
10217 def SetSubMenu(*args, **kwargs):
10218 """SetSubMenu(self, Menu menu)"""
10219 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10220
10221 def GetSubMenu(*args, **kwargs):
10222 """GetSubMenu(self) -> Menu"""
10223 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10224
10225 def Enable(*args, **kwargs):
10226 """Enable(self, bool enable=True)"""
10227 return _core_.MenuItem_Enable(*args, **kwargs)
10228
10229 def IsEnabled(*args, **kwargs):
10230 """IsEnabled(self) -> bool"""
10231 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10232
10233 def Check(*args, **kwargs):
10234 """Check(self, bool check=True)"""
10235 return _core_.MenuItem_Check(*args, **kwargs)
10236
10237 def IsChecked(*args, **kwargs):
10238 """IsChecked(self) -> bool"""
10239 return _core_.MenuItem_IsChecked(*args, **kwargs)
10240
10241 def Toggle(*args, **kwargs):
10242 """Toggle(self)"""
10243 return _core_.MenuItem_Toggle(*args, **kwargs)
10244
10245 def SetHelp(*args, **kwargs):
10246 """SetHelp(self, String str)"""
10247 return _core_.MenuItem_SetHelp(*args, **kwargs)
10248
10249 def GetHelp(*args, **kwargs):
10250 """GetHelp(self) -> String"""
10251 return _core_.MenuItem_GetHelp(*args, **kwargs)
10252
10253 def GetAccel(*args, **kwargs):
10254 """GetAccel(self) -> AcceleratorEntry"""
10255 return _core_.MenuItem_GetAccel(*args, **kwargs)
10256
10257 def SetAccel(*args, **kwargs):
10258 """SetAccel(self, AcceleratorEntry accel)"""
10259 return _core_.MenuItem_SetAccel(*args, **kwargs)
10260
10261 def SetBitmap(*args, **kwargs):
10262 """SetBitmap(self, Bitmap bitmap)"""
10263 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10264
10265 def GetBitmap(*args, **kwargs):
10266 """GetBitmap(self) -> Bitmap"""
10267 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10268
10269 def SetFont(*args, **kwargs):
10270 """SetFont(self, Font font)"""
10271 return _core_.MenuItem_SetFont(*args, **kwargs)
10272
10273 def GetFont(*args, **kwargs):
10274 """GetFont(self) -> Font"""
10275 return _core_.MenuItem_GetFont(*args, **kwargs)
10276
10277 def SetTextColour(*args, **kwargs):
10278 """SetTextColour(self, Colour colText)"""
10279 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10280
10281 def GetTextColour(*args, **kwargs):
10282 """GetTextColour(self) -> Colour"""
10283 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10284
10285 def SetBackgroundColour(*args, **kwargs):
10286 """SetBackgroundColour(self, Colour colBack)"""
10287 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10288
10289 def GetBackgroundColour(*args, **kwargs):
10290 """GetBackgroundColour(self) -> Colour"""
10291 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10292
10293 def SetBitmaps(*args, **kwargs):
10294 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10295 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10296
10297 def SetDisabledBitmap(*args, **kwargs):
10298 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10299 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10300
10301 def GetDisabledBitmap(*args, **kwargs):
10302 """GetDisabledBitmap(self) -> Bitmap"""
10303 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10304
10305 def SetMarginWidth(*args, **kwargs):
10306 """SetMarginWidth(self, int nWidth)"""
10307 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10308
10309 def GetMarginWidth(*args, **kwargs):
10310 """GetMarginWidth(self) -> int"""
10311 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10312
10313 def GetDefaultMarginWidth(*args, **kwargs):
10314 """GetDefaultMarginWidth() -> int"""
10315 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10316
10317 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10318 def IsOwnerDrawn(*args, **kwargs):
10319 """IsOwnerDrawn(self) -> bool"""
10320 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10321
10322 def SetOwnerDrawn(*args, **kwargs):
10323 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10324 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10325
10326 def ResetOwnerDrawn(*args, **kwargs):
10327 """ResetOwnerDrawn(self)"""
10328 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10329
10330 _core_.MenuItem_swigregister(MenuItem)
10331
10332 def MenuItem_GetLabelFromText(*args, **kwargs):
10333 """MenuItem_GetLabelFromText(String text) -> String"""
10334 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10335
10336 def MenuItem_GetDefaultMarginWidth(*args):
10337 """MenuItem_GetDefaultMarginWidth() -> int"""
10338 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10339
10340 #---------------------------------------------------------------------------
10341
10342 class Control(Window):
10343 """
10344 This is the base class for a control or 'widget'.
10345
10346 A control is generally a small window which processes user input
10347 and/or displays one or more item of data.
10348 """
10349 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10350 __repr__ = _swig_repr
10351 def __init__(self, *args, **kwargs):
10352 """
10353 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10354 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10355 String name=ControlNameStr) -> Control
10356
10357 Create a Control. Normally you should only call this from a subclass'
10358 __init__ as a plain old wx.Control is not very useful.
10359 """
10360 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10361 self._setOORInfo(self)
10362
10363 def Create(*args, **kwargs):
10364 """
10365 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10366 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10367 String name=ControlNameStr) -> bool
10368
10369 Do the 2nd phase and create the GUI control.
10370 """
10371 return _core_.Control_Create(*args, **kwargs)
10372
10373 def Command(*args, **kwargs):
10374 """
10375 Command(self, CommandEvent event)
10376
10377 Simulates the effect of the user issuing a command to the item.
10378
10379 :see: `wx.CommandEvent`
10380
10381 """
10382 return _core_.Control_Command(*args, **kwargs)
10383
10384 def GetLabel(*args, **kwargs):
10385 """
10386 GetLabel(self) -> String
10387
10388 Return a control's text.
10389 """
10390 return _core_.Control_GetLabel(*args, **kwargs)
10391
10392 def GetClassDefaultAttributes(*args, **kwargs):
10393 """
10394 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10395
10396 Get the default attributes for this class. This is useful if you want
10397 to use the same font or colour in your own control as in a standard
10398 control -- which is a much better idea than hard coding specific
10399 colours or fonts which might look completely out of place on the
10400 user's system, especially if it uses themes.
10401
10402 The variant parameter is only relevant under Mac currently and is
10403 ignore under other platforms. Under Mac, it will change the size of
10404 the returned font. See `wx.Window.SetWindowVariant` for more about
10405 this.
10406 """
10407 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10408
10409 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10410 _core_.Control_swigregister(Control)
10411 ControlNameStr = cvar.ControlNameStr
10412
10413 def PreControl(*args, **kwargs):
10414 """
10415 PreControl() -> Control
10416
10417 Precreate a Control control for 2-phase creation
10418 """
10419 val = _core_.new_PreControl(*args, **kwargs)
10420 return val
10421
10422 def Control_GetClassDefaultAttributes(*args, **kwargs):
10423 """
10424 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10425
10426 Get the default attributes for this class. This is useful if you want
10427 to use the same font or colour in your own control as in a standard
10428 control -- which is a much better idea than hard coding specific
10429 colours or fonts which might look completely out of place on the
10430 user's system, especially if it uses themes.
10431
10432 The variant parameter is only relevant under Mac currently and is
10433 ignore under other platforms. Under Mac, it will change the size of
10434 the returned font. See `wx.Window.SetWindowVariant` for more about
10435 this.
10436 """
10437 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10438
10439 #---------------------------------------------------------------------------
10440
10441 class ItemContainer(object):
10442 """
10443 The wx.ItemContainer class defines an interface which is implemented
10444 by all controls which have string subitems, each of which may be
10445 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10446 as `wx.ComboBox` which implements an extended interface deriving from
10447 this one.
10448
10449 It defines the methods for accessing the control's items and although
10450 each of the derived classes implements them differently, they still
10451 all conform to the same interface.
10452
10453 The items in a wx.ItemContainer have (non empty) string labels and,
10454 optionally, client data associated with them.
10455
10456 """
10457 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10458 def __init__(self): raise AttributeError, "No constructor defined"
10459 __repr__ = _swig_repr
10460 def Append(*args, **kwargs):
10461 """
10462 Append(self, String item, PyObject clientData=None) -> int
10463
10464 Adds the item to the control, associating the given data with the item
10465 if not None. The return value is the index of the newly added item
10466 which may be different from the last one if the control is sorted (e.g.
10467 has wx.LB_SORT or wx.CB_SORT style).
10468 """
10469 return _core_.ItemContainer_Append(*args, **kwargs)
10470
10471 def AppendItems(*args, **kwargs):
10472 """
10473 AppendItems(self, List strings)
10474
10475 Apend several items at once to the control. Notice that calling this
10476 method may be much faster than appending the items one by one if you
10477 need to add a lot of items.
10478 """
10479 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10480
10481 def Insert(*args, **kwargs):
10482 """
10483 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10484
10485 Insert an item into the control before the item at the ``pos`` index,
10486 optionally associating some data object with the item.
10487 """
10488 return _core_.ItemContainer_Insert(*args, **kwargs)
10489
10490 def Clear(*args, **kwargs):
10491 """
10492 Clear(self)
10493
10494 Removes all items from the control.
10495 """
10496 return _core_.ItemContainer_Clear(*args, **kwargs)
10497
10498 def Delete(*args, **kwargs):
10499 """
10500 Delete(self, unsigned int n)
10501
10502 Deletes the item at the zero-based index 'n' from the control. Note
10503 that it is an error (signalled by a `wx.PyAssertionError` exception if
10504 enabled) to remove an item with the index negative or greater or equal
10505 than the number of items in the control.
10506 """
10507 return _core_.ItemContainer_Delete(*args, **kwargs)
10508
10509 def GetClientData(*args, **kwargs):
10510 """
10511 GetClientData(self, unsigned int n) -> PyObject
10512
10513 Returns the client data associated with the given item, (if any.)
10514 """
10515 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10516
10517 def SetClientData(*args, **kwargs):
10518 """
10519 SetClientData(self, unsigned int n, PyObject clientData)
10520
10521 Associate the given client data with the item at position n.
10522 """
10523 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10524
10525 def GetCount(*args, **kwargs):
10526 """
10527 GetCount(self) -> unsigned int
10528
10529 Returns the number of items in the control.
10530 """
10531 return _core_.ItemContainer_GetCount(*args, **kwargs)
10532
10533 def IsEmpty(*args, **kwargs):
10534 """
10535 IsEmpty(self) -> bool
10536
10537 Returns True if the control is empty or False if it has some items.
10538 """
10539 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10540
10541 def GetString(*args, **kwargs):
10542 """
10543 GetString(self, unsigned int n) -> String
10544
10545 Returns the label of the item with the given index.
10546 """
10547 return _core_.ItemContainer_GetString(*args, **kwargs)
10548
10549 def GetStrings(*args, **kwargs):
10550 """GetStrings(self) -> wxArrayString"""
10551 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10552
10553 def SetString(*args, **kwargs):
10554 """
10555 SetString(self, unsigned int n, String s)
10556
10557 Sets the label for the given item.
10558 """
10559 return _core_.ItemContainer_SetString(*args, **kwargs)
10560
10561 def FindString(*args, **kwargs):
10562 """
10563 FindString(self, String s) -> int
10564
10565 Finds an item whose label matches the given string. Returns the
10566 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10567 found.
10568 """
10569 return _core_.ItemContainer_FindString(*args, **kwargs)
10570
10571 def SetSelection(*args, **kwargs):
10572 """
10573 SetSelection(self, int n)
10574
10575 Sets the item at index 'n' to be the selected item.
10576 """
10577 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10578
10579 def GetSelection(*args, **kwargs):
10580 """
10581 GetSelection(self) -> int
10582
10583 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10584 is selected.
10585 """
10586 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10587
10588 def SetStringSelection(*args, **kwargs):
10589 """SetStringSelection(self, String s) -> bool"""
10590 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10591
10592 def GetStringSelection(*args, **kwargs):
10593 """
10594 GetStringSelection(self) -> String
10595
10596 Returns the label of the selected item or an empty string if no item
10597 is selected.
10598 """
10599 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10600
10601 def Select(*args, **kwargs):
10602 """
10603 Select(self, int n)
10604
10605 This is the same as `SetSelection` and exists only because it is
10606 slightly more natural for controls which support multiple selection.
10607 """
10608 return _core_.ItemContainer_Select(*args, **kwargs)
10609
10610 _core_.ItemContainer_swigregister(ItemContainer)
10611
10612 #---------------------------------------------------------------------------
10613
10614 class ControlWithItems(Control,ItemContainer):
10615 """
10616 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10617 wx.Control class, and is used for the base class of various controls
10618 that have items.
10619 """
10620 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10621 def __init__(self): raise AttributeError, "No constructor defined"
10622 __repr__ = _swig_repr
10623 _core_.ControlWithItems_swigregister(ControlWithItems)
10624
10625 #---------------------------------------------------------------------------
10626
10627 class SizerItem(Object):
10628 """
10629 The wx.SizerItem class is used to track the position, size and other
10630 attributes of each item managed by a `wx.Sizer`. It is not usually
10631 necessary to use this class because the sizer elements can also be
10632 identified by their positions or window or sizer references but
10633 sometimes it may be more convenient to use wx.SizerItem directly.
10634 Also, custom classes derived from `wx.PySizer` will probably need to
10635 use the collection of wx.SizerItems held by wx.Sizer when calculating
10636 layout.
10637
10638 :see: `wx.Sizer`, `wx.GBSizerItem`
10639 """
10640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10641 __repr__ = _swig_repr
10642 def __init__(self, *args, **kwargs):
10643 """
10644 __init__(self) -> SizerItem
10645
10646 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10647 size will need to be set before this item can be used in a Sizer.
10648
10649 You will probably never need to create a wx.SizerItem directly as they
10650 are created automatically when the sizer's Add, Insert or Prepend
10651 methods are called.
10652
10653 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10654 """
10655 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10656 __swig_destroy__ = _core_.delete_SizerItem
10657 __del__ = lambda self : None;
10658 def DeleteWindows(*args, **kwargs):
10659 """
10660 DeleteWindows(self)
10661
10662 Destroy the window or the windows in a subsizer, depending on the type
10663 of item.
10664 """
10665 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10666
10667 def DetachSizer(*args, **kwargs):
10668 """
10669 DetachSizer(self)
10670
10671 Enable deleting the SizerItem without destroying the contained sizer.
10672 """
10673 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10674
10675 def GetSize(*args, **kwargs):
10676 """
10677 GetSize(self) -> Size
10678
10679 Get the current size of the item, as set in the last Layout.
10680 """
10681 return _core_.SizerItem_GetSize(*args, **kwargs)
10682
10683 def CalcMin(*args, **kwargs):
10684 """
10685 CalcMin(self) -> Size
10686
10687 Calculates the minimum desired size for the item, including any space
10688 needed by borders.
10689 """
10690 return _core_.SizerItem_CalcMin(*args, **kwargs)
10691
10692 def SetDimension(*args, **kwargs):
10693 """
10694 SetDimension(self, Point pos, Size size)
10695
10696 Set the position and size of the space allocated for this item by the
10697 sizer, and adjust the position and size of the item (window or
10698 subsizer) to be within that space taking alignment and borders into
10699 account.
10700 """
10701 return _core_.SizerItem_SetDimension(*args, **kwargs)
10702
10703 def GetMinSize(*args, **kwargs):
10704 """
10705 GetMinSize(self) -> Size
10706
10707 Get the minimum size needed for the item.
10708 """
10709 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10710
10711 def GetMinSizeWithBorder(*args, **kwargs):
10712 """
10713 GetMinSizeWithBorder(self) -> Size
10714
10715 Get the minimum size needed for the item with space for the borders
10716 added, if needed.
10717 """
10718 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10719
10720 def SetInitSize(*args, **kwargs):
10721 """SetInitSize(self, int x, int y)"""
10722 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10723
10724 def SetRatioWH(*args, **kwargs):
10725 """
10726 SetRatioWH(self, int width, int height)
10727
10728 Set the ratio item attribute.
10729 """
10730 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10731
10732 def SetRatioSize(*args, **kwargs):
10733 """
10734 SetRatioSize(self, Size size)
10735
10736 Set the ratio item attribute.
10737 """
10738 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10739
10740 def SetRatio(*args, **kwargs):
10741 """
10742 SetRatio(self, float ratio)
10743
10744 Set the ratio item attribute.
10745 """
10746 return _core_.SizerItem_SetRatio(*args, **kwargs)
10747
10748 def GetRatio(*args, **kwargs):
10749 """
10750 GetRatio(self) -> float
10751
10752 Set the ratio item attribute.
10753 """
10754 return _core_.SizerItem_GetRatio(*args, **kwargs)
10755
10756 def GetRect(*args, **kwargs):
10757 """
10758 GetRect(self) -> Rect
10759
10760 Returns the rectangle that the sizer item should occupy
10761 """
10762 return _core_.SizerItem_GetRect(*args, **kwargs)
10763
10764 def IsWindow(*args, **kwargs):
10765 """
10766 IsWindow(self) -> bool
10767
10768 Is this sizer item a window?
10769 """
10770 return _core_.SizerItem_IsWindow(*args, **kwargs)
10771
10772 def IsSizer(*args, **kwargs):
10773 """
10774 IsSizer(self) -> bool
10775
10776 Is this sizer item a subsizer?
10777 """
10778 return _core_.SizerItem_IsSizer(*args, **kwargs)
10779
10780 def IsSpacer(*args, **kwargs):
10781 """
10782 IsSpacer(self) -> bool
10783
10784 Is this sizer item a spacer?
10785 """
10786 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10787
10788 def SetProportion(*args, **kwargs):
10789 """
10790 SetProportion(self, int proportion)
10791
10792 Set the proportion value for this item.
10793 """
10794 return _core_.SizerItem_SetProportion(*args, **kwargs)
10795
10796 def GetProportion(*args, **kwargs):
10797 """
10798 GetProportion(self) -> int
10799
10800 Get the proportion value for this item.
10801 """
10802 return _core_.SizerItem_GetProportion(*args, **kwargs)
10803
10804 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10805 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10806 def SetFlag(*args, **kwargs):
10807 """
10808 SetFlag(self, int flag)
10809
10810 Set the flag value for this item.
10811 """
10812 return _core_.SizerItem_SetFlag(*args, **kwargs)
10813
10814 def GetFlag(*args, **kwargs):
10815 """
10816 GetFlag(self) -> int
10817
10818 Get the flag value for this item.
10819 """
10820 return _core_.SizerItem_GetFlag(*args, **kwargs)
10821
10822 def SetBorder(*args, **kwargs):
10823 """
10824 SetBorder(self, int border)
10825
10826 Set the border value for this item.
10827 """
10828 return _core_.SizerItem_SetBorder(*args, **kwargs)
10829
10830 def GetBorder(*args, **kwargs):
10831 """
10832 GetBorder(self) -> int
10833
10834 Get the border value for this item.
10835 """
10836 return _core_.SizerItem_GetBorder(*args, **kwargs)
10837
10838 def GetWindow(*args, **kwargs):
10839 """
10840 GetWindow(self) -> Window
10841
10842 Get the window (if any) that is managed by this sizer item.
10843 """
10844 return _core_.SizerItem_GetWindow(*args, **kwargs)
10845
10846 def SetWindow(*args, **kwargs):
10847 """
10848 SetWindow(self, Window window)
10849
10850 Set the window to be managed by this sizer item.
10851 """
10852 return _core_.SizerItem_SetWindow(*args, **kwargs)
10853
10854 def GetSizer(*args, **kwargs):
10855 """
10856 GetSizer(self) -> Sizer
10857
10858 Get the subsizer (if any) that is managed by this sizer item.
10859 """
10860 return _core_.SizerItem_GetSizer(*args, **kwargs)
10861
10862 def SetSizer(*args, **kwargs):
10863 """
10864 SetSizer(self, Sizer sizer)
10865
10866 Set the subsizer to be managed by this sizer item.
10867 """
10868 return _core_.SizerItem_SetSizer(*args, **kwargs)
10869
10870 def GetSpacer(*args, **kwargs):
10871 """
10872 GetSpacer(self) -> Size
10873
10874 Get the size of the spacer managed by this sizer item.
10875 """
10876 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10877
10878 def SetSpacer(*args, **kwargs):
10879 """
10880 SetSpacer(self, Size size)
10881
10882 Set the size of the spacer to be managed by this sizer item.
10883 """
10884 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10885
10886 def Show(*args, **kwargs):
10887 """
10888 Show(self, bool show)
10889
10890 Set the show item attribute, which sizers use to determine if the item
10891 is to be made part of the layout or not. If the item is tracking a
10892 window then it is shown or hidden as needed.
10893 """
10894 return _core_.SizerItem_Show(*args, **kwargs)
10895
10896 def IsShown(*args, **kwargs):
10897 """
10898 IsShown(self) -> bool
10899
10900 Is the item to be shown in the layout?
10901 """
10902 return _core_.SizerItem_IsShown(*args, **kwargs)
10903
10904 def GetPosition(*args, **kwargs):
10905 """
10906 GetPosition(self) -> Point
10907
10908 Returns the current position of the item, as set in the last Layout.
10909 """
10910 return _core_.SizerItem_GetPosition(*args, **kwargs)
10911
10912 def GetUserData(*args, **kwargs):
10913 """
10914 GetUserData(self) -> PyObject
10915
10916 Returns the userData associated with this sizer item, or None if there
10917 isn't any.
10918 """
10919 return _core_.SizerItem_GetUserData(*args, **kwargs)
10920
10921 def SetUserData(*args, **kwargs):
10922 """
10923 SetUserData(self, PyObject userData)
10924
10925 Associate a Python object with this sizer item.
10926 """
10927 return _core_.SizerItem_SetUserData(*args, **kwargs)
10928
10929 _core_.SizerItem_swigregister(SizerItem)
10930
10931 def SizerItemWindow(*args, **kwargs):
10932 """
10933 SizerItemWindow(Window window, int proportion, int flag, int border,
10934 PyObject userData=None) -> SizerItem
10935
10936 Constructs a `wx.SizerItem` for tracking a window.
10937 """
10938 val = _core_.new_SizerItemWindow(*args, **kwargs)
10939 return val
10940
10941 def SizerItemSpacer(*args, **kwargs):
10942 """
10943 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10944 PyObject userData=None) -> SizerItem
10945
10946 Constructs a `wx.SizerItem` for tracking a spacer.
10947 """
10948 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10949 return val
10950
10951 def SizerItemSizer(*args, **kwargs):
10952 """
10953 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10954 PyObject userData=None) -> SizerItem
10955
10956 Constructs a `wx.SizerItem` for tracking a subsizer
10957 """
10958 val = _core_.new_SizerItemSizer(*args, **kwargs)
10959 return val
10960
10961 class Sizer(Object):
10962 """
10963 wx.Sizer is the abstract base class used for laying out subwindows in
10964 a window. You cannot use wx.Sizer directly; instead, you will have to
10965 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10966 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10967 and `wx.GridBagSizer`.
10968
10969 The concept implemented by sizers in wxWidgets is closely related to
10970 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10971 toolkit or the Qt toolkit. It is based upon the idea of the individual
10972 subwindows reporting their minimal required size and their ability to
10973 get stretched if the size of the parent window has changed. This will
10974 most often mean that the programmer does not set the original size of
10975 a dialog in the beginning, rather the dialog will assigned a sizer and
10976 this sizer will be queried about the recommended size. The sizer in
10977 turn will query its children, which can be normal windows or contorls,
10978 empty space or other sizers, so that a hierarchy of sizers can be
10979 constructed. Note that wxSizer does not derive from wxWindow and thus
10980 do not interfere with tab ordering and requires very little resources
10981 compared to a real window on screen.
10982
10983 What makes sizers so well fitted for use in wxWidgets is the fact that
10984 every control reports its own minimal size and the algorithm can
10985 handle differences in font sizes or different window (dialog item)
10986 sizes on different platforms without problems. If for example the
10987 standard font as well as the overall design of Mac widgets requires
10988 more space than on Windows, then the initial size of a dialog using a
10989 sizer will automatically be bigger on Mac than on Windows.
10990 """
10991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10992 def __init__(self): raise AttributeError, "No constructor defined"
10993 __repr__ = _swig_repr
10994 __swig_destroy__ = _core_.delete_Sizer
10995 __del__ = lambda self : None;
10996 def _setOORInfo(*args, **kwargs):
10997 """_setOORInfo(self, PyObject _self)"""
10998 return _core_.Sizer__setOORInfo(*args, **kwargs)
10999
11000 def Add(*args, **kwargs):
11001 """
11002 Add(self, item, int proportion=0, int flag=0, int border=0,
11003 PyObject userData=None) -> wx.SizerItem
11004
11005 Appends a child item to the sizer.
11006 """
11007 return _core_.Sizer_Add(*args, **kwargs)
11008
11009 def Insert(*args, **kwargs):
11010 """
11011 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11012 PyObject userData=None) -> wx.SizerItem
11013
11014 Inserts a new item into the list of items managed by this sizer before
11015 the item at index *before*. See `Add` for a description of the parameters.
11016 """
11017 return _core_.Sizer_Insert(*args, **kwargs)
11018
11019 def Prepend(*args, **kwargs):
11020 """
11021 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11022 PyObject userData=None) -> wx.SizerItem
11023
11024 Adds a new item to the begining of the list of sizer items managed by
11025 this sizer. See `Add` for a description of the parameters.
11026 """
11027 return _core_.Sizer_Prepend(*args, **kwargs)
11028
11029 def Remove(*args, **kwargs):
11030 """
11031 Remove(self, item) -> bool
11032
11033 Removes an item from the sizer and destroys it. This method does not
11034 cause any layout or resizing to take place, call `Layout` to update
11035 the layout on screen after removing a child from the sizer. The
11036 *item* parameter can be either a window, a sizer, or the zero-based
11037 index of an item to remove. Returns True if the child item was found
11038 and removed.
11039 """
11040 return _core_.Sizer_Remove(*args, **kwargs)
11041
11042 def Detach(*args, **kwargs):
11043 """
11044 Detach(self, item) -> bool
11045
11046 Detaches an item from the sizer without destroying it. This method
11047 does not cause any layout or resizing to take place, call `Layout` to
11048 do so. The *item* parameter can be either a window, a sizer, or the
11049 zero-based index of the item to be detached. Returns True if the child item
11050 was found and detached.
11051 """
11052 return _core_.Sizer_Detach(*args, **kwargs)
11053
11054 def GetItem(*args, **kwargs):
11055 """
11056 GetItem(self, item) -> wx.SizerItem
11057
11058 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11059 parameter can be either a window, a sizer, or the zero-based index of
11060 the item to be found.
11061 """
11062 return _core_.Sizer_GetItem(*args, **kwargs)
11063
11064 def _SetItemMinSize(*args, **kwargs):
11065 """_SetItemMinSize(self, PyObject item, Size size)"""
11066 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11067
11068 def SetItemMinSize(self, item, *args):
11069 """
11070 SetItemMinSize(self, item, Size size)
11071
11072 Sets the minimum size that will be allocated for an item in the sizer.
11073 The *item* parameter can be either a window, a sizer, or the
11074 zero-based index of the item. If a window or sizer is given then it
11075 will be searched for recursivly in subsizers if neccessary.
11076 """
11077 if len(args) == 2:
11078 # for backward compatibility accept separate width,height args too
11079 return self._SetItemMinSize(item, args)
11080 else:
11081 return self._SetItemMinSize(item, args[0])
11082
11083 def AddItem(*args, **kwargs):
11084 """
11085 AddItem(self, SizerItem item)
11086
11087 Adds a `wx.SizerItem` to the sizer.
11088 """
11089 return _core_.Sizer_AddItem(*args, **kwargs)
11090
11091 def InsertItem(*args, **kwargs):
11092 """
11093 InsertItem(self, int index, SizerItem item)
11094
11095 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11096 """
11097 return _core_.Sizer_InsertItem(*args, **kwargs)
11098
11099 def PrependItem(*args, **kwargs):
11100 """
11101 PrependItem(self, SizerItem item)
11102
11103 Prepends a `wx.SizerItem` to the sizer.
11104 """
11105 return _core_.Sizer_PrependItem(*args, **kwargs)
11106
11107 def AddMany(self, items):
11108 """
11109 AddMany is a convenience method for adding several items
11110 to a sizer at one time. Simply pass it a list of tuples,
11111 where each tuple consists of the parameters that you
11112 would normally pass to the `Add` method.
11113 """
11114 for item in items:
11115 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11116 item = (item, )
11117 self.Add(*item)
11118
11119 # for backwards compatibility only, please do not use in new code
11120 def AddWindow(self, *args, **kw):
11121 """Compatibility alias for `Add`."""
11122 return self.Add(*args, **kw)
11123 def AddSizer(self, *args, **kw):
11124 """Compatibility alias for `Add`."""
11125 return self.Add(*args, **kw)
11126 def AddSpacer(self, *args, **kw):
11127 """Compatibility alias for `Add`."""
11128 return self.Add(*args, **kw)
11129
11130 def PrependWindow(self, *args, **kw):
11131 """Compatibility alias for `Prepend`."""
11132 return self.Prepend(*args, **kw)
11133 def PrependSizer(self, *args, **kw):
11134 """Compatibility alias for `Prepend`."""
11135 return self.Prepend(*args, **kw)
11136 def PrependSpacer(self, *args, **kw):
11137 """Compatibility alias for `Prepend`."""
11138 return self.Prepend(*args, **kw)
11139
11140 def InsertWindow(self, *args, **kw):
11141 """Compatibility alias for `Insert`."""
11142 return self.Insert(*args, **kw)
11143 def InsertSizer(self, *args, **kw):
11144 """Compatibility alias for `Insert`."""
11145 return self.Insert(*args, **kw)
11146 def InsertSpacer(self, *args, **kw):
11147 """Compatibility alias for `Insert`."""
11148 return self.Insert(*args, **kw)
11149
11150 def RemoveWindow(self, *args, **kw):
11151 """Compatibility alias for `Remove`."""
11152 return self.Remove(*args, **kw)
11153 def RemoveSizer(self, *args, **kw):
11154 """Compatibility alias for `Remove`."""
11155 return self.Remove(*args, **kw)
11156 def RemovePos(self, *args, **kw):
11157 """Compatibility alias for `Remove`."""
11158 return self.Remove(*args, **kw)
11159
11160
11161 def SetDimension(*args, **kwargs):
11162 """
11163 SetDimension(self, int x, int y, int width, int height)
11164
11165 Call this to force the sizer to take the given dimension and thus
11166 force the items owned by the sizer to resize themselves according to
11167 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11168 methods.
11169 """
11170 return _core_.Sizer_SetDimension(*args, **kwargs)
11171
11172 def SetMinSize(*args, **kwargs):
11173 """
11174 SetMinSize(self, Size size)
11175
11176 Call this to give the sizer a minimal size. Normally, the sizer will
11177 calculate its minimal size based purely on how much space its children
11178 need. After calling this method `GetMinSize` will return either the
11179 minimal size as requested by its children or the minimal size set
11180 here, depending on which is bigger.
11181 """
11182 return _core_.Sizer_SetMinSize(*args, **kwargs)
11183
11184 def GetSize(*args, **kwargs):
11185 """
11186 GetSize(self) -> Size
11187
11188 Returns the current size of the space managed by the sizer.
11189 """
11190 return _core_.Sizer_GetSize(*args, **kwargs)
11191
11192 def GetPosition(*args, **kwargs):
11193 """
11194 GetPosition(self) -> Point
11195
11196 Returns the current position of the sizer's managed space.
11197 """
11198 return _core_.Sizer_GetPosition(*args, **kwargs)
11199
11200 def GetMinSize(*args, **kwargs):
11201 """
11202 GetMinSize(self) -> Size
11203
11204 Returns the minimal size of the sizer. This is either the combined
11205 minimal size of all the children and their borders or the minimal size
11206 set by SetMinSize, depending on which is bigger.
11207 """
11208 return _core_.Sizer_GetMinSize(*args, **kwargs)
11209
11210 def GetSizeTuple(self):
11211 return self.GetSize().Get()
11212 def GetPositionTuple(self):
11213 return self.GetPosition().Get()
11214 def GetMinSizeTuple(self):
11215 return self.GetMinSize().Get()
11216
11217 def RecalcSizes(*args, **kwargs):
11218 """
11219 RecalcSizes(self)
11220
11221 Using the sizes calculated by `CalcMin` reposition and resize all the
11222 items managed by this sizer. You should not need to call this directly as
11223 it is called by `Layout`.
11224 """
11225 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11226
11227 def CalcMin(*args, **kwargs):
11228 """
11229 CalcMin(self) -> Size
11230
11231 This method is where the sizer will do the actual calculation of its
11232 children's minimal sizes. You should not need to call this directly as
11233 it is called by `Layout`.
11234 """
11235 return _core_.Sizer_CalcMin(*args, **kwargs)
11236
11237 def Layout(*args, **kwargs):
11238 """
11239 Layout(self)
11240
11241 This method will force the recalculation and layout of the items
11242 controlled by the sizer using the current space allocated to the
11243 sizer. Normally this is called automatically from the owning window's
11244 EVT_SIZE handler, but it is also useful to call it from user code when
11245 one of the items in a sizer change size, or items are added or
11246 removed.
11247 """
11248 return _core_.Sizer_Layout(*args, **kwargs)
11249
11250 def Fit(*args, **kwargs):
11251 """
11252 Fit(self, Window window) -> Size
11253
11254 Tell the sizer to resize the *window* to match the sizer's minimal
11255 size. This is commonly done in the constructor of the window itself in
11256 order to set its initial size to match the needs of the children as
11257 determined by the sizer. Returns the new size.
11258
11259 For a top level window this is the total window size, not the client size.
11260 """
11261 return _core_.Sizer_Fit(*args, **kwargs)
11262
11263 def FitInside(*args, **kwargs):
11264 """
11265 FitInside(self, Window window)
11266
11267 Tell the sizer to resize the *virtual size* of the *window* to match the
11268 sizer's minimal size. This will not alter the on screen size of the
11269 window, but may cause the addition/removal/alteration of scrollbars
11270 required to view the virtual area in windows which manage it.
11271
11272 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11273
11274 """
11275 return _core_.Sizer_FitInside(*args, **kwargs)
11276
11277 def SetSizeHints(*args, **kwargs):
11278 """
11279 SetSizeHints(self, Window window)
11280
11281 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11282 match the sizer's minimal size. This is commonly done in the
11283 constructor of the window itself if the window is resizable (as are
11284 many dialogs under Unix and frames on probably all platforms) in order
11285 to prevent the window from being sized smaller than the minimal size
11286 required by the sizer.
11287 """
11288 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11289
11290 def SetVirtualSizeHints(*args, **kwargs):
11291 """
11292 SetVirtualSizeHints(self, Window window)
11293
11294 Tell the sizer to set the minimal size of the window virtual area to
11295 match the sizer's minimal size. For windows with managed scrollbars
11296 this will set them appropriately.
11297
11298 :see: `wx.ScrolledWindow.SetScrollbars`
11299
11300 """
11301 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11302
11303 def Clear(*args, **kwargs):
11304 """
11305 Clear(self, bool deleteWindows=False)
11306
11307 Clear all items from the sizer, optionally destroying the window items
11308 as well.
11309 """
11310 return _core_.Sizer_Clear(*args, **kwargs)
11311
11312 def DeleteWindows(*args, **kwargs):
11313 """
11314 DeleteWindows(self)
11315
11316 Destroy all windows managed by the sizer.
11317 """
11318 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11319
11320 def GetChildren(*args, **kwargs):
11321 """
11322 GetChildren(self) -> list
11323
11324 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11325 """
11326 return _core_.Sizer_GetChildren(*args, **kwargs)
11327
11328 def Show(*args, **kwargs):
11329 """
11330 Show(self, item, bool show=True, bool recursive=false) -> bool
11331
11332 Shows or hides an item managed by the sizer. To make a sizer item
11333 disappear or reappear, use Show followed by `Layout`. The *item*
11334 parameter can be either a window, a sizer, or the zero-based index of
11335 the item. Use the recursive parameter to show or hide an item in a
11336 subsizer. Returns True if the item was found.
11337 """
11338 return _core_.Sizer_Show(*args, **kwargs)
11339
11340 def IsShown(*args, **kwargs):
11341 """
11342 IsShown(self, item)
11343
11344 Determines if the item is currently shown. To make a sizer
11345 item disappear or reappear, use Show followed by `Layout`. The *item*
11346 parameter can be either a window, a sizer, or the zero-based index of
11347 the item.
11348 """
11349 return _core_.Sizer_IsShown(*args, **kwargs)
11350
11351 def Hide(self, item, recursive=False):
11352 """
11353 A convenience method for `Show` (item, False, recursive).
11354 """
11355 return self.Show(item, False, recursive)
11356
11357 def ShowItems(*args, **kwargs):
11358 """
11359 ShowItems(self, bool show)
11360
11361 Recursively call `wx.SizerItem.Show` on all sizer items.
11362 """
11363 return _core_.Sizer_ShowItems(*args, **kwargs)
11364
11365 _core_.Sizer_swigregister(Sizer)
11366
11367 class PySizer(Sizer):
11368 """
11369 wx.PySizer is a special version of `wx.Sizer` that has been
11370 instrumented to allow the C++ virtual methods to be overloaded in
11371 Python derived classes. You would derive from this class if you are
11372 wanting to implement a custom sizer in Python code. Simply implement
11373 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11374 For example::
11375
11376 class MySizer(wx.PySizer):
11377 def __init__(self):
11378 wx.PySizer.__init__(self)
11379
11380 def CalcMin(self):
11381 for item in self.GetChildren():
11382 # calculate the total minimum width and height needed
11383 # by all items in the sizer according to this sizer's
11384 # layout algorithm.
11385 ...
11386 return wx.Size(width, height)
11387
11388 def RecalcSizes(self):
11389 # find the space allotted to this sizer
11390 pos = self.GetPosition()
11391 size = self.GetSize()
11392 for item in self.GetChildren():
11393 # Recalculate (if necessary) the position and size of
11394 # each item and then call item.SetDimension to do the
11395 # actual positioning and sizing of the items within the
11396 # space alloted to this sizer.
11397 ...
11398 item.SetDimension(itemPos, itemSize)
11399
11400
11401 When `Layout` is called it first calls `CalcMin` followed by
11402 `RecalcSizes` so you can optimize a bit by saving the results of
11403 `CalcMin` and reusing them in `RecalcSizes`.
11404
11405 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11406
11407
11408 """
11409 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11410 __repr__ = _swig_repr
11411 def __init__(self, *args, **kwargs):
11412 """
11413 __init__(self) -> PySizer
11414
11415 Creates a wx.PySizer. Must be called from the __init__ in the derived
11416 class.
11417 """
11418 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11419 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11420
11421 def _setCallbackInfo(*args, **kwargs):
11422 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11423 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11424
11425 _core_.PySizer_swigregister(PySizer)
11426
11427 #---------------------------------------------------------------------------
11428
11429 class BoxSizer(Sizer):
11430 """
11431 The basic idea behind a box sizer is that windows will most often be
11432 laid out in rather simple basic geometry, typically in a row or a
11433 column or nested hierarchies of either. A wx.BoxSizer will lay out
11434 its items in a simple row or column, depending on the orientation
11435 parameter passed to the constructor.
11436 """
11437 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11438 __repr__ = _swig_repr
11439 def __init__(self, *args, **kwargs):
11440 """
11441 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11442
11443 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11444 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11445 sizer.
11446 """
11447 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11448 self._setOORInfo(self)
11449
11450 def GetOrientation(*args, **kwargs):
11451 """
11452 GetOrientation(self) -> int
11453
11454 Returns the current orientation of the sizer.
11455 """
11456 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11457
11458 def SetOrientation(*args, **kwargs):
11459 """
11460 SetOrientation(self, int orient)
11461
11462 Resets the orientation of the sizer.
11463 """
11464 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11465
11466 _core_.BoxSizer_swigregister(BoxSizer)
11467
11468 #---------------------------------------------------------------------------
11469
11470 class StaticBoxSizer(BoxSizer):
11471 """
11472 wx.StaticBoxSizer derives from and functions identically to the
11473 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11474 manages. Note that this static box must be created separately and
11475 passed to the sizer constructor.
11476 """
11477 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11478 __repr__ = _swig_repr
11479 def __init__(self, *args, **kwargs):
11480 """
11481 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11482
11483 Constructor. It takes an associated static box and the orientation
11484 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11485 ``wx.HORIZONTAL``.
11486 """
11487 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11488 self._setOORInfo(self)
11489
11490 def GetStaticBox(*args, **kwargs):
11491 """
11492 GetStaticBox(self) -> StaticBox
11493
11494 Returns the static box associated with this sizer.
11495 """
11496 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11497
11498 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11499
11500 #---------------------------------------------------------------------------
11501
11502 class GridSizer(Sizer):
11503 """
11504 A grid sizer is a sizer which lays out its children in a
11505 two-dimensional table with all cells having the same size. In other
11506 words, the width of each cell within the grid is the width of the
11507 widest item added to the sizer and the height of each grid cell is the
11508 height of the tallest item. An optional vertical and/or horizontal
11509 gap between items can also be specified (in pixels.)
11510
11511 Items are placed in the cells of the grid in the order they are added,
11512 in row-major order. In other words, the first row is filled first,
11513 then the second, and so on until all items have been added. (If
11514 neccessary, additional rows will be added as items are added.) If you
11515 need to have greater control over the cells that items are placed in
11516 then use the `wx.GridBagSizer`.
11517
11518 """
11519 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11520 __repr__ = _swig_repr
11521 def __init__(self, *args, **kwargs):
11522 """
11523 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11524
11525 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11526 of columns and rows in the sizer - if either of the parameters is
11527 zero, it will be calculated to from the total number of children in
11528 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11529 define extra space between all children.
11530 """
11531 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11532 self._setOORInfo(self)
11533
11534 def SetCols(*args, **kwargs):
11535 """
11536 SetCols(self, int cols)
11537
11538 Sets the number of columns in the sizer.
11539 """
11540 return _core_.GridSizer_SetCols(*args, **kwargs)
11541
11542 def SetRows(*args, **kwargs):
11543 """
11544 SetRows(self, int rows)
11545
11546 Sets the number of rows in the sizer.
11547 """
11548 return _core_.GridSizer_SetRows(*args, **kwargs)
11549
11550 def SetVGap(*args, **kwargs):
11551 """
11552 SetVGap(self, int gap)
11553
11554 Sets the vertical gap (in pixels) between the cells in the sizer.
11555 """
11556 return _core_.GridSizer_SetVGap(*args, **kwargs)
11557
11558 def SetHGap(*args, **kwargs):
11559 """
11560 SetHGap(self, int gap)
11561
11562 Sets the horizontal gap (in pixels) between cells in the sizer
11563 """
11564 return _core_.GridSizer_SetHGap(*args, **kwargs)
11565
11566 def GetCols(*args, **kwargs):
11567 """
11568 GetCols(self) -> int
11569
11570 Returns the number of columns in the sizer.
11571 """
11572 return _core_.GridSizer_GetCols(*args, **kwargs)
11573
11574 def GetRows(*args, **kwargs):
11575 """
11576 GetRows(self) -> int
11577
11578 Returns the number of rows in the sizer.
11579 """
11580 return _core_.GridSizer_GetRows(*args, **kwargs)
11581
11582 def GetVGap(*args, **kwargs):
11583 """
11584 GetVGap(self) -> int
11585
11586 Returns the vertical gap (in pixels) between the cells in the sizer.
11587 """
11588 return _core_.GridSizer_GetVGap(*args, **kwargs)
11589
11590 def GetHGap(*args, **kwargs):
11591 """
11592 GetHGap(self) -> int
11593
11594 Returns the horizontal gap (in pixels) between cells in the sizer.
11595 """
11596 return _core_.GridSizer_GetHGap(*args, **kwargs)
11597
11598 def CalcRowsCols(self):
11599 """
11600 CalcRowsCols() -> (rows, cols)
11601
11602 Calculates how many rows and columns will be in the sizer based
11603 on the current number of items and also the rows, cols specified
11604 in the constructor.
11605 """
11606 nitems = len(self.GetChildren())
11607 rows = self.GetRows()
11608 cols = self.GetCols()
11609 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11610 if cols != 0:
11611 rows = (nitems + cols - 1) / cols
11612 elif rows != 0:
11613 cols = (nitems + rows - 1) / rows
11614 return (rows, cols)
11615
11616 _core_.GridSizer_swigregister(GridSizer)
11617
11618 #---------------------------------------------------------------------------
11619
11620 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11621 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11622 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11623 class FlexGridSizer(GridSizer):
11624 """
11625 A flex grid sizer is a sizer which lays out its children in a
11626 two-dimensional table with all table cells in one row having the same
11627 height and all cells in one column having the same width, but all
11628 rows or all columns are not necessarily the same height or width as in
11629 the `wx.GridSizer`.
11630
11631 wx.FlexGridSizer can also size items equally in one direction but
11632 unequally ("flexibly") in the other. If the sizer is only flexible
11633 in one direction (this can be changed using `SetFlexibleDirection`), it
11634 needs to be decided how the sizer should grow in the other ("non
11635 flexible") direction in order to fill the available space. The
11636 `SetNonFlexibleGrowMode` method serves this purpose.
11637
11638
11639 """
11640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11641 __repr__ = _swig_repr
11642 def __init__(self, *args, **kwargs):
11643 """
11644 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11645
11646 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11647 number of columns and rows in the sizer - if either of the parameters
11648 is zero, it will be calculated to from the total number of children in
11649 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11650 define extra space between all children.
11651 """
11652 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11653 self._setOORInfo(self)
11654
11655 def AddGrowableRow(*args, **kwargs):
11656 """
11657 AddGrowableRow(self, size_t idx, int proportion=0)
11658
11659 Specifies that row *idx* (starting from zero) should be grown if there
11660 is extra space available to the sizer.
11661
11662 The *proportion* parameter has the same meaning as the stretch factor
11663 for the box sizers except that if all proportions are 0, then all
11664 columns are resized equally (instead of not being resized at all).
11665 """
11666 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11667
11668 def RemoveGrowableRow(*args, **kwargs):
11669 """
11670 RemoveGrowableRow(self, size_t idx)
11671
11672 Specifies that row *idx* is no longer growable.
11673 """
11674 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11675
11676 def AddGrowableCol(*args, **kwargs):
11677 """
11678 AddGrowableCol(self, size_t idx, int proportion=0)
11679
11680 Specifies that column *idx* (starting from zero) should be grown if
11681 there is extra space available to the sizer.
11682
11683 The *proportion* parameter has the same meaning as the stretch factor
11684 for the box sizers except that if all proportions are 0, then all
11685 columns are resized equally (instead of not being resized at all).
11686 """
11687 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11688
11689 def RemoveGrowableCol(*args, **kwargs):
11690 """
11691 RemoveGrowableCol(self, size_t idx)
11692
11693 Specifies that column *idx* is no longer growable.
11694 """
11695 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11696
11697 def SetFlexibleDirection(*args, **kwargs):
11698 """
11699 SetFlexibleDirection(self, int direction)
11700
11701 Specifies whether the sizer should flexibly resize its columns, rows,
11702 or both. Argument *direction* can be one of the following values. Any
11703 other value is ignored.
11704
11705 ============== =======================================
11706 wx.VERTICAL Rows are flexibly sized.
11707 wx.HORIZONTAL Columns are flexibly sized.
11708 wx.BOTH Both rows and columns are flexibly sized
11709 (this is the default value).
11710 ============== =======================================
11711
11712 Note that this method does not trigger relayout.
11713
11714 """
11715 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11716
11717 def GetFlexibleDirection(*args, **kwargs):
11718 """
11719 GetFlexibleDirection(self) -> int
11720
11721 Returns a value that specifies whether the sizer
11722 flexibly resizes its columns, rows, or both (default).
11723
11724 :see: `SetFlexibleDirection`
11725 """
11726 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11727
11728 def SetNonFlexibleGrowMode(*args, **kwargs):
11729 """
11730 SetNonFlexibleGrowMode(self, int mode)
11731
11732 Specifies how the sizer should grow in the non-flexible direction if
11733 there is one (so `SetFlexibleDirection` must have been called
11734 previously). Argument *mode* can be one of the following values:
11735
11736 ========================== =================================================
11737 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11738 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11739 `AddGrowableCol` and `AddGrowableRow`. In this
11740 case equal sizing applies to minimum sizes of
11741 columns or rows (this is the default value).
11742 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11743 the non flexible direction, whether they are
11744 growable or not in the flexbile direction.
11745 ========================== =================================================
11746
11747 Note that this method does not trigger relayout.
11748
11749
11750 """
11751 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11752
11753 def GetNonFlexibleGrowMode(*args, **kwargs):
11754 """
11755 GetNonFlexibleGrowMode(self) -> int
11756
11757 Returns the value that specifies how the sizer grows in the
11758 non-flexible direction if there is one.
11759
11760 :see: `SetNonFlexibleGrowMode`
11761 """
11762 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11763
11764 def GetRowHeights(*args, **kwargs):
11765 """
11766 GetRowHeights(self) -> list
11767
11768 Returns a list of integers representing the heights of each of the
11769 rows in the sizer.
11770 """
11771 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11772
11773 def GetColWidths(*args, **kwargs):
11774 """
11775 GetColWidths(self) -> list
11776
11777 Returns a list of integers representing the widths of each of the
11778 columns in the sizer.
11779 """
11780 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11781
11782 _core_.FlexGridSizer_swigregister(FlexGridSizer)
11783
11784 class StdDialogButtonSizer(BoxSizer):
11785 """
11786 A special sizer that knows how to order and position standard buttons
11787 in order to conform to the current platform's standards. You simply
11788 need to add each `wx.Button` to the sizer, and be sure to create the
11789 buttons using the standard ID's. Then call `Realize` and the sizer
11790 will take care of the rest.
11791
11792 """
11793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11794 __repr__ = _swig_repr
11795 def __init__(self, *args, **kwargs):
11796 """__init__(self) -> StdDialogButtonSizer"""
11797 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11798 def AddButton(*args, **kwargs):
11799 """
11800 AddButton(self, wxButton button)
11801
11802 Use this to add the buttons to this sizer. Do not use the `Add`
11803 method in the base class.
11804 """
11805 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11806
11807 def Realize(*args, **kwargs):
11808 """
11809 Realize(self)
11810
11811 This funciton needs to be called after all the buttons have been added
11812 to the sizer. It will reorder them and position them in a platform
11813 specifc manner.
11814 """
11815 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11816
11817 def SetAffirmativeButton(*args, **kwargs):
11818 """SetAffirmativeButton(self, wxButton button)"""
11819 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11820
11821 def SetNegativeButton(*args, **kwargs):
11822 """SetNegativeButton(self, wxButton button)"""
11823 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11824
11825 def SetCancelButton(*args, **kwargs):
11826 """SetCancelButton(self, wxButton button)"""
11827 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11828
11829 def GetAffirmativeButton(*args, **kwargs):
11830 """GetAffirmativeButton(self) -> wxButton"""
11831 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11832
11833 def GetApplyButton(*args, **kwargs):
11834 """GetApplyButton(self) -> wxButton"""
11835 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11836
11837 def GetNegativeButton(*args, **kwargs):
11838 """GetNegativeButton(self) -> wxButton"""
11839 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11840
11841 def GetCancelButton(*args, **kwargs):
11842 """GetCancelButton(self) -> wxButton"""
11843 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11844
11845 def GetHelpButton(*args, **kwargs):
11846 """GetHelpButton(self) -> wxButton"""
11847 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11848
11849 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11850
11851 #---------------------------------------------------------------------------
11852
11853 class GBPosition(object):
11854 """
11855 This class represents the position of an item in a virtual grid of
11856 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11857 typemaps that will automatically convert from a 2-element sequence of
11858 integers to a wx.GBPosition, so you can use the more pythonic
11859 representation of the position nearly transparently in Python code.
11860 """
11861 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11862 __repr__ = _swig_repr
11863 def __init__(self, *args, **kwargs):
11864 """
11865 __init__(self, int row=0, int col=0) -> GBPosition
11866
11867 This class represents the position of an item in a virtual grid of
11868 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11869 typemaps that will automatically convert from a 2-element sequence of
11870 integers to a wx.GBPosition, so you can use the more pythonic
11871 representation of the position nearly transparently in Python code.
11872 """
11873 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11874 __swig_destroy__ = _core_.delete_GBPosition
11875 __del__ = lambda self : None;
11876 def GetRow(*args, **kwargs):
11877 """GetRow(self) -> int"""
11878 return _core_.GBPosition_GetRow(*args, **kwargs)
11879
11880 def GetCol(*args, **kwargs):
11881 """GetCol(self) -> int"""
11882 return _core_.GBPosition_GetCol(*args, **kwargs)
11883
11884 def SetRow(*args, **kwargs):
11885 """SetRow(self, int row)"""
11886 return _core_.GBPosition_SetRow(*args, **kwargs)
11887
11888 def SetCol(*args, **kwargs):
11889 """SetCol(self, int col)"""
11890 return _core_.GBPosition_SetCol(*args, **kwargs)
11891
11892 def __eq__(*args, **kwargs):
11893 """
11894 __eq__(self, PyObject other) -> bool
11895
11896 Compare GBPosition for equality.
11897 """
11898 return _core_.GBPosition___eq__(*args, **kwargs)
11899
11900 def __ne__(*args, **kwargs):
11901 """
11902 __ne__(self, PyObject other) -> bool
11903
11904 Compare GBPosition for inequality.
11905 """
11906 return _core_.GBPosition___ne__(*args, **kwargs)
11907
11908 def Set(*args, **kwargs):
11909 """Set(self, int row=0, int col=0)"""
11910 return _core_.GBPosition_Set(*args, **kwargs)
11911
11912 def Get(*args, **kwargs):
11913 """Get(self) -> PyObject"""
11914 return _core_.GBPosition_Get(*args, **kwargs)
11915
11916 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11917 def __str__(self): return str(self.Get())
11918 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11919 def __len__(self): return len(self.Get())
11920 def __getitem__(self, index): return self.Get()[index]
11921 def __setitem__(self, index, val):
11922 if index == 0: self.SetRow(val)
11923 elif index == 1: self.SetCol(val)
11924 else: raise IndexError
11925 def __nonzero__(self): return self.Get() != (0,0)
11926 __safe_for_unpickling__ = True
11927 def __reduce__(self): return (wx.GBPosition, self.Get())
11928
11929 row = property(GetRow, SetRow)
11930 col = property(GetCol, SetCol)
11931
11932 _core_.GBPosition_swigregister(GBPosition)
11933
11934 class GBSpan(object):
11935 """
11936 This class is used to hold the row and column spanning attributes of
11937 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11938 automatically convert from a 2-element sequence of integers to a
11939 wx.GBSpan, so you can use the more pythonic representation of the span
11940 nearly transparently in Python code.
11941
11942 """
11943 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11944 __repr__ = _swig_repr
11945 def __init__(self, *args, **kwargs):
11946 """
11947 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11948
11949 Construct a new wxGBSpan, optionally setting the rowspan and
11950 colspan. The default is (1,1). (Meaning that the item occupies one
11951 cell in each direction.
11952 """
11953 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11954 __swig_destroy__ = _core_.delete_GBSpan
11955 __del__ = lambda self : None;
11956 def GetRowspan(*args, **kwargs):
11957 """GetRowspan(self) -> int"""
11958 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11959
11960 def GetColspan(*args, **kwargs):
11961 """GetColspan(self) -> int"""
11962 return _core_.GBSpan_GetColspan(*args, **kwargs)
11963
11964 def SetRowspan(*args, **kwargs):
11965 """SetRowspan(self, int rowspan)"""
11966 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11967
11968 def SetColspan(*args, **kwargs):
11969 """SetColspan(self, int colspan)"""
11970 return _core_.GBSpan_SetColspan(*args, **kwargs)
11971
11972 def __eq__(*args, **kwargs):
11973 """
11974 __eq__(self, PyObject other) -> bool
11975
11976 Compare wxGBSpan for equality.
11977 """
11978 return _core_.GBSpan___eq__(*args, **kwargs)
11979
11980 def __ne__(*args, **kwargs):
11981 """
11982 __ne__(self, PyObject other) -> bool
11983
11984 Compare GBSpan for inequality.
11985 """
11986 return _core_.GBSpan___ne__(*args, **kwargs)
11987
11988 def Set(*args, **kwargs):
11989 """Set(self, int rowspan=1, int colspan=1)"""
11990 return _core_.GBSpan_Set(*args, **kwargs)
11991
11992 def Get(*args, **kwargs):
11993 """Get(self) -> PyObject"""
11994 return _core_.GBSpan_Get(*args, **kwargs)
11995
11996 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11997 def __str__(self): return str(self.Get())
11998 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11999 def __len__(self): return len(self.Get())
12000 def __getitem__(self, index): return self.Get()[index]
12001 def __setitem__(self, index, val):
12002 if index == 0: self.SetRowspan(val)
12003 elif index == 1: self.SetColspan(val)
12004 else: raise IndexError
12005 def __nonzero__(self): return self.Get() != (0,0)
12006 __safe_for_unpickling__ = True
12007 def __reduce__(self): return (wx.GBSpan, self.Get())
12008
12009 rowspan = property(GetRowspan, SetRowspan)
12010 colspan = property(GetColspan, SetColspan)
12011
12012 _core_.GBSpan_swigregister(GBSpan)
12013
12014 class GBSizerItem(SizerItem):
12015 """
12016 The wx.GBSizerItem class is used to track the additional data about
12017 items in a `wx.GridBagSizer` such as the item's position in the grid
12018 and how many rows or columns it spans.
12019
12020 """
12021 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12022 __repr__ = _swig_repr
12023 def __init__(self, *args, **kwargs):
12024 """
12025 __init__(self) -> GBSizerItem
12026
12027 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12028 size will need to be set, as well as a position and span before this
12029 item can be used in a Sizer.
12030
12031 You will probably never need to create a wx.GBSizerItem directly as they
12032 are created automatically when the sizer's Add method is called.
12033 """
12034 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12035 __swig_destroy__ = _core_.delete_GBSizerItem
12036 __del__ = lambda self : None;
12037 def GetPos(*args, **kwargs):
12038 """
12039 GetPos(self) -> GBPosition
12040
12041 Get the grid position of the item
12042 """
12043 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12044
12045 def GetPosTuple(self): return self.GetPos().Get()
12046 def GetSpan(*args, **kwargs):
12047 """
12048 GetSpan(self) -> GBSpan
12049
12050 Get the row and column spanning of the item
12051 """
12052 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12053
12054 def GetSpanTuple(self): return self.GetSpan().Get()
12055 def SetPos(*args, **kwargs):
12056 """
12057 SetPos(self, GBPosition pos) -> bool
12058
12059 If the item is already a member of a sizer then first ensure that
12060 there is no other item that would intersect with this one at the new
12061 position, then set the new position. Returns True if the change is
12062 successful and after the next Layout() the item will be moved.
12063 """
12064 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12065
12066 def SetSpan(*args, **kwargs):
12067 """
12068 SetSpan(self, GBSpan span) -> bool
12069
12070 If the item is already a member of a sizer then first ensure that
12071 there is no other item that would intersect with this one with its new
12072 spanning size, then set the new spanning. Returns True if the change
12073 is successful and after the next Layout() the item will be resized.
12074
12075 """
12076 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12077
12078 def Intersects(*args, **kwargs):
12079 """
12080 Intersects(self, GBSizerItem other) -> bool
12081
12082 Returns True if this item and the other item instersect.
12083 """
12084 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12085
12086 def IntersectsPos(*args, **kwargs):
12087 """
12088 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12089
12090 Returns True if the given pos/span would intersect with this item.
12091 """
12092 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12093
12094 def GetEndPos(*args, **kwargs):
12095 """
12096 GetEndPos(self) -> GBPosition
12097
12098 Get the row and column of the endpoint of this item.
12099 """
12100 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12101
12102 def GetGBSizer(*args, **kwargs):
12103 """
12104 GetGBSizer(self) -> GridBagSizer
12105
12106 Get the sizer this item is a member of.
12107 """
12108 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12109
12110 def SetGBSizer(*args, **kwargs):
12111 """
12112 SetGBSizer(self, GridBagSizer sizer)
12113
12114 Set the sizer this item is a member of.
12115 """
12116 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12117
12118 _core_.GBSizerItem_swigregister(GBSizerItem)
12119 DefaultSpan = cvar.DefaultSpan
12120
12121 def GBSizerItemWindow(*args, **kwargs):
12122 """
12123 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12124 int border, PyObject userData=None) -> GBSizerItem
12125
12126 Construct a `wx.GBSizerItem` for a window.
12127 """
12128 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12129 return val
12130
12131 def GBSizerItemSizer(*args, **kwargs):
12132 """
12133 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12134 int border, PyObject userData=None) -> GBSizerItem
12135
12136 Construct a `wx.GBSizerItem` for a sizer
12137 """
12138 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12139 return val
12140
12141 def GBSizerItemSpacer(*args, **kwargs):
12142 """
12143 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12144 int flag, int border, PyObject userData=None) -> GBSizerItem
12145
12146 Construct a `wx.GBSizerItem` for a spacer.
12147 """
12148 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12149 return val
12150
12151 class GridBagSizer(FlexGridSizer):
12152 """
12153 A `wx.Sizer` that can lay out items in a virtual grid like a
12154 `wx.FlexGridSizer` but in this case explicit positioning of the items
12155 is allowed using `wx.GBPosition`, and items can optionally span more
12156 than one row and/or column using `wx.GBSpan`. The total size of the
12157 virtual grid is determined by the largest row and column that items are
12158 positioned at, adjusted for spanning.
12159
12160 """
12161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12162 __repr__ = _swig_repr
12163 def __init__(self, *args, **kwargs):
12164 """
12165 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12166
12167 Constructor, with optional parameters to specify the gap between the
12168 rows and columns.
12169 """
12170 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12171 self._setOORInfo(self)
12172
12173 def Add(*args, **kwargs):
12174 """
12175 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12176 int border=0, userData=None) -> wx.GBSizerItem
12177
12178 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12179 more than one row or column as specified with *span*. The remaining
12180 args behave similarly to `wx.Sizer.Add`.
12181
12182 Returns True if the item was successfully placed at the given cell
12183 position, False if something was already there.
12184
12185 """
12186 return _core_.GridBagSizer_Add(*args, **kwargs)
12187
12188 def AddItem(*args, **kwargs):
12189 """
12190 Add(self, GBSizerItem item) -> wx.GBSizerItem
12191
12192 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12193 the item was successfully placed at its given cell position, False if
12194 something was already there.
12195 """
12196 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12197
12198 def GetCellSize(*args, **kwargs):
12199 """
12200 GetCellSize(self, int row, int col) -> Size
12201
12202 Get the size of the specified cell, including hgap and
12203 vgap. Only valid after a Layout.
12204 """
12205 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12206
12207 def GetEmptyCellSize(*args, **kwargs):
12208 """
12209 GetEmptyCellSize(self) -> Size
12210
12211 Get the size used for cells in the grid with no item.
12212 """
12213 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12214
12215 def SetEmptyCellSize(*args, **kwargs):
12216 """
12217 SetEmptyCellSize(self, Size sz)
12218
12219 Set the size used for cells in the grid with no item.
12220 """
12221 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12222
12223 def GetItemPosition(*args):
12224 """
12225 GetItemPosition(self, item) -> GBPosition
12226
12227 Get the grid position of the specified *item* where *item* is either a
12228 window or subsizer that is a member of this sizer, or a zero-based
12229 index of an item.
12230 """
12231 return _core_.GridBagSizer_GetItemPosition(*args)
12232
12233 def SetItemPosition(*args):
12234 """
12235 SetItemPosition(self, item, GBPosition pos) -> bool
12236
12237 Set the grid position of the specified *item* where *item* is either a
12238 window or subsizer that is a member of this sizer, or a zero-based
12239 index of an item. Returns True on success. If the move is not
12240 allowed (because an item is already there) then False is returned.
12241
12242 """
12243 return _core_.GridBagSizer_SetItemPosition(*args)
12244
12245 def GetItemSpan(*args):
12246 """
12247 GetItemSpan(self, item) -> GBSpan
12248
12249 Get the row/col spanning of the specified *item* where *item* is
12250 either a window or subsizer that is a member of this sizer, or a
12251 zero-based index of an item.
12252 """
12253 return _core_.GridBagSizer_GetItemSpan(*args)
12254
12255 def SetItemSpan(*args):
12256 """
12257 SetItemSpan(self, item, GBSpan span) -> bool
12258
12259 Set the row/col spanning of the specified *item* where *item* is
12260 either a window or subsizer that is a member of this sizer, or a
12261 zero-based index of an item. Returns True on success. If the move is
12262 not allowed (because an item is already there) then False is returned.
12263 """
12264 return _core_.GridBagSizer_SetItemSpan(*args)
12265
12266 def FindItem(*args):
12267 """
12268 FindItem(self, item) -> GBSizerItem
12269
12270 Find the sizer item for the given window or subsizer, returns None if
12271 not found. (non-recursive)
12272 """
12273 return _core_.GridBagSizer_FindItem(*args)
12274
12275 def FindItemAtPosition(*args, **kwargs):
12276 """
12277 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12278
12279 Return the sizer item for the given grid cell, or None if there is no
12280 item at that position. (non-recursive)
12281 """
12282 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12283
12284 def FindItemAtPoint(*args, **kwargs):
12285 """
12286 FindItemAtPoint(self, Point pt) -> GBSizerItem
12287
12288 Return the sizer item located at the point given in *pt*, or None if
12289 there is no item at that point. The (x,y) coordinates in pt correspond
12290 to the client coordinates of the window using the sizer for
12291 layout. (non-recursive)
12292 """
12293 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12294
12295 def CheckForIntersection(*args, **kwargs):
12296 """
12297 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12298
12299 Look at all items and see if any intersect (or would overlap) the
12300 given *item*. Returns True if so, False if there would be no overlap.
12301 If an *excludeItem* is given then it will not be checked for
12302 intersection, for example it may be the item we are checking the
12303 position of.
12304
12305 """
12306 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12307
12308 def CheckForIntersectionPos(*args, **kwargs):
12309 """
12310 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12311
12312 Look at all items and see if any intersect (or would overlap) the
12313 given position and span. Returns True if so, False if there would be
12314 no overlap. If an *excludeItem* is given then it will not be checked
12315 for intersection, for example it may be the item we are checking the
12316 position of.
12317 """
12318 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12319
12320 _core_.GridBagSizer_swigregister(GridBagSizer)
12321
12322 #---------------------------------------------------------------------------
12323
12324 Left = _core_.Left
12325 Top = _core_.Top
12326 Right = _core_.Right
12327 Bottom = _core_.Bottom
12328 Width = _core_.Width
12329 Height = _core_.Height
12330 Centre = _core_.Centre
12331 Center = _core_.Center
12332 CentreX = _core_.CentreX
12333 CentreY = _core_.CentreY
12334 Unconstrained = _core_.Unconstrained
12335 AsIs = _core_.AsIs
12336 PercentOf = _core_.PercentOf
12337 Above = _core_.Above
12338 Below = _core_.Below
12339 LeftOf = _core_.LeftOf
12340 RightOf = _core_.RightOf
12341 SameAs = _core_.SameAs
12342 Absolute = _core_.Absolute
12343 class IndividualLayoutConstraint(Object):
12344 """
12345 Objects of this class are stored in the `wx.LayoutConstraints` class as
12346 one of eight possible constraints that a window can be involved in.
12347 You will never need to create an instance of
12348 wx.IndividualLayoutConstraint, rather you should create a
12349 `wx.LayoutConstraints` instance and use the individual contstraints
12350 that it contains.
12351 """
12352 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12353 def __init__(self): raise AttributeError, "No constructor defined"
12354 __repr__ = _swig_repr
12355 def Set(*args, **kwargs):
12356 """
12357 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12358
12359 Sets the properties of the constraint. Normally called by one of the
12360 convenience functions such as Above, RightOf, SameAs.
12361 """
12362 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12363
12364 def LeftOf(*args, **kwargs):
12365 """
12366 LeftOf(self, Window sibling, int marg=0)
12367
12368 Constrains this edge to be to the left of the given window, with an
12369 optional margin. Implicitly, this is relative to the left edge of the
12370 other window.
12371 """
12372 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12373
12374 def RightOf(*args, **kwargs):
12375 """
12376 RightOf(self, Window sibling, int marg=0)
12377
12378 Constrains this edge to be to the right of the given window, with an
12379 optional margin. Implicitly, this is relative to the right edge of the
12380 other window.
12381 """
12382 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12383
12384 def Above(*args, **kwargs):
12385 """
12386 Above(self, Window sibling, int marg=0)
12387
12388 Constrains this edge to be above the given window, with an optional
12389 margin. Implicitly, this is relative to the top edge of the other
12390 window.
12391 """
12392 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12393
12394 def Below(*args, **kwargs):
12395 """
12396 Below(self, Window sibling, int marg=0)
12397
12398 Constrains this edge to be below the given window, with an optional
12399 margin. Implicitly, this is relative to the bottom edge of the other
12400 window.
12401 """
12402 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12403
12404 def SameAs(*args, **kwargs):
12405 """
12406 SameAs(self, Window otherW, int edge, int marg=0)
12407
12408 Constrains this edge or dimension to be to the same as the edge of the
12409 given window, with an optional margin.
12410 """
12411 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12412
12413 def PercentOf(*args, **kwargs):
12414 """
12415 PercentOf(self, Window otherW, int wh, int per)
12416
12417 Constrains this edge or dimension to be to a percentage of the given
12418 window, with an optional margin.
12419 """
12420 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12421
12422 def Absolute(*args, **kwargs):
12423 """
12424 Absolute(self, int val)
12425
12426 Constrains this edge or dimension to be the given absolute value.
12427 """
12428 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12429
12430 def Unconstrained(*args, **kwargs):
12431 """
12432 Unconstrained(self)
12433
12434 Sets this edge or dimension to be unconstrained, that is, dependent on
12435 other edges and dimensions from which this value can be deduced.
12436 """
12437 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12438
12439 def AsIs(*args, **kwargs):
12440 """
12441 AsIs(self)
12442
12443 Sets this edge or constraint to be whatever the window's value is at
12444 the moment. If either of the width and height constraints are *as is*,
12445 the window will not be resized, but moved instead. This is important
12446 when considering panel items which are intended to have a default
12447 size, such as a button, which may take its size from the size of the
12448 button label.
12449 """
12450 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12451
12452 def GetOtherWindow(*args, **kwargs):
12453 """GetOtherWindow(self) -> Window"""
12454 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12455
12456 def GetMyEdge(*args, **kwargs):
12457 """GetMyEdge(self) -> int"""
12458 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12459
12460 def SetEdge(*args, **kwargs):
12461 """SetEdge(self, int which)"""
12462 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12463
12464 def SetValue(*args, **kwargs):
12465 """SetValue(self, int v)"""
12466 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12467
12468 def GetMargin(*args, **kwargs):
12469 """GetMargin(self) -> int"""
12470 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12471
12472 def SetMargin(*args, **kwargs):
12473 """SetMargin(self, int m)"""
12474 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12475
12476 def GetValue(*args, **kwargs):
12477 """GetValue(self) -> int"""
12478 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12479
12480 def GetPercent(*args, **kwargs):
12481 """GetPercent(self) -> int"""
12482 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12483
12484 def GetOtherEdge(*args, **kwargs):
12485 """GetOtherEdge(self) -> int"""
12486 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12487
12488 def GetDone(*args, **kwargs):
12489 """GetDone(self) -> bool"""
12490 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12491
12492 def SetDone(*args, **kwargs):
12493 """SetDone(self, bool d)"""
12494 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12495
12496 def GetRelationship(*args, **kwargs):
12497 """GetRelationship(self) -> int"""
12498 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12499
12500 def SetRelationship(*args, **kwargs):
12501 """SetRelationship(self, int r)"""
12502 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12503
12504 def ResetIfWin(*args, **kwargs):
12505 """
12506 ResetIfWin(self, Window otherW) -> bool
12507
12508 Reset constraint if it mentions otherWin
12509 """
12510 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12511
12512 def SatisfyConstraint(*args, **kwargs):
12513 """
12514 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12515
12516 Try to satisfy constraint
12517 """
12518 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12519
12520 def GetEdge(*args, **kwargs):
12521 """
12522 GetEdge(self, int which, Window thisWin, Window other) -> int
12523
12524 Get the value of this edge or dimension, or if this
12525 is not determinable, -1.
12526 """
12527 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12528
12529 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12530
12531 class LayoutConstraints(Object):
12532 """
12533 **Note:** constraints are now deprecated and you should use sizers
12534 instead.
12535
12536 Objects of this class can be associated with a window to define its
12537 layout constraints, with respect to siblings or its parent.
12538
12539 The class consists of the following eight constraints of class
12540 wx.IndividualLayoutConstraint, some or all of which should be accessed
12541 directly to set the appropriate constraints.
12542
12543 * left: represents the left hand edge of the window
12544 * right: represents the right hand edge of the window
12545 * top: represents the top edge of the window
12546 * bottom: represents the bottom edge of the window
12547 * width: represents the width of the window
12548 * height: represents the height of the window
12549 * centreX: represents the horizontal centre point of the window
12550 * centreY: represents the vertical centre point of the window
12551
12552 Most constraints are initially set to have the relationship
12553 wxUnconstrained, which means that their values should be calculated by
12554 looking at known constraints. The exceptions are width and height,
12555 which are set to wxAsIs to ensure that if the user does not specify a
12556 constraint, the existing width and height will be used, to be
12557 compatible with panel items which often have take a default size. If
12558 the constraint is ``wx.AsIs``, the dimension will not be changed.
12559
12560 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12561
12562 """
12563 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12564 __repr__ = _swig_repr
12565 left = property(_core_.LayoutConstraints_left_get)
12566 top = property(_core_.LayoutConstraints_top_get)
12567 right = property(_core_.LayoutConstraints_right_get)
12568 bottom = property(_core_.LayoutConstraints_bottom_get)
12569 width = property(_core_.LayoutConstraints_width_get)
12570 height = property(_core_.LayoutConstraints_height_get)
12571 centreX = property(_core_.LayoutConstraints_centreX_get)
12572 centreY = property(_core_.LayoutConstraints_centreY_get)
12573 def __init__(self, *args, **kwargs):
12574 """__init__(self) -> LayoutConstraints"""
12575 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12576 __swig_destroy__ = _core_.delete_LayoutConstraints
12577 __del__ = lambda self : None;
12578 def SatisfyConstraints(*args, **kwargs):
12579 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12580 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12581
12582 def AreSatisfied(*args, **kwargs):
12583 """AreSatisfied(self) -> bool"""
12584 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12585
12586 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12587
12588 #----------------------------------------------------------------------------
12589
12590 # Use Python's bool constants if available, make some if not
12591 try:
12592 True
12593 except NameError:
12594 __builtins__.True = 1==1
12595 __builtins__.False = 1==0
12596 def bool(value): return not not value
12597 __builtins__.bool = bool
12598
12599
12600
12601 # workarounds for bad wxRTTI names
12602 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12603 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12604 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12605
12606
12607 #----------------------------------------------------------------------------
12608 # Load version numbers from __version__... Ensure that major and minor
12609 # versions are the same for both wxPython and wxWidgets.
12610
12611 from __version__ import *
12612 __version__ = VERSION_STRING
12613
12614 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12615 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12616 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12617 import warnings
12618 warnings.warn("wxPython/wxWidgets release number mismatch")
12619
12620 #----------------------------------------------------------------------------
12621
12622 # Set wxPython's default string<-->unicode conversion encoding from
12623 # the locale, but only if Python's default hasn't been changed. (We
12624 # assume that if the user has customized it already then that is the
12625 # encoding we need to use as well.)
12626 #
12627 # The encoding selected here is used when string or unicode objects
12628 # need to be converted in order to pass them to wxWidgets. Please be
12629 # aware that the default encoding within the same locale may be
12630 # slightly different on different platforms. For example, please see
12631 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12632 # between the common latin/roman encodings.
12633
12634 default = _sys.getdefaultencoding()
12635 if default == 'ascii':
12636 import locale
12637 import codecs
12638 try:
12639 default = locale.getdefaultlocale()[1]
12640 codecs.lookup(default)
12641 except (ValueError, LookupError, TypeError):
12642 default = _sys.getdefaultencoding()
12643 del locale
12644 del codecs
12645 if default:
12646 wx.SetDefaultPyEncoding(default)
12647 del default
12648
12649 #----------------------------------------------------------------------------
12650
12651 class PyDeadObjectError(AttributeError):
12652 pass
12653
12654 class _wxPyDeadObject(object):
12655 """
12656 Instances of wx objects that are OOR capable will have their __class__
12657 changed to this class when the C++ object is deleted. This should help
12658 prevent crashes due to referencing a bogus C++ pointer.
12659 """
12660 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12661 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12662
12663 def __repr__(self):
12664 if not hasattr(self, "_name"):
12665 self._name = "[unknown]"
12666 return self.reprStr % self._name
12667
12668 def __getattr__(self, *args):
12669 if not hasattr(self, "_name"):
12670 self._name = "[unknown]"
12671 raise PyDeadObjectError(self.attrStr % self._name)
12672
12673 def __nonzero__(self):
12674 return 0
12675
12676
12677
12678 class PyUnbornObjectError(AttributeError):
12679 pass
12680
12681 class _wxPyUnbornObject(object):
12682 """
12683 Some stock objects are created when the wx._core module is
12684 imported, but their C++ instance is not created until the wx.App
12685 object is created and initialized. These object instances will
12686 temporarily have their __class__ changed to this class so an
12687 exception will be raised if they are used before the C++ instance
12688 is ready.
12689 """
12690
12691 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12692 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12693
12694 def __repr__(self):
12695 #if not hasattr(self, "_name"):
12696 # self._name = "[unknown]"
12697 return self.reprStr #% self._name
12698
12699 def __getattr__(self, *args):
12700 #if not hasattr(self, "_name"):
12701 # self._name = "[unknown]"
12702 raise PyUnbornObjectError(self.attrStr) # % self._name )
12703
12704 def __nonzero__(self):
12705 return 0
12706
12707
12708 #----------------------------------------------------------------------------
12709
12710 def CallAfter(callable, *args, **kw):
12711 """
12712 Call the specified function after the current and pending event
12713 handlers have been completed. This is also good for making GUI
12714 method calls from non-GUI threads. Any extra positional or
12715 keyword args are passed on to the callable when it is called.
12716
12717 :see: `wx.FutureCall`
12718 """
12719 app = wx.GetApp()
12720 assert app is not None, 'No wx.App created yet'
12721
12722 if not hasattr(app, "_CallAfterId"):
12723 app._CallAfterId = wx.NewEventType()
12724 app.Connect(-1, -1, app._CallAfterId,
12725 lambda event: event.callable(*event.args, **event.kw) )
12726 evt = wx.PyEvent()
12727 evt.SetEventType(app._CallAfterId)
12728 evt.callable = callable
12729 evt.args = args
12730 evt.kw = kw
12731 wx.PostEvent(app, evt)
12732
12733 #----------------------------------------------------------------------------
12734
12735
12736 class FutureCall:
12737 """
12738 A convenience class for `wx.Timer`, that calls the given callable
12739 object once after the given amount of milliseconds, passing any
12740 positional or keyword args. The return value of the callable is
12741 availbale after it has been run with the `GetResult` method.
12742
12743 If you don't need to get the return value or restart the timer
12744 then there is no need to hold a reference to this object. It will
12745 hold a reference to itself while the timer is running (the timer
12746 has a reference to self.Notify) but the cycle will be broken when
12747 the timer completes, automatically cleaning up the wx.FutureCall
12748 object.
12749
12750 :see: `wx.CallAfter`
12751 """
12752 def __init__(self, millis, callable, *args, **kwargs):
12753 self.millis = millis
12754 self.callable = callable
12755 self.SetArgs(*args, **kwargs)
12756 self.runCount = 0
12757 self.running = False
12758 self.hasRun = False
12759 self.result = None
12760 self.timer = None
12761 self.Start()
12762
12763 def __del__(self):
12764 self.Stop()
12765
12766
12767 def Start(self, millis=None, *args, **kwargs):
12768 """
12769 (Re)start the timer
12770 """
12771 self.hasRun = False
12772 if millis is not None:
12773 self.millis = millis
12774 if args or kwargs:
12775 self.SetArgs(*args, **kwargs)
12776 self.Stop()
12777 self.timer = wx.PyTimer(self.Notify)
12778 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12779 self.running = True
12780 Restart = Start
12781
12782
12783 def Stop(self):
12784 """
12785 Stop and destroy the timer.
12786 """
12787 if self.timer is not None:
12788 self.timer.Stop()
12789 self.timer = None
12790
12791
12792 def GetInterval(self):
12793 if self.timer is not None:
12794 return self.timer.GetInterval()
12795 else:
12796 return 0
12797
12798
12799 def IsRunning(self):
12800 return self.timer is not None and self.timer.IsRunning()
12801
12802
12803 def SetArgs(self, *args, **kwargs):
12804 """
12805 (Re)set the args passed to the callable object. This is
12806 useful in conjunction with Restart if you want to schedule a
12807 new call to the same callable object but with different
12808 parameters.
12809 """
12810 self.args = args
12811 self.kwargs = kwargs
12812
12813
12814 def HasRun(self):
12815 return self.hasRun
12816
12817 def GetResult(self):
12818 return self.result
12819
12820 def Notify(self):
12821 """
12822 The timer has expired so call the callable.
12823 """
12824 if self.callable and getattr(self.callable, 'im_self', True):
12825 self.runCount += 1
12826 self.running = False
12827 self.result = self.callable(*self.args, **self.kwargs)
12828 self.hasRun = True
12829 if not self.running:
12830 # if it wasn't restarted, then cleanup
12831 wx.CallAfter(self.Stop)
12832
12833
12834
12835 #----------------------------------------------------------------------------
12836 # Control which items in this module should be documented by epydoc.
12837 # We allow only classes and functions, which will help reduce the size
12838 # of the docs by filtering out the zillions of constants, EVT objects,
12839 # and etc that don't make much sense by themselves, but are instead
12840 # documented (or will be) as part of the classes/functions/methods
12841 # where they should be used.
12842
12843 class __DocFilter:
12844 """
12845 A filter for epydoc that only allows non-Ptr classes and
12846 fucntions, in order to reduce the clutter in the API docs.
12847 """
12848 def __init__(self, globals):
12849 self._globals = globals
12850
12851 def __call__(self, name):
12852 import types
12853 obj = self._globals.get(name, None)
12854 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12855 return False
12856 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12857 return False
12858 return True
12859
12860 #----------------------------------------------------------------------------
12861 #----------------------------------------------------------------------------
12862
12863 # Import other modules in this package that should show up in the
12864 # "core" wx namespace
12865 from _gdi import *
12866 from _windows import *
12867 from _controls import *
12868 from _misc import *
12869
12870 #----------------------------------------------------------------------------
12871 #----------------------------------------------------------------------------
12872
12873
12874