]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
3b0f9e84364e8cbcdf6dee3af93882aac2dabe77
[wxWidgets.git] / wxPython / src / msw / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106 RETAINED = _core_.RETAINED
107 BACKINGSTORE = _core_.BACKINGSTORE
108 COLOURED = _core_.COLOURED
109 FIXED_LENGTH = _core_.FIXED_LENGTH
110 LB_NEEDED_SB = _core_.LB_NEEDED_SB
111 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112 LB_SORT = _core_.LB_SORT
113 LB_SINGLE = _core_.LB_SINGLE
114 LB_MULTIPLE = _core_.LB_MULTIPLE
115 LB_EXTENDED = _core_.LB_EXTENDED
116 LB_OWNERDRAW = _core_.LB_OWNERDRAW
117 LB_HSCROLL = _core_.LB_HSCROLL
118 PROCESS_ENTER = _core_.PROCESS_ENTER
119 PASSWORD = _core_.PASSWORD
120 CB_SIMPLE = _core_.CB_SIMPLE
121 CB_DROPDOWN = _core_.CB_DROPDOWN
122 CB_SORT = _core_.CB_SORT
123 CB_READONLY = _core_.CB_READONLY
124 RA_HORIZONTAL = _core_.RA_HORIZONTAL
125 RA_VERTICAL = _core_.RA_VERTICAL
126 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
128 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
129 RB_GROUP = _core_.RB_GROUP
130 RB_SINGLE = _core_.RB_SINGLE
131 SB_HORIZONTAL = _core_.SB_HORIZONTAL
132 SB_VERTICAL = _core_.SB_VERTICAL
133 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
134 ST_SIZEGRIP = _core_.ST_SIZEGRIP
135 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
136 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137 ST_DOTS_END = _core_.ST_DOTS_END
138 FLOOD_SURFACE = _core_.FLOOD_SURFACE
139 FLOOD_BORDER = _core_.FLOOD_BORDER
140 ODDEVEN_RULE = _core_.ODDEVEN_RULE
141 WINDING_RULE = _core_.WINDING_RULE
142 TOOL_TOP = _core_.TOOL_TOP
143 TOOL_BOTTOM = _core_.TOOL_BOTTOM
144 TOOL_LEFT = _core_.TOOL_LEFT
145 TOOL_RIGHT = _core_.TOOL_RIGHT
146 OK = _core_.OK
147 YES_NO = _core_.YES_NO
148 CANCEL = _core_.CANCEL
149 YES = _core_.YES
150 NO = _core_.NO
151 NO_DEFAULT = _core_.NO_DEFAULT
152 YES_DEFAULT = _core_.YES_DEFAULT
153 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154 ICON_HAND = _core_.ICON_HAND
155 ICON_QUESTION = _core_.ICON_QUESTION
156 ICON_INFORMATION = _core_.ICON_INFORMATION
157 ICON_STOP = _core_.ICON_STOP
158 ICON_ASTERISK = _core_.ICON_ASTERISK
159 ICON_MASK = _core_.ICON_MASK
160 ICON_WARNING = _core_.ICON_WARNING
161 ICON_ERROR = _core_.ICON_ERROR
162 FORWARD = _core_.FORWARD
163 BACKWARD = _core_.BACKWARD
164 RESET = _core_.RESET
165 HELP = _core_.HELP
166 MORE = _core_.MORE
167 SETUP = _core_.SETUP
168 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170 SIZE_AUTO = _core_.SIZE_AUTO
171 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
173 SIZE_FORCE = _core_.SIZE_FORCE
174 PORTRAIT = _core_.PORTRAIT
175 LANDSCAPE = _core_.LANDSCAPE
176 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180 ID_ANY = _core_.ID_ANY
181 ID_SEPARATOR = _core_.ID_SEPARATOR
182 ID_NONE = _core_.ID_NONE
183 ID_LOWEST = _core_.ID_LOWEST
184 ID_OPEN = _core_.ID_OPEN
185 ID_CLOSE = _core_.ID_CLOSE
186 ID_NEW = _core_.ID_NEW
187 ID_SAVE = _core_.ID_SAVE
188 ID_SAVEAS = _core_.ID_SAVEAS
189 ID_REVERT = _core_.ID_REVERT
190 ID_EXIT = _core_.ID_EXIT
191 ID_UNDO = _core_.ID_UNDO
192 ID_REDO = _core_.ID_REDO
193 ID_HELP = _core_.ID_HELP
194 ID_PRINT = _core_.ID_PRINT
195 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196 ID_PREVIEW = _core_.ID_PREVIEW
197 ID_ABOUT = _core_.ID_ABOUT
198 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203 ID_PREFERENCES = _core_.ID_PREFERENCES
204 ID_CUT = _core_.ID_CUT
205 ID_COPY = _core_.ID_COPY
206 ID_PASTE = _core_.ID_PASTE
207 ID_CLEAR = _core_.ID_CLEAR
208 ID_FIND = _core_.ID_FIND
209 ID_DUPLICATE = _core_.ID_DUPLICATE
210 ID_SELECTALL = _core_.ID_SELECTALL
211 ID_DELETE = _core_.ID_DELETE
212 ID_REPLACE = _core_.ID_REPLACE
213 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214 ID_PROPERTIES = _core_.ID_PROPERTIES
215 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST = _core_.ID_VIEW_LIST
219 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223 ID_FILE1 = _core_.ID_FILE1
224 ID_FILE2 = _core_.ID_FILE2
225 ID_FILE3 = _core_.ID_FILE3
226 ID_FILE4 = _core_.ID_FILE4
227 ID_FILE5 = _core_.ID_FILE5
228 ID_FILE6 = _core_.ID_FILE6
229 ID_FILE7 = _core_.ID_FILE7
230 ID_FILE8 = _core_.ID_FILE8
231 ID_FILE9 = _core_.ID_FILE9
232 ID_OK = _core_.ID_OK
233 ID_CANCEL = _core_.ID_CANCEL
234 ID_APPLY = _core_.ID_APPLY
235 ID_YES = _core_.ID_YES
236 ID_NO = _core_.ID_NO
237 ID_STATIC = _core_.ID_STATIC
238 ID_FORWARD = _core_.ID_FORWARD
239 ID_BACKWARD = _core_.ID_BACKWARD
240 ID_DEFAULT = _core_.ID_DEFAULT
241 ID_MORE = _core_.ID_MORE
242 ID_SETUP = _core_.ID_SETUP
243 ID_RESET = _core_.ID_RESET
244 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245 ID_YESTOALL = _core_.ID_YESTOALL
246 ID_NOTOALL = _core_.ID_NOTOALL
247 ID_ABORT = _core_.ID_ABORT
248 ID_RETRY = _core_.ID_RETRY
249 ID_IGNORE = _core_.ID_IGNORE
250 ID_ADD = _core_.ID_ADD
251 ID_REMOVE = _core_.ID_REMOVE
252 ID_UP = _core_.ID_UP
253 ID_DOWN = _core_.ID_DOWN
254 ID_HOME = _core_.ID_HOME
255 ID_REFRESH = _core_.ID_REFRESH
256 ID_STOP = _core_.ID_STOP
257 ID_INDEX = _core_.ID_INDEX
258 ID_BOLD = _core_.ID_BOLD
259 ID_ITALIC = _core_.ID_ITALIC
260 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264 ID_UNDERLINE = _core_.ID_UNDERLINE
265 ID_INDENT = _core_.ID_INDENT
266 ID_UNINDENT = _core_.ID_UNINDENT
267 ID_ZOOM_100 = _core_.ID_ZOOM_100
268 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269 ID_ZOOM_IN = _core_.ID_ZOOM_IN
270 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271 ID_UNDELETE = _core_.ID_UNDELETE
272 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
273 ID_HIGHEST = _core_.ID_HIGHEST
274 OPEN = _core_.OPEN
275 SAVE = _core_.SAVE
276 HIDE_READONLY = _core_.HIDE_READONLY
277 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
278 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
279 MULTIPLE = _core_.MULTIPLE
280 CHANGE_DIR = _core_.CHANGE_DIR
281 ACCEL_ALT = _core_.ACCEL_ALT
282 ACCEL_CTRL = _core_.ACCEL_CTRL
283 ACCEL_SHIFT = _core_.ACCEL_SHIFT
284 ACCEL_NORMAL = _core_.ACCEL_NORMAL
285 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
286 PD_APP_MODAL = _core_.PD_APP_MODAL
287 PD_CAN_ABORT = _core_.PD_CAN_ABORT
288 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
289 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
290 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
291 PD_SMOOTH = _core_.PD_SMOOTH
292 PD_CAN_SKIP = _core_.PD_CAN_SKIP
293 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
294 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
295 DD_CHANGE_DIR = _core_.DD_CHANGE_DIR
296 MENU_TEAROFF = _core_.MENU_TEAROFF
297 MB_DOCKABLE = _core_.MB_DOCKABLE
298 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
299 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
300 LI_HORIZONTAL = _core_.LI_HORIZONTAL
301 LI_VERTICAL = _core_.LI_VERTICAL
302 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
303 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
304 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
305 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
306 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
307 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
308 MM_TEXT = _core_.MM_TEXT
309 MM_LOMETRIC = _core_.MM_LOMETRIC
310 MM_HIMETRIC = _core_.MM_HIMETRIC
311 MM_LOENGLISH = _core_.MM_LOENGLISH
312 MM_HIENGLISH = _core_.MM_HIENGLISH
313 MM_TWIPS = _core_.MM_TWIPS
314 MM_ISOTROPIC = _core_.MM_ISOTROPIC
315 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
316 MM_POINTS = _core_.MM_POINTS
317 MM_METRIC = _core_.MM_METRIC
318 CENTRE = _core_.CENTRE
319 CENTER = _core_.CENTER
320 HORIZONTAL = _core_.HORIZONTAL
321 VERTICAL = _core_.VERTICAL
322 BOTH = _core_.BOTH
323 LEFT = _core_.LEFT
324 RIGHT = _core_.RIGHT
325 UP = _core_.UP
326 DOWN = _core_.DOWN
327 TOP = _core_.TOP
328 BOTTOM = _core_.BOTTOM
329 NORTH = _core_.NORTH
330 SOUTH = _core_.SOUTH
331 WEST = _core_.WEST
332 EAST = _core_.EAST
333 ALL = _core_.ALL
334 ALIGN_NOT = _core_.ALIGN_NOT
335 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
336 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
337 ALIGN_LEFT = _core_.ALIGN_LEFT
338 ALIGN_TOP = _core_.ALIGN_TOP
339 ALIGN_RIGHT = _core_.ALIGN_RIGHT
340 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
341 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
342 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
343 ALIGN_CENTER = _core_.ALIGN_CENTER
344 ALIGN_CENTRE = _core_.ALIGN_CENTRE
345 ALIGN_MASK = _core_.ALIGN_MASK
346 STRETCH_NOT = _core_.STRETCH_NOT
347 SHRINK = _core_.SHRINK
348 GROW = _core_.GROW
349 EXPAND = _core_.EXPAND
350 SHAPED = _core_.SHAPED
351 FIXED_MINSIZE = _core_.FIXED_MINSIZE
352 TILE = _core_.TILE
353 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
354 BORDER_DEFAULT = _core_.BORDER_DEFAULT
355 BORDER_NONE = _core_.BORDER_NONE
356 BORDER_STATIC = _core_.BORDER_STATIC
357 BORDER_SIMPLE = _core_.BORDER_SIMPLE
358 BORDER_RAISED = _core_.BORDER_RAISED
359 BORDER_SUNKEN = _core_.BORDER_SUNKEN
360 BORDER_DOUBLE = _core_.BORDER_DOUBLE
361 BORDER_MASK = _core_.BORDER_MASK
362 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
363 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
364 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
365 DEFAULT = _core_.DEFAULT
366 DECORATIVE = _core_.DECORATIVE
367 ROMAN = _core_.ROMAN
368 SCRIPT = _core_.SCRIPT
369 SWISS = _core_.SWISS
370 MODERN = _core_.MODERN
371 TELETYPE = _core_.TELETYPE
372 VARIABLE = _core_.VARIABLE
373 FIXED = _core_.FIXED
374 NORMAL = _core_.NORMAL
375 LIGHT = _core_.LIGHT
376 BOLD = _core_.BOLD
377 ITALIC = _core_.ITALIC
378 SLANT = _core_.SLANT
379 SOLID = _core_.SOLID
380 DOT = _core_.DOT
381 LONG_DASH = _core_.LONG_DASH
382 SHORT_DASH = _core_.SHORT_DASH
383 DOT_DASH = _core_.DOT_DASH
384 USER_DASH = _core_.USER_DASH
385 TRANSPARENT = _core_.TRANSPARENT
386 STIPPLE = _core_.STIPPLE
387 STIPPLE_MASK = _core_.STIPPLE_MASK
388 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
389 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
390 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
391 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
392 CROSS_HATCH = _core_.CROSS_HATCH
393 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
394 VERTICAL_HATCH = _core_.VERTICAL_HATCH
395 JOIN_BEVEL = _core_.JOIN_BEVEL
396 JOIN_MITER = _core_.JOIN_MITER
397 JOIN_ROUND = _core_.JOIN_ROUND
398 CAP_ROUND = _core_.CAP_ROUND
399 CAP_PROJECTING = _core_.CAP_PROJECTING
400 CAP_BUTT = _core_.CAP_BUTT
401 CLEAR = _core_.CLEAR
402 XOR = _core_.XOR
403 INVERT = _core_.INVERT
404 OR_REVERSE = _core_.OR_REVERSE
405 AND_REVERSE = _core_.AND_REVERSE
406 COPY = _core_.COPY
407 AND = _core_.AND
408 AND_INVERT = _core_.AND_INVERT
409 NO_OP = _core_.NO_OP
410 NOR = _core_.NOR
411 EQUIV = _core_.EQUIV
412 SRC_INVERT = _core_.SRC_INVERT
413 OR_INVERT = _core_.OR_INVERT
414 NAND = _core_.NAND
415 OR = _core_.OR
416 SET = _core_.SET
417 WXK_BACK = _core_.WXK_BACK
418 WXK_TAB = _core_.WXK_TAB
419 WXK_RETURN = _core_.WXK_RETURN
420 WXK_ESCAPE = _core_.WXK_ESCAPE
421 WXK_SPACE = _core_.WXK_SPACE
422 WXK_DELETE = _core_.WXK_DELETE
423 WXK_START = _core_.WXK_START
424 WXK_LBUTTON = _core_.WXK_LBUTTON
425 WXK_RBUTTON = _core_.WXK_RBUTTON
426 WXK_CANCEL = _core_.WXK_CANCEL
427 WXK_MBUTTON = _core_.WXK_MBUTTON
428 WXK_CLEAR = _core_.WXK_CLEAR
429 WXK_SHIFT = _core_.WXK_SHIFT
430 WXK_ALT = _core_.WXK_ALT
431 WXK_CONTROL = _core_.WXK_CONTROL
432 WXK_MENU = _core_.WXK_MENU
433 WXK_PAUSE = _core_.WXK_PAUSE
434 WXK_CAPITAL = _core_.WXK_CAPITAL
435 WXK_PRIOR = _core_.WXK_PRIOR
436 WXK_NEXT = _core_.WXK_NEXT
437 WXK_END = _core_.WXK_END
438 WXK_HOME = _core_.WXK_HOME
439 WXK_LEFT = _core_.WXK_LEFT
440 WXK_UP = _core_.WXK_UP
441 WXK_RIGHT = _core_.WXK_RIGHT
442 WXK_DOWN = _core_.WXK_DOWN
443 WXK_SELECT = _core_.WXK_SELECT
444 WXK_PRINT = _core_.WXK_PRINT
445 WXK_EXECUTE = _core_.WXK_EXECUTE
446 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
447 WXK_INSERT = _core_.WXK_INSERT
448 WXK_HELP = _core_.WXK_HELP
449 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
450 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
451 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
452 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
453 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
454 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
455 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
456 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
457 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
458 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
459 WXK_MULTIPLY = _core_.WXK_MULTIPLY
460 WXK_ADD = _core_.WXK_ADD
461 WXK_SEPARATOR = _core_.WXK_SEPARATOR
462 WXK_SUBTRACT = _core_.WXK_SUBTRACT
463 WXK_DECIMAL = _core_.WXK_DECIMAL
464 WXK_DIVIDE = _core_.WXK_DIVIDE
465 WXK_F1 = _core_.WXK_F1
466 WXK_F2 = _core_.WXK_F2
467 WXK_F3 = _core_.WXK_F3
468 WXK_F4 = _core_.WXK_F4
469 WXK_F5 = _core_.WXK_F5
470 WXK_F6 = _core_.WXK_F6
471 WXK_F7 = _core_.WXK_F7
472 WXK_F8 = _core_.WXK_F8
473 WXK_F9 = _core_.WXK_F9
474 WXK_F10 = _core_.WXK_F10
475 WXK_F11 = _core_.WXK_F11
476 WXK_F12 = _core_.WXK_F12
477 WXK_F13 = _core_.WXK_F13
478 WXK_F14 = _core_.WXK_F14
479 WXK_F15 = _core_.WXK_F15
480 WXK_F16 = _core_.WXK_F16
481 WXK_F17 = _core_.WXK_F17
482 WXK_F18 = _core_.WXK_F18
483 WXK_F19 = _core_.WXK_F19
484 WXK_F20 = _core_.WXK_F20
485 WXK_F21 = _core_.WXK_F21
486 WXK_F22 = _core_.WXK_F22
487 WXK_F23 = _core_.WXK_F23
488 WXK_F24 = _core_.WXK_F24
489 WXK_NUMLOCK = _core_.WXK_NUMLOCK
490 WXK_SCROLL = _core_.WXK_SCROLL
491 WXK_PAGEUP = _core_.WXK_PAGEUP
492 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
493 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
494 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
495 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
496 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
497 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
498 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
499 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
500 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
501 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
502 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
503 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
504 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
505 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
506 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
507 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
508 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
509 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
510 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
511 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
512 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
513 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
514 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
515 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
516 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
517 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
518 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
519 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
520 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
521 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
522 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
523 WXK_COMMAND = _core_.WXK_COMMAND
524 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
525 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
526 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
527 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
528 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
529 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
530 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
531 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
532 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
533 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
534 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
535 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
536 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
537 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
538 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
539 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
540 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
541 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
542 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
543 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
544 PAPER_NONE = _core_.PAPER_NONE
545 PAPER_LETTER = _core_.PAPER_LETTER
546 PAPER_LEGAL = _core_.PAPER_LEGAL
547 PAPER_A4 = _core_.PAPER_A4
548 PAPER_CSHEET = _core_.PAPER_CSHEET
549 PAPER_DSHEET = _core_.PAPER_DSHEET
550 PAPER_ESHEET = _core_.PAPER_ESHEET
551 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
552 PAPER_TABLOID = _core_.PAPER_TABLOID
553 PAPER_LEDGER = _core_.PAPER_LEDGER
554 PAPER_STATEMENT = _core_.PAPER_STATEMENT
555 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
556 PAPER_A3 = _core_.PAPER_A3
557 PAPER_A4SMALL = _core_.PAPER_A4SMALL
558 PAPER_A5 = _core_.PAPER_A5
559 PAPER_B4 = _core_.PAPER_B4
560 PAPER_B5 = _core_.PAPER_B5
561 PAPER_FOLIO = _core_.PAPER_FOLIO
562 PAPER_QUARTO = _core_.PAPER_QUARTO
563 PAPER_10X14 = _core_.PAPER_10X14
564 PAPER_11X17 = _core_.PAPER_11X17
565 PAPER_NOTE = _core_.PAPER_NOTE
566 PAPER_ENV_9 = _core_.PAPER_ENV_9
567 PAPER_ENV_10 = _core_.PAPER_ENV_10
568 PAPER_ENV_11 = _core_.PAPER_ENV_11
569 PAPER_ENV_12 = _core_.PAPER_ENV_12
570 PAPER_ENV_14 = _core_.PAPER_ENV_14
571 PAPER_ENV_DL = _core_.PAPER_ENV_DL
572 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
573 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
574 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
575 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
576 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
577 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
578 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
579 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
580 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
581 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
582 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
583 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
584 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
585 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
586 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
587 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
588 PAPER_9X11 = _core_.PAPER_9X11
589 PAPER_10X11 = _core_.PAPER_10X11
590 PAPER_15X11 = _core_.PAPER_15X11
591 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
592 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
593 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
594 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
595 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
596 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
597 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
598 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
599 PAPER_A_PLUS = _core_.PAPER_A_PLUS
600 PAPER_B_PLUS = _core_.PAPER_B_PLUS
601 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
602 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
603 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
604 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
605 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
606 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
607 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
608 PAPER_A2 = _core_.PAPER_A2
609 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
610 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
611 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
612 PAPER_A6 = _core_.PAPER_A6
613 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
614 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
615 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
616 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
617 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
618 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
619 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
620 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
621 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
622 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
623 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
624 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
625 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
626 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
627 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
628 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
629 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
630 PAPER_B6_JIS = _core_.PAPER_B6_JIS
631 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
632 PAPER_12X11 = _core_.PAPER_12X11
633 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
634 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
635 PAPER_P16K = _core_.PAPER_P16K
636 PAPER_P32K = _core_.PAPER_P32K
637 PAPER_P32KBIG = _core_.PAPER_P32KBIG
638 PAPER_PENV_1 = _core_.PAPER_PENV_1
639 PAPER_PENV_2 = _core_.PAPER_PENV_2
640 PAPER_PENV_3 = _core_.PAPER_PENV_3
641 PAPER_PENV_4 = _core_.PAPER_PENV_4
642 PAPER_PENV_5 = _core_.PAPER_PENV_5
643 PAPER_PENV_6 = _core_.PAPER_PENV_6
644 PAPER_PENV_7 = _core_.PAPER_PENV_7
645 PAPER_PENV_8 = _core_.PAPER_PENV_8
646 PAPER_PENV_9 = _core_.PAPER_PENV_9
647 PAPER_PENV_10 = _core_.PAPER_PENV_10
648 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
649 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
650 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
651 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
652 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
653 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
654 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
655 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
656 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
657 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
658 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
659 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
660 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
661 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
662 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
663 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
664 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
665 ITEM_NORMAL = _core_.ITEM_NORMAL
666 ITEM_CHECK = _core_.ITEM_CHECK
667 ITEM_RADIO = _core_.ITEM_RADIO
668 ITEM_MAX = _core_.ITEM_MAX
669 HT_NOWHERE = _core_.HT_NOWHERE
670 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
671 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
672 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
673 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
674 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
675 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
676 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
677 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
678 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
679 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
680 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
681 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
682 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
683 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
684 HT_MAX = _core_.HT_MAX
685 MOD_NONE = _core_.MOD_NONE
686 MOD_ALT = _core_.MOD_ALT
687 MOD_CONTROL = _core_.MOD_CONTROL
688 MOD_ALTGR = _core_.MOD_ALTGR
689 MOD_SHIFT = _core_.MOD_SHIFT
690 MOD_META = _core_.MOD_META
691 MOD_WIN = _core_.MOD_WIN
692 MOD_CMD = _core_.MOD_CMD
693 MOD_ALL = _core_.MOD_ALL
694 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
695 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
696 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
697 #---------------------------------------------------------------------------
698
699 class Object(object):
700 """
701 The base class for most wx objects, although in wxPython not
702 much functionality is needed nor exposed.
703 """
704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
705 def __init__(self): raise AttributeError, "No constructor defined"
706 __repr__ = _swig_repr
707 def GetClassName(*args, **kwargs):
708 """
709 GetClassName(self) -> String
710
711 Returns the class name of the C++ class using wxRTTI.
712 """
713 return _core_.Object_GetClassName(*args, **kwargs)
714
715 def Destroy(*args, **kwargs):
716 """
717 Destroy(self)
718
719 Deletes the C++ object this Python object is a proxy for.
720 """
721 val = _core_.Object_Destroy(*args, **kwargs)
722 args[0].thisown = 0
723 return val
724
725 Object_swigregister = _core_.Object_swigregister
726 Object_swigregister(Object)
727 _wxPySetDictionary = _core_._wxPySetDictionary
728 cvar = _core_.cvar
729 EmptyString = cvar.EmptyString
730
731 #---------------------------------------------------------------------------
732
733 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
734 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
735 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
736 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
737 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
738 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
739 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
740 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
741 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
742 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
743 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
744 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
745 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
746 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
747 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
748 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
749 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
750 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
751 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
752 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
753 CURSOR_NONE = _core_.CURSOR_NONE
754 CURSOR_ARROW = _core_.CURSOR_ARROW
755 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
756 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
757 CURSOR_CHAR = _core_.CURSOR_CHAR
758 CURSOR_CROSS = _core_.CURSOR_CROSS
759 CURSOR_HAND = _core_.CURSOR_HAND
760 CURSOR_IBEAM = _core_.CURSOR_IBEAM
761 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
762 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
763 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
764 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
765 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
766 CURSOR_PENCIL = _core_.CURSOR_PENCIL
767 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
768 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
769 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
770 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
771 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
772 CURSOR_SIZENS = _core_.CURSOR_SIZENS
773 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
774 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
775 CURSOR_SIZING = _core_.CURSOR_SIZING
776 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
777 CURSOR_WAIT = _core_.CURSOR_WAIT
778 CURSOR_WATCH = _core_.CURSOR_WATCH
779 CURSOR_BLANK = _core_.CURSOR_BLANK
780 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
781 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
782 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
783 CURSOR_MAX = _core_.CURSOR_MAX
784 #---------------------------------------------------------------------------
785
786 class Size(object):
787 """
788 wx.Size is a useful data structure used to represent the size of
789 something. It simply contains integer width and height
790 properties. In most places in wxPython where a wx.Size is
791 expected a (width, height) tuple can be used instead.
792 """
793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
794 __repr__ = _swig_repr
795 width = property(_core_.Size_width_get, _core_.Size_width_set)
796 height = property(_core_.Size_height_get, _core_.Size_height_set)
797 x = width; y = height
798 def __init__(self, *args, **kwargs):
799 """
800 __init__(self, int w=0, int h=0) -> Size
801
802 Creates a size object.
803 """
804 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
805 __swig_destroy__ = _core_.delete_Size
806 __del__ = lambda self : None;
807 def __eq__(*args, **kwargs):
808 """
809 __eq__(self, PyObject other) -> bool
810
811 Test for equality of wx.Size objects.
812 """
813 return _core_.Size___eq__(*args, **kwargs)
814
815 def __ne__(*args, **kwargs):
816 """
817 __ne__(self, PyObject other) -> bool
818
819 Test for inequality of wx.Size objects.
820 """
821 return _core_.Size___ne__(*args, **kwargs)
822
823 def __add__(*args, **kwargs):
824 """
825 __add__(self, Size sz) -> Size
826
827 Add sz's proprties to this and return the result.
828 """
829 return _core_.Size___add__(*args, **kwargs)
830
831 def __sub__(*args, **kwargs):
832 """
833 __sub__(self, Size sz) -> Size
834
835 Subtract sz's properties from this and return the result.
836 """
837 return _core_.Size___sub__(*args, **kwargs)
838
839 def IncTo(*args, **kwargs):
840 """
841 IncTo(self, Size sz)
842
843 Increments this object so that both of its dimensions are not less
844 than the corresponding dimensions of the size.
845 """
846 return _core_.Size_IncTo(*args, **kwargs)
847
848 def DecTo(*args, **kwargs):
849 """
850 DecTo(self, Size sz)
851
852 Decrements this object so that both of its dimensions are not greater
853 than the corresponding dimensions of the size.
854 """
855 return _core_.Size_DecTo(*args, **kwargs)
856
857 def Set(*args, **kwargs):
858 """
859 Set(self, int w, int h)
860
861 Set both width and height.
862 """
863 return _core_.Size_Set(*args, **kwargs)
864
865 def SetWidth(*args, **kwargs):
866 """SetWidth(self, int w)"""
867 return _core_.Size_SetWidth(*args, **kwargs)
868
869 def SetHeight(*args, **kwargs):
870 """SetHeight(self, int h)"""
871 return _core_.Size_SetHeight(*args, **kwargs)
872
873 def GetWidth(*args, **kwargs):
874 """GetWidth(self) -> int"""
875 return _core_.Size_GetWidth(*args, **kwargs)
876
877 def GetHeight(*args, **kwargs):
878 """GetHeight(self) -> int"""
879 return _core_.Size_GetHeight(*args, **kwargs)
880
881 def IsFullySpecified(*args, **kwargs):
882 """
883 IsFullySpecified(self) -> bool
884
885 Returns True if both components of the size are non-default values.
886 """
887 return _core_.Size_IsFullySpecified(*args, **kwargs)
888
889 def SetDefaults(*args, **kwargs):
890 """
891 SetDefaults(self, Size size)
892
893 Combine this size with the other one replacing the default components
894 of this object (i.e. equal to -1) with those of the other.
895 """
896 return _core_.Size_SetDefaults(*args, **kwargs)
897
898 def Get(*args, **kwargs):
899 """
900 Get() -> (width,height)
901
902 Returns the width and height properties as a tuple.
903 """
904 return _core_.Size_Get(*args, **kwargs)
905
906 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
907 def __str__(self): return str(self.Get())
908 def __repr__(self): return 'wx.Size'+str(self.Get())
909 def __len__(self): return len(self.Get())
910 def __getitem__(self, index): return self.Get()[index]
911 def __setitem__(self, index, val):
912 if index == 0: self.width = val
913 elif index == 1: self.height = val
914 else: raise IndexError
915 def __nonzero__(self): return self.Get() != (0,0)
916 __safe_for_unpickling__ = True
917 def __reduce__(self): return (wx.Size, self.Get())
918
919 Size_swigregister = _core_.Size_swigregister
920 Size_swigregister(Size)
921
922 #---------------------------------------------------------------------------
923
924 class RealPoint(object):
925 """
926 A data structure for representing a point or position with floating
927 point x and y properties. In wxPython most places that expect a
928 wx.RealPoint can also accept a (x,y) tuple.
929 """
930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
931 __repr__ = _swig_repr
932 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
933 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
934 def __init__(self, *args, **kwargs):
935 """
936 __init__(self, double x=0.0, double y=0.0) -> RealPoint
937
938 Create a wx.RealPoint object
939 """
940 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
941 __swig_destroy__ = _core_.delete_RealPoint
942 __del__ = lambda self : None;
943 def __eq__(*args, **kwargs):
944 """
945 __eq__(self, PyObject other) -> bool
946
947 Test for equality of wx.RealPoint objects.
948 """
949 return _core_.RealPoint___eq__(*args, **kwargs)
950
951 def __ne__(*args, **kwargs):
952 """
953 __ne__(self, PyObject other) -> bool
954
955 Test for inequality of wx.RealPoint objects.
956 """
957 return _core_.RealPoint___ne__(*args, **kwargs)
958
959 def __add__(*args, **kwargs):
960 """
961 __add__(self, RealPoint pt) -> RealPoint
962
963 Add pt's proprties to this and return the result.
964 """
965 return _core_.RealPoint___add__(*args, **kwargs)
966
967 def __sub__(*args, **kwargs):
968 """
969 __sub__(self, RealPoint pt) -> RealPoint
970
971 Subtract pt's proprties from this and return the result
972 """
973 return _core_.RealPoint___sub__(*args, **kwargs)
974
975 def Set(*args, **kwargs):
976 """
977 Set(self, double x, double y)
978
979 Set both the x and y properties
980 """
981 return _core_.RealPoint_Set(*args, **kwargs)
982
983 def Get(*args, **kwargs):
984 """
985 Get() -> (x,y)
986
987 Return the x and y properties as a tuple.
988 """
989 return _core_.RealPoint_Get(*args, **kwargs)
990
991 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
992 def __str__(self): return str(self.Get())
993 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
994 def __len__(self): return len(self.Get())
995 def __getitem__(self, index): return self.Get()[index]
996 def __setitem__(self, index, val):
997 if index == 0: self.x = val
998 elif index == 1: self.y = val
999 else: raise IndexError
1000 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1001 __safe_for_unpickling__ = True
1002 def __reduce__(self): return (wx.RealPoint, self.Get())
1003
1004 RealPoint_swigregister = _core_.RealPoint_swigregister
1005 RealPoint_swigregister(RealPoint)
1006
1007 #---------------------------------------------------------------------------
1008
1009 class Point(object):
1010 """
1011 A data structure for representing a point or position with integer x
1012 and y properties. Most places in wxPython that expect a wx.Point can
1013 also accept a (x,y) tuple.
1014 """
1015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1016 __repr__ = _swig_repr
1017 x = property(_core_.Point_x_get, _core_.Point_x_set)
1018 y = property(_core_.Point_y_get, _core_.Point_y_set)
1019 def __init__(self, *args, **kwargs):
1020 """
1021 __init__(self, int x=0, int y=0) -> Point
1022
1023 Create a wx.Point object
1024 """
1025 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1026 __swig_destroy__ = _core_.delete_Point
1027 __del__ = lambda self : None;
1028 def __eq__(*args, **kwargs):
1029 """
1030 __eq__(self, PyObject other) -> bool
1031
1032 Test for equality of wx.Point objects.
1033 """
1034 return _core_.Point___eq__(*args, **kwargs)
1035
1036 def __ne__(*args, **kwargs):
1037 """
1038 __ne__(self, PyObject other) -> bool
1039
1040 Test for inequality of wx.Point objects.
1041 """
1042 return _core_.Point___ne__(*args, **kwargs)
1043
1044 def __add__(*args, **kwargs):
1045 """
1046 __add__(self, Point pt) -> Point
1047
1048 Add pt's proprties to this and return the result.
1049 """
1050 return _core_.Point___add__(*args, **kwargs)
1051
1052 def __sub__(*args, **kwargs):
1053 """
1054 __sub__(self, Point pt) -> Point
1055
1056 Subtract pt's proprties from this and return the result
1057 """
1058 return _core_.Point___sub__(*args, **kwargs)
1059
1060 def __iadd__(*args, **kwargs):
1061 """
1062 __iadd__(self, Point pt) -> Point
1063
1064 Add pt to this object.
1065 """
1066 return _core_.Point___iadd__(*args, **kwargs)
1067
1068 def __isub__(*args, **kwargs):
1069 """
1070 __isub__(self, Point pt) -> Point
1071
1072 Subtract pt from this object.
1073 """
1074 return _core_.Point___isub__(*args, **kwargs)
1075
1076 def Set(*args, **kwargs):
1077 """
1078 Set(self, long x, long y)
1079
1080 Set both the x and y properties
1081 """
1082 return _core_.Point_Set(*args, **kwargs)
1083
1084 def Get(*args, **kwargs):
1085 """
1086 Get() -> (x,y)
1087
1088 Return the x and y properties as a tuple.
1089 """
1090 return _core_.Point_Get(*args, **kwargs)
1091
1092 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1093 def __str__(self): return str(self.Get())
1094 def __repr__(self): return 'wx.Point'+str(self.Get())
1095 def __len__(self): return len(self.Get())
1096 def __getitem__(self, index): return self.Get()[index]
1097 def __setitem__(self, index, val):
1098 if index == 0: self.x = val
1099 elif index == 1: self.y = val
1100 else: raise IndexError
1101 def __nonzero__(self): return self.Get() != (0,0)
1102 __safe_for_unpickling__ = True
1103 def __reduce__(self): return (wx.Point, self.Get())
1104
1105 Point_swigregister = _core_.Point_swigregister
1106 Point_swigregister(Point)
1107
1108 #---------------------------------------------------------------------------
1109
1110 class Rect(object):
1111 """
1112 A class for representing and manipulating rectangles. It has x, y,
1113 width and height properties. In wxPython most palces that expect a
1114 wx.Rect can also accept a (x,y,width,height) tuple.
1115 """
1116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1117 __repr__ = _swig_repr
1118 def __init__(self, *args, **kwargs):
1119 """
1120 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1121
1122 Create a new Rect object.
1123 """
1124 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1125 __swig_destroy__ = _core_.delete_Rect
1126 __del__ = lambda self : None;
1127 def GetX(*args, **kwargs):
1128 """GetX(self) -> int"""
1129 return _core_.Rect_GetX(*args, **kwargs)
1130
1131 def SetX(*args, **kwargs):
1132 """SetX(self, int x)"""
1133 return _core_.Rect_SetX(*args, **kwargs)
1134
1135 def GetY(*args, **kwargs):
1136 """GetY(self) -> int"""
1137 return _core_.Rect_GetY(*args, **kwargs)
1138
1139 def SetY(*args, **kwargs):
1140 """SetY(self, int y)"""
1141 return _core_.Rect_SetY(*args, **kwargs)
1142
1143 def GetWidth(*args, **kwargs):
1144 """GetWidth(self) -> int"""
1145 return _core_.Rect_GetWidth(*args, **kwargs)
1146
1147 def SetWidth(*args, **kwargs):
1148 """SetWidth(self, int w)"""
1149 return _core_.Rect_SetWidth(*args, **kwargs)
1150
1151 def GetHeight(*args, **kwargs):
1152 """GetHeight(self) -> int"""
1153 return _core_.Rect_GetHeight(*args, **kwargs)
1154
1155 def SetHeight(*args, **kwargs):
1156 """SetHeight(self, int h)"""
1157 return _core_.Rect_SetHeight(*args, **kwargs)
1158
1159 def GetPosition(*args, **kwargs):
1160 """GetPosition(self) -> Point"""
1161 return _core_.Rect_GetPosition(*args, **kwargs)
1162
1163 def SetPosition(*args, **kwargs):
1164 """SetPosition(self, Point p)"""
1165 return _core_.Rect_SetPosition(*args, **kwargs)
1166
1167 def GetSize(*args, **kwargs):
1168 """GetSize(self) -> Size"""
1169 return _core_.Rect_GetSize(*args, **kwargs)
1170
1171 def SetSize(*args, **kwargs):
1172 """SetSize(self, Size s)"""
1173 return _core_.Rect_SetSize(*args, **kwargs)
1174
1175 def IsEmpty(*args, **kwargs):
1176 """IsEmpty(self) -> bool"""
1177 return _core_.Rect_IsEmpty(*args, **kwargs)
1178
1179 def GetTopLeft(*args, **kwargs):
1180 """GetTopLeft(self) -> Point"""
1181 return _core_.Rect_GetTopLeft(*args, **kwargs)
1182
1183 def SetTopLeft(*args, **kwargs):
1184 """SetTopLeft(self, Point p)"""
1185 return _core_.Rect_SetTopLeft(*args, **kwargs)
1186
1187 def GetBottomRight(*args, **kwargs):
1188 """GetBottomRight(self) -> Point"""
1189 return _core_.Rect_GetBottomRight(*args, **kwargs)
1190
1191 def SetBottomRight(*args, **kwargs):
1192 """SetBottomRight(self, Point p)"""
1193 return _core_.Rect_SetBottomRight(*args, **kwargs)
1194
1195 def GetLeft(*args, **kwargs):
1196 """GetLeft(self) -> int"""
1197 return _core_.Rect_GetLeft(*args, **kwargs)
1198
1199 def GetTop(*args, **kwargs):
1200 """GetTop(self) -> int"""
1201 return _core_.Rect_GetTop(*args, **kwargs)
1202
1203 def GetBottom(*args, **kwargs):
1204 """GetBottom(self) -> int"""
1205 return _core_.Rect_GetBottom(*args, **kwargs)
1206
1207 def GetRight(*args, **kwargs):
1208 """GetRight(self) -> int"""
1209 return _core_.Rect_GetRight(*args, **kwargs)
1210
1211 def SetLeft(*args, **kwargs):
1212 """SetLeft(self, int left)"""
1213 return _core_.Rect_SetLeft(*args, **kwargs)
1214
1215 def SetRight(*args, **kwargs):
1216 """SetRight(self, int right)"""
1217 return _core_.Rect_SetRight(*args, **kwargs)
1218
1219 def SetTop(*args, **kwargs):
1220 """SetTop(self, int top)"""
1221 return _core_.Rect_SetTop(*args, **kwargs)
1222
1223 def SetBottom(*args, **kwargs):
1224 """SetBottom(self, int bottom)"""
1225 return _core_.Rect_SetBottom(*args, **kwargs)
1226
1227 position = property(GetPosition, SetPosition)
1228 size = property(GetSize, SetSize)
1229 left = property(GetLeft, SetLeft)
1230 right = property(GetRight, SetRight)
1231 top = property(GetTop, SetTop)
1232 bottom = property(GetBottom, SetBottom)
1233
1234 def Inflate(*args, **kwargs):
1235 """
1236 Inflate(self, int dx, int dy) -> Rect
1237
1238 Increases the size of the rectangle.
1239
1240 The left border is moved farther left and the right border is moved
1241 farther right by ``dx``. The upper border is moved farther up and the
1242 bottom border is moved farther down by ``dy``. (Note the the width and
1243 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1244 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1245 opposite happens: the rectangle size decreases in the respective
1246 direction.
1247
1248 The change is made to the rectangle inplace, if instead you need a
1249 copy that is inflated, preserving the original then make the copy
1250 first::
1251
1252 copy = wx.Rect(*original)
1253 copy.Inflate(10,15)
1254
1255
1256 """
1257 return _core_.Rect_Inflate(*args, **kwargs)
1258
1259 def Deflate(*args, **kwargs):
1260 """
1261 Deflate(self, int dx, int dy) -> Rect
1262
1263 Decrease the rectangle size. This method is the opposite of `Inflate`
1264 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1265 `Inflate` for a full description.
1266 """
1267 return _core_.Rect_Deflate(*args, **kwargs)
1268
1269 def OffsetXY(*args, **kwargs):
1270 """
1271 OffsetXY(self, int dx, int dy)
1272
1273 Moves the rectangle by the specified offset. If dx is positive, the
1274 rectangle is moved to the right, if dy is positive, it is moved to the
1275 bottom, otherwise it is moved to the left or top respectively.
1276 """
1277 return _core_.Rect_OffsetXY(*args, **kwargs)
1278
1279 def Offset(*args, **kwargs):
1280 """
1281 Offset(self, Point pt)
1282
1283 Same as `OffsetXY` but uses dx,dy from Point
1284 """
1285 return _core_.Rect_Offset(*args, **kwargs)
1286
1287 def Intersect(*args, **kwargs):
1288 """
1289 Intersect(self, Rect rect) -> Rect
1290
1291 Returns the intersectsion of this rectangle and rect.
1292 """
1293 return _core_.Rect_Intersect(*args, **kwargs)
1294
1295 def Union(*args, **kwargs):
1296 """
1297 Union(self, Rect rect) -> Rect
1298
1299 Returns the union of this rectangle and rect.
1300 """
1301 return _core_.Rect_Union(*args, **kwargs)
1302
1303 def __add__(*args, **kwargs):
1304 """
1305 __add__(self, Rect rect) -> Rect
1306
1307 Add the properties of rect to this rectangle and return the result.
1308 """
1309 return _core_.Rect___add__(*args, **kwargs)
1310
1311 def __iadd__(*args, **kwargs):
1312 """
1313 __iadd__(self, Rect rect) -> Rect
1314
1315 Add the properties of rect to this rectangle, updating this rectangle.
1316 """
1317 return _core_.Rect___iadd__(*args, **kwargs)
1318
1319 def __eq__(*args, **kwargs):
1320 """
1321 __eq__(self, PyObject other) -> bool
1322
1323 Test for equality of wx.Rect objects.
1324 """
1325 return _core_.Rect___eq__(*args, **kwargs)
1326
1327 def __ne__(*args, **kwargs):
1328 """
1329 __ne__(self, PyObject other) -> bool
1330
1331 Test for inequality of wx.Rect objects.
1332 """
1333 return _core_.Rect___ne__(*args, **kwargs)
1334
1335 def InsideXY(*args, **kwargs):
1336 """
1337 InsideXY(self, int x, int y) -> bool
1338
1339 Return True if the point is (not strcitly) inside the rect.
1340 """
1341 return _core_.Rect_InsideXY(*args, **kwargs)
1342
1343 def Inside(*args, **kwargs):
1344 """
1345 Inside(self, Point pt) -> bool
1346
1347 Return True if the point is (not strcitly) inside the rect.
1348 """
1349 return _core_.Rect_Inside(*args, **kwargs)
1350
1351 def Intersects(*args, **kwargs):
1352 """
1353 Intersects(self, Rect rect) -> bool
1354
1355 Returns True if the rectangles have a non empty intersection.
1356 """
1357 return _core_.Rect_Intersects(*args, **kwargs)
1358
1359 def CenterIn(*args, **kwargs):
1360 """
1361 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1362
1363 Center this rectangle within the one passed to the method, which is
1364 usually, but not necessarily, the larger one.
1365 """
1366 return _core_.Rect_CenterIn(*args, **kwargs)
1367
1368 CentreIn = CenterIn
1369 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1370 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1371 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1372 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1373 def Set(*args, **kwargs):
1374 """
1375 Set(self, int x=0, int y=0, int width=0, int height=0)
1376
1377 Set all rectangle properties.
1378 """
1379 return _core_.Rect_Set(*args, **kwargs)
1380
1381 def Get(*args, **kwargs):
1382 """
1383 Get() -> (x,y,width,height)
1384
1385 Return the rectangle properties as a tuple.
1386 """
1387 return _core_.Rect_Get(*args, **kwargs)
1388
1389 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1390 def __str__(self): return str(self.Get())
1391 def __repr__(self): return 'wx.Rect'+str(self.Get())
1392 def __len__(self): return len(self.Get())
1393 def __getitem__(self, index): return self.Get()[index]
1394 def __setitem__(self, index, val):
1395 if index == 0: self.x = val
1396 elif index == 1: self.y = val
1397 elif index == 2: self.width = val
1398 elif index == 3: self.height = val
1399 else: raise IndexError
1400 def __nonzero__(self): return self.Get() != (0,0,0,0)
1401 __safe_for_unpickling__ = True
1402 def __reduce__(self): return (wx.Rect, self.Get())
1403
1404 Rect_swigregister = _core_.Rect_swigregister
1405 Rect_swigregister(Rect)
1406
1407 def RectPP(*args, **kwargs):
1408 """
1409 RectPP(Point topLeft, Point bottomRight) -> Rect
1410
1411 Create a new Rect object from Points representing two corners.
1412 """
1413 val = _core_.new_RectPP(*args, **kwargs)
1414 return val
1415
1416 def RectPS(*args, **kwargs):
1417 """
1418 RectPS(Point pos, Size size) -> Rect
1419
1420 Create a new Rect from a position and size.
1421 """
1422 val = _core_.new_RectPS(*args, **kwargs)
1423 return val
1424
1425 def RectS(*args, **kwargs):
1426 """
1427 RectS(Size size) -> Rect
1428
1429 Create a new Rect from a size only.
1430 """
1431 val = _core_.new_RectS(*args, **kwargs)
1432 return val
1433
1434
1435 def IntersectRect(*args, **kwargs):
1436 """
1437 IntersectRect(Rect r1, Rect r2) -> Rect
1438
1439 Calculate and return the intersection of r1 and r2.
1440 """
1441 return _core_.IntersectRect(*args, **kwargs)
1442 #---------------------------------------------------------------------------
1443
1444 class Point2D(object):
1445 """
1446 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1447 with floating point values.
1448 """
1449 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1450 __repr__ = _swig_repr
1451 def __init__(self, *args, **kwargs):
1452 """
1453 __init__(self, double x=0.0, double y=0.0) -> Point2D
1454
1455 Create a w.Point2D object.
1456 """
1457 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1458 def GetFloor(*args, **kwargs):
1459 """
1460 GetFloor() -> (x,y)
1461
1462 Convert to integer
1463 """
1464 return _core_.Point2D_GetFloor(*args, **kwargs)
1465
1466 def GetRounded(*args, **kwargs):
1467 """
1468 GetRounded() -> (x,y)
1469
1470 Convert to integer
1471 """
1472 return _core_.Point2D_GetRounded(*args, **kwargs)
1473
1474 def GetVectorLength(*args, **kwargs):
1475 """GetVectorLength(self) -> double"""
1476 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1477
1478 def GetVectorAngle(*args, **kwargs):
1479 """GetVectorAngle(self) -> double"""
1480 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1481
1482 def SetVectorLength(*args, **kwargs):
1483 """SetVectorLength(self, double length)"""
1484 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1485
1486 def SetVectorAngle(*args, **kwargs):
1487 """SetVectorAngle(self, double degrees)"""
1488 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1489
1490 def SetPolarCoordinates(self, angle, length):
1491 self.SetVectorLength(length)
1492 self.SetVectorAngle(angle)
1493 def Normalize(self):
1494 self.SetVectorLength(1.0)
1495
1496 def GetDistance(*args, **kwargs):
1497 """GetDistance(self, Point2D pt) -> double"""
1498 return _core_.Point2D_GetDistance(*args, **kwargs)
1499
1500 def GetDistanceSquare(*args, **kwargs):
1501 """GetDistanceSquare(self, Point2D pt) -> double"""
1502 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1503
1504 def GetDotProduct(*args, **kwargs):
1505 """GetDotProduct(self, Point2D vec) -> double"""
1506 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1507
1508 def GetCrossProduct(*args, **kwargs):
1509 """GetCrossProduct(self, Point2D vec) -> double"""
1510 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1511
1512 def __neg__(*args, **kwargs):
1513 """
1514 __neg__(self) -> Point2D
1515
1516 the reflection of this point
1517 """
1518 return _core_.Point2D___neg__(*args, **kwargs)
1519
1520 def __iadd__(*args, **kwargs):
1521 """__iadd__(self, Point2D pt) -> Point2D"""
1522 return _core_.Point2D___iadd__(*args, **kwargs)
1523
1524 def __isub__(*args, **kwargs):
1525 """__isub__(self, Point2D pt) -> Point2D"""
1526 return _core_.Point2D___isub__(*args, **kwargs)
1527
1528 def __imul__(*args, **kwargs):
1529 """__imul__(self, Point2D pt) -> Point2D"""
1530 return _core_.Point2D___imul__(*args, **kwargs)
1531
1532 def __idiv__(*args, **kwargs):
1533 """__idiv__(self, Point2D pt) -> Point2D"""
1534 return _core_.Point2D___idiv__(*args, **kwargs)
1535
1536 def __eq__(*args, **kwargs):
1537 """
1538 __eq__(self, PyObject other) -> bool
1539
1540 Test for equality of wx.Point2D objects.
1541 """
1542 return _core_.Point2D___eq__(*args, **kwargs)
1543
1544 def __ne__(*args, **kwargs):
1545 """
1546 __ne__(self, PyObject other) -> bool
1547
1548 Test for inequality of wx.Point2D objects.
1549 """
1550 return _core_.Point2D___ne__(*args, **kwargs)
1551
1552 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1553 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1554 def Set(*args, **kwargs):
1555 """Set(self, double x=0, double y=0)"""
1556 return _core_.Point2D_Set(*args, **kwargs)
1557
1558 def Get(*args, **kwargs):
1559 """
1560 Get() -> (x,y)
1561
1562 Return x and y properties as a tuple.
1563 """
1564 return _core_.Point2D_Get(*args, **kwargs)
1565
1566 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1567 def __str__(self): return str(self.Get())
1568 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1569 def __len__(self): return len(self.Get())
1570 def __getitem__(self, index): return self.Get()[index]
1571 def __setitem__(self, index, val):
1572 if index == 0: self.x = val
1573 elif index == 1: self.y = val
1574 else: raise IndexError
1575 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1576 __safe_for_unpickling__ = True
1577 def __reduce__(self): return (wx.Point2D, self.Get())
1578
1579 Point2D_swigregister = _core_.Point2D_swigregister
1580 Point2D_swigregister(Point2D)
1581
1582 def Point2DCopy(*args, **kwargs):
1583 """
1584 Point2DCopy(Point2D pt) -> Point2D
1585
1586 Create a w.Point2D object.
1587 """
1588 val = _core_.new_Point2DCopy(*args, **kwargs)
1589 return val
1590
1591 def Point2DFromPoint(*args, **kwargs):
1592 """
1593 Point2DFromPoint(Point pt) -> Point2D
1594
1595 Create a w.Point2D object.
1596 """
1597 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1598 return val
1599
1600 #---------------------------------------------------------------------------
1601
1602 FromStart = _core_.FromStart
1603 FromCurrent = _core_.FromCurrent
1604 FromEnd = _core_.FromEnd
1605 class InputStream(object):
1606 """Proxy of C++ InputStream class"""
1607 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1608 __repr__ = _swig_repr
1609 def __init__(self, *args, **kwargs):
1610 """__init__(self, PyObject p) -> InputStream"""
1611 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1612 __swig_destroy__ = _core_.delete_InputStream
1613 __del__ = lambda self : None;
1614 def close(*args, **kwargs):
1615 """close(self)"""
1616 return _core_.InputStream_close(*args, **kwargs)
1617
1618 def flush(*args, **kwargs):
1619 """flush(self)"""
1620 return _core_.InputStream_flush(*args, **kwargs)
1621
1622 def eof(*args, **kwargs):
1623 """eof(self) -> bool"""
1624 return _core_.InputStream_eof(*args, **kwargs)
1625
1626 def read(*args, **kwargs):
1627 """read(self, int size=-1) -> PyObject"""
1628 return _core_.InputStream_read(*args, **kwargs)
1629
1630 def readline(*args, **kwargs):
1631 """readline(self, int size=-1) -> PyObject"""
1632 return _core_.InputStream_readline(*args, **kwargs)
1633
1634 def readlines(*args, **kwargs):
1635 """readlines(self, int sizehint=-1) -> PyObject"""
1636 return _core_.InputStream_readlines(*args, **kwargs)
1637
1638 def seek(*args, **kwargs):
1639 """seek(self, int offset, int whence=0)"""
1640 return _core_.InputStream_seek(*args, **kwargs)
1641
1642 def tell(*args, **kwargs):
1643 """tell(self) -> int"""
1644 return _core_.InputStream_tell(*args, **kwargs)
1645
1646 def Peek(*args, **kwargs):
1647 """Peek(self) -> char"""
1648 return _core_.InputStream_Peek(*args, **kwargs)
1649
1650 def GetC(*args, **kwargs):
1651 """GetC(self) -> char"""
1652 return _core_.InputStream_GetC(*args, **kwargs)
1653
1654 def LastRead(*args, **kwargs):
1655 """LastRead(self) -> size_t"""
1656 return _core_.InputStream_LastRead(*args, **kwargs)
1657
1658 def CanRead(*args, **kwargs):
1659 """CanRead(self) -> bool"""
1660 return _core_.InputStream_CanRead(*args, **kwargs)
1661
1662 def Eof(*args, **kwargs):
1663 """Eof(self) -> bool"""
1664 return _core_.InputStream_Eof(*args, **kwargs)
1665
1666 def Ungetch(*args, **kwargs):
1667 """Ungetch(self, char c) -> bool"""
1668 return _core_.InputStream_Ungetch(*args, **kwargs)
1669
1670 def SeekI(*args, **kwargs):
1671 """SeekI(self, long pos, int mode=FromStart) -> long"""
1672 return _core_.InputStream_SeekI(*args, **kwargs)
1673
1674 def TellI(*args, **kwargs):
1675 """TellI(self) -> long"""
1676 return _core_.InputStream_TellI(*args, **kwargs)
1677
1678 InputStream_swigregister = _core_.InputStream_swigregister
1679 InputStream_swigregister(InputStream)
1680 DefaultPosition = cvar.DefaultPosition
1681 DefaultSize = cvar.DefaultSize
1682
1683 class OutputStream(object):
1684 """Proxy of C++ OutputStream class"""
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 def __init__(self): raise AttributeError, "No constructor defined"
1687 __repr__ = _swig_repr
1688 def write(*args, **kwargs):
1689 """write(self, PyObject obj)"""
1690 return _core_.OutputStream_write(*args, **kwargs)
1691
1692 def LastWrite(*args, **kwargs):
1693 """LastWrite(self) -> size_t"""
1694 return _core_.OutputStream_LastWrite(*args, **kwargs)
1695
1696 OutputStream_swigregister = _core_.OutputStream_swigregister
1697 OutputStream_swigregister(OutputStream)
1698
1699 #---------------------------------------------------------------------------
1700
1701 class FSFile(Object):
1702 """Proxy of C++ FSFile class"""
1703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1704 __repr__ = _swig_repr
1705 def __init__(self, *args, **kwargs):
1706 """
1707 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1708 DateTime modif) -> FSFile
1709 """
1710 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1711 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1712
1713 __swig_destroy__ = _core_.delete_FSFile
1714 __del__ = lambda self : None;
1715 def GetStream(*args, **kwargs):
1716 """GetStream(self) -> InputStream"""
1717 return _core_.FSFile_GetStream(*args, **kwargs)
1718
1719 def GetMimeType(*args, **kwargs):
1720 """GetMimeType(self) -> String"""
1721 return _core_.FSFile_GetMimeType(*args, **kwargs)
1722
1723 def GetLocation(*args, **kwargs):
1724 """GetLocation(self) -> String"""
1725 return _core_.FSFile_GetLocation(*args, **kwargs)
1726
1727 def GetAnchor(*args, **kwargs):
1728 """GetAnchor(self) -> String"""
1729 return _core_.FSFile_GetAnchor(*args, **kwargs)
1730
1731 def GetModificationTime(*args, **kwargs):
1732 """GetModificationTime(self) -> DateTime"""
1733 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1734
1735 FSFile_swigregister = _core_.FSFile_swigregister
1736 FSFile_swigregister(FSFile)
1737
1738 class CPPFileSystemHandler(object):
1739 """Proxy of C++ CPPFileSystemHandler class"""
1740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1741 def __init__(self): raise AttributeError, "No constructor defined"
1742 __repr__ = _swig_repr
1743 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1744 __del__ = lambda self : None;
1745 CPPFileSystemHandler_swigregister = _core_.CPPFileSystemHandler_swigregister
1746 CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1747
1748 class FileSystemHandler(CPPFileSystemHandler):
1749 """Proxy of C++ FileSystemHandler class"""
1750 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1751 __repr__ = _swig_repr
1752 def __init__(self, *args, **kwargs):
1753 """__init__(self) -> FileSystemHandler"""
1754 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1755 self._setCallbackInfo(self, FileSystemHandler)
1756
1757 def _setCallbackInfo(*args, **kwargs):
1758 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1759 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1760
1761 def CanOpen(*args, **kwargs):
1762 """CanOpen(self, String location) -> bool"""
1763 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1764
1765 def OpenFile(*args, **kwargs):
1766 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1767 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1768
1769 def FindFirst(*args, **kwargs):
1770 """FindFirst(self, String spec, int flags=0) -> String"""
1771 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1772
1773 def FindNext(*args, **kwargs):
1774 """FindNext(self) -> String"""
1775 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1776
1777 def GetProtocol(*args, **kwargs):
1778 """GetProtocol(self, String location) -> String"""
1779 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1780
1781 def GetLeftLocation(*args, **kwargs):
1782 """GetLeftLocation(self, String location) -> String"""
1783 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1784
1785 def GetAnchor(*args, **kwargs):
1786 """GetAnchor(self, String location) -> String"""
1787 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1788
1789 def GetRightLocation(*args, **kwargs):
1790 """GetRightLocation(self, String location) -> String"""
1791 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1792
1793 def GetMimeTypeFromExt(*args, **kwargs):
1794 """GetMimeTypeFromExt(self, String location) -> String"""
1795 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1796
1797 FileSystemHandler_swigregister = _core_.FileSystemHandler_swigregister
1798 FileSystemHandler_swigregister(FileSystemHandler)
1799
1800 class FileSystem(Object):
1801 """Proxy of C++ FileSystem class"""
1802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1803 __repr__ = _swig_repr
1804 def __init__(self, *args, **kwargs):
1805 """__init__(self) -> FileSystem"""
1806 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1807 __swig_destroy__ = _core_.delete_FileSystem
1808 __del__ = lambda self : None;
1809 def ChangePathTo(*args, **kwargs):
1810 """ChangePathTo(self, String location, bool is_dir=False)"""
1811 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1812
1813 def GetPath(*args, **kwargs):
1814 """GetPath(self) -> String"""
1815 return _core_.FileSystem_GetPath(*args, **kwargs)
1816
1817 def OpenFile(*args, **kwargs):
1818 """OpenFile(self, String location) -> FSFile"""
1819 return _core_.FileSystem_OpenFile(*args, **kwargs)
1820
1821 def FindFirst(*args, **kwargs):
1822 """FindFirst(self, String spec, int flags=0) -> String"""
1823 return _core_.FileSystem_FindFirst(*args, **kwargs)
1824
1825 def FindNext(*args, **kwargs):
1826 """FindNext(self) -> String"""
1827 return _core_.FileSystem_FindNext(*args, **kwargs)
1828
1829 def AddHandler(*args, **kwargs):
1830 """AddHandler(CPPFileSystemHandler handler)"""
1831 return _core_.FileSystem_AddHandler(*args, **kwargs)
1832
1833 AddHandler = staticmethod(AddHandler)
1834 def CleanUpHandlers(*args, **kwargs):
1835 """CleanUpHandlers()"""
1836 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1837
1838 CleanUpHandlers = staticmethod(CleanUpHandlers)
1839 def FileNameToURL(*args, **kwargs):
1840 """FileNameToURL(String filename) -> String"""
1841 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1842
1843 FileNameToURL = staticmethod(FileNameToURL)
1844 def URLToFileName(*args, **kwargs):
1845 """URLToFileName(String url) -> String"""
1846 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1847
1848 URLToFileName = staticmethod(URLToFileName)
1849 FileSystem_swigregister = _core_.FileSystem_swigregister
1850 FileSystem_swigregister(FileSystem)
1851
1852 def FileSystem_AddHandler(*args, **kwargs):
1853 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1854 return _core_.FileSystem_AddHandler(*args, **kwargs)
1855
1856 def FileSystem_CleanUpHandlers(*args):
1857 """FileSystem_CleanUpHandlers()"""
1858 return _core_.FileSystem_CleanUpHandlers(*args)
1859
1860 def FileSystem_FileNameToURL(*args, **kwargs):
1861 """FileSystem_FileNameToURL(String filename) -> String"""
1862 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1863
1864 def FileSystem_URLToFileName(*args, **kwargs):
1865 """FileSystem_URLToFileName(String url) -> String"""
1866 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1867
1868 class InternetFSHandler(CPPFileSystemHandler):
1869 """Proxy of C++ InternetFSHandler class"""
1870 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1871 __repr__ = _swig_repr
1872 def __init__(self, *args, **kwargs):
1873 """__init__(self) -> InternetFSHandler"""
1874 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1875 def CanOpen(*args, **kwargs):
1876 """CanOpen(self, String location) -> bool"""
1877 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1878
1879 def OpenFile(*args, **kwargs):
1880 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1881 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1882
1883 InternetFSHandler_swigregister = _core_.InternetFSHandler_swigregister
1884 InternetFSHandler_swigregister(InternetFSHandler)
1885
1886 class ZipFSHandler(CPPFileSystemHandler):
1887 """Proxy of C++ ZipFSHandler class"""
1888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1889 __repr__ = _swig_repr
1890 def __init__(self, *args, **kwargs):
1891 """__init__(self) -> ZipFSHandler"""
1892 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1893 def CanOpen(*args, **kwargs):
1894 """CanOpen(self, String location) -> bool"""
1895 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1896
1897 def OpenFile(*args, **kwargs):
1898 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1899 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1900
1901 def FindFirst(*args, **kwargs):
1902 """FindFirst(self, String spec, int flags=0) -> String"""
1903 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1904
1905 def FindNext(*args, **kwargs):
1906 """FindNext(self) -> String"""
1907 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1908
1909 ZipFSHandler_swigregister = _core_.ZipFSHandler_swigregister
1910 ZipFSHandler_swigregister(ZipFSHandler)
1911
1912
1913 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1914 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1915 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1916
1917 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1918 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1919 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1920
1921 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1922 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1923 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1924 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1925 """
1926 Add 'file' to the memory filesystem. The dataItem parameter can
1927 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1928 arbitrary data. If a bitmap or image is used then the imgType
1929 parameter should specify what kind of image file it should be
1930 written as, wx.BITMAP_TYPE_PNG, etc.
1931 """
1932 if isinstance(dataItem, wx.Image):
1933 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1934 elif isinstance(dataItem, wx.Bitmap):
1935 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1936 elif type(dataItem) == str:
1937 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1938 else:
1939 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1940
1941 class MemoryFSHandler(CPPFileSystemHandler):
1942 """Proxy of C++ MemoryFSHandler class"""
1943 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1944 __repr__ = _swig_repr
1945 def __init__(self, *args, **kwargs):
1946 """__init__(self) -> MemoryFSHandler"""
1947 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1948 def RemoveFile(*args, **kwargs):
1949 """RemoveFile(String filename)"""
1950 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1951
1952 RemoveFile = staticmethod(RemoveFile)
1953 AddFile = staticmethod(MemoryFSHandler_AddFile)
1954 def CanOpen(*args, **kwargs):
1955 """CanOpen(self, String location) -> bool"""
1956 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1957
1958 def OpenFile(*args, **kwargs):
1959 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1960 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1961
1962 def FindFirst(*args, **kwargs):
1963 """FindFirst(self, String spec, int flags=0) -> String"""
1964 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1965
1966 def FindNext(*args, **kwargs):
1967 """FindNext(self) -> String"""
1968 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1969
1970 MemoryFSHandler_swigregister = _core_.MemoryFSHandler_swigregister
1971 MemoryFSHandler_swigregister(MemoryFSHandler)
1972
1973 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1974 """MemoryFSHandler_RemoveFile(String filename)"""
1975 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1976
1977 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1978 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1979 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1980 #---------------------------------------------------------------------------
1981
1982 class ImageHandler(Object):
1983 """
1984 This is the base class for implementing image file loading/saving, and
1985 image creation from data. It is used within `wx.Image` and is not
1986 normally seen by the application.
1987 """
1988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1989 def __init__(self): raise AttributeError, "No constructor defined"
1990 __repr__ = _swig_repr
1991 def GetName(*args, **kwargs):
1992 """GetName(self) -> String"""
1993 return _core_.ImageHandler_GetName(*args, **kwargs)
1994
1995 def GetExtension(*args, **kwargs):
1996 """GetExtension(self) -> String"""
1997 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1998
1999 def GetType(*args, **kwargs):
2000 """GetType(self) -> long"""
2001 return _core_.ImageHandler_GetType(*args, **kwargs)
2002
2003 def GetMimeType(*args, **kwargs):
2004 """GetMimeType(self) -> String"""
2005 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2006
2007 def CanRead(*args, **kwargs):
2008 """CanRead(self, String name) -> bool"""
2009 return _core_.ImageHandler_CanRead(*args, **kwargs)
2010
2011 def SetName(*args, **kwargs):
2012 """SetName(self, String name)"""
2013 return _core_.ImageHandler_SetName(*args, **kwargs)
2014
2015 def SetExtension(*args, **kwargs):
2016 """SetExtension(self, String extension)"""
2017 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2018
2019 def SetType(*args, **kwargs):
2020 """SetType(self, long type)"""
2021 return _core_.ImageHandler_SetType(*args, **kwargs)
2022
2023 def SetMimeType(*args, **kwargs):
2024 """SetMimeType(self, String mimetype)"""
2025 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2026
2027 ImageHandler_swigregister = _core_.ImageHandler_swigregister
2028 ImageHandler_swigregister(ImageHandler)
2029
2030 class PyImageHandler(ImageHandler):
2031 """
2032 This is the base class for implementing image file loading/saving, and
2033 image creation from data, all written in Python. To create a custom
2034 image handler derive a new class from wx.PyImageHandler and provide
2035 the following methods::
2036
2037 def DoCanRead(self, stream) --> bool
2038 '''Check if this handler can read the image on the stream'''
2039
2040 def LoadFile(self, image, stream, verbose, index) --> bool
2041 '''Load image data from the stream and load it into image.'''
2042
2043 def SaveFile(self, image, stream, verbose) --> bool
2044 '''Save the iamge data in image to the stream using
2045 this handler's image file format.'''
2046
2047 def GetImageCount(self, stream) --> int
2048 '''If this image format can hold more than one image,
2049 how many does the image on the stream have?'''
2050
2051 To activate your handler create an instance of it and pass it to
2052 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2053 `SetExtension` from your constructor.
2054
2055 """
2056 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2057 __repr__ = _swig_repr
2058 def __init__(self, *args, **kwargs):
2059 """
2060 __init__(self) -> PyImageHandler
2061
2062 This is the base class for implementing image file loading/saving, and
2063 image creation from data, all written in Python. To create a custom
2064 image handler derive a new class from wx.PyImageHandler and provide
2065 the following methods::
2066
2067 def DoCanRead(self, stream) --> bool
2068 '''Check if this handler can read the image on the stream'''
2069
2070 def LoadFile(self, image, stream, verbose, index) --> bool
2071 '''Load image data from the stream and load it into image.'''
2072
2073 def SaveFile(self, image, stream, verbose) --> bool
2074 '''Save the iamge data in image to the stream using
2075 this handler's image file format.'''
2076
2077 def GetImageCount(self, stream) --> int
2078 '''If this image format can hold more than one image,
2079 how many does the image on the stream have?'''
2080
2081 To activate your handler create an instance of it and pass it to
2082 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2083 `SetExtension` from your constructor.
2084
2085 """
2086 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2087 self._SetSelf(self)
2088
2089 def _SetSelf(*args, **kwargs):
2090 """_SetSelf(self, PyObject self)"""
2091 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2092
2093 PyImageHandler_swigregister = _core_.PyImageHandler_swigregister
2094 PyImageHandler_swigregister(PyImageHandler)
2095
2096 class ImageHistogram(object):
2097 """Proxy of C++ ImageHistogram class"""
2098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2099 __repr__ = _swig_repr
2100 def __init__(self, *args, **kwargs):
2101 """__init__(self) -> ImageHistogram"""
2102 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2103 def MakeKey(*args, **kwargs):
2104 """
2105 MakeKey(byte r, byte g, byte b) -> unsigned long
2106
2107 Get the key in the histogram for the given RGB values
2108 """
2109 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2110
2111 MakeKey = staticmethod(MakeKey)
2112 def FindFirstUnusedColour(*args, **kwargs):
2113 """
2114 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2115
2116 Find first colour that is not used in the image and has higher RGB
2117 values than startR, startG, startB. Returns a tuple consisting of a
2118 success flag and rgb values.
2119 """
2120 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2121
2122 def GetCount(*args, **kwargs):
2123 """
2124 GetCount(self, unsigned long key) -> unsigned long
2125
2126 Returns the pixel count for the given key. Use `MakeKey` to create a
2127 key value from a RGB tripple.
2128 """
2129 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2130
2131 def GetCountRGB(*args, **kwargs):
2132 """
2133 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2134
2135 Returns the pixel count for the given RGB values.
2136 """
2137 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2138
2139 def GetCountColour(*args, **kwargs):
2140 """
2141 GetCountColour(self, Colour colour) -> unsigned long
2142
2143 Returns the pixel count for the given `wx.Colour` value.
2144 """
2145 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2146
2147 ImageHistogram_swigregister = _core_.ImageHistogram_swigregister
2148 ImageHistogram_swigregister(ImageHistogram)
2149
2150 def ImageHistogram_MakeKey(*args, **kwargs):
2151 """
2152 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2153
2154 Get the key in the histogram for the given RGB values
2155 """
2156 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2157
2158 class Image_RGBValue(object):
2159 """
2160 An object that contains values for red, green and blue which represent
2161 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2162 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2163 color space.
2164 """
2165 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2166 __repr__ = _swig_repr
2167 def __init__(self, *args, **kwargs):
2168 """
2169 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2170
2171 Constructor.
2172 """
2173 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2174 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2175 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2176 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2177 Image_RGBValue_swigregister = _core_.Image_RGBValue_swigregister
2178 Image_RGBValue_swigregister(Image_RGBValue)
2179
2180 class Image_HSVValue(object):
2181 """
2182 An object that contains values for hue, saturation and value which
2183 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2184 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2185 color space.
2186 """
2187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2188 __repr__ = _swig_repr
2189 def __init__(self, *args, **kwargs):
2190 """
2191 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2192
2193 Constructor.
2194 """
2195 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2196 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2197 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2198 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2199 Image_HSVValue_swigregister = _core_.Image_HSVValue_swigregister
2200 Image_HSVValue_swigregister(Image_HSVValue)
2201
2202 class Image(Object):
2203 """
2204 A platform-independent image class. An image can be created from
2205 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2206 variety of formats. Functions are available to set and get image
2207 bits, so it can be used for basic image manipulation.
2208
2209 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2210 platform-specific `wx.Bitmap` object must be created from it using the
2211 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2212 device context, using `wx.DC.DrawBitmap`.
2213
2214 One colour value of the image may be used as a mask colour which will
2215 lead to the automatic creation of a `wx.Mask` object associated to the
2216 bitmap object.
2217
2218 wx.Image supports alpha channel data, that is in addition to a byte
2219 for the red, green and blue colour components for each pixel it also
2220 stores a byte representing the pixel opacity. An alpha value of 0
2221 corresponds to a transparent pixel (null opacity) while a value of 255
2222 means that the pixel is 100% opaque.
2223
2224 Unlike RGB data, not all images have an alpha channel and before using
2225 `GetAlpha` you should check if this image contains an alpha channel
2226 with `HasAlpha`. Note that currently only images loaded from PNG files
2227 with transparency information will have an alpha channel.
2228 """
2229 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2230 __repr__ = _swig_repr
2231 def __init__(self, *args, **kwargs):
2232 """
2233 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2234
2235 Loads an image from a file.
2236 """
2237 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2238 __swig_destroy__ = _core_.delete_Image
2239 __del__ = lambda self : None;
2240 def Create(*args, **kwargs):
2241 """
2242 Create(self, int width, int height, bool clear=True)
2243
2244 Creates a fresh image. If clear is ``True``, the new image will be
2245 initialized to black. Otherwise, the image data will be uninitialized.
2246 """
2247 return _core_.Image_Create(*args, **kwargs)
2248
2249 def Destroy(*args, **kwargs):
2250 """
2251 Destroy(self)
2252
2253 Destroys the image data.
2254 """
2255 val = _core_.Image_Destroy(*args, **kwargs)
2256 args[0].thisown = 0
2257 return val
2258
2259 def Scale(*args, **kwargs):
2260 """
2261 Scale(self, int width, int height) -> Image
2262
2263 Returns a scaled version of the image. This is also useful for scaling
2264 bitmaps in general as the only other way to scale bitmaps is to blit a
2265 `wx.MemoryDC` into another `wx.MemoryDC`.
2266 """
2267 return _core_.Image_Scale(*args, **kwargs)
2268
2269 def ShrinkBy(*args, **kwargs):
2270 """
2271 ShrinkBy(self, int xFactor, int yFactor) -> Image
2272
2273 Return a version of the image scaled smaller by the given factors.
2274 """
2275 return _core_.Image_ShrinkBy(*args, **kwargs)
2276
2277 def Rescale(*args, **kwargs):
2278 """
2279 Rescale(self, int width, int height) -> Image
2280
2281 Changes the size of the image in-place by scaling it: after a call to
2282 this function, the image will have the given width and height.
2283
2284 Returns the (modified) image itself.
2285 """
2286 return _core_.Image_Rescale(*args, **kwargs)
2287
2288 def Resize(*args, **kwargs):
2289 """
2290 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2291
2292 Changes the size of the image in-place without scaling it, by adding
2293 either a border with the given colour or cropping as necessary. The
2294 image is pasted into a new image with the given size and background
2295 colour at the position pos relative to the upper left of the new
2296 image. If red = green = blue = -1 then use either the current mask
2297 colour if set or find, use, and set a suitable mask colour for any
2298 newly exposed areas.
2299
2300 Returns the (modified) image itself.
2301 """
2302 return _core_.Image_Resize(*args, **kwargs)
2303
2304 def SetRGB(*args, **kwargs):
2305 """
2306 SetRGB(self, int x, int y, byte r, byte g, byte b)
2307
2308 Sets the pixel at the given coordinate. This routine performs
2309 bounds-checks for the coordinate so it can be considered a safe way to
2310 manipulate the data, but in some cases this might be too slow so that
2311 the data will have to be set directly. In that case you will have to
2312 get access to the image data using the `GetData` method.
2313 """
2314 return _core_.Image_SetRGB(*args, **kwargs)
2315
2316 def SetRGBRect(*args, **kwargs):
2317 """
2318 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2319
2320 Sets the colour of the pixels within the given rectangle. This routine
2321 performs bounds-checks for the rectangle so it can be considered a
2322 safe way to manipulate the data.
2323 """
2324 return _core_.Image_SetRGBRect(*args, **kwargs)
2325
2326 def GetRed(*args, **kwargs):
2327 """
2328 GetRed(self, int x, int y) -> byte
2329
2330 Returns the red intensity at the given coordinate.
2331 """
2332 return _core_.Image_GetRed(*args, **kwargs)
2333
2334 def GetGreen(*args, **kwargs):
2335 """
2336 GetGreen(self, int x, int y) -> byte
2337
2338 Returns the green intensity at the given coordinate.
2339 """
2340 return _core_.Image_GetGreen(*args, **kwargs)
2341
2342 def GetBlue(*args, **kwargs):
2343 """
2344 GetBlue(self, int x, int y) -> byte
2345
2346 Returns the blue intensity at the given coordinate.
2347 """
2348 return _core_.Image_GetBlue(*args, **kwargs)
2349
2350 def SetAlpha(*args, **kwargs):
2351 """
2352 SetAlpha(self, int x, int y, byte alpha)
2353
2354 Sets the alpha value for the given pixel. This function should only be
2355 called if the image has alpha channel data, use `HasAlpha` to check
2356 for this.
2357 """
2358 return _core_.Image_SetAlpha(*args, **kwargs)
2359
2360 def GetAlpha(*args, **kwargs):
2361 """
2362 GetAlpha(self, int x, int y) -> byte
2363
2364 Returns the alpha value for the given pixel. This function may only be
2365 called for the images with alpha channel, use `HasAlpha` to check for
2366 this.
2367
2368 The returned value is the *opacity* of the image, i.e. the value of 0
2369 corresponds to the fully transparent pixels while the value of 255 to
2370 the fully opaque pixels.
2371 """
2372 return _core_.Image_GetAlpha(*args, **kwargs)
2373
2374 def HasAlpha(*args, **kwargs):
2375 """
2376 HasAlpha(self) -> bool
2377
2378 Returns true if this image has alpha channel, false otherwise.
2379 """
2380 return _core_.Image_HasAlpha(*args, **kwargs)
2381
2382 def InitAlpha(*args, **kwargs):
2383 """
2384 InitAlpha(self)
2385
2386 Initializes the image alpha channel data. It is an error to call it if
2387 the image already has alpha data. If it doesn't, alpha data will be by
2388 default initialized to all pixels being fully opaque. But if the image
2389 has a a mask colour, all mask pixels will be completely transparent.
2390 """
2391 return _core_.Image_InitAlpha(*args, **kwargs)
2392
2393 def IsTransparent(*args, **kwargs):
2394 """
2395 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2396
2397 Returns ``True`` if this pixel is masked or has an alpha value less
2398 than the spcified threshold.
2399 """
2400 return _core_.Image_IsTransparent(*args, **kwargs)
2401
2402 def FindFirstUnusedColour(*args, **kwargs):
2403 """
2404 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2405
2406 Find first colour that is not used in the image and has higher RGB
2407 values than startR, startG, startB. Returns a tuple consisting of a
2408 success flag and rgb values.
2409 """
2410 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2411
2412 def ConvertAlphaToMask(*args, **kwargs):
2413 """
2414 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2415
2416 If the image has alpha channel, this method converts it to mask. All
2417 pixels with alpha value less than ``threshold`` are replaced with the
2418 mask colour and the alpha channel is removed. The mask colour is
2419 chosen automatically using `FindFirstUnusedColour`.
2420
2421 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2422 nothing.
2423 """
2424 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2425
2426 def ConvertColourToAlpha(*args, **kwargs):
2427 """
2428 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2429
2430 This method converts an image where the original alpha information is
2431 only available as a shades of a colour (actually shades of grey)
2432 typically when you draw anti-aliased text into a bitmap. The DC
2433 drawing routines draw grey values on the black background although
2434 they actually mean to draw white with differnt alpha values. This
2435 method reverses it, assuming a black (!) background and white text.
2436 The method will then fill up the whole image with the colour given.
2437 """
2438 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2439
2440 def SetMaskFromImage(*args, **kwargs):
2441 """
2442 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2443
2444 Sets the image's mask so that the pixels that have RGB value of
2445 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2446 by first finding an unused colour in the image, setting this colour as
2447 the mask colour and then using this colour to draw all pixels in the
2448 image who corresponding pixel in mask has given RGB value.
2449
2450 Returns ``False`` if ``mask`` does not have same dimensions as the
2451 image or if there is no unused colour left. Returns ``True`` if the
2452 mask was successfully applied.
2453
2454 Note that this method involves computing the histogram, which is
2455 computationally intensive operation.
2456 """
2457 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2458
2459 def CanRead(*args, **kwargs):
2460 """
2461 CanRead(String filename) -> bool
2462
2463 Returns True if the image handlers can read this file.
2464 """
2465 return _core_.Image_CanRead(*args, **kwargs)
2466
2467 CanRead = staticmethod(CanRead)
2468 def GetImageCount(*args, **kwargs):
2469 """
2470 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2471
2472 If the image file contains more than one image and the image handler
2473 is capable of retrieving these individually, this function will return
2474 the number of available images.
2475 """
2476 return _core_.Image_GetImageCount(*args, **kwargs)
2477
2478 GetImageCount = staticmethod(GetImageCount)
2479 def LoadFile(*args, **kwargs):
2480 """
2481 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2482
2483 Loads an image from a file. If no handler type is provided, the
2484 library will try to autodetect the format.
2485 """
2486 return _core_.Image_LoadFile(*args, **kwargs)
2487
2488 def LoadMimeFile(*args, **kwargs):
2489 """
2490 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2491
2492 Loads an image from a file, specifying the image type with a MIME type
2493 string.
2494 """
2495 return _core_.Image_LoadMimeFile(*args, **kwargs)
2496
2497 def SaveFile(*args, **kwargs):
2498 """
2499 SaveFile(self, String name, int type) -> bool
2500
2501 Saves an image in the named file.
2502 """
2503 return _core_.Image_SaveFile(*args, **kwargs)
2504
2505 def SaveMimeFile(*args, **kwargs):
2506 """
2507 SaveMimeFile(self, String name, String mimetype) -> bool
2508
2509 Saves an image in the named file.
2510 """
2511 return _core_.Image_SaveMimeFile(*args, **kwargs)
2512
2513 def CanReadStream(*args, **kwargs):
2514 """
2515 CanReadStream(InputStream stream) -> bool
2516
2517 Returns True if the image handlers can read an image file from the
2518 data currently on the input stream, or a readable Python file-like
2519 object.
2520 """
2521 return _core_.Image_CanReadStream(*args, **kwargs)
2522
2523 CanReadStream = staticmethod(CanReadStream)
2524 def LoadStream(*args, **kwargs):
2525 """
2526 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2527
2528 Loads an image from an input stream or a readable Python file-like
2529 object. If no handler type is provided, the library will try to
2530 autodetect the format.
2531 """
2532 return _core_.Image_LoadStream(*args, **kwargs)
2533
2534 def LoadMimeStream(*args, **kwargs):
2535 """
2536 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2537
2538 Loads an image from an input stream or a readable Python file-like
2539 object, using a MIME type string to specify the image file format.
2540 """
2541 return _core_.Image_LoadMimeStream(*args, **kwargs)
2542
2543 def Ok(*args, **kwargs):
2544 """
2545 Ok(self) -> bool
2546
2547 Returns true if image data is present.
2548 """
2549 return _core_.Image_Ok(*args, **kwargs)
2550
2551 def GetWidth(*args, **kwargs):
2552 """
2553 GetWidth(self) -> int
2554
2555 Gets the width of the image in pixels.
2556 """
2557 return _core_.Image_GetWidth(*args, **kwargs)
2558
2559 def GetHeight(*args, **kwargs):
2560 """
2561 GetHeight(self) -> int
2562
2563 Gets the height of the image in pixels.
2564 """
2565 return _core_.Image_GetHeight(*args, **kwargs)
2566
2567 def GetSize(*args, **kwargs):
2568 """
2569 GetSize(self) -> Size
2570
2571 Returns the size of the image in pixels.
2572 """
2573 return _core_.Image_GetSize(*args, **kwargs)
2574
2575 def GetSubImage(*args, **kwargs):
2576 """
2577 GetSubImage(self, Rect rect) -> Image
2578
2579 Returns a sub image of the current one as long as the rect belongs
2580 entirely to the image.
2581 """
2582 return _core_.Image_GetSubImage(*args, **kwargs)
2583
2584 def Size(*args, **kwargs):
2585 """
2586 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2587
2588 Returns a resized version of this image without scaling it by adding
2589 either a border with the given colour or cropping as necessary. The
2590 image is pasted into a new image with the given size and background
2591 colour at the position ``pos`` relative to the upper left of the new
2592 image. If red = green = blue = -1 then use either the current mask
2593 colour if set or find, use, and set a suitable mask colour for any
2594 newly exposed areas.
2595 """
2596 return _core_.Image_Size(*args, **kwargs)
2597
2598 def Copy(*args, **kwargs):
2599 """
2600 Copy(self) -> Image
2601
2602 Returns an identical copy of the image.
2603 """
2604 return _core_.Image_Copy(*args, **kwargs)
2605
2606 def Paste(*args, **kwargs):
2607 """
2608 Paste(self, Image image, int x, int y)
2609
2610 Pastes ``image`` into this instance and takes care of the mask colour
2611 and any out of bounds problems.
2612 """
2613 return _core_.Image_Paste(*args, **kwargs)
2614
2615 def GetData(*args, **kwargs):
2616 """
2617 GetData(self) -> PyObject
2618
2619 Returns a string containing a copy of the RGB bytes of the image.
2620 """
2621 return _core_.Image_GetData(*args, **kwargs)
2622
2623 def SetData(*args, **kwargs):
2624 """
2625 SetData(self, buffer data)
2626
2627 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2628 either a string or a buffer object holding the data and the length of
2629 the data must be width*height*3.
2630 """
2631 return _core_.Image_SetData(*args, **kwargs)
2632
2633 def GetDataBuffer(*args, **kwargs):
2634 """
2635 GetDataBuffer(self) -> PyObject
2636
2637 Returns a writable Python buffer object that is pointing at the RGB
2638 image data buffer inside the wx.Image. You need to ensure that you do
2639 not use this buffer object after the image has been destroyed.
2640 """
2641 return _core_.Image_GetDataBuffer(*args, **kwargs)
2642
2643 def SetDataBuffer(*args, **kwargs):
2644 """
2645 SetDataBuffer(self, buffer data)
2646
2647 Sets the internal image data pointer to point at a Python buffer
2648 object. This can save making an extra copy of the data but you must
2649 ensure that the buffer object lives longer than the wx.Image does.
2650 """
2651 return _core_.Image_SetDataBuffer(*args, **kwargs)
2652
2653 def GetAlphaData(*args, **kwargs):
2654 """
2655 GetAlphaData(self) -> PyObject
2656
2657 Returns a string containing a copy of the alpha bytes of the image.
2658 """
2659 return _core_.Image_GetAlphaData(*args, **kwargs)
2660
2661 def SetAlphaData(*args, **kwargs):
2662 """
2663 SetAlphaData(self, buffer alpha)
2664
2665 Resets the Image's alpha data from a buffer of bytes. Accepts either
2666 a string or a buffer object holding the data and the length of the
2667 data must be width*height.
2668 """
2669 return _core_.Image_SetAlphaData(*args, **kwargs)
2670
2671 def GetAlphaBuffer(*args, **kwargs):
2672 """GetAlphaBuffer(self) -> PyObject"""
2673 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2674
2675 def SetAlphaBuffer(*args, **kwargs):
2676 """SetAlphaBuffer(self, buffer alpha)"""
2677 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2678
2679 def SetMaskColour(*args, **kwargs):
2680 """
2681 SetMaskColour(self, byte r, byte g, byte b)
2682
2683 Sets the mask colour for this image (and tells the image to use the
2684 mask).
2685 """
2686 return _core_.Image_SetMaskColour(*args, **kwargs)
2687
2688 def GetOrFindMaskColour(*args, **kwargs):
2689 """
2690 GetOrFindMaskColour() -> (r,g,b)
2691
2692 Get the current mask colour or find a suitable colour.
2693 """
2694 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2695
2696 def GetMaskRed(*args, **kwargs):
2697 """
2698 GetMaskRed(self) -> byte
2699
2700 Gets the red component of the mask colour.
2701 """
2702 return _core_.Image_GetMaskRed(*args, **kwargs)
2703
2704 def GetMaskGreen(*args, **kwargs):
2705 """
2706 GetMaskGreen(self) -> byte
2707
2708 Gets the green component of the mask colour.
2709 """
2710 return _core_.Image_GetMaskGreen(*args, **kwargs)
2711
2712 def GetMaskBlue(*args, **kwargs):
2713 """
2714 GetMaskBlue(self) -> byte
2715
2716 Gets the blue component of the mask colour.
2717 """
2718 return _core_.Image_GetMaskBlue(*args, **kwargs)
2719
2720 def SetMask(*args, **kwargs):
2721 """
2722 SetMask(self, bool mask=True)
2723
2724 Specifies whether there is a mask or not. The area of the mask is
2725 determined by the current mask colour.
2726 """
2727 return _core_.Image_SetMask(*args, **kwargs)
2728
2729 def HasMask(*args, **kwargs):
2730 """
2731 HasMask(self) -> bool
2732
2733 Returns ``True`` if there is a mask active, ``False`` otherwise.
2734 """
2735 return _core_.Image_HasMask(*args, **kwargs)
2736
2737 def Rotate(*args, **kwargs):
2738 """
2739 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2740 Point offset_after_rotation=None) -> Image
2741
2742 Rotates the image about the given point, by ``angle`` radians. Passing
2743 ``True`` to ``interpolating`` results in better image quality, but is
2744 slower. If the image has a mask, then the mask colour is used for the
2745 uncovered pixels in the rotated image background. Otherwise, black
2746 will be used as the fill colour.
2747
2748 Returns the rotated image, leaving this image intact.
2749 """
2750 return _core_.Image_Rotate(*args, **kwargs)
2751
2752 def Rotate90(*args, **kwargs):
2753 """
2754 Rotate90(self, bool clockwise=True) -> Image
2755
2756 Returns a copy of the image rotated 90 degrees in the direction
2757 indicated by ``clockwise``.
2758 """
2759 return _core_.Image_Rotate90(*args, **kwargs)
2760
2761 def Mirror(*args, **kwargs):
2762 """
2763 Mirror(self, bool horizontally=True) -> Image
2764
2765 Returns a mirrored copy of the image. The parameter ``horizontally``
2766 indicates the orientation.
2767 """
2768 return _core_.Image_Mirror(*args, **kwargs)
2769
2770 def Replace(*args, **kwargs):
2771 """
2772 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2773
2774 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2775 ``(r2,g2,b2)``.
2776 """
2777 return _core_.Image_Replace(*args, **kwargs)
2778
2779 def ConvertToGreyscale(*args, **kwargs):
2780 """
2781 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2782
2783 Convert to greyscale image. Uses the luminance component (Y) of the
2784 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2785 defaults to ITU-T BT.601
2786 """
2787 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2788
2789 def ConvertToMono(*args, **kwargs):
2790 """
2791 ConvertToMono(self, byte r, byte g, byte b) -> Image
2792
2793 Returns monochromatic version of the image. The returned image has
2794 white colour where the original has ``(r,g,b)`` colour and black
2795 colour everywhere else.
2796 """
2797 return _core_.Image_ConvertToMono(*args, **kwargs)
2798
2799 def SetOption(*args, **kwargs):
2800 """
2801 SetOption(self, String name, String value)
2802
2803 Sets an image handler defined option. For example, when saving as a
2804 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2805 number between 0 and 100 (0 is terrible, 100 is very good).
2806 """
2807 return _core_.Image_SetOption(*args, **kwargs)
2808
2809 def SetOptionInt(*args, **kwargs):
2810 """
2811 SetOptionInt(self, String name, int value)
2812
2813 Sets an image option as an integer.
2814 """
2815 return _core_.Image_SetOptionInt(*args, **kwargs)
2816
2817 def GetOption(*args, **kwargs):
2818 """
2819 GetOption(self, String name) -> String
2820
2821 Gets the value of an image handler option.
2822 """
2823 return _core_.Image_GetOption(*args, **kwargs)
2824
2825 def GetOptionInt(*args, **kwargs):
2826 """
2827 GetOptionInt(self, String name) -> int
2828
2829 Gets the value of an image handler option as an integer. If the given
2830 option is not present, the function returns 0.
2831 """
2832 return _core_.Image_GetOptionInt(*args, **kwargs)
2833
2834 def HasOption(*args, **kwargs):
2835 """
2836 HasOption(self, String name) -> bool
2837
2838 Returns true if the given option is present.
2839 """
2840 return _core_.Image_HasOption(*args, **kwargs)
2841
2842 def CountColours(*args, **kwargs):
2843 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2844 return _core_.Image_CountColours(*args, **kwargs)
2845
2846 def ComputeHistogram(*args, **kwargs):
2847 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2848 return _core_.Image_ComputeHistogram(*args, **kwargs)
2849
2850 def AddHandler(*args, **kwargs):
2851 """AddHandler(ImageHandler handler)"""
2852 return _core_.Image_AddHandler(*args, **kwargs)
2853
2854 AddHandler = staticmethod(AddHandler)
2855 def InsertHandler(*args, **kwargs):
2856 """InsertHandler(ImageHandler handler)"""
2857 return _core_.Image_InsertHandler(*args, **kwargs)
2858
2859 InsertHandler = staticmethod(InsertHandler)
2860 def RemoveHandler(*args, **kwargs):
2861 """RemoveHandler(String name) -> bool"""
2862 return _core_.Image_RemoveHandler(*args, **kwargs)
2863
2864 RemoveHandler = staticmethod(RemoveHandler)
2865 def GetHandlers(*args, **kwargs):
2866 """GetHandlers() -> PyObject"""
2867 return _core_.Image_GetHandlers(*args, **kwargs)
2868
2869 GetHandlers = staticmethod(GetHandlers)
2870 def GetImageExtWildcard(*args, **kwargs):
2871 """
2872 GetImageExtWildcard() -> String
2873
2874 Iterates all registered wxImageHandler objects, and returns a string
2875 containing file extension masks suitable for passing to file open/save
2876 dialog boxes.
2877 """
2878 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2879
2880 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2881 def ConvertToBitmap(*args, **kwargs):
2882 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2883 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2884
2885 def ConvertToMonoBitmap(*args, **kwargs):
2886 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2887 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2888
2889 def RotateHue(*args, **kwargs):
2890 """
2891 RotateHue(self, double angle)
2892
2893 Rotates the hue of each pixel of the image. Hue is a double in the
2894 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2895 """
2896 return _core_.Image_RotateHue(*args, **kwargs)
2897
2898 def RGBtoHSV(*args, **kwargs):
2899 """
2900 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2901
2902 Converts a color in RGB color space to HSV color space.
2903 """
2904 return _core_.Image_RGBtoHSV(*args, **kwargs)
2905
2906 RGBtoHSV = staticmethod(RGBtoHSV)
2907 def HSVtoRGB(*args, **kwargs):
2908 """
2909 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2910
2911 Converts a color in HSV color space to RGB color space.
2912 """
2913 return _core_.Image_HSVtoRGB(*args, **kwargs)
2914
2915 HSVtoRGB = staticmethod(HSVtoRGB)
2916 def __nonzero__(self): return self.Ok()
2917 Image_swigregister = _core_.Image_swigregister
2918 Image_swigregister(Image)
2919
2920 def ImageFromMime(*args, **kwargs):
2921 """
2922 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2923
2924 Loads an image from a file, using a MIME type string (such as
2925 'image/jpeg') to specify image type.
2926 """
2927 val = _core_.new_ImageFromMime(*args, **kwargs)
2928 return val
2929
2930 def ImageFromStream(*args, **kwargs):
2931 """
2932 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2933
2934 Loads an image from an input stream, or any readable Python file-like
2935 object.
2936 """
2937 val = _core_.new_ImageFromStream(*args, **kwargs)
2938 return val
2939
2940 def ImageFromStreamMime(*args, **kwargs):
2941 """
2942 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2943
2944 Loads an image from an input stream, or any readable Python file-like
2945 object, specifying the image format with a MIME type string.
2946 """
2947 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2948 return val
2949
2950 def EmptyImage(*args, **kwargs):
2951 """
2952 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2953
2954 Construct an empty image of a given size, optionally setting all
2955 pixels to black.
2956 """
2957 val = _core_.new_EmptyImage(*args, **kwargs)
2958 return val
2959
2960 def ImageFromBitmap(*args, **kwargs):
2961 """
2962 ImageFromBitmap(Bitmap bitmap) -> Image
2963
2964 Construct an Image from a `wx.Bitmap`.
2965 """
2966 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2967 return val
2968
2969 def ImageFromData(*args, **kwargs):
2970 """
2971 ImageFromData(int width, int height, buffer data) -> Image
2972
2973 Construct an Image from a buffer of RGB bytes. Accepts either a
2974 string or a buffer object holding the data and the length of the data
2975 must be width*height*3.
2976 """
2977 val = _core_.new_ImageFromData(*args, **kwargs)
2978 return val
2979
2980 def ImageFromDataWithAlpha(*args, **kwargs):
2981 """
2982 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2983
2984 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2985 Accepts either a string or a buffer object holding the data and the
2986 length of the data must be width*height*3 bytes, and the length of the
2987 alpha data must be width*height bytes.
2988 """
2989 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2990 return val
2991
2992 def Image_CanRead(*args, **kwargs):
2993 """
2994 Image_CanRead(String filename) -> bool
2995
2996 Returns True if the image handlers can read this file.
2997 """
2998 return _core_.Image_CanRead(*args, **kwargs)
2999
3000 def Image_GetImageCount(*args, **kwargs):
3001 """
3002 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3003
3004 If the image file contains more than one image and the image handler
3005 is capable of retrieving these individually, this function will return
3006 the number of available images.
3007 """
3008 return _core_.Image_GetImageCount(*args, **kwargs)
3009
3010 def Image_CanReadStream(*args, **kwargs):
3011 """
3012 Image_CanReadStream(InputStream stream) -> bool
3013
3014 Returns True if the image handlers can read an image file from the
3015 data currently on the input stream, or a readable Python file-like
3016 object.
3017 """
3018 return _core_.Image_CanReadStream(*args, **kwargs)
3019
3020 def Image_AddHandler(*args, **kwargs):
3021 """Image_AddHandler(ImageHandler handler)"""
3022 return _core_.Image_AddHandler(*args, **kwargs)
3023
3024 def Image_InsertHandler(*args, **kwargs):
3025 """Image_InsertHandler(ImageHandler handler)"""
3026 return _core_.Image_InsertHandler(*args, **kwargs)
3027
3028 def Image_RemoveHandler(*args, **kwargs):
3029 """Image_RemoveHandler(String name) -> bool"""
3030 return _core_.Image_RemoveHandler(*args, **kwargs)
3031
3032 def Image_GetHandlers(*args):
3033 """Image_GetHandlers() -> PyObject"""
3034 return _core_.Image_GetHandlers(*args)
3035
3036 def Image_GetImageExtWildcard(*args):
3037 """
3038 Image_GetImageExtWildcard() -> String
3039
3040 Iterates all registered wxImageHandler objects, and returns a string
3041 containing file extension masks suitable for passing to file open/save
3042 dialog boxes.
3043 """
3044 return _core_.Image_GetImageExtWildcard(*args)
3045
3046 def Image_RGBtoHSV(*args, **kwargs):
3047 """
3048 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3049
3050 Converts a color in RGB color space to HSV color space.
3051 """
3052 return _core_.Image_RGBtoHSV(*args, **kwargs)
3053
3054 def Image_HSVtoRGB(*args, **kwargs):
3055 """
3056 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3057
3058 Converts a color in HSV color space to RGB color space.
3059 """
3060 return _core_.Image_HSVtoRGB(*args, **kwargs)
3061
3062 def InitAllImageHandlers():
3063 """
3064 The former functionality of InitAllImageHanders is now done internal to
3065 the _core_ extension module and so this function has become a simple NOP.
3066 """
3067 pass
3068
3069 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3070 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3071 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3072 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3073 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3074 BMP_24BPP = _core_.BMP_24BPP
3075 BMP_8BPP = _core_.BMP_8BPP
3076 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3077 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3078 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3079 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3080 BMP_4BPP = _core_.BMP_4BPP
3081 BMP_1BPP = _core_.BMP_1BPP
3082 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3083 class BMPHandler(ImageHandler):
3084 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3086 __repr__ = _swig_repr
3087 def __init__(self, *args, **kwargs):
3088 """
3089 __init__(self) -> BMPHandler
3090
3091 A `wx.ImageHandler` for \*.bmp bitmap files.
3092 """
3093 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3094 BMPHandler_swigregister = _core_.BMPHandler_swigregister
3095 BMPHandler_swigregister(BMPHandler)
3096 NullImage = cvar.NullImage
3097 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3098 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3099 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3100 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3101 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3102 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3103 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3104 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3105 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3106 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3107 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3108 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3109 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3110 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3111 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3112
3113 class ICOHandler(BMPHandler):
3114 """A `wx.ImageHandler` for \*.ico icon files."""
3115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3116 __repr__ = _swig_repr
3117 def __init__(self, *args, **kwargs):
3118 """
3119 __init__(self) -> ICOHandler
3120
3121 A `wx.ImageHandler` for \*.ico icon files.
3122 """
3123 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3124 ICOHandler_swigregister = _core_.ICOHandler_swigregister
3125 ICOHandler_swigregister(ICOHandler)
3126
3127 class CURHandler(ICOHandler):
3128 """A `wx.ImageHandler` for \*.cur cursor files."""
3129 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3130 __repr__ = _swig_repr
3131 def __init__(self, *args, **kwargs):
3132 """
3133 __init__(self) -> CURHandler
3134
3135 A `wx.ImageHandler` for \*.cur cursor files.
3136 """
3137 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3138 CURHandler_swigregister = _core_.CURHandler_swigregister
3139 CURHandler_swigregister(CURHandler)
3140
3141 class ANIHandler(CURHandler):
3142 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3143 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3144 __repr__ = _swig_repr
3145 def __init__(self, *args, **kwargs):
3146 """
3147 __init__(self) -> ANIHandler
3148
3149 A `wx.ImageHandler` for \*.ani animated cursor files.
3150 """
3151 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3152 ANIHandler_swigregister = _core_.ANIHandler_swigregister
3153 ANIHandler_swigregister(ANIHandler)
3154
3155 class PNGHandler(ImageHandler):
3156 """A `wx.ImageHandler` for PNG image files."""
3157 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3158 __repr__ = _swig_repr
3159 def __init__(self, *args, **kwargs):
3160 """
3161 __init__(self) -> PNGHandler
3162
3163 A `wx.ImageHandler` for PNG image files.
3164 """
3165 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3166 PNGHandler_swigregister = _core_.PNGHandler_swigregister
3167 PNGHandler_swigregister(PNGHandler)
3168
3169 class GIFHandler(ImageHandler):
3170 """A `wx.ImageHandler` for GIF image files."""
3171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3172 __repr__ = _swig_repr
3173 def __init__(self, *args, **kwargs):
3174 """
3175 __init__(self) -> GIFHandler
3176
3177 A `wx.ImageHandler` for GIF image files.
3178 """
3179 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3180 GIFHandler_swigregister = _core_.GIFHandler_swigregister
3181 GIFHandler_swigregister(GIFHandler)
3182
3183 class PCXHandler(ImageHandler):
3184 """A `wx.ImageHandler` for PCX imager files."""
3185 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3186 __repr__ = _swig_repr
3187 def __init__(self, *args, **kwargs):
3188 """
3189 __init__(self) -> PCXHandler
3190
3191 A `wx.ImageHandler` for PCX imager files.
3192 """
3193 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3194 PCXHandler_swigregister = _core_.PCXHandler_swigregister
3195 PCXHandler_swigregister(PCXHandler)
3196
3197 class JPEGHandler(ImageHandler):
3198 """A `wx.ImageHandler` for JPEG/JPG image files."""
3199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3200 __repr__ = _swig_repr
3201 def __init__(self, *args, **kwargs):
3202 """
3203 __init__(self) -> JPEGHandler
3204
3205 A `wx.ImageHandler` for JPEG/JPG image files.
3206 """
3207 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3208 JPEGHandler_swigregister = _core_.JPEGHandler_swigregister
3209 JPEGHandler_swigregister(JPEGHandler)
3210
3211 class PNMHandler(ImageHandler):
3212 """A `wx.ImageHandler` for PNM image files."""
3213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3214 __repr__ = _swig_repr
3215 def __init__(self, *args, **kwargs):
3216 """
3217 __init__(self) -> PNMHandler
3218
3219 A `wx.ImageHandler` for PNM image files.
3220 """
3221 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3222 PNMHandler_swigregister = _core_.PNMHandler_swigregister
3223 PNMHandler_swigregister(PNMHandler)
3224
3225 class XPMHandler(ImageHandler):
3226 """A `wx.ImageHandler` for XPM image."""
3227 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3228 __repr__ = _swig_repr
3229 def __init__(self, *args, **kwargs):
3230 """
3231 __init__(self) -> XPMHandler
3232
3233 A `wx.ImageHandler` for XPM image.
3234 """
3235 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3236 XPMHandler_swigregister = _core_.XPMHandler_swigregister
3237 XPMHandler_swigregister(XPMHandler)
3238
3239 class TIFFHandler(ImageHandler):
3240 """A `wx.ImageHandler` for TIFF image files."""
3241 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3242 __repr__ = _swig_repr
3243 def __init__(self, *args, **kwargs):
3244 """
3245 __init__(self) -> TIFFHandler
3246
3247 A `wx.ImageHandler` for TIFF image files.
3248 """
3249 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3250 TIFFHandler_swigregister = _core_.TIFFHandler_swigregister
3251 TIFFHandler_swigregister(TIFFHandler)
3252
3253 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3254 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3255 class Quantize(object):
3256 """Performs quantization, or colour reduction, on a wxImage."""
3257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3258 def __init__(self): raise AttributeError, "No constructor defined"
3259 __repr__ = _swig_repr
3260 def Quantize(*args, **kwargs):
3261 """
3262 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3263
3264 Reduce the colours in the source image and put the result into the
3265 destination image, setting the palette in the destination if
3266 needed. Both images may be the same, to overwrite the source image.
3267 """
3268 return _core_.Quantize_Quantize(*args, **kwargs)
3269
3270 Quantize = staticmethod(Quantize)
3271 Quantize_swigregister = _core_.Quantize_swigregister
3272 Quantize_swigregister(Quantize)
3273
3274 def Quantize_Quantize(*args, **kwargs):
3275 """
3276 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3277
3278 Reduce the colours in the source image and put the result into the
3279 destination image, setting the palette in the destination if
3280 needed. Both images may be the same, to overwrite the source image.
3281 """
3282 return _core_.Quantize_Quantize(*args, **kwargs)
3283
3284 #---------------------------------------------------------------------------
3285
3286 class EvtHandler(Object):
3287 """Proxy of C++ EvtHandler class"""
3288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3289 __repr__ = _swig_repr
3290 def __init__(self, *args, **kwargs):
3291 """__init__(self) -> EvtHandler"""
3292 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3293 def GetNextHandler(*args, **kwargs):
3294 """GetNextHandler(self) -> EvtHandler"""
3295 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3296
3297 def GetPreviousHandler(*args, **kwargs):
3298 """GetPreviousHandler(self) -> EvtHandler"""
3299 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3300
3301 def SetNextHandler(*args, **kwargs):
3302 """SetNextHandler(self, EvtHandler handler)"""
3303 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3304
3305 def SetPreviousHandler(*args, **kwargs):
3306 """SetPreviousHandler(self, EvtHandler handler)"""
3307 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3308
3309 def GetEvtHandlerEnabled(*args, **kwargs):
3310 """GetEvtHandlerEnabled(self) -> bool"""
3311 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3312
3313 def SetEvtHandlerEnabled(*args, **kwargs):
3314 """SetEvtHandlerEnabled(self, bool enabled)"""
3315 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3316
3317 def ProcessEvent(*args, **kwargs):
3318 """ProcessEvent(self, Event event) -> bool"""
3319 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3320
3321 def AddPendingEvent(*args, **kwargs):
3322 """AddPendingEvent(self, Event event)"""
3323 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3324
3325 def ProcessPendingEvents(*args, **kwargs):
3326 """ProcessPendingEvents(self)"""
3327 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3328
3329 def Connect(*args, **kwargs):
3330 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3331 return _core_.EvtHandler_Connect(*args, **kwargs)
3332
3333 def Disconnect(*args, **kwargs):
3334 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3335 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3336
3337 def _setOORInfo(*args, **kwargs):
3338 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3339 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3340 args[0].thisown = 0
3341 return val
3342
3343 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3344 """
3345 Bind an event to an event handler.
3346
3347 :param event: One of the EVT_* objects that specifies the
3348 type of event to bind,
3349
3350 :param handler: A callable object to be invoked when the
3351 event is delivered to self. Pass None to
3352 disconnect an event handler.
3353
3354 :param source: Sometimes the event originates from a
3355 different window than self, but you still
3356 want to catch it in self. (For example, a
3357 button event delivered to a frame.) By
3358 passing the source of the event, the event
3359 handling system is able to differentiate
3360 between the same event type from different
3361 controls.
3362
3363 :param id: Used to spcify the event source by ID instead
3364 of instance.
3365
3366 :param id2: Used when it is desirable to bind a handler
3367 to a range of IDs, such as with EVT_MENU_RANGE.
3368 """
3369 if source is not None:
3370 id = source.GetId()
3371 event.Bind(self, id, id2, handler)
3372
3373 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3374 """
3375 Disconencts the event handler binding for event from self.
3376 Returns True if successful.
3377 """
3378 if source is not None:
3379 id = source.GetId()
3380 return event.Unbind(self, id, id2)
3381
3382 EvtHandler_swigregister = _core_.EvtHandler_swigregister
3383 EvtHandler_swigregister(EvtHandler)
3384
3385 #---------------------------------------------------------------------------
3386
3387 class PyEventBinder(object):
3388 """
3389 Instances of this class are used to bind specific events to event
3390 handlers.
3391 """
3392 def __init__(self, evtType, expectedIDs=0):
3393 if expectedIDs not in [0, 1, 2]:
3394 raise ValueError, "Invalid number of expectedIDs"
3395 self.expectedIDs = expectedIDs
3396
3397 if type(evtType) == list or type(evtType) == tuple:
3398 self.evtType = evtType
3399 else:
3400 self.evtType = [evtType]
3401
3402
3403 def Bind(self, target, id1, id2, function):
3404 """Bind this set of event types to target."""
3405 for et in self.evtType:
3406 target.Connect(id1, id2, et, function)
3407
3408
3409 def Unbind(self, target, id1, id2):
3410 """Remove an event binding."""
3411 success = 0
3412 for et in self.evtType:
3413 success += target.Disconnect(id1, id2, et)
3414 return success != 0
3415
3416
3417 def __call__(self, *args):
3418 """
3419 For backwards compatibility with the old EVT_* functions.
3420 Should be called with either (window, func), (window, ID,
3421 func) or (window, ID1, ID2, func) parameters depending on the
3422 type of the event.
3423 """
3424 assert len(args) == 2 + self.expectedIDs
3425 id1 = wx.ID_ANY
3426 id2 = wx.ID_ANY
3427 target = args[0]
3428 if self.expectedIDs == 0:
3429 func = args[1]
3430 elif self.expectedIDs == 1:
3431 id1 = args[1]
3432 func = args[2]
3433 elif self.expectedIDs == 2:
3434 id1 = args[1]
3435 id2 = args[2]
3436 func = args[3]
3437 else:
3438 raise ValueError, "Unexpected number of IDs"
3439
3440 self.Bind(target, id1, id2, func)
3441
3442
3443 # These two are square pegs that don't fit the PyEventBinder hole...
3444 def EVT_COMMAND(win, id, cmd, func):
3445 win.Connect(id, -1, cmd, func)
3446 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3447 win.Connect(id1, id2, cmd, func)
3448
3449
3450 #---------------------------------------------------------------------------
3451
3452 #---------------------------------------------------------------------------
3453
3454 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3455 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3456
3457 def NewEventType(*args):
3458 """NewEventType() -> EventType"""
3459 return _core_.NewEventType(*args)
3460 wxEVT_NULL = _core_.wxEVT_NULL
3461 wxEVT_FIRST = _core_.wxEVT_FIRST
3462 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3463 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3464 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3465 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3466 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3467 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3468 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3469 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3470 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3471 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3472 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3473 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3474 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3475 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3476 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3477 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3478 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3479 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3480 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3481 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3482 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3483 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3484 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3485 wxEVT_MOTION = _core_.wxEVT_MOTION
3486 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3487 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3488 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3489 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3490 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3491 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3492 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3493 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3494 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3495 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3496 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3497 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3498 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3499 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3500 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3501 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3502 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3503 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3504 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3505 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3506 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3507 wxEVT_CHAR = _core_.wxEVT_CHAR
3508 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3509 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3510 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3511 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3512 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3513 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3514 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3515 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3516 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3517 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3518 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3519 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3520 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3521 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3522 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3523 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3524 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3525 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3526 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3527 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3528 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3529 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3530 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3531 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3532 wxEVT_SIZE = _core_.wxEVT_SIZE
3533 wxEVT_MOVE = _core_.wxEVT_MOVE
3534 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3535 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3536 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3537 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3538 wxEVT_POWER = _core_.wxEVT_POWER
3539 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3540 wxEVT_CREATE = _core_.wxEVT_CREATE
3541 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3542 wxEVT_SHOW = _core_.wxEVT_SHOW
3543 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3544 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3545 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3546 wxEVT_PAINT = _core_.wxEVT_PAINT
3547 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3548 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3549 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3550 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3551 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3552 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3553 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3554 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3555 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3556 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3557 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3558 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3559 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3560 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3561 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3562 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3563 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3564 wxEVT_IDLE = _core_.wxEVT_IDLE
3565 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3566 wxEVT_SIZING = _core_.wxEVT_SIZING
3567 wxEVT_MOVING = _core_.wxEVT_MOVING
3568 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3569 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3570 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3571 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3572 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3573 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3574 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3575 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3576 #
3577 # Create some event binders
3578 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3579 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3580 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3581 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3582 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3583 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3584 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3585 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3586 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3587 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3588 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3589 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3590 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3591 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3592 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3593 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3594 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3595 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3596 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3597 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3598 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3599 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3600 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3601 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3602 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3603 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3604 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3605 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3606 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3607 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3608 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3609 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3610 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3611 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3612 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3613 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3614 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3615 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3616 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3617 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3618 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3619
3620 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3621 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3622 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3623 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3624 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3625 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3626 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3627 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3628 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3629 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3630 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3631 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3632 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3633
3634 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3635 wxEVT_LEFT_UP,
3636 wxEVT_MIDDLE_DOWN,
3637 wxEVT_MIDDLE_UP,
3638 wxEVT_RIGHT_DOWN,
3639 wxEVT_RIGHT_UP,
3640 wxEVT_MOTION,
3641 wxEVT_LEFT_DCLICK,
3642 wxEVT_MIDDLE_DCLICK,
3643 wxEVT_RIGHT_DCLICK,
3644 wxEVT_ENTER_WINDOW,
3645 wxEVT_LEAVE_WINDOW,
3646 wxEVT_MOUSEWHEEL
3647 ])
3648
3649
3650 # Scrolling from wxWindow (sent to wxScrolledWindow)
3651 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3652 wxEVT_SCROLLWIN_BOTTOM,
3653 wxEVT_SCROLLWIN_LINEUP,
3654 wxEVT_SCROLLWIN_LINEDOWN,
3655 wxEVT_SCROLLWIN_PAGEUP,
3656 wxEVT_SCROLLWIN_PAGEDOWN,
3657 wxEVT_SCROLLWIN_THUMBTRACK,
3658 wxEVT_SCROLLWIN_THUMBRELEASE,
3659 ])
3660
3661 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3662 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3663 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3664 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3665 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3666 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3667 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3668 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3669
3670 # Scrolling from wx.Slider and wx.ScrollBar
3671 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3672 wxEVT_SCROLL_BOTTOM,
3673 wxEVT_SCROLL_LINEUP,
3674 wxEVT_SCROLL_LINEDOWN,
3675 wxEVT_SCROLL_PAGEUP,
3676 wxEVT_SCROLL_PAGEDOWN,
3677 wxEVT_SCROLL_THUMBTRACK,
3678 wxEVT_SCROLL_THUMBRELEASE,
3679 wxEVT_SCROLL_CHANGED,
3680 ])
3681
3682 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3683 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3684 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3685 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3686 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3687 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3688 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3689 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3690 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3691 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3692
3693 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3694 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3695 wxEVT_SCROLL_BOTTOM,
3696 wxEVT_SCROLL_LINEUP,
3697 wxEVT_SCROLL_LINEDOWN,
3698 wxEVT_SCROLL_PAGEUP,
3699 wxEVT_SCROLL_PAGEDOWN,
3700 wxEVT_SCROLL_THUMBTRACK,
3701 wxEVT_SCROLL_THUMBRELEASE,
3702 wxEVT_SCROLL_CHANGED,
3703 ], 1)
3704
3705 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3706 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3707 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3708 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3709 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3710 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3711 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3712 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3713 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3714 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3715
3716 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3717 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3718 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3719 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3720 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3721 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3722 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3723 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3724 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3725 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3726
3727 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3728 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3729 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3730 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3731 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3732 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3733 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3734 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3735 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3736
3737
3738 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3739 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3740 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3741 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3742 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3743 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3744 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3745
3746 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3747
3748 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3749 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3750
3751 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3752
3753
3754
3755 #---------------------------------------------------------------------------
3756
3757 class Event(Object):
3758 """
3759 An event is a structure holding information about an event passed to a
3760 callback or member function. wx.Event is an abstract base class for
3761 other event classes
3762 """
3763 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3764 def __init__(self): raise AttributeError, "No constructor defined"
3765 __repr__ = _swig_repr
3766 __swig_destroy__ = _core_.delete_Event
3767 __del__ = lambda self : None;
3768 def SetEventType(*args, **kwargs):
3769 """
3770 SetEventType(self, EventType typ)
3771
3772 Sets the specific type of the event.
3773 """
3774 return _core_.Event_SetEventType(*args, **kwargs)
3775
3776 def GetEventType(*args, **kwargs):
3777 """
3778 GetEventType(self) -> EventType
3779
3780 Returns the identifier of the given event type, such as
3781 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3782 """
3783 return _core_.Event_GetEventType(*args, **kwargs)
3784
3785 def GetEventObject(*args, **kwargs):
3786 """
3787 GetEventObject(self) -> Object
3788
3789 Returns the object (usually a window) associated with the event, if
3790 any.
3791 """
3792 return _core_.Event_GetEventObject(*args, **kwargs)
3793
3794 def SetEventObject(*args, **kwargs):
3795 """
3796 SetEventObject(self, Object obj)
3797
3798 Sets the originating object, or in other words, obj is normally the
3799 object that is sending the event.
3800 """
3801 return _core_.Event_SetEventObject(*args, **kwargs)
3802
3803 def GetTimestamp(*args, **kwargs):
3804 """GetTimestamp(self) -> long"""
3805 return _core_.Event_GetTimestamp(*args, **kwargs)
3806
3807 def SetTimestamp(*args, **kwargs):
3808 """SetTimestamp(self, long ts=0)"""
3809 return _core_.Event_SetTimestamp(*args, **kwargs)
3810
3811 def GetId(*args, **kwargs):
3812 """
3813 GetId(self) -> int
3814
3815 Returns the identifier associated with this event, such as a button
3816 command id.
3817 """
3818 return _core_.Event_GetId(*args, **kwargs)
3819
3820 def SetId(*args, **kwargs):
3821 """
3822 SetId(self, int Id)
3823
3824 Set's the ID for the event. This is usually the ID of the window that
3825 is sending the event, but it can also be a command id from a menu
3826 item, etc.
3827 """
3828 return _core_.Event_SetId(*args, **kwargs)
3829
3830 def IsCommandEvent(*args, **kwargs):
3831 """
3832 IsCommandEvent(self) -> bool
3833
3834 Returns true if the event is or is derived from `wx.CommandEvent` else
3835 it returns false. Note: Exists only for optimization purposes.
3836 """
3837 return _core_.Event_IsCommandEvent(*args, **kwargs)
3838
3839 def Skip(*args, **kwargs):
3840 """
3841 Skip(self, bool skip=True)
3842
3843 Called by an event handler, it controls whether additional event
3844 handlers bound to this event will be called after the current event
3845 handler returns. Skip(false) (the default setting) will prevent
3846 additional event handlers from being called and control will be
3847 returned to the sender of the event immediately after the current
3848 handler has finished. Skip(True) will cause the event processing
3849 system to continue searching for a handler function for this event.
3850
3851 """
3852 return _core_.Event_Skip(*args, **kwargs)
3853
3854 def GetSkipped(*args, **kwargs):
3855 """
3856 GetSkipped(self) -> bool
3857
3858 Returns true if the event handler should be skipped, false otherwise.
3859 :see: `Skip`
3860 """
3861 return _core_.Event_GetSkipped(*args, **kwargs)
3862
3863 def ShouldPropagate(*args, **kwargs):
3864 """
3865 ShouldPropagate(self) -> bool
3866
3867 Test if this event should be propagated to the parent window or not,
3868 i.e. if the propagation level is currently greater than 0.
3869 """
3870 return _core_.Event_ShouldPropagate(*args, **kwargs)
3871
3872 def StopPropagation(*args, **kwargs):
3873 """
3874 StopPropagation(self) -> int
3875
3876 Stop the event from propagating to its parent window. Returns the old
3877 propagation level value which may be later passed to
3878 `ResumePropagation` to allow propagating the event again.
3879 """
3880 return _core_.Event_StopPropagation(*args, **kwargs)
3881
3882 def ResumePropagation(*args, **kwargs):
3883 """
3884 ResumePropagation(self, int propagationLevel)
3885
3886 Resume the event propagation by restoring the propagation level. (For
3887 example, you can use the value returned by an earlier call to
3888 `StopPropagation`.)
3889
3890 """
3891 return _core_.Event_ResumePropagation(*args, **kwargs)
3892
3893 def Clone(*args, **kwargs):
3894 """Clone(self) -> Event"""
3895 return _core_.Event_Clone(*args, **kwargs)
3896
3897 Event_swigregister = _core_.Event_swigregister
3898 Event_swigregister(Event)
3899
3900 #---------------------------------------------------------------------------
3901
3902 class PropagationDisabler(object):
3903 """
3904 Helper class to temporarily change an event not to propagate. Simply
3905 create an instance of this class and then whe it is destroyed the
3906 propogation of the event will be restored.
3907 """
3908 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3909 __repr__ = _swig_repr
3910 def __init__(self, *args, **kwargs):
3911 """
3912 __init__(self, Event event) -> PropagationDisabler
3913
3914 Helper class to temporarily change an event not to propagate. Simply
3915 create an instance of this class and then whe it is destroyed the
3916 propogation of the event will be restored.
3917 """
3918 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3919 __swig_destroy__ = _core_.delete_PropagationDisabler
3920 __del__ = lambda self : None;
3921 PropagationDisabler_swigregister = _core_.PropagationDisabler_swigregister
3922 PropagationDisabler_swigregister(PropagationDisabler)
3923
3924 class PropagateOnce(object):
3925 """
3926 A helper class that will temporarily lower propagation level of an
3927 event. Simply create an instance of this class and then whe it is
3928 destroyed the propogation of the event will be restored.
3929 """
3930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3931 __repr__ = _swig_repr
3932 def __init__(self, *args, **kwargs):
3933 """
3934 __init__(self, Event event) -> PropagateOnce
3935
3936 A helper class that will temporarily lower propagation level of an
3937 event. Simply create an instance of this class and then whe it is
3938 destroyed the propogation of the event will be restored.
3939 """
3940 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3941 __swig_destroy__ = _core_.delete_PropagateOnce
3942 __del__ = lambda self : None;
3943 PropagateOnce_swigregister = _core_.PropagateOnce_swigregister
3944 PropagateOnce_swigregister(PropagateOnce)
3945
3946 #---------------------------------------------------------------------------
3947
3948 class CommandEvent(Event):
3949 """
3950 This event class contains information about command events, which
3951 originate from a variety of simple controls, as well as menus and
3952 toolbars.
3953 """
3954 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3955 __repr__ = _swig_repr
3956 def __init__(self, *args, **kwargs):
3957 """
3958 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3959
3960 This event class contains information about command events, which
3961 originate from a variety of simple controls, as well as menus and
3962 toolbars.
3963 """
3964 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3965 def GetSelection(*args, **kwargs):
3966 """
3967 GetSelection(self) -> int
3968
3969 Returns item index for a listbox or choice selection event (not valid
3970 for a deselection).
3971 """
3972 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3973
3974 def SetString(*args, **kwargs):
3975 """SetString(self, String s)"""
3976 return _core_.CommandEvent_SetString(*args, **kwargs)
3977
3978 def GetString(*args, **kwargs):
3979 """
3980 GetString(self) -> String
3981
3982 Returns item string for a listbox or choice selection event (not valid
3983 for a deselection).
3984 """
3985 return _core_.CommandEvent_GetString(*args, **kwargs)
3986
3987 def IsChecked(*args, **kwargs):
3988 """
3989 IsChecked(self) -> bool
3990
3991 This method can be used with checkbox and menu events: for the
3992 checkboxes, the method returns true for a selection event and false
3993 for a deselection one. For the menu events, this method indicates if
3994 the menu item just has become checked or unchecked (and thus only
3995 makes sense for checkable menu items).
3996 """
3997 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3998
3999 Checked = IsChecked
4000 def IsSelection(*args, **kwargs):
4001 """
4002 IsSelection(self) -> bool
4003
4004 For a listbox or similar event, returns true if it is a selection,
4005 false if it is a deselection.
4006 """
4007 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4008
4009 def SetExtraLong(*args, **kwargs):
4010 """SetExtraLong(self, long extraLong)"""
4011 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4012
4013 def GetExtraLong(*args, **kwargs):
4014 """
4015 GetExtraLong(self) -> long
4016
4017 Returns extra information dependant on the event objects type. If the
4018 event comes from a listbox selection, it is a boolean determining
4019 whether the event was a selection (true) or a deselection (false). A
4020 listbox deselection only occurs for multiple-selection boxes, and in
4021 this case the index and string values are indeterminate and the
4022 listbox must be examined by the application.
4023 """
4024 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4025
4026 def SetInt(*args, **kwargs):
4027 """SetInt(self, int i)"""
4028 return _core_.CommandEvent_SetInt(*args, **kwargs)
4029
4030 def GetInt(*args, **kwargs):
4031 """
4032 GetInt(self) -> int
4033
4034 Returns the integer identifier corresponding to a listbox, choice or
4035 radiobox selection (only if the event was a selection, not a
4036 deselection), or a boolean value representing the value of a checkbox.
4037 """
4038 return _core_.CommandEvent_GetInt(*args, **kwargs)
4039
4040 def GetClientData(*args, **kwargs):
4041 """
4042 GetClientData(self) -> PyObject
4043
4044 Returns the client data object for a listbox or choice selection event, (if any.)
4045 """
4046 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4047
4048 def SetClientData(*args, **kwargs):
4049 """
4050 SetClientData(self, PyObject clientData)
4051
4052 Associate the given client data with the item at position n.
4053 """
4054 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4055
4056 GetClientObject = GetClientData
4057 SetClientObject = SetClientData
4058
4059 def Clone(*args, **kwargs):
4060 """Clone(self) -> Event"""
4061 return _core_.CommandEvent_Clone(*args, **kwargs)
4062
4063 CommandEvent_swigregister = _core_.CommandEvent_swigregister
4064 CommandEvent_swigregister(CommandEvent)
4065
4066 #---------------------------------------------------------------------------
4067
4068 class NotifyEvent(CommandEvent):
4069 """
4070 An instance of this class (or one of its derived classes) is sent from
4071 a control when the control's state is being changed and the control
4072 allows that change to be prevented from happening. The event handler
4073 can call `Veto` or `Allow` to tell the control what to do.
4074 """
4075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4076 __repr__ = _swig_repr
4077 def __init__(self, *args, **kwargs):
4078 """
4079 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4080
4081 An instance of this class (or one of its derived classes) is sent from
4082 a control when the control's state is being changed and the control
4083 allows that change to be prevented from happening. The event handler
4084 can call `Veto` or `Allow` to tell the control what to do.
4085 """
4086 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4087 def Veto(*args, **kwargs):
4088 """
4089 Veto(self)
4090
4091 Prevents the change announced by this event from happening.
4092
4093 It is in general a good idea to notify the user about the reasons for
4094 vetoing the change because otherwise the applications behaviour (which
4095 just refuses to do what the user wants) might be quite surprising.
4096 """
4097 return _core_.NotifyEvent_Veto(*args, **kwargs)
4098
4099 def Allow(*args, **kwargs):
4100 """
4101 Allow(self)
4102
4103 This is the opposite of `Veto`: it explicitly allows the event to be
4104 processed. For most events it is not necessary to call this method as
4105 the events are allowed anyhow but some are forbidden by default (this
4106 will be mentioned in the corresponding event description).
4107 """
4108 return _core_.NotifyEvent_Allow(*args, **kwargs)
4109
4110 def IsAllowed(*args, **kwargs):
4111 """
4112 IsAllowed(self) -> bool
4113
4114 Returns true if the change is allowed (`Veto` hasn't been called) or
4115 false otherwise (if it was).
4116 """
4117 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4118
4119 NotifyEvent_swigregister = _core_.NotifyEvent_swigregister
4120 NotifyEvent_swigregister(NotifyEvent)
4121
4122 #---------------------------------------------------------------------------
4123
4124 class ScrollEvent(CommandEvent):
4125 """
4126 A scroll event holds information about events sent from stand-alone
4127 scrollbars and sliders. Note that scrolled windows do not send
4128 instnaces of this event class, but send the `wx.ScrollWinEvent`
4129 instead.
4130 """
4131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4132 __repr__ = _swig_repr
4133 def __init__(self, *args, **kwargs):
4134 """
4135 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4136 int orient=0) -> ScrollEvent
4137 """
4138 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4139 def GetOrientation(*args, **kwargs):
4140 """
4141 GetOrientation(self) -> int
4142
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4144 the scrollbar.
4145 """
4146 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4147
4148 def GetPosition(*args, **kwargs):
4149 """
4150 GetPosition(self) -> int
4151
4152 Returns the position of the scrollbar.
4153 """
4154 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4155
4156 def SetOrientation(*args, **kwargs):
4157 """SetOrientation(self, int orient)"""
4158 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4159
4160 def SetPosition(*args, **kwargs):
4161 """SetPosition(self, int pos)"""
4162 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4163
4164 ScrollEvent_swigregister = _core_.ScrollEvent_swigregister
4165 ScrollEvent_swigregister(ScrollEvent)
4166
4167 #---------------------------------------------------------------------------
4168
4169 class ScrollWinEvent(Event):
4170 """
4171 A wx.ScrollWinEvent holds information about scrolling and is sent from
4172 scrolling windows.
4173 """
4174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4175 __repr__ = _swig_repr
4176 def __init__(self, *args, **kwargs):
4177 """
4178 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4179
4180 A wx.ScrollWinEvent holds information about scrolling and is sent from
4181 scrolling windows.
4182 """
4183 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4184 def GetOrientation(*args, **kwargs):
4185 """
4186 GetOrientation(self) -> int
4187
4188 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4189 the scrollbar.
4190 """
4191 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4192
4193 def GetPosition(*args, **kwargs):
4194 """
4195 GetPosition(self) -> int
4196
4197 Returns the position of the scrollbar for the thumb track and release
4198 events. Note that this field can't be used for the other events, you
4199 need to query the window itself for the current position in that case.
4200 """
4201 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4202
4203 def SetOrientation(*args, **kwargs):
4204 """SetOrientation(self, int orient)"""
4205 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4206
4207 def SetPosition(*args, **kwargs):
4208 """SetPosition(self, int pos)"""
4209 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4210
4211 ScrollWinEvent_swigregister = _core_.ScrollWinEvent_swigregister
4212 ScrollWinEvent_swigregister(ScrollWinEvent)
4213
4214 #---------------------------------------------------------------------------
4215
4216 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4217 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4218 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4219 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4220 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4221 class MouseEvent(Event):
4222 """
4223 This event class contains information about the events generated by
4224 the mouse: they include mouse buttons press and release events and
4225 mouse move events.
4226
4227 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4228 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4229 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4230 a middle button so a portable application should avoid relying on the
4231 events from it.
4232
4233 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4234 the former returns true when the event corresponds to the left mouse
4235 button click while the latter returns true if the left mouse button is
4236 currently being pressed. For example, when the user is dragging the
4237 mouse you can use `LeftIsDown` to test whether the left mouse button
4238 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4239 `LeftIsDown` will also return true in wxWidgets whatever the
4240 underlying GUI behaviour is (which is platform-dependent). The same
4241 applies, of course, to other mouse buttons as well.
4242 """
4243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4244 __repr__ = _swig_repr
4245 def __init__(self, *args, **kwargs):
4246 """
4247 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4248
4249 Constructs a wx.MouseEvent. Valid event types are:
4250
4251 * wxEVT_ENTER_WINDOW
4252 * wxEVT_LEAVE_WINDOW
4253 * wxEVT_LEFT_DOWN
4254 * wxEVT_LEFT_UP
4255 * wxEVT_LEFT_DCLICK
4256 * wxEVT_MIDDLE_DOWN
4257 * wxEVT_MIDDLE_UP
4258 * wxEVT_MIDDLE_DCLICK
4259 * wxEVT_RIGHT_DOWN
4260 * wxEVT_RIGHT_UP
4261 * wxEVT_RIGHT_DCLICK
4262 * wxEVT_MOTION
4263 * wxEVT_MOUSEWHEEL
4264 """
4265 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4266 def IsButton(*args, **kwargs):
4267 """
4268 IsButton(self) -> bool
4269
4270 Returns true if the event was a mouse button event (not necessarily a
4271 button down event - that may be tested using `ButtonDown`).
4272 """
4273 return _core_.MouseEvent_IsButton(*args, **kwargs)
4274
4275 def ButtonDown(*args, **kwargs):
4276 """
4277 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4278
4279 If the argument is omitted, this returns true if the event was any
4280 mouse button down event. Otherwise the argument specifies which
4281 button-down event shold be checked for (see `Button` for the possible
4282 values).
4283 """
4284 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4285
4286 def ButtonDClick(*args, **kwargs):
4287 """
4288 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4289
4290 If the argument is omitted, this returns true if the event was any
4291 mouse double click event. Otherwise the argument specifies which
4292 double click event to check for (see `Button` for the possible
4293 values).
4294 """
4295 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4296
4297 def ButtonUp(*args, **kwargs):
4298 """
4299 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4300
4301 If the argument is omitted, this returns true if the event was any
4302 mouse button up event. Otherwise the argument specifies which button
4303 up event to check for (see `Button` for the possible values).
4304 """
4305 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4306
4307 def Button(*args, **kwargs):
4308 """
4309 Button(self, int button) -> bool
4310
4311 Returns true if the identified mouse button is changing state. Valid
4312 values of button are:
4313
4314 ==================== =====================================
4315 wx.MOUSE_BTN_LEFT check if left button was pressed
4316 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4317 wx.MOUSE_BTN_RIGHT check if right button was pressed
4318 wx.MOUSE_BTN_ANY check if any button was pressed
4319 ==================== =====================================
4320
4321 """
4322 return _core_.MouseEvent_Button(*args, **kwargs)
4323
4324 def ButtonIsDown(*args, **kwargs):
4325 """ButtonIsDown(self, int but) -> bool"""
4326 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4327
4328 def GetButton(*args, **kwargs):
4329 """
4330 GetButton(self) -> int
4331
4332 Returns the mouse button which generated this event or
4333 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4334 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4335 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4336 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4337 right buttons respectively.
4338 """
4339 return _core_.MouseEvent_GetButton(*args, **kwargs)
4340
4341 def ControlDown(*args, **kwargs):
4342 """
4343 ControlDown(self) -> bool
4344
4345 Returns true if the control key was down at the time of the event.
4346 """
4347 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4348
4349 def MetaDown(*args, **kwargs):
4350 """
4351 MetaDown(self) -> bool
4352
4353 Returns true if the Meta key was down at the time of the event.
4354 """
4355 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4356
4357 def AltDown(*args, **kwargs):
4358 """
4359 AltDown(self) -> bool
4360
4361 Returns true if the Alt key was down at the time of the event.
4362 """
4363 return _core_.MouseEvent_AltDown(*args, **kwargs)
4364
4365 def ShiftDown(*args, **kwargs):
4366 """
4367 ShiftDown(self) -> bool
4368
4369 Returns true if the Shift key was down at the time of the event.
4370 """
4371 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4372
4373 def CmdDown(*args, **kwargs):
4374 """
4375 CmdDown(self) -> bool
4376
4377 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4378 platforms but the special "Apple" (a.k.a as "Command") key on
4379 Macs. It often makes sense to use it instead of, say, `ControlDown`
4380 because Cmd key is used for the same thing under Mac as Ctrl
4381 elsewhere. The Ctrl key still exists, it's just not used for this
4382 purpose. So for non-Mac platforms this is the same as `ControlDown`
4383 and Macs this is the same as `MetaDown`.
4384 """
4385 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4386
4387 def LeftDown(*args, **kwargs):
4388 """
4389 LeftDown(self) -> bool
4390
4391 Returns true if the left mouse button state changed to down.
4392 """
4393 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4394
4395 def MiddleDown(*args, **kwargs):
4396 """
4397 MiddleDown(self) -> bool
4398
4399 Returns true if the middle mouse button state changed to down.
4400 """
4401 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4402
4403 def RightDown(*args, **kwargs):
4404 """
4405 RightDown(self) -> bool
4406
4407 Returns true if the right mouse button state changed to down.
4408 """
4409 return _core_.MouseEvent_RightDown(*args, **kwargs)
4410
4411 def LeftUp(*args, **kwargs):
4412 """
4413 LeftUp(self) -> bool
4414
4415 Returns true if the left mouse button state changed to up.
4416 """
4417 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4418
4419 def MiddleUp(*args, **kwargs):
4420 """
4421 MiddleUp(self) -> bool
4422
4423 Returns true if the middle mouse button state changed to up.
4424 """
4425 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4426
4427 def RightUp(*args, **kwargs):
4428 """
4429 RightUp(self) -> bool
4430
4431 Returns true if the right mouse button state changed to up.
4432 """
4433 return _core_.MouseEvent_RightUp(*args, **kwargs)
4434
4435 def LeftDClick(*args, **kwargs):
4436 """
4437 LeftDClick(self) -> bool
4438
4439 Returns true if the event was a left button double click.
4440 """
4441 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4442
4443 def MiddleDClick(*args, **kwargs):
4444 """
4445 MiddleDClick(self) -> bool
4446
4447 Returns true if the event was a middle button double click.
4448 """
4449 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4450
4451 def RightDClick(*args, **kwargs):
4452 """
4453 RightDClick(self) -> bool
4454
4455 Returns true if the event was a right button double click.
4456 """
4457 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4458
4459 def LeftIsDown(*args, **kwargs):
4460 """
4461 LeftIsDown(self) -> bool
4462
4463 Returns true if the left mouse button is currently down, independent
4464 of the current event type.
4465
4466 Please notice that it is not the same as LeftDown which returns true
4467 if the left mouse button was just pressed. Rather, it describes the
4468 state of the mouse button before the event happened.
4469
4470 This event is usually used in the mouse event handlers which process
4471 "move mouse" messages to determine whether the user is (still)
4472 dragging the mouse.
4473 """
4474 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4475
4476 def MiddleIsDown(*args, **kwargs):
4477 """
4478 MiddleIsDown(self) -> bool
4479
4480 Returns true if the middle mouse button is currently down, independent
4481 of the current event type.
4482 """
4483 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4484
4485 def RightIsDown(*args, **kwargs):
4486 """
4487 RightIsDown(self) -> bool
4488
4489 Returns true if the right mouse button is currently down, independent
4490 of the current event type.
4491 """
4492 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4493
4494 def Dragging(*args, **kwargs):
4495 """
4496 Dragging(self) -> bool
4497
4498 Returns true if this was a dragging event (motion while a button is
4499 depressed).
4500 """
4501 return _core_.MouseEvent_Dragging(*args, **kwargs)
4502
4503 def Moving(*args, **kwargs):
4504 """
4505 Moving(self) -> bool
4506
4507 Returns true if this was a motion event and no mouse buttons were
4508 pressed. If any mouse button is held pressed, then this method returns
4509 false and Dragging returns true.
4510 """
4511 return _core_.MouseEvent_Moving(*args, **kwargs)
4512
4513 def Entering(*args, **kwargs):
4514 """
4515 Entering(self) -> bool
4516
4517 Returns true if the mouse was entering the window.
4518 """
4519 return _core_.MouseEvent_Entering(*args, **kwargs)
4520
4521 def Leaving(*args, **kwargs):
4522 """
4523 Leaving(self) -> bool
4524
4525 Returns true if the mouse was leaving the window.
4526 """
4527 return _core_.MouseEvent_Leaving(*args, **kwargs)
4528
4529 def GetPosition(*args, **kwargs):
4530 """
4531 GetPosition(self) -> Point
4532
4533 Returns the pixel position of the mouse in window coordinates when the
4534 event happened.
4535 """
4536 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4537
4538 def GetPositionTuple(*args, **kwargs):
4539 """
4540 GetPositionTuple() -> (x,y)
4541
4542 Returns the pixel position of the mouse in window coordinates when the
4543 event happened.
4544 """
4545 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4546
4547 def GetLogicalPosition(*args, **kwargs):
4548 """
4549 GetLogicalPosition(self, DC dc) -> Point
4550
4551 Returns the logical mouse position in pixels (i.e. translated
4552 according to the translation set for the DC, which usually indicates
4553 that the window has been scrolled).
4554 """
4555 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4556
4557 def GetX(*args, **kwargs):
4558 """
4559 GetX(self) -> int
4560
4561 Returns X coordinate of the physical mouse event position.
4562 """
4563 return _core_.MouseEvent_GetX(*args, **kwargs)
4564
4565 def GetY(*args, **kwargs):
4566 """
4567 GetY(self) -> int
4568
4569 Returns Y coordinate of the physical mouse event position.
4570 """
4571 return _core_.MouseEvent_GetY(*args, **kwargs)
4572
4573 def GetWheelRotation(*args, **kwargs):
4574 """
4575 GetWheelRotation(self) -> int
4576
4577 Get wheel rotation, positive or negative indicates direction of
4578 rotation. Current devices all send an event when rotation is equal to
4579 +/-WheelDelta, but this allows for finer resolution devices to be
4580 created in the future. Because of this you shouldn't assume that one
4581 event is equal to 1 line or whatever, but you should be able to either
4582 do partial line scrolling or wait until +/-WheelDelta rotation values
4583 have been accumulated before scrolling.
4584 """
4585 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4586
4587 def GetWheelDelta(*args, **kwargs):
4588 """
4589 GetWheelDelta(self) -> int
4590
4591 Get wheel delta, normally 120. This is the threshold for action to be
4592 taken, and one such action (for example, scrolling one increment)
4593 should occur for each delta.
4594 """
4595 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4596
4597 def GetLinesPerAction(*args, **kwargs):
4598 """
4599 GetLinesPerAction(self) -> int
4600
4601 Returns the configured number of lines (or whatever) to be scrolled
4602 per wheel action. Defaults to three.
4603 """
4604 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4605
4606 def IsPageScroll(*args, **kwargs):
4607 """
4608 IsPageScroll(self) -> bool
4609
4610 Returns true if the system has been setup to do page scrolling with
4611 the mouse wheel instead of line scrolling.
4612 """
4613 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4614
4615 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4616 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4617 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4618 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4619 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4620 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4621 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4622 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4623 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4624 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4625 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4626 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4627 MouseEvent_swigregister = _core_.MouseEvent_swigregister
4628 MouseEvent_swigregister(MouseEvent)
4629
4630 #---------------------------------------------------------------------------
4631
4632 class SetCursorEvent(Event):
4633 """
4634 A SetCursorEvent is generated when the mouse cursor is about to be set
4635 as a result of mouse motion. This event gives the application the
4636 chance to perform specific mouse cursor processing based on the
4637 current position of the mouse within the window. Use the `SetCursor`
4638 method to specify the cursor you want to be displayed.
4639 """
4640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4641 __repr__ = _swig_repr
4642 def __init__(self, *args, **kwargs):
4643 """
4644 __init__(self, int x=0, int y=0) -> SetCursorEvent
4645
4646 Construct a new `wx.SetCursorEvent`.
4647 """
4648 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4649 def GetX(*args, **kwargs):
4650 """
4651 GetX(self) -> int
4652
4653 Returns the X coordinate of the mouse in client coordinates.
4654 """
4655 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4656
4657 def GetY(*args, **kwargs):
4658 """
4659 GetY(self) -> int
4660
4661 Returns the Y coordinate of the mouse in client coordinates.
4662 """
4663 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4664
4665 def SetCursor(*args, **kwargs):
4666 """
4667 SetCursor(self, Cursor cursor)
4668
4669 Sets the cursor associated with this event.
4670 """
4671 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4672
4673 def GetCursor(*args, **kwargs):
4674 """
4675 GetCursor(self) -> Cursor
4676
4677 Returns a reference to the cursor specified by this event.
4678 """
4679 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4680
4681 def HasCursor(*args, **kwargs):
4682 """
4683 HasCursor(self) -> bool
4684
4685 Returns true if the cursor specified by this event is a valid cursor.
4686 """
4687 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4688
4689 SetCursorEvent_swigregister = _core_.SetCursorEvent_swigregister
4690 SetCursorEvent_swigregister(SetCursorEvent)
4691
4692 #---------------------------------------------------------------------------
4693
4694 class KeyEvent(Event):
4695 """
4696 This event class contains information about keypress and character
4697 events. These events are only sent to the widget that currently has
4698 the keyboard focus.
4699
4700 Notice that there are three different kinds of keyboard events in
4701 wxWidgets: key down and up events and char events. The difference
4702 between the first two is clear - the first corresponds to a key press
4703 and the second to a key release - otherwise they are identical. Just
4704 note that if the key is maintained in a pressed state you will
4705 typically get a lot of (automatically generated) down events but only
4706 one up so it is wrong to assume that there is one up event
4707 corresponding to each down one.
4708
4709 Both key events provide untranslated key codes while the char event
4710 carries the translated one. The untranslated code for alphanumeric
4711 keys is always an upper case value. For the other keys it is one of
4712 WXK_XXX values from the keycodes table. The translated key is, in
4713 general, the character the user expects to appear as the result of the
4714 key combination when typing the text into a text entry zone, for
4715 example.
4716
4717 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4718 and the standard US keyboard): when the 'A' key is pressed, the key
4719 down event key code is equal to ASCII A == 65. But the char event key
4720 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4721 'A' keys simultaneously , the key code in key down event will still be
4722 just 'A' while the char event key code parameter will now be 'A' as
4723 well.
4724
4725 Although in this simple case it is clear that the correct key code
4726 could be found in the key down event handler by checking the value
4727 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4728 as for non alphanumeric keys or non-US keyboard layouts the
4729 translation is keyboard-layout dependent and can only be done properly
4730 by the system itself.
4731
4732 Another kind of translation is done when the control key is pressed:
4733 for example, for CTRL-A key press the key down event still carries the
4734 same key code 'A' as usual but the char event will have key code of 1,
4735 the ASCII value of this key combination.
4736
4737 You may discover how the other keys on your system behave
4738 interactively by running the KeyEvents sample in the wxPython demo and
4739 pressing some keys while the blue box at the top has the keyboard
4740 focus.
4741
4742 **Note**: If a key down event is caught and the event handler does not
4743 call event.Skip() then the coresponding char event will not
4744 happen. This is by design and enables the programs that handle both
4745 types of events to be a bit simpler.
4746
4747 **Note for Windows programmers**: The key and char events in wxWidgets
4748 are similar to but slightly different from Windows WM_KEYDOWN and
4749 WM_CHAR events. In particular, Alt-x combination will generate a char
4750 event in wxWidgets (unless it is used as an accelerator).
4751
4752 **Tip**: be sure to call event.Skip() for events that you don't
4753 process in key event function, otherwise menu shortcuts may cease to
4754 work under Windows.
4755
4756 """
4757 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4758 __repr__ = _swig_repr
4759 def __init__(self, *args, **kwargs):
4760 """
4761 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4762
4763 Construct a new `wx.KeyEvent`. Valid event types are:
4764 *
4765 """
4766 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4767 def GetModifiers(*args, **kwargs):
4768 """
4769 GetModifiers(self) -> int
4770
4771 Returns a bitmask of the current modifier settings. Can be used to
4772 check if the key event has exactly the given modifiers without having
4773 to explicitly check that the other modifiers are not down. For
4774 example::
4775
4776 if event.GetModifers() == wx.MOD_CONTROL:
4777 DoSomething()
4778
4779 """
4780 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4781
4782 def ControlDown(*args, **kwargs):
4783 """
4784 ControlDown(self) -> bool
4785
4786 Returns ``True`` if the Control key was down at the time of the event.
4787 """
4788 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4789
4790 def MetaDown(*args, **kwargs):
4791 """
4792 MetaDown(self) -> bool
4793
4794 Returns ``True`` if the Meta key was down at the time of the event.
4795 """
4796 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4797
4798 def AltDown(*args, **kwargs):
4799 """
4800 AltDown(self) -> bool
4801
4802 Returns ``True`` if the Alt key was down at the time of the event.
4803 """
4804 return _core_.KeyEvent_AltDown(*args, **kwargs)
4805
4806 def ShiftDown(*args, **kwargs):
4807 """
4808 ShiftDown(self) -> bool
4809
4810 Returns ``True`` if the Shift key was down at the time of the event.
4811 """
4812 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4813
4814 def CmdDown(*args, **kwargs):
4815 """
4816 CmdDown(self) -> bool
4817
4818 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4819 platforms but the special "Apple" (a.k.a as "Command") key on
4820 Macs. It makes often sense to use it instead of, say, `ControlDown`
4821 because Cmd key is used for the same thing under Mac as Ctrl
4822 elsewhere. The Ctrl still exists, it's just not used for this
4823 purpose. So for non-Mac platforms this is the same as `ControlDown`
4824 and Macs this is the same as `MetaDown`.
4825 """
4826 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4827
4828 def HasModifiers(*args, **kwargs):
4829 """
4830 HasModifiers(self) -> bool
4831
4832 Returns true if either CTRL or ALT keys was down at the time of the
4833 key event. Note that this function does not take into account neither
4834 SHIFT nor META key states (the reason for ignoring the latter is that
4835 it is common for NUMLOCK key to be configured as META under X but the
4836 key presses even while NUMLOCK is on should be still processed
4837 normally).
4838 """
4839 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4840
4841 def GetKeyCode(*args, **kwargs):
4842 """
4843 GetKeyCode(self) -> int
4844
4845 Returns the virtual key code. ASCII events return normal ASCII values,
4846 while non-ASCII events return values such as WXK_LEFT for the left
4847 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4848 codes.
4849
4850 Note that in Unicode build, the returned value is meaningful only if
4851 the user entered a character that can be represented in current
4852 locale's default charset. You can obtain the corresponding Unicode
4853 character using `GetUnicodeKey`.
4854 """
4855 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4856
4857 KeyCode = GetKeyCode
4858 def GetUnicodeKey(*args, **kwargs):
4859 """
4860 GetUnicodeKey(self) -> int
4861
4862 Returns the Unicode character corresponding to this key event. This
4863 function is only meaningfule in a Unicode build of wxPython.
4864 """
4865 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4866
4867 GetUniChar = GetUnicodeKey
4868 def GetRawKeyCode(*args, **kwargs):
4869 """
4870 GetRawKeyCode(self) -> unsigned int
4871
4872 Returns the raw key code for this event. This is a platform-dependent
4873 scan code which should only be used in advanced
4874 applications. Currently the raw key codes are not supported by all
4875 ports.
4876 """
4877 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4878
4879 def GetRawKeyFlags(*args, **kwargs):
4880 """
4881 GetRawKeyFlags(self) -> unsigned int
4882
4883 Returns the low level key flags for this event. The flags are
4884 platform-dependent and should only be used in advanced applications.
4885 Currently the raw key flags are not supported by all ports.
4886 """
4887 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4888
4889 def GetPosition(*args, **kwargs):
4890 """
4891 GetPosition(self) -> Point
4892
4893 Find the position of the event, if applicable.
4894 """
4895 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4896
4897 def GetPositionTuple(*args, **kwargs):
4898 """
4899 GetPositionTuple() -> (x,y)
4900
4901 Find the position of the event, if applicable.
4902 """
4903 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4904
4905 def GetX(*args, **kwargs):
4906 """
4907 GetX(self) -> int
4908
4909 Returns the X position (in client coordinates) of the event, if
4910 applicable.
4911 """
4912 return _core_.KeyEvent_GetX(*args, **kwargs)
4913
4914 def GetY(*args, **kwargs):
4915 """
4916 GetY(self) -> int
4917
4918 Returns the Y position (in client coordinates) of the event, if
4919 applicable.
4920 """
4921 return _core_.KeyEvent_GetY(*args, **kwargs)
4922
4923 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4924 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4925 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4926 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4927 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4928 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4929 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4930 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4931 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4932 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4933 KeyEvent_swigregister = _core_.KeyEvent_swigregister
4934 KeyEvent_swigregister(KeyEvent)
4935
4936 #---------------------------------------------------------------------------
4937
4938 class SizeEvent(Event):
4939 """
4940 A size event holds information about size change events. The EVT_SIZE
4941 handler function will be called when the window it is bound to has
4942 been resized.
4943
4944 Note that the size passed is of the whole window: call
4945 `wx.Window.GetClientSize` for the area which may be used by the
4946 application.
4947
4948 When a window is resized, usually only a small part of the window is
4949 damaged and and that area is all that is in the update region for the
4950 next paint event. However, if your drawing depends on the size of the
4951 window, you may need to clear the DC explicitly and repaint the whole
4952 window. In which case, you may need to call `wx.Window.Refresh` to
4953 invalidate the entire window.
4954
4955 """
4956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4957 __repr__ = _swig_repr
4958 def __init__(self, *args, **kwargs):
4959 """
4960 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4961
4962 Construct a new ``wx.SizeEvent``.
4963 """
4964 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4965 def GetSize(*args, **kwargs):
4966 """
4967 GetSize(self) -> Size
4968
4969 Returns the entire size of the window generating the size change
4970 event.
4971 """
4972 return _core_.SizeEvent_GetSize(*args, **kwargs)
4973
4974 def GetRect(*args, **kwargs):
4975 """GetRect(self) -> Rect"""
4976 return _core_.SizeEvent_GetRect(*args, **kwargs)
4977
4978 def SetRect(*args, **kwargs):
4979 """SetRect(self, Rect rect)"""
4980 return _core_.SizeEvent_SetRect(*args, **kwargs)
4981
4982 def SetSize(*args, **kwargs):
4983 """SetSize(self, Size size)"""
4984 return _core_.SizeEvent_SetSize(*args, **kwargs)
4985
4986 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4987 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4988 SizeEvent_swigregister = _core_.SizeEvent_swigregister
4989 SizeEvent_swigregister(SizeEvent)
4990
4991 #---------------------------------------------------------------------------
4992
4993 class MoveEvent(Event):
4994 """
4995 This event object is sent for EVT_MOVE event bindings when a window is
4996 moved to a new position.
4997 """
4998 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4999 __repr__ = _swig_repr
5000 def __init__(self, *args, **kwargs):
5001 """
5002 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5003
5004 Constructor.
5005 """
5006 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5007 def GetPosition(*args, **kwargs):
5008 """
5009 GetPosition(self) -> Point
5010
5011 Returns the position of the window generating the move change event.
5012 """
5013 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5014
5015 def GetRect(*args, **kwargs):
5016 """GetRect(self) -> Rect"""
5017 return _core_.MoveEvent_GetRect(*args, **kwargs)
5018
5019 def SetRect(*args, **kwargs):
5020 """SetRect(self, Rect rect)"""
5021 return _core_.MoveEvent_SetRect(*args, **kwargs)
5022
5023 def SetPosition(*args, **kwargs):
5024 """SetPosition(self, Point pos)"""
5025 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5026
5027 m_pos = property(GetPosition, SetPosition)
5028 m_rect = property(GetRect, SetRect)
5029
5030 MoveEvent_swigregister = _core_.MoveEvent_swigregister
5031 MoveEvent_swigregister(MoveEvent)
5032
5033 #---------------------------------------------------------------------------
5034
5035 class PaintEvent(Event):
5036 """
5037 A paint event is sent when a window's contents needs to be repainted.
5038 Note that in an EVT_PAINT handler the application must *always* create
5039 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5040 Windows assumes that the window has not been painted yet and will send
5041 the event again, causing endless refreshes.
5042
5043 You can optimize painting by retrieving the rectangles that have been
5044 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5045 and only repainting these rectangles. The rectangles are in terms of
5046 the client area, and are unscrolled, so you will need to do some
5047 calculations using the current view position to obtain logical,
5048 scrolled units.
5049
5050 """
5051 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5052 __repr__ = _swig_repr
5053 def __init__(self, *args, **kwargs):
5054 """__init__(self, int Id=0) -> PaintEvent"""
5055 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5056 PaintEvent_swigregister = _core_.PaintEvent_swigregister
5057 PaintEvent_swigregister(PaintEvent)
5058
5059 class NcPaintEvent(Event):
5060 """Proxy of C++ NcPaintEvent class"""
5061 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5062 __repr__ = _swig_repr
5063 def __init__(self, *args, **kwargs):
5064 """__init__(self, int winid=0) -> NcPaintEvent"""
5065 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5066 NcPaintEvent_swigregister = _core_.NcPaintEvent_swigregister
5067 NcPaintEvent_swigregister(NcPaintEvent)
5068
5069 #---------------------------------------------------------------------------
5070
5071 class EraseEvent(Event):
5072 """
5073 An erase event is sent whenever the background of a window needs to be
5074 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5075 binder. On some platforms, such as GTK+, this event is simulated
5076 (simply generated just before the paint event) and may cause flicker.
5077
5078 To paint a custom background use the `GetDC` method and use the returned
5079 device context if it is not ``None``, otherwise create a temporary
5080 `wx.ClientDC` and draw on that.
5081
5082 """
5083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5084 __repr__ = _swig_repr
5085 def __init__(self, *args, **kwargs):
5086 """
5087 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5088
5089 Constructor
5090 """
5091 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5092 def GetDC(*args, **kwargs):
5093 """
5094 GetDC(self) -> DC
5095
5096 Returns the device context the event handler should draw upon. If
5097 ``None`` is returned then create a temporary `wx.ClientDC` and use
5098 that instead.
5099 """
5100 return _core_.EraseEvent_GetDC(*args, **kwargs)
5101
5102 EraseEvent_swigregister = _core_.EraseEvent_swigregister
5103 EraseEvent_swigregister(EraseEvent)
5104
5105 #---------------------------------------------------------------------------
5106
5107 class FocusEvent(Event):
5108 """
5109 A focus event is sent when a window's focus changes. The window losing
5110 focus receives an EVT_KILL_FOCUS event while the window gaining it
5111 gets an EVT_SET_FOCUS event.
5112
5113 Notice that the set focus event happens both when the user gives focus
5114 to the window (whether using the mouse or keyboard) and when it is
5115 done from the program itself using `wx.Window.SetFocus`.
5116
5117 """
5118 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5119 __repr__ = _swig_repr
5120 def __init__(self, *args, **kwargs):
5121 """
5122 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5123
5124 Constructor
5125 """
5126 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5127 def GetWindow(*args, **kwargs):
5128 """
5129 GetWindow(self) -> Window
5130
5131 Returns the other window associated with this event, that is the
5132 window which had the focus before for the EVT_SET_FOCUS event and the
5133 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5134
5135 Warning: the window returned may be None!
5136 """
5137 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5138
5139 def SetWindow(*args, **kwargs):
5140 """SetWindow(self, Window win)"""
5141 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5142
5143 FocusEvent_swigregister = _core_.FocusEvent_swigregister
5144 FocusEvent_swigregister(FocusEvent)
5145
5146 #---------------------------------------------------------------------------
5147
5148 class ChildFocusEvent(CommandEvent):
5149 """
5150 wx.ChildFocusEvent notifies the parent that a child has received the
5151 focus. Unlike `wx.FocusEvent` it is propagated up the window
5152 heirarchy.
5153 """
5154 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5155 __repr__ = _swig_repr
5156 def __init__(self, *args, **kwargs):
5157 """
5158 __init__(self, Window win=None) -> ChildFocusEvent
5159
5160 Constructor
5161 """
5162 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5163 def GetWindow(*args, **kwargs):
5164 """
5165 GetWindow(self) -> Window
5166
5167 The window which has just received the focus.
5168 """
5169 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5170
5171 ChildFocusEvent_swigregister = _core_.ChildFocusEvent_swigregister
5172 ChildFocusEvent_swigregister(ChildFocusEvent)
5173
5174 #---------------------------------------------------------------------------
5175
5176 class ActivateEvent(Event):
5177 """
5178 An activate event is sent when a top-level window or the entire
5179 application is being activated or deactivated.
5180
5181 A top-level window (a dialog or frame) receives an activate event when
5182 is being activated or deactivated. This is indicated visually by the
5183 title bar changing colour, and a subwindow gaining the keyboard focus.
5184 An application is activated or deactivated when one of its frames
5185 becomes activated, or a frame becomes inactivate resulting in all
5186 application frames being inactive.
5187
5188 Please note that usually you should call event.Skip() in your handlers
5189 for these events so the default handlers will still be called, as not
5190 doing so can result in strange effects.
5191
5192 """
5193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5194 __repr__ = _swig_repr
5195 def __init__(self, *args, **kwargs):
5196 """
5197 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5198
5199 Constructor
5200 """
5201 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5202 def GetActive(*args, **kwargs):
5203 """
5204 GetActive(self) -> bool
5205
5206 Returns true if the application or window is being activated, false
5207 otherwise.
5208 """
5209 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5210
5211 ActivateEvent_swigregister = _core_.ActivateEvent_swigregister
5212 ActivateEvent_swigregister(ActivateEvent)
5213
5214 #---------------------------------------------------------------------------
5215
5216 class InitDialogEvent(Event):
5217 """
5218 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5219 any window when `wx.Window.InitDialog` is called. Handlers for this
5220 event can transfer data to the window, or anything else that should be
5221 done before the user begins editing the form. The default handler
5222 calls `wx.Window.TransferDataToWindow`.
5223 """
5224 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5225 __repr__ = _swig_repr
5226 def __init__(self, *args, **kwargs):
5227 """
5228 __init__(self, int Id=0) -> InitDialogEvent
5229
5230 Constructor
5231 """
5232 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5233 InitDialogEvent_swigregister = _core_.InitDialogEvent_swigregister
5234 InitDialogEvent_swigregister(InitDialogEvent)
5235
5236 #---------------------------------------------------------------------------
5237
5238 class MenuEvent(Event):
5239 """
5240 This class is used for a variety of menu-related events. Note that
5241 these do not include menu command events, which are handled by sending
5242 `wx.CommandEvent` objects.
5243
5244 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5245 text in the first field of the status bar.
5246 """
5247 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5248 __repr__ = _swig_repr
5249 def __init__(self, *args, **kwargs):
5250 """
5251 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5252
5253 Constructor
5254 """
5255 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5256 def GetMenuId(*args, **kwargs):
5257 """
5258 GetMenuId(self) -> int
5259
5260 Returns the menu identifier associated with the event. This method
5261 should be only used with the HIGHLIGHT events.
5262 """
5263 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5264
5265 def IsPopup(*args, **kwargs):
5266 """
5267 IsPopup(self) -> bool
5268
5269 Returns ``True`` if the menu which is being opened or closed is a
5270 popup menu, ``False`` if it is a normal one. This method should only
5271 be used with the OPEN and CLOSE events.
5272 """
5273 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5274
5275 def GetMenu(*args, **kwargs):
5276 """
5277 GetMenu(self) -> Menu
5278
5279 Returns the menu which is being opened or closed. This method should
5280 only be used with the OPEN and CLOSE events.
5281 """
5282 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5283
5284 MenuEvent_swigregister = _core_.MenuEvent_swigregister
5285 MenuEvent_swigregister(MenuEvent)
5286
5287 #---------------------------------------------------------------------------
5288
5289 class CloseEvent(Event):
5290 """
5291 This event class contains information about window and session close
5292 events.
5293
5294 The handler function for EVT_CLOSE is called when the user has tried
5295 to close a a frame or dialog box using the window manager controls or
5296 the system menu. It can also be invoked by the application itself
5297 programmatically, for example by calling the `wx.Window.Close`
5298 function.
5299
5300 You should check whether the application is forcing the deletion of
5301 the window using `CanVeto`. If it returns ``False``, you must destroy
5302 the window using `wx.Window.Destroy`. If the return value is ``True``,
5303 it is up to you whether you respond by destroying the window or not.
5304 For example you may wish to display a message dialog prompting to save
5305 files or to cancel the close.
5306
5307 If you don't destroy the window, you should call `Veto` to let the
5308 calling code know that you did not destroy the window. This allows the
5309 `wx.Window.Close` function to return ``True`` or ``False`` depending
5310 on whether the close instruction was honored or not.
5311 """
5312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5313 __repr__ = _swig_repr
5314 def __init__(self, *args, **kwargs):
5315 """
5316 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5317
5318 Constructor.
5319 """
5320 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5321 def SetLoggingOff(*args, **kwargs):
5322 """
5323 SetLoggingOff(self, bool logOff)
5324
5325 Sets the 'logging off' flag.
5326 """
5327 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5328
5329 def GetLoggingOff(*args, **kwargs):
5330 """
5331 GetLoggingOff(self) -> bool
5332
5333 Returns ``True`` if the user is logging off or ``False`` if the
5334 system is shutting down. This method can only be called for end
5335 session and query end session events, it doesn't make sense for close
5336 window event.
5337 """
5338 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5339
5340 def Veto(*args, **kwargs):
5341 """
5342 Veto(self, bool veto=True)
5343
5344 Call this from your event handler to veto a system shutdown or to
5345 signal to the calling application that a window close did not happen.
5346
5347 You can only veto a shutdown or close if `CanVeto` returns true.
5348 """
5349 return _core_.CloseEvent_Veto(*args, **kwargs)
5350
5351 def GetVeto(*args, **kwargs):
5352 """GetVeto(self) -> bool"""
5353 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5354
5355 def SetCanVeto(*args, **kwargs):
5356 """
5357 SetCanVeto(self, bool canVeto)
5358
5359 Sets the 'can veto' flag.
5360 """
5361 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5362
5363 def CanVeto(*args, **kwargs):
5364 """
5365 CanVeto(self) -> bool
5366
5367 Returns true if you can veto a system shutdown or a window close
5368 event. Vetoing a window close event is not possible if the calling
5369 code wishes to force the application to exit, and so this function
5370 must be called to check this.
5371 """
5372 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5373
5374 CloseEvent_swigregister = _core_.CloseEvent_swigregister
5375 CloseEvent_swigregister(CloseEvent)
5376
5377 #---------------------------------------------------------------------------
5378
5379 class ShowEvent(Event):
5380 """An EVT_SHOW event is sent when a window is shown or hidden."""
5381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5382 __repr__ = _swig_repr
5383 def __init__(self, *args, **kwargs):
5384 """
5385 __init__(self, int winid=0, bool show=False) -> ShowEvent
5386
5387 An EVT_SHOW event is sent when a window is shown or hidden.
5388 """
5389 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5390 def SetShow(*args, **kwargs):
5391 """SetShow(self, bool show)"""
5392 return _core_.ShowEvent_SetShow(*args, **kwargs)
5393
5394 def GetShow(*args, **kwargs):
5395 """GetShow(self) -> bool"""
5396 return _core_.ShowEvent_GetShow(*args, **kwargs)
5397
5398 ShowEvent_swigregister = _core_.ShowEvent_swigregister
5399 ShowEvent_swigregister(ShowEvent)
5400
5401 #---------------------------------------------------------------------------
5402
5403 class IconizeEvent(Event):
5404 """
5405 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5406 restored.
5407 """
5408 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5409 __repr__ = _swig_repr
5410 def __init__(self, *args, **kwargs):
5411 """
5412 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5413
5414 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5415 restored.
5416 """
5417 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5418 def Iconized(*args, **kwargs):
5419 """
5420 Iconized(self) -> bool
5421
5422 Returns ``True`` if the frame has been iconized, ``False`` if it has
5423 been restored.
5424 """
5425 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5426
5427 IconizeEvent_swigregister = _core_.IconizeEvent_swigregister
5428 IconizeEvent_swigregister(IconizeEvent)
5429
5430 #---------------------------------------------------------------------------
5431
5432 class MaximizeEvent(Event):
5433 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5435 __repr__ = _swig_repr
5436 def __init__(self, *args, **kwargs):
5437 """
5438 __init__(self, int id=0) -> MaximizeEvent
5439
5440 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5441 """
5442 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5443 MaximizeEvent_swigregister = _core_.MaximizeEvent_swigregister
5444 MaximizeEvent_swigregister(MaximizeEvent)
5445
5446 #---------------------------------------------------------------------------
5447
5448 class DropFilesEvent(Event):
5449 """
5450 This class is used for drop files events, that is, when files have
5451 been dropped onto the window. This functionality is only available
5452 under Windows. The window must have previously been enabled for
5453 dropping by calling `wx.Window.DragAcceptFiles`.
5454
5455 Important note: this is a separate implementation to the more general
5456 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5457 implementation uses the older, Windows message-based approach of
5458 dropping files.
5459
5460 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5461 events.
5462
5463 """
5464 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5465 def __init__(self): raise AttributeError, "No constructor defined"
5466 __repr__ = _swig_repr
5467 def GetPosition(*args, **kwargs):
5468 """
5469 GetPosition(self) -> Point
5470
5471 Returns the position at which the files were dropped.
5472 """
5473 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5474
5475 def GetNumberOfFiles(*args, **kwargs):
5476 """
5477 GetNumberOfFiles(self) -> int
5478
5479 Returns the number of files dropped.
5480 """
5481 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5482
5483 def GetFiles(*args, **kwargs):
5484 """
5485 GetFiles(self) -> PyObject
5486
5487 Returns a list of the filenames that were dropped.
5488 """
5489 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5490
5491 DropFilesEvent_swigregister = _core_.DropFilesEvent_swigregister
5492 DropFilesEvent_swigregister(DropFilesEvent)
5493
5494 #---------------------------------------------------------------------------
5495
5496 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5497 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5498 class UpdateUIEvent(CommandEvent):
5499 """
5500 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5501 wxWidgets to give an application the chance to update various user
5502 interface elements.
5503
5504 Without update UI events, an application has to work hard to
5505 check/uncheck, enable/disable, and set the text for elements such as
5506 menu items and toolbar buttons. The code for doing this has to be
5507 mixed up with the code that is invoked when an action is invoked for a
5508 menu item or button.
5509
5510 With update UI events, you define an event handler to look at the
5511 state of the application and change UI elements accordingly. wxWidgets
5512 will call your handler functions in idle time, so you don't have to
5513 worry where to call this code. In addition to being a clearer and more
5514 declarative method, it also means you don't have to worry whether
5515 you're updating a toolbar or menubar identifier. The same handler can
5516 update a menu item and toolbar button, if the ID values are the same.
5517
5518 Instead of directly manipulating the menu or button, you call
5519 functions in the event object, such as `Check`. wxWidgets will
5520 determine whether such a call has been made, and which UI element to
5521 update.
5522
5523 These events will work for popup menus as well as menubars. Just
5524 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5525 any UI events for the window that owns the menu.
5526
5527 If you find that the overhead of UI update processing is affecting
5528 your application, you can do one or both of the following:
5529
5530 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5531 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5532 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5533 receive update events. No other windows will receive update
5534 events.
5535
5536 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5537 value to set the delay between updates. You may need to call
5538 `wx.Window.UpdateWindowUI` at critical points, for example when
5539 a dialog is about to be shown, in case the user sees a slight
5540 delay before windows are updated.
5541
5542 Note that although events are sent in idle time, defining a EVT_IDLE
5543 handler for a window does not affect this because the events are sent
5544 from an internal idle handler.
5545
5546 wxWidgets tries to optimize update events on some platforms. On
5547 Windows and GTK+, events for menubar items are only sent when the menu
5548 is about to be shown, and not in idle time.
5549
5550 """
5551 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5552 __repr__ = _swig_repr
5553 def __init__(self, *args, **kwargs):
5554 """
5555 __init__(self, int commandId=0) -> UpdateUIEvent
5556
5557 Constructor
5558 """
5559 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5560 def GetChecked(*args, **kwargs):
5561 """
5562 GetChecked(self) -> bool
5563
5564 Returns ``True`` if the UI element should be checked.
5565 """
5566 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5567
5568 def GetEnabled(*args, **kwargs):
5569 """
5570 GetEnabled(self) -> bool
5571
5572 Returns ``True`` if the UI element should be enabled.
5573 """
5574 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5575
5576 def GetShown(*args, **kwargs):
5577 """
5578 GetShown(self) -> bool
5579
5580 Returns ``True`` if the UI element should be shown.
5581 """
5582 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5583
5584 def GetText(*args, **kwargs):
5585 """
5586 GetText(self) -> String
5587
5588 Returns the text that should be set for the UI element.
5589 """
5590 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5591
5592 def GetSetText(*args, **kwargs):
5593 """
5594 GetSetText(self) -> bool
5595
5596 Returns ``True`` if the application has called `SetText`. For
5597 wxWidgets internal use only.
5598 """
5599 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5600
5601 def GetSetChecked(*args, **kwargs):
5602 """
5603 GetSetChecked(self) -> bool
5604
5605 Returns ``True`` if the application has called `Check`. For wxWidgets
5606 internal use only.
5607 """
5608 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5609
5610 def GetSetEnabled(*args, **kwargs):
5611 """
5612 GetSetEnabled(self) -> bool
5613
5614 Returns ``True`` if the application has called `Enable`. For wxWidgets
5615 internal use only.
5616 """
5617 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5618
5619 def GetSetShown(*args, **kwargs):
5620 """
5621 GetSetShown(self) -> bool
5622
5623 Returns ``True`` if the application has called `Show`. For wxWidgets
5624 internal use only.
5625 """
5626 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5627
5628 def Check(*args, **kwargs):
5629 """
5630 Check(self, bool check)
5631
5632 Check or uncheck the UI element.
5633 """
5634 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5635
5636 def Enable(*args, **kwargs):
5637 """
5638 Enable(self, bool enable)
5639
5640 Enable or disable the UI element.
5641 """
5642 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5643
5644 def Show(*args, **kwargs):
5645 """
5646 Show(self, bool show)
5647
5648 Show or hide the UI element.
5649 """
5650 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5651
5652 def SetText(*args, **kwargs):
5653 """
5654 SetText(self, String text)
5655
5656 Sets the text for this UI element.
5657 """
5658 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5659
5660 def SetUpdateInterval(*args, **kwargs):
5661 """
5662 SetUpdateInterval(long updateInterval)
5663
5664 Sets the interval between updates in milliseconds. Set to -1 to
5665 disable updates, or to 0 to update as frequently as possible. The
5666 default is 0.
5667
5668 Use this to reduce the overhead of UI update events if your
5669 application has a lot of windows. If you set the value to -1 or
5670 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5671 at appropriate points in your application, such as when a dialog is
5672 about to be shown.
5673 """
5674 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5675
5676 SetUpdateInterval = staticmethod(SetUpdateInterval)
5677 def GetUpdateInterval(*args, **kwargs):
5678 """
5679 GetUpdateInterval() -> long
5680
5681 Returns the current interval between updates in milliseconds. -1
5682 disables updates, 0 updates as frequently as possible.
5683 """
5684 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5685
5686 GetUpdateInterval = staticmethod(GetUpdateInterval)
5687 def CanUpdate(*args, **kwargs):
5688 """
5689 CanUpdate(Window win) -> bool
5690
5691 Returns ``True`` if it is appropriate to update (send UI update events
5692 to) this window.
5693
5694 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5695 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5696 events were last sent in idle time, and the update interval, to
5697 determine whether events should be sent to this window now. By default
5698 this will always return true because the update mode is initially
5699 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5700 events will be sent as often as possible. You can reduce the frequency
5701 that events are sent by changing the mode and/or setting an update
5702 interval.
5703
5704 """
5705 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5706
5707 CanUpdate = staticmethod(CanUpdate)
5708 def ResetUpdateTime(*args, **kwargs):
5709 """
5710 ResetUpdateTime()
5711
5712 Used internally to reset the last-updated time to the current time. It
5713 is assumed that update events are normally sent in idle time, so this
5714 is called at the end of idle processing.
5715 """
5716 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5717
5718 ResetUpdateTime = staticmethod(ResetUpdateTime)
5719 def SetMode(*args, **kwargs):
5720 """
5721 SetMode(int mode)
5722
5723 Specify how wxWidgets will send update events: to all windows, or only
5724 to those which specify that they will process the events.
5725
5726 The mode may be one of the following values:
5727
5728 ============================= ==========================================
5729 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5730 is the default setting.
5731 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5732 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5733 style set.
5734 ============================= ==========================================
5735
5736 """
5737 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5738
5739 SetMode = staticmethod(SetMode)
5740 def GetMode(*args, **kwargs):
5741 """
5742 GetMode() -> int
5743
5744 Returns a value specifying how wxWidgets will send update events: to
5745 all windows, or only to those which specify that they will process the
5746 events.
5747 """
5748 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5749
5750 GetMode = staticmethod(GetMode)
5751 UpdateUIEvent_swigregister = _core_.UpdateUIEvent_swigregister
5752 UpdateUIEvent_swigregister(UpdateUIEvent)
5753
5754 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5755 """
5756 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5757
5758 Sets the interval between updates in milliseconds. Set to -1 to
5759 disable updates, or to 0 to update as frequently as possible. The
5760 default is 0.
5761
5762 Use this to reduce the overhead of UI update events if your
5763 application has a lot of windows. If you set the value to -1 or
5764 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5765 at appropriate points in your application, such as when a dialog is
5766 about to be shown.
5767 """
5768 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5769
5770 def UpdateUIEvent_GetUpdateInterval(*args):
5771 """
5772 UpdateUIEvent_GetUpdateInterval() -> long
5773
5774 Returns the current interval between updates in milliseconds. -1
5775 disables updates, 0 updates as frequently as possible.
5776 """
5777 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5778
5779 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5780 """
5781 UpdateUIEvent_CanUpdate(Window win) -> bool
5782
5783 Returns ``True`` if it is appropriate to update (send UI update events
5784 to) this window.
5785
5786 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5787 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5788 events were last sent in idle time, and the update interval, to
5789 determine whether events should be sent to this window now. By default
5790 this will always return true because the update mode is initially
5791 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5792 events will be sent as often as possible. You can reduce the frequency
5793 that events are sent by changing the mode and/or setting an update
5794 interval.
5795
5796 """
5797 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5798
5799 def UpdateUIEvent_ResetUpdateTime(*args):
5800 """
5801 UpdateUIEvent_ResetUpdateTime()
5802
5803 Used internally to reset the last-updated time to the current time. It
5804 is assumed that update events are normally sent in idle time, so this
5805 is called at the end of idle processing.
5806 """
5807 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5808
5809 def UpdateUIEvent_SetMode(*args, **kwargs):
5810 """
5811 UpdateUIEvent_SetMode(int mode)
5812
5813 Specify how wxWidgets will send update events: to all windows, or only
5814 to those which specify that they will process the events.
5815
5816 The mode may be one of the following values:
5817
5818 ============================= ==========================================
5819 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5820 is the default setting.
5821 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5822 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5823 style set.
5824 ============================= ==========================================
5825
5826 """
5827 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5828
5829 def UpdateUIEvent_GetMode(*args):
5830 """
5831 UpdateUIEvent_GetMode() -> int
5832
5833 Returns a value specifying how wxWidgets will send update events: to
5834 all windows, or only to those which specify that they will process the
5835 events.
5836 """
5837 return _core_.UpdateUIEvent_GetMode(*args)
5838
5839 #---------------------------------------------------------------------------
5840
5841 class SysColourChangedEvent(Event):
5842 """
5843 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5844 when the user changes the colour settings using the control
5845 panel. This is only applicable under Windows.
5846
5847 The default event handler for this event propagates the event to child
5848 windows, since Windows only sends the events to top-level windows. If
5849 intercepting this event for a top-level window, remember to call
5850 `Skip` so the the base class handler will still be executed, or to
5851 pass the event on to the window's children explicitly.
5852
5853 """
5854 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5855 __repr__ = _swig_repr
5856 def __init__(self, *args, **kwargs):
5857 """
5858 __init__(self) -> SysColourChangedEvent
5859
5860 Constructor
5861 """
5862 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5863 SysColourChangedEvent_swigregister = _core_.SysColourChangedEvent_swigregister
5864 SysColourChangedEvent_swigregister(SysColourChangedEvent)
5865
5866 #---------------------------------------------------------------------------
5867
5868 class MouseCaptureChangedEvent(Event):
5869 """
5870 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5871 a window that loses its mouse capture. This is called even if
5872 `wx.Window.ReleaseMouse` was called by the application code. Handling
5873 this event allows an application to cater for unexpected capture
5874 releases which might otherwise confuse mouse handling code.
5875
5876 This event is implemented under Windows only.
5877 """
5878 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5879 __repr__ = _swig_repr
5880 def __init__(self, *args, **kwargs):
5881 """
5882 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5883
5884 Constructor
5885 """
5886 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5887 def GetCapturedWindow(*args, **kwargs):
5888 """
5889 GetCapturedWindow(self) -> Window
5890
5891 Returns the window that gained the capture, or ``None`` if it was a
5892 non-wxWidgets window.
5893 """
5894 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5895
5896 MouseCaptureChangedEvent_swigregister = _core_.MouseCaptureChangedEvent_swigregister
5897 MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5898
5899 #---------------------------------------------------------------------------
5900
5901 class DisplayChangedEvent(Event):
5902 """
5903 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5904 resolution has changed.
5905
5906 This event is implemented under Windows only.
5907 """
5908 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5909 __repr__ = _swig_repr
5910 def __init__(self, *args, **kwargs):
5911 """__init__(self) -> DisplayChangedEvent"""
5912 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5913 DisplayChangedEvent_swigregister = _core_.DisplayChangedEvent_swigregister
5914 DisplayChangedEvent_swigregister(DisplayChangedEvent)
5915
5916 #---------------------------------------------------------------------------
5917
5918 class PaletteChangedEvent(Event):
5919 """
5920 An EVT_PALETTE_CHANGED event is sent when the system palette has
5921 changed, thereby giving each window a chance to redo their own to
5922 match.
5923
5924 This event is implemented under Windows only.
5925 """
5926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5927 __repr__ = _swig_repr
5928 def __init__(self, *args, **kwargs):
5929 """
5930 __init__(self, int id=0) -> PaletteChangedEvent
5931
5932 An EVT_PALETTE_CHANGED event is sent when the system palette has
5933 changed, thereby giving each window a chance to redo their own to
5934 match.
5935
5936 This event is implemented under Windows only.
5937 """
5938 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5939 def SetChangedWindow(*args, **kwargs):
5940 """SetChangedWindow(self, Window win)"""
5941 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5942
5943 def GetChangedWindow(*args, **kwargs):
5944 """GetChangedWindow(self) -> Window"""
5945 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5946
5947 PaletteChangedEvent_swigregister = _core_.PaletteChangedEvent_swigregister
5948 PaletteChangedEvent_swigregister(PaletteChangedEvent)
5949
5950 #---------------------------------------------------------------------------
5951
5952 class QueryNewPaletteEvent(Event):
5953 """
5954 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5955 focus and should re-do its palette.
5956
5957 This event is implemented under Windows only.
5958 """
5959 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5960 __repr__ = _swig_repr
5961 def __init__(self, *args, **kwargs):
5962 """
5963 __init__(self, int winid=0) -> QueryNewPaletteEvent
5964
5965 Constructor.
5966 """
5967 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
5968 def SetPaletteRealized(*args, **kwargs):
5969 """
5970 SetPaletteRealized(self, bool realized)
5971
5972 App should set this if it changes the palette.
5973 """
5974 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5975
5976 def GetPaletteRealized(*args, **kwargs):
5977 """GetPaletteRealized(self) -> bool"""
5978 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5979
5980 QueryNewPaletteEvent_swigregister = _core_.QueryNewPaletteEvent_swigregister
5981 QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
5982
5983 #---------------------------------------------------------------------------
5984
5985 class NavigationKeyEvent(Event):
5986 """
5987 EVT_NAVIGATION_KEY events are used to control moving the focus between
5988 widgets, otherwise known as tab-traversal. You woudl normally not
5989 catch navigation events in applications as there are already
5990 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5991 it useful to send navigation events in certain situations to change
5992 the focus in certain ways, although it's probably easier to just call
5993 `wx.Window.Navigate`.
5994 """
5995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5996 __repr__ = _swig_repr
5997 def __init__(self, *args, **kwargs):
5998 """__init__(self) -> NavigationKeyEvent"""
5999 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6000 def GetDirection(*args, **kwargs):
6001 """
6002 GetDirection(self) -> bool
6003
6004 Returns ``True`` if the direction is forward, ``False`` otherwise.
6005 """
6006 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6007
6008 def SetDirection(*args, **kwargs):
6009 """
6010 SetDirection(self, bool forward)
6011
6012 Specify the direction that the navigation should take. Usually the
6013 difference between using Tab and Shift-Tab.
6014 """
6015 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6016
6017 def IsWindowChange(*args, **kwargs):
6018 """
6019 IsWindowChange(self) -> bool
6020
6021 Returns ``True`` if window change is allowed.
6022 """
6023 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6024
6025 def SetWindowChange(*args, **kwargs):
6026 """
6027 SetWindowChange(self, bool ischange)
6028
6029 Specify if the navigation should be able to change parent windows.
6030 For example, changing notebook pages, etc. This is usually implemented
6031 by using Control-Tab.
6032 """
6033 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6034
6035 def IsFromTab(*args, **kwargs):
6036 """
6037 IsFromTab(self) -> bool
6038
6039 Returns ``True`` if the navigation event is originated from the Tab
6040 key.
6041 """
6042 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6043
6044 def SetFromTab(*args, **kwargs):
6045 """
6046 SetFromTab(self, bool bIs)
6047
6048 Set to true under MSW if the event was generated using the tab key.
6049 This is required for proper navogation over radio buttons.
6050 """
6051 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6052
6053 def SetFlags(*args, **kwargs):
6054 """
6055 SetFlags(self, long flags)
6056
6057 Set the navigation flags to a combination of the following:
6058
6059 * wx.NavigationKeyEvent.IsBackward
6060 * wx.NavigationKeyEvent.IsForward
6061 * wx.NavigationKeyEvent.WinChange
6062 * wx.NavigationKeyEvent.FromTab
6063
6064 """
6065 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6066
6067 def GetCurrentFocus(*args, **kwargs):
6068 """
6069 GetCurrentFocus(self) -> Window
6070
6071 Returns the child window which currenty has the focus. May be
6072 ``None``.
6073 """
6074 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6075
6076 def SetCurrentFocus(*args, **kwargs):
6077 """
6078 SetCurrentFocus(self, Window win)
6079
6080 Set the window that has the focus.
6081 """
6082 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6083
6084 IsBackward = _core_.NavigationKeyEvent_IsBackward
6085 IsForward = _core_.NavigationKeyEvent_IsForward
6086 WinChange = _core_.NavigationKeyEvent_WinChange
6087 FromTab = _core_.NavigationKeyEvent_FromTab
6088 NavigationKeyEvent_swigregister = _core_.NavigationKeyEvent_swigregister
6089 NavigationKeyEvent_swigregister(NavigationKeyEvent)
6090
6091 #---------------------------------------------------------------------------
6092
6093 class WindowCreateEvent(CommandEvent):
6094 """
6095 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6096 underlying GUI object) exists.
6097 """
6098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6099 __repr__ = _swig_repr
6100 def __init__(self, *args, **kwargs):
6101 """
6102 __init__(self, Window win=None) -> WindowCreateEvent
6103
6104 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6105 underlying GUI object) exists.
6106 """
6107 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6108 def GetWindow(*args, **kwargs):
6109 """
6110 GetWindow(self) -> Window
6111
6112 Returns the window that this event refers to.
6113 """
6114 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6115
6116 WindowCreateEvent_swigregister = _core_.WindowCreateEvent_swigregister
6117 WindowCreateEvent_swigregister(WindowCreateEvent)
6118
6119 class WindowDestroyEvent(CommandEvent):
6120 """
6121 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6122 when the GUI window is destroyed.
6123
6124 When a class derived from `wx.Window` is destroyed its destructor will
6125 have already run by the time this event is sent. Therefore this event
6126 will not usually be received at all by the window itself. Since it is
6127 received after the destructor has run, an object should not try to
6128 handle its own wx.WindowDestroyEvent, but it can be used to get
6129 notification of the destruction of another window.
6130 """
6131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6132 __repr__ = _swig_repr
6133 def __init__(self, *args, **kwargs):
6134 """
6135 __init__(self, Window win=None) -> WindowDestroyEvent
6136
6137 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6138 when the GUI window is destroyed.
6139
6140 When a class derived from `wx.Window` is destroyed its destructor will
6141 have already run by the time this event is sent. Therefore this event
6142 will not usually be received at all by the window itself. Since it is
6143 received after the destructor has run, an object should not try to
6144 handle its own wx.WindowDestroyEvent, but it can be used to get
6145 notification of the destruction of another window.
6146 """
6147 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6148 def GetWindow(*args, **kwargs):
6149 """
6150 GetWindow(self) -> Window
6151
6152 Returns the window that this event refers to.
6153 """
6154 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6155
6156 WindowDestroyEvent_swigregister = _core_.WindowDestroyEvent_swigregister
6157 WindowDestroyEvent_swigregister(WindowDestroyEvent)
6158
6159 #---------------------------------------------------------------------------
6160
6161 class ContextMenuEvent(CommandEvent):
6162 """
6163 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6164 give the application a chance to show a context (popup) menu.
6165 """
6166 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6167 __repr__ = _swig_repr
6168 def __init__(self, *args, **kwargs):
6169 """
6170 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6171
6172 Constructor.
6173 """
6174 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6175 def GetPosition(*args, **kwargs):
6176 """
6177 GetPosition(self) -> Point
6178
6179 Returns the position (in screen coordinants) at which the menu should
6180 be shown.
6181 """
6182 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6183
6184 def SetPosition(*args, **kwargs):
6185 """
6186 SetPosition(self, Point pos)
6187
6188 Sets the position at which the menu should be shown.
6189 """
6190 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6191
6192 ContextMenuEvent_swigregister = _core_.ContextMenuEvent_swigregister
6193 ContextMenuEvent_swigregister(ContextMenuEvent)
6194
6195 #---------------------------------------------------------------------------
6196
6197 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6198 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6199 class IdleEvent(Event):
6200 """
6201 This class is used for EVT_IDLE events, which are generated and sent
6202 when the application *becomes* idle. In other words, the when the
6203 event queue becomes empty then idle events are sent to all windows (by
6204 default) and as long as none of them call `RequestMore` then there are
6205 no more idle events until after the system event queue has some normal
6206 events and then becomes empty again.
6207
6208 By default, idle events are sent to all windows. If this is causing a
6209 significant overhead in your application, you can call
6210 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6211 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6212 which should receive idle events. Then idle events will only be sent
6213 to those windows and not to any others.
6214 """
6215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6216 __repr__ = _swig_repr
6217 def __init__(self, *args, **kwargs):
6218 """
6219 __init__(self) -> IdleEvent
6220
6221 Constructor
6222 """
6223 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6224 def RequestMore(*args, **kwargs):
6225 """
6226 RequestMore(self, bool needMore=True)
6227
6228 Tells wxWidgets that more processing is required. This function can be
6229 called by an EVT_IDLE handler for a window to indicate that the
6230 application should forward the EVT_IDLE event once more to the
6231 application windows. If no window calls this function during its
6232 EVT_IDLE handler, then the application will remain in a passive event
6233 loop until a new event is posted to the application by the windowing
6234 system.
6235 """
6236 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6237
6238 def MoreRequested(*args, **kwargs):
6239 """
6240 MoreRequested(self) -> bool
6241
6242 Returns ``True`` if the OnIdle function processing this event
6243 requested more processing time.
6244 """
6245 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6246
6247 def SetMode(*args, **kwargs):
6248 """
6249 SetMode(int mode)
6250
6251 Static method for specifying how wxWidgets will send idle events: to
6252 all windows, or only to those which specify that they will process the
6253 events.
6254
6255 The mode can be one of the following values:
6256
6257 ========================= ========================================
6258 wx.IDLE_PROCESS_ALL Send idle events to all windows
6259 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6260 the wx.WS_EX_PROCESS_IDLE extra style
6261 flag set.
6262 ========================= ========================================
6263
6264 """
6265 return _core_.IdleEvent_SetMode(*args, **kwargs)
6266
6267 SetMode = staticmethod(SetMode)
6268 def GetMode(*args, **kwargs):
6269 """
6270 GetMode() -> int
6271
6272 Static method returning a value specifying how wxWidgets will send
6273 idle events: to all windows, or only to those which specify that they
6274 will process the events.
6275 """
6276 return _core_.IdleEvent_GetMode(*args, **kwargs)
6277
6278 GetMode = staticmethod(GetMode)
6279 def CanSend(*args, **kwargs):
6280 """
6281 CanSend(Window win) -> bool
6282
6283 Returns ``True`` if it is appropriate to send idle events to this
6284 window.
6285
6286 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6287 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6288 events should be sent to this window now. By default this will always
6289 return ``True`` because the update mode is initially
6290 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6291 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6292 """
6293 return _core_.IdleEvent_CanSend(*args, **kwargs)
6294
6295 CanSend = staticmethod(CanSend)
6296 IdleEvent_swigregister = _core_.IdleEvent_swigregister
6297 IdleEvent_swigregister(IdleEvent)
6298
6299 def IdleEvent_SetMode(*args, **kwargs):
6300 """
6301 IdleEvent_SetMode(int mode)
6302
6303 Static method for specifying how wxWidgets will send idle events: to
6304 all windows, or only to those which specify that they will process the
6305 events.
6306
6307 The mode can be one of the following values:
6308
6309 ========================= ========================================
6310 wx.IDLE_PROCESS_ALL Send idle events to all windows
6311 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6312 the wx.WS_EX_PROCESS_IDLE extra style
6313 flag set.
6314 ========================= ========================================
6315
6316 """
6317 return _core_.IdleEvent_SetMode(*args, **kwargs)
6318
6319 def IdleEvent_GetMode(*args):
6320 """
6321 IdleEvent_GetMode() -> int
6322
6323 Static method returning a value specifying how wxWidgets will send
6324 idle events: to all windows, or only to those which specify that they
6325 will process the events.
6326 """
6327 return _core_.IdleEvent_GetMode(*args)
6328
6329 def IdleEvent_CanSend(*args, **kwargs):
6330 """
6331 IdleEvent_CanSend(Window win) -> bool
6332
6333 Returns ``True`` if it is appropriate to send idle events to this
6334 window.
6335
6336 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6337 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6338 events should be sent to this window now. By default this will always
6339 return ``True`` because the update mode is initially
6340 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6341 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6342 """
6343 return _core_.IdleEvent_CanSend(*args, **kwargs)
6344
6345 #---------------------------------------------------------------------------
6346
6347 class PyEvent(Event):
6348 """
6349 wx.PyEvent can be used as a base class for implementing custom event
6350 types in Python. You should derived from this class instead of
6351 `wx.Event` because this class is Python-aware and is able to transport
6352 its Python bits safely through the wxWidgets event system and have
6353 them still be there when the event handler is invoked.
6354
6355 :see: `wx.PyCommandEvent`
6356
6357 """
6358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6359 __repr__ = _swig_repr
6360 def __init__(self, *args, **kwargs):
6361 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6362 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6363 self._SetSelf(self)
6364
6365 __swig_destroy__ = _core_.delete_PyEvent
6366 __del__ = lambda self : None;
6367 def _SetSelf(*args, **kwargs):
6368 """_SetSelf(self, PyObject self)"""
6369 return _core_.PyEvent__SetSelf(*args, **kwargs)
6370
6371 def _GetSelf(*args, **kwargs):
6372 """_GetSelf(self) -> PyObject"""
6373 return _core_.PyEvent__GetSelf(*args, **kwargs)
6374
6375 PyEvent_swigregister = _core_.PyEvent_swigregister
6376 PyEvent_swigregister(PyEvent)
6377
6378 class PyCommandEvent(CommandEvent):
6379 """
6380 wx.PyCommandEvent can be used as a base class for implementing custom
6381 event types in Python, where the event shoudl travel up to parent
6382 windows looking for a handler. You should derived from this class
6383 instead of `wx.CommandEvent` because this class is Python-aware and is
6384 able to transport its Python bits safely through the wxWidgets event
6385 system and have them still be there when the event handler is invoked.
6386
6387 :see: `wx.PyEvent`
6388
6389 """
6390 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6391 __repr__ = _swig_repr
6392 def __init__(self, *args, **kwargs):
6393 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6394 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6395 self._SetSelf(self)
6396
6397 __swig_destroy__ = _core_.delete_PyCommandEvent
6398 __del__ = lambda self : None;
6399 def _SetSelf(*args, **kwargs):
6400 """_SetSelf(self, PyObject self)"""
6401 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6402
6403 def _GetSelf(*args, **kwargs):
6404 """_GetSelf(self) -> PyObject"""
6405 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6406
6407 PyCommandEvent_swigregister = _core_.PyCommandEvent_swigregister
6408 PyCommandEvent_swigregister(PyCommandEvent)
6409
6410 class DateEvent(CommandEvent):
6411 """
6412 This event class holds information about a date change event and is
6413 used together with `wx.DatePickerCtrl`. It also serves as a base class
6414 for `wx.calendar.CalendarEvent`. Bind these event types with
6415 EVT_DATE_CHANGED.
6416 """
6417 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6418 __repr__ = _swig_repr
6419 def __init__(self, *args, **kwargs):
6420 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6421 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6422 def GetDate(*args, **kwargs):
6423 """
6424 GetDate(self) -> DateTime
6425
6426 Returns the date.
6427 """
6428 return _core_.DateEvent_GetDate(*args, **kwargs)
6429
6430 def SetDate(*args, **kwargs):
6431 """
6432 SetDate(self, DateTime date)
6433
6434 Sets the date carried by the event, normally only used by the library
6435 internally.
6436 """
6437 return _core_.DateEvent_SetDate(*args, **kwargs)
6438
6439 DateEvent_swigregister = _core_.DateEvent_swigregister
6440 DateEvent_swigregister(DateEvent)
6441
6442 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6443 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6444
6445 #---------------------------------------------------------------------------
6446
6447 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6448 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6449 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6450 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6451 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6452 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6453 class PyApp(EvtHandler):
6454 """
6455 The ``wx.PyApp`` class is an *implementation detail*, please use the
6456 `wx.App` class (or some other derived class) instead.
6457 """
6458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6459 __repr__ = _swig_repr
6460 def __init__(self, *args, **kwargs):
6461 """
6462 __init__(self) -> PyApp
6463
6464 Create a new application object, starting the bootstrap process.
6465 """
6466 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6467 self._setCallbackInfo(self, PyApp, False)
6468 self._setOORInfo(self, False)
6469
6470 __swig_destroy__ = _core_.delete_PyApp
6471 __del__ = lambda self : None;
6472 def _setCallbackInfo(*args, **kwargs):
6473 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6474 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6475
6476 def GetAppName(*args, **kwargs):
6477 """
6478 GetAppName(self) -> String
6479
6480 Get the application name.
6481 """
6482 return _core_.PyApp_GetAppName(*args, **kwargs)
6483
6484 def SetAppName(*args, **kwargs):
6485 """
6486 SetAppName(self, String name)
6487
6488 Set the application name. This value may be used automatically by
6489 `wx.Config` and such.
6490 """
6491 return _core_.PyApp_SetAppName(*args, **kwargs)
6492
6493 def GetClassName(*args, **kwargs):
6494 """
6495 GetClassName(self) -> String
6496
6497 Get the application's class name.
6498 """
6499 return _core_.PyApp_GetClassName(*args, **kwargs)
6500
6501 def SetClassName(*args, **kwargs):
6502 """
6503 SetClassName(self, String name)
6504
6505 Set the application's class name. This value may be used for
6506 X-resources if applicable for the platform
6507 """
6508 return _core_.PyApp_SetClassName(*args, **kwargs)
6509
6510 def GetVendorName(*args, **kwargs):
6511 """
6512 GetVendorName(self) -> String
6513
6514 Get the application's vendor name.
6515 """
6516 return _core_.PyApp_GetVendorName(*args, **kwargs)
6517
6518 def SetVendorName(*args, **kwargs):
6519 """
6520 SetVendorName(self, String name)
6521
6522 Set the application's vendor name. This value may be used
6523 automatically by `wx.Config` and such.
6524 """
6525 return _core_.PyApp_SetVendorName(*args, **kwargs)
6526
6527 def GetTraits(*args, **kwargs):
6528 """
6529 GetTraits(self) -> wxAppTraits
6530
6531 Return (and create if necessary) the app traits object to which we
6532 delegate for everything which either should be configurable by the
6533 user (then he can change the default behaviour simply by overriding
6534 CreateTraits() and returning his own traits object) or which is
6535 GUI/console dependent as then wx.AppTraits allows us to abstract the
6536 differences behind the common facade.
6537
6538 :todo: Add support for overriding CreateAppTraits in wxPython.
6539 """
6540 return _core_.PyApp_GetTraits(*args, **kwargs)
6541
6542 def ProcessPendingEvents(*args, **kwargs):
6543 """
6544 ProcessPendingEvents(self)
6545
6546 Process all events in the Pending Events list -- it is necessary to
6547 call this function to process posted events. This normally happens
6548 during each event loop iteration.
6549 """
6550 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6551
6552 def Yield(*args, **kwargs):
6553 """
6554 Yield(self, bool onlyIfNeeded=False) -> bool
6555
6556 Process all currently pending events right now, instead of waiting
6557 until return to the event loop. It is an error to call ``Yield``
6558 recursively unless the value of ``onlyIfNeeded`` is True.
6559
6560 :warning: This function is dangerous as it can lead to unexpected
6561 reentrancies (i.e. when called from an event handler it may
6562 result in calling the same event handler again), use with
6563 extreme care or, better, don't use at all!
6564
6565 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6566
6567 """
6568 return _core_.PyApp_Yield(*args, **kwargs)
6569
6570 def WakeUpIdle(*args, **kwargs):
6571 """
6572 WakeUpIdle(self)
6573
6574 Make sure that idle events are sent again.
6575 :see: `wx.WakeUpIdle`
6576 """
6577 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6578
6579 def IsMainLoopRunning(*args, **kwargs):
6580 """
6581 IsMainLoopRunning() -> bool
6582
6583 Returns True if we're running the main loop, i.e. if the events can
6584 currently be dispatched.
6585 """
6586 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6587
6588 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6589 def MainLoop(*args, **kwargs):
6590 """
6591 MainLoop(self) -> int
6592
6593 Execute the main GUI loop, the function doesn't normally return until
6594 all top level windows have been closed and destroyed.
6595 """
6596 return _core_.PyApp_MainLoop(*args, **kwargs)
6597
6598 def Exit(*args, **kwargs):
6599 """
6600 Exit(self)
6601
6602 Exit the main loop thus terminating the application.
6603 :see: `wx.Exit`
6604 """
6605 return _core_.PyApp_Exit(*args, **kwargs)
6606
6607 def ExitMainLoop(*args, **kwargs):
6608 """
6609 ExitMainLoop(self)
6610
6611 Exit the main GUI loop during the next iteration of the main
6612 loop, (i.e. it does not stop the program immediately!)
6613 """
6614 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6615
6616 def Pending(*args, **kwargs):
6617 """
6618 Pending(self) -> bool
6619
6620 Returns True if there are unprocessed events in the event queue.
6621 """
6622 return _core_.PyApp_Pending(*args, **kwargs)
6623
6624 def Dispatch(*args, **kwargs):
6625 """
6626 Dispatch(self) -> bool
6627
6628 Process the first event in the event queue (blocks until an event
6629 appears if there are none currently)
6630 """
6631 return _core_.PyApp_Dispatch(*args, **kwargs)
6632
6633 def ProcessIdle(*args, **kwargs):
6634 """
6635 ProcessIdle(self) -> bool
6636
6637 Called from the MainLoop when the application becomes idle (there are
6638 no pending events) and sends a `wx.IdleEvent` to all interested
6639 parties. Returns True if more idle events are needed, False if not.
6640 """
6641 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6642
6643 def SendIdleEvents(*args, **kwargs):
6644 """
6645 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6646
6647 Send idle event to window and all subwindows. Returns True if more
6648 idle time is requested.
6649 """
6650 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6651
6652 def IsActive(*args, **kwargs):
6653 """
6654 IsActive(self) -> bool
6655
6656 Return True if our app has focus.
6657 """
6658 return _core_.PyApp_IsActive(*args, **kwargs)
6659
6660 def SetTopWindow(*args, **kwargs):
6661 """
6662 SetTopWindow(self, Window win)
6663
6664 Set the *main* top level window
6665 """
6666 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6667
6668 def GetTopWindow(*args, **kwargs):
6669 """
6670 GetTopWindow(self) -> Window
6671
6672 Return the *main* top level window (if it hadn't been set previously
6673 with SetTopWindow(), will return just some top level window and, if
6674 there not any, will return None)
6675 """
6676 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6677
6678 def SetExitOnFrameDelete(*args, **kwargs):
6679 """
6680 SetExitOnFrameDelete(self, bool flag)
6681
6682 Control the exit behaviour: by default, the program will exit the main
6683 loop (and so, usually, terminate) when the last top-level program
6684 window is deleted. Beware that if you disable this behaviour (with
6685 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6686 explicitly from somewhere.
6687 """
6688 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6689
6690 def GetExitOnFrameDelete(*args, **kwargs):
6691 """
6692 GetExitOnFrameDelete(self) -> bool
6693
6694 Get the current exit behaviour setting.
6695 """
6696 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6697
6698 def SetUseBestVisual(*args, **kwargs):
6699 """
6700 SetUseBestVisual(self, bool flag)
6701
6702 Set whether the app should try to use the best available visual on
6703 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6704 """
6705 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6706
6707 def GetUseBestVisual(*args, **kwargs):
6708 """
6709 GetUseBestVisual(self) -> bool
6710
6711 Get current UseBestVisual setting.
6712 """
6713 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6714
6715 def SetPrintMode(*args, **kwargs):
6716 """SetPrintMode(self, int mode)"""
6717 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6718
6719 def GetPrintMode(*args, **kwargs):
6720 """GetPrintMode(self) -> int"""
6721 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6722
6723 def SetAssertMode(*args, **kwargs):
6724 """
6725 SetAssertMode(self, int mode)
6726
6727 Set the OnAssert behaviour for debug and hybrid builds.
6728 """
6729 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6730
6731 def GetAssertMode(*args, **kwargs):
6732 """
6733 GetAssertMode(self) -> int
6734
6735 Get the current OnAssert behaviour setting.
6736 """
6737 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6738
6739 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6740 """GetMacSupportPCMenuShortcuts() -> bool"""
6741 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6742
6743 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6744 def GetMacAboutMenuItemId(*args, **kwargs):
6745 """GetMacAboutMenuItemId() -> long"""
6746 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6747
6748 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6749 def GetMacPreferencesMenuItemId(*args, **kwargs):
6750 """GetMacPreferencesMenuItemId() -> long"""
6751 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6752
6753 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6754 def GetMacExitMenuItemId(*args, **kwargs):
6755 """GetMacExitMenuItemId() -> long"""
6756 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6757
6758 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6759 def GetMacHelpMenuTitleName(*args, **kwargs):
6760 """GetMacHelpMenuTitleName() -> String"""
6761 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6762
6763 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6764 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6765 """SetMacSupportPCMenuShortcuts(bool val)"""
6766 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6767
6768 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6769 def SetMacAboutMenuItemId(*args, **kwargs):
6770 """SetMacAboutMenuItemId(long val)"""
6771 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6772
6773 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6774 def SetMacPreferencesMenuItemId(*args, **kwargs):
6775 """SetMacPreferencesMenuItemId(long val)"""
6776 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6777
6778 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6779 def SetMacExitMenuItemId(*args, **kwargs):
6780 """SetMacExitMenuItemId(long val)"""
6781 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6782
6783 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6784 def SetMacHelpMenuTitleName(*args, **kwargs):
6785 """SetMacHelpMenuTitleName(String val)"""
6786 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6787
6788 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6789 def _BootstrapApp(*args, **kwargs):
6790 """
6791 _BootstrapApp(self)
6792
6793 For internal use only
6794 """
6795 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6796
6797 def GetComCtl32Version(*args, **kwargs):
6798 """
6799 GetComCtl32Version() -> int
6800
6801 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6802 it wasn't found at all. Raises an exception on non-Windows platforms.
6803 """
6804 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6805
6806 GetComCtl32Version = staticmethod(GetComCtl32Version)
6807 PyApp_swigregister = _core_.PyApp_swigregister
6808 PyApp_swigregister(PyApp)
6809
6810 def PyApp_IsMainLoopRunning(*args):
6811 """
6812 PyApp_IsMainLoopRunning() -> bool
6813
6814 Returns True if we're running the main loop, i.e. if the events can
6815 currently be dispatched.
6816 """
6817 return _core_.PyApp_IsMainLoopRunning(*args)
6818
6819 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6820 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6821 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6822
6823 def PyApp_GetMacAboutMenuItemId(*args):
6824 """PyApp_GetMacAboutMenuItemId() -> long"""
6825 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6826
6827 def PyApp_GetMacPreferencesMenuItemId(*args):
6828 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6829 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6830
6831 def PyApp_GetMacExitMenuItemId(*args):
6832 """PyApp_GetMacExitMenuItemId() -> long"""
6833 return _core_.PyApp_GetMacExitMenuItemId(*args)
6834
6835 def PyApp_GetMacHelpMenuTitleName(*args):
6836 """PyApp_GetMacHelpMenuTitleName() -> String"""
6837 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6838
6839 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6840 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6841 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6842
6843 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6844 """PyApp_SetMacAboutMenuItemId(long val)"""
6845 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6846
6847 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6848 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6849 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6850
6851 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6852 """PyApp_SetMacExitMenuItemId(long val)"""
6853 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6854
6855 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6856 """PyApp_SetMacHelpMenuTitleName(String val)"""
6857 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6858
6859 def PyApp_GetComCtl32Version(*args):
6860 """
6861 PyApp_GetComCtl32Version() -> int
6862
6863 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6864 it wasn't found at all. Raises an exception on non-Windows platforms.
6865 """
6866 return _core_.PyApp_GetComCtl32Version(*args)
6867
6868 #---------------------------------------------------------------------------
6869
6870
6871 def Exit(*args):
6872 """
6873 Exit()
6874
6875 Force an exit of the application. Convenience for wx.GetApp().Exit()
6876 """
6877 return _core_.Exit(*args)
6878
6879 def Yield(*args):
6880 """
6881 Yield() -> bool
6882
6883 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6884 """
6885 return _core_.Yield(*args)
6886
6887 def YieldIfNeeded(*args):
6888 """
6889 YieldIfNeeded() -> bool
6890
6891 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6892 """
6893 return _core_.YieldIfNeeded(*args)
6894
6895 def SafeYield(*args, **kwargs):
6896 """
6897 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6898
6899 This function is similar to `wx.Yield`, except that it disables the
6900 user input to all program windows before calling `wx.Yield` and
6901 re-enables it again afterwards. If ``win`` is not None, this window
6902 will remain enabled, allowing the implementation of some limited user
6903 interaction.
6904
6905 :Returns: the result of the call to `wx.Yield`.
6906 """
6907 return _core_.SafeYield(*args, **kwargs)
6908
6909 def WakeUpIdle(*args):
6910 """
6911 WakeUpIdle()
6912
6913 Cause the message queue to become empty again, so idle events will be
6914 sent.
6915 """
6916 return _core_.WakeUpIdle(*args)
6917
6918 def PostEvent(*args, **kwargs):
6919 """
6920 PostEvent(EvtHandler dest, Event event)
6921
6922 Send an event to a window or other wx.EvtHandler to be processed
6923 later.
6924 """
6925 return _core_.PostEvent(*args, **kwargs)
6926
6927 def App_CleanUp(*args):
6928 """
6929 App_CleanUp()
6930
6931 For internal use only, it is used to cleanup after wxWidgets when
6932 Python shuts down.
6933 """
6934 return _core_.App_CleanUp(*args)
6935
6936 def GetApp(*args):
6937 """
6938 GetApp() -> PyApp
6939
6940 Return a reference to the current wx.App object.
6941 """
6942 return _core_.GetApp(*args)
6943
6944 def SetDefaultPyEncoding(*args, **kwargs):
6945 """
6946 SetDefaultPyEncoding(string encoding)
6947
6948 Sets the encoding that wxPython will use when it needs to convert a
6949 Python string or unicode object to or from a wxString.
6950
6951 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6952 but please be aware that the default encoding within the same locale
6953 may be slightly different on different platforms. For example, please
6954 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6955 between the common latin/roman encodings.
6956 """
6957 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6958
6959 def GetDefaultPyEncoding(*args):
6960 """
6961 GetDefaultPyEncoding() -> string
6962
6963 Gets the current encoding that wxPython will use when it needs to
6964 convert a Python string or unicode object to or from a wxString.
6965 """
6966 return _core_.GetDefaultPyEncoding(*args)
6967 #----------------------------------------------------------------------
6968
6969 class PyOnDemandOutputWindow:
6970 """
6971 A class that can be used for redirecting Python's stdout and
6972 stderr streams. It will do nothing until something is wrriten to
6973 the stream at which point it will create a Frame with a text area
6974 and write the text there.
6975 """
6976 def __init__(self, title = "wxPython: stdout/stderr"):
6977 self.frame = None
6978 self.title = title
6979 self.pos = wx.DefaultPosition
6980 self.size = (450, 300)
6981 self.parent = None
6982
6983 def SetParent(self, parent):
6984 """Set the window to be used as the popup Frame's parent."""
6985 self.parent = parent
6986
6987
6988 def CreateOutputWindow(self, st):
6989 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6990 style=wx.DEFAULT_FRAME_STYLE)
6991 self.text = wx.TextCtrl(self.frame, -1, "",
6992 style=wx.TE_MULTILINE|wx.TE_READONLY)
6993 self.text.AppendText(st)
6994 self.frame.Show(True)
6995 EVT_CLOSE(self.frame, self.OnCloseWindow)
6996
6997
6998 def OnCloseWindow(self, event):
6999 if self.frame is not None:
7000 self.frame.Destroy()
7001 self.frame = None
7002 self.text = None
7003
7004
7005 # These methods provide the file-like output behaviour.
7006 def write(self, text):
7007 """
7008 Create the output window if needed and write the string to it.
7009 If not called in the context of the gui thread then uses
7010 CallAfter to do the work there.
7011 """
7012 if self.frame is None:
7013 if not wx.Thread_IsMain():
7014 wx.CallAfter(self.CreateOutputWindow, text)
7015 else:
7016 self.CreateOutputWindow(text)
7017 else:
7018 if not wx.Thread_IsMain():
7019 wx.CallAfter(self.text.AppendText, text)
7020 else:
7021 self.text.AppendText(text)
7022
7023
7024 def close(self):
7025 if self.frame is not None:
7026 wx.CallAfter(self.frame.Close)
7027
7028
7029 def flush(self):
7030 pass
7031
7032
7033
7034 #----------------------------------------------------------------------
7035
7036 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7037
7038 class App(wx.PyApp):
7039 """
7040 The ``wx.App`` class represents the application and is used to:
7041
7042 * bootstrap the wxPython system and initialize the underlying
7043 gui toolkit
7044 * set and get application-wide properties
7045 * implement the windowing system main message or event loop,
7046 and to dispatch events to window instances
7047 * etc.
7048
7049 Every application must have a ``wx.App`` instance, and all
7050 creation of UI objects should be delayed until after the
7051 ``wx.App`` object has been created in order to ensure that the gui
7052 platform and wxWidgets have been fully initialized.
7053
7054 Normally you would derive from this class and implement an
7055 ``OnInit`` method that creates a frame and then calls
7056 ``self.SetTopWindow(frame)``.
7057
7058 :see: `wx.PySimpleApp` for a simpler app class that can be used
7059 directly.
7060 """
7061
7062 outputWindowClass = PyOnDemandOutputWindow
7063
7064 def __init__(self, redirect=_defRedirect, filename=None,
7065 useBestVisual=False, clearSigInt=True):
7066 """
7067 Construct a ``wx.App`` object.
7068
7069 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7070 redirected? Defaults to True on Windows and Mac, False
7071 otherwise. If `filename` is None then output will be
7072 redirected to a window that pops up as needed. (You can
7073 control what kind of window is created for the output by
7074 resetting the class variable ``outputWindowClass`` to a
7075 class of your choosing.)
7076
7077 :param filename: The name of a file to redirect output to, if
7078 redirect is True.
7079
7080 :param useBestVisual: Should the app try to use the best
7081 available visual provided by the system (only relevant on
7082 systems that have more than one visual.) This parameter
7083 must be used instead of calling `SetUseBestVisual` later
7084 on because it must be set before the underlying GUI
7085 toolkit is initialized.
7086
7087 :param clearSigInt: Should SIGINT be cleared? This allows the
7088 app to terminate upon a Ctrl-C in the console like other
7089 GUI apps will.
7090
7091 :note: You should override OnInit to do applicaition
7092 initialization to ensure that the system, toolkit and
7093 wxWidgets are fully initialized.
7094 """
7095 wx.PyApp.__init__(self)
7096
7097 if wx.Platform == "__WXMAC__":
7098 try:
7099 import MacOS
7100 if not MacOS.WMAvailable():
7101 print """\
7102 This program needs access to the screen. Please run with 'pythonw',
7103 not 'python', and only when you are logged in on the main display of
7104 your Mac."""
7105 _sys.exit(1)
7106 except SystemExit:
7107 raise
7108 except:
7109 pass
7110
7111 # This has to be done before OnInit
7112 self.SetUseBestVisual(useBestVisual)
7113
7114 # Set the default handler for SIGINT. This fixes a problem
7115 # where if Ctrl-C is pressed in the console that started this
7116 # app then it will not appear to do anything, (not even send
7117 # KeyboardInterrupt???) but will later segfault on exit. By
7118 # setting the default handler then the app will exit, as
7119 # expected (depending on platform.)
7120 if clearSigInt:
7121 try:
7122 import signal
7123 signal.signal(signal.SIGINT, signal.SIG_DFL)
7124 except:
7125 pass
7126
7127 # Save and redirect the stdio to a window?
7128 self.stdioWin = None
7129 self.saveStdio = (_sys.stdout, _sys.stderr)
7130 if redirect:
7131 self.RedirectStdio(filename)
7132
7133 # Use Python's install prefix as the default
7134 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7135
7136 # This finishes the initialization of wxWindows and then calls
7137 # the OnInit that should be present in the derived class
7138 self._BootstrapApp()
7139
7140
7141 def OnPreInit(self):
7142 """
7143 Things that must be done after _BootstrapApp has done its
7144 thing, but would be nice if they were already done by the time
7145 that OnInit is called.
7146 """
7147 wx.StockGDI._initStockObjects()
7148
7149
7150 def __del__(self, destroy=wx.PyApp.__del__):
7151 self.RestoreStdio() # Just in case the MainLoop was overridden
7152 destroy(self)
7153
7154 def Destroy(self):
7155 wx.PyApp.Destroy(self)
7156 self.thisown = 0
7157
7158 def SetTopWindow(self, frame):
7159 """Set the \"main\" top level window"""
7160 if self.stdioWin:
7161 self.stdioWin.SetParent(frame)
7162 wx.PyApp.SetTopWindow(self, frame)
7163
7164
7165 def MainLoop(self):
7166 """Execute the main GUI event loop"""
7167 wx.PyApp.MainLoop(self)
7168 self.RestoreStdio()
7169
7170
7171 def RedirectStdio(self, filename=None):
7172 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7173 if filename:
7174 _sys.stdout = _sys.stderr = open(filename, 'a')
7175 else:
7176 self.stdioWin = self.outputWindowClass()
7177 _sys.stdout = _sys.stderr = self.stdioWin
7178
7179
7180 def RestoreStdio(self):
7181 try:
7182 _sys.stdout, _sys.stderr = self.saveStdio
7183 except:
7184 pass
7185
7186
7187 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7188 """
7189 Set the title, position and/or size of the output window if
7190 the stdio has been redirected. This should be called before
7191 any output would cause the output window to be created.
7192 """
7193 if self.stdioWin:
7194 if title is not None:
7195 self.stdioWin.title = title
7196 if pos is not None:
7197 self.stdioWin.pos = pos
7198 if size is not None:
7199 self.stdioWin.size = size
7200
7201
7202
7203
7204 # change from wx.PyApp_XX to wx.App_XX
7205 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7206 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7207 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7208 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7209 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7210 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7211 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7212 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7213 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7214 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7215 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7216
7217 #----------------------------------------------------------------------------
7218
7219 class PySimpleApp(wx.App):
7220 """
7221 A simple application class. You can just create one of these and
7222 then then make your top level windows later, and not have to worry
7223 about OnInit. For example::
7224
7225 app = wx.PySimpleApp()
7226 frame = wx.Frame(None, title='Hello World')
7227 frame.Show()
7228 app.MainLoop()
7229
7230 :see: `wx.App`
7231 """
7232
7233 def __init__(self, redirect=False, filename=None,
7234 useBestVisual=False, clearSigInt=True):
7235 """
7236 :see: `wx.App.__init__`
7237 """
7238 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7239
7240 def OnInit(self):
7241 return True
7242
7243
7244
7245 # Is anybody using this one?
7246 class PyWidgetTester(wx.App):
7247 def __init__(self, size = (250, 100)):
7248 self.size = size
7249 wx.App.__init__(self, 0)
7250
7251 def OnInit(self):
7252 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7253 self.SetTopWindow(self.frame)
7254 return True
7255
7256 def SetWidget(self, widgetClass, *args, **kwargs):
7257 w = widgetClass(self.frame, *args, **kwargs)
7258 self.frame.Show(True)
7259
7260 #----------------------------------------------------------------------------
7261 # DO NOT hold any other references to this object. This is how we
7262 # know when to cleanup system resources that wxWidgets is holding. When
7263 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7264 # goes to zero and it calls the wx.App_CleanUp function.
7265
7266 class __wxPyCleanup:
7267 def __init__(self):
7268 self.cleanup = _core_.App_CleanUp
7269 def __del__(self):
7270 self.cleanup()
7271
7272 _sys.__wxPythonCleanup = __wxPyCleanup()
7273
7274 ## # another possible solution, but it gets called too early...
7275 ## import atexit
7276 ## atexit.register(_core_.wxApp_CleanUp)
7277
7278
7279 #----------------------------------------------------------------------------
7280
7281 #---------------------------------------------------------------------------
7282
7283 class EventLoop(object):
7284 """Proxy of C++ EventLoop class"""
7285 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7286 __repr__ = _swig_repr
7287 def __init__(self, *args, **kwargs):
7288 """__init__(self) -> EventLoop"""
7289 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7290 __swig_destroy__ = _core_.delete_EventLoop
7291 __del__ = lambda self : None;
7292 def Run(*args, **kwargs):
7293 """Run(self) -> int"""
7294 return _core_.EventLoop_Run(*args, **kwargs)
7295
7296 def Exit(*args, **kwargs):
7297 """Exit(self, int rc=0)"""
7298 return _core_.EventLoop_Exit(*args, **kwargs)
7299
7300 def Pending(*args, **kwargs):
7301 """Pending(self) -> bool"""
7302 return _core_.EventLoop_Pending(*args, **kwargs)
7303
7304 def Dispatch(*args, **kwargs):
7305 """Dispatch(self) -> bool"""
7306 return _core_.EventLoop_Dispatch(*args, **kwargs)
7307
7308 def IsRunning(*args, **kwargs):
7309 """IsRunning(self) -> bool"""
7310 return _core_.EventLoop_IsRunning(*args, **kwargs)
7311
7312 def GetActive(*args, **kwargs):
7313 """GetActive() -> EventLoop"""
7314 return _core_.EventLoop_GetActive(*args, **kwargs)
7315
7316 GetActive = staticmethod(GetActive)
7317 def SetActive(*args, **kwargs):
7318 """SetActive(EventLoop loop)"""
7319 return _core_.EventLoop_SetActive(*args, **kwargs)
7320
7321 SetActive = staticmethod(SetActive)
7322 EventLoop_swigregister = _core_.EventLoop_swigregister
7323 EventLoop_swigregister(EventLoop)
7324
7325 def EventLoop_GetActive(*args):
7326 """EventLoop_GetActive() -> EventLoop"""
7327 return _core_.EventLoop_GetActive(*args)
7328
7329 def EventLoop_SetActive(*args, **kwargs):
7330 """EventLoop_SetActive(EventLoop loop)"""
7331 return _core_.EventLoop_SetActive(*args, **kwargs)
7332
7333 class EventLoopActivator(object):
7334 """Proxy of C++ EventLoopActivator class"""
7335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7336 __repr__ = _swig_repr
7337 def __init__(self, *args, **kwargs):
7338 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7339 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7340 __swig_destroy__ = _core_.delete_EventLoopActivator
7341 __del__ = lambda self : None;
7342 EventLoopActivator_swigregister = _core_.EventLoopActivator_swigregister
7343 EventLoopActivator_swigregister(EventLoopActivator)
7344
7345 #---------------------------------------------------------------------------
7346
7347 class AcceleratorEntry(object):
7348 """
7349 A class used to define items in an `wx.AcceleratorTable`. wxPython
7350 programs can choose to use wx.AcceleratorEntry objects, but using a
7351 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7352 as well. See `__init__` for of the tuple values.
7353
7354 :see: `wx.AcceleratorTable`
7355 """
7356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7357 __repr__ = _swig_repr
7358 def __init__(self, *args, **kwargs):
7359 """
7360 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7361
7362 Construct a wx.AcceleratorEntry.
7363 """
7364 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7365 __swig_destroy__ = _core_.delete_AcceleratorEntry
7366 __del__ = lambda self : None;
7367 def Set(*args, **kwargs):
7368 """
7369 Set(self, int flags, int keyCode, int cmd)
7370
7371 (Re)set the attributes of a wx.AcceleratorEntry.
7372 :see `__init__`
7373 """
7374 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7375
7376 def GetFlags(*args, **kwargs):
7377 """
7378 GetFlags(self) -> int
7379
7380 Get the AcceleratorEntry's flags.
7381 """
7382 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7383
7384 def GetKeyCode(*args, **kwargs):
7385 """
7386 GetKeyCode(self) -> int
7387
7388 Get the AcceleratorEntry's keycode.
7389 """
7390 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7391
7392 def GetCommand(*args, **kwargs):
7393 """
7394 GetCommand(self) -> int
7395
7396 Get the AcceleratorEntry's command ID.
7397 """
7398 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7399
7400 AcceleratorEntry_swigregister = _core_.AcceleratorEntry_swigregister
7401 AcceleratorEntry_swigregister(AcceleratorEntry)
7402
7403 class AcceleratorTable(Object):
7404 """
7405 An accelerator table allows the application to specify a table of
7406 keyboard shortcuts for menus or other commands. On Windows, menu or
7407 button commands are supported; on GTK, only menu commands are
7408 supported.
7409 """
7410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7411 __repr__ = _swig_repr
7412 def __init__(self, *args, **kwargs):
7413 """
7414 __init__(entries) -> AcceleratorTable
7415
7416 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7417 items or or of 3-tuples (flags, keyCode, cmdID)
7418
7419 :see: `wx.AcceleratorEntry`
7420 """
7421 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7422 __swig_destroy__ = _core_.delete_AcceleratorTable
7423 __del__ = lambda self : None;
7424 def Ok(*args, **kwargs):
7425 """Ok(self) -> bool"""
7426 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7427
7428 AcceleratorTable_swigregister = _core_.AcceleratorTable_swigregister
7429 AcceleratorTable_swigregister(AcceleratorTable)
7430
7431
7432 def GetAccelFromString(*args, **kwargs):
7433 """GetAccelFromString(String label) -> AcceleratorEntry"""
7434 return _core_.GetAccelFromString(*args, **kwargs)
7435 #---------------------------------------------------------------------------
7436
7437 class VisualAttributes(object):
7438 """struct containing all the visual attributes of a control"""
7439 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7440 __repr__ = _swig_repr
7441 def __init__(self, *args, **kwargs):
7442 """
7443 __init__(self) -> VisualAttributes
7444
7445 struct containing all the visual attributes of a control
7446 """
7447 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7448 __swig_destroy__ = _core_.delete_VisualAttributes
7449 __del__ = lambda self : None;
7450 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7451 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7452 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7453 VisualAttributes_swigregister = _core_.VisualAttributes_swigregister
7454 VisualAttributes_swigregister(VisualAttributes)
7455 NullAcceleratorTable = cvar.NullAcceleratorTable
7456 PanelNameStr = cvar.PanelNameStr
7457
7458 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7459 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7460 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7461 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7462 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7463 class Window(EvtHandler):
7464 """
7465 wx.Window is the base class for all windows and represents any visible
7466 object on the screen. All controls, top level windows and so on are
7467 wx.Windows. Sizers and device contexts are not however, as they don't
7468 appear on screen themselves.
7469
7470 """
7471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7472 __repr__ = _swig_repr
7473 def __init__(self, *args, **kwargs):
7474 """
7475 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7476 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7477
7478 Construct and show a generic Window.
7479 """
7480 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7481 self._setOORInfo(self)
7482
7483 def Create(*args, **kwargs):
7484 """
7485 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7486 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7487
7488 Create the GUI part of the Window for 2-phase creation mode.
7489 """
7490 return _core_.Window_Create(*args, **kwargs)
7491
7492 def Close(*args, **kwargs):
7493 """
7494 Close(self, bool force=False) -> bool
7495
7496 This function simply generates a EVT_CLOSE event whose handler usually
7497 tries to close the window. It doesn't close the window itself,
7498 however. If force is False (the default) then the window's close
7499 handler will be allowed to veto the destruction of the window.
7500 """
7501 return _core_.Window_Close(*args, **kwargs)
7502
7503 def Destroy(*args, **kwargs):
7504 """
7505 Destroy(self) -> bool
7506
7507 Destroys the window safely. Frames and dialogs are not destroyed
7508 immediately when this function is called -- they are added to a list
7509 of windows to be deleted on idle time, when all the window's events
7510 have been processed. This prevents problems with events being sent to
7511 non-existent windows.
7512
7513 Returns True if the window has either been successfully deleted, or it
7514 has been added to the list of windows pending real deletion.
7515 """
7516 val = _core_.Window_Destroy(*args, **kwargs)
7517 args[0].thisown = 0
7518 return val
7519
7520 def DestroyChildren(*args, **kwargs):
7521 """
7522 DestroyChildren(self) -> bool
7523
7524 Destroys all children of a window. Called automatically by the
7525 destructor.
7526 """
7527 return _core_.Window_DestroyChildren(*args, **kwargs)
7528
7529 def IsBeingDeleted(*args, **kwargs):
7530 """
7531 IsBeingDeleted(self) -> bool
7532
7533 Is the window in the process of being deleted?
7534 """
7535 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7536
7537 def SetLabel(*args, **kwargs):
7538 """
7539 SetLabel(self, String label)
7540
7541 Set the text which the window shows in its label if applicable.
7542 """
7543 return _core_.Window_SetLabel(*args, **kwargs)
7544
7545 def GetLabel(*args, **kwargs):
7546 """
7547 GetLabel(self) -> String
7548
7549 Generic way of getting a label from any window, for identification
7550 purposes. The interpretation of this function differs from class to
7551 class. For frames and dialogs, the value returned is the title. For
7552 buttons or static text controls, it is the button text. This function
7553 can be useful for meta-programs such as testing tools or special-needs
7554 access programs)which need to identify windows by name.
7555 """
7556 return _core_.Window_GetLabel(*args, **kwargs)
7557
7558 def SetName(*args, **kwargs):
7559 """
7560 SetName(self, String name)
7561
7562 Sets the window's name. The window name is used for ressource setting
7563 in X, it is not the same as the window title/label
7564 """
7565 return _core_.Window_SetName(*args, **kwargs)
7566
7567 def GetName(*args, **kwargs):
7568 """
7569 GetName(self) -> String
7570
7571 Returns the windows name. This name is not guaranteed to be unique;
7572 it is up to the programmer to supply an appropriate name in the window
7573 constructor or via wx.Window.SetName.
7574 """
7575 return _core_.Window_GetName(*args, **kwargs)
7576
7577 def SetWindowVariant(*args, **kwargs):
7578 """
7579 SetWindowVariant(self, int variant)
7580
7581 Sets the variant of the window/font size to use for this window, if
7582 the platform supports variants, for example, wxMac.
7583 """
7584 return _core_.Window_SetWindowVariant(*args, **kwargs)
7585
7586 def GetWindowVariant(*args, **kwargs):
7587 """GetWindowVariant(self) -> int"""
7588 return _core_.Window_GetWindowVariant(*args, **kwargs)
7589
7590 def SetId(*args, **kwargs):
7591 """
7592 SetId(self, int winid)
7593
7594 Sets the identifier of the window. Each window has an integer
7595 identifier. If the application has not provided one, an identifier
7596 will be generated. Normally, the identifier should be provided on
7597 creation and should not be modified subsequently.
7598 """
7599 return _core_.Window_SetId(*args, **kwargs)
7600
7601 def GetId(*args, **kwargs):
7602 """
7603 GetId(self) -> int
7604
7605 Returns the identifier of the window. Each window has an integer
7606 identifier. If the application has not provided one (or the default Id
7607 -1 is used) then an unique identifier with a negative value will be
7608 generated.
7609 """
7610 return _core_.Window_GetId(*args, **kwargs)
7611
7612 def NewControlId(*args, **kwargs):
7613 """
7614 NewControlId() -> int
7615
7616 Generate a control id for the controls which were not given one.
7617 """
7618 return _core_.Window_NewControlId(*args, **kwargs)
7619
7620 NewControlId = staticmethod(NewControlId)
7621 def NextControlId(*args, **kwargs):
7622 """
7623 NextControlId(int winid) -> int
7624
7625 Get the id of the control following the one with the given
7626 autogenerated) id
7627 """
7628 return _core_.Window_NextControlId(*args, **kwargs)
7629
7630 NextControlId = staticmethod(NextControlId)
7631 def PrevControlId(*args, **kwargs):
7632 """
7633 PrevControlId(int winid) -> int
7634
7635 Get the id of the control preceding the one with the given
7636 autogenerated) id
7637 """
7638 return _core_.Window_PrevControlId(*args, **kwargs)
7639
7640 PrevControlId = staticmethod(PrevControlId)
7641 def SetSize(*args, **kwargs):
7642 """
7643 SetSize(self, Size size)
7644
7645 Sets the size of the window in pixels.
7646 """
7647 return _core_.Window_SetSize(*args, **kwargs)
7648
7649 def SetDimensions(*args, **kwargs):
7650 """
7651 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7652
7653 Sets the position and size of the window in pixels. The sizeFlags
7654 parameter indicates the interpretation of the other params if they are
7655 equal to -1.
7656
7657 ======================== ======================================
7658 wx.SIZE_AUTO A -1 indicates that a class-specific
7659 default should be used.
7660 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7661 -1 values are supplied.
7662 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7663 interpreted as real dimensions, not
7664 default values.
7665 ======================== ======================================
7666
7667 """
7668 return _core_.Window_SetDimensions(*args, **kwargs)
7669
7670 def SetRect(*args, **kwargs):
7671 """
7672 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7673
7674 Sets the position and size of the window in pixels using a wx.Rect.
7675 """
7676 return _core_.Window_SetRect(*args, **kwargs)
7677
7678 def SetSizeWH(*args, **kwargs):
7679 """
7680 SetSizeWH(self, int width, int height)
7681
7682 Sets the size of the window in pixels.
7683 """
7684 return _core_.Window_SetSizeWH(*args, **kwargs)
7685
7686 def Move(*args, **kwargs):
7687 """
7688 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7689
7690 Moves the window to the given position.
7691 """
7692 return _core_.Window_Move(*args, **kwargs)
7693
7694 SetPosition = Move
7695 def MoveXY(*args, **kwargs):
7696 """
7697 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7698
7699 Moves the window to the given position.
7700 """
7701 return _core_.Window_MoveXY(*args, **kwargs)
7702
7703 def SetBestFittingSize(*args, **kwargs):
7704 """
7705 SetBestFittingSize(self, Size size=DefaultSize)
7706
7707 A 'Smart' SetSize that will fill in default size components with the
7708 window's *best size* values. Also set's the minsize for use with sizers.
7709 """
7710 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7711
7712 def Raise(*args, **kwargs):
7713 """
7714 Raise(self)
7715
7716 Raises the window to the top of the window hierarchy. In current
7717 version of wxWidgets this works both for manage and child windows.
7718 """
7719 return _core_.Window_Raise(*args, **kwargs)
7720
7721 def Lower(*args, **kwargs):
7722 """
7723 Lower(self)
7724
7725 Lowers the window to the bottom of the window hierarchy. In current
7726 version of wxWidgets this works both for manage and child windows.
7727 """
7728 return _core_.Window_Lower(*args, **kwargs)
7729
7730 def SetClientSize(*args, **kwargs):
7731 """
7732 SetClientSize(self, Size size)
7733
7734 This sets the size of the window client area in pixels. Using this
7735 function to size a window tends to be more device-independent than
7736 wx.Window.SetSize, since the application need not worry about what
7737 dimensions the border or title bar have when trying to fit the window
7738 around panel items, for example.
7739 """
7740 return _core_.Window_SetClientSize(*args, **kwargs)
7741
7742 def SetClientSizeWH(*args, **kwargs):
7743 """
7744 SetClientSizeWH(self, int width, int height)
7745
7746 This sets the size of the window client area in pixels. Using this
7747 function to size a window tends to be more device-independent than
7748 wx.Window.SetSize, since the application need not worry about what
7749 dimensions the border or title bar have when trying to fit the window
7750 around panel items, for example.
7751 """
7752 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7753
7754 def SetClientRect(*args, **kwargs):
7755 """
7756 SetClientRect(self, Rect rect)
7757
7758 This sets the size of the window client area in pixels. Using this
7759 function to size a window tends to be more device-independent than
7760 wx.Window.SetSize, since the application need not worry about what
7761 dimensions the border or title bar have when trying to fit the window
7762 around panel items, for example.
7763 """
7764 return _core_.Window_SetClientRect(*args, **kwargs)
7765
7766 def GetPosition(*args, **kwargs):
7767 """
7768 GetPosition(self) -> Point
7769
7770 Get the window's position. Notice that the position is in client
7771 coordinates for child windows and screen coordinates for the top level
7772 ones, use `GetScreenPosition` if you need screen coordinates for all
7773 kinds of windows.
7774 """
7775 return _core_.Window_GetPosition(*args, **kwargs)
7776
7777 def GetPositionTuple(*args, **kwargs):
7778 """
7779 GetPositionTuple() -> (x,y)
7780
7781 Get the window's position. Notice that the position is in client
7782 coordinates for child windows and screen coordinates for the top level
7783 ones, use `GetScreenPosition` if you need screen coordinates for all
7784 kinds of windows.
7785 """
7786 return _core_.Window_GetPositionTuple(*args, **kwargs)
7787
7788 def GetScreenPosition(*args, **kwargs):
7789 """
7790 GetScreenPosition(self) -> Point
7791
7792 Get the position of the window in screen coordinantes.
7793 """
7794 return _core_.Window_GetScreenPosition(*args, **kwargs)
7795
7796 def GetScreenPositionTuple(*args, **kwargs):
7797 """
7798 GetScreenPositionTuple() -> (x,y)
7799
7800 Get the position of the window in screen coordinantes.
7801 """
7802 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7803
7804 def GetScreenRect(*args, **kwargs):
7805 """
7806 GetScreenRect(self) -> Rect
7807
7808 Returns the size and position of the window in screen coordinantes as
7809 a `wx.Rect` object.
7810 """
7811 return _core_.Window_GetScreenRect(*args, **kwargs)
7812
7813 def GetSize(*args, **kwargs):
7814 """
7815 GetSize(self) -> Size
7816
7817 Get the window size.
7818 """
7819 return _core_.Window_GetSize(*args, **kwargs)
7820
7821 def GetSizeTuple(*args, **kwargs):
7822 """
7823 GetSizeTuple() -> (width, height)
7824
7825 Get the window size.
7826 """
7827 return _core_.Window_GetSizeTuple(*args, **kwargs)
7828
7829 def GetRect(*args, **kwargs):
7830 """
7831 GetRect(self) -> Rect
7832
7833 Returns the size and position of the window as a `wx.Rect` object.
7834 """
7835 return _core_.Window_GetRect(*args, **kwargs)
7836
7837 def GetClientSize(*args, **kwargs):
7838 """
7839 GetClientSize(self) -> Size
7840
7841 This gets the size of the window's 'client area' in pixels. The client
7842 area is the area which may be drawn on by the programmer, excluding
7843 title bar, border, scrollbars, etc.
7844 """
7845 return _core_.Window_GetClientSize(*args, **kwargs)
7846
7847 def GetClientSizeTuple(*args, **kwargs):
7848 """
7849 GetClientSizeTuple() -> (width, height)
7850
7851 This gets the size of the window's 'client area' in pixels. The client
7852 area is the area which may be drawn on by the programmer, excluding
7853 title bar, border, scrollbars, etc.
7854 """
7855 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7856
7857 def GetClientAreaOrigin(*args, **kwargs):
7858 """
7859 GetClientAreaOrigin(self) -> Point
7860
7861 Get the origin of the client area of the window relative to the
7862 window's top left corner (the client area may be shifted because of
7863 the borders, scrollbars, other decorations...)
7864 """
7865 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7866
7867 def GetClientRect(*args, **kwargs):
7868 """
7869 GetClientRect(self) -> Rect
7870
7871 Get the client area position and size as a `wx.Rect` object.
7872 """
7873 return _core_.Window_GetClientRect(*args, **kwargs)
7874
7875 def GetBestSize(*args, **kwargs):
7876 """
7877 GetBestSize(self) -> Size
7878
7879 This function returns the best acceptable minimal size for the
7880 window, if applicable. For example, for a static text control, it will
7881 be the minimal size such that the control label is not truncated. For
7882 windows containing subwindows (suzh aswx.Panel), the size returned by
7883 this function will be the same as the size the window would have had
7884 after calling Fit.
7885 """
7886 return _core_.Window_GetBestSize(*args, **kwargs)
7887
7888 def GetBestSizeTuple(*args, **kwargs):
7889 """
7890 GetBestSizeTuple() -> (width, height)
7891
7892 This function returns the best acceptable minimal size for the
7893 window, if applicable. For example, for a static text control, it will
7894 be the minimal size such that the control label is not truncated. For
7895 windows containing subwindows (suzh aswx.Panel), the size returned by
7896 this function will be the same as the size the window would have had
7897 after calling Fit.
7898 """
7899 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7900
7901 def InvalidateBestSize(*args, **kwargs):
7902 """
7903 InvalidateBestSize(self)
7904
7905 Reset the cached best size value so it will be recalculated the next
7906 time it is needed.
7907 """
7908 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7909
7910 def CacheBestSize(*args, **kwargs):
7911 """
7912 CacheBestSize(self, Size size)
7913
7914 Cache the best size so it doesn't need to be calculated again, (at least until
7915 some properties of the window change.)
7916 """
7917 return _core_.Window_CacheBestSize(*args, **kwargs)
7918
7919 def GetBestFittingSize(*args, **kwargs):
7920 """
7921 GetBestFittingSize(self) -> Size
7922
7923 This function will merge the window's best size into the window's
7924 minimum size, giving priority to the min size components, and returns
7925 the results.
7926
7927 """
7928 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7929
7930 def GetAdjustedBestSize(*args, **kwargs):
7931 """
7932 GetAdjustedBestSize(self) -> Size
7933
7934 This method is similar to GetBestSize, except in one
7935 thing. GetBestSize should return the minimum untruncated size of the
7936 window, while this method will return the largest of BestSize and any
7937 user specified minimum size. ie. it is the minimum size the window
7938 should currently be drawn at, not the minimal size it can possibly
7939 tolerate.
7940 """
7941 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7942
7943 def Center(*args, **kwargs):
7944 """
7945 Center(self, int direction=BOTH)
7946
7947 Centers the window. The parameter specifies the direction for
7948 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7949 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7950 on the entire screen and not on its parent window. If it is a
7951 top-level window and has no parent then it will always be centered
7952 relative to the screen.
7953 """
7954 return _core_.Window_Center(*args, **kwargs)
7955
7956 Centre = Center
7957 def CenterOnParent(*args, **kwargs):
7958 """
7959 CenterOnParent(self, int dir=BOTH)
7960
7961 Center with respect to the the parent window
7962 """
7963 return _core_.Window_CenterOnParent(*args, **kwargs)
7964
7965 CentreOnParent = CenterOnParent
7966 def Fit(*args, **kwargs):
7967 """
7968 Fit(self)
7969
7970 Sizes the window so that it fits around its subwindows. This function
7971 won't do anything if there are no subwindows and will only really work
7972 correctly if sizers are used for the subwindows layout. Also, if the
7973 window has exactly one subwindow it is better (faster and the result
7974 is more precise as Fit adds some margin to account for fuzziness of
7975 its calculations) to call window.SetClientSize(child.GetSize())
7976 instead of calling Fit.
7977 """
7978 return _core_.Window_Fit(*args, **kwargs)
7979
7980 def FitInside(*args, **kwargs):
7981 """
7982 FitInside(self)
7983
7984 Similar to Fit, but sizes the interior (virtual) size of a
7985 window. Mainly useful with scrolled windows to reset scrollbars after
7986 sizing changes that do not trigger a size event, and/or scrolled
7987 windows without an interior sizer. This function similarly won't do
7988 anything if there are no subwindows.
7989 """
7990 return _core_.Window_FitInside(*args, **kwargs)
7991
7992 def SetSizeHints(*args, **kwargs):
7993 """
7994 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7995 int incH=-1)
7996
7997 Allows specification of minimum and maximum window sizes, and window
7998 size increments. If a pair of values is not set (or set to -1), the
7999 default values will be used. If this function is called, the user
8000 will not be able to size the window outside the given bounds (if it is
8001 a top-level window.) Sizers will also inspect the minimum window size
8002 and will use that value if set when calculating layout.
8003
8004 The resizing increments are only significant under Motif or Xt.
8005 """
8006 return _core_.Window_SetSizeHints(*args, **kwargs)
8007
8008 def SetSizeHintsSz(*args, **kwargs):
8009 """
8010 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8011
8012 Allows specification of minimum and maximum window sizes, and window
8013 size increments. If a pair of values is not set (or set to -1), the
8014 default values will be used. If this function is called, the user
8015 will not be able to size the window outside the given bounds (if it is
8016 a top-level window.) Sizers will also inspect the minimum window size
8017 and will use that value if set when calculating layout.
8018
8019 The resizing increments are only significant under Motif or Xt.
8020 """
8021 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8022
8023 def SetVirtualSizeHints(*args, **kwargs):
8024 """
8025 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8026
8027 Allows specification of minimum and maximum virtual window sizes. If a
8028 pair of values is not set (or set to -1), the default values will be
8029 used. If this function is called, the user will not be able to size
8030 the virtual area of the window outside the given bounds.
8031 """
8032 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8033
8034 def SetVirtualSizeHintsSz(*args, **kwargs):
8035 """
8036 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8037
8038 Allows specification of minimum and maximum virtual window sizes. If a
8039 pair of values is not set (or set to -1), the default values will be
8040 used. If this function is called, the user will not be able to size
8041 the virtual area of the window outside the given bounds.
8042 """
8043 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8044
8045 def GetMaxSize(*args, **kwargs):
8046 """GetMaxSize(self) -> Size"""
8047 return _core_.Window_GetMaxSize(*args, **kwargs)
8048
8049 def GetMinSize(*args, **kwargs):
8050 """GetMinSize(self) -> Size"""
8051 return _core_.Window_GetMinSize(*args, **kwargs)
8052
8053 def SetMinSize(*args, **kwargs):
8054 """
8055 SetMinSize(self, Size minSize)
8056
8057 A more convenient method than `SetSizeHints` for setting just the
8058 min size.
8059 """
8060 return _core_.Window_SetMinSize(*args, **kwargs)
8061
8062 def SetMaxSize(*args, **kwargs):
8063 """
8064 SetMaxSize(self, Size maxSize)
8065
8066 A more convenient method than `SetSizeHints` for setting just the
8067 max size.
8068 """
8069 return _core_.Window_SetMaxSize(*args, **kwargs)
8070
8071 def GetMinWidth(*args, **kwargs):
8072 """GetMinWidth(self) -> int"""
8073 return _core_.Window_GetMinWidth(*args, **kwargs)
8074
8075 def GetMinHeight(*args, **kwargs):
8076 """GetMinHeight(self) -> int"""
8077 return _core_.Window_GetMinHeight(*args, **kwargs)
8078
8079 def GetMaxWidth(*args, **kwargs):
8080 """GetMaxWidth(self) -> int"""
8081 return _core_.Window_GetMaxWidth(*args, **kwargs)
8082
8083 def GetMaxHeight(*args, **kwargs):
8084 """GetMaxHeight(self) -> int"""
8085 return _core_.Window_GetMaxHeight(*args, **kwargs)
8086
8087 def SetVirtualSize(*args, **kwargs):
8088 """
8089 SetVirtualSize(self, Size size)
8090
8091 Set the the virtual size of a window in pixels. For most windows this
8092 is just the client area of the window, but for some like scrolled
8093 windows it is more or less independent of the screen window size.
8094 """
8095 return _core_.Window_SetVirtualSize(*args, **kwargs)
8096
8097 def SetVirtualSizeWH(*args, **kwargs):
8098 """
8099 SetVirtualSizeWH(self, int w, int h)
8100
8101 Set the the virtual size of a window in pixels. For most windows this
8102 is just the client area of the window, but for some like scrolled
8103 windows it is more or less independent of the screen window size.
8104 """
8105 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8106
8107 def GetVirtualSize(*args, **kwargs):
8108 """
8109 GetVirtualSize(self) -> Size
8110
8111 Get the the virtual size of the window in pixels. For most windows
8112 this is just the client area of the window, but for some like scrolled
8113 windows it is more or less independent of the screen window size.
8114 """
8115 return _core_.Window_GetVirtualSize(*args, **kwargs)
8116
8117 def GetVirtualSizeTuple(*args, **kwargs):
8118 """
8119 GetVirtualSizeTuple() -> (width, height)
8120
8121 Get the the virtual size of the window in pixels. For most windows
8122 this is just the client area of the window, but for some like scrolled
8123 windows it is more or less independent of the screen window size.
8124 """
8125 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8126
8127 def GetBestVirtualSize(*args, **kwargs):
8128 """
8129 GetBestVirtualSize(self) -> Size
8130
8131 Return the largest of ClientSize and BestSize (as determined by a
8132 sizer, interior children, or other means)
8133 """
8134 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8135
8136 def Show(*args, **kwargs):
8137 """
8138 Show(self, bool show=True) -> bool
8139
8140 Shows or hides the window. You may need to call Raise for a top level
8141 window if you want to bring it to top, although this is not needed if
8142 Show is called immediately after the frame creation. Returns True if
8143 the window has been shown or hidden or False if nothing was done
8144 because it already was in the requested state.
8145 """
8146 return _core_.Window_Show(*args, **kwargs)
8147
8148 def Hide(*args, **kwargs):
8149 """
8150 Hide(self) -> bool
8151
8152 Equivalent to calling Show(False).
8153 """
8154 return _core_.Window_Hide(*args, **kwargs)
8155
8156 def Enable(*args, **kwargs):
8157 """
8158 Enable(self, bool enable=True) -> bool
8159
8160 Enable or disable the window for user input. Note that when a parent
8161 window is disabled, all of its children are disabled as well and they
8162 are reenabled again when the parent is. Returns true if the window
8163 has been enabled or disabled, false if nothing was done, i.e. if the
8164 window had already been in the specified state.
8165 """
8166 return _core_.Window_Enable(*args, **kwargs)
8167
8168 def Disable(*args, **kwargs):
8169 """
8170 Disable(self) -> bool
8171
8172 Disables the window, same as Enable(false).
8173 """
8174 return _core_.Window_Disable(*args, **kwargs)
8175
8176 def IsShown(*args, **kwargs):
8177 """
8178 IsShown(self) -> bool
8179
8180 Returns true if the window is shown, false if it has been hidden.
8181 """
8182 return _core_.Window_IsShown(*args, **kwargs)
8183
8184 def IsEnabled(*args, **kwargs):
8185 """
8186 IsEnabled(self) -> bool
8187
8188 Returns true if the window is enabled for input, false otherwise.
8189 """
8190 return _core_.Window_IsEnabled(*args, **kwargs)
8191
8192 def SetWindowStyleFlag(*args, **kwargs):
8193 """
8194 SetWindowStyleFlag(self, long style)
8195
8196 Sets the style of the window. Please note that some styles cannot be
8197 changed after the window creation and that Refresh() might need to be
8198 called after changing the others for the change to take place
8199 immediately.
8200 """
8201 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8202
8203 def GetWindowStyleFlag(*args, **kwargs):
8204 """
8205 GetWindowStyleFlag(self) -> long
8206
8207 Gets the window style that was passed to the constructor or Create
8208 method.
8209 """
8210 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8211
8212 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8213 def HasFlag(*args, **kwargs):
8214 """
8215 HasFlag(self, int flag) -> bool
8216
8217 Test if the given style is set for this window.
8218 """
8219 return _core_.Window_HasFlag(*args, **kwargs)
8220
8221 def IsRetained(*args, **kwargs):
8222 """
8223 IsRetained(self) -> bool
8224
8225 Returns true if the window is retained, false otherwise. Retained
8226 windows are only available on X platforms.
8227 """
8228 return _core_.Window_IsRetained(*args, **kwargs)
8229
8230 def SetExtraStyle(*args, **kwargs):
8231 """
8232 SetExtraStyle(self, long exStyle)
8233
8234 Sets the extra style bits for the window. Extra styles are the less
8235 often used style bits which can't be set with the constructor or with
8236 SetWindowStyleFlag()
8237 """
8238 return _core_.Window_SetExtraStyle(*args, **kwargs)
8239
8240 def GetExtraStyle(*args, **kwargs):
8241 """
8242 GetExtraStyle(self) -> long
8243
8244 Returns the extra style bits for the window.
8245 """
8246 return _core_.Window_GetExtraStyle(*args, **kwargs)
8247
8248 def MakeModal(*args, **kwargs):
8249 """
8250 MakeModal(self, bool modal=True)
8251
8252 Disables all other windows in the application so that the user can
8253 only interact with this window. Passing False will reverse this
8254 effect.
8255 """
8256 return _core_.Window_MakeModal(*args, **kwargs)
8257
8258 def SetThemeEnabled(*args, **kwargs):
8259 """
8260 SetThemeEnabled(self, bool enableTheme)
8261
8262 This function tells a window if it should use the system's "theme"
8263 code to draw the windows' background instead if its own background
8264 drawing code. This will only have an effect on platforms that support
8265 the notion of themes in user defined windows. One such platform is
8266 GTK+ where windows can have (very colourful) backgrounds defined by a
8267 user's selected theme.
8268
8269 Dialogs, notebook pages and the status bar have this flag set to true
8270 by default so that the default look and feel is simulated best.
8271 """
8272 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8273
8274 def GetThemeEnabled(*args, **kwargs):
8275 """
8276 GetThemeEnabled(self) -> bool
8277
8278 Return the themeEnabled flag.
8279 """
8280 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8281
8282 def SetFocus(*args, **kwargs):
8283 """
8284 SetFocus(self)
8285
8286 Set's the focus to this window, allowing it to receive keyboard input.
8287 """
8288 return _core_.Window_SetFocus(*args, **kwargs)
8289
8290 def SetFocusFromKbd(*args, **kwargs):
8291 """
8292 SetFocusFromKbd(self)
8293
8294 Set focus to this window as the result of a keyboard action. Normally
8295 only called internally.
8296 """
8297 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8298
8299 def FindFocus(*args, **kwargs):
8300 """
8301 FindFocus() -> Window
8302
8303 Returns the window or control that currently has the keyboard focus,
8304 or None.
8305 """
8306 return _core_.Window_FindFocus(*args, **kwargs)
8307
8308 FindFocus = staticmethod(FindFocus)
8309 def AcceptsFocus(*args, **kwargs):
8310 """
8311 AcceptsFocus(self) -> bool
8312
8313 Can this window have focus?
8314 """
8315 return _core_.Window_AcceptsFocus(*args, **kwargs)
8316
8317 def AcceptsFocusFromKeyboard(*args, **kwargs):
8318 """
8319 AcceptsFocusFromKeyboard(self) -> bool
8320
8321 Can this window be given focus by keyboard navigation? if not, the
8322 only way to give it focus (provided it accepts it at all) is to click
8323 it.
8324 """
8325 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8326
8327 def GetDefaultItem(*args, **kwargs):
8328 """
8329 GetDefaultItem(self) -> Window
8330
8331 Get the default child of this parent, i.e. the one which is activated
8332 by pressing <Enter> such as the OK button on a wx.Dialog.
8333 """
8334 return _core_.Window_GetDefaultItem(*args, **kwargs)
8335
8336 def SetDefaultItem(*args, **kwargs):
8337 """
8338 SetDefaultItem(self, Window child) -> Window
8339
8340 Set this child as default, return the old default.
8341 """
8342 return _core_.Window_SetDefaultItem(*args, **kwargs)
8343
8344 def SetTmpDefaultItem(*args, **kwargs):
8345 """
8346 SetTmpDefaultItem(self, Window win)
8347
8348 Set this child as temporary default
8349 """
8350 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8351
8352 def Navigate(*args, **kwargs):
8353 """
8354 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8355
8356 Does keyboard navigation from this window to another, by sending a
8357 `wx.NavigationKeyEvent`.
8358 """
8359 return _core_.Window_Navigate(*args, **kwargs)
8360
8361 def MoveAfterInTabOrder(*args, **kwargs):
8362 """
8363 MoveAfterInTabOrder(self, Window win)
8364
8365 Moves this window in the tab navigation order after the specified
8366 sibling window. This means that when the user presses the TAB key on
8367 that other window, the focus switches to this window.
8368
8369 The default tab order is the same as creation order. This function
8370 and `MoveBeforeInTabOrder` allow to change it after creating all the
8371 windows.
8372
8373 """
8374 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8375
8376 def MoveBeforeInTabOrder(*args, **kwargs):
8377 """
8378 MoveBeforeInTabOrder(self, Window win)
8379
8380 Same as `MoveAfterInTabOrder` except that it inserts this window just
8381 before win instead of putting it right after it.
8382 """
8383 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8384
8385 def GetChildren(*args, **kwargs):
8386 """
8387 GetChildren(self) -> PyObject
8388
8389 Returns a list of the window's children. NOTE: Currently this is a
8390 copy of the child window list maintained by the window, so the return
8391 value of this function is only valid as long as the window's children
8392 do not change.
8393 """
8394 return _core_.Window_GetChildren(*args, **kwargs)
8395
8396 def GetParent(*args, **kwargs):
8397 """
8398 GetParent(self) -> Window
8399
8400 Returns the parent window of this window, or None if there isn't one.
8401 """
8402 return _core_.Window_GetParent(*args, **kwargs)
8403
8404 def GetGrandParent(*args, **kwargs):
8405 """
8406 GetGrandParent(self) -> Window
8407
8408 Returns the parent of the parent of this window, or None if there
8409 isn't one.
8410 """
8411 return _core_.Window_GetGrandParent(*args, **kwargs)
8412
8413 def IsTopLevel(*args, **kwargs):
8414 """
8415 IsTopLevel(self) -> bool
8416
8417 Returns true if the given window is a top-level one. Currently all
8418 frames and dialogs are always considered to be top-level windows (even
8419 if they have a parent window).
8420 """
8421 return _core_.Window_IsTopLevel(*args, **kwargs)
8422
8423 def Reparent(*args, **kwargs):
8424 """
8425 Reparent(self, Window newParent) -> bool
8426
8427 Reparents the window, i.e the window will be removed from its current
8428 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8429 re-inserted into another. Available on Windows and GTK. Returns True
8430 if the parent was changed, False otherwise (error or newParent ==
8431 oldParent)
8432 """
8433 return _core_.Window_Reparent(*args, **kwargs)
8434
8435 def AddChild(*args, **kwargs):
8436 """
8437 AddChild(self, Window child)
8438
8439 Adds a child window. This is called automatically by window creation
8440 functions so should not be required by the application programmer.
8441 """
8442 return _core_.Window_AddChild(*args, **kwargs)
8443
8444 def RemoveChild(*args, **kwargs):
8445 """
8446 RemoveChild(self, Window child)
8447
8448 Removes a child window. This is called automatically by window
8449 deletion functions so should not be required by the application
8450 programmer.
8451 """
8452 return _core_.Window_RemoveChild(*args, **kwargs)
8453
8454 def FindWindowById(*args, **kwargs):
8455 """
8456 FindWindowById(self, long winid) -> Window
8457
8458 Find a chld of this window by window ID
8459 """
8460 return _core_.Window_FindWindowById(*args, **kwargs)
8461
8462 def FindWindowByName(*args, **kwargs):
8463 """
8464 FindWindowByName(self, String name) -> Window
8465
8466 Find a child of this window by name
8467 """
8468 return _core_.Window_FindWindowByName(*args, **kwargs)
8469
8470 def GetEventHandler(*args, **kwargs):
8471 """
8472 GetEventHandler(self) -> EvtHandler
8473
8474 Returns the event handler for this window. By default, the window is
8475 its own event handler.
8476 """
8477 return _core_.Window_GetEventHandler(*args, **kwargs)
8478
8479 def SetEventHandler(*args, **kwargs):
8480 """
8481 SetEventHandler(self, EvtHandler handler)
8482
8483 Sets the event handler for this window. An event handler is an object
8484 that is capable of processing the events sent to a window. By default,
8485 the window is its own event handler, but an application may wish to
8486 substitute another, for example to allow central implementation of
8487 event-handling for a variety of different window classes.
8488
8489 It is usually better to use `wx.Window.PushEventHandler` since this sets
8490 up a chain of event handlers, where an event not handled by one event
8491 handler is handed to the next one in the chain.
8492 """
8493 return _core_.Window_SetEventHandler(*args, **kwargs)
8494
8495 def PushEventHandler(*args, **kwargs):
8496 """
8497 PushEventHandler(self, EvtHandler handler)
8498
8499 Pushes this event handler onto the event handler stack for the window.
8500 An event handler is an object that is capable of processing the events
8501 sent to a window. By default, the window is its own event handler, but
8502 an application may wish to substitute another, for example to allow
8503 central implementation of event-handling for a variety of different
8504 window classes.
8505
8506 wx.Window.PushEventHandler allows an application to set up a chain of
8507 event handlers, where an event not handled by one event handler is
8508 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8509 remove the event handler.
8510 """
8511 return _core_.Window_PushEventHandler(*args, **kwargs)
8512
8513 def PopEventHandler(*args, **kwargs):
8514 """
8515 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8516
8517 Removes and returns the top-most event handler on the event handler
8518 stack. If deleteHandler is True then the wx.EvtHandler object will be
8519 destroyed after it is popped.
8520 """
8521 return _core_.Window_PopEventHandler(*args, **kwargs)
8522
8523 def RemoveEventHandler(*args, **kwargs):
8524 """
8525 RemoveEventHandler(self, EvtHandler handler) -> bool
8526
8527 Find the given handler in the event handler chain and remove (but not
8528 delete) it from the event handler chain, return True if it was found
8529 and False otherwise (this also results in an assert failure so this
8530 function should only be called when the handler is supposed to be
8531 there.)
8532 """
8533 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8534
8535 def SetValidator(*args, **kwargs):
8536 """
8537 SetValidator(self, Validator validator)
8538
8539 Deletes the current validator (if any) and sets the window validator,
8540 having called wx.Validator.Clone to create a new validator of this
8541 type.
8542 """
8543 return _core_.Window_SetValidator(*args, **kwargs)
8544
8545 def GetValidator(*args, **kwargs):
8546 """
8547 GetValidator(self) -> Validator
8548
8549 Returns a pointer to the current validator for the window, or None if
8550 there is none.
8551 """
8552 return _core_.Window_GetValidator(*args, **kwargs)
8553
8554 def Validate(*args, **kwargs):
8555 """
8556 Validate(self) -> bool
8557
8558 Validates the current values of the child controls using their
8559 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8560 style flag set, the method will also call Validate() of all child
8561 windows. Returns false if any of the validations failed.
8562 """
8563 return _core_.Window_Validate(*args, **kwargs)
8564
8565 def TransferDataToWindow(*args, **kwargs):
8566 """
8567 TransferDataToWindow(self) -> bool
8568
8569 Transfers values to child controls from data areas specified by their
8570 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8571 style flag set, the method will also call TransferDataToWindow() of
8572 all child windows.
8573 """
8574 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8575
8576 def TransferDataFromWindow(*args, **kwargs):
8577 """
8578 TransferDataFromWindow(self) -> bool
8579
8580 Transfers values from child controls to data areas specified by their
8581 validators. Returns false if a transfer failed. If the window has
8582 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8583 also call TransferDataFromWindow() of all child windows.
8584 """
8585 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8586
8587 def InitDialog(*args, **kwargs):
8588 """
8589 InitDialog(self)
8590
8591 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8592 to the dialog via validators.
8593 """
8594 return _core_.Window_InitDialog(*args, **kwargs)
8595
8596 def SetAcceleratorTable(*args, **kwargs):
8597 """
8598 SetAcceleratorTable(self, AcceleratorTable accel)
8599
8600 Sets the accelerator table for this window.
8601 """
8602 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8603
8604 def GetAcceleratorTable(*args, **kwargs):
8605 """
8606 GetAcceleratorTable(self) -> AcceleratorTable
8607
8608 Gets the accelerator table for this window.
8609 """
8610 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8611
8612 def RegisterHotKey(*args, **kwargs):
8613 """
8614 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8615
8616 Registers a system wide hotkey. Every time the user presses the hotkey
8617 registered here, this window will receive a hotkey event. It will
8618 receive the event even if the application is in the background and
8619 does not have the input focus because the user is working with some
8620 other application. To bind an event handler function to this hotkey
8621 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8622 hotkey was registered successfully.
8623 """
8624 return _core_.Window_RegisterHotKey(*args, **kwargs)
8625
8626 def UnregisterHotKey(*args, **kwargs):
8627 """
8628 UnregisterHotKey(self, int hotkeyId) -> bool
8629
8630 Unregisters a system wide hotkey.
8631 """
8632 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8633
8634 def ConvertDialogPointToPixels(*args, **kwargs):
8635 """
8636 ConvertDialogPointToPixels(self, Point pt) -> Point
8637
8638 Converts a point or size from dialog units to pixels. Dialog units
8639 are used for maintaining a dialog's proportions even if the font
8640 changes. For the x dimension, the dialog units are multiplied by the
8641 average character width and then divided by 4. For the y dimension,
8642 the dialog units are multiplied by the average character height and
8643 then divided by 8.
8644 """
8645 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8646
8647 def ConvertDialogSizeToPixels(*args, **kwargs):
8648 """
8649 ConvertDialogSizeToPixels(self, Size sz) -> Size
8650
8651 Converts a point or size from dialog units to pixels. Dialog units
8652 are used for maintaining a dialog's proportions even if the font
8653 changes. For the x dimension, the dialog units are multiplied by the
8654 average character width and then divided by 4. For the y dimension,
8655 the dialog units are multiplied by the average character height and
8656 then divided by 8.
8657 """
8658 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8659
8660 def DLG_PNT(*args, **kwargs):
8661 """
8662 DLG_PNT(self, Point pt) -> Point
8663
8664 Converts a point or size from dialog units to pixels. Dialog units
8665 are used for maintaining a dialog's proportions even if the font
8666 changes. For the x dimension, the dialog units are multiplied by the
8667 average character width and then divided by 4. For the y dimension,
8668 the dialog units are multiplied by the average character height and
8669 then divided by 8.
8670 """
8671 return _core_.Window_DLG_PNT(*args, **kwargs)
8672
8673 def DLG_SZE(*args, **kwargs):
8674 """
8675 DLG_SZE(self, Size sz) -> Size
8676
8677 Converts a point or size from dialog units to pixels. Dialog units
8678 are used for maintaining a dialog's proportions even if the font
8679 changes. For the x dimension, the dialog units are multiplied by the
8680 average character width and then divided by 4. For the y dimension,
8681 the dialog units are multiplied by the average character height and
8682 then divided by 8.
8683 """
8684 return _core_.Window_DLG_SZE(*args, **kwargs)
8685
8686 def ConvertPixelPointToDialog(*args, **kwargs):
8687 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8688 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8689
8690 def ConvertPixelSizeToDialog(*args, **kwargs):
8691 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8692 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8693
8694 def WarpPointer(*args, **kwargs):
8695 """
8696 WarpPointer(self, int x, int y)
8697
8698 Moves the pointer to the given position on the window.
8699
8700 NOTE: This function is not supported under Mac because Apple Human
8701 Interface Guidelines forbid moving the mouse cursor programmatically.
8702 """
8703 return _core_.Window_WarpPointer(*args, **kwargs)
8704
8705 def CaptureMouse(*args, **kwargs):
8706 """
8707 CaptureMouse(self)
8708
8709 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8710 release the capture.
8711
8712 Note that wxWindows maintains the stack of windows having captured the
8713 mouse and when the mouse is released the capture returns to the window
8714 which had had captured it previously and it is only really released if
8715 there were no previous window. In particular, this means that you must
8716 release the mouse as many times as you capture it.
8717 """
8718 return _core_.Window_CaptureMouse(*args, **kwargs)
8719
8720 def ReleaseMouse(*args, **kwargs):
8721 """
8722 ReleaseMouse(self)
8723
8724 Releases mouse input captured with wx.Window.CaptureMouse.
8725 """
8726 return _core_.Window_ReleaseMouse(*args, **kwargs)
8727
8728 def GetCapture(*args, **kwargs):
8729 """
8730 GetCapture() -> Window
8731
8732 Returns the window which currently captures the mouse or None
8733 """
8734 return _core_.Window_GetCapture(*args, **kwargs)
8735
8736 GetCapture = staticmethod(GetCapture)
8737 def HasCapture(*args, **kwargs):
8738 """
8739 HasCapture(self) -> bool
8740
8741 Returns true if this window has the current mouse capture.
8742 """
8743 return _core_.Window_HasCapture(*args, **kwargs)
8744
8745 def Refresh(*args, **kwargs):
8746 """
8747 Refresh(self, bool eraseBackground=True, Rect rect=None)
8748
8749 Mark the specified rectangle (or the whole window) as "dirty" so it
8750 will be repainted. Causes an EVT_PAINT event to be generated and sent
8751 to the window.
8752 """
8753 return _core_.Window_Refresh(*args, **kwargs)
8754
8755 def RefreshRect(*args, **kwargs):
8756 """
8757 RefreshRect(self, Rect rect, bool eraseBackground=True)
8758
8759 Redraws the contents of the given rectangle: the area inside it will
8760 be repainted. This is the same as Refresh but has a nicer syntax.
8761 """
8762 return _core_.Window_RefreshRect(*args, **kwargs)
8763
8764 def Update(*args, **kwargs):
8765 """
8766 Update(self)
8767
8768 Calling this method immediately repaints the invalidated area of the
8769 window instead of waiting for the EVT_PAINT event to happen, (normally
8770 this would usually only happen when the flow of control returns to the
8771 event loop.) Notice that this function doesn't refresh the window and
8772 does nothing if the window has been already repainted. Use Refresh
8773 first if you want to immediately redraw the window (or some portion of
8774 it) unconditionally.
8775 """
8776 return _core_.Window_Update(*args, **kwargs)
8777
8778 def ClearBackground(*args, **kwargs):
8779 """
8780 ClearBackground(self)
8781
8782 Clears the window by filling it with the current background
8783 colour. Does not cause an erase background event to be generated.
8784 """
8785 return _core_.Window_ClearBackground(*args, **kwargs)
8786
8787 def Freeze(*args, **kwargs):
8788 """
8789 Freeze(self)
8790
8791 Freezes the window or, in other words, prevents any updates from
8792 taking place on screen, the window is not redrawn at all. Thaw must be
8793 called to reenable window redrawing. Calls to Freeze/Thaw may be
8794 nested, with the actual Thaw being delayed until all the nesting has
8795 been undone.
8796
8797 This method is useful for visual appearance optimization (for example,
8798 it is a good idea to use it before inserting large amount of text into
8799 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8800 for all controls so it is mostly just a hint to wxWindows and not a
8801 mandatory directive.
8802 """
8803 return _core_.Window_Freeze(*args, **kwargs)
8804
8805 def Thaw(*args, **kwargs):
8806 """
8807 Thaw(self)
8808
8809 Reenables window updating after a previous call to Freeze. Calls to
8810 Freeze/Thaw may be nested, so Thaw must be called the same number of
8811 times that Freeze was before the window will be updated.
8812 """
8813 return _core_.Window_Thaw(*args, **kwargs)
8814
8815 def PrepareDC(*args, **kwargs):
8816 """
8817 PrepareDC(self, DC dc)
8818
8819 Call this function to prepare the device context for drawing a
8820 scrolled image. It sets the device origin according to the current
8821 scroll position.
8822 """
8823 return _core_.Window_PrepareDC(*args, **kwargs)
8824
8825 def GetUpdateRegion(*args, **kwargs):
8826 """
8827 GetUpdateRegion(self) -> Region
8828
8829 Returns the region specifying which parts of the window have been
8830 damaged. Should only be called within an EVT_PAINT handler.
8831 """
8832 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8833
8834 def GetUpdateClientRect(*args, **kwargs):
8835 """
8836 GetUpdateClientRect(self) -> Rect
8837
8838 Get the update rectangle region bounding box in client coords.
8839 """
8840 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8841
8842 def IsExposed(*args, **kwargs):
8843 """
8844 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8845
8846 Returns true if the given point or rectangle area has been exposed
8847 since the last repaint. Call this in an paint event handler to
8848 optimize redrawing by only redrawing those areas, which have been
8849 exposed.
8850 """
8851 return _core_.Window_IsExposed(*args, **kwargs)
8852
8853 def IsExposedPoint(*args, **kwargs):
8854 """
8855 IsExposedPoint(self, Point pt) -> bool
8856
8857 Returns true if the given point or rectangle area has been exposed
8858 since the last repaint. Call this in an paint event handler to
8859 optimize redrawing by only redrawing those areas, which have been
8860 exposed.
8861 """
8862 return _core_.Window_IsExposedPoint(*args, **kwargs)
8863
8864 def IsExposedRect(*args, **kwargs):
8865 """
8866 IsExposedRect(self, Rect rect) -> bool
8867
8868 Returns true if the given point or rectangle area has been exposed
8869 since the last repaint. Call this in an paint event handler to
8870 optimize redrawing by only redrawing those areas, which have been
8871 exposed.
8872 """
8873 return _core_.Window_IsExposedRect(*args, **kwargs)
8874
8875 def GetDefaultAttributes(*args, **kwargs):
8876 """
8877 GetDefaultAttributes(self) -> VisualAttributes
8878
8879 Get the default attributes for an instance of this class. This is
8880 useful if you want to use the same font or colour in your own control
8881 as in a standard control -- which is a much better idea than hard
8882 coding specific colours or fonts which might look completely out of
8883 place on the user's system, especially if it uses themes.
8884 """
8885 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8886
8887 def GetClassDefaultAttributes(*args, **kwargs):
8888 """
8889 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8890
8891 Get the default attributes for this class. This is useful if you want
8892 to use the same font or colour in your own control as in a standard
8893 control -- which is a much better idea than hard coding specific
8894 colours or fonts which might look completely out of place on the
8895 user's system, especially if it uses themes.
8896
8897 The variant parameter is only relevant under Mac currently and is
8898 ignore under other platforms. Under Mac, it will change the size of
8899 the returned font. See `wx.Window.SetWindowVariant` for more about
8900 this.
8901 """
8902 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8903
8904 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8905 def SetBackgroundColour(*args, **kwargs):
8906 """
8907 SetBackgroundColour(self, Colour colour) -> bool
8908
8909 Sets the background colour of the window. Returns True if the colour
8910 was changed. The background colour is usually painted by the default
8911 EVT_ERASE_BACKGROUND event handler function under Windows and
8912 automatically under GTK. Using `wx.NullColour` will reset the window
8913 to the default background colour.
8914
8915 Note that setting the background colour may not cause an immediate
8916 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8917 calling this function.
8918
8919 Using this function will disable attempts to use themes for this
8920 window, if the system supports them. Use with care since usually the
8921 themes represent the appearance chosen by the user to be used for all
8922 applications on the system.
8923 """
8924 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8925
8926 def SetOwnBackgroundColour(*args, **kwargs):
8927 """SetOwnBackgroundColour(self, Colour colour)"""
8928 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8929
8930 def SetForegroundColour(*args, **kwargs):
8931 """
8932 SetForegroundColour(self, Colour colour) -> bool
8933
8934 Sets the foreground colour of the window. Returns True is the colour
8935 was changed. The interpretation of foreground colour is dependent on
8936 the window class; it may be the text colour or other colour, or it may
8937 not be used at all.
8938 """
8939 return _core_.Window_SetForegroundColour(*args, **kwargs)
8940
8941 def SetOwnForegroundColour(*args, **kwargs):
8942 """SetOwnForegroundColour(self, Colour colour)"""
8943 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8944
8945 def GetBackgroundColour(*args, **kwargs):
8946 """
8947 GetBackgroundColour(self) -> Colour
8948
8949 Returns the background colour of the window.
8950 """
8951 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8952
8953 def GetForegroundColour(*args, **kwargs):
8954 """
8955 GetForegroundColour(self) -> Colour
8956
8957 Returns the foreground colour of the window. The interpretation of
8958 foreground colour is dependent on the window class; it may be the text
8959 colour or other colour, or it may not be used at all.
8960 """
8961 return _core_.Window_GetForegroundColour(*args, **kwargs)
8962
8963 def InheritsBackgroundColour(*args, **kwargs):
8964 """InheritsBackgroundColour(self) -> bool"""
8965 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8966
8967 def UseBgCol(*args, **kwargs):
8968 """UseBgCol(self) -> bool"""
8969 return _core_.Window_UseBgCol(*args, **kwargs)
8970
8971 def SetBackgroundStyle(*args, **kwargs):
8972 """
8973 SetBackgroundStyle(self, int style) -> bool
8974
8975 Returns the background style of the window. The background style
8976 indicates how the background of the window is drawn.
8977
8978 ====================== ========================================
8979 wx.BG_STYLE_SYSTEM The background colour or pattern should
8980 be determined by the system
8981 wx.BG_STYLE_COLOUR The background should be a solid colour
8982 wx.BG_STYLE_CUSTOM The background will be implemented by the
8983 application.
8984 ====================== ========================================
8985
8986 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8987 a custom background, such as a tiled bitmap. Currently the style has
8988 no effect on other platforms.
8989
8990 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8991 """
8992 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8993
8994 def GetBackgroundStyle(*args, **kwargs):
8995 """
8996 GetBackgroundStyle(self) -> int
8997
8998 Returns the background style of the window.
8999
9000 :see: `SetBackgroundStyle`
9001 """
9002 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9003
9004 def HasTransparentBackground(*args, **kwargs):
9005 """
9006 HasTransparentBackground(self) -> bool
9007
9008 Returns True if this window's background is transparent (as, for
9009 example, for `wx.StaticText`) and should show the parent window's
9010 background.
9011
9012 This method is mostly used internally by the library itself and you
9013 normally shouldn't have to call it. You may, however, have to override
9014 it in your custom control classes to ensure that background is painted
9015 correctly.
9016 """
9017 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9018
9019 def SetCursor(*args, **kwargs):
9020 """
9021 SetCursor(self, Cursor cursor) -> bool
9022
9023 Sets the window's cursor. Notice that the window cursor also sets it
9024 for the children of the window implicitly.
9025
9026 The cursor may be wx.NullCursor in which case the window cursor will
9027 be reset back to default.
9028 """
9029 return _core_.Window_SetCursor(*args, **kwargs)
9030
9031 def GetCursor(*args, **kwargs):
9032 """
9033 GetCursor(self) -> Cursor
9034
9035 Return the cursor associated with this window.
9036 """
9037 return _core_.Window_GetCursor(*args, **kwargs)
9038
9039 def SetFont(*args, **kwargs):
9040 """
9041 SetFont(self, Font font) -> bool
9042
9043 Sets the font for this window.
9044 """
9045 return _core_.Window_SetFont(*args, **kwargs)
9046
9047 def SetOwnFont(*args, **kwargs):
9048 """SetOwnFont(self, Font font)"""
9049 return _core_.Window_SetOwnFont(*args, **kwargs)
9050
9051 def GetFont(*args, **kwargs):
9052 """
9053 GetFont(self) -> Font
9054
9055 Returns the default font used for this window.
9056 """
9057 return _core_.Window_GetFont(*args, **kwargs)
9058
9059 def SetCaret(*args, **kwargs):
9060 """
9061 SetCaret(self, Caret caret)
9062
9063 Sets the caret associated with the window.
9064 """
9065 return _core_.Window_SetCaret(*args, **kwargs)
9066
9067 def GetCaret(*args, **kwargs):
9068 """
9069 GetCaret(self) -> Caret
9070
9071 Returns the caret associated with the window.
9072 """
9073 return _core_.Window_GetCaret(*args, **kwargs)
9074
9075 def GetCharHeight(*args, **kwargs):
9076 """
9077 GetCharHeight(self) -> int
9078
9079 Get the (average) character size for the current font.
9080 """
9081 return _core_.Window_GetCharHeight(*args, **kwargs)
9082
9083 def GetCharWidth(*args, **kwargs):
9084 """
9085 GetCharWidth(self) -> int
9086
9087 Get the (average) character size for the current font.
9088 """
9089 return _core_.Window_GetCharWidth(*args, **kwargs)
9090
9091 def GetTextExtent(*args, **kwargs):
9092 """
9093 GetTextExtent(String string) -> (width, height)
9094
9095 Get the width and height of the text using the current font.
9096 """
9097 return _core_.Window_GetTextExtent(*args, **kwargs)
9098
9099 def GetFullTextExtent(*args, **kwargs):
9100 """
9101 GetFullTextExtent(String string, Font font=None) ->
9102 (width, height, descent, externalLeading)
9103
9104 Get the width, height, decent and leading of the text using the
9105 current or specified font.
9106 """
9107 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9108
9109 def ClientToScreenXY(*args, **kwargs):
9110 """
9111 ClientToScreenXY(int x, int y) -> (x,y)
9112
9113 Converts to screen coordinates from coordinates relative to this window.
9114 """
9115 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9116
9117 def ScreenToClientXY(*args, **kwargs):
9118 """
9119 ScreenToClientXY(int x, int y) -> (x,y)
9120
9121 Converts from screen to client window coordinates.
9122 """
9123 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9124
9125 def ClientToScreen(*args, **kwargs):
9126 """
9127 ClientToScreen(self, Point pt) -> Point
9128
9129 Converts to screen coordinates from coordinates relative to this window.
9130 """
9131 return _core_.Window_ClientToScreen(*args, **kwargs)
9132
9133 def ScreenToClient(*args, **kwargs):
9134 """
9135 ScreenToClient(self, Point pt) -> Point
9136
9137 Converts from screen to client window coordinates.
9138 """
9139 return _core_.Window_ScreenToClient(*args, **kwargs)
9140
9141 def HitTestXY(*args, **kwargs):
9142 """
9143 HitTestXY(self, int x, int y) -> int
9144
9145 Test where the given (in client coords) point lies
9146 """
9147 return _core_.Window_HitTestXY(*args, **kwargs)
9148
9149 def HitTest(*args, **kwargs):
9150 """
9151 HitTest(self, Point pt) -> int
9152
9153 Test where the given (in client coords) point lies
9154 """
9155 return _core_.Window_HitTest(*args, **kwargs)
9156
9157 def GetBorder(*args):
9158 """
9159 GetBorder(self, long flags) -> int
9160 GetBorder(self) -> int
9161
9162 Get border for the flags of this window
9163 """
9164 return _core_.Window_GetBorder(*args)
9165
9166 def UpdateWindowUI(*args, **kwargs):
9167 """
9168 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9169
9170 This function sends EVT_UPDATE_UI events to the window. The particular
9171 implementation depends on the window; for example a wx.ToolBar will
9172 send an update UI event for each toolbar button, and a wx.Frame will
9173 send an update UI event for each menubar menu item. You can call this
9174 function from your application to ensure that your UI is up-to-date at
9175 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9176 concerned). This may be necessary if you have called
9177 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9178 limit the overhead that wxWindows incurs by sending update UI events
9179 in idle time.
9180 """
9181 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9182
9183 def PopupMenuXY(*args, **kwargs):
9184 """
9185 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9186
9187 Pops up the given menu at the specified coordinates, relative to this window,
9188 and returns control when the user has dismissed the menu. If a menu item is
9189 selected, the corresponding menu event is generated and will be processed as
9190 usual. If the default position is given then the current position of the
9191 mouse cursor will be used.
9192 """
9193 return _core_.Window_PopupMenuXY(*args, **kwargs)
9194
9195 def PopupMenu(*args, **kwargs):
9196 """
9197 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9198
9199 Pops up the given menu at the specified coordinates, relative to this window,
9200 and returns control when the user has dismissed the menu. If a menu item is
9201 selected, the corresponding menu event is generated and will be processed as
9202 usual. If the default position is given then the current position of the
9203 mouse cursor will be used.
9204 """
9205 return _core_.Window_PopupMenu(*args, **kwargs)
9206
9207 def GetHandle(*args, **kwargs):
9208 """
9209 GetHandle(self) -> long
9210
9211 Returns the platform-specific handle (as a long integer) of the
9212 physical window. Currently on wxMac it returns the handle of the
9213 toplevel parent of the window.
9214 """
9215 return _core_.Window_GetHandle(*args, **kwargs)
9216
9217 def AssociateHandle(*args, **kwargs):
9218 """
9219 AssociateHandle(self, long handle)
9220
9221 Associate the window with a new native handle
9222 """
9223 return _core_.Window_AssociateHandle(*args, **kwargs)
9224
9225 def DissociateHandle(*args, **kwargs):
9226 """
9227 DissociateHandle(self)
9228
9229 Dissociate the current native handle from the window
9230 """
9231 return _core_.Window_DissociateHandle(*args, **kwargs)
9232
9233 def OnPaint(*args, **kwargs):
9234 """OnPaint(self, PaintEvent event)"""
9235 return _core_.Window_OnPaint(*args, **kwargs)
9236
9237 def HasScrollbar(*args, **kwargs):
9238 """
9239 HasScrollbar(self, int orient) -> bool
9240
9241 Does the window have the scrollbar for this orientation?
9242 """
9243 return _core_.Window_HasScrollbar(*args, **kwargs)
9244
9245 def SetScrollbar(*args, **kwargs):
9246 """
9247 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9248 bool refresh=True)
9249
9250 Sets the scrollbar properties of a built-in scrollbar.
9251 """
9252 return _core_.Window_SetScrollbar(*args, **kwargs)
9253
9254 def SetScrollPos(*args, **kwargs):
9255 """
9256 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9257
9258 Sets the position of one of the built-in scrollbars.
9259 """
9260 return _core_.Window_SetScrollPos(*args, **kwargs)
9261
9262 def GetScrollPos(*args, **kwargs):
9263 """
9264 GetScrollPos(self, int orientation) -> int
9265
9266 Returns the built-in scrollbar position.
9267 """
9268 return _core_.Window_GetScrollPos(*args, **kwargs)
9269
9270 def GetScrollThumb(*args, **kwargs):
9271 """
9272 GetScrollThumb(self, int orientation) -> int
9273
9274 Returns the built-in scrollbar thumb size.
9275 """
9276 return _core_.Window_GetScrollThumb(*args, **kwargs)
9277
9278 def GetScrollRange(*args, **kwargs):
9279 """
9280 GetScrollRange(self, int orientation) -> int
9281
9282 Returns the built-in scrollbar range.
9283 """
9284 return _core_.Window_GetScrollRange(*args, **kwargs)
9285
9286 def ScrollWindow(*args, **kwargs):
9287 """
9288 ScrollWindow(self, int dx, int dy, Rect rect=None)
9289
9290 Physically scrolls the pixels in the window and move child windows
9291 accordingly. Use this function to optimise your scrolling
9292 implementations, to minimise the area that must be redrawn. Note that
9293 it is rarely required to call this function from a user program.
9294 """
9295 return _core_.Window_ScrollWindow(*args, **kwargs)
9296
9297 def ScrollLines(*args, **kwargs):
9298 """
9299 ScrollLines(self, int lines) -> bool
9300
9301 If the platform and window class supports it, scrolls the window by
9302 the given number of lines down, if lines is positive, or up if lines
9303 is negative. Returns True if the window was scrolled, False if it was
9304 already on top/bottom and nothing was done.
9305 """
9306 return _core_.Window_ScrollLines(*args, **kwargs)
9307
9308 def ScrollPages(*args, **kwargs):
9309 """
9310 ScrollPages(self, int pages) -> bool
9311
9312 If the platform and window class supports it, scrolls the window by
9313 the given number of pages down, if pages is positive, or up if pages
9314 is negative. Returns True if the window was scrolled, False if it was
9315 already on top/bottom and nothing was done.
9316 """
9317 return _core_.Window_ScrollPages(*args, **kwargs)
9318
9319 def LineUp(*args, **kwargs):
9320 """
9321 LineUp(self) -> bool
9322
9323 This is just a wrapper for ScrollLines(-1).
9324 """
9325 return _core_.Window_LineUp(*args, **kwargs)
9326
9327 def LineDown(*args, **kwargs):
9328 """
9329 LineDown(self) -> bool
9330
9331 This is just a wrapper for ScrollLines(1).
9332 """
9333 return _core_.Window_LineDown(*args, **kwargs)
9334
9335 def PageUp(*args, **kwargs):
9336 """
9337 PageUp(self) -> bool
9338
9339 This is just a wrapper for ScrollPages(-1).
9340 """
9341 return _core_.Window_PageUp(*args, **kwargs)
9342
9343 def PageDown(*args, **kwargs):
9344 """
9345 PageDown(self) -> bool
9346
9347 This is just a wrapper for ScrollPages(1).
9348 """
9349 return _core_.Window_PageDown(*args, **kwargs)
9350
9351 def SetHelpText(*args, **kwargs):
9352 """
9353 SetHelpText(self, String text)
9354
9355 Sets the help text to be used as context-sensitive help for this
9356 window. Note that the text is actually stored by the current
9357 `wx.HelpProvider` implementation, and not in the window object itself.
9358 """
9359 return _core_.Window_SetHelpText(*args, **kwargs)
9360
9361 def SetHelpTextForId(*args, **kwargs):
9362 """
9363 SetHelpTextForId(self, String text)
9364
9365 Associate this help text with all windows with the same id as this
9366 one.
9367 """
9368 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9369
9370 def GetHelpText(*args, **kwargs):
9371 """
9372 GetHelpText(self) -> String
9373
9374 Gets the help text to be used as context-sensitive help for this
9375 window. Note that the text is actually stored by the current
9376 `wx.HelpProvider` implementation, and not in the window object itself.
9377 """
9378 return _core_.Window_GetHelpText(*args, **kwargs)
9379
9380 def SetToolTipString(*args, **kwargs):
9381 """
9382 SetToolTipString(self, String tip)
9383
9384 Attach a tooltip to the window.
9385 """
9386 return _core_.Window_SetToolTipString(*args, **kwargs)
9387
9388 def SetToolTip(*args, **kwargs):
9389 """
9390 SetToolTip(self, ToolTip tip)
9391
9392 Attach a tooltip to the window.
9393 """
9394 return _core_.Window_SetToolTip(*args, **kwargs)
9395
9396 def GetToolTip(*args, **kwargs):
9397 """
9398 GetToolTip(self) -> ToolTip
9399
9400 get the associated tooltip or None if none
9401 """
9402 return _core_.Window_GetToolTip(*args, **kwargs)
9403
9404 def SetDropTarget(*args, **kwargs):
9405 """
9406 SetDropTarget(self, DropTarget dropTarget)
9407
9408 Associates a drop target with this window. If the window already has
9409 a drop target, it is deleted.
9410 """
9411 return _core_.Window_SetDropTarget(*args, **kwargs)
9412
9413 def GetDropTarget(*args, **kwargs):
9414 """
9415 GetDropTarget(self) -> DropTarget
9416
9417 Returns the associated drop target, which may be None.
9418 """
9419 return _core_.Window_GetDropTarget(*args, **kwargs)
9420
9421 def DragAcceptFiles(*args, **kwargs):
9422 """
9423 DragAcceptFiles(self, bool accept)
9424
9425 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9426 Only functional on Windows.
9427 """
9428 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9429
9430 def SetConstraints(*args, **kwargs):
9431 """
9432 SetConstraints(self, LayoutConstraints constraints)
9433
9434 Sets the window to have the given layout constraints. If an existing
9435 layout constraints object is already owned by the window, it will be
9436 deleted. Pass None to disassociate and delete the window's current
9437 constraints.
9438
9439 You must call SetAutoLayout to tell a window to use the constraints
9440 automatically in its default EVT_SIZE handler; otherwise, you must
9441 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9442 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9443 effect.
9444 """
9445 return _core_.Window_SetConstraints(*args, **kwargs)
9446
9447 def GetConstraints(*args, **kwargs):
9448 """
9449 GetConstraints(self) -> LayoutConstraints
9450
9451 Returns a pointer to the window's layout constraints, or None if there
9452 are none.
9453 """
9454 return _core_.Window_GetConstraints(*args, **kwargs)
9455
9456 def SetAutoLayout(*args, **kwargs):
9457 """
9458 SetAutoLayout(self, bool autoLayout)
9459
9460 Determines whether the Layout function will be called automatically
9461 when the window is resized. lease note that this only happens for the
9462 windows usually used to contain children, namely `wx.Panel` and
9463 `wx.TopLevelWindow` (and the classes deriving from them).
9464
9465 This method is called implicitly by `SetSizer` but if you use
9466 `SetConstraints` you should call it manually or otherwise the window
9467 layout won't be correctly updated when its size changes.
9468 """
9469 return _core_.Window_SetAutoLayout(*args, **kwargs)
9470
9471 def GetAutoLayout(*args, **kwargs):
9472 """
9473 GetAutoLayout(self) -> bool
9474
9475 Returns the current autoLayout setting
9476 """
9477 return _core_.Window_GetAutoLayout(*args, **kwargs)
9478
9479 def Layout(*args, **kwargs):
9480 """
9481 Layout(self) -> bool
9482
9483 Invokes the constraint-based layout algorithm or the sizer-based
9484 algorithm for this window. See SetAutoLayout: when auto layout is on,
9485 this function gets called automatically by the default EVT_SIZE
9486 handler when the window is resized.
9487 """
9488 return _core_.Window_Layout(*args, **kwargs)
9489
9490 def SetSizer(*args, **kwargs):
9491 """
9492 SetSizer(self, Sizer sizer, bool deleteOld=True)
9493
9494 Sets the window to have the given layout sizer. The window will then
9495 own the object, and will take care of its deletion. If an existing
9496 layout sizer object is already owned by the window, it will be deleted
9497 if the deleteOld parameter is true. Note that this function will also
9498 call SetAutoLayout implicitly with a True parameter if the sizer is
9499 non-None, and False otherwise.
9500 """
9501 return _core_.Window_SetSizer(*args, **kwargs)
9502
9503 def SetSizerAndFit(*args, **kwargs):
9504 """
9505 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9506
9507 The same as SetSizer, except it also sets the size hints for the
9508 window based on the sizer's minimum size.
9509 """
9510 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9511
9512 def GetSizer(*args, **kwargs):
9513 """
9514 GetSizer(self) -> Sizer
9515
9516 Return the sizer associated with the window by a previous call to
9517 SetSizer or None if there isn't one.
9518 """
9519 return _core_.Window_GetSizer(*args, **kwargs)
9520
9521 def SetContainingSizer(*args, **kwargs):
9522 """
9523 SetContainingSizer(self, Sizer sizer)
9524
9525 This normally does not need to be called by application code. It is
9526 called internally when a window is added to a sizer, and is used so
9527 the window can remove itself from the sizer when it is destroyed.
9528 """
9529 return _core_.Window_SetContainingSizer(*args, **kwargs)
9530
9531 def GetContainingSizer(*args, **kwargs):
9532 """
9533 GetContainingSizer(self) -> Sizer
9534
9535 Return the sizer that this window is a member of, if any, otherwise None.
9536 """
9537 return _core_.Window_GetContainingSizer(*args, **kwargs)
9538
9539 def InheritAttributes(*args, **kwargs):
9540 """
9541 InheritAttributes(self)
9542
9543 This function is (or should be, in case of custom controls) called
9544 during window creation to intelligently set up the window visual
9545 attributes, that is the font and the foreground and background
9546 colours.
9547
9548 By 'intelligently' the following is meant: by default, all windows use
9549 their own default attributes. However if some of the parent's
9550 attributes are explicitly changed (that is, using SetFont and not
9551 SetOwnFont) and if the corresponding attribute hadn't been
9552 explicitly set for this window itself, then this window takes the same
9553 value as used by the parent. In addition, if the window overrides
9554 ShouldInheritColours to return false, the colours will not be changed
9555 no matter what and only the font might.
9556
9557 This rather complicated logic is necessary in order to accommodate the
9558 different usage scenarios. The most common one is when all default
9559 attributes are used and in this case, nothing should be inherited as
9560 in modern GUIs different controls use different fonts (and colours)
9561 than their siblings so they can't inherit the same value from the
9562 parent. However it was also deemed desirable to allow to simply change
9563 the attributes of all children at once by just changing the font or
9564 colour of their common parent, hence in this case we do inherit the
9565 parents attributes.
9566
9567 """
9568 return _core_.Window_InheritAttributes(*args, **kwargs)
9569
9570 def ShouldInheritColours(*args, **kwargs):
9571 """
9572 ShouldInheritColours(self) -> bool
9573
9574 Return true from here to allow the colours of this window to be
9575 changed by InheritAttributes, returning false forbids inheriting them
9576 from the parent window.
9577
9578 The base class version returns false, but this method is overridden in
9579 wxControl where it returns true.
9580 """
9581 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9582
9583 def PostCreate(self, pre):
9584 """
9585 Phase 3 of the 2-phase create <wink!>
9586 Call this method after precreating the window with the 2-phase create method.
9587 """
9588 self.this = pre.this
9589 self.thisown = pre.thisown
9590 pre.thisown = 0
9591 if hasattr(self, '_setOORInfo'):
9592 self._setOORInfo(self)
9593 if hasattr(self, '_setCallbackInfo'):
9594 self._setCallbackInfo(self, self.__class__)
9595
9596 def SendSizeEvent(self):
9597 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9598
9599 Window_swigregister = _core_.Window_swigregister
9600 Window_swigregister(Window)
9601
9602 def PreWindow(*args, **kwargs):
9603 """
9604 PreWindow() -> Window
9605
9606 Precreate a Window for 2-phase creation.
9607 """
9608 val = _core_.new_PreWindow(*args, **kwargs)
9609 return val
9610
9611 def Window_NewControlId(*args):
9612 """
9613 Window_NewControlId() -> int
9614
9615 Generate a control id for the controls which were not given one.
9616 """
9617 return _core_.Window_NewControlId(*args)
9618
9619 def Window_NextControlId(*args, **kwargs):
9620 """
9621 Window_NextControlId(int winid) -> int
9622
9623 Get the id of the control following the one with the given
9624 autogenerated) id
9625 """
9626 return _core_.Window_NextControlId(*args, **kwargs)
9627
9628 def Window_PrevControlId(*args, **kwargs):
9629 """
9630 Window_PrevControlId(int winid) -> int
9631
9632 Get the id of the control preceding the one with the given
9633 autogenerated) id
9634 """
9635 return _core_.Window_PrevControlId(*args, **kwargs)
9636
9637 def Window_FindFocus(*args):
9638 """
9639 Window_FindFocus() -> Window
9640
9641 Returns the window or control that currently has the keyboard focus,
9642 or None.
9643 """
9644 return _core_.Window_FindFocus(*args)
9645
9646 def Window_GetCapture(*args):
9647 """
9648 Window_GetCapture() -> Window
9649
9650 Returns the window which currently captures the mouse or None
9651 """
9652 return _core_.Window_GetCapture(*args)
9653
9654 def Window_GetClassDefaultAttributes(*args, **kwargs):
9655 """
9656 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9657
9658 Get the default attributes for this class. This is useful if you want
9659 to use the same font or colour in your own control as in a standard
9660 control -- which is a much better idea than hard coding specific
9661 colours or fonts which might look completely out of place on the
9662 user's system, especially if it uses themes.
9663
9664 The variant parameter is only relevant under Mac currently and is
9665 ignore under other platforms. Under Mac, it will change the size of
9666 the returned font. See `wx.Window.SetWindowVariant` for more about
9667 this.
9668 """
9669 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9670
9671 def DLG_PNT(win, point_or_x, y=None):
9672 """
9673 Convenience function for converting a Point or (x,y) in
9674 dialog units to pixel units.
9675 """
9676 if y is None:
9677 return win.ConvertDialogPointToPixels(point_or_x)
9678 else:
9679 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9680
9681 def DLG_SZE(win, size_width, height=None):
9682 """
9683 Convenience function for converting a Size or (w,h) in
9684 dialog units to pixel units.
9685 """
9686 if height is None:
9687 return win.ConvertDialogSizeToPixels(size_width)
9688 else:
9689 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9690
9691
9692 def FindWindowById(*args, **kwargs):
9693 """
9694 FindWindowById(long id, Window parent=None) -> Window
9695
9696 Find the first window in the application with the given id. If parent
9697 is None, the search will start from all top-level frames and dialog
9698 boxes; if non-None, the search will be limited to the given window
9699 hierarchy. The search is recursive in both cases.
9700 """
9701 return _core_.FindWindowById(*args, **kwargs)
9702
9703 def FindWindowByName(*args, **kwargs):
9704 """
9705 FindWindowByName(String name, Window parent=None) -> Window
9706
9707 Find a window by its name (as given in a window constructor or Create
9708 function call). If parent is None, the search will start from all
9709 top-level frames and dialog boxes; if non-None, the search will be
9710 limited to the given window hierarchy. The search is recursive in both
9711 cases.
9712
9713 If no window with such name is found, wx.FindWindowByLabel is called.
9714 """
9715 return _core_.FindWindowByName(*args, **kwargs)
9716
9717 def FindWindowByLabel(*args, **kwargs):
9718 """
9719 FindWindowByLabel(String label, Window parent=None) -> Window
9720
9721 Find a window by its label. Depending on the type of window, the label
9722 may be a window title or panel item label. If parent is None, the
9723 search will start from all top-level frames and dialog boxes; if
9724 non-None, the search will be limited to the given window
9725 hierarchy. The search is recursive in both cases.
9726 """
9727 return _core_.FindWindowByLabel(*args, **kwargs)
9728
9729 def Window_FromHWND(*args, **kwargs):
9730 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9731 return _core_.Window_FromHWND(*args, **kwargs)
9732
9733 def GetTopLevelWindows(*args):
9734 """
9735 GetTopLevelWindows() -> PyObject
9736
9737 Returns a list of the the application's top-level windows, (frames,
9738 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9739 by wxWidgets, and so it is only valid as long as no top-level windows
9740 are closed or new top-level windows are created.
9741
9742 """
9743 return _core_.GetTopLevelWindows(*args)
9744 #---------------------------------------------------------------------------
9745
9746 class Validator(EvtHandler):
9747 """Proxy of C++ Validator class"""
9748 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9749 __repr__ = _swig_repr
9750 def __init__(self, *args, **kwargs):
9751 """__init__(self) -> Validator"""
9752 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9753 self._setOORInfo(self)
9754
9755 def Clone(*args, **kwargs):
9756 """Clone(self) -> Validator"""
9757 return _core_.Validator_Clone(*args, **kwargs)
9758
9759 def Validate(*args, **kwargs):
9760 """Validate(self, Window parent) -> bool"""
9761 return _core_.Validator_Validate(*args, **kwargs)
9762
9763 def TransferToWindow(*args, **kwargs):
9764 """TransferToWindow(self) -> bool"""
9765 return _core_.Validator_TransferToWindow(*args, **kwargs)
9766
9767 def TransferFromWindow(*args, **kwargs):
9768 """TransferFromWindow(self) -> bool"""
9769 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9770
9771 def GetWindow(*args, **kwargs):
9772 """GetWindow(self) -> Window"""
9773 return _core_.Validator_GetWindow(*args, **kwargs)
9774
9775 def SetWindow(*args, **kwargs):
9776 """SetWindow(self, Window window)"""
9777 return _core_.Validator_SetWindow(*args, **kwargs)
9778
9779 def IsSilent(*args, **kwargs):
9780 """IsSilent() -> bool"""
9781 return _core_.Validator_IsSilent(*args, **kwargs)
9782
9783 IsSilent = staticmethod(IsSilent)
9784 def SetBellOnError(*args, **kwargs):
9785 """SetBellOnError(int doIt=True)"""
9786 return _core_.Validator_SetBellOnError(*args, **kwargs)
9787
9788 SetBellOnError = staticmethod(SetBellOnError)
9789 Validator_swigregister = _core_.Validator_swigregister
9790 Validator_swigregister(Validator)
9791
9792 def Validator_IsSilent(*args):
9793 """Validator_IsSilent() -> bool"""
9794 return _core_.Validator_IsSilent(*args)
9795
9796 def Validator_SetBellOnError(*args, **kwargs):
9797 """Validator_SetBellOnError(int doIt=True)"""
9798 return _core_.Validator_SetBellOnError(*args, **kwargs)
9799
9800 class PyValidator(Validator):
9801 """Proxy of C++ PyValidator class"""
9802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9803 __repr__ = _swig_repr
9804 def __init__(self, *args, **kwargs):
9805 """__init__(self) -> PyValidator"""
9806 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9807
9808 self._setCallbackInfo(self, PyValidator, 1)
9809 self._setOORInfo(self)
9810
9811 def _setCallbackInfo(*args, **kwargs):
9812 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9813 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9814
9815 PyValidator_swigregister = _core_.PyValidator_swigregister
9816 PyValidator_swigregister(PyValidator)
9817
9818 #---------------------------------------------------------------------------
9819
9820 class Menu(EvtHandler):
9821 """Proxy of C++ Menu class"""
9822 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9823 __repr__ = _swig_repr
9824 def __init__(self, *args, **kwargs):
9825 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9826 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9827 self._setOORInfo(self)
9828
9829 def Append(*args, **kwargs):
9830 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9831 return _core_.Menu_Append(*args, **kwargs)
9832
9833 def AppendSeparator(*args, **kwargs):
9834 """AppendSeparator(self) -> MenuItem"""
9835 return _core_.Menu_AppendSeparator(*args, **kwargs)
9836
9837 def AppendCheckItem(*args, **kwargs):
9838 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9839 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9840
9841 def AppendRadioItem(*args, **kwargs):
9842 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9843 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9844
9845 def AppendMenu(*args, **kwargs):
9846 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9847 return _core_.Menu_AppendMenu(*args, **kwargs)
9848
9849 def AppendSubMenu(*args, **kwargs):
9850 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9851 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9852
9853 def AppendItem(*args, **kwargs):
9854 """AppendItem(self, MenuItem item) -> MenuItem"""
9855 return _core_.Menu_AppendItem(*args, **kwargs)
9856
9857 def InsertItem(*args, **kwargs):
9858 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9859 return _core_.Menu_InsertItem(*args, **kwargs)
9860
9861 def PrependItem(*args, **kwargs):
9862 """PrependItem(self, MenuItem item) -> MenuItem"""
9863 return _core_.Menu_PrependItem(*args, **kwargs)
9864
9865 def Break(*args, **kwargs):
9866 """Break(self)"""
9867 return _core_.Menu_Break(*args, **kwargs)
9868
9869 def Insert(*args, **kwargs):
9870 """
9871 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9872 int kind=ITEM_NORMAL) -> MenuItem
9873 """
9874 return _core_.Menu_Insert(*args, **kwargs)
9875
9876 def InsertSeparator(*args, **kwargs):
9877 """InsertSeparator(self, size_t pos) -> MenuItem"""
9878 return _core_.Menu_InsertSeparator(*args, **kwargs)
9879
9880 def InsertCheckItem(*args, **kwargs):
9881 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9882 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9883
9884 def InsertRadioItem(*args, **kwargs):
9885 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9886 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9887
9888 def InsertMenu(*args, **kwargs):
9889 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9890 return _core_.Menu_InsertMenu(*args, **kwargs)
9891
9892 def Prepend(*args, **kwargs):
9893 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9894 return _core_.Menu_Prepend(*args, **kwargs)
9895
9896 def PrependSeparator(*args, **kwargs):
9897 """PrependSeparator(self) -> MenuItem"""
9898 return _core_.Menu_PrependSeparator(*args, **kwargs)
9899
9900 def PrependCheckItem(*args, **kwargs):
9901 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9902 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9903
9904 def PrependRadioItem(*args, **kwargs):
9905 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9906 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9907
9908 def PrependMenu(*args, **kwargs):
9909 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9910 return _core_.Menu_PrependMenu(*args, **kwargs)
9911
9912 def Remove(*args, **kwargs):
9913 """Remove(self, int id) -> MenuItem"""
9914 return _core_.Menu_Remove(*args, **kwargs)
9915
9916 def RemoveItem(*args, **kwargs):
9917 """RemoveItem(self, MenuItem item) -> MenuItem"""
9918 return _core_.Menu_RemoveItem(*args, **kwargs)
9919
9920 def Delete(*args, **kwargs):
9921 """Delete(self, int id) -> bool"""
9922 return _core_.Menu_Delete(*args, **kwargs)
9923
9924 def DeleteItem(*args, **kwargs):
9925 """DeleteItem(self, MenuItem item) -> bool"""
9926 return _core_.Menu_DeleteItem(*args, **kwargs)
9927
9928 def Destroy(*args, **kwargs):
9929 """
9930 Destroy(self)
9931
9932 Deletes the C++ object this Python object is a proxy for.
9933 """
9934 val = _core_.Menu_Destroy(*args, **kwargs)
9935 args[0].thisown = 0
9936 return val
9937
9938 def DestroyId(*args, **kwargs):
9939 """
9940 DestroyId(self, int id) -> bool
9941
9942 Deletes the C++ object this Python object is a proxy for.
9943 """
9944 val = _core_.Menu_DestroyId(*args, **kwargs)
9945 args[0].thisown = 0
9946 return val
9947
9948 def DestroyItem(*args, **kwargs):
9949 """
9950 DestroyItem(self, MenuItem item) -> bool
9951
9952 Deletes the C++ object this Python object is a proxy for.
9953 """
9954 val = _core_.Menu_DestroyItem(*args, **kwargs)
9955 args[0].thisown = 0
9956 return val
9957
9958 def GetMenuItemCount(*args, **kwargs):
9959 """GetMenuItemCount(self) -> size_t"""
9960 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9961
9962 def GetMenuItems(*args, **kwargs):
9963 """GetMenuItems(self) -> PyObject"""
9964 return _core_.Menu_GetMenuItems(*args, **kwargs)
9965
9966 def FindItem(*args, **kwargs):
9967 """FindItem(self, String item) -> int"""
9968 return _core_.Menu_FindItem(*args, **kwargs)
9969
9970 def FindItemById(*args, **kwargs):
9971 """FindItemById(self, int id) -> MenuItem"""
9972 return _core_.Menu_FindItemById(*args, **kwargs)
9973
9974 def FindItemByPosition(*args, **kwargs):
9975 """FindItemByPosition(self, size_t position) -> MenuItem"""
9976 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9977
9978 def Enable(*args, **kwargs):
9979 """Enable(self, int id, bool enable)"""
9980 return _core_.Menu_Enable(*args, **kwargs)
9981
9982 def IsEnabled(*args, **kwargs):
9983 """IsEnabled(self, int id) -> bool"""
9984 return _core_.Menu_IsEnabled(*args, **kwargs)
9985
9986 def Check(*args, **kwargs):
9987 """Check(self, int id, bool check)"""
9988 return _core_.Menu_Check(*args, **kwargs)
9989
9990 def IsChecked(*args, **kwargs):
9991 """IsChecked(self, int id) -> bool"""
9992 return _core_.Menu_IsChecked(*args, **kwargs)
9993
9994 def SetLabel(*args, **kwargs):
9995 """SetLabel(self, int id, String label)"""
9996 return _core_.Menu_SetLabel(*args, **kwargs)
9997
9998 def GetLabel(*args, **kwargs):
9999 """GetLabel(self, int id) -> String"""
10000 return _core_.Menu_GetLabel(*args, **kwargs)
10001
10002 def SetHelpString(*args, **kwargs):
10003 """SetHelpString(self, int id, String helpString)"""
10004 return _core_.Menu_SetHelpString(*args, **kwargs)
10005
10006 def GetHelpString(*args, **kwargs):
10007 """GetHelpString(self, int id) -> String"""
10008 return _core_.Menu_GetHelpString(*args, **kwargs)
10009
10010 def SetTitle(*args, **kwargs):
10011 """SetTitle(self, String title)"""
10012 return _core_.Menu_SetTitle(*args, **kwargs)
10013
10014 def GetTitle(*args, **kwargs):
10015 """GetTitle(self) -> String"""
10016 return _core_.Menu_GetTitle(*args, **kwargs)
10017
10018 def SetEventHandler(*args, **kwargs):
10019 """SetEventHandler(self, EvtHandler handler)"""
10020 return _core_.Menu_SetEventHandler(*args, **kwargs)
10021
10022 def GetEventHandler(*args, **kwargs):
10023 """GetEventHandler(self) -> EvtHandler"""
10024 return _core_.Menu_GetEventHandler(*args, **kwargs)
10025
10026 def SetInvokingWindow(*args, **kwargs):
10027 """SetInvokingWindow(self, Window win)"""
10028 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10029
10030 def GetInvokingWindow(*args, **kwargs):
10031 """GetInvokingWindow(self) -> Window"""
10032 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10033
10034 def GetStyle(*args, **kwargs):
10035 """GetStyle(self) -> long"""
10036 return _core_.Menu_GetStyle(*args, **kwargs)
10037
10038 def UpdateUI(*args, **kwargs):
10039 """UpdateUI(self, EvtHandler source=None)"""
10040 return _core_.Menu_UpdateUI(*args, **kwargs)
10041
10042 def GetMenuBar(*args, **kwargs):
10043 """GetMenuBar(self) -> MenuBar"""
10044 return _core_.Menu_GetMenuBar(*args, **kwargs)
10045
10046 def Attach(*args, **kwargs):
10047 """Attach(self, wxMenuBarBase menubar)"""
10048 return _core_.Menu_Attach(*args, **kwargs)
10049
10050 def Detach(*args, **kwargs):
10051 """Detach(self)"""
10052 return _core_.Menu_Detach(*args, **kwargs)
10053
10054 def IsAttached(*args, **kwargs):
10055 """IsAttached(self) -> bool"""
10056 return _core_.Menu_IsAttached(*args, **kwargs)
10057
10058 def SetParent(*args, **kwargs):
10059 """SetParent(self, Menu parent)"""
10060 return _core_.Menu_SetParent(*args, **kwargs)
10061
10062 def GetParent(*args, **kwargs):
10063 """GetParent(self) -> Menu"""
10064 return _core_.Menu_GetParent(*args, **kwargs)
10065
10066 Menu_swigregister = _core_.Menu_swigregister
10067 Menu_swigregister(Menu)
10068 DefaultValidator = cvar.DefaultValidator
10069
10070 #---------------------------------------------------------------------------
10071
10072 class MenuBar(Window):
10073 """Proxy of C++ MenuBar class"""
10074 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10075 __repr__ = _swig_repr
10076 def __init__(self, *args, **kwargs):
10077 """__init__(self, long style=0) -> MenuBar"""
10078 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10079 self._setOORInfo(self)
10080
10081 def Append(*args, **kwargs):
10082 """Append(self, Menu menu, String title) -> bool"""
10083 return _core_.MenuBar_Append(*args, **kwargs)
10084
10085 def Insert(*args, **kwargs):
10086 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10087 return _core_.MenuBar_Insert(*args, **kwargs)
10088
10089 def GetMenuCount(*args, **kwargs):
10090 """GetMenuCount(self) -> size_t"""
10091 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10092
10093 def GetMenu(*args, **kwargs):
10094 """GetMenu(self, size_t pos) -> Menu"""
10095 return _core_.MenuBar_GetMenu(*args, **kwargs)
10096
10097 def Replace(*args, **kwargs):
10098 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10099 return _core_.MenuBar_Replace(*args, **kwargs)
10100
10101 def Remove(*args, **kwargs):
10102 """Remove(self, size_t pos) -> Menu"""
10103 return _core_.MenuBar_Remove(*args, **kwargs)
10104
10105 def EnableTop(*args, **kwargs):
10106 """EnableTop(self, size_t pos, bool enable)"""
10107 return _core_.MenuBar_EnableTop(*args, **kwargs)
10108
10109 def IsEnabledTop(*args, **kwargs):
10110 """IsEnabledTop(self, size_t pos) -> bool"""
10111 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10112
10113 def SetLabelTop(*args, **kwargs):
10114 """SetLabelTop(self, size_t pos, String label)"""
10115 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10116
10117 def GetLabelTop(*args, **kwargs):
10118 """GetLabelTop(self, size_t pos) -> String"""
10119 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10120
10121 def FindMenuItem(*args, **kwargs):
10122 """FindMenuItem(self, String menu, String item) -> int"""
10123 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10124
10125 def FindItemById(*args, **kwargs):
10126 """FindItemById(self, int id) -> MenuItem"""
10127 return _core_.MenuBar_FindItemById(*args, **kwargs)
10128
10129 def FindMenu(*args, **kwargs):
10130 """FindMenu(self, String title) -> int"""
10131 return _core_.MenuBar_FindMenu(*args, **kwargs)
10132
10133 def Enable(*args, **kwargs):
10134 """Enable(self, int id, bool enable)"""
10135 return _core_.MenuBar_Enable(*args, **kwargs)
10136
10137 def Check(*args, **kwargs):
10138 """Check(self, int id, bool check)"""
10139 return _core_.MenuBar_Check(*args, **kwargs)
10140
10141 def IsChecked(*args, **kwargs):
10142 """IsChecked(self, int id) -> bool"""
10143 return _core_.MenuBar_IsChecked(*args, **kwargs)
10144
10145 def IsEnabled(*args, **kwargs):
10146 """IsEnabled(self, int id) -> bool"""
10147 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10148
10149 def SetLabel(*args, **kwargs):
10150 """SetLabel(self, int id, String label)"""
10151 return _core_.MenuBar_SetLabel(*args, **kwargs)
10152
10153 def GetLabel(*args, **kwargs):
10154 """GetLabel(self, int id) -> String"""
10155 return _core_.MenuBar_GetLabel(*args, **kwargs)
10156
10157 def SetHelpString(*args, **kwargs):
10158 """SetHelpString(self, int id, String helpString)"""
10159 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10160
10161 def GetHelpString(*args, **kwargs):
10162 """GetHelpString(self, int id) -> String"""
10163 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10164
10165 def GetFrame(*args, **kwargs):
10166 """GetFrame(self) -> wxFrame"""
10167 return _core_.MenuBar_GetFrame(*args, **kwargs)
10168
10169 def IsAttached(*args, **kwargs):
10170 """IsAttached(self) -> bool"""
10171 return _core_.MenuBar_IsAttached(*args, **kwargs)
10172
10173 def Attach(*args, **kwargs):
10174 """Attach(self, wxFrame frame)"""
10175 return _core_.MenuBar_Attach(*args, **kwargs)
10176
10177 def Detach(*args, **kwargs):
10178 """Detach(self)"""
10179 return _core_.MenuBar_Detach(*args, **kwargs)
10180
10181 def SetAutoWindowMenu(*args, **kwargs):
10182 """SetAutoWindowMenu(bool enable)"""
10183 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10184
10185 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10186 def GetAutoWindowMenu(*args, **kwargs):
10187 """GetAutoWindowMenu() -> bool"""
10188 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10189
10190 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10191 MenuBar_swigregister = _core_.MenuBar_swigregister
10192 MenuBar_swigregister(MenuBar)
10193
10194 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10195 """MenuBar_SetAutoWindowMenu(bool enable)"""
10196 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10197
10198 def MenuBar_GetAutoWindowMenu(*args):
10199 """MenuBar_GetAutoWindowMenu() -> bool"""
10200 return _core_.MenuBar_GetAutoWindowMenu(*args)
10201
10202 #---------------------------------------------------------------------------
10203
10204 class MenuItem(Object):
10205 """Proxy of C++ MenuItem class"""
10206 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10207 __repr__ = _swig_repr
10208 def __init__(self, *args, **kwargs):
10209 """
10210 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10211 String help=EmptyString, int kind=ITEM_NORMAL,
10212 Menu subMenu=None) -> MenuItem
10213 """
10214 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10215 __swig_destroy__ = _core_.delete_MenuItem
10216 __del__ = lambda self : None;
10217 def GetMenu(*args, **kwargs):
10218 """GetMenu(self) -> Menu"""
10219 return _core_.MenuItem_GetMenu(*args, **kwargs)
10220
10221 def SetMenu(*args, **kwargs):
10222 """SetMenu(self, Menu menu)"""
10223 return _core_.MenuItem_SetMenu(*args, **kwargs)
10224
10225 def SetId(*args, **kwargs):
10226 """SetId(self, int id)"""
10227 return _core_.MenuItem_SetId(*args, **kwargs)
10228
10229 def GetId(*args, **kwargs):
10230 """GetId(self) -> int"""
10231 return _core_.MenuItem_GetId(*args, **kwargs)
10232
10233 def IsSeparator(*args, **kwargs):
10234 """IsSeparator(self) -> bool"""
10235 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10236
10237 def SetText(*args, **kwargs):
10238 """SetText(self, String str)"""
10239 return _core_.MenuItem_SetText(*args, **kwargs)
10240
10241 def GetLabel(*args, **kwargs):
10242 """GetLabel(self) -> String"""
10243 return _core_.MenuItem_GetLabel(*args, **kwargs)
10244
10245 def GetText(*args, **kwargs):
10246 """GetText(self) -> String"""
10247 return _core_.MenuItem_GetText(*args, **kwargs)
10248
10249 def GetLabelFromText(*args, **kwargs):
10250 """GetLabelFromText(String text) -> String"""
10251 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10252
10253 GetLabelFromText = staticmethod(GetLabelFromText)
10254 def GetKind(*args, **kwargs):
10255 """GetKind(self) -> int"""
10256 return _core_.MenuItem_GetKind(*args, **kwargs)
10257
10258 def SetKind(*args, **kwargs):
10259 """SetKind(self, int kind)"""
10260 return _core_.MenuItem_SetKind(*args, **kwargs)
10261
10262 def SetCheckable(*args, **kwargs):
10263 """SetCheckable(self, bool checkable)"""
10264 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10265
10266 def IsCheckable(*args, **kwargs):
10267 """IsCheckable(self) -> bool"""
10268 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10269
10270 def IsSubMenu(*args, **kwargs):
10271 """IsSubMenu(self) -> bool"""
10272 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10273
10274 def SetSubMenu(*args, **kwargs):
10275 """SetSubMenu(self, Menu menu)"""
10276 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10277
10278 def GetSubMenu(*args, **kwargs):
10279 """GetSubMenu(self) -> Menu"""
10280 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10281
10282 def Enable(*args, **kwargs):
10283 """Enable(self, bool enable=True)"""
10284 return _core_.MenuItem_Enable(*args, **kwargs)
10285
10286 def IsEnabled(*args, **kwargs):
10287 """IsEnabled(self) -> bool"""
10288 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10289
10290 def Check(*args, **kwargs):
10291 """Check(self, bool check=True)"""
10292 return _core_.MenuItem_Check(*args, **kwargs)
10293
10294 def IsChecked(*args, **kwargs):
10295 """IsChecked(self) -> bool"""
10296 return _core_.MenuItem_IsChecked(*args, **kwargs)
10297
10298 def Toggle(*args, **kwargs):
10299 """Toggle(self)"""
10300 return _core_.MenuItem_Toggle(*args, **kwargs)
10301
10302 def SetHelp(*args, **kwargs):
10303 """SetHelp(self, String str)"""
10304 return _core_.MenuItem_SetHelp(*args, **kwargs)
10305
10306 def GetHelp(*args, **kwargs):
10307 """GetHelp(self) -> String"""
10308 return _core_.MenuItem_GetHelp(*args, **kwargs)
10309
10310 def GetAccel(*args, **kwargs):
10311 """GetAccel(self) -> AcceleratorEntry"""
10312 return _core_.MenuItem_GetAccel(*args, **kwargs)
10313
10314 def SetAccel(*args, **kwargs):
10315 """SetAccel(self, AcceleratorEntry accel)"""
10316 return _core_.MenuItem_SetAccel(*args, **kwargs)
10317
10318 def SetBitmap(*args, **kwargs):
10319 """SetBitmap(self, Bitmap bitmap)"""
10320 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10321
10322 def GetBitmap(*args, **kwargs):
10323 """GetBitmap(self) -> Bitmap"""
10324 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10325
10326 def SetFont(*args, **kwargs):
10327 """SetFont(self, Font font)"""
10328 return _core_.MenuItem_SetFont(*args, **kwargs)
10329
10330 def GetFont(*args, **kwargs):
10331 """GetFont(self) -> Font"""
10332 return _core_.MenuItem_GetFont(*args, **kwargs)
10333
10334 def SetTextColour(*args, **kwargs):
10335 """SetTextColour(self, Colour colText)"""
10336 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10337
10338 def GetTextColour(*args, **kwargs):
10339 """GetTextColour(self) -> Colour"""
10340 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10341
10342 def SetBackgroundColour(*args, **kwargs):
10343 """SetBackgroundColour(self, Colour colBack)"""
10344 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10345
10346 def GetBackgroundColour(*args, **kwargs):
10347 """GetBackgroundColour(self) -> Colour"""
10348 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10349
10350 def SetBitmaps(*args, **kwargs):
10351 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10352 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10353
10354 def SetDisabledBitmap(*args, **kwargs):
10355 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10356 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10357
10358 def GetDisabledBitmap(*args, **kwargs):
10359 """GetDisabledBitmap(self) -> Bitmap"""
10360 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10361
10362 def SetMarginWidth(*args, **kwargs):
10363 """SetMarginWidth(self, int nWidth)"""
10364 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10365
10366 def GetMarginWidth(*args, **kwargs):
10367 """GetMarginWidth(self) -> int"""
10368 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10369
10370 def GetDefaultMarginWidth(*args, **kwargs):
10371 """GetDefaultMarginWidth() -> int"""
10372 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10373
10374 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10375 def IsOwnerDrawn(*args, **kwargs):
10376 """IsOwnerDrawn(self) -> bool"""
10377 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10378
10379 def SetOwnerDrawn(*args, **kwargs):
10380 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10381 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10382
10383 def ResetOwnerDrawn(*args, **kwargs):
10384 """ResetOwnerDrawn(self)"""
10385 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10386
10387 MenuItem_swigregister = _core_.MenuItem_swigregister
10388 MenuItem_swigregister(MenuItem)
10389
10390 def MenuItem_GetLabelFromText(*args, **kwargs):
10391 """MenuItem_GetLabelFromText(String text) -> String"""
10392 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10393
10394 def MenuItem_GetDefaultMarginWidth(*args):
10395 """MenuItem_GetDefaultMarginWidth() -> int"""
10396 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10397
10398 #---------------------------------------------------------------------------
10399
10400 class Control(Window):
10401 """
10402 This is the base class for a control or 'widget'.
10403
10404 A control is generally a small window which processes user input
10405 and/or displays one or more item of data.
10406 """
10407 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10408 __repr__ = _swig_repr
10409 def __init__(self, *args, **kwargs):
10410 """
10411 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10412 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10413 String name=ControlNameStr) -> Control
10414
10415 Create a Control. Normally you should only call this from a subclass'
10416 __init__ as a plain old wx.Control is not very useful.
10417 """
10418 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10419 self._setOORInfo(self)
10420
10421 def Create(*args, **kwargs):
10422 """
10423 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10424 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10425 String name=ControlNameStr) -> bool
10426
10427 Do the 2nd phase and create the GUI control.
10428 """
10429 return _core_.Control_Create(*args, **kwargs)
10430
10431 def Command(*args, **kwargs):
10432 """
10433 Command(self, CommandEvent event)
10434
10435 Simulates the effect of the user issuing a command to the item.
10436
10437 :see: `wx.CommandEvent`
10438
10439 """
10440 return _core_.Control_Command(*args, **kwargs)
10441
10442 def GetLabel(*args, **kwargs):
10443 """
10444 GetLabel(self) -> String
10445
10446 Return a control's text.
10447 """
10448 return _core_.Control_GetLabel(*args, **kwargs)
10449
10450 def GetClassDefaultAttributes(*args, **kwargs):
10451 """
10452 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10453
10454 Get the default attributes for this class. This is useful if you want
10455 to use the same font or colour in your own control as in a standard
10456 control -- which is a much better idea than hard coding specific
10457 colours or fonts which might look completely out of place on the
10458 user's system, especially if it uses themes.
10459
10460 The variant parameter is only relevant under Mac currently and is
10461 ignore under other platforms. Under Mac, it will change the size of
10462 the returned font. See `wx.Window.SetWindowVariant` for more about
10463 this.
10464 """
10465 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10466
10467 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10468 Control_swigregister = _core_.Control_swigregister
10469 Control_swigregister(Control)
10470 ControlNameStr = cvar.ControlNameStr
10471
10472 def PreControl(*args, **kwargs):
10473 """
10474 PreControl() -> Control
10475
10476 Precreate a Control control for 2-phase creation
10477 """
10478 val = _core_.new_PreControl(*args, **kwargs)
10479 return val
10480
10481 def Control_GetClassDefaultAttributes(*args, **kwargs):
10482 """
10483 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10484
10485 Get the default attributes for this class. This is useful if you want
10486 to use the same font or colour in your own control as in a standard
10487 control -- which is a much better idea than hard coding specific
10488 colours or fonts which might look completely out of place on the
10489 user's system, especially if it uses themes.
10490
10491 The variant parameter is only relevant under Mac currently and is
10492 ignore under other platforms. Under Mac, it will change the size of
10493 the returned font. See `wx.Window.SetWindowVariant` for more about
10494 this.
10495 """
10496 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10497
10498 #---------------------------------------------------------------------------
10499
10500 class ItemContainer(object):
10501 """
10502 The wx.ItemContainer class defines an interface which is implemented
10503 by all controls which have string subitems, each of which may be
10504 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10505 as `wx.ComboBox` which implements an extended interface deriving from
10506 this one.
10507
10508 It defines the methods for accessing the control's items and although
10509 each of the derived classes implements them differently, they still
10510 all conform to the same interface.
10511
10512 The items in a wx.ItemContainer have (non empty) string labels and,
10513 optionally, client data associated with them.
10514
10515 """
10516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10517 def __init__(self): raise AttributeError, "No constructor defined"
10518 __repr__ = _swig_repr
10519 def Append(*args, **kwargs):
10520 """
10521 Append(self, String item, PyObject clientData=None) -> int
10522
10523 Adds the item to the control, associating the given data with the item
10524 if not None. The return value is the index of the newly added item
10525 which may be different from the last one if the control is sorted (e.g.
10526 has wx.LB_SORT or wx.CB_SORT style).
10527 """
10528 return _core_.ItemContainer_Append(*args, **kwargs)
10529
10530 def AppendItems(*args, **kwargs):
10531 """
10532 AppendItems(self, List strings)
10533
10534 Apend several items at once to the control. Notice that calling this
10535 method may be much faster than appending the items one by one if you
10536 need to add a lot of items.
10537 """
10538 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10539
10540 def Insert(*args, **kwargs):
10541 """
10542 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10543
10544 Insert an item into the control before the item at the ``pos`` index,
10545 optionally associating some data object with the item.
10546 """
10547 return _core_.ItemContainer_Insert(*args, **kwargs)
10548
10549 def Clear(*args, **kwargs):
10550 """
10551 Clear(self)
10552
10553 Removes all items from the control.
10554 """
10555 return _core_.ItemContainer_Clear(*args, **kwargs)
10556
10557 def Delete(*args, **kwargs):
10558 """
10559 Delete(self, unsigned int n)
10560
10561 Deletes the item at the zero-based index 'n' from the control. Note
10562 that it is an error (signalled by a `wx.PyAssertionError` exception if
10563 enabled) to remove an item with the index negative or greater or equal
10564 than the number of items in the control.
10565 """
10566 return _core_.ItemContainer_Delete(*args, **kwargs)
10567
10568 def GetClientData(*args, **kwargs):
10569 """
10570 GetClientData(self, unsigned int n) -> PyObject
10571
10572 Returns the client data associated with the given item, (if any.)
10573 """
10574 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10575
10576 def SetClientData(*args, **kwargs):
10577 """
10578 SetClientData(self, unsigned int n, PyObject clientData)
10579
10580 Associate the given client data with the item at position n.
10581 """
10582 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10583
10584 def GetCount(*args, **kwargs):
10585 """
10586 GetCount(self) -> unsigned int
10587
10588 Returns the number of items in the control.
10589 """
10590 return _core_.ItemContainer_GetCount(*args, **kwargs)
10591
10592 def IsEmpty(*args, **kwargs):
10593 """
10594 IsEmpty(self) -> bool
10595
10596 Returns True if the control is empty or False if it has some items.
10597 """
10598 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10599
10600 def GetString(*args, **kwargs):
10601 """
10602 GetString(self, unsigned int n) -> String
10603
10604 Returns the label of the item with the given index.
10605 """
10606 return _core_.ItemContainer_GetString(*args, **kwargs)
10607
10608 def GetStrings(*args, **kwargs):
10609 """GetStrings(self) -> wxArrayString"""
10610 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10611
10612 def SetString(*args, **kwargs):
10613 """
10614 SetString(self, unsigned int n, String s)
10615
10616 Sets the label for the given item.
10617 """
10618 return _core_.ItemContainer_SetString(*args, **kwargs)
10619
10620 def FindString(*args, **kwargs):
10621 """
10622 FindString(self, String s) -> int
10623
10624 Finds an item whose label matches the given string. Returns the
10625 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10626 found.
10627 """
10628 return _core_.ItemContainer_FindString(*args, **kwargs)
10629
10630 def SetSelection(*args, **kwargs):
10631 """
10632 SetSelection(self, int n)
10633
10634 Sets the item at index 'n' to be the selected item.
10635 """
10636 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10637
10638 def GetSelection(*args, **kwargs):
10639 """
10640 GetSelection(self) -> int
10641
10642 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10643 is selected.
10644 """
10645 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10646
10647 def SetStringSelection(*args, **kwargs):
10648 """SetStringSelection(self, String s) -> bool"""
10649 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10650
10651 def GetStringSelection(*args, **kwargs):
10652 """
10653 GetStringSelection(self) -> String
10654
10655 Returns the label of the selected item or an empty string if no item
10656 is selected.
10657 """
10658 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10659
10660 def Select(*args, **kwargs):
10661 """
10662 Select(self, int n)
10663
10664 This is the same as `SetSelection` and exists only because it is
10665 slightly more natural for controls which support multiple selection.
10666 """
10667 return _core_.ItemContainer_Select(*args, **kwargs)
10668
10669 ItemContainer_swigregister = _core_.ItemContainer_swigregister
10670 ItemContainer_swigregister(ItemContainer)
10671
10672 #---------------------------------------------------------------------------
10673
10674 class ControlWithItems(Control,ItemContainer):
10675 """
10676 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10677 wx.Control class, and is used for the base class of various controls
10678 that have items.
10679 """
10680 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10681 def __init__(self): raise AttributeError, "No constructor defined"
10682 __repr__ = _swig_repr
10683 ControlWithItems_swigregister = _core_.ControlWithItems_swigregister
10684 ControlWithItems_swigregister(ControlWithItems)
10685
10686 #---------------------------------------------------------------------------
10687
10688 class SizerItem(Object):
10689 """
10690 The wx.SizerItem class is used to track the position, size and other
10691 attributes of each item managed by a `wx.Sizer`. It is not usually
10692 necessary to use this class because the sizer elements can also be
10693 identified by their positions or window or sizer references but
10694 sometimes it may be more convenient to use wx.SizerItem directly.
10695 Also, custom classes derived from `wx.PySizer` will probably need to
10696 use the collection of wx.SizerItems held by wx.Sizer when calculating
10697 layout.
10698
10699 :see: `wx.Sizer`, `wx.GBSizerItem`
10700 """
10701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10702 __repr__ = _swig_repr
10703 def __init__(self, *args, **kwargs):
10704 """
10705 __init__(self) -> SizerItem
10706
10707 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10708 size will need to be set before this item can be used in a Sizer.
10709
10710 You will probably never need to create a wx.SizerItem directly as they
10711 are created automatically when the sizer's Add, Insert or Prepend
10712 methods are called.
10713
10714 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10715 """
10716 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10717 __swig_destroy__ = _core_.delete_SizerItem
10718 __del__ = lambda self : None;
10719 def DeleteWindows(*args, **kwargs):
10720 """
10721 DeleteWindows(self)
10722
10723 Destroy the window or the windows in a subsizer, depending on the type
10724 of item.
10725 """
10726 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10727
10728 def DetachSizer(*args, **kwargs):
10729 """
10730 DetachSizer(self)
10731
10732 Enable deleting the SizerItem without destroying the contained sizer.
10733 """
10734 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10735
10736 def GetSize(*args, **kwargs):
10737 """
10738 GetSize(self) -> Size
10739
10740 Get the current size of the item, as set in the last Layout.
10741 """
10742 return _core_.SizerItem_GetSize(*args, **kwargs)
10743
10744 def CalcMin(*args, **kwargs):
10745 """
10746 CalcMin(self) -> Size
10747
10748 Calculates the minimum desired size for the item, including any space
10749 needed by borders.
10750 """
10751 return _core_.SizerItem_CalcMin(*args, **kwargs)
10752
10753 def SetDimension(*args, **kwargs):
10754 """
10755 SetDimension(self, Point pos, Size size)
10756
10757 Set the position and size of the space allocated for this item by the
10758 sizer, and adjust the position and size of the item (window or
10759 subsizer) to be within that space taking alignment and borders into
10760 account.
10761 """
10762 return _core_.SizerItem_SetDimension(*args, **kwargs)
10763
10764 def GetMinSize(*args, **kwargs):
10765 """
10766 GetMinSize(self) -> Size
10767
10768 Get the minimum size needed for the item.
10769 """
10770 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10771
10772 def GetMinSizeWithBorder(*args, **kwargs):
10773 """
10774 GetMinSizeWithBorder(self) -> Size
10775
10776 Get the minimum size needed for the item with space for the borders
10777 added, if needed.
10778 """
10779 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10780
10781 def SetInitSize(*args, **kwargs):
10782 """SetInitSize(self, int x, int y)"""
10783 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10784
10785 def SetRatioWH(*args, **kwargs):
10786 """
10787 SetRatioWH(self, int width, int height)
10788
10789 Set the ratio item attribute.
10790 """
10791 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10792
10793 def SetRatioSize(*args, **kwargs):
10794 """
10795 SetRatioSize(self, Size size)
10796
10797 Set the ratio item attribute.
10798 """
10799 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10800
10801 def SetRatio(*args, **kwargs):
10802 """
10803 SetRatio(self, float ratio)
10804
10805 Set the ratio item attribute.
10806 """
10807 return _core_.SizerItem_SetRatio(*args, **kwargs)
10808
10809 def GetRatio(*args, **kwargs):
10810 """
10811 GetRatio(self) -> float
10812
10813 Set the ratio item attribute.
10814 """
10815 return _core_.SizerItem_GetRatio(*args, **kwargs)
10816
10817 def GetRect(*args, **kwargs):
10818 """
10819 GetRect(self) -> Rect
10820
10821 Returns the rectangle that the sizer item should occupy
10822 """
10823 return _core_.SizerItem_GetRect(*args, **kwargs)
10824
10825 def IsWindow(*args, **kwargs):
10826 """
10827 IsWindow(self) -> bool
10828
10829 Is this sizer item a window?
10830 """
10831 return _core_.SizerItem_IsWindow(*args, **kwargs)
10832
10833 def IsSizer(*args, **kwargs):
10834 """
10835 IsSizer(self) -> bool
10836
10837 Is this sizer item a subsizer?
10838 """
10839 return _core_.SizerItem_IsSizer(*args, **kwargs)
10840
10841 def IsSpacer(*args, **kwargs):
10842 """
10843 IsSpacer(self) -> bool
10844
10845 Is this sizer item a spacer?
10846 """
10847 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10848
10849 def SetProportion(*args, **kwargs):
10850 """
10851 SetProportion(self, int proportion)
10852
10853 Set the proportion value for this item.
10854 """
10855 return _core_.SizerItem_SetProportion(*args, **kwargs)
10856
10857 def GetProportion(*args, **kwargs):
10858 """
10859 GetProportion(self) -> int
10860
10861 Get the proportion value for this item.
10862 """
10863 return _core_.SizerItem_GetProportion(*args, **kwargs)
10864
10865 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10866 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10867 def SetFlag(*args, **kwargs):
10868 """
10869 SetFlag(self, int flag)
10870
10871 Set the flag value for this item.
10872 """
10873 return _core_.SizerItem_SetFlag(*args, **kwargs)
10874
10875 def GetFlag(*args, **kwargs):
10876 """
10877 GetFlag(self) -> int
10878
10879 Get the flag value for this item.
10880 """
10881 return _core_.SizerItem_GetFlag(*args, **kwargs)
10882
10883 def SetBorder(*args, **kwargs):
10884 """
10885 SetBorder(self, int border)
10886
10887 Set the border value for this item.
10888 """
10889 return _core_.SizerItem_SetBorder(*args, **kwargs)
10890
10891 def GetBorder(*args, **kwargs):
10892 """
10893 GetBorder(self) -> int
10894
10895 Get the border value for this item.
10896 """
10897 return _core_.SizerItem_GetBorder(*args, **kwargs)
10898
10899 def GetWindow(*args, **kwargs):
10900 """
10901 GetWindow(self) -> Window
10902
10903 Get the window (if any) that is managed by this sizer item.
10904 """
10905 return _core_.SizerItem_GetWindow(*args, **kwargs)
10906
10907 def SetWindow(*args, **kwargs):
10908 """
10909 SetWindow(self, Window window)
10910
10911 Set the window to be managed by this sizer item.
10912 """
10913 return _core_.SizerItem_SetWindow(*args, **kwargs)
10914
10915 def GetSizer(*args, **kwargs):
10916 """
10917 GetSizer(self) -> Sizer
10918
10919 Get the subsizer (if any) that is managed by this sizer item.
10920 """
10921 return _core_.SizerItem_GetSizer(*args, **kwargs)
10922
10923 def SetSizer(*args, **kwargs):
10924 """
10925 SetSizer(self, Sizer sizer)
10926
10927 Set the subsizer to be managed by this sizer item.
10928 """
10929 return _core_.SizerItem_SetSizer(*args, **kwargs)
10930
10931 def GetSpacer(*args, **kwargs):
10932 """
10933 GetSpacer(self) -> Size
10934
10935 Get the size of the spacer managed by this sizer item.
10936 """
10937 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10938
10939 def SetSpacer(*args, **kwargs):
10940 """
10941 SetSpacer(self, Size size)
10942
10943 Set the size of the spacer to be managed by this sizer item.
10944 """
10945 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10946
10947 def Show(*args, **kwargs):
10948 """
10949 Show(self, bool show)
10950
10951 Set the show item attribute, which sizers use to determine if the item
10952 is to be made part of the layout or not. If the item is tracking a
10953 window then it is shown or hidden as needed.
10954 """
10955 return _core_.SizerItem_Show(*args, **kwargs)
10956
10957 def IsShown(*args, **kwargs):
10958 """
10959 IsShown(self) -> bool
10960
10961 Is the item to be shown in the layout?
10962 """
10963 return _core_.SizerItem_IsShown(*args, **kwargs)
10964
10965 def GetPosition(*args, **kwargs):
10966 """
10967 GetPosition(self) -> Point
10968
10969 Returns the current position of the item, as set in the last Layout.
10970 """
10971 return _core_.SizerItem_GetPosition(*args, **kwargs)
10972
10973 def GetUserData(*args, **kwargs):
10974 """
10975 GetUserData(self) -> PyObject
10976
10977 Returns the userData associated with this sizer item, or None if there
10978 isn't any.
10979 """
10980 return _core_.SizerItem_GetUserData(*args, **kwargs)
10981
10982 def SetUserData(*args, **kwargs):
10983 """
10984 SetUserData(self, PyObject userData)
10985
10986 Associate a Python object with this sizer item.
10987 """
10988 return _core_.SizerItem_SetUserData(*args, **kwargs)
10989
10990 SizerItem_swigregister = _core_.SizerItem_swigregister
10991 SizerItem_swigregister(SizerItem)
10992
10993 def SizerItemWindow(*args, **kwargs):
10994 """
10995 SizerItemWindow(Window window, int proportion, int flag, int border,
10996 PyObject userData=None) -> SizerItem
10997
10998 Constructs a `wx.SizerItem` for tracking a window.
10999 """
11000 val = _core_.new_SizerItemWindow(*args, **kwargs)
11001 return val
11002
11003 def SizerItemSpacer(*args, **kwargs):
11004 """
11005 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11006 PyObject userData=None) -> SizerItem
11007
11008 Constructs a `wx.SizerItem` for tracking a spacer.
11009 """
11010 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11011 return val
11012
11013 def SizerItemSizer(*args, **kwargs):
11014 """
11015 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11016 PyObject userData=None) -> SizerItem
11017
11018 Constructs a `wx.SizerItem` for tracking a subsizer
11019 """
11020 val = _core_.new_SizerItemSizer(*args, **kwargs)
11021 return val
11022
11023 class Sizer(Object):
11024 """
11025 wx.Sizer is the abstract base class used for laying out subwindows in
11026 a window. You cannot use wx.Sizer directly; instead, you will have to
11027 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11028 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11029 and `wx.GridBagSizer`.
11030
11031 The concept implemented by sizers in wxWidgets is closely related to
11032 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11033 toolkit or the Qt toolkit. It is based upon the idea of the individual
11034 subwindows reporting their minimal required size and their ability to
11035 get stretched if the size of the parent window has changed. This will
11036 most often mean that the programmer does not set the original size of
11037 a dialog in the beginning, rather the dialog will assigned a sizer and
11038 this sizer will be queried about the recommended size. The sizer in
11039 turn will query its children, which can be normal windows or contorls,
11040 empty space or other sizers, so that a hierarchy of sizers can be
11041 constructed. Note that wxSizer does not derive from wxWindow and thus
11042 do not interfere with tab ordering and requires very little resources
11043 compared to a real window on screen.
11044
11045 What makes sizers so well fitted for use in wxWidgets is the fact that
11046 every control reports its own minimal size and the algorithm can
11047 handle differences in font sizes or different window (dialog item)
11048 sizes on different platforms without problems. If for example the
11049 standard font as well as the overall design of Mac widgets requires
11050 more space than on Windows, then the initial size of a dialog using a
11051 sizer will automatically be bigger on Mac than on Windows.
11052 """
11053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11054 def __init__(self): raise AttributeError, "No constructor defined"
11055 __repr__ = _swig_repr
11056 __swig_destroy__ = _core_.delete_Sizer
11057 __del__ = lambda self : None;
11058 def _setOORInfo(*args, **kwargs):
11059 """_setOORInfo(self, PyObject _self)"""
11060 return _core_.Sizer__setOORInfo(*args, **kwargs)
11061
11062 def Add(*args, **kwargs):
11063 """
11064 Add(self, item, int proportion=0, int flag=0, int border=0,
11065 PyObject userData=None) -> wx.SizerItem
11066
11067 Appends a child item to the sizer.
11068 """
11069 return _core_.Sizer_Add(*args, **kwargs)
11070
11071 def Insert(*args, **kwargs):
11072 """
11073 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11074 PyObject userData=None) -> wx.SizerItem
11075
11076 Inserts a new item into the list of items managed by this sizer before
11077 the item at index *before*. See `Add` for a description of the parameters.
11078 """
11079 return _core_.Sizer_Insert(*args, **kwargs)
11080
11081 def Prepend(*args, **kwargs):
11082 """
11083 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11084 PyObject userData=None) -> wx.SizerItem
11085
11086 Adds a new item to the begining of the list of sizer items managed by
11087 this sizer. See `Add` for a description of the parameters.
11088 """
11089 return _core_.Sizer_Prepend(*args, **kwargs)
11090
11091 def Remove(*args, **kwargs):
11092 """
11093 Remove(self, item) -> bool
11094
11095 Removes an item from the sizer and destroys it. This method does not
11096 cause any layout or resizing to take place, call `Layout` to update
11097 the layout on screen after removing a child from the sizer. The
11098 *item* parameter can be either a window, a sizer, or the zero-based
11099 index of an item to remove. Returns True if the child item was found
11100 and removed.
11101 """
11102 return _core_.Sizer_Remove(*args, **kwargs)
11103
11104 def Detach(*args, **kwargs):
11105 """
11106 Detach(self, item) -> bool
11107
11108 Detaches an item from the sizer without destroying it. This method
11109 does not cause any layout or resizing to take place, call `Layout` to
11110 do so. The *item* parameter can be either a window, a sizer, or the
11111 zero-based index of the item to be detached. Returns True if the child item
11112 was found and detached.
11113 """
11114 return _core_.Sizer_Detach(*args, **kwargs)
11115
11116 def GetItem(*args, **kwargs):
11117 """
11118 GetItem(self, item) -> wx.SizerItem
11119
11120 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11121 parameter can be either a window, a sizer, or the zero-based index of
11122 the item to be found.
11123 """
11124 return _core_.Sizer_GetItem(*args, **kwargs)
11125
11126 def _SetItemMinSize(*args, **kwargs):
11127 """_SetItemMinSize(self, PyObject item, Size size)"""
11128 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11129
11130 def SetItemMinSize(self, item, *args):
11131 """
11132 SetItemMinSize(self, item, Size size)
11133
11134 Sets the minimum size that will be allocated for an item in the sizer.
11135 The *item* parameter can be either a window, a sizer, or the
11136 zero-based index of the item. If a window or sizer is given then it
11137 will be searched for recursivly in subsizers if neccessary.
11138 """
11139 if len(args) == 2:
11140 # for backward compatibility accept separate width,height args too
11141 return self._SetItemMinSize(item, args)
11142 else:
11143 return self._SetItemMinSize(item, args[0])
11144
11145 def AddItem(*args, **kwargs):
11146 """
11147 AddItem(self, SizerItem item)
11148
11149 Adds a `wx.SizerItem` to the sizer.
11150 """
11151 return _core_.Sizer_AddItem(*args, **kwargs)
11152
11153 def InsertItem(*args, **kwargs):
11154 """
11155 InsertItem(self, int index, SizerItem item)
11156
11157 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11158 """
11159 return _core_.Sizer_InsertItem(*args, **kwargs)
11160
11161 def PrependItem(*args, **kwargs):
11162 """
11163 PrependItem(self, SizerItem item)
11164
11165 Prepends a `wx.SizerItem` to the sizer.
11166 """
11167 return _core_.Sizer_PrependItem(*args, **kwargs)
11168
11169 def AddMany(self, items):
11170 """
11171 AddMany is a convenience method for adding several items
11172 to a sizer at one time. Simply pass it a list of tuples,
11173 where each tuple consists of the parameters that you
11174 would normally pass to the `Add` method.
11175 """
11176 for item in items:
11177 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11178 item = (item, )
11179 self.Add(*item)
11180
11181 # for backwards compatibility only, please do not use in new code
11182 def AddWindow(self, *args, **kw):
11183 """Compatibility alias for `Add`."""
11184 return self.Add(*args, **kw)
11185 def AddSizer(self, *args, **kw):
11186 """Compatibility alias for `Add`."""
11187 return self.Add(*args, **kw)
11188 def AddSpacer(self, *args, **kw):
11189 """Compatibility alias for `Add`."""
11190 return self.Add(*args, **kw)
11191
11192 def PrependWindow(self, *args, **kw):
11193 """Compatibility alias for `Prepend`."""
11194 return self.Prepend(*args, **kw)
11195 def PrependSizer(self, *args, **kw):
11196 """Compatibility alias for `Prepend`."""
11197 return self.Prepend(*args, **kw)
11198 def PrependSpacer(self, *args, **kw):
11199 """Compatibility alias for `Prepend`."""
11200 return self.Prepend(*args, **kw)
11201
11202 def InsertWindow(self, *args, **kw):
11203 """Compatibility alias for `Insert`."""
11204 return self.Insert(*args, **kw)
11205 def InsertSizer(self, *args, **kw):
11206 """Compatibility alias for `Insert`."""
11207 return self.Insert(*args, **kw)
11208 def InsertSpacer(self, *args, **kw):
11209 """Compatibility alias for `Insert`."""
11210 return self.Insert(*args, **kw)
11211
11212 def RemoveWindow(self, *args, **kw):
11213 """Compatibility alias for `Remove`."""
11214 return self.Remove(*args, **kw)
11215 def RemoveSizer(self, *args, **kw):
11216 """Compatibility alias for `Remove`."""
11217 return self.Remove(*args, **kw)
11218 def RemovePos(self, *args, **kw):
11219 """Compatibility alias for `Remove`."""
11220 return self.Remove(*args, **kw)
11221
11222
11223 def SetDimension(*args, **kwargs):
11224 """
11225 SetDimension(self, int x, int y, int width, int height)
11226
11227 Call this to force the sizer to take the given dimension and thus
11228 force the items owned by the sizer to resize themselves according to
11229 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11230 methods.
11231 """
11232 return _core_.Sizer_SetDimension(*args, **kwargs)
11233
11234 def SetMinSize(*args, **kwargs):
11235 """
11236 SetMinSize(self, Size size)
11237
11238 Call this to give the sizer a minimal size. Normally, the sizer will
11239 calculate its minimal size based purely on how much space its children
11240 need. After calling this method `GetMinSize` will return either the
11241 minimal size as requested by its children or the minimal size set
11242 here, depending on which is bigger.
11243 """
11244 return _core_.Sizer_SetMinSize(*args, **kwargs)
11245
11246 def GetSize(*args, **kwargs):
11247 """
11248 GetSize(self) -> Size
11249
11250 Returns the current size of the space managed by the sizer.
11251 """
11252 return _core_.Sizer_GetSize(*args, **kwargs)
11253
11254 def GetPosition(*args, **kwargs):
11255 """
11256 GetPosition(self) -> Point
11257
11258 Returns the current position of the sizer's managed space.
11259 """
11260 return _core_.Sizer_GetPosition(*args, **kwargs)
11261
11262 def GetMinSize(*args, **kwargs):
11263 """
11264 GetMinSize(self) -> Size
11265
11266 Returns the minimal size of the sizer. This is either the combined
11267 minimal size of all the children and their borders or the minimal size
11268 set by SetMinSize, depending on which is bigger.
11269 """
11270 return _core_.Sizer_GetMinSize(*args, **kwargs)
11271
11272 def GetSizeTuple(self):
11273 return self.GetSize().Get()
11274 def GetPositionTuple(self):
11275 return self.GetPosition().Get()
11276 def GetMinSizeTuple(self):
11277 return self.GetMinSize().Get()
11278
11279 def RecalcSizes(*args, **kwargs):
11280 """
11281 RecalcSizes(self)
11282
11283 Using the sizes calculated by `CalcMin` reposition and resize all the
11284 items managed by this sizer. You should not need to call this directly as
11285 it is called by `Layout`.
11286 """
11287 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11288
11289 def CalcMin(*args, **kwargs):
11290 """
11291 CalcMin(self) -> Size
11292
11293 This method is where the sizer will do the actual calculation of its
11294 children's minimal sizes. You should not need to call this directly as
11295 it is called by `Layout`.
11296 """
11297 return _core_.Sizer_CalcMin(*args, **kwargs)
11298
11299 def Layout(*args, **kwargs):
11300 """
11301 Layout(self)
11302
11303 This method will force the recalculation and layout of the items
11304 controlled by the sizer using the current space allocated to the
11305 sizer. Normally this is called automatically from the owning window's
11306 EVT_SIZE handler, but it is also useful to call it from user code when
11307 one of the items in a sizer change size, or items are added or
11308 removed.
11309 """
11310 return _core_.Sizer_Layout(*args, **kwargs)
11311
11312 def Fit(*args, **kwargs):
11313 """
11314 Fit(self, Window window) -> Size
11315
11316 Tell the sizer to resize the *window* to match the sizer's minimal
11317 size. This is commonly done in the constructor of the window itself in
11318 order to set its initial size to match the needs of the children as
11319 determined by the sizer. Returns the new size.
11320
11321 For a top level window this is the total window size, not the client size.
11322 """
11323 return _core_.Sizer_Fit(*args, **kwargs)
11324
11325 def FitInside(*args, **kwargs):
11326 """
11327 FitInside(self, Window window)
11328
11329 Tell the sizer to resize the *virtual size* of the *window* to match the
11330 sizer's minimal size. This will not alter the on screen size of the
11331 window, but may cause the addition/removal/alteration of scrollbars
11332 required to view the virtual area in windows which manage it.
11333
11334 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11335
11336 """
11337 return _core_.Sizer_FitInside(*args, **kwargs)
11338
11339 def SetSizeHints(*args, **kwargs):
11340 """
11341 SetSizeHints(self, Window window)
11342
11343 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11344 match the sizer's minimal size. This is commonly done in the
11345 constructor of the window itself if the window is resizable (as are
11346 many dialogs under Unix and frames on probably all platforms) in order
11347 to prevent the window from being sized smaller than the minimal size
11348 required by the sizer.
11349 """
11350 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11351
11352 def SetVirtualSizeHints(*args, **kwargs):
11353 """
11354 SetVirtualSizeHints(self, Window window)
11355
11356 Tell the sizer to set the minimal size of the window virtual area to
11357 match the sizer's minimal size. For windows with managed scrollbars
11358 this will set them appropriately.
11359
11360 :see: `wx.ScrolledWindow.SetScrollbars`
11361
11362 """
11363 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11364
11365 def Clear(*args, **kwargs):
11366 """
11367 Clear(self, bool deleteWindows=False)
11368
11369 Clear all items from the sizer, optionally destroying the window items
11370 as well.
11371 """
11372 return _core_.Sizer_Clear(*args, **kwargs)
11373
11374 def DeleteWindows(*args, **kwargs):
11375 """
11376 DeleteWindows(self)
11377
11378 Destroy all windows managed by the sizer.
11379 """
11380 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11381
11382 def GetChildren(*args, **kwargs):
11383 """
11384 GetChildren(self) -> list
11385
11386 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11387 """
11388 return _core_.Sizer_GetChildren(*args, **kwargs)
11389
11390 def Show(*args, **kwargs):
11391 """
11392 Show(self, item, bool show=True, bool recursive=false) -> bool
11393
11394 Shows or hides an item managed by the sizer. To make a sizer item
11395 disappear or reappear, use Show followed by `Layout`. The *item*
11396 parameter can be either a window, a sizer, or the zero-based index of
11397 the item. Use the recursive parameter to show or hide an item in a
11398 subsizer. Returns True if the item was found.
11399 """
11400 return _core_.Sizer_Show(*args, **kwargs)
11401
11402 def IsShown(*args, **kwargs):
11403 """
11404 IsShown(self, item)
11405
11406 Determines if the item is currently shown. To make a sizer
11407 item disappear or reappear, use Show followed by `Layout`. The *item*
11408 parameter can be either a window, a sizer, or the zero-based index of
11409 the item.
11410 """
11411 return _core_.Sizer_IsShown(*args, **kwargs)
11412
11413 def Hide(self, item, recursive=False):
11414 """
11415 A convenience method for `Show` (item, False, recursive).
11416 """
11417 return self.Show(item, False, recursive)
11418
11419 def ShowItems(*args, **kwargs):
11420 """
11421 ShowItems(self, bool show)
11422
11423 Recursively call `wx.SizerItem.Show` on all sizer items.
11424 """
11425 return _core_.Sizer_ShowItems(*args, **kwargs)
11426
11427 Sizer_swigregister = _core_.Sizer_swigregister
11428 Sizer_swigregister(Sizer)
11429
11430 class PySizer(Sizer):
11431 """
11432 wx.PySizer is a special version of `wx.Sizer` that has been
11433 instrumented to allow the C++ virtual methods to be overloaded in
11434 Python derived classes. You would derive from this class if you are
11435 wanting to implement a custom sizer in Python code. Simply implement
11436 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11437 For example::
11438
11439 class MySizer(wx.PySizer):
11440 def __init__(self):
11441 wx.PySizer.__init__(self)
11442
11443 def CalcMin(self):
11444 for item in self.GetChildren():
11445 # calculate the total minimum width and height needed
11446 # by all items in the sizer according to this sizer's
11447 # layout algorithm.
11448 ...
11449 return wx.Size(width, height)
11450
11451 def RecalcSizes(self):
11452 # find the space allotted to this sizer
11453 pos = self.GetPosition()
11454 size = self.GetSize()
11455 for item in self.GetChildren():
11456 # Recalculate (if necessary) the position and size of
11457 # each item and then call item.SetDimension to do the
11458 # actual positioning and sizing of the items within the
11459 # space alloted to this sizer.
11460 ...
11461 item.SetDimension(itemPos, itemSize)
11462
11463
11464 When `Layout` is called it first calls `CalcMin` followed by
11465 `RecalcSizes` so you can optimize a bit by saving the results of
11466 `CalcMin` and reusing them in `RecalcSizes`.
11467
11468 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11469
11470
11471 """
11472 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11473 __repr__ = _swig_repr
11474 def __init__(self, *args, **kwargs):
11475 """
11476 __init__(self) -> PySizer
11477
11478 Creates a wx.PySizer. Must be called from the __init__ in the derived
11479 class.
11480 """
11481 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11482 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11483
11484 def _setCallbackInfo(*args, **kwargs):
11485 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11486 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11487
11488 PySizer_swigregister = _core_.PySizer_swigregister
11489 PySizer_swigregister(PySizer)
11490
11491 #---------------------------------------------------------------------------
11492
11493 class BoxSizer(Sizer):
11494 """
11495 The basic idea behind a box sizer is that windows will most often be
11496 laid out in rather simple basic geometry, typically in a row or a
11497 column or nested hierarchies of either. A wx.BoxSizer will lay out
11498 its items in a simple row or column, depending on the orientation
11499 parameter passed to the constructor.
11500 """
11501 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11502 __repr__ = _swig_repr
11503 def __init__(self, *args, **kwargs):
11504 """
11505 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11506
11507 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11508 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11509 sizer.
11510 """
11511 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11512 self._setOORInfo(self)
11513
11514 def GetOrientation(*args, **kwargs):
11515 """
11516 GetOrientation(self) -> int
11517
11518 Returns the current orientation of the sizer.
11519 """
11520 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11521
11522 def SetOrientation(*args, **kwargs):
11523 """
11524 SetOrientation(self, int orient)
11525
11526 Resets the orientation of the sizer.
11527 """
11528 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11529
11530 BoxSizer_swigregister = _core_.BoxSizer_swigregister
11531 BoxSizer_swigregister(BoxSizer)
11532
11533 #---------------------------------------------------------------------------
11534
11535 class StaticBoxSizer(BoxSizer):
11536 """
11537 wx.StaticBoxSizer derives from and functions identically to the
11538 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11539 manages. Note that this static box must be created separately and
11540 passed to the sizer constructor.
11541 """
11542 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11543 __repr__ = _swig_repr
11544 def __init__(self, *args, **kwargs):
11545 """
11546 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11547
11548 Constructor. It takes an associated static box and the orientation
11549 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11550 ``wx.HORIZONTAL``.
11551 """
11552 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11553 self._setOORInfo(self)
11554
11555 def GetStaticBox(*args, **kwargs):
11556 """
11557 GetStaticBox(self) -> StaticBox
11558
11559 Returns the static box associated with this sizer.
11560 """
11561 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11562
11563 StaticBoxSizer_swigregister = _core_.StaticBoxSizer_swigregister
11564 StaticBoxSizer_swigregister(StaticBoxSizer)
11565
11566 #---------------------------------------------------------------------------
11567
11568 class GridSizer(Sizer):
11569 """
11570 A grid sizer is a sizer which lays out its children in a
11571 two-dimensional table with all cells having the same size. In other
11572 words, the width of each cell within the grid is the width of the
11573 widest item added to the sizer and the height of each grid cell is the
11574 height of the tallest item. An optional vertical and/or horizontal
11575 gap between items can also be specified (in pixels.)
11576
11577 Items are placed in the cells of the grid in the order they are added,
11578 in row-major order. In other words, the first row is filled first,
11579 then the second, and so on until all items have been added. (If
11580 neccessary, additional rows will be added as items are added.) If you
11581 need to have greater control over the cells that items are placed in
11582 then use the `wx.GridBagSizer`.
11583
11584 """
11585 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11586 __repr__ = _swig_repr
11587 def __init__(self, *args, **kwargs):
11588 """
11589 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11590
11591 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11592 of columns and rows in the sizer - if either of the parameters is
11593 zero, it will be calculated to from the total number of children in
11594 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11595 define extra space between all children.
11596 """
11597 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11598 self._setOORInfo(self)
11599
11600 def SetCols(*args, **kwargs):
11601 """
11602 SetCols(self, int cols)
11603
11604 Sets the number of columns in the sizer.
11605 """
11606 return _core_.GridSizer_SetCols(*args, **kwargs)
11607
11608 def SetRows(*args, **kwargs):
11609 """
11610 SetRows(self, int rows)
11611
11612 Sets the number of rows in the sizer.
11613 """
11614 return _core_.GridSizer_SetRows(*args, **kwargs)
11615
11616 def SetVGap(*args, **kwargs):
11617 """
11618 SetVGap(self, int gap)
11619
11620 Sets the vertical gap (in pixels) between the cells in the sizer.
11621 """
11622 return _core_.GridSizer_SetVGap(*args, **kwargs)
11623
11624 def SetHGap(*args, **kwargs):
11625 """
11626 SetHGap(self, int gap)
11627
11628 Sets the horizontal gap (in pixels) between cells in the sizer
11629 """
11630 return _core_.GridSizer_SetHGap(*args, **kwargs)
11631
11632 def GetCols(*args, **kwargs):
11633 """
11634 GetCols(self) -> int
11635
11636 Returns the number of columns in the sizer.
11637 """
11638 return _core_.GridSizer_GetCols(*args, **kwargs)
11639
11640 def GetRows(*args, **kwargs):
11641 """
11642 GetRows(self) -> int
11643
11644 Returns the number of rows in the sizer.
11645 """
11646 return _core_.GridSizer_GetRows(*args, **kwargs)
11647
11648 def GetVGap(*args, **kwargs):
11649 """
11650 GetVGap(self) -> int
11651
11652 Returns the vertical gap (in pixels) between the cells in the sizer.
11653 """
11654 return _core_.GridSizer_GetVGap(*args, **kwargs)
11655
11656 def GetHGap(*args, **kwargs):
11657 """
11658 GetHGap(self) -> int
11659
11660 Returns the horizontal gap (in pixels) between cells in the sizer.
11661 """
11662 return _core_.GridSizer_GetHGap(*args, **kwargs)
11663
11664 def CalcRowsCols(self):
11665 """
11666 CalcRowsCols() -> (rows, cols)
11667
11668 Calculates how many rows and columns will be in the sizer based
11669 on the current number of items and also the rows, cols specified
11670 in the constructor.
11671 """
11672 nitems = len(self.GetChildren())
11673 rows = self.GetRows()
11674 cols = self.GetCols()
11675 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11676 if cols != 0:
11677 rows = (nitems + cols - 1) / cols
11678 elif rows != 0:
11679 cols = (nitems + rows - 1) / rows
11680 return (rows, cols)
11681
11682 GridSizer_swigregister = _core_.GridSizer_swigregister
11683 GridSizer_swigregister(GridSizer)
11684
11685 #---------------------------------------------------------------------------
11686
11687 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11688 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11689 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11690 class FlexGridSizer(GridSizer):
11691 """
11692 A flex grid sizer is a sizer which lays out its children in a
11693 two-dimensional table with all table cells in one row having the same
11694 height and all cells in one column having the same width, but all
11695 rows or all columns are not necessarily the same height or width as in
11696 the `wx.GridSizer`.
11697
11698 wx.FlexGridSizer can also size items equally in one direction but
11699 unequally ("flexibly") in the other. If the sizer is only flexible
11700 in one direction (this can be changed using `SetFlexibleDirection`), it
11701 needs to be decided how the sizer should grow in the other ("non
11702 flexible") direction in order to fill the available space. The
11703 `SetNonFlexibleGrowMode` method serves this purpose.
11704
11705
11706 """
11707 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11708 __repr__ = _swig_repr
11709 def __init__(self, *args, **kwargs):
11710 """
11711 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11712
11713 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11714 number of columns and rows in the sizer - if either of the parameters
11715 is zero, it will be calculated to from the total number of children in
11716 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11717 define extra space between all children.
11718 """
11719 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11720 self._setOORInfo(self)
11721
11722 def AddGrowableRow(*args, **kwargs):
11723 """
11724 AddGrowableRow(self, size_t idx, int proportion=0)
11725
11726 Specifies that row *idx* (starting from zero) should be grown if there
11727 is extra space available to the sizer.
11728
11729 The *proportion* parameter has the same meaning as the stretch factor
11730 for the box sizers except that if all proportions are 0, then all
11731 columns are resized equally (instead of not being resized at all).
11732 """
11733 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11734
11735 def RemoveGrowableRow(*args, **kwargs):
11736 """
11737 RemoveGrowableRow(self, size_t idx)
11738
11739 Specifies that row *idx* is no longer growable.
11740 """
11741 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11742
11743 def AddGrowableCol(*args, **kwargs):
11744 """
11745 AddGrowableCol(self, size_t idx, int proportion=0)
11746
11747 Specifies that column *idx* (starting from zero) should be grown if
11748 there is extra space available to the sizer.
11749
11750 The *proportion* parameter has the same meaning as the stretch factor
11751 for the box sizers except that if all proportions are 0, then all
11752 columns are resized equally (instead of not being resized at all).
11753 """
11754 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11755
11756 def RemoveGrowableCol(*args, **kwargs):
11757 """
11758 RemoveGrowableCol(self, size_t idx)
11759
11760 Specifies that column *idx* is no longer growable.
11761 """
11762 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11763
11764 def SetFlexibleDirection(*args, **kwargs):
11765 """
11766 SetFlexibleDirection(self, int direction)
11767
11768 Specifies whether the sizer should flexibly resize its columns, rows,
11769 or both. Argument *direction* can be one of the following values. Any
11770 other value is ignored.
11771
11772 ============== =======================================
11773 wx.VERTICAL Rows are flexibly sized.
11774 wx.HORIZONTAL Columns are flexibly sized.
11775 wx.BOTH Both rows and columns are flexibly sized
11776 (this is the default value).
11777 ============== =======================================
11778
11779 Note that this method does not trigger relayout.
11780
11781 """
11782 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11783
11784 def GetFlexibleDirection(*args, **kwargs):
11785 """
11786 GetFlexibleDirection(self) -> int
11787
11788 Returns a value that specifies whether the sizer
11789 flexibly resizes its columns, rows, or both (default).
11790
11791 :see: `SetFlexibleDirection`
11792 """
11793 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11794
11795 def SetNonFlexibleGrowMode(*args, **kwargs):
11796 """
11797 SetNonFlexibleGrowMode(self, int mode)
11798
11799 Specifies how the sizer should grow in the non-flexible direction if
11800 there is one (so `SetFlexibleDirection` must have been called
11801 previously). Argument *mode* can be one of the following values:
11802
11803 ========================== =================================================
11804 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11805 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11806 `AddGrowableCol` and `AddGrowableRow`. In this
11807 case equal sizing applies to minimum sizes of
11808 columns or rows (this is the default value).
11809 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11810 the non flexible direction, whether they are
11811 growable or not in the flexbile direction.
11812 ========================== =================================================
11813
11814 Note that this method does not trigger relayout.
11815
11816
11817 """
11818 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11819
11820 def GetNonFlexibleGrowMode(*args, **kwargs):
11821 """
11822 GetNonFlexibleGrowMode(self) -> int
11823
11824 Returns the value that specifies how the sizer grows in the
11825 non-flexible direction if there is one.
11826
11827 :see: `SetNonFlexibleGrowMode`
11828 """
11829 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11830
11831 def GetRowHeights(*args, **kwargs):
11832 """
11833 GetRowHeights(self) -> list
11834
11835 Returns a list of integers representing the heights of each of the
11836 rows in the sizer.
11837 """
11838 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11839
11840 def GetColWidths(*args, **kwargs):
11841 """
11842 GetColWidths(self) -> list
11843
11844 Returns a list of integers representing the widths of each of the
11845 columns in the sizer.
11846 """
11847 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11848
11849 FlexGridSizer_swigregister = _core_.FlexGridSizer_swigregister
11850 FlexGridSizer_swigregister(FlexGridSizer)
11851
11852 class StdDialogButtonSizer(BoxSizer):
11853 """
11854 A special sizer that knows how to order and position standard buttons
11855 in order to conform to the current platform's standards. You simply
11856 need to add each `wx.Button` to the sizer, and be sure to create the
11857 buttons using the standard ID's. Then call `Realize` and the sizer
11858 will take care of the rest.
11859
11860 """
11861 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11862 __repr__ = _swig_repr
11863 def __init__(self, *args, **kwargs):
11864 """__init__(self) -> StdDialogButtonSizer"""
11865 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
11866 def AddButton(*args, **kwargs):
11867 """
11868 AddButton(self, wxButton button)
11869
11870 Use this to add the buttons to this sizer. Do not use the `Add`
11871 method in the base class.
11872 """
11873 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11874
11875 def Realize(*args, **kwargs):
11876 """
11877 Realize(self)
11878
11879 This funciton needs to be called after all the buttons have been added
11880 to the sizer. It will reorder them and position them in a platform
11881 specifc manner.
11882 """
11883 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11884
11885 def SetAffirmativeButton(*args, **kwargs):
11886 """SetAffirmativeButton(self, wxButton button)"""
11887 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11888
11889 def SetNegativeButton(*args, **kwargs):
11890 """SetNegativeButton(self, wxButton button)"""
11891 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11892
11893 def SetCancelButton(*args, **kwargs):
11894 """SetCancelButton(self, wxButton button)"""
11895 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11896
11897 def GetAffirmativeButton(*args, **kwargs):
11898 """GetAffirmativeButton(self) -> wxButton"""
11899 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11900
11901 def GetApplyButton(*args, **kwargs):
11902 """GetApplyButton(self) -> wxButton"""
11903 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11904
11905 def GetNegativeButton(*args, **kwargs):
11906 """GetNegativeButton(self) -> wxButton"""
11907 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11908
11909 def GetCancelButton(*args, **kwargs):
11910 """GetCancelButton(self) -> wxButton"""
11911 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11912
11913 def GetHelpButton(*args, **kwargs):
11914 """GetHelpButton(self) -> wxButton"""
11915 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11916
11917 StdDialogButtonSizer_swigregister = _core_.StdDialogButtonSizer_swigregister
11918 StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
11919
11920 #---------------------------------------------------------------------------
11921
11922 class GBPosition(object):
11923 """
11924 This class represents the position of an item in a virtual grid of
11925 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11926 typemaps that will automatically convert from a 2-element sequence of
11927 integers to a wx.GBPosition, so you can use the more pythonic
11928 representation of the position nearly transparently in Python code.
11929 """
11930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11931 __repr__ = _swig_repr
11932 def __init__(self, *args, **kwargs):
11933 """
11934 __init__(self, int row=0, int col=0) -> GBPosition
11935
11936 This class represents the position of an item in a virtual grid of
11937 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11938 typemaps that will automatically convert from a 2-element sequence of
11939 integers to a wx.GBPosition, so you can use the more pythonic
11940 representation of the position nearly transparently in Python code.
11941 """
11942 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11943 __swig_destroy__ = _core_.delete_GBPosition
11944 __del__ = lambda self : None;
11945 def GetRow(*args, **kwargs):
11946 """GetRow(self) -> int"""
11947 return _core_.GBPosition_GetRow(*args, **kwargs)
11948
11949 def GetCol(*args, **kwargs):
11950 """GetCol(self) -> int"""
11951 return _core_.GBPosition_GetCol(*args, **kwargs)
11952
11953 def SetRow(*args, **kwargs):
11954 """SetRow(self, int row)"""
11955 return _core_.GBPosition_SetRow(*args, **kwargs)
11956
11957 def SetCol(*args, **kwargs):
11958 """SetCol(self, int col)"""
11959 return _core_.GBPosition_SetCol(*args, **kwargs)
11960
11961 def __eq__(*args, **kwargs):
11962 """
11963 __eq__(self, PyObject other) -> bool
11964
11965 Compare GBPosition for equality.
11966 """
11967 return _core_.GBPosition___eq__(*args, **kwargs)
11968
11969 def __ne__(*args, **kwargs):
11970 """
11971 __ne__(self, PyObject other) -> bool
11972
11973 Compare GBPosition for inequality.
11974 """
11975 return _core_.GBPosition___ne__(*args, **kwargs)
11976
11977 def Set(*args, **kwargs):
11978 """Set(self, int row=0, int col=0)"""
11979 return _core_.GBPosition_Set(*args, **kwargs)
11980
11981 def Get(*args, **kwargs):
11982 """Get(self) -> PyObject"""
11983 return _core_.GBPosition_Get(*args, **kwargs)
11984
11985 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11986 def __str__(self): return str(self.Get())
11987 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11988 def __len__(self): return len(self.Get())
11989 def __getitem__(self, index): return self.Get()[index]
11990 def __setitem__(self, index, val):
11991 if index == 0: self.SetRow(val)
11992 elif index == 1: self.SetCol(val)
11993 else: raise IndexError
11994 def __nonzero__(self): return self.Get() != (0,0)
11995 __safe_for_unpickling__ = True
11996 def __reduce__(self): return (wx.GBPosition, self.Get())
11997
11998 row = property(GetRow, SetRow)
11999 col = property(GetCol, SetCol)
12000
12001 GBPosition_swigregister = _core_.GBPosition_swigregister
12002 GBPosition_swigregister(GBPosition)
12003
12004 class GBSpan(object):
12005 """
12006 This class is used to hold the row and column spanning attributes of
12007 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12008 automatically convert from a 2-element sequence of integers to a
12009 wx.GBSpan, so you can use the more pythonic representation of the span
12010 nearly transparently in Python code.
12011
12012 """
12013 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12014 __repr__ = _swig_repr
12015 def __init__(self, *args, **kwargs):
12016 """
12017 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12018
12019 Construct a new wxGBSpan, optionally setting the rowspan and
12020 colspan. The default is (1,1). (Meaning that the item occupies one
12021 cell in each direction.
12022 """
12023 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12024 __swig_destroy__ = _core_.delete_GBSpan
12025 __del__ = lambda self : None;
12026 def GetRowspan(*args, **kwargs):
12027 """GetRowspan(self) -> int"""
12028 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12029
12030 def GetColspan(*args, **kwargs):
12031 """GetColspan(self) -> int"""
12032 return _core_.GBSpan_GetColspan(*args, **kwargs)
12033
12034 def SetRowspan(*args, **kwargs):
12035 """SetRowspan(self, int rowspan)"""
12036 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12037
12038 def SetColspan(*args, **kwargs):
12039 """SetColspan(self, int colspan)"""
12040 return _core_.GBSpan_SetColspan(*args, **kwargs)
12041
12042 def __eq__(*args, **kwargs):
12043 """
12044 __eq__(self, PyObject other) -> bool
12045
12046 Compare wxGBSpan for equality.
12047 """
12048 return _core_.GBSpan___eq__(*args, **kwargs)
12049
12050 def __ne__(*args, **kwargs):
12051 """
12052 __ne__(self, PyObject other) -> bool
12053
12054 Compare GBSpan for inequality.
12055 """
12056 return _core_.GBSpan___ne__(*args, **kwargs)
12057
12058 def Set(*args, **kwargs):
12059 """Set(self, int rowspan=1, int colspan=1)"""
12060 return _core_.GBSpan_Set(*args, **kwargs)
12061
12062 def Get(*args, **kwargs):
12063 """Get(self) -> PyObject"""
12064 return _core_.GBSpan_Get(*args, **kwargs)
12065
12066 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12067 def __str__(self): return str(self.Get())
12068 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12069 def __len__(self): return len(self.Get())
12070 def __getitem__(self, index): return self.Get()[index]
12071 def __setitem__(self, index, val):
12072 if index == 0: self.SetRowspan(val)
12073 elif index == 1: self.SetColspan(val)
12074 else: raise IndexError
12075 def __nonzero__(self): return self.Get() != (0,0)
12076 __safe_for_unpickling__ = True
12077 def __reduce__(self): return (wx.GBSpan, self.Get())
12078
12079 rowspan = property(GetRowspan, SetRowspan)
12080 colspan = property(GetColspan, SetColspan)
12081
12082 GBSpan_swigregister = _core_.GBSpan_swigregister
12083 GBSpan_swigregister(GBSpan)
12084
12085 class GBSizerItem(SizerItem):
12086 """
12087 The wx.GBSizerItem class is used to track the additional data about
12088 items in a `wx.GridBagSizer` such as the item's position in the grid
12089 and how many rows or columns it spans.
12090
12091 """
12092 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12093 __repr__ = _swig_repr
12094 def __init__(self, *args, **kwargs):
12095 """
12096 __init__(self) -> GBSizerItem
12097
12098 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12099 size will need to be set, as well as a position and span before this
12100 item can be used in a Sizer.
12101
12102 You will probably never need to create a wx.GBSizerItem directly as they
12103 are created automatically when the sizer's Add method is called.
12104 """
12105 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12106 __swig_destroy__ = _core_.delete_GBSizerItem
12107 __del__ = lambda self : None;
12108 def GetPos(*args, **kwargs):
12109 """
12110 GetPos(self) -> GBPosition
12111
12112 Get the grid position of the item
12113 """
12114 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12115
12116 def GetPosTuple(self): return self.GetPos().Get()
12117 def GetSpan(*args, **kwargs):
12118 """
12119 GetSpan(self) -> GBSpan
12120
12121 Get the row and column spanning of the item
12122 """
12123 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12124
12125 def GetSpanTuple(self): return self.GetSpan().Get()
12126 def SetPos(*args, **kwargs):
12127 """
12128 SetPos(self, GBPosition pos) -> bool
12129
12130 If the item is already a member of a sizer then first ensure that
12131 there is no other item that would intersect with this one at the new
12132 position, then set the new position. Returns True if the change is
12133 successful and after the next Layout() the item will be moved.
12134 """
12135 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12136
12137 def SetSpan(*args, **kwargs):
12138 """
12139 SetSpan(self, GBSpan span) -> bool
12140
12141 If the item is already a member of a sizer then first ensure that
12142 there is no other item that would intersect with this one with its new
12143 spanning size, then set the new spanning. Returns True if the change
12144 is successful and after the next Layout() the item will be resized.
12145
12146 """
12147 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12148
12149 def Intersects(*args, **kwargs):
12150 """
12151 Intersects(self, GBSizerItem other) -> bool
12152
12153 Returns True if this item and the other item instersect.
12154 """
12155 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12156
12157 def IntersectsPos(*args, **kwargs):
12158 """
12159 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12160
12161 Returns True if the given pos/span would intersect with this item.
12162 """
12163 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12164
12165 def GetEndPos(*args, **kwargs):
12166 """
12167 GetEndPos(self) -> GBPosition
12168
12169 Get the row and column of the endpoint of this item.
12170 """
12171 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12172
12173 def GetGBSizer(*args, **kwargs):
12174 """
12175 GetGBSizer(self) -> GridBagSizer
12176
12177 Get the sizer this item is a member of.
12178 """
12179 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12180
12181 def SetGBSizer(*args, **kwargs):
12182 """
12183 SetGBSizer(self, GridBagSizer sizer)
12184
12185 Set the sizer this item is a member of.
12186 """
12187 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12188
12189 GBSizerItem_swigregister = _core_.GBSizerItem_swigregister
12190 GBSizerItem_swigregister(GBSizerItem)
12191 DefaultSpan = cvar.DefaultSpan
12192
12193 def GBSizerItemWindow(*args, **kwargs):
12194 """
12195 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12196 int border, PyObject userData=None) -> GBSizerItem
12197
12198 Construct a `wx.GBSizerItem` for a window.
12199 """
12200 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12201 return val
12202
12203 def GBSizerItemSizer(*args, **kwargs):
12204 """
12205 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12206 int border, PyObject userData=None) -> GBSizerItem
12207
12208 Construct a `wx.GBSizerItem` for a sizer
12209 """
12210 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12211 return val
12212
12213 def GBSizerItemSpacer(*args, **kwargs):
12214 """
12215 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12216 int flag, int border, PyObject userData=None) -> GBSizerItem
12217
12218 Construct a `wx.GBSizerItem` for a spacer.
12219 """
12220 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12221 return val
12222
12223 class GridBagSizer(FlexGridSizer):
12224 """
12225 A `wx.Sizer` that can lay out items in a virtual grid like a
12226 `wx.FlexGridSizer` but in this case explicit positioning of the items
12227 is allowed using `wx.GBPosition`, and items can optionally span more
12228 than one row and/or column using `wx.GBSpan`. The total size of the
12229 virtual grid is determined by the largest row and column that items are
12230 positioned at, adjusted for spanning.
12231
12232 """
12233 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12234 __repr__ = _swig_repr
12235 def __init__(self, *args, **kwargs):
12236 """
12237 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12238
12239 Constructor, with optional parameters to specify the gap between the
12240 rows and columns.
12241 """
12242 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12243 self._setOORInfo(self)
12244
12245 def Add(*args, **kwargs):
12246 """
12247 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12248 int border=0, userData=None) -> wx.GBSizerItem
12249
12250 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12251 more than one row or column as specified with *span*. The remaining
12252 args behave similarly to `wx.Sizer.Add`.
12253
12254 Returns True if the item was successfully placed at the given cell
12255 position, False if something was already there.
12256
12257 """
12258 return _core_.GridBagSizer_Add(*args, **kwargs)
12259
12260 def AddItem(*args, **kwargs):
12261 """
12262 Add(self, GBSizerItem item) -> wx.GBSizerItem
12263
12264 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12265 the item was successfully placed at its given cell position, False if
12266 something was already there.
12267 """
12268 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12269
12270 def GetCellSize(*args, **kwargs):
12271 """
12272 GetCellSize(self, int row, int col) -> Size
12273
12274 Get the size of the specified cell, including hgap and
12275 vgap. Only valid after a Layout.
12276 """
12277 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12278
12279 def GetEmptyCellSize(*args, **kwargs):
12280 """
12281 GetEmptyCellSize(self) -> Size
12282
12283 Get the size used for cells in the grid with no item.
12284 """
12285 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12286
12287 def SetEmptyCellSize(*args, **kwargs):
12288 """
12289 SetEmptyCellSize(self, Size sz)
12290
12291 Set the size used for cells in the grid with no item.
12292 """
12293 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12294
12295 def GetItemPosition(*args):
12296 """
12297 GetItemPosition(self, item) -> GBPosition
12298
12299 Get the grid position of the specified *item* where *item* is either a
12300 window or subsizer that is a member of this sizer, or a zero-based
12301 index of an item.
12302 """
12303 return _core_.GridBagSizer_GetItemPosition(*args)
12304
12305 def SetItemPosition(*args):
12306 """
12307 SetItemPosition(self, item, GBPosition pos) -> bool
12308
12309 Set the grid position of the specified *item* where *item* is either a
12310 window or subsizer that is a member of this sizer, or a zero-based
12311 index of an item. Returns True on success. If the move is not
12312 allowed (because an item is already there) then False is returned.
12313
12314 """
12315 return _core_.GridBagSizer_SetItemPosition(*args)
12316
12317 def GetItemSpan(*args):
12318 """
12319 GetItemSpan(self, item) -> GBSpan
12320
12321 Get the row/col spanning of the specified *item* where *item* is
12322 either a window or subsizer that is a member of this sizer, or a
12323 zero-based index of an item.
12324 """
12325 return _core_.GridBagSizer_GetItemSpan(*args)
12326
12327 def SetItemSpan(*args):
12328 """
12329 SetItemSpan(self, item, GBSpan span) -> bool
12330
12331 Set the row/col spanning of the specified *item* where *item* is
12332 either a window or subsizer that is a member of this sizer, or a
12333 zero-based index of an item. Returns True on success. If the move is
12334 not allowed (because an item is already there) then False is returned.
12335 """
12336 return _core_.GridBagSizer_SetItemSpan(*args)
12337
12338 def FindItem(*args):
12339 """
12340 FindItem(self, item) -> GBSizerItem
12341
12342 Find the sizer item for the given window or subsizer, returns None if
12343 not found. (non-recursive)
12344 """
12345 return _core_.GridBagSizer_FindItem(*args)
12346
12347 def FindItemAtPosition(*args, **kwargs):
12348 """
12349 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12350
12351 Return the sizer item for the given grid cell, or None if there is no
12352 item at that position. (non-recursive)
12353 """
12354 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12355
12356 def FindItemAtPoint(*args, **kwargs):
12357 """
12358 FindItemAtPoint(self, Point pt) -> GBSizerItem
12359
12360 Return the sizer item located at the point given in *pt*, or None if
12361 there is no item at that point. The (x,y) coordinates in pt correspond
12362 to the client coordinates of the window using the sizer for
12363 layout. (non-recursive)
12364 """
12365 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12366
12367 def CheckForIntersection(*args, **kwargs):
12368 """
12369 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12370
12371 Look at all items and see if any intersect (or would overlap) the
12372 given *item*. Returns True if so, False if there would be no overlap.
12373 If an *excludeItem* is given then it will not be checked for
12374 intersection, for example it may be the item we are checking the
12375 position of.
12376
12377 """
12378 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12379
12380 def CheckForIntersectionPos(*args, **kwargs):
12381 """
12382 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12383
12384 Look at all items and see if any intersect (or would overlap) the
12385 given position and span. Returns True if so, False if there would be
12386 no overlap. If an *excludeItem* is given then it will not be checked
12387 for intersection, for example it may be the item we are checking the
12388 position of.
12389 """
12390 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12391
12392 GridBagSizer_swigregister = _core_.GridBagSizer_swigregister
12393 GridBagSizer_swigregister(GridBagSizer)
12394
12395 #---------------------------------------------------------------------------
12396
12397 Left = _core_.Left
12398 Top = _core_.Top
12399 Right = _core_.Right
12400 Bottom = _core_.Bottom
12401 Width = _core_.Width
12402 Height = _core_.Height
12403 Centre = _core_.Centre
12404 Center = _core_.Center
12405 CentreX = _core_.CentreX
12406 CentreY = _core_.CentreY
12407 Unconstrained = _core_.Unconstrained
12408 AsIs = _core_.AsIs
12409 PercentOf = _core_.PercentOf
12410 Above = _core_.Above
12411 Below = _core_.Below
12412 LeftOf = _core_.LeftOf
12413 RightOf = _core_.RightOf
12414 SameAs = _core_.SameAs
12415 Absolute = _core_.Absolute
12416 class IndividualLayoutConstraint(Object):
12417 """
12418 Objects of this class are stored in the `wx.LayoutConstraints` class as
12419 one of eight possible constraints that a window can be involved in.
12420 You will never need to create an instance of
12421 wx.IndividualLayoutConstraint, rather you should create a
12422 `wx.LayoutConstraints` instance and use the individual contstraints
12423 that it contains.
12424 """
12425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12426 def __init__(self): raise AttributeError, "No constructor defined"
12427 __repr__ = _swig_repr
12428 def Set(*args, **kwargs):
12429 """
12430 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12431
12432 Sets the properties of the constraint. Normally called by one of the
12433 convenience functions such as Above, RightOf, SameAs.
12434 """
12435 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12436
12437 def LeftOf(*args, **kwargs):
12438 """
12439 LeftOf(self, Window sibling, int marg=0)
12440
12441 Constrains this edge to be to the left of the given window, with an
12442 optional margin. Implicitly, this is relative to the left edge of the
12443 other window.
12444 """
12445 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12446
12447 def RightOf(*args, **kwargs):
12448 """
12449 RightOf(self, Window sibling, int marg=0)
12450
12451 Constrains this edge to be to the right of the given window, with an
12452 optional margin. Implicitly, this is relative to the right edge of the
12453 other window.
12454 """
12455 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12456
12457 def Above(*args, **kwargs):
12458 """
12459 Above(self, Window sibling, int marg=0)
12460
12461 Constrains this edge to be above the given window, with an optional
12462 margin. Implicitly, this is relative to the top edge of the other
12463 window.
12464 """
12465 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12466
12467 def Below(*args, **kwargs):
12468 """
12469 Below(self, Window sibling, int marg=0)
12470
12471 Constrains this edge to be below the given window, with an optional
12472 margin. Implicitly, this is relative to the bottom edge of the other
12473 window.
12474 """
12475 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12476
12477 def SameAs(*args, **kwargs):
12478 """
12479 SameAs(self, Window otherW, int edge, int marg=0)
12480
12481 Constrains this edge or dimension to be to the same as the edge of the
12482 given window, with an optional margin.
12483 """
12484 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12485
12486 def PercentOf(*args, **kwargs):
12487 """
12488 PercentOf(self, Window otherW, int wh, int per)
12489
12490 Constrains this edge or dimension to be to a percentage of the given
12491 window, with an optional margin.
12492 """
12493 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12494
12495 def Absolute(*args, **kwargs):
12496 """
12497 Absolute(self, int val)
12498
12499 Constrains this edge or dimension to be the given absolute value.
12500 """
12501 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12502
12503 def Unconstrained(*args, **kwargs):
12504 """
12505 Unconstrained(self)
12506
12507 Sets this edge or dimension to be unconstrained, that is, dependent on
12508 other edges and dimensions from which this value can be deduced.
12509 """
12510 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12511
12512 def AsIs(*args, **kwargs):
12513 """
12514 AsIs(self)
12515
12516 Sets this edge or constraint to be whatever the window's value is at
12517 the moment. If either of the width and height constraints are *as is*,
12518 the window will not be resized, but moved instead. This is important
12519 when considering panel items which are intended to have a default
12520 size, such as a button, which may take its size from the size of the
12521 button label.
12522 """
12523 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12524
12525 def GetOtherWindow(*args, **kwargs):
12526 """GetOtherWindow(self) -> Window"""
12527 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12528
12529 def GetMyEdge(*args, **kwargs):
12530 """GetMyEdge(self) -> int"""
12531 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12532
12533 def SetEdge(*args, **kwargs):
12534 """SetEdge(self, int which)"""
12535 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12536
12537 def SetValue(*args, **kwargs):
12538 """SetValue(self, int v)"""
12539 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12540
12541 def GetMargin(*args, **kwargs):
12542 """GetMargin(self) -> int"""
12543 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12544
12545 def SetMargin(*args, **kwargs):
12546 """SetMargin(self, int m)"""
12547 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12548
12549 def GetValue(*args, **kwargs):
12550 """GetValue(self) -> int"""
12551 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12552
12553 def GetPercent(*args, **kwargs):
12554 """GetPercent(self) -> int"""
12555 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12556
12557 def GetOtherEdge(*args, **kwargs):
12558 """GetOtherEdge(self) -> int"""
12559 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12560
12561 def GetDone(*args, **kwargs):
12562 """GetDone(self) -> bool"""
12563 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12564
12565 def SetDone(*args, **kwargs):
12566 """SetDone(self, bool d)"""
12567 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12568
12569 def GetRelationship(*args, **kwargs):
12570 """GetRelationship(self) -> int"""
12571 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12572
12573 def SetRelationship(*args, **kwargs):
12574 """SetRelationship(self, int r)"""
12575 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12576
12577 def ResetIfWin(*args, **kwargs):
12578 """
12579 ResetIfWin(self, Window otherW) -> bool
12580
12581 Reset constraint if it mentions otherWin
12582 """
12583 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12584
12585 def SatisfyConstraint(*args, **kwargs):
12586 """
12587 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12588
12589 Try to satisfy constraint
12590 """
12591 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12592
12593 def GetEdge(*args, **kwargs):
12594 """
12595 GetEdge(self, int which, Window thisWin, Window other) -> int
12596
12597 Get the value of this edge or dimension, or if this
12598 is not determinable, -1.
12599 """
12600 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12601
12602 IndividualLayoutConstraint_swigregister = _core_.IndividualLayoutConstraint_swigregister
12603 IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12604
12605 class LayoutConstraints(Object):
12606 """
12607 **Note:** constraints are now deprecated and you should use sizers
12608 instead.
12609
12610 Objects of this class can be associated with a window to define its
12611 layout constraints, with respect to siblings or its parent.
12612
12613 The class consists of the following eight constraints of class
12614 wx.IndividualLayoutConstraint, some or all of which should be accessed
12615 directly to set the appropriate constraints.
12616
12617 * left: represents the left hand edge of the window
12618 * right: represents the right hand edge of the window
12619 * top: represents the top edge of the window
12620 * bottom: represents the bottom edge of the window
12621 * width: represents the width of the window
12622 * height: represents the height of the window
12623 * centreX: represents the horizontal centre point of the window
12624 * centreY: represents the vertical centre point of the window
12625
12626 Most constraints are initially set to have the relationship
12627 wxUnconstrained, which means that their values should be calculated by
12628 looking at known constraints. The exceptions are width and height,
12629 which are set to wxAsIs to ensure that if the user does not specify a
12630 constraint, the existing width and height will be used, to be
12631 compatible with panel items which often have take a default size. If
12632 the constraint is ``wx.AsIs``, the dimension will not be changed.
12633
12634 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12635
12636 """
12637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12638 __repr__ = _swig_repr
12639 left = property(_core_.LayoutConstraints_left_get)
12640 top = property(_core_.LayoutConstraints_top_get)
12641 right = property(_core_.LayoutConstraints_right_get)
12642 bottom = property(_core_.LayoutConstraints_bottom_get)
12643 width = property(_core_.LayoutConstraints_width_get)
12644 height = property(_core_.LayoutConstraints_height_get)
12645 centreX = property(_core_.LayoutConstraints_centreX_get)
12646 centreY = property(_core_.LayoutConstraints_centreY_get)
12647 def __init__(self, *args, **kwargs):
12648 """__init__(self) -> LayoutConstraints"""
12649 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12650 __swig_destroy__ = _core_.delete_LayoutConstraints
12651 __del__ = lambda self : None;
12652 def SatisfyConstraints(*args, **kwargs):
12653 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12654 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12655
12656 def AreSatisfied(*args, **kwargs):
12657 """AreSatisfied(self) -> bool"""
12658 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12659
12660 LayoutConstraints_swigregister = _core_.LayoutConstraints_swigregister
12661 LayoutConstraints_swigregister(LayoutConstraints)
12662
12663 #----------------------------------------------------------------------------
12664
12665 # Use Python's bool constants if available, make some if not
12666 try:
12667 True
12668 except NameError:
12669 __builtins__.True = 1==1
12670 __builtins__.False = 1==0
12671 def bool(value): return not not value
12672 __builtins__.bool = bool
12673
12674
12675
12676 # workarounds for bad wxRTTI names
12677 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12678 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12679 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12680
12681
12682 #----------------------------------------------------------------------------
12683 # Load version numbers from __version__... Ensure that major and minor
12684 # versions are the same for both wxPython and wxWidgets.
12685
12686 from __version__ import *
12687 __version__ = VERSION_STRING
12688
12689 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12690 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12691 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12692 import warnings
12693 warnings.warn("wxPython/wxWidgets release number mismatch")
12694
12695 #----------------------------------------------------------------------------
12696
12697 # Set wxPython's default string<-->unicode conversion encoding from
12698 # the locale, but only if Python's default hasn't been changed. (We
12699 # assume that if the user has customized it already then that is the
12700 # encoding we need to use as well.)
12701 #
12702 # The encoding selected here is used when string or unicode objects
12703 # need to be converted in order to pass them to wxWidgets. Please be
12704 # aware that the default encoding within the same locale may be
12705 # slightly different on different platforms. For example, please see
12706 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12707 # between the common latin/roman encodings.
12708
12709 default = _sys.getdefaultencoding()
12710 if default == 'ascii':
12711 import locale
12712 import codecs
12713 try:
12714 default = locale.getdefaultlocale()[1]
12715 codecs.lookup(default)
12716 except (ValueError, LookupError, TypeError):
12717 default = _sys.getdefaultencoding()
12718 del locale
12719 del codecs
12720 if default:
12721 wx.SetDefaultPyEncoding(default)
12722 del default
12723
12724 #----------------------------------------------------------------------------
12725
12726 class PyDeadObjectError(AttributeError):
12727 pass
12728
12729 class _wxPyDeadObject(object):
12730 """
12731 Instances of wx objects that are OOR capable will have their __class__
12732 changed to this class when the C++ object is deleted. This should help
12733 prevent crashes due to referencing a bogus C++ pointer.
12734 """
12735 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12736 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12737
12738 def __repr__(self):
12739 if not hasattr(self, "_name"):
12740 self._name = "[unknown]"
12741 return self.reprStr % self._name
12742
12743 def __getattr__(self, *args):
12744 if not hasattr(self, "_name"):
12745 self._name = "[unknown]"
12746 raise PyDeadObjectError(self.attrStr % self._name)
12747
12748 def __nonzero__(self):
12749 return 0
12750
12751
12752
12753 class PyUnbornObjectError(AttributeError):
12754 pass
12755
12756 class _wxPyUnbornObject(object):
12757 """
12758 Some stock objects are created when the wx._core module is
12759 imported, but their C++ instance is not created until the wx.App
12760 object is created and initialized. These object instances will
12761 temporarily have their __class__ changed to this class so an
12762 exception will be raised if they are used before the C++ instance
12763 is ready.
12764 """
12765
12766 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12767 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12768
12769 def __repr__(self):
12770 #if not hasattr(self, "_name"):
12771 # self._name = "[unknown]"
12772 return self.reprStr #% self._name
12773
12774 def __getattr__(self, *args):
12775 #if not hasattr(self, "_name"):
12776 # self._name = "[unknown]"
12777 raise PyUnbornObjectError(self.attrStr) # % self._name )
12778
12779 def __nonzero__(self):
12780 return 0
12781
12782
12783 #----------------------------------------------------------------------------
12784
12785 def CallAfter(callable, *args, **kw):
12786 """
12787 Call the specified function after the current and pending event
12788 handlers have been completed. This is also good for making GUI
12789 method calls from non-GUI threads. Any extra positional or
12790 keyword args are passed on to the callable when it is called.
12791
12792 :see: `wx.FutureCall`
12793 """
12794 app = wx.GetApp()
12795 assert app is not None, 'No wx.App created yet'
12796
12797 if not hasattr(app, "_CallAfterId"):
12798 app._CallAfterId = wx.NewEventType()
12799 app.Connect(-1, -1, app._CallAfterId,
12800 lambda event: event.callable(*event.args, **event.kw) )
12801 evt = wx.PyEvent()
12802 evt.SetEventType(app._CallAfterId)
12803 evt.callable = callable
12804 evt.args = args
12805 evt.kw = kw
12806 wx.PostEvent(app, evt)
12807
12808 #----------------------------------------------------------------------------
12809
12810
12811 class FutureCall:
12812 """
12813 A convenience class for `wx.Timer`, that calls the given callable
12814 object once after the given amount of milliseconds, passing any
12815 positional or keyword args. The return value of the callable is
12816 availbale after it has been run with the `GetResult` method.
12817
12818 If you don't need to get the return value or restart the timer
12819 then there is no need to hold a reference to this object. It will
12820 hold a reference to itself while the timer is running (the timer
12821 has a reference to self.Notify) but the cycle will be broken when
12822 the timer completes, automatically cleaning up the wx.FutureCall
12823 object.
12824
12825 :see: `wx.CallAfter`
12826 """
12827 def __init__(self, millis, callable, *args, **kwargs):
12828 self.millis = millis
12829 self.callable = callable
12830 self.SetArgs(*args, **kwargs)
12831 self.runCount = 0
12832 self.running = False
12833 self.hasRun = False
12834 self.result = None
12835 self.timer = None
12836 self.Start()
12837
12838 def __del__(self):
12839 self.Stop()
12840
12841
12842 def Start(self, millis=None, *args, **kwargs):
12843 """
12844 (Re)start the timer
12845 """
12846 self.hasRun = False
12847 if millis is not None:
12848 self.millis = millis
12849 if args or kwargs:
12850 self.SetArgs(*args, **kwargs)
12851 self.Stop()
12852 self.timer = wx.PyTimer(self.Notify)
12853 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12854 self.running = True
12855 Restart = Start
12856
12857
12858 def Stop(self):
12859 """
12860 Stop and destroy the timer.
12861 """
12862 if self.timer is not None:
12863 self.timer.Stop()
12864 self.timer = None
12865
12866
12867 def GetInterval(self):
12868 if self.timer is not None:
12869 return self.timer.GetInterval()
12870 else:
12871 return 0
12872
12873
12874 def IsRunning(self):
12875 return self.timer is not None and self.timer.IsRunning()
12876
12877
12878 def SetArgs(self, *args, **kwargs):
12879 """
12880 (Re)set the args passed to the callable object. This is
12881 useful in conjunction with Restart if you want to schedule a
12882 new call to the same callable object but with different
12883 parameters.
12884 """
12885 self.args = args
12886 self.kwargs = kwargs
12887
12888
12889 def HasRun(self):
12890 return self.hasRun
12891
12892 def GetResult(self):
12893 return self.result
12894
12895 def Notify(self):
12896 """
12897 The timer has expired so call the callable.
12898 """
12899 if self.callable and getattr(self.callable, 'im_self', True):
12900 self.runCount += 1
12901 self.running = False
12902 self.result = self.callable(*self.args, **self.kwargs)
12903 self.hasRun = True
12904 if not self.running:
12905 # if it wasn't restarted, then cleanup
12906 wx.CallAfter(self.Stop)
12907
12908
12909
12910 #----------------------------------------------------------------------------
12911 # Control which items in this module should be documented by epydoc.
12912 # We allow only classes and functions, which will help reduce the size
12913 # of the docs by filtering out the zillions of constants, EVT objects,
12914 # and etc that don't make much sense by themselves, but are instead
12915 # documented (or will be) as part of the classes/functions/methods
12916 # where they should be used.
12917
12918 class __DocFilter:
12919 """
12920 A filter for epydoc that only allows non-Ptr classes and
12921 fucntions, in order to reduce the clutter in the API docs.
12922 """
12923 def __init__(self, globals):
12924 self._globals = globals
12925
12926 def __call__(self, name):
12927 import types
12928 obj = self._globals.get(name, None)
12929 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12930 return False
12931 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
12932 return False
12933 return True
12934
12935 #----------------------------------------------------------------------------
12936 #----------------------------------------------------------------------------
12937
12938 # Import other modules in this package that should show up in the
12939 # "core" wx namespace
12940 from _gdi import *
12941 from _windows import *
12942 from _controls import *
12943 from _misc import *
12944
12945 #----------------------------------------------------------------------------
12946 #----------------------------------------------------------------------------
12947
12948
12949