]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
d64f158bbb9c2adc9cfbb83f566c78b496665fa9
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5
6 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
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) or (name == "thisown"):
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 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28 import types
29 try:
30 _object = types.ObjectType
31 _newclass = 1
32 except AttributeError:
33 class _object : pass
34 _newclass = 0
35 del types
36
37
38 def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
47 #// Give a reference to the dictionary of this module to the C++ extension
48 #// code.
49 _core_._wxPySetDictionary(vars())
50
51 #// A little trick to make 'wx' be a reference to this module so wx.Names can
52 #// be used here.
53 import sys as _sys
54 wx = _sys.modules[__name__]
55
56
57 #----------------------------------------------------------------------------
58
59 def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74 #----------------------------------------------------------------------------
75
76 NOT_FOUND = _core_.NOT_FOUND
77 VSCROLL = _core_.VSCROLL
78 HSCROLL = _core_.HSCROLL
79 CAPTION = _core_.CAPTION
80 DOUBLE_BORDER = _core_.DOUBLE_BORDER
81 SUNKEN_BORDER = _core_.SUNKEN_BORDER
82 RAISED_BORDER = _core_.RAISED_BORDER
83 BORDER = _core_.BORDER
84 SIMPLE_BORDER = _core_.SIMPLE_BORDER
85 STATIC_BORDER = _core_.STATIC_BORDER
86 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87 NO_BORDER = _core_.NO_BORDER
88 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
89 WANTS_CHARS = _core_.WANTS_CHARS
90 POPUP_WINDOW = _core_.POPUP_WINDOW
91 CENTER_FRAME = _core_.CENTER_FRAME
92 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
93 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
94 ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
95 ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
96 ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
97 ED_STATIC_LINE = _core_.ED_STATIC_LINE
98 EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
99 CLIP_CHILDREN = _core_.CLIP_CHILDREN
100 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
101 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
102 RETAINED = _core_.RETAINED
103 BACKINGSTORE = _core_.BACKINGSTORE
104 COLOURED = _core_.COLOURED
105 FIXED_LENGTH = _core_.FIXED_LENGTH
106 LB_NEEDED_SB = _core_.LB_NEEDED_SB
107 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
108 LB_SORT = _core_.LB_SORT
109 LB_SINGLE = _core_.LB_SINGLE
110 LB_MULTIPLE = _core_.LB_MULTIPLE
111 LB_EXTENDED = _core_.LB_EXTENDED
112 LB_OWNERDRAW = _core_.LB_OWNERDRAW
113 LB_HSCROLL = _core_.LB_HSCROLL
114 PROCESS_ENTER = _core_.PROCESS_ENTER
115 PASSWORD = _core_.PASSWORD
116 CB_SIMPLE = _core_.CB_SIMPLE
117 CB_DROPDOWN = _core_.CB_DROPDOWN
118 CB_SORT = _core_.CB_SORT
119 CB_READONLY = _core_.CB_READONLY
120 RA_HORIZONTAL = _core_.RA_HORIZONTAL
121 RA_VERTICAL = _core_.RA_VERTICAL
122 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
123 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
124 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
125 RB_GROUP = _core_.RB_GROUP
126 RB_SINGLE = _core_.RB_SINGLE
127 SB_HORIZONTAL = _core_.SB_HORIZONTAL
128 SB_VERTICAL = _core_.SB_VERTICAL
129 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
130 ST_SIZEGRIP = _core_.ST_SIZEGRIP
131 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
132 FLOOD_SURFACE = _core_.FLOOD_SURFACE
133 FLOOD_BORDER = _core_.FLOOD_BORDER
134 ODDEVEN_RULE = _core_.ODDEVEN_RULE
135 WINDING_RULE = _core_.WINDING_RULE
136 TOOL_TOP = _core_.TOOL_TOP
137 TOOL_BOTTOM = _core_.TOOL_BOTTOM
138 TOOL_LEFT = _core_.TOOL_LEFT
139 TOOL_RIGHT = _core_.TOOL_RIGHT
140 OK = _core_.OK
141 YES_NO = _core_.YES_NO
142 CANCEL = _core_.CANCEL
143 YES = _core_.YES
144 NO = _core_.NO
145 NO_DEFAULT = _core_.NO_DEFAULT
146 YES_DEFAULT = _core_.YES_DEFAULT
147 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
148 ICON_HAND = _core_.ICON_HAND
149 ICON_QUESTION = _core_.ICON_QUESTION
150 ICON_INFORMATION = _core_.ICON_INFORMATION
151 ICON_STOP = _core_.ICON_STOP
152 ICON_ASTERISK = _core_.ICON_ASTERISK
153 ICON_MASK = _core_.ICON_MASK
154 ICON_WARNING = _core_.ICON_WARNING
155 ICON_ERROR = _core_.ICON_ERROR
156 FORWARD = _core_.FORWARD
157 BACKWARD = _core_.BACKWARD
158 RESET = _core_.RESET
159 HELP = _core_.HELP
160 MORE = _core_.MORE
161 SETUP = _core_.SETUP
162 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
163 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
164 SIZE_AUTO = _core_.SIZE_AUTO
165 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
166 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
167 PORTRAIT = _core_.PORTRAIT
168 LANDSCAPE = _core_.LANDSCAPE
169 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
170 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
171 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
172 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
173 ID_ANY = _core_.ID_ANY
174 ID_SEPARATOR = _core_.ID_SEPARATOR
175 ID_LOWEST = _core_.ID_LOWEST
176 ID_OPEN = _core_.ID_OPEN
177 ID_CLOSE = _core_.ID_CLOSE
178 ID_NEW = _core_.ID_NEW
179 ID_SAVE = _core_.ID_SAVE
180 ID_SAVEAS = _core_.ID_SAVEAS
181 ID_REVERT = _core_.ID_REVERT
182 ID_EXIT = _core_.ID_EXIT
183 ID_UNDO = _core_.ID_UNDO
184 ID_REDO = _core_.ID_REDO
185 ID_HELP = _core_.ID_HELP
186 ID_PRINT = _core_.ID_PRINT
187 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
188 ID_PREVIEW = _core_.ID_PREVIEW
189 ID_ABOUT = _core_.ID_ABOUT
190 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
191 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
192 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
193 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
194 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
195 ID_PREFERENCES = _core_.ID_PREFERENCES
196 ID_CUT = _core_.ID_CUT
197 ID_COPY = _core_.ID_COPY
198 ID_PASTE = _core_.ID_PASTE
199 ID_CLEAR = _core_.ID_CLEAR
200 ID_FIND = _core_.ID_FIND
201 ID_DUPLICATE = _core_.ID_DUPLICATE
202 ID_SELECTALL = _core_.ID_SELECTALL
203 ID_DELETE = _core_.ID_DELETE
204 ID_REPLACE = _core_.ID_REPLACE
205 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
206 ID_PROPERTIES = _core_.ID_PROPERTIES
207 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
208 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
209 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
210 ID_VIEW_LIST = _core_.ID_VIEW_LIST
211 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
212 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
213 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
214 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
215 ID_FILE1 = _core_.ID_FILE1
216 ID_FILE2 = _core_.ID_FILE2
217 ID_FILE3 = _core_.ID_FILE3
218 ID_FILE4 = _core_.ID_FILE4
219 ID_FILE5 = _core_.ID_FILE5
220 ID_FILE6 = _core_.ID_FILE6
221 ID_FILE7 = _core_.ID_FILE7
222 ID_FILE8 = _core_.ID_FILE8
223 ID_FILE9 = _core_.ID_FILE9
224 ID_OK = _core_.ID_OK
225 ID_CANCEL = _core_.ID_CANCEL
226 ID_APPLY = _core_.ID_APPLY
227 ID_YES = _core_.ID_YES
228 ID_NO = _core_.ID_NO
229 ID_STATIC = _core_.ID_STATIC
230 ID_FORWARD = _core_.ID_FORWARD
231 ID_BACKWARD = _core_.ID_BACKWARD
232 ID_DEFAULT = _core_.ID_DEFAULT
233 ID_MORE = _core_.ID_MORE
234 ID_SETUP = _core_.ID_SETUP
235 ID_RESET = _core_.ID_RESET
236 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
237 ID_YESTOALL = _core_.ID_YESTOALL
238 ID_NOTOALL = _core_.ID_NOTOALL
239 ID_ABORT = _core_.ID_ABORT
240 ID_RETRY = _core_.ID_RETRY
241 ID_IGNORE = _core_.ID_IGNORE
242 ID_ADD = _core_.ID_ADD
243 ID_REMOVE = _core_.ID_REMOVE
244 ID_UP = _core_.ID_UP
245 ID_DOWN = _core_.ID_DOWN
246 ID_HOME = _core_.ID_HOME
247 ID_REFRESH = _core_.ID_REFRESH
248 ID_STOP = _core_.ID_STOP
249 ID_INDEX = _core_.ID_INDEX
250 ID_BOLD = _core_.ID_BOLD
251 ID_ITALIC = _core_.ID_ITALIC
252 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
253 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
254 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
255 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
256 ID_UNDERLINE = _core_.ID_UNDERLINE
257 ID_INDENT = _core_.ID_INDENT
258 ID_UNINDENT = _core_.ID_UNINDENT
259 ID_ZOOM_100 = _core_.ID_ZOOM_100
260 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
261 ID_ZOOM_IN = _core_.ID_ZOOM_IN
262 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
263 ID_UNDELETE = _core_.ID_UNDELETE
264 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
265 ID_HIGHEST = _core_.ID_HIGHEST
266 OPEN = _core_.OPEN
267 SAVE = _core_.SAVE
268 HIDE_READONLY = _core_.HIDE_READONLY
269 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
270 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
271 MULTIPLE = _core_.MULTIPLE
272 CHANGE_DIR = _core_.CHANGE_DIR
273 ACCEL_ALT = _core_.ACCEL_ALT
274 ACCEL_CTRL = _core_.ACCEL_CTRL
275 ACCEL_SHIFT = _core_.ACCEL_SHIFT
276 ACCEL_NORMAL = _core_.ACCEL_NORMAL
277 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
278 PD_APP_MODAL = _core_.PD_APP_MODAL
279 PD_CAN_ABORT = _core_.PD_CAN_ABORT
280 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
281 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
282 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
283 PD_SMOOTH = _core_.PD_SMOOTH
284 PD_CAN_SKIP = _core_.PD_CAN_SKIP
285 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
286 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
287 MENU_TEAROFF = _core_.MENU_TEAROFF
288 MB_DOCKABLE = _core_.MB_DOCKABLE
289 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
290 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
291 LI_HORIZONTAL = _core_.LI_HORIZONTAL
292 LI_VERTICAL = _core_.LI_VERTICAL
293 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
294 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
295 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
296 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
297 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
298 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
299 MM_TEXT = _core_.MM_TEXT
300 MM_LOMETRIC = _core_.MM_LOMETRIC
301 MM_HIMETRIC = _core_.MM_HIMETRIC
302 MM_LOENGLISH = _core_.MM_LOENGLISH
303 MM_HIENGLISH = _core_.MM_HIENGLISH
304 MM_TWIPS = _core_.MM_TWIPS
305 MM_ISOTROPIC = _core_.MM_ISOTROPIC
306 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
307 MM_POINTS = _core_.MM_POINTS
308 MM_METRIC = _core_.MM_METRIC
309 CENTRE = _core_.CENTRE
310 CENTER = _core_.CENTER
311 HORIZONTAL = _core_.HORIZONTAL
312 VERTICAL = _core_.VERTICAL
313 BOTH = _core_.BOTH
314 LEFT = _core_.LEFT
315 RIGHT = _core_.RIGHT
316 UP = _core_.UP
317 DOWN = _core_.DOWN
318 TOP = _core_.TOP
319 BOTTOM = _core_.BOTTOM
320 NORTH = _core_.NORTH
321 SOUTH = _core_.SOUTH
322 WEST = _core_.WEST
323 EAST = _core_.EAST
324 ALL = _core_.ALL
325 ALIGN_NOT = _core_.ALIGN_NOT
326 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
327 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
328 ALIGN_LEFT = _core_.ALIGN_LEFT
329 ALIGN_TOP = _core_.ALIGN_TOP
330 ALIGN_RIGHT = _core_.ALIGN_RIGHT
331 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
332 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
333 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
334 ALIGN_CENTER = _core_.ALIGN_CENTER
335 ALIGN_CENTRE = _core_.ALIGN_CENTRE
336 ALIGN_MASK = _core_.ALIGN_MASK
337 STRETCH_NOT = _core_.STRETCH_NOT
338 SHRINK = _core_.SHRINK
339 GROW = _core_.GROW
340 EXPAND = _core_.EXPAND
341 SHAPED = _core_.SHAPED
342 FIXED_MINSIZE = _core_.FIXED_MINSIZE
343 TILE = _core_.TILE
344 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
345 BORDER_DEFAULT = _core_.BORDER_DEFAULT
346 BORDER_NONE = _core_.BORDER_NONE
347 BORDER_STATIC = _core_.BORDER_STATIC
348 BORDER_SIMPLE = _core_.BORDER_SIMPLE
349 BORDER_RAISED = _core_.BORDER_RAISED
350 BORDER_SUNKEN = _core_.BORDER_SUNKEN
351 BORDER_DOUBLE = _core_.BORDER_DOUBLE
352 BORDER_MASK = _core_.BORDER_MASK
353 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
354 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
355 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
356 DEFAULT = _core_.DEFAULT
357 DECORATIVE = _core_.DECORATIVE
358 ROMAN = _core_.ROMAN
359 SCRIPT = _core_.SCRIPT
360 SWISS = _core_.SWISS
361 MODERN = _core_.MODERN
362 TELETYPE = _core_.TELETYPE
363 VARIABLE = _core_.VARIABLE
364 FIXED = _core_.FIXED
365 NORMAL = _core_.NORMAL
366 LIGHT = _core_.LIGHT
367 BOLD = _core_.BOLD
368 ITALIC = _core_.ITALIC
369 SLANT = _core_.SLANT
370 SOLID = _core_.SOLID
371 DOT = _core_.DOT
372 LONG_DASH = _core_.LONG_DASH
373 SHORT_DASH = _core_.SHORT_DASH
374 DOT_DASH = _core_.DOT_DASH
375 USER_DASH = _core_.USER_DASH
376 TRANSPARENT = _core_.TRANSPARENT
377 STIPPLE = _core_.STIPPLE
378 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
379 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
380 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
381 CROSS_HATCH = _core_.CROSS_HATCH
382 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
383 VERTICAL_HATCH = _core_.VERTICAL_HATCH
384 JOIN_BEVEL = _core_.JOIN_BEVEL
385 JOIN_MITER = _core_.JOIN_MITER
386 JOIN_ROUND = _core_.JOIN_ROUND
387 CAP_ROUND = _core_.CAP_ROUND
388 CAP_PROJECTING = _core_.CAP_PROJECTING
389 CAP_BUTT = _core_.CAP_BUTT
390 CLEAR = _core_.CLEAR
391 XOR = _core_.XOR
392 INVERT = _core_.INVERT
393 OR_REVERSE = _core_.OR_REVERSE
394 AND_REVERSE = _core_.AND_REVERSE
395 COPY = _core_.COPY
396 AND = _core_.AND
397 AND_INVERT = _core_.AND_INVERT
398 NO_OP = _core_.NO_OP
399 NOR = _core_.NOR
400 EQUIV = _core_.EQUIV
401 SRC_INVERT = _core_.SRC_INVERT
402 OR_INVERT = _core_.OR_INVERT
403 NAND = _core_.NAND
404 OR = _core_.OR
405 SET = _core_.SET
406 WXK_BACK = _core_.WXK_BACK
407 WXK_TAB = _core_.WXK_TAB
408 WXK_RETURN = _core_.WXK_RETURN
409 WXK_ESCAPE = _core_.WXK_ESCAPE
410 WXK_SPACE = _core_.WXK_SPACE
411 WXK_DELETE = _core_.WXK_DELETE
412 WXK_START = _core_.WXK_START
413 WXK_LBUTTON = _core_.WXK_LBUTTON
414 WXK_RBUTTON = _core_.WXK_RBUTTON
415 WXK_CANCEL = _core_.WXK_CANCEL
416 WXK_MBUTTON = _core_.WXK_MBUTTON
417 WXK_CLEAR = _core_.WXK_CLEAR
418 WXK_SHIFT = _core_.WXK_SHIFT
419 WXK_ALT = _core_.WXK_ALT
420 WXK_CONTROL = _core_.WXK_CONTROL
421 WXK_MENU = _core_.WXK_MENU
422 WXK_PAUSE = _core_.WXK_PAUSE
423 WXK_CAPITAL = _core_.WXK_CAPITAL
424 WXK_PRIOR = _core_.WXK_PRIOR
425 WXK_NEXT = _core_.WXK_NEXT
426 WXK_END = _core_.WXK_END
427 WXK_HOME = _core_.WXK_HOME
428 WXK_LEFT = _core_.WXK_LEFT
429 WXK_UP = _core_.WXK_UP
430 WXK_RIGHT = _core_.WXK_RIGHT
431 WXK_DOWN = _core_.WXK_DOWN
432 WXK_SELECT = _core_.WXK_SELECT
433 WXK_PRINT = _core_.WXK_PRINT
434 WXK_EXECUTE = _core_.WXK_EXECUTE
435 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
436 WXK_INSERT = _core_.WXK_INSERT
437 WXK_HELP = _core_.WXK_HELP
438 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
439 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
440 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
441 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
442 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
443 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
444 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
445 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
446 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
447 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
448 WXK_MULTIPLY = _core_.WXK_MULTIPLY
449 WXK_ADD = _core_.WXK_ADD
450 WXK_SEPARATOR = _core_.WXK_SEPARATOR
451 WXK_SUBTRACT = _core_.WXK_SUBTRACT
452 WXK_DECIMAL = _core_.WXK_DECIMAL
453 WXK_DIVIDE = _core_.WXK_DIVIDE
454 WXK_F1 = _core_.WXK_F1
455 WXK_F2 = _core_.WXK_F2
456 WXK_F3 = _core_.WXK_F3
457 WXK_F4 = _core_.WXK_F4
458 WXK_F5 = _core_.WXK_F5
459 WXK_F6 = _core_.WXK_F6
460 WXK_F7 = _core_.WXK_F7
461 WXK_F8 = _core_.WXK_F8
462 WXK_F9 = _core_.WXK_F9
463 WXK_F10 = _core_.WXK_F10
464 WXK_F11 = _core_.WXK_F11
465 WXK_F12 = _core_.WXK_F12
466 WXK_F13 = _core_.WXK_F13
467 WXK_F14 = _core_.WXK_F14
468 WXK_F15 = _core_.WXK_F15
469 WXK_F16 = _core_.WXK_F16
470 WXK_F17 = _core_.WXK_F17
471 WXK_F18 = _core_.WXK_F18
472 WXK_F19 = _core_.WXK_F19
473 WXK_F20 = _core_.WXK_F20
474 WXK_F21 = _core_.WXK_F21
475 WXK_F22 = _core_.WXK_F22
476 WXK_F23 = _core_.WXK_F23
477 WXK_F24 = _core_.WXK_F24
478 WXK_NUMLOCK = _core_.WXK_NUMLOCK
479 WXK_SCROLL = _core_.WXK_SCROLL
480 WXK_PAGEUP = _core_.WXK_PAGEUP
481 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
482 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
483 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
484 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
485 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
486 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
487 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
488 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
489 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
490 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
491 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
492 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
493 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
494 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
495 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
496 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
497 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
498 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
499 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
500 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
501 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
502 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
503 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
504 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
505 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
506 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
507 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
508 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
509 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
510 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
511 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
512 PAPER_NONE = _core_.PAPER_NONE
513 PAPER_LETTER = _core_.PAPER_LETTER
514 PAPER_LEGAL = _core_.PAPER_LEGAL
515 PAPER_A4 = _core_.PAPER_A4
516 PAPER_CSHEET = _core_.PAPER_CSHEET
517 PAPER_DSHEET = _core_.PAPER_DSHEET
518 PAPER_ESHEET = _core_.PAPER_ESHEET
519 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
520 PAPER_TABLOID = _core_.PAPER_TABLOID
521 PAPER_LEDGER = _core_.PAPER_LEDGER
522 PAPER_STATEMENT = _core_.PAPER_STATEMENT
523 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
524 PAPER_A3 = _core_.PAPER_A3
525 PAPER_A4SMALL = _core_.PAPER_A4SMALL
526 PAPER_A5 = _core_.PAPER_A5
527 PAPER_B4 = _core_.PAPER_B4
528 PAPER_B5 = _core_.PAPER_B5
529 PAPER_FOLIO = _core_.PAPER_FOLIO
530 PAPER_QUARTO = _core_.PAPER_QUARTO
531 PAPER_10X14 = _core_.PAPER_10X14
532 PAPER_11X17 = _core_.PAPER_11X17
533 PAPER_NOTE = _core_.PAPER_NOTE
534 PAPER_ENV_9 = _core_.PAPER_ENV_9
535 PAPER_ENV_10 = _core_.PAPER_ENV_10
536 PAPER_ENV_11 = _core_.PAPER_ENV_11
537 PAPER_ENV_12 = _core_.PAPER_ENV_12
538 PAPER_ENV_14 = _core_.PAPER_ENV_14
539 PAPER_ENV_DL = _core_.PAPER_ENV_DL
540 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
541 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
542 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
543 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
544 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
545 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
546 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
547 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
548 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
549 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
550 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
551 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
552 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
553 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
554 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
555 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
556 PAPER_9X11 = _core_.PAPER_9X11
557 PAPER_10X11 = _core_.PAPER_10X11
558 PAPER_15X11 = _core_.PAPER_15X11
559 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
560 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
561 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
562 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
563 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
564 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
565 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
566 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
567 PAPER_A_PLUS = _core_.PAPER_A_PLUS
568 PAPER_B_PLUS = _core_.PAPER_B_PLUS
569 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
570 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
571 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
572 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
573 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
574 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
575 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
576 PAPER_A2 = _core_.PAPER_A2
577 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
578 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
579 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
580 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
581 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
582 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
583 ITEM_NORMAL = _core_.ITEM_NORMAL
584 ITEM_CHECK = _core_.ITEM_CHECK
585 ITEM_RADIO = _core_.ITEM_RADIO
586 ITEM_MAX = _core_.ITEM_MAX
587 HT_NOWHERE = _core_.HT_NOWHERE
588 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
589 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
590 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
591 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
592 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
593 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
594 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
595 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
596 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
597 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
598 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
599 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
600 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
601 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
602 HT_MAX = _core_.HT_MAX
603 MOD_NONE = _core_.MOD_NONE
604 MOD_ALT = _core_.MOD_ALT
605 MOD_CONTROL = _core_.MOD_CONTROL
606 MOD_SHIFT = _core_.MOD_SHIFT
607 MOD_WIN = _core_.MOD_WIN
608 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
609 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
610 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
611 #---------------------------------------------------------------------------
612
613 class Object(object):
614 """
615 The base class for most wx objects, although in wxPython not
616 much functionality is needed nor exposed.
617 """
618 def __init__(self): raise RuntimeError, "No constructor defined"
619 def __repr__(self):
620 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
621 def GetClassName(*args, **kwargs):
622 """
623 GetClassName(self) -> String
624
625 Returns the class name of the C++ class using wxRTTI.
626 """
627 return _core_.Object_GetClassName(*args, **kwargs)
628
629 def Destroy(*args, **kwargs):
630 """
631 Destroy(self)
632
633 Deletes the C++ object this Python object is a proxy for.
634 """
635 return _core_.Object_Destroy(*args, **kwargs)
636
637
638 class ObjectPtr(Object):
639 def __init__(self, this):
640 self.this = this
641 if not hasattr(self,"thisown"): self.thisown = 0
642 self.__class__ = Object
643 _core_.Object_swigregister(ObjectPtr)
644 _wxPySetDictionary = _core_._wxPySetDictionary
645
646 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
647
648 cvar = _core_.cvar
649 EmptyString = cvar.EmptyString
650
651 #---------------------------------------------------------------------------
652
653 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
654 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
655 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
656 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
657 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
658 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
659 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
660 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
661 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
662 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
663 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
664 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
665 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
666 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
667 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
668 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
669 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
670 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
671 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
672 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
673 CURSOR_NONE = _core_.CURSOR_NONE
674 CURSOR_ARROW = _core_.CURSOR_ARROW
675 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
676 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
677 CURSOR_CHAR = _core_.CURSOR_CHAR
678 CURSOR_CROSS = _core_.CURSOR_CROSS
679 CURSOR_HAND = _core_.CURSOR_HAND
680 CURSOR_IBEAM = _core_.CURSOR_IBEAM
681 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
682 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
683 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
684 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
685 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
686 CURSOR_PENCIL = _core_.CURSOR_PENCIL
687 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
688 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
689 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
690 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
691 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
692 CURSOR_SIZENS = _core_.CURSOR_SIZENS
693 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
694 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
695 CURSOR_SIZING = _core_.CURSOR_SIZING
696 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
697 CURSOR_WAIT = _core_.CURSOR_WAIT
698 CURSOR_WATCH = _core_.CURSOR_WATCH
699 CURSOR_BLANK = _core_.CURSOR_BLANK
700 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
701 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
702 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
703 CURSOR_MAX = _core_.CURSOR_MAX
704 #---------------------------------------------------------------------------
705
706 class Size(object):
707 """
708 wx.Size is a useful data structure used to represent the size of
709 something. It simply contians integer width and height
710 proprtites. In most places in wxPython where a wx.Size is
711 expected a (width, height) tuple can be used instead.
712 """
713 def __repr__(self):
714 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
715 width = property(_core_.Size_width_get, _core_.Size_width_set)
716 height = property(_core_.Size_height_get, _core_.Size_height_set)
717 x = width; y = height
718 def __init__(self, *args, **kwargs):
719 """
720 __init__(self, int w=0, int h=0) -> Size
721
722 Creates a size object.
723 """
724 newobj = _core_.new_Size(*args, **kwargs)
725 self.this = newobj.this
726 self.thisown = 1
727 del newobj.thisown
728 def __del__(self, destroy=_core_.delete_Size):
729 """__del__(self)"""
730 try:
731 if self.thisown: destroy(self)
732 except: pass
733
734 def __eq__(*args, **kwargs):
735 """
736 __eq__(self, Size sz) -> bool
737
738 Test for equality of wx.Size objects.
739 """
740 return _core_.Size___eq__(*args, **kwargs)
741
742 def __ne__(*args, **kwargs):
743 """
744 __ne__(self, Size sz) -> bool
745
746 Test for inequality.
747 """
748 return _core_.Size___ne__(*args, **kwargs)
749
750 def __add__(*args, **kwargs):
751 """
752 __add__(self, Size sz) -> Size
753
754 Add sz's proprties to this and return the result.
755 """
756 return _core_.Size___add__(*args, **kwargs)
757
758 def __sub__(*args, **kwargs):
759 """
760 __sub__(self, Size sz) -> Size
761
762 Subtract sz's properties from this and return the result.
763 """
764 return _core_.Size___sub__(*args, **kwargs)
765
766 def IncTo(*args, **kwargs):
767 """
768 IncTo(self, Size sz)
769
770 Increments this object so that both of its dimensions are not less
771 than the corresponding dimensions of the size.
772 """
773 return _core_.Size_IncTo(*args, **kwargs)
774
775 def DecTo(*args, **kwargs):
776 """
777 DecTo(self, Size sz)
778
779 Decrements this object so that both of its dimensions are not greater
780 than the corresponding dimensions of the size.
781 """
782 return _core_.Size_DecTo(*args, **kwargs)
783
784 def Set(*args, **kwargs):
785 """
786 Set(self, int w, int h)
787
788 Set both width and height.
789 """
790 return _core_.Size_Set(*args, **kwargs)
791
792 def SetWidth(*args, **kwargs):
793 """SetWidth(self, int w)"""
794 return _core_.Size_SetWidth(*args, **kwargs)
795
796 def SetHeight(*args, **kwargs):
797 """SetHeight(self, int h)"""
798 return _core_.Size_SetHeight(*args, **kwargs)
799
800 def GetWidth(*args, **kwargs):
801 """GetWidth(self) -> int"""
802 return _core_.Size_GetWidth(*args, **kwargs)
803
804 def GetHeight(*args, **kwargs):
805 """GetHeight(self) -> int"""
806 return _core_.Size_GetHeight(*args, **kwargs)
807
808 def IsFullySpecified(*args, **kwargs):
809 """
810 IsFullySpecified(self) -> bool
811
812 Returns True if both components of the size are non-default values.
813 """
814 return _core_.Size_IsFullySpecified(*args, **kwargs)
815
816 def SetDefaults(*args, **kwargs):
817 """
818 SetDefaults(self, Size size)
819
820 Combine this size with the other one replacing the default components
821 of this object (i.e. equal to -1) with those of the other.
822 """
823 return _core_.Size_SetDefaults(*args, **kwargs)
824
825 def Get(*args, **kwargs):
826 """
827 Get() -> (width,height)
828
829 Returns the width and height properties as a tuple.
830 """
831 return _core_.Size_Get(*args, **kwargs)
832
833 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
834 def __str__(self): return str(self.Get())
835 def __repr__(self): return 'wx.Size'+str(self.Get())
836 def __len__(self): return len(self.Get())
837 def __getitem__(self, index): return self.Get()[index]
838 def __setitem__(self, index, val):
839 if index == 0: self.width = val
840 elif index == 1: self.height = val
841 else: raise IndexError
842 def __nonzero__(self): return self.Get() != (0,0)
843 __safe_for_unpickling__ = True
844 def __reduce__(self): return (wx.Size, self.Get())
845
846
847 class SizePtr(Size):
848 def __init__(self, this):
849 self.this = this
850 if not hasattr(self,"thisown"): self.thisown = 0
851 self.__class__ = Size
852 _core_.Size_swigregister(SizePtr)
853
854 #---------------------------------------------------------------------------
855
856 class RealPoint(object):
857 """
858 A data structure for representing a point or position with floating
859 point x and y properties. In wxPython most places that expect a
860 wx.RealPoint can also accept a (x,y) tuple.
861 """
862 def __repr__(self):
863 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
864 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
865 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
866 def __init__(self, *args, **kwargs):
867 """
868 __init__(self, double x=0.0, double y=0.0) -> RealPoint
869
870 Create a wx.RealPoint object
871 """
872 newobj = _core_.new_RealPoint(*args, **kwargs)
873 self.this = newobj.this
874 self.thisown = 1
875 del newobj.thisown
876 def __del__(self, destroy=_core_.delete_RealPoint):
877 """__del__(self)"""
878 try:
879 if self.thisown: destroy(self)
880 except: pass
881
882 def __eq__(*args, **kwargs):
883 """
884 __eq__(self, RealPoint pt) -> bool
885
886 Test for equality of wx.RealPoint objects.
887 """
888 return _core_.RealPoint___eq__(*args, **kwargs)
889
890 def __ne__(*args, **kwargs):
891 """
892 __ne__(self, RealPoint pt) -> bool
893
894 Test for inequality of wx.RealPoint objects.
895 """
896 return _core_.RealPoint___ne__(*args, **kwargs)
897
898 def __add__(*args, **kwargs):
899 """
900 __add__(self, RealPoint pt) -> RealPoint
901
902 Add pt's proprties to this and return the result.
903 """
904 return _core_.RealPoint___add__(*args, **kwargs)
905
906 def __sub__(*args, **kwargs):
907 """
908 __sub__(self, RealPoint pt) -> RealPoint
909
910 Subtract pt's proprties from this and return the result
911 """
912 return _core_.RealPoint___sub__(*args, **kwargs)
913
914 def Set(*args, **kwargs):
915 """
916 Set(self, double x, double y)
917
918 Set both the x and y properties
919 """
920 return _core_.RealPoint_Set(*args, **kwargs)
921
922 def Get(*args, **kwargs):
923 """
924 Get() -> (x,y)
925
926 Return the x and y properties as a tuple.
927 """
928 return _core_.RealPoint_Get(*args, **kwargs)
929
930 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
931 def __str__(self): return str(self.Get())
932 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
933 def __len__(self): return len(self.Get())
934 def __getitem__(self, index): return self.Get()[index]
935 def __setitem__(self, index, val):
936 if index == 0: self.x = val
937 elif index == 1: self.y = val
938 else: raise IndexError
939 def __nonzero__(self): return self.Get() != (0.0, 0.0)
940 __safe_for_unpickling__ = True
941 def __reduce__(self): return (wx.RealPoint, self.Get())
942
943
944 class RealPointPtr(RealPoint):
945 def __init__(self, this):
946 self.this = this
947 if not hasattr(self,"thisown"): self.thisown = 0
948 self.__class__ = RealPoint
949 _core_.RealPoint_swigregister(RealPointPtr)
950
951 #---------------------------------------------------------------------------
952
953 class Point(object):
954 """
955 A data structure for representing a point or position with integer x
956 and y properties. Most places in wxPython that expect a wx.Point can
957 also accept a (x,y) tuple.
958 """
959 def __repr__(self):
960 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
961 x = property(_core_.Point_x_get, _core_.Point_x_set)
962 y = property(_core_.Point_y_get, _core_.Point_y_set)
963 def __init__(self, *args, **kwargs):
964 """
965 __init__(self, int x=0, int y=0) -> Point
966
967 Create a wx.Point object
968 """
969 newobj = _core_.new_Point(*args, **kwargs)
970 self.this = newobj.this
971 self.thisown = 1
972 del newobj.thisown
973 def __del__(self, destroy=_core_.delete_Point):
974 """__del__(self)"""
975 try:
976 if self.thisown: destroy(self)
977 except: pass
978
979 def __eq__(*args, **kwargs):
980 """
981 __eq__(self, Point pt) -> bool
982
983 Test for equality of wx.Point objects.
984 """
985 return _core_.Point___eq__(*args, **kwargs)
986
987 def __ne__(*args, **kwargs):
988 """
989 __ne__(self, Point pt) -> bool
990
991 Test for inequality of wx.Point objects.
992 """
993 return _core_.Point___ne__(*args, **kwargs)
994
995 def __add__(*args, **kwargs):
996 """
997 __add__(self, Point pt) -> Point
998
999 Add pt's proprties to this and return the result.
1000 """
1001 return _core_.Point___add__(*args, **kwargs)
1002
1003 def __sub__(*args, **kwargs):
1004 """
1005 __sub__(self, Point pt) -> Point
1006
1007 Subtract pt's proprties from this and return the result
1008 """
1009 return _core_.Point___sub__(*args, **kwargs)
1010
1011 def __iadd__(*args, **kwargs):
1012 """
1013 __iadd__(self, Point pt) -> Point
1014
1015 Add pt to this object.
1016 """
1017 return _core_.Point___iadd__(*args, **kwargs)
1018
1019 def __isub__(*args, **kwargs):
1020 """
1021 __isub__(self, Point pt) -> Point
1022
1023 Subtract pt from this object.
1024 """
1025 return _core_.Point___isub__(*args, **kwargs)
1026
1027 def Set(*args, **kwargs):
1028 """
1029 Set(self, long x, long y)
1030
1031 Set both the x and y properties
1032 """
1033 return _core_.Point_Set(*args, **kwargs)
1034
1035 def Get(*args, **kwargs):
1036 """
1037 Get() -> (x,y)
1038
1039 Return the x and y properties as a tuple.
1040 """
1041 return _core_.Point_Get(*args, **kwargs)
1042
1043 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1044 def __str__(self): return str(self.Get())
1045 def __repr__(self): return 'wx.Point'+str(self.Get())
1046 def __len__(self): return len(self.Get())
1047 def __getitem__(self, index): return self.Get()[index]
1048 def __setitem__(self, index, val):
1049 if index == 0: self.x = val
1050 elif index == 1: self.y = val
1051 else: raise IndexError
1052 def __nonzero__(self): return self.Get() != (0,0)
1053 __safe_for_unpickling__ = True
1054 def __reduce__(self): return (wx.Point, self.Get())
1055
1056
1057 class PointPtr(Point):
1058 def __init__(self, this):
1059 self.this = this
1060 if not hasattr(self,"thisown"): self.thisown = 0
1061 self.__class__ = Point
1062 _core_.Point_swigregister(PointPtr)
1063
1064 #---------------------------------------------------------------------------
1065
1066 class Rect(object):
1067 """
1068 A class for representing and manipulating rectangles. It has x, y,
1069 width and height properties. In wxPython most palces that expect a
1070 wx.Rect can also accept a (x,y,width,height) tuple.
1071 """
1072 def __repr__(self):
1073 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1074 def __init__(self, *args, **kwargs):
1075 """
1076 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1077
1078 Create a new Rect object.
1079 """
1080 newobj = _core_.new_Rect(*args, **kwargs)
1081 self.this = newobj.this
1082 self.thisown = 1
1083 del newobj.thisown
1084 def __del__(self, destroy=_core_.delete_Rect):
1085 """__del__(self)"""
1086 try:
1087 if self.thisown: destroy(self)
1088 except: pass
1089
1090 def GetX(*args, **kwargs):
1091 """GetX(self) -> int"""
1092 return _core_.Rect_GetX(*args, **kwargs)
1093
1094 def SetX(*args, **kwargs):
1095 """SetX(self, int x)"""
1096 return _core_.Rect_SetX(*args, **kwargs)
1097
1098 def GetY(*args, **kwargs):
1099 """GetY(self) -> int"""
1100 return _core_.Rect_GetY(*args, **kwargs)
1101
1102 def SetY(*args, **kwargs):
1103 """SetY(self, int y)"""
1104 return _core_.Rect_SetY(*args, **kwargs)
1105
1106 def GetWidth(*args, **kwargs):
1107 """GetWidth(self) -> int"""
1108 return _core_.Rect_GetWidth(*args, **kwargs)
1109
1110 def SetWidth(*args, **kwargs):
1111 """SetWidth(self, int w)"""
1112 return _core_.Rect_SetWidth(*args, **kwargs)
1113
1114 def GetHeight(*args, **kwargs):
1115 """GetHeight(self) -> int"""
1116 return _core_.Rect_GetHeight(*args, **kwargs)
1117
1118 def SetHeight(*args, **kwargs):
1119 """SetHeight(self, int h)"""
1120 return _core_.Rect_SetHeight(*args, **kwargs)
1121
1122 def GetPosition(*args, **kwargs):
1123 """GetPosition(self) -> Point"""
1124 return _core_.Rect_GetPosition(*args, **kwargs)
1125
1126 def SetPosition(*args, **kwargs):
1127 """SetPosition(self, Point p)"""
1128 return _core_.Rect_SetPosition(*args, **kwargs)
1129
1130 def GetSize(*args, **kwargs):
1131 """GetSize(self) -> Size"""
1132 return _core_.Rect_GetSize(*args, **kwargs)
1133
1134 def SetSize(*args, **kwargs):
1135 """SetSize(self, Size s)"""
1136 return _core_.Rect_SetSize(*args, **kwargs)
1137
1138 def GetTopLeft(*args, **kwargs):
1139 """GetTopLeft(self) -> Point"""
1140 return _core_.Rect_GetTopLeft(*args, **kwargs)
1141
1142 def SetTopLeft(*args, **kwargs):
1143 """SetTopLeft(self, Point p)"""
1144 return _core_.Rect_SetTopLeft(*args, **kwargs)
1145
1146 def GetBottomRight(*args, **kwargs):
1147 """GetBottomRight(self) -> Point"""
1148 return _core_.Rect_GetBottomRight(*args, **kwargs)
1149
1150 def SetBottomRight(*args, **kwargs):
1151 """SetBottomRight(self, Point p)"""
1152 return _core_.Rect_SetBottomRight(*args, **kwargs)
1153
1154 def GetLeft(*args, **kwargs):
1155 """GetLeft(self) -> int"""
1156 return _core_.Rect_GetLeft(*args, **kwargs)
1157
1158 def GetTop(*args, **kwargs):
1159 """GetTop(self) -> int"""
1160 return _core_.Rect_GetTop(*args, **kwargs)
1161
1162 def GetBottom(*args, **kwargs):
1163 """GetBottom(self) -> int"""
1164 return _core_.Rect_GetBottom(*args, **kwargs)
1165
1166 def GetRight(*args, **kwargs):
1167 """GetRight(self) -> int"""
1168 return _core_.Rect_GetRight(*args, **kwargs)
1169
1170 def SetLeft(*args, **kwargs):
1171 """SetLeft(self, int left)"""
1172 return _core_.Rect_SetLeft(*args, **kwargs)
1173
1174 def SetRight(*args, **kwargs):
1175 """SetRight(self, int right)"""
1176 return _core_.Rect_SetRight(*args, **kwargs)
1177
1178 def SetTop(*args, **kwargs):
1179 """SetTop(self, int top)"""
1180 return _core_.Rect_SetTop(*args, **kwargs)
1181
1182 def SetBottom(*args, **kwargs):
1183 """SetBottom(self, int bottom)"""
1184 return _core_.Rect_SetBottom(*args, **kwargs)
1185
1186 position = property(GetPosition, SetPosition)
1187 size = property(GetSize, SetSize)
1188 left = property(GetLeft, SetLeft)
1189 right = property(GetRight, SetRight)
1190 top = property(GetTop, SetTop)
1191 bottom = property(GetBottom, SetBottom)
1192
1193 def Inflate(*args, **kwargs):
1194 """
1195 Inflate(self, int dx, int dy) -> Rect
1196
1197 Increases the size of the rectangle.
1198
1199 The left border is moved farther left and the right border is moved
1200 farther right by ``dx``. The upper border is moved farther up and the
1201 bottom border is moved farther down by ``dy``. (Note the the width and
1202 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1203 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1204 opposite happens: the rectangle size decreases in the respective
1205 direction.
1206
1207 The change is made to the rectangle inplace, if instead you need a
1208 copy that is inflated, preserving the original then make the copy
1209 first::
1210
1211 copy = wx.Rect(*original)
1212 copy.Inflate(10,15)
1213
1214
1215 """
1216 return _core_.Rect_Inflate(*args, **kwargs)
1217
1218 def Deflate(*args, **kwargs):
1219 """
1220 Deflate(self, int dx, int dy) -> Rect
1221
1222 Decrease the rectangle size. This method is the opposite of `Inflate`
1223 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1224 `Inflate` for a full description.
1225 """
1226 return _core_.Rect_Deflate(*args, **kwargs)
1227
1228 def OffsetXY(*args, **kwargs):
1229 """
1230 OffsetXY(self, int dx, int dy)
1231
1232 Moves the rectangle by the specified offset. If dx is positive, the
1233 rectangle is moved to the right, if dy is positive, it is moved to the
1234 bottom, otherwise it is moved to the left or top respectively.
1235 """
1236 return _core_.Rect_OffsetXY(*args, **kwargs)
1237
1238 def Offset(*args, **kwargs):
1239 """
1240 Offset(self, Point pt)
1241
1242 Same as OffsetXY but uses dx,dy from Point
1243 """
1244 return _core_.Rect_Offset(*args, **kwargs)
1245
1246 def Intersect(*args, **kwargs):
1247 """
1248 Intersect(self, Rect rect) -> Rect
1249
1250 Returns the intersectsion of this rectangle and rect.
1251 """
1252 return _core_.Rect_Intersect(*args, **kwargs)
1253
1254 def Union(*args, **kwargs):
1255 """
1256 Union(self, Rect rect) -> Rect
1257
1258 Returns the union of this rectangle and rect.
1259 """
1260 return _core_.Rect_Union(*args, **kwargs)
1261
1262 def __add__(*args, **kwargs):
1263 """
1264 __add__(self, Rect rect) -> Rect
1265
1266 Add the properties of rect to this rectangle and return the result.
1267 """
1268 return _core_.Rect___add__(*args, **kwargs)
1269
1270 def __iadd__(*args, **kwargs):
1271 """
1272 __iadd__(self, Rect rect) -> Rect
1273
1274 Add the properties of rect to this rectangle, updating this rectangle.
1275 """
1276 return _core_.Rect___iadd__(*args, **kwargs)
1277
1278 def __eq__(*args, **kwargs):
1279 """
1280 __eq__(self, Rect rect) -> bool
1281
1282 Test for equality.
1283 """
1284 return _core_.Rect___eq__(*args, **kwargs)
1285
1286 def __ne__(*args, **kwargs):
1287 """
1288 __ne__(self, Rect rect) -> bool
1289
1290 Test for inequality.
1291 """
1292 return _core_.Rect___ne__(*args, **kwargs)
1293
1294 def InsideXY(*args, **kwargs):
1295 """
1296 InsideXY(self, int x, int y) -> bool
1297
1298 Return True if the point is (not strcitly) inside the rect.
1299 """
1300 return _core_.Rect_InsideXY(*args, **kwargs)
1301
1302 def Inside(*args, **kwargs):
1303 """
1304 Inside(self, Point pt) -> bool
1305
1306 Return True if the point is (not strcitly) inside the rect.
1307 """
1308 return _core_.Rect_Inside(*args, **kwargs)
1309
1310 def Intersects(*args, **kwargs):
1311 """
1312 Intersects(self, Rect rect) -> bool
1313
1314 Returns True if the rectangles have a non empty intersection.
1315 """
1316 return _core_.Rect_Intersects(*args, **kwargs)
1317
1318 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1319 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1320 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1321 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1322 def Set(*args, **kwargs):
1323 """
1324 Set(self, int x=0, int y=0, int width=0, int height=0)
1325
1326 Set all rectangle properties.
1327 """
1328 return _core_.Rect_Set(*args, **kwargs)
1329
1330 def Get(*args, **kwargs):
1331 """
1332 Get() -> (x,y,width,height)
1333
1334 Return the rectangle properties as a tuple.
1335 """
1336 return _core_.Rect_Get(*args, **kwargs)
1337
1338 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1339 def __str__(self): return str(self.Get())
1340 def __repr__(self): return 'wx.Rect'+str(self.Get())
1341 def __len__(self): return len(self.Get())
1342 def __getitem__(self, index): return self.Get()[index]
1343 def __setitem__(self, index, val):
1344 if index == 0: self.x = val
1345 elif index == 1: self.y = val
1346 elif index == 2: self.width = val
1347 elif index == 3: self.height = val
1348 else: raise IndexError
1349 def __nonzero__(self): return self.Get() != (0,0,0,0)
1350 __safe_for_unpickling__ = True
1351 def __reduce__(self): return (wx.Rect, self.Get())
1352
1353
1354 class RectPtr(Rect):
1355 def __init__(self, this):
1356 self.this = this
1357 if not hasattr(self,"thisown"): self.thisown = 0
1358 self.__class__ = Rect
1359 _core_.Rect_swigregister(RectPtr)
1360
1361 def RectPP(*args, **kwargs):
1362 """
1363 RectPP(Point topLeft, Point bottomRight) -> Rect
1364
1365 Create a new Rect object from Points representing two corners.
1366 """
1367 val = _core_.new_RectPP(*args, **kwargs)
1368 val.thisown = 1
1369 return val
1370
1371 def RectPS(*args, **kwargs):
1372 """
1373 RectPS(Point pos, Size size) -> Rect
1374
1375 Create a new Rect from a position and size.
1376 """
1377 val = _core_.new_RectPS(*args, **kwargs)
1378 val.thisown = 1
1379 return val
1380
1381 def RectS(*args, **kwargs):
1382 """
1383 RectS(Size size) -> Rect
1384
1385 Create a new Rect from a size only.
1386 """
1387 val = _core_.new_RectS(*args, **kwargs)
1388 val.thisown = 1
1389 return val
1390
1391
1392 def IntersectRect(*args, **kwargs):
1393 """
1394 IntersectRect(Rect r1, Rect r2) -> Rect
1395
1396 Calculate and return the intersection of r1 and r2.
1397 """
1398 return _core_.IntersectRect(*args, **kwargs)
1399 #---------------------------------------------------------------------------
1400
1401 class Point2D(object):
1402 """
1403 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1404 with floating point values.
1405 """
1406 def __repr__(self):
1407 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1408 def __init__(self, *args, **kwargs):
1409 """
1410 __init__(self, double x=0.0, double y=0.0) -> Point2D
1411
1412 Create a w.Point2D object.
1413 """
1414 newobj = _core_.new_Point2D(*args, **kwargs)
1415 self.this = newobj.this
1416 self.thisown = 1
1417 del newobj.thisown
1418 def GetFloor(*args, **kwargs):
1419 """
1420 GetFloor() -> (x,y)
1421
1422 Convert to integer
1423 """
1424 return _core_.Point2D_GetFloor(*args, **kwargs)
1425
1426 def GetRounded(*args, **kwargs):
1427 """
1428 GetRounded() -> (x,y)
1429
1430 Convert to integer
1431 """
1432 return _core_.Point2D_GetRounded(*args, **kwargs)
1433
1434 def GetVectorLength(*args, **kwargs):
1435 """GetVectorLength(self) -> double"""
1436 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1437
1438 def GetVectorAngle(*args, **kwargs):
1439 """GetVectorAngle(self) -> double"""
1440 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1441
1442 def SetVectorLength(*args, **kwargs):
1443 """SetVectorLength(self, double length)"""
1444 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1445
1446 def SetVectorAngle(*args, **kwargs):
1447 """SetVectorAngle(self, double degrees)"""
1448 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1449
1450 def SetPolarCoordinates(self, angle, length):
1451 self.SetVectorLength(length)
1452 self.SetVectorAngle(angle)
1453 def Normalize(self):
1454 self.SetVectorLength(1.0)
1455
1456 def GetDistance(*args, **kwargs):
1457 """GetDistance(self, Point2D pt) -> double"""
1458 return _core_.Point2D_GetDistance(*args, **kwargs)
1459
1460 def GetDistanceSquare(*args, **kwargs):
1461 """GetDistanceSquare(self, Point2D pt) -> double"""
1462 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1463
1464 def GetDotProduct(*args, **kwargs):
1465 """GetDotProduct(self, Point2D vec) -> double"""
1466 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1467
1468 def GetCrossProduct(*args, **kwargs):
1469 """GetCrossProduct(self, Point2D vec) -> double"""
1470 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1471
1472 def __neg__(*args, **kwargs):
1473 """
1474 __neg__(self) -> Point2D
1475
1476 the reflection of this point
1477 """
1478 return _core_.Point2D___neg__(*args, **kwargs)
1479
1480 def __iadd__(*args, **kwargs):
1481 """__iadd__(self, Point2D pt) -> Point2D"""
1482 return _core_.Point2D___iadd__(*args, **kwargs)
1483
1484 def __isub__(*args, **kwargs):
1485 """__isub__(self, Point2D pt) -> Point2D"""
1486 return _core_.Point2D___isub__(*args, **kwargs)
1487
1488 def __imul__(*args, **kwargs):
1489 """__imul__(self, Point2D pt) -> Point2D"""
1490 return _core_.Point2D___imul__(*args, **kwargs)
1491
1492 def __idiv__(*args, **kwargs):
1493 """__idiv__(self, Point2D pt) -> Point2D"""
1494 return _core_.Point2D___idiv__(*args, **kwargs)
1495
1496 def __eq__(*args, **kwargs):
1497 """
1498 __eq__(self, Point2D pt) -> bool
1499
1500 Test for equality
1501 """
1502 return _core_.Point2D___eq__(*args, **kwargs)
1503
1504 def __ne__(*args, **kwargs):
1505 """
1506 __ne__(self, Point2D pt) -> bool
1507
1508 Test for inequality
1509 """
1510 return _core_.Point2D___ne__(*args, **kwargs)
1511
1512 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1513 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1514 def Set(*args, **kwargs):
1515 """Set(self, double x=0, double y=0)"""
1516 return _core_.Point2D_Set(*args, **kwargs)
1517
1518 def Get(*args, **kwargs):
1519 """
1520 Get() -> (x,y)
1521
1522 Return x and y properties as a tuple.
1523 """
1524 return _core_.Point2D_Get(*args, **kwargs)
1525
1526 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1527 def __str__(self): return str(self.Get())
1528 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1529 def __len__(self): return len(self.Get())
1530 def __getitem__(self, index): return self.Get()[index]
1531 def __setitem__(self, index, val):
1532 if index == 0: self.x = val
1533 elif index == 1: self.y = val
1534 else: raise IndexError
1535 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1536 __safe_for_unpickling__ = True
1537 def __reduce__(self): return (wx.Point2D, self.Get())
1538
1539
1540 class Point2DPtr(Point2D):
1541 def __init__(self, this):
1542 self.this = this
1543 if not hasattr(self,"thisown"): self.thisown = 0
1544 self.__class__ = Point2D
1545 _core_.Point2D_swigregister(Point2DPtr)
1546
1547 def Point2DCopy(*args, **kwargs):
1548 """
1549 Point2DCopy(Point2D pt) -> Point2D
1550
1551 Create a w.Point2D object.
1552 """
1553 val = _core_.new_Point2DCopy(*args, **kwargs)
1554 val.thisown = 1
1555 return val
1556
1557 def Point2DFromPoint(*args, **kwargs):
1558 """
1559 Point2DFromPoint(Point pt) -> Point2D
1560
1561 Create a w.Point2D object.
1562 """
1563 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1564 val.thisown = 1
1565 return val
1566
1567 #---------------------------------------------------------------------------
1568
1569 FromStart = _core_.FromStart
1570 FromCurrent = _core_.FromCurrent
1571 FromEnd = _core_.FromEnd
1572 class InputStream(object):
1573 """Proxy of C++ InputStream class"""
1574 def __repr__(self):
1575 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1576 def __init__(self, *args, **kwargs):
1577 """__init__(self, PyObject p) -> InputStream"""
1578 newobj = _core_.new_InputStream(*args, **kwargs)
1579 self.this = newobj.this
1580 self.thisown = 1
1581 del newobj.thisown
1582 def __del__(self, destroy=_core_.delete_InputStream):
1583 """__del__(self)"""
1584 try:
1585 if self.thisown: destroy(self)
1586 except: pass
1587
1588 def close(*args, **kwargs):
1589 """close(self)"""
1590 return _core_.InputStream_close(*args, **kwargs)
1591
1592 def flush(*args, **kwargs):
1593 """flush(self)"""
1594 return _core_.InputStream_flush(*args, **kwargs)
1595
1596 def eof(*args, **kwargs):
1597 """eof(self) -> bool"""
1598 return _core_.InputStream_eof(*args, **kwargs)
1599
1600 def read(*args, **kwargs):
1601 """read(self, int size=-1) -> PyObject"""
1602 return _core_.InputStream_read(*args, **kwargs)
1603
1604 def readline(*args, **kwargs):
1605 """readline(self, int size=-1) -> PyObject"""
1606 return _core_.InputStream_readline(*args, **kwargs)
1607
1608 def readlines(*args, **kwargs):
1609 """readlines(self, int sizehint=-1) -> PyObject"""
1610 return _core_.InputStream_readlines(*args, **kwargs)
1611
1612 def seek(*args, **kwargs):
1613 """seek(self, int offset, int whence=0)"""
1614 return _core_.InputStream_seek(*args, **kwargs)
1615
1616 def tell(*args, **kwargs):
1617 """tell(self) -> int"""
1618 return _core_.InputStream_tell(*args, **kwargs)
1619
1620 def Peek(*args, **kwargs):
1621 """Peek(self) -> char"""
1622 return _core_.InputStream_Peek(*args, **kwargs)
1623
1624 def GetC(*args, **kwargs):
1625 """GetC(self) -> char"""
1626 return _core_.InputStream_GetC(*args, **kwargs)
1627
1628 def LastRead(*args, **kwargs):
1629 """LastRead(self) -> size_t"""
1630 return _core_.InputStream_LastRead(*args, **kwargs)
1631
1632 def CanRead(*args, **kwargs):
1633 """CanRead(self) -> bool"""
1634 return _core_.InputStream_CanRead(*args, **kwargs)
1635
1636 def Eof(*args, **kwargs):
1637 """Eof(self) -> bool"""
1638 return _core_.InputStream_Eof(*args, **kwargs)
1639
1640 def Ungetch(*args, **kwargs):
1641 """Ungetch(self, char c) -> bool"""
1642 return _core_.InputStream_Ungetch(*args, **kwargs)
1643
1644 def SeekI(*args, **kwargs):
1645 """SeekI(self, long pos, int mode=FromStart) -> long"""
1646 return _core_.InputStream_SeekI(*args, **kwargs)
1647
1648 def TellI(*args, **kwargs):
1649 """TellI(self) -> long"""
1650 return _core_.InputStream_TellI(*args, **kwargs)
1651
1652
1653 class InputStreamPtr(InputStream):
1654 def __init__(self, this):
1655 self.this = this
1656 if not hasattr(self,"thisown"): self.thisown = 0
1657 self.__class__ = InputStream
1658 _core_.InputStream_swigregister(InputStreamPtr)
1659 DefaultPosition = cvar.DefaultPosition
1660 DefaultSize = cvar.DefaultSize
1661
1662 class OutputStream(object):
1663 """Proxy of C++ OutputStream class"""
1664 def __init__(self): raise RuntimeError, "No constructor defined"
1665 def __repr__(self):
1666 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1667 def write(*args, **kwargs):
1668 """write(self, PyObject obj)"""
1669 return _core_.OutputStream_write(*args, **kwargs)
1670
1671
1672 class OutputStreamPtr(OutputStream):
1673 def __init__(self, this):
1674 self.this = this
1675 if not hasattr(self,"thisown"): self.thisown = 0
1676 self.__class__ = OutputStream
1677 _core_.OutputStream_swigregister(OutputStreamPtr)
1678
1679 #---------------------------------------------------------------------------
1680
1681 class FSFile(Object):
1682 """Proxy of C++ FSFile class"""
1683 def __repr__(self):
1684 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1685 def __init__(self, *args, **kwargs):
1686 """
1687 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1688 DateTime modif) -> FSFile
1689 """
1690 newobj = _core_.new_FSFile(*args, **kwargs)
1691 self.this = newobj.this
1692 self.thisown = 1
1693 del newobj.thisown
1694 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1695
1696 def __del__(self, destroy=_core_.delete_FSFile):
1697 """__del__(self)"""
1698 try:
1699 if self.thisown: destroy(self)
1700 except: pass
1701
1702 def GetStream(*args, **kwargs):
1703 """GetStream(self) -> InputStream"""
1704 return _core_.FSFile_GetStream(*args, **kwargs)
1705
1706 def GetMimeType(*args, **kwargs):
1707 """GetMimeType(self) -> String"""
1708 return _core_.FSFile_GetMimeType(*args, **kwargs)
1709
1710 def GetLocation(*args, **kwargs):
1711 """GetLocation(self) -> String"""
1712 return _core_.FSFile_GetLocation(*args, **kwargs)
1713
1714 def GetAnchor(*args, **kwargs):
1715 """GetAnchor(self) -> String"""
1716 return _core_.FSFile_GetAnchor(*args, **kwargs)
1717
1718 def GetModificationTime(*args, **kwargs):
1719 """GetModificationTime(self) -> DateTime"""
1720 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1721
1722
1723 class FSFilePtr(FSFile):
1724 def __init__(self, this):
1725 self.this = this
1726 if not hasattr(self,"thisown"): self.thisown = 0
1727 self.__class__ = FSFile
1728 _core_.FSFile_swigregister(FSFilePtr)
1729
1730 class CPPFileSystemHandler(object):
1731 """Proxy of C++ CPPFileSystemHandler class"""
1732 def __init__(self): raise RuntimeError, "No constructor defined"
1733 def __repr__(self):
1734 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1735
1736 class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1737 def __init__(self, this):
1738 self.this = this
1739 if not hasattr(self,"thisown"): self.thisown = 0
1740 self.__class__ = CPPFileSystemHandler
1741 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1742
1743 class FileSystemHandler(CPPFileSystemHandler):
1744 """Proxy of C++ FileSystemHandler class"""
1745 def __repr__(self):
1746 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1747 def __init__(self, *args, **kwargs):
1748 """__init__(self) -> FileSystemHandler"""
1749 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1750 self.this = newobj.this
1751 self.thisown = 1
1752 del newobj.thisown
1753 self._setCallbackInfo(self, FileSystemHandler)
1754
1755 def _setCallbackInfo(*args, **kwargs):
1756 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1757 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1758
1759 def CanOpen(*args, **kwargs):
1760 """CanOpen(self, String location) -> bool"""
1761 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1762
1763 def OpenFile(*args, **kwargs):
1764 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1765 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1766
1767 def FindFirst(*args, **kwargs):
1768 """FindFirst(self, String spec, int flags=0) -> String"""
1769 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1770
1771 def FindNext(*args, **kwargs):
1772 """FindNext(self) -> String"""
1773 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1774
1775 def GetProtocol(*args, **kwargs):
1776 """GetProtocol(self, String location) -> String"""
1777 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1778
1779 def GetLeftLocation(*args, **kwargs):
1780 """GetLeftLocation(self, String location) -> String"""
1781 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1782
1783 def GetAnchor(*args, **kwargs):
1784 """GetAnchor(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1786
1787 def GetRightLocation(*args, **kwargs):
1788 """GetRightLocation(self, String location) -> String"""
1789 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1790
1791 def GetMimeTypeFromExt(*args, **kwargs):
1792 """GetMimeTypeFromExt(self, String location) -> String"""
1793 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1794
1795
1796 class FileSystemHandlerPtr(FileSystemHandler):
1797 def __init__(self, this):
1798 self.this = this
1799 if not hasattr(self,"thisown"): self.thisown = 0
1800 self.__class__ = FileSystemHandler
1801 _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1802
1803 class FileSystem(Object):
1804 """Proxy of C++ FileSystem class"""
1805 def __repr__(self):
1806 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1807 def __init__(self, *args, **kwargs):
1808 """__init__(self) -> FileSystem"""
1809 newobj = _core_.new_FileSystem(*args, **kwargs)
1810 self.this = newobj.this
1811 self.thisown = 1
1812 del newobj.thisown
1813 def __del__(self, destroy=_core_.delete_FileSystem):
1814 """__del__(self)"""
1815 try:
1816 if self.thisown: destroy(self)
1817 except: pass
1818
1819 def ChangePathTo(*args, **kwargs):
1820 """ChangePathTo(self, String location, bool is_dir=False)"""
1821 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1822
1823 def GetPath(*args, **kwargs):
1824 """GetPath(self) -> String"""
1825 return _core_.FileSystem_GetPath(*args, **kwargs)
1826
1827 def OpenFile(*args, **kwargs):
1828 """OpenFile(self, String location) -> FSFile"""
1829 return _core_.FileSystem_OpenFile(*args, **kwargs)
1830
1831 def FindFirst(*args, **kwargs):
1832 """FindFirst(self, String spec, int flags=0) -> String"""
1833 return _core_.FileSystem_FindFirst(*args, **kwargs)
1834
1835 def FindNext(*args, **kwargs):
1836 """FindNext(self) -> String"""
1837 return _core_.FileSystem_FindNext(*args, **kwargs)
1838
1839 def AddHandler(*args, **kwargs):
1840 """AddHandler(CPPFileSystemHandler handler)"""
1841 return _core_.FileSystem_AddHandler(*args, **kwargs)
1842
1843 AddHandler = staticmethod(AddHandler)
1844 def CleanUpHandlers(*args, **kwargs):
1845 """CleanUpHandlers()"""
1846 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1847
1848 CleanUpHandlers = staticmethod(CleanUpHandlers)
1849 def FileNameToURL(*args, **kwargs):
1850 """FileNameToURL(String filename) -> String"""
1851 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1852
1853 FileNameToURL = staticmethod(FileNameToURL)
1854 def URLToFileName(*args, **kwargs):
1855 """URLToFileName(String url) -> String"""
1856 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1857
1858 URLToFileName = staticmethod(URLToFileName)
1859
1860 class FileSystemPtr(FileSystem):
1861 def __init__(self, this):
1862 self.this = this
1863 if not hasattr(self,"thisown"): self.thisown = 0
1864 self.__class__ = FileSystem
1865 _core_.FileSystem_swigregister(FileSystemPtr)
1866
1867 def FileSystem_AddHandler(*args, **kwargs):
1868 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1869 return _core_.FileSystem_AddHandler(*args, **kwargs)
1870
1871 def FileSystem_CleanUpHandlers(*args, **kwargs):
1872 """FileSystem_CleanUpHandlers()"""
1873 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1874
1875 def FileSystem_FileNameToURL(*args, **kwargs):
1876 """FileSystem_FileNameToURL(String filename) -> String"""
1877 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1878
1879 def FileSystem_URLToFileName(*args, **kwargs):
1880 """FileSystem_URLToFileName(String url) -> String"""
1881 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1882
1883 class InternetFSHandler(CPPFileSystemHandler):
1884 """Proxy of C++ InternetFSHandler class"""
1885 def __repr__(self):
1886 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1887 def __init__(self, *args, **kwargs):
1888 """__init__(self) -> InternetFSHandler"""
1889 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1890 self.this = newobj.this
1891 self.thisown = 1
1892 del newobj.thisown
1893 def CanOpen(*args, **kwargs):
1894 """CanOpen(self, String location) -> bool"""
1895 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1896
1897 def OpenFile(*args, **kwargs):
1898 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1899 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1900
1901
1902 class InternetFSHandlerPtr(InternetFSHandler):
1903 def __init__(self, this):
1904 self.this = this
1905 if not hasattr(self,"thisown"): self.thisown = 0
1906 self.__class__ = InternetFSHandler
1907 _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1908
1909 class ZipFSHandler(CPPFileSystemHandler):
1910 """Proxy of C++ ZipFSHandler class"""
1911 def __repr__(self):
1912 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1913 def __init__(self, *args, **kwargs):
1914 """__init__(self) -> ZipFSHandler"""
1915 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1916 self.this = newobj.this
1917 self.thisown = 1
1918 del newobj.thisown
1919 def CanOpen(*args, **kwargs):
1920 """CanOpen(self, String location) -> bool"""
1921 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1922
1923 def OpenFile(*args, **kwargs):
1924 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1925 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1926
1927 def FindFirst(*args, **kwargs):
1928 """FindFirst(self, String spec, int flags=0) -> String"""
1929 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1930
1931 def FindNext(*args, **kwargs):
1932 """FindNext(self) -> String"""
1933 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1934
1935
1936 class ZipFSHandlerPtr(ZipFSHandler):
1937 def __init__(self, this):
1938 self.this = this
1939 if not hasattr(self,"thisown"): self.thisown = 0
1940 self.__class__ = ZipFSHandler
1941 _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1942
1943
1944 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1945 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1946 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1947
1948 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1949 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1950 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1951
1952 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1953 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1954 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1955 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1956 """
1957 Add 'file' to the memory filesystem. The dataItem parameter can
1958 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1959 arbitrary data. If a bitmap or image is used then the imgType
1960 parameter should specify what kind of image file it should be
1961 written as, wx.BITMAP_TYPE_PNG, etc.
1962 """
1963 if isinstance(dataItem, wx.Image):
1964 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1965 elif isinstance(dataItem, wx.Bitmap):
1966 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1967 elif type(dataItem) == str:
1968 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1969 else:
1970 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1971
1972 class MemoryFSHandler(CPPFileSystemHandler):
1973 """Proxy of C++ MemoryFSHandler class"""
1974 def __repr__(self):
1975 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1976 def __init__(self, *args, **kwargs):
1977 """__init__(self) -> MemoryFSHandler"""
1978 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1979 self.this = newobj.this
1980 self.thisown = 1
1981 del newobj.thisown
1982 def RemoveFile(*args, **kwargs):
1983 """RemoveFile(String filename)"""
1984 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1985
1986 RemoveFile = staticmethod(RemoveFile)
1987 AddFile = staticmethod(MemoryFSHandler_AddFile)
1988 def CanOpen(*args, **kwargs):
1989 """CanOpen(self, String location) -> bool"""
1990 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1991
1992 def OpenFile(*args, **kwargs):
1993 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1994 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1995
1996 def FindFirst(*args, **kwargs):
1997 """FindFirst(self, String spec, int flags=0) -> String"""
1998 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1999
2000 def FindNext(*args, **kwargs):
2001 """FindNext(self) -> String"""
2002 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2003
2004
2005 class MemoryFSHandlerPtr(MemoryFSHandler):
2006 def __init__(self, this):
2007 self.this = this
2008 if not hasattr(self,"thisown"): self.thisown = 0
2009 self.__class__ = MemoryFSHandler
2010 _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2011
2012 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2013 """MemoryFSHandler_RemoveFile(String filename)"""
2014 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2015
2016 #---------------------------------------------------------------------------
2017
2018 class ImageHandler(Object):
2019 """Proxy of C++ ImageHandler class"""
2020 def __init__(self): raise RuntimeError, "No constructor defined"
2021 def __repr__(self):
2022 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2023 def GetName(*args, **kwargs):
2024 """GetName(self) -> String"""
2025 return _core_.ImageHandler_GetName(*args, **kwargs)
2026
2027 def GetExtension(*args, **kwargs):
2028 """GetExtension(self) -> String"""
2029 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2030
2031 def GetType(*args, **kwargs):
2032 """GetType(self) -> long"""
2033 return _core_.ImageHandler_GetType(*args, **kwargs)
2034
2035 def GetMimeType(*args, **kwargs):
2036 """GetMimeType(self) -> String"""
2037 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2038
2039 def CanRead(*args, **kwargs):
2040 """CanRead(self, String name) -> bool"""
2041 return _core_.ImageHandler_CanRead(*args, **kwargs)
2042
2043 def SetName(*args, **kwargs):
2044 """SetName(self, String name)"""
2045 return _core_.ImageHandler_SetName(*args, **kwargs)
2046
2047 def SetExtension(*args, **kwargs):
2048 """SetExtension(self, String extension)"""
2049 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2050
2051 def SetType(*args, **kwargs):
2052 """SetType(self, long type)"""
2053 return _core_.ImageHandler_SetType(*args, **kwargs)
2054
2055 def SetMimeType(*args, **kwargs):
2056 """SetMimeType(self, String mimetype)"""
2057 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2058
2059
2060 class ImageHandlerPtr(ImageHandler):
2061 def __init__(self, this):
2062 self.this = this
2063 if not hasattr(self,"thisown"): self.thisown = 0
2064 self.__class__ = ImageHandler
2065 _core_.ImageHandler_swigregister(ImageHandlerPtr)
2066
2067 class ImageHistogram(object):
2068 """Proxy of C++ ImageHistogram class"""
2069 def __repr__(self):
2070 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2071 def __init__(self, *args, **kwargs):
2072 """__init__(self) -> ImageHistogram"""
2073 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2074 self.this = newobj.this
2075 self.thisown = 1
2076 del newobj.thisown
2077 def MakeKey(*args, **kwargs):
2078 """
2079 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2080
2081 Get the key in the histogram for the given RGB values
2082 """
2083 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2084
2085 MakeKey = staticmethod(MakeKey)
2086 def FindFirstUnusedColour(*args, **kwargs):
2087 """
2088 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2089
2090 Find first colour that is not used in the image and has higher RGB
2091 values than startR, startG, startB. Returns a tuple consisting of a
2092 success flag and rgb values.
2093 """
2094 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2095
2096
2097 class ImageHistogramPtr(ImageHistogram):
2098 def __init__(self, this):
2099 self.this = this
2100 if not hasattr(self,"thisown"): self.thisown = 0
2101 self.__class__ = ImageHistogram
2102 _core_.ImageHistogram_swigregister(ImageHistogramPtr)
2103
2104 def ImageHistogram_MakeKey(*args, **kwargs):
2105 """
2106 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2107
2108 Get the key in the histogram for the given RGB values
2109 """
2110 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2111
2112 class Image(Object):
2113 """Proxy of C++ Image class"""
2114 def __repr__(self):
2115 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2116 def __init__(self, *args, **kwargs):
2117 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2118 newobj = _core_.new_Image(*args, **kwargs)
2119 self.this = newobj.this
2120 self.thisown = 1
2121 del newobj.thisown
2122 def __del__(self, destroy=_core_.delete_Image):
2123 """__del__(self)"""
2124 try:
2125 if self.thisown: destroy(self)
2126 except: pass
2127
2128 def Create(*args, **kwargs):
2129 """Create(self, int width, int height)"""
2130 return _core_.Image_Create(*args, **kwargs)
2131
2132 def Destroy(*args, **kwargs):
2133 """
2134 Destroy(self)
2135
2136 Deletes the C++ object this Python object is a proxy for.
2137 """
2138 return _core_.Image_Destroy(*args, **kwargs)
2139
2140 def Scale(*args, **kwargs):
2141 """Scale(self, int width, int height) -> Image"""
2142 return _core_.Image_Scale(*args, **kwargs)
2143
2144 def ShrinkBy(*args, **kwargs):
2145 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2146 return _core_.Image_ShrinkBy(*args, **kwargs)
2147
2148 def Rescale(*args, **kwargs):
2149 """Rescale(self, int width, int height) -> Image"""
2150 return _core_.Image_Rescale(*args, **kwargs)
2151
2152 def SetRGB(*args, **kwargs):
2153 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2154 return _core_.Image_SetRGB(*args, **kwargs)
2155
2156 def GetRed(*args, **kwargs):
2157 """GetRed(self, int x, int y) -> unsigned char"""
2158 return _core_.Image_GetRed(*args, **kwargs)
2159
2160 def GetGreen(*args, **kwargs):
2161 """GetGreen(self, int x, int y) -> unsigned char"""
2162 return _core_.Image_GetGreen(*args, **kwargs)
2163
2164 def GetBlue(*args, **kwargs):
2165 """GetBlue(self, int x, int y) -> unsigned char"""
2166 return _core_.Image_GetBlue(*args, **kwargs)
2167
2168 def SetAlpha(*args, **kwargs):
2169 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2170 return _core_.Image_SetAlpha(*args, **kwargs)
2171
2172 def GetAlpha(*args, **kwargs):
2173 """GetAlpha(self, int x, int y) -> unsigned char"""
2174 return _core_.Image_GetAlpha(*args, **kwargs)
2175
2176 def HasAlpha(*args, **kwargs):
2177 """HasAlpha(self) -> bool"""
2178 return _core_.Image_HasAlpha(*args, **kwargs)
2179
2180 def InitAlpha(*args, **kwargs):
2181 """
2182 InitAlpha(self)
2183
2184 Initializes the image alpha channel data. It is an error to call it if
2185 the image already has alpha data. If it doesn't, alpha data will be by
2186 default initialized to all pixels being fully opaque. But if the image
2187 has a a mask colour, all mask pixels will be completely transparent.
2188 """
2189 return _core_.Image_InitAlpha(*args, **kwargs)
2190
2191 def FindFirstUnusedColour(*args, **kwargs):
2192 """
2193 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2194
2195 Find first colour that is not used in the image and has higher RGB
2196 values than startR, startG, startB. Returns a tuple consisting of a
2197 success flag and rgb values.
2198 """
2199 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2200
2201 def ConvertAlphaToMask(*args, **kwargs):
2202 """
2203 ConvertAlphaToMask(self, byte threshold=128) -> bool
2204
2205 If the image has alpha channel, this method converts it to mask. All pixels
2206 with alpha value less than ``threshold`` are replaced with mask colour and the
2207 alpha channel is removed. Mask colour is chosen automatically using
2208 `FindFirstUnusedColour`.
2209
2210 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2211 nothing.
2212 """
2213 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2214
2215 def ConvertColourToAlpha(*args, **kwargs):
2216 """
2217 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2218
2219 This method converts an image where the original alpha information is
2220 only available as a shades of a colour (actually shades of grey)
2221 typically when you draw anti-aliased text into a bitmap. The DC
2222 drawing routines draw grey values on the black background although
2223 they actually mean to draw white with differnt alpha values. This
2224 method reverses it, assuming a black (!) background and white text.
2225 The method will then fill up the whole image with the colour given.
2226 """
2227 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2228
2229 def SetMaskFromImage(*args, **kwargs):
2230 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2231 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2232
2233 def CanRead(*args, **kwargs):
2234 """CanRead(String name) -> bool"""
2235 return _core_.Image_CanRead(*args, **kwargs)
2236
2237 CanRead = staticmethod(CanRead)
2238 def GetImageCount(*args, **kwargs):
2239 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2240 return _core_.Image_GetImageCount(*args, **kwargs)
2241
2242 GetImageCount = staticmethod(GetImageCount)
2243 def LoadFile(*args, **kwargs):
2244 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2245 return _core_.Image_LoadFile(*args, **kwargs)
2246
2247 def LoadMimeFile(*args, **kwargs):
2248 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2249 return _core_.Image_LoadMimeFile(*args, **kwargs)
2250
2251 def SaveFile(*args, **kwargs):
2252 """SaveFile(self, String name, int type) -> bool"""
2253 return _core_.Image_SaveFile(*args, **kwargs)
2254
2255 def SaveMimeFile(*args, **kwargs):
2256 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2257 return _core_.Image_SaveMimeFile(*args, **kwargs)
2258
2259 def CanReadStream(*args, **kwargs):
2260 """CanReadStream(InputStream stream) -> bool"""
2261 return _core_.Image_CanReadStream(*args, **kwargs)
2262
2263 CanReadStream = staticmethod(CanReadStream)
2264 def LoadStream(*args, **kwargs):
2265 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2266 return _core_.Image_LoadStream(*args, **kwargs)
2267
2268 def LoadMimeStream(*args, **kwargs):
2269 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2270 return _core_.Image_LoadMimeStream(*args, **kwargs)
2271
2272 def Ok(*args, **kwargs):
2273 """Ok(self) -> bool"""
2274 return _core_.Image_Ok(*args, **kwargs)
2275
2276 def GetWidth(*args, **kwargs):
2277 """GetWidth(self) -> int"""
2278 return _core_.Image_GetWidth(*args, **kwargs)
2279
2280 def GetHeight(*args, **kwargs):
2281 """GetHeight(self) -> int"""
2282 return _core_.Image_GetHeight(*args, **kwargs)
2283
2284 def GetSize(*args, **kwargs):
2285 """GetSize(self) -> Size"""
2286 return _core_.Image_GetSize(*args, **kwargs)
2287
2288 def GetSubImage(*args, **kwargs):
2289 """GetSubImage(self, Rect rect) -> Image"""
2290 return _core_.Image_GetSubImage(*args, **kwargs)
2291
2292 def Copy(*args, **kwargs):
2293 """Copy(self) -> Image"""
2294 return _core_.Image_Copy(*args, **kwargs)
2295
2296 def Paste(*args, **kwargs):
2297 """Paste(self, Image image, int x, int y)"""
2298 return _core_.Image_Paste(*args, **kwargs)
2299
2300 def GetData(*args, **kwargs):
2301 """GetData(self) -> PyObject"""
2302 return _core_.Image_GetData(*args, **kwargs)
2303
2304 def SetData(*args, **kwargs):
2305 """SetData(self, PyObject data)"""
2306 return _core_.Image_SetData(*args, **kwargs)
2307
2308 def GetDataBuffer(*args, **kwargs):
2309 """GetDataBuffer(self) -> PyObject"""
2310 return _core_.Image_GetDataBuffer(*args, **kwargs)
2311
2312 def SetDataBuffer(*args, **kwargs):
2313 """SetDataBuffer(self, PyObject data)"""
2314 return _core_.Image_SetDataBuffer(*args, **kwargs)
2315
2316 def GetAlphaData(*args, **kwargs):
2317 """GetAlphaData(self) -> PyObject"""
2318 return _core_.Image_GetAlphaData(*args, **kwargs)
2319
2320 def SetAlphaData(*args, **kwargs):
2321 """SetAlphaData(self, PyObject data)"""
2322 return _core_.Image_SetAlphaData(*args, **kwargs)
2323
2324 def GetAlphaBuffer(*args, **kwargs):
2325 """GetAlphaBuffer(self) -> PyObject"""
2326 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2327
2328 def SetAlphaBuffer(*args, **kwargs):
2329 """SetAlphaBuffer(self, PyObject data)"""
2330 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2331
2332 def SetMaskColour(*args, **kwargs):
2333 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2334 return _core_.Image_SetMaskColour(*args, **kwargs)
2335
2336 def GetMaskRed(*args, **kwargs):
2337 """GetMaskRed(self) -> unsigned char"""
2338 return _core_.Image_GetMaskRed(*args, **kwargs)
2339
2340 def GetMaskGreen(*args, **kwargs):
2341 """GetMaskGreen(self) -> unsigned char"""
2342 return _core_.Image_GetMaskGreen(*args, **kwargs)
2343
2344 def GetMaskBlue(*args, **kwargs):
2345 """GetMaskBlue(self) -> unsigned char"""
2346 return _core_.Image_GetMaskBlue(*args, **kwargs)
2347
2348 def SetMask(*args, **kwargs):
2349 """SetMask(self, bool mask=True)"""
2350 return _core_.Image_SetMask(*args, **kwargs)
2351
2352 def HasMask(*args, **kwargs):
2353 """HasMask(self) -> bool"""
2354 return _core_.Image_HasMask(*args, **kwargs)
2355
2356 def Rotate(*args, **kwargs):
2357 """
2358 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2359 Point offset_after_rotation=None) -> Image
2360 """
2361 return _core_.Image_Rotate(*args, **kwargs)
2362
2363 def Rotate90(*args, **kwargs):
2364 """Rotate90(self, bool clockwise=True) -> Image"""
2365 return _core_.Image_Rotate90(*args, **kwargs)
2366
2367 def Mirror(*args, **kwargs):
2368 """Mirror(self, bool horizontally=True) -> Image"""
2369 return _core_.Image_Mirror(*args, **kwargs)
2370
2371 def Replace(*args, **kwargs):
2372 """
2373 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2374 unsigned char r2, unsigned char g2, unsigned char b2)
2375 """
2376 return _core_.Image_Replace(*args, **kwargs)
2377
2378 def ConvertToMono(*args, **kwargs):
2379 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2380 return _core_.Image_ConvertToMono(*args, **kwargs)
2381
2382 def SetOption(*args, **kwargs):
2383 """SetOption(self, String name, String value)"""
2384 return _core_.Image_SetOption(*args, **kwargs)
2385
2386 def SetOptionInt(*args, **kwargs):
2387 """SetOptionInt(self, String name, int value)"""
2388 return _core_.Image_SetOptionInt(*args, **kwargs)
2389
2390 def GetOption(*args, **kwargs):
2391 """GetOption(self, String name) -> String"""
2392 return _core_.Image_GetOption(*args, **kwargs)
2393
2394 def GetOptionInt(*args, **kwargs):
2395 """GetOptionInt(self, String name) -> int"""
2396 return _core_.Image_GetOptionInt(*args, **kwargs)
2397
2398 def HasOption(*args, **kwargs):
2399 """HasOption(self, String name) -> bool"""
2400 return _core_.Image_HasOption(*args, **kwargs)
2401
2402 def CountColours(*args, **kwargs):
2403 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2404 return _core_.Image_CountColours(*args, **kwargs)
2405
2406 def ComputeHistogram(*args, **kwargs):
2407 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2408 return _core_.Image_ComputeHistogram(*args, **kwargs)
2409
2410 def AddHandler(*args, **kwargs):
2411 """AddHandler(ImageHandler handler)"""
2412 return _core_.Image_AddHandler(*args, **kwargs)
2413
2414 AddHandler = staticmethod(AddHandler)
2415 def InsertHandler(*args, **kwargs):
2416 """InsertHandler(ImageHandler handler)"""
2417 return _core_.Image_InsertHandler(*args, **kwargs)
2418
2419 InsertHandler = staticmethod(InsertHandler)
2420 def RemoveHandler(*args, **kwargs):
2421 """RemoveHandler(String name) -> bool"""
2422 return _core_.Image_RemoveHandler(*args, **kwargs)
2423
2424 RemoveHandler = staticmethod(RemoveHandler)
2425 def GetImageExtWildcard(*args, **kwargs):
2426 """GetImageExtWildcard() -> String"""
2427 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2428
2429 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2430 def ConvertToBitmap(*args, **kwargs):
2431 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2432 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2433
2434 def ConvertToMonoBitmap(*args, **kwargs):
2435 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2436 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2437
2438 def __nonzero__(self): return self.Ok()
2439
2440 class ImagePtr(Image):
2441 def __init__(self, this):
2442 self.this = this
2443 if not hasattr(self,"thisown"): self.thisown = 0
2444 self.__class__ = Image
2445 _core_.Image_swigregister(ImagePtr)
2446
2447 def ImageFromMime(*args, **kwargs):
2448 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2449 val = _core_.new_ImageFromMime(*args, **kwargs)
2450 val.thisown = 1
2451 return val
2452
2453 def ImageFromStream(*args, **kwargs):
2454 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2455 val = _core_.new_ImageFromStream(*args, **kwargs)
2456 val.thisown = 1
2457 return val
2458
2459 def ImageFromStreamMime(*args, **kwargs):
2460 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2461 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2462 val.thisown = 1
2463 return val
2464
2465 def EmptyImage(*args, **kwargs):
2466 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2467 val = _core_.new_EmptyImage(*args, **kwargs)
2468 val.thisown = 1
2469 return val
2470
2471 def ImageFromBitmap(*args, **kwargs):
2472 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2473 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2474 val.thisown = 1
2475 return val
2476
2477 def ImageFromData(*args, **kwargs):
2478 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2479 val = _core_.new_ImageFromData(*args, **kwargs)
2480 val.thisown = 1
2481 return val
2482
2483 def ImageFromDataWithAlpha(*args, **kwargs):
2484 """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
2485 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2486 val.thisown = 1
2487 return val
2488
2489 def Image_CanRead(*args, **kwargs):
2490 """Image_CanRead(String name) -> bool"""
2491 return _core_.Image_CanRead(*args, **kwargs)
2492
2493 def Image_GetImageCount(*args, **kwargs):
2494 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2495 return _core_.Image_GetImageCount(*args, **kwargs)
2496
2497 def Image_CanReadStream(*args, **kwargs):
2498 """Image_CanReadStream(InputStream stream) -> bool"""
2499 return _core_.Image_CanReadStream(*args, **kwargs)
2500
2501 def Image_AddHandler(*args, **kwargs):
2502 """Image_AddHandler(ImageHandler handler)"""
2503 return _core_.Image_AddHandler(*args, **kwargs)
2504
2505 def Image_InsertHandler(*args, **kwargs):
2506 """Image_InsertHandler(ImageHandler handler)"""
2507 return _core_.Image_InsertHandler(*args, **kwargs)
2508
2509 def Image_RemoveHandler(*args, **kwargs):
2510 """Image_RemoveHandler(String name) -> bool"""
2511 return _core_.Image_RemoveHandler(*args, **kwargs)
2512
2513 def Image_GetImageExtWildcard(*args, **kwargs):
2514 """Image_GetImageExtWildcard() -> String"""
2515 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2516
2517 def InitAllImageHandlers():
2518 """
2519 The former functionality of InitAllImageHanders is now done internal to
2520 the _core_ extension module and so this function has become a simple NOP.
2521 """
2522 pass
2523
2524 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2525 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2526 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2527 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2528 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
2529 BMP_24BPP = _core_.BMP_24BPP
2530 BMP_8BPP = _core_.BMP_8BPP
2531 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2532 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2533 BMP_8BPP_RED = _core_.BMP_8BPP_RED
2534 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2535 BMP_4BPP = _core_.BMP_4BPP
2536 BMP_1BPP = _core_.BMP_1BPP
2537 BMP_1BPP_BW = _core_.BMP_1BPP_BW
2538 class BMPHandler(ImageHandler):
2539 """Proxy of C++ BMPHandler class"""
2540 def __repr__(self):
2541 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2542 def __init__(self, *args, **kwargs):
2543 """__init__(self) -> BMPHandler"""
2544 newobj = _core_.new_BMPHandler(*args, **kwargs)
2545 self.this = newobj.this
2546 self.thisown = 1
2547 del newobj.thisown
2548
2549 class BMPHandlerPtr(BMPHandler):
2550 def __init__(self, this):
2551 self.this = this
2552 if not hasattr(self,"thisown"): self.thisown = 0
2553 self.__class__ = BMPHandler
2554 _core_.BMPHandler_swigregister(BMPHandlerPtr)
2555 NullImage = cvar.NullImage
2556 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
2557 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2558 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2559 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2560 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2561 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
2562 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
2563 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2564 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
2565 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
2566 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
2567 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
2568 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
2569 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
2570 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
2571
2572 class ICOHandler(BMPHandler):
2573 """Proxy of C++ ICOHandler class"""
2574 def __repr__(self):
2575 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2576 def __init__(self, *args, **kwargs):
2577 """__init__(self) -> ICOHandler"""
2578 newobj = _core_.new_ICOHandler(*args, **kwargs)
2579 self.this = newobj.this
2580 self.thisown = 1
2581 del newobj.thisown
2582
2583 class ICOHandlerPtr(ICOHandler):
2584 def __init__(self, this):
2585 self.this = this
2586 if not hasattr(self,"thisown"): self.thisown = 0
2587 self.__class__ = ICOHandler
2588 _core_.ICOHandler_swigregister(ICOHandlerPtr)
2589
2590 class CURHandler(ICOHandler):
2591 """Proxy of C++ CURHandler class"""
2592 def __repr__(self):
2593 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2594 def __init__(self, *args, **kwargs):
2595 """__init__(self) -> CURHandler"""
2596 newobj = _core_.new_CURHandler(*args, **kwargs)
2597 self.this = newobj.this
2598 self.thisown = 1
2599 del newobj.thisown
2600
2601 class CURHandlerPtr(CURHandler):
2602 def __init__(self, this):
2603 self.this = this
2604 if not hasattr(self,"thisown"): self.thisown = 0
2605 self.__class__ = CURHandler
2606 _core_.CURHandler_swigregister(CURHandlerPtr)
2607
2608 class ANIHandler(CURHandler):
2609 """Proxy of C++ ANIHandler class"""
2610 def __repr__(self):
2611 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2612 def __init__(self, *args, **kwargs):
2613 """__init__(self) -> ANIHandler"""
2614 newobj = _core_.new_ANIHandler(*args, **kwargs)
2615 self.this = newobj.this
2616 self.thisown = 1
2617 del newobj.thisown
2618
2619 class ANIHandlerPtr(ANIHandler):
2620 def __init__(self, this):
2621 self.this = this
2622 if not hasattr(self,"thisown"): self.thisown = 0
2623 self.__class__ = ANIHandler
2624 _core_.ANIHandler_swigregister(ANIHandlerPtr)
2625
2626 class PNGHandler(ImageHandler):
2627 """Proxy of C++ PNGHandler class"""
2628 def __repr__(self):
2629 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2630 def __init__(self, *args, **kwargs):
2631 """__init__(self) -> PNGHandler"""
2632 newobj = _core_.new_PNGHandler(*args, **kwargs)
2633 self.this = newobj.this
2634 self.thisown = 1
2635 del newobj.thisown
2636
2637 class PNGHandlerPtr(PNGHandler):
2638 def __init__(self, this):
2639 self.this = this
2640 if not hasattr(self,"thisown"): self.thisown = 0
2641 self.__class__ = PNGHandler
2642 _core_.PNGHandler_swigregister(PNGHandlerPtr)
2643
2644 class GIFHandler(ImageHandler):
2645 """Proxy of C++ GIFHandler class"""
2646 def __repr__(self):
2647 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2648 def __init__(self, *args, **kwargs):
2649 """__init__(self) -> GIFHandler"""
2650 newobj = _core_.new_GIFHandler(*args, **kwargs)
2651 self.this = newobj.this
2652 self.thisown = 1
2653 del newobj.thisown
2654
2655 class GIFHandlerPtr(GIFHandler):
2656 def __init__(self, this):
2657 self.this = this
2658 if not hasattr(self,"thisown"): self.thisown = 0
2659 self.__class__ = GIFHandler
2660 _core_.GIFHandler_swigregister(GIFHandlerPtr)
2661
2662 class PCXHandler(ImageHandler):
2663 """Proxy of C++ PCXHandler class"""
2664 def __repr__(self):
2665 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2666 def __init__(self, *args, **kwargs):
2667 """__init__(self) -> PCXHandler"""
2668 newobj = _core_.new_PCXHandler(*args, **kwargs)
2669 self.this = newobj.this
2670 self.thisown = 1
2671 del newobj.thisown
2672
2673 class PCXHandlerPtr(PCXHandler):
2674 def __init__(self, this):
2675 self.this = this
2676 if not hasattr(self,"thisown"): self.thisown = 0
2677 self.__class__ = PCXHandler
2678 _core_.PCXHandler_swigregister(PCXHandlerPtr)
2679
2680 class JPEGHandler(ImageHandler):
2681 """Proxy of C++ JPEGHandler class"""
2682 def __repr__(self):
2683 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2684 def __init__(self, *args, **kwargs):
2685 """__init__(self) -> JPEGHandler"""
2686 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2687 self.this = newobj.this
2688 self.thisown = 1
2689 del newobj.thisown
2690
2691 class JPEGHandlerPtr(JPEGHandler):
2692 def __init__(self, this):
2693 self.this = this
2694 if not hasattr(self,"thisown"): self.thisown = 0
2695 self.__class__ = JPEGHandler
2696 _core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2697
2698 class PNMHandler(ImageHandler):
2699 """Proxy of C++ PNMHandler class"""
2700 def __repr__(self):
2701 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2702 def __init__(self, *args, **kwargs):
2703 """__init__(self) -> PNMHandler"""
2704 newobj = _core_.new_PNMHandler(*args, **kwargs)
2705 self.this = newobj.this
2706 self.thisown = 1
2707 del newobj.thisown
2708
2709 class PNMHandlerPtr(PNMHandler):
2710 def __init__(self, this):
2711 self.this = this
2712 if not hasattr(self,"thisown"): self.thisown = 0
2713 self.__class__ = PNMHandler
2714 _core_.PNMHandler_swigregister(PNMHandlerPtr)
2715
2716 class XPMHandler(ImageHandler):
2717 """Proxy of C++ XPMHandler class"""
2718 def __repr__(self):
2719 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2720 def __init__(self, *args, **kwargs):
2721 """__init__(self) -> XPMHandler"""
2722 newobj = _core_.new_XPMHandler(*args, **kwargs)
2723 self.this = newobj.this
2724 self.thisown = 1
2725 del newobj.thisown
2726
2727 class XPMHandlerPtr(XPMHandler):
2728 def __init__(self, this):
2729 self.this = this
2730 if not hasattr(self,"thisown"): self.thisown = 0
2731 self.__class__ = XPMHandler
2732 _core_.XPMHandler_swigregister(XPMHandlerPtr)
2733
2734 class TIFFHandler(ImageHandler):
2735 """Proxy of C++ TIFFHandler class"""
2736 def __repr__(self):
2737 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2738 def __init__(self, *args, **kwargs):
2739 """__init__(self) -> TIFFHandler"""
2740 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2741 self.this = newobj.this
2742 self.thisown = 1
2743 del newobj.thisown
2744
2745 class TIFFHandlerPtr(TIFFHandler):
2746 def __init__(self, this):
2747 self.this = this
2748 if not hasattr(self,"thisown"): self.thisown = 0
2749 self.__class__ = TIFFHandler
2750 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2751
2752 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2753 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2754 class Quantize(object):
2755 """Performs quantization, or colour reduction, on a wxImage."""
2756 def __init__(self): raise RuntimeError, "No constructor defined"
2757 def __repr__(self):
2758 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2759 def Quantize(*args, **kwargs):
2760 """
2761 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2762
2763 Reduce the colours in the source image and put the result into the
2764 destination image, setting the palette in the destination if
2765 needed. Both images may be the same, to overwrite the source image.
2766 """
2767 return _core_.Quantize_Quantize(*args, **kwargs)
2768
2769 Quantize = staticmethod(Quantize)
2770
2771 class QuantizePtr(Quantize):
2772 def __init__(self, this):
2773 self.this = this
2774 if not hasattr(self,"thisown"): self.thisown = 0
2775 self.__class__ = Quantize
2776 _core_.Quantize_swigregister(QuantizePtr)
2777
2778 def Quantize_Quantize(*args, **kwargs):
2779 """
2780 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2781
2782 Reduce the colours in the source image and put the result into the
2783 destination image, setting the palette in the destination if
2784 needed. Both images may be the same, to overwrite the source image.
2785 """
2786 return _core_.Quantize_Quantize(*args, **kwargs)
2787
2788 #---------------------------------------------------------------------------
2789
2790 class EvtHandler(Object):
2791 """Proxy of C++ EvtHandler class"""
2792 def __repr__(self):
2793 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2794 def __init__(self, *args, **kwargs):
2795 """__init__(self) -> EvtHandler"""
2796 newobj = _core_.new_EvtHandler(*args, **kwargs)
2797 self.this = newobj.this
2798 self.thisown = 1
2799 del newobj.thisown
2800 def GetNextHandler(*args, **kwargs):
2801 """GetNextHandler(self) -> EvtHandler"""
2802 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2803
2804 def GetPreviousHandler(*args, **kwargs):
2805 """GetPreviousHandler(self) -> EvtHandler"""
2806 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2807
2808 def SetNextHandler(*args, **kwargs):
2809 """SetNextHandler(self, EvtHandler handler)"""
2810 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2811
2812 def SetPreviousHandler(*args, **kwargs):
2813 """SetPreviousHandler(self, EvtHandler handler)"""
2814 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2815
2816 def GetEvtHandlerEnabled(*args, **kwargs):
2817 """GetEvtHandlerEnabled(self) -> bool"""
2818 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2819
2820 def SetEvtHandlerEnabled(*args, **kwargs):
2821 """SetEvtHandlerEnabled(self, bool enabled)"""
2822 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2823
2824 def ProcessEvent(*args, **kwargs):
2825 """ProcessEvent(self, Event event) -> bool"""
2826 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2827
2828 def AddPendingEvent(*args, **kwargs):
2829 """AddPendingEvent(self, Event event)"""
2830 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2831
2832 def ProcessPendingEvents(*args, **kwargs):
2833 """ProcessPendingEvents(self)"""
2834 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2835
2836 def Connect(*args, **kwargs):
2837 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2838 return _core_.EvtHandler_Connect(*args, **kwargs)
2839
2840 def Disconnect(*args, **kwargs):
2841 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2842 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2843
2844 def _setOORInfo(*args, **kwargs):
2845 """_setOORInfo(self, PyObject _self, bool incref=True)"""
2846 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2847
2848 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2849 """
2850 Bind an event to an event handler.
2851
2852 :param event: One of the EVT_* objects that specifies the
2853 type of event to bind,
2854
2855 :param handler: A callable object to be invoked when the
2856 event is delivered to self. Pass None to
2857 disconnect an event handler.
2858
2859 :param source: Sometimes the event originates from a
2860 different window than self, but you still
2861 want to catch it in self. (For example, a
2862 button event delivered to a frame.) By
2863 passing the source of the event, the event
2864 handling system is able to differentiate
2865 between the same event type from different
2866 controls.
2867
2868 :param id: Used to spcify the event source by ID instead
2869 of instance.
2870
2871 :param id2: Used when it is desirable to bind a handler
2872 to a range of IDs, such as with EVT_MENU_RANGE.
2873 """
2874 if source is not None:
2875 id = source.GetId()
2876 event.Bind(self, id, id2, handler)
2877
2878 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2879 """
2880 Disconencts the event handler binding for event from self.
2881 Returns True if successful.
2882 """
2883 if source is not None:
2884 id = source.GetId()
2885 return event.Unbind(self, id, id2)
2886
2887
2888 class EvtHandlerPtr(EvtHandler):
2889 def __init__(self, this):
2890 self.this = this
2891 if not hasattr(self,"thisown"): self.thisown = 0
2892 self.__class__ = EvtHandler
2893 _core_.EvtHandler_swigregister(EvtHandlerPtr)
2894
2895 #---------------------------------------------------------------------------
2896
2897 class PyEventBinder(object):
2898 """
2899 Instances of this class are used to bind specific events to event
2900 handlers.
2901 """
2902 def __init__(self, evtType, expectedIDs=0):
2903 if expectedIDs not in [0, 1, 2]:
2904 raise ValueError, "Invalid number of expectedIDs"
2905 self.expectedIDs = expectedIDs
2906
2907 if type(evtType) == list or type(evtType) == tuple:
2908 self.evtType = evtType
2909 else:
2910 self.evtType = [evtType]
2911
2912
2913 def Bind(self, target, id1, id2, function):
2914 """Bind this set of event types to target."""
2915 for et in self.evtType:
2916 target.Connect(id1, id2, et, function)
2917
2918
2919 def Unbind(self, target, id1, id2):
2920 """Remove an event binding."""
2921 success = 0
2922 for et in self.evtType:
2923 success += target.Disconnect(id1, id2, et)
2924 return success != 0
2925
2926
2927 def __call__(self, *args):
2928 """
2929 For backwards compatibility with the old EVT_* functions.
2930 Should be called with either (window, func), (window, ID,
2931 func) or (window, ID1, ID2, func) parameters depending on the
2932 type of the event.
2933 """
2934 assert len(args) == 2 + self.expectedIDs
2935 id1 = wx.ID_ANY
2936 id2 = wx.ID_ANY
2937 target = args[0]
2938 if self.expectedIDs == 0:
2939 func = args[1]
2940 elif self.expectedIDs == 1:
2941 id1 = args[1]
2942 func = args[2]
2943 elif self.expectedIDs == 2:
2944 id1 = args[1]
2945 id2 = args[2]
2946 func = args[3]
2947 else:
2948 raise ValueError, "Unexpected number of IDs"
2949
2950 self.Bind(target, id1, id2, func)
2951
2952
2953 # These two are square pegs that don't fit the PyEventBinder hole...
2954 def EVT_COMMAND(win, id, cmd, func):
2955 win.Connect(id, -1, cmd, func)
2956 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2957 win.Connect(id1, id2, cmd, func)
2958
2959
2960 #---------------------------------------------------------------------------
2961
2962 #---------------------------------------------------------------------------
2963
2964 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2965 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
2966
2967 def NewEventType(*args, **kwargs):
2968 """NewEventType() -> wxEventType"""
2969 return _core_.NewEventType(*args, **kwargs)
2970 wxEVT_NULL = _core_.wxEVT_NULL
2971 wxEVT_FIRST = _core_.wxEVT_FIRST
2972 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2973 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2974 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2975 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2976 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2977 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2978 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2979 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2980 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2981 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2982 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2983 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2984 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2985 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2986 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2987 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2988 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2989 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2990 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2991 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2992 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2993 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2994 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2995 wxEVT_MOTION = _core_.wxEVT_MOTION
2996 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2997 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2998 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2999 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3000 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3001 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3002 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3003 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3004 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3005 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3006 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3007 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3008 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3009 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3010 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3011 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3012 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3013 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3014 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3015 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3016 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3017 wxEVT_CHAR = _core_.wxEVT_CHAR
3018 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3019 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3020 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3021 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3022 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3023 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3024 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3025 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3026 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3027 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3028 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3029 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3030 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3031 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3032 wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3033 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3034 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3035 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3036 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3037 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3038 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3039 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3040 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3041 wxEVT_SIZE = _core_.wxEVT_SIZE
3042 wxEVT_MOVE = _core_.wxEVT_MOVE
3043 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3044 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3045 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3046 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3047 wxEVT_POWER = _core_.wxEVT_POWER
3048 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3049 wxEVT_CREATE = _core_.wxEVT_CREATE
3050 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3051 wxEVT_SHOW = _core_.wxEVT_SHOW
3052 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3053 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3054 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3055 wxEVT_PAINT = _core_.wxEVT_PAINT
3056 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3057 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3058 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3059 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3060 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3061 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3062 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3063 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3064 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3065 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3066 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3067 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3068 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3069 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3070 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3071 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3072 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3073 wxEVT_IDLE = _core_.wxEVT_IDLE
3074 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3075 wxEVT_SIZING = _core_.wxEVT_SIZING
3076 wxEVT_MOVING = _core_.wxEVT_MOVING
3077 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3078 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3079 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3080 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3081 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3082 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3083 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3084 #
3085 # Create some event binders
3086 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3087 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3088 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3089 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3090 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3091 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3092 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3093 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3094 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3095 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3096 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3097 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3098 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3099 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3100 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3101 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3102 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3103 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3104 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3105 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3106 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3107 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3108 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3109 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3110 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3111 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3112 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3113 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3114 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3115 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3116 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3117 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3118 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3119 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3120 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3121 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3122 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3123 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3124 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3125 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3126
3127 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3128 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3129 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3130 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3131 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3132 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3133 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3134 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3135 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3136 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3137 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3138 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3139 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3140
3141 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3142 wxEVT_LEFT_UP,
3143 wxEVT_MIDDLE_DOWN,
3144 wxEVT_MIDDLE_UP,
3145 wxEVT_RIGHT_DOWN,
3146 wxEVT_RIGHT_UP,
3147 wxEVT_MOTION,
3148 wxEVT_LEFT_DCLICK,
3149 wxEVT_MIDDLE_DCLICK,
3150 wxEVT_RIGHT_DCLICK,
3151 wxEVT_ENTER_WINDOW,
3152 wxEVT_LEAVE_WINDOW,
3153 wxEVT_MOUSEWHEEL
3154 ])
3155
3156
3157 # Scrolling from wxWindow (sent to wxScrolledWindow)
3158 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3159 wxEVT_SCROLLWIN_BOTTOM,
3160 wxEVT_SCROLLWIN_LINEUP,
3161 wxEVT_SCROLLWIN_LINEDOWN,
3162 wxEVT_SCROLLWIN_PAGEUP,
3163 wxEVT_SCROLLWIN_PAGEDOWN,
3164 wxEVT_SCROLLWIN_THUMBTRACK,
3165 wxEVT_SCROLLWIN_THUMBRELEASE,
3166 ])
3167
3168 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3169 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3170 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3171 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3172 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3173 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3174 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3175 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3176
3177 # Scrolling from wxSlider and wxScrollBar
3178 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3179 wxEVT_SCROLL_BOTTOM,
3180 wxEVT_SCROLL_LINEUP,
3181 wxEVT_SCROLL_LINEDOWN,
3182 wxEVT_SCROLL_PAGEUP,
3183 wxEVT_SCROLL_PAGEDOWN,
3184 wxEVT_SCROLL_THUMBTRACK,
3185 wxEVT_SCROLL_THUMBRELEASE,
3186 wxEVT_SCROLL_ENDSCROLL,
3187 ])
3188
3189 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3190 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3191 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3192 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3193 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3194 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3195 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3196 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3197 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3198
3199 # Scrolling from wxSlider and wxScrollBar, with an id
3200 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3201 wxEVT_SCROLL_BOTTOM,
3202 wxEVT_SCROLL_LINEUP,
3203 wxEVT_SCROLL_LINEDOWN,
3204 wxEVT_SCROLL_PAGEUP,
3205 wxEVT_SCROLL_PAGEDOWN,
3206 wxEVT_SCROLL_THUMBTRACK,
3207 wxEVT_SCROLL_THUMBRELEASE,
3208 wxEVT_SCROLL_ENDSCROLL,
3209 ], 1)
3210
3211 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3212 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3213 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3214 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3215 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3216 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3217 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3218 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3219 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3220
3221 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3222 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3223 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3224 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3225 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3226 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3227 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3228 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3229 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3230 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3231
3232 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3233 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3234 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3235 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3236 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3237 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3238 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3239 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3240 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3241
3242
3243 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3244 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3245 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3246 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3247 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3248 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3249 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3250
3251 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3252
3253 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3254 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3255
3256 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3257
3258
3259
3260 #---------------------------------------------------------------------------
3261
3262 class Event(Object):
3263 """Proxy of C++ Event class"""
3264 def __init__(self): raise RuntimeError, "No constructor defined"
3265 def __repr__(self):
3266 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3267 def __del__(self, destroy=_core_.delete_Event):
3268 """__del__(self)"""
3269 try:
3270 if self.thisown: destroy(self)
3271 except: pass
3272
3273 def SetEventType(*args, **kwargs):
3274 """SetEventType(self, wxEventType typ)"""
3275 return _core_.Event_SetEventType(*args, **kwargs)
3276
3277 def GetEventType(*args, **kwargs):
3278 """GetEventType(self) -> wxEventType"""
3279 return _core_.Event_GetEventType(*args, **kwargs)
3280
3281 def GetEventObject(*args, **kwargs):
3282 """GetEventObject(self) -> Object"""
3283 return _core_.Event_GetEventObject(*args, **kwargs)
3284
3285 def SetEventObject(*args, **kwargs):
3286 """SetEventObject(self, Object obj)"""
3287 return _core_.Event_SetEventObject(*args, **kwargs)
3288
3289 def GetTimestamp(*args, **kwargs):
3290 """GetTimestamp(self) -> long"""
3291 return _core_.Event_GetTimestamp(*args, **kwargs)
3292
3293 def SetTimestamp(*args, **kwargs):
3294 """SetTimestamp(self, long ts=0)"""
3295 return _core_.Event_SetTimestamp(*args, **kwargs)
3296
3297 def GetId(*args, **kwargs):
3298 """GetId(self) -> int"""
3299 return _core_.Event_GetId(*args, **kwargs)
3300
3301 def SetId(*args, **kwargs):
3302 """SetId(self, int Id)"""
3303 return _core_.Event_SetId(*args, **kwargs)
3304
3305 def IsCommandEvent(*args, **kwargs):
3306 """IsCommandEvent(self) -> bool"""
3307 return _core_.Event_IsCommandEvent(*args, **kwargs)
3308
3309 def Skip(*args, **kwargs):
3310 """
3311 Skip(self, bool skip=True)
3312
3313 Called by an event handler, it controls whether additional event
3314 handlers bound to this event will be called after the current event
3315 handler returns. Skip(false) (the default setting) will prevent
3316 additional event handlers from being called and control will be
3317 returned to the sender of the event immediately after the current
3318 handler has finished. Skip(True) will cause the event processing
3319 system to continue searching for a handler function for this event.
3320
3321 """
3322 return _core_.Event_Skip(*args, **kwargs)
3323
3324 def GetSkipped(*args, **kwargs):
3325 """GetSkipped(self) -> bool"""
3326 return _core_.Event_GetSkipped(*args, **kwargs)
3327
3328 def ShouldPropagate(*args, **kwargs):
3329 """ShouldPropagate(self) -> bool"""
3330 return _core_.Event_ShouldPropagate(*args, **kwargs)
3331
3332 def StopPropagation(*args, **kwargs):
3333 """StopPropagation(self) -> int"""
3334 return _core_.Event_StopPropagation(*args, **kwargs)
3335
3336 def ResumePropagation(*args, **kwargs):
3337 """ResumePropagation(self, int propagationLevel)"""
3338 return _core_.Event_ResumePropagation(*args, **kwargs)
3339
3340 def Clone(*args, **kwargs):
3341 """Clone(self) -> Event"""
3342 return _core_.Event_Clone(*args, **kwargs)
3343
3344
3345 class EventPtr(Event):
3346 def __init__(self, this):
3347 self.this = this
3348 if not hasattr(self,"thisown"): self.thisown = 0
3349 self.__class__ = Event
3350 _core_.Event_swigregister(EventPtr)
3351
3352 #---------------------------------------------------------------------------
3353
3354 class PropagationDisabler(object):
3355 """Proxy of C++ PropagationDisabler class"""
3356 def __repr__(self):
3357 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3358 def __init__(self, *args, **kwargs):
3359 """__init__(self, Event event) -> PropagationDisabler"""
3360 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3361 self.this = newobj.this
3362 self.thisown = 1
3363 del newobj.thisown
3364 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3365 """__del__(self)"""
3366 try:
3367 if self.thisown: destroy(self)
3368 except: pass
3369
3370
3371 class PropagationDisablerPtr(PropagationDisabler):
3372 def __init__(self, this):
3373 self.this = this
3374 if not hasattr(self,"thisown"): self.thisown = 0
3375 self.__class__ = PropagationDisabler
3376 _core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3377
3378 class PropagateOnce(object):
3379 """Proxy of C++ PropagateOnce class"""
3380 def __repr__(self):
3381 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3382 def __init__(self, *args, **kwargs):
3383 """__init__(self, Event event) -> PropagateOnce"""
3384 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3385 self.this = newobj.this
3386 self.thisown = 1
3387 del newobj.thisown
3388 def __del__(self, destroy=_core_.delete_PropagateOnce):
3389 """__del__(self)"""
3390 try:
3391 if self.thisown: destroy(self)
3392 except: pass
3393
3394
3395 class PropagateOncePtr(PropagateOnce):
3396 def __init__(self, this):
3397 self.this = this
3398 if not hasattr(self,"thisown"): self.thisown = 0
3399 self.__class__ = PropagateOnce
3400 _core_.PropagateOnce_swigregister(PropagateOncePtr)
3401
3402 #---------------------------------------------------------------------------
3403
3404 class CommandEvent(Event):
3405 """Proxy of C++ CommandEvent class"""
3406 def __repr__(self):
3407 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3408 def __init__(self, *args, **kwargs):
3409 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3410 newobj = _core_.new_CommandEvent(*args, **kwargs)
3411 self.this = newobj.this
3412 self.thisown = 1
3413 del newobj.thisown
3414 def GetSelection(*args, **kwargs):
3415 """GetSelection(self) -> int"""
3416 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3417
3418 def SetString(*args, **kwargs):
3419 """SetString(self, String s)"""
3420 return _core_.CommandEvent_SetString(*args, **kwargs)
3421
3422 def GetString(*args, **kwargs):
3423 """GetString(self) -> String"""
3424 return _core_.CommandEvent_GetString(*args, **kwargs)
3425
3426 def IsChecked(*args, **kwargs):
3427 """IsChecked(self) -> bool"""
3428 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3429
3430 Checked = IsChecked
3431 def IsSelection(*args, **kwargs):
3432 """IsSelection(self) -> bool"""
3433 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3434
3435 def SetExtraLong(*args, **kwargs):
3436 """SetExtraLong(self, long extraLong)"""
3437 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3438
3439 def GetExtraLong(*args, **kwargs):
3440 """GetExtraLong(self) -> long"""
3441 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3442
3443 def SetInt(*args, **kwargs):
3444 """SetInt(self, int i)"""
3445 return _core_.CommandEvent_SetInt(*args, **kwargs)
3446
3447 def GetInt(*args, **kwargs):
3448 """GetInt(self) -> long"""
3449 return _core_.CommandEvent_GetInt(*args, **kwargs)
3450
3451 def Clone(*args, **kwargs):
3452 """Clone(self) -> Event"""
3453 return _core_.CommandEvent_Clone(*args, **kwargs)
3454
3455
3456 class CommandEventPtr(CommandEvent):
3457 def __init__(self, this):
3458 self.this = this
3459 if not hasattr(self,"thisown"): self.thisown = 0
3460 self.__class__ = CommandEvent
3461 _core_.CommandEvent_swigregister(CommandEventPtr)
3462
3463 #---------------------------------------------------------------------------
3464
3465 class NotifyEvent(CommandEvent):
3466 """Proxy of C++ NotifyEvent class"""
3467 def __repr__(self):
3468 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3469 def __init__(self, *args, **kwargs):
3470 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3471 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3472 self.this = newobj.this
3473 self.thisown = 1
3474 del newobj.thisown
3475 def Veto(*args, **kwargs):
3476 """Veto(self)"""
3477 return _core_.NotifyEvent_Veto(*args, **kwargs)
3478
3479 def Allow(*args, **kwargs):
3480 """Allow(self)"""
3481 return _core_.NotifyEvent_Allow(*args, **kwargs)
3482
3483 def IsAllowed(*args, **kwargs):
3484 """IsAllowed(self) -> bool"""
3485 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3486
3487
3488 class NotifyEventPtr(NotifyEvent):
3489 def __init__(self, this):
3490 self.this = this
3491 if not hasattr(self,"thisown"): self.thisown = 0
3492 self.__class__ = NotifyEvent
3493 _core_.NotifyEvent_swigregister(NotifyEventPtr)
3494
3495 #---------------------------------------------------------------------------
3496
3497 class ScrollEvent(CommandEvent):
3498 """Proxy of C++ ScrollEvent class"""
3499 def __repr__(self):
3500 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3501 def __init__(self, *args, **kwargs):
3502 """
3503 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3504 int orient=0) -> ScrollEvent
3505 """
3506 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3507 self.this = newobj.this
3508 self.thisown = 1
3509 del newobj.thisown
3510 def GetOrientation(*args, **kwargs):
3511 """GetOrientation(self) -> int"""
3512 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3513
3514 def GetPosition(*args, **kwargs):
3515 """GetPosition(self) -> int"""
3516 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3517
3518 def SetOrientation(*args, **kwargs):
3519 """SetOrientation(self, int orient)"""
3520 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3521
3522 def SetPosition(*args, **kwargs):
3523 """SetPosition(self, int pos)"""
3524 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3525
3526
3527 class ScrollEventPtr(ScrollEvent):
3528 def __init__(self, this):
3529 self.this = this
3530 if not hasattr(self,"thisown"): self.thisown = 0
3531 self.__class__ = ScrollEvent
3532 _core_.ScrollEvent_swigregister(ScrollEventPtr)
3533
3534 #---------------------------------------------------------------------------
3535
3536 class ScrollWinEvent(Event):
3537 """Proxy of C++ ScrollWinEvent class"""
3538 def __repr__(self):
3539 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3540 def __init__(self, *args, **kwargs):
3541 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3542 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3543 self.this = newobj.this
3544 self.thisown = 1
3545 del newobj.thisown
3546 def GetOrientation(*args, **kwargs):
3547 """GetOrientation(self) -> int"""
3548 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3549
3550 def GetPosition(*args, **kwargs):
3551 """GetPosition(self) -> int"""
3552 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3553
3554 def SetOrientation(*args, **kwargs):
3555 """SetOrientation(self, int orient)"""
3556 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3557
3558 def SetPosition(*args, **kwargs):
3559 """SetPosition(self, int pos)"""
3560 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3561
3562
3563 class ScrollWinEventPtr(ScrollWinEvent):
3564 def __init__(self, this):
3565 self.this = this
3566 if not hasattr(self,"thisown"): self.thisown = 0
3567 self.__class__ = ScrollWinEvent
3568 _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3569
3570 #---------------------------------------------------------------------------
3571
3572 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3573 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3574 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3575 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3576 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3577 class MouseEvent(Event):
3578 """Proxy of C++ MouseEvent class"""
3579 def __repr__(self):
3580 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3581 def __init__(self, *args, **kwargs):
3582 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3583 newobj = _core_.new_MouseEvent(*args, **kwargs)
3584 self.this = newobj.this
3585 self.thisown = 1
3586 del newobj.thisown
3587 def IsButton(*args, **kwargs):
3588 """IsButton(self) -> bool"""
3589 return _core_.MouseEvent_IsButton(*args, **kwargs)
3590
3591 def ButtonDown(*args, **kwargs):
3592 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3593 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3594
3595 def ButtonDClick(*args, **kwargs):
3596 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3597 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3598
3599 def ButtonUp(*args, **kwargs):
3600 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3601 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3602
3603 def Button(*args, **kwargs):
3604 """Button(self, int but) -> bool"""
3605 return _core_.MouseEvent_Button(*args, **kwargs)
3606
3607 def ButtonIsDown(*args, **kwargs):
3608 """ButtonIsDown(self, int but) -> bool"""
3609 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3610
3611 def GetButton(*args, **kwargs):
3612 """GetButton(self) -> int"""
3613 return _core_.MouseEvent_GetButton(*args, **kwargs)
3614
3615 def ControlDown(*args, **kwargs):
3616 """ControlDown(self) -> bool"""
3617 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3618
3619 def MetaDown(*args, **kwargs):
3620 """MetaDown(self) -> bool"""
3621 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3622
3623 def AltDown(*args, **kwargs):
3624 """AltDown(self) -> bool"""
3625 return _core_.MouseEvent_AltDown(*args, **kwargs)
3626
3627 def ShiftDown(*args, **kwargs):
3628 """ShiftDown(self) -> bool"""
3629 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3630
3631 def CmdDown(*args, **kwargs):
3632 """
3633 CmdDown(self) -> bool
3634
3635 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3636 platforms but the special "Apple" (a.k.a as "Command") key on
3637 Macs: it makes often sense to use it instead of, say, `ControlDown`
3638 because Cmd key is used for the same thing under Mac as Ctrl
3639 elsewhere. The Ctrl still exists, it's just not used for this
3640 purpose. So for non-Mac platforms this is the same as `ControlDown`
3641 and Macs this is the same as `MetaDown`.
3642 """
3643 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3644
3645 def LeftDown(*args, **kwargs):
3646 """LeftDown(self) -> bool"""
3647 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3648
3649 def MiddleDown(*args, **kwargs):
3650 """MiddleDown(self) -> bool"""
3651 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3652
3653 def RightDown(*args, **kwargs):
3654 """RightDown(self) -> bool"""
3655 return _core_.MouseEvent_RightDown(*args, **kwargs)
3656
3657 def LeftUp(*args, **kwargs):
3658 """LeftUp(self) -> bool"""
3659 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3660
3661 def MiddleUp(*args, **kwargs):
3662 """MiddleUp(self) -> bool"""
3663 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3664
3665 def RightUp(*args, **kwargs):
3666 """RightUp(self) -> bool"""
3667 return _core_.MouseEvent_RightUp(*args, **kwargs)
3668
3669 def LeftDClick(*args, **kwargs):
3670 """LeftDClick(self) -> bool"""
3671 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3672
3673 def MiddleDClick(*args, **kwargs):
3674 """MiddleDClick(self) -> bool"""
3675 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3676
3677 def RightDClick(*args, **kwargs):
3678 """RightDClick(self) -> bool"""
3679 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3680
3681 def LeftIsDown(*args, **kwargs):
3682 """LeftIsDown(self) -> bool"""
3683 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3684
3685 def MiddleIsDown(*args, **kwargs):
3686 """MiddleIsDown(self) -> bool"""
3687 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3688
3689 def RightIsDown(*args, **kwargs):
3690 """RightIsDown(self) -> bool"""
3691 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3692
3693 def Dragging(*args, **kwargs):
3694 """Dragging(self) -> bool"""
3695 return _core_.MouseEvent_Dragging(*args, **kwargs)
3696
3697 def Moving(*args, **kwargs):
3698 """Moving(self) -> bool"""
3699 return _core_.MouseEvent_Moving(*args, **kwargs)
3700
3701 def Entering(*args, **kwargs):
3702 """Entering(self) -> bool"""
3703 return _core_.MouseEvent_Entering(*args, **kwargs)
3704
3705 def Leaving(*args, **kwargs):
3706 """Leaving(self) -> bool"""
3707 return _core_.MouseEvent_Leaving(*args, **kwargs)
3708
3709 def GetPosition(*args, **kwargs):
3710 """
3711 GetPosition(self) -> Point
3712
3713 Returns the position of the mouse in window coordinates when the event
3714 happened.
3715 """
3716 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3717
3718 def GetPositionTuple(*args, **kwargs):
3719 """
3720 GetPositionTuple() -> (x,y)
3721
3722 Returns the position of the mouse in window coordinates when the event
3723 happened.
3724 """
3725 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3726
3727 def GetLogicalPosition(*args, **kwargs):
3728 """GetLogicalPosition(self, DC dc) -> Point"""
3729 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3730
3731 def GetX(*args, **kwargs):
3732 """GetX(self) -> int"""
3733 return _core_.MouseEvent_GetX(*args, **kwargs)
3734
3735 def GetY(*args, **kwargs):
3736 """GetY(self) -> int"""
3737 return _core_.MouseEvent_GetY(*args, **kwargs)
3738
3739 def GetWheelRotation(*args, **kwargs):
3740 """GetWheelRotation(self) -> int"""
3741 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3742
3743 def GetWheelDelta(*args, **kwargs):
3744 """GetWheelDelta(self) -> int"""
3745 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3746
3747 def GetLinesPerAction(*args, **kwargs):
3748 """GetLinesPerAction(self) -> int"""
3749 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3750
3751 def IsPageScroll(*args, **kwargs):
3752 """IsPageScroll(self) -> bool"""
3753 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3754
3755 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3756 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3757 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3758 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3759 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3760 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3761 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3762 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3763 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3764 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3765 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3766 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3767
3768 class MouseEventPtr(MouseEvent):
3769 def __init__(self, this):
3770 self.this = this
3771 if not hasattr(self,"thisown"): self.thisown = 0
3772 self.__class__ = MouseEvent
3773 _core_.MouseEvent_swigregister(MouseEventPtr)
3774
3775 #---------------------------------------------------------------------------
3776
3777 class SetCursorEvent(Event):
3778 """Proxy of C++ SetCursorEvent class"""
3779 def __repr__(self):
3780 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3781 def __init__(self, *args, **kwargs):
3782 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3783 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3784 self.this = newobj.this
3785 self.thisown = 1
3786 del newobj.thisown
3787 def GetX(*args, **kwargs):
3788 """GetX(self) -> int"""
3789 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3790
3791 def GetY(*args, **kwargs):
3792 """GetY(self) -> int"""
3793 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3794
3795 def SetCursor(*args, **kwargs):
3796 """SetCursor(self, Cursor cursor)"""
3797 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3798
3799 def GetCursor(*args, **kwargs):
3800 """GetCursor(self) -> Cursor"""
3801 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3802
3803 def HasCursor(*args, **kwargs):
3804 """HasCursor(self) -> bool"""
3805 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3806
3807
3808 class SetCursorEventPtr(SetCursorEvent):
3809 def __init__(self, this):
3810 self.this = this
3811 if not hasattr(self,"thisown"): self.thisown = 0
3812 self.__class__ = SetCursorEvent
3813 _core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3814
3815 #---------------------------------------------------------------------------
3816
3817 class KeyEvent(Event):
3818 """Proxy of C++ KeyEvent class"""
3819 def __repr__(self):
3820 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3821 def __init__(self, *args, **kwargs):
3822 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3823 newobj = _core_.new_KeyEvent(*args, **kwargs)
3824 self.this = newobj.this
3825 self.thisown = 1
3826 del newobj.thisown
3827 def ControlDown(*args, **kwargs):
3828 """ControlDown(self) -> bool"""
3829 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3830
3831 def MetaDown(*args, **kwargs):
3832 """MetaDown(self) -> bool"""
3833 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3834
3835 def AltDown(*args, **kwargs):
3836 """AltDown(self) -> bool"""
3837 return _core_.KeyEvent_AltDown(*args, **kwargs)
3838
3839 def ShiftDown(*args, **kwargs):
3840 """ShiftDown(self) -> bool"""
3841 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3842
3843 def CmdDown(*args, **kwargs):
3844 """
3845 CmdDown(self) -> bool
3846
3847 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3848 platforms but the special "Apple" (a.k.a as "Command") key on
3849 Macs: it makes often sense to use it instead of, say, `ControlDown`
3850 because Cmd key is used for the same thing under Mac as Ctrl
3851 elsewhere. The Ctrl still exists, it's just not used for this
3852 purpose. So for non-Mac platforms this is the same as `ControlDown`
3853 and Macs this is the same as `MetaDown`.
3854 """
3855 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3856
3857 def HasModifiers(*args, **kwargs):
3858 """HasModifiers(self) -> bool"""
3859 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3860
3861 def GetKeyCode(*args, **kwargs):
3862 """GetKeyCode(self) -> int"""
3863 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3864
3865 KeyCode = GetKeyCode
3866 def GetUnicodeKey(*args, **kwargs):
3867 """GetUnicodeKey(self) -> int"""
3868 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
3869
3870 GetUniChar = GetUnicodeKey
3871 def GetRawKeyCode(*args, **kwargs):
3872 """GetRawKeyCode(self) -> unsigned int"""
3873 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3874
3875 def GetRawKeyFlags(*args, **kwargs):
3876 """GetRawKeyFlags(self) -> unsigned int"""
3877 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3878
3879 def GetPosition(*args, **kwargs):
3880 """
3881 GetPosition(self) -> Point
3882
3883 Find the position of the event.
3884 """
3885 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3886
3887 def GetPositionTuple(*args, **kwargs):
3888 """
3889 GetPositionTuple() -> (x,y)
3890
3891 Find the position of the event.
3892 """
3893 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3894
3895 def GetX(*args, **kwargs):
3896 """GetX(self) -> int"""
3897 return _core_.KeyEvent_GetX(*args, **kwargs)
3898
3899 def GetY(*args, **kwargs):
3900 """GetY(self) -> int"""
3901 return _core_.KeyEvent_GetY(*args, **kwargs)
3902
3903 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3904 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3905 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3906 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3907 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3908 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3909 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3910 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3911 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3912 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3913
3914 class KeyEventPtr(KeyEvent):
3915 def __init__(self, this):
3916 self.this = this
3917 if not hasattr(self,"thisown"): self.thisown = 0
3918 self.__class__ = KeyEvent
3919 _core_.KeyEvent_swigregister(KeyEventPtr)
3920
3921 #---------------------------------------------------------------------------
3922
3923 class SizeEvent(Event):
3924 """Proxy of C++ SizeEvent class"""
3925 def __repr__(self):
3926 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3927 def __init__(self, *args, **kwargs):
3928 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3929 newobj = _core_.new_SizeEvent(*args, **kwargs)
3930 self.this = newobj.this
3931 self.thisown = 1
3932 del newobj.thisown
3933 def GetSize(*args, **kwargs):
3934 """GetSize(self) -> Size"""
3935 return _core_.SizeEvent_GetSize(*args, **kwargs)
3936
3937 def GetRect(*args, **kwargs):
3938 """GetRect(self) -> Rect"""
3939 return _core_.SizeEvent_GetRect(*args, **kwargs)
3940
3941 def SetRect(*args, **kwargs):
3942 """SetRect(self, Rect rect)"""
3943 return _core_.SizeEvent_SetRect(*args, **kwargs)
3944
3945 def SetSize(*args, **kwargs):
3946 """SetSize(self, Size size)"""
3947 return _core_.SizeEvent_SetSize(*args, **kwargs)
3948
3949 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3950 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3951
3952 class SizeEventPtr(SizeEvent):
3953 def __init__(self, this):
3954 self.this = this
3955 if not hasattr(self,"thisown"): self.thisown = 0
3956 self.__class__ = SizeEvent
3957 _core_.SizeEvent_swigregister(SizeEventPtr)
3958
3959 #---------------------------------------------------------------------------
3960
3961 class MoveEvent(Event):
3962 """Proxy of C++ MoveEvent class"""
3963 def __repr__(self):
3964 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3965 def __init__(self, *args, **kwargs):
3966 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
3967 newobj = _core_.new_MoveEvent(*args, **kwargs)
3968 self.this = newobj.this
3969 self.thisown = 1
3970 del newobj.thisown
3971 def GetPosition(*args, **kwargs):
3972 """GetPosition(self) -> Point"""
3973 return _core_.MoveEvent_GetPosition(*args, **kwargs)
3974
3975 def GetRect(*args, **kwargs):
3976 """GetRect(self) -> Rect"""
3977 return _core_.MoveEvent_GetRect(*args, **kwargs)
3978
3979 def SetRect(*args, **kwargs):
3980 """SetRect(self, Rect rect)"""
3981 return _core_.MoveEvent_SetRect(*args, **kwargs)
3982
3983 def SetPosition(*args, **kwargs):
3984 """SetPosition(self, Point pos)"""
3985 return _core_.MoveEvent_SetPosition(*args, **kwargs)
3986
3987 m_pos = property(GetPosition, SetPosition)
3988 m_rect = property(GetRect, SetRect)
3989
3990
3991 class MoveEventPtr(MoveEvent):
3992 def __init__(self, this):
3993 self.this = this
3994 if not hasattr(self,"thisown"): self.thisown = 0
3995 self.__class__ = MoveEvent
3996 _core_.MoveEvent_swigregister(MoveEventPtr)
3997
3998 #---------------------------------------------------------------------------
3999
4000 class PaintEvent(Event):
4001 """Proxy of C++ PaintEvent class"""
4002 def __repr__(self):
4003 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4004 def __init__(self, *args, **kwargs):
4005 """__init__(self, int Id=0) -> PaintEvent"""
4006 newobj = _core_.new_PaintEvent(*args, **kwargs)
4007 self.this = newobj.this
4008 self.thisown = 1
4009 del newobj.thisown
4010
4011 class PaintEventPtr(PaintEvent):
4012 def __init__(self, this):
4013 self.this = this
4014 if not hasattr(self,"thisown"): self.thisown = 0
4015 self.__class__ = PaintEvent
4016 _core_.PaintEvent_swigregister(PaintEventPtr)
4017
4018 class NcPaintEvent(Event):
4019 """Proxy of C++ NcPaintEvent class"""
4020 def __repr__(self):
4021 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4022 def __init__(self, *args, **kwargs):
4023 """__init__(self, int winid=0) -> NcPaintEvent"""
4024 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
4025 self.this = newobj.this
4026 self.thisown = 1
4027 del newobj.thisown
4028
4029 class NcPaintEventPtr(NcPaintEvent):
4030 def __init__(self, this):
4031 self.this = this
4032 if not hasattr(self,"thisown"): self.thisown = 0
4033 self.__class__ = NcPaintEvent
4034 _core_.NcPaintEvent_swigregister(NcPaintEventPtr)
4035
4036 #---------------------------------------------------------------------------
4037
4038 class EraseEvent(Event):
4039 """Proxy of C++ EraseEvent class"""
4040 def __repr__(self):
4041 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4042 def __init__(self, *args, **kwargs):
4043 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4044 newobj = _core_.new_EraseEvent(*args, **kwargs)
4045 self.this = newobj.this
4046 self.thisown = 1
4047 del newobj.thisown
4048 def GetDC(*args, **kwargs):
4049 """GetDC(self) -> DC"""
4050 return _core_.EraseEvent_GetDC(*args, **kwargs)
4051
4052
4053 class EraseEventPtr(EraseEvent):
4054 def __init__(self, this):
4055 self.this = this
4056 if not hasattr(self,"thisown"): self.thisown = 0
4057 self.__class__ = EraseEvent
4058 _core_.EraseEvent_swigregister(EraseEventPtr)
4059
4060 #---------------------------------------------------------------------------
4061
4062 class FocusEvent(Event):
4063 """Proxy of C++ FocusEvent class"""
4064 def __repr__(self):
4065 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4066 def __init__(self, *args, **kwargs):
4067 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4068 newobj = _core_.new_FocusEvent(*args, **kwargs)
4069 self.this = newobj.this
4070 self.thisown = 1
4071 del newobj.thisown
4072 def GetWindow(*args, **kwargs):
4073 """GetWindow(self) -> Window"""
4074 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4075
4076 def SetWindow(*args, **kwargs):
4077 """SetWindow(self, Window win)"""
4078 return _core_.FocusEvent_SetWindow(*args, **kwargs)
4079
4080
4081 class FocusEventPtr(FocusEvent):
4082 def __init__(self, this):
4083 self.this = this
4084 if not hasattr(self,"thisown"): self.thisown = 0
4085 self.__class__ = FocusEvent
4086 _core_.FocusEvent_swigregister(FocusEventPtr)
4087
4088 #---------------------------------------------------------------------------
4089
4090 class ChildFocusEvent(CommandEvent):
4091 """Proxy of C++ ChildFocusEvent class"""
4092 def __repr__(self):
4093 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4094 def __init__(self, *args, **kwargs):
4095 """__init__(self, Window win=None) -> ChildFocusEvent"""
4096 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
4097 self.this = newobj.this
4098 self.thisown = 1
4099 del newobj.thisown
4100 def GetWindow(*args, **kwargs):
4101 """GetWindow(self) -> Window"""
4102 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
4103
4104
4105 class ChildFocusEventPtr(ChildFocusEvent):
4106 def __init__(self, this):
4107 self.this = this
4108 if not hasattr(self,"thisown"): self.thisown = 0
4109 self.__class__ = ChildFocusEvent
4110 _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
4111
4112 #---------------------------------------------------------------------------
4113
4114 class ActivateEvent(Event):
4115 """Proxy of C++ ActivateEvent class"""
4116 def __repr__(self):
4117 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4118 def __init__(self, *args, **kwargs):
4119 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4120 newobj = _core_.new_ActivateEvent(*args, **kwargs)
4121 self.this = newobj.this
4122 self.thisown = 1
4123 del newobj.thisown
4124 def GetActive(*args, **kwargs):
4125 """GetActive(self) -> bool"""
4126 return _core_.ActivateEvent_GetActive(*args, **kwargs)
4127
4128
4129 class ActivateEventPtr(ActivateEvent):
4130 def __init__(self, this):
4131 self.this = this
4132 if not hasattr(self,"thisown"): self.thisown = 0
4133 self.__class__ = ActivateEvent
4134 _core_.ActivateEvent_swigregister(ActivateEventPtr)
4135
4136 #---------------------------------------------------------------------------
4137
4138 class InitDialogEvent(Event):
4139 """Proxy of C++ InitDialogEvent class"""
4140 def __repr__(self):
4141 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4142 def __init__(self, *args, **kwargs):
4143 """__init__(self, int Id=0) -> InitDialogEvent"""
4144 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
4145 self.this = newobj.this
4146 self.thisown = 1
4147 del newobj.thisown
4148
4149 class InitDialogEventPtr(InitDialogEvent):
4150 def __init__(self, this):
4151 self.this = this
4152 if not hasattr(self,"thisown"): self.thisown = 0
4153 self.__class__ = InitDialogEvent
4154 _core_.InitDialogEvent_swigregister(InitDialogEventPtr)
4155
4156 #---------------------------------------------------------------------------
4157
4158 class MenuEvent(Event):
4159 """Proxy of C++ MenuEvent class"""
4160 def __repr__(self):
4161 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4162 def __init__(self, *args, **kwargs):
4163 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4164 newobj = _core_.new_MenuEvent(*args, **kwargs)
4165 self.this = newobj.this
4166 self.thisown = 1
4167 del newobj.thisown
4168 def GetMenuId(*args, **kwargs):
4169 """GetMenuId(self) -> int"""
4170 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4171
4172 def IsPopup(*args, **kwargs):
4173 """IsPopup(self) -> bool"""
4174 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4175
4176 def GetMenu(*args, **kwargs):
4177 """GetMenu(self) -> Menu"""
4178 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4179
4180
4181 class MenuEventPtr(MenuEvent):
4182 def __init__(self, this):
4183 self.this = this
4184 if not hasattr(self,"thisown"): self.thisown = 0
4185 self.__class__ = MenuEvent
4186 _core_.MenuEvent_swigregister(MenuEventPtr)
4187
4188 #---------------------------------------------------------------------------
4189
4190 class CloseEvent(Event):
4191 """Proxy of C++ CloseEvent class"""
4192 def __repr__(self):
4193 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4194 def __init__(self, *args, **kwargs):
4195 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4196 newobj = _core_.new_CloseEvent(*args, **kwargs)
4197 self.this = newobj.this
4198 self.thisown = 1
4199 del newobj.thisown
4200 def SetLoggingOff(*args, **kwargs):
4201 """SetLoggingOff(self, bool logOff)"""
4202 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4203
4204 def GetLoggingOff(*args, **kwargs):
4205 """GetLoggingOff(self) -> bool"""
4206 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4207
4208 def Veto(*args, **kwargs):
4209 """Veto(self, bool veto=True)"""
4210 return _core_.CloseEvent_Veto(*args, **kwargs)
4211
4212 def SetCanVeto(*args, **kwargs):
4213 """SetCanVeto(self, bool canVeto)"""
4214 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4215
4216 def CanVeto(*args, **kwargs):
4217 """CanVeto(self) -> bool"""
4218 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4219
4220 def GetVeto(*args, **kwargs):
4221 """GetVeto(self) -> bool"""
4222 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4223
4224
4225 class CloseEventPtr(CloseEvent):
4226 def __init__(self, this):
4227 self.this = this
4228 if not hasattr(self,"thisown"): self.thisown = 0
4229 self.__class__ = CloseEvent
4230 _core_.CloseEvent_swigregister(CloseEventPtr)
4231
4232 #---------------------------------------------------------------------------
4233
4234 class ShowEvent(Event):
4235 """Proxy of C++ ShowEvent class"""
4236 def __repr__(self):
4237 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4238 def __init__(self, *args, **kwargs):
4239 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4240 newobj = _core_.new_ShowEvent(*args, **kwargs)
4241 self.this = newobj.this
4242 self.thisown = 1
4243 del newobj.thisown
4244 def SetShow(*args, **kwargs):
4245 """SetShow(self, bool show)"""
4246 return _core_.ShowEvent_SetShow(*args, **kwargs)
4247
4248 def GetShow(*args, **kwargs):
4249 """GetShow(self) -> bool"""
4250 return _core_.ShowEvent_GetShow(*args, **kwargs)
4251
4252
4253 class ShowEventPtr(ShowEvent):
4254 def __init__(self, this):
4255 self.this = this
4256 if not hasattr(self,"thisown"): self.thisown = 0
4257 self.__class__ = ShowEvent
4258 _core_.ShowEvent_swigregister(ShowEventPtr)
4259
4260 #---------------------------------------------------------------------------
4261
4262 class IconizeEvent(Event):
4263 """Proxy of C++ IconizeEvent class"""
4264 def __repr__(self):
4265 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4266 def __init__(self, *args, **kwargs):
4267 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4268 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4269 self.this = newobj.this
4270 self.thisown = 1
4271 del newobj.thisown
4272 def Iconized(*args, **kwargs):
4273 """Iconized(self) -> bool"""
4274 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4275
4276
4277 class IconizeEventPtr(IconizeEvent):
4278 def __init__(self, this):
4279 self.this = this
4280 if not hasattr(self,"thisown"): self.thisown = 0
4281 self.__class__ = IconizeEvent
4282 _core_.IconizeEvent_swigregister(IconizeEventPtr)
4283
4284 #---------------------------------------------------------------------------
4285
4286 class MaximizeEvent(Event):
4287 """Proxy of C++ MaximizeEvent class"""
4288 def __repr__(self):
4289 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4290 def __init__(self, *args, **kwargs):
4291 """__init__(self, int id=0) -> MaximizeEvent"""
4292 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4293 self.this = newobj.this
4294 self.thisown = 1
4295 del newobj.thisown
4296
4297 class MaximizeEventPtr(MaximizeEvent):
4298 def __init__(self, this):
4299 self.this = this
4300 if not hasattr(self,"thisown"): self.thisown = 0
4301 self.__class__ = MaximizeEvent
4302 _core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4303
4304 #---------------------------------------------------------------------------
4305
4306 class DropFilesEvent(Event):
4307 """Proxy of C++ DropFilesEvent class"""
4308 def __init__(self): raise RuntimeError, "No constructor defined"
4309 def __repr__(self):
4310 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4311 def GetPosition(*args, **kwargs):
4312 """GetPosition(self) -> Point"""
4313 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4314
4315 def GetNumberOfFiles(*args, **kwargs):
4316 """GetNumberOfFiles(self) -> int"""
4317 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4318
4319 def GetFiles(*args, **kwargs):
4320 """GetFiles(self) -> PyObject"""
4321 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4322
4323
4324 class DropFilesEventPtr(DropFilesEvent):
4325 def __init__(self, this):
4326 self.this = this
4327 if not hasattr(self,"thisown"): self.thisown = 0
4328 self.__class__ = DropFilesEvent
4329 _core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4330
4331 #---------------------------------------------------------------------------
4332
4333 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4334 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4335 class UpdateUIEvent(CommandEvent):
4336 """Proxy of C++ UpdateUIEvent class"""
4337 def __repr__(self):
4338 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4339 def __init__(self, *args, **kwargs):
4340 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4341 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4342 self.this = newobj.this
4343 self.thisown = 1
4344 del newobj.thisown
4345 def GetChecked(*args, **kwargs):
4346 """GetChecked(self) -> bool"""
4347 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4348
4349 def GetEnabled(*args, **kwargs):
4350 """GetEnabled(self) -> bool"""
4351 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4352
4353 def GetText(*args, **kwargs):
4354 """GetText(self) -> String"""
4355 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4356
4357 def GetSetText(*args, **kwargs):
4358 """GetSetText(self) -> bool"""
4359 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4360
4361 def GetSetChecked(*args, **kwargs):
4362 """GetSetChecked(self) -> bool"""
4363 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4364
4365 def GetSetEnabled(*args, **kwargs):
4366 """GetSetEnabled(self) -> bool"""
4367 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4368
4369 def Check(*args, **kwargs):
4370 """Check(self, bool check)"""
4371 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4372
4373 def Enable(*args, **kwargs):
4374 """Enable(self, bool enable)"""
4375 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4376
4377 def SetText(*args, **kwargs):
4378 """SetText(self, String text)"""
4379 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4380
4381 def SetUpdateInterval(*args, **kwargs):
4382 """SetUpdateInterval(long updateInterval)"""
4383 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4384
4385 SetUpdateInterval = staticmethod(SetUpdateInterval)
4386 def GetUpdateInterval(*args, **kwargs):
4387 """GetUpdateInterval() -> long"""
4388 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4389
4390 GetUpdateInterval = staticmethod(GetUpdateInterval)
4391 def CanUpdate(*args, **kwargs):
4392 """CanUpdate(Window win) -> bool"""
4393 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4394
4395 CanUpdate = staticmethod(CanUpdate)
4396 def ResetUpdateTime(*args, **kwargs):
4397 """ResetUpdateTime()"""
4398 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4399
4400 ResetUpdateTime = staticmethod(ResetUpdateTime)
4401 def SetMode(*args, **kwargs):
4402 """SetMode(int mode)"""
4403 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4404
4405 SetMode = staticmethod(SetMode)
4406 def GetMode(*args, **kwargs):
4407 """GetMode() -> int"""
4408 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4409
4410 GetMode = staticmethod(GetMode)
4411
4412 class UpdateUIEventPtr(UpdateUIEvent):
4413 def __init__(self, this):
4414 self.this = this
4415 if not hasattr(self,"thisown"): self.thisown = 0
4416 self.__class__ = UpdateUIEvent
4417 _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4418
4419 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4420 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4421 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4422
4423 def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4424 """UpdateUIEvent_GetUpdateInterval() -> long"""
4425 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4426
4427 def UpdateUIEvent_CanUpdate(*args, **kwargs):
4428 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4429 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4430
4431 def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4432 """UpdateUIEvent_ResetUpdateTime()"""
4433 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4434
4435 def UpdateUIEvent_SetMode(*args, **kwargs):
4436 """UpdateUIEvent_SetMode(int mode)"""
4437 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4438
4439 def UpdateUIEvent_GetMode(*args, **kwargs):
4440 """UpdateUIEvent_GetMode() -> int"""
4441 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4442
4443 #---------------------------------------------------------------------------
4444
4445 class SysColourChangedEvent(Event):
4446 """Proxy of C++ SysColourChangedEvent class"""
4447 def __repr__(self):
4448 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4449 def __init__(self, *args, **kwargs):
4450 """__init__(self) -> SysColourChangedEvent"""
4451 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4452 self.this = newobj.this
4453 self.thisown = 1
4454 del newobj.thisown
4455
4456 class SysColourChangedEventPtr(SysColourChangedEvent):
4457 def __init__(self, this):
4458 self.this = this
4459 if not hasattr(self,"thisown"): self.thisown = 0
4460 self.__class__ = SysColourChangedEvent
4461 _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4462
4463 #---------------------------------------------------------------------------
4464
4465 class MouseCaptureChangedEvent(Event):
4466 """Proxy of C++ MouseCaptureChangedEvent class"""
4467 def __repr__(self):
4468 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4469 def __init__(self, *args, **kwargs):
4470 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4471 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4472 self.this = newobj.this
4473 self.thisown = 1
4474 del newobj.thisown
4475 def GetCapturedWindow(*args, **kwargs):
4476 """GetCapturedWindow(self) -> Window"""
4477 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4478
4479
4480 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4481 def __init__(self, this):
4482 self.this = this
4483 if not hasattr(self,"thisown"): self.thisown = 0
4484 self.__class__ = MouseCaptureChangedEvent
4485 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4486
4487 #---------------------------------------------------------------------------
4488
4489 class DisplayChangedEvent(Event):
4490 """Proxy of C++ DisplayChangedEvent class"""
4491 def __repr__(self):
4492 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4493 def __init__(self, *args, **kwargs):
4494 """__init__(self) -> DisplayChangedEvent"""
4495 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4496 self.this = newobj.this
4497 self.thisown = 1
4498 del newobj.thisown
4499
4500 class DisplayChangedEventPtr(DisplayChangedEvent):
4501 def __init__(self, this):
4502 self.this = this
4503 if not hasattr(self,"thisown"): self.thisown = 0
4504 self.__class__ = DisplayChangedEvent
4505 _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4506
4507 #---------------------------------------------------------------------------
4508
4509 class PaletteChangedEvent(Event):
4510 """Proxy of C++ PaletteChangedEvent class"""
4511 def __repr__(self):
4512 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4513 def __init__(self, *args, **kwargs):
4514 """__init__(self, int id=0) -> PaletteChangedEvent"""
4515 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4516 self.this = newobj.this
4517 self.thisown = 1
4518 del newobj.thisown
4519 def SetChangedWindow(*args, **kwargs):
4520 """SetChangedWindow(self, Window win)"""
4521 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4522
4523 def GetChangedWindow(*args, **kwargs):
4524 """GetChangedWindow(self) -> Window"""
4525 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4526
4527
4528 class PaletteChangedEventPtr(PaletteChangedEvent):
4529 def __init__(self, this):
4530 self.this = this
4531 if not hasattr(self,"thisown"): self.thisown = 0
4532 self.__class__ = PaletteChangedEvent
4533 _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4534
4535 #---------------------------------------------------------------------------
4536
4537 class QueryNewPaletteEvent(Event):
4538 """Proxy of C++ QueryNewPaletteEvent class"""
4539 def __repr__(self):
4540 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4541 def __init__(self, *args, **kwargs):
4542 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4543 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4544 self.this = newobj.this
4545 self.thisown = 1
4546 del newobj.thisown
4547 def SetPaletteRealized(*args, **kwargs):
4548 """SetPaletteRealized(self, bool realized)"""
4549 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4550
4551 def GetPaletteRealized(*args, **kwargs):
4552 """GetPaletteRealized(self) -> bool"""
4553 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4554
4555
4556 class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4557 def __init__(self, this):
4558 self.this = this
4559 if not hasattr(self,"thisown"): self.thisown = 0
4560 self.__class__ = QueryNewPaletteEvent
4561 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4562
4563 #---------------------------------------------------------------------------
4564
4565 class NavigationKeyEvent(Event):
4566 """Proxy of C++ NavigationKeyEvent class"""
4567 def __repr__(self):
4568 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4569 def __init__(self, *args, **kwargs):
4570 """__init__(self) -> NavigationKeyEvent"""
4571 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4572 self.this = newobj.this
4573 self.thisown = 1
4574 del newobj.thisown
4575 def GetDirection(*args, **kwargs):
4576 """GetDirection(self) -> bool"""
4577 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4578
4579 def SetDirection(*args, **kwargs):
4580 """SetDirection(self, bool forward)"""
4581 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4582
4583 def IsWindowChange(*args, **kwargs):
4584 """IsWindowChange(self) -> bool"""
4585 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4586
4587 def SetWindowChange(*args, **kwargs):
4588 """SetWindowChange(self, bool ischange)"""
4589 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4590
4591 def IsFromTab(*args, **kwargs):
4592 """IsFromTab(self) -> bool"""
4593 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
4594
4595 def SetFromTab(*args, **kwargs):
4596 """SetFromTab(self, bool bIs)"""
4597 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
4598
4599 def SetFlags(*args, **kwargs):
4600 """SetFlags(self, long flags)"""
4601 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4602
4603 def GetCurrentFocus(*args, **kwargs):
4604 """GetCurrentFocus(self) -> Window"""
4605 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4606
4607 def SetCurrentFocus(*args, **kwargs):
4608 """SetCurrentFocus(self, Window win)"""
4609 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4610
4611 IsBackward = _core_.NavigationKeyEvent_IsBackward
4612 IsForward = _core_.NavigationKeyEvent_IsForward
4613 WinChange = _core_.NavigationKeyEvent_WinChange
4614 FromTab = _core_.NavigationKeyEvent_FromTab
4615
4616 class NavigationKeyEventPtr(NavigationKeyEvent):
4617 def __init__(self, this):
4618 self.this = this
4619 if not hasattr(self,"thisown"): self.thisown = 0
4620 self.__class__ = NavigationKeyEvent
4621 _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4622
4623 #---------------------------------------------------------------------------
4624
4625 class WindowCreateEvent(CommandEvent):
4626 """Proxy of C++ WindowCreateEvent class"""
4627 def __repr__(self):
4628 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4629 def __init__(self, *args, **kwargs):
4630 """__init__(self, Window win=None) -> WindowCreateEvent"""
4631 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4632 self.this = newobj.this
4633 self.thisown = 1
4634 del newobj.thisown
4635 def GetWindow(*args, **kwargs):
4636 """GetWindow(self) -> Window"""
4637 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4638
4639
4640 class WindowCreateEventPtr(WindowCreateEvent):
4641 def __init__(self, this):
4642 self.this = this
4643 if not hasattr(self,"thisown"): self.thisown = 0
4644 self.__class__ = WindowCreateEvent
4645 _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4646
4647 class WindowDestroyEvent(CommandEvent):
4648 """Proxy of C++ WindowDestroyEvent class"""
4649 def __repr__(self):
4650 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4651 def __init__(self, *args, **kwargs):
4652 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4653 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4654 self.this = newobj.this
4655 self.thisown = 1
4656 del newobj.thisown
4657 def GetWindow(*args, **kwargs):
4658 """GetWindow(self) -> Window"""
4659 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4660
4661
4662 class WindowDestroyEventPtr(WindowDestroyEvent):
4663 def __init__(self, this):
4664 self.this = this
4665 if not hasattr(self,"thisown"): self.thisown = 0
4666 self.__class__ = WindowDestroyEvent
4667 _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4668
4669 #---------------------------------------------------------------------------
4670
4671 class ContextMenuEvent(CommandEvent):
4672 """Proxy of C++ ContextMenuEvent class"""
4673 def __repr__(self):
4674 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4675 def __init__(self, *args, **kwargs):
4676 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4677 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4678 self.this = newobj.this
4679 self.thisown = 1
4680 del newobj.thisown
4681 def GetPosition(*args, **kwargs):
4682 """GetPosition(self) -> Point"""
4683 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4684
4685 def SetPosition(*args, **kwargs):
4686 """SetPosition(self, Point pos)"""
4687 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4688
4689
4690 class ContextMenuEventPtr(ContextMenuEvent):
4691 def __init__(self, this):
4692 self.this = this
4693 if not hasattr(self,"thisown"): self.thisown = 0
4694 self.__class__ = ContextMenuEvent
4695 _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4696
4697 #---------------------------------------------------------------------------
4698
4699 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4700 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4701 class IdleEvent(Event):
4702 """Proxy of C++ IdleEvent class"""
4703 def __repr__(self):
4704 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4705 def __init__(self, *args, **kwargs):
4706 """__init__(self) -> IdleEvent"""
4707 newobj = _core_.new_IdleEvent(*args, **kwargs)
4708 self.this = newobj.this
4709 self.thisown = 1
4710 del newobj.thisown
4711 def RequestMore(*args, **kwargs):
4712 """RequestMore(self, bool needMore=True)"""
4713 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4714
4715 def MoreRequested(*args, **kwargs):
4716 """MoreRequested(self) -> bool"""
4717 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4718
4719 def SetMode(*args, **kwargs):
4720 """SetMode(int mode)"""
4721 return _core_.IdleEvent_SetMode(*args, **kwargs)
4722
4723 SetMode = staticmethod(SetMode)
4724 def GetMode(*args, **kwargs):
4725 """GetMode() -> int"""
4726 return _core_.IdleEvent_GetMode(*args, **kwargs)
4727
4728 GetMode = staticmethod(GetMode)
4729 def CanSend(*args, **kwargs):
4730 """CanSend(Window win) -> bool"""
4731 return _core_.IdleEvent_CanSend(*args, **kwargs)
4732
4733 CanSend = staticmethod(CanSend)
4734
4735 class IdleEventPtr(IdleEvent):
4736 def __init__(self, this):
4737 self.this = this
4738 if not hasattr(self,"thisown"): self.thisown = 0
4739 self.__class__ = IdleEvent
4740 _core_.IdleEvent_swigregister(IdleEventPtr)
4741
4742 def IdleEvent_SetMode(*args, **kwargs):
4743 """IdleEvent_SetMode(int mode)"""
4744 return _core_.IdleEvent_SetMode(*args, **kwargs)
4745
4746 def IdleEvent_GetMode(*args, **kwargs):
4747 """IdleEvent_GetMode() -> int"""
4748 return _core_.IdleEvent_GetMode(*args, **kwargs)
4749
4750 def IdleEvent_CanSend(*args, **kwargs):
4751 """IdleEvent_CanSend(Window win) -> bool"""
4752 return _core_.IdleEvent_CanSend(*args, **kwargs)
4753
4754 #---------------------------------------------------------------------------
4755
4756 class PyEvent(Event):
4757 """Proxy of C++ PyEvent class"""
4758 def __repr__(self):
4759 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4760 def __init__(self, *args, **kwargs):
4761 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4762 newobj = _core_.new_PyEvent(*args, **kwargs)
4763 self.this = newobj.this
4764 self.thisown = 1
4765 del newobj.thisown
4766 self.SetSelf(self)
4767
4768 def __del__(self, destroy=_core_.delete_PyEvent):
4769 """__del__(self)"""
4770 try:
4771 if self.thisown: destroy(self)
4772 except: pass
4773
4774 def SetSelf(*args, **kwargs):
4775 """SetSelf(self, PyObject self)"""
4776 return _core_.PyEvent_SetSelf(*args, **kwargs)
4777
4778 def GetSelf(*args, **kwargs):
4779 """GetSelf(self) -> PyObject"""
4780 return _core_.PyEvent_GetSelf(*args, **kwargs)
4781
4782
4783 class PyEventPtr(PyEvent):
4784 def __init__(self, this):
4785 self.this = this
4786 if not hasattr(self,"thisown"): self.thisown = 0
4787 self.__class__ = PyEvent
4788 _core_.PyEvent_swigregister(PyEventPtr)
4789
4790 class PyCommandEvent(CommandEvent):
4791 """Proxy of C++ PyCommandEvent class"""
4792 def __repr__(self):
4793 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4794 def __init__(self, *args, **kwargs):
4795 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4796 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4797 self.this = newobj.this
4798 self.thisown = 1
4799 del newobj.thisown
4800 self.SetSelf(self)
4801
4802 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4803 """__del__(self)"""
4804 try:
4805 if self.thisown: destroy(self)
4806 except: pass
4807
4808 def SetSelf(*args, **kwargs):
4809 """SetSelf(self, PyObject self)"""
4810 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4811
4812 def GetSelf(*args, **kwargs):
4813 """GetSelf(self) -> PyObject"""
4814 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4815
4816
4817 class PyCommandEventPtr(PyCommandEvent):
4818 def __init__(self, this):
4819 self.this = this
4820 if not hasattr(self,"thisown"): self.thisown = 0
4821 self.__class__ = PyCommandEvent
4822 _core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4823
4824 class DateEvent(CommandEvent):
4825 """Proxy of C++ DateEvent class"""
4826 def __repr__(self):
4827 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4828 def __init__(self, *args, **kwargs):
4829 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
4830 newobj = _core_.new_DateEvent(*args, **kwargs)
4831 self.this = newobj.this
4832 self.thisown = 1
4833 del newobj.thisown
4834 def GetDate(*args, **kwargs):
4835 """GetDate(self) -> DateTime"""
4836 return _core_.DateEvent_GetDate(*args, **kwargs)
4837
4838 def SetDate(*args, **kwargs):
4839 """SetDate(self, DateTime date)"""
4840 return _core_.DateEvent_SetDate(*args, **kwargs)
4841
4842
4843 class DateEventPtr(DateEvent):
4844 def __init__(self, this):
4845 self.this = this
4846 if not hasattr(self,"thisown"): self.thisown = 0
4847 self.__class__ = DateEvent
4848 _core_.DateEvent_swigregister(DateEventPtr)
4849
4850 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
4851 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
4852
4853 #---------------------------------------------------------------------------
4854
4855 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4856 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4857 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4858 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4859 PRINT_WINDOWS = _core_.PRINT_WINDOWS
4860 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4861 class PyApp(EvtHandler):
4862 """
4863 The ``wx.PyApp`` class is an *implementation detail*, please use the
4864 `wx.App` class (or some other derived class) instead.
4865 """
4866 def __repr__(self):
4867 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4868 def __init__(self, *args, **kwargs):
4869 """
4870 __init__(self) -> PyApp
4871
4872 Create a new application object, starting the bootstrap process.
4873 """
4874 newobj = _core_.new_PyApp(*args, **kwargs)
4875 self.this = newobj.this
4876 self.thisown = 1
4877 del newobj.thisown
4878 self._setCallbackInfo(self, PyApp)
4879 self._setOORInfo(self)
4880
4881 def __del__(self, destroy=_core_.delete_PyApp):
4882 """__del__(self)"""
4883 try:
4884 if self.thisown: destroy(self)
4885 except: pass
4886
4887 def _setCallbackInfo(*args, **kwargs):
4888 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4889 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4890
4891 def GetAppName(*args, **kwargs):
4892 """
4893 GetAppName(self) -> String
4894
4895 Get the application name.
4896 """
4897 return _core_.PyApp_GetAppName(*args, **kwargs)
4898
4899 def SetAppName(*args, **kwargs):
4900 """
4901 SetAppName(self, String name)
4902
4903 Set the application name. This value may be used automatically by
4904 `wx.Config` and such.
4905 """
4906 return _core_.PyApp_SetAppName(*args, **kwargs)
4907
4908 def GetClassName(*args, **kwargs):
4909 """
4910 GetClassName(self) -> String
4911
4912 Get the application's class name.
4913 """
4914 return _core_.PyApp_GetClassName(*args, **kwargs)
4915
4916 def SetClassName(*args, **kwargs):
4917 """
4918 SetClassName(self, String name)
4919
4920 Set the application's class name. This value may be used for
4921 X-resources if applicable for the platform
4922 """
4923 return _core_.PyApp_SetClassName(*args, **kwargs)
4924
4925 def GetVendorName(*args, **kwargs):
4926 """
4927 GetVendorName(self) -> String
4928
4929 Get the application's vendor name.
4930 """
4931 return _core_.PyApp_GetVendorName(*args, **kwargs)
4932
4933 def SetVendorName(*args, **kwargs):
4934 """
4935 SetVendorName(self, String name)
4936
4937 Set the application's vendor name. This value may be used
4938 automatically by `wx.Config` and such.
4939 """
4940 return _core_.PyApp_SetVendorName(*args, **kwargs)
4941
4942 def GetTraits(*args, **kwargs):
4943 """
4944 GetTraits(self) -> wxAppTraits
4945
4946 Return (and create if necessary) the app traits object to which we
4947 delegate for everything which either should be configurable by the
4948 user (then he can change the default behaviour simply by overriding
4949 CreateTraits() and returning his own traits object) or which is
4950 GUI/console dependent as then wx.AppTraits allows us to abstract the
4951 differences behind the common facade.
4952
4953 :todo: Add support for overriding CreateAppTraits in wxPython.
4954 """
4955 return _core_.PyApp_GetTraits(*args, **kwargs)
4956
4957 def ProcessPendingEvents(*args, **kwargs):
4958 """
4959 ProcessPendingEvents(self)
4960
4961 Process all events in the Pending Events list -- it is necessary to
4962 call this function to process posted events. This normally happens
4963 during each event loop iteration.
4964 """
4965 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
4966
4967 def Yield(*args, **kwargs):
4968 """
4969 Yield(self, bool onlyIfNeeded=False) -> bool
4970
4971 Process all currently pending events right now, instead of waiting
4972 until return to the event loop. It is an error to call ``Yield``
4973 recursively unless the value of ``onlyIfNeeded`` is True.
4974
4975 :warning: This function is dangerous as it can lead to unexpected
4976 reentrancies (i.e. when called from an event handler it may
4977 result in calling the same event handler again), use with
4978 extreme care or, better, don't use at all!
4979
4980 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
4981
4982 """
4983 return _core_.PyApp_Yield(*args, **kwargs)
4984
4985 def WakeUpIdle(*args, **kwargs):
4986 """
4987 WakeUpIdle(self)
4988
4989 Make sure that idle events are sent again.
4990 :see: `wx.WakeUpIdle`
4991 """
4992 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
4993
4994 def IsMainLoopRunning(*args, **kwargs):
4995 """
4996 IsMainLoopRunning() -> bool
4997
4998 Returns True if we're running the main loop, i.e. if the events can
4999 currently be dispatched.
5000 """
5001 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5002
5003 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
5004 def MainLoop(*args, **kwargs):
5005 """
5006 MainLoop(self) -> int
5007
5008 Execute the main GUI loop, the function doesn't normally return until
5009 all top level windows have been closed and destroyed.
5010 """
5011 return _core_.PyApp_MainLoop(*args, **kwargs)
5012
5013 def Exit(*args, **kwargs):
5014 """
5015 Exit(self)
5016
5017 Exit the main loop thus terminating the application.
5018 :see: `wx.Exit`
5019 """
5020 return _core_.PyApp_Exit(*args, **kwargs)
5021
5022 def ExitMainLoop(*args, **kwargs):
5023 """
5024 ExitMainLoop(self)
5025
5026 Exit the main GUI loop during the next iteration of the main
5027 loop, (i.e. it does not stop the program immediately!)
5028 """
5029 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
5030
5031 def Pending(*args, **kwargs):
5032 """
5033 Pending(self) -> bool
5034
5035 Returns True if there are unprocessed events in the event queue.
5036 """
5037 return _core_.PyApp_Pending(*args, **kwargs)
5038
5039 def Dispatch(*args, **kwargs):
5040 """
5041 Dispatch(self) -> bool
5042
5043 Process the first event in the event queue (blocks until an event
5044 appears if there are none currently)
5045 """
5046 return _core_.PyApp_Dispatch(*args, **kwargs)
5047
5048 def ProcessIdle(*args, **kwargs):
5049 """
5050 ProcessIdle(self) -> bool
5051
5052 Called from the MainLoop when the application becomes idle (there are
5053 no pending events) and sends a `wx.IdleEvent` to all interested
5054 parties. Returns True if more idle events are needed, False if not.
5055 """
5056 return _core_.PyApp_ProcessIdle(*args, **kwargs)
5057
5058 def SendIdleEvents(*args, **kwargs):
5059 """
5060 SendIdleEvents(self, Window win, IdleEvent event) -> bool
5061
5062 Send idle event to window and all subwindows. Returns True if more
5063 idle time is requested.
5064 """
5065 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
5066
5067 def IsActive(*args, **kwargs):
5068 """
5069 IsActive(self) -> bool
5070
5071 Return True if our app has focus.
5072 """
5073 return _core_.PyApp_IsActive(*args, **kwargs)
5074
5075 def SetTopWindow(*args, **kwargs):
5076 """
5077 SetTopWindow(self, Window win)
5078
5079 Set the *main* top level window
5080 """
5081 return _core_.PyApp_SetTopWindow(*args, **kwargs)
5082
5083 def GetTopWindow(*args, **kwargs):
5084 """
5085 GetTopWindow(self) -> Window
5086
5087 Return the *main* top level window (if it hadn't been set previously
5088 with SetTopWindow(), will return just some top level window and, if
5089 there not any, will return None)
5090 """
5091 return _core_.PyApp_GetTopWindow(*args, **kwargs)
5092
5093 def SetExitOnFrameDelete(*args, **kwargs):
5094 """
5095 SetExitOnFrameDelete(self, bool flag)
5096
5097 Control the exit behaviour: by default, the program will exit the main
5098 loop (and so, usually, terminate) when the last top-level program
5099 window is deleted. Beware that if you disable this behaviour (with
5100 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5101 explicitly from somewhere.
5102 """
5103 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
5104
5105 def GetExitOnFrameDelete(*args, **kwargs):
5106 """
5107 GetExitOnFrameDelete(self) -> bool
5108
5109 Get the current exit behaviour setting.
5110 """
5111 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
5112
5113 def SetUseBestVisual(*args, **kwargs):
5114 """
5115 SetUseBestVisual(self, bool flag)
5116
5117 Set whether the app should try to use the best available visual on
5118 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
5119 """
5120 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
5121
5122 def GetUseBestVisual(*args, **kwargs):
5123 """
5124 GetUseBestVisual(self) -> bool
5125
5126 Get current UseBestVisual setting.
5127 """
5128 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
5129
5130 def SetPrintMode(*args, **kwargs):
5131 """SetPrintMode(self, int mode)"""
5132 return _core_.PyApp_SetPrintMode(*args, **kwargs)
5133
5134 def GetPrintMode(*args, **kwargs):
5135 """GetPrintMode(self) -> int"""
5136 return _core_.PyApp_GetPrintMode(*args, **kwargs)
5137
5138 def SetAssertMode(*args, **kwargs):
5139 """
5140 SetAssertMode(self, int mode)
5141
5142 Set the OnAssert behaviour for debug and hybrid builds.
5143 """
5144 return _core_.PyApp_SetAssertMode(*args, **kwargs)
5145
5146 def GetAssertMode(*args, **kwargs):
5147 """
5148 GetAssertMode(self) -> int
5149
5150 Get the current OnAssert behaviour setting.
5151 """
5152 return _core_.PyApp_GetAssertMode(*args, **kwargs)
5153
5154 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
5155 """GetMacSupportPCMenuShortcuts() -> bool"""
5156 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5157
5158 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5159 def GetMacAboutMenuItemId(*args, **kwargs):
5160 """GetMacAboutMenuItemId() -> long"""
5161 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5162
5163 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5164 def GetMacPreferencesMenuItemId(*args, **kwargs):
5165 """GetMacPreferencesMenuItemId() -> long"""
5166 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5167
5168 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5169 def GetMacExitMenuItemId(*args, **kwargs):
5170 """GetMacExitMenuItemId() -> long"""
5171 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5172
5173 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5174 def GetMacHelpMenuTitleName(*args, **kwargs):
5175 """GetMacHelpMenuTitleName() -> String"""
5176 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5177
5178 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5179 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
5180 """SetMacSupportPCMenuShortcuts(bool val)"""
5181 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5182
5183 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5184 def SetMacAboutMenuItemId(*args, **kwargs):
5185 """SetMacAboutMenuItemId(long val)"""
5186 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5187
5188 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5189 def SetMacPreferencesMenuItemId(*args, **kwargs):
5190 """SetMacPreferencesMenuItemId(long val)"""
5191 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5192
5193 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5194 def SetMacExitMenuItemId(*args, **kwargs):
5195 """SetMacExitMenuItemId(long val)"""
5196 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5197
5198 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5199 def SetMacHelpMenuTitleName(*args, **kwargs):
5200 """SetMacHelpMenuTitleName(String val)"""
5201 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5202
5203 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5204 def _BootstrapApp(*args, **kwargs):
5205 """
5206 _BootstrapApp(self)
5207
5208 For internal use only
5209 """
5210 return _core_.PyApp__BootstrapApp(*args, **kwargs)
5211
5212 def GetComCtl32Version(*args, **kwargs):
5213 """
5214 GetComCtl32Version() -> int
5215
5216 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5217 it wasn't found at all. Raises an exception on non-Windows platforms.
5218 """
5219 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5220
5221 GetComCtl32Version = staticmethod(GetComCtl32Version)
5222
5223 class PyAppPtr(PyApp):
5224 def __init__(self, this):
5225 self.this = this
5226 if not hasattr(self,"thisown"): self.thisown = 0
5227 self.__class__ = PyApp
5228 _core_.PyApp_swigregister(PyAppPtr)
5229
5230 def PyApp_IsMainLoopRunning(*args, **kwargs):
5231 """
5232 PyApp_IsMainLoopRunning() -> bool
5233
5234 Returns True if we're running the main loop, i.e. if the events can
5235 currently be dispatched.
5236 """
5237 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5238
5239 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5240 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5241 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5242
5243 def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5244 """PyApp_GetMacAboutMenuItemId() -> long"""
5245 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5246
5247 def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5248 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5249 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5250
5251 def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5252 """PyApp_GetMacExitMenuItemId() -> long"""
5253 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5254
5255 def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5256 """PyApp_GetMacHelpMenuTitleName() -> String"""
5257 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5258
5259 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5260 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5261 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5262
5263 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5264 """PyApp_SetMacAboutMenuItemId(long val)"""
5265 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5266
5267 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5268 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5269 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5270
5271 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5272 """PyApp_SetMacExitMenuItemId(long val)"""
5273 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5274
5275 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5276 """PyApp_SetMacHelpMenuTitleName(String val)"""
5277 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5278
5279 def PyApp_GetComCtl32Version(*args, **kwargs):
5280 """
5281 PyApp_GetComCtl32Version() -> int
5282
5283 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5284 it wasn't found at all. Raises an exception on non-Windows platforms.
5285 """
5286 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5287
5288 #---------------------------------------------------------------------------
5289
5290
5291 def Exit(*args, **kwargs):
5292 """
5293 Exit()
5294
5295 Force an exit of the application. Convenience for wx.GetApp().Exit()
5296 """
5297 return _core_.Exit(*args, **kwargs)
5298
5299 def Yield(*args, **kwargs):
5300 """
5301 Yield() -> bool
5302
5303 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5304 """
5305 return _core_.Yield(*args, **kwargs)
5306
5307 def YieldIfNeeded(*args, **kwargs):
5308 """
5309 YieldIfNeeded() -> bool
5310
5311 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5312 """
5313 return _core_.YieldIfNeeded(*args, **kwargs)
5314
5315 def SafeYield(*args, **kwargs):
5316 """
5317 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5318
5319 This function is similar to `wx.Yield`, except that it disables the
5320 user input to all program windows before calling `wx.Yield` and
5321 re-enables it again afterwards. If ``win`` is not None, this window
5322 will remain enabled, allowing the implementation of some limited user
5323 interaction.
5324
5325 :Returns: the result of the call to `wx.Yield`.
5326 """
5327 return _core_.SafeYield(*args, **kwargs)
5328
5329 def WakeUpIdle(*args, **kwargs):
5330 """
5331 WakeUpIdle()
5332
5333 Cause the message queue to become empty again, so idle events will be
5334 sent.
5335 """
5336 return _core_.WakeUpIdle(*args, **kwargs)
5337
5338 def PostEvent(*args, **kwargs):
5339 """
5340 PostEvent(EvtHandler dest, Event event)
5341
5342 Send an event to a window or other wx.EvtHandler to be processed
5343 later.
5344 """
5345 return _core_.PostEvent(*args, **kwargs)
5346
5347 def App_CleanUp(*args, **kwargs):
5348 """
5349 App_CleanUp()
5350
5351 For internal use only, it is used to cleanup after wxWidgets when
5352 Python shuts down.
5353 """
5354 return _core_.App_CleanUp(*args, **kwargs)
5355
5356 def GetApp(*args, **kwargs):
5357 """
5358 GetApp() -> PyApp
5359
5360 Return a reference to the current wx.App object.
5361 """
5362 return _core_.GetApp(*args, **kwargs)
5363
5364 def SetDefaultPyEncoding(*args, **kwargs):
5365 """
5366 SetDefaultPyEncoding(string encoding)
5367
5368 Sets the encoding that wxPython will use when it needs to convert a
5369 Python string or unicode object to or from a wxString.
5370
5371 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5372 but please be aware that the default encoding within the same locale
5373 may be slightly different on different platforms. For example, please
5374 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5375 between the common latin/roman encodings.
5376 """
5377 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5378
5379 def GetDefaultPyEncoding(*args, **kwargs):
5380 """
5381 GetDefaultPyEncoding() -> string
5382
5383 Gets the current encoding that wxPython will use when it needs to
5384 convert a Python string or unicode object to or from a wxString.
5385 """
5386 return _core_.GetDefaultPyEncoding(*args, **kwargs)
5387 #----------------------------------------------------------------------
5388
5389 class PyOnDemandOutputWindow:
5390 """
5391 A class that can be used for redirecting Python's stdout and
5392 stderr streams. It will do nothing until something is wrriten to
5393 the stream at which point it will create a Frame with a text area
5394 and write the text there.
5395 """
5396 def __init__(self, title = "wxPython: stdout/stderr"):
5397 self.frame = None
5398 self.title = title
5399 self.pos = wx.DefaultPosition
5400 self.size = (450, 300)
5401 self.parent = None
5402
5403 def SetParent(self, parent):
5404 """Set the window to be used as the popup Frame's parent."""
5405 self.parent = parent
5406
5407
5408 def CreateOutputWindow(self, st):
5409 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5410 style=wx.DEFAULT_FRAME_STYLE)
5411 self.text = wx.TextCtrl(self.frame, -1, "",
5412 style=wx.TE_MULTILINE|wx.TE_READONLY)
5413 self.text.AppendText(st)
5414 self.frame.Show(True)
5415 EVT_CLOSE(self.frame, self.OnCloseWindow)
5416
5417
5418 def OnCloseWindow(self, event):
5419 if self.frame is not None:
5420 self.frame.Destroy()
5421 self.frame = None
5422 self.text = None
5423
5424
5425 # These methods provide the file-like output behaviour.
5426 def write(self, text):
5427 """
5428 Create the output window if needed and write the string to it.
5429 If not called in the context of the gui thread then uses
5430 CallAfter to do the work there.
5431 """
5432 if self.frame is None:
5433 if not wx.Thread_IsMain():
5434 wx.CallAfter(self.CreateOutputWindow, text)
5435 else:
5436 self.CreateOutputWindow(text)
5437 else:
5438 if not wx.Thread_IsMain():
5439 wx.CallAfter(self.text.AppendText, text)
5440 else:
5441 self.text.AppendText(text)
5442
5443
5444 def close(self):
5445 if self.frame is not None:
5446 wx.CallAfter(self.frame.Close)
5447
5448
5449 def flush(self):
5450 pass
5451
5452
5453
5454 #----------------------------------------------------------------------
5455
5456 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5457
5458 class App(wx.PyApp):
5459 """
5460 The ``wx.App`` class represents the application and is used to:
5461
5462 * bootstrap the wxPython system and initialize the underlying
5463 gui toolkit
5464 * set and get application-wide properties
5465 * implement the windowing system main message or event loop,
5466 and to dispatch events to window instances
5467 * etc.
5468
5469 Every application must have a ``wx.App`` instance, and all
5470 creation of UI objects should be delayed until after the
5471 ``wx.App`` object has been created in order to ensure that the gui
5472 platform and wxWidgets have been fully initialized.
5473
5474 Normally you would derive from this class and implement an
5475 ``OnInit`` method that creates a frame and then calls
5476 ``self.SetTopWindow(frame)``.
5477
5478 :see: `wx.PySimpleApp` for a simpler app class that can be used
5479 directly.
5480 """
5481
5482 outputWindowClass = PyOnDemandOutputWindow
5483
5484 def __init__(self, redirect=_defRedirect, filename=None,
5485 useBestVisual=False, clearSigInt=True):
5486 """
5487 Construct a ``wx.App`` object.
5488
5489 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5490 redirected? Defaults to True on Windows and Mac, False
5491 otherwise. If `filename` is None then output will be
5492 redirected to a window that pops up as needed. (You can
5493 control what kind of window is created for the output by
5494 resetting the class variable ``outputWindowClass`` to a
5495 class of your choosing.)
5496
5497 :param filename: The name of a file to redirect output to, if
5498 redirect is True.
5499
5500 :param useBestVisual: Should the app try to use the best
5501 available visual provided by the system (only relevant on
5502 systems that have more than one visual.) This parameter
5503 must be used instead of calling `SetUseBestVisual` later
5504 on because it must be set before the underlying GUI
5505 toolkit is initialized.
5506
5507 :param clearSigInt: Should SIGINT be cleared? This allows the
5508 app to terminate upon a Ctrl-C in the console like other
5509 GUI apps will.
5510
5511 :note: You should override OnInit to do applicaition
5512 initialization to ensure that the system, toolkit and
5513 wxWidgets are fully initialized.
5514 """
5515 wx.PyApp.__init__(self)
5516
5517 if wx.Platform == "__WXMAC__":
5518 try:
5519 import MacOS
5520 if not MacOS.WMAvailable():
5521 print """\
5522 This program needs access to the screen. Please run with 'pythonw',
5523 not 'python', and only when you are logged in on the main display of
5524 your Mac."""
5525 _sys.exit(1)
5526 except SystemExit:
5527 raise
5528 except:
5529 pass
5530
5531 # This has to be done before OnInit
5532 self.SetUseBestVisual(useBestVisual)
5533
5534 # Set the default handler for SIGINT. This fixes a problem
5535 # where if Ctrl-C is pressed in the console that started this
5536 # app then it will not appear to do anything, (not even send
5537 # KeyboardInterrupt???) but will later segfault on exit. By
5538 # setting the default handler then the app will exit, as
5539 # expected (depending on platform.)
5540 if clearSigInt:
5541 try:
5542 import signal
5543 signal.signal(signal.SIGINT, signal.SIG_DFL)
5544 except:
5545 pass
5546
5547 # Save and redirect the stdio to a window?
5548 self.stdioWin = None
5549 self.saveStdio = (_sys.stdout, _sys.stderr)
5550 if redirect:
5551 self.RedirectStdio(filename)
5552
5553 # Use Python's install prefix as the default
5554 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5555
5556 # This finishes the initialization of wxWindows and then calls
5557 # the OnInit that should be present in the derived class
5558 self._BootstrapApp()
5559
5560
5561 def __del__(self):
5562 try:
5563 self.RestoreStdio() # Just in case the MainLoop was overridden
5564 except:
5565 pass
5566
5567
5568 def SetTopWindow(self, frame):
5569 """Set the \"main\" top level window"""
5570 if self.stdioWin:
5571 self.stdioWin.SetParent(frame)
5572 wx.PyApp.SetTopWindow(self, frame)
5573
5574
5575 def MainLoop(self):
5576 """Execute the main GUI event loop"""
5577 wx.PyApp.MainLoop(self)
5578 self.RestoreStdio()
5579
5580
5581 def RedirectStdio(self, filename=None):
5582 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5583 if filename:
5584 _sys.stdout = _sys.stderr = open(filename, 'a')
5585 else:
5586 self.stdioWin = self.outputWindowClass()
5587 _sys.stdout = _sys.stderr = self.stdioWin
5588
5589
5590 def RestoreStdio(self):
5591 _sys.stdout, _sys.stderr = self.saveStdio
5592
5593
5594 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5595 """
5596 Set the title, position and/or size of the output window if
5597 the stdio has been redirected. This should be called before
5598 any output would cause the output window to be created.
5599 """
5600 if self.stdioWin:
5601 if title is not None:
5602 self.stdioWin.title = title
5603 if pos is not None:
5604 self.stdioWin.pos = pos
5605 if size is not None:
5606 self.stdioWin.size = size
5607
5608
5609
5610
5611 # change from wx.PyApp_XX to wx.App_XX
5612 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5613 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5614 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5615 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5616 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5617 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5618 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5619 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5620 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5621 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5622 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5623
5624 #----------------------------------------------------------------------------
5625
5626 class PySimpleApp(wx.App):
5627 """
5628 A simple application class. You can just create one of these and
5629 then then make your top level windows later, and not have to worry
5630 about OnInit. For example::
5631
5632 app = wx.PySimpleApp()
5633 frame = wx.Frame(None, title='Hello World')
5634 frame.Show()
5635 app.MainLoop()
5636
5637 :see: `wx.App`
5638 """
5639
5640 def __init__(self, redirect=False, filename=None,
5641 useBestVisual=False, clearSigInt=True):
5642 """
5643 :see: `wx.App.__init__`
5644 """
5645 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
5646
5647 def OnInit(self):
5648 return True
5649
5650
5651
5652 # Is anybody using this one?
5653 class PyWidgetTester(wx.App):
5654 def __init__(self, size = (250, 100)):
5655 self.size = size
5656 wx.App.__init__(self, 0)
5657
5658 def OnInit(self):
5659 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5660 self.SetTopWindow(self.frame)
5661 return True
5662
5663 def SetWidget(self, widgetClass, *args, **kwargs):
5664 w = widgetClass(self.frame, *args, **kwargs)
5665 self.frame.Show(True)
5666
5667 #----------------------------------------------------------------------------
5668 # DO NOT hold any other references to this object. This is how we
5669 # know when to cleanup system resources that wxWidgets is holding. When
5670 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
5671 # goes to zero and it calls the wx.App_CleanUp function.
5672
5673 class __wxPyCleanup:
5674 def __init__(self):
5675 self.cleanup = _core_.App_CleanUp
5676 def __del__(self):
5677 self.cleanup()
5678
5679 _sys.__wxPythonCleanup = __wxPyCleanup()
5680
5681 ## # another possible solution, but it gets called too early...
5682 ## import atexit
5683 ## atexit.register(_core_.wxApp_CleanUp)
5684
5685
5686 #----------------------------------------------------------------------------
5687
5688 #---------------------------------------------------------------------------
5689
5690 class EventLoop(object):
5691 """Proxy of C++ EventLoop class"""
5692 def __repr__(self):
5693 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5694 def __init__(self, *args, **kwargs):
5695 """__init__(self) -> EventLoop"""
5696 newobj = _core_.new_EventLoop(*args, **kwargs)
5697 self.this = newobj.this
5698 self.thisown = 1
5699 del newobj.thisown
5700 def __del__(self, destroy=_core_.delete_EventLoop):
5701 """__del__(self)"""
5702 try:
5703 if self.thisown: destroy(self)
5704 except: pass
5705
5706 def Run(*args, **kwargs):
5707 """Run(self) -> int"""
5708 return _core_.EventLoop_Run(*args, **kwargs)
5709
5710 def Exit(*args, **kwargs):
5711 """Exit(self, int rc=0)"""
5712 return _core_.EventLoop_Exit(*args, **kwargs)
5713
5714 def Pending(*args, **kwargs):
5715 """Pending(self) -> bool"""
5716 return _core_.EventLoop_Pending(*args, **kwargs)
5717
5718 def Dispatch(*args, **kwargs):
5719 """Dispatch(self) -> bool"""
5720 return _core_.EventLoop_Dispatch(*args, **kwargs)
5721
5722 def IsRunning(*args, **kwargs):
5723 """IsRunning(self) -> bool"""
5724 return _core_.EventLoop_IsRunning(*args, **kwargs)
5725
5726 def GetActive(*args, **kwargs):
5727 """GetActive() -> EventLoop"""
5728 return _core_.EventLoop_GetActive(*args, **kwargs)
5729
5730 GetActive = staticmethod(GetActive)
5731 def SetActive(*args, **kwargs):
5732 """SetActive(EventLoop loop)"""
5733 return _core_.EventLoop_SetActive(*args, **kwargs)
5734
5735 SetActive = staticmethod(SetActive)
5736
5737 class EventLoopPtr(EventLoop):
5738 def __init__(self, this):
5739 self.this = this
5740 if not hasattr(self,"thisown"): self.thisown = 0
5741 self.__class__ = EventLoop
5742 _core_.EventLoop_swigregister(EventLoopPtr)
5743
5744 def EventLoop_GetActive(*args, **kwargs):
5745 """EventLoop_GetActive() -> EventLoop"""
5746 return _core_.EventLoop_GetActive(*args, **kwargs)
5747
5748 def EventLoop_SetActive(*args, **kwargs):
5749 """EventLoop_SetActive(EventLoop loop)"""
5750 return _core_.EventLoop_SetActive(*args, **kwargs)
5751
5752 #---------------------------------------------------------------------------
5753
5754 class AcceleratorEntry(object):
5755 """
5756 A class used to define items in an `wx.AcceleratorTable`. wxPython
5757 programs can choose to use wx.AcceleratorEntry objects, but using a
5758 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
5759 as well. See `__init__` for of the tuple values.
5760
5761 :see: `wx.AcceleratorTable`
5762 """
5763 def __repr__(self):
5764 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5765 def __init__(self, *args, **kwargs):
5766 """
5767 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5768
5769 Construct a wx.AcceleratorEntry.
5770 """
5771 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5772 self.this = newobj.this
5773 self.thisown = 1
5774 del newobj.thisown
5775 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5776 """__del__(self)"""
5777 try:
5778 if self.thisown: destroy(self)
5779 except: pass
5780
5781 def Set(*args, **kwargs):
5782 """
5783 Set(self, int flags, int keyCode, int cmd)
5784
5785 (Re)set the attributes of a wx.AcceleratorEntry.
5786 :see `__init__`
5787 """
5788 return _core_.AcceleratorEntry_Set(*args, **kwargs)
5789
5790 def GetFlags(*args, **kwargs):
5791 """
5792 GetFlags(self) -> int
5793
5794 Get the AcceleratorEntry's flags.
5795 """
5796 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5797
5798 def GetKeyCode(*args, **kwargs):
5799 """
5800 GetKeyCode(self) -> int
5801
5802 Get the AcceleratorEntry's keycode.
5803 """
5804 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5805
5806 def GetCommand(*args, **kwargs):
5807 """
5808 GetCommand(self) -> int
5809
5810 Get the AcceleratorEntry's command ID.
5811 """
5812 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5813
5814
5815 class AcceleratorEntryPtr(AcceleratorEntry):
5816 def __init__(self, this):
5817 self.this = this
5818 if not hasattr(self,"thisown"): self.thisown = 0
5819 self.__class__ = AcceleratorEntry
5820 _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5821
5822 class AcceleratorTable(Object):
5823 """
5824 An accelerator table allows the application to specify a table of
5825 keyboard shortcuts for menus or other commands. On Windows, menu or
5826 button commands are supported; on GTK, only menu commands are
5827 supported.
5828 """
5829 def __repr__(self):
5830 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5831 def __init__(self, *args, **kwargs):
5832 """
5833 __init__(entries) -> AcceleratorTable
5834
5835 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5836 items or or of 3-tuples (flags, keyCode, cmdID)
5837
5838 :see: `wx.AcceleratorEntry`
5839 """
5840 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5841 self.this = newobj.this
5842 self.thisown = 1
5843 del newobj.thisown
5844 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5845 """__del__(self)"""
5846 try:
5847 if self.thisown: destroy(self)
5848 except: pass
5849
5850 def Ok(*args, **kwargs):
5851 """Ok(self) -> bool"""
5852 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5853
5854
5855 class AcceleratorTablePtr(AcceleratorTable):
5856 def __init__(self, this):
5857 self.this = this
5858 if not hasattr(self,"thisown"): self.thisown = 0
5859 self.__class__ = AcceleratorTable
5860 _core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5861
5862
5863 def GetAccelFromString(*args, **kwargs):
5864 """GetAccelFromString(String label) -> AcceleratorEntry"""
5865 return _core_.GetAccelFromString(*args, **kwargs)
5866 #---------------------------------------------------------------------------
5867
5868 class VisualAttributes(object):
5869 """struct containing all the visual attributes of a control"""
5870 def __repr__(self):
5871 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5872 def __init__(self, *args, **kwargs):
5873 """
5874 __init__(self) -> VisualAttributes
5875
5876 struct containing all the visual attributes of a control
5877 """
5878 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5879 self.this = newobj.this
5880 self.thisown = 1
5881 del newobj.thisown
5882 def __del__(self, destroy=_core_.delete_VisualAttributes):
5883 """__del__(self)"""
5884 try:
5885 if self.thisown: destroy(self)
5886 except: pass
5887
5888 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5889 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5890 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5891
5892 class VisualAttributesPtr(VisualAttributes):
5893 def __init__(self, this):
5894 self.this = this
5895 if not hasattr(self,"thisown"): self.thisown = 0
5896 self.__class__ = VisualAttributes
5897 _core_.VisualAttributes_swigregister(VisualAttributesPtr)
5898 NullAcceleratorTable = cvar.NullAcceleratorTable
5899 PanelNameStr = cvar.PanelNameStr
5900
5901 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5902 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5903 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5904 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5905 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5906 class Window(EvtHandler):
5907 """
5908 wx.Window is the base class for all windows and represents any visible
5909 object on the screen. All controls, top level windows and so on are
5910 wx.Windows. Sizers and device contexts are not however, as they don't
5911 appear on screen themselves.
5912
5913 """
5914 def __repr__(self):
5915 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5916 def __init__(self, *args, **kwargs):
5917 """
5918 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5919 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5920
5921 Construct and show a generic Window.
5922 """
5923 newobj = _core_.new_Window(*args, **kwargs)
5924 self.this = newobj.this
5925 self.thisown = 1
5926 del newobj.thisown
5927 self._setOORInfo(self)
5928
5929 def Create(*args, **kwargs):
5930 """
5931 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5932 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5933
5934 Create the GUI part of the Window for 2-phase creation mode.
5935 """
5936 return _core_.Window_Create(*args, **kwargs)
5937
5938 def Close(*args, **kwargs):
5939 """
5940 Close(self, bool force=False) -> bool
5941
5942 This function simply generates a EVT_CLOSE event whose handler usually
5943 tries to close the window. It doesn't close the window itself,
5944 however. If force is False (the default) then the window's close
5945 handler will be allowed to veto the destruction of the window.
5946 """
5947 return _core_.Window_Close(*args, **kwargs)
5948
5949 def Destroy(*args, **kwargs):
5950 """
5951 Destroy(self) -> bool
5952
5953 Destroys the window safely. Frames and dialogs are not destroyed
5954 immediately when this function is called -- they are added to a list
5955 of windows to be deleted on idle time, when all the window's events
5956 have been processed. This prevents problems with events being sent to
5957 non-existent windows.
5958
5959 Returns True if the window has either been successfully deleted, or it
5960 has been added to the list of windows pending real deletion.
5961 """
5962 return _core_.Window_Destroy(*args, **kwargs)
5963
5964 def DestroyChildren(*args, **kwargs):
5965 """
5966 DestroyChildren(self) -> bool
5967
5968 Destroys all children of a window. Called automatically by the
5969 destructor.
5970 """
5971 return _core_.Window_DestroyChildren(*args, **kwargs)
5972
5973 def IsBeingDeleted(*args, **kwargs):
5974 """
5975 IsBeingDeleted(self) -> bool
5976
5977 Is the window in the process of being deleted?
5978 """
5979 return _core_.Window_IsBeingDeleted(*args, **kwargs)
5980
5981 def SetTitle(*args, **kwargs):
5982 """
5983 SetTitle(self, String title)
5984
5985 Sets the window's title. Applicable only to frames and dialogs.
5986 """
5987 return _core_.Window_SetTitle(*args, **kwargs)
5988
5989 def GetTitle(*args, **kwargs):
5990 """
5991 GetTitle(self) -> String
5992
5993 Gets the window's title. Applicable only to frames and dialogs.
5994 """
5995 return _core_.Window_GetTitle(*args, **kwargs)
5996
5997 def SetLabel(*args, **kwargs):
5998 """
5999 SetLabel(self, String label)
6000
6001 Set the text which the window shows in its label if applicable.
6002 """
6003 return _core_.Window_SetLabel(*args, **kwargs)
6004
6005 def GetLabel(*args, **kwargs):
6006 """
6007 GetLabel(self) -> String
6008
6009 Generic way of getting a label from any window, for identification
6010 purposes. The interpretation of this function differs from class to
6011 class. For frames and dialogs, the value returned is the title. For
6012 buttons or static text controls, it is the button text. This function
6013 can be useful for meta-programs such as testing tools or special-needs
6014 access programs)which need to identify windows by name.
6015 """
6016 return _core_.Window_GetLabel(*args, **kwargs)
6017
6018 def SetName(*args, **kwargs):
6019 """
6020 SetName(self, String name)
6021
6022 Sets the window's name. The window name is used for ressource setting
6023 in X, it is not the same as the window title/label
6024 """
6025 return _core_.Window_SetName(*args, **kwargs)
6026
6027 def GetName(*args, **kwargs):
6028 """
6029 GetName(self) -> String
6030
6031 Returns the windows name. This name is not guaranteed to be unique;
6032 it is up to the programmer to supply an appropriate name in the window
6033 constructor or via wx.Window.SetName.
6034 """
6035 return _core_.Window_GetName(*args, **kwargs)
6036
6037 def SetWindowVariant(*args, **kwargs):
6038 """
6039 SetWindowVariant(self, int variant)
6040
6041 Sets the variant of the window/font size to use for this window, if
6042 the platform supports variants, for example, wxMac.
6043 """
6044 return _core_.Window_SetWindowVariant(*args, **kwargs)
6045
6046 def GetWindowVariant(*args, **kwargs):
6047 """GetWindowVariant(self) -> int"""
6048 return _core_.Window_GetWindowVariant(*args, **kwargs)
6049
6050 def SetId(*args, **kwargs):
6051 """
6052 SetId(self, int winid)
6053
6054 Sets the identifier of the window. Each window has an integer
6055 identifier. If the application has not provided one, an identifier
6056 will be generated. Normally, the identifier should be provided on
6057 creation and should not be modified subsequently.
6058 """
6059 return _core_.Window_SetId(*args, **kwargs)
6060
6061 def GetId(*args, **kwargs):
6062 """
6063 GetId(self) -> int
6064
6065 Returns the identifier of the window. Each window has an integer
6066 identifier. If the application has not provided one (or the default Id
6067 -1 is used) then an unique identifier with a negative value will be
6068 generated.
6069 """
6070 return _core_.Window_GetId(*args, **kwargs)
6071
6072 def NewControlId(*args, **kwargs):
6073 """
6074 NewControlId() -> int
6075
6076 Generate a control id for the controls which were not given one.
6077 """
6078 return _core_.Window_NewControlId(*args, **kwargs)
6079
6080 NewControlId = staticmethod(NewControlId)
6081 def NextControlId(*args, **kwargs):
6082 """
6083 NextControlId(int winid) -> int
6084
6085 Get the id of the control following the one with the given
6086 autogenerated) id
6087 """
6088 return _core_.Window_NextControlId(*args, **kwargs)
6089
6090 NextControlId = staticmethod(NextControlId)
6091 def PrevControlId(*args, **kwargs):
6092 """
6093 PrevControlId(int winid) -> int
6094
6095 Get the id of the control preceding the one with the given
6096 autogenerated) id
6097 """
6098 return _core_.Window_PrevControlId(*args, **kwargs)
6099
6100 PrevControlId = staticmethod(PrevControlId)
6101 def SetSize(*args, **kwargs):
6102 """
6103 SetSize(self, Size size)
6104
6105 Sets the size of the window in pixels.
6106 """
6107 return _core_.Window_SetSize(*args, **kwargs)
6108
6109 def SetDimensions(*args, **kwargs):
6110 """
6111 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
6112
6113 Sets the position and size of the window in pixels. The sizeFlags
6114 parameter indicates the interpretation of the other params if they are
6115 equal to -1.
6116
6117 ======================== ======================================
6118 wx.SIZE_AUTO A -1 indicates that a class-specific
6119 default should be used.
6120 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6121 -1 values are supplied.
6122 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6123 interpreted as real dimensions, not
6124 default values.
6125 ======================== ======================================
6126
6127 """
6128 return _core_.Window_SetDimensions(*args, **kwargs)
6129
6130 def SetRect(*args, **kwargs):
6131 """
6132 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
6133
6134 Sets the position and size of the window in pixels using a wx.Rect.
6135 """
6136 return _core_.Window_SetRect(*args, **kwargs)
6137
6138 def SetSizeWH(*args, **kwargs):
6139 """
6140 SetSizeWH(self, int width, int height)
6141
6142 Sets the size of the window in pixels.
6143 """
6144 return _core_.Window_SetSizeWH(*args, **kwargs)
6145
6146 def Move(*args, **kwargs):
6147 """
6148 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
6149
6150 Moves the window to the given position.
6151 """
6152 return _core_.Window_Move(*args, **kwargs)
6153
6154 SetPosition = Move
6155 def MoveXY(*args, **kwargs):
6156 """
6157 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
6158
6159 Moves the window to the given position.
6160 """
6161 return _core_.Window_MoveXY(*args, **kwargs)
6162
6163 def SetBestFittingSize(*args, **kwargs):
6164 """
6165 SetBestFittingSize(self, Size size=DefaultSize)
6166
6167 A 'Smart' SetSize that will fill in default size components with the
6168 window's *best size* values. Also set's the minsize for use with sizers.
6169 """
6170 return _core_.Window_SetBestFittingSize(*args, **kwargs)
6171
6172 def Raise(*args, **kwargs):
6173 """
6174 Raise(self)
6175
6176 Raises the window to the top of the window hierarchy if it is a
6177 managed window (dialog or frame).
6178 """
6179 return _core_.Window_Raise(*args, **kwargs)
6180
6181 def Lower(*args, **kwargs):
6182 """
6183 Lower(self)
6184
6185 Lowers the window to the bottom of the window hierarchy if it is a
6186 managed window (dialog or frame).
6187 """
6188 return _core_.Window_Lower(*args, **kwargs)
6189
6190 def SetClientSize(*args, **kwargs):
6191 """
6192 SetClientSize(self, Size size)
6193
6194 This sets the size of the window client area in pixels. Using this
6195 function to size a window tends to be more device-independent than
6196 wx.Window.SetSize, since the application need not worry about what
6197 dimensions the border or title bar have when trying to fit the window
6198 around panel items, for example.
6199 """
6200 return _core_.Window_SetClientSize(*args, **kwargs)
6201
6202 def SetClientSizeWH(*args, **kwargs):
6203 """
6204 SetClientSizeWH(self, int width, int height)
6205
6206 This sets the size of the window client area in pixels. Using this
6207 function to size a window tends to be more device-independent than
6208 wx.Window.SetSize, since the application need not worry about what
6209 dimensions the border or title bar have when trying to fit the window
6210 around panel items, for example.
6211 """
6212 return _core_.Window_SetClientSizeWH(*args, **kwargs)
6213
6214 def SetClientRect(*args, **kwargs):
6215 """
6216 SetClientRect(self, Rect rect)
6217
6218 This sets the size of the window client area in pixels. Using this
6219 function to size a window tends to be more device-independent than
6220 wx.Window.SetSize, since the application need not worry about what
6221 dimensions the border or title bar have when trying to fit the window
6222 around panel items, for example.
6223 """
6224 return _core_.Window_SetClientRect(*args, **kwargs)
6225
6226 def GetPosition(*args, **kwargs):
6227 """
6228 GetPosition(self) -> Point
6229
6230 Get the window's position.
6231 """
6232 return _core_.Window_GetPosition(*args, **kwargs)
6233
6234 def GetPositionTuple(*args, **kwargs):
6235 """
6236 GetPositionTuple() -> (x,y)
6237
6238 Get the window's position.
6239 """
6240 return _core_.Window_GetPositionTuple(*args, **kwargs)
6241
6242 def GetSize(*args, **kwargs):
6243 """
6244 GetSize(self) -> Size
6245
6246 Get the window size.
6247 """
6248 return _core_.Window_GetSize(*args, **kwargs)
6249
6250 def GetSizeTuple(*args, **kwargs):
6251 """
6252 GetSizeTuple() -> (width, height)
6253
6254 Get the window size.
6255 """
6256 return _core_.Window_GetSizeTuple(*args, **kwargs)
6257
6258 def GetRect(*args, **kwargs):
6259 """
6260 GetRect(self) -> Rect
6261
6262 Returns the size and position of the window as a wx.Rect object.
6263 """
6264 return _core_.Window_GetRect(*args, **kwargs)
6265
6266 def GetClientSize(*args, **kwargs):
6267 """
6268 GetClientSize(self) -> Size
6269
6270 This gets the size of the window's 'client area' in pixels. The client
6271 area is the area which may be drawn on by the programmer, excluding
6272 title bar, border, scrollbars, etc.
6273 """
6274 return _core_.Window_GetClientSize(*args, **kwargs)
6275
6276 def GetClientSizeTuple(*args, **kwargs):
6277 """
6278 GetClientSizeTuple() -> (width, height)
6279
6280 This gets the size of the window's 'client area' in pixels. The client
6281 area is the area which may be drawn on by the programmer, excluding
6282 title bar, border, scrollbars, etc.
6283 """
6284 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6285
6286 def GetClientAreaOrigin(*args, **kwargs):
6287 """
6288 GetClientAreaOrigin(self) -> Point
6289
6290 Get the origin of the client area of the window relative to the
6291 window's top left corner (the client area may be shifted because of
6292 the borders, scrollbars, other decorations...)
6293 """
6294 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6295
6296 def GetClientRect(*args, **kwargs):
6297 """
6298 GetClientRect(self) -> Rect
6299
6300 Get the client area position and size as a `wx.Rect` object.
6301 """
6302 return _core_.Window_GetClientRect(*args, **kwargs)
6303
6304 def GetBestSize(*args, **kwargs):
6305 """
6306 GetBestSize(self) -> Size
6307
6308 This function returns the best acceptable minimal size for the
6309 window, if applicable. For example, for a static text control, it will
6310 be the minimal size such that the control label is not truncated. For
6311 windows containing subwindows (suzh aswx.Panel), the size returned by
6312 this function will be the same as the size the window would have had
6313 after calling Fit.
6314 """
6315 return _core_.Window_GetBestSize(*args, **kwargs)
6316
6317 def GetBestSizeTuple(*args, **kwargs):
6318 """
6319 GetBestSizeTuple() -> (width, height)
6320
6321 This function returns the best acceptable minimal size for the
6322 window, if applicable. For example, for a static text control, it will
6323 be the minimal size such that the control label is not truncated. For
6324 windows containing subwindows (suzh aswx.Panel), the size returned by
6325 this function will be the same as the size the window would have had
6326 after calling Fit.
6327 """
6328 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6329
6330 def InvalidateBestSize(*args, **kwargs):
6331 """
6332 InvalidateBestSize(self)
6333
6334 Reset the cached best size value so it will be recalculated the next
6335 time it is needed.
6336 """
6337 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6338
6339 def GetBestFittingSize(*args, **kwargs):
6340 """
6341 GetBestFittingSize(self) -> Size
6342
6343 This function will merge the window's best size into the window's
6344 minimum size, giving priority to the min size components, and returns
6345 the results.
6346
6347 """
6348 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6349
6350 def GetAdjustedBestSize(*args, **kwargs):
6351 """
6352 GetAdjustedBestSize(self) -> Size
6353
6354 This method is similar to GetBestSize, except in one
6355 thing. GetBestSize should return the minimum untruncated size of the
6356 window, while this method will return the largest of BestSize and any
6357 user specified minimum size. ie. it is the minimum size the window
6358 should currently be drawn at, not the minimal size it can possibly
6359 tolerate.
6360 """
6361 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6362
6363 def Center(*args, **kwargs):
6364 """
6365 Center(self, int direction=BOTH)
6366
6367 Centers the window. The parameter specifies the direction for
6368 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6369 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6370 on the entire screen and not on its parent window. If it is a
6371 top-level window and has no parent then it will always be centered
6372 relative to the screen.
6373 """
6374 return _core_.Window_Center(*args, **kwargs)
6375
6376 Centre = Center
6377 def CenterOnScreen(*args, **kwargs):
6378 """
6379 CenterOnScreen(self, int dir=BOTH)
6380
6381 Center on screen (only works for top level windows)
6382 """
6383 return _core_.Window_CenterOnScreen(*args, **kwargs)
6384
6385 CentreOnScreen = CenterOnScreen
6386 def CenterOnParent(*args, **kwargs):
6387 """
6388 CenterOnParent(self, int dir=BOTH)
6389
6390 Center with respect to the the parent window
6391 """
6392 return _core_.Window_CenterOnParent(*args, **kwargs)
6393
6394 CentreOnParent = CenterOnParent
6395 def Fit(*args, **kwargs):
6396 """
6397 Fit(self)
6398
6399 Sizes the window so that it fits around its subwindows. This function
6400 won't do anything if there are no subwindows and will only really work
6401 correctly if sizers are used for the subwindows layout. Also, if the
6402 window has exactly one subwindow it is better (faster and the result
6403 is more precise as Fit adds some margin to account for fuzziness of
6404 its calculations) to call window.SetClientSize(child.GetSize())
6405 instead of calling Fit.
6406 """
6407 return _core_.Window_Fit(*args, **kwargs)
6408
6409 def FitInside(*args, **kwargs):
6410 """
6411 FitInside(self)
6412
6413 Similar to Fit, but sizes the interior (virtual) size of a
6414 window. Mainly useful with scrolled windows to reset scrollbars after
6415 sizing changes that do not trigger a size event, and/or scrolled
6416 windows without an interior sizer. This function similarly won't do
6417 anything if there are no subwindows.
6418 """
6419 return _core_.Window_FitInside(*args, **kwargs)
6420
6421 def SetSizeHints(*args, **kwargs):
6422 """
6423 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6424 int incH=-1)
6425
6426 Allows specification of minimum and maximum window sizes, and window
6427 size increments. If a pair of values is not set (or set to -1), the
6428 default values will be used. If this function is called, the user
6429 will not be able to size the window outside the given bounds (if it is
6430 a top-level window.) Sizers will also inspect the minimum window size
6431 and will use that value if set when calculating layout.
6432
6433 The resizing increments are only significant under Motif or Xt.
6434 """
6435 return _core_.Window_SetSizeHints(*args, **kwargs)
6436
6437 def SetSizeHintsSz(*args, **kwargs):
6438 """
6439 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6440
6441 Allows specification of minimum and maximum window sizes, and window
6442 size increments. If a pair of values is not set (or set to -1), the
6443 default values will be used. If this function is called, the user
6444 will not be able to size the window outside the given bounds (if it is
6445 a top-level window.) Sizers will also inspect the minimum window size
6446 and will use that value if set when calculating layout.
6447
6448 The resizing increments are only significant under Motif or Xt.
6449 """
6450 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6451
6452 def SetVirtualSizeHints(*args, **kwargs):
6453 """
6454 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
6455
6456 Allows specification of minimum and maximum virtual window sizes. If a
6457 pair of values is not set (or set to -1), the default values will be
6458 used. If this function is called, the user will not be able to size
6459 the virtual area of the window outside the given bounds.
6460 """
6461 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6462
6463 def SetVirtualSizeHintsSz(*args, **kwargs):
6464 """
6465 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6466
6467 Allows specification of minimum and maximum virtual window sizes. If a
6468 pair of values is not set (or set to -1), the default values will be
6469 used. If this function is called, the user will not be able to size
6470 the virtual area of the window outside the given bounds.
6471 """
6472 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
6473
6474 def GetMaxSize(*args, **kwargs):
6475 """GetMaxSize(self) -> Size"""
6476 return _core_.Window_GetMaxSize(*args, **kwargs)
6477
6478 def GetMinSize(*args, **kwargs):
6479 """GetMinSize(self) -> Size"""
6480 return _core_.Window_GetMinSize(*args, **kwargs)
6481
6482 def SetMinSize(*args, **kwargs):
6483 """
6484 SetMinSize(self, Size minSize)
6485
6486 A more convenient method than `SetSizeHints` for setting just the
6487 min size.
6488 """
6489 return _core_.Window_SetMinSize(*args, **kwargs)
6490
6491 def SetMaxSize(*args, **kwargs):
6492 """
6493 SetMaxSize(self, Size maxSize)
6494
6495 A more convenient method than `SetSizeHints` for setting just the
6496 max size.
6497 """
6498 return _core_.Window_SetMaxSize(*args, **kwargs)
6499
6500 def GetMinWidth(*args, **kwargs):
6501 """GetMinWidth(self) -> int"""
6502 return _core_.Window_GetMinWidth(*args, **kwargs)
6503
6504 def GetMinHeight(*args, **kwargs):
6505 """GetMinHeight(self) -> int"""
6506 return _core_.Window_GetMinHeight(*args, **kwargs)
6507
6508 def GetMaxWidth(*args, **kwargs):
6509 """GetMaxWidth(self) -> int"""
6510 return _core_.Window_GetMaxWidth(*args, **kwargs)
6511
6512 def GetMaxHeight(*args, **kwargs):
6513 """GetMaxHeight(self) -> int"""
6514 return _core_.Window_GetMaxHeight(*args, **kwargs)
6515
6516 def SetVirtualSize(*args, **kwargs):
6517 """
6518 SetVirtualSize(self, Size size)
6519
6520 Set the the virtual size of a window in pixels. For most windows this
6521 is just the client area of the window, but for some like scrolled
6522 windows it is more or less independent of the screen window size.
6523 """
6524 return _core_.Window_SetVirtualSize(*args, **kwargs)
6525
6526 def SetVirtualSizeWH(*args, **kwargs):
6527 """
6528 SetVirtualSizeWH(self, int w, int h)
6529
6530 Set the the virtual size of a window in pixels. For most windows this
6531 is just the client area of the window, but for some like scrolled
6532 windows it is more or less independent of the screen window size.
6533 """
6534 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6535
6536 def GetVirtualSize(*args, **kwargs):
6537 """
6538 GetVirtualSize(self) -> Size
6539
6540 Get the the virtual size of the window in pixels. For most windows
6541 this is just the client area of the window, but for some like scrolled
6542 windows it is more or less independent of the screen window size.
6543 """
6544 return _core_.Window_GetVirtualSize(*args, **kwargs)
6545
6546 def GetVirtualSizeTuple(*args, **kwargs):
6547 """
6548 GetVirtualSizeTuple() -> (width, height)
6549
6550 Get the the virtual size of the window in pixels. For most windows
6551 this is just the client area of the window, but for some like scrolled
6552 windows it is more or less independent of the screen window size.
6553 """
6554 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6555
6556 def GetBestVirtualSize(*args, **kwargs):
6557 """
6558 GetBestVirtualSize(self) -> Size
6559
6560 Return the largest of ClientSize and BestSize (as determined by a
6561 sizer, interior children, or other means)
6562 """
6563 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6564
6565 def Show(*args, **kwargs):
6566 """
6567 Show(self, bool show=True) -> bool
6568
6569 Shows or hides the window. You may need to call Raise for a top level
6570 window if you want to bring it to top, although this is not needed if
6571 Show is called immediately after the frame creation. Returns True if
6572 the window has been shown or hidden or False if nothing was done
6573 because it already was in the requested state.
6574 """
6575 return _core_.Window_Show(*args, **kwargs)
6576
6577 def Hide(*args, **kwargs):
6578 """
6579 Hide(self) -> bool
6580
6581 Equivalent to calling Show(False).
6582 """
6583 return _core_.Window_Hide(*args, **kwargs)
6584
6585 def Enable(*args, **kwargs):
6586 """
6587 Enable(self, bool enable=True) -> bool
6588
6589 Enable or disable the window for user input. Note that when a parent
6590 window is disabled, all of its children are disabled as well and they
6591 are reenabled again when the parent is. Returns true if the window
6592 has been enabled or disabled, false if nothing was done, i.e. if the
6593 window had already been in the specified state.
6594 """
6595 return _core_.Window_Enable(*args, **kwargs)
6596
6597 def Disable(*args, **kwargs):
6598 """
6599 Disable(self) -> bool
6600
6601 Disables the window, same as Enable(false).
6602 """
6603 return _core_.Window_Disable(*args, **kwargs)
6604
6605 def IsShown(*args, **kwargs):
6606 """
6607 IsShown(self) -> bool
6608
6609 Returns true if the window is shown, false if it has been hidden.
6610 """
6611 return _core_.Window_IsShown(*args, **kwargs)
6612
6613 def IsEnabled(*args, **kwargs):
6614 """
6615 IsEnabled(self) -> bool
6616
6617 Returns true if the window is enabled for input, false otherwise.
6618 """
6619 return _core_.Window_IsEnabled(*args, **kwargs)
6620
6621 def SetWindowStyleFlag(*args, **kwargs):
6622 """
6623 SetWindowStyleFlag(self, long style)
6624
6625 Sets the style of the window. Please note that some styles cannot be
6626 changed after the window creation and that Refresh() might need to be
6627 called after changing the others for the change to take place
6628 immediately.
6629 """
6630 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6631
6632 def GetWindowStyleFlag(*args, **kwargs):
6633 """
6634 GetWindowStyleFlag(self) -> long
6635
6636 Gets the window style that was passed to the constructor or Create
6637 method.
6638 """
6639 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6640
6641 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6642 def HasFlag(*args, **kwargs):
6643 """
6644 HasFlag(self, int flag) -> bool
6645
6646 Test if the given style is set for this window.
6647 """
6648 return _core_.Window_HasFlag(*args, **kwargs)
6649
6650 def IsRetained(*args, **kwargs):
6651 """
6652 IsRetained(self) -> bool
6653
6654 Returns true if the window is retained, false otherwise. Retained
6655 windows are only available on X platforms.
6656 """
6657 return _core_.Window_IsRetained(*args, **kwargs)
6658
6659 def SetExtraStyle(*args, **kwargs):
6660 """
6661 SetExtraStyle(self, long exStyle)
6662
6663 Sets the extra style bits for the window. Extra styles are the less
6664 often used style bits which can't be set with the constructor or with
6665 SetWindowStyleFlag()
6666 """
6667 return _core_.Window_SetExtraStyle(*args, **kwargs)
6668
6669 def GetExtraStyle(*args, **kwargs):
6670 """
6671 GetExtraStyle(self) -> long
6672
6673 Returns the extra style bits for the window.
6674 """
6675 return _core_.Window_GetExtraStyle(*args, **kwargs)
6676
6677 def MakeModal(*args, **kwargs):
6678 """
6679 MakeModal(self, bool modal=True)
6680
6681 Disables all other windows in the application so that the user can
6682 only interact with this window. Passing False will reverse this
6683 effect.
6684 """
6685 return _core_.Window_MakeModal(*args, **kwargs)
6686
6687 def SetThemeEnabled(*args, **kwargs):
6688 """
6689 SetThemeEnabled(self, bool enableTheme)
6690
6691 This function tells a window if it should use the system's "theme"
6692 code to draw the windows' background instead if its own background
6693 drawing code. This will only have an effect on platforms that support
6694 the notion of themes in user defined windows. One such platform is
6695 GTK+ where windows can have (very colourful) backgrounds defined by a
6696 user's selected theme.
6697
6698 Dialogs, notebook pages and the status bar have this flag set to true
6699 by default so that the default look and feel is simulated best.
6700 """
6701 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6702
6703 def GetThemeEnabled(*args, **kwargs):
6704 """
6705 GetThemeEnabled(self) -> bool
6706
6707 Return the themeEnabled flag.
6708 """
6709 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6710
6711 def SetFocus(*args, **kwargs):
6712 """
6713 SetFocus(self)
6714
6715 Set's the focus to this window, allowing it to receive keyboard input.
6716 """
6717 return _core_.Window_SetFocus(*args, **kwargs)
6718
6719 def SetFocusFromKbd(*args, **kwargs):
6720 """
6721 SetFocusFromKbd(self)
6722
6723 Set focus to this window as the result of a keyboard action. Normally
6724 only called internally.
6725 """
6726 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6727
6728 def FindFocus(*args, **kwargs):
6729 """
6730 FindFocus() -> Window
6731
6732 Returns the window or control that currently has the keyboard focus,
6733 or None.
6734 """
6735 return _core_.Window_FindFocus(*args, **kwargs)
6736
6737 FindFocus = staticmethod(FindFocus)
6738 def AcceptsFocus(*args, **kwargs):
6739 """
6740 AcceptsFocus(self) -> bool
6741
6742 Can this window have focus?
6743 """
6744 return _core_.Window_AcceptsFocus(*args, **kwargs)
6745
6746 def AcceptsFocusFromKeyboard(*args, **kwargs):
6747 """
6748 AcceptsFocusFromKeyboard(self) -> bool
6749
6750 Can this window be given focus by keyboard navigation? if not, the
6751 only way to give it focus (provided it accepts it at all) is to click
6752 it.
6753 """
6754 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6755
6756 def GetDefaultItem(*args, **kwargs):
6757 """
6758 GetDefaultItem(self) -> Window
6759
6760 Get the default child of this parent, i.e. the one which is activated
6761 by pressing <Enter> such as the OK button on a wx.Dialog.
6762 """
6763 return _core_.Window_GetDefaultItem(*args, **kwargs)
6764
6765 def SetDefaultItem(*args, **kwargs):
6766 """
6767 SetDefaultItem(self, Window child) -> Window
6768
6769 Set this child as default, return the old default.
6770 """
6771 return _core_.Window_SetDefaultItem(*args, **kwargs)
6772
6773 def SetTmpDefaultItem(*args, **kwargs):
6774 """
6775 SetTmpDefaultItem(self, Window win)
6776
6777 Set this child as temporary default
6778 """
6779 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6780
6781 def Navigate(*args, **kwargs):
6782 """
6783 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6784
6785 Does keyboard navigation from this window to another, by sending a
6786 `wx.NavigationKeyEvent`.
6787 """
6788 return _core_.Window_Navigate(*args, **kwargs)
6789
6790 def MoveAfterInTabOrder(*args, **kwargs):
6791 """
6792 MoveAfterInTabOrder(self, Window win)
6793
6794 Moves this window in the tab navigation order after the specified
6795 sibling window. This means that when the user presses the TAB key on
6796 that other window, the focus switches to this window.
6797
6798 The default tab order is the same as creation order. This function
6799 and `MoveBeforeInTabOrder` allow to change it after creating all the
6800 windows.
6801
6802 """
6803 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6804
6805 def MoveBeforeInTabOrder(*args, **kwargs):
6806 """
6807 MoveBeforeInTabOrder(self, Window win)
6808
6809 Same as `MoveAfterInTabOrder` except that it inserts this window just
6810 before win instead of putting it right after it.
6811 """
6812 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6813
6814 def GetChildren(*args, **kwargs):
6815 """
6816 GetChildren(self) -> PyObject
6817
6818 Returns a list of the window's children. NOTE: Currently this is a
6819 copy of the child window list maintained by the window, so the return
6820 value of this function is only valid as long as the window's children
6821 do not change.
6822 """
6823 return _core_.Window_GetChildren(*args, **kwargs)
6824
6825 def GetParent(*args, **kwargs):
6826 """
6827 GetParent(self) -> Window
6828
6829 Returns the parent window of this window, or None if there isn't one.
6830 """
6831 return _core_.Window_GetParent(*args, **kwargs)
6832
6833 def GetGrandParent(*args, **kwargs):
6834 """
6835 GetGrandParent(self) -> Window
6836
6837 Returns the parent of the parent of this window, or None if there
6838 isn't one.
6839 """
6840 return _core_.Window_GetGrandParent(*args, **kwargs)
6841
6842 def IsTopLevel(*args, **kwargs):
6843 """
6844 IsTopLevel(self) -> bool
6845
6846 Returns true if the given window is a top-level one. Currently all
6847 frames and dialogs are always considered to be top-level windows (even
6848 if they have a parent window).
6849 """
6850 return _core_.Window_IsTopLevel(*args, **kwargs)
6851
6852 def Reparent(*args, **kwargs):
6853 """
6854 Reparent(self, Window newParent) -> bool
6855
6856 Reparents the window, i.e the window will be removed from its current
6857 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6858 re-inserted into another. Available on Windows and GTK. Returns True
6859 if the parent was changed, False otherwise (error or newParent ==
6860 oldParent)
6861 """
6862 return _core_.Window_Reparent(*args, **kwargs)
6863
6864 def AddChild(*args, **kwargs):
6865 """
6866 AddChild(self, Window child)
6867
6868 Adds a child window. This is called automatically by window creation
6869 functions so should not be required by the application programmer.
6870 """
6871 return _core_.Window_AddChild(*args, **kwargs)
6872
6873 def RemoveChild(*args, **kwargs):
6874 """
6875 RemoveChild(self, Window child)
6876
6877 Removes a child window. This is called automatically by window
6878 deletion functions so should not be required by the application
6879 programmer.
6880 """
6881 return _core_.Window_RemoveChild(*args, **kwargs)
6882
6883 def FindWindowById(*args, **kwargs):
6884 """
6885 FindWindowById(self, long winid) -> Window
6886
6887 Find a chld of this window by window ID
6888 """
6889 return _core_.Window_FindWindowById(*args, **kwargs)
6890
6891 def FindWindowByName(*args, **kwargs):
6892 """
6893 FindWindowByName(self, String name) -> Window
6894
6895 Find a child of this window by name
6896 """
6897 return _core_.Window_FindWindowByName(*args, **kwargs)
6898
6899 def GetEventHandler(*args, **kwargs):
6900 """
6901 GetEventHandler(self) -> EvtHandler
6902
6903 Returns the event handler for this window. By default, the window is
6904 its own event handler.
6905 """
6906 return _core_.Window_GetEventHandler(*args, **kwargs)
6907
6908 def SetEventHandler(*args, **kwargs):
6909 """
6910 SetEventHandler(self, EvtHandler handler)
6911
6912 Sets the event handler for this window. An event handler is an object
6913 that is capable of processing the events sent to a window. By default,
6914 the window is its own event handler, but an application may wish to
6915 substitute another, for example to allow central implementation of
6916 event-handling for a variety of different window classes.
6917
6918 It is usually better to use `wx.Window.PushEventHandler` since this sets
6919 up a chain of event handlers, where an event not handled by one event
6920 handler is handed to the next one in the chain.
6921 """
6922 return _core_.Window_SetEventHandler(*args, **kwargs)
6923
6924 def PushEventHandler(*args, **kwargs):
6925 """
6926 PushEventHandler(self, EvtHandler handler)
6927
6928 Pushes this event handler onto the event handler stack for the window.
6929 An event handler is an object that is capable of processing the events
6930 sent to a window. By default, the window is its own event handler, but
6931 an application may wish to substitute another, for example to allow
6932 central implementation of event-handling for a variety of different
6933 window classes.
6934
6935 wx.Window.PushEventHandler allows an application to set up a chain of
6936 event handlers, where an event not handled by one event handler is
6937 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
6938 remove the event handler.
6939 """
6940 return _core_.Window_PushEventHandler(*args, **kwargs)
6941
6942 def PopEventHandler(*args, **kwargs):
6943 """
6944 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6945
6946 Removes and returns the top-most event handler on the event handler
6947 stack. If deleteHandler is True then the wx.EvtHandler object will be
6948 destroyed after it is popped.
6949 """
6950 return _core_.Window_PopEventHandler(*args, **kwargs)
6951
6952 def RemoveEventHandler(*args, **kwargs):
6953 """
6954 RemoveEventHandler(self, EvtHandler handler) -> bool
6955
6956 Find the given handler in the event handler chain and remove (but not
6957 delete) it from the event handler chain, return True if it was found
6958 and False otherwise (this also results in an assert failure so this
6959 function should only be called when the handler is supposed to be
6960 there.)
6961 """
6962 return _core_.Window_RemoveEventHandler(*args, **kwargs)
6963
6964 def SetValidator(*args, **kwargs):
6965 """
6966 SetValidator(self, Validator validator)
6967
6968 Deletes the current validator (if any) and sets the window validator,
6969 having called wx.Validator.Clone to create a new validator of this
6970 type.
6971 """
6972 return _core_.Window_SetValidator(*args, **kwargs)
6973
6974 def GetValidator(*args, **kwargs):
6975 """
6976 GetValidator(self) -> Validator
6977
6978 Returns a pointer to the current validator for the window, or None if
6979 there is none.
6980 """
6981 return _core_.Window_GetValidator(*args, **kwargs)
6982
6983 def Validate(*args, **kwargs):
6984 """
6985 Validate(self) -> bool
6986
6987 Validates the current values of the child controls using their
6988 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6989 style flag set, the method will also call Validate() of all child
6990 windows. Returns false if any of the validations failed.
6991 """
6992 return _core_.Window_Validate(*args, **kwargs)
6993
6994 def TransferDataToWindow(*args, **kwargs):
6995 """
6996 TransferDataToWindow(self) -> bool
6997
6998 Transfers values to child controls from data areas specified by their
6999 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7000 style flag set, the method will also call TransferDataToWindow() of
7001 all child windows.
7002 """
7003 return _core_.Window_TransferDataToWindow(*args, **kwargs)
7004
7005 def TransferDataFromWindow(*args, **kwargs):
7006 """
7007 TransferDataFromWindow(self) -> bool
7008
7009 Transfers values from child controls to data areas specified by their
7010 validators. Returns false if a transfer failed. If the window has
7011 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7012 also call TransferDataFromWindow() of all child windows.
7013 """
7014 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
7015
7016 def InitDialog(*args, **kwargs):
7017 """
7018 InitDialog(self)
7019
7020 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7021 to the dialog via validators.
7022 """
7023 return _core_.Window_InitDialog(*args, **kwargs)
7024
7025 def SetAcceleratorTable(*args, **kwargs):
7026 """
7027 SetAcceleratorTable(self, AcceleratorTable accel)
7028
7029 Sets the accelerator table for this window.
7030 """
7031 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
7032
7033 def GetAcceleratorTable(*args, **kwargs):
7034 """
7035 GetAcceleratorTable(self) -> AcceleratorTable
7036
7037 Gets the accelerator table for this window.
7038 """
7039 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
7040
7041 def RegisterHotKey(*args, **kwargs):
7042 """
7043 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7044
7045 Registers a system wide hotkey. Every time the user presses the hotkey
7046 registered here, this window will receive a hotkey event. It will
7047 receive the event even if the application is in the background and
7048 does not have the input focus because the user is working with some
7049 other application. To bind an event handler function to this hotkey
7050 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7051 hotkey was registered successfully.
7052 """
7053 return _core_.Window_RegisterHotKey(*args, **kwargs)
7054
7055 def UnregisterHotKey(*args, **kwargs):
7056 """
7057 UnregisterHotKey(self, int hotkeyId) -> bool
7058
7059 Unregisters a system wide hotkey.
7060 """
7061 return _core_.Window_UnregisterHotKey(*args, **kwargs)
7062
7063 def ConvertDialogPointToPixels(*args, **kwargs):
7064 """
7065 ConvertDialogPointToPixels(self, Point pt) -> Point
7066
7067 Converts a point or size from dialog units to pixels. Dialog units
7068 are used for maintaining a dialog's proportions even if the font
7069 changes. For the x dimension, the dialog units are multiplied by the
7070 average character width and then divided by 4. For the y dimension,
7071 the dialog units are multiplied by the average character height and
7072 then divided by 8.
7073 """
7074 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
7075
7076 def ConvertDialogSizeToPixels(*args, **kwargs):
7077 """
7078 ConvertDialogSizeToPixels(self, Size sz) -> Size
7079
7080 Converts a point or size from dialog units to pixels. Dialog units
7081 are used for maintaining a dialog's proportions even if the font
7082 changes. For the x dimension, the dialog units are multiplied by the
7083 average character width and then divided by 4. For the y dimension,
7084 the dialog units are multiplied by the average character height and
7085 then divided by 8.
7086 """
7087 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
7088
7089 def DLG_PNT(*args, **kwargs):
7090 """
7091 DLG_PNT(self, Point pt) -> Point
7092
7093 Converts a point or size from dialog units to pixels. Dialog units
7094 are used for maintaining a dialog's proportions even if the font
7095 changes. For the x dimension, the dialog units are multiplied by the
7096 average character width and then divided by 4. For the y dimension,
7097 the dialog units are multiplied by the average character height and
7098 then divided by 8.
7099 """
7100 return _core_.Window_DLG_PNT(*args, **kwargs)
7101
7102 def DLG_SZE(*args, **kwargs):
7103 """
7104 DLG_SZE(self, Size sz) -> Size
7105
7106 Converts a point or size from dialog units to pixels. Dialog units
7107 are used for maintaining a dialog's proportions even if the font
7108 changes. For the x dimension, the dialog units are multiplied by the
7109 average character width and then divided by 4. For the y dimension,
7110 the dialog units are multiplied by the average character height and
7111 then divided by 8.
7112 """
7113 return _core_.Window_DLG_SZE(*args, **kwargs)
7114
7115 def ConvertPixelPointToDialog(*args, **kwargs):
7116 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7117 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
7118
7119 def ConvertPixelSizeToDialog(*args, **kwargs):
7120 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7121 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
7122
7123 def WarpPointer(*args, **kwargs):
7124 """
7125 WarpPointer(self, int x, int y)
7126
7127 Moves the pointer to the given position on the window.
7128
7129 NOTE: This function is not supported under Mac because Apple Human
7130 Interface Guidelines forbid moving the mouse cursor programmatically.
7131 """
7132 return _core_.Window_WarpPointer(*args, **kwargs)
7133
7134 def CaptureMouse(*args, **kwargs):
7135 """
7136 CaptureMouse(self)
7137
7138 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7139 release the capture.
7140
7141 Note that wxWindows maintains the stack of windows having captured the
7142 mouse and when the mouse is released the capture returns to the window
7143 which had had captured it previously and it is only really released if
7144 there were no previous window. In particular, this means that you must
7145 release the mouse as many times as you capture it.
7146 """
7147 return _core_.Window_CaptureMouse(*args, **kwargs)
7148
7149 def ReleaseMouse(*args, **kwargs):
7150 """
7151 ReleaseMouse(self)
7152
7153 Releases mouse input captured with wx.Window.CaptureMouse.
7154 """
7155 return _core_.Window_ReleaseMouse(*args, **kwargs)
7156
7157 def GetCapture(*args, **kwargs):
7158 """
7159 GetCapture() -> Window
7160
7161 Returns the window which currently captures the mouse or None
7162 """
7163 return _core_.Window_GetCapture(*args, **kwargs)
7164
7165 GetCapture = staticmethod(GetCapture)
7166 def HasCapture(*args, **kwargs):
7167 """
7168 HasCapture(self) -> bool
7169
7170 Returns true if this window has the current mouse capture.
7171 """
7172 return _core_.Window_HasCapture(*args, **kwargs)
7173
7174 def Refresh(*args, **kwargs):
7175 """
7176 Refresh(self, bool eraseBackground=True, Rect rect=None)
7177
7178 Mark the specified rectangle (or the whole window) as "dirty" so it
7179 will be repainted. Causes an EVT_PAINT event to be generated and sent
7180 to the window.
7181 """
7182 return _core_.Window_Refresh(*args, **kwargs)
7183
7184 def RefreshRect(*args, **kwargs):
7185 """
7186 RefreshRect(self, Rect rect, bool eraseBackground=True)
7187
7188 Redraws the contents of the given rectangle: the area inside it will
7189 be repainted. This is the same as Refresh but has a nicer syntax.
7190 """
7191 return _core_.Window_RefreshRect(*args, **kwargs)
7192
7193 def Update(*args, **kwargs):
7194 """
7195 Update(self)
7196
7197 Calling this method immediately repaints the invalidated area of the
7198 window instead of waiting for the EVT_PAINT event to happen, (normally
7199 this would usually only happen when the flow of control returns to the
7200 event loop.) Notice that this function doesn't refresh the window and
7201 does nothing if the window has been already repainted. Use Refresh
7202 first if you want to immediately redraw the window (or some portion of
7203 it) unconditionally.
7204 """
7205 return _core_.Window_Update(*args, **kwargs)
7206
7207 def ClearBackground(*args, **kwargs):
7208 """
7209 ClearBackground(self)
7210
7211 Clears the window by filling it with the current background
7212 colour. Does not cause an erase background event to be generated.
7213 """
7214 return _core_.Window_ClearBackground(*args, **kwargs)
7215
7216 def Freeze(*args, **kwargs):
7217 """
7218 Freeze(self)
7219
7220 Freezes the window or, in other words, prevents any updates from
7221 taking place on screen, the window is not redrawn at all. Thaw must be
7222 called to reenable window redrawing. Calls to Freeze/Thaw may be
7223 nested, with the actual Thaw being delayed until all the nesting has
7224 been undone.
7225
7226 This method is useful for visual appearance optimization (for example,
7227 it is a good idea to use it before inserting large amount of text into
7228 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7229 for all controls so it is mostly just a hint to wxWindows and not a
7230 mandatory directive.
7231 """
7232 return _core_.Window_Freeze(*args, **kwargs)
7233
7234 def Thaw(*args, **kwargs):
7235 """
7236 Thaw(self)
7237
7238 Reenables window updating after a previous call to Freeze. Calls to
7239 Freeze/Thaw may be nested, so Thaw must be called the same number of
7240 times that Freeze was before the window will be updated.
7241 """
7242 return _core_.Window_Thaw(*args, **kwargs)
7243
7244 def PrepareDC(*args, **kwargs):
7245 """
7246 PrepareDC(self, DC dc)
7247
7248 Call this function to prepare the device context for drawing a
7249 scrolled image. It sets the device origin according to the current
7250 scroll position.
7251 """
7252 return _core_.Window_PrepareDC(*args, **kwargs)
7253
7254 def GetUpdateRegion(*args, **kwargs):
7255 """
7256 GetUpdateRegion(self) -> Region
7257
7258 Returns the region specifying which parts of the window have been
7259 damaged. Should only be called within an EVT_PAINT handler.
7260 """
7261 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7262
7263 def GetUpdateClientRect(*args, **kwargs):
7264 """
7265 GetUpdateClientRect(self) -> Rect
7266
7267 Get the update rectangle region bounding box in client coords.
7268 """
7269 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7270
7271 def IsExposed(*args, **kwargs):
7272 """
7273 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7274
7275 Returns true if the given point or rectangle area has been exposed
7276 since the last repaint. Call this in an paint event handler to
7277 optimize redrawing by only redrawing those areas, which have been
7278 exposed.
7279 """
7280 return _core_.Window_IsExposed(*args, **kwargs)
7281
7282 def IsExposedPoint(*args, **kwargs):
7283 """
7284 IsExposedPoint(self, Point pt) -> bool
7285
7286 Returns true if the given point or rectangle area has been exposed
7287 since the last repaint. Call this in an paint event handler to
7288 optimize redrawing by only redrawing those areas, which have been
7289 exposed.
7290 """
7291 return _core_.Window_IsExposedPoint(*args, **kwargs)
7292
7293 def IsExposedRect(*args, **kwargs):
7294 """
7295 IsExposedRect(self, Rect rect) -> bool
7296
7297 Returns true if the given point or rectangle area has been exposed
7298 since the last repaint. Call this in an paint event handler to
7299 optimize redrawing by only redrawing those areas, which have been
7300 exposed.
7301 """
7302 return _core_.Window_IsExposedRect(*args, **kwargs)
7303
7304 def GetDefaultAttributes(*args, **kwargs):
7305 """
7306 GetDefaultAttributes(self) -> VisualAttributes
7307
7308 Get the default attributes for an instance of this class. This is
7309 useful if you want to use the same font or colour in your own control
7310 as in a standard control -- which is a much better idea than hard
7311 coding specific colours or fonts which might look completely out of
7312 place on the user's system, especially if it uses themes.
7313 """
7314 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7315
7316 def GetClassDefaultAttributes(*args, **kwargs):
7317 """
7318 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7319
7320 Get the default attributes for this class. This is useful if you want
7321 to use the same font or colour in your own control as in a standard
7322 control -- which is a much better idea than hard coding specific
7323 colours or fonts which might look completely out of place on the
7324 user's system, especially if it uses themes.
7325
7326 The variant parameter is only relevant under Mac currently and is
7327 ignore under other platforms. Under Mac, it will change the size of
7328 the returned font. See `wx.Window.SetWindowVariant` for more about
7329 this.
7330 """
7331 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7332
7333 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7334 def SetBackgroundColour(*args, **kwargs):
7335 """
7336 SetBackgroundColour(self, Colour colour) -> bool
7337
7338 Sets the background colour of the window. Returns True if the colour
7339 was changed. The background colour is usually painted by the default
7340 EVT_ERASE_BACKGROUND event handler function under Windows and
7341 automatically under GTK. Using `wx.NullColour` will reset the window
7342 to the default background colour.
7343
7344 Note that setting the background colour may not cause an immediate
7345 refresh, so you may wish to call `ClearBackground` or `Refresh` after
7346 calling this function.
7347
7348 Using this function will disable attempts to use themes for this
7349 window, if the system supports them. Use with care since usually the
7350 themes represent the appearance chosen by the user to be used for all
7351 applications on the system.
7352 """
7353 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7354
7355 def SetOwnBackgroundColour(*args, **kwargs):
7356 """SetOwnBackgroundColour(self, Colour colour)"""
7357 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
7358
7359 def SetForegroundColour(*args, **kwargs):
7360 """
7361 SetForegroundColour(self, Colour colour) -> bool
7362
7363 Sets the foreground colour of the window. Returns True is the colour
7364 was changed. The interpretation of foreground colour is dependent on
7365 the window class; it may be the text colour or other colour, or it may
7366 not be used at all.
7367 """
7368 return _core_.Window_SetForegroundColour(*args, **kwargs)
7369
7370 def SetOwnForegroundColour(*args, **kwargs):
7371 """SetOwnForegroundColour(self, Colour colour)"""
7372 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
7373
7374 def GetBackgroundColour(*args, **kwargs):
7375 """
7376 GetBackgroundColour(self) -> Colour
7377
7378 Returns the background colour of the window.
7379 """
7380 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7381
7382 def GetForegroundColour(*args, **kwargs):
7383 """
7384 GetForegroundColour(self) -> Colour
7385
7386 Returns the foreground colour of the window. The interpretation of
7387 foreground colour is dependent on the window class; it may be the text
7388 colour or other colour, or it may not be used at all.
7389 """
7390 return _core_.Window_GetForegroundColour(*args, **kwargs)
7391
7392 def InheritsBackgroundColour(*args, **kwargs):
7393 """InheritsBackgroundColour(self) -> bool"""
7394 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
7395
7396 def UseBgCol(*args, **kwargs):
7397 """UseBgCol(self) -> bool"""
7398 return _core_.Window_UseBgCol(*args, **kwargs)
7399
7400 def SetBackgroundStyle(*args, **kwargs):
7401 """
7402 SetBackgroundStyle(self, int style) -> bool
7403
7404 Returns the background style of the window. The background style
7405 indicates how the background of the window is drawn.
7406
7407 ====================== ========================================
7408 wx.BG_STYLE_SYSTEM The background colour or pattern should
7409 be determined by the system
7410 wx.BG_STYLE_COLOUR The background should be a solid colour
7411 wx.BG_STYLE_CUSTOM The background will be implemented by the
7412 application.
7413 ====================== ========================================
7414
7415 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7416 a custom background, such as a tiled bitmap. Currently the style has
7417 no effect on other platforms.
7418
7419 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7420 """
7421 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7422
7423 def GetBackgroundStyle(*args, **kwargs):
7424 """
7425 GetBackgroundStyle(self) -> int
7426
7427 Returns the background style of the window.
7428
7429 :see: `SetBackgroundStyle`
7430 """
7431 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7432
7433 def HasTransparentBackground(*args, **kwargs):
7434 """
7435 HasTransparentBackground(self) -> bool
7436
7437 Returns True if this window's background is transparent (as, for
7438 example, for `wx.StaticText`) and should show the parent window's
7439 background.
7440
7441 This method is mostly used internally by the library itself and you
7442 normally shouldn't have to call it. You may, however, have to override
7443 it in your custom control classes to ensure that background is painted
7444 correctly.
7445 """
7446 return _core_.Window_HasTransparentBackground(*args, **kwargs)
7447
7448 def SetCursor(*args, **kwargs):
7449 """
7450 SetCursor(self, Cursor cursor) -> bool
7451
7452 Sets the window's cursor. Notice that the window cursor also sets it
7453 for the children of the window implicitly.
7454
7455 The cursor may be wx.NullCursor in which case the window cursor will
7456 be reset back to default.
7457 """
7458 return _core_.Window_SetCursor(*args, **kwargs)
7459
7460 def GetCursor(*args, **kwargs):
7461 """
7462 GetCursor(self) -> Cursor
7463
7464 Return the cursor associated with this window.
7465 """
7466 return _core_.Window_GetCursor(*args, **kwargs)
7467
7468 def SetFont(*args, **kwargs):
7469 """
7470 SetFont(self, Font font) -> bool
7471
7472 Sets the font for this window.
7473 """
7474 return _core_.Window_SetFont(*args, **kwargs)
7475
7476 def SetOwnFont(*args, **kwargs):
7477 """SetOwnFont(self, Font font)"""
7478 return _core_.Window_SetOwnFont(*args, **kwargs)
7479
7480 def GetFont(*args, **kwargs):
7481 """
7482 GetFont(self) -> Font
7483
7484 Returns the default font used for this window.
7485 """
7486 return _core_.Window_GetFont(*args, **kwargs)
7487
7488 def SetCaret(*args, **kwargs):
7489 """
7490 SetCaret(self, Caret caret)
7491
7492 Sets the caret associated with the window.
7493 """
7494 return _core_.Window_SetCaret(*args, **kwargs)
7495
7496 def GetCaret(*args, **kwargs):
7497 """
7498 GetCaret(self) -> Caret
7499
7500 Returns the caret associated with the window.
7501 """
7502 return _core_.Window_GetCaret(*args, **kwargs)
7503
7504 def GetCharHeight(*args, **kwargs):
7505 """
7506 GetCharHeight(self) -> int
7507
7508 Get the (average) character size for the current font.
7509 """
7510 return _core_.Window_GetCharHeight(*args, **kwargs)
7511
7512 def GetCharWidth(*args, **kwargs):
7513 """
7514 GetCharWidth(self) -> int
7515
7516 Get the (average) character size for the current font.
7517 """
7518 return _core_.Window_GetCharWidth(*args, **kwargs)
7519
7520 def GetTextExtent(*args, **kwargs):
7521 """
7522 GetTextExtent(String string) -> (width, height)
7523
7524 Get the width and height of the text using the current font.
7525 """
7526 return _core_.Window_GetTextExtent(*args, **kwargs)
7527
7528 def GetFullTextExtent(*args, **kwargs):
7529 """
7530 GetFullTextExtent(String string, Font font=None) ->
7531 (width, height, descent, externalLeading)
7532
7533 Get the width, height, decent and leading of the text using the
7534 current or specified font.
7535 """
7536 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7537
7538 def ClientToScreenXY(*args, **kwargs):
7539 """
7540 ClientToScreenXY(int x, int y) -> (x,y)
7541
7542 Converts to screen coordinates from coordinates relative to this window.
7543 """
7544 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7545
7546 def ScreenToClientXY(*args, **kwargs):
7547 """
7548 ScreenToClientXY(int x, int y) -> (x,y)
7549
7550 Converts from screen to client window coordinates.
7551 """
7552 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7553
7554 def ClientToScreen(*args, **kwargs):
7555 """
7556 ClientToScreen(self, Point pt) -> Point
7557
7558 Converts to screen coordinates from coordinates relative to this window.
7559 """
7560 return _core_.Window_ClientToScreen(*args, **kwargs)
7561
7562 def ScreenToClient(*args, **kwargs):
7563 """
7564 ScreenToClient(self, Point pt) -> Point
7565
7566 Converts from screen to client window coordinates.
7567 """
7568 return _core_.Window_ScreenToClient(*args, **kwargs)
7569
7570 def HitTestXY(*args, **kwargs):
7571 """
7572 HitTestXY(self, int x, int y) -> int
7573
7574 Test where the given (in client coords) point lies
7575 """
7576 return _core_.Window_HitTestXY(*args, **kwargs)
7577
7578 def HitTest(*args, **kwargs):
7579 """
7580 HitTest(self, Point pt) -> int
7581
7582 Test where the given (in client coords) point lies
7583 """
7584 return _core_.Window_HitTest(*args, **kwargs)
7585
7586 def GetBorder(*args):
7587 """
7588 GetBorder(self, long flags) -> int
7589 GetBorder(self) -> int
7590
7591 Get border for the flags of this window
7592 """
7593 return _core_.Window_GetBorder(*args)
7594
7595 def UpdateWindowUI(*args, **kwargs):
7596 """
7597 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7598
7599 This function sends EVT_UPDATE_UI events to the window. The particular
7600 implementation depends on the window; for example a wx.ToolBar will
7601 send an update UI event for each toolbar button, and a wx.Frame will
7602 send an update UI event for each menubar menu item. You can call this
7603 function from your application to ensure that your UI is up-to-date at
7604 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7605 concerned). This may be necessary if you have called
7606 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7607 limit the overhead that wxWindows incurs by sending update UI events
7608 in idle time.
7609 """
7610 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7611
7612 def PopupMenuXY(*args, **kwargs):
7613 """
7614 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
7615
7616 Pops up the given menu at the specified coordinates, relative to this window,
7617 and returns control when the user has dismissed the menu. If a menu item is
7618 selected, the corresponding menu event is generated and will be processed as
7619 usual. If the default position is given then the current position of the
7620 mouse cursor will be used.
7621 """
7622 return _core_.Window_PopupMenuXY(*args, **kwargs)
7623
7624 def PopupMenu(*args, **kwargs):
7625 """
7626 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
7627
7628 Pops up the given menu at the specified coordinates, relative to this window,
7629 and returns control when the user has dismissed the menu. If a menu item is
7630 selected, the corresponding menu event is generated and will be processed as
7631 usual. If the default position is given then the current position of the
7632 mouse cursor will be used.
7633 """
7634 return _core_.Window_PopupMenu(*args, **kwargs)
7635
7636 def GetHandle(*args, **kwargs):
7637 """
7638 GetHandle(self) -> long
7639
7640 Returns the platform-specific handle (as a long integer) of the
7641 physical window. Currently on wxMac it returns the handle of the
7642 toplevel parent of the window.
7643 """
7644 return _core_.Window_GetHandle(*args, **kwargs)
7645
7646 def AssociateHandle(*args, **kwargs):
7647 """
7648 AssociateHandle(self, long handle)
7649
7650 Associate the window with a new native handle
7651 """
7652 return _core_.Window_AssociateHandle(*args, **kwargs)
7653
7654 def DissociateHandle(*args, **kwargs):
7655 """
7656 DissociateHandle(self)
7657
7658 Dissociate the current native handle from the window
7659 """
7660 return _core_.Window_DissociateHandle(*args, **kwargs)
7661
7662 def HasScrollbar(*args, **kwargs):
7663 """
7664 HasScrollbar(self, int orient) -> bool
7665
7666 Does the window have the scrollbar for this orientation?
7667 """
7668 return _core_.Window_HasScrollbar(*args, **kwargs)
7669
7670 def SetScrollbar(*args, **kwargs):
7671 """
7672 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
7673 bool refresh=True)
7674
7675 Sets the scrollbar properties of a built-in scrollbar.
7676 """
7677 return _core_.Window_SetScrollbar(*args, **kwargs)
7678
7679 def SetScrollPos(*args, **kwargs):
7680 """
7681 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7682
7683 Sets the position of one of the built-in scrollbars.
7684 """
7685 return _core_.Window_SetScrollPos(*args, **kwargs)
7686
7687 def GetScrollPos(*args, **kwargs):
7688 """
7689 GetScrollPos(self, int orientation) -> int
7690
7691 Returns the built-in scrollbar position.
7692 """
7693 return _core_.Window_GetScrollPos(*args, **kwargs)
7694
7695 def GetScrollThumb(*args, **kwargs):
7696 """
7697 GetScrollThumb(self, int orientation) -> int
7698
7699 Returns the built-in scrollbar thumb size.
7700 """
7701 return _core_.Window_GetScrollThumb(*args, **kwargs)
7702
7703 def GetScrollRange(*args, **kwargs):
7704 """
7705 GetScrollRange(self, int orientation) -> int
7706
7707 Returns the built-in scrollbar range.
7708 """
7709 return _core_.Window_GetScrollRange(*args, **kwargs)
7710
7711 def ScrollWindow(*args, **kwargs):
7712 """
7713 ScrollWindow(self, int dx, int dy, Rect rect=None)
7714
7715 Physically scrolls the pixels in the window and move child windows
7716 accordingly. Use this function to optimise your scrolling
7717 implementations, to minimise the area that must be redrawn. Note that
7718 it is rarely required to call this function from a user program.
7719 """
7720 return _core_.Window_ScrollWindow(*args, **kwargs)
7721
7722 def ScrollLines(*args, **kwargs):
7723 """
7724 ScrollLines(self, int lines) -> bool
7725
7726 If the platform and window class supports it, scrolls the window by
7727 the given number of lines down, if lines is positive, or up if lines
7728 is negative. Returns True if the window was scrolled, False if it was
7729 already on top/bottom and nothing was done.
7730 """
7731 return _core_.Window_ScrollLines(*args, **kwargs)
7732
7733 def ScrollPages(*args, **kwargs):
7734 """
7735 ScrollPages(self, int pages) -> bool
7736
7737 If the platform and window class supports it, scrolls the window by
7738 the given number of pages down, if pages is positive, or up if pages
7739 is negative. Returns True if the window was scrolled, False if it was
7740 already on top/bottom and nothing was done.
7741 """
7742 return _core_.Window_ScrollPages(*args, **kwargs)
7743
7744 def LineUp(*args, **kwargs):
7745 """
7746 LineUp(self) -> bool
7747
7748 This is just a wrapper for ScrollLines(-1).
7749 """
7750 return _core_.Window_LineUp(*args, **kwargs)
7751
7752 def LineDown(*args, **kwargs):
7753 """
7754 LineDown(self) -> bool
7755
7756 This is just a wrapper for ScrollLines(1).
7757 """
7758 return _core_.Window_LineDown(*args, **kwargs)
7759
7760 def PageUp(*args, **kwargs):
7761 """
7762 PageUp(self) -> bool
7763
7764 This is just a wrapper for ScrollPages(-1).
7765 """
7766 return _core_.Window_PageUp(*args, **kwargs)
7767
7768 def PageDown(*args, **kwargs):
7769 """
7770 PageDown(self) -> bool
7771
7772 This is just a wrapper for ScrollPages(1).
7773 """
7774 return _core_.Window_PageDown(*args, **kwargs)
7775
7776 def SetHelpText(*args, **kwargs):
7777 """
7778 SetHelpText(self, String text)
7779
7780 Sets the help text to be used as context-sensitive help for this
7781 window. Note that the text is actually stored by the current
7782 wxHelpProvider implementation, and not in the window object itself.
7783 """
7784 return _core_.Window_SetHelpText(*args, **kwargs)
7785
7786 def SetHelpTextForId(*args, **kwargs):
7787 """
7788 SetHelpTextForId(self, String text)
7789
7790 Associate this help text with all windows with the same id as this
7791 one.
7792 """
7793 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7794
7795 def GetHelpText(*args, **kwargs):
7796 """
7797 GetHelpText(self) -> String
7798
7799 Gets the help text to be used as context-sensitive help for this
7800 window. Note that the text is actually stored by the current
7801 wxHelpProvider implementation, and not in the window object itself.
7802 """
7803 return _core_.Window_GetHelpText(*args, **kwargs)
7804
7805 def SetToolTipString(*args, **kwargs):
7806 """
7807 SetToolTipString(self, String tip)
7808
7809 Attach a tooltip to the window.
7810 """
7811 return _core_.Window_SetToolTipString(*args, **kwargs)
7812
7813 def SetToolTip(*args, **kwargs):
7814 """
7815 SetToolTip(self, ToolTip tip)
7816
7817 Attach a tooltip to the window.
7818 """
7819 return _core_.Window_SetToolTip(*args, **kwargs)
7820
7821 def GetToolTip(*args, **kwargs):
7822 """
7823 GetToolTip(self) -> ToolTip
7824
7825 get the associated tooltip or None if none
7826 """
7827 return _core_.Window_GetToolTip(*args, **kwargs)
7828
7829 def SetDropTarget(*args, **kwargs):
7830 """
7831 SetDropTarget(self, DropTarget dropTarget)
7832
7833 Associates a drop target with this window. If the window already has
7834 a drop target, it is deleted.
7835 """
7836 return _core_.Window_SetDropTarget(*args, **kwargs)
7837
7838 def GetDropTarget(*args, **kwargs):
7839 """
7840 GetDropTarget(self) -> DropTarget
7841
7842 Returns the associated drop target, which may be None.
7843 """
7844 return _core_.Window_GetDropTarget(*args, **kwargs)
7845
7846 def SetConstraints(*args, **kwargs):
7847 """
7848 SetConstraints(self, LayoutConstraints constraints)
7849
7850 Sets the window to have the given layout constraints. If an existing
7851 layout constraints object is already owned by the window, it will be
7852 deleted. Pass None to disassociate and delete the window's current
7853 constraints.
7854
7855 You must call SetAutoLayout to tell a window to use the constraints
7856 automatically in its default EVT_SIZE handler; otherwise, you must
7857 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7858 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7859 effect.
7860 """
7861 return _core_.Window_SetConstraints(*args, **kwargs)
7862
7863 def GetConstraints(*args, **kwargs):
7864 """
7865 GetConstraints(self) -> LayoutConstraints
7866
7867 Returns a pointer to the window's layout constraints, or None if there
7868 are none.
7869 """
7870 return _core_.Window_GetConstraints(*args, **kwargs)
7871
7872 def SetAutoLayout(*args, **kwargs):
7873 """
7874 SetAutoLayout(self, bool autoLayout)
7875
7876 Determines whether the Layout function will be called automatically
7877 when the window is resized. It is called implicitly by SetSizer but
7878 if you use SetConstraints you should call it manually or otherwise the
7879 window layout won't be correctly updated when its size changes.
7880 """
7881 return _core_.Window_SetAutoLayout(*args, **kwargs)
7882
7883 def GetAutoLayout(*args, **kwargs):
7884 """
7885 GetAutoLayout(self) -> bool
7886
7887 Returns the current autoLayout setting
7888 """
7889 return _core_.Window_GetAutoLayout(*args, **kwargs)
7890
7891 def Layout(*args, **kwargs):
7892 """
7893 Layout(self) -> bool
7894
7895 Invokes the constraint-based layout algorithm or the sizer-based
7896 algorithm for this window. See SetAutoLayout: when auto layout is on,
7897 this function gets called automatically by the default EVT_SIZE
7898 handler when the window is resized.
7899 """
7900 return _core_.Window_Layout(*args, **kwargs)
7901
7902 def SetSizer(*args, **kwargs):
7903 """
7904 SetSizer(self, Sizer sizer, bool deleteOld=True)
7905
7906 Sets the window to have the given layout sizer. The window will then
7907 own the object, and will take care of its deletion. If an existing
7908 layout sizer object is already owned by the window, it will be deleted
7909 if the deleteOld parameter is true. Note that this function will also
7910 call SetAutoLayout implicitly with a True parameter if the sizer is
7911 non-None, and False otherwise.
7912 """
7913 return _core_.Window_SetSizer(*args, **kwargs)
7914
7915 def SetSizerAndFit(*args, **kwargs):
7916 """
7917 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7918
7919 The same as SetSizer, except it also sets the size hints for the
7920 window based on the sizer's minimum size.
7921 """
7922 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7923
7924 def GetSizer(*args, **kwargs):
7925 """
7926 GetSizer(self) -> Sizer
7927
7928 Return the sizer associated with the window by a previous call to
7929 SetSizer or None if there isn't one.
7930 """
7931 return _core_.Window_GetSizer(*args, **kwargs)
7932
7933 def SetContainingSizer(*args, **kwargs):
7934 """
7935 SetContainingSizer(self, Sizer sizer)
7936
7937 This normally does not need to be called by application code. It is
7938 called internally when a window is added to a sizer, and is used so
7939 the window can remove itself from the sizer when it is destroyed.
7940 """
7941 return _core_.Window_SetContainingSizer(*args, **kwargs)
7942
7943 def GetContainingSizer(*args, **kwargs):
7944 """
7945 GetContainingSizer(self) -> Sizer
7946
7947 Return the sizer that this window is a member of, if any, otherwise None.
7948 """
7949 return _core_.Window_GetContainingSizer(*args, **kwargs)
7950
7951 def InheritAttributes(*args, **kwargs):
7952 """
7953 InheritAttributes(self)
7954
7955 This function is (or should be, in case of custom controls) called
7956 during window creation to intelligently set up the window visual
7957 attributes, that is the font and the foreground and background
7958 colours.
7959
7960 By 'intelligently' the following is meant: by default, all windows use
7961 their own default attributes. However if some of the parent's
7962 attributes are explicitly changed (that is, using SetFont and not
7963 SetOwnFont) and if the corresponding attribute hadn't been
7964 explicitly set for this window itself, then this window takes the same
7965 value as used by the parent. In addition, if the window overrides
7966 ShouldInheritColours to return false, the colours will not be changed
7967 no matter what and only the font might.
7968
7969 This rather complicated logic is necessary in order to accommodate the
7970 different usage scenarios. The most common one is when all default
7971 attributes are used and in this case, nothing should be inherited as
7972 in modern GUIs different controls use different fonts (and colours)
7973 than their siblings so they can't inherit the same value from the
7974 parent. However it was also deemed desirable to allow to simply change
7975 the attributes of all children at once by just changing the font or
7976 colour of their common parent, hence in this case we do inherit the
7977 parents attributes.
7978
7979 """
7980 return _core_.Window_InheritAttributes(*args, **kwargs)
7981
7982 def ShouldInheritColours(*args, **kwargs):
7983 """
7984 ShouldInheritColours(self) -> bool
7985
7986 Return true from here to allow the colours of this window to be
7987 changed by InheritAttributes, returning false forbids inheriting them
7988 from the parent window.
7989
7990 The base class version returns false, but this method is overridden in
7991 wxControl where it returns true.
7992 """
7993 return _core_.Window_ShouldInheritColours(*args, **kwargs)
7994
7995 def PostCreate(self, pre):
7996 """
7997 Phase 3 of the 2-phase create <wink!>
7998 Call this method after precreating the window with the 2-phase create method.
7999 """
8000 self.this = pre.this
8001 self.thisown = pre.thisown
8002 pre.thisown = 0
8003 if hasattr(self, '_setOORInfo'):
8004 self._setOORInfo(self)
8005 if hasattr(self, '_setCallbackInfo'):
8006 self._setCallbackInfo(self, self.__class__)
8007
8008
8009 class WindowPtr(Window):
8010 def __init__(self, this):
8011 self.this = this
8012 if not hasattr(self,"thisown"): self.thisown = 0
8013 self.__class__ = Window
8014 _core_.Window_swigregister(WindowPtr)
8015
8016 def PreWindow(*args, **kwargs):
8017 """
8018 PreWindow() -> Window
8019
8020 Precreate a Window for 2-phase creation.
8021 """
8022 val = _core_.new_PreWindow(*args, **kwargs)
8023 val.thisown = 1
8024 return val
8025
8026 def Window_NewControlId(*args, **kwargs):
8027 """
8028 Window_NewControlId() -> int
8029
8030 Generate a control id for the controls which were not given one.
8031 """
8032 return _core_.Window_NewControlId(*args, **kwargs)
8033
8034 def Window_NextControlId(*args, **kwargs):
8035 """
8036 Window_NextControlId(int winid) -> int
8037
8038 Get the id of the control following the one with the given
8039 autogenerated) id
8040 """
8041 return _core_.Window_NextControlId(*args, **kwargs)
8042
8043 def Window_PrevControlId(*args, **kwargs):
8044 """
8045 Window_PrevControlId(int winid) -> int
8046
8047 Get the id of the control preceding the one with the given
8048 autogenerated) id
8049 """
8050 return _core_.Window_PrevControlId(*args, **kwargs)
8051
8052 def Window_FindFocus(*args, **kwargs):
8053 """
8054 Window_FindFocus() -> Window
8055
8056 Returns the window or control that currently has the keyboard focus,
8057 or None.
8058 """
8059 return _core_.Window_FindFocus(*args, **kwargs)
8060
8061 def Window_GetCapture(*args, **kwargs):
8062 """
8063 Window_GetCapture() -> Window
8064
8065 Returns the window which currently captures the mouse or None
8066 """
8067 return _core_.Window_GetCapture(*args, **kwargs)
8068
8069 def Window_GetClassDefaultAttributes(*args, **kwargs):
8070 """
8071 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8072
8073 Get the default attributes for this class. This is useful if you want
8074 to use the same font or colour in your own control as in a standard
8075 control -- which is a much better idea than hard coding specific
8076 colours or fonts which might look completely out of place on the
8077 user's system, especially if it uses themes.
8078
8079 The variant parameter is only relevant under Mac currently and is
8080 ignore under other platforms. Under Mac, it will change the size of
8081 the returned font. See `wx.Window.SetWindowVariant` for more about
8082 this.
8083 """
8084 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8085
8086 def DLG_PNT(win, point_or_x, y=None):
8087 """
8088 Convenience function for converting a Point or (x,y) in
8089 dialog units to pixel units.
8090 """
8091 if y is None:
8092 return win.ConvertDialogPointToPixels(point_or_x)
8093 else:
8094 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8095
8096 def DLG_SZE(win, size_width, height=None):
8097 """
8098 Convenience function for converting a Size or (w,h) in
8099 dialog units to pixel units.
8100 """
8101 if height is None:
8102 return win.ConvertDialogSizeToPixels(size_width)
8103 else:
8104 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8105
8106
8107 def FindWindowById(*args, **kwargs):
8108 """
8109 FindWindowById(long id, Window parent=None) -> Window
8110
8111 Find the first window in the application with the given id. If parent
8112 is None, the search will start from all top-level frames and dialog
8113 boxes; if non-None, the search will be limited to the given window
8114 hierarchy. The search is recursive in both cases.
8115 """
8116 return _core_.FindWindowById(*args, **kwargs)
8117
8118 def FindWindowByName(*args, **kwargs):
8119 """
8120 FindWindowByName(String name, Window parent=None) -> Window
8121
8122 Find a window by its name (as given in a window constructor or Create
8123 function call). If parent is None, the search will start from all
8124 top-level frames and dialog boxes; if non-None, the search will be
8125 limited to the given window hierarchy. The search is recursive in both
8126 cases.
8127
8128 If no window with such name is found, wx.FindWindowByLabel is called.
8129 """
8130 return _core_.FindWindowByName(*args, **kwargs)
8131
8132 def FindWindowByLabel(*args, **kwargs):
8133 """
8134 FindWindowByLabel(String label, Window parent=None) -> Window
8135
8136 Find a window by its label. Depending on the type of window, the label
8137 may be a window title or panel item label. If parent is None, the
8138 search will start from all top-level frames and dialog boxes; if
8139 non-None, the search will be limited to the given window
8140 hierarchy. The search is recursive in both cases.
8141 """
8142 return _core_.FindWindowByLabel(*args, **kwargs)
8143
8144 def Window_FromHWND(*args, **kwargs):
8145 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8146 return _core_.Window_FromHWND(*args, **kwargs)
8147 #---------------------------------------------------------------------------
8148
8149 class Validator(EvtHandler):
8150 """Proxy of C++ Validator class"""
8151 def __repr__(self):
8152 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8153 def __init__(self, *args, **kwargs):
8154 """__init__(self) -> Validator"""
8155 newobj = _core_.new_Validator(*args, **kwargs)
8156 self.this = newobj.this
8157 self.thisown = 1
8158 del newobj.thisown
8159 self._setOORInfo(self)
8160
8161 def Clone(*args, **kwargs):
8162 """Clone(self) -> Validator"""
8163 return _core_.Validator_Clone(*args, **kwargs)
8164
8165 def Validate(*args, **kwargs):
8166 """Validate(self, Window parent) -> bool"""
8167 return _core_.Validator_Validate(*args, **kwargs)
8168
8169 def TransferToWindow(*args, **kwargs):
8170 """TransferToWindow(self) -> bool"""
8171 return _core_.Validator_TransferToWindow(*args, **kwargs)
8172
8173 def TransferFromWindow(*args, **kwargs):
8174 """TransferFromWindow(self) -> bool"""
8175 return _core_.Validator_TransferFromWindow(*args, **kwargs)
8176
8177 def GetWindow(*args, **kwargs):
8178 """GetWindow(self) -> Window"""
8179 return _core_.Validator_GetWindow(*args, **kwargs)
8180
8181 def SetWindow(*args, **kwargs):
8182 """SetWindow(self, Window window)"""
8183 return _core_.Validator_SetWindow(*args, **kwargs)
8184
8185 def IsSilent(*args, **kwargs):
8186 """IsSilent() -> bool"""
8187 return _core_.Validator_IsSilent(*args, **kwargs)
8188
8189 IsSilent = staticmethod(IsSilent)
8190 def SetBellOnError(*args, **kwargs):
8191 """SetBellOnError(int doIt=True)"""
8192 return _core_.Validator_SetBellOnError(*args, **kwargs)
8193
8194 SetBellOnError = staticmethod(SetBellOnError)
8195
8196 class ValidatorPtr(Validator):
8197 def __init__(self, this):
8198 self.this = this
8199 if not hasattr(self,"thisown"): self.thisown = 0
8200 self.__class__ = Validator
8201 _core_.Validator_swigregister(ValidatorPtr)
8202
8203 def Validator_IsSilent(*args, **kwargs):
8204 """Validator_IsSilent() -> bool"""
8205 return _core_.Validator_IsSilent(*args, **kwargs)
8206
8207 def Validator_SetBellOnError(*args, **kwargs):
8208 """Validator_SetBellOnError(int doIt=True)"""
8209 return _core_.Validator_SetBellOnError(*args, **kwargs)
8210
8211 class PyValidator(Validator):
8212 """Proxy of C++ PyValidator class"""
8213 def __repr__(self):
8214 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8215 def __init__(self, *args, **kwargs):
8216 """__init__(self) -> PyValidator"""
8217 newobj = _core_.new_PyValidator(*args, **kwargs)
8218 self.this = newobj.this
8219 self.thisown = 1
8220 del newobj.thisown
8221
8222 self._setCallbackInfo(self, PyValidator, 1)
8223 self._setOORInfo(self)
8224
8225 def _setCallbackInfo(*args, **kwargs):
8226 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
8227 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
8228
8229
8230 class PyValidatorPtr(PyValidator):
8231 def __init__(self, this):
8232 self.this = this
8233 if not hasattr(self,"thisown"): self.thisown = 0
8234 self.__class__ = PyValidator
8235 _core_.PyValidator_swigregister(PyValidatorPtr)
8236
8237 #---------------------------------------------------------------------------
8238
8239 class Menu(EvtHandler):
8240 """Proxy of C++ Menu class"""
8241 def __repr__(self):
8242 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8243 def __init__(self, *args, **kwargs):
8244 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8245 newobj = _core_.new_Menu(*args, **kwargs)
8246 self.this = newobj.this
8247 self.thisown = 1
8248 del newobj.thisown
8249 self._setOORInfo(self)
8250
8251 def Append(*args, **kwargs):
8252 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8253 return _core_.Menu_Append(*args, **kwargs)
8254
8255 def AppendSeparator(*args, **kwargs):
8256 """AppendSeparator(self) -> MenuItem"""
8257 return _core_.Menu_AppendSeparator(*args, **kwargs)
8258
8259 def AppendCheckItem(*args, **kwargs):
8260 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8261 return _core_.Menu_AppendCheckItem(*args, **kwargs)
8262
8263 def AppendRadioItem(*args, **kwargs):
8264 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8265 return _core_.Menu_AppendRadioItem(*args, **kwargs)
8266
8267 def AppendMenu(*args, **kwargs):
8268 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8269 return _core_.Menu_AppendMenu(*args, **kwargs)
8270
8271 def AppendItem(*args, **kwargs):
8272 """AppendItem(self, MenuItem item) -> MenuItem"""
8273 return _core_.Menu_AppendItem(*args, **kwargs)
8274
8275 def Break(*args, **kwargs):
8276 """Break(self)"""
8277 return _core_.Menu_Break(*args, **kwargs)
8278
8279 def InsertItem(*args, **kwargs):
8280 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8281 return _core_.Menu_InsertItem(*args, **kwargs)
8282
8283 def Insert(*args, **kwargs):
8284 """
8285 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8286 int kind=ITEM_NORMAL) -> MenuItem
8287 """
8288 return _core_.Menu_Insert(*args, **kwargs)
8289
8290 def InsertSeparator(*args, **kwargs):
8291 """InsertSeparator(self, size_t pos) -> MenuItem"""
8292 return _core_.Menu_InsertSeparator(*args, **kwargs)
8293
8294 def InsertCheckItem(*args, **kwargs):
8295 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8296 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8297
8298 def InsertRadioItem(*args, **kwargs):
8299 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8300 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8301
8302 def InsertMenu(*args, **kwargs):
8303 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8304 return _core_.Menu_InsertMenu(*args, **kwargs)
8305
8306 def PrependItem(*args, **kwargs):
8307 """PrependItem(self, MenuItem item) -> MenuItem"""
8308 return _core_.Menu_PrependItem(*args, **kwargs)
8309
8310 def Prepend(*args, **kwargs):
8311 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8312 return _core_.Menu_Prepend(*args, **kwargs)
8313
8314 def PrependSeparator(*args, **kwargs):
8315 """PrependSeparator(self) -> MenuItem"""
8316 return _core_.Menu_PrependSeparator(*args, **kwargs)
8317
8318 def PrependCheckItem(*args, **kwargs):
8319 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8320 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8321
8322 def PrependRadioItem(*args, **kwargs):
8323 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8324 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8325
8326 def PrependMenu(*args, **kwargs):
8327 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8328 return _core_.Menu_PrependMenu(*args, **kwargs)
8329
8330 def Remove(*args, **kwargs):
8331 """Remove(self, int id) -> MenuItem"""
8332 return _core_.Menu_Remove(*args, **kwargs)
8333
8334 def RemoveItem(*args, **kwargs):
8335 """RemoveItem(self, MenuItem item) -> MenuItem"""
8336 return _core_.Menu_RemoveItem(*args, **kwargs)
8337
8338 def Delete(*args, **kwargs):
8339 """Delete(self, int id) -> bool"""
8340 return _core_.Menu_Delete(*args, **kwargs)
8341
8342 def DeleteItem(*args, **kwargs):
8343 """DeleteItem(self, MenuItem item) -> bool"""
8344 return _core_.Menu_DeleteItem(*args, **kwargs)
8345
8346 def Destroy(*args, **kwargs):
8347 """
8348 Destroy(self)
8349
8350 Deletes the C++ object this Python object is a proxy for.
8351 """
8352 return _core_.Menu_Destroy(*args, **kwargs)
8353
8354 def DestroyId(*args, **kwargs):
8355 """
8356 DestroyId(self, int id) -> bool
8357
8358 Deletes the C++ object this Python object is a proxy for.
8359 """
8360 return _core_.Menu_DestroyId(*args, **kwargs)
8361
8362 def DestroyItem(*args, **kwargs):
8363 """
8364 DestroyItem(self, MenuItem item) -> bool
8365
8366 Deletes the C++ object this Python object is a proxy for.
8367 """
8368 return _core_.Menu_DestroyItem(*args, **kwargs)
8369
8370 def GetMenuItemCount(*args, **kwargs):
8371 """GetMenuItemCount(self) -> size_t"""
8372 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8373
8374 def GetMenuItems(*args, **kwargs):
8375 """GetMenuItems(self) -> PyObject"""
8376 return _core_.Menu_GetMenuItems(*args, **kwargs)
8377
8378 def FindItem(*args, **kwargs):
8379 """FindItem(self, String item) -> int"""
8380 return _core_.Menu_FindItem(*args, **kwargs)
8381
8382 def FindItemById(*args, **kwargs):
8383 """FindItemById(self, int id) -> MenuItem"""
8384 return _core_.Menu_FindItemById(*args, **kwargs)
8385
8386 def FindItemByPosition(*args, **kwargs):
8387 """FindItemByPosition(self, size_t position) -> MenuItem"""
8388 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8389
8390 def Enable(*args, **kwargs):
8391 """Enable(self, int id, bool enable)"""
8392 return _core_.Menu_Enable(*args, **kwargs)
8393
8394 def IsEnabled(*args, **kwargs):
8395 """IsEnabled(self, int id) -> bool"""
8396 return _core_.Menu_IsEnabled(*args, **kwargs)
8397
8398 def Check(*args, **kwargs):
8399 """Check(self, int id, bool check)"""
8400 return _core_.Menu_Check(*args, **kwargs)
8401
8402 def IsChecked(*args, **kwargs):
8403 """IsChecked(self, int id) -> bool"""
8404 return _core_.Menu_IsChecked(*args, **kwargs)
8405
8406 def SetLabel(*args, **kwargs):
8407 """SetLabel(self, int id, String label)"""
8408 return _core_.Menu_SetLabel(*args, **kwargs)
8409
8410 def GetLabel(*args, **kwargs):
8411 """GetLabel(self, int id) -> String"""
8412 return _core_.Menu_GetLabel(*args, **kwargs)
8413
8414 def SetHelpString(*args, **kwargs):
8415 """SetHelpString(self, int id, String helpString)"""
8416 return _core_.Menu_SetHelpString(*args, **kwargs)
8417
8418 def GetHelpString(*args, **kwargs):
8419 """GetHelpString(self, int id) -> String"""
8420 return _core_.Menu_GetHelpString(*args, **kwargs)
8421
8422 def SetTitle(*args, **kwargs):
8423 """SetTitle(self, String title)"""
8424 return _core_.Menu_SetTitle(*args, **kwargs)
8425
8426 def GetTitle(*args, **kwargs):
8427 """GetTitle(self) -> String"""
8428 return _core_.Menu_GetTitle(*args, **kwargs)
8429
8430 def SetEventHandler(*args, **kwargs):
8431 """SetEventHandler(self, EvtHandler handler)"""
8432 return _core_.Menu_SetEventHandler(*args, **kwargs)
8433
8434 def GetEventHandler(*args, **kwargs):
8435 """GetEventHandler(self) -> EvtHandler"""
8436 return _core_.Menu_GetEventHandler(*args, **kwargs)
8437
8438 def SetInvokingWindow(*args, **kwargs):
8439 """SetInvokingWindow(self, Window win)"""
8440 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8441
8442 def GetInvokingWindow(*args, **kwargs):
8443 """GetInvokingWindow(self) -> Window"""
8444 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8445
8446 def GetStyle(*args, **kwargs):
8447 """GetStyle(self) -> long"""
8448 return _core_.Menu_GetStyle(*args, **kwargs)
8449
8450 def UpdateUI(*args, **kwargs):
8451 """UpdateUI(self, EvtHandler source=None)"""
8452 return _core_.Menu_UpdateUI(*args, **kwargs)
8453
8454 def GetMenuBar(*args, **kwargs):
8455 """GetMenuBar(self) -> MenuBar"""
8456 return _core_.Menu_GetMenuBar(*args, **kwargs)
8457
8458 def Attach(*args, **kwargs):
8459 """Attach(self, wxMenuBarBase menubar)"""
8460 return _core_.Menu_Attach(*args, **kwargs)
8461
8462 def Detach(*args, **kwargs):
8463 """Detach(self)"""
8464 return _core_.Menu_Detach(*args, **kwargs)
8465
8466 def IsAttached(*args, **kwargs):
8467 """IsAttached(self) -> bool"""
8468 return _core_.Menu_IsAttached(*args, **kwargs)
8469
8470 def SetParent(*args, **kwargs):
8471 """SetParent(self, Menu parent)"""
8472 return _core_.Menu_SetParent(*args, **kwargs)
8473
8474 def GetParent(*args, **kwargs):
8475 """GetParent(self) -> Menu"""
8476 return _core_.Menu_GetParent(*args, **kwargs)
8477
8478
8479 class MenuPtr(Menu):
8480 def __init__(self, this):
8481 self.this = this
8482 if not hasattr(self,"thisown"): self.thisown = 0
8483 self.__class__ = Menu
8484 _core_.Menu_swigregister(MenuPtr)
8485 DefaultValidator = cvar.DefaultValidator
8486
8487 #---------------------------------------------------------------------------
8488
8489 class MenuBar(Window):
8490 """Proxy of C++ MenuBar class"""
8491 def __repr__(self):
8492 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8493 def __init__(self, *args, **kwargs):
8494 """__init__(self, long style=0) -> MenuBar"""
8495 newobj = _core_.new_MenuBar(*args, **kwargs)
8496 self.this = newobj.this
8497 self.thisown = 1
8498 del newobj.thisown
8499 self._setOORInfo(self)
8500
8501 def Append(*args, **kwargs):
8502 """Append(self, Menu menu, String title) -> bool"""
8503 return _core_.MenuBar_Append(*args, **kwargs)
8504
8505 def Insert(*args, **kwargs):
8506 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8507 return _core_.MenuBar_Insert(*args, **kwargs)
8508
8509 def GetMenuCount(*args, **kwargs):
8510 """GetMenuCount(self) -> size_t"""
8511 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8512
8513 def GetMenu(*args, **kwargs):
8514 """GetMenu(self, size_t pos) -> Menu"""
8515 return _core_.MenuBar_GetMenu(*args, **kwargs)
8516
8517 def Replace(*args, **kwargs):
8518 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8519 return _core_.MenuBar_Replace(*args, **kwargs)
8520
8521 def Remove(*args, **kwargs):
8522 """Remove(self, size_t pos) -> Menu"""
8523 return _core_.MenuBar_Remove(*args, **kwargs)
8524
8525 def EnableTop(*args, **kwargs):
8526 """EnableTop(self, size_t pos, bool enable)"""
8527 return _core_.MenuBar_EnableTop(*args, **kwargs)
8528
8529 def IsEnabledTop(*args, **kwargs):
8530 """IsEnabledTop(self, size_t pos) -> bool"""
8531 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8532
8533 def SetLabelTop(*args, **kwargs):
8534 """SetLabelTop(self, size_t pos, String label)"""
8535 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8536
8537 def GetLabelTop(*args, **kwargs):
8538 """GetLabelTop(self, size_t pos) -> String"""
8539 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8540
8541 def FindMenuItem(*args, **kwargs):
8542 """FindMenuItem(self, String menu, String item) -> int"""
8543 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8544
8545 def FindItemById(*args, **kwargs):
8546 """FindItemById(self, int id) -> MenuItem"""
8547 return _core_.MenuBar_FindItemById(*args, **kwargs)
8548
8549 def FindMenu(*args, **kwargs):
8550 """FindMenu(self, String title) -> int"""
8551 return _core_.MenuBar_FindMenu(*args, **kwargs)
8552
8553 def Enable(*args, **kwargs):
8554 """Enable(self, int id, bool enable)"""
8555 return _core_.MenuBar_Enable(*args, **kwargs)
8556
8557 def Check(*args, **kwargs):
8558 """Check(self, int id, bool check)"""
8559 return _core_.MenuBar_Check(*args, **kwargs)
8560
8561 def IsChecked(*args, **kwargs):
8562 """IsChecked(self, int id) -> bool"""
8563 return _core_.MenuBar_IsChecked(*args, **kwargs)
8564
8565 def IsEnabled(*args, **kwargs):
8566 """IsEnabled(self, int id) -> bool"""
8567 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8568
8569 def SetLabel(*args, **kwargs):
8570 """SetLabel(self, int id, String label)"""
8571 return _core_.MenuBar_SetLabel(*args, **kwargs)
8572
8573 def GetLabel(*args, **kwargs):
8574 """GetLabel(self, int id) -> String"""
8575 return _core_.MenuBar_GetLabel(*args, **kwargs)
8576
8577 def SetHelpString(*args, **kwargs):
8578 """SetHelpString(self, int id, String helpString)"""
8579 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8580
8581 def GetHelpString(*args, **kwargs):
8582 """GetHelpString(self, int id) -> String"""
8583 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8584
8585 def GetFrame(*args, **kwargs):
8586 """GetFrame(self) -> wxFrame"""
8587 return _core_.MenuBar_GetFrame(*args, **kwargs)
8588
8589 def IsAttached(*args, **kwargs):
8590 """IsAttached(self) -> bool"""
8591 return _core_.MenuBar_IsAttached(*args, **kwargs)
8592
8593 def Attach(*args, **kwargs):
8594 """Attach(self, wxFrame frame)"""
8595 return _core_.MenuBar_Attach(*args, **kwargs)
8596
8597 def Detach(*args, **kwargs):
8598 """Detach(self)"""
8599 return _core_.MenuBar_Detach(*args, **kwargs)
8600
8601
8602 class MenuBarPtr(MenuBar):
8603 def __init__(self, this):
8604 self.this = this
8605 if not hasattr(self,"thisown"): self.thisown = 0
8606 self.__class__ = MenuBar
8607 _core_.MenuBar_swigregister(MenuBarPtr)
8608
8609 #---------------------------------------------------------------------------
8610
8611 class MenuItem(Object):
8612 """Proxy of C++ MenuItem class"""
8613 def __repr__(self):
8614 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8615 def __init__(self, *args, **kwargs):
8616 """
8617 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8618 String help=EmptyString, int kind=ITEM_NORMAL,
8619 Menu subMenu=None) -> MenuItem
8620 """
8621 newobj = _core_.new_MenuItem(*args, **kwargs)
8622 self.this = newobj.this
8623 self.thisown = 1
8624 del newobj.thisown
8625 def GetMenu(*args, **kwargs):
8626 """GetMenu(self) -> Menu"""
8627 return _core_.MenuItem_GetMenu(*args, **kwargs)
8628
8629 def SetMenu(*args, **kwargs):
8630 """SetMenu(self, Menu menu)"""
8631 return _core_.MenuItem_SetMenu(*args, **kwargs)
8632
8633 def SetId(*args, **kwargs):
8634 """SetId(self, int id)"""
8635 return _core_.MenuItem_SetId(*args, **kwargs)
8636
8637 def GetId(*args, **kwargs):
8638 """GetId(self) -> int"""
8639 return _core_.MenuItem_GetId(*args, **kwargs)
8640
8641 def IsSeparator(*args, **kwargs):
8642 """IsSeparator(self) -> bool"""
8643 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8644
8645 def SetText(*args, **kwargs):
8646 """SetText(self, String str)"""
8647 return _core_.MenuItem_SetText(*args, **kwargs)
8648
8649 def GetLabel(*args, **kwargs):
8650 """GetLabel(self) -> String"""
8651 return _core_.MenuItem_GetLabel(*args, **kwargs)
8652
8653 def GetText(*args, **kwargs):
8654 """GetText(self) -> String"""
8655 return _core_.MenuItem_GetText(*args, **kwargs)
8656
8657 def GetLabelFromText(*args, **kwargs):
8658 """GetLabelFromText(String text) -> String"""
8659 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8660
8661 GetLabelFromText = staticmethod(GetLabelFromText)
8662 def GetKind(*args, **kwargs):
8663 """GetKind(self) -> int"""
8664 return _core_.MenuItem_GetKind(*args, **kwargs)
8665
8666 def SetKind(*args, **kwargs):
8667 """SetKind(self, int kind)"""
8668 return _core_.MenuItem_SetKind(*args, **kwargs)
8669
8670 def SetCheckable(*args, **kwargs):
8671 """SetCheckable(self, bool checkable)"""
8672 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8673
8674 def IsCheckable(*args, **kwargs):
8675 """IsCheckable(self) -> bool"""
8676 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8677
8678 def IsSubMenu(*args, **kwargs):
8679 """IsSubMenu(self) -> bool"""
8680 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8681
8682 def SetSubMenu(*args, **kwargs):
8683 """SetSubMenu(self, Menu menu)"""
8684 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8685
8686 def GetSubMenu(*args, **kwargs):
8687 """GetSubMenu(self) -> Menu"""
8688 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8689
8690 def Enable(*args, **kwargs):
8691 """Enable(self, bool enable=True)"""
8692 return _core_.MenuItem_Enable(*args, **kwargs)
8693
8694 def IsEnabled(*args, **kwargs):
8695 """IsEnabled(self) -> bool"""
8696 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8697
8698 def Check(*args, **kwargs):
8699 """Check(self, bool check=True)"""
8700 return _core_.MenuItem_Check(*args, **kwargs)
8701
8702 def IsChecked(*args, **kwargs):
8703 """IsChecked(self) -> bool"""
8704 return _core_.MenuItem_IsChecked(*args, **kwargs)
8705
8706 def Toggle(*args, **kwargs):
8707 """Toggle(self)"""
8708 return _core_.MenuItem_Toggle(*args, **kwargs)
8709
8710 def SetHelp(*args, **kwargs):
8711 """SetHelp(self, String str)"""
8712 return _core_.MenuItem_SetHelp(*args, **kwargs)
8713
8714 def GetHelp(*args, **kwargs):
8715 """GetHelp(self) -> String"""
8716 return _core_.MenuItem_GetHelp(*args, **kwargs)
8717
8718 def GetAccel(*args, **kwargs):
8719 """GetAccel(self) -> AcceleratorEntry"""
8720 return _core_.MenuItem_GetAccel(*args, **kwargs)
8721
8722 def SetAccel(*args, **kwargs):
8723 """SetAccel(self, AcceleratorEntry accel)"""
8724 return _core_.MenuItem_SetAccel(*args, **kwargs)
8725
8726 def SetFont(*args, **kwargs):
8727 """SetFont(self, Font font)"""
8728 return _core_.MenuItem_SetFont(*args, **kwargs)
8729
8730 def GetFont(*args, **kwargs):
8731 """GetFont(self) -> Font"""
8732 return _core_.MenuItem_GetFont(*args, **kwargs)
8733
8734 def SetTextColour(*args, **kwargs):
8735 """SetTextColour(self, Colour colText)"""
8736 return _core_.MenuItem_SetTextColour(*args, **kwargs)
8737
8738 def GetTextColour(*args, **kwargs):
8739 """GetTextColour(self) -> Colour"""
8740 return _core_.MenuItem_GetTextColour(*args, **kwargs)
8741
8742 def SetBackgroundColour(*args, **kwargs):
8743 """SetBackgroundColour(self, Colour colBack)"""
8744 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
8745
8746 def GetBackgroundColour(*args, **kwargs):
8747 """GetBackgroundColour(self) -> Colour"""
8748 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
8749
8750 def SetBitmaps(*args, **kwargs):
8751 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
8752 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
8753
8754 def SetDisabledBitmap(*args, **kwargs):
8755 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
8756 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
8757
8758 def GetDisabledBitmap(*args, **kwargs):
8759 """GetDisabledBitmap(self) -> Bitmap"""
8760 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
8761
8762 def SetMarginWidth(*args, **kwargs):
8763 """SetMarginWidth(self, int nWidth)"""
8764 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
8765
8766 def GetMarginWidth(*args, **kwargs):
8767 """GetMarginWidth(self) -> int"""
8768 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
8769
8770 def GetDefaultMarginWidth(*args, **kwargs):
8771 """GetDefaultMarginWidth() -> int"""
8772 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8773
8774 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8775 def IsOwnerDrawn(*args, **kwargs):
8776 """IsOwnerDrawn(self) -> bool"""
8777 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
8778
8779 def SetOwnerDrawn(*args, **kwargs):
8780 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
8781 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
8782
8783 def ResetOwnerDrawn(*args, **kwargs):
8784 """ResetOwnerDrawn(self)"""
8785 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
8786
8787 def SetBitmap(*args, **kwargs):
8788 """SetBitmap(self, Bitmap bitmap)"""
8789 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8790
8791 def GetBitmap(*args, **kwargs):
8792 """GetBitmap(self) -> Bitmap"""
8793 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8794
8795
8796 class MenuItemPtr(MenuItem):
8797 def __init__(self, this):
8798 self.this = this
8799 if not hasattr(self,"thisown"): self.thisown = 0
8800 self.__class__ = MenuItem
8801 _core_.MenuItem_swigregister(MenuItemPtr)
8802
8803 def MenuItem_GetLabelFromText(*args, **kwargs):
8804 """MenuItem_GetLabelFromText(String text) -> String"""
8805 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8806
8807 def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8808 """MenuItem_GetDefaultMarginWidth() -> int"""
8809 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8810
8811 #---------------------------------------------------------------------------
8812
8813 class Control(Window):
8814 """
8815 This is the base class for a control or 'widget'.
8816
8817 A control is generally a small window which processes user input
8818 and/or displays one or more item of data.
8819 """
8820 def __repr__(self):
8821 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8822 def __init__(self, *args, **kwargs):
8823 """
8824 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8825 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8826 String name=ControlNameStr) -> Control
8827
8828 Create a Control. Normally you should only call this from a subclass'
8829 __init__ as a plain old wx.Control is not very useful.
8830 """
8831 newobj = _core_.new_Control(*args, **kwargs)
8832 self.this = newobj.this
8833 self.thisown = 1
8834 del newobj.thisown
8835 self._setOORInfo(self)
8836
8837 def Create(*args, **kwargs):
8838 """
8839 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8840 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8841 String name=ControlNameStr) -> bool
8842
8843 Do the 2nd phase and create the GUI control.
8844 """
8845 return _core_.Control_Create(*args, **kwargs)
8846
8847 def Command(*args, **kwargs):
8848 """
8849 Command(self, CommandEvent event)
8850
8851 Simulates the effect of the user issuing a command to the item.
8852
8853 :see: `wx.CommandEvent`
8854
8855 """
8856 return _core_.Control_Command(*args, **kwargs)
8857
8858 def GetLabel(*args, **kwargs):
8859 """
8860 GetLabel(self) -> String
8861
8862 Return a control's text.
8863 """
8864 return _core_.Control_GetLabel(*args, **kwargs)
8865
8866 def SetLabel(*args, **kwargs):
8867 """
8868 SetLabel(self, String label)
8869
8870 Sets the item's text.
8871 """
8872 return _core_.Control_SetLabel(*args, **kwargs)
8873
8874 def GetClassDefaultAttributes(*args, **kwargs):
8875 """
8876 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8877
8878 Get the default attributes for this class. This is useful if you want
8879 to use the same font or colour in your own control as in a standard
8880 control -- which is a much better idea than hard coding specific
8881 colours or fonts which might look completely out of place on the
8882 user's system, especially if it uses themes.
8883
8884 The variant parameter is only relevant under Mac currently and is
8885 ignore under other platforms. Under Mac, it will change the size of
8886 the returned font. See `wx.Window.SetWindowVariant` for more about
8887 this.
8888 """
8889 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8890
8891 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8892
8893 class ControlPtr(Control):
8894 def __init__(self, this):
8895 self.this = this
8896 if not hasattr(self,"thisown"): self.thisown = 0
8897 self.__class__ = Control
8898 _core_.Control_swigregister(ControlPtr)
8899 ControlNameStr = cvar.ControlNameStr
8900
8901 def PreControl(*args, **kwargs):
8902 """
8903 PreControl() -> Control
8904
8905 Precreate a Control control for 2-phase creation
8906 """
8907 val = _core_.new_PreControl(*args, **kwargs)
8908 val.thisown = 1
8909 return val
8910
8911 def Control_GetClassDefaultAttributes(*args, **kwargs):
8912 """
8913 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8914
8915 Get the default attributes for this class. This is useful if you want
8916 to use the same font or colour in your own control as in a standard
8917 control -- which is a much better idea than hard coding specific
8918 colours or fonts which might look completely out of place on the
8919 user's system, especially if it uses themes.
8920
8921 The variant parameter is only relevant under Mac currently and is
8922 ignore under other platforms. Under Mac, it will change the size of
8923 the returned font. See `wx.Window.SetWindowVariant` for more about
8924 this.
8925 """
8926 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8927
8928 #---------------------------------------------------------------------------
8929
8930 class ItemContainer(object):
8931 """
8932 The wx.ItemContainer class defines an interface which is implemented
8933 by all controls which have string subitems, each of which may be
8934 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
8935 as `wx.ComboBox` which implements an extended interface deriving from
8936 this one.
8937
8938 It defines the methods for accessing the control's items and although
8939 each of the derived classes implements them differently, they still
8940 all conform to the same interface.
8941
8942 The items in a wx.ItemContainer have (non empty) string labels and,
8943 optionally, client data associated with them.
8944
8945 """
8946 def __init__(self): raise RuntimeError, "No constructor defined"
8947 def __repr__(self):
8948 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8949 def Append(*args, **kwargs):
8950 """
8951 Append(self, String item, PyObject clientData=None) -> int
8952
8953 Adds the item to the control, associating the given data with the item
8954 if not None. The return value is the index of the newly added item
8955 which may be different from the last one if the control is sorted (e.g.
8956 has wx.LB_SORT or wx.CB_SORT style).
8957 """
8958 return _core_.ItemContainer_Append(*args, **kwargs)
8959
8960 def AppendItems(*args, **kwargs):
8961 """
8962 AppendItems(self, List strings)
8963
8964 Apend several items at once to the control. Notice that calling this
8965 method may be much faster than appending the items one by one if you
8966 need to add a lot of items.
8967 """
8968 return _core_.ItemContainer_AppendItems(*args, **kwargs)
8969
8970 def Insert(*args, **kwargs):
8971 """
8972 Insert(self, String item, int pos, PyObject clientData=None) -> int
8973
8974 Insert an item into the control before the item at the ``pos`` index,
8975 optionally associating some data object with the item.
8976 """
8977 return _core_.ItemContainer_Insert(*args, **kwargs)
8978
8979 def Clear(*args, **kwargs):
8980 """
8981 Clear(self)
8982
8983 Removes all items from the control.
8984 """
8985 return _core_.ItemContainer_Clear(*args, **kwargs)
8986
8987 def Delete(*args, **kwargs):
8988 """
8989 Delete(self, int n)
8990
8991 Deletes the item at the zero-based index 'n' from the control. Note
8992 that it is an error (signalled by a `wx.PyAssertionError` exception if
8993 enabled) to remove an item with the index negative or greater or equal
8994 than the number of items in the control.
8995 """
8996 return _core_.ItemContainer_Delete(*args, **kwargs)
8997
8998 def GetClientData(*args, **kwargs):
8999 """
9000 GetClientData(self, int n) -> PyObject
9001
9002 Returns the client data associated with the given item, (if any.)
9003 """
9004 return _core_.ItemContainer_GetClientData(*args, **kwargs)
9005
9006 def SetClientData(*args, **kwargs):
9007 """
9008 SetClientData(self, int n, PyObject clientData)
9009
9010 Associate the given client data with the item at position n.
9011 """
9012 return _core_.ItemContainer_SetClientData(*args, **kwargs)
9013
9014 def GetCount(*args, **kwargs):
9015 """
9016 GetCount(self) -> int
9017
9018 Returns the number of items in the control.
9019 """
9020 return _core_.ItemContainer_GetCount(*args, **kwargs)
9021
9022 def IsEmpty(*args, **kwargs):
9023 """
9024 IsEmpty(self) -> bool
9025
9026 Returns True if the control is empty or False if it has some items.
9027 """
9028 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
9029
9030 def GetString(*args, **kwargs):
9031 """
9032 GetString(self, int n) -> String
9033
9034 Returns the label of the item with the given index.
9035 """
9036 return _core_.ItemContainer_GetString(*args, **kwargs)
9037
9038 def GetStrings(*args, **kwargs):
9039 """GetStrings(self) -> wxArrayString"""
9040 return _core_.ItemContainer_GetStrings(*args, **kwargs)
9041
9042 def SetString(*args, **kwargs):
9043 """
9044 SetString(self, int n, String s)
9045
9046 Sets the label for the given item.
9047 """
9048 return _core_.ItemContainer_SetString(*args, **kwargs)
9049
9050 def FindString(*args, **kwargs):
9051 """
9052 FindString(self, String s) -> int
9053
9054 Finds an item whose label matches the given string. Returns the
9055 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9056 found.
9057 """
9058 return _core_.ItemContainer_FindString(*args, **kwargs)
9059
9060 def SetSelection(*args, **kwargs):
9061 """
9062 SetSelection(self, int n)
9063
9064 Sets the item at index 'n' to be the selected item.
9065 """
9066 return _core_.ItemContainer_SetSelection(*args, **kwargs)
9067
9068 def GetSelection(*args, **kwargs):
9069 """
9070 GetSelection(self) -> int
9071
9072 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
9073 is selected.
9074 """
9075 return _core_.ItemContainer_GetSelection(*args, **kwargs)
9076
9077 def SetStringSelection(*args, **kwargs):
9078 """SetStringSelection(self, String s) -> bool"""
9079 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
9080
9081 def GetStringSelection(*args, **kwargs):
9082 """
9083 GetStringSelection(self) -> String
9084
9085 Returns the label of the selected item or an empty string if no item
9086 is selected.
9087 """
9088 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
9089
9090 def Select(*args, **kwargs):
9091 """
9092 Select(self, int n)
9093
9094 This is the same as `SetSelection` and exists only because it is
9095 slightly more natural for controls which support multiple selection.
9096 """
9097 return _core_.ItemContainer_Select(*args, **kwargs)
9098
9099
9100 class ItemContainerPtr(ItemContainer):
9101 def __init__(self, this):
9102 self.this = this
9103 if not hasattr(self,"thisown"): self.thisown = 0
9104 self.__class__ = ItemContainer
9105 _core_.ItemContainer_swigregister(ItemContainerPtr)
9106
9107 #---------------------------------------------------------------------------
9108
9109 class ControlWithItems(Control,ItemContainer):
9110 """
9111 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
9112 wx.Control class, and is used for the base class of various controls
9113 that have items.
9114 """
9115 def __init__(self): raise RuntimeError, "No constructor defined"
9116 def __repr__(self):
9117 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9118
9119 class ControlWithItemsPtr(ControlWithItems):
9120 def __init__(self, this):
9121 self.this = this
9122 if not hasattr(self,"thisown"): self.thisown = 0
9123 self.__class__ = ControlWithItems
9124 _core_.ControlWithItems_swigregister(ControlWithItemsPtr)
9125
9126 #---------------------------------------------------------------------------
9127
9128 class SizerItem(Object):
9129 """
9130 The wx.SizerItem class is used to track the position, size and other
9131 attributes of each item managed by a `wx.Sizer`. In normal usage user
9132 code should never need to deal directly with a wx.SizerItem, but
9133 custom classes derived from `wx.PySizer` will probably need to use the
9134 collection of wx.SizerItems held by wx.Sizer when calculating layout.
9135
9136 :see: `wx.Sizer`, `wx.GBSizerItem`
9137 """
9138 def __repr__(self):
9139 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9140 def __init__(self, *args, **kwargs):
9141 """
9142 __init__(self) -> SizerItem
9143
9144 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
9145 size will need to be set before this item can be used in a Sizer.
9146
9147 You will probably never need to create a wx.SizerItem directly as they
9148 are created automatically when the sizer's Add, Insert or Prepend
9149 methods are called.
9150
9151 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
9152 """
9153 newobj = _core_.new_SizerItem(*args, **kwargs)
9154 self.this = newobj.this
9155 self.thisown = 1
9156 del newobj.thisown
9157 def DeleteWindows(*args, **kwargs):
9158 """
9159 DeleteWindows(self)
9160
9161 Destroy the window or the windows in a subsizer, depending on the type
9162 of item.
9163 """
9164 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
9165
9166 def DetachSizer(*args, **kwargs):
9167 """
9168 DetachSizer(self)
9169
9170 Enable deleting the SizerItem without destroying the contained sizer.
9171 """
9172 return _core_.SizerItem_DetachSizer(*args, **kwargs)
9173
9174 def GetSize(*args, **kwargs):
9175 """
9176 GetSize(self) -> Size
9177
9178 Get the current size of the item, as set in the last Layout.
9179 """
9180 return _core_.SizerItem_GetSize(*args, **kwargs)
9181
9182 def CalcMin(*args, **kwargs):
9183 """
9184 CalcMin(self) -> Size
9185
9186 Calculates the minimum desired size for the item, including any space
9187 needed by borders.
9188 """
9189 return _core_.SizerItem_CalcMin(*args, **kwargs)
9190
9191 def SetDimension(*args, **kwargs):
9192 """
9193 SetDimension(self, Point pos, Size size)
9194
9195 Set the position and size of the space allocated for this item by the
9196 sizer, and adjust the position and size of the item (window or
9197 subsizer) to be within that space taking alignment and borders into
9198 account.
9199 """
9200 return _core_.SizerItem_SetDimension(*args, **kwargs)
9201
9202 def GetMinSize(*args, **kwargs):
9203 """
9204 GetMinSize(self) -> Size
9205
9206 Get the minimum size needed for the item.
9207 """
9208 return _core_.SizerItem_GetMinSize(*args, **kwargs)
9209
9210 def GetMinSizeWithBorder(*args, **kwargs):
9211 """
9212 GetMinSizeWithBorder(self) -> Size
9213
9214 Get the minimum size needed for the item with space for the borders
9215 added, if needed.
9216 """
9217 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
9218
9219 def SetInitSize(*args, **kwargs):
9220 """SetInitSize(self, int x, int y)"""
9221 return _core_.SizerItem_SetInitSize(*args, **kwargs)
9222
9223 def SetRatioWH(*args, **kwargs):
9224 """
9225 SetRatioWH(self, int width, int height)
9226
9227 Set the ratio item attribute.
9228 """
9229 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
9230
9231 def SetRatioSize(*args, **kwargs):
9232 """
9233 SetRatioSize(self, Size size)
9234
9235 Set the ratio item attribute.
9236 """
9237 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
9238
9239 def SetRatio(*args, **kwargs):
9240 """
9241 SetRatio(self, float ratio)
9242
9243 Set the ratio item attribute.
9244 """
9245 return _core_.SizerItem_SetRatio(*args, **kwargs)
9246
9247 def GetRatio(*args, **kwargs):
9248 """
9249 GetRatio(self) -> float
9250
9251 Set the ratio item attribute.
9252 """
9253 return _core_.SizerItem_GetRatio(*args, **kwargs)
9254
9255 def GetRect(*args, **kwargs):
9256 """
9257 GetRect(self) -> Rect
9258
9259 Returns the rectangle that the sizer item should occupy
9260 """
9261 return _core_.SizerItem_GetRect(*args, **kwargs)
9262
9263 def IsWindow(*args, **kwargs):
9264 """
9265 IsWindow(self) -> bool
9266
9267 Is this sizer item a window?
9268 """
9269 return _core_.SizerItem_IsWindow(*args, **kwargs)
9270
9271 def IsSizer(*args, **kwargs):
9272 """
9273 IsSizer(self) -> bool
9274
9275 Is this sizer item a subsizer?
9276 """
9277 return _core_.SizerItem_IsSizer(*args, **kwargs)
9278
9279 def IsSpacer(*args, **kwargs):
9280 """
9281 IsSpacer(self) -> bool
9282
9283 Is this sizer item a spacer?
9284 """
9285 return _core_.SizerItem_IsSpacer(*args, **kwargs)
9286
9287 def SetProportion(*args, **kwargs):
9288 """
9289 SetProportion(self, int proportion)
9290
9291 Set the proportion value for this item.
9292 """
9293 return _core_.SizerItem_SetProportion(*args, **kwargs)
9294
9295 def GetProportion(*args, **kwargs):
9296 """
9297 GetProportion(self) -> int
9298
9299 Get the proportion value for this item.
9300 """
9301 return _core_.SizerItem_GetProportion(*args, **kwargs)
9302
9303 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9304 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
9305 def SetFlag(*args, **kwargs):
9306 """
9307 SetFlag(self, int flag)
9308
9309 Set the flag value for this item.
9310 """
9311 return _core_.SizerItem_SetFlag(*args, **kwargs)
9312
9313 def GetFlag(*args, **kwargs):
9314 """
9315 GetFlag(self) -> int
9316
9317 Get the flag value for this item.
9318 """
9319 return _core_.SizerItem_GetFlag(*args, **kwargs)
9320
9321 def SetBorder(*args, **kwargs):
9322 """
9323 SetBorder(self, int border)
9324
9325 Set the border value for this item.
9326 """
9327 return _core_.SizerItem_SetBorder(*args, **kwargs)
9328
9329 def GetBorder(*args, **kwargs):
9330 """
9331 GetBorder(self) -> int
9332
9333 Get the border value for this item.
9334 """
9335 return _core_.SizerItem_GetBorder(*args, **kwargs)
9336
9337 def GetWindow(*args, **kwargs):
9338 """
9339 GetWindow(self) -> Window
9340
9341 Get the window (if any) that is managed by this sizer item.
9342 """
9343 return _core_.SizerItem_GetWindow(*args, **kwargs)
9344
9345 def SetWindow(*args, **kwargs):
9346 """
9347 SetWindow(self, Window window)
9348
9349 Set the window to be managed by this sizer item.
9350 """
9351 return _core_.SizerItem_SetWindow(*args, **kwargs)
9352
9353 def GetSizer(*args, **kwargs):
9354 """
9355 GetSizer(self) -> Sizer
9356
9357 Get the subsizer (if any) that is managed by this sizer item.
9358 """
9359 return _core_.SizerItem_GetSizer(*args, **kwargs)
9360
9361 def SetSizer(*args, **kwargs):
9362 """
9363 SetSizer(self, Sizer sizer)
9364
9365 Set the subsizer to be managed by this sizer item.
9366 """
9367 return _core_.SizerItem_SetSizer(*args, **kwargs)
9368
9369 def GetSpacer(*args, **kwargs):
9370 """
9371 GetSpacer(self) -> Size
9372
9373 Get the size of the spacer managed by this sizer item.
9374 """
9375 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9376
9377 def SetSpacer(*args, **kwargs):
9378 """
9379 SetSpacer(self, Size size)
9380
9381 Set the size of the spacer to be managed by this sizer item.
9382 """
9383 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9384
9385 def Show(*args, **kwargs):
9386 """
9387 Show(self, bool show)
9388
9389 Set the show item attribute, which sizers use to determine if the item
9390 is to be made part of the layout or not. If the item is tracking a
9391 window then it is shown or hidden as needed.
9392 """
9393 return _core_.SizerItem_Show(*args, **kwargs)
9394
9395 def IsShown(*args, **kwargs):
9396 """
9397 IsShown(self) -> bool
9398
9399 Is the item to be shown in the layout?
9400 """
9401 return _core_.SizerItem_IsShown(*args, **kwargs)
9402
9403 def GetPosition(*args, **kwargs):
9404 """
9405 GetPosition(self) -> Point
9406
9407 Returns the current position of the item, as set in the last Layout.
9408 """
9409 return _core_.SizerItem_GetPosition(*args, **kwargs)
9410
9411 def GetUserData(*args, **kwargs):
9412 """
9413 GetUserData(self) -> PyObject
9414
9415 Returns the userData associated with this sizer item, or None if there
9416 isn't any.
9417 """
9418 return _core_.SizerItem_GetUserData(*args, **kwargs)
9419
9420
9421 class SizerItemPtr(SizerItem):
9422 def __init__(self, this):
9423 self.this = this
9424 if not hasattr(self,"thisown"): self.thisown = 0
9425 self.__class__ = SizerItem
9426 _core_.SizerItem_swigregister(SizerItemPtr)
9427
9428 def SizerItemWindow(*args, **kwargs):
9429 """
9430 SizerItemWindow(Window window, int proportion, int flag, int border,
9431 PyObject userData=None) -> SizerItem
9432
9433 Constructs a `wx.SizerItem` for tracking a window.
9434 """
9435 val = _core_.new_SizerItemWindow(*args, **kwargs)
9436 val.thisown = 1
9437 return val
9438
9439 def SizerItemSpacer(*args, **kwargs):
9440 """
9441 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9442 PyObject userData=None) -> SizerItem
9443
9444 Constructs a `wx.SizerItem` for tracking a spacer.
9445 """
9446 val = _core_.new_SizerItemSpacer(*args, **kwargs)
9447 val.thisown = 1
9448 return val
9449
9450 def SizerItemSizer(*args, **kwargs):
9451 """
9452 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
9453 PyObject userData=None) -> SizerItem
9454
9455 Constructs a `wx.SizerItem` for tracking a subsizer
9456 """
9457 val = _core_.new_SizerItemSizer(*args, **kwargs)
9458 val.thisown = 1
9459 return val
9460
9461 class Sizer(Object):
9462 """
9463 wx.Sizer is the abstract base class used for laying out subwindows in
9464 a window. You cannot use wx.Sizer directly; instead, you will have to
9465 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9466 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9467 and `wx.GridBagSizer`.
9468
9469 The concept implemented by sizers in wxWidgets is closely related to
9470 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9471 toolkit or the Qt toolkit. It is based upon the idea of the individual
9472 subwindows reporting their minimal required size and their ability to
9473 get stretched if the size of the parent window has changed. This will
9474 most often mean that the programmer does not set the original size of
9475 a dialog in the beginning, rather the dialog will assigned a sizer and
9476 this sizer will be queried about the recommended size. The sizer in
9477 turn will query its children, which can be normal windows or contorls,
9478 empty space or other sizers, so that a hierarchy of sizers can be
9479 constructed. Note that wxSizer does not derive from wxWindow and thus
9480 do not interfere with tab ordering and requires very little resources
9481 compared to a real window on screen.
9482
9483 What makes sizers so well fitted for use in wxWidgets is the fact that
9484 every control reports its own minimal size and the algorithm can
9485 handle differences in font sizes or different window (dialog item)
9486 sizes on different platforms without problems. If for example the
9487 standard font as well as the overall design of Mac widgets requires
9488 more space than on Windows, then the initial size of a dialog using a
9489 sizer will automatically be bigger on Mac than on Windows.
9490 """
9491 def __init__(self): raise RuntimeError, "No constructor defined"
9492 def __repr__(self):
9493 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9494 def _setOORInfo(*args, **kwargs):
9495 """_setOORInfo(self, PyObject _self)"""
9496 return _core_.Sizer__setOORInfo(*args, **kwargs)
9497
9498 def Add(*args, **kwargs):
9499 """
9500 Add(self, item, int proportion=0, int flag=0, int border=0,
9501 PyObject userData=None) -> wx.SizerItem
9502
9503 Appends a child item to the sizer.
9504 """
9505 return _core_.Sizer_Add(*args, **kwargs)
9506
9507 def Insert(*args, **kwargs):
9508 """
9509 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
9510 PyObject userData=None) -> wx.SizerItem
9511
9512 Inserts a new item into the list of items managed by this sizer before
9513 the item at index *before*. See `Add` for a description of the parameters.
9514 """
9515 return _core_.Sizer_Insert(*args, **kwargs)
9516
9517 def Prepend(*args, **kwargs):
9518 """
9519 Prepend(self, item, int proportion=0, int flag=0, int border=0,
9520 PyObject userData=None) -> wx.SizerItem
9521
9522 Adds a new item to the begining of the list of sizer items managed by
9523 this sizer. See `Add` for a description of the parameters.
9524 """
9525 return _core_.Sizer_Prepend(*args, **kwargs)
9526
9527 def Remove(*args, **kwargs):
9528 """
9529 Remove(self, item) -> bool
9530
9531 Removes an item from the sizer and destroys it. This method does not
9532 cause any layout or resizing to take place, call `Layout` to update
9533 the layout on screen after removing a child from the sizer. The
9534 *item* parameter can be either a window, a sizer, or the zero-based
9535 index of an item to remove. Returns True if the child item was found
9536 and removed.
9537 """
9538 return _core_.Sizer_Remove(*args, **kwargs)
9539
9540 def Detach(*args, **kwargs):
9541 """
9542 Detach(self, item) -> bool
9543
9544 Detaches an item from the sizer without destroying it. This method
9545 does not cause any layout or resizing to take place, call `Layout` to
9546 do so. The *item* parameter can be either a window, a sizer, or the
9547 zero-based index of the item to be detached. Returns True if the child item
9548 was found and detached.
9549 """
9550 return _core_.Sizer_Detach(*args, **kwargs)
9551
9552 def GetItem(*args, **kwargs):
9553 """
9554 GetItem(self, item) -> wx.SizerItem
9555
9556 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9557 parameter can be either a window, a sizer, or the zero-based index of
9558 the item to be detached.
9559 """
9560 return _core_.Sizer_GetItem(*args, **kwargs)
9561
9562 def _SetItemMinSize(*args, **kwargs):
9563 """_SetItemMinSize(self, PyObject item, Size size)"""
9564 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9565
9566 def SetItemMinSize(self, item, *args):
9567 """
9568 SetItemMinSize(self, item, Size size)
9569
9570 Sets the minimum size that will be allocated for an item in the sizer.
9571 The *item* parameter can be either a window, a sizer, or the
9572 zero-based index of the item. If a window or sizer is given then it
9573 will be searched for recursivly in subsizers if neccessary.
9574 """
9575 if len(args) == 2:
9576 # for backward compatibility accept separate width,height args too
9577 return self._SetItemMinSize(item, args)
9578 else:
9579 return self._SetItemMinSize(item, args[0])
9580
9581 def AddItem(*args, **kwargs):
9582 """
9583 AddItem(self, SizerItem item)
9584
9585 Adds a `wx.SizerItem` to the sizer.
9586 """
9587 return _core_.Sizer_AddItem(*args, **kwargs)
9588
9589 def InsertItem(*args, **kwargs):
9590 """
9591 InsertItem(self, int index, SizerItem item)
9592
9593 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9594 """
9595 return _core_.Sizer_InsertItem(*args, **kwargs)
9596
9597 def PrependItem(*args, **kwargs):
9598 """
9599 PrependItem(self, SizerItem item)
9600
9601 Prepends a `wx.SizerItem` to the sizer.
9602 """
9603 return _core_.Sizer_PrependItem(*args, **kwargs)
9604
9605 def AddMany(self, items):
9606 """
9607 AddMany is a convenience method for adding several items
9608 to a sizer at one time. Simply pass it a list of tuples,
9609 where each tuple consists of the parameters that you
9610 would normally pass to the `Add` method.
9611 """
9612 for item in items:
9613 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9614 item = (item, )
9615 self.Add(*item)
9616
9617 # for backwards compatibility only, please do not use in new code
9618 def AddWindow(self, *args, **kw):
9619 """Compatibility alias for `Add`."""
9620 return self.Add(*args, **kw)
9621 def AddSizer(self, *args, **kw):
9622 """Compatibility alias for `Add`."""
9623 return self.Add(*args, **kw)
9624 def AddSpacer(self, *args, **kw):
9625 """Compatibility alias for `Add`."""
9626 return self.Add(*args, **kw)
9627
9628 def PrependWindow(self, *args, **kw):
9629 """Compatibility alias for `Prepend`."""
9630 return self.Prepend(*args, **kw)
9631 def PrependSizer(self, *args, **kw):
9632 """Compatibility alias for `Prepend`."""
9633 return self.Prepend(*args, **kw)
9634 def PrependSpacer(self, *args, **kw):
9635 """Compatibility alias for `Prepend`."""
9636 return self.Prepend(*args, **kw)
9637
9638 def InsertWindow(self, *args, **kw):
9639 """Compatibility alias for `Insert`."""
9640 return self.Insert(*args, **kw)
9641 def InsertSizer(self, *args, **kw):
9642 """Compatibility alias for `Insert`."""
9643 return self.Insert(*args, **kw)
9644 def InsertSpacer(self, *args, **kw):
9645 """Compatibility alias for `Insert`."""
9646 return self.Insert(*args, **kw)
9647
9648 def RemoveWindow(self, *args, **kw):
9649 """Compatibility alias for `Remove`."""
9650 return self.Remove(*args, **kw)
9651 def RemoveSizer(self, *args, **kw):
9652 """Compatibility alias for `Remove`."""
9653 return self.Remove(*args, **kw)
9654 def RemovePos(self, *args, **kw):
9655 """Compatibility alias for `Remove`."""
9656 return self.Remove(*args, **kw)
9657
9658
9659 def SetDimension(*args, **kwargs):
9660 """
9661 SetDimension(self, int x, int y, int width, int height)
9662
9663 Call this to force the sizer to take the given dimension and thus
9664 force the items owned by the sizer to resize themselves according to
9665 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9666 methods.
9667 """
9668 return _core_.Sizer_SetDimension(*args, **kwargs)
9669
9670 def SetMinSize(*args, **kwargs):
9671 """
9672 SetMinSize(self, Size size)
9673
9674 Call this to give the sizer a minimal size. Normally, the sizer will
9675 calculate its minimal size based purely on how much space its children
9676 need. After calling this method `GetMinSize` will return either the
9677 minimal size as requested by its children or the minimal size set
9678 here, depending on which is bigger.
9679 """
9680 return _core_.Sizer_SetMinSize(*args, **kwargs)
9681
9682 def GetSize(*args, **kwargs):
9683 """
9684 GetSize(self) -> Size
9685
9686 Returns the current size of the space managed by the sizer.
9687 """
9688 return _core_.Sizer_GetSize(*args, **kwargs)
9689
9690 def GetPosition(*args, **kwargs):
9691 """
9692 GetPosition(self) -> Point
9693
9694 Returns the current position of the sizer's managed space.
9695 """
9696 return _core_.Sizer_GetPosition(*args, **kwargs)
9697
9698 def GetMinSize(*args, **kwargs):
9699 """
9700 GetMinSize(self) -> Size
9701
9702 Returns the minimal size of the sizer. This is either the combined
9703 minimal size of all the children and their borders or the minimal size
9704 set by SetMinSize, depending on which is bigger.
9705 """
9706 return _core_.Sizer_GetMinSize(*args, **kwargs)
9707
9708 def GetSizeTuple(self):
9709 return self.GetSize().Get()
9710 def GetPositionTuple(self):
9711 return self.GetPosition().Get()
9712 def GetMinSizeTuple(self):
9713 return self.GetMinSize().Get()
9714
9715 def RecalcSizes(*args, **kwargs):
9716 """
9717 RecalcSizes(self)
9718
9719 Using the sizes calculated by `CalcMin` reposition and resize all the
9720 items managed by this sizer. You should not need to call this directly as
9721 it is called by `Layout`.
9722 """
9723 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9724
9725 def CalcMin(*args, **kwargs):
9726 """
9727 CalcMin(self) -> Size
9728
9729 This method is where the sizer will do the actual calculation of its
9730 children's minimal sizes. You should not need to call this directly as
9731 it is called by `Layout`.
9732 """
9733 return _core_.Sizer_CalcMin(*args, **kwargs)
9734
9735 def Layout(*args, **kwargs):
9736 """
9737 Layout(self)
9738
9739 This method will force the recalculation and layout of the items
9740 controlled by the sizer using the current space allocated to the
9741 sizer. Normally this is called automatically from the owning window's
9742 EVT_SIZE handler, but it is also useful to call it from user code when
9743 one of the items in a sizer change size, or items are added or
9744 removed.
9745 """
9746 return _core_.Sizer_Layout(*args, **kwargs)
9747
9748 def Fit(*args, **kwargs):
9749 """
9750 Fit(self, Window window) -> Size
9751
9752 Tell the sizer to resize the *window* to match the sizer's minimal
9753 size. This is commonly done in the constructor of the window itself in
9754 order to set its initial size to match the needs of the children as
9755 determined by the sizer. Returns the new size.
9756
9757 For a top level window this is the total window size, not the client size.
9758 """
9759 return _core_.Sizer_Fit(*args, **kwargs)
9760
9761 def FitInside(*args, **kwargs):
9762 """
9763 FitInside(self, Window window)
9764
9765 Tell the sizer to resize the *virtual size* of the *window* to match the
9766 sizer's minimal size. This will not alter the on screen size of the
9767 window, but may cause the addition/removal/alteration of scrollbars
9768 required to view the virtual area in windows which manage it.
9769
9770 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9771
9772 """
9773 return _core_.Sizer_FitInside(*args, **kwargs)
9774
9775 def SetSizeHints(*args, **kwargs):
9776 """
9777 SetSizeHints(self, Window window)
9778
9779 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9780 match the sizer's minimal size. This is commonly done in the
9781 constructor of the window itself if the window is resizable (as are
9782 many dialogs under Unix and frames on probably all platforms) in order
9783 to prevent the window from being sized smaller than the minimal size
9784 required by the sizer.
9785 """
9786 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9787
9788 def SetVirtualSizeHints(*args, **kwargs):
9789 """
9790 SetVirtualSizeHints(self, Window window)
9791
9792 Tell the sizer to set the minimal size of the window virtual area to
9793 match the sizer's minimal size. For windows with managed scrollbars
9794 this will set them appropriately.
9795
9796 :see: `wx.ScrolledWindow.SetScrollbars`
9797
9798 """
9799 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9800
9801 def Clear(*args, **kwargs):
9802 """
9803 Clear(self, bool deleteWindows=False)
9804
9805 Clear all items from the sizer, optionally destroying the window items
9806 as well.
9807 """
9808 return _core_.Sizer_Clear(*args, **kwargs)
9809
9810 def DeleteWindows(*args, **kwargs):
9811 """
9812 DeleteWindows(self)
9813
9814 Destroy all windows managed by the sizer.
9815 """
9816 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9817
9818 def GetChildren(*args, **kwargs):
9819 """
9820 GetChildren(self) -> list
9821
9822 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9823 """
9824 return _core_.Sizer_GetChildren(*args, **kwargs)
9825
9826 def Show(*args, **kwargs):
9827 """
9828 Show(self, item, bool show=True, bool recursive=false) -> bool
9829
9830 Shows or hides an item managed by the sizer. To make a sizer item
9831 disappear or reappear, use Show followed by `Layout`. The *item*
9832 parameter can be either a window, a sizer, or the zero-based index of
9833 the item. Use the recursive parameter to show or hide an item in a
9834 subsizer. Returns True if the item was found.
9835 """
9836 return _core_.Sizer_Show(*args, **kwargs)
9837
9838 def IsShown(*args, **kwargs):
9839 """
9840 IsShown(self, item)
9841
9842 Determines if the item is currently shown. sizer. To make a sizer
9843 item disappear or reappear, use Show followed by `Layout`. The *item*
9844 parameter can be either a window, a sizer, or the zero-based index of
9845 the item.
9846 """
9847 return _core_.Sizer_IsShown(*args, **kwargs)
9848
9849 def Hide(self, item, recursive=False):
9850 """
9851 A convenience method for Show(item, False, recursive).
9852 """
9853 return self.Show(item, False, recursive)
9854
9855 def ShowItems(*args, **kwargs):
9856 """
9857 ShowItems(self, bool show)
9858
9859 Recursively call `wx.SizerItem.Show` on all sizer items.
9860 """
9861 return _core_.Sizer_ShowItems(*args, **kwargs)
9862
9863
9864 class SizerPtr(Sizer):
9865 def __init__(self, this):
9866 self.this = this
9867 if not hasattr(self,"thisown"): self.thisown = 0
9868 self.__class__ = Sizer
9869 _core_.Sizer_swigregister(SizerPtr)
9870
9871 class PySizer(Sizer):
9872 """
9873 wx.PySizer is a special version of `wx.Sizer` that has been
9874 instrumented to allow the C++ virtual methods to be overloaded in
9875 Python derived classes. You would derive from this class if you are
9876 wanting to implement a custom sizer in Python code. Simply implement
9877 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9878 For example::
9879
9880 class MySizer(wx.PySizer):
9881 def __init__(self):
9882 wx.PySizer.__init__(self)
9883
9884 def CalcMin(self):
9885 for item in self.GetChildren():
9886 # calculate the total minimum width and height needed
9887 # by all items in the sizer according to this sizer's
9888 # layout algorithm.
9889 ...
9890 return wx.Size(width, height)
9891
9892 def RecalcSizes(self):
9893 # find the space allotted to this sizer
9894 pos = self.GetPosition()
9895 size = self.GetSize()
9896 for item in self.GetChildren():
9897 # Recalculate (if necessary) the position and size of
9898 # each item and then call item.SetDimension to do the
9899 # actual positioning and sizing of the items within the
9900 # space alloted to this sizer.
9901 ...
9902 item.SetDimension(itemPos, itemSize)
9903
9904
9905 When `Layout` is called it first calls `CalcMin` followed by
9906 `RecalcSizes` so you can optimize a bit by saving the results of
9907 `CalcMin` and reusing them in `RecalcSizes`.
9908
9909 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9910
9911
9912 """
9913 def __repr__(self):
9914 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9915 def __init__(self, *args, **kwargs):
9916 """
9917 __init__(self) -> PySizer
9918
9919 Creates a wx.PySizer. Must be called from the __init__ in the derived
9920 class.
9921 """
9922 newobj = _core_.new_PySizer(*args, **kwargs)
9923 self.this = newobj.this
9924 self.thisown = 1
9925 del newobj.thisown
9926 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9927
9928 def _setCallbackInfo(*args, **kwargs):
9929 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9930 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9931
9932
9933 class PySizerPtr(PySizer):
9934 def __init__(self, this):
9935 self.this = this
9936 if not hasattr(self,"thisown"): self.thisown = 0
9937 self.__class__ = PySizer
9938 _core_.PySizer_swigregister(PySizerPtr)
9939
9940 #---------------------------------------------------------------------------
9941
9942 class BoxSizer(Sizer):
9943 """
9944 The basic idea behind a box sizer is that windows will most often be
9945 laid out in rather simple basic geometry, typically in a row or a
9946 column or nested hierarchies of either. A wx.BoxSizer will lay out
9947 its items in a simple row or column, depending on the orientation
9948 parameter passed to the constructor.
9949 """
9950 def __repr__(self):
9951 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9952 def __init__(self, *args, **kwargs):
9953 """
9954 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9955
9956 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9957 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9958 sizer.
9959 """
9960 newobj = _core_.new_BoxSizer(*args, **kwargs)
9961 self.this = newobj.this
9962 self.thisown = 1
9963 del newobj.thisown
9964 self._setOORInfo(self)
9965
9966 def GetOrientation(*args, **kwargs):
9967 """
9968 GetOrientation(self) -> int
9969
9970 Returns the current orientation of the sizer.
9971 """
9972 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
9973
9974 def SetOrientation(*args, **kwargs):
9975 """
9976 SetOrientation(self, int orient)
9977
9978 Resets the orientation of the sizer.
9979 """
9980 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
9981
9982
9983 class BoxSizerPtr(BoxSizer):
9984 def __init__(self, this):
9985 self.this = this
9986 if not hasattr(self,"thisown"): self.thisown = 0
9987 self.__class__ = BoxSizer
9988 _core_.BoxSizer_swigregister(BoxSizerPtr)
9989
9990 #---------------------------------------------------------------------------
9991
9992 class StaticBoxSizer(BoxSizer):
9993 """
9994 wx.StaticBoxSizer derives from and functions identically to the
9995 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9996 manages. Note that this static box must be created separately and
9997 passed to the sizer constructor.
9998 """
9999 def __repr__(self):
10000 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10001 def __init__(self, *args, **kwargs):
10002 """
10003 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
10004
10005 Constructor. It takes an associated static box and the orientation
10006 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10007 ``wx.HORIZONTAL``.
10008 """
10009 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
10010 self.this = newobj.this
10011 self.thisown = 1
10012 del newobj.thisown
10013 self._setOORInfo(self)
10014
10015 def GetStaticBox(*args, **kwargs):
10016 """
10017 GetStaticBox(self) -> StaticBox
10018
10019 Returns the static box associated with this sizer.
10020 """
10021 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
10022
10023
10024 class StaticBoxSizerPtr(StaticBoxSizer):
10025 def __init__(self, this):
10026 self.this = this
10027 if not hasattr(self,"thisown"): self.thisown = 0
10028 self.__class__ = StaticBoxSizer
10029 _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
10030
10031 #---------------------------------------------------------------------------
10032
10033 class GridSizer(Sizer):
10034 """
10035 A grid sizer is a sizer which lays out its children in a
10036 two-dimensional table with all cells having the same size. In other
10037 words, the width of each cell within the grid is the width of the
10038 widest item added to the sizer and the height of each grid cell is the
10039 height of the tallest item. An optional vertical and/or horizontal
10040 gap between items can also be specified (in pixels.)
10041
10042 Items are placed in the cells of the grid in the order they are added,
10043 in row-major order. In other words, the first row is filled first,
10044 then the second, and so on until all items have been added. (If
10045 neccessary, additional rows will be added as items are added.) If you
10046 need to have greater control over the cells that items are placed in
10047 then use the `wx.GridBagSizer`.
10048
10049 """
10050 def __repr__(self):
10051 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10052 def __init__(self, *args, **kwargs):
10053 """
10054 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
10055
10056 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10057 of columns and rows in the sizer - if either of the parameters is
10058 zero, it will be calculated to from the total number of children in
10059 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10060 define extra space between all children.
10061 """
10062 newobj = _core_.new_GridSizer(*args, **kwargs)
10063 self.this = newobj.this
10064 self.thisown = 1
10065 del newobj.thisown
10066 self._setOORInfo(self)
10067
10068 def SetCols(*args, **kwargs):
10069 """
10070 SetCols(self, int cols)
10071
10072 Sets the number of columns in the sizer.
10073 """
10074 return _core_.GridSizer_SetCols(*args, **kwargs)
10075
10076 def SetRows(*args, **kwargs):
10077 """
10078 SetRows(self, int rows)
10079
10080 Sets the number of rows in the sizer.
10081 """
10082 return _core_.GridSizer_SetRows(*args, **kwargs)
10083
10084 def SetVGap(*args, **kwargs):
10085 """
10086 SetVGap(self, int gap)
10087
10088 Sets the vertical gap (in pixels) between the cells in the sizer.
10089 """
10090 return _core_.GridSizer_SetVGap(*args, **kwargs)
10091
10092 def SetHGap(*args, **kwargs):
10093 """
10094 SetHGap(self, int gap)
10095
10096 Sets the horizontal gap (in pixels) between cells in the sizer
10097 """
10098 return _core_.GridSizer_SetHGap(*args, **kwargs)
10099
10100 def GetCols(*args, **kwargs):
10101 """
10102 GetCols(self) -> int
10103
10104 Returns the number of columns in the sizer.
10105 """
10106 return _core_.GridSizer_GetCols(*args, **kwargs)
10107
10108 def GetRows(*args, **kwargs):
10109 """
10110 GetRows(self) -> int
10111
10112 Returns the number of rows in the sizer.
10113 """
10114 return _core_.GridSizer_GetRows(*args, **kwargs)
10115
10116 def GetVGap(*args, **kwargs):
10117 """
10118 GetVGap(self) -> int
10119
10120 Returns the vertical gap (in pixels) between the cells in the sizer.
10121 """
10122 return _core_.GridSizer_GetVGap(*args, **kwargs)
10123
10124 def GetHGap(*args, **kwargs):
10125 """
10126 GetHGap(self) -> int
10127
10128 Returns the horizontal gap (in pixels) between cells in the sizer.
10129 """
10130 return _core_.GridSizer_GetHGap(*args, **kwargs)
10131
10132
10133 class GridSizerPtr(GridSizer):
10134 def __init__(self, this):
10135 self.this = this
10136 if not hasattr(self,"thisown"): self.thisown = 0
10137 self.__class__ = GridSizer
10138 _core_.GridSizer_swigregister(GridSizerPtr)
10139
10140 #---------------------------------------------------------------------------
10141
10142 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
10143 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
10144 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
10145 class FlexGridSizer(GridSizer):
10146 """
10147 A flex grid sizer is a sizer which lays out its children in a
10148 two-dimensional table with all table cells in one row having the same
10149 height and all cells in one column having the same width, but all
10150 rows or all columns are not necessarily the same height or width as in
10151 the `wx.GridSizer`.
10152
10153 wx.FlexGridSizer can also size items equally in one direction but
10154 unequally ("flexibly") in the other. If the sizer is only flexible
10155 in one direction (this can be changed using `SetFlexibleDirection`), it
10156 needs to be decided how the sizer should grow in the other ("non
10157 flexible") direction in order to fill the available space. The
10158 `SetNonFlexibleGrowMode` method serves this purpose.
10159
10160
10161 """
10162 def __repr__(self):
10163 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10164 def __init__(self, *args, **kwargs):
10165 """
10166 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
10167
10168 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
10169 number of columns and rows in the sizer - if either of the parameters
10170 is zero, it will be calculated to from the total number of children in
10171 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10172 define extra space between all children.
10173 """
10174 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
10175 self.this = newobj.this
10176 self.thisown = 1
10177 del newobj.thisown
10178 self._setOORInfo(self)
10179
10180 def AddGrowableRow(*args, **kwargs):
10181 """
10182 AddGrowableRow(self, size_t idx, int proportion=0)
10183
10184 Specifies that row *idx* (starting from zero) should be grown if there
10185 is extra space available to the sizer.
10186
10187 The *proportion* parameter has the same meaning as the stretch factor
10188 for the box sizers except that if all proportions are 0, then all
10189 columns are resized equally (instead of not being resized at all).
10190 """
10191 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
10192
10193 def RemoveGrowableRow(*args, **kwargs):
10194 """
10195 RemoveGrowableRow(self, size_t idx)
10196
10197 Specifies that row *idx* is no longer growable.
10198 """
10199 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
10200
10201 def AddGrowableCol(*args, **kwargs):
10202 """
10203 AddGrowableCol(self, size_t idx, int proportion=0)
10204
10205 Specifies that column *idx* (starting from zero) should be grown if
10206 there is extra space available to the sizer.
10207
10208 The *proportion* parameter has the same meaning as the stretch factor
10209 for the box sizers except that if all proportions are 0, then all
10210 columns are resized equally (instead of not being resized at all).
10211 """
10212 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
10213
10214 def RemoveGrowableCol(*args, **kwargs):
10215 """
10216 RemoveGrowableCol(self, size_t idx)
10217
10218 Specifies that column *idx* is no longer growable.
10219 """
10220 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
10221
10222 def SetFlexibleDirection(*args, **kwargs):
10223 """
10224 SetFlexibleDirection(self, int direction)
10225
10226 Specifies whether the sizer should flexibly resize its columns, rows,
10227 or both. Argument *direction* can be one of the following values. Any
10228 other value is ignored.
10229
10230 ============== =======================================
10231 wx.VERTICAL Rows are flexibly sized.
10232 wx.HORIZONTAL Columns are flexibly sized.
10233 wx.BOTH Both rows and columns are flexibly sized
10234 (this is the default value).
10235 ============== =======================================
10236
10237 Note that this method does not trigger relayout.
10238
10239 """
10240 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
10241
10242 def GetFlexibleDirection(*args, **kwargs):
10243 """
10244 GetFlexibleDirection(self) -> int
10245
10246 Returns a value that specifies whether the sizer
10247 flexibly resizes its columns, rows, or both (default).
10248
10249 :see: `SetFlexibleDirection`
10250 """
10251 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
10252
10253 def SetNonFlexibleGrowMode(*args, **kwargs):
10254 """
10255 SetNonFlexibleGrowMode(self, int mode)
10256
10257 Specifies how the sizer should grow in the non-flexible direction if
10258 there is one (so `SetFlexibleDirection` must have been called
10259 previously). Argument *mode* can be one of the following values:
10260
10261 ========================== =================================================
10262 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10263 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10264 `AddGrowableCol` and `AddGrowableRow`. In this
10265 case equal sizing applies to minimum sizes of
10266 columns or rows (this is the default value).
10267 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10268 the non flexible direction, whether they are
10269 growable or not in the flexbile direction.
10270 ========================== =================================================
10271
10272 Note that this method does not trigger relayout.
10273
10274
10275 """
10276 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
10277
10278 def GetNonFlexibleGrowMode(*args, **kwargs):
10279 """
10280 GetNonFlexibleGrowMode(self) -> int
10281
10282 Returns the value that specifies how the sizer grows in the
10283 non-flexible direction if there is one.
10284
10285 :see: `SetNonFlexibleGrowMode`
10286 """
10287 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
10288
10289 def GetRowHeights(*args, **kwargs):
10290 """
10291 GetRowHeights(self) -> list
10292
10293 Returns a list of integers representing the heights of each of the
10294 rows in the sizer.
10295 """
10296 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
10297
10298 def GetColWidths(*args, **kwargs):
10299 """
10300 GetColWidths(self) -> list
10301
10302 Returns a list of integers representing the widths of each of the
10303 columns in the sizer.
10304 """
10305 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
10306
10307
10308 class FlexGridSizerPtr(FlexGridSizer):
10309 def __init__(self, this):
10310 self.this = this
10311 if not hasattr(self,"thisown"): self.thisown = 0
10312 self.__class__ = FlexGridSizer
10313 _core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
10314
10315 class StdDialogButtonSizer(BoxSizer):
10316 """
10317 A special sizer that knows how to order and position standard buttons
10318 in order to conform to the current platform's standards. You simply
10319 need to add each `wx.Button` to the sizer, and be sure to create the
10320 buttons using the standard ID's. Then call `Realize` and the sizer
10321 will take care of the rest.
10322
10323 """
10324 def __repr__(self):
10325 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10326 def __init__(self, *args, **kwargs):
10327 """__init__(self) -> StdDialogButtonSizer"""
10328 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
10329 self.this = newobj.this
10330 self.thisown = 1
10331 del newobj.thisown
10332 def AddButton(*args, **kwargs):
10333 """
10334 AddButton(self, wxButton button)
10335
10336 Use this to add the buttons to this sizer. Do not use the `Add`
10337 method in the base class.
10338 """
10339 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
10340
10341 def Realize(*args, **kwargs):
10342 """
10343 Realize(self)
10344
10345 This funciton needs to be called after all the buttons have been added
10346 to the sizer. It will reorder them and position them in a platform
10347 specifc manner.
10348 """
10349 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
10350
10351 def SetAffirmativeButton(*args, **kwargs):
10352 """SetAffirmativeButton(self, wxButton button)"""
10353 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
10354
10355 def SetNegativeButton(*args, **kwargs):
10356 """SetNegativeButton(self, wxButton button)"""
10357 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
10358
10359 def SetCancelButton(*args, **kwargs):
10360 """SetCancelButton(self, wxButton button)"""
10361 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
10362
10363 def GetAffirmativeButton(*args, **kwargs):
10364 """GetAffirmativeButton(self) -> wxButton"""
10365 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
10366
10367 def GetApplyButton(*args, **kwargs):
10368 """GetApplyButton(self) -> wxButton"""
10369 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
10370
10371 def GetNegativeButton(*args, **kwargs):
10372 """GetNegativeButton(self) -> wxButton"""
10373 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
10374
10375 def GetCancelButton(*args, **kwargs):
10376 """GetCancelButton(self) -> wxButton"""
10377 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
10378
10379 def GetHelpButton(*args, **kwargs):
10380 """GetHelpButton(self) -> wxButton"""
10381 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
10382
10383
10384 class StdDialogButtonSizerPtr(StdDialogButtonSizer):
10385 def __init__(self, this):
10386 self.this = this
10387 if not hasattr(self,"thisown"): self.thisown = 0
10388 self.__class__ = StdDialogButtonSizer
10389 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
10390
10391 #---------------------------------------------------------------------------
10392
10393 class GBPosition(object):
10394 """
10395 This class represents the position of an item in a virtual grid of
10396 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10397 typemaps that will automatically convert from a 2-element sequence of
10398 integers to a wx.GBPosition, so you can use the more pythonic
10399 representation of the position nearly transparently in Python code.
10400 """
10401 def __repr__(self):
10402 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10403 def __init__(self, *args, **kwargs):
10404 """
10405 __init__(self, int row=0, int col=0) -> GBPosition
10406
10407 This class represents the position of an item in a virtual grid of
10408 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10409 typemaps that will automatically convert from a 2-element sequence of
10410 integers to a wx.GBPosition, so you can use the more pythonic
10411 representation of the position nearly transparently in Python code.
10412 """
10413 newobj = _core_.new_GBPosition(*args, **kwargs)
10414 self.this = newobj.this
10415 self.thisown = 1
10416 del newobj.thisown
10417 def GetRow(*args, **kwargs):
10418 """GetRow(self) -> int"""
10419 return _core_.GBPosition_GetRow(*args, **kwargs)
10420
10421 def GetCol(*args, **kwargs):
10422 """GetCol(self) -> int"""
10423 return _core_.GBPosition_GetCol(*args, **kwargs)
10424
10425 def SetRow(*args, **kwargs):
10426 """SetRow(self, int row)"""
10427 return _core_.GBPosition_SetRow(*args, **kwargs)
10428
10429 def SetCol(*args, **kwargs):
10430 """SetCol(self, int col)"""
10431 return _core_.GBPosition_SetCol(*args, **kwargs)
10432
10433 def __eq__(*args, **kwargs):
10434 """__eq__(self, GBPosition other) -> bool"""
10435 return _core_.GBPosition___eq__(*args, **kwargs)
10436
10437 def __ne__(*args, **kwargs):
10438 """__ne__(self, GBPosition other) -> bool"""
10439 return _core_.GBPosition___ne__(*args, **kwargs)
10440
10441 def Set(*args, **kwargs):
10442 """Set(self, int row=0, int col=0)"""
10443 return _core_.GBPosition_Set(*args, **kwargs)
10444
10445 def Get(*args, **kwargs):
10446 """Get(self) -> PyObject"""
10447 return _core_.GBPosition_Get(*args, **kwargs)
10448
10449 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10450 def __str__(self): return str(self.Get())
10451 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10452 def __len__(self): return len(self.Get())
10453 def __getitem__(self, index): return self.Get()[index]
10454 def __setitem__(self, index, val):
10455 if index == 0: self.SetRow(val)
10456 elif index == 1: self.SetCol(val)
10457 else: raise IndexError
10458 def __nonzero__(self): return self.Get() != (0,0)
10459 __safe_for_unpickling__ = True
10460 def __reduce__(self): return (wx.GBPosition, self.Get())
10461
10462 row = property(GetRow, SetRow)
10463 col = property(GetCol, SetCol)
10464
10465
10466 class GBPositionPtr(GBPosition):
10467 def __init__(self, this):
10468 self.this = this
10469 if not hasattr(self,"thisown"): self.thisown = 0
10470 self.__class__ = GBPosition
10471 _core_.GBPosition_swigregister(GBPositionPtr)
10472
10473 class GBSpan(object):
10474 """
10475 This class is used to hold the row and column spanning attributes of
10476 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10477 automatically convert from a 2-element sequence of integers to a
10478 wx.GBSpan, so you can use the more pythonic representation of the span
10479 nearly transparently in Python code.
10480
10481 """
10482 def __repr__(self):
10483 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10484 def __init__(self, *args, **kwargs):
10485 """
10486 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10487
10488 Construct a new wxGBSpan, optionally setting the rowspan and
10489 colspan. The default is (1,1). (Meaning that the item occupies one
10490 cell in each direction.
10491 """
10492 newobj = _core_.new_GBSpan(*args, **kwargs)
10493 self.this = newobj.this
10494 self.thisown = 1
10495 del newobj.thisown
10496 def GetRowspan(*args, **kwargs):
10497 """GetRowspan(self) -> int"""
10498 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10499
10500 def GetColspan(*args, **kwargs):
10501 """GetColspan(self) -> int"""
10502 return _core_.GBSpan_GetColspan(*args, **kwargs)
10503
10504 def SetRowspan(*args, **kwargs):
10505 """SetRowspan(self, int rowspan)"""
10506 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10507
10508 def SetColspan(*args, **kwargs):
10509 """SetColspan(self, int colspan)"""
10510 return _core_.GBSpan_SetColspan(*args, **kwargs)
10511
10512 def __eq__(*args, **kwargs):
10513 """__eq__(self, GBSpan other) -> bool"""
10514 return _core_.GBSpan___eq__(*args, **kwargs)
10515
10516 def __ne__(*args, **kwargs):
10517 """__ne__(self, GBSpan other) -> bool"""
10518 return _core_.GBSpan___ne__(*args, **kwargs)
10519
10520 def Set(*args, **kwargs):
10521 """Set(self, int rowspan=1, int colspan=1)"""
10522 return _core_.GBSpan_Set(*args, **kwargs)
10523
10524 def Get(*args, **kwargs):
10525 """Get(self) -> PyObject"""
10526 return _core_.GBSpan_Get(*args, **kwargs)
10527
10528 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10529 def __str__(self): return str(self.Get())
10530 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10531 def __len__(self): return len(self.Get())
10532 def __getitem__(self, index): return self.Get()[index]
10533 def __setitem__(self, index, val):
10534 if index == 0: self.SetRowspan(val)
10535 elif index == 1: self.SetColspan(val)
10536 else: raise IndexError
10537 def __nonzero__(self): return self.Get() != (0,0)
10538 __safe_for_unpickling__ = True
10539 def __reduce__(self): return (wx.GBSpan, self.Get())
10540
10541 rowspan = property(GetRowspan, SetRowspan)
10542 colspan = property(GetColspan, SetColspan)
10543
10544
10545 class GBSpanPtr(GBSpan):
10546 def __init__(self, this):
10547 self.this = this
10548 if not hasattr(self,"thisown"): self.thisown = 0
10549 self.__class__ = GBSpan
10550 _core_.GBSpan_swigregister(GBSpanPtr)
10551
10552 class GBSizerItem(SizerItem):
10553 """
10554 The wx.GBSizerItem class is used to track the additional data about
10555 items in a `wx.GridBagSizer` such as the item's position in the grid
10556 and how many rows or columns it spans.
10557
10558 """
10559 def __repr__(self):
10560 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10561 def __init__(self, *args, **kwargs):
10562 """
10563 __init__(self) -> GBSizerItem
10564
10565 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10566 size will need to be set, as well as a position and span before this
10567 item can be used in a Sizer.
10568
10569 You will probably never need to create a wx.GBSizerItem directly as they
10570 are created automatically when the sizer's Add method is called.
10571 """
10572 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10573 self.this = newobj.this
10574 self.thisown = 1
10575 del newobj.thisown
10576 def GetPos(*args, **kwargs):
10577 """
10578 GetPos(self) -> GBPosition
10579
10580 Get the grid position of the item
10581 """
10582 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10583
10584 def GetPosTuple(self): return self.GetPos().Get()
10585 def GetSpan(*args, **kwargs):
10586 """
10587 GetSpan(self) -> GBSpan
10588
10589 Get the row and column spanning of the item
10590 """
10591 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10592
10593 def GetSpanTuple(self): return self.GetSpan().Get()
10594 def SetPos(*args, **kwargs):
10595 """
10596 SetPos(self, GBPosition pos) -> bool
10597
10598 If the item is already a member of a sizer then first ensure that
10599 there is no other item that would intersect with this one at the new
10600 position, then set the new position. Returns True if the change is
10601 successful and after the next Layout() the item will be moved.
10602 """
10603 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10604
10605 def SetSpan(*args, **kwargs):
10606 """
10607 SetSpan(self, GBSpan span) -> bool
10608
10609 If the item is already a member of a sizer then first ensure that
10610 there is no other item that would intersect with this one with its new
10611 spanning size, then set the new spanning. Returns True if the change
10612 is successful and after the next Layout() the item will be resized.
10613
10614 """
10615 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10616
10617 def Intersects(*args, **kwargs):
10618 """
10619 Intersects(self, GBSizerItem other) -> bool
10620
10621 Returns True if this item and the other item instersect.
10622 """
10623 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10624
10625 def IntersectsPos(*args, **kwargs):
10626 """
10627 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10628
10629 Returns True if the given pos/span would intersect with this item.
10630 """
10631 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
10632
10633 def GetEndPos(*args, **kwargs):
10634 """
10635 GetEndPos(self) -> GBPosition
10636
10637 Get the row and column of the endpoint of this item.
10638 """
10639 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10640
10641 def GetGBSizer(*args, **kwargs):
10642 """
10643 GetGBSizer(self) -> GridBagSizer
10644
10645 Get the sizer this item is a member of.
10646 """
10647 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10648
10649 def SetGBSizer(*args, **kwargs):
10650 """
10651 SetGBSizer(self, GridBagSizer sizer)
10652
10653 Set the sizer this item is a member of.
10654 """
10655 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10656
10657
10658 class GBSizerItemPtr(GBSizerItem):
10659 def __init__(self, this):
10660 self.this = this
10661 if not hasattr(self,"thisown"): self.thisown = 0
10662 self.__class__ = GBSizerItem
10663 _core_.GBSizerItem_swigregister(GBSizerItemPtr)
10664 DefaultSpan = cvar.DefaultSpan
10665
10666 def GBSizerItemWindow(*args, **kwargs):
10667 """
10668 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
10669 int border, PyObject userData=None) -> GBSizerItem
10670
10671 Construct a `wx.GBSizerItem` for a window.
10672 """
10673 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10674 val.thisown = 1
10675 return val
10676
10677 def GBSizerItemSizer(*args, **kwargs):
10678 """
10679 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
10680 int border, PyObject userData=None) -> GBSizerItem
10681
10682 Construct a `wx.GBSizerItem` for a sizer
10683 """
10684 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10685 val.thisown = 1
10686 return val
10687
10688 def GBSizerItemSpacer(*args, **kwargs):
10689 """
10690 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
10691 int flag, int border, PyObject userData=None) -> GBSizerItem
10692
10693 Construct a `wx.GBSizerItem` for a spacer.
10694 """
10695 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10696 val.thisown = 1
10697 return val
10698
10699 class GridBagSizer(FlexGridSizer):
10700 """
10701 A `wx.Sizer` that can lay out items in a virtual grid like a
10702 `wx.FlexGridSizer` but in this case explicit positioning of the items
10703 is allowed using `wx.GBPosition`, and items can optionally span more
10704 than one row and/or column using `wx.GBSpan`. The total size of the
10705 virtual grid is determined by the largest row and column that items are
10706 positioned at, adjusted for spanning.
10707
10708 """
10709 def __repr__(self):
10710 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10711 def __init__(self, *args, **kwargs):
10712 """
10713 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10714
10715 Constructor, with optional parameters to specify the gap between the
10716 rows and columns.
10717 """
10718 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10719 self.this = newobj.this
10720 self.thisown = 1
10721 del newobj.thisown
10722 self._setOORInfo(self)
10723
10724 def Add(*args, **kwargs):
10725 """
10726 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
10727 int border=0, userData=None) -> wx.GBSizerItem
10728
10729 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10730 more than one row or column as specified with *span*. The remaining
10731 args behave similarly to `wx.Sizer.Add`.
10732
10733 Returns True if the item was successfully placed at the given cell
10734 position, False if something was already there.
10735
10736 """
10737 return _core_.GridBagSizer_Add(*args, **kwargs)
10738
10739 def AddItem(*args, **kwargs):
10740 """
10741 Add(self, GBSizerItem item) -> wx.GBSizerItem
10742
10743 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10744 the item was successfully placed at its given cell position, False if
10745 something was already there.
10746 """
10747 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10748
10749 def GetCellSize(*args, **kwargs):
10750 """
10751 GetCellSize(self, int row, int col) -> Size
10752
10753 Get the size of the specified cell, including hgap and
10754 vgap. Only valid after a Layout.
10755 """
10756 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10757
10758 def GetEmptyCellSize(*args, **kwargs):
10759 """
10760 GetEmptyCellSize(self) -> Size
10761
10762 Get the size used for cells in the grid with no item.
10763 """
10764 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10765
10766 def SetEmptyCellSize(*args, **kwargs):
10767 """
10768 SetEmptyCellSize(self, Size sz)
10769
10770 Set the size used for cells in the grid with no item.
10771 """
10772 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10773
10774 def GetItemPosition(*args):
10775 """
10776 GetItemPosition(self, item) -> GBPosition
10777
10778 Get the grid position of the specified *item* where *item* is either a
10779 window or subsizer that is a member of this sizer, or a zero-based
10780 index of an item.
10781 """
10782 return _core_.GridBagSizer_GetItemPosition(*args)
10783
10784 def SetItemPosition(*args):
10785 """
10786 SetItemPosition(self, item, GBPosition pos) -> bool
10787
10788 Set the grid position of the specified *item* where *item* is either a
10789 window or subsizer that is a member of this sizer, or a zero-based
10790 index of an item. Returns True on success. If the move is not
10791 allowed (because an item is already there) then False is returned.
10792
10793 """
10794 return _core_.GridBagSizer_SetItemPosition(*args)
10795
10796 def GetItemSpan(*args):
10797 """
10798 GetItemSpan(self, item) -> GBSpan
10799
10800 Get the row/col spanning of the specified *item* where *item* is
10801 either a window or subsizer that is a member of this sizer, or a
10802 zero-based index of an item.
10803 """
10804 return _core_.GridBagSizer_GetItemSpan(*args)
10805
10806 def SetItemSpan(*args):
10807 """
10808 SetItemSpan(self, item, GBSpan span) -> bool
10809
10810 Set the row/col spanning of the specified *item* where *item* is
10811 either a window or subsizer that is a member of this sizer, or a
10812 zero-based index of an item. Returns True on success. If the move is
10813 not allowed (because an item is already there) then False is returned.
10814 """
10815 return _core_.GridBagSizer_SetItemSpan(*args)
10816
10817 def FindItem(*args):
10818 """
10819 FindItem(self, item) -> GBSizerItem
10820
10821 Find the sizer item for the given window or subsizer, returns None if
10822 not found. (non-recursive)
10823 """
10824 return _core_.GridBagSizer_FindItem(*args)
10825
10826 def FindItemAtPosition(*args, **kwargs):
10827 """
10828 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10829
10830 Return the sizer item for the given grid cell, or None if there is no
10831 item at that position. (non-recursive)
10832 """
10833 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10834
10835 def FindItemAtPoint(*args, **kwargs):
10836 """
10837 FindItemAtPoint(self, Point pt) -> GBSizerItem
10838
10839 Return the sizer item located at the point given in *pt*, or None if
10840 there is no item at that point. The (x,y) coordinates in pt correspond
10841 to the client coordinates of the window using the sizer for
10842 layout. (non-recursive)
10843 """
10844 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10845
10846 def CheckForIntersection(*args, **kwargs):
10847 """
10848 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
10849
10850 Look at all items and see if any intersect (or would overlap) the
10851 given *item*. Returns True if so, False if there would be no overlap.
10852 If an *excludeItem* is given then it will not be checked for
10853 intersection, for example it may be the item we are checking the
10854 position of.
10855
10856 """
10857 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
10858
10859 def CheckForIntersectionPos(*args, **kwargs):
10860 """
10861 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10862
10863 Look at all items and see if any intersect (or would overlap) the
10864 given position and span. Returns True if so, False if there would be
10865 no overlap. If an *excludeItem* is given then it will not be checked
10866 for intersection, for example it may be the item we are checking the
10867 position of.
10868 """
10869 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
10870
10871
10872 class GridBagSizerPtr(GridBagSizer):
10873 def __init__(self, this):
10874 self.this = this
10875 if not hasattr(self,"thisown"): self.thisown = 0
10876 self.__class__ = GridBagSizer
10877 _core_.GridBagSizer_swigregister(GridBagSizerPtr)
10878
10879 #---------------------------------------------------------------------------
10880
10881 Left = _core_.Left
10882 Top = _core_.Top
10883 Right = _core_.Right
10884 Bottom = _core_.Bottom
10885 Width = _core_.Width
10886 Height = _core_.Height
10887 Centre = _core_.Centre
10888 Center = _core_.Center
10889 CentreX = _core_.CentreX
10890 CentreY = _core_.CentreY
10891 Unconstrained = _core_.Unconstrained
10892 AsIs = _core_.AsIs
10893 PercentOf = _core_.PercentOf
10894 Above = _core_.Above
10895 Below = _core_.Below
10896 LeftOf = _core_.LeftOf
10897 RightOf = _core_.RightOf
10898 SameAs = _core_.SameAs
10899 Absolute = _core_.Absolute
10900 class IndividualLayoutConstraint(Object):
10901 """
10902 Objects of this class are stored in the `wx.LayoutConstraints` class as
10903 one of eight possible constraints that a window can be involved in.
10904 You will never need to create an instance of
10905 wx.IndividualLayoutConstraint, rather you should create a
10906 `wx.LayoutConstraints` instance and use the individual contstraints
10907 that it contains.
10908 """
10909 def __init__(self): raise RuntimeError, "No constructor defined"
10910 def __repr__(self):
10911 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10912 def Set(*args, **kwargs):
10913 """
10914 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10915
10916 Sets the properties of the constraint. Normally called by one of the
10917 convenience functions such as Above, RightOf, SameAs.
10918 """
10919 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10920
10921 def LeftOf(*args, **kwargs):
10922 """
10923 LeftOf(self, Window sibling, int marg=0)
10924
10925 Constrains this edge to be to the left of the given window, with an
10926 optional margin. Implicitly, this is relative to the left edge of the
10927 other window.
10928 """
10929 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10930
10931 def RightOf(*args, **kwargs):
10932 """
10933 RightOf(self, Window sibling, int marg=0)
10934
10935 Constrains this edge to be to the right of the given window, with an
10936 optional margin. Implicitly, this is relative to the right edge of the
10937 other window.
10938 """
10939 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10940
10941 def Above(*args, **kwargs):
10942 """
10943 Above(self, Window sibling, int marg=0)
10944
10945 Constrains this edge to be above the given window, with an optional
10946 margin. Implicitly, this is relative to the top edge of the other
10947 window.
10948 """
10949 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
10950
10951 def Below(*args, **kwargs):
10952 """
10953 Below(self, Window sibling, int marg=0)
10954
10955 Constrains this edge to be below the given window, with an optional
10956 margin. Implicitly, this is relative to the bottom edge of the other
10957 window.
10958 """
10959 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
10960
10961 def SameAs(*args, **kwargs):
10962 """
10963 SameAs(self, Window otherW, int edge, int marg=0)
10964
10965 Constrains this edge or dimension to be to the same as the edge of the
10966 given window, with an optional margin.
10967 """
10968 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
10969
10970 def PercentOf(*args, **kwargs):
10971 """
10972 PercentOf(self, Window otherW, int wh, int per)
10973
10974 Constrains this edge or dimension to be to a percentage of the given
10975 window, with an optional margin.
10976 """
10977 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
10978
10979 def Absolute(*args, **kwargs):
10980 """
10981 Absolute(self, int val)
10982
10983 Constrains this edge or dimension to be the given absolute value.
10984 """
10985 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
10986
10987 def Unconstrained(*args, **kwargs):
10988 """
10989 Unconstrained(self)
10990
10991 Sets this edge or dimension to be unconstrained, that is, dependent on
10992 other edges and dimensions from which this value can be deduced.
10993 """
10994 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
10995
10996 def AsIs(*args, **kwargs):
10997 """
10998 AsIs(self)
10999
11000 Sets this edge or constraint to be whatever the window's value is at
11001 the moment. If either of the width and height constraints are *as is*,
11002 the window will not be resized, but moved instead. This is important
11003 when considering panel items which are intended to have a default
11004 size, such as a button, which may take its size from the size of the
11005 button label.
11006 """
11007 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
11008
11009 def GetOtherWindow(*args, **kwargs):
11010 """GetOtherWindow(self) -> Window"""
11011 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
11012
11013 def GetMyEdge(*args, **kwargs):
11014 """GetMyEdge(self) -> int"""
11015 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
11016
11017 def SetEdge(*args, **kwargs):
11018 """SetEdge(self, int which)"""
11019 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
11020
11021 def SetValue(*args, **kwargs):
11022 """SetValue(self, int v)"""
11023 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
11024
11025 def GetMargin(*args, **kwargs):
11026 """GetMargin(self) -> int"""
11027 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
11028
11029 def SetMargin(*args, **kwargs):
11030 """SetMargin(self, int m)"""
11031 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
11032
11033 def GetValue(*args, **kwargs):
11034 """GetValue(self) -> int"""
11035 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
11036
11037 def GetPercent(*args, **kwargs):
11038 """GetPercent(self) -> int"""
11039 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
11040
11041 def GetOtherEdge(*args, **kwargs):
11042 """GetOtherEdge(self) -> int"""
11043 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
11044
11045 def GetDone(*args, **kwargs):
11046 """GetDone(self) -> bool"""
11047 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
11048
11049 def SetDone(*args, **kwargs):
11050 """SetDone(self, bool d)"""
11051 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
11052
11053 def GetRelationship(*args, **kwargs):
11054 """GetRelationship(self) -> int"""
11055 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
11056
11057 def SetRelationship(*args, **kwargs):
11058 """SetRelationship(self, int r)"""
11059 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
11060
11061 def ResetIfWin(*args, **kwargs):
11062 """
11063 ResetIfWin(self, Window otherW) -> bool
11064
11065 Reset constraint if it mentions otherWin
11066 """
11067 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
11068
11069 def SatisfyConstraint(*args, **kwargs):
11070 """
11071 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
11072
11073 Try to satisfy constraint
11074 """
11075 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
11076
11077 def GetEdge(*args, **kwargs):
11078 """
11079 GetEdge(self, int which, Window thisWin, Window other) -> int
11080
11081 Get the value of this edge or dimension, or if this
11082 is not determinable, -1.
11083 """
11084 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
11085
11086
11087 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
11088 def __init__(self, this):
11089 self.this = this
11090 if not hasattr(self,"thisown"): self.thisown = 0
11091 self.__class__ = IndividualLayoutConstraint
11092 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
11093
11094 class LayoutConstraints(Object):
11095 """
11096 **Note:** constraints are now deprecated and you should use sizers
11097 instead.
11098
11099 Objects of this class can be associated with a window to define its
11100 layout constraints, with respect to siblings or its parent.
11101
11102 The class consists of the following eight constraints of class
11103 wx.IndividualLayoutConstraint, some or all of which should be accessed
11104 directly to set the appropriate constraints.
11105
11106 * left: represents the left hand edge of the window
11107 * right: represents the right hand edge of the window
11108 * top: represents the top edge of the window
11109 * bottom: represents the bottom edge of the window
11110 * width: represents the width of the window
11111 * height: represents the height of the window
11112 * centreX: represents the horizontal centre point of the window
11113 * centreY: represents the vertical centre point of the window
11114
11115 Most constraints are initially set to have the relationship
11116 wxUnconstrained, which means that their values should be calculated by
11117 looking at known constraints. The exceptions are width and height,
11118 which are set to wxAsIs to ensure that if the user does not specify a
11119 constraint, the existing width and height will be used, to be
11120 compatible with panel items which often have take a default size. If
11121 the constraint is ``wx.AsIs``, the dimension will not be changed.
11122
11123 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
11124
11125 """
11126 def __repr__(self):
11127 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11128 left = property(_core_.LayoutConstraints_left_get)
11129 top = property(_core_.LayoutConstraints_top_get)
11130 right = property(_core_.LayoutConstraints_right_get)
11131 bottom = property(_core_.LayoutConstraints_bottom_get)
11132 width = property(_core_.LayoutConstraints_width_get)
11133 height = property(_core_.LayoutConstraints_height_get)
11134 centreX = property(_core_.LayoutConstraints_centreX_get)
11135 centreY = property(_core_.LayoutConstraints_centreY_get)
11136 def __init__(self, *args, **kwargs):
11137 """__init__(self) -> LayoutConstraints"""
11138 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
11139 self.this = newobj.this
11140 self.thisown = 1
11141 del newobj.thisown
11142 def SatisfyConstraints(*args, **kwargs):
11143 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
11144 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
11145
11146 def AreSatisfied(*args, **kwargs):
11147 """AreSatisfied(self) -> bool"""
11148 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
11149
11150
11151 class LayoutConstraintsPtr(LayoutConstraints):
11152 def __init__(self, this):
11153 self.this = this
11154 if not hasattr(self,"thisown"): self.thisown = 0
11155 self.__class__ = LayoutConstraints
11156 _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
11157
11158 #----------------------------------------------------------------------------
11159
11160 # Use Python's bool constants if available, make some if not
11161 try:
11162 True
11163 except NameError:
11164 __builtins__.True = 1==1
11165 __builtins__.False = 1==0
11166 def bool(value): return not not value
11167 __builtins__.bool = bool
11168
11169
11170
11171 # workarounds for bad wxRTTI names
11172 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
11173 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
11174 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
11175
11176
11177 #----------------------------------------------------------------------------
11178 # Load version numbers from __version__... Ensure that major and minor
11179 # versions are the same for both wxPython and wxWidgets.
11180
11181 from __version__ import *
11182 __version__ = VERSION_STRING
11183
11184 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11185 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
11186 if RELEASE_VERSION != _core_.RELEASE_VERSION:
11187 import warnings
11188 warnings.warn("wxPython/wxWidgets release number mismatch")
11189
11190 #----------------------------------------------------------------------------
11191
11192 # Set the default string<-->unicode conversion encoding from the
11193 # locale. This encoding is used when string or unicode objects need
11194 # to be converted in order to pass them to wxWidgets. Please be aware
11195 # that the default encoding within the same locale may be slightly
11196 # different on different platforms. For example, please see
11197 # http://www.alanwood.net/demos/charsetdiffs.html for differences
11198 # between the common latin/roman encodings.
11199 import locale
11200 default = locale.getdefaultlocale()[1]
11201 if default:
11202 wx.SetDefaultPyEncoding(default)
11203 del default
11204 del locale
11205
11206 #----------------------------------------------------------------------------
11207
11208 class PyDeadObjectError(AttributeError):
11209 pass
11210
11211 class _wxPyDeadObject(object):
11212 """
11213 Instances of wx objects that are OOR capable will have their __class__
11214 changed to this class when the C++ object is deleted. This should help
11215 prevent crashes due to referencing a bogus C++ pointer.
11216 """
11217 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11218 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11219
11220 def __repr__(self):
11221 if not hasattr(self, "_name"):
11222 self._name = "[unknown]"
11223 return self.reprStr % self._name
11224
11225 def __getattr__(self, *args):
11226 if not hasattr(self, "_name"):
11227 self._name = "[unknown]"
11228 raise PyDeadObjectError(self.attrStr % self._name)
11229
11230 def __nonzero__(self):
11231 return 0
11232
11233
11234
11235 class PyUnbornObjectError(AttributeError):
11236 pass
11237
11238 class _wxPyUnbornObject(object):
11239 """
11240 Some stock objects are created when the wx._core module is
11241 imported, but their C++ instance is not created until the wx.App
11242 object is created and initialized. These object instances will
11243 temporarily have their __class__ changed to this class so an
11244 exception will be raised if they are used before the C++ instance
11245 is ready.
11246 """
11247
11248 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11249 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11250
11251 def __repr__(self):
11252 #if not hasattr(self, "_name"):
11253 # self._name = "[unknown]"
11254 return self.reprStr #% self._name
11255
11256 def __getattr__(self, *args):
11257 #if not hasattr(self, "_name"):
11258 # self._name = "[unknown]"
11259 raise PyUnbornObjectError(self.attrStr) # % self._name )
11260
11261 def __nonzero__(self):
11262 return 0
11263
11264
11265 #----------------------------------------------------------------------------
11266
11267 def CallAfter(callable, *args, **kw):
11268 """
11269 Call the specified function after the current and pending event
11270 handlers have been completed. This is also good for making GUI
11271 method calls from non-GUI threads. Any extra positional or
11272 keyword args are passed on to the callable when it is called.
11273
11274 :see: `wx.FutureCall`
11275 """
11276 app = wx.GetApp()
11277 assert app is not None, 'No wx.App created yet'
11278
11279 if not hasattr(app, "_CallAfterId"):
11280 app._CallAfterId = wx.NewEventType()
11281 app.Connect(-1, -1, app._CallAfterId,
11282 lambda event: event.callable(*event.args, **event.kw) )
11283 evt = wx.PyEvent()
11284 evt.SetEventType(app._CallAfterId)
11285 evt.callable = callable
11286 evt.args = args
11287 evt.kw = kw
11288 wx.PostEvent(app, evt)
11289
11290 #----------------------------------------------------------------------------
11291
11292
11293 class FutureCall:
11294 """
11295 A convenience class for `wx.Timer`, that calls the given callable
11296 object once after the given amount of milliseconds, passing any
11297 positional or keyword args. The return value of the callable is
11298 availbale after it has been run with the `GetResult` method.
11299
11300 If you don't need to get the return value or restart the timer
11301 then there is no need to hold a reference to this object. It will
11302 hold a reference to itself while the timer is running (the timer
11303 has a reference to self.Notify) but the cycle will be broken when
11304 the timer completes, automatically cleaning up the wx.FutureCall
11305 object.
11306
11307 :see: `wx.CallAfter`
11308 """
11309 def __init__(self, millis, callable, *args, **kwargs):
11310 self.millis = millis
11311 self.callable = callable
11312 self.SetArgs(*args, **kwargs)
11313 self.runCount = 0
11314 self.running = False
11315 self.hasRun = False
11316 self.result = None
11317 self.timer = None
11318 self.Start()
11319
11320 def __del__(self):
11321 self.Stop()
11322
11323
11324 def Start(self, millis=None, *args, **kwargs):
11325 """
11326 (Re)start the timer
11327 """
11328 self.hasRun = False
11329 if millis is not None:
11330 self.millis = millis
11331 if args or kwargs:
11332 self.SetArgs(*args, **kwargs)
11333 self.Stop()
11334 self.timer = wx.PyTimer(self.Notify)
11335 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11336 self.running = True
11337 Restart = Start
11338
11339
11340 def Stop(self):
11341 """
11342 Stop and destroy the timer.
11343 """
11344 if self.timer is not None:
11345 self.timer.Stop()
11346 self.timer = None
11347
11348
11349 def GetInterval(self):
11350 if self.timer is not None:
11351 return self.timer.GetInterval()
11352 else:
11353 return 0
11354
11355
11356 def IsRunning(self):
11357 return self.timer is not None and self.timer.IsRunning()
11358
11359
11360 def SetArgs(self, *args, **kwargs):
11361 """
11362 (Re)set the args passed to the callable object. This is
11363 useful in conjunction with Restart if you want to schedule a
11364 new call to the same callable object but with different
11365 parameters.
11366 """
11367 self.args = args
11368 self.kwargs = kwargs
11369
11370
11371 def HasRun(self):
11372 return self.hasRun
11373
11374 def GetResult(self):
11375 return self.result
11376
11377 def Notify(self):
11378 """
11379 The timer has expired so call the callable.
11380 """
11381 if self.callable and getattr(self.callable, 'im_self', True):
11382 self.runCount += 1
11383 self.running = False
11384 self.result = self.callable(*self.args, **self.kwargs)
11385 self.hasRun = True
11386 if not self.running:
11387 # if it wasn't restarted, then cleanup
11388 wx.CallAfter(self.Stop)
11389
11390
11391
11392 #----------------------------------------------------------------------------
11393 # Control which items in this module should be documented by epydoc.
11394 # We allow only classes and functions, which will help reduce the size
11395 # of the docs by filtering out the zillions of constants, EVT objects,
11396 # and etc that don't make much sense by themselves, but are instead
11397 # documented (or will be) as part of the classes/functions/methods
11398 # where they should be used.
11399
11400 class __DocFilter:
11401 """
11402 A filter for epydoc that only allows non-Ptr classes and
11403 fucntions, in order to reduce the clutter in the API docs.
11404 """
11405 def __init__(self, globals):
11406 self._globals = globals
11407
11408 def __call__(self, name):
11409 import types
11410 obj = self._globals.get(name, None)
11411 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11412 return False
11413 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11414 return False
11415 return True
11416
11417 #----------------------------------------------------------------------------
11418 #----------------------------------------------------------------------------
11419
11420 # Import other modules in this package that should show up in the
11421 # "core" wx namespace
11422 from _gdi import *
11423 from _windows import *
11424 from _controls import *
11425 from _misc import *
11426
11427
11428 # Fixup the stock objects since they can't be used yet. (They will be
11429 # restored in wx.PyApp.OnInit.)
11430 _core_._wxPyFixStockObjects()
11431
11432 #----------------------------------------------------------------------------
11433 #----------------------------------------------------------------------------
11434
11435