]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/_core.py
wxTinderbox warning fix.
[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 FLOOD_SURFACE = _core_.FLOOD_SURFACE
137 FLOOD_BORDER = _core_.FLOOD_BORDER
138 ODDEVEN_RULE = _core_.ODDEVEN_RULE
139 WINDING_RULE = _core_.WINDING_RULE
140 TOOL_TOP = _core_.TOOL_TOP
141 TOOL_BOTTOM = _core_.TOOL_BOTTOM
142 TOOL_LEFT = _core_.TOOL_LEFT
143 TOOL_RIGHT = _core_.TOOL_RIGHT
144 OK = _core_.OK
145 YES_NO = _core_.YES_NO
146 CANCEL = _core_.CANCEL
147 YES = _core_.YES
148 NO = _core_.NO
149 NO_DEFAULT = _core_.NO_DEFAULT
150 YES_DEFAULT = _core_.YES_DEFAULT
151 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
152 ICON_HAND = _core_.ICON_HAND
153 ICON_QUESTION = _core_.ICON_QUESTION
154 ICON_INFORMATION = _core_.ICON_INFORMATION
155 ICON_STOP = _core_.ICON_STOP
156 ICON_ASTERISK = _core_.ICON_ASTERISK
157 ICON_MASK = _core_.ICON_MASK
158 ICON_WARNING = _core_.ICON_WARNING
159 ICON_ERROR = _core_.ICON_ERROR
160 FORWARD = _core_.FORWARD
161 BACKWARD = _core_.BACKWARD
162 RESET = _core_.RESET
163 HELP = _core_.HELP
164 MORE = _core_.MORE
165 SETUP = _core_.SETUP
166 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
167 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
168 SIZE_AUTO = _core_.SIZE_AUTO
169 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
170 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
171 SIZE_FORCE = _core_.SIZE_FORCE
172 PORTRAIT = _core_.PORTRAIT
173 LANDSCAPE = _core_.LANDSCAPE
174 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
175 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
176 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
177 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
178 ID_ANY = _core_.ID_ANY
179 ID_SEPARATOR = _core_.ID_SEPARATOR
180 ID_NONE = _core_.ID_NONE
181 ID_LOWEST = _core_.ID_LOWEST
182 ID_OPEN = _core_.ID_OPEN
183 ID_CLOSE = _core_.ID_CLOSE
184 ID_NEW = _core_.ID_NEW
185 ID_SAVE = _core_.ID_SAVE
186 ID_SAVEAS = _core_.ID_SAVEAS
187 ID_REVERT = _core_.ID_REVERT
188 ID_EXIT = _core_.ID_EXIT
189 ID_UNDO = _core_.ID_UNDO
190 ID_REDO = _core_.ID_REDO
191 ID_HELP = _core_.ID_HELP
192 ID_PRINT = _core_.ID_PRINT
193 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
194 ID_PREVIEW = _core_.ID_PREVIEW
195 ID_ABOUT = _core_.ID_ABOUT
196 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
197 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
198 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
199 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
200 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
201 ID_PREFERENCES = _core_.ID_PREFERENCES
202 ID_CUT = _core_.ID_CUT
203 ID_COPY = _core_.ID_COPY
204 ID_PASTE = _core_.ID_PASTE
205 ID_CLEAR = _core_.ID_CLEAR
206 ID_FIND = _core_.ID_FIND
207 ID_DUPLICATE = _core_.ID_DUPLICATE
208 ID_SELECTALL = _core_.ID_SELECTALL
209 ID_DELETE = _core_.ID_DELETE
210 ID_REPLACE = _core_.ID_REPLACE
211 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
212 ID_PROPERTIES = _core_.ID_PROPERTIES
213 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
214 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
215 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
216 ID_VIEW_LIST = _core_.ID_VIEW_LIST
217 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
218 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
219 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
220 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
221 ID_FILE1 = _core_.ID_FILE1
222 ID_FILE2 = _core_.ID_FILE2
223 ID_FILE3 = _core_.ID_FILE3
224 ID_FILE4 = _core_.ID_FILE4
225 ID_FILE5 = _core_.ID_FILE5
226 ID_FILE6 = _core_.ID_FILE6
227 ID_FILE7 = _core_.ID_FILE7
228 ID_FILE8 = _core_.ID_FILE8
229 ID_FILE9 = _core_.ID_FILE9
230 ID_OK = _core_.ID_OK
231 ID_CANCEL = _core_.ID_CANCEL
232 ID_APPLY = _core_.ID_APPLY
233 ID_YES = _core_.ID_YES
234 ID_NO = _core_.ID_NO
235 ID_STATIC = _core_.ID_STATIC
236 ID_FORWARD = _core_.ID_FORWARD
237 ID_BACKWARD = _core_.ID_BACKWARD
238 ID_DEFAULT = _core_.ID_DEFAULT
239 ID_MORE = _core_.ID_MORE
240 ID_SETUP = _core_.ID_SETUP
241 ID_RESET = _core_.ID_RESET
242 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
243 ID_YESTOALL = _core_.ID_YESTOALL
244 ID_NOTOALL = _core_.ID_NOTOALL
245 ID_ABORT = _core_.ID_ABORT
246 ID_RETRY = _core_.ID_RETRY
247 ID_IGNORE = _core_.ID_IGNORE
248 ID_ADD = _core_.ID_ADD
249 ID_REMOVE = _core_.ID_REMOVE
250 ID_UP = _core_.ID_UP
251 ID_DOWN = _core_.ID_DOWN
252 ID_HOME = _core_.ID_HOME
253 ID_REFRESH = _core_.ID_REFRESH
254 ID_STOP = _core_.ID_STOP
255 ID_INDEX = _core_.ID_INDEX
256 ID_BOLD = _core_.ID_BOLD
257 ID_ITALIC = _core_.ID_ITALIC
258 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
259 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
260 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
261 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
262 ID_UNDERLINE = _core_.ID_UNDERLINE
263 ID_INDENT = _core_.ID_INDENT
264 ID_UNINDENT = _core_.ID_UNINDENT
265 ID_ZOOM_100 = _core_.ID_ZOOM_100
266 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
267 ID_ZOOM_IN = _core_.ID_ZOOM_IN
268 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
269 ID_UNDELETE = _core_.ID_UNDELETE
270 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
271 ID_HIGHEST = _core_.ID_HIGHEST
272 OPEN = _core_.OPEN
273 SAVE = _core_.SAVE
274 HIDE_READONLY = _core_.HIDE_READONLY
275 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
276 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
277 MULTIPLE = _core_.MULTIPLE
278 CHANGE_DIR = _core_.CHANGE_DIR
279 ACCEL_ALT = _core_.ACCEL_ALT
280 ACCEL_CTRL = _core_.ACCEL_CTRL
281 ACCEL_SHIFT = _core_.ACCEL_SHIFT
282 ACCEL_NORMAL = _core_.ACCEL_NORMAL
283 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
284 PD_APP_MODAL = _core_.PD_APP_MODAL
285 PD_CAN_ABORT = _core_.PD_CAN_ABORT
286 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
287 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
288 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
289 PD_SMOOTH = _core_.PD_SMOOTH
290 PD_CAN_SKIP = _core_.PD_CAN_SKIP
291 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
292 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
293 MENU_TEAROFF = _core_.MENU_TEAROFF
294 MB_DOCKABLE = _core_.MB_DOCKABLE
295 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
296 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
297 LI_HORIZONTAL = _core_.LI_HORIZONTAL
298 LI_VERTICAL = _core_.LI_VERTICAL
299 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
300 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
301 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
302 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
303 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
304 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
305 MM_TEXT = _core_.MM_TEXT
306 MM_LOMETRIC = _core_.MM_LOMETRIC
307 MM_HIMETRIC = _core_.MM_HIMETRIC
308 MM_LOENGLISH = _core_.MM_LOENGLISH
309 MM_HIENGLISH = _core_.MM_HIENGLISH
310 MM_TWIPS = _core_.MM_TWIPS
311 MM_ISOTROPIC = _core_.MM_ISOTROPIC
312 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
313 MM_POINTS = _core_.MM_POINTS
314 MM_METRIC = _core_.MM_METRIC
315 CENTRE = _core_.CENTRE
316 CENTER = _core_.CENTER
317 HORIZONTAL = _core_.HORIZONTAL
318 VERTICAL = _core_.VERTICAL
319 BOTH = _core_.BOTH
320 LEFT = _core_.LEFT
321 RIGHT = _core_.RIGHT
322 UP = _core_.UP
323 DOWN = _core_.DOWN
324 TOP = _core_.TOP
325 BOTTOM = _core_.BOTTOM
326 NORTH = _core_.NORTH
327 SOUTH = _core_.SOUTH
328 WEST = _core_.WEST
329 EAST = _core_.EAST
330 ALL = _core_.ALL
331 ALIGN_NOT = _core_.ALIGN_NOT
332 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
333 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
334 ALIGN_LEFT = _core_.ALIGN_LEFT
335 ALIGN_TOP = _core_.ALIGN_TOP
336 ALIGN_RIGHT = _core_.ALIGN_RIGHT
337 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
338 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
339 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
340 ALIGN_CENTER = _core_.ALIGN_CENTER
341 ALIGN_CENTRE = _core_.ALIGN_CENTRE
342 ALIGN_MASK = _core_.ALIGN_MASK
343 STRETCH_NOT = _core_.STRETCH_NOT
344 SHRINK = _core_.SHRINK
345 GROW = _core_.GROW
346 EXPAND = _core_.EXPAND
347 SHAPED = _core_.SHAPED
348 FIXED_MINSIZE = _core_.FIXED_MINSIZE
349 TILE = _core_.TILE
350 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
351 BORDER_DEFAULT = _core_.BORDER_DEFAULT
352 BORDER_NONE = _core_.BORDER_NONE
353 BORDER_STATIC = _core_.BORDER_STATIC
354 BORDER_SIMPLE = _core_.BORDER_SIMPLE
355 BORDER_RAISED = _core_.BORDER_RAISED
356 BORDER_SUNKEN = _core_.BORDER_SUNKEN
357 BORDER_DOUBLE = _core_.BORDER_DOUBLE
358 BORDER_MASK = _core_.BORDER_MASK
359 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
360 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
361 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
362 DEFAULT = _core_.DEFAULT
363 DECORATIVE = _core_.DECORATIVE
364 ROMAN = _core_.ROMAN
365 SCRIPT = _core_.SCRIPT
366 SWISS = _core_.SWISS
367 MODERN = _core_.MODERN
368 TELETYPE = _core_.TELETYPE
369 VARIABLE = _core_.VARIABLE
370 FIXED = _core_.FIXED
371 NORMAL = _core_.NORMAL
372 LIGHT = _core_.LIGHT
373 BOLD = _core_.BOLD
374 ITALIC = _core_.ITALIC
375 SLANT = _core_.SLANT
376 SOLID = _core_.SOLID
377 DOT = _core_.DOT
378 LONG_DASH = _core_.LONG_DASH
379 SHORT_DASH = _core_.SHORT_DASH
380 DOT_DASH = _core_.DOT_DASH
381 USER_DASH = _core_.USER_DASH
382 TRANSPARENT = _core_.TRANSPARENT
383 STIPPLE = _core_.STIPPLE
384 STIPPLE_MASK = _core_.STIPPLE_MASK
385 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
386 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
387 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
388 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
389 CROSS_HATCH = _core_.CROSS_HATCH
390 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
391 VERTICAL_HATCH = _core_.VERTICAL_HATCH
392 JOIN_BEVEL = _core_.JOIN_BEVEL
393 JOIN_MITER = _core_.JOIN_MITER
394 JOIN_ROUND = _core_.JOIN_ROUND
395 CAP_ROUND = _core_.CAP_ROUND
396 CAP_PROJECTING = _core_.CAP_PROJECTING
397 CAP_BUTT = _core_.CAP_BUTT
398 CLEAR = _core_.CLEAR
399 XOR = _core_.XOR
400 INVERT = _core_.INVERT
401 OR_REVERSE = _core_.OR_REVERSE
402 AND_REVERSE = _core_.AND_REVERSE
403 COPY = _core_.COPY
404 AND = _core_.AND
405 AND_INVERT = _core_.AND_INVERT
406 NO_OP = _core_.NO_OP
407 NOR = _core_.NOR
408 EQUIV = _core_.EQUIV
409 SRC_INVERT = _core_.SRC_INVERT
410 OR_INVERT = _core_.OR_INVERT
411 NAND = _core_.NAND
412 OR = _core_.OR
413 SET = _core_.SET
414 WXK_BACK = _core_.WXK_BACK
415 WXK_TAB = _core_.WXK_TAB
416 WXK_RETURN = _core_.WXK_RETURN
417 WXK_ESCAPE = _core_.WXK_ESCAPE
418 WXK_SPACE = _core_.WXK_SPACE
419 WXK_DELETE = _core_.WXK_DELETE
420 WXK_START = _core_.WXK_START
421 WXK_LBUTTON = _core_.WXK_LBUTTON
422 WXK_RBUTTON = _core_.WXK_RBUTTON
423 WXK_CANCEL = _core_.WXK_CANCEL
424 WXK_MBUTTON = _core_.WXK_MBUTTON
425 WXK_CLEAR = _core_.WXK_CLEAR
426 WXK_SHIFT = _core_.WXK_SHIFT
427 WXK_ALT = _core_.WXK_ALT
428 WXK_CONTROL = _core_.WXK_CONTROL
429 WXK_MENU = _core_.WXK_MENU
430 WXK_PAUSE = _core_.WXK_PAUSE
431 WXK_CAPITAL = _core_.WXK_CAPITAL
432 WXK_PRIOR = _core_.WXK_PRIOR
433 WXK_NEXT = _core_.WXK_NEXT
434 WXK_END = _core_.WXK_END
435 WXK_HOME = _core_.WXK_HOME
436 WXK_LEFT = _core_.WXK_LEFT
437 WXK_UP = _core_.WXK_UP
438 WXK_RIGHT = _core_.WXK_RIGHT
439 WXK_DOWN = _core_.WXK_DOWN
440 WXK_SELECT = _core_.WXK_SELECT
441 WXK_PRINT = _core_.WXK_PRINT
442 WXK_EXECUTE = _core_.WXK_EXECUTE
443 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
444 WXK_INSERT = _core_.WXK_INSERT
445 WXK_HELP = _core_.WXK_HELP
446 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
447 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
448 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
449 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
450 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
451 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
452 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
453 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
454 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
455 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
456 WXK_MULTIPLY = _core_.WXK_MULTIPLY
457 WXK_ADD = _core_.WXK_ADD
458 WXK_SEPARATOR = _core_.WXK_SEPARATOR
459 WXK_SUBTRACT = _core_.WXK_SUBTRACT
460 WXK_DECIMAL = _core_.WXK_DECIMAL
461 WXK_DIVIDE = _core_.WXK_DIVIDE
462 WXK_F1 = _core_.WXK_F1
463 WXK_F2 = _core_.WXK_F2
464 WXK_F3 = _core_.WXK_F3
465 WXK_F4 = _core_.WXK_F4
466 WXK_F5 = _core_.WXK_F5
467 WXK_F6 = _core_.WXK_F6
468 WXK_F7 = _core_.WXK_F7
469 WXK_F8 = _core_.WXK_F8
470 WXK_F9 = _core_.WXK_F9
471 WXK_F10 = _core_.WXK_F10
472 WXK_F11 = _core_.WXK_F11
473 WXK_F12 = _core_.WXK_F12
474 WXK_F13 = _core_.WXK_F13
475 WXK_F14 = _core_.WXK_F14
476 WXK_F15 = _core_.WXK_F15
477 WXK_F16 = _core_.WXK_F16
478 WXK_F17 = _core_.WXK_F17
479 WXK_F18 = _core_.WXK_F18
480 WXK_F19 = _core_.WXK_F19
481 WXK_F20 = _core_.WXK_F20
482 WXK_F21 = _core_.WXK_F21
483 WXK_F22 = _core_.WXK_F22
484 WXK_F23 = _core_.WXK_F23
485 WXK_F24 = _core_.WXK_F24
486 WXK_NUMLOCK = _core_.WXK_NUMLOCK
487 WXK_SCROLL = _core_.WXK_SCROLL
488 WXK_PAGEUP = _core_.WXK_PAGEUP
489 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
490 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
491 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
492 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
493 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
494 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
495 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
496 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
497 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
498 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
499 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
500 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
501 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
502 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
503 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
504 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
505 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
506 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
507 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
508 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
509 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
510 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
511 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
512 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
513 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
514 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
515 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
516 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
517 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
518 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
519 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
520 WXK_COMMAND = _core_.WXK_COMMAND
521 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
522 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
523 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
524 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
525 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
526 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
527 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
528 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
529 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
530 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
531 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
532 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
533 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
534 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
535 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
536 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
537 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
538 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
539 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
540 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
541 PAPER_NONE = _core_.PAPER_NONE
542 PAPER_LETTER = _core_.PAPER_LETTER
543 PAPER_LEGAL = _core_.PAPER_LEGAL
544 PAPER_A4 = _core_.PAPER_A4
545 PAPER_CSHEET = _core_.PAPER_CSHEET
546 PAPER_DSHEET = _core_.PAPER_DSHEET
547 PAPER_ESHEET = _core_.PAPER_ESHEET
548 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
549 PAPER_TABLOID = _core_.PAPER_TABLOID
550 PAPER_LEDGER = _core_.PAPER_LEDGER
551 PAPER_STATEMENT = _core_.PAPER_STATEMENT
552 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
553 PAPER_A3 = _core_.PAPER_A3
554 PAPER_A4SMALL = _core_.PAPER_A4SMALL
555 PAPER_A5 = _core_.PAPER_A5
556 PAPER_B4 = _core_.PAPER_B4
557 PAPER_B5 = _core_.PAPER_B5
558 PAPER_FOLIO = _core_.PAPER_FOLIO
559 PAPER_QUARTO = _core_.PAPER_QUARTO
560 PAPER_10X14 = _core_.PAPER_10X14
561 PAPER_11X17 = _core_.PAPER_11X17
562 PAPER_NOTE = _core_.PAPER_NOTE
563 PAPER_ENV_9 = _core_.PAPER_ENV_9
564 PAPER_ENV_10 = _core_.PAPER_ENV_10
565 PAPER_ENV_11 = _core_.PAPER_ENV_11
566 PAPER_ENV_12 = _core_.PAPER_ENV_12
567 PAPER_ENV_14 = _core_.PAPER_ENV_14
568 PAPER_ENV_DL = _core_.PAPER_ENV_DL
569 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
570 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
571 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
572 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
573 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
574 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
575 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
576 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
577 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
578 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
579 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
580 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
581 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
582 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
583 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
584 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
585 PAPER_9X11 = _core_.PAPER_9X11
586 PAPER_10X11 = _core_.PAPER_10X11
587 PAPER_15X11 = _core_.PAPER_15X11
588 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
589 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
590 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
591 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
592 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
593 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
594 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
595 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
596 PAPER_A_PLUS = _core_.PAPER_A_PLUS
597 PAPER_B_PLUS = _core_.PAPER_B_PLUS
598 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
599 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
600 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
601 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
602 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
603 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
604 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
605 PAPER_A2 = _core_.PAPER_A2
606 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
607 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
608 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
609 PAPER_A6 = _core_.PAPER_A6
610 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
611 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
612 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
613 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
614 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
615 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
616 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
617 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
618 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
619 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
620 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
621 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
622 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
623 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
624 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
625 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
626 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
627 PAPER_B6_JIS = _core_.PAPER_B6_JIS
628 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
629 PAPER_12X11 = _core_.PAPER_12X11
630 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
631 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
632 PAPER_P16K = _core_.PAPER_P16K
633 PAPER_P32K = _core_.PAPER_P32K
634 PAPER_P32KBIG = _core_.PAPER_P32KBIG
635 PAPER_PENV_1 = _core_.PAPER_PENV_1
636 PAPER_PENV_2 = _core_.PAPER_PENV_2
637 PAPER_PENV_3 = _core_.PAPER_PENV_3
638 PAPER_PENV_4 = _core_.PAPER_PENV_4
639 PAPER_PENV_5 = _core_.PAPER_PENV_5
640 PAPER_PENV_6 = _core_.PAPER_PENV_6
641 PAPER_PENV_7 = _core_.PAPER_PENV_7
642 PAPER_PENV_8 = _core_.PAPER_PENV_8
643 PAPER_PENV_9 = _core_.PAPER_PENV_9
644 PAPER_PENV_10 = _core_.PAPER_PENV_10
645 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
646 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
647 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
648 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
649 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
650 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
651 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
652 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
653 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
654 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
655 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
656 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
657 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
658 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
659 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
660 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
661 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
662 ITEM_NORMAL = _core_.ITEM_NORMAL
663 ITEM_CHECK = _core_.ITEM_CHECK
664 ITEM_RADIO = _core_.ITEM_RADIO
665 ITEM_MAX = _core_.ITEM_MAX
666 HT_NOWHERE = _core_.HT_NOWHERE
667 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
668 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
669 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
670 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
671 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
672 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
673 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
674 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
675 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
676 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
677 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
678 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
679 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
680 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
681 HT_MAX = _core_.HT_MAX
682 MOD_NONE = _core_.MOD_NONE
683 MOD_ALT = _core_.MOD_ALT
684 MOD_CONTROL = _core_.MOD_CONTROL
685 MOD_ALTGR = _core_.MOD_ALTGR
686 MOD_SHIFT = _core_.MOD_SHIFT
687 MOD_META = _core_.MOD_META
688 MOD_WIN = _core_.MOD_WIN
689 MOD_CMD = _core_.MOD_CMD
690 MOD_ALL = _core_.MOD_ALL
691 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
692 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
693 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
694 #---------------------------------------------------------------------------
695
696 class Object(object):
697 """
698 The base class for most wx objects, although in wxPython not
699 much functionality is needed nor exposed.
700 """
701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
702 def __init__(self): raise AttributeError, "No constructor defined"
703 __repr__ = _swig_repr
704 def GetClassName(*args, **kwargs):
705 """
706 GetClassName(self) -> String
707
708 Returns the class name of the C++ class using wxRTTI.
709 """
710 return _core_.Object_GetClassName(*args, **kwargs)
711
712 def Destroy(*args, **kwargs):
713 """
714 Destroy(self)
715
716 Deletes the C++ object this Python object is a proxy for.
717 """
718 val = _core_.Object_Destroy(*args, **kwargs)
719 args[0].thisown = 0
720 return val
721
722 Object_swigregister = _core_.Object_swigregister
723 Object_swigregister(Object)
724 _wxPySetDictionary = _core_._wxPySetDictionary
725 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
726 cvar = _core_.cvar
727 EmptyString = cvar.EmptyString
728
729 #---------------------------------------------------------------------------
730
731 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
732 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
733 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
734 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
735 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
736 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
737 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
738 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
739 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
740 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
741 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
742 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
743 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
744 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
745 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
746 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
747 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
748 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
749 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
750 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
751 CURSOR_NONE = _core_.CURSOR_NONE
752 CURSOR_ARROW = _core_.CURSOR_ARROW
753 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
754 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
755 CURSOR_CHAR = _core_.CURSOR_CHAR
756 CURSOR_CROSS = _core_.CURSOR_CROSS
757 CURSOR_HAND = _core_.CURSOR_HAND
758 CURSOR_IBEAM = _core_.CURSOR_IBEAM
759 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
760 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
761 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
762 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
763 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
764 CURSOR_PENCIL = _core_.CURSOR_PENCIL
765 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
766 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
767 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
768 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
769 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
770 CURSOR_SIZENS = _core_.CURSOR_SIZENS
771 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
772 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
773 CURSOR_SIZING = _core_.CURSOR_SIZING
774 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
775 CURSOR_WAIT = _core_.CURSOR_WAIT
776 CURSOR_WATCH = _core_.CURSOR_WATCH
777 CURSOR_BLANK = _core_.CURSOR_BLANK
778 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
779 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
780 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
781 CURSOR_MAX = _core_.CURSOR_MAX
782 #---------------------------------------------------------------------------
783
784 class Size(object):
785 """
786 wx.Size is a useful data structure used to represent the size of
787 something. It simply contains integer width and height
788 properties. In most places in wxPython where a wx.Size is
789 expected a (width, height) tuple can be used instead.
790 """
791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
792 __repr__ = _swig_repr
793 width = property(_core_.Size_width_get, _core_.Size_width_set)
794 height = property(_core_.Size_height_get, _core_.Size_height_set)
795 x = width; y = height
796 def __init__(self, *args, **kwargs):
797 """
798 __init__(self, int w=0, int h=0) -> Size
799
800 Creates a size object.
801 """
802 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
803 __swig_destroy__ = _core_.delete_Size
804 __del__ = lambda self : None;
805 def __eq__(*args, **kwargs):
806 """
807 __eq__(self, Size sz) -> bool
808
809 Test for equality of wx.Size objects.
810 """
811 return _core_.Size___eq__(*args, **kwargs)
812
813 def __ne__(*args, **kwargs):
814 """
815 __ne__(self, Size sz) -> bool
816
817 Test for inequality.
818 """
819 return _core_.Size___ne__(*args, **kwargs)
820
821 def __add__(*args, **kwargs):
822 """
823 __add__(self, Size sz) -> Size
824
825 Add sz's proprties to this and return the result.
826 """
827 return _core_.Size___add__(*args, **kwargs)
828
829 def __sub__(*args, **kwargs):
830 """
831 __sub__(self, Size sz) -> Size
832
833 Subtract sz's properties from this and return the result.
834 """
835 return _core_.Size___sub__(*args, **kwargs)
836
837 def IncTo(*args, **kwargs):
838 """
839 IncTo(self, Size sz)
840
841 Increments this object so that both of its dimensions are not less
842 than the corresponding dimensions of the size.
843 """
844 return _core_.Size_IncTo(*args, **kwargs)
845
846 def DecTo(*args, **kwargs):
847 """
848 DecTo(self, Size sz)
849
850 Decrements this object so that both of its dimensions are not greater
851 than the corresponding dimensions of the size.
852 """
853 return _core_.Size_DecTo(*args, **kwargs)
854
855 def Set(*args, **kwargs):
856 """
857 Set(self, int w, int h)
858
859 Set both width and height.
860 """
861 return _core_.Size_Set(*args, **kwargs)
862
863 def SetWidth(*args, **kwargs):
864 """SetWidth(self, int w)"""
865 return _core_.Size_SetWidth(*args, **kwargs)
866
867 def SetHeight(*args, **kwargs):
868 """SetHeight(self, int h)"""
869 return _core_.Size_SetHeight(*args, **kwargs)
870
871 def GetWidth(*args, **kwargs):
872 """GetWidth(self) -> int"""
873 return _core_.Size_GetWidth(*args, **kwargs)
874
875 def GetHeight(*args, **kwargs):
876 """GetHeight(self) -> int"""
877 return _core_.Size_GetHeight(*args, **kwargs)
878
879 def IsFullySpecified(*args, **kwargs):
880 """
881 IsFullySpecified(self) -> bool
882
883 Returns True if both components of the size are non-default values.
884 """
885 return _core_.Size_IsFullySpecified(*args, **kwargs)
886
887 def SetDefaults(*args, **kwargs):
888 """
889 SetDefaults(self, Size size)
890
891 Combine this size with the other one replacing the default components
892 of this object (i.e. equal to -1) with those of the other.
893 """
894 return _core_.Size_SetDefaults(*args, **kwargs)
895
896 def Get(*args, **kwargs):
897 """
898 Get() -> (width,height)
899
900 Returns the width and height properties as a tuple.
901 """
902 return _core_.Size_Get(*args, **kwargs)
903
904 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
905 def __str__(self): return str(self.Get())
906 def __repr__(self): return 'wx.Size'+str(self.Get())
907 def __len__(self): return len(self.Get())
908 def __getitem__(self, index): return self.Get()[index]
909 def __setitem__(self, index, val):
910 if index == 0: self.width = val
911 elif index == 1: self.height = val
912 else: raise IndexError
913 def __nonzero__(self): return self.Get() != (0,0)
914 __safe_for_unpickling__ = True
915 def __reduce__(self): return (wx.Size, self.Get())
916
917 Size_swigregister = _core_.Size_swigregister
918 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, RealPoint pt) -> 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, RealPoint pt) -> 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 RealPoint_swigregister = _core_.RealPoint_swigregister
1003 RealPoint_swigregister(RealPoint)
1004
1005 #---------------------------------------------------------------------------
1006
1007 class Point(object):
1008 """
1009 A data structure for representing a point or position with integer x
1010 and y properties. Most places in wxPython that expect a wx.Point can
1011 also accept a (x,y) tuple.
1012 """
1013 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1014 __repr__ = _swig_repr
1015 x = property(_core_.Point_x_get, _core_.Point_x_set)
1016 y = property(_core_.Point_y_get, _core_.Point_y_set)
1017 def __init__(self, *args, **kwargs):
1018 """
1019 __init__(self, int x=0, int y=0) -> Point
1020
1021 Create a wx.Point object
1022 """
1023 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1024 __swig_destroy__ = _core_.delete_Point
1025 __del__ = lambda self : None;
1026 def __eq__(*args, **kwargs):
1027 """
1028 __eq__(self, Point pt) -> bool
1029
1030 Test for equality of wx.Point objects.
1031 """
1032 return _core_.Point___eq__(*args, **kwargs)
1033
1034 def __ne__(*args, **kwargs):
1035 """
1036 __ne__(self, Point pt) -> bool
1037
1038 Test for inequality of wx.Point objects.
1039 """
1040 return _core_.Point___ne__(*args, **kwargs)
1041
1042 def __add__(*args, **kwargs):
1043 """
1044 __add__(self, Point pt) -> Point
1045
1046 Add pt's proprties to this and return the result.
1047 """
1048 return _core_.Point___add__(*args, **kwargs)
1049
1050 def __sub__(*args, **kwargs):
1051 """
1052 __sub__(self, Point pt) -> Point
1053
1054 Subtract pt's proprties from this and return the result
1055 """
1056 return _core_.Point___sub__(*args, **kwargs)
1057
1058 def __iadd__(*args, **kwargs):
1059 """
1060 __iadd__(self, Point pt) -> Point
1061
1062 Add pt to this object.
1063 """
1064 return _core_.Point___iadd__(*args, **kwargs)
1065
1066 def __isub__(*args, **kwargs):
1067 """
1068 __isub__(self, Point pt) -> Point
1069
1070 Subtract pt from this object.
1071 """
1072 return _core_.Point___isub__(*args, **kwargs)
1073
1074 def Set(*args, **kwargs):
1075 """
1076 Set(self, long x, long y)
1077
1078 Set both the x and y properties
1079 """
1080 return _core_.Point_Set(*args, **kwargs)
1081
1082 def Get(*args, **kwargs):
1083 """
1084 Get() -> (x,y)
1085
1086 Return the x and y properties as a tuple.
1087 """
1088 return _core_.Point_Get(*args, **kwargs)
1089
1090 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1091 def __str__(self): return str(self.Get())
1092 def __repr__(self): return 'wx.Point'+str(self.Get())
1093 def __len__(self): return len(self.Get())
1094 def __getitem__(self, index): return self.Get()[index]
1095 def __setitem__(self, index, val):
1096 if index == 0: self.x = val
1097 elif index == 1: self.y = val
1098 else: raise IndexError
1099 def __nonzero__(self): return self.Get() != (0,0)
1100 __safe_for_unpickling__ = True
1101 def __reduce__(self): return (wx.Point, self.Get())
1102
1103 Point_swigregister = _core_.Point_swigregister
1104 Point_swigregister(Point)
1105
1106 #---------------------------------------------------------------------------
1107
1108 class Rect(object):
1109 """
1110 A class for representing and manipulating rectangles. It has x, y,
1111 width and height properties. In wxPython most palces that expect a
1112 wx.Rect can also accept a (x,y,width,height) tuple.
1113 """
1114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1115 __repr__ = _swig_repr
1116 def __init__(self, *args, **kwargs):
1117 """
1118 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1119
1120 Create a new Rect object.
1121 """
1122 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1123 __swig_destroy__ = _core_.delete_Rect
1124 __del__ = lambda self : None;
1125 def GetX(*args, **kwargs):
1126 """GetX(self) -> int"""
1127 return _core_.Rect_GetX(*args, **kwargs)
1128
1129 def SetX(*args, **kwargs):
1130 """SetX(self, int x)"""
1131 return _core_.Rect_SetX(*args, **kwargs)
1132
1133 def GetY(*args, **kwargs):
1134 """GetY(self) -> int"""
1135 return _core_.Rect_GetY(*args, **kwargs)
1136
1137 def SetY(*args, **kwargs):
1138 """SetY(self, int y)"""
1139 return _core_.Rect_SetY(*args, **kwargs)
1140
1141 def GetWidth(*args, **kwargs):
1142 """GetWidth(self) -> int"""
1143 return _core_.Rect_GetWidth(*args, **kwargs)
1144
1145 def SetWidth(*args, **kwargs):
1146 """SetWidth(self, int w)"""
1147 return _core_.Rect_SetWidth(*args, **kwargs)
1148
1149 def GetHeight(*args, **kwargs):
1150 """GetHeight(self) -> int"""
1151 return _core_.Rect_GetHeight(*args, **kwargs)
1152
1153 def SetHeight(*args, **kwargs):
1154 """SetHeight(self, int h)"""
1155 return _core_.Rect_SetHeight(*args, **kwargs)
1156
1157 def GetPosition(*args, **kwargs):
1158 """GetPosition(self) -> Point"""
1159 return _core_.Rect_GetPosition(*args, **kwargs)
1160
1161 def SetPosition(*args, **kwargs):
1162 """SetPosition(self, Point p)"""
1163 return _core_.Rect_SetPosition(*args, **kwargs)
1164
1165 def GetSize(*args, **kwargs):
1166 """GetSize(self) -> Size"""
1167 return _core_.Rect_GetSize(*args, **kwargs)
1168
1169 def SetSize(*args, **kwargs):
1170 """SetSize(self, Size s)"""
1171 return _core_.Rect_SetSize(*args, **kwargs)
1172
1173 def IsEmpty(*args, **kwargs):
1174 """IsEmpty(self) -> bool"""
1175 return _core_.Rect_IsEmpty(*args, **kwargs)
1176
1177 def GetTopLeft(*args, **kwargs):
1178 """GetTopLeft(self) -> Point"""
1179 return _core_.Rect_GetTopLeft(*args, **kwargs)
1180
1181 def SetTopLeft(*args, **kwargs):
1182 """SetTopLeft(self, Point p)"""
1183 return _core_.Rect_SetTopLeft(*args, **kwargs)
1184
1185 def GetBottomRight(*args, **kwargs):
1186 """GetBottomRight(self) -> Point"""
1187 return _core_.Rect_GetBottomRight(*args, **kwargs)
1188
1189 def SetBottomRight(*args, **kwargs):
1190 """SetBottomRight(self, Point p)"""
1191 return _core_.Rect_SetBottomRight(*args, **kwargs)
1192
1193 def GetLeft(*args, **kwargs):
1194 """GetLeft(self) -> int"""
1195 return _core_.Rect_GetLeft(*args, **kwargs)
1196
1197 def GetTop(*args, **kwargs):
1198 """GetTop(self) -> int"""
1199 return _core_.Rect_GetTop(*args, **kwargs)
1200
1201 def GetBottom(*args, **kwargs):
1202 """GetBottom(self) -> int"""
1203 return _core_.Rect_GetBottom(*args, **kwargs)
1204
1205 def GetRight(*args, **kwargs):
1206 """GetRight(self) -> int"""
1207 return _core_.Rect_GetRight(*args, **kwargs)
1208
1209 def SetLeft(*args, **kwargs):
1210 """SetLeft(self, int left)"""
1211 return _core_.Rect_SetLeft(*args, **kwargs)
1212
1213 def SetRight(*args, **kwargs):
1214 """SetRight(self, int right)"""
1215 return _core_.Rect_SetRight(*args, **kwargs)
1216
1217 def SetTop(*args, **kwargs):
1218 """SetTop(self, int top)"""
1219 return _core_.Rect_SetTop(*args, **kwargs)
1220
1221 def SetBottom(*args, **kwargs):
1222 """SetBottom(self, int bottom)"""
1223 return _core_.Rect_SetBottom(*args, **kwargs)
1224
1225 position = property(GetPosition, SetPosition)
1226 size = property(GetSize, SetSize)
1227 left = property(GetLeft, SetLeft)
1228 right = property(GetRight, SetRight)
1229 top = property(GetTop, SetTop)
1230 bottom = property(GetBottom, SetBottom)
1231
1232 def Inflate(*args, **kwargs):
1233 """
1234 Inflate(self, int dx, int dy) -> Rect
1235
1236 Increases the size of the rectangle.
1237
1238 The left border is moved farther left and the right border is moved
1239 farther right by ``dx``. The upper border is moved farther up and the
1240 bottom border is moved farther down by ``dy``. (Note the the width and
1241 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1242 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1243 opposite happens: the rectangle size decreases in the respective
1244 direction.
1245
1246 The change is made to the rectangle inplace, if instead you need a
1247 copy that is inflated, preserving the original then make the copy
1248 first::
1249
1250 copy = wx.Rect(*original)
1251 copy.Inflate(10,15)
1252
1253
1254 """
1255 return _core_.Rect_Inflate(*args, **kwargs)
1256
1257 def Deflate(*args, **kwargs):
1258 """
1259 Deflate(self, int dx, int dy) -> Rect
1260
1261 Decrease the rectangle size. This method is the opposite of `Inflate`
1262 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1263 `Inflate` for a full description.
1264 """
1265 return _core_.Rect_Deflate(*args, **kwargs)
1266
1267 def OffsetXY(*args, **kwargs):
1268 """
1269 OffsetXY(self, int dx, int dy)
1270
1271 Moves the rectangle by the specified offset. If dx is positive, the
1272 rectangle is moved to the right, if dy is positive, it is moved to the
1273 bottom, otherwise it is moved to the left or top respectively.
1274 """
1275 return _core_.Rect_OffsetXY(*args, **kwargs)
1276
1277 def Offset(*args, **kwargs):
1278 """
1279 Offset(self, Point pt)
1280
1281 Same as `OffsetXY` but uses dx,dy from Point
1282 """
1283 return _core_.Rect_Offset(*args, **kwargs)
1284
1285 def Intersect(*args, **kwargs):
1286 """
1287 Intersect(self, Rect rect) -> Rect
1288
1289 Returns the intersectsion of this rectangle and rect.
1290 """
1291 return _core_.Rect_Intersect(*args, **kwargs)
1292
1293 def Union(*args, **kwargs):
1294 """
1295 Union(self, Rect rect) -> Rect
1296
1297 Returns the union of this rectangle and rect.
1298 """
1299 return _core_.Rect_Union(*args, **kwargs)
1300
1301 def __add__(*args, **kwargs):
1302 """
1303 __add__(self, Rect rect) -> Rect
1304
1305 Add the properties of rect to this rectangle and return the result.
1306 """
1307 return _core_.Rect___add__(*args, **kwargs)
1308
1309 def __iadd__(*args, **kwargs):
1310 """
1311 __iadd__(self, Rect rect) -> Rect
1312
1313 Add the properties of rect to this rectangle, updating this rectangle.
1314 """
1315 return _core_.Rect___iadd__(*args, **kwargs)
1316
1317 def __eq__(*args, **kwargs):
1318 """
1319 __eq__(self, Rect rect) -> bool
1320
1321 Test for equality.
1322 """
1323 return _core_.Rect___eq__(*args, **kwargs)
1324
1325 def __ne__(*args, **kwargs):
1326 """
1327 __ne__(self, Rect rect) -> bool
1328
1329 Test for inequality.
1330 """
1331 return _core_.Rect___ne__(*args, **kwargs)
1332
1333 def InsideXY(*args, **kwargs):
1334 """
1335 InsideXY(self, int x, int y) -> bool
1336
1337 Return True if the point is (not strcitly) inside the rect.
1338 """
1339 return _core_.Rect_InsideXY(*args, **kwargs)
1340
1341 def Inside(*args, **kwargs):
1342 """
1343 Inside(self, Point pt) -> bool
1344
1345 Return True if the point is (not strcitly) inside the rect.
1346 """
1347 return _core_.Rect_Inside(*args, **kwargs)
1348
1349 def Intersects(*args, **kwargs):
1350 """
1351 Intersects(self, Rect rect) -> bool
1352
1353 Returns True if the rectangles have a non empty intersection.
1354 """
1355 return _core_.Rect_Intersects(*args, **kwargs)
1356
1357 def CenterIn(*args, **kwargs):
1358 """
1359 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1360
1361 Center this rectangle within the one passed to the method, which is
1362 usually, but not necessarily, the larger one.
1363 """
1364 return _core_.Rect_CenterIn(*args, **kwargs)
1365
1366 CentreIn = CenterIn
1367 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1368 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1369 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1370 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1371 def Set(*args, **kwargs):
1372 """
1373 Set(self, int x=0, int y=0, int width=0, int height=0)
1374
1375 Set all rectangle properties.
1376 """
1377 return _core_.Rect_Set(*args, **kwargs)
1378
1379 def Get(*args, **kwargs):
1380 """
1381 Get() -> (x,y,width,height)
1382
1383 Return the rectangle properties as a tuple.
1384 """
1385 return _core_.Rect_Get(*args, **kwargs)
1386
1387 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1388 def __str__(self): return str(self.Get())
1389 def __repr__(self): return 'wx.Rect'+str(self.Get())
1390 def __len__(self): return len(self.Get())
1391 def __getitem__(self, index): return self.Get()[index]
1392 def __setitem__(self, index, val):
1393 if index == 0: self.x = val
1394 elif index == 1: self.y = val
1395 elif index == 2: self.width = val
1396 elif index == 3: self.height = val
1397 else: raise IndexError
1398 def __nonzero__(self): return self.Get() != (0,0,0,0)
1399 __safe_for_unpickling__ = True
1400 def __reduce__(self): return (wx.Rect, self.Get())
1401
1402 Rect_swigregister = _core_.Rect_swigregister
1403 Rect_swigregister(Rect)
1404
1405 def RectPP(*args, **kwargs):
1406 """
1407 RectPP(Point topLeft, Point bottomRight) -> Rect
1408
1409 Create a new Rect object from Points representing two corners.
1410 """
1411 val = _core_.new_RectPP(*args, **kwargs)
1412 return val
1413
1414 def RectPS(*args, **kwargs):
1415 """
1416 RectPS(Point pos, Size size) -> Rect
1417
1418 Create a new Rect from a position and size.
1419 """
1420 val = _core_.new_RectPS(*args, **kwargs)
1421 return val
1422
1423 def RectS(*args, **kwargs):
1424 """
1425 RectS(Size size) -> Rect
1426
1427 Create a new Rect from a size only.
1428 """
1429 val = _core_.new_RectS(*args, **kwargs)
1430 return val
1431
1432
1433 def IntersectRect(*args, **kwargs):
1434 """
1435 IntersectRect(Rect r1, Rect r2) -> Rect
1436
1437 Calculate and return the intersection of r1 and r2.
1438 """
1439 return _core_.IntersectRect(*args, **kwargs)
1440 #---------------------------------------------------------------------------
1441
1442 class Point2D(object):
1443 """
1444 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1445 with floating point values.
1446 """
1447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1448 __repr__ = _swig_repr
1449 def __init__(self, *args, **kwargs):
1450 """
1451 __init__(self, double x=0.0, double y=0.0) -> Point2D
1452
1453 Create a w.Point2D object.
1454 """
1455 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1456 def GetFloor(*args, **kwargs):
1457 """
1458 GetFloor() -> (x,y)
1459
1460 Convert to integer
1461 """
1462 return _core_.Point2D_GetFloor(*args, **kwargs)
1463
1464 def GetRounded(*args, **kwargs):
1465 """
1466 GetRounded() -> (x,y)
1467
1468 Convert to integer
1469 """
1470 return _core_.Point2D_GetRounded(*args, **kwargs)
1471
1472 def GetVectorLength(*args, **kwargs):
1473 """GetVectorLength(self) -> double"""
1474 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1475
1476 def GetVectorAngle(*args, **kwargs):
1477 """GetVectorAngle(self) -> double"""
1478 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1479
1480 def SetVectorLength(*args, **kwargs):
1481 """SetVectorLength(self, double length)"""
1482 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1483
1484 def SetVectorAngle(*args, **kwargs):
1485 """SetVectorAngle(self, double degrees)"""
1486 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1487
1488 def SetPolarCoordinates(self, angle, length):
1489 self.SetVectorLength(length)
1490 self.SetVectorAngle(angle)
1491 def Normalize(self):
1492 self.SetVectorLength(1.0)
1493
1494 def GetDistance(*args, **kwargs):
1495 """GetDistance(self, Point2D pt) -> double"""
1496 return _core_.Point2D_GetDistance(*args, **kwargs)
1497
1498 def GetDistanceSquare(*args, **kwargs):
1499 """GetDistanceSquare(self, Point2D pt) -> double"""
1500 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1501
1502 def GetDotProduct(*args, **kwargs):
1503 """GetDotProduct(self, Point2D vec) -> double"""
1504 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1505
1506 def GetCrossProduct(*args, **kwargs):
1507 """GetCrossProduct(self, Point2D vec) -> double"""
1508 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1509
1510 def __neg__(*args, **kwargs):
1511 """
1512 __neg__(self) -> Point2D
1513
1514 the reflection of this point
1515 """
1516 return _core_.Point2D___neg__(*args, **kwargs)
1517
1518 def __iadd__(*args, **kwargs):
1519 """__iadd__(self, Point2D pt) -> Point2D"""
1520 return _core_.Point2D___iadd__(*args, **kwargs)
1521
1522 def __isub__(*args, **kwargs):
1523 """__isub__(self, Point2D pt) -> Point2D"""
1524 return _core_.Point2D___isub__(*args, **kwargs)
1525
1526 def __imul__(*args, **kwargs):
1527 """__imul__(self, Point2D pt) -> Point2D"""
1528 return _core_.Point2D___imul__(*args, **kwargs)
1529
1530 def __idiv__(*args, **kwargs):
1531 """__idiv__(self, Point2D pt) -> Point2D"""
1532 return _core_.Point2D___idiv__(*args, **kwargs)
1533
1534 def __eq__(*args, **kwargs):
1535 """
1536 __eq__(self, Point2D pt) -> bool
1537
1538 Test for equality
1539 """
1540 return _core_.Point2D___eq__(*args, **kwargs)
1541
1542 def __ne__(*args, **kwargs):
1543 """
1544 __ne__(self, Point2D pt) -> bool
1545
1546 Test for inequality
1547 """
1548 return _core_.Point2D___ne__(*args, **kwargs)
1549
1550 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1551 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1552 def Set(*args, **kwargs):
1553 """Set(self, double x=0, double y=0)"""
1554 return _core_.Point2D_Set(*args, **kwargs)
1555
1556 def Get(*args, **kwargs):
1557 """
1558 Get() -> (x,y)
1559
1560 Return x and y properties as a tuple.
1561 """
1562 return _core_.Point2D_Get(*args, **kwargs)
1563
1564 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1565 def __str__(self): return str(self.Get())
1566 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1567 def __len__(self): return len(self.Get())
1568 def __getitem__(self, index): return self.Get()[index]
1569 def __setitem__(self, index, val):
1570 if index == 0: self.x = val
1571 elif index == 1: self.y = val
1572 else: raise IndexError
1573 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1574 __safe_for_unpickling__ = True
1575 def __reduce__(self): return (wx.Point2D, self.Get())
1576
1577 Point2D_swigregister = _core_.Point2D_swigregister
1578 Point2D_swigregister(Point2D)
1579
1580 def Point2DCopy(*args, **kwargs):
1581 """
1582 Point2DCopy(Point2D pt) -> Point2D
1583
1584 Create a w.Point2D object.
1585 """
1586 val = _core_.new_Point2DCopy(*args, **kwargs)
1587 return val
1588
1589 def Point2DFromPoint(*args, **kwargs):
1590 """
1591 Point2DFromPoint(Point pt) -> Point2D
1592
1593 Create a w.Point2D object.
1594 """
1595 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1596 return val
1597
1598 #---------------------------------------------------------------------------
1599
1600 FromStart = _core_.FromStart
1601 FromCurrent = _core_.FromCurrent
1602 FromEnd = _core_.FromEnd
1603 class InputStream(object):
1604 """Proxy of C++ InputStream class"""
1605 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1606 __repr__ = _swig_repr
1607 def __init__(self, *args, **kwargs):
1608 """__init__(self, PyObject p) -> InputStream"""
1609 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1610 __swig_destroy__ = _core_.delete_InputStream
1611 __del__ = lambda self : None;
1612 def close(*args, **kwargs):
1613 """close(self)"""
1614 return _core_.InputStream_close(*args, **kwargs)
1615
1616 def flush(*args, **kwargs):
1617 """flush(self)"""
1618 return _core_.InputStream_flush(*args, **kwargs)
1619
1620 def eof(*args, **kwargs):
1621 """eof(self) -> bool"""
1622 return _core_.InputStream_eof(*args, **kwargs)
1623
1624 def read(*args, **kwargs):
1625 """read(self, int size=-1) -> PyObject"""
1626 return _core_.InputStream_read(*args, **kwargs)
1627
1628 def readline(*args, **kwargs):
1629 """readline(self, int size=-1) -> PyObject"""
1630 return _core_.InputStream_readline(*args, **kwargs)
1631
1632 def readlines(*args, **kwargs):
1633 """readlines(self, int sizehint=-1) -> PyObject"""
1634 return _core_.InputStream_readlines(*args, **kwargs)
1635
1636 def seek(*args, **kwargs):
1637 """seek(self, int offset, int whence=0)"""
1638 return _core_.InputStream_seek(*args, **kwargs)
1639
1640 def tell(*args, **kwargs):
1641 """tell(self) -> int"""
1642 return _core_.InputStream_tell(*args, **kwargs)
1643
1644 def Peek(*args, **kwargs):
1645 """Peek(self) -> char"""
1646 return _core_.InputStream_Peek(*args, **kwargs)
1647
1648 def GetC(*args, **kwargs):
1649 """GetC(self) -> char"""
1650 return _core_.InputStream_GetC(*args, **kwargs)
1651
1652 def LastRead(*args, **kwargs):
1653 """LastRead(self) -> size_t"""
1654 return _core_.InputStream_LastRead(*args, **kwargs)
1655
1656 def CanRead(*args, **kwargs):
1657 """CanRead(self) -> bool"""
1658 return _core_.InputStream_CanRead(*args, **kwargs)
1659
1660 def Eof(*args, **kwargs):
1661 """Eof(self) -> bool"""
1662 return _core_.InputStream_Eof(*args, **kwargs)
1663
1664 def Ungetch(*args, **kwargs):
1665 """Ungetch(self, char c) -> bool"""
1666 return _core_.InputStream_Ungetch(*args, **kwargs)
1667
1668 def SeekI(*args, **kwargs):
1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
1670 return _core_.InputStream_SeekI(*args, **kwargs)
1671
1672 def TellI(*args, **kwargs):
1673 """TellI(self) -> long"""
1674 return _core_.InputStream_TellI(*args, **kwargs)
1675
1676 InputStream_swigregister = _core_.InputStream_swigregister
1677 InputStream_swigregister(InputStream)
1678 DefaultPosition = cvar.DefaultPosition
1679 DefaultSize = cvar.DefaultSize
1680
1681 class OutputStream(object):
1682 """Proxy of C++ OutputStream class"""
1683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1684 def __init__(self): raise AttributeError, "No constructor defined"
1685 __repr__ = _swig_repr
1686 def write(*args, **kwargs):
1687 """write(self, PyObject obj)"""
1688 return _core_.OutputStream_write(*args, **kwargs)
1689
1690 def LastWrite(*args, **kwargs):
1691 """LastWrite(self) -> size_t"""
1692 return _core_.OutputStream_LastWrite(*args, **kwargs)
1693
1694 OutputStream_swigregister = _core_.OutputStream_swigregister
1695 OutputStream_swigregister(OutputStream)
1696
1697 #---------------------------------------------------------------------------
1698
1699 class FSFile(Object):
1700 """Proxy of C++ FSFile class"""
1701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1702 __repr__ = _swig_repr
1703 def __init__(self, *args, **kwargs):
1704 """
1705 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1706 DateTime modif) -> FSFile
1707 """
1708 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1709 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1710
1711 __swig_destroy__ = _core_.delete_FSFile
1712 __del__ = lambda self : None;
1713 def GetStream(*args, **kwargs):
1714 """GetStream(self) -> InputStream"""
1715 return _core_.FSFile_GetStream(*args, **kwargs)
1716
1717 def GetMimeType(*args, **kwargs):
1718 """GetMimeType(self) -> String"""
1719 return _core_.FSFile_GetMimeType(*args, **kwargs)
1720
1721 def GetLocation(*args, **kwargs):
1722 """GetLocation(self) -> String"""
1723 return _core_.FSFile_GetLocation(*args, **kwargs)
1724
1725 def GetAnchor(*args, **kwargs):
1726 """GetAnchor(self) -> String"""
1727 return _core_.FSFile_GetAnchor(*args, **kwargs)
1728
1729 def GetModificationTime(*args, **kwargs):
1730 """GetModificationTime(self) -> DateTime"""
1731 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1732
1733 FSFile_swigregister = _core_.FSFile_swigregister
1734 FSFile_swigregister(FSFile)
1735
1736 class CPPFileSystemHandler(object):
1737 """Proxy of C++ CPPFileSystemHandler class"""
1738 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1739 def __init__(self): raise AttributeError, "No constructor defined"
1740 __repr__ = _swig_repr
1741 CPPFileSystemHandler_swigregister = _core_.CPPFileSystemHandler_swigregister
1742 CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1743
1744 class FileSystemHandler(CPPFileSystemHandler):
1745 """Proxy of C++ FileSystemHandler class"""
1746 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1747 __repr__ = _swig_repr
1748 def __init__(self, *args, **kwargs):
1749 """__init__(self) -> FileSystemHandler"""
1750 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1751 self._setCallbackInfo(self, FileSystemHandler)
1752
1753 def _setCallbackInfo(*args, **kwargs):
1754 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1755 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1756
1757 def CanOpen(*args, **kwargs):
1758 """CanOpen(self, String location) -> bool"""
1759 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1760
1761 def OpenFile(*args, **kwargs):
1762 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1763 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1764
1765 def FindFirst(*args, **kwargs):
1766 """FindFirst(self, String spec, int flags=0) -> String"""
1767 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1768
1769 def FindNext(*args, **kwargs):
1770 """FindNext(self) -> String"""
1771 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1772
1773 def GetProtocol(*args, **kwargs):
1774 """GetProtocol(self, String location) -> String"""
1775 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1776
1777 def GetLeftLocation(*args, **kwargs):
1778 """GetLeftLocation(self, String location) -> String"""
1779 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1780
1781 def GetAnchor(*args, **kwargs):
1782 """GetAnchor(self, String location) -> String"""
1783 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1784
1785 def GetRightLocation(*args, **kwargs):
1786 """GetRightLocation(self, String location) -> String"""
1787 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1788
1789 def GetMimeTypeFromExt(*args, **kwargs):
1790 """GetMimeTypeFromExt(self, String location) -> String"""
1791 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1792
1793 FileSystemHandler_swigregister = _core_.FileSystemHandler_swigregister
1794 FileSystemHandler_swigregister(FileSystemHandler)
1795
1796 class FileSystem(Object):
1797 """Proxy of C++ FileSystem class"""
1798 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1799 __repr__ = _swig_repr
1800 def __init__(self, *args, **kwargs):
1801 """__init__(self) -> FileSystem"""
1802 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1803 __swig_destroy__ = _core_.delete_FileSystem
1804 __del__ = lambda self : None;
1805 def ChangePathTo(*args, **kwargs):
1806 """ChangePathTo(self, String location, bool is_dir=False)"""
1807 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1808
1809 def GetPath(*args, **kwargs):
1810 """GetPath(self) -> String"""
1811 return _core_.FileSystem_GetPath(*args, **kwargs)
1812
1813 def OpenFile(*args, **kwargs):
1814 """OpenFile(self, String location) -> FSFile"""
1815 return _core_.FileSystem_OpenFile(*args, **kwargs)
1816
1817 def FindFirst(*args, **kwargs):
1818 """FindFirst(self, String spec, int flags=0) -> String"""
1819 return _core_.FileSystem_FindFirst(*args, **kwargs)
1820
1821 def FindNext(*args, **kwargs):
1822 """FindNext(self) -> String"""
1823 return _core_.FileSystem_FindNext(*args, **kwargs)
1824
1825 def AddHandler(*args, **kwargs):
1826 """AddHandler(CPPFileSystemHandler handler)"""
1827 return _core_.FileSystem_AddHandler(*args, **kwargs)
1828
1829 AddHandler = staticmethod(AddHandler)
1830 def CleanUpHandlers(*args, **kwargs):
1831 """CleanUpHandlers()"""
1832 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1833
1834 CleanUpHandlers = staticmethod(CleanUpHandlers)
1835 def FileNameToURL(*args, **kwargs):
1836 """FileNameToURL(String filename) -> String"""
1837 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1838
1839 FileNameToURL = staticmethod(FileNameToURL)
1840 def URLToFileName(*args, **kwargs):
1841 """URLToFileName(String url) -> String"""
1842 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1843
1844 URLToFileName = staticmethod(URLToFileName)
1845 FileSystem_swigregister = _core_.FileSystem_swigregister
1846 FileSystem_swigregister(FileSystem)
1847
1848 def FileSystem_AddHandler(*args, **kwargs):
1849 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1850 return _core_.FileSystem_AddHandler(*args, **kwargs)
1851
1852 def FileSystem_CleanUpHandlers(*args):
1853 """FileSystem_CleanUpHandlers()"""
1854 return _core_.FileSystem_CleanUpHandlers(*args)
1855
1856 def FileSystem_FileNameToURL(*args, **kwargs):
1857 """FileSystem_FileNameToURL(String filename) -> String"""
1858 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1859
1860 def FileSystem_URLToFileName(*args, **kwargs):
1861 """FileSystem_URLToFileName(String url) -> String"""
1862 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1863
1864 class InternetFSHandler(CPPFileSystemHandler):
1865 """Proxy of C++ InternetFSHandler class"""
1866 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1867 __repr__ = _swig_repr
1868 def __init__(self, *args, **kwargs):
1869 """__init__(self) -> InternetFSHandler"""
1870 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1871 def CanOpen(*args, **kwargs):
1872 """CanOpen(self, String location) -> bool"""
1873 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1874
1875 def OpenFile(*args, **kwargs):
1876 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1877 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1878
1879 InternetFSHandler_swigregister = _core_.InternetFSHandler_swigregister
1880 InternetFSHandler_swigregister(InternetFSHandler)
1881
1882 class ZipFSHandler(CPPFileSystemHandler):
1883 """Proxy of C++ ZipFSHandler class"""
1884 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1885 __repr__ = _swig_repr
1886 def __init__(self, *args, **kwargs):
1887 """__init__(self) -> ZipFSHandler"""
1888 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1889 def CanOpen(*args, **kwargs):
1890 """CanOpen(self, String location) -> bool"""
1891 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1892
1893 def OpenFile(*args, **kwargs):
1894 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1895 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1896
1897 def FindFirst(*args, **kwargs):
1898 """FindFirst(self, String spec, int flags=0) -> String"""
1899 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1900
1901 def FindNext(*args, **kwargs):
1902 """FindNext(self) -> String"""
1903 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1904
1905 ZipFSHandler_swigregister = _core_.ZipFSHandler_swigregister
1906 ZipFSHandler_swigregister(ZipFSHandler)
1907
1908
1909 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1910 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1911 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1912
1913 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1914 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1915 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1916
1917 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1918 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1919 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1920 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1921 """
1922 Add 'file' to the memory filesystem. The dataItem parameter can
1923 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1924 arbitrary data. If a bitmap or image is used then the imgType
1925 parameter should specify what kind of image file it should be
1926 written as, wx.BITMAP_TYPE_PNG, etc.
1927 """
1928 if isinstance(dataItem, wx.Image):
1929 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1930 elif isinstance(dataItem, wx.Bitmap):
1931 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1932 elif type(dataItem) == str:
1933 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1934 else:
1935 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1936
1937 class MemoryFSHandler(CPPFileSystemHandler):
1938 """Proxy of C++ MemoryFSHandler class"""
1939 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1940 __repr__ = _swig_repr
1941 def __init__(self, *args, **kwargs):
1942 """__init__(self) -> MemoryFSHandler"""
1943 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1944 def RemoveFile(*args, **kwargs):
1945 """RemoveFile(String filename)"""
1946 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1947
1948 RemoveFile = staticmethod(RemoveFile)
1949 AddFile = staticmethod(MemoryFSHandler_AddFile)
1950 def CanOpen(*args, **kwargs):
1951 """CanOpen(self, String location) -> bool"""
1952 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1953
1954 def OpenFile(*args, **kwargs):
1955 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1956 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1957
1958 def FindFirst(*args, **kwargs):
1959 """FindFirst(self, String spec, int flags=0) -> String"""
1960 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1961
1962 def FindNext(*args, **kwargs):
1963 """FindNext(self) -> String"""
1964 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1965
1966 MemoryFSHandler_swigregister = _core_.MemoryFSHandler_swigregister
1967 MemoryFSHandler_swigregister(MemoryFSHandler)
1968
1969 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1970 """MemoryFSHandler_RemoveFile(String filename)"""
1971 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1972
1973 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1974 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1975 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1976 #---------------------------------------------------------------------------
1977
1978 class ImageHandler(Object):
1979 """
1980 This is the base class for implementing image file loading/saving, and
1981 image creation from data. It is used within `wx.Image` and is not
1982 normally seen by the application.
1983 """
1984 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1985 def __init__(self): raise AttributeError, "No constructor defined"
1986 __repr__ = _swig_repr
1987 def GetName(*args, **kwargs):
1988 """GetName(self) -> String"""
1989 return _core_.ImageHandler_GetName(*args, **kwargs)
1990
1991 def GetExtension(*args, **kwargs):
1992 """GetExtension(self) -> String"""
1993 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1994
1995 def GetType(*args, **kwargs):
1996 """GetType(self) -> long"""
1997 return _core_.ImageHandler_GetType(*args, **kwargs)
1998
1999 def GetMimeType(*args, **kwargs):
2000 """GetMimeType(self) -> String"""
2001 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2002
2003 def CanRead(*args, **kwargs):
2004 """CanRead(self, String name) -> bool"""
2005 return _core_.ImageHandler_CanRead(*args, **kwargs)
2006
2007 def SetName(*args, **kwargs):
2008 """SetName(self, String name)"""
2009 return _core_.ImageHandler_SetName(*args, **kwargs)
2010
2011 def SetExtension(*args, **kwargs):
2012 """SetExtension(self, String extension)"""
2013 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2014
2015 def SetType(*args, **kwargs):
2016 """SetType(self, long type)"""
2017 return _core_.ImageHandler_SetType(*args, **kwargs)
2018
2019 def SetMimeType(*args, **kwargs):
2020 """SetMimeType(self, String mimetype)"""
2021 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2022
2023 ImageHandler_swigregister = _core_.ImageHandler_swigregister
2024 ImageHandler_swigregister(ImageHandler)
2025
2026 class PyImageHandler(ImageHandler):
2027 """
2028 This is the base class for implementing image file loading/saving, and
2029 image creation from data, all written in Python. To create a custom
2030 image handler derive a new class from wx.PyImageHandler and provide
2031 the following methods::
2032
2033 def DoCanRead(self, stream) --> bool
2034 '''Check if this handler can read the image on the stream'''
2035
2036 def LoadFile(self, image, stream, verbose, index) --> bool
2037 '''Load image data from the stream and load it into image.'''
2038
2039 def SaveFile(self, image, stream, verbose) --> bool
2040 '''Save the iamge data in image to the stream using
2041 this handler's image file format.'''
2042
2043 def GetImageCount(self, stream) --> int
2044 '''If this image format can hold more than one image,
2045 how many does the image on the stream have?'''
2046
2047 To activate your handler create an instance of it and pass it to
2048 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2049 `SetExtension` from your constructor.
2050
2051 """
2052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2053 __repr__ = _swig_repr
2054 def __init__(self, *args, **kwargs):
2055 """
2056 __init__(self) -> PyImageHandler
2057
2058 This is the base class for implementing image file loading/saving, and
2059 image creation from data, all written in Python. To create a custom
2060 image handler derive a new class from wx.PyImageHandler and provide
2061 the following methods::
2062
2063 def DoCanRead(self, stream) --> bool
2064 '''Check if this handler can read the image on the stream'''
2065
2066 def LoadFile(self, image, stream, verbose, index) --> bool
2067 '''Load image data from the stream and load it into image.'''
2068
2069 def SaveFile(self, image, stream, verbose) --> bool
2070 '''Save the iamge data in image to the stream using
2071 this handler's image file format.'''
2072
2073 def GetImageCount(self, stream) --> int
2074 '''If this image format can hold more than one image,
2075 how many does the image on the stream have?'''
2076
2077 To activate your handler create an instance of it and pass it to
2078 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2079 `SetExtension` from your constructor.
2080
2081 """
2082 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2083 self._SetSelf(self)
2084
2085 def _SetSelf(*args, **kwargs):
2086 """_SetSelf(self, PyObject self)"""
2087 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2088
2089 PyImageHandler_swigregister = _core_.PyImageHandler_swigregister
2090 PyImageHandler_swigregister(PyImageHandler)
2091
2092 class ImageHistogram(object):
2093 """Proxy of C++ ImageHistogram class"""
2094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2095 __repr__ = _swig_repr
2096 def __init__(self, *args, **kwargs):
2097 """__init__(self) -> ImageHistogram"""
2098 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2099 def MakeKey(*args, **kwargs):
2100 """
2101 MakeKey(byte r, byte g, byte b) -> unsigned long
2102
2103 Get the key in the histogram for the given RGB values
2104 """
2105 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2106
2107 MakeKey = staticmethod(MakeKey)
2108 def FindFirstUnusedColour(*args, **kwargs):
2109 """
2110 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2111
2112 Find first colour that is not used in the image and has higher RGB
2113 values than startR, startG, startB. Returns a tuple consisting of a
2114 success flag and rgb values.
2115 """
2116 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2117
2118 def GetCount(*args, **kwargs):
2119 """
2120 GetCount(self, unsigned long key) -> unsigned long
2121
2122 Returns the pixel count for the given key. Use `MakeKey` to create a
2123 key value from a RGB tripple.
2124 """
2125 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2126
2127 def GetCountRGB(*args, **kwargs):
2128 """
2129 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2130
2131 Returns the pixel count for the given RGB values.
2132 """
2133 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2134
2135 def GetCountColour(*args, **kwargs):
2136 """
2137 GetCountColour(self, Colour colour) -> unsigned long
2138
2139 Returns the pixel count for the given `wx.Colour` value.
2140 """
2141 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2142
2143 ImageHistogram_swigregister = _core_.ImageHistogram_swigregister
2144 ImageHistogram_swigregister(ImageHistogram)
2145
2146 def ImageHistogram_MakeKey(*args, **kwargs):
2147 """
2148 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2149
2150 Get the key in the histogram for the given RGB values
2151 """
2152 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2153
2154 class Image_RGBValue(object):
2155 """
2156 An object that contains values for red, green and blue which represent
2157 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2158 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2159 color space.
2160 """
2161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2162 __repr__ = _swig_repr
2163 def __init__(self, *args, **kwargs):
2164 """
2165 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2166
2167 Constructor.
2168 """
2169 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2170 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2171 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2172 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2173 Image_RGBValue_swigregister = _core_.Image_RGBValue_swigregister
2174 Image_RGBValue_swigregister(Image_RGBValue)
2175
2176 class Image_HSVValue(object):
2177 """
2178 An object that contains values for hue, saturation and value which
2179 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2180 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2181 color space.
2182 """
2183 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2184 __repr__ = _swig_repr
2185 def __init__(self, *args, **kwargs):
2186 """
2187 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2188
2189 Constructor.
2190 """
2191 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2192 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2193 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2194 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2195 Image_HSVValue_swigregister = _core_.Image_HSVValue_swigregister
2196 Image_HSVValue_swigregister(Image_HSVValue)
2197
2198 class Image(Object):
2199 """
2200 A platform-independent image class. An image can be created from
2201 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2202 variety of formats. Functions are available to set and get image
2203 bits, so it can be used for basic image manipulation.
2204
2205 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2206 platform-specific `wx.Bitmap` object must be created from it using the
2207 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2208 device context, using `wx.DC.DrawBitmap`.
2209
2210 One colour value of the image may be used as a mask colour which will
2211 lead to the automatic creation of a `wx.Mask` object associated to the
2212 bitmap object.
2213
2214 wx.Image supports alpha channel data, that is in addition to a byte
2215 for the red, green and blue colour components for each pixel it also
2216 stores a byte representing the pixel opacity. An alpha value of 0
2217 corresponds to a transparent pixel (null opacity) while a value of 255
2218 means that the pixel is 100% opaque.
2219
2220 Unlike RGB data, not all images have an alpha channel and before using
2221 `GetAlpha` you should check if this image contains an alpha channel
2222 with `HasAlpha`. Note that currently only images loaded from PNG files
2223 with transparency information will have an alpha channel.
2224 """
2225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2226 __repr__ = _swig_repr
2227 def __init__(self, *args, **kwargs):
2228 """
2229 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2230
2231 Loads an image from a file.
2232 """
2233 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2234 __swig_destroy__ = _core_.delete_Image
2235 __del__ = lambda self : None;
2236 def Create(*args, **kwargs):
2237 """
2238 Create(self, int width, int height, bool clear=True)
2239
2240 Creates a fresh image. If clear is ``True``, the new image will be
2241 initialized to black. Otherwise, the image data will be uninitialized.
2242 """
2243 return _core_.Image_Create(*args, **kwargs)
2244
2245 def Destroy(*args, **kwargs):
2246 """
2247 Destroy(self)
2248
2249 Destroys the image data.
2250 """
2251 val = _core_.Image_Destroy(*args, **kwargs)
2252 args[0].thisown = 0
2253 return val
2254
2255 def Scale(*args, **kwargs):
2256 """
2257 Scale(self, int width, int height) -> Image
2258
2259 Returns a scaled version of the image. This is also useful for scaling
2260 bitmaps in general as the only other way to scale bitmaps is to blit a
2261 `wx.MemoryDC` into another `wx.MemoryDC`.
2262 """
2263 return _core_.Image_Scale(*args, **kwargs)
2264
2265 def ShrinkBy(*args, **kwargs):
2266 """
2267 ShrinkBy(self, int xFactor, int yFactor) -> Image
2268
2269 Return a version of the image scaled smaller by the given factors.
2270 """
2271 return _core_.Image_ShrinkBy(*args, **kwargs)
2272
2273 def Rescale(*args, **kwargs):
2274 """
2275 Rescale(self, int width, int height) -> Image
2276
2277 Changes the size of the image in-place by scaling it: after a call to
2278 this function, the image will have the given width and height.
2279
2280 Returns the (modified) image itself.
2281 """
2282 return _core_.Image_Rescale(*args, **kwargs)
2283
2284 def Resize(*args, **kwargs):
2285 """
2286 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2287
2288 Changes the size of the image in-place without scaling it, by adding
2289 either a border with the given colour or cropping as necessary. The
2290 image is pasted into a new image with the given size and background
2291 colour at the position pos relative to the upper left of the new
2292 image. If red = green = blue = -1 then use either the current mask
2293 colour if set or find, use, and set a suitable mask colour for any
2294 newly exposed areas.
2295
2296 Returns the (modified) image itself.
2297 """
2298 return _core_.Image_Resize(*args, **kwargs)
2299
2300 def SetRGB(*args, **kwargs):
2301 """
2302 SetRGB(self, int x, int y, byte r, byte g, byte b)
2303
2304 Sets the pixel at the given coordinate. This routine performs
2305 bounds-checks for the coordinate so it can be considered a safe way to
2306 manipulate the data, but in some cases this might be too slow so that
2307 the data will have to be set directly. In that case you will have to
2308 get access to the image data using the `GetData` method.
2309 """
2310 return _core_.Image_SetRGB(*args, **kwargs)
2311
2312 def SetRGBRect(*args, **kwargs):
2313 """
2314 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2315
2316 Sets the colour of the pixels within the given rectangle. This routine
2317 performs bounds-checks for the rectangle so it can be considered a
2318 safe way to manipulate the data.
2319 """
2320 return _core_.Image_SetRGBRect(*args, **kwargs)
2321
2322 def GetRed(*args, **kwargs):
2323 """
2324 GetRed(self, int x, int y) -> byte
2325
2326 Returns the red intensity at the given coordinate.
2327 """
2328 return _core_.Image_GetRed(*args, **kwargs)
2329
2330 def GetGreen(*args, **kwargs):
2331 """
2332 GetGreen(self, int x, int y) -> byte
2333
2334 Returns the green intensity at the given coordinate.
2335 """
2336 return _core_.Image_GetGreen(*args, **kwargs)
2337
2338 def GetBlue(*args, **kwargs):
2339 """
2340 GetBlue(self, int x, int y) -> byte
2341
2342 Returns the blue intensity at the given coordinate.
2343 """
2344 return _core_.Image_GetBlue(*args, **kwargs)
2345
2346 def SetAlpha(*args, **kwargs):
2347 """
2348 SetAlpha(self, int x, int y, byte alpha)
2349
2350 Sets the alpha value for the given pixel. This function should only be
2351 called if the image has alpha channel data, use `HasAlpha` to check
2352 for this.
2353 """
2354 return _core_.Image_SetAlpha(*args, **kwargs)
2355
2356 def GetAlpha(*args, **kwargs):
2357 """
2358 GetAlpha(self, int x, int y) -> byte
2359
2360 Returns the alpha value for the given pixel. This function may only be
2361 called for the images with alpha channel, use `HasAlpha` to check for
2362 this.
2363
2364 The returned value is the *opacity* of the image, i.e. the value of 0
2365 corresponds to the fully transparent pixels while the value of 255 to
2366 the fully opaque pixels.
2367 """
2368 return _core_.Image_GetAlpha(*args, **kwargs)
2369
2370 def HasAlpha(*args, **kwargs):
2371 """
2372 HasAlpha(self) -> bool
2373
2374 Returns true if this image has alpha channel, false otherwise.
2375 """
2376 return _core_.Image_HasAlpha(*args, **kwargs)
2377
2378 def InitAlpha(*args, **kwargs):
2379 """
2380 InitAlpha(self)
2381
2382 Initializes the image alpha channel data. It is an error to call it if
2383 the image already has alpha data. If it doesn't, alpha data will be by
2384 default initialized to all pixels being fully opaque. But if the image
2385 has a a mask colour, all mask pixels will be completely transparent.
2386 """
2387 return _core_.Image_InitAlpha(*args, **kwargs)
2388
2389 def IsTransparent(*args, **kwargs):
2390 """
2391 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2392
2393 Returns ``True`` if this pixel is masked or has an alpha value less
2394 than the spcified threshold.
2395 """
2396 return _core_.Image_IsTransparent(*args, **kwargs)
2397
2398 def FindFirstUnusedColour(*args, **kwargs):
2399 """
2400 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2401
2402 Find first colour that is not used in the image and has higher RGB
2403 values than startR, startG, startB. Returns a tuple consisting of a
2404 success flag and rgb values.
2405 """
2406 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2407
2408 def ConvertAlphaToMask(*args, **kwargs):
2409 """
2410 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2411
2412 If the image has alpha channel, this method converts it to mask. All
2413 pixels with alpha value less than ``threshold`` are replaced with the
2414 mask colour and the alpha channel is removed. The mask colour is
2415 chosen automatically using `FindFirstUnusedColour`.
2416
2417 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2418 nothing.
2419 """
2420 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2421
2422 def ConvertColourToAlpha(*args, **kwargs):
2423 """
2424 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2425
2426 This method converts an image where the original alpha information is
2427 only available as a shades of a colour (actually shades of grey)
2428 typically when you draw anti-aliased text into a bitmap. The DC
2429 drawing routines draw grey values on the black background although
2430 they actually mean to draw white with differnt alpha values. This
2431 method reverses it, assuming a black (!) background and white text.
2432 The method will then fill up the whole image with the colour given.
2433 """
2434 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2435
2436 def SetMaskFromImage(*args, **kwargs):
2437 """
2438 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2439
2440 Sets the image's mask so that the pixels that have RGB value of
2441 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2442 by first finding an unused colour in the image, setting this colour as
2443 the mask colour and then using this colour to draw all pixels in the
2444 image who corresponding pixel in mask has given RGB value.
2445
2446 Returns ``False`` if ``mask`` does not have same dimensions as the
2447 image or if there is no unused colour left. Returns ``True`` if the
2448 mask was successfully applied.
2449
2450 Note that this method involves computing the histogram, which is
2451 computationally intensive operation.
2452 """
2453 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2454
2455 def CanRead(*args, **kwargs):
2456 """
2457 CanRead(String filename) -> bool
2458
2459 Returns True if the image handlers can read this file.
2460 """
2461 return _core_.Image_CanRead(*args, **kwargs)
2462
2463 CanRead = staticmethod(CanRead)
2464 def GetImageCount(*args, **kwargs):
2465 """
2466 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2467
2468 If the image file contains more than one image and the image handler
2469 is capable of retrieving these individually, this function will return
2470 the number of available images.
2471 """
2472 return _core_.Image_GetImageCount(*args, **kwargs)
2473
2474 GetImageCount = staticmethod(GetImageCount)
2475 def LoadFile(*args, **kwargs):
2476 """
2477 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2478
2479 Loads an image from a file. If no handler type is provided, the
2480 library will try to autodetect the format.
2481 """
2482 return _core_.Image_LoadFile(*args, **kwargs)
2483
2484 def LoadMimeFile(*args, **kwargs):
2485 """
2486 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2487
2488 Loads an image from a file, specifying the image type with a MIME type
2489 string.
2490 """
2491 return _core_.Image_LoadMimeFile(*args, **kwargs)
2492
2493 def SaveFile(*args, **kwargs):
2494 """
2495 SaveFile(self, String name, int type) -> bool
2496
2497 Saves an image in the named file.
2498 """
2499 return _core_.Image_SaveFile(*args, **kwargs)
2500
2501 def SaveMimeFile(*args, **kwargs):
2502 """
2503 SaveMimeFile(self, String name, String mimetype) -> bool
2504
2505 Saves an image in the named file.
2506 """
2507 return _core_.Image_SaveMimeFile(*args, **kwargs)
2508
2509 def CanReadStream(*args, **kwargs):
2510 """
2511 CanReadStream(InputStream stream) -> bool
2512
2513 Returns True if the image handlers can read an image file from the
2514 data currently on the input stream, or a readable Python file-like
2515 object.
2516 """
2517 return _core_.Image_CanReadStream(*args, **kwargs)
2518
2519 CanReadStream = staticmethod(CanReadStream)
2520 def LoadStream(*args, **kwargs):
2521 """
2522 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2523
2524 Loads an image from an input stream or a readable Python file-like
2525 object. If no handler type is provided, the library will try to
2526 autodetect the format.
2527 """
2528 return _core_.Image_LoadStream(*args, **kwargs)
2529
2530 def LoadMimeStream(*args, **kwargs):
2531 """
2532 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2533
2534 Loads an image from an input stream or a readable Python file-like
2535 object, using a MIME type string to specify the image file format.
2536 """
2537 return _core_.Image_LoadMimeStream(*args, **kwargs)
2538
2539 def Ok(*args, **kwargs):
2540 """
2541 Ok(self) -> bool
2542
2543 Returns true if image data is present.
2544 """
2545 return _core_.Image_Ok(*args, **kwargs)
2546
2547 def GetWidth(*args, **kwargs):
2548 """
2549 GetWidth(self) -> int
2550
2551 Gets the width of the image in pixels.
2552 """
2553 return _core_.Image_GetWidth(*args, **kwargs)
2554
2555 def GetHeight(*args, **kwargs):
2556 """
2557 GetHeight(self) -> int
2558
2559 Gets the height of the image in pixels.
2560 """
2561 return _core_.Image_GetHeight(*args, **kwargs)
2562
2563 def GetSize(*args, **kwargs):
2564 """
2565 GetSize(self) -> Size
2566
2567 Returns the size of the image in pixels.
2568 """
2569 return _core_.Image_GetSize(*args, **kwargs)
2570
2571 def GetSubImage(*args, **kwargs):
2572 """
2573 GetSubImage(self, Rect rect) -> Image
2574
2575 Returns a sub image of the current one as long as the rect belongs
2576 entirely to the image.
2577 """
2578 return _core_.Image_GetSubImage(*args, **kwargs)
2579
2580 def Size(*args, **kwargs):
2581 """
2582 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2583
2584 Returns a resized version of this image without scaling it by adding
2585 either a border with the given colour or cropping as necessary. The
2586 image is pasted into a new image with the given size and background
2587 colour at the position ``pos`` relative to the upper left of the new
2588 image. If red = green = blue = -1 then use either the current mask
2589 colour if set or find, use, and set a suitable mask colour for any
2590 newly exposed areas.
2591 """
2592 return _core_.Image_Size(*args, **kwargs)
2593
2594 def Copy(*args, **kwargs):
2595 """
2596 Copy(self) -> Image
2597
2598 Returns an identical copy of the image.
2599 """
2600 return _core_.Image_Copy(*args, **kwargs)
2601
2602 def Paste(*args, **kwargs):
2603 """
2604 Paste(self, Image image, int x, int y)
2605
2606 Pastes ``image`` into this instance and takes care of the mask colour
2607 and any out of bounds problems.
2608 """
2609 return _core_.Image_Paste(*args, **kwargs)
2610
2611 def GetData(*args, **kwargs):
2612 """
2613 GetData(self) -> PyObject
2614
2615 Returns a string containing a copy of the RGB bytes of the image.
2616 """
2617 return _core_.Image_GetData(*args, **kwargs)
2618
2619 def SetData(*args, **kwargs):
2620 """
2621 SetData(self, buffer data)
2622
2623 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2624 either a string or a buffer object holding the data and the length of
2625 the data must be width*height*3.
2626 """
2627 return _core_.Image_SetData(*args, **kwargs)
2628
2629 def GetDataBuffer(*args, **kwargs):
2630 """
2631 GetDataBuffer(self) -> PyObject
2632
2633 Returns a writable Python buffer object that is pointing at the RGB
2634 image data buffer inside the wx.Image. You need to ensure that you do
2635 not use this buffer object after the image has been destroyed.
2636 """
2637 return _core_.Image_GetDataBuffer(*args, **kwargs)
2638
2639 def SetDataBuffer(*args, **kwargs):
2640 """
2641 SetDataBuffer(self, buffer data)
2642
2643 Sets the internal image data pointer to point at a Python buffer
2644 object. This can save making an extra copy of the data but you must
2645 ensure that the buffer object lives longer than the wx.Image does.
2646 """
2647 return _core_.Image_SetDataBuffer(*args, **kwargs)
2648
2649 def GetAlphaData(*args, **kwargs):
2650 """
2651 GetAlphaData(self) -> PyObject
2652
2653 Returns a string containing a copy of the alpha bytes of the image.
2654 """
2655 return _core_.Image_GetAlphaData(*args, **kwargs)
2656
2657 def SetAlphaData(*args, **kwargs):
2658 """
2659 SetAlphaData(self, buffer alpha)
2660
2661 Resets the Image's alpha data from a buffer of bytes. Accepts either
2662 a string or a buffer object holding the data and the length of the
2663 data must be width*height.
2664 """
2665 return _core_.Image_SetAlphaData(*args, **kwargs)
2666
2667 def GetAlphaBuffer(*args, **kwargs):
2668 """GetAlphaBuffer(self) -> PyObject"""
2669 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2670
2671 def SetAlphaBuffer(*args, **kwargs):
2672 """SetAlphaBuffer(self, buffer alpha)"""
2673 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2674
2675 def SetMaskColour(*args, **kwargs):
2676 """
2677 SetMaskColour(self, byte r, byte g, byte b)
2678
2679 Sets the mask colour for this image (and tells the image to use the
2680 mask).
2681 """
2682 return _core_.Image_SetMaskColour(*args, **kwargs)
2683
2684 def GetOrFindMaskColour(*args, **kwargs):
2685 """
2686 GetOrFindMaskColour() -> (r,g,b)
2687
2688 Get the current mask colour or find a suitable colour.
2689 """
2690 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2691
2692 def GetMaskRed(*args, **kwargs):
2693 """
2694 GetMaskRed(self) -> byte
2695
2696 Gets the red component of the mask colour.
2697 """
2698 return _core_.Image_GetMaskRed(*args, **kwargs)
2699
2700 def GetMaskGreen(*args, **kwargs):
2701 """
2702 GetMaskGreen(self) -> byte
2703
2704 Gets the green component of the mask colour.
2705 """
2706 return _core_.Image_GetMaskGreen(*args, **kwargs)
2707
2708 def GetMaskBlue(*args, **kwargs):
2709 """
2710 GetMaskBlue(self) -> byte
2711
2712 Gets the blue component of the mask colour.
2713 """
2714 return _core_.Image_GetMaskBlue(*args, **kwargs)
2715
2716 def SetMask(*args, **kwargs):
2717 """
2718 SetMask(self, bool mask=True)
2719
2720 Specifies whether there is a mask or not. The area of the mask is
2721 determined by the current mask colour.
2722 """
2723 return _core_.Image_SetMask(*args, **kwargs)
2724
2725 def HasMask(*args, **kwargs):
2726 """
2727 HasMask(self) -> bool
2728
2729 Returns ``True`` if there is a mask active, ``False`` otherwise.
2730 """
2731 return _core_.Image_HasMask(*args, **kwargs)
2732
2733 def Rotate(*args, **kwargs):
2734 """
2735 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2736 Point offset_after_rotation=None) -> Image
2737
2738 Rotates the image about the given point, by ``angle`` radians. Passing
2739 ``True`` to ``interpolating`` results in better image quality, but is
2740 slower. If the image has a mask, then the mask colour is used for the
2741 uncovered pixels in the rotated image background. Otherwise, black
2742 will be used as the fill colour.
2743
2744 Returns the rotated image, leaving this image intact.
2745 """
2746 return _core_.Image_Rotate(*args, **kwargs)
2747
2748 def Rotate90(*args, **kwargs):
2749 """
2750 Rotate90(self, bool clockwise=True) -> Image
2751
2752 Returns a copy of the image rotated 90 degrees in the direction
2753 indicated by ``clockwise``.
2754 """
2755 return _core_.Image_Rotate90(*args, **kwargs)
2756
2757 def Mirror(*args, **kwargs):
2758 """
2759 Mirror(self, bool horizontally=True) -> Image
2760
2761 Returns a mirrored copy of the image. The parameter ``horizontally``
2762 indicates the orientation.
2763 """
2764 return _core_.Image_Mirror(*args, **kwargs)
2765
2766 def Replace(*args, **kwargs):
2767 """
2768 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2769
2770 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2771 ``(r2,g2,b2)``.
2772 """
2773 return _core_.Image_Replace(*args, **kwargs)
2774
2775 def ConvertToGreyscale(*args, **kwargs):
2776 """
2777 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2778
2779 Convert to greyscale image. Uses the luminance component (Y) of the
2780 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2781 defaults to ITU-T BT.601
2782 """
2783 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2784
2785 def ConvertToMono(*args, **kwargs):
2786 """
2787 ConvertToMono(self, byte r, byte g, byte b) -> Image
2788
2789 Returns monochromatic version of the image. The returned image has
2790 white colour where the original has ``(r,g,b)`` colour and black
2791 colour everywhere else.
2792 """
2793 return _core_.Image_ConvertToMono(*args, **kwargs)
2794
2795 def SetOption(*args, **kwargs):
2796 """
2797 SetOption(self, String name, String value)
2798
2799 Sets an image handler defined option. For example, when saving as a
2800 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2801 number between 0 and 100 (0 is terrible, 100 is very good).
2802 """
2803 return _core_.Image_SetOption(*args, **kwargs)
2804
2805 def SetOptionInt(*args, **kwargs):
2806 """
2807 SetOptionInt(self, String name, int value)
2808
2809 Sets an image option as an integer.
2810 """
2811 return _core_.Image_SetOptionInt(*args, **kwargs)
2812
2813 def GetOption(*args, **kwargs):
2814 """
2815 GetOption(self, String name) -> String
2816
2817 Gets the value of an image handler option.
2818 """
2819 return _core_.Image_GetOption(*args, **kwargs)
2820
2821 def GetOptionInt(*args, **kwargs):
2822 """
2823 GetOptionInt(self, String name) -> int
2824
2825 Gets the value of an image handler option as an integer. If the given
2826 option is not present, the function returns 0.
2827 """
2828 return _core_.Image_GetOptionInt(*args, **kwargs)
2829
2830 def HasOption(*args, **kwargs):
2831 """
2832 HasOption(self, String name) -> bool
2833
2834 Returns true if the given option is present.
2835 """
2836 return _core_.Image_HasOption(*args, **kwargs)
2837
2838 def CountColours(*args, **kwargs):
2839 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2840 return _core_.Image_CountColours(*args, **kwargs)
2841
2842 def ComputeHistogram(*args, **kwargs):
2843 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2844 return _core_.Image_ComputeHistogram(*args, **kwargs)
2845
2846 def AddHandler(*args, **kwargs):
2847 """AddHandler(ImageHandler handler)"""
2848 return _core_.Image_AddHandler(*args, **kwargs)
2849
2850 AddHandler = staticmethod(AddHandler)
2851 def InsertHandler(*args, **kwargs):
2852 """InsertHandler(ImageHandler handler)"""
2853 return _core_.Image_InsertHandler(*args, **kwargs)
2854
2855 InsertHandler = staticmethod(InsertHandler)
2856 def RemoveHandler(*args, **kwargs):
2857 """RemoveHandler(String name) -> bool"""
2858 return _core_.Image_RemoveHandler(*args, **kwargs)
2859
2860 RemoveHandler = staticmethod(RemoveHandler)
2861 def GetHandlers(*args, **kwargs):
2862 """GetHandlers() -> PyObject"""
2863 return _core_.Image_GetHandlers(*args, **kwargs)
2864
2865 GetHandlers = staticmethod(GetHandlers)
2866 def GetImageExtWildcard(*args, **kwargs):
2867 """
2868 GetImageExtWildcard() -> String
2869
2870 Iterates all registered wxImageHandler objects, and returns a string
2871 containing file extension masks suitable for passing to file open/save
2872 dialog boxes.
2873 """
2874 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2875
2876 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2877 def ConvertToBitmap(*args, **kwargs):
2878 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2879 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2880
2881 def ConvertToMonoBitmap(*args, **kwargs):
2882 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2883 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2884
2885 def RotateHue(*args, **kwargs):
2886 """
2887 RotateHue(self, double angle)
2888
2889 Rotates the hue of each pixel of the image. Hue is a double in the
2890 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2891 """
2892 return _core_.Image_RotateHue(*args, **kwargs)
2893
2894 def RGBtoHSV(*args, **kwargs):
2895 """
2896 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2897
2898 Converts a color in RGB color space to HSV color space.
2899 """
2900 return _core_.Image_RGBtoHSV(*args, **kwargs)
2901
2902 RGBtoHSV = staticmethod(RGBtoHSV)
2903 def HSVtoRGB(*args, **kwargs):
2904 """
2905 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2906
2907 Converts a color in HSV color space to RGB color space.
2908 """
2909 return _core_.Image_HSVtoRGB(*args, **kwargs)
2910
2911 HSVtoRGB = staticmethod(HSVtoRGB)
2912 def __nonzero__(self): return self.Ok()
2913 Image_swigregister = _core_.Image_swigregister
2914 Image_swigregister(Image)
2915
2916 def ImageFromMime(*args, **kwargs):
2917 """
2918 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2919
2920 Loads an image from a file, using a MIME type string (such as
2921 'image/jpeg') to specify image type.
2922 """
2923 val = _core_.new_ImageFromMime(*args, **kwargs)
2924 return val
2925
2926 def ImageFromStream(*args, **kwargs):
2927 """
2928 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2929
2930 Loads an image from an input stream, or any readable Python file-like
2931 object.
2932 """
2933 val = _core_.new_ImageFromStream(*args, **kwargs)
2934 return val
2935
2936 def ImageFromStreamMime(*args, **kwargs):
2937 """
2938 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2939
2940 Loads an image from an input stream, or any readable Python file-like
2941 object, specifying the image format with a MIME type string.
2942 """
2943 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2944 return val
2945
2946 def EmptyImage(*args, **kwargs):
2947 """
2948 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2949
2950 Construct an empty image of a given size, optionally setting all
2951 pixels to black.
2952 """
2953 val = _core_.new_EmptyImage(*args, **kwargs)
2954 return val
2955
2956 def ImageFromBitmap(*args, **kwargs):
2957 """
2958 ImageFromBitmap(Bitmap bitmap) -> Image
2959
2960 Construct an Image from a `wx.Bitmap`.
2961 """
2962 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2963 return val
2964
2965 def ImageFromData(*args, **kwargs):
2966 """
2967 ImageFromData(int width, int height, buffer data) -> Image
2968
2969 Construct an Image from a buffer of RGB bytes. Accepts either a
2970 string or a buffer object holding the data and the length of the data
2971 must be width*height*3.
2972 """
2973 val = _core_.new_ImageFromData(*args, **kwargs)
2974 return val
2975
2976 def ImageFromDataWithAlpha(*args, **kwargs):
2977 """
2978 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2979
2980 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2981 Accepts either a string or a buffer object holding the data and the
2982 length of the data must be width*height*3 bytes, and the length of the
2983 alpha data must be width*height bytes.
2984 """
2985 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2986 return val
2987
2988 def Image_CanRead(*args, **kwargs):
2989 """
2990 Image_CanRead(String filename) -> bool
2991
2992 Returns True if the image handlers can read this file.
2993 """
2994 return _core_.Image_CanRead(*args, **kwargs)
2995
2996 def Image_GetImageCount(*args, **kwargs):
2997 """
2998 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2999
3000 If the image file contains more than one image and the image handler
3001 is capable of retrieving these individually, this function will return
3002 the number of available images.
3003 """
3004 return _core_.Image_GetImageCount(*args, **kwargs)
3005
3006 def Image_CanReadStream(*args, **kwargs):
3007 """
3008 Image_CanReadStream(InputStream stream) -> bool
3009
3010 Returns True if the image handlers can read an image file from the
3011 data currently on the input stream, or a readable Python file-like
3012 object.
3013 """
3014 return _core_.Image_CanReadStream(*args, **kwargs)
3015
3016 def Image_AddHandler(*args, **kwargs):
3017 """Image_AddHandler(ImageHandler handler)"""
3018 return _core_.Image_AddHandler(*args, **kwargs)
3019
3020 def Image_InsertHandler(*args, **kwargs):
3021 """Image_InsertHandler(ImageHandler handler)"""
3022 return _core_.Image_InsertHandler(*args, **kwargs)
3023
3024 def Image_RemoveHandler(*args, **kwargs):
3025 """Image_RemoveHandler(String name) -> bool"""
3026 return _core_.Image_RemoveHandler(*args, **kwargs)
3027
3028 def Image_GetHandlers(*args):
3029 """Image_GetHandlers() -> PyObject"""
3030 return _core_.Image_GetHandlers(*args)
3031
3032 def Image_GetImageExtWildcard(*args):
3033 """
3034 Image_GetImageExtWildcard() -> String
3035
3036 Iterates all registered wxImageHandler objects, and returns a string
3037 containing file extension masks suitable for passing to file open/save
3038 dialog boxes.
3039 """
3040 return _core_.Image_GetImageExtWildcard(*args)
3041
3042 def Image_RGBtoHSV(*args, **kwargs):
3043 """
3044 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3045
3046 Converts a color in RGB color space to HSV color space.
3047 """
3048 return _core_.Image_RGBtoHSV(*args, **kwargs)
3049
3050 def Image_HSVtoRGB(*args, **kwargs):
3051 """
3052 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3053
3054 Converts a color in HSV color space to RGB color space.
3055 """
3056 return _core_.Image_HSVtoRGB(*args, **kwargs)
3057
3058 def InitAllImageHandlers():
3059 """
3060 The former functionality of InitAllImageHanders is now done internal to
3061 the _core_ extension module and so this function has become a simple NOP.
3062 """
3063 pass
3064
3065 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3066 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3067 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3068 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3069 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3070 BMP_24BPP = _core_.BMP_24BPP
3071 BMP_8BPP = _core_.BMP_8BPP
3072 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3073 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3074 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3075 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3076 BMP_4BPP = _core_.BMP_4BPP
3077 BMP_1BPP = _core_.BMP_1BPP
3078 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3079 class BMPHandler(ImageHandler):
3080 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3082 __repr__ = _swig_repr
3083 def __init__(self, *args, **kwargs):
3084 """
3085 __init__(self) -> BMPHandler
3086
3087 A `wx.ImageHandler` for \*.bmp bitmap files.
3088 """
3089 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3090 BMPHandler_swigregister = _core_.BMPHandler_swigregister
3091 BMPHandler_swigregister(BMPHandler)
3092 NullImage = cvar.NullImage
3093 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3094 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3095 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3096 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3097 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3098 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3099 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3100 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3101 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3102 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3103 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3104 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3105 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3106 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3107 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3108
3109 class ICOHandler(BMPHandler):
3110 """A `wx.ImageHandler` for \*.ico icon files."""
3111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3112 __repr__ = _swig_repr
3113 def __init__(self, *args, **kwargs):
3114 """
3115 __init__(self) -> ICOHandler
3116
3117 A `wx.ImageHandler` for \*.ico icon files.
3118 """
3119 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3120 ICOHandler_swigregister = _core_.ICOHandler_swigregister
3121 ICOHandler_swigregister(ICOHandler)
3122
3123 class CURHandler(ICOHandler):
3124 """A `wx.ImageHandler` for \*.cur cursor files."""
3125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3126 __repr__ = _swig_repr
3127 def __init__(self, *args, **kwargs):
3128 """
3129 __init__(self) -> CURHandler
3130
3131 A `wx.ImageHandler` for \*.cur cursor files.
3132 """
3133 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3134 CURHandler_swigregister = _core_.CURHandler_swigregister
3135 CURHandler_swigregister(CURHandler)
3136
3137 class ANIHandler(CURHandler):
3138 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3139 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3140 __repr__ = _swig_repr
3141 def __init__(self, *args, **kwargs):
3142 """
3143 __init__(self) -> ANIHandler
3144
3145 A `wx.ImageHandler` for \*.ani animated cursor files.
3146 """
3147 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3148 ANIHandler_swigregister = _core_.ANIHandler_swigregister
3149 ANIHandler_swigregister(ANIHandler)
3150
3151 class PNGHandler(ImageHandler):
3152 """A `wx.ImageHandler` for PNG image files."""
3153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3154 __repr__ = _swig_repr
3155 def __init__(self, *args, **kwargs):
3156 """
3157 __init__(self) -> PNGHandler
3158
3159 A `wx.ImageHandler` for PNG image files.
3160 """
3161 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3162 PNGHandler_swigregister = _core_.PNGHandler_swigregister
3163 PNGHandler_swigregister(PNGHandler)
3164
3165 class GIFHandler(ImageHandler):
3166 """A `wx.ImageHandler` for GIF image files."""
3167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3168 __repr__ = _swig_repr
3169 def __init__(self, *args, **kwargs):
3170 """
3171 __init__(self) -> GIFHandler
3172
3173 A `wx.ImageHandler` for GIF image files.
3174 """
3175 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3176 GIFHandler_swigregister = _core_.GIFHandler_swigregister
3177 GIFHandler_swigregister(GIFHandler)
3178
3179 class PCXHandler(ImageHandler):
3180 """A `wx.ImageHandler` for PCX imager files."""
3181 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3182 __repr__ = _swig_repr
3183 def __init__(self, *args, **kwargs):
3184 """
3185 __init__(self) -> PCXHandler
3186
3187 A `wx.ImageHandler` for PCX imager files.
3188 """
3189 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3190 PCXHandler_swigregister = _core_.PCXHandler_swigregister
3191 PCXHandler_swigregister(PCXHandler)
3192
3193 class JPEGHandler(ImageHandler):
3194 """A `wx.ImageHandler` for JPEG/JPG image files."""
3195 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3196 __repr__ = _swig_repr
3197 def __init__(self, *args, **kwargs):
3198 """
3199 __init__(self) -> JPEGHandler
3200
3201 A `wx.ImageHandler` for JPEG/JPG image files.
3202 """
3203 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3204 JPEGHandler_swigregister = _core_.JPEGHandler_swigregister
3205 JPEGHandler_swigregister(JPEGHandler)
3206
3207 class PNMHandler(ImageHandler):
3208 """A `wx.ImageHandler` for PNM image files."""
3209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3210 __repr__ = _swig_repr
3211 def __init__(self, *args, **kwargs):
3212 """
3213 __init__(self) -> PNMHandler
3214
3215 A `wx.ImageHandler` for PNM image files.
3216 """
3217 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3218 PNMHandler_swigregister = _core_.PNMHandler_swigregister
3219 PNMHandler_swigregister(PNMHandler)
3220
3221 class XPMHandler(ImageHandler):
3222 """A `wx.ImageHandler` for XPM image."""
3223 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3224 __repr__ = _swig_repr
3225 def __init__(self, *args, **kwargs):
3226 """
3227 __init__(self) -> XPMHandler
3228
3229 A `wx.ImageHandler` for XPM image.
3230 """
3231 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3232 XPMHandler_swigregister = _core_.XPMHandler_swigregister
3233 XPMHandler_swigregister(XPMHandler)
3234
3235 class TIFFHandler(ImageHandler):
3236 """A `wx.ImageHandler` for TIFF image files."""
3237 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3238 __repr__ = _swig_repr
3239 def __init__(self, *args, **kwargs):
3240 """
3241 __init__(self) -> TIFFHandler
3242
3243 A `wx.ImageHandler` for TIFF image files.
3244 """
3245 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3246 TIFFHandler_swigregister = _core_.TIFFHandler_swigregister
3247 TIFFHandler_swigregister(TIFFHandler)
3248
3249 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3250 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3251 class Quantize(object):
3252 """Performs quantization, or colour reduction, on a wxImage."""
3253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3254 def __init__(self): raise AttributeError, "No constructor defined"
3255 __repr__ = _swig_repr
3256 def Quantize(*args, **kwargs):
3257 """
3258 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3259
3260 Reduce the colours in the source image and put the result into the
3261 destination image, setting the palette in the destination if
3262 needed. Both images may be the same, to overwrite the source image.
3263 """
3264 return _core_.Quantize_Quantize(*args, **kwargs)
3265
3266 Quantize = staticmethod(Quantize)
3267 Quantize_swigregister = _core_.Quantize_swigregister
3268 Quantize_swigregister(Quantize)
3269
3270 def Quantize_Quantize(*args, **kwargs):
3271 """
3272 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3273
3274 Reduce the colours in the source image and put the result into the
3275 destination image, setting the palette in the destination if
3276 needed. Both images may be the same, to overwrite the source image.
3277 """
3278 return _core_.Quantize_Quantize(*args, **kwargs)
3279
3280 #---------------------------------------------------------------------------
3281
3282 class EvtHandler(Object):
3283 """Proxy of C++ EvtHandler class"""
3284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3285 __repr__ = _swig_repr
3286 def __init__(self, *args, **kwargs):
3287 """__init__(self) -> EvtHandler"""
3288 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3289 def GetNextHandler(*args, **kwargs):
3290 """GetNextHandler(self) -> EvtHandler"""
3291 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3292
3293 def GetPreviousHandler(*args, **kwargs):
3294 """GetPreviousHandler(self) -> EvtHandler"""
3295 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3296
3297 def SetNextHandler(*args, **kwargs):
3298 """SetNextHandler(self, EvtHandler handler)"""
3299 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3300
3301 def SetPreviousHandler(*args, **kwargs):
3302 """SetPreviousHandler(self, EvtHandler handler)"""
3303 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3304
3305 def GetEvtHandlerEnabled(*args, **kwargs):
3306 """GetEvtHandlerEnabled(self) -> bool"""
3307 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3308
3309 def SetEvtHandlerEnabled(*args, **kwargs):
3310 """SetEvtHandlerEnabled(self, bool enabled)"""
3311 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3312
3313 def ProcessEvent(*args, **kwargs):
3314 """ProcessEvent(self, Event event) -> bool"""
3315 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3316
3317 def AddPendingEvent(*args, **kwargs):
3318 """AddPendingEvent(self, Event event)"""
3319 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3320
3321 def ProcessPendingEvents(*args, **kwargs):
3322 """ProcessPendingEvents(self)"""
3323 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3324
3325 def Connect(*args, **kwargs):
3326 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3327 return _core_.EvtHandler_Connect(*args, **kwargs)
3328
3329 def Disconnect(*args, **kwargs):
3330 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3331 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3332
3333 def _setOORInfo(*args, **kwargs):
3334 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3335 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3336 args[0].thisown = 0
3337 return val
3338
3339 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3340 """
3341 Bind an event to an event handler.
3342
3343 :param event: One of the EVT_* objects that specifies the
3344 type of event to bind,
3345
3346 :param handler: A callable object to be invoked when the
3347 event is delivered to self. Pass None to
3348 disconnect an event handler.
3349
3350 :param source: Sometimes the event originates from a
3351 different window than self, but you still
3352 want to catch it in self. (For example, a
3353 button event delivered to a frame.) By
3354 passing the source of the event, the event
3355 handling system is able to differentiate
3356 between the same event type from different
3357 controls.
3358
3359 :param id: Used to spcify the event source by ID instead
3360 of instance.
3361
3362 :param id2: Used when it is desirable to bind a handler
3363 to a range of IDs, such as with EVT_MENU_RANGE.
3364 """
3365 if source is not None:
3366 id = source.GetId()
3367 event.Bind(self, id, id2, handler)
3368
3369 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3370 """
3371 Disconencts the event handler binding for event from self.
3372 Returns True if successful.
3373 """
3374 if source is not None:
3375 id = source.GetId()
3376 return event.Unbind(self, id, id2)
3377
3378 EvtHandler_swigregister = _core_.EvtHandler_swigregister
3379 EvtHandler_swigregister(EvtHandler)
3380
3381 #---------------------------------------------------------------------------
3382
3383 class PyEventBinder(object):
3384 """
3385 Instances of this class are used to bind specific events to event
3386 handlers.
3387 """
3388 def __init__(self, evtType, expectedIDs=0):
3389 if expectedIDs not in [0, 1, 2]:
3390 raise ValueError, "Invalid number of expectedIDs"
3391 self.expectedIDs = expectedIDs
3392
3393 if type(evtType) == list or type(evtType) == tuple:
3394 self.evtType = evtType
3395 else:
3396 self.evtType = [evtType]
3397
3398
3399 def Bind(self, target, id1, id2, function):
3400 """Bind this set of event types to target."""
3401 for et in self.evtType:
3402 target.Connect(id1, id2, et, function)
3403
3404
3405 def Unbind(self, target, id1, id2):
3406 """Remove an event binding."""
3407 success = 0
3408 for et in self.evtType:
3409 success += target.Disconnect(id1, id2, et)
3410 return success != 0
3411
3412
3413 def __call__(self, *args):
3414 """
3415 For backwards compatibility with the old EVT_* functions.
3416 Should be called with either (window, func), (window, ID,
3417 func) or (window, ID1, ID2, func) parameters depending on the
3418 type of the event.
3419 """
3420 assert len(args) == 2 + self.expectedIDs
3421 id1 = wx.ID_ANY
3422 id2 = wx.ID_ANY
3423 target = args[0]
3424 if self.expectedIDs == 0:
3425 func = args[1]
3426 elif self.expectedIDs == 1:
3427 id1 = args[1]
3428 func = args[2]
3429 elif self.expectedIDs == 2:
3430 id1 = args[1]
3431 id2 = args[2]
3432 func = args[3]
3433 else:
3434 raise ValueError, "Unexpected number of IDs"
3435
3436 self.Bind(target, id1, id2, func)
3437
3438
3439 # These two are square pegs that don't fit the PyEventBinder hole...
3440 def EVT_COMMAND(win, id, cmd, func):
3441 win.Connect(id, -1, cmd, func)
3442 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3443 win.Connect(id1, id2, cmd, func)
3444
3445
3446 #---------------------------------------------------------------------------
3447
3448 #---------------------------------------------------------------------------
3449
3450 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3451 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3452
3453 def NewEventType(*args):
3454 """NewEventType() -> wxEventType"""
3455 return _core_.NewEventType(*args)
3456 wxEVT_NULL = _core_.wxEVT_NULL
3457 wxEVT_FIRST = _core_.wxEVT_FIRST
3458 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3459 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3460 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3461 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3462 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3463 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3464 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3465 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3466 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3467 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3468 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3469 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3470 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3471 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3472 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3473 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3474 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3475 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3476 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3477 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3478 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3479 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3480 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3481 wxEVT_MOTION = _core_.wxEVT_MOTION
3482 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3483 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3484 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3485 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3486 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3487 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3488 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3489 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3490 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3491 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3492 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3493 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3494 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3495 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3496 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3497 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3498 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3499 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3500 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3501 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3502 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3503 wxEVT_CHAR = _core_.wxEVT_CHAR
3504 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3505 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3506 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3507 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3508 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3509 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3510 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3511 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3512 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3513 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3514 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3515 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3516 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3517 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3518 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3519 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3520 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3521 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3522 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3523 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3524 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3525 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3526 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3527 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3528 wxEVT_SIZE = _core_.wxEVT_SIZE
3529 wxEVT_MOVE = _core_.wxEVT_MOVE
3530 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3531 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3532 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3533 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3534 wxEVT_POWER = _core_.wxEVT_POWER
3535 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3536 wxEVT_CREATE = _core_.wxEVT_CREATE
3537 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3538 wxEVT_SHOW = _core_.wxEVT_SHOW
3539 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3540 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3541 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3542 wxEVT_PAINT = _core_.wxEVT_PAINT
3543 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3544 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3545 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3546 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3547 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3548 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3549 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3550 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3551 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3552 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3553 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3554 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3555 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3556 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3557 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3558 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3559 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3560 wxEVT_IDLE = _core_.wxEVT_IDLE
3561 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3562 wxEVT_SIZING = _core_.wxEVT_SIZING
3563 wxEVT_MOVING = _core_.wxEVT_MOVING
3564 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3565 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3566 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3567 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3568 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3569 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3570 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3571 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3572 #
3573 # Create some event binders
3574 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3575 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3576 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3577 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3578 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3579 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3580 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3581 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3582 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3583 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3584 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3585 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3586 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3587 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3588 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3589 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3590 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3591 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3592 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3593 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3594 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3595 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3596 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3597 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3598 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3599 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3600 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3601 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3602 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3603 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3604 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3605 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3606 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3607 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3608 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3609 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3610 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3611 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3612 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3613 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3614 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3615
3616 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3617 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3618 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3619 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3620 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3621 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3622 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3623 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3624 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3625 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3626 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3627 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3628 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3629
3630 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3631 wxEVT_LEFT_UP,
3632 wxEVT_MIDDLE_DOWN,
3633 wxEVT_MIDDLE_UP,
3634 wxEVT_RIGHT_DOWN,
3635 wxEVT_RIGHT_UP,
3636 wxEVT_MOTION,
3637 wxEVT_LEFT_DCLICK,
3638 wxEVT_MIDDLE_DCLICK,
3639 wxEVT_RIGHT_DCLICK,
3640 wxEVT_ENTER_WINDOW,
3641 wxEVT_LEAVE_WINDOW,
3642 wxEVT_MOUSEWHEEL
3643 ])
3644
3645
3646 # Scrolling from wxWindow (sent to wxScrolledWindow)
3647 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3648 wxEVT_SCROLLWIN_BOTTOM,
3649 wxEVT_SCROLLWIN_LINEUP,
3650 wxEVT_SCROLLWIN_LINEDOWN,
3651 wxEVT_SCROLLWIN_PAGEUP,
3652 wxEVT_SCROLLWIN_PAGEDOWN,
3653 wxEVT_SCROLLWIN_THUMBTRACK,
3654 wxEVT_SCROLLWIN_THUMBRELEASE,
3655 ])
3656
3657 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3658 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3659 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3660 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3661 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3662 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3663 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3664 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3665
3666 # Scrolling from wx.Slider and wx.ScrollBar
3667 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3668 wxEVT_SCROLL_BOTTOM,
3669 wxEVT_SCROLL_LINEUP,
3670 wxEVT_SCROLL_LINEDOWN,
3671 wxEVT_SCROLL_PAGEUP,
3672 wxEVT_SCROLL_PAGEDOWN,
3673 wxEVT_SCROLL_THUMBTRACK,
3674 wxEVT_SCROLL_THUMBRELEASE,
3675 wxEVT_SCROLL_CHANGED,
3676 ])
3677
3678 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3679 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3680 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3681 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3682 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3683 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3684 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3685 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3686 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3687 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3688
3689 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3690 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3691 wxEVT_SCROLL_BOTTOM,
3692 wxEVT_SCROLL_LINEUP,
3693 wxEVT_SCROLL_LINEDOWN,
3694 wxEVT_SCROLL_PAGEUP,
3695 wxEVT_SCROLL_PAGEDOWN,
3696 wxEVT_SCROLL_THUMBTRACK,
3697 wxEVT_SCROLL_THUMBRELEASE,
3698 wxEVT_SCROLL_CHANGED,
3699 ], 1)
3700
3701 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3702 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3703 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3704 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3705 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3706 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3707 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3708 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3709 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3710 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3711
3712 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3713 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3714 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3715 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3716 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3717 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3718 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3719 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3720 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3721 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3722
3723 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3724 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3725 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3726 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3727 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3728 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3729 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3730 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3731 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3732
3733
3734 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3735 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3736 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3737 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3738 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3739 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3740 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3741
3742 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3743
3744 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3745 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3746
3747 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3748
3749
3750
3751 #---------------------------------------------------------------------------
3752
3753 class Event(Object):
3754 """
3755 An event is a structure holding information about an event passed to a
3756 callback or member function. wx.Event is an abstract base class for
3757 other event classes
3758 """
3759 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3760 def __init__(self): raise AttributeError, "No constructor defined"
3761 __repr__ = _swig_repr
3762 __swig_destroy__ = _core_.delete_Event
3763 __del__ = lambda self : None;
3764 def SetEventType(*args, **kwargs):
3765 """
3766 SetEventType(self, wxEventType typ)
3767
3768 Sets the specific type of the event.
3769 """
3770 return _core_.Event_SetEventType(*args, **kwargs)
3771
3772 def GetEventType(*args, **kwargs):
3773 """
3774 GetEventType(self) -> wxEventType
3775
3776 Returns the identifier of the given event type, such as
3777 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3778 """
3779 return _core_.Event_GetEventType(*args, **kwargs)
3780
3781 def GetEventObject(*args, **kwargs):
3782 """
3783 GetEventObject(self) -> Object
3784
3785 Returns the object (usually a window) associated with the event, if
3786 any.
3787 """
3788 return _core_.Event_GetEventObject(*args, **kwargs)
3789
3790 def SetEventObject(*args, **kwargs):
3791 """
3792 SetEventObject(self, Object obj)
3793
3794 Sets the originating object, or in other words, obj is normally the
3795 object that is sending the event.
3796 """
3797 return _core_.Event_SetEventObject(*args, **kwargs)
3798
3799 def GetTimestamp(*args, **kwargs):
3800 """GetTimestamp(self) -> long"""
3801 return _core_.Event_GetTimestamp(*args, **kwargs)
3802
3803 def SetTimestamp(*args, **kwargs):
3804 """SetTimestamp(self, long ts=0)"""
3805 return _core_.Event_SetTimestamp(*args, **kwargs)
3806
3807 def GetId(*args, **kwargs):
3808 """
3809 GetId(self) -> int
3810
3811 Returns the identifier associated with this event, such as a button
3812 command id.
3813 """
3814 return _core_.Event_GetId(*args, **kwargs)
3815
3816 def SetId(*args, **kwargs):
3817 """
3818 SetId(self, int Id)
3819
3820 Set's the ID for the event. This is usually the ID of the window that
3821 is sending the event, but it can also be a command id from a menu
3822 item, etc.
3823 """
3824 return _core_.Event_SetId(*args, **kwargs)
3825
3826 def IsCommandEvent(*args, **kwargs):
3827 """
3828 IsCommandEvent(self) -> bool
3829
3830 Returns true if the event is or is derived from `wx.CommandEvent` else
3831 it returns false. Note: Exists only for optimization purposes.
3832 """
3833 return _core_.Event_IsCommandEvent(*args, **kwargs)
3834
3835 def Skip(*args, **kwargs):
3836 """
3837 Skip(self, bool skip=True)
3838
3839 Called by an event handler, it controls whether additional event
3840 handlers bound to this event will be called after the current event
3841 handler returns. Skip(false) (the default setting) will prevent
3842 additional event handlers from being called and control will be
3843 returned to the sender of the event immediately after the current
3844 handler has finished. Skip(True) will cause the event processing
3845 system to continue searching for a handler function for this event.
3846
3847 """
3848 return _core_.Event_Skip(*args, **kwargs)
3849
3850 def GetSkipped(*args, **kwargs):
3851 """
3852 GetSkipped(self) -> bool
3853
3854 Returns true if the event handler should be skipped, false otherwise.
3855 :see: `Skip`
3856 """
3857 return _core_.Event_GetSkipped(*args, **kwargs)
3858
3859 def ShouldPropagate(*args, **kwargs):
3860 """
3861 ShouldPropagate(self) -> bool
3862
3863 Test if this event should be propagated to the parent window or not,
3864 i.e. if the propagation level is currently greater than 0.
3865 """
3866 return _core_.Event_ShouldPropagate(*args, **kwargs)
3867
3868 def StopPropagation(*args, **kwargs):
3869 """
3870 StopPropagation(self) -> int
3871
3872 Stop the event from propagating to its parent window. Returns the old
3873 propagation level value which may be later passed to
3874 `ResumePropagation` to allow propagating the event again.
3875 """
3876 return _core_.Event_StopPropagation(*args, **kwargs)
3877
3878 def ResumePropagation(*args, **kwargs):
3879 """
3880 ResumePropagation(self, int propagationLevel)
3881
3882 Resume the event propagation by restoring the propagation level. (For
3883 example, you can use the value returned by an earlier call to
3884 `StopPropagation`.)
3885
3886 """
3887 return _core_.Event_ResumePropagation(*args, **kwargs)
3888
3889 def Clone(*args, **kwargs):
3890 """Clone(self) -> Event"""
3891 return _core_.Event_Clone(*args, **kwargs)
3892
3893 Event_swigregister = _core_.Event_swigregister
3894 Event_swigregister(Event)
3895
3896 #---------------------------------------------------------------------------
3897
3898 class PropagationDisabler(object):
3899 """
3900 Helper class to temporarily change an event not to propagate. Simply
3901 create an instance of this class and then whe it is destroyed the
3902 propogation of the event will be restored.
3903 """
3904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3905 __repr__ = _swig_repr
3906 def __init__(self, *args, **kwargs):
3907 """
3908 __init__(self, Event event) -> PropagationDisabler
3909
3910 Helper class to temporarily change an event not to propagate. Simply
3911 create an instance of this class and then whe it is destroyed the
3912 propogation of the event will be restored.
3913 """
3914 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3915 __swig_destroy__ = _core_.delete_PropagationDisabler
3916 __del__ = lambda self : None;
3917 PropagationDisabler_swigregister = _core_.PropagationDisabler_swigregister
3918 PropagationDisabler_swigregister(PropagationDisabler)
3919
3920 class PropagateOnce(object):
3921 """
3922 A helper class that will temporarily lower propagation level of an
3923 event. Simply create an instance of this class and then whe it is
3924 destroyed the propogation of the event will be restored.
3925 """
3926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3927 __repr__ = _swig_repr
3928 def __init__(self, *args, **kwargs):
3929 """
3930 __init__(self, Event event) -> PropagateOnce
3931
3932 A helper class that will temporarily lower propagation level of an
3933 event. Simply create an instance of this class and then whe it is
3934 destroyed the propogation of the event will be restored.
3935 """
3936 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3937 __swig_destroy__ = _core_.delete_PropagateOnce
3938 __del__ = lambda self : None;
3939 PropagateOnce_swigregister = _core_.PropagateOnce_swigregister
3940 PropagateOnce_swigregister(PropagateOnce)
3941
3942 #---------------------------------------------------------------------------
3943
3944 class CommandEvent(Event):
3945 """
3946 This event class contains information about command events, which
3947 originate from a variety of simple controls, as well as menus and
3948 toolbars.
3949 """
3950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3951 __repr__ = _swig_repr
3952 def __init__(self, *args, **kwargs):
3953 """
3954 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3955
3956 This event class contains information about command events, which
3957 originate from a variety of simple controls, as well as menus and
3958 toolbars.
3959 """
3960 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3961 def GetSelection(*args, **kwargs):
3962 """
3963 GetSelection(self) -> int
3964
3965 Returns item index for a listbox or choice selection event (not valid
3966 for a deselection).
3967 """
3968 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3969
3970 def SetString(*args, **kwargs):
3971 """SetString(self, String s)"""
3972 return _core_.CommandEvent_SetString(*args, **kwargs)
3973
3974 def GetString(*args, **kwargs):
3975 """
3976 GetString(self) -> String
3977
3978 Returns item string for a listbox or choice selection event (not valid
3979 for a deselection).
3980 """
3981 return _core_.CommandEvent_GetString(*args, **kwargs)
3982
3983 def IsChecked(*args, **kwargs):
3984 """
3985 IsChecked(self) -> bool
3986
3987 This method can be used with checkbox and menu events: for the
3988 checkboxes, the method returns true for a selection event and false
3989 for a deselection one. For the menu events, this method indicates if
3990 the menu item just has become checked or unchecked (and thus only
3991 makes sense for checkable menu items).
3992 """
3993 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3994
3995 Checked = IsChecked
3996 def IsSelection(*args, **kwargs):
3997 """
3998 IsSelection(self) -> bool
3999
4000 For a listbox or similar event, returns true if it is a selection,
4001 false if it is a deselection.
4002 """
4003 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4004
4005 def SetExtraLong(*args, **kwargs):
4006 """SetExtraLong(self, long extraLong)"""
4007 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4008
4009 def GetExtraLong(*args, **kwargs):
4010 """
4011 GetExtraLong(self) -> long
4012
4013 Returns extra information dependant on the event objects type. If the
4014 event comes from a listbox selection, it is a boolean determining
4015 whether the event was a selection (true) or a deselection (false). A
4016 listbox deselection only occurs for multiple-selection boxes, and in
4017 this case the index and string values are indeterminate and the
4018 listbox must be examined by the application.
4019 """
4020 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4021
4022 def SetInt(*args, **kwargs):
4023 """SetInt(self, int i)"""
4024 return _core_.CommandEvent_SetInt(*args, **kwargs)
4025
4026 def GetInt(*args, **kwargs):
4027 """
4028 GetInt(self) -> long
4029
4030 Returns the integer identifier corresponding to a listbox, choice or
4031 radiobox selection (only if the event was a selection, not a
4032 deselection), or a boolean value representing the value of a checkbox.
4033 """
4034 return _core_.CommandEvent_GetInt(*args, **kwargs)
4035
4036 def GetClientData(*args, **kwargs):
4037 """
4038 GetClientData(self) -> PyObject
4039
4040 Returns the client data object for a listbox or choice selection event, (if any.)
4041 """
4042 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4043
4044 def SetClientData(*args, **kwargs):
4045 """
4046 SetClientData(self, PyObject clientData)
4047
4048 Associate the given client data with the item at position n.
4049 """
4050 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4051
4052 GetClientObject = GetClientData
4053 SetClientObject = SetClientData
4054
4055 def Clone(*args, **kwargs):
4056 """Clone(self) -> Event"""
4057 return _core_.CommandEvent_Clone(*args, **kwargs)
4058
4059 CommandEvent_swigregister = _core_.CommandEvent_swigregister
4060 CommandEvent_swigregister(CommandEvent)
4061
4062 #---------------------------------------------------------------------------
4063
4064 class NotifyEvent(CommandEvent):
4065 """
4066 An instance of this class (or one of its derived classes) is sent from
4067 a control when the control's state is being changed and the control
4068 allows that change to be prevented from happening. The event handler
4069 can call `Veto` or `Allow` to tell the control what to do.
4070 """
4071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4072 __repr__ = _swig_repr
4073 def __init__(self, *args, **kwargs):
4074 """
4075 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4076
4077 An instance of this class (or one of its derived classes) is sent from
4078 a control when the control's state is being changed and the control
4079 allows that change to be prevented from happening. The event handler
4080 can call `Veto` or `Allow` to tell the control what to do.
4081 """
4082 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4083 def Veto(*args, **kwargs):
4084 """
4085 Veto(self)
4086
4087 Prevents the change announced by this event from happening.
4088
4089 It is in general a good idea to notify the user about the reasons for
4090 vetoing the change because otherwise the applications behaviour (which
4091 just refuses to do what the user wants) might be quite surprising.
4092 """
4093 return _core_.NotifyEvent_Veto(*args, **kwargs)
4094
4095 def Allow(*args, **kwargs):
4096 """
4097 Allow(self)
4098
4099 This is the opposite of `Veto`: it explicitly allows the event to be
4100 processed. For most events it is not necessary to call this method as
4101 the events are allowed anyhow but some are forbidden by default (this
4102 will be mentioned in the corresponding event description).
4103 """
4104 return _core_.NotifyEvent_Allow(*args, **kwargs)
4105
4106 def IsAllowed(*args, **kwargs):
4107 """
4108 IsAllowed(self) -> bool
4109
4110 Returns true if the change is allowed (`Veto` hasn't been called) or
4111 false otherwise (if it was).
4112 """
4113 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4114
4115 NotifyEvent_swigregister = _core_.NotifyEvent_swigregister
4116 NotifyEvent_swigregister(NotifyEvent)
4117
4118 #---------------------------------------------------------------------------
4119
4120 class ScrollEvent(CommandEvent):
4121 """
4122 A scroll event holds information about events sent from stand-alone
4123 scrollbars and sliders. Note that scrolled windows do not send
4124 instnaces of this event class, but send the `wx.ScrollWinEvent`
4125 instead.
4126 """
4127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4128 __repr__ = _swig_repr
4129 def __init__(self, *args, **kwargs):
4130 """
4131 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4132 int orient=0) -> ScrollEvent
4133 """
4134 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4135 def GetOrientation(*args, **kwargs):
4136 """
4137 GetOrientation(self) -> int
4138
4139 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4140 the scrollbar.
4141 """
4142 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4143
4144 def GetPosition(*args, **kwargs):
4145 """
4146 GetPosition(self) -> int
4147
4148 Returns the position of the scrollbar.
4149 """
4150 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4151
4152 def SetOrientation(*args, **kwargs):
4153 """SetOrientation(self, int orient)"""
4154 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4155
4156 def SetPosition(*args, **kwargs):
4157 """SetPosition(self, int pos)"""
4158 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4159
4160 ScrollEvent_swigregister = _core_.ScrollEvent_swigregister
4161 ScrollEvent_swigregister(ScrollEvent)
4162
4163 #---------------------------------------------------------------------------
4164
4165 class ScrollWinEvent(Event):
4166 """
4167 A wx.ScrollWinEvent holds information about scrolling and is sent from
4168 scrolling windows.
4169 """
4170 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4171 __repr__ = _swig_repr
4172 def __init__(self, *args, **kwargs):
4173 """
4174 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4175
4176 A wx.ScrollWinEvent holds information about scrolling and is sent from
4177 scrolling windows.
4178 """
4179 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4180 def GetOrientation(*args, **kwargs):
4181 """
4182 GetOrientation(self) -> int
4183
4184 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4185 the scrollbar.
4186 """
4187 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4188
4189 def GetPosition(*args, **kwargs):
4190 """
4191 GetPosition(self) -> int
4192
4193 Returns the position of the scrollbar for the thumb track and release
4194 events. Note that this field can't be used for the other events, you
4195 need to query the window itself for the current position in that case.
4196 """
4197 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4198
4199 def SetOrientation(*args, **kwargs):
4200 """SetOrientation(self, int orient)"""
4201 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4202
4203 def SetPosition(*args, **kwargs):
4204 """SetPosition(self, int pos)"""
4205 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4206
4207 ScrollWinEvent_swigregister = _core_.ScrollWinEvent_swigregister
4208 ScrollWinEvent_swigregister(ScrollWinEvent)
4209
4210 #---------------------------------------------------------------------------
4211
4212 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4213 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4214 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4215 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4216 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4217 class MouseEvent(Event):
4218 """
4219 This event class contains information about the events generated by
4220 the mouse: they include mouse buttons press and release events and
4221 mouse move events.
4222
4223 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4224 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4225 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4226 a middle button so a portable application should avoid relying on the
4227 events from it.
4228
4229 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4230 the former returns true when the event corresponds to the left mouse
4231 button click while the latter returns true if the left mouse button is
4232 currently being pressed. For example, when the user is dragging the
4233 mouse you can use `LeftIsDown` to test whether the left mouse button
4234 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4235 `LeftIsDown` will also return true in wxWidgets whatever the
4236 underlying GUI behaviour is (which is platform-dependent). The same
4237 applies, of course, to other mouse buttons as well.
4238 """
4239 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4240 __repr__ = _swig_repr
4241 def __init__(self, *args, **kwargs):
4242 """
4243 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4244
4245 Constructs a wx.MouseEvent. Valid event types are:
4246
4247 * wxEVT_ENTER_WINDOW
4248 * wxEVT_LEAVE_WINDOW
4249 * wxEVT_LEFT_DOWN
4250 * wxEVT_LEFT_UP
4251 * wxEVT_LEFT_DCLICK
4252 * wxEVT_MIDDLE_DOWN
4253 * wxEVT_MIDDLE_UP
4254 * wxEVT_MIDDLE_DCLICK
4255 * wxEVT_RIGHT_DOWN
4256 * wxEVT_RIGHT_UP
4257 * wxEVT_RIGHT_DCLICK
4258 * wxEVT_MOTION
4259 * wxEVT_MOUSEWHEEL
4260 """
4261 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4262 def IsButton(*args, **kwargs):
4263 """
4264 IsButton(self) -> bool
4265
4266 Returns true if the event was a mouse button event (not necessarily a
4267 button down event - that may be tested using `ButtonDown`).
4268 """
4269 return _core_.MouseEvent_IsButton(*args, **kwargs)
4270
4271 def ButtonDown(*args, **kwargs):
4272 """
4273 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4274
4275 If the argument is omitted, this returns true if the event was any
4276 mouse button down event. Otherwise the argument specifies which
4277 button-down event shold be checked for (see `Button` for the possible
4278 values).
4279 """
4280 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4281
4282 def ButtonDClick(*args, **kwargs):
4283 """
4284 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4285
4286 If the argument is omitted, this returns true if the event was any
4287 mouse double click event. Otherwise the argument specifies which
4288 double click event to check for (see `Button` for the possible
4289 values).
4290 """
4291 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4292
4293 def ButtonUp(*args, **kwargs):
4294 """
4295 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4296
4297 If the argument is omitted, this returns true if the event was any
4298 mouse button up event. Otherwise the argument specifies which button
4299 up event to check for (see `Button` for the possible values).
4300 """
4301 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4302
4303 def Button(*args, **kwargs):
4304 """
4305 Button(self, int button) -> bool
4306
4307 Returns true if the identified mouse button is changing state. Valid
4308 values of button are:
4309
4310 ==================== =====================================
4311 wx.MOUSE_BTN_LEFT check if left button was pressed
4312 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4313 wx.MOUSE_BTN_RIGHT check if right button was pressed
4314 wx.MOUSE_BTN_ANY check if any button was pressed
4315 ==================== =====================================
4316
4317 """
4318 return _core_.MouseEvent_Button(*args, **kwargs)
4319
4320 def ButtonIsDown(*args, **kwargs):
4321 """ButtonIsDown(self, int but) -> bool"""
4322 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4323
4324 def GetButton(*args, **kwargs):
4325 """
4326 GetButton(self) -> int
4327
4328 Returns the mouse button which generated this event or
4329 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4330 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4331 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4332 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4333 right buttons respectively.
4334 """
4335 return _core_.MouseEvent_GetButton(*args, **kwargs)
4336
4337 def ControlDown(*args, **kwargs):
4338 """
4339 ControlDown(self) -> bool
4340
4341 Returns true if the control key was down at the time of the event.
4342 """
4343 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4344
4345 def MetaDown(*args, **kwargs):
4346 """
4347 MetaDown(self) -> bool
4348
4349 Returns true if the Meta key was down at the time of the event.
4350 """
4351 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4352
4353 def AltDown(*args, **kwargs):
4354 """
4355 AltDown(self) -> bool
4356
4357 Returns true if the Alt key was down at the time of the event.
4358 """
4359 return _core_.MouseEvent_AltDown(*args, **kwargs)
4360
4361 def ShiftDown(*args, **kwargs):
4362 """
4363 ShiftDown(self) -> bool
4364
4365 Returns true if the Shift key was down at the time of the event.
4366 """
4367 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4368
4369 def CmdDown(*args, **kwargs):
4370 """
4371 CmdDown(self) -> bool
4372
4373 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4374 platforms but the special "Apple" (a.k.a as "Command") key on
4375 Macs. It often makes sense to use it instead of, say, `ControlDown`
4376 because Cmd key is used for the same thing under Mac as Ctrl
4377 elsewhere. The Ctrl key still exists, it's just not used for this
4378 purpose. So for non-Mac platforms this is the same as `ControlDown`
4379 and Macs this is the same as `MetaDown`.
4380 """
4381 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4382
4383 def LeftDown(*args, **kwargs):
4384 """
4385 LeftDown(self) -> bool
4386
4387 Returns true if the left mouse button state changed to down.
4388 """
4389 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4390
4391 def MiddleDown(*args, **kwargs):
4392 """
4393 MiddleDown(self) -> bool
4394
4395 Returns true if the middle mouse button state changed to down.
4396 """
4397 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4398
4399 def RightDown(*args, **kwargs):
4400 """
4401 RightDown(self) -> bool
4402
4403 Returns true if the right mouse button state changed to down.
4404 """
4405 return _core_.MouseEvent_RightDown(*args, **kwargs)
4406
4407 def LeftUp(*args, **kwargs):
4408 """
4409 LeftUp(self) -> bool
4410
4411 Returns true if the left mouse button state changed to up.
4412 """
4413 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4414
4415 def MiddleUp(*args, **kwargs):
4416 """
4417 MiddleUp(self) -> bool
4418
4419 Returns true if the middle mouse button state changed to up.
4420 """
4421 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4422
4423 def RightUp(*args, **kwargs):
4424 """
4425 RightUp(self) -> bool
4426
4427 Returns true if the right mouse button state changed to up.
4428 """
4429 return _core_.MouseEvent_RightUp(*args, **kwargs)
4430
4431 def LeftDClick(*args, **kwargs):
4432 """
4433 LeftDClick(self) -> bool
4434
4435 Returns true if the event was a left button double click.
4436 """
4437 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4438
4439 def MiddleDClick(*args, **kwargs):
4440 """
4441 MiddleDClick(self) -> bool
4442
4443 Returns true if the event was a middle button double click.
4444 """
4445 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4446
4447 def RightDClick(*args, **kwargs):
4448 """
4449 RightDClick(self) -> bool
4450
4451 Returns true if the event was a right button double click.
4452 """
4453 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4454
4455 def LeftIsDown(*args, **kwargs):
4456 """
4457 LeftIsDown(self) -> bool
4458
4459 Returns true if the left mouse button is currently down, independent
4460 of the current event type.
4461
4462 Please notice that it is not the same as LeftDown which returns true
4463 if the left mouse button was just pressed. Rather, it describes the
4464 state of the mouse button before the event happened.
4465
4466 This event is usually used in the mouse event handlers which process
4467 "move mouse" messages to determine whether the user is (still)
4468 dragging the mouse.
4469 """
4470 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4471
4472 def MiddleIsDown(*args, **kwargs):
4473 """
4474 MiddleIsDown(self) -> bool
4475
4476 Returns true if the middle mouse button is currently down, independent
4477 of the current event type.
4478 """
4479 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4480
4481 def RightIsDown(*args, **kwargs):
4482 """
4483 RightIsDown(self) -> bool
4484
4485 Returns true if the right mouse button is currently down, independent
4486 of the current event type.
4487 """
4488 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4489
4490 def Dragging(*args, **kwargs):
4491 """
4492 Dragging(self) -> bool
4493
4494 Returns true if this was a dragging event (motion while a button is
4495 depressed).
4496 """
4497 return _core_.MouseEvent_Dragging(*args, **kwargs)
4498
4499 def Moving(*args, **kwargs):
4500 """
4501 Moving(self) -> bool
4502
4503 Returns true if this was a motion event and no mouse buttons were
4504 pressed. If any mouse button is held pressed, then this method returns
4505 false and Dragging returns true.
4506 """
4507 return _core_.MouseEvent_Moving(*args, **kwargs)
4508
4509 def Entering(*args, **kwargs):
4510 """
4511 Entering(self) -> bool
4512
4513 Returns true if the mouse was entering the window.
4514 """
4515 return _core_.MouseEvent_Entering(*args, **kwargs)
4516
4517 def Leaving(*args, **kwargs):
4518 """
4519 Leaving(self) -> bool
4520
4521 Returns true if the mouse was leaving the window.
4522 """
4523 return _core_.MouseEvent_Leaving(*args, **kwargs)
4524
4525 def GetPosition(*args, **kwargs):
4526 """
4527 GetPosition(self) -> Point
4528
4529 Returns the pixel position of the mouse in window coordinates when the
4530 event happened.
4531 """
4532 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4533
4534 def GetPositionTuple(*args, **kwargs):
4535 """
4536 GetPositionTuple() -> (x,y)
4537
4538 Returns the pixel position of the mouse in window coordinates when the
4539 event happened.
4540 """
4541 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4542
4543 def GetLogicalPosition(*args, **kwargs):
4544 """
4545 GetLogicalPosition(self, DC dc) -> Point
4546
4547 Returns the logical mouse position in pixels (i.e. translated
4548 according to the translation set for the DC, which usually indicates
4549 that the window has been scrolled).
4550 """
4551 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4552
4553 def GetX(*args, **kwargs):
4554 """
4555 GetX(self) -> int
4556
4557 Returns X coordinate of the physical mouse event position.
4558 """
4559 return _core_.MouseEvent_GetX(*args, **kwargs)
4560
4561 def GetY(*args, **kwargs):
4562 """
4563 GetY(self) -> int
4564
4565 Returns Y coordinate of the physical mouse event position.
4566 """
4567 return _core_.MouseEvent_GetY(*args, **kwargs)
4568
4569 def GetWheelRotation(*args, **kwargs):
4570 """
4571 GetWheelRotation(self) -> int
4572
4573 Get wheel rotation, positive or negative indicates direction of
4574 rotation. Current devices all send an event when rotation is equal to
4575 +/-WheelDelta, but this allows for finer resolution devices to be
4576 created in the future. Because of this you shouldn't assume that one
4577 event is equal to 1 line or whatever, but you should be able to either
4578 do partial line scrolling or wait until +/-WheelDelta rotation values
4579 have been accumulated before scrolling.
4580 """
4581 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4582
4583 def GetWheelDelta(*args, **kwargs):
4584 """
4585 GetWheelDelta(self) -> int
4586
4587 Get wheel delta, normally 120. This is the threshold for action to be
4588 taken, and one such action (for example, scrolling one increment)
4589 should occur for each delta.
4590 """
4591 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4592
4593 def GetLinesPerAction(*args, **kwargs):
4594 """
4595 GetLinesPerAction(self) -> int
4596
4597 Returns the configured number of lines (or whatever) to be scrolled
4598 per wheel action. Defaults to three.
4599 """
4600 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4601
4602 def IsPageScroll(*args, **kwargs):
4603 """
4604 IsPageScroll(self) -> bool
4605
4606 Returns true if the system has been setup to do page scrolling with
4607 the mouse wheel instead of line scrolling.
4608 """
4609 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4610
4611 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4612 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4613 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4614 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4615 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4616 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4617 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4618 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4619 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4620 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4621 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4622 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4623 MouseEvent_swigregister = _core_.MouseEvent_swigregister
4624 MouseEvent_swigregister(MouseEvent)
4625
4626 #---------------------------------------------------------------------------
4627
4628 class SetCursorEvent(Event):
4629 """
4630 A SetCursorEvent is generated when the mouse cursor is about to be set
4631 as a result of mouse motion. This event gives the application the
4632 chance to perform specific mouse cursor processing based on the
4633 current position of the mouse within the window. Use the `SetCursor`
4634 method to specify the cursor you want to be displayed.
4635 """
4636 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4637 __repr__ = _swig_repr
4638 def __init__(self, *args, **kwargs):
4639 """
4640 __init__(self, int x=0, int y=0) -> SetCursorEvent
4641
4642 Construct a new `wx.SetCursorEvent`.
4643 """
4644 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4645 def GetX(*args, **kwargs):
4646 """
4647 GetX(self) -> int
4648
4649 Returns the X coordinate of the mouse in client coordinates.
4650 """
4651 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4652
4653 def GetY(*args, **kwargs):
4654 """
4655 GetY(self) -> int
4656
4657 Returns the Y coordinate of the mouse in client coordinates.
4658 """
4659 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4660
4661 def SetCursor(*args, **kwargs):
4662 """
4663 SetCursor(self, Cursor cursor)
4664
4665 Sets the cursor associated with this event.
4666 """
4667 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4668
4669 def GetCursor(*args, **kwargs):
4670 """
4671 GetCursor(self) -> Cursor
4672
4673 Returns a reference to the cursor specified by this event.
4674 """
4675 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4676
4677 def HasCursor(*args, **kwargs):
4678 """
4679 HasCursor(self) -> bool
4680
4681 Returns true if the cursor specified by this event is a valid cursor.
4682 """
4683 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4684
4685 SetCursorEvent_swigregister = _core_.SetCursorEvent_swigregister
4686 SetCursorEvent_swigregister(SetCursorEvent)
4687
4688 #---------------------------------------------------------------------------
4689
4690 class KeyEvent(Event):
4691 """
4692 This event class contains information about keypress and character
4693 events. These events are only sent to the widget that currently has
4694 the keyboard focus.
4695
4696 Notice that there are three different kinds of keyboard events in
4697 wxWidgets: key down and up events and char events. The difference
4698 between the first two is clear - the first corresponds to a key press
4699 and the second to a key release - otherwise they are identical. Just
4700 note that if the key is maintained in a pressed state you will
4701 typically get a lot of (automatically generated) down events but only
4702 one up so it is wrong to assume that there is one up event
4703 corresponding to each down one.
4704
4705 Both key events provide untranslated key codes while the char event
4706 carries the translated one. The untranslated code for alphanumeric
4707 keys is always an upper case value. For the other keys it is one of
4708 WXK_XXX values from the keycodes table. The translated key is, in
4709 general, the character the user expects to appear as the result of the
4710 key combination when typing the text into a text entry zone, for
4711 example.
4712
4713 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4714 and the standard US keyboard): when the 'A' key is pressed, the key
4715 down event key code is equal to ASCII A == 65. But the char event key
4716 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4717 'A' keys simultaneously , the key code in key down event will still be
4718 just 'A' while the char event key code parameter will now be 'A' as
4719 well.
4720
4721 Although in this simple case it is clear that the correct key code
4722 could be found in the key down event handler by checking the value
4723 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4724 as for non alphanumeric keys or non-US keyboard layouts the
4725 translation is keyboard-layout dependent and can only be done properly
4726 by the system itself.
4727
4728 Another kind of translation is done when the control key is pressed:
4729 for example, for CTRL-A key press the key down event still carries the
4730 same key code 'A' as usual but the char event will have key code of 1,
4731 the ASCII value of this key combination.
4732
4733 You may discover how the other keys on your system behave
4734 interactively by running the KeyEvents sample in the wxPython demo and
4735 pressing some keys while the blue box at the top has the keyboard
4736 focus.
4737
4738 **Note**: If a key down event is caught and the event handler does not
4739 call event.Skip() then the coresponding char event will not
4740 happen. This is by design and enables the programs that handle both
4741 types of events to be a bit simpler.
4742
4743 **Note for Windows programmers**: The key and char events in wxWidgets
4744 are similar to but slightly different from Windows WM_KEYDOWN and
4745 WM_CHAR events. In particular, Alt-x combination will generate a char
4746 event in wxWidgets (unless it is used as an accelerator).
4747
4748 **Tip**: be sure to call event.Skip() for events that you don't
4749 process in key event function, otherwise menu shortcuts may cease to
4750 work under Windows.
4751
4752 """
4753 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4754 __repr__ = _swig_repr
4755 def __init__(self, *args, **kwargs):
4756 """
4757 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4758
4759 Construct a new `wx.KeyEvent`. Valid event types are:
4760 *
4761 """
4762 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4763 def GetModifiers(*args, **kwargs):
4764 """
4765 GetModifiers(self) -> int
4766
4767 Returns a bitmask of the current modifier settings. Can be used to
4768 check if the key event has exactly the given modifiers without having
4769 to explicitly check that the other modifiers are not down. For
4770 example::
4771
4772 if event.GetModifers() == wx.MOD_CONTROL:
4773 DoSomething()
4774
4775 """
4776 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4777
4778 def ControlDown(*args, **kwargs):
4779 """
4780 ControlDown(self) -> bool
4781
4782 Returns ``True`` if the Control key was down at the time of the event.
4783 """
4784 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4785
4786 def MetaDown(*args, **kwargs):
4787 """
4788 MetaDown(self) -> bool
4789
4790 Returns ``True`` if the Meta key was down at the time of the event.
4791 """
4792 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4793
4794 def AltDown(*args, **kwargs):
4795 """
4796 AltDown(self) -> bool
4797
4798 Returns ``True`` if the Alt key was down at the time of the event.
4799 """
4800 return _core_.KeyEvent_AltDown(*args, **kwargs)
4801
4802 def ShiftDown(*args, **kwargs):
4803 """
4804 ShiftDown(self) -> bool
4805
4806 Returns ``True`` if the Shift key was down at the time of the event.
4807 """
4808 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4809
4810 def CmdDown(*args, **kwargs):
4811 """
4812 CmdDown(self) -> bool
4813
4814 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4815 platforms but the special "Apple" (a.k.a as "Command") key on
4816 Macs. It makes often sense to use it instead of, say, `ControlDown`
4817 because Cmd key is used for the same thing under Mac as Ctrl
4818 elsewhere. The Ctrl still exists, it's just not used for this
4819 purpose. So for non-Mac platforms this is the same as `ControlDown`
4820 and Macs this is the same as `MetaDown`.
4821 """
4822 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4823
4824 def HasModifiers(*args, **kwargs):
4825 """
4826 HasModifiers(self) -> bool
4827
4828 Returns true if either CTRL or ALT keys was down at the time of the
4829 key event. Note that this function does not take into account neither
4830 SHIFT nor META key states (the reason for ignoring the latter is that
4831 it is common for NUMLOCK key to be configured as META under X but the
4832 key presses even while NUMLOCK is on should be still processed
4833 normally).
4834 """
4835 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4836
4837 def GetKeyCode(*args, **kwargs):
4838 """
4839 GetKeyCode(self) -> int
4840
4841 Returns the virtual key code. ASCII events return normal ASCII values,
4842 while non-ASCII events return values such as WXK_LEFT for the left
4843 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4844 codes.
4845
4846 Note that in Unicode build, the returned value is meaningful only if
4847 the user entered a character that can be represented in current
4848 locale's default charset. You can obtain the corresponding Unicode
4849 character using `GetUnicodeKey`.
4850 """
4851 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4852
4853 KeyCode = GetKeyCode
4854 def GetUnicodeKey(*args, **kwargs):
4855 """
4856 GetUnicodeKey(self) -> int
4857
4858 Returns the Unicode character corresponding to this key event. This
4859 function is only meaningfule in a Unicode build of wxPython.
4860 """
4861 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4862
4863 GetUniChar = GetUnicodeKey
4864 def GetRawKeyCode(*args, **kwargs):
4865 """
4866 GetRawKeyCode(self) -> unsigned int
4867
4868 Returns the raw key code for this event. This is a platform-dependent
4869 scan code which should only be used in advanced
4870 applications. Currently the raw key codes are not supported by all
4871 ports.
4872 """
4873 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4874
4875 def GetRawKeyFlags(*args, **kwargs):
4876 """
4877 GetRawKeyFlags(self) -> unsigned int
4878
4879 Returns the low level key flags for this event. The flags are
4880 platform-dependent and should only be used in advanced applications.
4881 Currently the raw key flags are not supported by all ports.
4882 """
4883 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4884
4885 def GetPosition(*args, **kwargs):
4886 """
4887 GetPosition(self) -> Point
4888
4889 Find the position of the event, if applicable.
4890 """
4891 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4892
4893 def GetPositionTuple(*args, **kwargs):
4894 """
4895 GetPositionTuple() -> (x,y)
4896
4897 Find the position of the event, if applicable.
4898 """
4899 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4900
4901 def GetX(*args, **kwargs):
4902 """
4903 GetX(self) -> int
4904
4905 Returns the X position (in client coordinates) of the event, if
4906 applicable.
4907 """
4908 return _core_.KeyEvent_GetX(*args, **kwargs)
4909
4910 def GetY(*args, **kwargs):
4911 """
4912 GetY(self) -> int
4913
4914 Returns the Y position (in client coordinates) of the event, if
4915 applicable.
4916 """
4917 return _core_.KeyEvent_GetY(*args, **kwargs)
4918
4919 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4920 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4921 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4922 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4923 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4924 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4925 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4926 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4927 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4928 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4929 KeyEvent_swigregister = _core_.KeyEvent_swigregister
4930 KeyEvent_swigregister(KeyEvent)
4931
4932 #---------------------------------------------------------------------------
4933
4934 class SizeEvent(Event):
4935 """
4936 A size event holds information about size change events. The EVT_SIZE
4937 handler function will be called when the window it is bound to has
4938 been resized.
4939
4940 Note that the size passed is of the whole window: call
4941 `wx.Window.GetClientSize` for the area which may be used by the
4942 application.
4943
4944 When a window is resized, usually only a small part of the window is
4945 damaged and and that area is all that is in the update region for the
4946 next paint event. However, if your drawing depends on the size of the
4947 window, you may need to clear the DC explicitly and repaint the whole
4948 window. In which case, you may need to call `wx.Window.Refresh` to
4949 invalidate the entire window.
4950
4951 """
4952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4953 __repr__ = _swig_repr
4954 def __init__(self, *args, **kwargs):
4955 """
4956 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4957
4958 Construct a new ``wx.SizeEvent``.
4959 """
4960 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4961 def GetSize(*args, **kwargs):
4962 """
4963 GetSize(self) -> Size
4964
4965 Returns the entire size of the window generating the size change
4966 event.
4967 """
4968 return _core_.SizeEvent_GetSize(*args, **kwargs)
4969
4970 def GetRect(*args, **kwargs):
4971 """GetRect(self) -> Rect"""
4972 return _core_.SizeEvent_GetRect(*args, **kwargs)
4973
4974 def SetRect(*args, **kwargs):
4975 """SetRect(self, Rect rect)"""
4976 return _core_.SizeEvent_SetRect(*args, **kwargs)
4977
4978 def SetSize(*args, **kwargs):
4979 """SetSize(self, Size size)"""
4980 return _core_.SizeEvent_SetSize(*args, **kwargs)
4981
4982 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4983 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4984 SizeEvent_swigregister = _core_.SizeEvent_swigregister
4985 SizeEvent_swigregister(SizeEvent)
4986
4987 #---------------------------------------------------------------------------
4988
4989 class MoveEvent(Event):
4990 """
4991 This event object is sent for EVT_MOVE event bindings when a window is
4992 moved to a new position.
4993 """
4994 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4995 __repr__ = _swig_repr
4996 def __init__(self, *args, **kwargs):
4997 """
4998 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4999
5000 Constructor.
5001 """
5002 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5003 def GetPosition(*args, **kwargs):
5004 """
5005 GetPosition(self) -> Point
5006
5007 Returns the position of the window generating the move change event.
5008 """
5009 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5010
5011 def GetRect(*args, **kwargs):
5012 """GetRect(self) -> Rect"""
5013 return _core_.MoveEvent_GetRect(*args, **kwargs)
5014
5015 def SetRect(*args, **kwargs):
5016 """SetRect(self, Rect rect)"""
5017 return _core_.MoveEvent_SetRect(*args, **kwargs)
5018
5019 def SetPosition(*args, **kwargs):
5020 """SetPosition(self, Point pos)"""
5021 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5022
5023 m_pos = property(GetPosition, SetPosition)
5024 m_rect = property(GetRect, SetRect)
5025
5026 MoveEvent_swigregister = _core_.MoveEvent_swigregister
5027 MoveEvent_swigregister(MoveEvent)
5028
5029 #---------------------------------------------------------------------------
5030
5031 class PaintEvent(Event):
5032 """
5033 A paint event is sent when a window's contents needs to be repainted.
5034 Note that in an EVT_PAINT handler the application must *always* create
5035 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5036 Windows assumes that the window has not been painted yet and will send
5037 the event again, causing endless refreshes.
5038
5039 You can optimize painting by retrieving the rectangles that have been
5040 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5041 and only repainting these rectangles. The rectangles are in terms of
5042 the client area, and are unscrolled, so you will need to do some
5043 calculations using the current view position to obtain logical,
5044 scrolled units.
5045
5046 """
5047 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5048 __repr__ = _swig_repr
5049 def __init__(self, *args, **kwargs):
5050 """__init__(self, int Id=0) -> PaintEvent"""
5051 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5052 PaintEvent_swigregister = _core_.PaintEvent_swigregister
5053 PaintEvent_swigregister(PaintEvent)
5054
5055 class NcPaintEvent(Event):
5056 """Proxy of C++ NcPaintEvent class"""
5057 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5058 __repr__ = _swig_repr
5059 def __init__(self, *args, **kwargs):
5060 """__init__(self, int winid=0) -> NcPaintEvent"""
5061 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5062 NcPaintEvent_swigregister = _core_.NcPaintEvent_swigregister
5063 NcPaintEvent_swigregister(NcPaintEvent)
5064
5065 #---------------------------------------------------------------------------
5066
5067 class EraseEvent(Event):
5068 """
5069 An erase event is sent whenever the background of a window needs to be
5070 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5071 binder. On some platforms, such as GTK+, this event is simulated
5072 (simply generated just before the paint event) and may cause flicker.
5073
5074 To paint a custom background use the `GetDC` method and use the returned
5075 device context if it is not ``None``, otherwise create a temporary
5076 `wx.ClientDC` and draw on that.
5077
5078 """
5079 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5080 __repr__ = _swig_repr
5081 def __init__(self, *args, **kwargs):
5082 """
5083 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5084
5085 Constructor
5086 """
5087 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5088 def GetDC(*args, **kwargs):
5089 """
5090 GetDC(self) -> DC
5091
5092 Returns the device context the event handler should draw upon. If
5093 ``None`` is returned then create a temporary `wx.ClientDC` and use
5094 that instead.
5095 """
5096 return _core_.EraseEvent_GetDC(*args, **kwargs)
5097
5098 EraseEvent_swigregister = _core_.EraseEvent_swigregister
5099 EraseEvent_swigregister(EraseEvent)
5100
5101 #---------------------------------------------------------------------------
5102
5103 class FocusEvent(Event):
5104 """
5105 A focus event is sent when a window's focus changes. The window losing
5106 focus receives an EVT_KILL_FOCUS event while the window gaining it
5107 gets an EVT_SET_FOCUS event.
5108
5109 Notice that the set focus event happens both when the user gives focus
5110 to the window (whether using the mouse or keyboard) and when it is
5111 done from the program itself using `wx.Window.SetFocus`.
5112
5113 """
5114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5115 __repr__ = _swig_repr
5116 def __init__(self, *args, **kwargs):
5117 """
5118 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5119
5120 Constructor
5121 """
5122 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5123 def GetWindow(*args, **kwargs):
5124 """
5125 GetWindow(self) -> Window
5126
5127 Returns the other window associated with this event, that is the
5128 window which had the focus before for the EVT_SET_FOCUS event and the
5129 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5130
5131 Warning: the window returned may be None!
5132 """
5133 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5134
5135 def SetWindow(*args, **kwargs):
5136 """SetWindow(self, Window win)"""
5137 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5138
5139 FocusEvent_swigregister = _core_.FocusEvent_swigregister
5140 FocusEvent_swigregister(FocusEvent)
5141
5142 #---------------------------------------------------------------------------
5143
5144 class ChildFocusEvent(CommandEvent):
5145 """
5146 wx.ChildFocusEvent notifies the parent that a child has received the
5147 focus. Unlike `wx.FocusEvent` it is propagated up the window
5148 heirarchy.
5149 """
5150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5151 __repr__ = _swig_repr
5152 def __init__(self, *args, **kwargs):
5153 """
5154 __init__(self, Window win=None) -> ChildFocusEvent
5155
5156 Constructor
5157 """
5158 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5159 def GetWindow(*args, **kwargs):
5160 """
5161 GetWindow(self) -> Window
5162
5163 The window which has just received the focus.
5164 """
5165 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5166
5167 ChildFocusEvent_swigregister = _core_.ChildFocusEvent_swigregister
5168 ChildFocusEvent_swigregister(ChildFocusEvent)
5169
5170 #---------------------------------------------------------------------------
5171
5172 class ActivateEvent(Event):
5173 """
5174 An activate event is sent when a top-level window or the entire
5175 application is being activated or deactivated.
5176
5177 A top-level window (a dialog or frame) receives an activate event when
5178 is being activated or deactivated. This is indicated visually by the
5179 title bar changing colour, and a subwindow gaining the keyboard focus.
5180 An application is activated or deactivated when one of its frames
5181 becomes activated, or a frame becomes inactivate resulting in all
5182 application frames being inactive.
5183
5184 Please note that usually you should call event.Skip() in your handlers
5185 for these events so the default handlers will still be called, as not
5186 doing so can result in strange effects.
5187
5188 """
5189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5190 __repr__ = _swig_repr
5191 def __init__(self, *args, **kwargs):
5192 """
5193 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5194
5195 Constructor
5196 """
5197 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5198 def GetActive(*args, **kwargs):
5199 """
5200 GetActive(self) -> bool
5201
5202 Returns true if the application or window is being activated, false
5203 otherwise.
5204 """
5205 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5206
5207 ActivateEvent_swigregister = _core_.ActivateEvent_swigregister
5208 ActivateEvent_swigregister(ActivateEvent)
5209
5210 #---------------------------------------------------------------------------
5211
5212 class InitDialogEvent(Event):
5213 """
5214 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5215 any window when `wx.Window.InitDialog` is called. Handlers for this
5216 event can transfer data to the window, or anything else that should be
5217 done before the user begins editing the form. The default handler
5218 calls `wx.Window.TransferDataToWindow`.
5219 """
5220 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5221 __repr__ = _swig_repr
5222 def __init__(self, *args, **kwargs):
5223 """
5224 __init__(self, int Id=0) -> InitDialogEvent
5225
5226 Constructor
5227 """
5228 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5229 InitDialogEvent_swigregister = _core_.InitDialogEvent_swigregister
5230 InitDialogEvent_swigregister(InitDialogEvent)
5231
5232 #---------------------------------------------------------------------------
5233
5234 class MenuEvent(Event):
5235 """
5236 This class is used for a variety of menu-related events. Note that
5237 these do not include menu command events, which are handled by sending
5238 `wx.CommandEvent` objects.
5239
5240 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5241 text in the first field of the status bar.
5242 """
5243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5244 __repr__ = _swig_repr
5245 def __init__(self, *args, **kwargs):
5246 """
5247 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5248
5249 Constructor
5250 """
5251 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5252 def GetMenuId(*args, **kwargs):
5253 """
5254 GetMenuId(self) -> int
5255
5256 Returns the menu identifier associated with the event. This method
5257 should be only used with the HIGHLIGHT events.
5258 """
5259 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5260
5261 def IsPopup(*args, **kwargs):
5262 """
5263 IsPopup(self) -> bool
5264
5265 Returns ``True`` if the menu which is being opened or closed is a
5266 popup menu, ``False`` if it is a normal one. This method should only
5267 be used with the OPEN and CLOSE events.
5268 """
5269 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5270
5271 def GetMenu(*args, **kwargs):
5272 """
5273 GetMenu(self) -> Menu
5274
5275 Returns the menu which is being opened or closed. This method should
5276 only be used with the OPEN and CLOSE events.
5277 """
5278 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5279
5280 MenuEvent_swigregister = _core_.MenuEvent_swigregister
5281 MenuEvent_swigregister(MenuEvent)
5282
5283 #---------------------------------------------------------------------------
5284
5285 class CloseEvent(Event):
5286 """
5287 This event class contains information about window and session close
5288 events.
5289
5290 The handler function for EVT_CLOSE is called when the user has tried
5291 to close a a frame or dialog box using the window manager controls or
5292 the system menu. It can also be invoked by the application itself
5293 programmatically, for example by calling the `wx.Window.Close`
5294 function.
5295
5296 You should check whether the application is forcing the deletion of
5297 the window using `CanVeto`. If it returns ``False``, you must destroy
5298 the window using `wx.Window.Destroy`. If the return value is ``True``,
5299 it is up to you whether you respond by destroying the window or not.
5300 For example you may wish to display a message dialog prompting to save
5301 files or to cancel the close.
5302
5303 If you don't destroy the window, you should call `Veto` to let the
5304 calling code know that you did not destroy the window. This allows the
5305 `wx.Window.Close` function to return ``True`` or ``False`` depending
5306 on whether the close instruction was honored or not.
5307 """
5308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5309 __repr__ = _swig_repr
5310 def __init__(self, *args, **kwargs):
5311 """
5312 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5313
5314 Constructor.
5315 """
5316 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5317 def SetLoggingOff(*args, **kwargs):
5318 """
5319 SetLoggingOff(self, bool logOff)
5320
5321 Sets the 'logging off' flag.
5322 """
5323 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5324
5325 def GetLoggingOff(*args, **kwargs):
5326 """
5327 GetLoggingOff(self) -> bool
5328
5329 Returns ``True`` if the user is logging off or ``False`` if the
5330 system is shutting down. This method can only be called for end
5331 session and query end session events, it doesn't make sense for close
5332 window event.
5333 """
5334 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5335
5336 def Veto(*args, **kwargs):
5337 """
5338 Veto(self, bool veto=True)
5339
5340 Call this from your event handler to veto a system shutdown or to
5341 signal to the calling application that a window close did not happen.
5342
5343 You can only veto a shutdown or close if `CanVeto` returns true.
5344 """
5345 return _core_.CloseEvent_Veto(*args, **kwargs)
5346
5347 def GetVeto(*args, **kwargs):
5348 """GetVeto(self) -> bool"""
5349 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5350
5351 def SetCanVeto(*args, **kwargs):
5352 """
5353 SetCanVeto(self, bool canVeto)
5354
5355 Sets the 'can veto' flag.
5356 """
5357 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5358
5359 def CanVeto(*args, **kwargs):
5360 """
5361 CanVeto(self) -> bool
5362
5363 Returns true if you can veto a system shutdown or a window close
5364 event. Vetoing a window close event is not possible if the calling
5365 code wishes to force the application to exit, and so this function
5366 must be called to check this.
5367 """
5368 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5369
5370 CloseEvent_swigregister = _core_.CloseEvent_swigregister
5371 CloseEvent_swigregister(CloseEvent)
5372
5373 #---------------------------------------------------------------------------
5374
5375 class ShowEvent(Event):
5376 """An EVT_SHOW event is sent when a window is shown or hidden."""
5377 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5378 __repr__ = _swig_repr
5379 def __init__(self, *args, **kwargs):
5380 """
5381 __init__(self, int winid=0, bool show=False) -> ShowEvent
5382
5383 An EVT_SHOW event is sent when a window is shown or hidden.
5384 """
5385 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5386 def SetShow(*args, **kwargs):
5387 """SetShow(self, bool show)"""
5388 return _core_.ShowEvent_SetShow(*args, **kwargs)
5389
5390 def GetShow(*args, **kwargs):
5391 """GetShow(self) -> bool"""
5392 return _core_.ShowEvent_GetShow(*args, **kwargs)
5393
5394 ShowEvent_swigregister = _core_.ShowEvent_swigregister
5395 ShowEvent_swigregister(ShowEvent)
5396
5397 #---------------------------------------------------------------------------
5398
5399 class IconizeEvent(Event):
5400 """
5401 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5402 restored.
5403 """
5404 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5405 __repr__ = _swig_repr
5406 def __init__(self, *args, **kwargs):
5407 """
5408 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5409
5410 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5411 restored.
5412 """
5413 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5414 def Iconized(*args, **kwargs):
5415 """
5416 Iconized(self) -> bool
5417
5418 Returns ``True`` if the frame has been iconized, ``False`` if it has
5419 been restored.
5420 """
5421 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5422
5423 IconizeEvent_swigregister = _core_.IconizeEvent_swigregister
5424 IconizeEvent_swigregister(IconizeEvent)
5425
5426 #---------------------------------------------------------------------------
5427
5428 class MaximizeEvent(Event):
5429 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5431 __repr__ = _swig_repr
5432 def __init__(self, *args, **kwargs):
5433 """
5434 __init__(self, int id=0) -> MaximizeEvent
5435
5436 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5437 """
5438 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5439 MaximizeEvent_swigregister = _core_.MaximizeEvent_swigregister
5440 MaximizeEvent_swigregister(MaximizeEvent)
5441
5442 #---------------------------------------------------------------------------
5443
5444 class DropFilesEvent(Event):
5445 """
5446 This class is used for drop files events, that is, when files have
5447 been dropped onto the window. This functionality is only available
5448 under Windows. The window must have previously been enabled for
5449 dropping by calling `wx.Window.DragAcceptFiles`.
5450
5451 Important note: this is a separate implementation to the more general
5452 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5453 implementation uses the older, Windows message-based approach of
5454 dropping files.
5455
5456 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5457 events.
5458
5459 """
5460 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5461 def __init__(self): raise AttributeError, "No constructor defined"
5462 __repr__ = _swig_repr
5463 def GetPosition(*args, **kwargs):
5464 """
5465 GetPosition(self) -> Point
5466
5467 Returns the position at which the files were dropped.
5468 """
5469 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5470
5471 def GetNumberOfFiles(*args, **kwargs):
5472 """
5473 GetNumberOfFiles(self) -> int
5474
5475 Returns the number of files dropped.
5476 """
5477 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5478
5479 def GetFiles(*args, **kwargs):
5480 """
5481 GetFiles(self) -> PyObject
5482
5483 Returns a list of the filenames that were dropped.
5484 """
5485 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5486
5487 DropFilesEvent_swigregister = _core_.DropFilesEvent_swigregister
5488 DropFilesEvent_swigregister(DropFilesEvent)
5489
5490 #---------------------------------------------------------------------------
5491
5492 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5493 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5494 class UpdateUIEvent(CommandEvent):
5495 """
5496 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5497 wxWidgets to give an application the chance to update various user
5498 interface elements.
5499
5500 Without update UI events, an application has to work hard to
5501 check/uncheck, enable/disable, and set the text for elements such as
5502 menu items and toolbar buttons. The code for doing this has to be
5503 mixed up with the code that is invoked when an action is invoked for a
5504 menu item or button.
5505
5506 With update UI events, you define an event handler to look at the
5507 state of the application and change UI elements accordingly. wxWidgets
5508 will call your handler functions in idle time, so you don't have to
5509 worry where to call this code. In addition to being a clearer and more
5510 declarative method, it also means you don't have to worry whether
5511 you're updating a toolbar or menubar identifier. The same handler can
5512 update a menu item and toolbar button, if the ID values are the same.
5513
5514 Instead of directly manipulating the menu or button, you call
5515 functions in the event object, such as `Check`. wxWidgets will
5516 determine whether such a call has been made, and which UI element to
5517 update.
5518
5519 These events will work for popup menus as well as menubars. Just
5520 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5521 any UI events for the window that owns the menu.
5522
5523 If you find that the overhead of UI update processing is affecting
5524 your application, you can do one or both of the following:
5525
5526 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5527 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5528 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5529 receive update events. No other windows will receive update
5530 events.
5531
5532 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5533 value to set the delay between updates. You may need to call
5534 `wx.Window.UpdateWindowUI` at critical points, for example when
5535 a dialog is about to be shown, in case the user sees a slight
5536 delay before windows are updated.
5537
5538 Note that although events are sent in idle time, defining a EVT_IDLE
5539 handler for a window does not affect this because the events are sent
5540 from an internal idle handler.
5541
5542 wxWidgets tries to optimize update events on some platforms. On
5543 Windows and GTK+, events for menubar items are only sent when the menu
5544 is about to be shown, and not in idle time.
5545
5546 """
5547 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5548 __repr__ = _swig_repr
5549 def __init__(self, *args, **kwargs):
5550 """
5551 __init__(self, int commandId=0) -> UpdateUIEvent
5552
5553 Constructor
5554 """
5555 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5556 def GetChecked(*args, **kwargs):
5557 """
5558 GetChecked(self) -> bool
5559
5560 Returns ``True`` if the UI element should be checked.
5561 """
5562 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5563
5564 def GetEnabled(*args, **kwargs):
5565 """
5566 GetEnabled(self) -> bool
5567
5568 Returns ``True`` if the UI element should be enabled.
5569 """
5570 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5571
5572 def GetShown(*args, **kwargs):
5573 """
5574 GetShown(self) -> bool
5575
5576 Returns ``True`` if the UI element should be shown.
5577 """
5578 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5579
5580 def GetText(*args, **kwargs):
5581 """
5582 GetText(self) -> String
5583
5584 Returns the text that should be set for the UI element.
5585 """
5586 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5587
5588 def GetSetText(*args, **kwargs):
5589 """
5590 GetSetText(self) -> bool
5591
5592 Returns ``True`` if the application has called `SetText`. For
5593 wxWidgets internal use only.
5594 """
5595 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5596
5597 def GetSetChecked(*args, **kwargs):
5598 """
5599 GetSetChecked(self) -> bool
5600
5601 Returns ``True`` if the application has called `Check`. For wxWidgets
5602 internal use only.
5603 """
5604 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5605
5606 def GetSetEnabled(*args, **kwargs):
5607 """
5608 GetSetEnabled(self) -> bool
5609
5610 Returns ``True`` if the application has called `Enable`. For wxWidgets
5611 internal use only.
5612 """
5613 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5614
5615 def GetSetShown(*args, **kwargs):
5616 """
5617 GetSetShown(self) -> bool
5618
5619 Returns ``True`` if the application has called `Show`. For wxWidgets
5620 internal use only.
5621 """
5622 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5623
5624 def Check(*args, **kwargs):
5625 """
5626 Check(self, bool check)
5627
5628 Check or uncheck the UI element.
5629 """
5630 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5631
5632 def Enable(*args, **kwargs):
5633 """
5634 Enable(self, bool enable)
5635
5636 Enable or disable the UI element.
5637 """
5638 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5639
5640 def Show(*args, **kwargs):
5641 """
5642 Show(self, bool show)
5643
5644 Show or hide the UI element.
5645 """
5646 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5647
5648 def SetText(*args, **kwargs):
5649 """
5650 SetText(self, String text)
5651
5652 Sets the text for this UI element.
5653 """
5654 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5655
5656 def SetUpdateInterval(*args, **kwargs):
5657 """
5658 SetUpdateInterval(long updateInterval)
5659
5660 Sets the interval between updates in milliseconds. Set to -1 to
5661 disable updates, or to 0 to update as frequently as possible. The
5662 default is 0.
5663
5664 Use this to reduce the overhead of UI update events if your
5665 application has a lot of windows. If you set the value to -1 or
5666 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5667 at appropriate points in your application, such as when a dialog is
5668 about to be shown.
5669 """
5670 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5671
5672 SetUpdateInterval = staticmethod(SetUpdateInterval)
5673 def GetUpdateInterval(*args, **kwargs):
5674 """
5675 GetUpdateInterval() -> long
5676
5677 Returns the current interval between updates in milliseconds. -1
5678 disables updates, 0 updates as frequently as possible.
5679 """
5680 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5681
5682 GetUpdateInterval = staticmethod(GetUpdateInterval)
5683 def CanUpdate(*args, **kwargs):
5684 """
5685 CanUpdate(Window win) -> bool
5686
5687 Returns ``True`` if it is appropriate to update (send UI update events
5688 to) this window.
5689
5690 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5691 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5692 events were last sent in idle time, and the update interval, to
5693 determine whether events should be sent to this window now. By default
5694 this will always return true because the update mode is initially
5695 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5696 events will be sent as often as possible. You can reduce the frequency
5697 that events are sent by changing the mode and/or setting an update
5698 interval.
5699
5700 """
5701 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5702
5703 CanUpdate = staticmethod(CanUpdate)
5704 def ResetUpdateTime(*args, **kwargs):
5705 """
5706 ResetUpdateTime()
5707
5708 Used internally to reset the last-updated time to the current time. It
5709 is assumed that update events are normally sent in idle time, so this
5710 is called at the end of idle processing.
5711 """
5712 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5713
5714 ResetUpdateTime = staticmethod(ResetUpdateTime)
5715 def SetMode(*args, **kwargs):
5716 """
5717 SetMode(int mode)
5718
5719 Specify how wxWidgets will send update events: to all windows, or only
5720 to those which specify that they will process the events.
5721
5722 The mode may be one of the following values:
5723
5724 ============================= ==========================================
5725 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5726 is the default setting.
5727 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5728 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5729 style set.
5730 ============================= ==========================================
5731
5732 """
5733 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5734
5735 SetMode = staticmethod(SetMode)
5736 def GetMode(*args, **kwargs):
5737 """
5738 GetMode() -> int
5739
5740 Returns a value specifying how wxWidgets will send update events: to
5741 all windows, or only to those which specify that they will process the
5742 events.
5743 """
5744 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5745
5746 GetMode = staticmethod(GetMode)
5747 UpdateUIEvent_swigregister = _core_.UpdateUIEvent_swigregister
5748 UpdateUIEvent_swigregister(UpdateUIEvent)
5749
5750 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5751 """
5752 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5753
5754 Sets the interval between updates in milliseconds. Set to -1 to
5755 disable updates, or to 0 to update as frequently as possible. The
5756 default is 0.
5757
5758 Use this to reduce the overhead of UI update events if your
5759 application has a lot of windows. If you set the value to -1 or
5760 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5761 at appropriate points in your application, such as when a dialog is
5762 about to be shown.
5763 """
5764 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5765
5766 def UpdateUIEvent_GetUpdateInterval(*args):
5767 """
5768 UpdateUIEvent_GetUpdateInterval() -> long
5769
5770 Returns the current interval between updates in milliseconds. -1
5771 disables updates, 0 updates as frequently as possible.
5772 """
5773 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5774
5775 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5776 """
5777 UpdateUIEvent_CanUpdate(Window win) -> bool
5778
5779 Returns ``True`` if it is appropriate to update (send UI update events
5780 to) this window.
5781
5782 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5783 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5784 events were last sent in idle time, and the update interval, to
5785 determine whether events should be sent to this window now. By default
5786 this will always return true because the update mode is initially
5787 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5788 events will be sent as often as possible. You can reduce the frequency
5789 that events are sent by changing the mode and/or setting an update
5790 interval.
5791
5792 """
5793 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5794
5795 def UpdateUIEvent_ResetUpdateTime(*args):
5796 """
5797 UpdateUIEvent_ResetUpdateTime()
5798
5799 Used internally to reset the last-updated time to the current time. It
5800 is assumed that update events are normally sent in idle time, so this
5801 is called at the end of idle processing.
5802 """
5803 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5804
5805 def UpdateUIEvent_SetMode(*args, **kwargs):
5806 """
5807 UpdateUIEvent_SetMode(int mode)
5808
5809 Specify how wxWidgets will send update events: to all windows, or only
5810 to those which specify that they will process the events.
5811
5812 The mode may be one of the following values:
5813
5814 ============================= ==========================================
5815 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5816 is the default setting.
5817 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5818 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5819 style set.
5820 ============================= ==========================================
5821
5822 """
5823 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5824
5825 def UpdateUIEvent_GetMode(*args):
5826 """
5827 UpdateUIEvent_GetMode() -> int
5828
5829 Returns a value specifying how wxWidgets will send update events: to
5830 all windows, or only to those which specify that they will process the
5831 events.
5832 """
5833 return _core_.UpdateUIEvent_GetMode(*args)
5834
5835 #---------------------------------------------------------------------------
5836
5837 class SysColourChangedEvent(Event):
5838 """
5839 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5840 when the user changes the colour settings using the control
5841 panel. This is only applicable under Windows.
5842
5843 The default event handler for this event propagates the event to child
5844 windows, since Windows only sends the events to top-level windows. If
5845 intercepting this event for a top-level window, remember to call
5846 `Skip` so the the base class handler will still be executed, or to
5847 pass the event on to the window's children explicitly.
5848
5849 """
5850 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5851 __repr__ = _swig_repr
5852 def __init__(self, *args, **kwargs):
5853 """
5854 __init__(self) -> SysColourChangedEvent
5855
5856 Constructor
5857 """
5858 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5859 SysColourChangedEvent_swigregister = _core_.SysColourChangedEvent_swigregister
5860 SysColourChangedEvent_swigregister(SysColourChangedEvent)
5861
5862 #---------------------------------------------------------------------------
5863
5864 class MouseCaptureChangedEvent(Event):
5865 """
5866 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5867 a window that loses its mouse capture. This is called even if
5868 `wx.Window.ReleaseMouse` was called by the application code. Handling
5869 this event allows an application to cater for unexpected capture
5870 releases which might otherwise confuse mouse handling code.
5871
5872 This event is implemented under Windows only.
5873 """
5874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5875 __repr__ = _swig_repr
5876 def __init__(self, *args, **kwargs):
5877 """
5878 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5879
5880 Constructor
5881 """
5882 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5883 def GetCapturedWindow(*args, **kwargs):
5884 """
5885 GetCapturedWindow(self) -> Window
5886
5887 Returns the window that gained the capture, or ``None`` if it was a
5888 non-wxWidgets window.
5889 """
5890 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5891
5892 MouseCaptureChangedEvent_swigregister = _core_.MouseCaptureChangedEvent_swigregister
5893 MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5894
5895 #---------------------------------------------------------------------------
5896
5897 class DisplayChangedEvent(Event):
5898 """
5899 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5900 resolution has changed.
5901
5902 This event is implemented under Windows only.
5903 """
5904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5905 __repr__ = _swig_repr
5906 def __init__(self, *args, **kwargs):
5907 """__init__(self) -> DisplayChangedEvent"""
5908 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5909 DisplayChangedEvent_swigregister = _core_.DisplayChangedEvent_swigregister
5910 DisplayChangedEvent_swigregister(DisplayChangedEvent)
5911
5912 #---------------------------------------------------------------------------
5913
5914 class PaletteChangedEvent(Event):
5915 """
5916 An EVT_PALETTE_CHANGED event is sent when the system palette has
5917 changed, thereby giving each window a chance to redo their own to
5918 match.
5919
5920 This event is implemented under Windows only.
5921 """
5922 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5923 __repr__ = _swig_repr
5924 def __init__(self, *args, **kwargs):
5925 """
5926 __init__(self, int id=0) -> PaletteChangedEvent
5927
5928 An EVT_PALETTE_CHANGED event is sent when the system palette has
5929 changed, thereby giving each window a chance to redo their own to
5930 match.
5931
5932 This event is implemented under Windows only.
5933 """
5934 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5935 def SetChangedWindow(*args, **kwargs):
5936 """SetChangedWindow(self, Window win)"""
5937 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5938
5939 def GetChangedWindow(*args, **kwargs):
5940 """GetChangedWindow(self) -> Window"""
5941 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5942
5943 PaletteChangedEvent_swigregister = _core_.PaletteChangedEvent_swigregister
5944 PaletteChangedEvent_swigregister(PaletteChangedEvent)
5945
5946 #---------------------------------------------------------------------------
5947
5948 class QueryNewPaletteEvent(Event):
5949 """
5950 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5951 focus and should re-do its palette.
5952
5953 This event is implemented under Windows only.
5954 """
5955 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5956 __repr__ = _swig_repr
5957 def __init__(self, *args, **kwargs):
5958 """
5959 __init__(self, int winid=0) -> QueryNewPaletteEvent
5960
5961 Constructor.
5962 """
5963 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
5964 def SetPaletteRealized(*args, **kwargs):
5965 """
5966 SetPaletteRealized(self, bool realized)
5967
5968 App should set this if it changes the palette.
5969 """
5970 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5971
5972 def GetPaletteRealized(*args, **kwargs):
5973 """GetPaletteRealized(self) -> bool"""
5974 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5975
5976 QueryNewPaletteEvent_swigregister = _core_.QueryNewPaletteEvent_swigregister
5977 QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
5978
5979 #---------------------------------------------------------------------------
5980
5981 class NavigationKeyEvent(Event):
5982 """
5983 EVT_NAVIGATION_KEY events are used to control moving the focus between
5984 widgets, otherwise known as tab-traversal. You woudl normally not
5985 catch navigation events in applications as there are already
5986 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5987 it useful to send navigation events in certain situations to change
5988 the focus in certain ways, although it's probably easier to just call
5989 `wx.Window.Navigate`.
5990 """
5991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5992 __repr__ = _swig_repr
5993 def __init__(self, *args, **kwargs):
5994 """__init__(self) -> NavigationKeyEvent"""
5995 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
5996 def GetDirection(*args, **kwargs):
5997 """
5998 GetDirection(self) -> bool
5999
6000 Returns ``True`` if the direction is forward, ``False`` otherwise.
6001 """
6002 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6003
6004 def SetDirection(*args, **kwargs):
6005 """
6006 SetDirection(self, bool forward)
6007
6008 Specify the direction that the navigation should take. Usually the
6009 difference between using Tab and Shift-Tab.
6010 """
6011 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6012
6013 def IsWindowChange(*args, **kwargs):
6014 """
6015 IsWindowChange(self) -> bool
6016
6017 Returns ``True`` if window change is allowed.
6018 """
6019 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6020
6021 def SetWindowChange(*args, **kwargs):
6022 """
6023 SetWindowChange(self, bool ischange)
6024
6025 Specify if the navigation should be able to change parent windows.
6026 For example, changing notebook pages, etc. This is usually implemented
6027 by using Control-Tab.
6028 """
6029 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6030
6031 def IsFromTab(*args, **kwargs):
6032 """
6033 IsFromTab(self) -> bool
6034
6035 Returns ``True`` if the navigation event is originated from the Tab
6036 key.
6037 """
6038 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6039
6040 def SetFromTab(*args, **kwargs):
6041 """
6042 SetFromTab(self, bool bIs)
6043
6044 Set to true under MSW if the event was generated using the tab key.
6045 This is required for proper navogation over radio buttons.
6046 """
6047 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6048
6049 def SetFlags(*args, **kwargs):
6050 """
6051 SetFlags(self, long flags)
6052
6053 Set the navigation flags to a combination of the following:
6054
6055 * wx.NavigationKeyEvent.IsBackward
6056 * wx.NavigationKeyEvent.IsForward
6057 * wx.NavigationKeyEvent.WinChange
6058 * wx.NavigationKeyEvent.FromTab
6059
6060 """
6061 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6062
6063 def GetCurrentFocus(*args, **kwargs):
6064 """
6065 GetCurrentFocus(self) -> Window
6066
6067 Returns the child window which currenty has the focus. May be
6068 ``None``.
6069 """
6070 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6071
6072 def SetCurrentFocus(*args, **kwargs):
6073 """
6074 SetCurrentFocus(self, Window win)
6075
6076 Set the window that has the focus.
6077 """
6078 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6079
6080 IsBackward = _core_.NavigationKeyEvent_IsBackward
6081 IsForward = _core_.NavigationKeyEvent_IsForward
6082 WinChange = _core_.NavigationKeyEvent_WinChange
6083 FromTab = _core_.NavigationKeyEvent_FromTab
6084 NavigationKeyEvent_swigregister = _core_.NavigationKeyEvent_swigregister
6085 NavigationKeyEvent_swigregister(NavigationKeyEvent)
6086
6087 #---------------------------------------------------------------------------
6088
6089 class WindowCreateEvent(CommandEvent):
6090 """
6091 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6092 underlying GUI object) exists.
6093 """
6094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6095 __repr__ = _swig_repr
6096 def __init__(self, *args, **kwargs):
6097 """
6098 __init__(self, Window win=None) -> WindowCreateEvent
6099
6100 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6101 underlying GUI object) exists.
6102 """
6103 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6104 def GetWindow(*args, **kwargs):
6105 """
6106 GetWindow(self) -> Window
6107
6108 Returns the window that this event refers to.
6109 """
6110 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6111
6112 WindowCreateEvent_swigregister = _core_.WindowCreateEvent_swigregister
6113 WindowCreateEvent_swigregister(WindowCreateEvent)
6114
6115 class WindowDestroyEvent(CommandEvent):
6116 """
6117 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6118 when the GUI window is destroyed.
6119
6120 When a class derived from `wx.Window` is destroyed its destructor will
6121 have already run by the time this event is sent. Therefore this event
6122 will not usually be received at all by the window itself. Since it is
6123 received after the destructor has run, an object should not try to
6124 handle its own wx.WindowDestroyEvent, but it can be used to get
6125 notification of the destruction of another window.
6126 """
6127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6128 __repr__ = _swig_repr
6129 def __init__(self, *args, **kwargs):
6130 """
6131 __init__(self, Window win=None) -> WindowDestroyEvent
6132
6133 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6134 when the GUI window is destroyed.
6135
6136 When a class derived from `wx.Window` is destroyed its destructor will
6137 have already run by the time this event is sent. Therefore this event
6138 will not usually be received at all by the window itself. Since it is
6139 received after the destructor has run, an object should not try to
6140 handle its own wx.WindowDestroyEvent, but it can be used to get
6141 notification of the destruction of another window.
6142 """
6143 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6144 def GetWindow(*args, **kwargs):
6145 """
6146 GetWindow(self) -> Window
6147
6148 Returns the window that this event refers to.
6149 """
6150 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6151
6152 WindowDestroyEvent_swigregister = _core_.WindowDestroyEvent_swigregister
6153 WindowDestroyEvent_swigregister(WindowDestroyEvent)
6154
6155 #---------------------------------------------------------------------------
6156
6157 class ContextMenuEvent(CommandEvent):
6158 """
6159 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6160 give the application a chance to show a context (popup) menu.
6161 """
6162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6163 __repr__ = _swig_repr
6164 def __init__(self, *args, **kwargs):
6165 """
6166 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6167
6168 Constructor.
6169 """
6170 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6171 def GetPosition(*args, **kwargs):
6172 """
6173 GetPosition(self) -> Point
6174
6175 Returns the position (in screen coordinants) at which the menu should
6176 be shown.
6177 """
6178 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6179
6180 def SetPosition(*args, **kwargs):
6181 """
6182 SetPosition(self, Point pos)
6183
6184 Sets the position at which the menu should be shown.
6185 """
6186 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6187
6188 ContextMenuEvent_swigregister = _core_.ContextMenuEvent_swigregister
6189 ContextMenuEvent_swigregister(ContextMenuEvent)
6190
6191 #---------------------------------------------------------------------------
6192
6193 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6194 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6195 class IdleEvent(Event):
6196 """
6197 This class is used for EVT_IDLE events, which are generated and sent
6198 when the application *becomes* idle. In other words, the when the
6199 event queue becomes empty then idle events are sent to all windows (by
6200 default) and as long as none of them call `RequestMore` then there are
6201 no more idle events until after the system event queue has some normal
6202 events and then becomes empty again.
6203
6204 By default, idle events are sent to all windows. If this is causing a
6205 significant overhead in your application, you can call
6206 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6207 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6208 which should receive idle events. Then idle events will only be sent
6209 to those windows and not to any others.
6210 """
6211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6212 __repr__ = _swig_repr
6213 def __init__(self, *args, **kwargs):
6214 """
6215 __init__(self) -> IdleEvent
6216
6217 Constructor
6218 """
6219 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6220 def RequestMore(*args, **kwargs):
6221 """
6222 RequestMore(self, bool needMore=True)
6223
6224 Tells wxWidgets that more processing is required. This function can be
6225 called by an EVT_IDLE handler for a window to indicate that the
6226 application should forward the EVT_IDLE event once more to the
6227 application windows. If no window calls this function during its
6228 EVT_IDLE handler, then the application will remain in a passive event
6229 loop until a new event is posted to the application by the windowing
6230 system.
6231 """
6232 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6233
6234 def MoreRequested(*args, **kwargs):
6235 """
6236 MoreRequested(self) -> bool
6237
6238 Returns ``True`` if the OnIdle function processing this event
6239 requested more processing time.
6240 """
6241 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6242
6243 def SetMode(*args, **kwargs):
6244 """
6245 SetMode(int mode)
6246
6247 Static method for specifying how wxWidgets will send idle events: to
6248 all windows, or only to those which specify that they will process the
6249 events.
6250
6251 The mode can be one of the following values:
6252
6253 ========================= ========================================
6254 wx.IDLE_PROCESS_ALL Send idle events to all windows
6255 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6256 the wx.WS_EX_PROCESS_IDLE extra style
6257 flag set.
6258 ========================= ========================================
6259
6260 """
6261 return _core_.IdleEvent_SetMode(*args, **kwargs)
6262
6263 SetMode = staticmethod(SetMode)
6264 def GetMode(*args, **kwargs):
6265 """
6266 GetMode() -> int
6267
6268 Static method returning a value specifying how wxWidgets will send
6269 idle events: to all windows, or only to those which specify that they
6270 will process the events.
6271 """
6272 return _core_.IdleEvent_GetMode(*args, **kwargs)
6273
6274 GetMode = staticmethod(GetMode)
6275 def CanSend(*args, **kwargs):
6276 """
6277 CanSend(Window win) -> bool
6278
6279 Returns ``True`` if it is appropriate to send idle events to this
6280 window.
6281
6282 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6283 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6284 events should be sent to this window now. By default this will always
6285 return ``True`` because the update mode is initially
6286 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6287 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6288 """
6289 return _core_.IdleEvent_CanSend(*args, **kwargs)
6290
6291 CanSend = staticmethod(CanSend)
6292 IdleEvent_swigregister = _core_.IdleEvent_swigregister
6293 IdleEvent_swigregister(IdleEvent)
6294
6295 def IdleEvent_SetMode(*args, **kwargs):
6296 """
6297 IdleEvent_SetMode(int mode)
6298
6299 Static method for specifying how wxWidgets will send idle events: to
6300 all windows, or only to those which specify that they will process the
6301 events.
6302
6303 The mode can be one of the following values:
6304
6305 ========================= ========================================
6306 wx.IDLE_PROCESS_ALL Send idle events to all windows
6307 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6308 the wx.WS_EX_PROCESS_IDLE extra style
6309 flag set.
6310 ========================= ========================================
6311
6312 """
6313 return _core_.IdleEvent_SetMode(*args, **kwargs)
6314
6315 def IdleEvent_GetMode(*args):
6316 """
6317 IdleEvent_GetMode() -> int
6318
6319 Static method returning a value specifying how wxWidgets will send
6320 idle events: to all windows, or only to those which specify that they
6321 will process the events.
6322 """
6323 return _core_.IdleEvent_GetMode(*args)
6324
6325 def IdleEvent_CanSend(*args, **kwargs):
6326 """
6327 IdleEvent_CanSend(Window win) -> bool
6328
6329 Returns ``True`` if it is appropriate to send idle events to this
6330 window.
6331
6332 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6333 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6334 events should be sent to this window now. By default this will always
6335 return ``True`` because the update mode is initially
6336 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6337 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6338 """
6339 return _core_.IdleEvent_CanSend(*args, **kwargs)
6340
6341 #---------------------------------------------------------------------------
6342
6343 class PyEvent(Event):
6344 """
6345 wx.PyEvent can be used as a base class for implementing custom event
6346 types in Python. You should derived from this class instead of
6347 `wx.Event` because this class is Python-aware and is able to transport
6348 its Python bits safely through the wxWidgets event system and have
6349 them still be there when the event handler is invoked.
6350
6351 :see: `wx.PyCommandEvent`
6352
6353 """
6354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6355 __repr__ = _swig_repr
6356 def __init__(self, *args, **kwargs):
6357 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
6358 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6359 self._SetSelf(self)
6360
6361 __swig_destroy__ = _core_.delete_PyEvent
6362 __del__ = lambda self : None;
6363 def _SetSelf(*args, **kwargs):
6364 """_SetSelf(self, PyObject self)"""
6365 return _core_.PyEvent__SetSelf(*args, **kwargs)
6366
6367 def _GetSelf(*args, **kwargs):
6368 """_GetSelf(self) -> PyObject"""
6369 return _core_.PyEvent__GetSelf(*args, **kwargs)
6370
6371 PyEvent_swigregister = _core_.PyEvent_swigregister
6372 PyEvent_swigregister(PyEvent)
6373
6374 class PyCommandEvent(CommandEvent):
6375 """
6376 wx.PyCommandEvent can be used as a base class for implementing custom
6377 event types in Python, where the event shoudl travel up to parent
6378 windows looking for a handler. You should derived from this class
6379 instead of `wx.CommandEvent` because this class is Python-aware and is
6380 able to transport its Python bits safely through the wxWidgets event
6381 system and have them still be there when the event handler is invoked.
6382
6383 :see: `wx.PyEvent`
6384
6385 """
6386 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6387 __repr__ = _swig_repr
6388 def __init__(self, *args, **kwargs):
6389 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6390 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6391 self._SetSelf(self)
6392
6393 __swig_destroy__ = _core_.delete_PyCommandEvent
6394 __del__ = lambda self : None;
6395 def _SetSelf(*args, **kwargs):
6396 """_SetSelf(self, PyObject self)"""
6397 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6398
6399 def _GetSelf(*args, **kwargs):
6400 """_GetSelf(self) -> PyObject"""
6401 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6402
6403 PyCommandEvent_swigregister = _core_.PyCommandEvent_swigregister
6404 PyCommandEvent_swigregister(PyCommandEvent)
6405
6406 class DateEvent(CommandEvent):
6407 """
6408 This event class holds information about a date change event and is
6409 used together with `wx.DatePickerCtrl`. It also serves as a base class
6410 for `wx.calendar.CalendarEvent`. Bind these event types with
6411 EVT_DATE_CHANGED.
6412 """
6413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6414 __repr__ = _swig_repr
6415 def __init__(self, *args, **kwargs):
6416 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6417 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6418 def GetDate(*args, **kwargs):
6419 """
6420 GetDate(self) -> DateTime
6421
6422 Returns the date.
6423 """
6424 return _core_.DateEvent_GetDate(*args, **kwargs)
6425
6426 def SetDate(*args, **kwargs):
6427 """
6428 SetDate(self, DateTime date)
6429
6430 Sets the date carried by the event, normally only used by the library
6431 internally.
6432 """
6433 return _core_.DateEvent_SetDate(*args, **kwargs)
6434
6435 DateEvent_swigregister = _core_.DateEvent_swigregister
6436 DateEvent_swigregister(DateEvent)
6437
6438 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6439 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6440
6441 #---------------------------------------------------------------------------
6442
6443 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6444 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6445 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6446 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6447 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6448 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6449 class PyApp(EvtHandler):
6450 """
6451 The ``wx.PyApp`` class is an *implementation detail*, please use the
6452 `wx.App` class (or some other derived class) instead.
6453 """
6454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6455 __repr__ = _swig_repr
6456 def __init__(self, *args, **kwargs):
6457 """
6458 __init__(self) -> PyApp
6459
6460 Create a new application object, starting the bootstrap process.
6461 """
6462 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6463 self._setCallbackInfo(self, PyApp, False)
6464 self._setOORInfo(self, False)
6465
6466 __swig_destroy__ = _core_.delete_PyApp
6467 __del__ = lambda self : None;
6468 def _setCallbackInfo(*args, **kwargs):
6469 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6470 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6471
6472 def GetAppName(*args, **kwargs):
6473 """
6474 GetAppName(self) -> String
6475
6476 Get the application name.
6477 """
6478 return _core_.PyApp_GetAppName(*args, **kwargs)
6479
6480 def SetAppName(*args, **kwargs):
6481 """
6482 SetAppName(self, String name)
6483
6484 Set the application name. This value may be used automatically by
6485 `wx.Config` and such.
6486 """
6487 return _core_.PyApp_SetAppName(*args, **kwargs)
6488
6489 def GetClassName(*args, **kwargs):
6490 """
6491 GetClassName(self) -> String
6492
6493 Get the application's class name.
6494 """
6495 return _core_.PyApp_GetClassName(*args, **kwargs)
6496
6497 def SetClassName(*args, **kwargs):
6498 """
6499 SetClassName(self, String name)
6500
6501 Set the application's class name. This value may be used for
6502 X-resources if applicable for the platform
6503 """
6504 return _core_.PyApp_SetClassName(*args, **kwargs)
6505
6506 def GetVendorName(*args, **kwargs):
6507 """
6508 GetVendorName(self) -> String
6509
6510 Get the application's vendor name.
6511 """
6512 return _core_.PyApp_GetVendorName(*args, **kwargs)
6513
6514 def SetVendorName(*args, **kwargs):
6515 """
6516 SetVendorName(self, String name)
6517
6518 Set the application's vendor name. This value may be used
6519 automatically by `wx.Config` and such.
6520 """
6521 return _core_.PyApp_SetVendorName(*args, **kwargs)
6522
6523 def GetTraits(*args, **kwargs):
6524 """
6525 GetTraits(self) -> wxAppTraits
6526
6527 Return (and create if necessary) the app traits object to which we
6528 delegate for everything which either should be configurable by the
6529 user (then he can change the default behaviour simply by overriding
6530 CreateTraits() and returning his own traits object) or which is
6531 GUI/console dependent as then wx.AppTraits allows us to abstract the
6532 differences behind the common facade.
6533
6534 :todo: Add support for overriding CreateAppTraits in wxPython.
6535 """
6536 return _core_.PyApp_GetTraits(*args, **kwargs)
6537
6538 def ProcessPendingEvents(*args, **kwargs):
6539 """
6540 ProcessPendingEvents(self)
6541
6542 Process all events in the Pending Events list -- it is necessary to
6543 call this function to process posted events. This normally happens
6544 during each event loop iteration.
6545 """
6546 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6547
6548 def Yield(*args, **kwargs):
6549 """
6550 Yield(self, bool onlyIfNeeded=False) -> bool
6551
6552 Process all currently pending events right now, instead of waiting
6553 until return to the event loop. It is an error to call ``Yield``
6554 recursively unless the value of ``onlyIfNeeded`` is True.
6555
6556 :warning: This function is dangerous as it can lead to unexpected
6557 reentrancies (i.e. when called from an event handler it may
6558 result in calling the same event handler again), use with
6559 extreme care or, better, don't use at all!
6560
6561 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6562
6563 """
6564 return _core_.PyApp_Yield(*args, **kwargs)
6565
6566 def WakeUpIdle(*args, **kwargs):
6567 """
6568 WakeUpIdle(self)
6569
6570 Make sure that idle events are sent again.
6571 :see: `wx.WakeUpIdle`
6572 """
6573 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6574
6575 def IsMainLoopRunning(*args, **kwargs):
6576 """
6577 IsMainLoopRunning() -> bool
6578
6579 Returns True if we're running the main loop, i.e. if the events can
6580 currently be dispatched.
6581 """
6582 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6583
6584 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6585 def MainLoop(*args, **kwargs):
6586 """
6587 MainLoop(self) -> int
6588
6589 Execute the main GUI loop, the function doesn't normally return until
6590 all top level windows have been closed and destroyed.
6591 """
6592 return _core_.PyApp_MainLoop(*args, **kwargs)
6593
6594 def Exit(*args, **kwargs):
6595 """
6596 Exit(self)
6597
6598 Exit the main loop thus terminating the application.
6599 :see: `wx.Exit`
6600 """
6601 return _core_.PyApp_Exit(*args, **kwargs)
6602
6603 def ExitMainLoop(*args, **kwargs):
6604 """
6605 ExitMainLoop(self)
6606
6607 Exit the main GUI loop during the next iteration of the main
6608 loop, (i.e. it does not stop the program immediately!)
6609 """
6610 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6611
6612 def Pending(*args, **kwargs):
6613 """
6614 Pending(self) -> bool
6615
6616 Returns True if there are unprocessed events in the event queue.
6617 """
6618 return _core_.PyApp_Pending(*args, **kwargs)
6619
6620 def Dispatch(*args, **kwargs):
6621 """
6622 Dispatch(self) -> bool
6623
6624 Process the first event in the event queue (blocks until an event
6625 appears if there are none currently)
6626 """
6627 return _core_.PyApp_Dispatch(*args, **kwargs)
6628
6629 def ProcessIdle(*args, **kwargs):
6630 """
6631 ProcessIdle(self) -> bool
6632
6633 Called from the MainLoop when the application becomes idle (there are
6634 no pending events) and sends a `wx.IdleEvent` to all interested
6635 parties. Returns True if more idle events are needed, False if not.
6636 """
6637 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6638
6639 def SendIdleEvents(*args, **kwargs):
6640 """
6641 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6642
6643 Send idle event to window and all subwindows. Returns True if more
6644 idle time is requested.
6645 """
6646 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6647
6648 def IsActive(*args, **kwargs):
6649 """
6650 IsActive(self) -> bool
6651
6652 Return True if our app has focus.
6653 """
6654 return _core_.PyApp_IsActive(*args, **kwargs)
6655
6656 def SetTopWindow(*args, **kwargs):
6657 """
6658 SetTopWindow(self, Window win)
6659
6660 Set the *main* top level window
6661 """
6662 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6663
6664 def GetTopWindow(*args, **kwargs):
6665 """
6666 GetTopWindow(self) -> Window
6667
6668 Return the *main* top level window (if it hadn't been set previously
6669 with SetTopWindow(), will return just some top level window and, if
6670 there not any, will return None)
6671 """
6672 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6673
6674 def SetExitOnFrameDelete(*args, **kwargs):
6675 """
6676 SetExitOnFrameDelete(self, bool flag)
6677
6678 Control the exit behaviour: by default, the program will exit the main
6679 loop (and so, usually, terminate) when the last top-level program
6680 window is deleted. Beware that if you disable this behaviour (with
6681 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6682 explicitly from somewhere.
6683 """
6684 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6685
6686 def GetExitOnFrameDelete(*args, **kwargs):
6687 """
6688 GetExitOnFrameDelete(self) -> bool
6689
6690 Get the current exit behaviour setting.
6691 """
6692 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6693
6694 def SetUseBestVisual(*args, **kwargs):
6695 """
6696 SetUseBestVisual(self, bool flag)
6697
6698 Set whether the app should try to use the best available visual on
6699 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6700 """
6701 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6702
6703 def GetUseBestVisual(*args, **kwargs):
6704 """
6705 GetUseBestVisual(self) -> bool
6706
6707 Get current UseBestVisual setting.
6708 """
6709 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6710
6711 def SetPrintMode(*args, **kwargs):
6712 """SetPrintMode(self, int mode)"""
6713 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6714
6715 def GetPrintMode(*args, **kwargs):
6716 """GetPrintMode(self) -> int"""
6717 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6718
6719 def SetAssertMode(*args, **kwargs):
6720 """
6721 SetAssertMode(self, int mode)
6722
6723 Set the OnAssert behaviour for debug and hybrid builds.
6724 """
6725 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6726
6727 def GetAssertMode(*args, **kwargs):
6728 """
6729 GetAssertMode(self) -> int
6730
6731 Get the current OnAssert behaviour setting.
6732 """
6733 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6734
6735 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6736 """GetMacSupportPCMenuShortcuts() -> bool"""
6737 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6738
6739 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6740 def GetMacAboutMenuItemId(*args, **kwargs):
6741 """GetMacAboutMenuItemId() -> long"""
6742 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6743
6744 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6745 def GetMacPreferencesMenuItemId(*args, **kwargs):
6746 """GetMacPreferencesMenuItemId() -> long"""
6747 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6748
6749 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6750 def GetMacExitMenuItemId(*args, **kwargs):
6751 """GetMacExitMenuItemId() -> long"""
6752 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6753
6754 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6755 def GetMacHelpMenuTitleName(*args, **kwargs):
6756 """GetMacHelpMenuTitleName() -> String"""
6757 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6758
6759 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6760 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6761 """SetMacSupportPCMenuShortcuts(bool val)"""
6762 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6763
6764 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6765 def SetMacAboutMenuItemId(*args, **kwargs):
6766 """SetMacAboutMenuItemId(long val)"""
6767 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6768
6769 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6770 def SetMacPreferencesMenuItemId(*args, **kwargs):
6771 """SetMacPreferencesMenuItemId(long val)"""
6772 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6773
6774 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6775 def SetMacExitMenuItemId(*args, **kwargs):
6776 """SetMacExitMenuItemId(long val)"""
6777 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6778
6779 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6780 def SetMacHelpMenuTitleName(*args, **kwargs):
6781 """SetMacHelpMenuTitleName(String val)"""
6782 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6783
6784 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6785 def _BootstrapApp(*args, **kwargs):
6786 """
6787 _BootstrapApp(self)
6788
6789 For internal use only
6790 """
6791 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6792
6793 def GetComCtl32Version(*args, **kwargs):
6794 """
6795 GetComCtl32Version() -> int
6796
6797 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6798 it wasn't found at all. Raises an exception on non-Windows platforms.
6799 """
6800 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6801
6802 GetComCtl32Version = staticmethod(GetComCtl32Version)
6803 PyApp_swigregister = _core_.PyApp_swigregister
6804 PyApp_swigregister(PyApp)
6805
6806 def PyApp_IsMainLoopRunning(*args):
6807 """
6808 PyApp_IsMainLoopRunning() -> bool
6809
6810 Returns True if we're running the main loop, i.e. if the events can
6811 currently be dispatched.
6812 """
6813 return _core_.PyApp_IsMainLoopRunning(*args)
6814
6815 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6816 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6817 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6818
6819 def PyApp_GetMacAboutMenuItemId(*args):
6820 """PyApp_GetMacAboutMenuItemId() -> long"""
6821 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6822
6823 def PyApp_GetMacPreferencesMenuItemId(*args):
6824 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6825 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6826
6827 def PyApp_GetMacExitMenuItemId(*args):
6828 """PyApp_GetMacExitMenuItemId() -> long"""
6829 return _core_.PyApp_GetMacExitMenuItemId(*args)
6830
6831 def PyApp_GetMacHelpMenuTitleName(*args):
6832 """PyApp_GetMacHelpMenuTitleName() -> String"""
6833 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6834
6835 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6836 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6837 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6838
6839 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6840 """PyApp_SetMacAboutMenuItemId(long val)"""
6841 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6842
6843 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6844 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6845 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6846
6847 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6848 """PyApp_SetMacExitMenuItemId(long val)"""
6849 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6850
6851 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6852 """PyApp_SetMacHelpMenuTitleName(String val)"""
6853 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6854
6855 def PyApp_GetComCtl32Version(*args):
6856 """
6857 PyApp_GetComCtl32Version() -> int
6858
6859 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6860 it wasn't found at all. Raises an exception on non-Windows platforms.
6861 """
6862 return _core_.PyApp_GetComCtl32Version(*args)
6863
6864 #---------------------------------------------------------------------------
6865
6866
6867 def Exit(*args):
6868 """
6869 Exit()
6870
6871 Force an exit of the application. Convenience for wx.GetApp().Exit()
6872 """
6873 return _core_.Exit(*args)
6874
6875 def Yield(*args):
6876 """
6877 Yield() -> bool
6878
6879 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6880 """
6881 return _core_.Yield(*args)
6882
6883 def YieldIfNeeded(*args):
6884 """
6885 YieldIfNeeded() -> bool
6886
6887 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6888 """
6889 return _core_.YieldIfNeeded(*args)
6890
6891 def SafeYield(*args, **kwargs):
6892 """
6893 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6894
6895 This function is similar to `wx.Yield`, except that it disables the
6896 user input to all program windows before calling `wx.Yield` and
6897 re-enables it again afterwards. If ``win`` is not None, this window
6898 will remain enabled, allowing the implementation of some limited user
6899 interaction.
6900
6901 :Returns: the result of the call to `wx.Yield`.
6902 """
6903 return _core_.SafeYield(*args, **kwargs)
6904
6905 def WakeUpIdle(*args):
6906 """
6907 WakeUpIdle()
6908
6909 Cause the message queue to become empty again, so idle events will be
6910 sent.
6911 """
6912 return _core_.WakeUpIdle(*args)
6913
6914 def PostEvent(*args, **kwargs):
6915 """
6916 PostEvent(EvtHandler dest, Event event)
6917
6918 Send an event to a window or other wx.EvtHandler to be processed
6919 later.
6920 """
6921 return _core_.PostEvent(*args, **kwargs)
6922
6923 def App_CleanUp(*args):
6924 """
6925 App_CleanUp()
6926
6927 For internal use only, it is used to cleanup after wxWidgets when
6928 Python shuts down.
6929 """
6930 return _core_.App_CleanUp(*args)
6931
6932 def GetApp(*args):
6933 """
6934 GetApp() -> PyApp
6935
6936 Return a reference to the current wx.App object.
6937 """
6938 return _core_.GetApp(*args)
6939
6940 def SetDefaultPyEncoding(*args, **kwargs):
6941 """
6942 SetDefaultPyEncoding(string encoding)
6943
6944 Sets the encoding that wxPython will use when it needs to convert a
6945 Python string or unicode object to or from a wxString.
6946
6947 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6948 but please be aware that the default encoding within the same locale
6949 may be slightly different on different platforms. For example, please
6950 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6951 between the common latin/roman encodings.
6952 """
6953 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6954
6955 def GetDefaultPyEncoding(*args):
6956 """
6957 GetDefaultPyEncoding() -> string
6958
6959 Gets the current encoding that wxPython will use when it needs to
6960 convert a Python string or unicode object to or from a wxString.
6961 """
6962 return _core_.GetDefaultPyEncoding(*args)
6963 #----------------------------------------------------------------------
6964
6965 class PyOnDemandOutputWindow:
6966 """
6967 A class that can be used for redirecting Python's stdout and
6968 stderr streams. It will do nothing until something is wrriten to
6969 the stream at which point it will create a Frame with a text area
6970 and write the text there.
6971 """
6972 def __init__(self, title = "wxPython: stdout/stderr"):
6973 self.frame = None
6974 self.title = title
6975 self.pos = wx.DefaultPosition
6976 self.size = (450, 300)
6977 self.parent = None
6978
6979 def SetParent(self, parent):
6980 """Set the window to be used as the popup Frame's parent."""
6981 self.parent = parent
6982
6983
6984 def CreateOutputWindow(self, st):
6985 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6986 style=wx.DEFAULT_FRAME_STYLE)
6987 self.text = wx.TextCtrl(self.frame, -1, "",
6988 style=wx.TE_MULTILINE|wx.TE_READONLY)
6989 self.text.AppendText(st)
6990 self.frame.Show(True)
6991 EVT_CLOSE(self.frame, self.OnCloseWindow)
6992
6993
6994 def OnCloseWindow(self, event):
6995 if self.frame is not None:
6996 self.frame.Destroy()
6997 self.frame = None
6998 self.text = None
6999
7000
7001 # These methods provide the file-like output behaviour.
7002 def write(self, text):
7003 """
7004 Create the output window if needed and write the string to it.
7005 If not called in the context of the gui thread then uses
7006 CallAfter to do the work there.
7007 """
7008 if self.frame is None:
7009 if not wx.Thread_IsMain():
7010 wx.CallAfter(self.CreateOutputWindow, text)
7011 else:
7012 self.CreateOutputWindow(text)
7013 else:
7014 if not wx.Thread_IsMain():
7015 wx.CallAfter(self.text.AppendText, text)
7016 else:
7017 self.text.AppendText(text)
7018
7019
7020 def close(self):
7021 if self.frame is not None:
7022 wx.CallAfter(self.frame.Close)
7023
7024
7025 def flush(self):
7026 pass
7027
7028
7029
7030 #----------------------------------------------------------------------
7031
7032 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7033
7034 class App(wx.PyApp):
7035 """
7036 The ``wx.App`` class represents the application and is used to:
7037
7038 * bootstrap the wxPython system and initialize the underlying
7039 gui toolkit
7040 * set and get application-wide properties
7041 * implement the windowing system main message or event loop,
7042 and to dispatch events to window instances
7043 * etc.
7044
7045 Every application must have a ``wx.App`` instance, and all
7046 creation of UI objects should be delayed until after the
7047 ``wx.App`` object has been created in order to ensure that the gui
7048 platform and wxWidgets have been fully initialized.
7049
7050 Normally you would derive from this class and implement an
7051 ``OnInit`` method that creates a frame and then calls
7052 ``self.SetTopWindow(frame)``.
7053
7054 :see: `wx.PySimpleApp` for a simpler app class that can be used
7055 directly.
7056 """
7057
7058 outputWindowClass = PyOnDemandOutputWindow
7059
7060 def __init__(self, redirect=_defRedirect, filename=None,
7061 useBestVisual=False, clearSigInt=True):
7062 """
7063 Construct a ``wx.App`` object.
7064
7065 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7066 redirected? Defaults to True on Windows and Mac, False
7067 otherwise. If `filename` is None then output will be
7068 redirected to a window that pops up as needed. (You can
7069 control what kind of window is created for the output by
7070 resetting the class variable ``outputWindowClass`` to a
7071 class of your choosing.)
7072
7073 :param filename: The name of a file to redirect output to, if
7074 redirect is True.
7075
7076 :param useBestVisual: Should the app try to use the best
7077 available visual provided by the system (only relevant on
7078 systems that have more than one visual.) This parameter
7079 must be used instead of calling `SetUseBestVisual` later
7080 on because it must be set before the underlying GUI
7081 toolkit is initialized.
7082
7083 :param clearSigInt: Should SIGINT be cleared? This allows the
7084 app to terminate upon a Ctrl-C in the console like other
7085 GUI apps will.
7086
7087 :note: You should override OnInit to do applicaition
7088 initialization to ensure that the system, toolkit and
7089 wxWidgets are fully initialized.
7090 """
7091 wx.PyApp.__init__(self)
7092
7093 if wx.Platform == "__WXMAC__":
7094 try:
7095 import MacOS
7096 if not MacOS.WMAvailable():
7097 print """\
7098 This program needs access to the screen. Please run with 'pythonw',
7099 not 'python', and only when you are logged in on the main display of
7100 your Mac."""
7101 _sys.exit(1)
7102 except SystemExit:
7103 raise
7104 except:
7105 pass
7106
7107 # This has to be done before OnInit
7108 self.SetUseBestVisual(useBestVisual)
7109
7110 # Set the default handler for SIGINT. This fixes a problem
7111 # where if Ctrl-C is pressed in the console that started this
7112 # app then it will not appear to do anything, (not even send
7113 # KeyboardInterrupt???) but will later segfault on exit. By
7114 # setting the default handler then the app will exit, as
7115 # expected (depending on platform.)
7116 if clearSigInt:
7117 try:
7118 import signal
7119 signal.signal(signal.SIGINT, signal.SIG_DFL)
7120 except:
7121 pass
7122
7123 # Save and redirect the stdio to a window?
7124 self.stdioWin = None
7125 self.saveStdio = (_sys.stdout, _sys.stderr)
7126 if redirect:
7127 self.RedirectStdio(filename)
7128
7129 # Use Python's install prefix as the default
7130 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7131
7132 # This finishes the initialization of wxWindows and then calls
7133 # the OnInit that should be present in the derived class
7134 self._BootstrapApp()
7135
7136
7137 def __del__(self, destroy=wx.PyApp.__del__):
7138 self.RestoreStdio() # Just in case the MainLoop was overridden
7139 destroy(self)
7140
7141 def Destroy(self):
7142 wx.PyApp.Destroy(self)
7143 self.thisown = 0
7144
7145 def SetTopWindow(self, frame):
7146 """Set the \"main\" top level window"""
7147 if self.stdioWin:
7148 self.stdioWin.SetParent(frame)
7149 wx.PyApp.SetTopWindow(self, frame)
7150
7151
7152 def MainLoop(self):
7153 """Execute the main GUI event loop"""
7154 wx.PyApp.MainLoop(self)
7155 self.RestoreStdio()
7156
7157
7158 def RedirectStdio(self, filename=None):
7159 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7160 if filename:
7161 _sys.stdout = _sys.stderr = open(filename, 'a')
7162 else:
7163 self.stdioWin = self.outputWindowClass()
7164 _sys.stdout = _sys.stderr = self.stdioWin
7165
7166
7167 def RestoreStdio(self):
7168 try:
7169 _sys.stdout, _sys.stderr = self.saveStdio
7170 except:
7171 pass
7172
7173
7174 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7175 """
7176 Set the title, position and/or size of the output window if
7177 the stdio has been redirected. This should be called before
7178 any output would cause the output window to be created.
7179 """
7180 if self.stdioWin:
7181 if title is not None:
7182 self.stdioWin.title = title
7183 if pos is not None:
7184 self.stdioWin.pos = pos
7185 if size is not None:
7186 self.stdioWin.size = size
7187
7188
7189
7190
7191 # change from wx.PyApp_XX to wx.App_XX
7192 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7193 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7194 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7195 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7196 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7197 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7198 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7199 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7200 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7201 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7202 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7203
7204 #----------------------------------------------------------------------------
7205
7206 class PySimpleApp(wx.App):
7207 """
7208 A simple application class. You can just create one of these and
7209 then then make your top level windows later, and not have to worry
7210 about OnInit. For example::
7211
7212 app = wx.PySimpleApp()
7213 frame = wx.Frame(None, title='Hello World')
7214 frame.Show()
7215 app.MainLoop()
7216
7217 :see: `wx.App`
7218 """
7219
7220 def __init__(self, redirect=False, filename=None,
7221 useBestVisual=False, clearSigInt=True):
7222 """
7223 :see: `wx.App.__init__`
7224 """
7225 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7226
7227 def OnInit(self):
7228 return True
7229
7230
7231
7232 # Is anybody using this one?
7233 class PyWidgetTester(wx.App):
7234 def __init__(self, size = (250, 100)):
7235 self.size = size
7236 wx.App.__init__(self, 0)
7237
7238 def OnInit(self):
7239 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7240 self.SetTopWindow(self.frame)
7241 return True
7242
7243 def SetWidget(self, widgetClass, *args, **kwargs):
7244 w = widgetClass(self.frame, *args, **kwargs)
7245 self.frame.Show(True)
7246
7247 #----------------------------------------------------------------------------
7248 # DO NOT hold any other references to this object. This is how we
7249 # know when to cleanup system resources that wxWidgets is holding. When
7250 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7251 # goes to zero and it calls the wx.App_CleanUp function.
7252
7253 class __wxPyCleanup:
7254 def __init__(self):
7255 self.cleanup = _core_.App_CleanUp
7256 def __del__(self):
7257 self.cleanup()
7258
7259 _sys.__wxPythonCleanup = __wxPyCleanup()
7260
7261 ## # another possible solution, but it gets called too early...
7262 ## import atexit
7263 ## atexit.register(_core_.wxApp_CleanUp)
7264
7265
7266 #----------------------------------------------------------------------------
7267
7268 #---------------------------------------------------------------------------
7269
7270 class EventLoop(object):
7271 """Proxy of C++ EventLoop class"""
7272 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7273 __repr__ = _swig_repr
7274 def __init__(self, *args, **kwargs):
7275 """__init__(self) -> EventLoop"""
7276 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7277 __swig_destroy__ = _core_.delete_EventLoop
7278 __del__ = lambda self : None;
7279 def Run(*args, **kwargs):
7280 """Run(self) -> int"""
7281 return _core_.EventLoop_Run(*args, **kwargs)
7282
7283 def Exit(*args, **kwargs):
7284 """Exit(self, int rc=0)"""
7285 return _core_.EventLoop_Exit(*args, **kwargs)
7286
7287 def Pending(*args, **kwargs):
7288 """Pending(self) -> bool"""
7289 return _core_.EventLoop_Pending(*args, **kwargs)
7290
7291 def Dispatch(*args, **kwargs):
7292 """Dispatch(self) -> bool"""
7293 return _core_.EventLoop_Dispatch(*args, **kwargs)
7294
7295 def IsRunning(*args, **kwargs):
7296 """IsRunning(self) -> bool"""
7297 return _core_.EventLoop_IsRunning(*args, **kwargs)
7298
7299 def GetActive(*args, **kwargs):
7300 """GetActive() -> EventLoop"""
7301 return _core_.EventLoop_GetActive(*args, **kwargs)
7302
7303 GetActive = staticmethod(GetActive)
7304 def SetActive(*args, **kwargs):
7305 """SetActive(EventLoop loop)"""
7306 return _core_.EventLoop_SetActive(*args, **kwargs)
7307
7308 SetActive = staticmethod(SetActive)
7309 EventLoop_swigregister = _core_.EventLoop_swigregister
7310 EventLoop_swigregister(EventLoop)
7311
7312 def EventLoop_GetActive(*args):
7313 """EventLoop_GetActive() -> EventLoop"""
7314 return _core_.EventLoop_GetActive(*args)
7315
7316 def EventLoop_SetActive(*args, **kwargs):
7317 """EventLoop_SetActive(EventLoop loop)"""
7318 return _core_.EventLoop_SetActive(*args, **kwargs)
7319
7320 class EventLoopActivator(object):
7321 """Proxy of C++ EventLoopActivator class"""
7322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7323 __repr__ = _swig_repr
7324 def __init__(self, *args, **kwargs):
7325 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7326 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7327 __swig_destroy__ = _core_.delete_EventLoopActivator
7328 __del__ = lambda self : None;
7329 EventLoopActivator_swigregister = _core_.EventLoopActivator_swigregister
7330 EventLoopActivator_swigregister(EventLoopActivator)
7331
7332 #---------------------------------------------------------------------------
7333
7334 class AcceleratorEntry(object):
7335 """
7336 A class used to define items in an `wx.AcceleratorTable`. wxPython
7337 programs can choose to use wx.AcceleratorEntry objects, but using a
7338 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7339 as well. See `__init__` for of the tuple values.
7340
7341 :see: `wx.AcceleratorTable`
7342 """
7343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7344 __repr__ = _swig_repr
7345 def __init__(self, *args, **kwargs):
7346 """
7347 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7348
7349 Construct a wx.AcceleratorEntry.
7350 """
7351 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7352 __swig_destroy__ = _core_.delete_AcceleratorEntry
7353 __del__ = lambda self : None;
7354 def Set(*args, **kwargs):
7355 """
7356 Set(self, int flags, int keyCode, int cmd)
7357
7358 (Re)set the attributes of a wx.AcceleratorEntry.
7359 :see `__init__`
7360 """
7361 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7362
7363 def GetFlags(*args, **kwargs):
7364 """
7365 GetFlags(self) -> int
7366
7367 Get the AcceleratorEntry's flags.
7368 """
7369 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7370
7371 def GetKeyCode(*args, **kwargs):
7372 """
7373 GetKeyCode(self) -> int
7374
7375 Get the AcceleratorEntry's keycode.
7376 """
7377 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7378
7379 def GetCommand(*args, **kwargs):
7380 """
7381 GetCommand(self) -> int
7382
7383 Get the AcceleratorEntry's command ID.
7384 """
7385 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7386
7387 AcceleratorEntry_swigregister = _core_.AcceleratorEntry_swigregister
7388 AcceleratorEntry_swigregister(AcceleratorEntry)
7389
7390 class AcceleratorTable(Object):
7391 """
7392 An accelerator table allows the application to specify a table of
7393 keyboard shortcuts for menus or other commands. On Windows, menu or
7394 button commands are supported; on GTK, only menu commands are
7395 supported.
7396 """
7397 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7398 __repr__ = _swig_repr
7399 def __init__(self, *args, **kwargs):
7400 """
7401 __init__(entries) -> AcceleratorTable
7402
7403 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7404 items or or of 3-tuples (flags, keyCode, cmdID)
7405
7406 :see: `wx.AcceleratorEntry`
7407 """
7408 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7409 __swig_destroy__ = _core_.delete_AcceleratorTable
7410 __del__ = lambda self : None;
7411 def Ok(*args, **kwargs):
7412 """Ok(self) -> bool"""
7413 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7414
7415 AcceleratorTable_swigregister = _core_.AcceleratorTable_swigregister
7416 AcceleratorTable_swigregister(AcceleratorTable)
7417
7418
7419 def GetAccelFromString(*args, **kwargs):
7420 """GetAccelFromString(String label) -> AcceleratorEntry"""
7421 return _core_.GetAccelFromString(*args, **kwargs)
7422 #---------------------------------------------------------------------------
7423
7424 class VisualAttributes(object):
7425 """struct containing all the visual attributes of a control"""
7426 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7427 __repr__ = _swig_repr
7428 def __init__(self, *args, **kwargs):
7429 """
7430 __init__(self) -> VisualAttributes
7431
7432 struct containing all the visual attributes of a control
7433 """
7434 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7435 __swig_destroy__ = _core_.delete_VisualAttributes
7436 __del__ = lambda self : None;
7437 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7438 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7439 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7440 VisualAttributes_swigregister = _core_.VisualAttributes_swigregister
7441 VisualAttributes_swigregister(VisualAttributes)
7442 NullAcceleratorTable = cvar.NullAcceleratorTable
7443 PanelNameStr = cvar.PanelNameStr
7444
7445 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7446 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7447 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7448 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7449 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7450 class Window(EvtHandler):
7451 """
7452 wx.Window is the base class for all windows and represents any visible
7453 object on the screen. All controls, top level windows and so on are
7454 wx.Windows. Sizers and device contexts are not however, as they don't
7455 appear on screen themselves.
7456
7457 """
7458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7459 __repr__ = _swig_repr
7460 def __init__(self, *args, **kwargs):
7461 """
7462 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7463 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7464
7465 Construct and show a generic Window.
7466 """
7467 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7468 self._setOORInfo(self)
7469
7470 def Create(*args, **kwargs):
7471 """
7472 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7473 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7474
7475 Create the GUI part of the Window for 2-phase creation mode.
7476 """
7477 return _core_.Window_Create(*args, **kwargs)
7478
7479 def Close(*args, **kwargs):
7480 """
7481 Close(self, bool force=False) -> bool
7482
7483 This function simply generates a EVT_CLOSE event whose handler usually
7484 tries to close the window. It doesn't close the window itself,
7485 however. If force is False (the default) then the window's close
7486 handler will be allowed to veto the destruction of the window.
7487 """
7488 return _core_.Window_Close(*args, **kwargs)
7489
7490 def Destroy(*args, **kwargs):
7491 """
7492 Destroy(self) -> bool
7493
7494 Destroys the window safely. Frames and dialogs are not destroyed
7495 immediately when this function is called -- they are added to a list
7496 of windows to be deleted on idle time, when all the window's events
7497 have been processed. This prevents problems with events being sent to
7498 non-existent windows.
7499
7500 Returns True if the window has either been successfully deleted, or it
7501 has been added to the list of windows pending real deletion.
7502 """
7503 val = _core_.Window_Destroy(*args, **kwargs)
7504 args[0].thisown = 0
7505 return val
7506
7507 def DestroyChildren(*args, **kwargs):
7508 """
7509 DestroyChildren(self) -> bool
7510
7511 Destroys all children of a window. Called automatically by the
7512 destructor.
7513 """
7514 return _core_.Window_DestroyChildren(*args, **kwargs)
7515
7516 def IsBeingDeleted(*args, **kwargs):
7517 """
7518 IsBeingDeleted(self) -> bool
7519
7520 Is the window in the process of being deleted?
7521 """
7522 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7523
7524 def SetLabel(*args, **kwargs):
7525 """
7526 SetLabel(self, String label)
7527
7528 Set the text which the window shows in its label if applicable.
7529 """
7530 return _core_.Window_SetLabel(*args, **kwargs)
7531
7532 def GetLabel(*args, **kwargs):
7533 """
7534 GetLabel(self) -> String
7535
7536 Generic way of getting a label from any window, for identification
7537 purposes. The interpretation of this function differs from class to
7538 class. For frames and dialogs, the value returned is the title. For
7539 buttons or static text controls, it is the button text. This function
7540 can be useful for meta-programs such as testing tools or special-needs
7541 access programs)which need to identify windows by name.
7542 """
7543 return _core_.Window_GetLabel(*args, **kwargs)
7544
7545 def SetName(*args, **kwargs):
7546 """
7547 SetName(self, String name)
7548
7549 Sets the window's name. The window name is used for ressource setting
7550 in X, it is not the same as the window title/label
7551 """
7552 return _core_.Window_SetName(*args, **kwargs)
7553
7554 def GetName(*args, **kwargs):
7555 """
7556 GetName(self) -> String
7557
7558 Returns the windows name. This name is not guaranteed to be unique;
7559 it is up to the programmer to supply an appropriate name in the window
7560 constructor or via wx.Window.SetName.
7561 """
7562 return _core_.Window_GetName(*args, **kwargs)
7563
7564 def SetWindowVariant(*args, **kwargs):
7565 """
7566 SetWindowVariant(self, int variant)
7567
7568 Sets the variant of the window/font size to use for this window, if
7569 the platform supports variants, for example, wxMac.
7570 """
7571 return _core_.Window_SetWindowVariant(*args, **kwargs)
7572
7573 def GetWindowVariant(*args, **kwargs):
7574 """GetWindowVariant(self) -> int"""
7575 return _core_.Window_GetWindowVariant(*args, **kwargs)
7576
7577 def SetId(*args, **kwargs):
7578 """
7579 SetId(self, int winid)
7580
7581 Sets the identifier of the window. Each window has an integer
7582 identifier. If the application has not provided one, an identifier
7583 will be generated. Normally, the identifier should be provided on
7584 creation and should not be modified subsequently.
7585 """
7586 return _core_.Window_SetId(*args, **kwargs)
7587
7588 def GetId(*args, **kwargs):
7589 """
7590 GetId(self) -> int
7591
7592 Returns the identifier of the window. Each window has an integer
7593 identifier. If the application has not provided one (or the default Id
7594 -1 is used) then an unique identifier with a negative value will be
7595 generated.
7596 """
7597 return _core_.Window_GetId(*args, **kwargs)
7598
7599 def NewControlId(*args, **kwargs):
7600 """
7601 NewControlId() -> int
7602
7603 Generate a control id for the controls which were not given one.
7604 """
7605 return _core_.Window_NewControlId(*args, **kwargs)
7606
7607 NewControlId = staticmethod(NewControlId)
7608 def NextControlId(*args, **kwargs):
7609 """
7610 NextControlId(int winid) -> int
7611
7612 Get the id of the control following the one with the given
7613 autogenerated) id
7614 """
7615 return _core_.Window_NextControlId(*args, **kwargs)
7616
7617 NextControlId = staticmethod(NextControlId)
7618 def PrevControlId(*args, **kwargs):
7619 """
7620 PrevControlId(int winid) -> int
7621
7622 Get the id of the control preceding the one with the given
7623 autogenerated) id
7624 """
7625 return _core_.Window_PrevControlId(*args, **kwargs)
7626
7627 PrevControlId = staticmethod(PrevControlId)
7628 def SetSize(*args, **kwargs):
7629 """
7630 SetSize(self, Size size)
7631
7632 Sets the size of the window in pixels.
7633 """
7634 return _core_.Window_SetSize(*args, **kwargs)
7635
7636 def SetDimensions(*args, **kwargs):
7637 """
7638 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7639
7640 Sets the position and size of the window in pixels. The sizeFlags
7641 parameter indicates the interpretation of the other params if they are
7642 equal to -1.
7643
7644 ======================== ======================================
7645 wx.SIZE_AUTO A -1 indicates that a class-specific
7646 default should be used.
7647 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7648 -1 values are supplied.
7649 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7650 interpreted as real dimensions, not
7651 default values.
7652 ======================== ======================================
7653
7654 """
7655 return _core_.Window_SetDimensions(*args, **kwargs)
7656
7657 def SetRect(*args, **kwargs):
7658 """
7659 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7660
7661 Sets the position and size of the window in pixels using a wx.Rect.
7662 """
7663 return _core_.Window_SetRect(*args, **kwargs)
7664
7665 def SetSizeWH(*args, **kwargs):
7666 """
7667 SetSizeWH(self, int width, int height)
7668
7669 Sets the size of the window in pixels.
7670 """
7671 return _core_.Window_SetSizeWH(*args, **kwargs)
7672
7673 def Move(*args, **kwargs):
7674 """
7675 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7676
7677 Moves the window to the given position.
7678 """
7679 return _core_.Window_Move(*args, **kwargs)
7680
7681 SetPosition = Move
7682 def MoveXY(*args, **kwargs):
7683 """
7684 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7685
7686 Moves the window to the given position.
7687 """
7688 return _core_.Window_MoveXY(*args, **kwargs)
7689
7690 def SetBestFittingSize(*args, **kwargs):
7691 """
7692 SetBestFittingSize(self, Size size=DefaultSize)
7693
7694 A 'Smart' SetSize that will fill in default size components with the
7695 window's *best size* values. Also set's the minsize for use with sizers.
7696 """
7697 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7698
7699 def Raise(*args, **kwargs):
7700 """
7701 Raise(self)
7702
7703 Raises the window to the top of the window hierarchy. In current
7704 version of wxWidgets this works both for manage and child windows.
7705 """
7706 return _core_.Window_Raise(*args, **kwargs)
7707
7708 def Lower(*args, **kwargs):
7709 """
7710 Lower(self)
7711
7712 Lowers the window to the bottom of the window hierarchy. In current
7713 version of wxWidgets this works both for manage and child windows.
7714 """
7715 return _core_.Window_Lower(*args, **kwargs)
7716
7717 def SetClientSize(*args, **kwargs):
7718 """
7719 SetClientSize(self, Size size)
7720
7721 This sets the size of the window client area in pixels. Using this
7722 function to size a window tends to be more device-independent than
7723 wx.Window.SetSize, since the application need not worry about what
7724 dimensions the border or title bar have when trying to fit the window
7725 around panel items, for example.
7726 """
7727 return _core_.Window_SetClientSize(*args, **kwargs)
7728
7729 def SetClientSizeWH(*args, **kwargs):
7730 """
7731 SetClientSizeWH(self, int width, int height)
7732
7733 This sets the size of the window client area in pixels. Using this
7734 function to size a window tends to be more device-independent than
7735 wx.Window.SetSize, since the application need not worry about what
7736 dimensions the border or title bar have when trying to fit the window
7737 around panel items, for example.
7738 """
7739 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7740
7741 def SetClientRect(*args, **kwargs):
7742 """
7743 SetClientRect(self, Rect rect)
7744
7745 This sets the size of the window client area in pixels. Using this
7746 function to size a window tends to be more device-independent than
7747 wx.Window.SetSize, since the application need not worry about what
7748 dimensions the border or title bar have when trying to fit the window
7749 around panel items, for example.
7750 """
7751 return _core_.Window_SetClientRect(*args, **kwargs)
7752
7753 def GetPosition(*args, **kwargs):
7754 """
7755 GetPosition(self) -> Point
7756
7757 Get the window's position.
7758 """
7759 return _core_.Window_GetPosition(*args, **kwargs)
7760
7761 def GetPositionTuple(*args, **kwargs):
7762 """
7763 GetPositionTuple() -> (x,y)
7764
7765 Get the window's position.
7766 """
7767 return _core_.Window_GetPositionTuple(*args, **kwargs)
7768
7769 def GetSize(*args, **kwargs):
7770 """
7771 GetSize(self) -> Size
7772
7773 Get the window size.
7774 """
7775 return _core_.Window_GetSize(*args, **kwargs)
7776
7777 def GetSizeTuple(*args, **kwargs):
7778 """
7779 GetSizeTuple() -> (width, height)
7780
7781 Get the window size.
7782 """
7783 return _core_.Window_GetSizeTuple(*args, **kwargs)
7784
7785 def GetRect(*args, **kwargs):
7786 """
7787 GetRect(self) -> Rect
7788
7789 Returns the size and position of the window as a wx.Rect object.
7790 """
7791 return _core_.Window_GetRect(*args, **kwargs)
7792
7793 def GetClientSize(*args, **kwargs):
7794 """
7795 GetClientSize(self) -> Size
7796
7797 This gets the size of the window's 'client area' in pixels. The client
7798 area is the area which may be drawn on by the programmer, excluding
7799 title bar, border, scrollbars, etc.
7800 """
7801 return _core_.Window_GetClientSize(*args, **kwargs)
7802
7803 def GetClientSizeTuple(*args, **kwargs):
7804 """
7805 GetClientSizeTuple() -> (width, height)
7806
7807 This gets the size of the window's 'client area' in pixels. The client
7808 area is the area which may be drawn on by the programmer, excluding
7809 title bar, border, scrollbars, etc.
7810 """
7811 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7812
7813 def GetClientAreaOrigin(*args, **kwargs):
7814 """
7815 GetClientAreaOrigin(self) -> Point
7816
7817 Get the origin of the client area of the window relative to the
7818 window's top left corner (the client area may be shifted because of
7819 the borders, scrollbars, other decorations...)
7820 """
7821 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7822
7823 def GetClientRect(*args, **kwargs):
7824 """
7825 GetClientRect(self) -> Rect
7826
7827 Get the client area position and size as a `wx.Rect` object.
7828 """
7829 return _core_.Window_GetClientRect(*args, **kwargs)
7830
7831 def GetBestSize(*args, **kwargs):
7832 """
7833 GetBestSize(self) -> Size
7834
7835 This function returns the best acceptable minimal size for the
7836 window, if applicable. For example, for a static text control, it will
7837 be the minimal size such that the control label is not truncated. For
7838 windows containing subwindows (suzh aswx.Panel), the size returned by
7839 this function will be the same as the size the window would have had
7840 after calling Fit.
7841 """
7842 return _core_.Window_GetBestSize(*args, **kwargs)
7843
7844 def GetBestSizeTuple(*args, **kwargs):
7845 """
7846 GetBestSizeTuple() -> (width, height)
7847
7848 This function returns the best acceptable minimal size for the
7849 window, if applicable. For example, for a static text control, it will
7850 be the minimal size such that the control label is not truncated. For
7851 windows containing subwindows (suzh aswx.Panel), the size returned by
7852 this function will be the same as the size the window would have had
7853 after calling Fit.
7854 """
7855 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7856
7857 def InvalidateBestSize(*args, **kwargs):
7858 """
7859 InvalidateBestSize(self)
7860
7861 Reset the cached best size value so it will be recalculated the next
7862 time it is needed.
7863 """
7864 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7865
7866 def CacheBestSize(*args, **kwargs):
7867 """
7868 CacheBestSize(self, Size size)
7869
7870 Cache the best size so it doesn't need to be calculated again, (at least until
7871 some properties of the window change.)
7872 """
7873 return _core_.Window_CacheBestSize(*args, **kwargs)
7874
7875 def GetBestFittingSize(*args, **kwargs):
7876 """
7877 GetBestFittingSize(self) -> Size
7878
7879 This function will merge the window's best size into the window's
7880 minimum size, giving priority to the min size components, and returns
7881 the results.
7882
7883 """
7884 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7885
7886 def GetAdjustedBestSize(*args, **kwargs):
7887 """
7888 GetAdjustedBestSize(self) -> Size
7889
7890 This method is similar to GetBestSize, except in one
7891 thing. GetBestSize should return the minimum untruncated size of the
7892 window, while this method will return the largest of BestSize and any
7893 user specified minimum size. ie. it is the minimum size the window
7894 should currently be drawn at, not the minimal size it can possibly
7895 tolerate.
7896 """
7897 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7898
7899 def Center(*args, **kwargs):
7900 """
7901 Center(self, int direction=BOTH)
7902
7903 Centers the window. The parameter specifies the direction for
7904 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7905 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7906 on the entire screen and not on its parent window. If it is a
7907 top-level window and has no parent then it will always be centered
7908 relative to the screen.
7909 """
7910 return _core_.Window_Center(*args, **kwargs)
7911
7912 Centre = Center
7913 def CenterOnParent(*args, **kwargs):
7914 """
7915 CenterOnParent(self, int dir=BOTH)
7916
7917 Center with respect to the the parent window
7918 """
7919 return _core_.Window_CenterOnParent(*args, **kwargs)
7920
7921 CentreOnParent = CenterOnParent
7922 def Fit(*args, **kwargs):
7923 """
7924 Fit(self)
7925
7926 Sizes the window so that it fits around its subwindows. This function
7927 won't do anything if there are no subwindows and will only really work
7928 correctly if sizers are used for the subwindows layout. Also, if the
7929 window has exactly one subwindow it is better (faster and the result
7930 is more precise as Fit adds some margin to account for fuzziness of
7931 its calculations) to call window.SetClientSize(child.GetSize())
7932 instead of calling Fit.
7933 """
7934 return _core_.Window_Fit(*args, **kwargs)
7935
7936 def FitInside(*args, **kwargs):
7937 """
7938 FitInside(self)
7939
7940 Similar to Fit, but sizes the interior (virtual) size of a
7941 window. Mainly useful with scrolled windows to reset scrollbars after
7942 sizing changes that do not trigger a size event, and/or scrolled
7943 windows without an interior sizer. This function similarly won't do
7944 anything if there are no subwindows.
7945 """
7946 return _core_.Window_FitInside(*args, **kwargs)
7947
7948 def SetSizeHints(*args, **kwargs):
7949 """
7950 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7951 int incH=-1)
7952
7953 Allows specification of minimum and maximum window sizes, and window
7954 size increments. If a pair of values is not set (or set to -1), the
7955 default values will be used. If this function is called, the user
7956 will not be able to size the window outside the given bounds (if it is
7957 a top-level window.) Sizers will also inspect the minimum window size
7958 and will use that value if set when calculating layout.
7959
7960 The resizing increments are only significant under Motif or Xt.
7961 """
7962 return _core_.Window_SetSizeHints(*args, **kwargs)
7963
7964 def SetSizeHintsSz(*args, **kwargs):
7965 """
7966 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7967
7968 Allows specification of minimum and maximum window sizes, and window
7969 size increments. If a pair of values is not set (or set to -1), the
7970 default values will be used. If this function is called, the user
7971 will not be able to size the window outside the given bounds (if it is
7972 a top-level window.) Sizers will also inspect the minimum window size
7973 and will use that value if set when calculating layout.
7974
7975 The resizing increments are only significant under Motif or Xt.
7976 """
7977 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7978
7979 def SetVirtualSizeHints(*args, **kwargs):
7980 """
7981 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7982
7983 Allows specification of minimum and maximum virtual window sizes. If a
7984 pair of values is not set (or set to -1), the default values will be
7985 used. If this function is called, the user will not be able to size
7986 the virtual area of the window outside the given bounds.
7987 """
7988 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7989
7990 def SetVirtualSizeHintsSz(*args, **kwargs):
7991 """
7992 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7993
7994 Allows specification of minimum and maximum virtual window sizes. If a
7995 pair of values is not set (or set to -1), the default values will be
7996 used. If this function is called, the user will not be able to size
7997 the virtual area of the window outside the given bounds.
7998 """
7999 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8000
8001 def GetMaxSize(*args, **kwargs):
8002 """GetMaxSize(self) -> Size"""
8003 return _core_.Window_GetMaxSize(*args, **kwargs)
8004
8005 def GetMinSize(*args, **kwargs):
8006 """GetMinSize(self) -> Size"""
8007 return _core_.Window_GetMinSize(*args, **kwargs)
8008
8009 def SetMinSize(*args, **kwargs):
8010 """
8011 SetMinSize(self, Size minSize)
8012
8013 A more convenient method than `SetSizeHints` for setting just the
8014 min size.
8015 """
8016 return _core_.Window_SetMinSize(*args, **kwargs)
8017
8018 def SetMaxSize(*args, **kwargs):
8019 """
8020 SetMaxSize(self, Size maxSize)
8021
8022 A more convenient method than `SetSizeHints` for setting just the
8023 max size.
8024 """
8025 return _core_.Window_SetMaxSize(*args, **kwargs)
8026
8027 def GetMinWidth(*args, **kwargs):
8028 """GetMinWidth(self) -> int"""
8029 return _core_.Window_GetMinWidth(*args, **kwargs)
8030
8031 def GetMinHeight(*args, **kwargs):
8032 """GetMinHeight(self) -> int"""
8033 return _core_.Window_GetMinHeight(*args, **kwargs)
8034
8035 def GetMaxWidth(*args, **kwargs):
8036 """GetMaxWidth(self) -> int"""
8037 return _core_.Window_GetMaxWidth(*args, **kwargs)
8038
8039 def GetMaxHeight(*args, **kwargs):
8040 """GetMaxHeight(self) -> int"""
8041 return _core_.Window_GetMaxHeight(*args, **kwargs)
8042
8043 def SetVirtualSize(*args, **kwargs):
8044 """
8045 SetVirtualSize(self, Size size)
8046
8047 Set the the virtual size of a window in pixels. For most windows this
8048 is just the client area of the window, but for some like scrolled
8049 windows it is more or less independent of the screen window size.
8050 """
8051 return _core_.Window_SetVirtualSize(*args, **kwargs)
8052
8053 def SetVirtualSizeWH(*args, **kwargs):
8054 """
8055 SetVirtualSizeWH(self, int w, int h)
8056
8057 Set the the virtual size of a window in pixels. For most windows this
8058 is just the client area of the window, but for some like scrolled
8059 windows it is more or less independent of the screen window size.
8060 """
8061 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8062
8063 def GetVirtualSize(*args, **kwargs):
8064 """
8065 GetVirtualSize(self) -> Size
8066
8067 Get the the virtual size of the window in pixels. For most windows
8068 this is just the client area of the window, but for some like scrolled
8069 windows it is more or less independent of the screen window size.
8070 """
8071 return _core_.Window_GetVirtualSize(*args, **kwargs)
8072
8073 def GetVirtualSizeTuple(*args, **kwargs):
8074 """
8075 GetVirtualSizeTuple() -> (width, height)
8076
8077 Get the the virtual size of the window in pixels. For most windows
8078 this is just the client area of the window, but for some like scrolled
8079 windows it is more or less independent of the screen window size.
8080 """
8081 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8082
8083 def GetBestVirtualSize(*args, **kwargs):
8084 """
8085 GetBestVirtualSize(self) -> Size
8086
8087 Return the largest of ClientSize and BestSize (as determined by a
8088 sizer, interior children, or other means)
8089 """
8090 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8091
8092 def Show(*args, **kwargs):
8093 """
8094 Show(self, bool show=True) -> bool
8095
8096 Shows or hides the window. You may need to call Raise for a top level
8097 window if you want to bring it to top, although this is not needed if
8098 Show is called immediately after the frame creation. Returns True if
8099 the window has been shown or hidden or False if nothing was done
8100 because it already was in the requested state.
8101 """
8102 return _core_.Window_Show(*args, **kwargs)
8103
8104 def Hide(*args, **kwargs):
8105 """
8106 Hide(self) -> bool
8107
8108 Equivalent to calling Show(False).
8109 """
8110 return _core_.Window_Hide(*args, **kwargs)
8111
8112 def Enable(*args, **kwargs):
8113 """
8114 Enable(self, bool enable=True) -> bool
8115
8116 Enable or disable the window for user input. Note that when a parent
8117 window is disabled, all of its children are disabled as well and they
8118 are reenabled again when the parent is. Returns true if the window
8119 has been enabled or disabled, false if nothing was done, i.e. if the
8120 window had already been in the specified state.
8121 """
8122 return _core_.Window_Enable(*args, **kwargs)
8123
8124 def Disable(*args, **kwargs):
8125 """
8126 Disable(self) -> bool
8127
8128 Disables the window, same as Enable(false).
8129 """
8130 return _core_.Window_Disable(*args, **kwargs)
8131
8132 def IsShown(*args, **kwargs):
8133 """
8134 IsShown(self) -> bool
8135
8136 Returns true if the window is shown, false if it has been hidden.
8137 """
8138 return _core_.Window_IsShown(*args, **kwargs)
8139
8140 def IsEnabled(*args, **kwargs):
8141 """
8142 IsEnabled(self) -> bool
8143
8144 Returns true if the window is enabled for input, false otherwise.
8145 """
8146 return _core_.Window_IsEnabled(*args, **kwargs)
8147
8148 def SetWindowStyleFlag(*args, **kwargs):
8149 """
8150 SetWindowStyleFlag(self, long style)
8151
8152 Sets the style of the window. Please note that some styles cannot be
8153 changed after the window creation and that Refresh() might need to be
8154 called after changing the others for the change to take place
8155 immediately.
8156 """
8157 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8158
8159 def GetWindowStyleFlag(*args, **kwargs):
8160 """
8161 GetWindowStyleFlag(self) -> long
8162
8163 Gets the window style that was passed to the constructor or Create
8164 method.
8165 """
8166 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8167
8168 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8169 def HasFlag(*args, **kwargs):
8170 """
8171 HasFlag(self, int flag) -> bool
8172
8173 Test if the given style is set for this window.
8174 """
8175 return _core_.Window_HasFlag(*args, **kwargs)
8176
8177 def IsRetained(*args, **kwargs):
8178 """
8179 IsRetained(self) -> bool
8180
8181 Returns true if the window is retained, false otherwise. Retained
8182 windows are only available on X platforms.
8183 """
8184 return _core_.Window_IsRetained(*args, **kwargs)
8185
8186 def SetExtraStyle(*args, **kwargs):
8187 """
8188 SetExtraStyle(self, long exStyle)
8189
8190 Sets the extra style bits for the window. Extra styles are the less
8191 often used style bits which can't be set with the constructor or with
8192 SetWindowStyleFlag()
8193 """
8194 return _core_.Window_SetExtraStyle(*args, **kwargs)
8195
8196 def GetExtraStyle(*args, **kwargs):
8197 """
8198 GetExtraStyle(self) -> long
8199
8200 Returns the extra style bits for the window.
8201 """
8202 return _core_.Window_GetExtraStyle(*args, **kwargs)
8203
8204 def MakeModal(*args, **kwargs):
8205 """
8206 MakeModal(self, bool modal=True)
8207
8208 Disables all other windows in the application so that the user can
8209 only interact with this window. Passing False will reverse this
8210 effect.
8211 """
8212 return _core_.Window_MakeModal(*args, **kwargs)
8213
8214 def SetThemeEnabled(*args, **kwargs):
8215 """
8216 SetThemeEnabled(self, bool enableTheme)
8217
8218 This function tells a window if it should use the system's "theme"
8219 code to draw the windows' background instead if its own background
8220 drawing code. This will only have an effect on platforms that support
8221 the notion of themes in user defined windows. One such platform is
8222 GTK+ where windows can have (very colourful) backgrounds defined by a
8223 user's selected theme.
8224
8225 Dialogs, notebook pages and the status bar have this flag set to true
8226 by default so that the default look and feel is simulated best.
8227 """
8228 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8229
8230 def GetThemeEnabled(*args, **kwargs):
8231 """
8232 GetThemeEnabled(self) -> bool
8233
8234 Return the themeEnabled flag.
8235 """
8236 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8237
8238 def SetFocus(*args, **kwargs):
8239 """
8240 SetFocus(self)
8241
8242 Set's the focus to this window, allowing it to receive keyboard input.
8243 """
8244 return _core_.Window_SetFocus(*args, **kwargs)
8245
8246 def SetFocusFromKbd(*args, **kwargs):
8247 """
8248 SetFocusFromKbd(self)
8249
8250 Set focus to this window as the result of a keyboard action. Normally
8251 only called internally.
8252 """
8253 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8254
8255 def FindFocus(*args, **kwargs):
8256 """
8257 FindFocus() -> Window
8258
8259 Returns the window or control that currently has the keyboard focus,
8260 or None.
8261 """
8262 return _core_.Window_FindFocus(*args, **kwargs)
8263
8264 FindFocus = staticmethod(FindFocus)
8265 def AcceptsFocus(*args, **kwargs):
8266 """
8267 AcceptsFocus(self) -> bool
8268
8269 Can this window have focus?
8270 """
8271 return _core_.Window_AcceptsFocus(*args, **kwargs)
8272
8273 def AcceptsFocusFromKeyboard(*args, **kwargs):
8274 """
8275 AcceptsFocusFromKeyboard(self) -> bool
8276
8277 Can this window be given focus by keyboard navigation? if not, the
8278 only way to give it focus (provided it accepts it at all) is to click
8279 it.
8280 """
8281 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8282
8283 def GetDefaultItem(*args, **kwargs):
8284 """
8285 GetDefaultItem(self) -> Window
8286
8287 Get the default child of this parent, i.e. the one which is activated
8288 by pressing <Enter> such as the OK button on a wx.Dialog.
8289 """
8290 return _core_.Window_GetDefaultItem(*args, **kwargs)
8291
8292 def SetDefaultItem(*args, **kwargs):
8293 """
8294 SetDefaultItem(self, Window child) -> Window
8295
8296 Set this child as default, return the old default.
8297 """
8298 return _core_.Window_SetDefaultItem(*args, **kwargs)
8299
8300 def SetTmpDefaultItem(*args, **kwargs):
8301 """
8302 SetTmpDefaultItem(self, Window win)
8303
8304 Set this child as temporary default
8305 """
8306 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8307
8308 def Navigate(*args, **kwargs):
8309 """
8310 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8311
8312 Does keyboard navigation from this window to another, by sending a
8313 `wx.NavigationKeyEvent`.
8314 """
8315 return _core_.Window_Navigate(*args, **kwargs)
8316
8317 def MoveAfterInTabOrder(*args, **kwargs):
8318 """
8319 MoveAfterInTabOrder(self, Window win)
8320
8321 Moves this window in the tab navigation order after the specified
8322 sibling window. This means that when the user presses the TAB key on
8323 that other window, the focus switches to this window.
8324
8325 The default tab order is the same as creation order. This function
8326 and `MoveBeforeInTabOrder` allow to change it after creating all the
8327 windows.
8328
8329 """
8330 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8331
8332 def MoveBeforeInTabOrder(*args, **kwargs):
8333 """
8334 MoveBeforeInTabOrder(self, Window win)
8335
8336 Same as `MoveAfterInTabOrder` except that it inserts this window just
8337 before win instead of putting it right after it.
8338 """
8339 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8340
8341 def GetChildren(*args, **kwargs):
8342 """
8343 GetChildren(self) -> PyObject
8344
8345 Returns a list of the window's children. NOTE: Currently this is a
8346 copy of the child window list maintained by the window, so the return
8347 value of this function is only valid as long as the window's children
8348 do not change.
8349 """
8350 return _core_.Window_GetChildren(*args, **kwargs)
8351
8352 def GetParent(*args, **kwargs):
8353 """
8354 GetParent(self) -> Window
8355
8356 Returns the parent window of this window, or None if there isn't one.
8357 """
8358 return _core_.Window_GetParent(*args, **kwargs)
8359
8360 def GetGrandParent(*args, **kwargs):
8361 """
8362 GetGrandParent(self) -> Window
8363
8364 Returns the parent of the parent of this window, or None if there
8365 isn't one.
8366 """
8367 return _core_.Window_GetGrandParent(*args, **kwargs)
8368
8369 def IsTopLevel(*args, **kwargs):
8370 """
8371 IsTopLevel(self) -> bool
8372
8373 Returns true if the given window is a top-level one. Currently all
8374 frames and dialogs are always considered to be top-level windows (even
8375 if they have a parent window).
8376 """
8377 return _core_.Window_IsTopLevel(*args, **kwargs)
8378
8379 def Reparent(*args, **kwargs):
8380 """
8381 Reparent(self, Window newParent) -> bool
8382
8383 Reparents the window, i.e the window will be removed from its current
8384 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8385 re-inserted into another. Available on Windows and GTK. Returns True
8386 if the parent was changed, False otherwise (error or newParent ==
8387 oldParent)
8388 """
8389 return _core_.Window_Reparent(*args, **kwargs)
8390
8391 def AddChild(*args, **kwargs):
8392 """
8393 AddChild(self, Window child)
8394
8395 Adds a child window. This is called automatically by window creation
8396 functions so should not be required by the application programmer.
8397 """
8398 return _core_.Window_AddChild(*args, **kwargs)
8399
8400 def RemoveChild(*args, **kwargs):
8401 """
8402 RemoveChild(self, Window child)
8403
8404 Removes a child window. This is called automatically by window
8405 deletion functions so should not be required by the application
8406 programmer.
8407 """
8408 return _core_.Window_RemoveChild(*args, **kwargs)
8409
8410 def FindWindowById(*args, **kwargs):
8411 """
8412 FindWindowById(self, long winid) -> Window
8413
8414 Find a chld of this window by window ID
8415 """
8416 return _core_.Window_FindWindowById(*args, **kwargs)
8417
8418 def FindWindowByName(*args, **kwargs):
8419 """
8420 FindWindowByName(self, String name) -> Window
8421
8422 Find a child of this window by name
8423 """
8424 return _core_.Window_FindWindowByName(*args, **kwargs)
8425
8426 def GetEventHandler(*args, **kwargs):
8427 """
8428 GetEventHandler(self) -> EvtHandler
8429
8430 Returns the event handler for this window. By default, the window is
8431 its own event handler.
8432 """
8433 return _core_.Window_GetEventHandler(*args, **kwargs)
8434
8435 def SetEventHandler(*args, **kwargs):
8436 """
8437 SetEventHandler(self, EvtHandler handler)
8438
8439 Sets the event handler for this window. An event handler is an object
8440 that is capable of processing the events sent to a window. By default,
8441 the window is its own event handler, but an application may wish to
8442 substitute another, for example to allow central implementation of
8443 event-handling for a variety of different window classes.
8444
8445 It is usually better to use `wx.Window.PushEventHandler` since this sets
8446 up a chain of event handlers, where an event not handled by one event
8447 handler is handed to the next one in the chain.
8448 """
8449 return _core_.Window_SetEventHandler(*args, **kwargs)
8450
8451 def PushEventHandler(*args, **kwargs):
8452 """
8453 PushEventHandler(self, EvtHandler handler)
8454
8455 Pushes this event handler onto the event handler stack for the window.
8456 An event handler is an object that is capable of processing the events
8457 sent to a window. By default, the window is its own event handler, but
8458 an application may wish to substitute another, for example to allow
8459 central implementation of event-handling for a variety of different
8460 window classes.
8461
8462 wx.Window.PushEventHandler allows an application to set up a chain of
8463 event handlers, where an event not handled by one event handler is
8464 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8465 remove the event handler.
8466 """
8467 return _core_.Window_PushEventHandler(*args, **kwargs)
8468
8469 def PopEventHandler(*args, **kwargs):
8470 """
8471 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8472
8473 Removes and returns the top-most event handler on the event handler
8474 stack. If deleteHandler is True then the wx.EvtHandler object will be
8475 destroyed after it is popped.
8476 """
8477 return _core_.Window_PopEventHandler(*args, **kwargs)
8478
8479 def RemoveEventHandler(*args, **kwargs):
8480 """
8481 RemoveEventHandler(self, EvtHandler handler) -> bool
8482
8483 Find the given handler in the event handler chain and remove (but not
8484 delete) it from the event handler chain, return True if it was found
8485 and False otherwise (this also results in an assert failure so this
8486 function should only be called when the handler is supposed to be
8487 there.)
8488 """
8489 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8490
8491 def SetValidator(*args, **kwargs):
8492 """
8493 SetValidator(self, Validator validator)
8494
8495 Deletes the current validator (if any) and sets the window validator,
8496 having called wx.Validator.Clone to create a new validator of this
8497 type.
8498 """
8499 return _core_.Window_SetValidator(*args, **kwargs)
8500
8501 def GetValidator(*args, **kwargs):
8502 """
8503 GetValidator(self) -> Validator
8504
8505 Returns a pointer to the current validator for the window, or None if
8506 there is none.
8507 """
8508 return _core_.Window_GetValidator(*args, **kwargs)
8509
8510 def Validate(*args, **kwargs):
8511 """
8512 Validate(self) -> bool
8513
8514 Validates the current values of the child controls using their
8515 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8516 style flag set, the method will also call Validate() of all child
8517 windows. Returns false if any of the validations failed.
8518 """
8519 return _core_.Window_Validate(*args, **kwargs)
8520
8521 def TransferDataToWindow(*args, **kwargs):
8522 """
8523 TransferDataToWindow(self) -> bool
8524
8525 Transfers values to child controls from data areas specified by their
8526 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8527 style flag set, the method will also call TransferDataToWindow() of
8528 all child windows.
8529 """
8530 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8531
8532 def TransferDataFromWindow(*args, **kwargs):
8533 """
8534 TransferDataFromWindow(self) -> bool
8535
8536 Transfers values from child controls to data areas specified by their
8537 validators. Returns false if a transfer failed. If the window has
8538 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8539 also call TransferDataFromWindow() of all child windows.
8540 """
8541 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8542
8543 def InitDialog(*args, **kwargs):
8544 """
8545 InitDialog(self)
8546
8547 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8548 to the dialog via validators.
8549 """
8550 return _core_.Window_InitDialog(*args, **kwargs)
8551
8552 def SetAcceleratorTable(*args, **kwargs):
8553 """
8554 SetAcceleratorTable(self, AcceleratorTable accel)
8555
8556 Sets the accelerator table for this window.
8557 """
8558 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8559
8560 def GetAcceleratorTable(*args, **kwargs):
8561 """
8562 GetAcceleratorTable(self) -> AcceleratorTable
8563
8564 Gets the accelerator table for this window.
8565 """
8566 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8567
8568 def RegisterHotKey(*args, **kwargs):
8569 """
8570 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8571
8572 Registers a system wide hotkey. Every time the user presses the hotkey
8573 registered here, this window will receive a hotkey event. It will
8574 receive the event even if the application is in the background and
8575 does not have the input focus because the user is working with some
8576 other application. To bind an event handler function to this hotkey
8577 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8578 hotkey was registered successfully.
8579 """
8580 return _core_.Window_RegisterHotKey(*args, **kwargs)
8581
8582 def UnregisterHotKey(*args, **kwargs):
8583 """
8584 UnregisterHotKey(self, int hotkeyId) -> bool
8585
8586 Unregisters a system wide hotkey.
8587 """
8588 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8589
8590 def ConvertDialogPointToPixels(*args, **kwargs):
8591 """
8592 ConvertDialogPointToPixels(self, Point pt) -> Point
8593
8594 Converts a point or size from dialog units to pixels. Dialog units
8595 are used for maintaining a dialog's proportions even if the font
8596 changes. For the x dimension, the dialog units are multiplied by the
8597 average character width and then divided by 4. For the y dimension,
8598 the dialog units are multiplied by the average character height and
8599 then divided by 8.
8600 """
8601 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8602
8603 def ConvertDialogSizeToPixels(*args, **kwargs):
8604 """
8605 ConvertDialogSizeToPixels(self, Size sz) -> Size
8606
8607 Converts a point or size from dialog units to pixels. Dialog units
8608 are used for maintaining a dialog's proportions even if the font
8609 changes. For the x dimension, the dialog units are multiplied by the
8610 average character width and then divided by 4. For the y dimension,
8611 the dialog units are multiplied by the average character height and
8612 then divided by 8.
8613 """
8614 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8615
8616 def DLG_PNT(*args, **kwargs):
8617 """
8618 DLG_PNT(self, Point pt) -> Point
8619
8620 Converts a point or size from dialog units to pixels. Dialog units
8621 are used for maintaining a dialog's proportions even if the font
8622 changes. For the x dimension, the dialog units are multiplied by the
8623 average character width and then divided by 4. For the y dimension,
8624 the dialog units are multiplied by the average character height and
8625 then divided by 8.
8626 """
8627 return _core_.Window_DLG_PNT(*args, **kwargs)
8628
8629 def DLG_SZE(*args, **kwargs):
8630 """
8631 DLG_SZE(self, Size sz) -> Size
8632
8633 Converts a point or size from dialog units to pixels. Dialog units
8634 are used for maintaining a dialog's proportions even if the font
8635 changes. For the x dimension, the dialog units are multiplied by the
8636 average character width and then divided by 4. For the y dimension,
8637 the dialog units are multiplied by the average character height and
8638 then divided by 8.
8639 """
8640 return _core_.Window_DLG_SZE(*args, **kwargs)
8641
8642 def ConvertPixelPointToDialog(*args, **kwargs):
8643 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8644 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8645
8646 def ConvertPixelSizeToDialog(*args, **kwargs):
8647 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8648 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8649
8650 def WarpPointer(*args, **kwargs):
8651 """
8652 WarpPointer(self, int x, int y)
8653
8654 Moves the pointer to the given position on the window.
8655
8656 NOTE: This function is not supported under Mac because Apple Human
8657 Interface Guidelines forbid moving the mouse cursor programmatically.
8658 """
8659 return _core_.Window_WarpPointer(*args, **kwargs)
8660
8661 def CaptureMouse(*args, **kwargs):
8662 """
8663 CaptureMouse(self)
8664
8665 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8666 release the capture.
8667
8668 Note that wxWindows maintains the stack of windows having captured the
8669 mouse and when the mouse is released the capture returns to the window
8670 which had had captured it previously and it is only really released if
8671 there were no previous window. In particular, this means that you must
8672 release the mouse as many times as you capture it.
8673 """
8674 return _core_.Window_CaptureMouse(*args, **kwargs)
8675
8676 def ReleaseMouse(*args, **kwargs):
8677 """
8678 ReleaseMouse(self)
8679
8680 Releases mouse input captured with wx.Window.CaptureMouse.
8681 """
8682 return _core_.Window_ReleaseMouse(*args, **kwargs)
8683
8684 def GetCapture(*args, **kwargs):
8685 """
8686 GetCapture() -> Window
8687
8688 Returns the window which currently captures the mouse or None
8689 """
8690 return _core_.Window_GetCapture(*args, **kwargs)
8691
8692 GetCapture = staticmethod(GetCapture)
8693 def HasCapture(*args, **kwargs):
8694 """
8695 HasCapture(self) -> bool
8696
8697 Returns true if this window has the current mouse capture.
8698 """
8699 return _core_.Window_HasCapture(*args, **kwargs)
8700
8701 def Refresh(*args, **kwargs):
8702 """
8703 Refresh(self, bool eraseBackground=True, Rect rect=None)
8704
8705 Mark the specified rectangle (or the whole window) as "dirty" so it
8706 will be repainted. Causes an EVT_PAINT event to be generated and sent
8707 to the window.
8708 """
8709 return _core_.Window_Refresh(*args, **kwargs)
8710
8711 def RefreshRect(*args, **kwargs):
8712 """
8713 RefreshRect(self, Rect rect, bool eraseBackground=True)
8714
8715 Redraws the contents of the given rectangle: the area inside it will
8716 be repainted. This is the same as Refresh but has a nicer syntax.
8717 """
8718 return _core_.Window_RefreshRect(*args, **kwargs)
8719
8720 def Update(*args, **kwargs):
8721 """
8722 Update(self)
8723
8724 Calling this method immediately repaints the invalidated area of the
8725 window instead of waiting for the EVT_PAINT event to happen, (normally
8726 this would usually only happen when the flow of control returns to the
8727 event loop.) Notice that this function doesn't refresh the window and
8728 does nothing if the window has been already repainted. Use Refresh
8729 first if you want to immediately redraw the window (or some portion of
8730 it) unconditionally.
8731 """
8732 return _core_.Window_Update(*args, **kwargs)
8733
8734 def ClearBackground(*args, **kwargs):
8735 """
8736 ClearBackground(self)
8737
8738 Clears the window by filling it with the current background
8739 colour. Does not cause an erase background event to be generated.
8740 """
8741 return _core_.Window_ClearBackground(*args, **kwargs)
8742
8743 def Freeze(*args, **kwargs):
8744 """
8745 Freeze(self)
8746
8747 Freezes the window or, in other words, prevents any updates from
8748 taking place on screen, the window is not redrawn at all. Thaw must be
8749 called to reenable window redrawing. Calls to Freeze/Thaw may be
8750 nested, with the actual Thaw being delayed until all the nesting has
8751 been undone.
8752
8753 This method is useful for visual appearance optimization (for example,
8754 it is a good idea to use it before inserting large amount of text into
8755 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8756 for all controls so it is mostly just a hint to wxWindows and not a
8757 mandatory directive.
8758 """
8759 return _core_.Window_Freeze(*args, **kwargs)
8760
8761 def Thaw(*args, **kwargs):
8762 """
8763 Thaw(self)
8764
8765 Reenables window updating after a previous call to Freeze. Calls to
8766 Freeze/Thaw may be nested, so Thaw must be called the same number of
8767 times that Freeze was before the window will be updated.
8768 """
8769 return _core_.Window_Thaw(*args, **kwargs)
8770
8771 def PrepareDC(*args, **kwargs):
8772 """
8773 PrepareDC(self, DC dc)
8774
8775 Call this function to prepare the device context for drawing a
8776 scrolled image. It sets the device origin according to the current
8777 scroll position.
8778 """
8779 return _core_.Window_PrepareDC(*args, **kwargs)
8780
8781 def GetUpdateRegion(*args, **kwargs):
8782 """
8783 GetUpdateRegion(self) -> Region
8784
8785 Returns the region specifying which parts of the window have been
8786 damaged. Should only be called within an EVT_PAINT handler.
8787 """
8788 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8789
8790 def GetUpdateClientRect(*args, **kwargs):
8791 """
8792 GetUpdateClientRect(self) -> Rect
8793
8794 Get the update rectangle region bounding box in client coords.
8795 """
8796 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8797
8798 def IsExposed(*args, **kwargs):
8799 """
8800 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8801
8802 Returns true if the given point or rectangle area has been exposed
8803 since the last repaint. Call this in an paint event handler to
8804 optimize redrawing by only redrawing those areas, which have been
8805 exposed.
8806 """
8807 return _core_.Window_IsExposed(*args, **kwargs)
8808
8809 def IsExposedPoint(*args, **kwargs):
8810 """
8811 IsExposedPoint(self, Point pt) -> bool
8812
8813 Returns true if the given point or rectangle area has been exposed
8814 since the last repaint. Call this in an paint event handler to
8815 optimize redrawing by only redrawing those areas, which have been
8816 exposed.
8817 """
8818 return _core_.Window_IsExposedPoint(*args, **kwargs)
8819
8820 def IsExposedRect(*args, **kwargs):
8821 """
8822 IsExposedRect(self, Rect rect) -> bool
8823
8824 Returns true if the given point or rectangle area has been exposed
8825 since the last repaint. Call this in an paint event handler to
8826 optimize redrawing by only redrawing those areas, which have been
8827 exposed.
8828 """
8829 return _core_.Window_IsExposedRect(*args, **kwargs)
8830
8831 def GetDefaultAttributes(*args, **kwargs):
8832 """
8833 GetDefaultAttributes(self) -> VisualAttributes
8834
8835 Get the default attributes for an instance of this class. This is
8836 useful if you want to use the same font or colour in your own control
8837 as in a standard control -- which is a much better idea than hard
8838 coding specific colours or fonts which might look completely out of
8839 place on the user's system, especially if it uses themes.
8840 """
8841 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8842
8843 def GetClassDefaultAttributes(*args, **kwargs):
8844 """
8845 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8846
8847 Get the default attributes for this class. This is useful if you want
8848 to use the same font or colour in your own control as in a standard
8849 control -- which is a much better idea than hard coding specific
8850 colours or fonts which might look completely out of place on the
8851 user's system, especially if it uses themes.
8852
8853 The variant parameter is only relevant under Mac currently and is
8854 ignore under other platforms. Under Mac, it will change the size of
8855 the returned font. See `wx.Window.SetWindowVariant` for more about
8856 this.
8857 """
8858 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8859
8860 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8861 def SetBackgroundColour(*args, **kwargs):
8862 """
8863 SetBackgroundColour(self, Colour colour) -> bool
8864
8865 Sets the background colour of the window. Returns True if the colour
8866 was changed. The background colour is usually painted by the default
8867 EVT_ERASE_BACKGROUND event handler function under Windows and
8868 automatically under GTK. Using `wx.NullColour` will reset the window
8869 to the default background colour.
8870
8871 Note that setting the background colour may not cause an immediate
8872 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8873 calling this function.
8874
8875 Using this function will disable attempts to use themes for this
8876 window, if the system supports them. Use with care since usually the
8877 themes represent the appearance chosen by the user to be used for all
8878 applications on the system.
8879 """
8880 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8881
8882 def SetOwnBackgroundColour(*args, **kwargs):
8883 """SetOwnBackgroundColour(self, Colour colour)"""
8884 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8885
8886 def SetForegroundColour(*args, **kwargs):
8887 """
8888 SetForegroundColour(self, Colour colour) -> bool
8889
8890 Sets the foreground colour of the window. Returns True is the colour
8891 was changed. The interpretation of foreground colour is dependent on
8892 the window class; it may be the text colour or other colour, or it may
8893 not be used at all.
8894 """
8895 return _core_.Window_SetForegroundColour(*args, **kwargs)
8896
8897 def SetOwnForegroundColour(*args, **kwargs):
8898 """SetOwnForegroundColour(self, Colour colour)"""
8899 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8900
8901 def GetBackgroundColour(*args, **kwargs):
8902 """
8903 GetBackgroundColour(self) -> Colour
8904
8905 Returns the background colour of the window.
8906 """
8907 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8908
8909 def GetForegroundColour(*args, **kwargs):
8910 """
8911 GetForegroundColour(self) -> Colour
8912
8913 Returns the foreground colour of the window. The interpretation of
8914 foreground colour is dependent on the window class; it may be the text
8915 colour or other colour, or it may not be used at all.
8916 """
8917 return _core_.Window_GetForegroundColour(*args, **kwargs)
8918
8919 def InheritsBackgroundColour(*args, **kwargs):
8920 """InheritsBackgroundColour(self) -> bool"""
8921 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8922
8923 def UseBgCol(*args, **kwargs):
8924 """UseBgCol(self) -> bool"""
8925 return _core_.Window_UseBgCol(*args, **kwargs)
8926
8927 def SetBackgroundStyle(*args, **kwargs):
8928 """
8929 SetBackgroundStyle(self, int style) -> bool
8930
8931 Returns the background style of the window. The background style
8932 indicates how the background of the window is drawn.
8933
8934 ====================== ========================================
8935 wx.BG_STYLE_SYSTEM The background colour or pattern should
8936 be determined by the system
8937 wx.BG_STYLE_COLOUR The background should be a solid colour
8938 wx.BG_STYLE_CUSTOM The background will be implemented by the
8939 application.
8940 ====================== ========================================
8941
8942 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8943 a custom background, such as a tiled bitmap. Currently the style has
8944 no effect on other platforms.
8945
8946 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8947 """
8948 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8949
8950 def GetBackgroundStyle(*args, **kwargs):
8951 """
8952 GetBackgroundStyle(self) -> int
8953
8954 Returns the background style of the window.
8955
8956 :see: `SetBackgroundStyle`
8957 """
8958 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8959
8960 def HasTransparentBackground(*args, **kwargs):
8961 """
8962 HasTransparentBackground(self) -> bool
8963
8964 Returns True if this window's background is transparent (as, for
8965 example, for `wx.StaticText`) and should show the parent window's
8966 background.
8967
8968 This method is mostly used internally by the library itself and you
8969 normally shouldn't have to call it. You may, however, have to override
8970 it in your custom control classes to ensure that background is painted
8971 correctly.
8972 """
8973 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8974
8975 def SetCursor(*args, **kwargs):
8976 """
8977 SetCursor(self, Cursor cursor) -> bool
8978
8979 Sets the window's cursor. Notice that the window cursor also sets it
8980 for the children of the window implicitly.
8981
8982 The cursor may be wx.NullCursor in which case the window cursor will
8983 be reset back to default.
8984 """
8985 return _core_.Window_SetCursor(*args, **kwargs)
8986
8987 def GetCursor(*args, **kwargs):
8988 """
8989 GetCursor(self) -> Cursor
8990
8991 Return the cursor associated with this window.
8992 """
8993 return _core_.Window_GetCursor(*args, **kwargs)
8994
8995 def SetFont(*args, **kwargs):
8996 """
8997 SetFont(self, Font font) -> bool
8998
8999 Sets the font for this window.
9000 """
9001 return _core_.Window_SetFont(*args, **kwargs)
9002
9003 def SetOwnFont(*args, **kwargs):
9004 """SetOwnFont(self, Font font)"""
9005 return _core_.Window_SetOwnFont(*args, **kwargs)
9006
9007 def GetFont(*args, **kwargs):
9008 """
9009 GetFont(self) -> Font
9010
9011 Returns the default font used for this window.
9012 """
9013 return _core_.Window_GetFont(*args, **kwargs)
9014
9015 def SetCaret(*args, **kwargs):
9016 """
9017 SetCaret(self, Caret caret)
9018
9019 Sets the caret associated with the window.
9020 """
9021 return _core_.Window_SetCaret(*args, **kwargs)
9022
9023 def GetCaret(*args, **kwargs):
9024 """
9025 GetCaret(self) -> Caret
9026
9027 Returns the caret associated with the window.
9028 """
9029 return _core_.Window_GetCaret(*args, **kwargs)
9030
9031 def GetCharHeight(*args, **kwargs):
9032 """
9033 GetCharHeight(self) -> int
9034
9035 Get the (average) character size for the current font.
9036 """
9037 return _core_.Window_GetCharHeight(*args, **kwargs)
9038
9039 def GetCharWidth(*args, **kwargs):
9040 """
9041 GetCharWidth(self) -> int
9042
9043 Get the (average) character size for the current font.
9044 """
9045 return _core_.Window_GetCharWidth(*args, **kwargs)
9046
9047 def GetTextExtent(*args, **kwargs):
9048 """
9049 GetTextExtent(String string) -> (width, height)
9050
9051 Get the width and height of the text using the current font.
9052 """
9053 return _core_.Window_GetTextExtent(*args, **kwargs)
9054
9055 def GetFullTextExtent(*args, **kwargs):
9056 """
9057 GetFullTextExtent(String string, Font font=None) ->
9058 (width, height, descent, externalLeading)
9059
9060 Get the width, height, decent and leading of the text using the
9061 current or specified font.
9062 """
9063 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9064
9065 def ClientToScreenXY(*args, **kwargs):
9066 """
9067 ClientToScreenXY(int x, int y) -> (x,y)
9068
9069 Converts to screen coordinates from coordinates relative to this window.
9070 """
9071 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9072
9073 def ScreenToClientXY(*args, **kwargs):
9074 """
9075 ScreenToClientXY(int x, int y) -> (x,y)
9076
9077 Converts from screen to client window coordinates.
9078 """
9079 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9080
9081 def ClientToScreen(*args, **kwargs):
9082 """
9083 ClientToScreen(self, Point pt) -> Point
9084
9085 Converts to screen coordinates from coordinates relative to this window.
9086 """
9087 return _core_.Window_ClientToScreen(*args, **kwargs)
9088
9089 def ScreenToClient(*args, **kwargs):
9090 """
9091 ScreenToClient(self, Point pt) -> Point
9092
9093 Converts from screen to client window coordinates.
9094 """
9095 return _core_.Window_ScreenToClient(*args, **kwargs)
9096
9097 def HitTestXY(*args, **kwargs):
9098 """
9099 HitTestXY(self, int x, int y) -> int
9100
9101 Test where the given (in client coords) point lies
9102 """
9103 return _core_.Window_HitTestXY(*args, **kwargs)
9104
9105 def HitTest(*args, **kwargs):
9106 """
9107 HitTest(self, Point pt) -> int
9108
9109 Test where the given (in client coords) point lies
9110 """
9111 return _core_.Window_HitTest(*args, **kwargs)
9112
9113 def GetBorder(*args):
9114 """
9115 GetBorder(self, long flags) -> int
9116 GetBorder(self) -> int
9117
9118 Get border for the flags of this window
9119 """
9120 return _core_.Window_GetBorder(*args)
9121
9122 def UpdateWindowUI(*args, **kwargs):
9123 """
9124 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9125
9126 This function sends EVT_UPDATE_UI events to the window. The particular
9127 implementation depends on the window; for example a wx.ToolBar will
9128 send an update UI event for each toolbar button, and a wx.Frame will
9129 send an update UI event for each menubar menu item. You can call this
9130 function from your application to ensure that your UI is up-to-date at
9131 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9132 concerned). This may be necessary if you have called
9133 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9134 limit the overhead that wxWindows incurs by sending update UI events
9135 in idle time.
9136 """
9137 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9138
9139 def PopupMenuXY(*args, **kwargs):
9140 """
9141 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9142
9143 Pops up the given menu at the specified coordinates, relative to this window,
9144 and returns control when the user has dismissed the menu. If a menu item is
9145 selected, the corresponding menu event is generated and will be processed as
9146 usual. If the default position is given then the current position of the
9147 mouse cursor will be used.
9148 """
9149 return _core_.Window_PopupMenuXY(*args, **kwargs)
9150
9151 def PopupMenu(*args, **kwargs):
9152 """
9153 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9154
9155 Pops up the given menu at the specified coordinates, relative to this window,
9156 and returns control when the user has dismissed the menu. If a menu item is
9157 selected, the corresponding menu event is generated and will be processed as
9158 usual. If the default position is given then the current position of the
9159 mouse cursor will be used.
9160 """
9161 return _core_.Window_PopupMenu(*args, **kwargs)
9162
9163 def GetHandle(*args, **kwargs):
9164 """
9165 GetHandle(self) -> long
9166
9167 Returns the platform-specific handle (as a long integer) of the
9168 physical window. Currently on wxMac it returns the handle of the
9169 toplevel parent of the window.
9170 """
9171 return _core_.Window_GetHandle(*args, **kwargs)
9172
9173 def AssociateHandle(*args, **kwargs):
9174 """
9175 AssociateHandle(self, long handle)
9176
9177 Associate the window with a new native handle
9178 """
9179 return _core_.Window_AssociateHandle(*args, **kwargs)
9180
9181 def DissociateHandle(*args, **kwargs):
9182 """
9183 DissociateHandle(self)
9184
9185 Dissociate the current native handle from the window
9186 """
9187 return _core_.Window_DissociateHandle(*args, **kwargs)
9188
9189 def HasScrollbar(*args, **kwargs):
9190 """
9191 HasScrollbar(self, int orient) -> bool
9192
9193 Does the window have the scrollbar for this orientation?
9194 """
9195 return _core_.Window_HasScrollbar(*args, **kwargs)
9196
9197 def SetScrollbar(*args, **kwargs):
9198 """
9199 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9200 bool refresh=True)
9201
9202 Sets the scrollbar properties of a built-in scrollbar.
9203 """
9204 return _core_.Window_SetScrollbar(*args, **kwargs)
9205
9206 def SetScrollPos(*args, **kwargs):
9207 """
9208 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9209
9210 Sets the position of one of the built-in scrollbars.
9211 """
9212 return _core_.Window_SetScrollPos(*args, **kwargs)
9213
9214 def GetScrollPos(*args, **kwargs):
9215 """
9216 GetScrollPos(self, int orientation) -> int
9217
9218 Returns the built-in scrollbar position.
9219 """
9220 return _core_.Window_GetScrollPos(*args, **kwargs)
9221
9222 def GetScrollThumb(*args, **kwargs):
9223 """
9224 GetScrollThumb(self, int orientation) -> int
9225
9226 Returns the built-in scrollbar thumb size.
9227 """
9228 return _core_.Window_GetScrollThumb(*args, **kwargs)
9229
9230 def GetScrollRange(*args, **kwargs):
9231 """
9232 GetScrollRange(self, int orientation) -> int
9233
9234 Returns the built-in scrollbar range.
9235 """
9236 return _core_.Window_GetScrollRange(*args, **kwargs)
9237
9238 def ScrollWindow(*args, **kwargs):
9239 """
9240 ScrollWindow(self, int dx, int dy, Rect rect=None)
9241
9242 Physically scrolls the pixels in the window and move child windows
9243 accordingly. Use this function to optimise your scrolling
9244 implementations, to minimise the area that must be redrawn. Note that
9245 it is rarely required to call this function from a user program.
9246 """
9247 return _core_.Window_ScrollWindow(*args, **kwargs)
9248
9249 def ScrollLines(*args, **kwargs):
9250 """
9251 ScrollLines(self, int lines) -> bool
9252
9253 If the platform and window class supports it, scrolls the window by
9254 the given number of lines down, if lines is positive, or up if lines
9255 is negative. Returns True if the window was scrolled, False if it was
9256 already on top/bottom and nothing was done.
9257 """
9258 return _core_.Window_ScrollLines(*args, **kwargs)
9259
9260 def ScrollPages(*args, **kwargs):
9261 """
9262 ScrollPages(self, int pages) -> bool
9263
9264 If the platform and window class supports it, scrolls the window by
9265 the given number of pages down, if pages is positive, or up if pages
9266 is negative. Returns True if the window was scrolled, False if it was
9267 already on top/bottom and nothing was done.
9268 """
9269 return _core_.Window_ScrollPages(*args, **kwargs)
9270
9271 def LineUp(*args, **kwargs):
9272 """
9273 LineUp(self) -> bool
9274
9275 This is just a wrapper for ScrollLines(-1).
9276 """
9277 return _core_.Window_LineUp(*args, **kwargs)
9278
9279 def LineDown(*args, **kwargs):
9280 """
9281 LineDown(self) -> bool
9282
9283 This is just a wrapper for ScrollLines(1).
9284 """
9285 return _core_.Window_LineDown(*args, **kwargs)
9286
9287 def PageUp(*args, **kwargs):
9288 """
9289 PageUp(self) -> bool
9290
9291 This is just a wrapper for ScrollPages(-1).
9292 """
9293 return _core_.Window_PageUp(*args, **kwargs)
9294
9295 def PageDown(*args, **kwargs):
9296 """
9297 PageDown(self) -> bool
9298
9299 This is just a wrapper for ScrollPages(1).
9300 """
9301 return _core_.Window_PageDown(*args, **kwargs)
9302
9303 def SetHelpText(*args, **kwargs):
9304 """
9305 SetHelpText(self, String text)
9306
9307 Sets the help text to be used as context-sensitive help for this
9308 window. Note that the text is actually stored by the current
9309 wxHelpProvider implementation, and not in the window object itself.
9310 """
9311 return _core_.Window_SetHelpText(*args, **kwargs)
9312
9313 def SetHelpTextForId(*args, **kwargs):
9314 """
9315 SetHelpTextForId(self, String text)
9316
9317 Associate this help text with all windows with the same id as this
9318 one.
9319 """
9320 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9321
9322 def GetHelpText(*args, **kwargs):
9323 """
9324 GetHelpText(self) -> String
9325
9326 Gets the help text to be used as context-sensitive help for this
9327 window. Note that the text is actually stored by the current
9328 wxHelpProvider implementation, and not in the window object itself.
9329 """
9330 return _core_.Window_GetHelpText(*args, **kwargs)
9331
9332 def SetToolTipString(*args, **kwargs):
9333 """
9334 SetToolTipString(self, String tip)
9335
9336 Attach a tooltip to the window.
9337 """
9338 return _core_.Window_SetToolTipString(*args, **kwargs)
9339
9340 def SetToolTip(*args, **kwargs):
9341 """
9342 SetToolTip(self, ToolTip tip)
9343
9344 Attach a tooltip to the window.
9345 """
9346 return _core_.Window_SetToolTip(*args, **kwargs)
9347
9348 def GetToolTip(*args, **kwargs):
9349 """
9350 GetToolTip(self) -> ToolTip
9351
9352 get the associated tooltip or None if none
9353 """
9354 return _core_.Window_GetToolTip(*args, **kwargs)
9355
9356 def SetDropTarget(*args, **kwargs):
9357 """
9358 SetDropTarget(self, DropTarget dropTarget)
9359
9360 Associates a drop target with this window. If the window already has
9361 a drop target, it is deleted.
9362 """
9363 return _core_.Window_SetDropTarget(*args, **kwargs)
9364
9365 def GetDropTarget(*args, **kwargs):
9366 """
9367 GetDropTarget(self) -> DropTarget
9368
9369 Returns the associated drop target, which may be None.
9370 """
9371 return _core_.Window_GetDropTarget(*args, **kwargs)
9372
9373 def DragAcceptFiles(*args, **kwargs):
9374 """
9375 DragAcceptFiles(self, bool accept)
9376
9377 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9378 Only functional on Windows.
9379 """
9380 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9381
9382 def SetConstraints(*args, **kwargs):
9383 """
9384 SetConstraints(self, LayoutConstraints constraints)
9385
9386 Sets the window to have the given layout constraints. If an existing
9387 layout constraints object is already owned by the window, it will be
9388 deleted. Pass None to disassociate and delete the window's current
9389 constraints.
9390
9391 You must call SetAutoLayout to tell a window to use the constraints
9392 automatically in its default EVT_SIZE handler; otherwise, you must
9393 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9394 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9395 effect.
9396 """
9397 return _core_.Window_SetConstraints(*args, **kwargs)
9398
9399 def GetConstraints(*args, **kwargs):
9400 """
9401 GetConstraints(self) -> LayoutConstraints
9402
9403 Returns a pointer to the window's layout constraints, or None if there
9404 are none.
9405 """
9406 return _core_.Window_GetConstraints(*args, **kwargs)
9407
9408 def SetAutoLayout(*args, **kwargs):
9409 """
9410 SetAutoLayout(self, bool autoLayout)
9411
9412 Determines whether the Layout function will be called automatically
9413 when the window is resized. lease note that this only happens for the
9414 windows usually used to contain children, namely `wx.Panel` and
9415 `wx.TopLevelWindow` (and the classes deriving from them).
9416
9417 This method is called implicitly by `SetSizer` but if you use
9418 `SetConstraints` you should call it manually or otherwise the window
9419 layout won't be correctly updated when its size changes.
9420 """
9421 return _core_.Window_SetAutoLayout(*args, **kwargs)
9422
9423 def GetAutoLayout(*args, **kwargs):
9424 """
9425 GetAutoLayout(self) -> bool
9426
9427 Returns the current autoLayout setting
9428 """
9429 return _core_.Window_GetAutoLayout(*args, **kwargs)
9430
9431 def Layout(*args, **kwargs):
9432 """
9433 Layout(self) -> bool
9434
9435 Invokes the constraint-based layout algorithm or the sizer-based
9436 algorithm for this window. See SetAutoLayout: when auto layout is on,
9437 this function gets called automatically by the default EVT_SIZE
9438 handler when the window is resized.
9439 """
9440 return _core_.Window_Layout(*args, **kwargs)
9441
9442 def SetSizer(*args, **kwargs):
9443 """
9444 SetSizer(self, Sizer sizer, bool deleteOld=True)
9445
9446 Sets the window to have the given layout sizer. The window will then
9447 own the object, and will take care of its deletion. If an existing
9448 layout sizer object is already owned by the window, it will be deleted
9449 if the deleteOld parameter is true. Note that this function will also
9450 call SetAutoLayout implicitly with a True parameter if the sizer is
9451 non-None, and False otherwise.
9452 """
9453 return _core_.Window_SetSizer(*args, **kwargs)
9454
9455 def SetSizerAndFit(*args, **kwargs):
9456 """
9457 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9458
9459 The same as SetSizer, except it also sets the size hints for the
9460 window based on the sizer's minimum size.
9461 """
9462 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9463
9464 def GetSizer(*args, **kwargs):
9465 """
9466 GetSizer(self) -> Sizer
9467
9468 Return the sizer associated with the window by a previous call to
9469 SetSizer or None if there isn't one.
9470 """
9471 return _core_.Window_GetSizer(*args, **kwargs)
9472
9473 def SetContainingSizer(*args, **kwargs):
9474 """
9475 SetContainingSizer(self, Sizer sizer)
9476
9477 This normally does not need to be called by application code. It is
9478 called internally when a window is added to a sizer, and is used so
9479 the window can remove itself from the sizer when it is destroyed.
9480 """
9481 return _core_.Window_SetContainingSizer(*args, **kwargs)
9482
9483 def GetContainingSizer(*args, **kwargs):
9484 """
9485 GetContainingSizer(self) -> Sizer
9486
9487 Return the sizer that this window is a member of, if any, otherwise None.
9488 """
9489 return _core_.Window_GetContainingSizer(*args, **kwargs)
9490
9491 def InheritAttributes(*args, **kwargs):
9492 """
9493 InheritAttributes(self)
9494
9495 This function is (or should be, in case of custom controls) called
9496 during window creation to intelligently set up the window visual
9497 attributes, that is the font and the foreground and background
9498 colours.
9499
9500 By 'intelligently' the following is meant: by default, all windows use
9501 their own default attributes. However if some of the parent's
9502 attributes are explicitly changed (that is, using SetFont and not
9503 SetOwnFont) and if the corresponding attribute hadn't been
9504 explicitly set for this window itself, then this window takes the same
9505 value as used by the parent. In addition, if the window overrides
9506 ShouldInheritColours to return false, the colours will not be changed
9507 no matter what and only the font might.
9508
9509 This rather complicated logic is necessary in order to accommodate the
9510 different usage scenarios. The most common one is when all default
9511 attributes are used and in this case, nothing should be inherited as
9512 in modern GUIs different controls use different fonts (and colours)
9513 than their siblings so they can't inherit the same value from the
9514 parent. However it was also deemed desirable to allow to simply change
9515 the attributes of all children at once by just changing the font or
9516 colour of their common parent, hence in this case we do inherit the
9517 parents attributes.
9518
9519 """
9520 return _core_.Window_InheritAttributes(*args, **kwargs)
9521
9522 def ShouldInheritColours(*args, **kwargs):
9523 """
9524 ShouldInheritColours(self) -> bool
9525
9526 Return true from here to allow the colours of this window to be
9527 changed by InheritAttributes, returning false forbids inheriting them
9528 from the parent window.
9529
9530 The base class version returns false, but this method is overridden in
9531 wxControl where it returns true.
9532 """
9533 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9534
9535 def PostCreate(self, pre):
9536 """
9537 Phase 3 of the 2-phase create <wink!>
9538 Call this method after precreating the window with the 2-phase create method.
9539 """
9540 self.this = pre.this
9541 self.thisown = pre.thisown
9542 pre.thisown = 0
9543 if hasattr(self, '_setOORInfo'):
9544 self._setOORInfo(self)
9545 if hasattr(self, '_setCallbackInfo'):
9546 self._setCallbackInfo(self, self.__class__)
9547
9548 def SendSizeEvent(self):
9549 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9550
9551 Window_swigregister = _core_.Window_swigregister
9552 Window_swigregister(Window)
9553
9554 def PreWindow(*args, **kwargs):
9555 """
9556 PreWindow() -> Window
9557
9558 Precreate a Window for 2-phase creation.
9559 """
9560 val = _core_.new_PreWindow(*args, **kwargs)
9561 return val
9562
9563 def Window_NewControlId(*args):
9564 """
9565 Window_NewControlId() -> int
9566
9567 Generate a control id for the controls which were not given one.
9568 """
9569 return _core_.Window_NewControlId(*args)
9570
9571 def Window_NextControlId(*args, **kwargs):
9572 """
9573 Window_NextControlId(int winid) -> int
9574
9575 Get the id of the control following the one with the given
9576 autogenerated) id
9577 """
9578 return _core_.Window_NextControlId(*args, **kwargs)
9579
9580 def Window_PrevControlId(*args, **kwargs):
9581 """
9582 Window_PrevControlId(int winid) -> int
9583
9584 Get the id of the control preceding the one with the given
9585 autogenerated) id
9586 """
9587 return _core_.Window_PrevControlId(*args, **kwargs)
9588
9589 def Window_FindFocus(*args):
9590 """
9591 Window_FindFocus() -> Window
9592
9593 Returns the window or control that currently has the keyboard focus,
9594 or None.
9595 """
9596 return _core_.Window_FindFocus(*args)
9597
9598 def Window_GetCapture(*args):
9599 """
9600 Window_GetCapture() -> Window
9601
9602 Returns the window which currently captures the mouse or None
9603 """
9604 return _core_.Window_GetCapture(*args)
9605
9606 def Window_GetClassDefaultAttributes(*args, **kwargs):
9607 """
9608 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9609
9610 Get the default attributes for this class. This is useful if you want
9611 to use the same font or colour in your own control as in a standard
9612 control -- which is a much better idea than hard coding specific
9613 colours or fonts which might look completely out of place on the
9614 user's system, especially if it uses themes.
9615
9616 The variant parameter is only relevant under Mac currently and is
9617 ignore under other platforms. Under Mac, it will change the size of
9618 the returned font. See `wx.Window.SetWindowVariant` for more about
9619 this.
9620 """
9621 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9622
9623 def DLG_PNT(win, point_or_x, y=None):
9624 """
9625 Convenience function for converting a Point or (x,y) in
9626 dialog units to pixel units.
9627 """
9628 if y is None:
9629 return win.ConvertDialogPointToPixels(point_or_x)
9630 else:
9631 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9632
9633 def DLG_SZE(win, size_width, height=None):
9634 """
9635 Convenience function for converting a Size or (w,h) in
9636 dialog units to pixel units.
9637 """
9638 if height is None:
9639 return win.ConvertDialogSizeToPixels(size_width)
9640 else:
9641 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9642
9643
9644 def FindWindowById(*args, **kwargs):
9645 """
9646 FindWindowById(long id, Window parent=None) -> Window
9647
9648 Find the first window in the application with the given id. If parent
9649 is None, the search will start from all top-level frames and dialog
9650 boxes; if non-None, the search will be limited to the given window
9651 hierarchy. The search is recursive in both cases.
9652 """
9653 return _core_.FindWindowById(*args, **kwargs)
9654
9655 def FindWindowByName(*args, **kwargs):
9656 """
9657 FindWindowByName(String name, Window parent=None) -> Window
9658
9659 Find a window by its name (as given in a window constructor or Create
9660 function call). If parent is None, the search will start from all
9661 top-level frames and dialog boxes; if non-None, the search will be
9662 limited to the given window hierarchy. The search is recursive in both
9663 cases.
9664
9665 If no window with such name is found, wx.FindWindowByLabel is called.
9666 """
9667 return _core_.FindWindowByName(*args, **kwargs)
9668
9669 def FindWindowByLabel(*args, **kwargs):
9670 """
9671 FindWindowByLabel(String label, Window parent=None) -> Window
9672
9673 Find a window by its label. Depending on the type of window, the label
9674 may be a window title or panel item label. If parent is None, the
9675 search will start from all top-level frames and dialog boxes; if
9676 non-None, the search will be limited to the given window
9677 hierarchy. The search is recursive in both cases.
9678 """
9679 return _core_.FindWindowByLabel(*args, **kwargs)
9680
9681 def Window_FromHWND(*args, **kwargs):
9682 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9683 return _core_.Window_FromHWND(*args, **kwargs)
9684
9685 def GetTopLevelWindows(*args):
9686 """
9687 GetTopLevelWindows() -> PyObject
9688
9689 Returns a list of the the application's top-level windows, (frames,
9690 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9691 by wxWidgets, and so it is only valid as long as no top-level windows
9692 are closed or new top-level windows are created.
9693
9694 """
9695 return _core_.GetTopLevelWindows(*args)
9696 #---------------------------------------------------------------------------
9697
9698 class Validator(EvtHandler):
9699 """Proxy of C++ Validator class"""
9700 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9701 __repr__ = _swig_repr
9702 def __init__(self, *args, **kwargs):
9703 """__init__(self) -> Validator"""
9704 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9705 self._setOORInfo(self)
9706
9707 def Clone(*args, **kwargs):
9708 """Clone(self) -> Validator"""
9709 return _core_.Validator_Clone(*args, **kwargs)
9710
9711 def Validate(*args, **kwargs):
9712 """Validate(self, Window parent) -> bool"""
9713 return _core_.Validator_Validate(*args, **kwargs)
9714
9715 def TransferToWindow(*args, **kwargs):
9716 """TransferToWindow(self) -> bool"""
9717 return _core_.Validator_TransferToWindow(*args, **kwargs)
9718
9719 def TransferFromWindow(*args, **kwargs):
9720 """TransferFromWindow(self) -> bool"""
9721 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9722
9723 def GetWindow(*args, **kwargs):
9724 """GetWindow(self) -> Window"""
9725 return _core_.Validator_GetWindow(*args, **kwargs)
9726
9727 def SetWindow(*args, **kwargs):
9728 """SetWindow(self, Window window)"""
9729 return _core_.Validator_SetWindow(*args, **kwargs)
9730
9731 def IsSilent(*args, **kwargs):
9732 """IsSilent() -> bool"""
9733 return _core_.Validator_IsSilent(*args, **kwargs)
9734
9735 IsSilent = staticmethod(IsSilent)
9736 def SetBellOnError(*args, **kwargs):
9737 """SetBellOnError(int doIt=True)"""
9738 return _core_.Validator_SetBellOnError(*args, **kwargs)
9739
9740 SetBellOnError = staticmethod(SetBellOnError)
9741 Validator_swigregister = _core_.Validator_swigregister
9742 Validator_swigregister(Validator)
9743
9744 def Validator_IsSilent(*args):
9745 """Validator_IsSilent() -> bool"""
9746 return _core_.Validator_IsSilent(*args)
9747
9748 def Validator_SetBellOnError(*args, **kwargs):
9749 """Validator_SetBellOnError(int doIt=True)"""
9750 return _core_.Validator_SetBellOnError(*args, **kwargs)
9751
9752 class PyValidator(Validator):
9753 """Proxy of C++ PyValidator class"""
9754 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9755 __repr__ = _swig_repr
9756 def __init__(self, *args, **kwargs):
9757 """__init__(self) -> PyValidator"""
9758 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9759
9760 self._setCallbackInfo(self, PyValidator, 1)
9761 self._setOORInfo(self)
9762
9763 def _setCallbackInfo(*args, **kwargs):
9764 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9765 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9766
9767 PyValidator_swigregister = _core_.PyValidator_swigregister
9768 PyValidator_swigregister(PyValidator)
9769
9770 #---------------------------------------------------------------------------
9771
9772 class Menu(EvtHandler):
9773 """Proxy of C++ Menu class"""
9774 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9775 __repr__ = _swig_repr
9776 def __init__(self, *args, **kwargs):
9777 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9778 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9779 self._setOORInfo(self)
9780
9781 def Append(*args, **kwargs):
9782 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9783 return _core_.Menu_Append(*args, **kwargs)
9784
9785 def AppendSeparator(*args, **kwargs):
9786 """AppendSeparator(self) -> MenuItem"""
9787 return _core_.Menu_AppendSeparator(*args, **kwargs)
9788
9789 def AppendCheckItem(*args, **kwargs):
9790 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9791 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9792
9793 def AppendRadioItem(*args, **kwargs):
9794 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9795 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9796
9797 def AppendMenu(*args, **kwargs):
9798 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9799 return _core_.Menu_AppendMenu(*args, **kwargs)
9800
9801 def AppendItem(*args, **kwargs):
9802 """AppendItem(self, MenuItem item) -> MenuItem"""
9803 return _core_.Menu_AppendItem(*args, **kwargs)
9804
9805 def InsertItem(*args, **kwargs):
9806 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9807 return _core_.Menu_InsertItem(*args, **kwargs)
9808
9809 def PrependItem(*args, **kwargs):
9810 """PrependItem(self, MenuItem item) -> MenuItem"""
9811 return _core_.Menu_PrependItem(*args, **kwargs)
9812
9813 def Break(*args, **kwargs):
9814 """Break(self)"""
9815 return _core_.Menu_Break(*args, **kwargs)
9816
9817 def Insert(*args, **kwargs):
9818 """
9819 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9820 int kind=ITEM_NORMAL) -> MenuItem
9821 """
9822 return _core_.Menu_Insert(*args, **kwargs)
9823
9824 def InsertSeparator(*args, **kwargs):
9825 """InsertSeparator(self, size_t pos) -> MenuItem"""
9826 return _core_.Menu_InsertSeparator(*args, **kwargs)
9827
9828 def InsertCheckItem(*args, **kwargs):
9829 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9830 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9831
9832 def InsertRadioItem(*args, **kwargs):
9833 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9834 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9835
9836 def InsertMenu(*args, **kwargs):
9837 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9838 return _core_.Menu_InsertMenu(*args, **kwargs)
9839
9840 def Prepend(*args, **kwargs):
9841 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9842 return _core_.Menu_Prepend(*args, **kwargs)
9843
9844 def PrependSeparator(*args, **kwargs):
9845 """PrependSeparator(self) -> MenuItem"""
9846 return _core_.Menu_PrependSeparator(*args, **kwargs)
9847
9848 def PrependCheckItem(*args, **kwargs):
9849 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9850 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9851
9852 def PrependRadioItem(*args, **kwargs):
9853 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9854 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9855
9856 def PrependMenu(*args, **kwargs):
9857 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9858 return _core_.Menu_PrependMenu(*args, **kwargs)
9859
9860 def Remove(*args, **kwargs):
9861 """Remove(self, int id) -> MenuItem"""
9862 return _core_.Menu_Remove(*args, **kwargs)
9863
9864 def RemoveItem(*args, **kwargs):
9865 """RemoveItem(self, MenuItem item) -> MenuItem"""
9866 return _core_.Menu_RemoveItem(*args, **kwargs)
9867
9868 def Delete(*args, **kwargs):
9869 """Delete(self, int id) -> bool"""
9870 return _core_.Menu_Delete(*args, **kwargs)
9871
9872 def DeleteItem(*args, **kwargs):
9873 """DeleteItem(self, MenuItem item) -> bool"""
9874 return _core_.Menu_DeleteItem(*args, **kwargs)
9875
9876 def Destroy(*args, **kwargs):
9877 """
9878 Destroy(self)
9879
9880 Deletes the C++ object this Python object is a proxy for.
9881 """
9882 val = _core_.Menu_Destroy(*args, **kwargs)
9883 args[0].thisown = 0
9884 return val
9885
9886 def DestroyId(*args, **kwargs):
9887 """
9888 DestroyId(self, int id) -> bool
9889
9890 Deletes the C++ object this Python object is a proxy for.
9891 """
9892 val = _core_.Menu_DestroyId(*args, **kwargs)
9893 args[0].thisown = 0
9894 return val
9895
9896 def DestroyItem(*args, **kwargs):
9897 """
9898 DestroyItem(self, MenuItem item) -> bool
9899
9900 Deletes the C++ object this Python object is a proxy for.
9901 """
9902 val = _core_.Menu_DestroyItem(*args, **kwargs)
9903 args[0].thisown = 0
9904 return val
9905
9906 def GetMenuItemCount(*args, **kwargs):
9907 """GetMenuItemCount(self) -> size_t"""
9908 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9909
9910 def GetMenuItems(*args, **kwargs):
9911 """GetMenuItems(self) -> PyObject"""
9912 return _core_.Menu_GetMenuItems(*args, **kwargs)
9913
9914 def FindItem(*args, **kwargs):
9915 """FindItem(self, String item) -> int"""
9916 return _core_.Menu_FindItem(*args, **kwargs)
9917
9918 def FindItemById(*args, **kwargs):
9919 """FindItemById(self, int id) -> MenuItem"""
9920 return _core_.Menu_FindItemById(*args, **kwargs)
9921
9922 def FindItemByPosition(*args, **kwargs):
9923 """FindItemByPosition(self, size_t position) -> MenuItem"""
9924 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9925
9926 def Enable(*args, **kwargs):
9927 """Enable(self, int id, bool enable)"""
9928 return _core_.Menu_Enable(*args, **kwargs)
9929
9930 def IsEnabled(*args, **kwargs):
9931 """IsEnabled(self, int id) -> bool"""
9932 return _core_.Menu_IsEnabled(*args, **kwargs)
9933
9934 def Check(*args, **kwargs):
9935 """Check(self, int id, bool check)"""
9936 return _core_.Menu_Check(*args, **kwargs)
9937
9938 def IsChecked(*args, **kwargs):
9939 """IsChecked(self, int id) -> bool"""
9940 return _core_.Menu_IsChecked(*args, **kwargs)
9941
9942 def SetLabel(*args, **kwargs):
9943 """SetLabel(self, int id, String label)"""
9944 return _core_.Menu_SetLabel(*args, **kwargs)
9945
9946 def GetLabel(*args, **kwargs):
9947 """GetLabel(self, int id) -> String"""
9948 return _core_.Menu_GetLabel(*args, **kwargs)
9949
9950 def SetHelpString(*args, **kwargs):
9951 """SetHelpString(self, int id, String helpString)"""
9952 return _core_.Menu_SetHelpString(*args, **kwargs)
9953
9954 def GetHelpString(*args, **kwargs):
9955 """GetHelpString(self, int id) -> String"""
9956 return _core_.Menu_GetHelpString(*args, **kwargs)
9957
9958 def SetTitle(*args, **kwargs):
9959 """SetTitle(self, String title)"""
9960 return _core_.Menu_SetTitle(*args, **kwargs)
9961
9962 def GetTitle(*args, **kwargs):
9963 """GetTitle(self) -> String"""
9964 return _core_.Menu_GetTitle(*args, **kwargs)
9965
9966 def SetEventHandler(*args, **kwargs):
9967 """SetEventHandler(self, EvtHandler handler)"""
9968 return _core_.Menu_SetEventHandler(*args, **kwargs)
9969
9970 def GetEventHandler(*args, **kwargs):
9971 """GetEventHandler(self) -> EvtHandler"""
9972 return _core_.Menu_GetEventHandler(*args, **kwargs)
9973
9974 def SetInvokingWindow(*args, **kwargs):
9975 """SetInvokingWindow(self, Window win)"""
9976 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9977
9978 def GetInvokingWindow(*args, **kwargs):
9979 """GetInvokingWindow(self) -> Window"""
9980 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9981
9982 def GetStyle(*args, **kwargs):
9983 """GetStyle(self) -> long"""
9984 return _core_.Menu_GetStyle(*args, **kwargs)
9985
9986 def UpdateUI(*args, **kwargs):
9987 """UpdateUI(self, EvtHandler source=None)"""
9988 return _core_.Menu_UpdateUI(*args, **kwargs)
9989
9990 def GetMenuBar(*args, **kwargs):
9991 """GetMenuBar(self) -> MenuBar"""
9992 return _core_.Menu_GetMenuBar(*args, **kwargs)
9993
9994 def Attach(*args, **kwargs):
9995 """Attach(self, wxMenuBarBase menubar)"""
9996 return _core_.Menu_Attach(*args, **kwargs)
9997
9998 def Detach(*args, **kwargs):
9999 """Detach(self)"""
10000 return _core_.Menu_Detach(*args, **kwargs)
10001
10002 def IsAttached(*args, **kwargs):
10003 """IsAttached(self) -> bool"""
10004 return _core_.Menu_IsAttached(*args, **kwargs)
10005
10006 def SetParent(*args, **kwargs):
10007 """SetParent(self, Menu parent)"""
10008 return _core_.Menu_SetParent(*args, **kwargs)
10009
10010 def GetParent(*args, **kwargs):
10011 """GetParent(self) -> Menu"""
10012 return _core_.Menu_GetParent(*args, **kwargs)
10013
10014 Menu_swigregister = _core_.Menu_swigregister
10015 Menu_swigregister(Menu)
10016 DefaultValidator = cvar.DefaultValidator
10017
10018 #---------------------------------------------------------------------------
10019
10020 class MenuBar(Window):
10021 """Proxy of C++ MenuBar class"""
10022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10023 __repr__ = _swig_repr
10024 def __init__(self, *args, **kwargs):
10025 """__init__(self, long style=0) -> MenuBar"""
10026 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10027 self._setOORInfo(self)
10028
10029 def Append(*args, **kwargs):
10030 """Append(self, Menu menu, String title) -> bool"""
10031 return _core_.MenuBar_Append(*args, **kwargs)
10032
10033 def Insert(*args, **kwargs):
10034 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10035 return _core_.MenuBar_Insert(*args, **kwargs)
10036
10037 def GetMenuCount(*args, **kwargs):
10038 """GetMenuCount(self) -> size_t"""
10039 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10040
10041 def GetMenu(*args, **kwargs):
10042 """GetMenu(self, size_t pos) -> Menu"""
10043 return _core_.MenuBar_GetMenu(*args, **kwargs)
10044
10045 def Replace(*args, **kwargs):
10046 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10047 return _core_.MenuBar_Replace(*args, **kwargs)
10048
10049 def Remove(*args, **kwargs):
10050 """Remove(self, size_t pos) -> Menu"""
10051 return _core_.MenuBar_Remove(*args, **kwargs)
10052
10053 def EnableTop(*args, **kwargs):
10054 """EnableTop(self, size_t pos, bool enable)"""
10055 return _core_.MenuBar_EnableTop(*args, **kwargs)
10056
10057 def IsEnabledTop(*args, **kwargs):
10058 """IsEnabledTop(self, size_t pos) -> bool"""
10059 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10060
10061 def SetLabelTop(*args, **kwargs):
10062 """SetLabelTop(self, size_t pos, String label)"""
10063 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10064
10065 def GetLabelTop(*args, **kwargs):
10066 """GetLabelTop(self, size_t pos) -> String"""
10067 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10068
10069 def FindMenuItem(*args, **kwargs):
10070 """FindMenuItem(self, String menu, String item) -> int"""
10071 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10072
10073 def FindItemById(*args, **kwargs):
10074 """FindItemById(self, int id) -> MenuItem"""
10075 return _core_.MenuBar_FindItemById(*args, **kwargs)
10076
10077 def FindMenu(*args, **kwargs):
10078 """FindMenu(self, String title) -> int"""
10079 return _core_.MenuBar_FindMenu(*args, **kwargs)
10080
10081 def Enable(*args, **kwargs):
10082 """Enable(self, int id, bool enable)"""
10083 return _core_.MenuBar_Enable(*args, **kwargs)
10084
10085 def Check(*args, **kwargs):
10086 """Check(self, int id, bool check)"""
10087 return _core_.MenuBar_Check(*args, **kwargs)
10088
10089 def IsChecked(*args, **kwargs):
10090 """IsChecked(self, int id) -> bool"""
10091 return _core_.MenuBar_IsChecked(*args, **kwargs)
10092
10093 def IsEnabled(*args, **kwargs):
10094 """IsEnabled(self, int id) -> bool"""
10095 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10096
10097 def SetLabel(*args, **kwargs):
10098 """SetLabel(self, int id, String label)"""
10099 return _core_.MenuBar_SetLabel(*args, **kwargs)
10100
10101 def GetLabel(*args, **kwargs):
10102 """GetLabel(self, int id) -> String"""
10103 return _core_.MenuBar_GetLabel(*args, **kwargs)
10104
10105 def SetHelpString(*args, **kwargs):
10106 """SetHelpString(self, int id, String helpString)"""
10107 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10108
10109 def GetHelpString(*args, **kwargs):
10110 """GetHelpString(self, int id) -> String"""
10111 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10112
10113 def GetFrame(*args, **kwargs):
10114 """GetFrame(self) -> wxFrame"""
10115 return _core_.MenuBar_GetFrame(*args, **kwargs)
10116
10117 def IsAttached(*args, **kwargs):
10118 """IsAttached(self) -> bool"""
10119 return _core_.MenuBar_IsAttached(*args, **kwargs)
10120
10121 def Attach(*args, **kwargs):
10122 """Attach(self, wxFrame frame)"""
10123 return _core_.MenuBar_Attach(*args, **kwargs)
10124
10125 def Detach(*args, **kwargs):
10126 """Detach(self)"""
10127 return _core_.MenuBar_Detach(*args, **kwargs)
10128
10129 def SetAutoWindowMenu(*args, **kwargs):
10130 """SetAutoWindowMenu(bool enable)"""
10131 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10132
10133 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10134 def GetAutoWindowMenu(*args, **kwargs):
10135 """GetAutoWindowMenu() -> bool"""
10136 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10137
10138 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10139 MenuBar_swigregister = _core_.MenuBar_swigregister
10140 MenuBar_swigregister(MenuBar)
10141
10142 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10143 """MenuBar_SetAutoWindowMenu(bool enable)"""
10144 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10145
10146 def MenuBar_GetAutoWindowMenu(*args):
10147 """MenuBar_GetAutoWindowMenu() -> bool"""
10148 return _core_.MenuBar_GetAutoWindowMenu(*args)
10149
10150 #---------------------------------------------------------------------------
10151
10152 class MenuItem(Object):
10153 """Proxy of C++ MenuItem class"""
10154 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10155 __repr__ = _swig_repr
10156 def __init__(self, *args, **kwargs):
10157 """
10158 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10159 String help=EmptyString, int kind=ITEM_NORMAL,
10160 Menu subMenu=None) -> MenuItem
10161 """
10162 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10163 __swig_destroy__ = _core_.delete_MenuItem
10164 __del__ = lambda self : None;
10165 def GetMenu(*args, **kwargs):
10166 """GetMenu(self) -> Menu"""
10167 return _core_.MenuItem_GetMenu(*args, **kwargs)
10168
10169 def SetMenu(*args, **kwargs):
10170 """SetMenu(self, Menu menu)"""
10171 return _core_.MenuItem_SetMenu(*args, **kwargs)
10172
10173 def SetId(*args, **kwargs):
10174 """SetId(self, int id)"""
10175 return _core_.MenuItem_SetId(*args, **kwargs)
10176
10177 def GetId(*args, **kwargs):
10178 """GetId(self) -> int"""
10179 return _core_.MenuItem_GetId(*args, **kwargs)
10180
10181 def IsSeparator(*args, **kwargs):
10182 """IsSeparator(self) -> bool"""
10183 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10184
10185 def SetText(*args, **kwargs):
10186 """SetText(self, String str)"""
10187 return _core_.MenuItem_SetText(*args, **kwargs)
10188
10189 def GetLabel(*args, **kwargs):
10190 """GetLabel(self) -> String"""
10191 return _core_.MenuItem_GetLabel(*args, **kwargs)
10192
10193 def GetText(*args, **kwargs):
10194 """GetText(self) -> String"""
10195 return _core_.MenuItem_GetText(*args, **kwargs)
10196
10197 def GetLabelFromText(*args, **kwargs):
10198 """GetLabelFromText(String text) -> String"""
10199 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10200
10201 GetLabelFromText = staticmethod(GetLabelFromText)
10202 def GetKind(*args, **kwargs):
10203 """GetKind(self) -> int"""
10204 return _core_.MenuItem_GetKind(*args, **kwargs)
10205
10206 def SetKind(*args, **kwargs):
10207 """SetKind(self, int kind)"""
10208 return _core_.MenuItem_SetKind(*args, **kwargs)
10209
10210 def SetCheckable(*args, **kwargs):
10211 """SetCheckable(self, bool checkable)"""
10212 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10213
10214 def IsCheckable(*args, **kwargs):
10215 """IsCheckable(self) -> bool"""
10216 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10217
10218 def IsSubMenu(*args, **kwargs):
10219 """IsSubMenu(self) -> bool"""
10220 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10221
10222 def SetSubMenu(*args, **kwargs):
10223 """SetSubMenu(self, Menu menu)"""
10224 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10225
10226 def GetSubMenu(*args, **kwargs):
10227 """GetSubMenu(self) -> Menu"""
10228 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10229
10230 def Enable(*args, **kwargs):
10231 """Enable(self, bool enable=True)"""
10232 return _core_.MenuItem_Enable(*args, **kwargs)
10233
10234 def IsEnabled(*args, **kwargs):
10235 """IsEnabled(self) -> bool"""
10236 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10237
10238 def Check(*args, **kwargs):
10239 """Check(self, bool check=True)"""
10240 return _core_.MenuItem_Check(*args, **kwargs)
10241
10242 def IsChecked(*args, **kwargs):
10243 """IsChecked(self) -> bool"""
10244 return _core_.MenuItem_IsChecked(*args, **kwargs)
10245
10246 def Toggle(*args, **kwargs):
10247 """Toggle(self)"""
10248 return _core_.MenuItem_Toggle(*args, **kwargs)
10249
10250 def SetHelp(*args, **kwargs):
10251 """SetHelp(self, String str)"""
10252 return _core_.MenuItem_SetHelp(*args, **kwargs)
10253
10254 def GetHelp(*args, **kwargs):
10255 """GetHelp(self) -> String"""
10256 return _core_.MenuItem_GetHelp(*args, **kwargs)
10257
10258 def GetAccel(*args, **kwargs):
10259 """GetAccel(self) -> AcceleratorEntry"""
10260 return _core_.MenuItem_GetAccel(*args, **kwargs)
10261
10262 def SetAccel(*args, **kwargs):
10263 """SetAccel(self, AcceleratorEntry accel)"""
10264 return _core_.MenuItem_SetAccel(*args, **kwargs)
10265
10266 def SetBitmap(*args, **kwargs):
10267 """SetBitmap(self, Bitmap bitmap)"""
10268 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10269
10270 def GetBitmap(*args, **kwargs):
10271 """GetBitmap(self) -> Bitmap"""
10272 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10273
10274 def SetFont(*args, **kwargs):
10275 """SetFont(self, Font font)"""
10276 return _core_.MenuItem_SetFont(*args, **kwargs)
10277
10278 def GetFont(*args, **kwargs):
10279 """GetFont(self) -> Font"""
10280 return _core_.MenuItem_GetFont(*args, **kwargs)
10281
10282 def SetTextColour(*args, **kwargs):
10283 """SetTextColour(self, Colour colText)"""
10284 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10285
10286 def GetTextColour(*args, **kwargs):
10287 """GetTextColour(self) -> Colour"""
10288 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10289
10290 def SetBackgroundColour(*args, **kwargs):
10291 """SetBackgroundColour(self, Colour colBack)"""
10292 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10293
10294 def GetBackgroundColour(*args, **kwargs):
10295 """GetBackgroundColour(self) -> Colour"""
10296 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10297
10298 def SetBitmaps(*args, **kwargs):
10299 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10300 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10301
10302 def SetDisabledBitmap(*args, **kwargs):
10303 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10304 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10305
10306 def GetDisabledBitmap(*args, **kwargs):
10307 """GetDisabledBitmap(self) -> Bitmap"""
10308 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10309
10310 def SetMarginWidth(*args, **kwargs):
10311 """SetMarginWidth(self, int nWidth)"""
10312 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10313
10314 def GetMarginWidth(*args, **kwargs):
10315 """GetMarginWidth(self) -> int"""
10316 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10317
10318 def GetDefaultMarginWidth(*args, **kwargs):
10319 """GetDefaultMarginWidth() -> int"""
10320 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10321
10322 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10323 def IsOwnerDrawn(*args, **kwargs):
10324 """IsOwnerDrawn(self) -> bool"""
10325 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10326
10327 def SetOwnerDrawn(*args, **kwargs):
10328 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10329 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10330
10331 def ResetOwnerDrawn(*args, **kwargs):
10332 """ResetOwnerDrawn(self)"""
10333 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10334
10335 MenuItem_swigregister = _core_.MenuItem_swigregister
10336 MenuItem_swigregister(MenuItem)
10337
10338 def MenuItem_GetLabelFromText(*args, **kwargs):
10339 """MenuItem_GetLabelFromText(String text) -> String"""
10340 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10341
10342 def MenuItem_GetDefaultMarginWidth(*args):
10343 """MenuItem_GetDefaultMarginWidth() -> int"""
10344 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10345
10346 #---------------------------------------------------------------------------
10347
10348 class Control(Window):
10349 """
10350 This is the base class for a control or 'widget'.
10351
10352 A control is generally a small window which processes user input
10353 and/or displays one or more item of data.
10354 """
10355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10356 __repr__ = _swig_repr
10357 def __init__(self, *args, **kwargs):
10358 """
10359 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10360 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10361 String name=ControlNameStr) -> Control
10362
10363 Create a Control. Normally you should only call this from a subclass'
10364 __init__ as a plain old wx.Control is not very useful.
10365 """
10366 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10367 self._setOORInfo(self)
10368
10369 def Create(*args, **kwargs):
10370 """
10371 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10372 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10373 String name=ControlNameStr) -> bool
10374
10375 Do the 2nd phase and create the GUI control.
10376 """
10377 return _core_.Control_Create(*args, **kwargs)
10378
10379 def Command(*args, **kwargs):
10380 """
10381 Command(self, CommandEvent event)
10382
10383 Simulates the effect of the user issuing a command to the item.
10384
10385 :see: `wx.CommandEvent`
10386
10387 """
10388 return _core_.Control_Command(*args, **kwargs)
10389
10390 def GetLabel(*args, **kwargs):
10391 """
10392 GetLabel(self) -> String
10393
10394 Return a control's text.
10395 """
10396 return _core_.Control_GetLabel(*args, **kwargs)
10397
10398 def GetClassDefaultAttributes(*args, **kwargs):
10399 """
10400 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10401
10402 Get the default attributes for this class. This is useful if you want
10403 to use the same font or colour in your own control as in a standard
10404 control -- which is a much better idea than hard coding specific
10405 colours or fonts which might look completely out of place on the
10406 user's system, especially if it uses themes.
10407
10408 The variant parameter is only relevant under Mac currently and is
10409 ignore under other platforms. Under Mac, it will change the size of
10410 the returned font. See `wx.Window.SetWindowVariant` for more about
10411 this.
10412 """
10413 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10414
10415 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10416 Control_swigregister = _core_.Control_swigregister
10417 Control_swigregister(Control)
10418 ControlNameStr = cvar.ControlNameStr
10419
10420 def PreControl(*args, **kwargs):
10421 """
10422 PreControl() -> Control
10423
10424 Precreate a Control control for 2-phase creation
10425 """
10426 val = _core_.new_PreControl(*args, **kwargs)
10427 return val
10428
10429 def Control_GetClassDefaultAttributes(*args, **kwargs):
10430 """
10431 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10432
10433 Get the default attributes for this class. This is useful if you want
10434 to use the same font or colour in your own control as in a standard
10435 control -- which is a much better idea than hard coding specific
10436 colours or fonts which might look completely out of place on the
10437 user's system, especially if it uses themes.
10438
10439 The variant parameter is only relevant under Mac currently and is
10440 ignore under other platforms. Under Mac, it will change the size of
10441 the returned font. See `wx.Window.SetWindowVariant` for more about
10442 this.
10443 """
10444 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10445
10446 #---------------------------------------------------------------------------
10447
10448 class ItemContainer(object):
10449 """
10450 The wx.ItemContainer class defines an interface which is implemented
10451 by all controls which have string subitems, each of which may be
10452 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10453 as `wx.ComboBox` which implements an extended interface deriving from
10454 this one.
10455
10456 It defines the methods for accessing the control's items and although
10457 each of the derived classes implements them differently, they still
10458 all conform to the same interface.
10459
10460 The items in a wx.ItemContainer have (non empty) string labels and,
10461 optionally, client data associated with them.
10462
10463 """
10464 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10465 def __init__(self): raise AttributeError, "No constructor defined"
10466 __repr__ = _swig_repr
10467 def Append(*args, **kwargs):
10468 """
10469 Append(self, String item, PyObject clientData=None) -> int
10470
10471 Adds the item to the control, associating the given data with the item
10472 if not None. The return value is the index of the newly added item
10473 which may be different from the last one if the control is sorted (e.g.
10474 has wx.LB_SORT or wx.CB_SORT style).
10475 """
10476 return _core_.ItemContainer_Append(*args, **kwargs)
10477
10478 def AppendItems(*args, **kwargs):
10479 """
10480 AppendItems(self, List strings)
10481
10482 Apend several items at once to the control. Notice that calling this
10483 method may be much faster than appending the items one by one if you
10484 need to add a lot of items.
10485 """
10486 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10487
10488 def Insert(*args, **kwargs):
10489 """
10490 Insert(self, String item, int pos, PyObject clientData=None) -> int
10491
10492 Insert an item into the control before the item at the ``pos`` index,
10493 optionally associating some data object with the item.
10494 """
10495 return _core_.ItemContainer_Insert(*args, **kwargs)
10496
10497 def Clear(*args, **kwargs):
10498 """
10499 Clear(self)
10500
10501 Removes all items from the control.
10502 """
10503 return _core_.ItemContainer_Clear(*args, **kwargs)
10504
10505 def Delete(*args, **kwargs):
10506 """
10507 Delete(self, int n)
10508
10509 Deletes the item at the zero-based index 'n' from the control. Note
10510 that it is an error (signalled by a `wx.PyAssertionError` exception if
10511 enabled) to remove an item with the index negative or greater or equal
10512 than the number of items in the control.
10513 """
10514 return _core_.ItemContainer_Delete(*args, **kwargs)
10515
10516 def GetClientData(*args, **kwargs):
10517 """
10518 GetClientData(self, int n) -> PyObject
10519
10520 Returns the client data associated with the given item, (if any.)
10521 """
10522 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10523
10524 def SetClientData(*args, **kwargs):
10525 """
10526 SetClientData(self, int n, PyObject clientData)
10527
10528 Associate the given client data with the item at position n.
10529 """
10530 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10531
10532 def GetCount(*args, **kwargs):
10533 """
10534 GetCount(self) -> int
10535
10536 Returns the number of items in the control.
10537 """
10538 return _core_.ItemContainer_GetCount(*args, **kwargs)
10539
10540 def IsEmpty(*args, **kwargs):
10541 """
10542 IsEmpty(self) -> bool
10543
10544 Returns True if the control is empty or False if it has some items.
10545 """
10546 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10547
10548 def GetString(*args, **kwargs):
10549 """
10550 GetString(self, int n) -> String
10551
10552 Returns the label of the item with the given index.
10553 """
10554 return _core_.ItemContainer_GetString(*args, **kwargs)
10555
10556 def GetStrings(*args, **kwargs):
10557 """GetStrings(self) -> wxArrayString"""
10558 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10559
10560 def SetString(*args, **kwargs):
10561 """
10562 SetString(self, int n, String s)
10563
10564 Sets the label for the given item.
10565 """
10566 return _core_.ItemContainer_SetString(*args, **kwargs)
10567
10568 def FindString(*args, **kwargs):
10569 """
10570 FindString(self, String s) -> int
10571
10572 Finds an item whose label matches the given string. Returns the
10573 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10574 found.
10575 """
10576 return _core_.ItemContainer_FindString(*args, **kwargs)
10577
10578 def SetSelection(*args, **kwargs):
10579 """
10580 SetSelection(self, int n)
10581
10582 Sets the item at index 'n' to be the selected item.
10583 """
10584 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10585
10586 def GetSelection(*args, **kwargs):
10587 """
10588 GetSelection(self) -> int
10589
10590 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10591 is selected.
10592 """
10593 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10594
10595 def SetStringSelection(*args, **kwargs):
10596 """SetStringSelection(self, String s) -> bool"""
10597 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10598
10599 def GetStringSelection(*args, **kwargs):
10600 """
10601 GetStringSelection(self) -> String
10602
10603 Returns the label of the selected item or an empty string if no item
10604 is selected.
10605 """
10606 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10607
10608 def Select(*args, **kwargs):
10609 """
10610 Select(self, int n)
10611
10612 This is the same as `SetSelection` and exists only because it is
10613 slightly more natural for controls which support multiple selection.
10614 """
10615 return _core_.ItemContainer_Select(*args, **kwargs)
10616
10617 ItemContainer_swigregister = _core_.ItemContainer_swigregister
10618 ItemContainer_swigregister(ItemContainer)
10619
10620 #---------------------------------------------------------------------------
10621
10622 class ControlWithItems(Control,ItemContainer):
10623 """
10624 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10625 wx.Control class, and is used for the base class of various controls
10626 that have items.
10627 """
10628 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10629 def __init__(self): raise AttributeError, "No constructor defined"
10630 __repr__ = _swig_repr
10631 ControlWithItems_swigregister = _core_.ControlWithItems_swigregister
10632 ControlWithItems_swigregister(ControlWithItems)
10633
10634 #---------------------------------------------------------------------------
10635
10636 class SizerItem(Object):
10637 """
10638 The wx.SizerItem class is used to track the position, size and other
10639 attributes of each item managed by a `wx.Sizer`. In normal usage user
10640 code should never need to deal directly with a wx.SizerItem, but
10641 custom classes derived from `wx.PySizer` will probably need to use the
10642 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10643
10644 :see: `wx.Sizer`, `wx.GBSizerItem`
10645 """
10646 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10647 __repr__ = _swig_repr
10648 def __init__(self, *args, **kwargs):
10649 """
10650 __init__(self) -> SizerItem
10651
10652 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10653 size will need to be set before this item can be used in a Sizer.
10654
10655 You will probably never need to create a wx.SizerItem directly as they
10656 are created automatically when the sizer's Add, Insert or Prepend
10657 methods are called.
10658
10659 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10660 """
10661 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10662 __swig_destroy__ = _core_.delete_SizerItem
10663 __del__ = lambda self : None;
10664 def DeleteWindows(*args, **kwargs):
10665 """
10666 DeleteWindows(self)
10667
10668 Destroy the window or the windows in a subsizer, depending on the type
10669 of item.
10670 """
10671 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10672
10673 def DetachSizer(*args, **kwargs):
10674 """
10675 DetachSizer(self)
10676
10677 Enable deleting the SizerItem without destroying the contained sizer.
10678 """
10679 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10680
10681 def GetSize(*args, **kwargs):
10682 """
10683 GetSize(self) -> Size
10684
10685 Get the current size of the item, as set in the last Layout.
10686 """
10687 return _core_.SizerItem_GetSize(*args, **kwargs)
10688
10689 def CalcMin(*args, **kwargs):
10690 """
10691 CalcMin(self) -> Size
10692
10693 Calculates the minimum desired size for the item, including any space
10694 needed by borders.
10695 """
10696 return _core_.SizerItem_CalcMin(*args, **kwargs)
10697
10698 def SetDimension(*args, **kwargs):
10699 """
10700 SetDimension(self, Point pos, Size size)
10701
10702 Set the position and size of the space allocated for this item by the
10703 sizer, and adjust the position and size of the item (window or
10704 subsizer) to be within that space taking alignment and borders into
10705 account.
10706 """
10707 return _core_.SizerItem_SetDimension(*args, **kwargs)
10708
10709 def GetMinSize(*args, **kwargs):
10710 """
10711 GetMinSize(self) -> Size
10712
10713 Get the minimum size needed for the item.
10714 """
10715 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10716
10717 def GetMinSizeWithBorder(*args, **kwargs):
10718 """
10719 GetMinSizeWithBorder(self) -> Size
10720
10721 Get the minimum size needed for the item with space for the borders
10722 added, if needed.
10723 """
10724 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10725
10726 def SetInitSize(*args, **kwargs):
10727 """SetInitSize(self, int x, int y)"""
10728 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10729
10730 def SetRatioWH(*args, **kwargs):
10731 """
10732 SetRatioWH(self, int width, int height)
10733
10734 Set the ratio item attribute.
10735 """
10736 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10737
10738 def SetRatioSize(*args, **kwargs):
10739 """
10740 SetRatioSize(self, Size size)
10741
10742 Set the ratio item attribute.
10743 """
10744 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10745
10746 def SetRatio(*args, **kwargs):
10747 """
10748 SetRatio(self, float ratio)
10749
10750 Set the ratio item attribute.
10751 """
10752 return _core_.SizerItem_SetRatio(*args, **kwargs)
10753
10754 def GetRatio(*args, **kwargs):
10755 """
10756 GetRatio(self) -> float
10757
10758 Set the ratio item attribute.
10759 """
10760 return _core_.SizerItem_GetRatio(*args, **kwargs)
10761
10762 def GetRect(*args, **kwargs):
10763 """
10764 GetRect(self) -> Rect
10765
10766 Returns the rectangle that the sizer item should occupy
10767 """
10768 return _core_.SizerItem_GetRect(*args, **kwargs)
10769
10770 def IsWindow(*args, **kwargs):
10771 """
10772 IsWindow(self) -> bool
10773
10774 Is this sizer item a window?
10775 """
10776 return _core_.SizerItem_IsWindow(*args, **kwargs)
10777
10778 def IsSizer(*args, **kwargs):
10779 """
10780 IsSizer(self) -> bool
10781
10782 Is this sizer item a subsizer?
10783 """
10784 return _core_.SizerItem_IsSizer(*args, **kwargs)
10785
10786 def IsSpacer(*args, **kwargs):
10787 """
10788 IsSpacer(self) -> bool
10789
10790 Is this sizer item a spacer?
10791 """
10792 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10793
10794 def SetProportion(*args, **kwargs):
10795 """
10796 SetProportion(self, int proportion)
10797
10798 Set the proportion value for this item.
10799 """
10800 return _core_.SizerItem_SetProportion(*args, **kwargs)
10801
10802 def GetProportion(*args, **kwargs):
10803 """
10804 GetProportion(self) -> int
10805
10806 Get the proportion value for this item.
10807 """
10808 return _core_.SizerItem_GetProportion(*args, **kwargs)
10809
10810 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10811 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10812 def SetFlag(*args, **kwargs):
10813 """
10814 SetFlag(self, int flag)
10815
10816 Set the flag value for this item.
10817 """
10818 return _core_.SizerItem_SetFlag(*args, **kwargs)
10819
10820 def GetFlag(*args, **kwargs):
10821 """
10822 GetFlag(self) -> int
10823
10824 Get the flag value for this item.
10825 """
10826 return _core_.SizerItem_GetFlag(*args, **kwargs)
10827
10828 def SetBorder(*args, **kwargs):
10829 """
10830 SetBorder(self, int border)
10831
10832 Set the border value for this item.
10833 """
10834 return _core_.SizerItem_SetBorder(*args, **kwargs)
10835
10836 def GetBorder(*args, **kwargs):
10837 """
10838 GetBorder(self) -> int
10839
10840 Get the border value for this item.
10841 """
10842 return _core_.SizerItem_GetBorder(*args, **kwargs)
10843
10844 def GetWindow(*args, **kwargs):
10845 """
10846 GetWindow(self) -> Window
10847
10848 Get the window (if any) that is managed by this sizer item.
10849 """
10850 return _core_.SizerItem_GetWindow(*args, **kwargs)
10851
10852 def SetWindow(*args, **kwargs):
10853 """
10854 SetWindow(self, Window window)
10855
10856 Set the window to be managed by this sizer item.
10857 """
10858 return _core_.SizerItem_SetWindow(*args, **kwargs)
10859
10860 def GetSizer(*args, **kwargs):
10861 """
10862 GetSizer(self) -> Sizer
10863
10864 Get the subsizer (if any) that is managed by this sizer item.
10865 """
10866 return _core_.SizerItem_GetSizer(*args, **kwargs)
10867
10868 def SetSizer(*args, **kwargs):
10869 """
10870 SetSizer(self, Sizer sizer)
10871
10872 Set the subsizer to be managed by this sizer item.
10873 """
10874 return _core_.SizerItem_SetSizer(*args, **kwargs)
10875
10876 def GetSpacer(*args, **kwargs):
10877 """
10878 GetSpacer(self) -> Size
10879
10880 Get the size of the spacer managed by this sizer item.
10881 """
10882 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10883
10884 def SetSpacer(*args, **kwargs):
10885 """
10886 SetSpacer(self, Size size)
10887
10888 Set the size of the spacer to be managed by this sizer item.
10889 """
10890 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10891
10892 def Show(*args, **kwargs):
10893 """
10894 Show(self, bool show)
10895
10896 Set the show item attribute, which sizers use to determine if the item
10897 is to be made part of the layout or not. If the item is tracking a
10898 window then it is shown or hidden as needed.
10899 """
10900 return _core_.SizerItem_Show(*args, **kwargs)
10901
10902 def IsShown(*args, **kwargs):
10903 """
10904 IsShown(self) -> bool
10905
10906 Is the item to be shown in the layout?
10907 """
10908 return _core_.SizerItem_IsShown(*args, **kwargs)
10909
10910 def GetPosition(*args, **kwargs):
10911 """
10912 GetPosition(self) -> Point
10913
10914 Returns the current position of the item, as set in the last Layout.
10915 """
10916 return _core_.SizerItem_GetPosition(*args, **kwargs)
10917
10918 def GetUserData(*args, **kwargs):
10919 """
10920 GetUserData(self) -> PyObject
10921
10922 Returns the userData associated with this sizer item, or None if there
10923 isn't any.
10924 """
10925 return _core_.SizerItem_GetUserData(*args, **kwargs)
10926
10927 def SetUserData(*args, **kwargs):
10928 """
10929 SetUserData(self, PyObject userData)
10930
10931 Associate a Python object with this sizer item.
10932 """
10933 return _core_.SizerItem_SetUserData(*args, **kwargs)
10934
10935 SizerItem_swigregister = _core_.SizerItem_swigregister
10936 SizerItem_swigregister(SizerItem)
10937
10938 def SizerItemWindow(*args, **kwargs):
10939 """
10940 SizerItemWindow(Window window, int proportion, int flag, int border,
10941 PyObject userData=None) -> SizerItem
10942
10943 Constructs a `wx.SizerItem` for tracking a window.
10944 """
10945 val = _core_.new_SizerItemWindow(*args, **kwargs)
10946 return val
10947
10948 def SizerItemSpacer(*args, **kwargs):
10949 """
10950 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10951 PyObject userData=None) -> SizerItem
10952
10953 Constructs a `wx.SizerItem` for tracking a spacer.
10954 """
10955 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10956 return val
10957
10958 def SizerItemSizer(*args, **kwargs):
10959 """
10960 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10961 PyObject userData=None) -> SizerItem
10962
10963 Constructs a `wx.SizerItem` for tracking a subsizer
10964 """
10965 val = _core_.new_SizerItemSizer(*args, **kwargs)
10966 return val
10967
10968 class Sizer(Object):
10969 """
10970 wx.Sizer is the abstract base class used for laying out subwindows in
10971 a window. You cannot use wx.Sizer directly; instead, you will have to
10972 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10973 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10974 and `wx.GridBagSizer`.
10975
10976 The concept implemented by sizers in wxWidgets is closely related to
10977 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10978 toolkit or the Qt toolkit. It is based upon the idea of the individual
10979 subwindows reporting their minimal required size and their ability to
10980 get stretched if the size of the parent window has changed. This will
10981 most often mean that the programmer does not set the original size of
10982 a dialog in the beginning, rather the dialog will assigned a sizer and
10983 this sizer will be queried about the recommended size. The sizer in
10984 turn will query its children, which can be normal windows or contorls,
10985 empty space or other sizers, so that a hierarchy of sizers can be
10986 constructed. Note that wxSizer does not derive from wxWindow and thus
10987 do not interfere with tab ordering and requires very little resources
10988 compared to a real window on screen.
10989
10990 What makes sizers so well fitted for use in wxWidgets is the fact that
10991 every control reports its own minimal size and the algorithm can
10992 handle differences in font sizes or different window (dialog item)
10993 sizes on different platforms without problems. If for example the
10994 standard font as well as the overall design of Mac widgets requires
10995 more space than on Windows, then the initial size of a dialog using a
10996 sizer will automatically be bigger on Mac than on Windows.
10997 """
10998 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10999 def __init__(self): raise AttributeError, "No constructor defined"
11000 __repr__ = _swig_repr
11001 __swig_destroy__ = _core_.delete_Sizer
11002 __del__ = lambda self : None;
11003 def _setOORInfo(*args, **kwargs):
11004 """_setOORInfo(self, PyObject _self)"""
11005 return _core_.Sizer__setOORInfo(*args, **kwargs)
11006
11007 def Add(*args, **kwargs):
11008 """
11009 Add(self, item, int proportion=0, int flag=0, int border=0,
11010 PyObject userData=None) -> wx.SizerItem
11011
11012 Appends a child item to the sizer.
11013 """
11014 return _core_.Sizer_Add(*args, **kwargs)
11015
11016 def Insert(*args, **kwargs):
11017 """
11018 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11019 PyObject userData=None) -> wx.SizerItem
11020
11021 Inserts a new item into the list of items managed by this sizer before
11022 the item at index *before*. See `Add` for a description of the parameters.
11023 """
11024 return _core_.Sizer_Insert(*args, **kwargs)
11025
11026 def Prepend(*args, **kwargs):
11027 """
11028 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11029 PyObject userData=None) -> wx.SizerItem
11030
11031 Adds a new item to the begining of the list of sizer items managed by
11032 this sizer. See `Add` for a description of the parameters.
11033 """
11034 return _core_.Sizer_Prepend(*args, **kwargs)
11035
11036 def Remove(*args, **kwargs):
11037 """
11038 Remove(self, item) -> bool
11039
11040 Removes an item from the sizer and destroys it. This method does not
11041 cause any layout or resizing to take place, call `Layout` to update
11042 the layout on screen after removing a child from the sizer. The
11043 *item* parameter can be either a window, a sizer, or the zero-based
11044 index of an item to remove. Returns True if the child item was found
11045 and removed.
11046 """
11047 return _core_.Sizer_Remove(*args, **kwargs)
11048
11049 def Detach(*args, **kwargs):
11050 """
11051 Detach(self, item) -> bool
11052
11053 Detaches an item from the sizer without destroying it. This method
11054 does not cause any layout or resizing to take place, call `Layout` to
11055 do so. The *item* parameter can be either a window, a sizer, or the
11056 zero-based index of the item to be detached. Returns True if the child item
11057 was found and detached.
11058 """
11059 return _core_.Sizer_Detach(*args, **kwargs)
11060
11061 def GetItem(*args, **kwargs):
11062 """
11063 GetItem(self, item) -> wx.SizerItem
11064
11065 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11066 parameter can be either a window, a sizer, or the zero-based index of
11067 the item to be found.
11068 """
11069 return _core_.Sizer_GetItem(*args, **kwargs)
11070
11071 def _SetItemMinSize(*args, **kwargs):
11072 """_SetItemMinSize(self, PyObject item, Size size)"""
11073 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11074
11075 def SetItemMinSize(self, item, *args):
11076 """
11077 SetItemMinSize(self, item, Size size)
11078
11079 Sets the minimum size that will be allocated for an item in the sizer.
11080 The *item* parameter can be either a window, a sizer, or the
11081 zero-based index of the item. If a window or sizer is given then it
11082 will be searched for recursivly in subsizers if neccessary.
11083 """
11084 if len(args) == 2:
11085 # for backward compatibility accept separate width,height args too
11086 return self._SetItemMinSize(item, args)
11087 else:
11088 return self._SetItemMinSize(item, args[0])
11089
11090 def AddItem(*args, **kwargs):
11091 """
11092 AddItem(self, SizerItem item)
11093
11094 Adds a `wx.SizerItem` to the sizer.
11095 """
11096 return _core_.Sizer_AddItem(*args, **kwargs)
11097
11098 def InsertItem(*args, **kwargs):
11099 """
11100 InsertItem(self, int index, SizerItem item)
11101
11102 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11103 """
11104 return _core_.Sizer_InsertItem(*args, **kwargs)
11105
11106 def PrependItem(*args, **kwargs):
11107 """
11108 PrependItem(self, SizerItem item)
11109
11110 Prepends a `wx.SizerItem` to the sizer.
11111 """
11112 return _core_.Sizer_PrependItem(*args, **kwargs)
11113
11114 def AddMany(self, items):
11115 """
11116 AddMany is a convenience method for adding several items
11117 to a sizer at one time. Simply pass it a list of tuples,
11118 where each tuple consists of the parameters that you
11119 would normally pass to the `Add` method.
11120 """
11121 for item in items:
11122 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11123 item = (item, )
11124 self.Add(*item)
11125
11126 # for backwards compatibility only, please do not use in new code
11127 def AddWindow(self, *args, **kw):
11128 """Compatibility alias for `Add`."""
11129 return self.Add(*args, **kw)
11130 def AddSizer(self, *args, **kw):
11131 """Compatibility alias for `Add`."""
11132 return self.Add(*args, **kw)
11133 def AddSpacer(self, *args, **kw):
11134 """Compatibility alias for `Add`."""
11135 return self.Add(*args, **kw)
11136
11137 def PrependWindow(self, *args, **kw):
11138 """Compatibility alias for `Prepend`."""
11139 return self.Prepend(*args, **kw)
11140 def PrependSizer(self, *args, **kw):
11141 """Compatibility alias for `Prepend`."""
11142 return self.Prepend(*args, **kw)
11143 def PrependSpacer(self, *args, **kw):
11144 """Compatibility alias for `Prepend`."""
11145 return self.Prepend(*args, **kw)
11146
11147 def InsertWindow(self, *args, **kw):
11148 """Compatibility alias for `Insert`."""
11149 return self.Insert(*args, **kw)
11150 def InsertSizer(self, *args, **kw):
11151 """Compatibility alias for `Insert`."""
11152 return self.Insert(*args, **kw)
11153 def InsertSpacer(self, *args, **kw):
11154 """Compatibility alias for `Insert`."""
11155 return self.Insert(*args, **kw)
11156
11157 def RemoveWindow(self, *args, **kw):
11158 """Compatibility alias for `Remove`."""
11159 return self.Remove(*args, **kw)
11160 def RemoveSizer(self, *args, **kw):
11161 """Compatibility alias for `Remove`."""
11162 return self.Remove(*args, **kw)
11163 def RemovePos(self, *args, **kw):
11164 """Compatibility alias for `Remove`."""
11165 return self.Remove(*args, **kw)
11166
11167
11168 def SetDimension(*args, **kwargs):
11169 """
11170 SetDimension(self, int x, int y, int width, int height)
11171
11172 Call this to force the sizer to take the given dimension and thus
11173 force the items owned by the sizer to resize themselves according to
11174 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11175 methods.
11176 """
11177 return _core_.Sizer_SetDimension(*args, **kwargs)
11178
11179 def SetMinSize(*args, **kwargs):
11180 """
11181 SetMinSize(self, Size size)
11182
11183 Call this to give the sizer a minimal size. Normally, the sizer will
11184 calculate its minimal size based purely on how much space its children
11185 need. After calling this method `GetMinSize` will return either the
11186 minimal size as requested by its children or the minimal size set
11187 here, depending on which is bigger.
11188 """
11189 return _core_.Sizer_SetMinSize(*args, **kwargs)
11190
11191 def GetSize(*args, **kwargs):
11192 """
11193 GetSize(self) -> Size
11194
11195 Returns the current size of the space managed by the sizer.
11196 """
11197 return _core_.Sizer_GetSize(*args, **kwargs)
11198
11199 def GetPosition(*args, **kwargs):
11200 """
11201 GetPosition(self) -> Point
11202
11203 Returns the current position of the sizer's managed space.
11204 """
11205 return _core_.Sizer_GetPosition(*args, **kwargs)
11206
11207 def GetMinSize(*args, **kwargs):
11208 """
11209 GetMinSize(self) -> Size
11210
11211 Returns the minimal size of the sizer. This is either the combined
11212 minimal size of all the children and their borders or the minimal size
11213 set by SetMinSize, depending on which is bigger.
11214 """
11215 return _core_.Sizer_GetMinSize(*args, **kwargs)
11216
11217 def GetSizeTuple(self):
11218 return self.GetSize().Get()
11219 def GetPositionTuple(self):
11220 return self.GetPosition().Get()
11221 def GetMinSizeTuple(self):
11222 return self.GetMinSize().Get()
11223
11224 def RecalcSizes(*args, **kwargs):
11225 """
11226 RecalcSizes(self)
11227
11228 Using the sizes calculated by `CalcMin` reposition and resize all the
11229 items managed by this sizer. You should not need to call this directly as
11230 it is called by `Layout`.
11231 """
11232 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11233
11234 def CalcMin(*args, **kwargs):
11235 """
11236 CalcMin(self) -> Size
11237
11238 This method is where the sizer will do the actual calculation of its
11239 children's minimal sizes. You should not need to call this directly as
11240 it is called by `Layout`.
11241 """
11242 return _core_.Sizer_CalcMin(*args, **kwargs)
11243
11244 def Layout(*args, **kwargs):
11245 """
11246 Layout(self)
11247
11248 This method will force the recalculation and layout of the items
11249 controlled by the sizer using the current space allocated to the
11250 sizer. Normally this is called automatically from the owning window's
11251 EVT_SIZE handler, but it is also useful to call it from user code when
11252 one of the items in a sizer change size, or items are added or
11253 removed.
11254 """
11255 return _core_.Sizer_Layout(*args, **kwargs)
11256
11257 def Fit(*args, **kwargs):
11258 """
11259 Fit(self, Window window) -> Size
11260
11261 Tell the sizer to resize the *window* to match the sizer's minimal
11262 size. This is commonly done in the constructor of the window itself in
11263 order to set its initial size to match the needs of the children as
11264 determined by the sizer. Returns the new size.
11265
11266 For a top level window this is the total window size, not the client size.
11267 """
11268 return _core_.Sizer_Fit(*args, **kwargs)
11269
11270 def FitInside(*args, **kwargs):
11271 """
11272 FitInside(self, Window window)
11273
11274 Tell the sizer to resize the *virtual size* of the *window* to match the
11275 sizer's minimal size. This will not alter the on screen size of the
11276 window, but may cause the addition/removal/alteration of scrollbars
11277 required to view the virtual area in windows which manage it.
11278
11279 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11280
11281 """
11282 return _core_.Sizer_FitInside(*args, **kwargs)
11283
11284 def SetSizeHints(*args, **kwargs):
11285 """
11286 SetSizeHints(self, Window window)
11287
11288 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11289 match the sizer's minimal size. This is commonly done in the
11290 constructor of the window itself if the window is resizable (as are
11291 many dialogs under Unix and frames on probably all platforms) in order
11292 to prevent the window from being sized smaller than the minimal size
11293 required by the sizer.
11294 """
11295 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11296
11297 def SetVirtualSizeHints(*args, **kwargs):
11298 """
11299 SetVirtualSizeHints(self, Window window)
11300
11301 Tell the sizer to set the minimal size of the window virtual area to
11302 match the sizer's minimal size. For windows with managed scrollbars
11303 this will set them appropriately.
11304
11305 :see: `wx.ScrolledWindow.SetScrollbars`
11306
11307 """
11308 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11309
11310 def Clear(*args, **kwargs):
11311 """
11312 Clear(self, bool deleteWindows=False)
11313
11314 Clear all items from the sizer, optionally destroying the window items
11315 as well.
11316 """
11317 return _core_.Sizer_Clear(*args, **kwargs)
11318
11319 def DeleteWindows(*args, **kwargs):
11320 """
11321 DeleteWindows(self)
11322
11323 Destroy all windows managed by the sizer.
11324 """
11325 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11326
11327 def GetChildren(*args, **kwargs):
11328 """
11329 GetChildren(self) -> list
11330
11331 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11332 """
11333 return _core_.Sizer_GetChildren(*args, **kwargs)
11334
11335 def Show(*args, **kwargs):
11336 """
11337 Show(self, item, bool show=True, bool recursive=false) -> bool
11338
11339 Shows or hides an item managed by the sizer. To make a sizer item
11340 disappear or reappear, use Show followed by `Layout`. The *item*
11341 parameter can be either a window, a sizer, or the zero-based index of
11342 the item. Use the recursive parameter to show or hide an item in a
11343 subsizer. Returns True if the item was found.
11344 """
11345 return _core_.Sizer_Show(*args, **kwargs)
11346
11347 def IsShown(*args, **kwargs):
11348 """
11349 IsShown(self, item)
11350
11351 Determines if the item is currently shown. To make a sizer
11352 item disappear or reappear, use Show followed by `Layout`. The *item*
11353 parameter can be either a window, a sizer, or the zero-based index of
11354 the item.
11355 """
11356 return _core_.Sizer_IsShown(*args, **kwargs)
11357
11358 def Hide(self, item, recursive=False):
11359 """
11360 A convenience method for `Show` (item, False, recursive).
11361 """
11362 return self.Show(item, False, recursive)
11363
11364 def ShowItems(*args, **kwargs):
11365 """
11366 ShowItems(self, bool show)
11367
11368 Recursively call `wx.SizerItem.Show` on all sizer items.
11369 """
11370 return _core_.Sizer_ShowItems(*args, **kwargs)
11371
11372 Sizer_swigregister = _core_.Sizer_swigregister
11373 Sizer_swigregister(Sizer)
11374
11375 class PySizer(Sizer):
11376 """
11377 wx.PySizer is a special version of `wx.Sizer` that has been
11378 instrumented to allow the C++ virtual methods to be overloaded in
11379 Python derived classes. You would derive from this class if you are
11380 wanting to implement a custom sizer in Python code. Simply implement
11381 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11382 For example::
11383
11384 class MySizer(wx.PySizer):
11385 def __init__(self):
11386 wx.PySizer.__init__(self)
11387
11388 def CalcMin(self):
11389 for item in self.GetChildren():
11390 # calculate the total minimum width and height needed
11391 # by all items in the sizer according to this sizer's
11392 # layout algorithm.
11393 ...
11394 return wx.Size(width, height)
11395
11396 def RecalcSizes(self):
11397 # find the space allotted to this sizer
11398 pos = self.GetPosition()
11399 size = self.GetSize()
11400 for item in self.GetChildren():
11401 # Recalculate (if necessary) the position and size of
11402 # each item and then call item.SetDimension to do the
11403 # actual positioning and sizing of the items within the
11404 # space alloted to this sizer.
11405 ...
11406 item.SetDimension(itemPos, itemSize)
11407
11408
11409 When `Layout` is called it first calls `CalcMin` followed by
11410 `RecalcSizes` so you can optimize a bit by saving the results of
11411 `CalcMin` and reusing them in `RecalcSizes`.
11412
11413 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11414
11415
11416 """
11417 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11418 __repr__ = _swig_repr
11419 def __init__(self, *args, **kwargs):
11420 """
11421 __init__(self) -> PySizer
11422
11423 Creates a wx.PySizer. Must be called from the __init__ in the derived
11424 class.
11425 """
11426 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11427 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11428
11429 def _setCallbackInfo(*args, **kwargs):
11430 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11431 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11432
11433 PySizer_swigregister = _core_.PySizer_swigregister
11434 PySizer_swigregister(PySizer)
11435
11436 #---------------------------------------------------------------------------
11437
11438 class BoxSizer(Sizer):
11439 """
11440 The basic idea behind a box sizer is that windows will most often be
11441 laid out in rather simple basic geometry, typically in a row or a
11442 column or nested hierarchies of either. A wx.BoxSizer will lay out
11443 its items in a simple row or column, depending on the orientation
11444 parameter passed to the constructor.
11445 """
11446 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11447 __repr__ = _swig_repr
11448 def __init__(self, *args, **kwargs):
11449 """
11450 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11451
11452 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11453 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11454 sizer.
11455 """
11456 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11457 self._setOORInfo(self)
11458
11459 def GetOrientation(*args, **kwargs):
11460 """
11461 GetOrientation(self) -> int
11462
11463 Returns the current orientation of the sizer.
11464 """
11465 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11466
11467 def SetOrientation(*args, **kwargs):
11468 """
11469 SetOrientation(self, int orient)
11470
11471 Resets the orientation of the sizer.
11472 """
11473 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11474
11475 BoxSizer_swigregister = _core_.BoxSizer_swigregister
11476 BoxSizer_swigregister(BoxSizer)
11477
11478 #---------------------------------------------------------------------------
11479
11480 class StaticBoxSizer(BoxSizer):
11481 """
11482 wx.StaticBoxSizer derives from and functions identically to the
11483 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11484 manages. Note that this static box must be created separately and
11485 passed to the sizer constructor.
11486 """
11487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11488 __repr__ = _swig_repr
11489 def __init__(self, *args, **kwargs):
11490 """
11491 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11492
11493 Constructor. It takes an associated static box and the orientation
11494 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11495 ``wx.HORIZONTAL``.
11496 """
11497 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11498 self._setOORInfo(self)
11499
11500 def GetStaticBox(*args, **kwargs):
11501 """
11502 GetStaticBox(self) -> StaticBox
11503
11504 Returns the static box associated with this sizer.
11505 """
11506 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11507
11508 StaticBoxSizer_swigregister = _core_.StaticBoxSizer_swigregister
11509 StaticBoxSizer_swigregister(StaticBoxSizer)
11510
11511 #---------------------------------------------------------------------------
11512
11513 class GridSizer(Sizer):
11514 """
11515 A grid sizer is a sizer which lays out its children in a
11516 two-dimensional table with all cells having the same size. In other
11517 words, the width of each cell within the grid is the width of the
11518 widest item added to the sizer and the height of each grid cell is the
11519 height of the tallest item. An optional vertical and/or horizontal
11520 gap between items can also be specified (in pixels.)
11521
11522 Items are placed in the cells of the grid in the order they are added,
11523 in row-major order. In other words, the first row is filled first,
11524 then the second, and so on until all items have been added. (If
11525 neccessary, additional rows will be added as items are added.) If you
11526 need to have greater control over the cells that items are placed in
11527 then use the `wx.GridBagSizer`.
11528
11529 """
11530 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11531 __repr__ = _swig_repr
11532 def __init__(self, *args, **kwargs):
11533 """
11534 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11535
11536 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11537 of columns and rows in the sizer - if either of the parameters is
11538 zero, it will be calculated to from the total number of children in
11539 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11540 define extra space between all children.
11541 """
11542 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11543 self._setOORInfo(self)
11544
11545 def SetCols(*args, **kwargs):
11546 """
11547 SetCols(self, int cols)
11548
11549 Sets the number of columns in the sizer.
11550 """
11551 return _core_.GridSizer_SetCols(*args, **kwargs)
11552
11553 def SetRows(*args, **kwargs):
11554 """
11555 SetRows(self, int rows)
11556
11557 Sets the number of rows in the sizer.
11558 """
11559 return _core_.GridSizer_SetRows(*args, **kwargs)
11560
11561 def SetVGap(*args, **kwargs):
11562 """
11563 SetVGap(self, int gap)
11564
11565 Sets the vertical gap (in pixels) between the cells in the sizer.
11566 """
11567 return _core_.GridSizer_SetVGap(*args, **kwargs)
11568
11569 def SetHGap(*args, **kwargs):
11570 """
11571 SetHGap(self, int gap)
11572
11573 Sets the horizontal gap (in pixels) between cells in the sizer
11574 """
11575 return _core_.GridSizer_SetHGap(*args, **kwargs)
11576
11577 def GetCols(*args, **kwargs):
11578 """
11579 GetCols(self) -> int
11580
11581 Returns the number of columns in the sizer.
11582 """
11583 return _core_.GridSizer_GetCols(*args, **kwargs)
11584
11585 def GetRows(*args, **kwargs):
11586 """
11587 GetRows(self) -> int
11588
11589 Returns the number of rows in the sizer.
11590 """
11591 return _core_.GridSizer_GetRows(*args, **kwargs)
11592
11593 def GetVGap(*args, **kwargs):
11594 """
11595 GetVGap(self) -> int
11596
11597 Returns the vertical gap (in pixels) between the cells in the sizer.
11598 """
11599 return _core_.GridSizer_GetVGap(*args, **kwargs)
11600
11601 def GetHGap(*args, **kwargs):
11602 """
11603 GetHGap(self) -> int
11604
11605 Returns the horizontal gap (in pixels) between cells in the sizer.
11606 """
11607 return _core_.GridSizer_GetHGap(*args, **kwargs)
11608
11609 def CalcRowsCols(self):
11610 """
11611 CalcRowsCols() -> (rows, cols)
11612
11613 Calculates how many rows and columns will be in the sizer based
11614 on the current number of items and also the rows, cols specified
11615 in the constructor.
11616 """
11617 nitems = len(self.GetChildren())
11618 rows = self.GetRows()
11619 cols = self.GetCols()
11620 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11621 if cols != 0:
11622 rows = (nitems + cols - 1) / cols
11623 elif rows != 0:
11624 cols = (nitems + rows - 1) / rows
11625 return (rows, cols)
11626
11627 GridSizer_swigregister = _core_.GridSizer_swigregister
11628 GridSizer_swigregister(GridSizer)
11629
11630 #---------------------------------------------------------------------------
11631
11632 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11633 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11634 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11635 class FlexGridSizer(GridSizer):
11636 """
11637 A flex grid sizer is a sizer which lays out its children in a
11638 two-dimensional table with all table cells in one row having the same
11639 height and all cells in one column having the same width, but all
11640 rows or all columns are not necessarily the same height or width as in
11641 the `wx.GridSizer`.
11642
11643 wx.FlexGridSizer can also size items equally in one direction but
11644 unequally ("flexibly") in the other. If the sizer is only flexible
11645 in one direction (this can be changed using `SetFlexibleDirection`), it
11646 needs to be decided how the sizer should grow in the other ("non
11647 flexible") direction in order to fill the available space. The
11648 `SetNonFlexibleGrowMode` method serves this purpose.
11649
11650
11651 """
11652 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11653 __repr__ = _swig_repr
11654 def __init__(self, *args, **kwargs):
11655 """
11656 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11657
11658 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11659 number of columns and rows in the sizer - if either of the parameters
11660 is zero, it will be calculated to from the total number of children in
11661 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11662 define extra space between all children.
11663 """
11664 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11665 self._setOORInfo(self)
11666
11667 def AddGrowableRow(*args, **kwargs):
11668 """
11669 AddGrowableRow(self, size_t idx, int proportion=0)
11670
11671 Specifies that row *idx* (starting from zero) should be grown if there
11672 is extra space available to the sizer.
11673
11674 The *proportion* parameter has the same meaning as the stretch factor
11675 for the box sizers except that if all proportions are 0, then all
11676 columns are resized equally (instead of not being resized at all).
11677 """
11678 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11679
11680 def RemoveGrowableRow(*args, **kwargs):
11681 """
11682 RemoveGrowableRow(self, size_t idx)
11683
11684 Specifies that row *idx* is no longer growable.
11685 """
11686 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11687
11688 def AddGrowableCol(*args, **kwargs):
11689 """
11690 AddGrowableCol(self, size_t idx, int proportion=0)
11691
11692 Specifies that column *idx* (starting from zero) should be grown if
11693 there is extra space available to the sizer.
11694
11695 The *proportion* parameter has the same meaning as the stretch factor
11696 for the box sizers except that if all proportions are 0, then all
11697 columns are resized equally (instead of not being resized at all).
11698 """
11699 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11700
11701 def RemoveGrowableCol(*args, **kwargs):
11702 """
11703 RemoveGrowableCol(self, size_t idx)
11704
11705 Specifies that column *idx* is no longer growable.
11706 """
11707 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11708
11709 def SetFlexibleDirection(*args, **kwargs):
11710 """
11711 SetFlexibleDirection(self, int direction)
11712
11713 Specifies whether the sizer should flexibly resize its columns, rows,
11714 or both. Argument *direction* can be one of the following values. Any
11715 other value is ignored.
11716
11717 ============== =======================================
11718 wx.VERTICAL Rows are flexibly sized.
11719 wx.HORIZONTAL Columns are flexibly sized.
11720 wx.BOTH Both rows and columns are flexibly sized
11721 (this is the default value).
11722 ============== =======================================
11723
11724 Note that this method does not trigger relayout.
11725
11726 """
11727 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11728
11729 def GetFlexibleDirection(*args, **kwargs):
11730 """
11731 GetFlexibleDirection(self) -> int
11732
11733 Returns a value that specifies whether the sizer
11734 flexibly resizes its columns, rows, or both (default).
11735
11736 :see: `SetFlexibleDirection`
11737 """
11738 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11739
11740 def SetNonFlexibleGrowMode(*args, **kwargs):
11741 """
11742 SetNonFlexibleGrowMode(self, int mode)
11743
11744 Specifies how the sizer should grow in the non-flexible direction if
11745 there is one (so `SetFlexibleDirection` must have been called
11746 previously). Argument *mode* can be one of the following values:
11747
11748 ========================== =================================================
11749 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11750 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11751 `AddGrowableCol` and `AddGrowableRow`. In this
11752 case equal sizing applies to minimum sizes of
11753 columns or rows (this is the default value).
11754 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11755 the non flexible direction, whether they are
11756 growable or not in the flexbile direction.
11757 ========================== =================================================
11758
11759 Note that this method does not trigger relayout.
11760
11761
11762 """
11763 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11764
11765 def GetNonFlexibleGrowMode(*args, **kwargs):
11766 """
11767 GetNonFlexibleGrowMode(self) -> int
11768
11769 Returns the value that specifies how the sizer grows in the
11770 non-flexible direction if there is one.
11771
11772 :see: `SetNonFlexibleGrowMode`
11773 """
11774 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11775
11776 def GetRowHeights(*args, **kwargs):
11777 """
11778 GetRowHeights(self) -> list
11779
11780 Returns a list of integers representing the heights of each of the
11781 rows in the sizer.
11782 """
11783 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11784
11785 def GetColWidths(*args, **kwargs):
11786 """
11787 GetColWidths(self) -> list
11788
11789 Returns a list of integers representing the widths of each of the
11790 columns in the sizer.
11791 """
11792 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11793
11794 FlexGridSizer_swigregister = _core_.FlexGridSizer_swigregister
11795 FlexGridSizer_swigregister(FlexGridSizer)
11796
11797 class StdDialogButtonSizer(BoxSizer):
11798 """
11799 A special sizer that knows how to order and position standard buttons
11800 in order to conform to the current platform's standards. You simply
11801 need to add each `wx.Button` to the sizer, and be sure to create the
11802 buttons using the standard ID's. Then call `Realize` and the sizer
11803 will take care of the rest.
11804
11805 """
11806 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11807 __repr__ = _swig_repr
11808 def __init__(self, *args, **kwargs):
11809 """__init__(self) -> StdDialogButtonSizer"""
11810 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11811 def AddButton(*args, **kwargs):
11812 """
11813 AddButton(self, wxButton button)
11814
11815 Use this to add the buttons to this sizer. Do not use the `Add`
11816 method in the base class.
11817 """
11818 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11819
11820 def Realize(*args, **kwargs):
11821 """
11822 Realize(self)
11823
11824 This funciton needs to be called after all the buttons have been added
11825 to the sizer. It will reorder them and position them in a platform
11826 specifc manner.
11827 """
11828 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11829
11830 def SetAffirmativeButton(*args, **kwargs):
11831 """SetAffirmativeButton(self, wxButton button)"""
11832 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11833
11834 def SetNegativeButton(*args, **kwargs):
11835 """SetNegativeButton(self, wxButton button)"""
11836 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11837
11838 def SetCancelButton(*args, **kwargs):
11839 """SetCancelButton(self, wxButton button)"""
11840 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11841
11842 def GetAffirmativeButton(*args, **kwargs):
11843 """GetAffirmativeButton(self) -> wxButton"""
11844 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11845
11846 def GetApplyButton(*args, **kwargs):
11847 """GetApplyButton(self) -> wxButton"""
11848 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11849
11850 def GetNegativeButton(*args, **kwargs):
11851 """GetNegativeButton(self) -> wxButton"""
11852 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11853
11854 def GetCancelButton(*args, **kwargs):
11855 """GetCancelButton(self) -> wxButton"""
11856 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11857
11858 def GetHelpButton(*args, **kwargs):
11859 """GetHelpButton(self) -> wxButton"""
11860 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11861
11862 StdDialogButtonSizer_swigregister = _core_.StdDialogButtonSizer_swigregister
11863 StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11864
11865 #---------------------------------------------------------------------------
11866
11867 class GBPosition(object):
11868 """
11869 This class represents the position of an item in a virtual grid of
11870 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11871 typemaps that will automatically convert from a 2-element sequence of
11872 integers to a wx.GBPosition, so you can use the more pythonic
11873 representation of the position nearly transparently in Python code.
11874 """
11875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11876 __repr__ = _swig_repr
11877 def __init__(self, *args, **kwargs):
11878 """
11879 __init__(self, int row=0, int col=0) -> GBPosition
11880
11881 This class represents the position of an item in a virtual grid of
11882 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11883 typemaps that will automatically convert from a 2-element sequence of
11884 integers to a wx.GBPosition, so you can use the more pythonic
11885 representation of the position nearly transparently in Python code.
11886 """
11887 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11888 __swig_destroy__ = _core_.delete_GBPosition
11889 __del__ = lambda self : None;
11890 def GetRow(*args, **kwargs):
11891 """GetRow(self) -> int"""
11892 return _core_.GBPosition_GetRow(*args, **kwargs)
11893
11894 def GetCol(*args, **kwargs):
11895 """GetCol(self) -> int"""
11896 return _core_.GBPosition_GetCol(*args, **kwargs)
11897
11898 def SetRow(*args, **kwargs):
11899 """SetRow(self, int row)"""
11900 return _core_.GBPosition_SetRow(*args, **kwargs)
11901
11902 def SetCol(*args, **kwargs):
11903 """SetCol(self, int col)"""
11904 return _core_.GBPosition_SetCol(*args, **kwargs)
11905
11906 def __eq__(*args, **kwargs):
11907 """__eq__(self, GBPosition other) -> bool"""
11908 return _core_.GBPosition___eq__(*args, **kwargs)
11909
11910 def __ne__(*args, **kwargs):
11911 """__ne__(self, GBPosition other) -> bool"""
11912 return _core_.GBPosition___ne__(*args, **kwargs)
11913
11914 def Set(*args, **kwargs):
11915 """Set(self, int row=0, int col=0)"""
11916 return _core_.GBPosition_Set(*args, **kwargs)
11917
11918 def Get(*args, **kwargs):
11919 """Get(self) -> PyObject"""
11920 return _core_.GBPosition_Get(*args, **kwargs)
11921
11922 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11923 def __str__(self): return str(self.Get())
11924 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11925 def __len__(self): return len(self.Get())
11926 def __getitem__(self, index): return self.Get()[index]
11927 def __setitem__(self, index, val):
11928 if index == 0: self.SetRow(val)
11929 elif index == 1: self.SetCol(val)
11930 else: raise IndexError
11931 def __nonzero__(self): return self.Get() != (0,0)
11932 __safe_for_unpickling__ = True
11933 def __reduce__(self): return (wx.GBPosition, self.Get())
11934
11935 row = property(GetRow, SetRow)
11936 col = property(GetCol, SetCol)
11937
11938 GBPosition_swigregister = _core_.GBPosition_swigregister
11939 GBPosition_swigregister(GBPosition)
11940
11941 class GBSpan(object):
11942 """
11943 This class is used to hold the row and column spanning attributes of
11944 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11945 automatically convert from a 2-element sequence of integers to a
11946 wx.GBSpan, so you can use the more pythonic representation of the span
11947 nearly transparently in Python code.
11948
11949 """
11950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11951 __repr__ = _swig_repr
11952 def __init__(self, *args, **kwargs):
11953 """
11954 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11955
11956 Construct a new wxGBSpan, optionally setting the rowspan and
11957 colspan. The default is (1,1). (Meaning that the item occupies one
11958 cell in each direction.
11959 """
11960 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11961 __swig_destroy__ = _core_.delete_GBSpan
11962 __del__ = lambda self : None;
11963 def GetRowspan(*args, **kwargs):
11964 """GetRowspan(self) -> int"""
11965 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11966
11967 def GetColspan(*args, **kwargs):
11968 """GetColspan(self) -> int"""
11969 return _core_.GBSpan_GetColspan(*args, **kwargs)
11970
11971 def SetRowspan(*args, **kwargs):
11972 """SetRowspan(self, int rowspan)"""
11973 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11974
11975 def SetColspan(*args, **kwargs):
11976 """SetColspan(self, int colspan)"""
11977 return _core_.GBSpan_SetColspan(*args, **kwargs)
11978
11979 def __eq__(*args, **kwargs):
11980 """__eq__(self, GBSpan other) -> bool"""
11981 return _core_.GBSpan___eq__(*args, **kwargs)
11982
11983 def __ne__(*args, **kwargs):
11984 """__ne__(self, GBSpan other) -> bool"""
11985 return _core_.GBSpan___ne__(*args, **kwargs)
11986
11987 def Set(*args, **kwargs):
11988 """Set(self, int rowspan=1, int colspan=1)"""
11989 return _core_.GBSpan_Set(*args, **kwargs)
11990
11991 def Get(*args, **kwargs):
11992 """Get(self) -> PyObject"""
11993 return _core_.GBSpan_Get(*args, **kwargs)
11994
11995 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11996 def __str__(self): return str(self.Get())
11997 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11998 def __len__(self): return len(self.Get())
11999 def __getitem__(self, index): return self.Get()[index]
12000 def __setitem__(self, index, val):
12001 if index == 0: self.SetRowspan(val)
12002 elif index == 1: self.SetColspan(val)
12003 else: raise IndexError
12004 def __nonzero__(self): return self.Get() != (0,0)
12005 __safe_for_unpickling__ = True
12006 def __reduce__(self): return (wx.GBSpan, self.Get())
12007
12008 rowspan = property(GetRowspan, SetRowspan)
12009 colspan = property(GetColspan, SetColspan)
12010
12011 GBSpan_swigregister = _core_.GBSpan_swigregister
12012 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 GBSizerItem_swigregister = _core_.GBSizerItem_swigregister
12119 GBSizerItem_swigregister(GBSizerItem)
12120 DefaultSpan = cvar.DefaultSpan
12121
12122 def GBSizerItemWindow(*args, **kwargs):
12123 """
12124 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12125 int border, PyObject userData=None) -> GBSizerItem
12126
12127 Construct a `wx.GBSizerItem` for a window.
12128 """
12129 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12130 return val
12131
12132 def GBSizerItemSizer(*args, **kwargs):
12133 """
12134 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12135 int border, PyObject userData=None) -> GBSizerItem
12136
12137 Construct a `wx.GBSizerItem` for a sizer
12138 """
12139 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12140 return val
12141
12142 def GBSizerItemSpacer(*args, **kwargs):
12143 """
12144 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12145 int flag, int border, PyObject userData=None) -> GBSizerItem
12146
12147 Construct a `wx.GBSizerItem` for a spacer.
12148 """
12149 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12150 return val
12151
12152 class GridBagSizer(FlexGridSizer):
12153 """
12154 A `wx.Sizer` that can lay out items in a virtual grid like a
12155 `wx.FlexGridSizer` but in this case explicit positioning of the items
12156 is allowed using `wx.GBPosition`, and items can optionally span more
12157 than one row and/or column using `wx.GBSpan`. The total size of the
12158 virtual grid is determined by the largest row and column that items are
12159 positioned at, adjusted for spanning.
12160
12161 """
12162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12163 __repr__ = _swig_repr
12164 def __init__(self, *args, **kwargs):
12165 """
12166 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12167
12168 Constructor, with optional parameters to specify the gap between the
12169 rows and columns.
12170 """
12171 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12172 self._setOORInfo(self)
12173
12174 def Add(*args, **kwargs):
12175 """
12176 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12177 int border=0, userData=None) -> wx.GBSizerItem
12178
12179 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12180 more than one row or column as specified with *span*. The remaining
12181 args behave similarly to `wx.Sizer.Add`.
12182
12183 Returns True if the item was successfully placed at the given cell
12184 position, False if something was already there.
12185
12186 """
12187 return _core_.GridBagSizer_Add(*args, **kwargs)
12188
12189 def AddItem(*args, **kwargs):
12190 """
12191 Add(self, GBSizerItem item) -> wx.GBSizerItem
12192
12193 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12194 the item was successfully placed at its given cell position, False if
12195 something was already there.
12196 """
12197 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12198
12199 def GetCellSize(*args, **kwargs):
12200 """
12201 GetCellSize(self, int row, int col) -> Size
12202
12203 Get the size of the specified cell, including hgap and
12204 vgap. Only valid after a Layout.
12205 """
12206 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12207
12208 def GetEmptyCellSize(*args, **kwargs):
12209 """
12210 GetEmptyCellSize(self) -> Size
12211
12212 Get the size used for cells in the grid with no item.
12213 """
12214 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12215
12216 def SetEmptyCellSize(*args, **kwargs):
12217 """
12218 SetEmptyCellSize(self, Size sz)
12219
12220 Set the size used for cells in the grid with no item.
12221 """
12222 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12223
12224 def GetItemPosition(*args):
12225 """
12226 GetItemPosition(self, item) -> GBPosition
12227
12228 Get the grid position of the specified *item* where *item* is either a
12229 window or subsizer that is a member of this sizer, or a zero-based
12230 index of an item.
12231 """
12232 return _core_.GridBagSizer_GetItemPosition(*args)
12233
12234 def SetItemPosition(*args):
12235 """
12236 SetItemPosition(self, item, GBPosition pos) -> bool
12237
12238 Set the grid position of the specified *item* where *item* is either a
12239 window or subsizer that is a member of this sizer, or a zero-based
12240 index of an item. Returns True on success. If the move is not
12241 allowed (because an item is already there) then False is returned.
12242
12243 """
12244 return _core_.GridBagSizer_SetItemPosition(*args)
12245
12246 def GetItemSpan(*args):
12247 """
12248 GetItemSpan(self, item) -> GBSpan
12249
12250 Get the row/col spanning of the specified *item* where *item* is
12251 either a window or subsizer that is a member of this sizer, or a
12252 zero-based index of an item.
12253 """
12254 return _core_.GridBagSizer_GetItemSpan(*args)
12255
12256 def SetItemSpan(*args):
12257 """
12258 SetItemSpan(self, item, GBSpan span) -> bool
12259
12260 Set the row/col spanning of the specified *item* where *item* is
12261 either a window or subsizer that is a member of this sizer, or a
12262 zero-based index of an item. Returns True on success. If the move is
12263 not allowed (because an item is already there) then False is returned.
12264 """
12265 return _core_.GridBagSizer_SetItemSpan(*args)
12266
12267 def FindItem(*args):
12268 """
12269 FindItem(self, item) -> GBSizerItem
12270
12271 Find the sizer item for the given window or subsizer, returns None if
12272 not found. (non-recursive)
12273 """
12274 return _core_.GridBagSizer_FindItem(*args)
12275
12276 def FindItemAtPosition(*args, **kwargs):
12277 """
12278 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12279
12280 Return the sizer item for the given grid cell, or None if there is no
12281 item at that position. (non-recursive)
12282 """
12283 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12284
12285 def FindItemAtPoint(*args, **kwargs):
12286 """
12287 FindItemAtPoint(self, Point pt) -> GBSizerItem
12288
12289 Return the sizer item located at the point given in *pt*, or None if
12290 there is no item at that point. The (x,y) coordinates in pt correspond
12291 to the client coordinates of the window using the sizer for
12292 layout. (non-recursive)
12293 """
12294 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12295
12296 def CheckForIntersection(*args, **kwargs):
12297 """
12298 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12299
12300 Look at all items and see if any intersect (or would overlap) the
12301 given *item*. Returns True if so, False if there would be no overlap.
12302 If an *excludeItem* is given then it will not be checked for
12303 intersection, for example it may be the item we are checking the
12304 position of.
12305
12306 """
12307 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12308
12309 def CheckForIntersectionPos(*args, **kwargs):
12310 """
12311 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12312
12313 Look at all items and see if any intersect (or would overlap) the
12314 given position and span. Returns True if so, False if there would be
12315 no overlap. If an *excludeItem* is given then it will not be checked
12316 for intersection, for example it may be the item we are checking the
12317 position of.
12318 """
12319 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12320
12321 GridBagSizer_swigregister = _core_.GridBagSizer_swigregister
12322 GridBagSizer_swigregister(GridBagSizer)
12323
12324 #---------------------------------------------------------------------------
12325
12326 Left = _core_.Left
12327 Top = _core_.Top
12328 Right = _core_.Right
12329 Bottom = _core_.Bottom
12330 Width = _core_.Width
12331 Height = _core_.Height
12332 Centre = _core_.Centre
12333 Center = _core_.Center
12334 CentreX = _core_.CentreX
12335 CentreY = _core_.CentreY
12336 Unconstrained = _core_.Unconstrained
12337 AsIs = _core_.AsIs
12338 PercentOf = _core_.PercentOf
12339 Above = _core_.Above
12340 Below = _core_.Below
12341 LeftOf = _core_.LeftOf
12342 RightOf = _core_.RightOf
12343 SameAs = _core_.SameAs
12344 Absolute = _core_.Absolute
12345 class IndividualLayoutConstraint(Object):
12346 """
12347 Objects of this class are stored in the `wx.LayoutConstraints` class as
12348 one of eight possible constraints that a window can be involved in.
12349 You will never need to create an instance of
12350 wx.IndividualLayoutConstraint, rather you should create a
12351 `wx.LayoutConstraints` instance and use the individual contstraints
12352 that it contains.
12353 """
12354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12355 def __init__(self): raise AttributeError, "No constructor defined"
12356 __repr__ = _swig_repr
12357 def Set(*args, **kwargs):
12358 """
12359 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12360
12361 Sets the properties of the constraint. Normally called by one of the
12362 convenience functions such as Above, RightOf, SameAs.
12363 """
12364 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12365
12366 def LeftOf(*args, **kwargs):
12367 """
12368 LeftOf(self, Window sibling, int marg=0)
12369
12370 Constrains this edge to be to the left of the given window, with an
12371 optional margin. Implicitly, this is relative to the left edge of the
12372 other window.
12373 """
12374 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12375
12376 def RightOf(*args, **kwargs):
12377 """
12378 RightOf(self, Window sibling, int marg=0)
12379
12380 Constrains this edge to be to the right of the given window, with an
12381 optional margin. Implicitly, this is relative to the right edge of the
12382 other window.
12383 """
12384 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12385
12386 def Above(*args, **kwargs):
12387 """
12388 Above(self, Window sibling, int marg=0)
12389
12390 Constrains this edge to be above the given window, with an optional
12391 margin. Implicitly, this is relative to the top edge of the other
12392 window.
12393 """
12394 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12395
12396 def Below(*args, **kwargs):
12397 """
12398 Below(self, Window sibling, int marg=0)
12399
12400 Constrains this edge to be below the given window, with an optional
12401 margin. Implicitly, this is relative to the bottom edge of the other
12402 window.
12403 """
12404 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12405
12406 def SameAs(*args, **kwargs):
12407 """
12408 SameAs(self, Window otherW, int edge, int marg=0)
12409
12410 Constrains this edge or dimension to be to the same as the edge of the
12411 given window, with an optional margin.
12412 """
12413 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12414
12415 def PercentOf(*args, **kwargs):
12416 """
12417 PercentOf(self, Window otherW, int wh, int per)
12418
12419 Constrains this edge or dimension to be to a percentage of the given
12420 window, with an optional margin.
12421 """
12422 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12423
12424 def Absolute(*args, **kwargs):
12425 """
12426 Absolute(self, int val)
12427
12428 Constrains this edge or dimension to be the given absolute value.
12429 """
12430 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12431
12432 def Unconstrained(*args, **kwargs):
12433 """
12434 Unconstrained(self)
12435
12436 Sets this edge or dimension to be unconstrained, that is, dependent on
12437 other edges and dimensions from which this value can be deduced.
12438 """
12439 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12440
12441 def AsIs(*args, **kwargs):
12442 """
12443 AsIs(self)
12444
12445 Sets this edge or constraint to be whatever the window's value is at
12446 the moment. If either of the width and height constraints are *as is*,
12447 the window will not be resized, but moved instead. This is important
12448 when considering panel items which are intended to have a default
12449 size, such as a button, which may take its size from the size of the
12450 button label.
12451 """
12452 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12453
12454 def GetOtherWindow(*args, **kwargs):
12455 """GetOtherWindow(self) -> Window"""
12456 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12457
12458 def GetMyEdge(*args, **kwargs):
12459 """GetMyEdge(self) -> int"""
12460 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12461
12462 def SetEdge(*args, **kwargs):
12463 """SetEdge(self, int which)"""
12464 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12465
12466 def SetValue(*args, **kwargs):
12467 """SetValue(self, int v)"""
12468 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12469
12470 def GetMargin(*args, **kwargs):
12471 """GetMargin(self) -> int"""
12472 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12473
12474 def SetMargin(*args, **kwargs):
12475 """SetMargin(self, int m)"""
12476 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12477
12478 def GetValue(*args, **kwargs):
12479 """GetValue(self) -> int"""
12480 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12481
12482 def GetPercent(*args, **kwargs):
12483 """GetPercent(self) -> int"""
12484 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12485
12486 def GetOtherEdge(*args, **kwargs):
12487 """GetOtherEdge(self) -> int"""
12488 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12489
12490 def GetDone(*args, **kwargs):
12491 """GetDone(self) -> bool"""
12492 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12493
12494 def SetDone(*args, **kwargs):
12495 """SetDone(self, bool d)"""
12496 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12497
12498 def GetRelationship(*args, **kwargs):
12499 """GetRelationship(self) -> int"""
12500 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12501
12502 def SetRelationship(*args, **kwargs):
12503 """SetRelationship(self, int r)"""
12504 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12505
12506 def ResetIfWin(*args, **kwargs):
12507 """
12508 ResetIfWin(self, Window otherW) -> bool
12509
12510 Reset constraint if it mentions otherWin
12511 """
12512 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12513
12514 def SatisfyConstraint(*args, **kwargs):
12515 """
12516 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12517
12518 Try to satisfy constraint
12519 """
12520 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12521
12522 def GetEdge(*args, **kwargs):
12523 """
12524 GetEdge(self, int which, Window thisWin, Window other) -> int
12525
12526 Get the value of this edge or dimension, or if this
12527 is not determinable, -1.
12528 """
12529 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12530
12531 IndividualLayoutConstraint_swigregister = _core_.IndividualLayoutConstraint_swigregister
12532 IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12533
12534 class LayoutConstraints(Object):
12535 """
12536 **Note:** constraints are now deprecated and you should use sizers
12537 instead.
12538
12539 Objects of this class can be associated with a window to define its
12540 layout constraints, with respect to siblings or its parent.
12541
12542 The class consists of the following eight constraints of class
12543 wx.IndividualLayoutConstraint, some or all of which should be accessed
12544 directly to set the appropriate constraints.
12545
12546 * left: represents the left hand edge of the window
12547 * right: represents the right hand edge of the window
12548 * top: represents the top edge of the window
12549 * bottom: represents the bottom edge of the window
12550 * width: represents the width of the window
12551 * height: represents the height of the window
12552 * centreX: represents the horizontal centre point of the window
12553 * centreY: represents the vertical centre point of the window
12554
12555 Most constraints are initially set to have the relationship
12556 wxUnconstrained, which means that their values should be calculated by
12557 looking at known constraints. The exceptions are width and height,
12558 which are set to wxAsIs to ensure that if the user does not specify a
12559 constraint, the existing width and height will be used, to be
12560 compatible with panel items which often have take a default size. If
12561 the constraint is ``wx.AsIs``, the dimension will not be changed.
12562
12563 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12564
12565 """
12566 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12567 __repr__ = _swig_repr
12568 left = property(_core_.LayoutConstraints_left_get)
12569 top = property(_core_.LayoutConstraints_top_get)
12570 right = property(_core_.LayoutConstraints_right_get)
12571 bottom = property(_core_.LayoutConstraints_bottom_get)
12572 width = property(_core_.LayoutConstraints_width_get)
12573 height = property(_core_.LayoutConstraints_height_get)
12574 centreX = property(_core_.LayoutConstraints_centreX_get)
12575 centreY = property(_core_.LayoutConstraints_centreY_get)
12576 def __init__(self, *args, **kwargs):
12577 """__init__(self) -> LayoutConstraints"""
12578 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12579 __swig_destroy__ = _core_.delete_LayoutConstraints
12580 __del__ = lambda self : None;
12581 def SatisfyConstraints(*args, **kwargs):
12582 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12583 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12584
12585 def AreSatisfied(*args, **kwargs):
12586 """AreSatisfied(self) -> bool"""
12587 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12588
12589 LayoutConstraints_swigregister = _core_.LayoutConstraints_swigregister
12590 LayoutConstraints_swigregister(LayoutConstraints)
12591
12592 #----------------------------------------------------------------------------
12593
12594 # Use Python's bool constants if available, make some if not
12595 try:
12596 True
12597 except NameError:
12598 __builtins__.True = 1==1
12599 __builtins__.False = 1==0
12600 def bool(value): return not not value
12601 __builtins__.bool = bool
12602
12603
12604
12605 # workarounds for bad wxRTTI names
12606 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12607 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12608 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12609
12610
12611 #----------------------------------------------------------------------------
12612 # Load version numbers from __version__... Ensure that major and minor
12613 # versions are the same for both wxPython and wxWidgets.
12614
12615 from __version__ import *
12616 __version__ = VERSION_STRING
12617
12618 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12619 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12620 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12621 import warnings
12622 warnings.warn("wxPython/wxWidgets release number mismatch")
12623
12624 #----------------------------------------------------------------------------
12625
12626 # Set wxPython's default string<-->unicode conversion encoding from
12627 # the locale, but only if Python's default hasn't been changed. (We
12628 # assume that if the user has customized it already then that is the
12629 # encoding we need to use as well.)
12630 #
12631 # The encoding selected here is used when string or unicode objects
12632 # need to be converted in order to pass them to wxWidgets. Please be
12633 # aware that the default encoding within the same locale may be
12634 # slightly different on different platforms. For example, please see
12635 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12636 # between the common latin/roman encodings.
12637
12638 default = _sys.getdefaultencoding()
12639 if default == 'ascii':
12640 import locale
12641 import codecs
12642 try:
12643 default = locale.getdefaultlocale()[1]
12644 codecs.lookup(default)
12645 except (ValueError, LookupError, TypeError):
12646 default = _sys.getdefaultencoding()
12647 del locale
12648 del codecs
12649 if default:
12650 wx.SetDefaultPyEncoding(default)
12651 del default
12652
12653 #----------------------------------------------------------------------------
12654
12655 class PyDeadObjectError(AttributeError):
12656 pass
12657
12658 class _wxPyDeadObject(object):
12659 """
12660 Instances of wx objects that are OOR capable will have their __class__
12661 changed to this class when the C++ object is deleted. This should help
12662 prevent crashes due to referencing a bogus C++ pointer.
12663 """
12664 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12665 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12666
12667 def __repr__(self):
12668 if not hasattr(self, "_name"):
12669 self._name = "[unknown]"
12670 return self.reprStr % self._name
12671
12672 def __getattr__(self, *args):
12673 if not hasattr(self, "_name"):
12674 self._name = "[unknown]"
12675 raise PyDeadObjectError(self.attrStr % self._name)
12676
12677 def __nonzero__(self):
12678 return 0
12679
12680
12681
12682 class PyUnbornObjectError(AttributeError):
12683 pass
12684
12685 class _wxPyUnbornObject(object):
12686 """
12687 Some stock objects are created when the wx._core module is
12688 imported, but their C++ instance is not created until the wx.App
12689 object is created and initialized. These object instances will
12690 temporarily have their __class__ changed to this class so an
12691 exception will be raised if they are used before the C++ instance
12692 is ready.
12693 """
12694
12695 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12696 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12697
12698 def __repr__(self):
12699 #if not hasattr(self, "_name"):
12700 # self._name = "[unknown]"
12701 return self.reprStr #% self._name
12702
12703 def __getattr__(self, *args):
12704 #if not hasattr(self, "_name"):
12705 # self._name = "[unknown]"
12706 raise PyUnbornObjectError(self.attrStr) # % self._name )
12707
12708 def __nonzero__(self):
12709 return 0
12710
12711
12712 #----------------------------------------------------------------------------
12713
12714 def CallAfter(callable, *args, **kw):
12715 """
12716 Call the specified function after the current and pending event
12717 handlers have been completed. This is also good for making GUI
12718 method calls from non-GUI threads. Any extra positional or
12719 keyword args are passed on to the callable when it is called.
12720
12721 :see: `wx.FutureCall`
12722 """
12723 app = wx.GetApp()
12724 assert app is not None, 'No wx.App created yet'
12725
12726 if not hasattr(app, "_CallAfterId"):
12727 app._CallAfterId = wx.NewEventType()
12728 app.Connect(-1, -1, app._CallAfterId,
12729 lambda event: event.callable(*event.args, **event.kw) )
12730 evt = wx.PyEvent()
12731 evt.SetEventType(app._CallAfterId)
12732 evt.callable = callable
12733 evt.args = args
12734 evt.kw = kw
12735 wx.PostEvent(app, evt)
12736
12737 #----------------------------------------------------------------------------
12738
12739
12740 class FutureCall:
12741 """
12742 A convenience class for `wx.Timer`, that calls the given callable
12743 object once after the given amount of milliseconds, passing any
12744 positional or keyword args. The return value of the callable is
12745 availbale after it has been run with the `GetResult` method.
12746
12747 If you don't need to get the return value or restart the timer
12748 then there is no need to hold a reference to this object. It will
12749 hold a reference to itself while the timer is running (the timer
12750 has a reference to self.Notify) but the cycle will be broken when
12751 the timer completes, automatically cleaning up the wx.FutureCall
12752 object.
12753
12754 :see: `wx.CallAfter`
12755 """
12756 def __init__(self, millis, callable, *args, **kwargs):
12757 self.millis = millis
12758 self.callable = callable
12759 self.SetArgs(*args, **kwargs)
12760 self.runCount = 0
12761 self.running = False
12762 self.hasRun = False
12763 self.result = None
12764 self.timer = None
12765 self.Start()
12766
12767 def __del__(self):
12768 self.Stop()
12769
12770
12771 def Start(self, millis=None, *args, **kwargs):
12772 """
12773 (Re)start the timer
12774 """
12775 self.hasRun = False
12776 if millis is not None:
12777 self.millis = millis
12778 if args or kwargs:
12779 self.SetArgs(*args, **kwargs)
12780 self.Stop()
12781 self.timer = wx.PyTimer(self.Notify)
12782 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12783 self.running = True
12784 Restart = Start
12785
12786
12787 def Stop(self):
12788 """
12789 Stop and destroy the timer.
12790 """
12791 if self.timer is not None:
12792 self.timer.Stop()
12793 self.timer = None
12794
12795
12796 def GetInterval(self):
12797 if self.timer is not None:
12798 return self.timer.GetInterval()
12799 else:
12800 return 0
12801
12802
12803 def IsRunning(self):
12804 return self.timer is not None and self.timer.IsRunning()
12805
12806
12807 def SetArgs(self, *args, **kwargs):
12808 """
12809 (Re)set the args passed to the callable object. This is
12810 useful in conjunction with Restart if you want to schedule a
12811 new call to the same callable object but with different
12812 parameters.
12813 """
12814 self.args = args
12815 self.kwargs = kwargs
12816
12817
12818 def HasRun(self):
12819 return self.hasRun
12820
12821 def GetResult(self):
12822 return self.result
12823
12824 def Notify(self):
12825 """
12826 The timer has expired so call the callable.
12827 """
12828 if self.callable and getattr(self.callable, 'im_self', True):
12829 self.runCount += 1
12830 self.running = False
12831 self.result = self.callable(*self.args, **self.kwargs)
12832 self.hasRun = True
12833 if not self.running:
12834 # if it wasn't restarted, then cleanup
12835 wx.CallAfter(self.Stop)
12836
12837
12838
12839 #----------------------------------------------------------------------------
12840 # Control which items in this module should be documented by epydoc.
12841 # We allow only classes and functions, which will help reduce the size
12842 # of the docs by filtering out the zillions of constants, EVT objects,
12843 # and etc that don't make much sense by themselves, but are instead
12844 # documented (or will be) as part of the classes/functions/methods
12845 # where they should be used.
12846
12847 class __DocFilter:
12848 """
12849 A filter for epydoc that only allows non-Ptr classes and
12850 fucntions, in order to reduce the clutter in the API docs.
12851 """
12852 def __init__(self, globals):
12853 self._globals = globals
12854
12855 def __call__(self, name):
12856 import types
12857 obj = self._globals.get(name, None)
12858 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12859 return False
12860 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12861 return False
12862 return True
12863
12864 #----------------------------------------------------------------------------
12865 #----------------------------------------------------------------------------
12866
12867 # Import other modules in this package that should show up in the
12868 # "core" wx namespace
12869 from _gdi import *
12870 from _windows import *
12871 from _controls import *
12872 from _misc import *
12873
12874
12875 # Fixup the stock objects since they can't be used yet. (They will be
12876 # restored in wx.PyApp.OnInit.)
12877 _core_._wxPyFixStockObjects()
12878
12879 #----------------------------------------------------------------------------
12880 #----------------------------------------------------------------------------
12881
12882
12883