]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
837170a76b97384765001083965c024a2948eaa7
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 PROCESS_ENTER = _core_.PROCESS_ENTER
120 PASSWORD = _core_.PASSWORD
121 CB_SIMPLE = _core_.CB_SIMPLE
122 CB_DROPDOWN = _core_.CB_DROPDOWN
123 CB_SORT = _core_.CB_SORT
124 CB_READONLY = _core_.CB_READONLY
125 RA_HORIZONTAL = _core_.RA_HORIZONTAL
126 RA_VERTICAL = _core_.RA_VERTICAL
127 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130 RB_GROUP = _core_.RB_GROUP
131 RB_SINGLE = _core_.RB_SINGLE
132 SB_HORIZONTAL = _core_.SB_HORIZONTAL
133 SB_VERTICAL = _core_.SB_VERTICAL
134 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135 ST_SIZEGRIP = _core_.ST_SIZEGRIP
136 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138 ST_DOTS_END = _core_.ST_DOTS_END
139 FLOOD_SURFACE = _core_.FLOOD_SURFACE
140 FLOOD_BORDER = _core_.FLOOD_BORDER
141 ODDEVEN_RULE = _core_.ODDEVEN_RULE
142 WINDING_RULE = _core_.WINDING_RULE
143 TOOL_TOP = _core_.TOOL_TOP
144 TOOL_BOTTOM = _core_.TOOL_BOTTOM
145 TOOL_LEFT = _core_.TOOL_LEFT
146 TOOL_RIGHT = _core_.TOOL_RIGHT
147 OK = _core_.OK
148 YES_NO = _core_.YES_NO
149 CANCEL = _core_.CANCEL
150 YES = _core_.YES
151 NO = _core_.NO
152 NO_DEFAULT = _core_.NO_DEFAULT
153 YES_DEFAULT = _core_.YES_DEFAULT
154 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155 ICON_HAND = _core_.ICON_HAND
156 ICON_QUESTION = _core_.ICON_QUESTION
157 ICON_INFORMATION = _core_.ICON_INFORMATION
158 ICON_STOP = _core_.ICON_STOP
159 ICON_ASTERISK = _core_.ICON_ASTERISK
160 ICON_MASK = _core_.ICON_MASK
161 ICON_WARNING = _core_.ICON_WARNING
162 ICON_ERROR = _core_.ICON_ERROR
163 FORWARD = _core_.FORWARD
164 BACKWARD = _core_.BACKWARD
165 RESET = _core_.RESET
166 HELP = _core_.HELP
167 MORE = _core_.MORE
168 SETUP = _core_.SETUP
169 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171 SIZE_AUTO = _core_.SIZE_AUTO
172 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE = _core_.SIZE_FORCE
175 PORTRAIT = _core_.PORTRAIT
176 LANDSCAPE = _core_.LANDSCAPE
177 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181 ID_ANY = _core_.ID_ANY
182 ID_SEPARATOR = _core_.ID_SEPARATOR
183 ID_NONE = _core_.ID_NONE
184 ID_LOWEST = _core_.ID_LOWEST
185 ID_OPEN = _core_.ID_OPEN
186 ID_CLOSE = _core_.ID_CLOSE
187 ID_NEW = _core_.ID_NEW
188 ID_SAVE = _core_.ID_SAVE
189 ID_SAVEAS = _core_.ID_SAVEAS
190 ID_REVERT = _core_.ID_REVERT
191 ID_EXIT = _core_.ID_EXIT
192 ID_UNDO = _core_.ID_UNDO
193 ID_REDO = _core_.ID_REDO
194 ID_HELP = _core_.ID_HELP
195 ID_PRINT = _core_.ID_PRINT
196 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
198 ID_PREVIEW = _core_.ID_PREVIEW
199 ID_ABOUT = _core_.ID_ABOUT
200 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
204 ID_HELP_INDEX = _core_.ID_HELP_INDEX
205 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
206 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207 ID_PREFERENCES = _core_.ID_PREFERENCES
208 ID_CUT = _core_.ID_CUT
209 ID_COPY = _core_.ID_COPY
210 ID_PASTE = _core_.ID_PASTE
211 ID_CLEAR = _core_.ID_CLEAR
212 ID_FIND = _core_.ID_FIND
213 ID_DUPLICATE = _core_.ID_DUPLICATE
214 ID_SELECTALL = _core_.ID_SELECTALL
215 ID_DELETE = _core_.ID_DELETE
216 ID_REPLACE = _core_.ID_REPLACE
217 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
218 ID_PROPERTIES = _core_.ID_PROPERTIES
219 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
220 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
221 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
222 ID_VIEW_LIST = _core_.ID_VIEW_LIST
223 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
224 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
225 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
226 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
227 ID_FILE1 = _core_.ID_FILE1
228 ID_FILE2 = _core_.ID_FILE2
229 ID_FILE3 = _core_.ID_FILE3
230 ID_FILE4 = _core_.ID_FILE4
231 ID_FILE5 = _core_.ID_FILE5
232 ID_FILE6 = _core_.ID_FILE6
233 ID_FILE7 = _core_.ID_FILE7
234 ID_FILE8 = _core_.ID_FILE8
235 ID_FILE9 = _core_.ID_FILE9
236 ID_OK = _core_.ID_OK
237 ID_CANCEL = _core_.ID_CANCEL
238 ID_APPLY = _core_.ID_APPLY
239 ID_YES = _core_.ID_YES
240 ID_NO = _core_.ID_NO
241 ID_STATIC = _core_.ID_STATIC
242 ID_FORWARD = _core_.ID_FORWARD
243 ID_BACKWARD = _core_.ID_BACKWARD
244 ID_DEFAULT = _core_.ID_DEFAULT
245 ID_MORE = _core_.ID_MORE
246 ID_SETUP = _core_.ID_SETUP
247 ID_RESET = _core_.ID_RESET
248 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
249 ID_YESTOALL = _core_.ID_YESTOALL
250 ID_NOTOALL = _core_.ID_NOTOALL
251 ID_ABORT = _core_.ID_ABORT
252 ID_RETRY = _core_.ID_RETRY
253 ID_IGNORE = _core_.ID_IGNORE
254 ID_ADD = _core_.ID_ADD
255 ID_REMOVE = _core_.ID_REMOVE
256 ID_UP = _core_.ID_UP
257 ID_DOWN = _core_.ID_DOWN
258 ID_HOME = _core_.ID_HOME
259 ID_REFRESH = _core_.ID_REFRESH
260 ID_STOP = _core_.ID_STOP
261 ID_INDEX = _core_.ID_INDEX
262 ID_BOLD = _core_.ID_BOLD
263 ID_ITALIC = _core_.ID_ITALIC
264 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
265 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
266 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
267 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
268 ID_UNDERLINE = _core_.ID_UNDERLINE
269 ID_INDENT = _core_.ID_INDENT
270 ID_UNINDENT = _core_.ID_UNINDENT
271 ID_ZOOM_100 = _core_.ID_ZOOM_100
272 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
273 ID_ZOOM_IN = _core_.ID_ZOOM_IN
274 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
275 ID_UNDELETE = _core_.ID_UNDELETE
276 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
277 ID_HIGHEST = _core_.ID_HIGHEST
278 ACCEL_ALT = _core_.ACCEL_ALT
279 ACCEL_CTRL = _core_.ACCEL_CTRL
280 ACCEL_SHIFT = _core_.ACCEL_SHIFT
281 ACCEL_NORMAL = _core_.ACCEL_NORMAL
282 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
283 PD_APP_MODAL = _core_.PD_APP_MODAL
284 PD_CAN_ABORT = _core_.PD_CAN_ABORT
285 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
286 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
287 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
288 PD_SMOOTH = _core_.PD_SMOOTH
289 PD_CAN_SKIP = _core_.PD_CAN_SKIP
290 MENU_TEAROFF = _core_.MENU_TEAROFF
291 MB_DOCKABLE = _core_.MB_DOCKABLE
292 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
293 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
294 LI_HORIZONTAL = _core_.LI_HORIZONTAL
295 LI_VERTICAL = _core_.LI_VERTICAL
296 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
297 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
298 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
299 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
300 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
301 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
302 MM_TEXT = _core_.MM_TEXT
303 MM_LOMETRIC = _core_.MM_LOMETRIC
304 MM_HIMETRIC = _core_.MM_HIMETRIC
305 MM_LOENGLISH = _core_.MM_LOENGLISH
306 MM_HIENGLISH = _core_.MM_HIENGLISH
307 MM_TWIPS = _core_.MM_TWIPS
308 MM_ISOTROPIC = _core_.MM_ISOTROPIC
309 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
310 MM_POINTS = _core_.MM_POINTS
311 MM_METRIC = _core_.MM_METRIC
312 CENTRE = _core_.CENTRE
313 CENTER = _core_.CENTER
314 HORIZONTAL = _core_.HORIZONTAL
315 VERTICAL = _core_.VERTICAL
316 BOTH = _core_.BOTH
317 LEFT = _core_.LEFT
318 RIGHT = _core_.RIGHT
319 UP = _core_.UP
320 DOWN = _core_.DOWN
321 TOP = _core_.TOP
322 BOTTOM = _core_.BOTTOM
323 NORTH = _core_.NORTH
324 SOUTH = _core_.SOUTH
325 WEST = _core_.WEST
326 EAST = _core_.EAST
327 ALL = _core_.ALL
328 ALIGN_NOT = _core_.ALIGN_NOT
329 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
330 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
331 ALIGN_LEFT = _core_.ALIGN_LEFT
332 ALIGN_TOP = _core_.ALIGN_TOP
333 ALIGN_RIGHT = _core_.ALIGN_RIGHT
334 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
335 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
336 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
337 ALIGN_CENTER = _core_.ALIGN_CENTER
338 ALIGN_CENTRE = _core_.ALIGN_CENTRE
339 ALIGN_MASK = _core_.ALIGN_MASK
340 STRETCH_NOT = _core_.STRETCH_NOT
341 SHRINK = _core_.SHRINK
342 GROW = _core_.GROW
343 EXPAND = _core_.EXPAND
344 SHAPED = _core_.SHAPED
345 FIXED_MINSIZE = _core_.FIXED_MINSIZE
346 TILE = _core_.TILE
347 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
348 BORDER_DEFAULT = _core_.BORDER_DEFAULT
349 BORDER_NONE = _core_.BORDER_NONE
350 BORDER_STATIC = _core_.BORDER_STATIC
351 BORDER_SIMPLE = _core_.BORDER_SIMPLE
352 BORDER_RAISED = _core_.BORDER_RAISED
353 BORDER_SUNKEN = _core_.BORDER_SUNKEN
354 BORDER_DOUBLE = _core_.BORDER_DOUBLE
355 BORDER_MASK = _core_.BORDER_MASK
356 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
357 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
358 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
359 DEFAULT = _core_.DEFAULT
360 DECORATIVE = _core_.DECORATIVE
361 ROMAN = _core_.ROMAN
362 SCRIPT = _core_.SCRIPT
363 SWISS = _core_.SWISS
364 MODERN = _core_.MODERN
365 TELETYPE = _core_.TELETYPE
366 VARIABLE = _core_.VARIABLE
367 FIXED = _core_.FIXED
368 NORMAL = _core_.NORMAL
369 LIGHT = _core_.LIGHT
370 BOLD = _core_.BOLD
371 ITALIC = _core_.ITALIC
372 SLANT = _core_.SLANT
373 SOLID = _core_.SOLID
374 DOT = _core_.DOT
375 LONG_DASH = _core_.LONG_DASH
376 SHORT_DASH = _core_.SHORT_DASH
377 DOT_DASH = _core_.DOT_DASH
378 USER_DASH = _core_.USER_DASH
379 TRANSPARENT = _core_.TRANSPARENT
380 STIPPLE = _core_.STIPPLE
381 STIPPLE_MASK = _core_.STIPPLE_MASK
382 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
383 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
384 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
385 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
386 CROSS_HATCH = _core_.CROSS_HATCH
387 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
388 VERTICAL_HATCH = _core_.VERTICAL_HATCH
389 JOIN_BEVEL = _core_.JOIN_BEVEL
390 JOIN_MITER = _core_.JOIN_MITER
391 JOIN_ROUND = _core_.JOIN_ROUND
392 CAP_ROUND = _core_.CAP_ROUND
393 CAP_PROJECTING = _core_.CAP_PROJECTING
394 CAP_BUTT = _core_.CAP_BUTT
395 CLEAR = _core_.CLEAR
396 XOR = _core_.XOR
397 INVERT = _core_.INVERT
398 OR_REVERSE = _core_.OR_REVERSE
399 AND_REVERSE = _core_.AND_REVERSE
400 COPY = _core_.COPY
401 AND = _core_.AND
402 AND_INVERT = _core_.AND_INVERT
403 NO_OP = _core_.NO_OP
404 NOR = _core_.NOR
405 EQUIV = _core_.EQUIV
406 SRC_INVERT = _core_.SRC_INVERT
407 OR_INVERT = _core_.OR_INVERT
408 NAND = _core_.NAND
409 OR = _core_.OR
410 SET = _core_.SET
411 WXK_BACK = _core_.WXK_BACK
412 WXK_TAB = _core_.WXK_TAB
413 WXK_RETURN = _core_.WXK_RETURN
414 WXK_ESCAPE = _core_.WXK_ESCAPE
415 WXK_SPACE = _core_.WXK_SPACE
416 WXK_DELETE = _core_.WXK_DELETE
417 WXK_START = _core_.WXK_START
418 WXK_LBUTTON = _core_.WXK_LBUTTON
419 WXK_RBUTTON = _core_.WXK_RBUTTON
420 WXK_CANCEL = _core_.WXK_CANCEL
421 WXK_MBUTTON = _core_.WXK_MBUTTON
422 WXK_CLEAR = _core_.WXK_CLEAR
423 WXK_SHIFT = _core_.WXK_SHIFT
424 WXK_ALT = _core_.WXK_ALT
425 WXK_CONTROL = _core_.WXK_CONTROL
426 WXK_MENU = _core_.WXK_MENU
427 WXK_PAUSE = _core_.WXK_PAUSE
428 WXK_CAPITAL = _core_.WXK_CAPITAL
429 WXK_PRIOR = _core_.WXK_PRIOR
430 WXK_NEXT = _core_.WXK_NEXT
431 WXK_END = _core_.WXK_END
432 WXK_HOME = _core_.WXK_HOME
433 WXK_LEFT = _core_.WXK_LEFT
434 WXK_UP = _core_.WXK_UP
435 WXK_RIGHT = _core_.WXK_RIGHT
436 WXK_DOWN = _core_.WXK_DOWN
437 WXK_SELECT = _core_.WXK_SELECT
438 WXK_PRINT = _core_.WXK_PRINT
439 WXK_EXECUTE = _core_.WXK_EXECUTE
440 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
441 WXK_INSERT = _core_.WXK_INSERT
442 WXK_HELP = _core_.WXK_HELP
443 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
444 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
445 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
446 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
447 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
448 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
449 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
450 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
451 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
452 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
453 WXK_MULTIPLY = _core_.WXK_MULTIPLY
454 WXK_ADD = _core_.WXK_ADD
455 WXK_SEPARATOR = _core_.WXK_SEPARATOR
456 WXK_SUBTRACT = _core_.WXK_SUBTRACT
457 WXK_DECIMAL = _core_.WXK_DECIMAL
458 WXK_DIVIDE = _core_.WXK_DIVIDE
459 WXK_F1 = _core_.WXK_F1
460 WXK_F2 = _core_.WXK_F2
461 WXK_F3 = _core_.WXK_F3
462 WXK_F4 = _core_.WXK_F4
463 WXK_F5 = _core_.WXK_F5
464 WXK_F6 = _core_.WXK_F6
465 WXK_F7 = _core_.WXK_F7
466 WXK_F8 = _core_.WXK_F8
467 WXK_F9 = _core_.WXK_F9
468 WXK_F10 = _core_.WXK_F10
469 WXK_F11 = _core_.WXK_F11
470 WXK_F12 = _core_.WXK_F12
471 WXK_F13 = _core_.WXK_F13
472 WXK_F14 = _core_.WXK_F14
473 WXK_F15 = _core_.WXK_F15
474 WXK_F16 = _core_.WXK_F16
475 WXK_F17 = _core_.WXK_F17
476 WXK_F18 = _core_.WXK_F18
477 WXK_F19 = _core_.WXK_F19
478 WXK_F20 = _core_.WXK_F20
479 WXK_F21 = _core_.WXK_F21
480 WXK_F22 = _core_.WXK_F22
481 WXK_F23 = _core_.WXK_F23
482 WXK_F24 = _core_.WXK_F24
483 WXK_NUMLOCK = _core_.WXK_NUMLOCK
484 WXK_SCROLL = _core_.WXK_SCROLL
485 WXK_PAGEUP = _core_.WXK_PAGEUP
486 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
487 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
488 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
489 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
490 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
491 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
492 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
493 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
494 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
495 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
496 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
497 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
498 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
499 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
500 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
501 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
502 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
503 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
504 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
505 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
506 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
507 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
508 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
509 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
510 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
511 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
512 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
513 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
514 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
515 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
516 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
517 WXK_COMMAND = _core_.WXK_COMMAND
518 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
519 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
520 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
521 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
522 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
523 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
524 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
525 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
526 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
527 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
528 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
529 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
530 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
531 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
532 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
533 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
534 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
535 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
536 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
537 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
538 PAPER_NONE = _core_.PAPER_NONE
539 PAPER_LETTER = _core_.PAPER_LETTER
540 PAPER_LEGAL = _core_.PAPER_LEGAL
541 PAPER_A4 = _core_.PAPER_A4
542 PAPER_CSHEET = _core_.PAPER_CSHEET
543 PAPER_DSHEET = _core_.PAPER_DSHEET
544 PAPER_ESHEET = _core_.PAPER_ESHEET
545 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
546 PAPER_TABLOID = _core_.PAPER_TABLOID
547 PAPER_LEDGER = _core_.PAPER_LEDGER
548 PAPER_STATEMENT = _core_.PAPER_STATEMENT
549 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
550 PAPER_A3 = _core_.PAPER_A3
551 PAPER_A4SMALL = _core_.PAPER_A4SMALL
552 PAPER_A5 = _core_.PAPER_A5
553 PAPER_B4 = _core_.PAPER_B4
554 PAPER_B5 = _core_.PAPER_B5
555 PAPER_FOLIO = _core_.PAPER_FOLIO
556 PAPER_QUARTO = _core_.PAPER_QUARTO
557 PAPER_10X14 = _core_.PAPER_10X14
558 PAPER_11X17 = _core_.PAPER_11X17
559 PAPER_NOTE = _core_.PAPER_NOTE
560 PAPER_ENV_9 = _core_.PAPER_ENV_9
561 PAPER_ENV_10 = _core_.PAPER_ENV_10
562 PAPER_ENV_11 = _core_.PAPER_ENV_11
563 PAPER_ENV_12 = _core_.PAPER_ENV_12
564 PAPER_ENV_14 = _core_.PAPER_ENV_14
565 PAPER_ENV_DL = _core_.PAPER_ENV_DL
566 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
567 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
568 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
569 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
570 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
571 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
572 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
573 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
574 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
575 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
576 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
577 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
578 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
579 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
580 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
581 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
582 PAPER_9X11 = _core_.PAPER_9X11
583 PAPER_10X11 = _core_.PAPER_10X11
584 PAPER_15X11 = _core_.PAPER_15X11
585 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
586 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
587 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
588 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
589 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
590 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
591 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
592 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
593 PAPER_A_PLUS = _core_.PAPER_A_PLUS
594 PAPER_B_PLUS = _core_.PAPER_B_PLUS
595 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
596 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
597 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
598 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
599 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
600 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
601 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
602 PAPER_A2 = _core_.PAPER_A2
603 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
604 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
605 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
606 PAPER_A6 = _core_.PAPER_A6
607 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
608 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
609 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
610 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
611 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
612 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
613 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
614 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
615 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
616 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
617 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
618 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
619 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
620 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
621 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
622 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
623 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
624 PAPER_B6_JIS = _core_.PAPER_B6_JIS
625 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
626 PAPER_12X11 = _core_.PAPER_12X11
627 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
628 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
629 PAPER_P16K = _core_.PAPER_P16K
630 PAPER_P32K = _core_.PAPER_P32K
631 PAPER_P32KBIG = _core_.PAPER_P32KBIG
632 PAPER_PENV_1 = _core_.PAPER_PENV_1
633 PAPER_PENV_2 = _core_.PAPER_PENV_2
634 PAPER_PENV_3 = _core_.PAPER_PENV_3
635 PAPER_PENV_4 = _core_.PAPER_PENV_4
636 PAPER_PENV_5 = _core_.PAPER_PENV_5
637 PAPER_PENV_6 = _core_.PAPER_PENV_6
638 PAPER_PENV_7 = _core_.PAPER_PENV_7
639 PAPER_PENV_8 = _core_.PAPER_PENV_8
640 PAPER_PENV_9 = _core_.PAPER_PENV_9
641 PAPER_PENV_10 = _core_.PAPER_PENV_10
642 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
643 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
644 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
645 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
646 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
647 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
648 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
649 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
650 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
651 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
652 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
653 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
654 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
655 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
656 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
657 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
658 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
659 ITEM_NORMAL = _core_.ITEM_NORMAL
660 ITEM_CHECK = _core_.ITEM_CHECK
661 ITEM_RADIO = _core_.ITEM_RADIO
662 ITEM_MAX = _core_.ITEM_MAX
663 HT_NOWHERE = _core_.HT_NOWHERE
664 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
665 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
666 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
667 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
668 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
669 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
670 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
671 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
672 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
673 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
674 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
675 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
676 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
677 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
678 HT_MAX = _core_.HT_MAX
679 MOD_NONE = _core_.MOD_NONE
680 MOD_ALT = _core_.MOD_ALT
681 MOD_CONTROL = _core_.MOD_CONTROL
682 MOD_ALTGR = _core_.MOD_ALTGR
683 MOD_SHIFT = _core_.MOD_SHIFT
684 MOD_META = _core_.MOD_META
685 MOD_WIN = _core_.MOD_WIN
686 MOD_CMD = _core_.MOD_CMD
687 MOD_ALL = _core_.MOD_ALL
688 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
689 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
690 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
691 #---------------------------------------------------------------------------
692
693 class Object(object):
694 """
695 The base class for most wx objects, although in wxPython not
696 much functionality is needed nor exposed.
697 """
698 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
699 def __init__(self): raise AttributeError, "No constructor defined"
700 __repr__ = _swig_repr
701 def GetClassName(*args, **kwargs):
702 """
703 GetClassName(self) -> String
704
705 Returns the class name of the C++ class using wxRTTI.
706 """
707 return _core_.Object_GetClassName(*args, **kwargs)
708
709 def Destroy(*args, **kwargs):
710 """
711 Destroy(self)
712
713 Deletes the C++ object this Python object is a proxy for.
714 """
715 val = _core_.Object_Destroy(*args, **kwargs)
716 args[0].thisown = 0
717 return val
718
719 _core_.Object_swigregister(Object)
720 _wxPySetDictionary = _core_._wxPySetDictionary
721 cvar = _core_.cvar
722 EmptyString = cvar.EmptyString
723
724 #---------------------------------------------------------------------------
725
726 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
727 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
728 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
729 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
730 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
731 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
732 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
733 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
734 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
735 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
736 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
737 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
738 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
739 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
740 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
741 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
742 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
743 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
744 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746 CURSOR_NONE = _core_.CURSOR_NONE
747 CURSOR_ARROW = _core_.CURSOR_ARROW
748 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750 CURSOR_CHAR = _core_.CURSOR_CHAR
751 CURSOR_CROSS = _core_.CURSOR_CROSS
752 CURSOR_HAND = _core_.CURSOR_HAND
753 CURSOR_IBEAM = _core_.CURSOR_IBEAM
754 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759 CURSOR_PENCIL = _core_.CURSOR_PENCIL
760 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765 CURSOR_SIZENS = _core_.CURSOR_SIZENS
766 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768 CURSOR_SIZING = _core_.CURSOR_SIZING
769 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770 CURSOR_WAIT = _core_.CURSOR_WAIT
771 CURSOR_WATCH = _core_.CURSOR_WATCH
772 CURSOR_BLANK = _core_.CURSOR_BLANK
773 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776 CURSOR_MAX = _core_.CURSOR_MAX
777 #---------------------------------------------------------------------------
778
779 class Size(object):
780 """
781 wx.Size is a useful data structure used to represent the size of
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
784 expected a (width, height) tuple can be used instead.
785 """
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
790 x = width; y = height
791 def __init__(self, *args, **kwargs):
792 """
793 __init__(self, int w=0, int h=0) -> Size
794
795 Creates a size object.
796 """
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
800 def __eq__(*args, **kwargs):
801 """
802 __eq__(self, PyObject other) -> bool
803
804 Test for equality of wx.Size objects.
805 """
806 return _core_.Size___eq__(*args, **kwargs)
807
808 def __ne__(*args, **kwargs):
809 """
810 __ne__(self, PyObject other) -> bool
811
812 Test for inequality of wx.Size objects.
813 """
814 return _core_.Size___ne__(*args, **kwargs)
815
816 def __add__(*args, **kwargs):
817 """
818 __add__(self, Size sz) -> Size
819
820 Add sz's proprties to this and return the result.
821 """
822 return _core_.Size___add__(*args, **kwargs)
823
824 def __sub__(*args, **kwargs):
825 """
826 __sub__(self, Size sz) -> Size
827
828 Subtract sz's properties from this and return the result.
829 """
830 return _core_.Size___sub__(*args, **kwargs)
831
832 def IncTo(*args, **kwargs):
833 """
834 IncTo(self, Size sz)
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
839 return _core_.Size_IncTo(*args, **kwargs)
840
841 def DecTo(*args, **kwargs):
842 """
843 DecTo(self, Size sz)
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
848 return _core_.Size_DecTo(*args, **kwargs)
849
850 def Scale(*args, **kwargs):
851 """
852 Scale(self, float xscale, float yscale)
853
854 Scales the dimensions of this object by the given factors.
855 """
856 return _core_.Size_Scale(*args, **kwargs)
857
858 def Set(*args, **kwargs):
859 """
860 Set(self, int w, int h)
861
862 Set both width and height.
863 """
864 return _core_.Size_Set(*args, **kwargs)
865
866 def SetWidth(*args, **kwargs):
867 """SetWidth(self, int w)"""
868 return _core_.Size_SetWidth(*args, **kwargs)
869
870 def SetHeight(*args, **kwargs):
871 """SetHeight(self, int h)"""
872 return _core_.Size_SetHeight(*args, **kwargs)
873
874 def GetWidth(*args, **kwargs):
875 """GetWidth(self) -> int"""
876 return _core_.Size_GetWidth(*args, **kwargs)
877
878 def GetHeight(*args, **kwargs):
879 """GetHeight(self) -> int"""
880 return _core_.Size_GetHeight(*args, **kwargs)
881
882 def IsFullySpecified(*args, **kwargs):
883 """
884 IsFullySpecified(self) -> bool
885
886 Returns True if both components of the size are non-default values.
887 """
888 return _core_.Size_IsFullySpecified(*args, **kwargs)
889
890 def SetDefaults(*args, **kwargs):
891 """
892 SetDefaults(self, Size size)
893
894 Combine this size with the other one replacing the default components
895 of this object (i.e. equal to -1) with those of the other.
896 """
897 return _core_.Size_SetDefaults(*args, **kwargs)
898
899 def Get(*args, **kwargs):
900 """
901 Get() -> (width,height)
902
903 Returns the width and height properties as a tuple.
904 """
905 return _core_.Size_Get(*args, **kwargs)
906
907 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
908 def __str__(self): return str(self.Get())
909 def __repr__(self): return 'wx.Size'+str(self.Get())
910 def __len__(self): return len(self.Get())
911 def __getitem__(self, index): return self.Get()[index]
912 def __setitem__(self, index, val):
913 if index == 0: self.width = val
914 elif index == 1: self.height = val
915 else: raise IndexError
916 def __nonzero__(self): return self.Get() != (0,0)
917 __safe_for_unpickling__ = True
918 def __reduce__(self): return (wx.Size, self.Get())
919
920 _core_.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 _core_.RealPoint_swigregister(RealPoint)
1005
1006 #---------------------------------------------------------------------------
1007
1008 class Point(object):
1009 """
1010 A data structure for representing a point or position with integer x
1011 and y properties. Most places in wxPython that expect a wx.Point can
1012 also accept a (x,y) tuple.
1013 """
1014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1015 __repr__ = _swig_repr
1016 x = property(_core_.Point_x_get, _core_.Point_x_set)
1017 y = property(_core_.Point_y_get, _core_.Point_y_set)
1018 def __init__(self, *args, **kwargs):
1019 """
1020 __init__(self, int x=0, int y=0) -> Point
1021
1022 Create a wx.Point object
1023 """
1024 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1025 __swig_destroy__ = _core_.delete_Point
1026 __del__ = lambda self : None;
1027 def __eq__(*args, **kwargs):
1028 """
1029 __eq__(self, PyObject other) -> bool
1030
1031 Test for equality of wx.Point objects.
1032 """
1033 return _core_.Point___eq__(*args, **kwargs)
1034
1035 def __ne__(*args, **kwargs):
1036 """
1037 __ne__(self, PyObject other) -> bool
1038
1039 Test for inequality of wx.Point objects.
1040 """
1041 return _core_.Point___ne__(*args, **kwargs)
1042
1043 def __add__(*args, **kwargs):
1044 """
1045 __add__(self, Point pt) -> Point
1046
1047 Add pt's proprties to this and return the result.
1048 """
1049 return _core_.Point___add__(*args, **kwargs)
1050
1051 def __sub__(*args, **kwargs):
1052 """
1053 __sub__(self, Point pt) -> Point
1054
1055 Subtract pt's proprties from this and return the result
1056 """
1057 return _core_.Point___sub__(*args, **kwargs)
1058
1059 def __iadd__(*args, **kwargs):
1060 """
1061 __iadd__(self, Point pt) -> Point
1062
1063 Add pt to this object.
1064 """
1065 return _core_.Point___iadd__(*args, **kwargs)
1066
1067 def __isub__(*args, **kwargs):
1068 """
1069 __isub__(self, Point pt) -> Point
1070
1071 Subtract pt from this object.
1072 """
1073 return _core_.Point___isub__(*args, **kwargs)
1074
1075 def Set(*args, **kwargs):
1076 """
1077 Set(self, long x, long y)
1078
1079 Set both the x and y properties
1080 """
1081 return _core_.Point_Set(*args, **kwargs)
1082
1083 def Get(*args, **kwargs):
1084 """
1085 Get() -> (x,y)
1086
1087 Return the x and y properties as a tuple.
1088 """
1089 return _core_.Point_Get(*args, **kwargs)
1090
1091 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1092 def __str__(self): return str(self.Get())
1093 def __repr__(self): return 'wx.Point'+str(self.Get())
1094 def __len__(self): return len(self.Get())
1095 def __getitem__(self, index): return self.Get()[index]
1096 def __setitem__(self, index, val):
1097 if index == 0: self.x = val
1098 elif index == 1: self.y = val
1099 else: raise IndexError
1100 def __nonzero__(self): return self.Get() != (0,0)
1101 __safe_for_unpickling__ = True
1102 def __reduce__(self): return (wx.Point, self.Get())
1103
1104 _core_.Point_swigregister(Point)
1105
1106 #---------------------------------------------------------------------------
1107
1108 class Rect(object):
1109 """
1110 A class for representing and manipulating rectangles. It has x, y,
1111 width and height properties. In wxPython most palces that expect a
1112 wx.Rect can also accept a (x,y,width,height) tuple.
1113 """
1114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1115 __repr__ = _swig_repr
1116 def __init__(self, *args, **kwargs):
1117 """
1118 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1119
1120 Create a new Rect object.
1121 """
1122 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1123 __swig_destroy__ = _core_.delete_Rect
1124 __del__ = lambda self : None;
1125 def GetX(*args, **kwargs):
1126 """GetX(self) -> int"""
1127 return _core_.Rect_GetX(*args, **kwargs)
1128
1129 def SetX(*args, **kwargs):
1130 """SetX(self, int x)"""
1131 return _core_.Rect_SetX(*args, **kwargs)
1132
1133 def GetY(*args, **kwargs):
1134 """GetY(self) -> int"""
1135 return _core_.Rect_GetY(*args, **kwargs)
1136
1137 def SetY(*args, **kwargs):
1138 """SetY(self, int y)"""
1139 return _core_.Rect_SetY(*args, **kwargs)
1140
1141 def GetWidth(*args, **kwargs):
1142 """GetWidth(self) -> int"""
1143 return _core_.Rect_GetWidth(*args, **kwargs)
1144
1145 def SetWidth(*args, **kwargs):
1146 """SetWidth(self, int w)"""
1147 return _core_.Rect_SetWidth(*args, **kwargs)
1148
1149 def GetHeight(*args, **kwargs):
1150 """GetHeight(self) -> int"""
1151 return _core_.Rect_GetHeight(*args, **kwargs)
1152
1153 def SetHeight(*args, **kwargs):
1154 """SetHeight(self, int h)"""
1155 return _core_.Rect_SetHeight(*args, **kwargs)
1156
1157 def GetPosition(*args, **kwargs):
1158 """GetPosition(self) -> Point"""
1159 return _core_.Rect_GetPosition(*args, **kwargs)
1160
1161 def SetPosition(*args, **kwargs):
1162 """SetPosition(self, Point p)"""
1163 return _core_.Rect_SetPosition(*args, **kwargs)
1164
1165 def GetSize(*args, **kwargs):
1166 """GetSize(self) -> Size"""
1167 return _core_.Rect_GetSize(*args, **kwargs)
1168
1169 def SetSize(*args, **kwargs):
1170 """SetSize(self, Size s)"""
1171 return _core_.Rect_SetSize(*args, **kwargs)
1172
1173 def IsEmpty(*args, **kwargs):
1174 """IsEmpty(self) -> bool"""
1175 return _core_.Rect_IsEmpty(*args, **kwargs)
1176
1177 def GetTopLeft(*args, **kwargs):
1178 """GetTopLeft(self) -> Point"""
1179 return _core_.Rect_GetTopLeft(*args, **kwargs)
1180
1181 def SetTopLeft(*args, **kwargs):
1182 """SetTopLeft(self, Point p)"""
1183 return _core_.Rect_SetTopLeft(*args, **kwargs)
1184
1185 def GetBottomRight(*args, **kwargs):
1186 """GetBottomRight(self) -> Point"""
1187 return _core_.Rect_GetBottomRight(*args, **kwargs)
1188
1189 def SetBottomRight(*args, **kwargs):
1190 """SetBottomRight(self, Point p)"""
1191 return _core_.Rect_SetBottomRight(*args, **kwargs)
1192
1193 def GetLeft(*args, **kwargs):
1194 """GetLeft(self) -> int"""
1195 return _core_.Rect_GetLeft(*args, **kwargs)
1196
1197 def GetTop(*args, **kwargs):
1198 """GetTop(self) -> int"""
1199 return _core_.Rect_GetTop(*args, **kwargs)
1200
1201 def GetBottom(*args, **kwargs):
1202 """GetBottom(self) -> int"""
1203 return _core_.Rect_GetBottom(*args, **kwargs)
1204
1205 def GetRight(*args, **kwargs):
1206 """GetRight(self) -> int"""
1207 return _core_.Rect_GetRight(*args, **kwargs)
1208
1209 def SetLeft(*args, **kwargs):
1210 """SetLeft(self, int left)"""
1211 return _core_.Rect_SetLeft(*args, **kwargs)
1212
1213 def SetRight(*args, **kwargs):
1214 """SetRight(self, int right)"""
1215 return _core_.Rect_SetRight(*args, **kwargs)
1216
1217 def SetTop(*args, **kwargs):
1218 """SetTop(self, int top)"""
1219 return _core_.Rect_SetTop(*args, **kwargs)
1220
1221 def SetBottom(*args, **kwargs):
1222 """SetBottom(self, int bottom)"""
1223 return _core_.Rect_SetBottom(*args, **kwargs)
1224
1225 position = property(GetPosition, SetPosition)
1226 size = property(GetSize, SetSize)
1227 left = property(GetLeft, SetLeft)
1228 right = property(GetRight, SetRight)
1229 top = property(GetTop, SetTop)
1230 bottom = property(GetBottom, SetBottom)
1231
1232 def Inflate(*args, **kwargs):
1233 """
1234 Inflate(self, int dx, int dy) -> Rect
1235
1236 Increases the size of the rectangle.
1237
1238 The left border is moved farther left and the right border is moved
1239 farther right by ``dx``. The upper border is moved farther up and the
1240 bottom border is moved farther down by ``dy``. (Note the the width and
1241 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1242 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1243 opposite happens: the rectangle size decreases in the respective
1244 direction.
1245
1246 The change is made to the rectangle inplace, if instead you need a
1247 copy that is inflated, preserving the original then make the copy
1248 first::
1249
1250 copy = wx.Rect(*original)
1251 copy.Inflate(10,15)
1252
1253
1254 """
1255 return _core_.Rect_Inflate(*args, **kwargs)
1256
1257 def Deflate(*args, **kwargs):
1258 """
1259 Deflate(self, int dx, int dy) -> Rect
1260
1261 Decrease the rectangle size. This method is the opposite of `Inflate`
1262 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1263 `Inflate` for a full description.
1264 """
1265 return _core_.Rect_Deflate(*args, **kwargs)
1266
1267 def OffsetXY(*args, **kwargs):
1268 """
1269 OffsetXY(self, int dx, int dy)
1270
1271 Moves the rectangle by the specified offset. If dx is positive, the
1272 rectangle is moved to the right, if dy is positive, it is moved to the
1273 bottom, otherwise it is moved to the left or top respectively.
1274 """
1275 return _core_.Rect_OffsetXY(*args, **kwargs)
1276
1277 def Offset(*args, **kwargs):
1278 """
1279 Offset(self, Point pt)
1280
1281 Same as `OffsetXY` but uses dx,dy from Point
1282 """
1283 return _core_.Rect_Offset(*args, **kwargs)
1284
1285 def Intersect(*args, **kwargs):
1286 """
1287 Intersect(self, Rect rect) -> Rect
1288
1289 Returns the intersectsion of this rectangle and rect.
1290 """
1291 return _core_.Rect_Intersect(*args, **kwargs)
1292
1293 def Union(*args, **kwargs):
1294 """
1295 Union(self, Rect rect) -> Rect
1296
1297 Returns the union of this rectangle and rect.
1298 """
1299 return _core_.Rect_Union(*args, **kwargs)
1300
1301 def __add__(*args, **kwargs):
1302 """
1303 __add__(self, Rect rect) -> Rect
1304
1305 Add the properties of rect to this rectangle and return the result.
1306 """
1307 return _core_.Rect___add__(*args, **kwargs)
1308
1309 def __iadd__(*args, **kwargs):
1310 """
1311 __iadd__(self, Rect rect) -> Rect
1312
1313 Add the properties of rect to this rectangle, updating this rectangle.
1314 """
1315 return _core_.Rect___iadd__(*args, **kwargs)
1316
1317 def __eq__(*args, **kwargs):
1318 """
1319 __eq__(self, PyObject other) -> bool
1320
1321 Test for equality of wx.Rect objects.
1322 """
1323 return _core_.Rect___eq__(*args, **kwargs)
1324
1325 def __ne__(*args, **kwargs):
1326 """
1327 __ne__(self, PyObject other) -> bool
1328
1329 Test for inequality of wx.Rect objects.
1330 """
1331 return _core_.Rect___ne__(*args, **kwargs)
1332
1333 def InsideXY(*args, **kwargs):
1334 """
1335 InsideXY(self, int x, int y) -> bool
1336
1337 Return True if the point is (not strcitly) inside the rect.
1338 """
1339 return _core_.Rect_InsideXY(*args, **kwargs)
1340
1341 def Inside(*args, **kwargs):
1342 """
1343 Inside(self, Point pt) -> bool
1344
1345 Return True if the point is (not strcitly) inside the rect.
1346 """
1347 return _core_.Rect_Inside(*args, **kwargs)
1348
1349 def InsideRect(*args, **kwargs):
1350 """
1351 InsideRect(self, Rect rect) -> bool
1352
1353 Returns ``True`` if the given rectangle is completely inside this
1354 rectangle or touches its boundary.
1355 """
1356 return _core_.Rect_InsideRect(*args, **kwargs)
1357
1358 def Intersects(*args, **kwargs):
1359 """
1360 Intersects(self, Rect rect) -> bool
1361
1362 Returns True if the rectangles have a non empty intersection.
1363 """
1364 return _core_.Rect_Intersects(*args, **kwargs)
1365
1366 def CenterIn(*args, **kwargs):
1367 """
1368 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1369
1370 Center this rectangle within the one passed to the method, which is
1371 usually, but not necessarily, the larger one.
1372 """
1373 return _core_.Rect_CenterIn(*args, **kwargs)
1374
1375 CentreIn = CenterIn
1376 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1377 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1378 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1379 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1380 def Set(*args, **kwargs):
1381 """
1382 Set(self, int x=0, int y=0, int width=0, int height=0)
1383
1384 Set all rectangle properties.
1385 """
1386 return _core_.Rect_Set(*args, **kwargs)
1387
1388 def Get(*args, **kwargs):
1389 """
1390 Get() -> (x,y,width,height)
1391
1392 Return the rectangle properties as a tuple.
1393 """
1394 return _core_.Rect_Get(*args, **kwargs)
1395
1396 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1397 def __str__(self): return str(self.Get())
1398 def __repr__(self): return 'wx.Rect'+str(self.Get())
1399 def __len__(self): return len(self.Get())
1400 def __getitem__(self, index): return self.Get()[index]
1401 def __setitem__(self, index, val):
1402 if index == 0: self.x = val
1403 elif index == 1: self.y = val
1404 elif index == 2: self.width = val
1405 elif index == 3: self.height = val
1406 else: raise IndexError
1407 def __nonzero__(self): return self.Get() != (0,0,0,0)
1408 __safe_for_unpickling__ = True
1409 def __reduce__(self): return (wx.Rect, self.Get())
1410
1411 _core_.Rect_swigregister(Rect)
1412
1413 def RectPP(*args, **kwargs):
1414 """
1415 RectPP(Point topLeft, Point bottomRight) -> Rect
1416
1417 Create a new Rect object from Points representing two corners.
1418 """
1419 val = _core_.new_RectPP(*args, **kwargs)
1420 return val
1421
1422 def RectPS(*args, **kwargs):
1423 """
1424 RectPS(Point pos, Size size) -> Rect
1425
1426 Create a new Rect from a position and size.
1427 """
1428 val = _core_.new_RectPS(*args, **kwargs)
1429 return val
1430
1431 def RectS(*args, **kwargs):
1432 """
1433 RectS(Size size) -> Rect
1434
1435 Create a new Rect from a size only.
1436 """
1437 val = _core_.new_RectS(*args, **kwargs)
1438 return val
1439
1440
1441 def IntersectRect(*args, **kwargs):
1442 """
1443 IntersectRect(Rect r1, Rect r2) -> Rect
1444
1445 Calculate and return the intersection of r1 and r2.
1446 """
1447 return _core_.IntersectRect(*args, **kwargs)
1448 #---------------------------------------------------------------------------
1449
1450 class Point2D(object):
1451 """
1452 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1453 with floating point values.
1454 """
1455 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1456 __repr__ = _swig_repr
1457 def __init__(self, *args, **kwargs):
1458 """
1459 __init__(self, double x=0.0, double y=0.0) -> Point2D
1460
1461 Create a w.Point2D object.
1462 """
1463 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1464 def GetFloor(*args, **kwargs):
1465 """
1466 GetFloor() -> (x,y)
1467
1468 Convert to integer
1469 """
1470 return _core_.Point2D_GetFloor(*args, **kwargs)
1471
1472 def GetRounded(*args, **kwargs):
1473 """
1474 GetRounded() -> (x,y)
1475
1476 Convert to integer
1477 """
1478 return _core_.Point2D_GetRounded(*args, **kwargs)
1479
1480 def GetVectorLength(*args, **kwargs):
1481 """GetVectorLength(self) -> double"""
1482 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1483
1484 def GetVectorAngle(*args, **kwargs):
1485 """GetVectorAngle(self) -> double"""
1486 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1487
1488 def SetVectorLength(*args, **kwargs):
1489 """SetVectorLength(self, double length)"""
1490 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1491
1492 def SetVectorAngle(*args, **kwargs):
1493 """SetVectorAngle(self, double degrees)"""
1494 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1495
1496 def SetPolarCoordinates(self, angle, length):
1497 self.SetVectorLength(length)
1498 self.SetVectorAngle(angle)
1499 def Normalize(self):
1500 self.SetVectorLength(1.0)
1501
1502 def GetDistance(*args, **kwargs):
1503 """GetDistance(self, Point2D pt) -> double"""
1504 return _core_.Point2D_GetDistance(*args, **kwargs)
1505
1506 def GetDistanceSquare(*args, **kwargs):
1507 """GetDistanceSquare(self, Point2D pt) -> double"""
1508 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1509
1510 def GetDotProduct(*args, **kwargs):
1511 """GetDotProduct(self, Point2D vec) -> double"""
1512 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1513
1514 def GetCrossProduct(*args, **kwargs):
1515 """GetCrossProduct(self, Point2D vec) -> double"""
1516 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1517
1518 def __neg__(*args, **kwargs):
1519 """
1520 __neg__(self) -> Point2D
1521
1522 the reflection of this point
1523 """
1524 return _core_.Point2D___neg__(*args, **kwargs)
1525
1526 def __iadd__(*args, **kwargs):
1527 """__iadd__(self, Point2D pt) -> Point2D"""
1528 return _core_.Point2D___iadd__(*args, **kwargs)
1529
1530 def __isub__(*args, **kwargs):
1531 """__isub__(self, Point2D pt) -> Point2D"""
1532 return _core_.Point2D___isub__(*args, **kwargs)
1533
1534 def __imul__(*args, **kwargs):
1535 """__imul__(self, Point2D pt) -> Point2D"""
1536 return _core_.Point2D___imul__(*args, **kwargs)
1537
1538 def __idiv__(*args, **kwargs):
1539 """__idiv__(self, Point2D pt) -> Point2D"""
1540 return _core_.Point2D___idiv__(*args, **kwargs)
1541
1542 def __eq__(*args, **kwargs):
1543 """
1544 __eq__(self, PyObject other) -> bool
1545
1546 Test for equality of wx.Point2D objects.
1547 """
1548 return _core_.Point2D___eq__(*args, **kwargs)
1549
1550 def __ne__(*args, **kwargs):
1551 """
1552 __ne__(self, PyObject other) -> bool
1553
1554 Test for inequality of wx.Point2D objects.
1555 """
1556 return _core_.Point2D___ne__(*args, **kwargs)
1557
1558 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1559 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1560 def Set(*args, **kwargs):
1561 """Set(self, double x=0, double y=0)"""
1562 return _core_.Point2D_Set(*args, **kwargs)
1563
1564 def Get(*args, **kwargs):
1565 """
1566 Get() -> (x,y)
1567
1568 Return x and y properties as a tuple.
1569 """
1570 return _core_.Point2D_Get(*args, **kwargs)
1571
1572 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1573 def __str__(self): return str(self.Get())
1574 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1575 def __len__(self): return len(self.Get())
1576 def __getitem__(self, index): return self.Get()[index]
1577 def __setitem__(self, index, val):
1578 if index == 0: self.x = val
1579 elif index == 1: self.y = val
1580 else: raise IndexError
1581 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1582 __safe_for_unpickling__ = True
1583 def __reduce__(self): return (wx.Point2D, self.Get())
1584
1585 _core_.Point2D_swigregister(Point2D)
1586
1587 def Point2DCopy(*args, **kwargs):
1588 """
1589 Point2DCopy(Point2D pt) -> Point2D
1590
1591 Create a w.Point2D object.
1592 """
1593 val = _core_.new_Point2DCopy(*args, **kwargs)
1594 return val
1595
1596 def Point2DFromPoint(*args, **kwargs):
1597 """
1598 Point2DFromPoint(Point pt) -> Point2D
1599
1600 Create a w.Point2D object.
1601 """
1602 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1603 return val
1604
1605 #---------------------------------------------------------------------------
1606
1607 FromStart = _core_.FromStart
1608 FromCurrent = _core_.FromCurrent
1609 FromEnd = _core_.FromEnd
1610 class InputStream(object):
1611 """Proxy of C++ InputStream class"""
1612 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1613 __repr__ = _swig_repr
1614 def __init__(self, *args, **kwargs):
1615 """__init__(self, PyObject p) -> InputStream"""
1616 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1617 __swig_destroy__ = _core_.delete_InputStream
1618 __del__ = lambda self : None;
1619 def close(*args, **kwargs):
1620 """close(self)"""
1621 return _core_.InputStream_close(*args, **kwargs)
1622
1623 def flush(*args, **kwargs):
1624 """flush(self)"""
1625 return _core_.InputStream_flush(*args, **kwargs)
1626
1627 def eof(*args, **kwargs):
1628 """eof(self) -> bool"""
1629 return _core_.InputStream_eof(*args, **kwargs)
1630
1631 def read(*args, **kwargs):
1632 """read(self, int size=-1) -> PyObject"""
1633 return _core_.InputStream_read(*args, **kwargs)
1634
1635 def readline(*args, **kwargs):
1636 """readline(self, int size=-1) -> PyObject"""
1637 return _core_.InputStream_readline(*args, **kwargs)
1638
1639 def readlines(*args, **kwargs):
1640 """readlines(self, int sizehint=-1) -> PyObject"""
1641 return _core_.InputStream_readlines(*args, **kwargs)
1642
1643 def seek(*args, **kwargs):
1644 """seek(self, int offset, int whence=0)"""
1645 return _core_.InputStream_seek(*args, **kwargs)
1646
1647 def tell(*args, **kwargs):
1648 """tell(self) -> int"""
1649 return _core_.InputStream_tell(*args, **kwargs)
1650
1651 def Peek(*args, **kwargs):
1652 """Peek(self) -> char"""
1653 return _core_.InputStream_Peek(*args, **kwargs)
1654
1655 def GetC(*args, **kwargs):
1656 """GetC(self) -> char"""
1657 return _core_.InputStream_GetC(*args, **kwargs)
1658
1659 def LastRead(*args, **kwargs):
1660 """LastRead(self) -> size_t"""
1661 return _core_.InputStream_LastRead(*args, **kwargs)
1662
1663 def CanRead(*args, **kwargs):
1664 """CanRead(self) -> bool"""
1665 return _core_.InputStream_CanRead(*args, **kwargs)
1666
1667 def Eof(*args, **kwargs):
1668 """Eof(self) -> bool"""
1669 return _core_.InputStream_Eof(*args, **kwargs)
1670
1671 def Ungetch(*args, **kwargs):
1672 """Ungetch(self, char c) -> bool"""
1673 return _core_.InputStream_Ungetch(*args, **kwargs)
1674
1675 def SeekI(*args, **kwargs):
1676 """SeekI(self, long pos, int mode=FromStart) -> long"""
1677 return _core_.InputStream_SeekI(*args, **kwargs)
1678
1679 def TellI(*args, **kwargs):
1680 """TellI(self) -> long"""
1681 return _core_.InputStream_TellI(*args, **kwargs)
1682
1683 _core_.InputStream_swigregister(InputStream)
1684 DefaultPosition = cvar.DefaultPosition
1685 DefaultSize = cvar.DefaultSize
1686
1687 class OutputStream(object):
1688 """Proxy of C++ OutputStream class"""
1689 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1690 def __init__(self): raise AttributeError, "No constructor defined"
1691 __repr__ = _swig_repr
1692 def write(*args, **kwargs):
1693 """write(self, PyObject obj)"""
1694 return _core_.OutputStream_write(*args, **kwargs)
1695
1696 def LastWrite(*args, **kwargs):
1697 """LastWrite(self) -> size_t"""
1698 return _core_.OutputStream_LastWrite(*args, **kwargs)
1699
1700 _core_.OutputStream_swigregister(OutputStream)
1701
1702 #---------------------------------------------------------------------------
1703
1704 class FSFile(Object):
1705 """Proxy of C++ FSFile class"""
1706 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1707 __repr__ = _swig_repr
1708 def __init__(self, *args, **kwargs):
1709 """
1710 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1711 DateTime modif) -> FSFile
1712 """
1713 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1714 __swig_destroy__ = _core_.delete_FSFile
1715 __del__ = lambda self : None;
1716 def GetStream(*args, **kwargs):
1717 """GetStream(self) -> InputStream"""
1718 return _core_.FSFile_GetStream(*args, **kwargs)
1719
1720 def GetMimeType(*args, **kwargs):
1721 """GetMimeType(self) -> String"""
1722 return _core_.FSFile_GetMimeType(*args, **kwargs)
1723
1724 def GetLocation(*args, **kwargs):
1725 """GetLocation(self) -> String"""
1726 return _core_.FSFile_GetLocation(*args, **kwargs)
1727
1728 def GetAnchor(*args, **kwargs):
1729 """GetAnchor(self) -> String"""
1730 return _core_.FSFile_GetAnchor(*args, **kwargs)
1731
1732 def GetModificationTime(*args, **kwargs):
1733 """GetModificationTime(self) -> DateTime"""
1734 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1735
1736 _core_.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 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1746
1747 class FileSystemHandler(CPPFileSystemHandler):
1748 """Proxy of C++ FileSystemHandler class"""
1749 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1750 __repr__ = _swig_repr
1751 def __init__(self, *args, **kwargs):
1752 """__init__(self) -> FileSystemHandler"""
1753 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1754 self._setCallbackInfo(self, FileSystemHandler)
1755
1756 def _setCallbackInfo(*args, **kwargs):
1757 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1758 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1759
1760 def CanOpen(*args, **kwargs):
1761 """CanOpen(self, String location) -> bool"""
1762 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1763
1764 def OpenFile(*args, **kwargs):
1765 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1766 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1767
1768 def FindFirst(*args, **kwargs):
1769 """FindFirst(self, String spec, int flags=0) -> String"""
1770 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1771
1772 def FindNext(*args, **kwargs):
1773 """FindNext(self) -> String"""
1774 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1775
1776 def GetProtocol(*args, **kwargs):
1777 """GetProtocol(self, String location) -> String"""
1778 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1779
1780 def GetLeftLocation(*args, **kwargs):
1781 """GetLeftLocation(self, String location) -> String"""
1782 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1783
1784 def GetAnchor(*args, **kwargs):
1785 """GetAnchor(self, String location) -> String"""
1786 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1787
1788 def GetRightLocation(*args, **kwargs):
1789 """GetRightLocation(self, String location) -> String"""
1790 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1791
1792 def GetMimeTypeFromExt(*args, **kwargs):
1793 """GetMimeTypeFromExt(self, String location) -> String"""
1794 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1795
1796 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1797
1798 class FileSystem(Object):
1799 """Proxy of C++ FileSystem class"""
1800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1801 __repr__ = _swig_repr
1802 def __init__(self, *args, **kwargs):
1803 """__init__(self) -> FileSystem"""
1804 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1805 __swig_destroy__ = _core_.delete_FileSystem
1806 __del__ = lambda self : None;
1807 def ChangePathTo(*args, **kwargs):
1808 """ChangePathTo(self, String location, bool is_dir=False)"""
1809 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1810
1811 def GetPath(*args, **kwargs):
1812 """GetPath(self) -> String"""
1813 return _core_.FileSystem_GetPath(*args, **kwargs)
1814
1815 def OpenFile(*args, **kwargs):
1816 """OpenFile(self, String location) -> FSFile"""
1817 return _core_.FileSystem_OpenFile(*args, **kwargs)
1818
1819 def FindFirst(*args, **kwargs):
1820 """FindFirst(self, String spec, int flags=0) -> String"""
1821 return _core_.FileSystem_FindFirst(*args, **kwargs)
1822
1823 def FindNext(*args, **kwargs):
1824 """FindNext(self) -> String"""
1825 return _core_.FileSystem_FindNext(*args, **kwargs)
1826
1827 def AddHandler(*args, **kwargs):
1828 """AddHandler(CPPFileSystemHandler handler)"""
1829 return _core_.FileSystem_AddHandler(*args, **kwargs)
1830
1831 AddHandler = staticmethod(AddHandler)
1832 def CleanUpHandlers(*args, **kwargs):
1833 """CleanUpHandlers()"""
1834 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1835
1836 CleanUpHandlers = staticmethod(CleanUpHandlers)
1837 def FileNameToURL(*args, **kwargs):
1838 """FileNameToURL(String filename) -> String"""
1839 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1840
1841 FileNameToURL = staticmethod(FileNameToURL)
1842 def URLToFileName(*args, **kwargs):
1843 """URLToFileName(String url) -> String"""
1844 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1845
1846 URLToFileName = staticmethod(URLToFileName)
1847 _core_.FileSystem_swigregister(FileSystem)
1848
1849 def FileSystem_AddHandler(*args, **kwargs):
1850 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1851 return _core_.FileSystem_AddHandler(*args, **kwargs)
1852
1853 def FileSystem_CleanUpHandlers(*args):
1854 """FileSystem_CleanUpHandlers()"""
1855 return _core_.FileSystem_CleanUpHandlers(*args)
1856
1857 def FileSystem_FileNameToURL(*args, **kwargs):
1858 """FileSystem_FileNameToURL(String filename) -> String"""
1859 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1860
1861 def FileSystem_URLToFileName(*args, **kwargs):
1862 """FileSystem_URLToFileName(String url) -> String"""
1863 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1864
1865 class InternetFSHandler(CPPFileSystemHandler):
1866 """Proxy of C++ InternetFSHandler class"""
1867 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1868 __repr__ = _swig_repr
1869 def __init__(self, *args, **kwargs):
1870 """__init__(self) -> InternetFSHandler"""
1871 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1872 def CanOpen(*args, **kwargs):
1873 """CanOpen(self, String location) -> bool"""
1874 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1875
1876 def OpenFile(*args, **kwargs):
1877 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1878 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1879
1880 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1881
1882 class ZipFSHandler(CPPFileSystemHandler):
1883 """Proxy of C++ ZipFSHandler class"""
1884 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1885 __repr__ = _swig_repr
1886 def __init__(self, *args, **kwargs):
1887 """__init__(self) -> ZipFSHandler"""
1888 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1889 def CanOpen(*args, **kwargs):
1890 """CanOpen(self, String location) -> bool"""
1891 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1892
1893 def OpenFile(*args, **kwargs):
1894 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1895 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1896
1897 def FindFirst(*args, **kwargs):
1898 """FindFirst(self, String spec, int flags=0) -> String"""
1899 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1900
1901 def FindNext(*args, **kwargs):
1902 """FindNext(self) -> String"""
1903 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1904
1905 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1906
1907
1908 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1909 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1910 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1911
1912 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1913 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1914 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1915
1916 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1917 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1918 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1919 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1920 """
1921 Add 'file' to the memory filesystem. The dataItem parameter can
1922 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1923 arbitrary data. If a bitmap or image is used then the imgType
1924 parameter should specify what kind of image file it should be
1925 written as, wx.BITMAP_TYPE_PNG, etc.
1926 """
1927 if isinstance(dataItem, wx.Image):
1928 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1929 elif isinstance(dataItem, wx.Bitmap):
1930 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1931 elif type(dataItem) == str:
1932 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1933 else:
1934 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1935
1936 class MemoryFSHandler(CPPFileSystemHandler):
1937 """Proxy of C++ MemoryFSHandler class"""
1938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1939 __repr__ = _swig_repr
1940 def __init__(self, *args, **kwargs):
1941 """__init__(self) -> MemoryFSHandler"""
1942 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1943 def RemoveFile(*args, **kwargs):
1944 """RemoveFile(String filename)"""
1945 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1946
1947 RemoveFile = staticmethod(RemoveFile)
1948 AddFile = staticmethod(MemoryFSHandler_AddFile)
1949 def CanOpen(*args, **kwargs):
1950 """CanOpen(self, String location) -> bool"""
1951 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1952
1953 def OpenFile(*args, **kwargs):
1954 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1955 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1956
1957 def FindFirst(*args, **kwargs):
1958 """FindFirst(self, String spec, int flags=0) -> String"""
1959 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1960
1961 def FindNext(*args, **kwargs):
1962 """FindNext(self) -> String"""
1963 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1964
1965 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1966
1967 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1968 """MemoryFSHandler_RemoveFile(String filename)"""
1969 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1970
1971 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1972 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1973 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1974 #---------------------------------------------------------------------------
1975
1976 class ImageHandler(Object):
1977 """
1978 This is the base class for implementing image file loading/saving, and
1979 image creation from data. It is used within `wx.Image` and is not
1980 normally seen by the application.
1981 """
1982 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1983 def __init__(self): raise AttributeError, "No constructor defined"
1984 __repr__ = _swig_repr
1985 def GetName(*args, **kwargs):
1986 """GetName(self) -> String"""
1987 return _core_.ImageHandler_GetName(*args, **kwargs)
1988
1989 def GetExtension(*args, **kwargs):
1990 """GetExtension(self) -> String"""
1991 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1992
1993 def GetType(*args, **kwargs):
1994 """GetType(self) -> long"""
1995 return _core_.ImageHandler_GetType(*args, **kwargs)
1996
1997 def GetMimeType(*args, **kwargs):
1998 """GetMimeType(self) -> String"""
1999 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2000
2001 def CanRead(*args, **kwargs):
2002 """CanRead(self, String name) -> bool"""
2003 return _core_.ImageHandler_CanRead(*args, **kwargs)
2004
2005 def CanReadStream(*args, **kwargs):
2006 """CanReadStream(self, InputStream stream) -> bool"""
2007 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2008
2009 def SetName(*args, **kwargs):
2010 """SetName(self, String name)"""
2011 return _core_.ImageHandler_SetName(*args, **kwargs)
2012
2013 def SetExtension(*args, **kwargs):
2014 """SetExtension(self, String extension)"""
2015 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2016
2017 def SetType(*args, **kwargs):
2018 """SetType(self, long type)"""
2019 return _core_.ImageHandler_SetType(*args, **kwargs)
2020
2021 def SetMimeType(*args, **kwargs):
2022 """SetMimeType(self, String mimetype)"""
2023 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2024
2025 _core_.ImageHandler_swigregister(ImageHandler)
2026
2027 class PyImageHandler(ImageHandler):
2028 """
2029 This is the base class for implementing image file loading/saving, and
2030 image creation from data, all written in Python. To create a custom
2031 image handler derive a new class from wx.PyImageHandler and provide
2032 the following methods::
2033
2034 def DoCanRead(self, stream) --> bool
2035 '''Check if this handler can read the image on the stream'''
2036
2037 def LoadFile(self, image, stream, verbose, index) --> bool
2038 '''Load image data from the stream and load it into image.'''
2039
2040 def SaveFile(self, image, stream, verbose) --> bool
2041 '''Save the iamge data in image to the stream using
2042 this handler's image file format.'''
2043
2044 def GetImageCount(self, stream) --> int
2045 '''If this image format can hold more than one image,
2046 how many does the image on the stream have?'''
2047
2048 To activate your handler create an instance of it and pass it to
2049 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2050 `SetExtension` from your constructor.
2051
2052 """
2053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2054 __repr__ = _swig_repr
2055 def __init__(self, *args, **kwargs):
2056 """
2057 __init__(self) -> PyImageHandler
2058
2059 This is the base class for implementing image file loading/saving, and
2060 image creation from data, all written in Python. To create a custom
2061 image handler derive a new class from wx.PyImageHandler and provide
2062 the following methods::
2063
2064 def DoCanRead(self, stream) --> bool
2065 '''Check if this handler can read the image on the stream'''
2066
2067 def LoadFile(self, image, stream, verbose, index) --> bool
2068 '''Load image data from the stream and load it into image.'''
2069
2070 def SaveFile(self, image, stream, verbose) --> bool
2071 '''Save the iamge data in image to the stream using
2072 this handler's image file format.'''
2073
2074 def GetImageCount(self, stream) --> int
2075 '''If this image format can hold more than one image,
2076 how many does the image on the stream have?'''
2077
2078 To activate your handler create an instance of it and pass it to
2079 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2080 `SetExtension` from your constructor.
2081
2082 """
2083 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2084 self._SetSelf(self)
2085
2086 def _SetSelf(*args, **kwargs):
2087 """_SetSelf(self, PyObject self)"""
2088 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2089
2090 _core_.PyImageHandler_swigregister(PyImageHandler)
2091
2092 class ImageHistogram(object):
2093 """Proxy of C++ ImageHistogram class"""
2094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2095 __repr__ = _swig_repr
2096 def __init__(self, *args, **kwargs):
2097 """__init__(self) -> ImageHistogram"""
2098 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2099 def MakeKey(*args, **kwargs):
2100 """
2101 MakeKey(byte r, byte g, byte b) -> unsigned long
2102
2103 Get the key in the histogram for the given RGB values
2104 """
2105 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2106
2107 MakeKey = staticmethod(MakeKey)
2108 def FindFirstUnusedColour(*args, **kwargs):
2109 """
2110 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2111
2112 Find first colour that is not used in the image and has higher RGB
2113 values than startR, startG, startB. Returns a tuple consisting of a
2114 success flag and rgb values.
2115 """
2116 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2117
2118 def GetCount(*args, **kwargs):
2119 """
2120 GetCount(self, unsigned long key) -> unsigned long
2121
2122 Returns the pixel count for the given key. Use `MakeKey` to create a
2123 key value from a RGB tripple.
2124 """
2125 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2126
2127 def GetCountRGB(*args, **kwargs):
2128 """
2129 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2130
2131 Returns the pixel count for the given RGB values.
2132 """
2133 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2134
2135 def GetCountColour(*args, **kwargs):
2136 """
2137 GetCountColour(self, Colour colour) -> unsigned long
2138
2139 Returns the pixel count for the given `wx.Colour` value.
2140 """
2141 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2142
2143 _core_.ImageHistogram_swigregister(ImageHistogram)
2144
2145 def ImageHistogram_MakeKey(*args, **kwargs):
2146 """
2147 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2148
2149 Get the key in the histogram for the given RGB values
2150 """
2151 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2152
2153 class Image_RGBValue(object):
2154 """
2155 An object that contains values for red, green and blue which represent
2156 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2157 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2158 color space.
2159 """
2160 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2161 __repr__ = _swig_repr
2162 def __init__(self, *args, **kwargs):
2163 """
2164 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2165
2166 Constructor.
2167 """
2168 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2169 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2170 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2171 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2172 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2173
2174 class Image_HSVValue(object):
2175 """
2176 An object that contains values for hue, saturation and value which
2177 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2178 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2179 color space.
2180 """
2181 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2182 __repr__ = _swig_repr
2183 def __init__(self, *args, **kwargs):
2184 """
2185 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2186
2187 Constructor.
2188 """
2189 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2190 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2191 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2192 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2193 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2194
2195 class Image(Object):
2196 """
2197 A platform-independent image class. An image can be created from
2198 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2199 variety of formats. Functions are available to set and get image
2200 bits, so it can be used for basic image manipulation.
2201
2202 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2203 platform-specific `wx.Bitmap` object must be created from it using the
2204 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2205 device context, using `wx.DC.DrawBitmap`.
2206
2207 One colour value of the image may be used as a mask colour which will
2208 lead to the automatic creation of a `wx.Mask` object associated to the
2209 bitmap object.
2210
2211 wx.Image supports alpha channel data, that is in addition to a byte
2212 for the red, green and blue colour components for each pixel it also
2213 stores a byte representing the pixel opacity. An alpha value of 0
2214 corresponds to a transparent pixel (null opacity) while a value of 255
2215 means that the pixel is 100% opaque.
2216
2217 Unlike RGB data, not all images have an alpha channel and before using
2218 `GetAlpha` you should check if this image contains an alpha channel
2219 with `HasAlpha`. Note that currently only images loaded from PNG files
2220 with transparency information will have an alpha channel.
2221 """
2222 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2223 __repr__ = _swig_repr
2224 def __init__(self, *args, **kwargs):
2225 """
2226 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2227
2228 Loads an image from a file.
2229 """
2230 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2231 __swig_destroy__ = _core_.delete_Image
2232 __del__ = lambda self : None;
2233 def Create(*args, **kwargs):
2234 """
2235 Create(self, int width, int height, bool clear=True)
2236
2237 Creates a fresh image. If clear is ``True``, the new image will be
2238 initialized to black. Otherwise, the image data will be uninitialized.
2239 """
2240 return _core_.Image_Create(*args, **kwargs)
2241
2242 def Destroy(*args, **kwargs):
2243 """
2244 Destroy(self)
2245
2246 Destroys the image data.
2247 """
2248 val = _core_.Image_Destroy(*args, **kwargs)
2249 args[0].thisown = 0
2250 return val
2251
2252 def Scale(*args, **kwargs):
2253 """
2254 Scale(self, int width, int height) -> Image
2255
2256 Returns a scaled version of the image. This is also useful for scaling
2257 bitmaps in general as the only other way to scale bitmaps is to blit a
2258 `wx.MemoryDC` into another `wx.MemoryDC`.
2259 """
2260 return _core_.Image_Scale(*args, **kwargs)
2261
2262 def ShrinkBy(*args, **kwargs):
2263 """
2264 ShrinkBy(self, int xFactor, int yFactor) -> Image
2265
2266 Return a version of the image scaled smaller by the given factors.
2267 """
2268 return _core_.Image_ShrinkBy(*args, **kwargs)
2269
2270 def Rescale(*args, **kwargs):
2271 """
2272 Rescale(self, int width, int height) -> Image
2273
2274 Changes the size of the image in-place by scaling it: after a call to
2275 this function, the image will have the given width and height.
2276
2277 Returns the (modified) image itself.
2278 """
2279 return _core_.Image_Rescale(*args, **kwargs)
2280
2281 def Resize(*args, **kwargs):
2282 """
2283 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2284
2285 Changes the size of the image in-place without scaling it, by adding
2286 either a border with the given colour or cropping as necessary. The
2287 image is pasted into a new image with the given size and background
2288 colour at the position pos relative to the upper left of the new
2289 image. If red = green = blue = -1 then use either the current mask
2290 colour if set or find, use, and set a suitable mask colour for any
2291 newly exposed areas.
2292
2293 Returns the (modified) image itself.
2294 """
2295 return _core_.Image_Resize(*args, **kwargs)
2296
2297 def SetRGB(*args, **kwargs):
2298 """
2299 SetRGB(self, int x, int y, byte r, byte g, byte b)
2300
2301 Sets the pixel at the given coordinate. This routine performs
2302 bounds-checks for the coordinate so it can be considered a safe way to
2303 manipulate the data, but in some cases this might be too slow so that
2304 the data will have to be set directly. In that case you will have to
2305 get access to the image data using the `GetData` method.
2306 """
2307 return _core_.Image_SetRGB(*args, **kwargs)
2308
2309 def SetRGBRect(*args, **kwargs):
2310 """
2311 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2312
2313 Sets the colour of the pixels within the given rectangle. This routine
2314 performs bounds-checks for the rectangle so it can be considered a
2315 safe way to manipulate the data.
2316 """
2317 return _core_.Image_SetRGBRect(*args, **kwargs)
2318
2319 def GetRed(*args, **kwargs):
2320 """
2321 GetRed(self, int x, int y) -> byte
2322
2323 Returns the red intensity at the given coordinate.
2324 """
2325 return _core_.Image_GetRed(*args, **kwargs)
2326
2327 def GetGreen(*args, **kwargs):
2328 """
2329 GetGreen(self, int x, int y) -> byte
2330
2331 Returns the green intensity at the given coordinate.
2332 """
2333 return _core_.Image_GetGreen(*args, **kwargs)
2334
2335 def GetBlue(*args, **kwargs):
2336 """
2337 GetBlue(self, int x, int y) -> byte
2338
2339 Returns the blue intensity at the given coordinate.
2340 """
2341 return _core_.Image_GetBlue(*args, **kwargs)
2342
2343 def SetAlpha(*args, **kwargs):
2344 """
2345 SetAlpha(self, int x, int y, byte alpha)
2346
2347 Sets the alpha value for the given pixel. This function should only be
2348 called if the image has alpha channel data, use `HasAlpha` to check
2349 for this.
2350 """
2351 return _core_.Image_SetAlpha(*args, **kwargs)
2352
2353 def GetAlpha(*args, **kwargs):
2354 """
2355 GetAlpha(self, int x, int y) -> byte
2356
2357 Returns the alpha value for the given pixel. This function may only be
2358 called for the images with alpha channel, use `HasAlpha` to check for
2359 this.
2360
2361 The returned value is the *opacity* of the image, i.e. the value of 0
2362 corresponds to the fully transparent pixels while the value of 255 to
2363 the fully opaque pixels.
2364 """
2365 return _core_.Image_GetAlpha(*args, **kwargs)
2366
2367 def HasAlpha(*args, **kwargs):
2368 """
2369 HasAlpha(self) -> bool
2370
2371 Returns true if this image has alpha channel, false otherwise.
2372 """
2373 return _core_.Image_HasAlpha(*args, **kwargs)
2374
2375 def InitAlpha(*args, **kwargs):
2376 """
2377 InitAlpha(self)
2378
2379 Initializes the image alpha channel data. It is an error to call it if
2380 the image already has alpha data. If it doesn't, alpha data will be by
2381 default initialized to all pixels being fully opaque. But if the image
2382 has a a mask colour, all mask pixels will be completely transparent.
2383 """
2384 return _core_.Image_InitAlpha(*args, **kwargs)
2385
2386 def IsTransparent(*args, **kwargs):
2387 """
2388 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2389
2390 Returns ``True`` if this pixel is masked or has an alpha value less
2391 than the spcified threshold.
2392 """
2393 return _core_.Image_IsTransparent(*args, **kwargs)
2394
2395 def FindFirstUnusedColour(*args, **kwargs):
2396 """
2397 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2398
2399 Find first colour that is not used in the image and has higher RGB
2400 values than startR, startG, startB. Returns a tuple consisting of a
2401 success flag and rgb values.
2402 """
2403 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2404
2405 def ConvertAlphaToMask(*args, **kwargs):
2406 """
2407 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2408
2409 If the image has alpha channel, this method converts it to mask. All
2410 pixels with alpha value less than ``threshold`` are replaced with the
2411 mask colour and the alpha channel is removed. The mask colour is
2412 chosen automatically using `FindFirstUnusedColour`.
2413
2414 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2415 nothing.
2416 """
2417 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2418
2419 def ConvertColourToAlpha(*args, **kwargs):
2420 """
2421 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2422
2423 This method converts an image where the original alpha information is
2424 only available as a shades of a colour (actually shades of grey)
2425 typically when you draw anti-aliased text into a bitmap. The DC
2426 drawing routines draw grey values on the black background although
2427 they actually mean to draw white with differnt alpha values. This
2428 method reverses it, assuming a black (!) background and white text.
2429 The method will then fill up the whole image with the colour given.
2430 """
2431 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2432
2433 def SetMaskFromImage(*args, **kwargs):
2434 """
2435 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2436
2437 Sets the image's mask so that the pixels that have RGB value of
2438 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2439 by first finding an unused colour in the image, setting this colour as
2440 the mask colour and then using this colour to draw all pixels in the
2441 image who corresponding pixel in mask has given RGB value.
2442
2443 Returns ``False`` if ``mask`` does not have same dimensions as the
2444 image or if there is no unused colour left. Returns ``True`` if the
2445 mask was successfully applied.
2446
2447 Note that this method involves computing the histogram, which is
2448 computationally intensive operation.
2449 """
2450 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2451
2452 def CanRead(*args, **kwargs):
2453 """
2454 CanRead(String filename) -> bool
2455
2456 Returns True if the image handlers can read this file.
2457 """
2458 return _core_.Image_CanRead(*args, **kwargs)
2459
2460 CanRead = staticmethod(CanRead)
2461 def GetImageCount(*args, **kwargs):
2462 """
2463 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2464
2465 If the image file contains more than one image and the image handler
2466 is capable of retrieving these individually, this function will return
2467 the number of available images.
2468 """
2469 return _core_.Image_GetImageCount(*args, **kwargs)
2470
2471 GetImageCount = staticmethod(GetImageCount)
2472 def LoadFile(*args, **kwargs):
2473 """
2474 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2475
2476 Loads an image from a file. If no handler type is provided, the
2477 library will try to autodetect the format.
2478 """
2479 return _core_.Image_LoadFile(*args, **kwargs)
2480
2481 def LoadMimeFile(*args, **kwargs):
2482 """
2483 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2484
2485 Loads an image from a file, specifying the image type with a MIME type
2486 string.
2487 """
2488 return _core_.Image_LoadMimeFile(*args, **kwargs)
2489
2490 def SaveFile(*args, **kwargs):
2491 """
2492 SaveFile(self, String name, int type) -> bool
2493
2494 Saves an image in the named file.
2495 """
2496 return _core_.Image_SaveFile(*args, **kwargs)
2497
2498 def SaveMimeFile(*args, **kwargs):
2499 """
2500 SaveMimeFile(self, String name, String mimetype) -> bool
2501
2502 Saves an image in the named file.
2503 """
2504 return _core_.Image_SaveMimeFile(*args, **kwargs)
2505
2506 def CanReadStream(*args, **kwargs):
2507 """
2508 CanReadStream(InputStream stream) -> bool
2509
2510 Returns True if the image handlers can read an image file from the
2511 data currently on the input stream, or a readable Python file-like
2512 object.
2513 """
2514 return _core_.Image_CanReadStream(*args, **kwargs)
2515
2516 CanReadStream = staticmethod(CanReadStream)
2517 def LoadStream(*args, **kwargs):
2518 """
2519 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2520
2521 Loads an image from an input stream or a readable Python file-like
2522 object. If no handler type is provided, the library will try to
2523 autodetect the format.
2524 """
2525 return _core_.Image_LoadStream(*args, **kwargs)
2526
2527 def LoadMimeStream(*args, **kwargs):
2528 """
2529 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2530
2531 Loads an image from an input stream or a readable Python file-like
2532 object, using a MIME type string to specify the image file format.
2533 """
2534 return _core_.Image_LoadMimeStream(*args, **kwargs)
2535
2536 def Ok(*args, **kwargs):
2537 """
2538 Ok(self) -> bool
2539
2540 Returns true if image data is present.
2541 """
2542 return _core_.Image_Ok(*args, **kwargs)
2543
2544 def GetWidth(*args, **kwargs):
2545 """
2546 GetWidth(self) -> int
2547
2548 Gets the width of the image in pixels.
2549 """
2550 return _core_.Image_GetWidth(*args, **kwargs)
2551
2552 def GetHeight(*args, **kwargs):
2553 """
2554 GetHeight(self) -> int
2555
2556 Gets the height of the image in pixels.
2557 """
2558 return _core_.Image_GetHeight(*args, **kwargs)
2559
2560 def GetSize(*args, **kwargs):
2561 """
2562 GetSize(self) -> Size
2563
2564 Returns the size of the image in pixels.
2565 """
2566 return _core_.Image_GetSize(*args, **kwargs)
2567
2568 def GetSubImage(*args, **kwargs):
2569 """
2570 GetSubImage(self, Rect rect) -> Image
2571
2572 Returns a sub image of the current one as long as the rect belongs
2573 entirely to the image.
2574 """
2575 return _core_.Image_GetSubImage(*args, **kwargs)
2576
2577 def Size(*args, **kwargs):
2578 """
2579 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2580
2581 Returns a resized version of this image without scaling it by adding
2582 either a border with the given colour or cropping as necessary. The
2583 image is pasted into a new image with the given size and background
2584 colour at the position ``pos`` relative to the upper left of the new
2585 image. If red = green = blue = -1 then use either the current mask
2586 colour if set or find, use, and set a suitable mask colour for any
2587 newly exposed areas.
2588 """
2589 return _core_.Image_Size(*args, **kwargs)
2590
2591 def Copy(*args, **kwargs):
2592 """
2593 Copy(self) -> Image
2594
2595 Returns an identical copy of the image.
2596 """
2597 return _core_.Image_Copy(*args, **kwargs)
2598
2599 def Paste(*args, **kwargs):
2600 """
2601 Paste(self, Image image, int x, int y)
2602
2603 Pastes ``image`` into this instance and takes care of the mask colour
2604 and any out of bounds problems.
2605 """
2606 return _core_.Image_Paste(*args, **kwargs)
2607
2608 def GetData(*args, **kwargs):
2609 """
2610 GetData(self) -> PyObject
2611
2612 Returns a string containing a copy of the RGB bytes of the image.
2613 """
2614 return _core_.Image_GetData(*args, **kwargs)
2615
2616 def SetData(*args, **kwargs):
2617 """
2618 SetData(self, buffer data)
2619
2620 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2621 either a string or a buffer object holding the data and the length of
2622 the data must be width*height*3.
2623 """
2624 return _core_.Image_SetData(*args, **kwargs)
2625
2626 def GetDataBuffer(*args, **kwargs):
2627 """
2628 GetDataBuffer(self) -> PyObject
2629
2630 Returns a writable Python buffer object that is pointing at the RGB
2631 image data buffer inside the wx.Image. You need to ensure that you do
2632 not use this buffer object after the image has been destroyed.
2633 """
2634 return _core_.Image_GetDataBuffer(*args, **kwargs)
2635
2636 def SetDataBuffer(*args, **kwargs):
2637 """
2638 SetDataBuffer(self, buffer data)
2639
2640 Sets the internal image data pointer to point at a Python buffer
2641 object. This can save making an extra copy of the data but you must
2642 ensure that the buffer object lives longer than the wx.Image does.
2643 """
2644 return _core_.Image_SetDataBuffer(*args, **kwargs)
2645
2646 def GetAlphaData(*args, **kwargs):
2647 """
2648 GetAlphaData(self) -> PyObject
2649
2650 Returns a string containing a copy of the alpha bytes of the image.
2651 """
2652 return _core_.Image_GetAlphaData(*args, **kwargs)
2653
2654 def SetAlphaData(*args, **kwargs):
2655 """
2656 SetAlphaData(self, buffer alpha)
2657
2658 Resets the Image's alpha data from a buffer of bytes. Accepts either
2659 a string or a buffer object holding the data and the length of the
2660 data must be width*height.
2661 """
2662 return _core_.Image_SetAlphaData(*args, **kwargs)
2663
2664 def GetAlphaBuffer(*args, **kwargs):
2665 """
2666 GetAlphaBuffer(self) -> PyObject
2667
2668 Returns a writable Python buffer object that is pointing at the Alpha
2669 data buffer inside the wx.Image. You need to ensure that you do not
2670 use this buffer object after the image has been destroyed.
2671 """
2672 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2673
2674 def SetAlphaBuffer(*args, **kwargs):
2675 """
2676 SetAlphaBuffer(self, buffer alpha)
2677
2678 Sets the internal image alpha pointer to point at a Python buffer
2679 object. This can save making an extra copy of the data but you must
2680 ensure that the buffer object lives as long as the wx.Image does.
2681 """
2682 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2683
2684 def SetMaskColour(*args, **kwargs):
2685 """
2686 SetMaskColour(self, byte r, byte g, byte b)
2687
2688 Sets the mask colour for this image (and tells the image to use the
2689 mask).
2690 """
2691 return _core_.Image_SetMaskColour(*args, **kwargs)
2692
2693 def GetOrFindMaskColour(*args, **kwargs):
2694 """
2695 GetOrFindMaskColour() -> (r,g,b)
2696
2697 Get the current mask colour or find a suitable colour.
2698 """
2699 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2700
2701 def GetMaskRed(*args, **kwargs):
2702 """
2703 GetMaskRed(self) -> byte
2704
2705 Gets the red component of the mask colour.
2706 """
2707 return _core_.Image_GetMaskRed(*args, **kwargs)
2708
2709 def GetMaskGreen(*args, **kwargs):
2710 """
2711 GetMaskGreen(self) -> byte
2712
2713 Gets the green component of the mask colour.
2714 """
2715 return _core_.Image_GetMaskGreen(*args, **kwargs)
2716
2717 def GetMaskBlue(*args, **kwargs):
2718 """
2719 GetMaskBlue(self) -> byte
2720
2721 Gets the blue component of the mask colour.
2722 """
2723 return _core_.Image_GetMaskBlue(*args, **kwargs)
2724
2725 def SetMask(*args, **kwargs):
2726 """
2727 SetMask(self, bool mask=True)
2728
2729 Specifies whether there is a mask or not. The area of the mask is
2730 determined by the current mask colour.
2731 """
2732 return _core_.Image_SetMask(*args, **kwargs)
2733
2734 def HasMask(*args, **kwargs):
2735 """
2736 HasMask(self) -> bool
2737
2738 Returns ``True`` if there is a mask active, ``False`` otherwise.
2739 """
2740 return _core_.Image_HasMask(*args, **kwargs)
2741
2742 def Rotate(*args, **kwargs):
2743 """
2744 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2745 Point offset_after_rotation=None) -> Image
2746
2747 Rotates the image about the given point, by ``angle`` radians. Passing
2748 ``True`` to ``interpolating`` results in better image quality, but is
2749 slower. If the image has a mask, then the mask colour is used for the
2750 uncovered pixels in the rotated image background. Otherwise, black
2751 will be used as the fill colour.
2752
2753 Returns the rotated image, leaving this image intact.
2754 """
2755 return _core_.Image_Rotate(*args, **kwargs)
2756
2757 def Rotate90(*args, **kwargs):
2758 """
2759 Rotate90(self, bool clockwise=True) -> Image
2760
2761 Returns a copy of the image rotated 90 degrees in the direction
2762 indicated by ``clockwise``.
2763 """
2764 return _core_.Image_Rotate90(*args, **kwargs)
2765
2766 def Mirror(*args, **kwargs):
2767 """
2768 Mirror(self, bool horizontally=True) -> Image
2769
2770 Returns a mirrored copy of the image. The parameter ``horizontally``
2771 indicates the orientation.
2772 """
2773 return _core_.Image_Mirror(*args, **kwargs)
2774
2775 def Replace(*args, **kwargs):
2776 """
2777 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2778
2779 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2780 ``(r2,g2,b2)``.
2781 """
2782 return _core_.Image_Replace(*args, **kwargs)
2783
2784 def ConvertToGreyscale(*args, **kwargs):
2785 """
2786 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2787
2788 Convert to greyscale image. Uses the luminance component (Y) of the
2789 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2790 defaults to ITU-T BT.601
2791 """
2792 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2793
2794 def ConvertToMono(*args, **kwargs):
2795 """
2796 ConvertToMono(self, byte r, byte g, byte b) -> Image
2797
2798 Returns monochromatic version of the image. The returned image has
2799 white colour where the original has ``(r,g,b)`` colour and black
2800 colour everywhere else.
2801 """
2802 return _core_.Image_ConvertToMono(*args, **kwargs)
2803
2804 def SetOption(*args, **kwargs):
2805 """
2806 SetOption(self, String name, String value)
2807
2808 Sets an image handler defined option. For example, when saving as a
2809 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2810 number between 0 and 100 (0 is terrible, 100 is very good).
2811 """
2812 return _core_.Image_SetOption(*args, **kwargs)
2813
2814 def SetOptionInt(*args, **kwargs):
2815 """
2816 SetOptionInt(self, String name, int value)
2817
2818 Sets an image option as an integer.
2819 """
2820 return _core_.Image_SetOptionInt(*args, **kwargs)
2821
2822 def GetOption(*args, **kwargs):
2823 """
2824 GetOption(self, String name) -> String
2825
2826 Gets the value of an image handler option.
2827 """
2828 return _core_.Image_GetOption(*args, **kwargs)
2829
2830 def GetOptionInt(*args, **kwargs):
2831 """
2832 GetOptionInt(self, String name) -> int
2833
2834 Gets the value of an image handler option as an integer. If the given
2835 option is not present, the function returns 0.
2836 """
2837 return _core_.Image_GetOptionInt(*args, **kwargs)
2838
2839 def HasOption(*args, **kwargs):
2840 """
2841 HasOption(self, String name) -> bool
2842
2843 Returns true if the given option is present.
2844 """
2845 return _core_.Image_HasOption(*args, **kwargs)
2846
2847 def CountColours(*args, **kwargs):
2848 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2849 return _core_.Image_CountColours(*args, **kwargs)
2850
2851 def ComputeHistogram(*args, **kwargs):
2852 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2853 return _core_.Image_ComputeHistogram(*args, **kwargs)
2854
2855 def AddHandler(*args, **kwargs):
2856 """AddHandler(ImageHandler handler)"""
2857 return _core_.Image_AddHandler(*args, **kwargs)
2858
2859 AddHandler = staticmethod(AddHandler)
2860 def InsertHandler(*args, **kwargs):
2861 """InsertHandler(ImageHandler handler)"""
2862 return _core_.Image_InsertHandler(*args, **kwargs)
2863
2864 InsertHandler = staticmethod(InsertHandler)
2865 def RemoveHandler(*args, **kwargs):
2866 """RemoveHandler(String name) -> bool"""
2867 return _core_.Image_RemoveHandler(*args, **kwargs)
2868
2869 RemoveHandler = staticmethod(RemoveHandler)
2870 def GetHandlers(*args, **kwargs):
2871 """GetHandlers() -> PyObject"""
2872 return _core_.Image_GetHandlers(*args, **kwargs)
2873
2874 GetHandlers = staticmethod(GetHandlers)
2875 def GetImageExtWildcard(*args, **kwargs):
2876 """
2877 GetImageExtWildcard() -> String
2878
2879 Iterates all registered wxImageHandler objects, and returns a string
2880 containing file extension masks suitable for passing to file open/save
2881 dialog boxes.
2882 """
2883 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2884
2885 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2886 def ConvertToBitmap(*args, **kwargs):
2887 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2888 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2889
2890 def ConvertToMonoBitmap(*args, **kwargs):
2891 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2892 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2893
2894 def RotateHue(*args, **kwargs):
2895 """
2896 RotateHue(self, double angle)
2897
2898 Rotates the hue of each pixel of the image. Hue is a double in the
2899 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2900 """
2901 return _core_.Image_RotateHue(*args, **kwargs)
2902
2903 def RGBtoHSV(*args, **kwargs):
2904 """
2905 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2906
2907 Converts a color in RGB color space to HSV color space.
2908 """
2909 return _core_.Image_RGBtoHSV(*args, **kwargs)
2910
2911 RGBtoHSV = staticmethod(RGBtoHSV)
2912 def HSVtoRGB(*args, **kwargs):
2913 """
2914 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2915
2916 Converts a color in HSV color space to RGB color space.
2917 """
2918 return _core_.Image_HSVtoRGB(*args, **kwargs)
2919
2920 HSVtoRGB = staticmethod(HSVtoRGB)
2921 def __nonzero__(self): return self.Ok()
2922 _core_.Image_swigregister(Image)
2923
2924 def ImageFromMime(*args, **kwargs):
2925 """
2926 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2927
2928 Loads an image from a file, using a MIME type string (such as
2929 'image/jpeg') to specify image type.
2930 """
2931 val = _core_.new_ImageFromMime(*args, **kwargs)
2932 return val
2933
2934 def ImageFromStream(*args, **kwargs):
2935 """
2936 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2937
2938 Loads an image from an input stream, or any readable Python file-like
2939 object.
2940 """
2941 val = _core_.new_ImageFromStream(*args, **kwargs)
2942 return val
2943
2944 def ImageFromStreamMime(*args, **kwargs):
2945 """
2946 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2947
2948 Loads an image from an input stream, or any readable Python file-like
2949 object, specifying the image format with a MIME type string.
2950 """
2951 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2952 return val
2953
2954 def EmptyImage(*args, **kwargs):
2955 """
2956 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2957
2958 Construct an empty image of a given size, optionally setting all
2959 pixels to black.
2960 """
2961 val = _core_.new_EmptyImage(*args, **kwargs)
2962 return val
2963
2964 def ImageFromBitmap(*args, **kwargs):
2965 """
2966 ImageFromBitmap(Bitmap bitmap) -> Image
2967
2968 Construct an Image from a `wx.Bitmap`.
2969 """
2970 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2971 return val
2972
2973 def ImageFromData(*args, **kwargs):
2974 """
2975 ImageFromData(int width, int height, buffer data) -> Image
2976
2977 Construct an Image from a buffer of RGB bytes. Accepts either a
2978 string or a buffer object holding the data and the length of the data
2979 must be width*height*3.
2980 """
2981 val = _core_.new_ImageFromData(*args, **kwargs)
2982 return val
2983
2984 def ImageFromDataWithAlpha(*args, **kwargs):
2985 """
2986 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2987
2988 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2989 Accepts either a string or a buffer object holding the data and the
2990 length of the data must be width*height*3 bytes, and the length of the
2991 alpha data must be width*height bytes.
2992 """
2993 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2994 return val
2995
2996 def Image_CanRead(*args, **kwargs):
2997 """
2998 Image_CanRead(String filename) -> bool
2999
3000 Returns True if the image handlers can read this file.
3001 """
3002 return _core_.Image_CanRead(*args, **kwargs)
3003
3004 def Image_GetImageCount(*args, **kwargs):
3005 """
3006 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3007
3008 If the image file contains more than one image and the image handler
3009 is capable of retrieving these individually, this function will return
3010 the number of available images.
3011 """
3012 return _core_.Image_GetImageCount(*args, **kwargs)
3013
3014 def Image_CanReadStream(*args, **kwargs):
3015 """
3016 Image_CanReadStream(InputStream stream) -> bool
3017
3018 Returns True if the image handlers can read an image file from the
3019 data currently on the input stream, or a readable Python file-like
3020 object.
3021 """
3022 return _core_.Image_CanReadStream(*args, **kwargs)
3023
3024 def Image_AddHandler(*args, **kwargs):
3025 """Image_AddHandler(ImageHandler handler)"""
3026 return _core_.Image_AddHandler(*args, **kwargs)
3027
3028 def Image_InsertHandler(*args, **kwargs):
3029 """Image_InsertHandler(ImageHandler handler)"""
3030 return _core_.Image_InsertHandler(*args, **kwargs)
3031
3032 def Image_RemoveHandler(*args, **kwargs):
3033 """Image_RemoveHandler(String name) -> bool"""
3034 return _core_.Image_RemoveHandler(*args, **kwargs)
3035
3036 def Image_GetHandlers(*args):
3037 """Image_GetHandlers() -> PyObject"""
3038 return _core_.Image_GetHandlers(*args)
3039
3040 def Image_GetImageExtWildcard(*args):
3041 """
3042 Image_GetImageExtWildcard() -> String
3043
3044 Iterates all registered wxImageHandler objects, and returns a string
3045 containing file extension masks suitable for passing to file open/save
3046 dialog boxes.
3047 """
3048 return _core_.Image_GetImageExtWildcard(*args)
3049
3050 def Image_RGBtoHSV(*args, **kwargs):
3051 """
3052 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3053
3054 Converts a color in RGB color space to HSV color space.
3055 """
3056 return _core_.Image_RGBtoHSV(*args, **kwargs)
3057
3058 def Image_HSVtoRGB(*args, **kwargs):
3059 """
3060 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3061
3062 Converts a color in HSV color space to RGB color space.
3063 """
3064 return _core_.Image_HSVtoRGB(*args, **kwargs)
3065
3066
3067 def _ImageFromBuffer(*args, **kwargs):
3068 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3069 return _core_._ImageFromBuffer(*args, **kwargs)
3070 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3071 """
3072 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3073 parameter must be a Python object that implements the buffer interface, or
3074 is convertable to a buffer object, such as a string, array, etc. The
3075 dataBuffer object is expected to contain a series of RGB bytes and be
3076 width*height*3 bytes long. A buffer object can optionally be supplied for
3077 the image's alpha channel data, and it is expected to be width*height
3078 bytes long.
3079
3080 The wx.Image will be created with its data and alpha pointers initialized
3081 to the memory address pointed to by the buffer objects, thus saving the
3082 time needed to copy the image data from the buffer object to the wx.Image.
3083 While this has advantages, it also has the shoot-yourself-in-the-foot
3084 risks associated with sharing a C pointer between two objects.
3085
3086 To help alleviate the risk a reference to the data and alpha buffer
3087 objects are kept with the wx.Image, so that they won't get deleted until
3088 after the wx.Image is deleted. However please be aware that it is not
3089 guaranteed that an object won't move its memory buffer to a new location
3090 when it needs to resize its contents. If that happens then the wx.Image
3091 will end up referring to an invalid memory location and could cause the
3092 application to crash. Therefore care should be taken to not manipulate
3093 the objects used for the data and alpha buffers in a way that would cause
3094 them to change size.
3095 """
3096 if not isinstance(dataBuffer, buffer):
3097 dataBuffer = buffer(dataBuffer)
3098 if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
3099 alphaBuffer = buffer(alphaBuffer)
3100 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3101 image._buffer = dataBuffer
3102 image._alpha = alphaBuffer
3103 return image
3104
3105 def InitAllImageHandlers():
3106 """
3107 The former functionality of InitAllImageHanders is now done internal to
3108 the _core_ extension module and so this function has become a simple NOP.
3109 """
3110 pass
3111
3112 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3113 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3114 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3115 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3116 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3117 BMP_24BPP = _core_.BMP_24BPP
3118 BMP_8BPP = _core_.BMP_8BPP
3119 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3120 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3121 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3122 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3123 BMP_4BPP = _core_.BMP_4BPP
3124 BMP_1BPP = _core_.BMP_1BPP
3125 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3126 class BMPHandler(ImageHandler):
3127 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3128 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3129 __repr__ = _swig_repr
3130 def __init__(self, *args, **kwargs):
3131 """
3132 __init__(self) -> BMPHandler
3133
3134 A `wx.ImageHandler` for \*.bmp bitmap files.
3135 """
3136 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3137 _core_.BMPHandler_swigregister(BMPHandler)
3138 NullImage = cvar.NullImage
3139 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3140 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3141 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3142 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3143 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3144 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3145 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3146 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3147 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3148 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3149 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3150 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3151 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3152 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3153 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3154
3155 class ICOHandler(BMPHandler):
3156 """A `wx.ImageHandler` for \*.ico icon 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) -> ICOHandler
3162
3163 A `wx.ImageHandler` for \*.ico icon files.
3164 """
3165 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3166 _core_.ICOHandler_swigregister(ICOHandler)
3167
3168 class CURHandler(ICOHandler):
3169 """A `wx.ImageHandler` for \*.cur cursor files."""
3170 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3171 __repr__ = _swig_repr
3172 def __init__(self, *args, **kwargs):
3173 """
3174 __init__(self) -> CURHandler
3175
3176 A `wx.ImageHandler` for \*.cur cursor files.
3177 """
3178 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3179 _core_.CURHandler_swigregister(CURHandler)
3180
3181 class ANIHandler(CURHandler):
3182 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3183 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3184 __repr__ = _swig_repr
3185 def __init__(self, *args, **kwargs):
3186 """
3187 __init__(self) -> ANIHandler
3188
3189 A `wx.ImageHandler` for \*.ani animated cursor files.
3190 """
3191 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3192 _core_.ANIHandler_swigregister(ANIHandler)
3193
3194 class PNGHandler(ImageHandler):
3195 """A `wx.ImageHandler` for PNG image files."""
3196 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3197 __repr__ = _swig_repr
3198 def __init__(self, *args, **kwargs):
3199 """
3200 __init__(self) -> PNGHandler
3201
3202 A `wx.ImageHandler` for PNG image files.
3203 """
3204 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3205 _core_.PNGHandler_swigregister(PNGHandler)
3206
3207 class GIFHandler(ImageHandler):
3208 """A `wx.ImageHandler` for GIF image files."""
3209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3210 __repr__ = _swig_repr
3211 def __init__(self, *args, **kwargs):
3212 """
3213 __init__(self) -> GIFHandler
3214
3215 A `wx.ImageHandler` for GIF image files.
3216 """
3217 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3218 _core_.GIFHandler_swigregister(GIFHandler)
3219
3220 class PCXHandler(ImageHandler):
3221 """A `wx.ImageHandler` for PCX imager files."""
3222 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3223 __repr__ = _swig_repr
3224 def __init__(self, *args, **kwargs):
3225 """
3226 __init__(self) -> PCXHandler
3227
3228 A `wx.ImageHandler` for PCX imager files.
3229 """
3230 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3231 _core_.PCXHandler_swigregister(PCXHandler)
3232
3233 class JPEGHandler(ImageHandler):
3234 """A `wx.ImageHandler` for JPEG/JPG image files."""
3235 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3236 __repr__ = _swig_repr
3237 def __init__(self, *args, **kwargs):
3238 """
3239 __init__(self) -> JPEGHandler
3240
3241 A `wx.ImageHandler` for JPEG/JPG image files.
3242 """
3243 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3244 _core_.JPEGHandler_swigregister(JPEGHandler)
3245
3246 class PNMHandler(ImageHandler):
3247 """A `wx.ImageHandler` for PNM image files."""
3248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3249 __repr__ = _swig_repr
3250 def __init__(self, *args, **kwargs):
3251 """
3252 __init__(self) -> PNMHandler
3253
3254 A `wx.ImageHandler` for PNM image files.
3255 """
3256 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3257 _core_.PNMHandler_swigregister(PNMHandler)
3258
3259 class XPMHandler(ImageHandler):
3260 """A `wx.ImageHandler` for XPM image."""
3261 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3262 __repr__ = _swig_repr
3263 def __init__(self, *args, **kwargs):
3264 """
3265 __init__(self) -> XPMHandler
3266
3267 A `wx.ImageHandler` for XPM image.
3268 """
3269 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3270 _core_.XPMHandler_swigregister(XPMHandler)
3271
3272 class TIFFHandler(ImageHandler):
3273 """A `wx.ImageHandler` for TIFF image files."""
3274 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3275 __repr__ = _swig_repr
3276 def __init__(self, *args, **kwargs):
3277 """
3278 __init__(self) -> TIFFHandler
3279
3280 A `wx.ImageHandler` for TIFF image files.
3281 """
3282 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3283 _core_.TIFFHandler_swigregister(TIFFHandler)
3284
3285 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3286 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3287 class Quantize(object):
3288 """Performs quantization, or colour reduction, on a wxImage."""
3289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3290 def __init__(self): raise AttributeError, "No constructor defined"
3291 __repr__ = _swig_repr
3292 def Quantize(*args, **kwargs):
3293 """
3294 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3295
3296 Reduce the colours in the source image and put the result into the
3297 destination image, setting the palette in the destination if
3298 needed. Both images may be the same, to overwrite the source image.
3299 """
3300 return _core_.Quantize_Quantize(*args, **kwargs)
3301
3302 Quantize = staticmethod(Quantize)
3303 _core_.Quantize_swigregister(Quantize)
3304
3305 def Quantize_Quantize(*args, **kwargs):
3306 """
3307 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3308
3309 Reduce the colours in the source image and put the result into the
3310 destination image, setting the palette in the destination if
3311 needed. Both images may be the same, to overwrite the source image.
3312 """
3313 return _core_.Quantize_Quantize(*args, **kwargs)
3314
3315 #---------------------------------------------------------------------------
3316
3317 class EvtHandler(Object):
3318 """Proxy of C++ EvtHandler class"""
3319 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3320 __repr__ = _swig_repr
3321 def __init__(self, *args, **kwargs):
3322 """__init__(self) -> EvtHandler"""
3323 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3324 def GetNextHandler(*args, **kwargs):
3325 """GetNextHandler(self) -> EvtHandler"""
3326 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3327
3328 def GetPreviousHandler(*args, **kwargs):
3329 """GetPreviousHandler(self) -> EvtHandler"""
3330 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3331
3332 def SetNextHandler(*args, **kwargs):
3333 """SetNextHandler(self, EvtHandler handler)"""
3334 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3335
3336 def SetPreviousHandler(*args, **kwargs):
3337 """SetPreviousHandler(self, EvtHandler handler)"""
3338 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3339
3340 def GetEvtHandlerEnabled(*args, **kwargs):
3341 """GetEvtHandlerEnabled(self) -> bool"""
3342 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3343
3344 def SetEvtHandlerEnabled(*args, **kwargs):
3345 """SetEvtHandlerEnabled(self, bool enabled)"""
3346 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3347
3348 def ProcessEvent(*args, **kwargs):
3349 """ProcessEvent(self, Event event) -> bool"""
3350 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3351
3352 def AddPendingEvent(*args, **kwargs):
3353 """AddPendingEvent(self, Event event)"""
3354 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3355
3356 def ProcessPendingEvents(*args, **kwargs):
3357 """ProcessPendingEvents(self)"""
3358 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3359
3360 def Connect(*args, **kwargs):
3361 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3362 return _core_.EvtHandler_Connect(*args, **kwargs)
3363
3364 def Disconnect(*args, **kwargs):
3365 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3366 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3367
3368 def _setOORInfo(*args, **kwargs):
3369 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3370 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3371 args[0].thisown = 0
3372 return val
3373
3374 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3375 """
3376 Bind an event to an event handler.
3377
3378 :param event: One of the EVT_* objects that specifies the
3379 type of event to bind,
3380
3381 :param handler: A callable object to be invoked when the
3382 event is delivered to self. Pass None to
3383 disconnect an event handler.
3384
3385 :param source: Sometimes the event originates from a
3386 different window than self, but you still
3387 want to catch it in self. (For example, a
3388 button event delivered to a frame.) By
3389 passing the source of the event, the event
3390 handling system is able to differentiate
3391 between the same event type from different
3392 controls.
3393
3394 :param id: Used to spcify the event source by ID instead
3395 of instance.
3396
3397 :param id2: Used when it is desirable to bind a handler
3398 to a range of IDs, such as with EVT_MENU_RANGE.
3399 """
3400 if source is not None:
3401 id = source.GetId()
3402 event.Bind(self, id, id2, handler)
3403
3404 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3405 """
3406 Disconencts the event handler binding for event from self.
3407 Returns True if successful.
3408 """
3409 if source is not None:
3410 id = source.GetId()
3411 return event.Unbind(self, id, id2)
3412
3413 _core_.EvtHandler_swigregister(EvtHandler)
3414
3415 #---------------------------------------------------------------------------
3416
3417 class PyEventBinder(object):
3418 """
3419 Instances of this class are used to bind specific events to event
3420 handlers.
3421 """
3422 def __init__(self, evtType, expectedIDs=0):
3423 if expectedIDs not in [0, 1, 2]:
3424 raise ValueError, "Invalid number of expectedIDs"
3425 self.expectedIDs = expectedIDs
3426
3427 if type(evtType) == list or type(evtType) == tuple:
3428 self.evtType = evtType
3429 else:
3430 self.evtType = [evtType]
3431
3432
3433 def Bind(self, target, id1, id2, function):
3434 """Bind this set of event types to target."""
3435 for et in self.evtType:
3436 target.Connect(id1, id2, et, function)
3437
3438
3439 def Unbind(self, target, id1, id2):
3440 """Remove an event binding."""
3441 success = 0
3442 for et in self.evtType:
3443 success += target.Disconnect(id1, id2, et)
3444 return success != 0
3445
3446
3447 def __call__(self, *args):
3448 """
3449 For backwards compatibility with the old EVT_* functions.
3450 Should be called with either (window, func), (window, ID,
3451 func) or (window, ID1, ID2, func) parameters depending on the
3452 type of the event.
3453 """
3454 assert len(args) == 2 + self.expectedIDs
3455 id1 = wx.ID_ANY
3456 id2 = wx.ID_ANY
3457 target = args[0]
3458 if self.expectedIDs == 0:
3459 func = args[1]
3460 elif self.expectedIDs == 1:
3461 id1 = args[1]
3462 func = args[2]
3463 elif self.expectedIDs == 2:
3464 id1 = args[1]
3465 id2 = args[2]
3466 func = args[3]
3467 else:
3468 raise ValueError, "Unexpected number of IDs"
3469
3470 self.Bind(target, id1, id2, func)
3471
3472
3473 # These two are square pegs that don't fit the PyEventBinder hole...
3474 def EVT_COMMAND(win, id, cmd, func):
3475 win.Connect(id, -1, cmd, func)
3476 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3477 win.Connect(id1, id2, cmd, func)
3478
3479
3480 #---------------------------------------------------------------------------
3481
3482 #---------------------------------------------------------------------------
3483
3484 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3485 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3486
3487 def NewEventType(*args):
3488 """NewEventType() -> EventType"""
3489 return _core_.NewEventType(*args)
3490 wxEVT_NULL = _core_.wxEVT_NULL
3491 wxEVT_FIRST = _core_.wxEVT_FIRST
3492 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3493 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3494 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3495 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3496 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3497 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3498 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3499 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3500 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3501 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3502 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3503 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3504 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3505 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3506 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3507 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3508 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3509 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3510 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3511 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3512 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3513 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3514 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3515 wxEVT_MOTION = _core_.wxEVT_MOTION
3516 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3517 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3518 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3519 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3520 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3521 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3522 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3523 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3524 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3525 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3526 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3527 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3528 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3529 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3530 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3531 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3532 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3533 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3534 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3535 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3536 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3537 wxEVT_CHAR = _core_.wxEVT_CHAR
3538 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3539 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3540 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3541 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3542 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3543 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3544 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3545 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3546 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3547 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3548 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3549 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3550 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3551 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3552 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3553 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3554 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3555 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3556 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3557 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3558 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3559 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3560 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3561 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3562 wxEVT_SIZE = _core_.wxEVT_SIZE
3563 wxEVT_MOVE = _core_.wxEVT_MOVE
3564 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3565 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3566 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3567 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3568 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3569 wxEVT_CREATE = _core_.wxEVT_CREATE
3570 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3571 wxEVT_SHOW = _core_.wxEVT_SHOW
3572 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3573 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3574 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3575 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3576 wxEVT_PAINT = _core_.wxEVT_PAINT
3577 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3578 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3579 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3580 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3581 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3582 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3583 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3584 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3585 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3586 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3587 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3588 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3589 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3590 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3591 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3592 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3593 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3594 wxEVT_IDLE = _core_.wxEVT_IDLE
3595 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3596 wxEVT_SIZING = _core_.wxEVT_SIZING
3597 wxEVT_MOVING = _core_.wxEVT_MOVING
3598 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3599 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3600 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3601 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3602 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3603 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3604 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3605 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3606 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3607 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3608 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3609 #
3610 # Create some event binders
3611 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3612 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3613 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3614 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3615 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3616 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3617 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3618 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3619 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3620 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3621 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3622 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3623 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3624 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3625 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3626 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3627 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3628 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3629 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3630 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3631 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3632 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3633 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3634 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3635 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3636 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3637 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3638 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3639 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3640 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3641 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3642 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3643 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3644 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3645 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3646 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3647 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3648 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3649 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3650 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3651 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3652 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3653
3654 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3655 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3656 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3657 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3658 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3659 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3660 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3661 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3662 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3663 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3664 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3665 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3666 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3667
3668 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3669 wxEVT_LEFT_UP,
3670 wxEVT_MIDDLE_DOWN,
3671 wxEVT_MIDDLE_UP,
3672 wxEVT_RIGHT_DOWN,
3673 wxEVT_RIGHT_UP,
3674 wxEVT_MOTION,
3675 wxEVT_LEFT_DCLICK,
3676 wxEVT_MIDDLE_DCLICK,
3677 wxEVT_RIGHT_DCLICK,
3678 wxEVT_ENTER_WINDOW,
3679 wxEVT_LEAVE_WINDOW,
3680 wxEVT_MOUSEWHEEL
3681 ])
3682
3683
3684 # Scrolling from wxWindow (sent to wxScrolledWindow)
3685 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3686 wxEVT_SCROLLWIN_BOTTOM,
3687 wxEVT_SCROLLWIN_LINEUP,
3688 wxEVT_SCROLLWIN_LINEDOWN,
3689 wxEVT_SCROLLWIN_PAGEUP,
3690 wxEVT_SCROLLWIN_PAGEDOWN,
3691 wxEVT_SCROLLWIN_THUMBTRACK,
3692 wxEVT_SCROLLWIN_THUMBRELEASE,
3693 ])
3694
3695 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3696 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3697 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3698 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3699 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3700 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3701 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3702 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3703
3704 # Scrolling from wx.Slider and wx.ScrollBar
3705 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3706 wxEVT_SCROLL_BOTTOM,
3707 wxEVT_SCROLL_LINEUP,
3708 wxEVT_SCROLL_LINEDOWN,
3709 wxEVT_SCROLL_PAGEUP,
3710 wxEVT_SCROLL_PAGEDOWN,
3711 wxEVT_SCROLL_THUMBTRACK,
3712 wxEVT_SCROLL_THUMBRELEASE,
3713 wxEVT_SCROLL_CHANGED,
3714 ])
3715
3716 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3717 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3718 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3719 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3720 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3721 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3722 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3723 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3724 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3725 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3726
3727 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3728 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3729 wxEVT_SCROLL_BOTTOM,
3730 wxEVT_SCROLL_LINEUP,
3731 wxEVT_SCROLL_LINEDOWN,
3732 wxEVT_SCROLL_PAGEUP,
3733 wxEVT_SCROLL_PAGEDOWN,
3734 wxEVT_SCROLL_THUMBTRACK,
3735 wxEVT_SCROLL_THUMBRELEASE,
3736 wxEVT_SCROLL_CHANGED,
3737 ], 1)
3738
3739 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3740 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3741 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3742 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3743 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3744 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3745 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3746 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3747 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3748 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3749
3750 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3751 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3752 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3753 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3754 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3755 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3756 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3757 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3758 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3759 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3760
3761 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3762 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3763 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3764 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3765 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3766 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3767 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3768 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3769 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3770
3771
3772 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3773 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3774 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3775 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3776 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3777 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3778 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3779
3780 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3781
3782 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3783 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3784
3785 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3786
3787 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3788 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3789 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3790
3791
3792 #---------------------------------------------------------------------------
3793
3794 class Event(Object):
3795 """
3796 An event is a structure holding information about an event passed to a
3797 callback or member function. wx.Event is an abstract base class for
3798 other event classes
3799 """
3800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3801 def __init__(self): raise AttributeError, "No constructor defined"
3802 __repr__ = _swig_repr
3803 __swig_destroy__ = _core_.delete_Event
3804 __del__ = lambda self : None;
3805 def SetEventType(*args, **kwargs):
3806 """
3807 SetEventType(self, EventType typ)
3808
3809 Sets the specific type of the event.
3810 """
3811 return _core_.Event_SetEventType(*args, **kwargs)
3812
3813 def GetEventType(*args, **kwargs):
3814 """
3815 GetEventType(self) -> EventType
3816
3817 Returns the identifier of the given event type, such as
3818 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3819 """
3820 return _core_.Event_GetEventType(*args, **kwargs)
3821
3822 def GetEventObject(*args, **kwargs):
3823 """
3824 GetEventObject(self) -> Object
3825
3826 Returns the object (usually a window) associated with the event, if
3827 any.
3828 """
3829 return _core_.Event_GetEventObject(*args, **kwargs)
3830
3831 def SetEventObject(*args, **kwargs):
3832 """
3833 SetEventObject(self, Object obj)
3834
3835 Sets the originating object, or in other words, obj is normally the
3836 object that is sending the event.
3837 """
3838 return _core_.Event_SetEventObject(*args, **kwargs)
3839
3840 def GetTimestamp(*args, **kwargs):
3841 """GetTimestamp(self) -> long"""
3842 return _core_.Event_GetTimestamp(*args, **kwargs)
3843
3844 def SetTimestamp(*args, **kwargs):
3845 """SetTimestamp(self, long ts=0)"""
3846 return _core_.Event_SetTimestamp(*args, **kwargs)
3847
3848 def GetId(*args, **kwargs):
3849 """
3850 GetId(self) -> int
3851
3852 Returns the identifier associated with this event, such as a button
3853 command id.
3854 """
3855 return _core_.Event_GetId(*args, **kwargs)
3856
3857 def SetId(*args, **kwargs):
3858 """
3859 SetId(self, int Id)
3860
3861 Set's the ID for the event. This is usually the ID of the window that
3862 is sending the event, but it can also be a command id from a menu
3863 item, etc.
3864 """
3865 return _core_.Event_SetId(*args, **kwargs)
3866
3867 def IsCommandEvent(*args, **kwargs):
3868 """
3869 IsCommandEvent(self) -> bool
3870
3871 Returns true if the event is or is derived from `wx.CommandEvent` else
3872 it returns false. Note: Exists only for optimization purposes.
3873 """
3874 return _core_.Event_IsCommandEvent(*args, **kwargs)
3875
3876 def Skip(*args, **kwargs):
3877 """
3878 Skip(self, bool skip=True)
3879
3880 Called by an event handler, it controls whether additional event
3881 handlers bound to this event will be called after the current event
3882 handler returns. Skip(false) (the default setting) will prevent
3883 additional event handlers from being called and control will be
3884 returned to the sender of the event immediately after the current
3885 handler has finished. Skip(True) will cause the event processing
3886 system to continue searching for a handler function for this event.
3887
3888 """
3889 return _core_.Event_Skip(*args, **kwargs)
3890
3891 def GetSkipped(*args, **kwargs):
3892 """
3893 GetSkipped(self) -> bool
3894
3895 Returns true if the event handler should be skipped, false otherwise.
3896 :see: `Skip`
3897 """
3898 return _core_.Event_GetSkipped(*args, **kwargs)
3899
3900 def ShouldPropagate(*args, **kwargs):
3901 """
3902 ShouldPropagate(self) -> bool
3903
3904 Test if this event should be propagated to the parent window or not,
3905 i.e. if the propagation level is currently greater than 0.
3906 """
3907 return _core_.Event_ShouldPropagate(*args, **kwargs)
3908
3909 def StopPropagation(*args, **kwargs):
3910 """
3911 StopPropagation(self) -> int
3912
3913 Stop the event from propagating to its parent window. Returns the old
3914 propagation level value which may be later passed to
3915 `ResumePropagation` to allow propagating the event again.
3916 """
3917 return _core_.Event_StopPropagation(*args, **kwargs)
3918
3919 def ResumePropagation(*args, **kwargs):
3920 """
3921 ResumePropagation(self, int propagationLevel)
3922
3923 Resume the event propagation by restoring the propagation level. (For
3924 example, you can use the value returned by an earlier call to
3925 `StopPropagation`.)
3926
3927 """
3928 return _core_.Event_ResumePropagation(*args, **kwargs)
3929
3930 def Clone(*args, **kwargs):
3931 """Clone(self) -> Event"""
3932 return _core_.Event_Clone(*args, **kwargs)
3933
3934 _core_.Event_swigregister(Event)
3935
3936 #---------------------------------------------------------------------------
3937
3938 class PropagationDisabler(object):
3939 """
3940 Helper class to temporarily change an event not to propagate. Simply
3941 create an instance of this class and then whe it is destroyed the
3942 propogation of the event will be restored.
3943 """
3944 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3945 __repr__ = _swig_repr
3946 def __init__(self, *args, **kwargs):
3947 """
3948 __init__(self, Event event) -> PropagationDisabler
3949
3950 Helper class to temporarily change an event not to propagate. Simply
3951 create an instance of this class and then whe it is destroyed the
3952 propogation of the event will be restored.
3953 """
3954 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3955 __swig_destroy__ = _core_.delete_PropagationDisabler
3956 __del__ = lambda self : None;
3957 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3958
3959 class PropagateOnce(object):
3960 """
3961 A helper class that will temporarily lower propagation level of an
3962 event. Simply create an instance of this class and then whe it is
3963 destroyed the propogation of the event will be restored.
3964 """
3965 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3966 __repr__ = _swig_repr
3967 def __init__(self, *args, **kwargs):
3968 """
3969 __init__(self, Event event) -> PropagateOnce
3970
3971 A helper class that will temporarily lower propagation level of an
3972 event. Simply create an instance of this class and then whe it is
3973 destroyed the propogation of the event will be restored.
3974 """
3975 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3976 __swig_destroy__ = _core_.delete_PropagateOnce
3977 __del__ = lambda self : None;
3978 _core_.PropagateOnce_swigregister(PropagateOnce)
3979
3980 #---------------------------------------------------------------------------
3981
3982 class CommandEvent(Event):
3983 """
3984 This event class contains information about command events, which
3985 originate from a variety of simple controls, as well as menus and
3986 toolbars.
3987 """
3988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3989 __repr__ = _swig_repr
3990 def __init__(self, *args, **kwargs):
3991 """
3992 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3993
3994 This event class contains information about command events, which
3995 originate from a variety of simple controls, as well as menus and
3996 toolbars.
3997 """
3998 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3999 def GetSelection(*args, **kwargs):
4000 """
4001 GetSelection(self) -> int
4002
4003 Returns item index for a listbox or choice selection event (not valid
4004 for a deselection).
4005 """
4006 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4007
4008 def SetString(*args, **kwargs):
4009 """SetString(self, String s)"""
4010 return _core_.CommandEvent_SetString(*args, **kwargs)
4011
4012 def GetString(*args, **kwargs):
4013 """
4014 GetString(self) -> String
4015
4016 Returns item string for a listbox or choice selection event (not valid
4017 for a deselection).
4018 """
4019 return _core_.CommandEvent_GetString(*args, **kwargs)
4020
4021 def IsChecked(*args, **kwargs):
4022 """
4023 IsChecked(self) -> bool
4024
4025 This method can be used with checkbox and menu events: for the
4026 checkboxes, the method returns true for a selection event and false
4027 for a deselection one. For the menu events, this method indicates if
4028 the menu item just has become checked or unchecked (and thus only
4029 makes sense for checkable menu items).
4030 """
4031 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4032
4033 Checked = IsChecked
4034 def IsSelection(*args, **kwargs):
4035 """
4036 IsSelection(self) -> bool
4037
4038 For a listbox or similar event, returns true if it is a selection,
4039 false if it is a deselection.
4040 """
4041 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4042
4043 def SetExtraLong(*args, **kwargs):
4044 """SetExtraLong(self, long extraLong)"""
4045 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4046
4047 def GetExtraLong(*args, **kwargs):
4048 """
4049 GetExtraLong(self) -> long
4050
4051 Returns extra information dependant on the event objects type. If the
4052 event comes from a listbox selection, it is a boolean determining
4053 whether the event was a selection (true) or a deselection (false). A
4054 listbox deselection only occurs for multiple-selection boxes, and in
4055 this case the index and string values are indeterminate and the
4056 listbox must be examined by the application.
4057 """
4058 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4059
4060 def SetInt(*args, **kwargs):
4061 """SetInt(self, int i)"""
4062 return _core_.CommandEvent_SetInt(*args, **kwargs)
4063
4064 def GetInt(*args, **kwargs):
4065 """
4066 GetInt(self) -> int
4067
4068 Returns the integer identifier corresponding to a listbox, choice or
4069 radiobox selection (only if the event was a selection, not a
4070 deselection), or a boolean value representing the value of a checkbox.
4071 """
4072 return _core_.CommandEvent_GetInt(*args, **kwargs)
4073
4074 def GetClientData(*args, **kwargs):
4075 """
4076 GetClientData(self) -> PyObject
4077
4078 Returns the client data object for a listbox or choice selection event, (if any.)
4079 """
4080 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4081
4082 def SetClientData(*args, **kwargs):
4083 """
4084 SetClientData(self, PyObject clientData)
4085
4086 Associate the given client data with the item at position n.
4087 """
4088 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4089
4090 GetClientObject = GetClientData
4091 SetClientObject = SetClientData
4092
4093 def Clone(*args, **kwargs):
4094 """Clone(self) -> Event"""
4095 return _core_.CommandEvent_Clone(*args, **kwargs)
4096
4097 _core_.CommandEvent_swigregister(CommandEvent)
4098
4099 #---------------------------------------------------------------------------
4100
4101 class NotifyEvent(CommandEvent):
4102 """
4103 An instance of this class (or one of its derived classes) is sent from
4104 a control when the control's state is being changed and the control
4105 allows that change to be prevented from happening. The event handler
4106 can call `Veto` or `Allow` to tell the control what to do.
4107 """
4108 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4109 __repr__ = _swig_repr
4110 def __init__(self, *args, **kwargs):
4111 """
4112 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4113
4114 An instance of this class (or one of its derived classes) is sent from
4115 a control when the control's state is being changed and the control
4116 allows that change to be prevented from happening. The event handler
4117 can call `Veto` or `Allow` to tell the control what to do.
4118 """
4119 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4120 def Veto(*args, **kwargs):
4121 """
4122 Veto(self)
4123
4124 Prevents the change announced by this event from happening.
4125
4126 It is in general a good idea to notify the user about the reasons for
4127 vetoing the change because otherwise the applications behaviour (which
4128 just refuses to do what the user wants) might be quite surprising.
4129 """
4130 return _core_.NotifyEvent_Veto(*args, **kwargs)
4131
4132 def Allow(*args, **kwargs):
4133 """
4134 Allow(self)
4135
4136 This is the opposite of `Veto`: it explicitly allows the event to be
4137 processed. For most events it is not necessary to call this method as
4138 the events are allowed anyhow but some are forbidden by default (this
4139 will be mentioned in the corresponding event description).
4140 """
4141 return _core_.NotifyEvent_Allow(*args, **kwargs)
4142
4143 def IsAllowed(*args, **kwargs):
4144 """
4145 IsAllowed(self) -> bool
4146
4147 Returns true if the change is allowed (`Veto` hasn't been called) or
4148 false otherwise (if it was).
4149 """
4150 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4151
4152 _core_.NotifyEvent_swigregister(NotifyEvent)
4153
4154 #---------------------------------------------------------------------------
4155
4156 class ScrollEvent(CommandEvent):
4157 """
4158 A scroll event holds information about events sent from stand-alone
4159 scrollbars and sliders. Note that scrolled windows do not send
4160 instnaces of this event class, but send the `wx.ScrollWinEvent`
4161 instead.
4162 """
4163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4164 __repr__ = _swig_repr
4165 def __init__(self, *args, **kwargs):
4166 """
4167 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4168 int orient=0) -> ScrollEvent
4169 """
4170 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4171 def GetOrientation(*args, **kwargs):
4172 """
4173 GetOrientation(self) -> int
4174
4175 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4176 the scrollbar.
4177 """
4178 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4179
4180 def GetPosition(*args, **kwargs):
4181 """
4182 GetPosition(self) -> int
4183
4184 Returns the position of the scrollbar.
4185 """
4186 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4187
4188 def SetOrientation(*args, **kwargs):
4189 """SetOrientation(self, int orient)"""
4190 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4191
4192 def SetPosition(*args, **kwargs):
4193 """SetPosition(self, int pos)"""
4194 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4195
4196 _core_.ScrollEvent_swigregister(ScrollEvent)
4197
4198 #---------------------------------------------------------------------------
4199
4200 class ScrollWinEvent(Event):
4201 """
4202 A wx.ScrollWinEvent holds information about scrolling and is sent from
4203 scrolling windows.
4204 """
4205 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4206 __repr__ = _swig_repr
4207 def __init__(self, *args, **kwargs):
4208 """
4209 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4210
4211 A wx.ScrollWinEvent holds information about scrolling and is sent from
4212 scrolling windows.
4213 """
4214 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4215 def GetOrientation(*args, **kwargs):
4216 """
4217 GetOrientation(self) -> int
4218
4219 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4220 the scrollbar.
4221 """
4222 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4223
4224 def GetPosition(*args, **kwargs):
4225 """
4226 GetPosition(self) -> int
4227
4228 Returns the position of the scrollbar for the thumb track and release
4229 events. Note that this field can't be used for the other events, you
4230 need to query the window itself for the current position in that case.
4231 """
4232 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4233
4234 def SetOrientation(*args, **kwargs):
4235 """SetOrientation(self, int orient)"""
4236 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4237
4238 def SetPosition(*args, **kwargs):
4239 """SetPosition(self, int pos)"""
4240 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4241
4242 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4243
4244 #---------------------------------------------------------------------------
4245
4246 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4247 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4248 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4249 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4250 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4251 class MouseEvent(Event):
4252 """
4253 This event class contains information about the events generated by
4254 the mouse: they include mouse buttons press and release events and
4255 mouse move events.
4256
4257 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4258 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4259 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4260 a middle button so a portable application should avoid relying on the
4261 events from it.
4262
4263 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4264 the former returns true when the event corresponds to the left mouse
4265 button click while the latter returns true if the left mouse button is
4266 currently being pressed. For example, when the user is dragging the
4267 mouse you can use `LeftIsDown` to test whether the left mouse button
4268 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4269 `LeftIsDown` will also return true in wxWidgets whatever the
4270 underlying GUI behaviour is (which is platform-dependent). The same
4271 applies, of course, to other mouse buttons as well.
4272 """
4273 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4274 __repr__ = _swig_repr
4275 def __init__(self, *args, **kwargs):
4276 """
4277 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4278
4279 Constructs a wx.MouseEvent. Valid event types are:
4280
4281 * wxEVT_ENTER_WINDOW
4282 * wxEVT_LEAVE_WINDOW
4283 * wxEVT_LEFT_DOWN
4284 * wxEVT_LEFT_UP
4285 * wxEVT_LEFT_DCLICK
4286 * wxEVT_MIDDLE_DOWN
4287 * wxEVT_MIDDLE_UP
4288 * wxEVT_MIDDLE_DCLICK
4289 * wxEVT_RIGHT_DOWN
4290 * wxEVT_RIGHT_UP
4291 * wxEVT_RIGHT_DCLICK
4292 * wxEVT_MOTION
4293 * wxEVT_MOUSEWHEEL
4294 """
4295 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4296 def IsButton(*args, **kwargs):
4297 """
4298 IsButton(self) -> bool
4299
4300 Returns true if the event was a mouse button event (not necessarily a
4301 button down event - that may be tested using `ButtonDown`).
4302 """
4303 return _core_.MouseEvent_IsButton(*args, **kwargs)
4304
4305 def ButtonDown(*args, **kwargs):
4306 """
4307 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4308
4309 If the argument is omitted, this returns true if the event was any
4310 mouse button down event. Otherwise the argument specifies which
4311 button-down event shold be checked for (see `Button` for the possible
4312 values).
4313 """
4314 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4315
4316 def ButtonDClick(*args, **kwargs):
4317 """
4318 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4319
4320 If the argument is omitted, this returns true if the event was any
4321 mouse double click event. Otherwise the argument specifies which
4322 double click event to check for (see `Button` for the possible
4323 values).
4324 """
4325 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4326
4327 def ButtonUp(*args, **kwargs):
4328 """
4329 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4330
4331 If the argument is omitted, this returns true if the event was any
4332 mouse button up event. Otherwise the argument specifies which button
4333 up event to check for (see `Button` for the possible values).
4334 """
4335 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4336
4337 def Button(*args, **kwargs):
4338 """
4339 Button(self, int button) -> bool
4340
4341 Returns true if the identified mouse button is changing state. Valid
4342 values of button are:
4343
4344 ==================== =====================================
4345 wx.MOUSE_BTN_LEFT check if left button was pressed
4346 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4347 wx.MOUSE_BTN_RIGHT check if right button was pressed
4348 wx.MOUSE_BTN_ANY check if any button was pressed
4349 ==================== =====================================
4350
4351 """
4352 return _core_.MouseEvent_Button(*args, **kwargs)
4353
4354 def ButtonIsDown(*args, **kwargs):
4355 """ButtonIsDown(self, int but) -> bool"""
4356 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4357
4358 def GetButton(*args, **kwargs):
4359 """
4360 GetButton(self) -> int
4361
4362 Returns the mouse button which generated this event or
4363 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4364 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4365 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4366 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4367 right buttons respectively.
4368 """
4369 return _core_.MouseEvent_GetButton(*args, **kwargs)
4370
4371 def ControlDown(*args, **kwargs):
4372 """
4373 ControlDown(self) -> bool
4374
4375 Returns true if the control key was down at the time of the event.
4376 """
4377 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4378
4379 def MetaDown(*args, **kwargs):
4380 """
4381 MetaDown(self) -> bool
4382
4383 Returns true if the Meta key was down at the time of the event.
4384 """
4385 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4386
4387 def AltDown(*args, **kwargs):
4388 """
4389 AltDown(self) -> bool
4390
4391 Returns true if the Alt key was down at the time of the event.
4392 """
4393 return _core_.MouseEvent_AltDown(*args, **kwargs)
4394
4395 def ShiftDown(*args, **kwargs):
4396 """
4397 ShiftDown(self) -> bool
4398
4399 Returns true if the Shift key was down at the time of the event.
4400 """
4401 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4402
4403 def CmdDown(*args, **kwargs):
4404 """
4405 CmdDown(self) -> bool
4406
4407 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4408 platforms but the special "Apple" (a.k.a as "Command") key on
4409 Macs. It often makes sense to use it instead of, say, `ControlDown`
4410 because Cmd key is used for the same thing under Mac as Ctrl
4411 elsewhere. The Ctrl key still exists, it's just not used for this
4412 purpose. So for non-Mac platforms this is the same as `ControlDown`
4413 and Macs this is the same as `MetaDown`.
4414 """
4415 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4416
4417 def LeftDown(*args, **kwargs):
4418 """
4419 LeftDown(self) -> bool
4420
4421 Returns true if the left mouse button state changed to down.
4422 """
4423 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4424
4425 def MiddleDown(*args, **kwargs):
4426 """
4427 MiddleDown(self) -> bool
4428
4429 Returns true if the middle mouse button state changed to down.
4430 """
4431 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4432
4433 def RightDown(*args, **kwargs):
4434 """
4435 RightDown(self) -> bool
4436
4437 Returns true if the right mouse button state changed to down.
4438 """
4439 return _core_.MouseEvent_RightDown(*args, **kwargs)
4440
4441 def LeftUp(*args, **kwargs):
4442 """
4443 LeftUp(self) -> bool
4444
4445 Returns true if the left mouse button state changed to up.
4446 """
4447 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4448
4449 def MiddleUp(*args, **kwargs):
4450 """
4451 MiddleUp(self) -> bool
4452
4453 Returns true if the middle mouse button state changed to up.
4454 """
4455 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4456
4457 def RightUp(*args, **kwargs):
4458 """
4459 RightUp(self) -> bool
4460
4461 Returns true if the right mouse button state changed to up.
4462 """
4463 return _core_.MouseEvent_RightUp(*args, **kwargs)
4464
4465 def LeftDClick(*args, **kwargs):
4466 """
4467 LeftDClick(self) -> bool
4468
4469 Returns true if the event was a left button double click.
4470 """
4471 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4472
4473 def MiddleDClick(*args, **kwargs):
4474 """
4475 MiddleDClick(self) -> bool
4476
4477 Returns true if the event was a middle button double click.
4478 """
4479 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4480
4481 def RightDClick(*args, **kwargs):
4482 """
4483 RightDClick(self) -> bool
4484
4485 Returns true if the event was a right button double click.
4486 """
4487 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4488
4489 def LeftIsDown(*args, **kwargs):
4490 """
4491 LeftIsDown(self) -> bool
4492
4493 Returns true if the left mouse button is currently down, independent
4494 of the current event type.
4495
4496 Please notice that it is not the same as LeftDown which returns true
4497 if the left mouse button was just pressed. Rather, it describes the
4498 state of the mouse button before the event happened.
4499
4500 This event is usually used in the mouse event handlers which process
4501 "move mouse" messages to determine whether the user is (still)
4502 dragging the mouse.
4503 """
4504 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4505
4506 def MiddleIsDown(*args, **kwargs):
4507 """
4508 MiddleIsDown(self) -> bool
4509
4510 Returns true if the middle mouse button is currently down, independent
4511 of the current event type.
4512 """
4513 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4514
4515 def RightIsDown(*args, **kwargs):
4516 """
4517 RightIsDown(self) -> bool
4518
4519 Returns true if the right mouse button is currently down, independent
4520 of the current event type.
4521 """
4522 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4523
4524 def Dragging(*args, **kwargs):
4525 """
4526 Dragging(self) -> bool
4527
4528 Returns true if this was a dragging event (motion while a button is
4529 depressed).
4530 """
4531 return _core_.MouseEvent_Dragging(*args, **kwargs)
4532
4533 def Moving(*args, **kwargs):
4534 """
4535 Moving(self) -> bool
4536
4537 Returns true if this was a motion event and no mouse buttons were
4538 pressed. If any mouse button is held pressed, then this method returns
4539 false and Dragging returns true.
4540 """
4541 return _core_.MouseEvent_Moving(*args, **kwargs)
4542
4543 def Entering(*args, **kwargs):
4544 """
4545 Entering(self) -> bool
4546
4547 Returns true if the mouse was entering the window.
4548 """
4549 return _core_.MouseEvent_Entering(*args, **kwargs)
4550
4551 def Leaving(*args, **kwargs):
4552 """
4553 Leaving(self) -> bool
4554
4555 Returns true if the mouse was leaving the window.
4556 """
4557 return _core_.MouseEvent_Leaving(*args, **kwargs)
4558
4559 def GetPosition(*args, **kwargs):
4560 """
4561 GetPosition(self) -> Point
4562
4563 Returns the pixel position of the mouse in window coordinates when the
4564 event happened.
4565 """
4566 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4567
4568 def GetPositionTuple(*args, **kwargs):
4569 """
4570 GetPositionTuple() -> (x,y)
4571
4572 Returns the pixel position of the mouse in window coordinates when the
4573 event happened.
4574 """
4575 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4576
4577 def GetLogicalPosition(*args, **kwargs):
4578 """
4579 GetLogicalPosition(self, DC dc) -> Point
4580
4581 Returns the logical mouse position in pixels (i.e. translated
4582 according to the translation set for the DC, which usually indicates
4583 that the window has been scrolled).
4584 """
4585 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4586
4587 def GetX(*args, **kwargs):
4588 """
4589 GetX(self) -> int
4590
4591 Returns X coordinate of the physical mouse event position.
4592 """
4593 return _core_.MouseEvent_GetX(*args, **kwargs)
4594
4595 def GetY(*args, **kwargs):
4596 """
4597 GetY(self) -> int
4598
4599 Returns Y coordinate of the physical mouse event position.
4600 """
4601 return _core_.MouseEvent_GetY(*args, **kwargs)
4602
4603 def GetWheelRotation(*args, **kwargs):
4604 """
4605 GetWheelRotation(self) -> int
4606
4607 Get wheel rotation, positive or negative indicates direction of
4608 rotation. Current devices all send an event when rotation is equal to
4609 +/-WheelDelta, but this allows for finer resolution devices to be
4610 created in the future. Because of this you shouldn't assume that one
4611 event is equal to 1 line or whatever, but you should be able to either
4612 do partial line scrolling or wait until +/-WheelDelta rotation values
4613 have been accumulated before scrolling.
4614 """
4615 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4616
4617 def GetWheelDelta(*args, **kwargs):
4618 """
4619 GetWheelDelta(self) -> int
4620
4621 Get wheel delta, normally 120. This is the threshold for action to be
4622 taken, and one such action (for example, scrolling one increment)
4623 should occur for each delta.
4624 """
4625 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4626
4627 def GetLinesPerAction(*args, **kwargs):
4628 """
4629 GetLinesPerAction(self) -> int
4630
4631 Returns the configured number of lines (or whatever) to be scrolled
4632 per wheel action. Defaults to three.
4633 """
4634 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4635
4636 def IsPageScroll(*args, **kwargs):
4637 """
4638 IsPageScroll(self) -> bool
4639
4640 Returns true if the system has been setup to do page scrolling with
4641 the mouse wheel instead of line scrolling.
4642 """
4643 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4644
4645 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4646 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4647 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4648 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4649 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4650 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4651 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4652 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4653 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4654 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4655 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4656 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4657 _core_.MouseEvent_swigregister(MouseEvent)
4658
4659 #---------------------------------------------------------------------------
4660
4661 class SetCursorEvent(Event):
4662 """
4663 A SetCursorEvent is generated when the mouse cursor is about to be set
4664 as a result of mouse motion. This event gives the application the
4665 chance to perform specific mouse cursor processing based on the
4666 current position of the mouse within the window. Use the `SetCursor`
4667 method to specify the cursor you want to be displayed.
4668 """
4669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4670 __repr__ = _swig_repr
4671 def __init__(self, *args, **kwargs):
4672 """
4673 __init__(self, int x=0, int y=0) -> SetCursorEvent
4674
4675 Construct a new `wx.SetCursorEvent`.
4676 """
4677 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4678 def GetX(*args, **kwargs):
4679 """
4680 GetX(self) -> int
4681
4682 Returns the X coordinate of the mouse in client coordinates.
4683 """
4684 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4685
4686 def GetY(*args, **kwargs):
4687 """
4688 GetY(self) -> int
4689
4690 Returns the Y coordinate of the mouse in client coordinates.
4691 """
4692 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4693
4694 def SetCursor(*args, **kwargs):
4695 """
4696 SetCursor(self, Cursor cursor)
4697
4698 Sets the cursor associated with this event.
4699 """
4700 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4701
4702 def GetCursor(*args, **kwargs):
4703 """
4704 GetCursor(self) -> Cursor
4705
4706 Returns a reference to the cursor specified by this event.
4707 """
4708 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4709
4710 def HasCursor(*args, **kwargs):
4711 """
4712 HasCursor(self) -> bool
4713
4714 Returns true if the cursor specified by this event is a valid cursor.
4715 """
4716 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4717
4718 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4719
4720 #---------------------------------------------------------------------------
4721
4722 class KeyEvent(Event):
4723 """
4724 This event class contains information about keypress and character
4725 events. These events are only sent to the widget that currently has
4726 the keyboard focus.
4727
4728 Notice that there are three different kinds of keyboard events in
4729 wxWidgets: key down and up events and char events. The difference
4730 between the first two is clear - the first corresponds to a key press
4731 and the second to a key release - otherwise they are identical. Just
4732 note that if the key is maintained in a pressed state you will
4733 typically get a lot of (automatically generated) down events but only
4734 one up so it is wrong to assume that there is one up event
4735 corresponding to each down one.
4736
4737 Both key events provide untranslated key codes while the char event
4738 carries the translated one. The untranslated code for alphanumeric
4739 keys is always an upper case value. For the other keys it is one of
4740 WXK_XXX values from the keycodes table. The translated key is, in
4741 general, the character the user expects to appear as the result of the
4742 key combination when typing the text into a text entry zone, for
4743 example.
4744
4745 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4746 and the standard US keyboard): when the 'A' key is pressed, the key
4747 down event key code is equal to ASCII A == 65. But the char event key
4748 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4749 'A' keys simultaneously , the key code in key down event will still be
4750 just 'A' while the char event key code parameter will now be 'A' as
4751 well.
4752
4753 Although in this simple case it is clear that the correct key code
4754 could be found in the key down event handler by checking the value
4755 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4756 as for non alphanumeric keys or non-US keyboard layouts the
4757 translation is keyboard-layout dependent and can only be done properly
4758 by the system itself.
4759
4760 Another kind of translation is done when the control key is pressed:
4761 for example, for CTRL-A key press the key down event still carries the
4762 same key code 'A' as usual but the char event will have key code of 1,
4763 the ASCII value of this key combination.
4764
4765 You may discover how the other keys on your system behave
4766 interactively by running the KeyEvents sample in the wxPython demo and
4767 pressing some keys while the blue box at the top has the keyboard
4768 focus.
4769
4770 **Note**: If a key down event is caught and the event handler does not
4771 call event.Skip() then the coresponding char event will not
4772 happen. This is by design and enables the programs that handle both
4773 types of events to be a bit simpler.
4774
4775 **Note for Windows programmers**: The key and char events in wxWidgets
4776 are similar to but slightly different from Windows WM_KEYDOWN and
4777 WM_CHAR events. In particular, Alt-x combination will generate a char
4778 event in wxWidgets (unless it is used as an accelerator).
4779
4780 **Tip**: be sure to call event.Skip() for events that you don't
4781 process in key event function, otherwise menu shortcuts may cease to
4782 work under Windows.
4783
4784 """
4785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4786 __repr__ = _swig_repr
4787 def __init__(self, *args, **kwargs):
4788 """
4789 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4790
4791 Construct a new `wx.KeyEvent`. Valid event types are:
4792 *
4793 """
4794 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4795 def GetModifiers(*args, **kwargs):
4796 """
4797 GetModifiers(self) -> int
4798
4799 Returns a bitmask of the current modifier settings. Can be used to
4800 check if the key event has exactly the given modifiers without having
4801 to explicitly check that the other modifiers are not down. For
4802 example::
4803
4804 if event.GetModifers() == wx.MOD_CONTROL:
4805 DoSomething()
4806
4807 """
4808 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4809
4810 def ControlDown(*args, **kwargs):
4811 """
4812 ControlDown(self) -> bool
4813
4814 Returns ``True`` if the Control key was down at the time of the event.
4815 """
4816 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4817
4818 def MetaDown(*args, **kwargs):
4819 """
4820 MetaDown(self) -> bool
4821
4822 Returns ``True`` if the Meta key was down at the time of the event.
4823 """
4824 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4825
4826 def AltDown(*args, **kwargs):
4827 """
4828 AltDown(self) -> bool
4829
4830 Returns ``True`` if the Alt key was down at the time of the event.
4831 """
4832 return _core_.KeyEvent_AltDown(*args, **kwargs)
4833
4834 def ShiftDown(*args, **kwargs):
4835 """
4836 ShiftDown(self) -> bool
4837
4838 Returns ``True`` if the Shift key was down at the time of the event.
4839 """
4840 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4841
4842 def CmdDown(*args, **kwargs):
4843 """
4844 CmdDown(self) -> bool
4845
4846 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4847 platforms but the special "Apple" (a.k.a as "Command") key on
4848 Macs. It makes often sense to use it instead of, say, `ControlDown`
4849 because Cmd key is used for the same thing under Mac as Ctrl
4850 elsewhere. The Ctrl still exists, it's just not used for this
4851 purpose. So for non-Mac platforms this is the same as `ControlDown`
4852 and Macs this is the same as `MetaDown`.
4853 """
4854 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4855
4856 def HasModifiers(*args, **kwargs):
4857 """
4858 HasModifiers(self) -> bool
4859
4860 Returns true if either CTRL or ALT keys was down at the time of the
4861 key event. Note that this function does not take into account neither
4862 SHIFT nor META key states (the reason for ignoring the latter is that
4863 it is common for NUMLOCK key to be configured as META under X but the
4864 key presses even while NUMLOCK is on should be still processed
4865 normally).
4866 """
4867 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4868
4869 def GetKeyCode(*args, **kwargs):
4870 """
4871 GetKeyCode(self) -> int
4872
4873 Returns the virtual key code. ASCII events return normal ASCII values,
4874 while non-ASCII events return values such as WXK_LEFT for the left
4875 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4876 codes.
4877
4878 Note that in Unicode build, the returned value is meaningful only if
4879 the user entered a character that can be represented in current
4880 locale's default charset. You can obtain the corresponding Unicode
4881 character using `GetUnicodeKey`.
4882 """
4883 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4884
4885 KeyCode = GetKeyCode
4886 def GetUnicodeKey(*args, **kwargs):
4887 """
4888 GetUnicodeKey(self) -> int
4889
4890 Returns the Unicode character corresponding to this key event. This
4891 function is only meaningfule in a Unicode build of wxPython.
4892 """
4893 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4894
4895 GetUniChar = GetUnicodeKey
4896 def SetUnicodeKey(*args, **kwargs):
4897 """
4898 SetUnicodeKey(self, int uniChar)
4899
4900 Set the Unicode value of the key event, but only if this is a Unicode
4901 build of wxPython.
4902 """
4903 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4904
4905 def GetRawKeyCode(*args, **kwargs):
4906 """
4907 GetRawKeyCode(self) -> unsigned int
4908
4909 Returns the raw key code for this event. This is a platform-dependent
4910 scan code which should only be used in advanced
4911 applications. Currently the raw key codes are not supported by all
4912 ports.
4913 """
4914 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4915
4916 def GetRawKeyFlags(*args, **kwargs):
4917 """
4918 GetRawKeyFlags(self) -> unsigned int
4919
4920 Returns the low level key flags for this event. The flags are
4921 platform-dependent and should only be used in advanced applications.
4922 Currently the raw key flags are not supported by all ports.
4923 """
4924 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4925
4926 def GetPosition(*args, **kwargs):
4927 """
4928 GetPosition(self) -> Point
4929
4930 Find the position of the event, if applicable.
4931 """
4932 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4933
4934 def GetPositionTuple(*args, **kwargs):
4935 """
4936 GetPositionTuple() -> (x,y)
4937
4938 Find the position of the event, if applicable.
4939 """
4940 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4941
4942 def GetX(*args, **kwargs):
4943 """
4944 GetX(self) -> int
4945
4946 Returns the X position (in client coordinates) of the event, if
4947 applicable.
4948 """
4949 return _core_.KeyEvent_GetX(*args, **kwargs)
4950
4951 def GetY(*args, **kwargs):
4952 """
4953 GetY(self) -> int
4954
4955 Returns the Y position (in client coordinates) of the event, if
4956 applicable.
4957 """
4958 return _core_.KeyEvent_GetY(*args, **kwargs)
4959
4960 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4961 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4962 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4963 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4964 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4965 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4966 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4967 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4968 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4969 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4970 _core_.KeyEvent_swigregister(KeyEvent)
4971
4972 #---------------------------------------------------------------------------
4973
4974 class SizeEvent(Event):
4975 """
4976 A size event holds information about size change events. The EVT_SIZE
4977 handler function will be called when the window it is bound to has
4978 been resized.
4979
4980 Note that the size passed is of the whole window: call
4981 `wx.Window.GetClientSize` for the area which may be used by the
4982 application.
4983
4984 When a window is resized, usually only a small part of the window is
4985 damaged and and that area is all that is in the update region for the
4986 next paint event. However, if your drawing depends on the size of the
4987 window, you may need to clear the DC explicitly and repaint the whole
4988 window. In which case, you may need to call `wx.Window.Refresh` to
4989 invalidate the entire window.
4990
4991 """
4992 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4993 __repr__ = _swig_repr
4994 def __init__(self, *args, **kwargs):
4995 """
4996 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4997
4998 Construct a new ``wx.SizeEvent``.
4999 """
5000 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5001 def GetSize(*args, **kwargs):
5002 """
5003 GetSize(self) -> Size
5004
5005 Returns the entire size of the window generating the size change
5006 event.
5007 """
5008 return _core_.SizeEvent_GetSize(*args, **kwargs)
5009
5010 def GetRect(*args, **kwargs):
5011 """GetRect(self) -> Rect"""
5012 return _core_.SizeEvent_GetRect(*args, **kwargs)
5013
5014 def SetRect(*args, **kwargs):
5015 """SetRect(self, Rect rect)"""
5016 return _core_.SizeEvent_SetRect(*args, **kwargs)
5017
5018 def SetSize(*args, **kwargs):
5019 """SetSize(self, Size size)"""
5020 return _core_.SizeEvent_SetSize(*args, **kwargs)
5021
5022 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5023 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5024 _core_.SizeEvent_swigregister(SizeEvent)
5025
5026 #---------------------------------------------------------------------------
5027
5028 class MoveEvent(Event):
5029 """
5030 This event object is sent for EVT_MOVE event bindings when a window is
5031 moved to a new position.
5032 """
5033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5034 __repr__ = _swig_repr
5035 def __init__(self, *args, **kwargs):
5036 """
5037 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5038
5039 Constructor.
5040 """
5041 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5042 def GetPosition(*args, **kwargs):
5043 """
5044 GetPosition(self) -> Point
5045
5046 Returns the position of the window generating the move change event.
5047 """
5048 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5049
5050 def GetRect(*args, **kwargs):
5051 """GetRect(self) -> Rect"""
5052 return _core_.MoveEvent_GetRect(*args, **kwargs)
5053
5054 def SetRect(*args, **kwargs):
5055 """SetRect(self, Rect rect)"""
5056 return _core_.MoveEvent_SetRect(*args, **kwargs)
5057
5058 def SetPosition(*args, **kwargs):
5059 """SetPosition(self, Point pos)"""
5060 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5061
5062 m_pos = property(GetPosition, SetPosition)
5063 m_rect = property(GetRect, SetRect)
5064
5065 _core_.MoveEvent_swigregister(MoveEvent)
5066
5067 #---------------------------------------------------------------------------
5068
5069 class PaintEvent(Event):
5070 """
5071 A paint event is sent when a window's contents needs to be repainted.
5072 Note that in an EVT_PAINT handler the application must *always* create
5073 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5074 Windows assumes that the window has not been painted yet and will send
5075 the event again, causing endless refreshes.
5076
5077 You can optimize painting by retrieving the rectangles that have been
5078 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5079 and only repainting these rectangles. The rectangles are in terms of
5080 the client area, and are unscrolled, so you will need to do some
5081 calculations using the current view position to obtain logical,
5082 scrolled units.
5083
5084 """
5085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5086 __repr__ = _swig_repr
5087 def __init__(self, *args, **kwargs):
5088 """__init__(self, int Id=0) -> PaintEvent"""
5089 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5090 _core_.PaintEvent_swigregister(PaintEvent)
5091
5092 class NcPaintEvent(Event):
5093 """Proxy of C++ NcPaintEvent class"""
5094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5095 __repr__ = _swig_repr
5096 def __init__(self, *args, **kwargs):
5097 """__init__(self, int winid=0) -> NcPaintEvent"""
5098 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5099 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5100
5101 #---------------------------------------------------------------------------
5102
5103 class EraseEvent(Event):
5104 """
5105 An erase event is sent whenever the background of a window needs to be
5106 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5107 binder. On some platforms, such as GTK+, this event is simulated
5108 (simply generated just before the paint event) and may cause flicker.
5109
5110 To paint a custom background use the `GetDC` method and use the returned
5111 device context if it is not ``None``, otherwise create a temporary
5112 `wx.ClientDC` and draw on that.
5113
5114 """
5115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5116 __repr__ = _swig_repr
5117 def __init__(self, *args, **kwargs):
5118 """
5119 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5120
5121 Constructor
5122 """
5123 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5124 def GetDC(*args, **kwargs):
5125 """
5126 GetDC(self) -> DC
5127
5128 Returns the device context the event handler should draw upon. If
5129 ``None`` is returned then create a temporary `wx.ClientDC` and use
5130 that instead.
5131 """
5132 return _core_.EraseEvent_GetDC(*args, **kwargs)
5133
5134 _core_.EraseEvent_swigregister(EraseEvent)
5135
5136 #---------------------------------------------------------------------------
5137
5138 class FocusEvent(Event):
5139 """
5140 A focus event is sent when a window's focus changes. The window losing
5141 focus receives an EVT_KILL_FOCUS event while the window gaining it
5142 gets an EVT_SET_FOCUS event.
5143
5144 Notice that the set focus event happens both when the user gives focus
5145 to the window (whether using the mouse or keyboard) and when it is
5146 done from the program itself using `wx.Window.SetFocus`.
5147
5148 """
5149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5150 __repr__ = _swig_repr
5151 def __init__(self, *args, **kwargs):
5152 """
5153 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5154
5155 Constructor
5156 """
5157 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5158 def GetWindow(*args, **kwargs):
5159 """
5160 GetWindow(self) -> Window
5161
5162 Returns the other window associated with this event, that is the
5163 window which had the focus before for the EVT_SET_FOCUS event and the
5164 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5165
5166 Warning: the window returned may be None!
5167 """
5168 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5169
5170 def SetWindow(*args, **kwargs):
5171 """SetWindow(self, Window win)"""
5172 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5173
5174 _core_.FocusEvent_swigregister(FocusEvent)
5175
5176 #---------------------------------------------------------------------------
5177
5178 class ChildFocusEvent(CommandEvent):
5179 """
5180 wx.ChildFocusEvent notifies the parent that a child has received the
5181 focus. Unlike `wx.FocusEvent` it is propagated up the window
5182 heirarchy.
5183 """
5184 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5185 __repr__ = _swig_repr
5186 def __init__(self, *args, **kwargs):
5187 """
5188 __init__(self, Window win=None) -> ChildFocusEvent
5189
5190 Constructor
5191 """
5192 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5193 def GetWindow(*args, **kwargs):
5194 """
5195 GetWindow(self) -> Window
5196
5197 The window which has just received the focus.
5198 """
5199 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5200
5201 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5202
5203 #---------------------------------------------------------------------------
5204
5205 class ActivateEvent(Event):
5206 """
5207 An activate event is sent when a top-level window or the entire
5208 application is being activated or deactivated.
5209
5210 A top-level window (a dialog or frame) receives an activate event when
5211 is being activated or deactivated. This is indicated visually by the
5212 title bar changing colour, and a subwindow gaining the keyboard focus.
5213 An application is activated or deactivated when one of its frames
5214 becomes activated, or a frame becomes inactivate resulting in all
5215 application frames being inactive.
5216
5217 Please note that usually you should call event.Skip() in your handlers
5218 for these events so the default handlers will still be called, as not
5219 doing so can result in strange effects.
5220
5221 """
5222 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5223 __repr__ = _swig_repr
5224 def __init__(self, *args, **kwargs):
5225 """
5226 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5227
5228 Constructor
5229 """
5230 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5231 def GetActive(*args, **kwargs):
5232 """
5233 GetActive(self) -> bool
5234
5235 Returns true if the application or window is being activated, false
5236 otherwise.
5237 """
5238 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5239
5240 _core_.ActivateEvent_swigregister(ActivateEvent)
5241
5242 #---------------------------------------------------------------------------
5243
5244 class InitDialogEvent(Event):
5245 """
5246 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5247 any window when `wx.Window.InitDialog` is called. Handlers for this
5248 event can transfer data to the window, or anything else that should be
5249 done before the user begins editing the form. The default handler
5250 calls `wx.Window.TransferDataToWindow`.
5251 """
5252 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5253 __repr__ = _swig_repr
5254 def __init__(self, *args, **kwargs):
5255 """
5256 __init__(self, int Id=0) -> InitDialogEvent
5257
5258 Constructor
5259 """
5260 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5261 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5262
5263 #---------------------------------------------------------------------------
5264
5265 class MenuEvent(Event):
5266 """
5267 This class is used for a variety of menu-related events. Note that
5268 these do not include menu command events, which are handled by sending
5269 `wx.CommandEvent` objects.
5270
5271 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5272 text in the first field of the status bar.
5273 """
5274 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5275 __repr__ = _swig_repr
5276 def __init__(self, *args, **kwargs):
5277 """
5278 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5279
5280 Constructor
5281 """
5282 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5283 def GetMenuId(*args, **kwargs):
5284 """
5285 GetMenuId(self) -> int
5286
5287 Returns the menu identifier associated with the event. This method
5288 should be only used with the HIGHLIGHT events.
5289 """
5290 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5291
5292 def IsPopup(*args, **kwargs):
5293 """
5294 IsPopup(self) -> bool
5295
5296 Returns ``True`` if the menu which is being opened or closed is a
5297 popup menu, ``False`` if it is a normal one. This method should only
5298 be used with the OPEN and CLOSE events.
5299 """
5300 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5301
5302 def GetMenu(*args, **kwargs):
5303 """
5304 GetMenu(self) -> Menu
5305
5306 Returns the menu which is being opened or closed. This method should
5307 only be used with the OPEN and CLOSE events.
5308 """
5309 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5310
5311 _core_.MenuEvent_swigregister(MenuEvent)
5312
5313 #---------------------------------------------------------------------------
5314
5315 class CloseEvent(Event):
5316 """
5317 This event class contains information about window and session close
5318 events.
5319
5320 The handler function for EVT_CLOSE is called when the user has tried
5321 to close a a frame or dialog box using the window manager controls or
5322 the system menu. It can also be invoked by the application itself
5323 programmatically, for example by calling the `wx.Window.Close`
5324 function.
5325
5326 You should check whether the application is forcing the deletion of
5327 the window using `CanVeto`. If it returns ``False``, you must destroy
5328 the window using `wx.Window.Destroy`. If the return value is ``True``,
5329 it is up to you whether you respond by destroying the window or not.
5330 For example you may wish to display a message dialog prompting to save
5331 files or to cancel the close.
5332
5333 If you don't destroy the window, you should call `Veto` to let the
5334 calling code know that you did not destroy the window. This allows the
5335 `wx.Window.Close` function to return ``True`` or ``False`` depending
5336 on whether the close instruction was honored or not.
5337 """
5338 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5339 __repr__ = _swig_repr
5340 def __init__(self, *args, **kwargs):
5341 """
5342 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5343
5344 Constructor.
5345 """
5346 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5347 def SetLoggingOff(*args, **kwargs):
5348 """
5349 SetLoggingOff(self, bool logOff)
5350
5351 Sets the 'logging off' flag.
5352 """
5353 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5354
5355 def GetLoggingOff(*args, **kwargs):
5356 """
5357 GetLoggingOff(self) -> bool
5358
5359 Returns ``True`` if the user is logging off or ``False`` if the
5360 system is shutting down. This method can only be called for end
5361 session and query end session events, it doesn't make sense for close
5362 window event.
5363 """
5364 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5365
5366 def Veto(*args, **kwargs):
5367 """
5368 Veto(self, bool veto=True)
5369
5370 Call this from your event handler to veto a system shutdown or to
5371 signal to the calling application that a window close did not happen.
5372
5373 You can only veto a shutdown or close if `CanVeto` returns true.
5374 """
5375 return _core_.CloseEvent_Veto(*args, **kwargs)
5376
5377 def GetVeto(*args, **kwargs):
5378 """GetVeto(self) -> bool"""
5379 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5380
5381 def SetCanVeto(*args, **kwargs):
5382 """
5383 SetCanVeto(self, bool canVeto)
5384
5385 Sets the 'can veto' flag.
5386 """
5387 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5388
5389 def CanVeto(*args, **kwargs):
5390 """
5391 CanVeto(self) -> bool
5392
5393 Returns true if you can veto a system shutdown or a window close
5394 event. Vetoing a window close event is not possible if the calling
5395 code wishes to force the application to exit, and so this function
5396 must be called to check this.
5397 """
5398 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5399
5400 _core_.CloseEvent_swigregister(CloseEvent)
5401
5402 #---------------------------------------------------------------------------
5403
5404 class ShowEvent(Event):
5405 """An EVT_SHOW event is sent when a window is shown or hidden."""
5406 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5407 __repr__ = _swig_repr
5408 def __init__(self, *args, **kwargs):
5409 """
5410 __init__(self, int winid=0, bool show=False) -> ShowEvent
5411
5412 An EVT_SHOW event is sent when a window is shown or hidden.
5413 """
5414 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5415 def SetShow(*args, **kwargs):
5416 """SetShow(self, bool show)"""
5417 return _core_.ShowEvent_SetShow(*args, **kwargs)
5418
5419 def GetShow(*args, **kwargs):
5420 """GetShow(self) -> bool"""
5421 return _core_.ShowEvent_GetShow(*args, **kwargs)
5422
5423 _core_.ShowEvent_swigregister(ShowEvent)
5424
5425 #---------------------------------------------------------------------------
5426
5427 class IconizeEvent(Event):
5428 """
5429 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5430 restored.
5431 """
5432 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5433 __repr__ = _swig_repr
5434 def __init__(self, *args, **kwargs):
5435 """
5436 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5437
5438 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5439 restored.
5440 """
5441 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5442 def Iconized(*args, **kwargs):
5443 """
5444 Iconized(self) -> bool
5445
5446 Returns ``True`` if the frame has been iconized, ``False`` if it has
5447 been restored.
5448 """
5449 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5450
5451 _core_.IconizeEvent_swigregister(IconizeEvent)
5452
5453 #---------------------------------------------------------------------------
5454
5455 class MaximizeEvent(Event):
5456 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5457 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5458 __repr__ = _swig_repr
5459 def __init__(self, *args, **kwargs):
5460 """
5461 __init__(self, int id=0) -> MaximizeEvent
5462
5463 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5464 """
5465 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5466 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5467
5468 #---------------------------------------------------------------------------
5469
5470 class DropFilesEvent(Event):
5471 """
5472 This class is used for drop files events, that is, when files have
5473 been dropped onto the window. This functionality is only available
5474 under Windows. The window must have previously been enabled for
5475 dropping by calling `wx.Window.DragAcceptFiles`.
5476
5477 Important note: this is a separate implementation to the more general
5478 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5479 implementation uses the older, Windows message-based approach of
5480 dropping files.
5481
5482 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5483 events.
5484
5485 """
5486 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5487 def __init__(self): raise AttributeError, "No constructor defined"
5488 __repr__ = _swig_repr
5489 def GetPosition(*args, **kwargs):
5490 """
5491 GetPosition(self) -> Point
5492
5493 Returns the position at which the files were dropped.
5494 """
5495 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5496
5497 def GetNumberOfFiles(*args, **kwargs):
5498 """
5499 GetNumberOfFiles(self) -> int
5500
5501 Returns the number of files dropped.
5502 """
5503 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5504
5505 def GetFiles(*args, **kwargs):
5506 """
5507 GetFiles(self) -> PyObject
5508
5509 Returns a list of the filenames that were dropped.
5510 """
5511 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5512
5513 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5514
5515 #---------------------------------------------------------------------------
5516
5517 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5518 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5519 class UpdateUIEvent(CommandEvent):
5520 """
5521 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5522 wxWidgets to give an application the chance to update various user
5523 interface elements.
5524
5525 Without update UI events, an application has to work hard to
5526 check/uncheck, enable/disable, and set the text for elements such as
5527 menu items and toolbar buttons. The code for doing this has to be
5528 mixed up with the code that is invoked when an action is invoked for a
5529 menu item or button.
5530
5531 With update UI events, you define an event handler to look at the
5532 state of the application and change UI elements accordingly. wxWidgets
5533 will call your handler functions in idle time, so you don't have to
5534 worry where to call this code. In addition to being a clearer and more
5535 declarative method, it also means you don't have to worry whether
5536 you're updating a toolbar or menubar identifier. The same handler can
5537 update a menu item and toolbar button, if the ID values are the same.
5538
5539 Instead of directly manipulating the menu or button, you call
5540 functions in the event object, such as `Check`. wxWidgets will
5541 determine whether such a call has been made, and which UI element to
5542 update.
5543
5544 These events will work for popup menus as well as menubars. Just
5545 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5546 any UI events for the window that owns the menu.
5547
5548 If you find that the overhead of UI update processing is affecting
5549 your application, you can do one or both of the following:
5550
5551 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5552 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5553 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5554 receive update events. No other windows will receive update
5555 events.
5556
5557 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5558 value to set the delay between updates. You may need to call
5559 `wx.Window.UpdateWindowUI` at critical points, for example when
5560 a dialog is about to be shown, in case the user sees a slight
5561 delay before windows are updated.
5562
5563 Note that although events are sent in idle time, defining a EVT_IDLE
5564 handler for a window does not affect this because the events are sent
5565 from an internal idle handler.
5566
5567 wxWidgets tries to optimize update events on some platforms. On
5568 Windows and GTK+, events for menubar items are only sent when the menu
5569 is about to be shown, and not in idle time.
5570
5571 """
5572 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5573 __repr__ = _swig_repr
5574 def __init__(self, *args, **kwargs):
5575 """
5576 __init__(self, int commandId=0) -> UpdateUIEvent
5577
5578 Constructor
5579 """
5580 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5581 def GetChecked(*args, **kwargs):
5582 """
5583 GetChecked(self) -> bool
5584
5585 Returns ``True`` if the UI element should be checked.
5586 """
5587 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5588
5589 def GetEnabled(*args, **kwargs):
5590 """
5591 GetEnabled(self) -> bool
5592
5593 Returns ``True`` if the UI element should be enabled.
5594 """
5595 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5596
5597 def GetShown(*args, **kwargs):
5598 """
5599 GetShown(self) -> bool
5600
5601 Returns ``True`` if the UI element should be shown.
5602 """
5603 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5604
5605 def GetText(*args, **kwargs):
5606 """
5607 GetText(self) -> String
5608
5609 Returns the text that should be set for the UI element.
5610 """
5611 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5612
5613 def GetSetText(*args, **kwargs):
5614 """
5615 GetSetText(self) -> bool
5616
5617 Returns ``True`` if the application has called `SetText`. For
5618 wxWidgets internal use only.
5619 """
5620 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5621
5622 def GetSetChecked(*args, **kwargs):
5623 """
5624 GetSetChecked(self) -> bool
5625
5626 Returns ``True`` if the application has called `Check`. For wxWidgets
5627 internal use only.
5628 """
5629 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5630
5631 def GetSetEnabled(*args, **kwargs):
5632 """
5633 GetSetEnabled(self) -> bool
5634
5635 Returns ``True`` if the application has called `Enable`. For wxWidgets
5636 internal use only.
5637 """
5638 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5639
5640 def GetSetShown(*args, **kwargs):
5641 """
5642 GetSetShown(self) -> bool
5643
5644 Returns ``True`` if the application has called `Show`. For wxWidgets
5645 internal use only.
5646 """
5647 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5648
5649 def Check(*args, **kwargs):
5650 """
5651 Check(self, bool check)
5652
5653 Check or uncheck the UI element.
5654 """
5655 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5656
5657 def Enable(*args, **kwargs):
5658 """
5659 Enable(self, bool enable)
5660
5661 Enable or disable the UI element.
5662 """
5663 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5664
5665 def Show(*args, **kwargs):
5666 """
5667 Show(self, bool show)
5668
5669 Show or hide the UI element.
5670 """
5671 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5672
5673 def SetText(*args, **kwargs):
5674 """
5675 SetText(self, String text)
5676
5677 Sets the text for this UI element.
5678 """
5679 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5680
5681 def SetUpdateInterval(*args, **kwargs):
5682 """
5683 SetUpdateInterval(long updateInterval)
5684
5685 Sets the interval between updates in milliseconds. Set to -1 to
5686 disable updates, or to 0 to update as frequently as possible. The
5687 default is 0.
5688
5689 Use this to reduce the overhead of UI update events if your
5690 application has a lot of windows. If you set the value to -1 or
5691 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5692 at appropriate points in your application, such as when a dialog is
5693 about to be shown.
5694 """
5695 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5696
5697 SetUpdateInterval = staticmethod(SetUpdateInterval)
5698 def GetUpdateInterval(*args, **kwargs):
5699 """
5700 GetUpdateInterval() -> long
5701
5702 Returns the current interval between updates in milliseconds. -1
5703 disables updates, 0 updates as frequently as possible.
5704 """
5705 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5706
5707 GetUpdateInterval = staticmethod(GetUpdateInterval)
5708 def CanUpdate(*args, **kwargs):
5709 """
5710 CanUpdate(Window win) -> bool
5711
5712 Returns ``True`` if it is appropriate to update (send UI update events
5713 to) this window.
5714
5715 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5716 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5717 events were last sent in idle time, and the update interval, to
5718 determine whether events should be sent to this window now. By default
5719 this will always return true because the update mode is initially
5720 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5721 events will be sent as often as possible. You can reduce the frequency
5722 that events are sent by changing the mode and/or setting an update
5723 interval.
5724
5725 """
5726 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5727
5728 CanUpdate = staticmethod(CanUpdate)
5729 def ResetUpdateTime(*args, **kwargs):
5730 """
5731 ResetUpdateTime()
5732
5733 Used internally to reset the last-updated time to the current time. It
5734 is assumed that update events are normally sent in idle time, so this
5735 is called at the end of idle processing.
5736 """
5737 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5738
5739 ResetUpdateTime = staticmethod(ResetUpdateTime)
5740 def SetMode(*args, **kwargs):
5741 """
5742 SetMode(int mode)
5743
5744 Specify how wxWidgets will send update events: to all windows, or only
5745 to those which specify that they will process the events.
5746
5747 The mode may be one of the following values:
5748
5749 ============================= ==========================================
5750 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5751 is the default setting.
5752 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5753 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5754 style set.
5755 ============================= ==========================================
5756
5757 """
5758 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5759
5760 SetMode = staticmethod(SetMode)
5761 def GetMode(*args, **kwargs):
5762 """
5763 GetMode() -> int
5764
5765 Returns a value specifying how wxWidgets will send update events: to
5766 all windows, or only to those which specify that they will process the
5767 events.
5768 """
5769 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5770
5771 GetMode = staticmethod(GetMode)
5772 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5773
5774 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5775 """
5776 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5777
5778 Sets the interval between updates in milliseconds. Set to -1 to
5779 disable updates, or to 0 to update as frequently as possible. The
5780 default is 0.
5781
5782 Use this to reduce the overhead of UI update events if your
5783 application has a lot of windows. If you set the value to -1 or
5784 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5785 at appropriate points in your application, such as when a dialog is
5786 about to be shown.
5787 """
5788 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5789
5790 def UpdateUIEvent_GetUpdateInterval(*args):
5791 """
5792 UpdateUIEvent_GetUpdateInterval() -> long
5793
5794 Returns the current interval between updates in milliseconds. -1
5795 disables updates, 0 updates as frequently as possible.
5796 """
5797 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5798
5799 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5800 """
5801 UpdateUIEvent_CanUpdate(Window win) -> bool
5802
5803 Returns ``True`` if it is appropriate to update (send UI update events
5804 to) this window.
5805
5806 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5807 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5808 events were last sent in idle time, and the update interval, to
5809 determine whether events should be sent to this window now. By default
5810 this will always return true because the update mode is initially
5811 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5812 events will be sent as often as possible. You can reduce the frequency
5813 that events are sent by changing the mode and/or setting an update
5814 interval.
5815
5816 """
5817 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5818
5819 def UpdateUIEvent_ResetUpdateTime(*args):
5820 """
5821 UpdateUIEvent_ResetUpdateTime()
5822
5823 Used internally to reset the last-updated time to the current time. It
5824 is assumed that update events are normally sent in idle time, so this
5825 is called at the end of idle processing.
5826 """
5827 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5828
5829 def UpdateUIEvent_SetMode(*args, **kwargs):
5830 """
5831 UpdateUIEvent_SetMode(int mode)
5832
5833 Specify how wxWidgets will send update events: to all windows, or only
5834 to those which specify that they will process the events.
5835
5836 The mode may be one of the following values:
5837
5838 ============================= ==========================================
5839 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5840 is the default setting.
5841 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5842 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5843 style set.
5844 ============================= ==========================================
5845
5846 """
5847 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5848
5849 def UpdateUIEvent_GetMode(*args):
5850 """
5851 UpdateUIEvent_GetMode() -> int
5852
5853 Returns a value specifying how wxWidgets will send update events: to
5854 all windows, or only to those which specify that they will process the
5855 events.
5856 """
5857 return _core_.UpdateUIEvent_GetMode(*args)
5858
5859 #---------------------------------------------------------------------------
5860
5861 class SysColourChangedEvent(Event):
5862 """
5863 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5864 when the user changes the colour settings using the control
5865 panel. This is only applicable under Windows.
5866
5867 The default event handler for this event propagates the event to child
5868 windows, since Windows only sends the events to top-level windows. If
5869 intercepting this event for a top-level window, remember to call
5870 `Skip` so the the base class handler will still be executed, or to
5871 pass the event on to the window's children explicitly.
5872
5873 """
5874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5875 __repr__ = _swig_repr
5876 def __init__(self, *args, **kwargs):
5877 """
5878 __init__(self) -> SysColourChangedEvent
5879
5880 Constructor
5881 """
5882 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5883 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5884
5885 #---------------------------------------------------------------------------
5886
5887 class MouseCaptureChangedEvent(Event):
5888 """
5889 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5890 a window that loses its mouse capture. This is called even if
5891 `wx.Window.ReleaseMouse` was called by the application code. Handling
5892 this event allows an application to cater for unexpected capture
5893 releases which might otherwise confuse mouse handling code.
5894
5895 This event is implemented under Windows only.
5896 """
5897 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5898 __repr__ = _swig_repr
5899 def __init__(self, *args, **kwargs):
5900 """
5901 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5902
5903 Constructor
5904 """
5905 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5906 def GetCapturedWindow(*args, **kwargs):
5907 """
5908 GetCapturedWindow(self) -> Window
5909
5910 Returns the window that gained the capture, or ``None`` if it was a
5911 non-wxWidgets window.
5912 """
5913 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5914
5915 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5916
5917 #---------------------------------------------------------------------------
5918
5919 class MouseCaptureLostEvent(Event):
5920 """
5921 A mouse capture lost event is sent to a window that obtained mouse
5922 capture, which was subsequently loss due to "external" event, for
5923 example when a dialog box is shown or if another application captures
5924 the mouse.
5925
5926 If this happens, this event is sent to all windows that are on the
5927 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5928 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5929 if the capture changes because of a call to CaptureMouse or
5930 ReleaseMouse.
5931
5932 This event is currently emitted under Windows only.
5933
5934 """
5935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5936 __repr__ = _swig_repr
5937 def __init__(self, *args, **kwargs):
5938 """
5939 __init__(self, int winid=0) -> MouseCaptureLostEvent
5940
5941 A mouse capture lost event is sent to a window that obtained mouse
5942 capture, which was subsequently loss due to "external" event, for
5943 example when a dialog box is shown or if another application captures
5944 the mouse.
5945
5946 If this happens, this event is sent to all windows that are on the
5947 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5948 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5949 if the capture changes because of a call to CaptureMouse or
5950 ReleaseMouse.
5951
5952 This event is currently emitted under Windows only.
5953
5954 """
5955 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
5956 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
5957
5958 #---------------------------------------------------------------------------
5959
5960 class DisplayChangedEvent(Event):
5961 """
5962 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5963 resolution has changed.
5964
5965 This event is implemented under Windows only.
5966 """
5967 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5968 __repr__ = _swig_repr
5969 def __init__(self, *args, **kwargs):
5970 """__init__(self) -> DisplayChangedEvent"""
5971 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5972 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
5973
5974 #---------------------------------------------------------------------------
5975
5976 class PaletteChangedEvent(Event):
5977 """
5978 An EVT_PALETTE_CHANGED event is sent when the system palette has
5979 changed, thereby giving each window a chance to redo their own to
5980 match.
5981
5982 This event is implemented under Windows only.
5983 """
5984 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5985 __repr__ = _swig_repr
5986 def __init__(self, *args, **kwargs):
5987 """
5988 __init__(self, int id=0) -> PaletteChangedEvent
5989
5990 An EVT_PALETTE_CHANGED event is sent when the system palette has
5991 changed, thereby giving each window a chance to redo their own to
5992 match.
5993
5994 This event is implemented under Windows only.
5995 """
5996 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
5997 def SetChangedWindow(*args, **kwargs):
5998 """SetChangedWindow(self, Window win)"""
5999 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6000
6001 def GetChangedWindow(*args, **kwargs):
6002 """GetChangedWindow(self) -> Window"""
6003 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6004
6005 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6006
6007 #---------------------------------------------------------------------------
6008
6009 class QueryNewPaletteEvent(Event):
6010 """
6011 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6012 focus and should re-do its palette.
6013
6014 This event is implemented under Windows only.
6015 """
6016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6017 __repr__ = _swig_repr
6018 def __init__(self, *args, **kwargs):
6019 """
6020 __init__(self, int winid=0) -> QueryNewPaletteEvent
6021
6022 Constructor.
6023 """
6024 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6025 def SetPaletteRealized(*args, **kwargs):
6026 """
6027 SetPaletteRealized(self, bool realized)
6028
6029 App should set this if it changes the palette.
6030 """
6031 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6032
6033 def GetPaletteRealized(*args, **kwargs):
6034 """GetPaletteRealized(self) -> bool"""
6035 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6036
6037 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6038
6039 #---------------------------------------------------------------------------
6040
6041 class NavigationKeyEvent(Event):
6042 """
6043 EVT_NAVIGATION_KEY events are used to control moving the focus between
6044 widgets, otherwise known as tab-traversal. You woudl normally not
6045 catch navigation events in applications as there are already
6046 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6047 it useful to send navigation events in certain situations to change
6048 the focus in certain ways, although it's probably easier to just call
6049 `wx.Window.Navigate`.
6050 """
6051 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6052 __repr__ = _swig_repr
6053 def __init__(self, *args, **kwargs):
6054 """__init__(self) -> NavigationKeyEvent"""
6055 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6056 def GetDirection(*args, **kwargs):
6057 """
6058 GetDirection(self) -> bool
6059
6060 Returns ``True`` if the direction is forward, ``False`` otherwise.
6061 """
6062 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6063
6064 def SetDirection(*args, **kwargs):
6065 """
6066 SetDirection(self, bool forward)
6067
6068 Specify the direction that the navigation should take. Usually the
6069 difference between using Tab and Shift-Tab.
6070 """
6071 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6072
6073 def IsWindowChange(*args, **kwargs):
6074 """
6075 IsWindowChange(self) -> bool
6076
6077 Returns ``True`` if window change is allowed.
6078 """
6079 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6080
6081 def SetWindowChange(*args, **kwargs):
6082 """
6083 SetWindowChange(self, bool ischange)
6084
6085 Specify if the navigation should be able to change parent windows.
6086 For example, changing notebook pages, etc. This is usually implemented
6087 by using Control-Tab.
6088 """
6089 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6090
6091 def IsFromTab(*args, **kwargs):
6092 """
6093 IsFromTab(self) -> bool
6094
6095 Returns ``True`` if the navigation event is originated from the Tab
6096 key.
6097 """
6098 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6099
6100 def SetFromTab(*args, **kwargs):
6101 """
6102 SetFromTab(self, bool bIs)
6103
6104 Set to true under MSW if the event was generated using the tab key.
6105 This is required for proper navogation over radio buttons.
6106 """
6107 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6108
6109 def SetFlags(*args, **kwargs):
6110 """
6111 SetFlags(self, long flags)
6112
6113 Set the navigation flags to a combination of the following:
6114
6115 * wx.NavigationKeyEvent.IsBackward
6116 * wx.NavigationKeyEvent.IsForward
6117 * wx.NavigationKeyEvent.WinChange
6118 * wx.NavigationKeyEvent.FromTab
6119
6120 """
6121 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6122
6123 def GetCurrentFocus(*args, **kwargs):
6124 """
6125 GetCurrentFocus(self) -> Window
6126
6127 Returns the child window which currenty has the focus. May be
6128 ``None``.
6129 """
6130 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6131
6132 def SetCurrentFocus(*args, **kwargs):
6133 """
6134 SetCurrentFocus(self, Window win)
6135
6136 Set the window that has the focus.
6137 """
6138 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6139
6140 IsBackward = _core_.NavigationKeyEvent_IsBackward
6141 IsForward = _core_.NavigationKeyEvent_IsForward
6142 WinChange = _core_.NavigationKeyEvent_WinChange
6143 FromTab = _core_.NavigationKeyEvent_FromTab
6144 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6145
6146 #---------------------------------------------------------------------------
6147
6148 class WindowCreateEvent(CommandEvent):
6149 """
6150 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6151 underlying GUI object) exists.
6152 """
6153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6154 __repr__ = _swig_repr
6155 def __init__(self, *args, **kwargs):
6156 """
6157 __init__(self, Window win=None) -> WindowCreateEvent
6158
6159 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6160 underlying GUI object) exists.
6161 """
6162 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6163 def GetWindow(*args, **kwargs):
6164 """
6165 GetWindow(self) -> Window
6166
6167 Returns the window that this event refers to.
6168 """
6169 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6170
6171 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6172
6173 class WindowDestroyEvent(CommandEvent):
6174 """
6175 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6176 when the GUI window is destroyed.
6177
6178 When a class derived from `wx.Window` is destroyed its destructor will
6179 have already run by the time this event is sent. Therefore this event
6180 will not usually be received at all by the window itself. Since it is
6181 received after the destructor has run, an object should not try to
6182 handle its own wx.WindowDestroyEvent, but it can be used to get
6183 notification of the destruction of another window.
6184 """
6185 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6186 __repr__ = _swig_repr
6187 def __init__(self, *args, **kwargs):
6188 """
6189 __init__(self, Window win=None) -> WindowDestroyEvent
6190
6191 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6192 when the GUI window is destroyed.
6193
6194 When a class derived from `wx.Window` is destroyed its destructor will
6195 have already run by the time this event is sent. Therefore this event
6196 will not usually be received at all by the window itself. Since it is
6197 received after the destructor has run, an object should not try to
6198 handle its own wx.WindowDestroyEvent, but it can be used to get
6199 notification of the destruction of another window.
6200 """
6201 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6202 def GetWindow(*args, **kwargs):
6203 """
6204 GetWindow(self) -> Window
6205
6206 Returns the window that this event refers to.
6207 """
6208 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6209
6210 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6211
6212 #---------------------------------------------------------------------------
6213
6214 class ContextMenuEvent(CommandEvent):
6215 """
6216 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6217 give the application a chance to show a context (popup) menu.
6218 """
6219 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6220 __repr__ = _swig_repr
6221 def __init__(self, *args, **kwargs):
6222 """
6223 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6224
6225 Constructor.
6226 """
6227 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6228 def GetPosition(*args, **kwargs):
6229 """
6230 GetPosition(self) -> Point
6231
6232 Returns the position (in screen coordinants) at which the menu should
6233 be shown.
6234 """
6235 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6236
6237 def SetPosition(*args, **kwargs):
6238 """
6239 SetPosition(self, Point pos)
6240
6241 Sets the position at which the menu should be shown.
6242 """
6243 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6244
6245 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6246
6247 #---------------------------------------------------------------------------
6248
6249 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6250 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6251 class IdleEvent(Event):
6252 """
6253 This class is used for EVT_IDLE events, which are generated and sent
6254 when the application *becomes* idle. In other words, the when the
6255 event queue becomes empty then idle events are sent to all windows (by
6256 default) and as long as none of them call `RequestMore` then there are
6257 no more idle events until after the system event queue has some normal
6258 events and then becomes empty again.
6259
6260 By default, idle events are sent to all windows. If this is causing a
6261 significant overhead in your application, you can call
6262 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6263 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6264 which should receive idle events. Then idle events will only be sent
6265 to those windows and not to any others.
6266 """
6267 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6268 __repr__ = _swig_repr
6269 def __init__(self, *args, **kwargs):
6270 """
6271 __init__(self) -> IdleEvent
6272
6273 Constructor
6274 """
6275 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6276 def RequestMore(*args, **kwargs):
6277 """
6278 RequestMore(self, bool needMore=True)
6279
6280 Tells wxWidgets that more processing is required. This function can be
6281 called by an EVT_IDLE handler for a window to indicate that the
6282 application should forward the EVT_IDLE event once more to the
6283 application windows. If no window calls this function during its
6284 EVT_IDLE handler, then the application will remain in a passive event
6285 loop until a new event is posted to the application by the windowing
6286 system.
6287 """
6288 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6289
6290 def MoreRequested(*args, **kwargs):
6291 """
6292 MoreRequested(self) -> bool
6293
6294 Returns ``True`` if the OnIdle function processing this event
6295 requested more processing time.
6296 """
6297 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6298
6299 def SetMode(*args, **kwargs):
6300 """
6301 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 SetMode = staticmethod(SetMode)
6320 def GetMode(*args, **kwargs):
6321 """
6322 GetMode() -> int
6323
6324 Static method returning a value specifying how wxWidgets will send
6325 idle events: to all windows, or only to those which specify that they
6326 will process the events.
6327 """
6328 return _core_.IdleEvent_GetMode(*args, **kwargs)
6329
6330 GetMode = staticmethod(GetMode)
6331 def CanSend(*args, **kwargs):
6332 """
6333 CanSend(Window win) -> bool
6334
6335 Returns ``True`` if it is appropriate to send idle events to this
6336 window.
6337
6338 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6339 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6340 events should be sent to this window now. By default this will always
6341 return ``True`` because the update mode is initially
6342 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6343 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6344 """
6345 return _core_.IdleEvent_CanSend(*args, **kwargs)
6346
6347 CanSend = staticmethod(CanSend)
6348 _core_.IdleEvent_swigregister(IdleEvent)
6349
6350 def IdleEvent_SetMode(*args, **kwargs):
6351 """
6352 IdleEvent_SetMode(int mode)
6353
6354 Static method for specifying how wxWidgets will send idle events: to
6355 all windows, or only to those which specify that they will process the
6356 events.
6357
6358 The mode can be one of the following values:
6359
6360 ========================= ========================================
6361 wx.IDLE_PROCESS_ALL Send idle events to all windows
6362 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6363 the wx.WS_EX_PROCESS_IDLE extra style
6364 flag set.
6365 ========================= ========================================
6366
6367 """
6368 return _core_.IdleEvent_SetMode(*args, **kwargs)
6369
6370 def IdleEvent_GetMode(*args):
6371 """
6372 IdleEvent_GetMode() -> int
6373
6374 Static method returning a value specifying how wxWidgets will send
6375 idle events: to all windows, or only to those which specify that they
6376 will process the events.
6377 """
6378 return _core_.IdleEvent_GetMode(*args)
6379
6380 def IdleEvent_CanSend(*args, **kwargs):
6381 """
6382 IdleEvent_CanSend(Window win) -> bool
6383
6384 Returns ``True`` if it is appropriate to send idle events to this
6385 window.
6386
6387 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6388 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6389 events should be sent to this window now. By default this will always
6390 return ``True`` because the update mode is initially
6391 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6392 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6393 """
6394 return _core_.IdleEvent_CanSend(*args, **kwargs)
6395
6396 #---------------------------------------------------------------------------
6397
6398 class ClipboardTextEvent(CommandEvent):
6399 """
6400 A Clipboard Text event is sent when a window intercepts a text
6401 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6402 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6403 popup menu command, etc. NOTE : under windows these events are *NOT*
6404 generated automatically for a Rich Edit text control.
6405 """
6406 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6407 __repr__ = _swig_repr
6408 def __init__(self, *args, **kwargs):
6409 """
6410 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6411
6412 A Clipboard Text event is sent when a window intercepts a text
6413 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6414 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6415 popup menu command, etc. NOTE : under windows these events are *NOT*
6416 generated automatically for a Rich Edit text control.
6417 """
6418 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6419 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6420
6421 #---------------------------------------------------------------------------
6422
6423 class PyEvent(Event):
6424 """
6425 wx.PyEvent can be used as a base class for implementing custom event
6426 types in Python. You should derived from this class instead of
6427 `wx.Event` because this class is Python-aware and is able to transport
6428 its Python bits safely through the wxWidgets event system and have
6429 them still be there when the event handler is invoked.
6430
6431 :see: `wx.PyCommandEvent`
6432
6433 """
6434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6435 __repr__ = _swig_repr
6436 def __init__(self, *args, **kwargs):
6437 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6438 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6439 self._SetSelf(self)
6440
6441 __swig_destroy__ = _core_.delete_PyEvent
6442 __del__ = lambda self : None;
6443 def _SetSelf(*args, **kwargs):
6444 """_SetSelf(self, PyObject self)"""
6445 return _core_.PyEvent__SetSelf(*args, **kwargs)
6446
6447 def _GetSelf(*args, **kwargs):
6448 """_GetSelf(self) -> PyObject"""
6449 return _core_.PyEvent__GetSelf(*args, **kwargs)
6450
6451 _core_.PyEvent_swigregister(PyEvent)
6452
6453 class PyCommandEvent(CommandEvent):
6454 """
6455 wx.PyCommandEvent can be used as a base class for implementing custom
6456 event types in Python, where the event shoudl travel up to parent
6457 windows looking for a handler. You should derived from this class
6458 instead of `wx.CommandEvent` because this class is Python-aware and is
6459 able to transport its Python bits safely through the wxWidgets event
6460 system and have them still be there when the event handler is invoked.
6461
6462 :see: `wx.PyEvent`
6463
6464 """
6465 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6466 __repr__ = _swig_repr
6467 def __init__(self, *args, **kwargs):
6468 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6469 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6470 self._SetSelf(self)
6471
6472 __swig_destroy__ = _core_.delete_PyCommandEvent
6473 __del__ = lambda self : None;
6474 def _SetSelf(*args, **kwargs):
6475 """_SetSelf(self, PyObject self)"""
6476 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6477
6478 def _GetSelf(*args, **kwargs):
6479 """_GetSelf(self) -> PyObject"""
6480 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6481
6482 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6483
6484 class DateEvent(CommandEvent):
6485 """
6486 This event class holds information about a date change event and is
6487 used together with `wx.DatePickerCtrl`. It also serves as a base class
6488 for `wx.calendar.CalendarEvent`. Bind these event types with
6489 EVT_DATE_CHANGED.
6490 """
6491 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6492 __repr__ = _swig_repr
6493 def __init__(self, *args, **kwargs):
6494 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6495 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6496 def GetDate(*args, **kwargs):
6497 """
6498 GetDate(self) -> DateTime
6499
6500 Returns the date.
6501 """
6502 return _core_.DateEvent_GetDate(*args, **kwargs)
6503
6504 def SetDate(*args, **kwargs):
6505 """
6506 SetDate(self, DateTime date)
6507
6508 Sets the date carried by the event, normally only used by the library
6509 internally.
6510 """
6511 return _core_.DateEvent_SetDate(*args, **kwargs)
6512
6513 _core_.DateEvent_swigregister(DateEvent)
6514
6515 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6516 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6517
6518 #---------------------------------------------------------------------------
6519
6520 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6521 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6522 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6523 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6524 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6525 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6526 class PyApp(EvtHandler):
6527 """
6528 The ``wx.PyApp`` class is an *implementation detail*, please use the
6529 `wx.App` class (or some other derived class) instead.
6530 """
6531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6532 __repr__ = _swig_repr
6533 def __init__(self, *args, **kwargs):
6534 """
6535 __init__(self) -> PyApp
6536
6537 Create a new application object, starting the bootstrap process.
6538 """
6539 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6540 self._setCallbackInfo(self, PyApp, False)
6541 self._setOORInfo(self, False)
6542
6543 __swig_destroy__ = _core_.delete_PyApp
6544 __del__ = lambda self : None;
6545 def _setCallbackInfo(*args, **kwargs):
6546 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6547 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6548
6549 def GetAppName(*args, **kwargs):
6550 """
6551 GetAppName(self) -> String
6552
6553 Get the application name.
6554 """
6555 return _core_.PyApp_GetAppName(*args, **kwargs)
6556
6557 def SetAppName(*args, **kwargs):
6558 """
6559 SetAppName(self, String name)
6560
6561 Set the application name. This value may be used automatically by
6562 `wx.Config` and such.
6563 """
6564 return _core_.PyApp_SetAppName(*args, **kwargs)
6565
6566 def GetClassName(*args, **kwargs):
6567 """
6568 GetClassName(self) -> String
6569
6570 Get the application's class name.
6571 """
6572 return _core_.PyApp_GetClassName(*args, **kwargs)
6573
6574 def SetClassName(*args, **kwargs):
6575 """
6576 SetClassName(self, String name)
6577
6578 Set the application's class name. This value may be used for
6579 X-resources if applicable for the platform
6580 """
6581 return _core_.PyApp_SetClassName(*args, **kwargs)
6582
6583 def GetVendorName(*args, **kwargs):
6584 """
6585 GetVendorName(self) -> String
6586
6587 Get the application's vendor name.
6588 """
6589 return _core_.PyApp_GetVendorName(*args, **kwargs)
6590
6591 def SetVendorName(*args, **kwargs):
6592 """
6593 SetVendorName(self, String name)
6594
6595 Set the application's vendor name. This value may be used
6596 automatically by `wx.Config` and such.
6597 """
6598 return _core_.PyApp_SetVendorName(*args, **kwargs)
6599
6600 def GetTraits(*args, **kwargs):
6601 """
6602 GetTraits(self) -> wxAppTraits
6603
6604 Return (and create if necessary) the app traits object to which we
6605 delegate for everything which either should be configurable by the
6606 user (then he can change the default behaviour simply by overriding
6607 CreateTraits() and returning his own traits object) or which is
6608 GUI/console dependent as then wx.AppTraits allows us to abstract the
6609 differences behind the common facade.
6610
6611 :todo: Add support for overriding CreateAppTraits in wxPython.
6612 """
6613 return _core_.PyApp_GetTraits(*args, **kwargs)
6614
6615 def ProcessPendingEvents(*args, **kwargs):
6616 """
6617 ProcessPendingEvents(self)
6618
6619 Process all events in the Pending Events list -- it is necessary to
6620 call this function to process posted events. This normally happens
6621 during each event loop iteration.
6622 """
6623 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6624
6625 def Yield(*args, **kwargs):
6626 """
6627 Yield(self, bool onlyIfNeeded=False) -> bool
6628
6629 Process all currently pending events right now, instead of waiting
6630 until return to the event loop. It is an error to call ``Yield``
6631 recursively unless the value of ``onlyIfNeeded`` is True.
6632
6633 :warning: This function is dangerous as it can lead to unexpected
6634 reentrancies (i.e. when called from an event handler it may
6635 result in calling the same event handler again), use with
6636 extreme care or, better, don't use at all!
6637
6638 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6639
6640 """
6641 return _core_.PyApp_Yield(*args, **kwargs)
6642
6643 def WakeUpIdle(*args, **kwargs):
6644 """
6645 WakeUpIdle(self)
6646
6647 Make sure that idle events are sent again.
6648 :see: `wx.WakeUpIdle`
6649 """
6650 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6651
6652 def IsMainLoopRunning(*args, **kwargs):
6653 """
6654 IsMainLoopRunning() -> bool
6655
6656 Returns True if we're running the main loop, i.e. if the events can
6657 currently be dispatched.
6658 """
6659 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6660
6661 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6662 def MainLoop(*args, **kwargs):
6663 """
6664 MainLoop(self) -> int
6665
6666 Execute the main GUI loop, the function doesn't normally return until
6667 all top level windows have been closed and destroyed.
6668 """
6669 return _core_.PyApp_MainLoop(*args, **kwargs)
6670
6671 def Exit(*args, **kwargs):
6672 """
6673 Exit(self)
6674
6675 Exit the main loop thus terminating the application.
6676 :see: `wx.Exit`
6677 """
6678 return _core_.PyApp_Exit(*args, **kwargs)
6679
6680 def ExitMainLoop(*args, **kwargs):
6681 """
6682 ExitMainLoop(self)
6683
6684 Exit the main GUI loop during the next iteration of the main
6685 loop, (i.e. it does not stop the program immediately!)
6686 """
6687 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6688
6689 def Pending(*args, **kwargs):
6690 """
6691 Pending(self) -> bool
6692
6693 Returns True if there are unprocessed events in the event queue.
6694 """
6695 return _core_.PyApp_Pending(*args, **kwargs)
6696
6697 def Dispatch(*args, **kwargs):
6698 """
6699 Dispatch(self) -> bool
6700
6701 Process the first event in the event queue (blocks until an event
6702 appears if there are none currently)
6703 """
6704 return _core_.PyApp_Dispatch(*args, **kwargs)
6705
6706 def ProcessIdle(*args, **kwargs):
6707 """
6708 ProcessIdle(self) -> bool
6709
6710 Called from the MainLoop when the application becomes idle (there are
6711 no pending events) and sends a `wx.IdleEvent` to all interested
6712 parties. Returns True if more idle events are needed, False if not.
6713 """
6714 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6715
6716 def SendIdleEvents(*args, **kwargs):
6717 """
6718 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6719
6720 Send idle event to window and all subwindows. Returns True if more
6721 idle time is requested.
6722 """
6723 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6724
6725 def IsActive(*args, **kwargs):
6726 """
6727 IsActive(self) -> bool
6728
6729 Return True if our app has focus.
6730 """
6731 return _core_.PyApp_IsActive(*args, **kwargs)
6732
6733 def SetTopWindow(*args, **kwargs):
6734 """
6735 SetTopWindow(self, Window win)
6736
6737 Set the *main* top level window
6738 """
6739 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6740
6741 def GetTopWindow(*args, **kwargs):
6742 """
6743 GetTopWindow(self) -> Window
6744
6745 Return the *main* top level window (if it hadn't been set previously
6746 with SetTopWindow(), will return just some top level window and, if
6747 there not any, will return None)
6748 """
6749 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6750
6751 def SetExitOnFrameDelete(*args, **kwargs):
6752 """
6753 SetExitOnFrameDelete(self, bool flag)
6754
6755 Control the exit behaviour: by default, the program will exit the main
6756 loop (and so, usually, terminate) when the last top-level program
6757 window is deleted. Beware that if you disable this behaviour (with
6758 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6759 explicitly from somewhere.
6760 """
6761 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6762
6763 def GetExitOnFrameDelete(*args, **kwargs):
6764 """
6765 GetExitOnFrameDelete(self) -> bool
6766
6767 Get the current exit behaviour setting.
6768 """
6769 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6770
6771 def SetUseBestVisual(*args, **kwargs):
6772 """
6773 SetUseBestVisual(self, bool flag)
6774
6775 Set whether the app should try to use the best available visual on
6776 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6777 """
6778 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6779
6780 def GetUseBestVisual(*args, **kwargs):
6781 """
6782 GetUseBestVisual(self) -> bool
6783
6784 Get current UseBestVisual setting.
6785 """
6786 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6787
6788 def SetPrintMode(*args, **kwargs):
6789 """SetPrintMode(self, int mode)"""
6790 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6791
6792 def GetPrintMode(*args, **kwargs):
6793 """GetPrintMode(self) -> int"""
6794 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6795
6796 def SetAssertMode(*args, **kwargs):
6797 """
6798 SetAssertMode(self, int mode)
6799
6800 Set the OnAssert behaviour for debug and hybrid builds.
6801 """
6802 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6803
6804 def GetAssertMode(*args, **kwargs):
6805 """
6806 GetAssertMode(self) -> int
6807
6808 Get the current OnAssert behaviour setting.
6809 """
6810 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6811
6812 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6813 """GetMacSupportPCMenuShortcuts() -> bool"""
6814 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6815
6816 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6817 def GetMacAboutMenuItemId(*args, **kwargs):
6818 """GetMacAboutMenuItemId() -> long"""
6819 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6820
6821 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6822 def GetMacPreferencesMenuItemId(*args, **kwargs):
6823 """GetMacPreferencesMenuItemId() -> long"""
6824 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6825
6826 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6827 def GetMacExitMenuItemId(*args, **kwargs):
6828 """GetMacExitMenuItemId() -> long"""
6829 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6830
6831 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6832 def GetMacHelpMenuTitleName(*args, **kwargs):
6833 """GetMacHelpMenuTitleName() -> String"""
6834 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6835
6836 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6837 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6838 """SetMacSupportPCMenuShortcuts(bool val)"""
6839 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6840
6841 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6842 def SetMacAboutMenuItemId(*args, **kwargs):
6843 """SetMacAboutMenuItemId(long val)"""
6844 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6845
6846 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6847 def SetMacPreferencesMenuItemId(*args, **kwargs):
6848 """SetMacPreferencesMenuItemId(long val)"""
6849 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6850
6851 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6852 def SetMacExitMenuItemId(*args, **kwargs):
6853 """SetMacExitMenuItemId(long val)"""
6854 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6855
6856 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6857 def SetMacHelpMenuTitleName(*args, **kwargs):
6858 """SetMacHelpMenuTitleName(String val)"""
6859 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6860
6861 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6862 def _BootstrapApp(*args, **kwargs):
6863 """
6864 _BootstrapApp(self)
6865
6866 For internal use only
6867 """
6868 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6869
6870 def GetComCtl32Version(*args, **kwargs):
6871 """
6872 GetComCtl32Version() -> int
6873
6874 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6875 it wasn't found at all. Raises an exception on non-Windows platforms.
6876 """
6877 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6878
6879 GetComCtl32Version = staticmethod(GetComCtl32Version)
6880 def DisplayAvailable(*args, **kwargs):
6881 """
6882 DisplayAvailable() -> bool
6883
6884 Tests if it is possible to create a GUI in the current environment.
6885 This will mean different things on the different platforms.
6886
6887 * On X Windows systems this function will return ``False`` if it is
6888 not able to open a connection to the X display, which can happen
6889 if $DISPLAY is not set, or is not set correctly.
6890
6891 * On Mac OS X a ``False`` return value will mean that wx is not
6892 able to access the window manager, which can happen if logged in
6893 remotely or if running from the normal version of python instead
6894 of the framework version, (i.e., pythonw.)
6895
6896 * On MS Windows...
6897
6898 """
6899 return _core_.PyApp_DisplayAvailable(*args, **kwargs)
6900
6901 DisplayAvailable = staticmethod(DisplayAvailable)
6902 _core_.PyApp_swigregister(PyApp)
6903
6904 def PyApp_IsMainLoopRunning(*args):
6905 """
6906 PyApp_IsMainLoopRunning() -> bool
6907
6908 Returns True if we're running the main loop, i.e. if the events can
6909 currently be dispatched.
6910 """
6911 return _core_.PyApp_IsMainLoopRunning(*args)
6912
6913 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6914 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6915 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6916
6917 def PyApp_GetMacAboutMenuItemId(*args):
6918 """PyApp_GetMacAboutMenuItemId() -> long"""
6919 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6920
6921 def PyApp_GetMacPreferencesMenuItemId(*args):
6922 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6923 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6924
6925 def PyApp_GetMacExitMenuItemId(*args):
6926 """PyApp_GetMacExitMenuItemId() -> long"""
6927 return _core_.PyApp_GetMacExitMenuItemId(*args)
6928
6929 def PyApp_GetMacHelpMenuTitleName(*args):
6930 """PyApp_GetMacHelpMenuTitleName() -> String"""
6931 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6932
6933 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6934 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6935 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6936
6937 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6938 """PyApp_SetMacAboutMenuItemId(long val)"""
6939 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6940
6941 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6942 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6943 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6944
6945 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6946 """PyApp_SetMacExitMenuItemId(long val)"""
6947 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6948
6949 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6950 """PyApp_SetMacHelpMenuTitleName(String val)"""
6951 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6952
6953 def PyApp_GetComCtl32Version(*args):
6954 """
6955 PyApp_GetComCtl32Version() -> int
6956
6957 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6958 it wasn't found at all. Raises an exception on non-Windows platforms.
6959 """
6960 return _core_.PyApp_GetComCtl32Version(*args)
6961
6962 def PyApp_DisplayAvailable(*args):
6963 """
6964 PyApp_DisplayAvailable() -> bool
6965
6966 Tests if it is possible to create a GUI in the current environment.
6967 This will mean different things on the different platforms.
6968
6969 * On X Windows systems this function will return ``False`` if it is
6970 not able to open a connection to the X display, which can happen
6971 if $DISPLAY is not set, or is not set correctly.
6972
6973 * On Mac OS X a ``False`` return value will mean that wx is not
6974 able to access the window manager, which can happen if logged in
6975 remotely or if running from the normal version of python instead
6976 of the framework version, (i.e., pythonw.)
6977
6978 * On MS Windows...
6979
6980 """
6981 return _core_.PyApp_DisplayAvailable(*args)
6982
6983 #---------------------------------------------------------------------------
6984
6985
6986 def Exit(*args):
6987 """
6988 Exit()
6989
6990 Force an exit of the application. Convenience for wx.GetApp().Exit()
6991 """
6992 return _core_.Exit(*args)
6993
6994 def Yield(*args):
6995 """
6996 Yield() -> bool
6997
6998 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6999 """
7000 return _core_.Yield(*args)
7001
7002 def YieldIfNeeded(*args):
7003 """
7004 YieldIfNeeded() -> bool
7005
7006 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7007 """
7008 return _core_.YieldIfNeeded(*args)
7009
7010 def SafeYield(*args, **kwargs):
7011 """
7012 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7013
7014 This function is similar to `wx.Yield`, except that it disables the
7015 user input to all program windows before calling `wx.Yield` and
7016 re-enables it again afterwards. If ``win`` is not None, this window
7017 will remain enabled, allowing the implementation of some limited user
7018 interaction.
7019
7020 :Returns: the result of the call to `wx.Yield`.
7021 """
7022 return _core_.SafeYield(*args, **kwargs)
7023
7024 def WakeUpIdle(*args):
7025 """
7026 WakeUpIdle()
7027
7028 Cause the message queue to become empty again, so idle events will be
7029 sent.
7030 """
7031 return _core_.WakeUpIdle(*args)
7032
7033 def PostEvent(*args, **kwargs):
7034 """
7035 PostEvent(EvtHandler dest, Event event)
7036
7037 Send an event to a window or other wx.EvtHandler to be processed
7038 later.
7039 """
7040 return _core_.PostEvent(*args, **kwargs)
7041
7042 def App_CleanUp(*args):
7043 """
7044 App_CleanUp()
7045
7046 For internal use only, it is used to cleanup after wxWidgets when
7047 Python shuts down.
7048 """
7049 return _core_.App_CleanUp(*args)
7050
7051 def GetApp(*args):
7052 """
7053 GetApp() -> PyApp
7054
7055 Return a reference to the current wx.App object.
7056 """
7057 return _core_.GetApp(*args)
7058
7059 def SetDefaultPyEncoding(*args, **kwargs):
7060 """
7061 SetDefaultPyEncoding(string encoding)
7062
7063 Sets the encoding that wxPython will use when it needs to convert a
7064 Python string or unicode object to or from a wxString.
7065
7066 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7067 but please be aware that the default encoding within the same locale
7068 may be slightly different on different platforms. For example, please
7069 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7070 between the common latin/roman encodings.
7071 """
7072 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7073
7074 def GetDefaultPyEncoding(*args):
7075 """
7076 GetDefaultPyEncoding() -> string
7077
7078 Gets the current encoding that wxPython will use when it needs to
7079 convert a Python string or unicode object to or from a wxString.
7080 """
7081 return _core_.GetDefaultPyEncoding(*args)
7082 #----------------------------------------------------------------------
7083
7084 class PyOnDemandOutputWindow:
7085 """
7086 A class that can be used for redirecting Python's stdout and
7087 stderr streams. It will do nothing until something is wrriten to
7088 the stream at which point it will create a Frame with a text area
7089 and write the text there.
7090 """
7091 def __init__(self, title = "wxPython: stdout/stderr"):
7092 self.frame = None
7093 self.title = title
7094 self.pos = wx.DefaultPosition
7095 self.size = (450, 300)
7096 self.parent = None
7097
7098 def SetParent(self, parent):
7099 """Set the window to be used as the popup Frame's parent."""
7100 self.parent = parent
7101
7102
7103 def CreateOutputWindow(self, st):
7104 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7105 style=wx.DEFAULT_FRAME_STYLE)
7106 self.text = wx.TextCtrl(self.frame, -1, "",
7107 style=wx.TE_MULTILINE|wx.TE_READONLY)
7108 self.text.AppendText(st)
7109 self.frame.Show(True)
7110 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7111
7112
7113 def OnCloseWindow(self, event):
7114 if self.frame is not None:
7115 self.frame.Destroy()
7116 self.frame = None
7117 self.text = None
7118
7119
7120 # These methods provide the file-like output behaviour.
7121 def write(self, text):
7122 """
7123 Create the output window if needed and write the string to it.
7124 If not called in the context of the gui thread then uses
7125 CallAfter to do the work there.
7126 """
7127 if self.frame is None:
7128 if not wx.Thread_IsMain():
7129 wx.CallAfter(self.CreateOutputWindow, text)
7130 else:
7131 self.CreateOutputWindow(text)
7132 else:
7133 if not wx.Thread_IsMain():
7134 wx.CallAfter(self.text.AppendText, text)
7135 else:
7136 self.text.AppendText(text)
7137
7138
7139 def close(self):
7140 if self.frame is not None:
7141 wx.CallAfter(self.frame.Close)
7142
7143
7144 def flush(self):
7145 pass
7146
7147
7148
7149 #----------------------------------------------------------------------
7150
7151 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7152
7153 class App(wx.PyApp):
7154 """
7155 The ``wx.App`` class represents the application and is used to:
7156
7157 * bootstrap the wxPython system and initialize the underlying
7158 gui toolkit
7159 * set and get application-wide properties
7160 * implement the windowing system main message or event loop,
7161 and to dispatch events to window instances
7162 * etc.
7163
7164 Every application must have a ``wx.App`` instance, and all
7165 creation of UI objects should be delayed until after the
7166 ``wx.App`` object has been created in order to ensure that the gui
7167 platform and wxWidgets have been fully initialized.
7168
7169 Normally you would derive from this class and implement an
7170 ``OnInit`` method that creates a frame and then calls
7171 ``self.SetTopWindow(frame)``.
7172
7173 :see: `wx.PySimpleApp` for a simpler app class that can be used
7174 directly.
7175 """
7176
7177 outputWindowClass = PyOnDemandOutputWindow
7178
7179 def __init__(self, redirect=_defRedirect, filename=None,
7180 useBestVisual=False, clearSigInt=True):
7181 """
7182 Construct a ``wx.App`` object.
7183
7184 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7185 redirected? Defaults to True on Windows and Mac, False
7186 otherwise. If `filename` is None then output will be
7187 redirected to a window that pops up as needed. (You can
7188 control what kind of window is created for the output by
7189 resetting the class variable ``outputWindowClass`` to a
7190 class of your choosing.)
7191
7192 :param filename: The name of a file to redirect output to, if
7193 redirect is True.
7194
7195 :param useBestVisual: Should the app try to use the best
7196 available visual provided by the system (only relevant on
7197 systems that have more than one visual.) This parameter
7198 must be used instead of calling `SetUseBestVisual` later
7199 on because it must be set before the underlying GUI
7200 toolkit is initialized.
7201
7202 :param clearSigInt: Should SIGINT be cleared? This allows the
7203 app to terminate upon a Ctrl-C in the console like other
7204 GUI apps will.
7205
7206 :note: You should override OnInit to do applicaition
7207 initialization to ensure that the system, toolkit and
7208 wxWidgets are fully initialized.
7209 """
7210
7211 wx.PyApp.__init__(self)
7212
7213 # make sure we can create a GUI
7214 if not self.DisplayAvailable():
7215
7216 if wx.Platform == "__WXMAC__":
7217 msg = """This program needs access to the screen.
7218 Please run with 'pythonw', not 'python', and only when you are logged
7219 in on the main display of your Mac."""
7220
7221 elif wx.Platform == "__WXGTK__":
7222 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7223
7224 else:
7225 msg = "Unable to create GUI"
7226 # TODO: more description is needed for wxMSW...
7227
7228 raise SystemExit(msg)
7229
7230 # This has to be done before OnInit
7231 self.SetUseBestVisual(useBestVisual)
7232
7233 # Set the default handler for SIGINT. This fixes a problem
7234 # where if Ctrl-C is pressed in the console that started this
7235 # app then it will not appear to do anything, (not even send
7236 # KeyboardInterrupt???) but will later segfault on exit. By
7237 # setting the default handler then the app will exit, as
7238 # expected (depending on platform.)
7239 if clearSigInt:
7240 try:
7241 import signal
7242 signal.signal(signal.SIGINT, signal.SIG_DFL)
7243 except:
7244 pass
7245
7246 # Save and redirect the stdio to a window?
7247 self.stdioWin = None
7248 self.saveStdio = (_sys.stdout, _sys.stderr)
7249 if redirect:
7250 self.RedirectStdio(filename)
7251
7252 # Use Python's install prefix as the default
7253 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7254
7255 # This finishes the initialization of wxWindows and then calls
7256 # the OnInit that should be present in the derived class
7257 self._BootstrapApp()
7258
7259
7260 def OnPreInit(self):
7261 """
7262 Things that must be done after _BootstrapApp has done its
7263 thing, but would be nice if they were already done by the time
7264 that OnInit is called.
7265 """
7266 wx.StockGDI._initStockObjects()
7267
7268
7269 def __del__(self, destroy=wx.PyApp.__del__):
7270 self.RestoreStdio() # Just in case the MainLoop was overridden
7271 destroy(self)
7272
7273 def Destroy(self):
7274 wx.PyApp.Destroy(self)
7275 self.thisown = 0
7276
7277 def SetTopWindow(self, frame):
7278 """Set the \"main\" top level window"""
7279 if self.stdioWin:
7280 self.stdioWin.SetParent(frame)
7281 wx.PyApp.SetTopWindow(self, frame)
7282
7283
7284 def MainLoop(self):
7285 """Execute the main GUI event loop"""
7286 wx.PyApp.MainLoop(self)
7287 self.RestoreStdio()
7288
7289
7290 def RedirectStdio(self, filename=None):
7291 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7292 if filename:
7293 _sys.stdout = _sys.stderr = open(filename, 'a')
7294 else:
7295 self.stdioWin = self.outputWindowClass()
7296 _sys.stdout = _sys.stderr = self.stdioWin
7297
7298
7299 def RestoreStdio(self):
7300 try:
7301 _sys.stdout, _sys.stderr = self.saveStdio
7302 except:
7303 pass
7304
7305
7306 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7307 """
7308 Set the title, position and/or size of the output window if
7309 the stdio has been redirected. This should be called before
7310 any output would cause the output window to be created.
7311 """
7312 if self.stdioWin:
7313 if title is not None:
7314 self.stdioWin.title = title
7315 if pos is not None:
7316 self.stdioWin.pos = pos
7317 if size is not None:
7318 self.stdioWin.size = size
7319
7320
7321
7322
7323 # change from wx.PyApp_XX to wx.App_XX
7324 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7325 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7326 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7327 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7328 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7329 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7330 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7331 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7332 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7333 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7334 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7335
7336 #----------------------------------------------------------------------------
7337
7338 class PySimpleApp(wx.App):
7339 """
7340 A simple application class. You can just create one of these and
7341 then then make your top level windows later, and not have to worry
7342 about OnInit. For example::
7343
7344 app = wx.PySimpleApp()
7345 frame = wx.Frame(None, title='Hello World')
7346 frame.Show()
7347 app.MainLoop()
7348
7349 :see: `wx.App`
7350 """
7351
7352 def __init__(self, redirect=False, filename=None,
7353 useBestVisual=False, clearSigInt=True):
7354 """
7355 :see: `wx.App.__init__`
7356 """
7357 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7358
7359 def OnInit(self):
7360 return True
7361
7362
7363
7364 # Is anybody using this one?
7365 class PyWidgetTester(wx.App):
7366 def __init__(self, size = (250, 100)):
7367 self.size = size
7368 wx.App.__init__(self, 0)
7369
7370 def OnInit(self):
7371 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7372 self.SetTopWindow(self.frame)
7373 return True
7374
7375 def SetWidget(self, widgetClass, *args, **kwargs):
7376 w = widgetClass(self.frame, *args, **kwargs)
7377 self.frame.Show(True)
7378
7379 #----------------------------------------------------------------------------
7380 # DO NOT hold any other references to this object. This is how we
7381 # know when to cleanup system resources that wxWidgets is holding. When
7382 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7383 # goes to zero and it calls the wx.App_CleanUp function.
7384
7385 class __wxPyCleanup:
7386 def __init__(self):
7387 self.cleanup = _core_.App_CleanUp
7388 def __del__(self):
7389 self.cleanup()
7390
7391 _sys.__wxPythonCleanup = __wxPyCleanup()
7392
7393 ## # another possible solution, but it gets called too early...
7394 ## import atexit
7395 ## atexit.register(_core_.wxApp_CleanUp)
7396
7397
7398 #----------------------------------------------------------------------------
7399
7400 #---------------------------------------------------------------------------
7401
7402 class EventLoop(object):
7403 """Proxy of C++ EventLoop class"""
7404 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7405 __repr__ = _swig_repr
7406 def __init__(self, *args, **kwargs):
7407 """__init__(self) -> EventLoop"""
7408 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7409 __swig_destroy__ = _core_.delete_EventLoop
7410 __del__ = lambda self : None;
7411 def Run(*args, **kwargs):
7412 """Run(self) -> int"""
7413 return _core_.EventLoop_Run(*args, **kwargs)
7414
7415 def Exit(*args, **kwargs):
7416 """Exit(self, int rc=0)"""
7417 return _core_.EventLoop_Exit(*args, **kwargs)
7418
7419 def Pending(*args, **kwargs):
7420 """Pending(self) -> bool"""
7421 return _core_.EventLoop_Pending(*args, **kwargs)
7422
7423 def Dispatch(*args, **kwargs):
7424 """Dispatch(self) -> bool"""
7425 return _core_.EventLoop_Dispatch(*args, **kwargs)
7426
7427 def IsRunning(*args, **kwargs):
7428 """IsRunning(self) -> bool"""
7429 return _core_.EventLoop_IsRunning(*args, **kwargs)
7430
7431 def GetActive(*args, **kwargs):
7432 """GetActive() -> EventLoop"""
7433 return _core_.EventLoop_GetActive(*args, **kwargs)
7434
7435 GetActive = staticmethod(GetActive)
7436 def SetActive(*args, **kwargs):
7437 """SetActive(EventLoop loop)"""
7438 return _core_.EventLoop_SetActive(*args, **kwargs)
7439
7440 SetActive = staticmethod(SetActive)
7441 _core_.EventLoop_swigregister(EventLoop)
7442
7443 def EventLoop_GetActive(*args):
7444 """EventLoop_GetActive() -> EventLoop"""
7445 return _core_.EventLoop_GetActive(*args)
7446
7447 def EventLoop_SetActive(*args, **kwargs):
7448 """EventLoop_SetActive(EventLoop loop)"""
7449 return _core_.EventLoop_SetActive(*args, **kwargs)
7450
7451 class EventLoopActivator(object):
7452 """Proxy of C++ EventLoopActivator class"""
7453 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7454 __repr__ = _swig_repr
7455 def __init__(self, *args, **kwargs):
7456 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7457 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7458 __swig_destroy__ = _core_.delete_EventLoopActivator
7459 __del__ = lambda self : None;
7460 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7461
7462 #---------------------------------------------------------------------------
7463
7464 class AcceleratorEntry(object):
7465 """
7466 A class used to define items in an `wx.AcceleratorTable`. wxPython
7467 programs can choose to use wx.AcceleratorEntry objects, but using a
7468 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7469 as well. See `__init__` for of the tuple values.
7470
7471 :see: `wx.AcceleratorTable`
7472 """
7473 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7474 __repr__ = _swig_repr
7475 def __init__(self, *args, **kwargs):
7476 """
7477 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7478
7479 Construct a wx.AcceleratorEntry.
7480 """
7481 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7482 __swig_destroy__ = _core_.delete_AcceleratorEntry
7483 __del__ = lambda self : None;
7484 def Set(*args, **kwargs):
7485 """
7486 Set(self, int flags, int keyCode, int cmd)
7487
7488 (Re)set the attributes of a wx.AcceleratorEntry.
7489 :see `__init__`
7490 """
7491 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7492
7493 def GetFlags(*args, **kwargs):
7494 """
7495 GetFlags(self) -> int
7496
7497 Get the AcceleratorEntry's flags.
7498 """
7499 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7500
7501 def GetKeyCode(*args, **kwargs):
7502 """
7503 GetKeyCode(self) -> int
7504
7505 Get the AcceleratorEntry's keycode.
7506 """
7507 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7508
7509 def GetCommand(*args, **kwargs):
7510 """
7511 GetCommand(self) -> int
7512
7513 Get the AcceleratorEntry's command ID.
7514 """
7515 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7516
7517 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7518
7519 class AcceleratorTable(Object):
7520 """
7521 An accelerator table allows the application to specify a table of
7522 keyboard shortcuts for menus or other commands. On Windows, menu or
7523 button commands are supported; on GTK, only menu commands are
7524 supported.
7525 """
7526 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7527 __repr__ = _swig_repr
7528 def __init__(self, *args, **kwargs):
7529 """
7530 __init__(entries) -> AcceleratorTable
7531
7532 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7533 items or or of 3-tuples (flags, keyCode, cmdID)
7534
7535 :see: `wx.AcceleratorEntry`
7536 """
7537 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7538 __swig_destroy__ = _core_.delete_AcceleratorTable
7539 __del__ = lambda self : None;
7540 def Ok(*args, **kwargs):
7541 """Ok(self) -> bool"""
7542 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7543
7544 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7545
7546
7547 def GetAccelFromString(*args, **kwargs):
7548 """GetAccelFromString(String label) -> AcceleratorEntry"""
7549 return _core_.GetAccelFromString(*args, **kwargs)
7550 #---------------------------------------------------------------------------
7551
7552 class VisualAttributes(object):
7553 """struct containing all the visual attributes of a control"""
7554 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7555 __repr__ = _swig_repr
7556 def __init__(self, *args, **kwargs):
7557 """
7558 __init__(self) -> VisualAttributes
7559
7560 struct containing all the visual attributes of a control
7561 """
7562 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7563 __swig_destroy__ = _core_.delete_VisualAttributes
7564 __del__ = lambda self : None;
7565 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7566 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7567 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7568 _core_.VisualAttributes_swigregister(VisualAttributes)
7569 NullAcceleratorTable = cvar.NullAcceleratorTable
7570 PanelNameStr = cvar.PanelNameStr
7571
7572 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7573 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7574 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7575 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7576 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7577 class Window(EvtHandler):
7578 """
7579 wx.Window is the base class for all windows and represents any visible
7580 object on the screen. All controls, top level windows and so on are
7581 wx.Windows. Sizers and device contexts are not however, as they don't
7582 appear on screen themselves.
7583
7584 """
7585 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7586 __repr__ = _swig_repr
7587 def __init__(self, *args, **kwargs):
7588 """
7589 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7590 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7591
7592 Construct and show a generic Window.
7593 """
7594 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7595 self._setOORInfo(self)
7596
7597 def Create(*args, **kwargs):
7598 """
7599 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7600 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7601
7602 Create the GUI part of the Window for 2-phase creation mode.
7603 """
7604 return _core_.Window_Create(*args, **kwargs)
7605
7606 def Close(*args, **kwargs):
7607 """
7608 Close(self, bool force=False) -> bool
7609
7610 This function simply generates a EVT_CLOSE event whose handler usually
7611 tries to close the window. It doesn't close the window itself,
7612 however. If force is False (the default) then the window's close
7613 handler will be allowed to veto the destruction of the window.
7614 """
7615 return _core_.Window_Close(*args, **kwargs)
7616
7617 def Destroy(*args, **kwargs):
7618 """
7619 Destroy(self) -> bool
7620
7621 Destroys the window safely. Frames and dialogs are not destroyed
7622 immediately when this function is called -- they are added to a list
7623 of windows to be deleted on idle time, when all the window's events
7624 have been processed. This prevents problems with events being sent to
7625 non-existent windows.
7626
7627 Returns True if the window has either been successfully deleted, or it
7628 has been added to the list of windows pending real deletion.
7629 """
7630 val = _core_.Window_Destroy(*args, **kwargs)
7631 args[0].thisown = 0
7632 return val
7633
7634 def DestroyChildren(*args, **kwargs):
7635 """
7636 DestroyChildren(self) -> bool
7637
7638 Destroys all children of a window. Called automatically by the
7639 destructor.
7640 """
7641 return _core_.Window_DestroyChildren(*args, **kwargs)
7642
7643 def IsBeingDeleted(*args, **kwargs):
7644 """
7645 IsBeingDeleted(self) -> bool
7646
7647 Is the window in the process of being deleted?
7648 """
7649 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7650
7651 def SetLabel(*args, **kwargs):
7652 """
7653 SetLabel(self, String label)
7654
7655 Set the text which the window shows in its label if applicable.
7656 """
7657 return _core_.Window_SetLabel(*args, **kwargs)
7658
7659 def GetLabel(*args, **kwargs):
7660 """
7661 GetLabel(self) -> String
7662
7663 Generic way of getting a label from any window, for identification
7664 purposes. The interpretation of this function differs from class to
7665 class. For frames and dialogs, the value returned is the title. For
7666 buttons or static text controls, it is the button text. This function
7667 can be useful for meta-programs such as testing tools or special-needs
7668 access programs)which need to identify windows by name.
7669 """
7670 return _core_.Window_GetLabel(*args, **kwargs)
7671
7672 def SetName(*args, **kwargs):
7673 """
7674 SetName(self, String name)
7675
7676 Sets the window's name. The window name is used for ressource setting
7677 in X, it is not the same as the window title/label
7678 """
7679 return _core_.Window_SetName(*args, **kwargs)
7680
7681 def GetName(*args, **kwargs):
7682 """
7683 GetName(self) -> String
7684
7685 Returns the windows name. This name is not guaranteed to be unique;
7686 it is up to the programmer to supply an appropriate name in the window
7687 constructor or via wx.Window.SetName.
7688 """
7689 return _core_.Window_GetName(*args, **kwargs)
7690
7691 def SetWindowVariant(*args, **kwargs):
7692 """
7693 SetWindowVariant(self, int variant)
7694
7695 Sets the variant of the window/font size to use for this window, if
7696 the platform supports variants, for example, wxMac.
7697 """
7698 return _core_.Window_SetWindowVariant(*args, **kwargs)
7699
7700 def GetWindowVariant(*args, **kwargs):
7701 """GetWindowVariant(self) -> int"""
7702 return _core_.Window_GetWindowVariant(*args, **kwargs)
7703
7704 def SetId(*args, **kwargs):
7705 """
7706 SetId(self, int winid)
7707
7708 Sets the identifier of the window. Each window has an integer
7709 identifier. If the application has not provided one, an identifier
7710 will be generated. Normally, the identifier should be provided on
7711 creation and should not be modified subsequently.
7712 """
7713 return _core_.Window_SetId(*args, **kwargs)
7714
7715 def GetId(*args, **kwargs):
7716 """
7717 GetId(self) -> int
7718
7719 Returns the identifier of the window. Each window has an integer
7720 identifier. If the application has not provided one (or the default Id
7721 -1 is used) then an unique identifier with a negative value will be
7722 generated.
7723 """
7724 return _core_.Window_GetId(*args, **kwargs)
7725
7726 def NewControlId(*args, **kwargs):
7727 """
7728 NewControlId() -> int
7729
7730 Generate a control id for the controls which were not given one.
7731 """
7732 return _core_.Window_NewControlId(*args, **kwargs)
7733
7734 NewControlId = staticmethod(NewControlId)
7735 def NextControlId(*args, **kwargs):
7736 """
7737 NextControlId(int winid) -> int
7738
7739 Get the id of the control following the one with the given
7740 autogenerated) id
7741 """
7742 return _core_.Window_NextControlId(*args, **kwargs)
7743
7744 NextControlId = staticmethod(NextControlId)
7745 def PrevControlId(*args, **kwargs):
7746 """
7747 PrevControlId(int winid) -> int
7748
7749 Get the id of the control preceding the one with the given
7750 autogenerated) id
7751 """
7752 return _core_.Window_PrevControlId(*args, **kwargs)
7753
7754 PrevControlId = staticmethod(PrevControlId)
7755 def SetSize(*args, **kwargs):
7756 """
7757 SetSize(self, Size size)
7758
7759 Sets the size of the window in pixels.
7760 """
7761 return _core_.Window_SetSize(*args, **kwargs)
7762
7763 def SetDimensions(*args, **kwargs):
7764 """
7765 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7766
7767 Sets the position and size of the window in pixels. The sizeFlags
7768 parameter indicates the interpretation of the other params if they are
7769 equal to -1.
7770
7771 ======================== ======================================
7772 wx.SIZE_AUTO A -1 indicates that a class-specific
7773 default should be used.
7774 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7775 -1 values are supplied.
7776 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7777 interpreted as real dimensions, not
7778 default values.
7779 ======================== ======================================
7780
7781 """
7782 return _core_.Window_SetDimensions(*args, **kwargs)
7783
7784 def SetRect(*args, **kwargs):
7785 """
7786 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7787
7788 Sets the position and size of the window in pixels using a wx.Rect.
7789 """
7790 return _core_.Window_SetRect(*args, **kwargs)
7791
7792 def SetSizeWH(*args, **kwargs):
7793 """
7794 SetSizeWH(self, int width, int height)
7795
7796 Sets the size of the window in pixels.
7797 """
7798 return _core_.Window_SetSizeWH(*args, **kwargs)
7799
7800 def Move(*args, **kwargs):
7801 """
7802 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7803
7804 Moves the window to the given position.
7805 """
7806 return _core_.Window_Move(*args, **kwargs)
7807
7808 SetPosition = Move
7809 def MoveXY(*args, **kwargs):
7810 """
7811 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7812
7813 Moves the window to the given position.
7814 """
7815 return _core_.Window_MoveXY(*args, **kwargs)
7816
7817 def SetBestFittingSize(*args, **kwargs):
7818 """
7819 SetBestFittingSize(self, Size size=DefaultSize)
7820
7821 A 'Smart' SetSize that will fill in default size components with the
7822 window's *best size* values. Also set's the minsize for use with sizers.
7823 """
7824 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7825
7826 def Raise(*args, **kwargs):
7827 """
7828 Raise(self)
7829
7830 Raises the window to the top of the window hierarchy. In current
7831 version of wxWidgets this works both for manage and child windows.
7832 """
7833 return _core_.Window_Raise(*args, **kwargs)
7834
7835 def Lower(*args, **kwargs):
7836 """
7837 Lower(self)
7838
7839 Lowers the window to the bottom of the window hierarchy. In current
7840 version of wxWidgets this works both for manage and child windows.
7841 """
7842 return _core_.Window_Lower(*args, **kwargs)
7843
7844 def SetClientSize(*args, **kwargs):
7845 """
7846 SetClientSize(self, Size size)
7847
7848 This sets the size of the window client area in pixels. Using this
7849 function to size a window tends to be more device-independent than
7850 wx.Window.SetSize, since the application need not worry about what
7851 dimensions the border or title bar have when trying to fit the window
7852 around panel items, for example.
7853 """
7854 return _core_.Window_SetClientSize(*args, **kwargs)
7855
7856 def SetClientSizeWH(*args, **kwargs):
7857 """
7858 SetClientSizeWH(self, int width, int height)
7859
7860 This sets the size of the window client area in pixels. Using this
7861 function to size a window tends to be more device-independent than
7862 wx.Window.SetSize, since the application need not worry about what
7863 dimensions the border or title bar have when trying to fit the window
7864 around panel items, for example.
7865 """
7866 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7867
7868 def SetClientRect(*args, **kwargs):
7869 """
7870 SetClientRect(self, Rect rect)
7871
7872 This sets the size of the window client area in pixels. Using this
7873 function to size a window tends to be more device-independent than
7874 wx.Window.SetSize, since the application need not worry about what
7875 dimensions the border or title bar have when trying to fit the window
7876 around panel items, for example.
7877 """
7878 return _core_.Window_SetClientRect(*args, **kwargs)
7879
7880 def GetPosition(*args, **kwargs):
7881 """
7882 GetPosition(self) -> Point
7883
7884 Get the window's position. Notice that the position is in client
7885 coordinates for child windows and screen coordinates for the top level
7886 ones, use `GetScreenPosition` if you need screen coordinates for all
7887 kinds of windows.
7888 """
7889 return _core_.Window_GetPosition(*args, **kwargs)
7890
7891 def GetPositionTuple(*args, **kwargs):
7892 """
7893 GetPositionTuple() -> (x,y)
7894
7895 Get the window's position. Notice that the position is in client
7896 coordinates for child windows and screen coordinates for the top level
7897 ones, use `GetScreenPosition` if you need screen coordinates for all
7898 kinds of windows.
7899 """
7900 return _core_.Window_GetPositionTuple(*args, **kwargs)
7901
7902 def GetScreenPosition(*args, **kwargs):
7903 """
7904 GetScreenPosition(self) -> Point
7905
7906 Get the position of the window in screen coordinantes.
7907 """
7908 return _core_.Window_GetScreenPosition(*args, **kwargs)
7909
7910 def GetScreenPositionTuple(*args, **kwargs):
7911 """
7912 GetScreenPositionTuple() -> (x,y)
7913
7914 Get the position of the window in screen coordinantes.
7915 """
7916 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7917
7918 def GetScreenRect(*args, **kwargs):
7919 """
7920 GetScreenRect(self) -> Rect
7921
7922 Returns the size and position of the window in screen coordinantes as
7923 a `wx.Rect` object.
7924 """
7925 return _core_.Window_GetScreenRect(*args, **kwargs)
7926
7927 def GetSize(*args, **kwargs):
7928 """
7929 GetSize(self) -> Size
7930
7931 Get the window size.
7932 """
7933 return _core_.Window_GetSize(*args, **kwargs)
7934
7935 def GetSizeTuple(*args, **kwargs):
7936 """
7937 GetSizeTuple() -> (width, height)
7938
7939 Get the window size.
7940 """
7941 return _core_.Window_GetSizeTuple(*args, **kwargs)
7942
7943 def GetRect(*args, **kwargs):
7944 """
7945 GetRect(self) -> Rect
7946
7947 Returns the size and position of the window as a `wx.Rect` object.
7948 """
7949 return _core_.Window_GetRect(*args, **kwargs)
7950
7951 def GetClientSize(*args, **kwargs):
7952 """
7953 GetClientSize(self) -> Size
7954
7955 This gets the size of the window's 'client area' in pixels. The client
7956 area is the area which may be drawn on by the programmer, excluding
7957 title bar, border, scrollbars, etc.
7958 """
7959 return _core_.Window_GetClientSize(*args, **kwargs)
7960
7961 def GetClientSizeTuple(*args, **kwargs):
7962 """
7963 GetClientSizeTuple() -> (width, height)
7964
7965 This gets the size of the window's 'client area' in pixels. The client
7966 area is the area which may be drawn on by the programmer, excluding
7967 title bar, border, scrollbars, etc.
7968 """
7969 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7970
7971 def GetClientAreaOrigin(*args, **kwargs):
7972 """
7973 GetClientAreaOrigin(self) -> Point
7974
7975 Get the origin of the client area of the window relative to the
7976 window's top left corner (the client area may be shifted because of
7977 the borders, scrollbars, other decorations...)
7978 """
7979 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7980
7981 def GetClientRect(*args, **kwargs):
7982 """
7983 GetClientRect(self) -> Rect
7984
7985 Get the client area position and size as a `wx.Rect` object.
7986 """
7987 return _core_.Window_GetClientRect(*args, **kwargs)
7988
7989 def GetBestSize(*args, **kwargs):
7990 """
7991 GetBestSize(self) -> Size
7992
7993 This function returns the best acceptable minimal size for the
7994 window, if applicable. For example, for a static text control, it will
7995 be the minimal size such that the control label is not truncated. For
7996 windows containing subwindows (suzh aswx.Panel), the size returned by
7997 this function will be the same as the size the window would have had
7998 after calling Fit.
7999 """
8000 return _core_.Window_GetBestSize(*args, **kwargs)
8001
8002 def GetBestSizeTuple(*args, **kwargs):
8003 """
8004 GetBestSizeTuple() -> (width, height)
8005
8006 This function returns the best acceptable minimal size for the
8007 window, if applicable. For example, for a static text control, it will
8008 be the minimal size such that the control label is not truncated. For
8009 windows containing subwindows (suzh aswx.Panel), the size returned by
8010 this function will be the same as the size the window would have had
8011 after calling Fit.
8012 """
8013 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8014
8015 def InvalidateBestSize(*args, **kwargs):
8016 """
8017 InvalidateBestSize(self)
8018
8019 Reset the cached best size value so it will be recalculated the next
8020 time it is needed.
8021 """
8022 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8023
8024 def CacheBestSize(*args, **kwargs):
8025 """
8026 CacheBestSize(self, Size size)
8027
8028 Cache the best size so it doesn't need to be calculated again, (at least until
8029 some properties of the window change.)
8030 """
8031 return _core_.Window_CacheBestSize(*args, **kwargs)
8032
8033 def GetBestFittingSize(*args, **kwargs):
8034 """
8035 GetBestFittingSize(self) -> Size
8036
8037 This function will merge the window's best size into the window's
8038 minimum size, giving priority to the min size components, and returns
8039 the results.
8040
8041 """
8042 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8043
8044 def GetAdjustedBestSize(*args, **kwargs):
8045 """
8046 GetAdjustedBestSize(self) -> Size
8047
8048 This method is similar to GetBestSize, except in one
8049 thing. GetBestSize should return the minimum untruncated size of the
8050 window, while this method will return the largest of BestSize and any
8051 user specified minimum size. ie. it is the minimum size the window
8052 should currently be drawn at, not the minimal size it can possibly
8053 tolerate.
8054 """
8055 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8056
8057 def Center(*args, **kwargs):
8058 """
8059 Center(self, int direction=BOTH)
8060
8061 Centers the window. The parameter specifies the direction for
8062 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8063 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8064 on the entire screen and not on its parent window. If it is a
8065 top-level window and has no parent then it will always be centered
8066 relative to the screen.
8067 """
8068 return _core_.Window_Center(*args, **kwargs)
8069
8070 Centre = Center
8071 def CenterOnParent(*args, **kwargs):
8072 """
8073 CenterOnParent(self, int dir=BOTH)
8074
8075 Center with respect to the the parent window
8076 """
8077 return _core_.Window_CenterOnParent(*args, **kwargs)
8078
8079 CentreOnParent = CenterOnParent
8080 def Fit(*args, **kwargs):
8081 """
8082 Fit(self)
8083
8084 Sizes the window so that it fits around its subwindows. This function
8085 won't do anything if there are no subwindows and will only really work
8086 correctly if sizers are used for the subwindows layout. Also, if the
8087 window has exactly one subwindow it is better (faster and the result
8088 is more precise as Fit adds some margin to account for fuzziness of
8089 its calculations) to call window.SetClientSize(child.GetSize())
8090 instead of calling Fit.
8091 """
8092 return _core_.Window_Fit(*args, **kwargs)
8093
8094 def FitInside(*args, **kwargs):
8095 """
8096 FitInside(self)
8097
8098 Similar to Fit, but sizes the interior (virtual) size of a
8099 window. Mainly useful with scrolled windows to reset scrollbars after
8100 sizing changes that do not trigger a size event, and/or scrolled
8101 windows without an interior sizer. This function similarly won't do
8102 anything if there are no subwindows.
8103 """
8104 return _core_.Window_FitInside(*args, **kwargs)
8105
8106 def SetSizeHints(*args, **kwargs):
8107 """
8108 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8109 int incH=-1)
8110
8111 Allows specification of minimum and maximum window sizes, and window
8112 size increments. If a pair of values is not set (or set to -1), the
8113 default values will be used. If this function is called, the user
8114 will not be able to size the window outside the given bounds (if it is
8115 a top-level window.) Sizers will also inspect the minimum window size
8116 and will use that value if set when calculating layout.
8117
8118 The resizing increments are only significant under Motif or Xt.
8119 """
8120 return _core_.Window_SetSizeHints(*args, **kwargs)
8121
8122 def SetSizeHintsSz(*args, **kwargs):
8123 """
8124 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8125
8126 Allows specification of minimum and maximum window sizes, and window
8127 size increments. If a pair of values is not set (or set to -1), the
8128 default values will be used. If this function is called, the user
8129 will not be able to size the window outside the given bounds (if it is
8130 a top-level window.) Sizers will also inspect the minimum window size
8131 and will use that value if set when calculating layout.
8132
8133 The resizing increments are only significant under Motif or Xt.
8134 """
8135 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8136
8137 def SetVirtualSizeHints(*args, **kwargs):
8138 """
8139 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8140
8141 Allows specification of minimum and maximum virtual window sizes. If a
8142 pair of values is not set (or set to -1), the default values will be
8143 used. If this function is called, the user will not be able to size
8144 the virtual area of the window outside the given bounds.
8145 """
8146 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8147
8148 def SetVirtualSizeHintsSz(*args, **kwargs):
8149 """
8150 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8151
8152 Allows specification of minimum and maximum virtual window sizes. If a
8153 pair of values is not set (or set to -1), the default values will be
8154 used. If this function is called, the user will not be able to size
8155 the virtual area of the window outside the given bounds.
8156 """
8157 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8158
8159 def GetMaxSize(*args, **kwargs):
8160 """GetMaxSize(self) -> Size"""
8161 return _core_.Window_GetMaxSize(*args, **kwargs)
8162
8163 def GetMinSize(*args, **kwargs):
8164 """GetMinSize(self) -> Size"""
8165 return _core_.Window_GetMinSize(*args, **kwargs)
8166
8167 def SetMinSize(*args, **kwargs):
8168 """
8169 SetMinSize(self, Size minSize)
8170
8171 A more convenient method than `SetSizeHints` for setting just the
8172 min size.
8173 """
8174 return _core_.Window_SetMinSize(*args, **kwargs)
8175
8176 def SetMaxSize(*args, **kwargs):
8177 """
8178 SetMaxSize(self, Size maxSize)
8179
8180 A more convenient method than `SetSizeHints` for setting just the
8181 max size.
8182 """
8183 return _core_.Window_SetMaxSize(*args, **kwargs)
8184
8185 def GetMinWidth(*args, **kwargs):
8186 """GetMinWidth(self) -> int"""
8187 return _core_.Window_GetMinWidth(*args, **kwargs)
8188
8189 def GetMinHeight(*args, **kwargs):
8190 """GetMinHeight(self) -> int"""
8191 return _core_.Window_GetMinHeight(*args, **kwargs)
8192
8193 def GetMaxWidth(*args, **kwargs):
8194 """GetMaxWidth(self) -> int"""
8195 return _core_.Window_GetMaxWidth(*args, **kwargs)
8196
8197 def GetMaxHeight(*args, **kwargs):
8198 """GetMaxHeight(self) -> int"""
8199 return _core_.Window_GetMaxHeight(*args, **kwargs)
8200
8201 def SetVirtualSize(*args, **kwargs):
8202 """
8203 SetVirtualSize(self, Size size)
8204
8205 Set the the virtual size of a window in pixels. For most windows this
8206 is just the client area of the window, but for some like scrolled
8207 windows it is more or less independent of the screen window size.
8208 """
8209 return _core_.Window_SetVirtualSize(*args, **kwargs)
8210
8211 def SetVirtualSizeWH(*args, **kwargs):
8212 """
8213 SetVirtualSizeWH(self, int w, int h)
8214
8215 Set the the virtual size of a window in pixels. For most windows this
8216 is just the client area of the window, but for some like scrolled
8217 windows it is more or less independent of the screen window size.
8218 """
8219 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8220
8221 def GetVirtualSize(*args, **kwargs):
8222 """
8223 GetVirtualSize(self) -> Size
8224
8225 Get the the virtual size of the window in pixels. For most windows
8226 this is just the client area of the window, but for some like scrolled
8227 windows it is more or less independent of the screen window size.
8228 """
8229 return _core_.Window_GetVirtualSize(*args, **kwargs)
8230
8231 def GetVirtualSizeTuple(*args, **kwargs):
8232 """
8233 GetVirtualSizeTuple() -> (width, height)
8234
8235 Get the the virtual size of the window in pixels. For most windows
8236 this is just the client area of the window, but for some like scrolled
8237 windows it is more or less independent of the screen window size.
8238 """
8239 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8240
8241 def GetBestVirtualSize(*args, **kwargs):
8242 """
8243 GetBestVirtualSize(self) -> Size
8244
8245 Return the largest of ClientSize and BestSize (as determined by a
8246 sizer, interior children, or other means)
8247 """
8248 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8249
8250 def Show(*args, **kwargs):
8251 """
8252 Show(self, bool show=True) -> bool
8253
8254 Shows or hides the window. You may need to call Raise for a top level
8255 window if you want to bring it to top, although this is not needed if
8256 Show is called immediately after the frame creation. Returns True if
8257 the window has been shown or hidden or False if nothing was done
8258 because it already was in the requested state.
8259 """
8260 return _core_.Window_Show(*args, **kwargs)
8261
8262 def Hide(*args, **kwargs):
8263 """
8264 Hide(self) -> bool
8265
8266 Equivalent to calling Show(False).
8267 """
8268 return _core_.Window_Hide(*args, **kwargs)
8269
8270 def Enable(*args, **kwargs):
8271 """
8272 Enable(self, bool enable=True) -> bool
8273
8274 Enable or disable the window for user input. Note that when a parent
8275 window is disabled, all of its children are disabled as well and they
8276 are reenabled again when the parent is. Returns true if the window
8277 has been enabled or disabled, false if nothing was done, i.e. if the
8278 window had already been in the specified state.
8279 """
8280 return _core_.Window_Enable(*args, **kwargs)
8281
8282 def Disable(*args, **kwargs):
8283 """
8284 Disable(self) -> bool
8285
8286 Disables the window, same as Enable(false).
8287 """
8288 return _core_.Window_Disable(*args, **kwargs)
8289
8290 def IsShown(*args, **kwargs):
8291 """
8292 IsShown(self) -> bool
8293
8294 Returns true if the window is shown, false if it has been hidden.
8295 """
8296 return _core_.Window_IsShown(*args, **kwargs)
8297
8298 def IsEnabled(*args, **kwargs):
8299 """
8300 IsEnabled(self) -> bool
8301
8302 Returns true if the window is enabled for input, false otherwise.
8303 """
8304 return _core_.Window_IsEnabled(*args, **kwargs)
8305
8306 def SetWindowStyleFlag(*args, **kwargs):
8307 """
8308 SetWindowStyleFlag(self, long style)
8309
8310 Sets the style of the window. Please note that some styles cannot be
8311 changed after the window creation and that Refresh() might need to be
8312 called after changing the others for the change to take place
8313 immediately.
8314 """
8315 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8316
8317 def GetWindowStyleFlag(*args, **kwargs):
8318 """
8319 GetWindowStyleFlag(self) -> long
8320
8321 Gets the window style that was passed to the constructor or Create
8322 method.
8323 """
8324 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8325
8326 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8327 def HasFlag(*args, **kwargs):
8328 """
8329 HasFlag(self, int flag) -> bool
8330
8331 Test if the given style is set for this window.
8332 """
8333 return _core_.Window_HasFlag(*args, **kwargs)
8334
8335 def IsRetained(*args, **kwargs):
8336 """
8337 IsRetained(self) -> bool
8338
8339 Returns true if the window is retained, false otherwise. Retained
8340 windows are only available on X platforms.
8341 """
8342 return _core_.Window_IsRetained(*args, **kwargs)
8343
8344 def SetExtraStyle(*args, **kwargs):
8345 """
8346 SetExtraStyle(self, long exStyle)
8347
8348 Sets the extra style bits for the window. Extra styles are the less
8349 often used style bits which can't be set with the constructor or with
8350 SetWindowStyleFlag()
8351 """
8352 return _core_.Window_SetExtraStyle(*args, **kwargs)
8353
8354 def GetExtraStyle(*args, **kwargs):
8355 """
8356 GetExtraStyle(self) -> long
8357
8358 Returns the extra style bits for the window.
8359 """
8360 return _core_.Window_GetExtraStyle(*args, **kwargs)
8361
8362 def MakeModal(*args, **kwargs):
8363 """
8364 MakeModal(self, bool modal=True)
8365
8366 Disables all other windows in the application so that the user can
8367 only interact with this window. Passing False will reverse this
8368 effect.
8369 """
8370 return _core_.Window_MakeModal(*args, **kwargs)
8371
8372 def SetThemeEnabled(*args, **kwargs):
8373 """
8374 SetThemeEnabled(self, bool enableTheme)
8375
8376 This function tells a window if it should use the system's "theme"
8377 code to draw the windows' background instead if its own background
8378 drawing code. This will only have an effect on platforms that support
8379 the notion of themes in user defined windows. One such platform is
8380 GTK+ where windows can have (very colourful) backgrounds defined by a
8381 user's selected theme.
8382
8383 Dialogs, notebook pages and the status bar have this flag set to true
8384 by default so that the default look and feel is simulated best.
8385 """
8386 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8387
8388 def GetThemeEnabled(*args, **kwargs):
8389 """
8390 GetThemeEnabled(self) -> bool
8391
8392 Return the themeEnabled flag.
8393 """
8394 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8395
8396 def SetFocus(*args, **kwargs):
8397 """
8398 SetFocus(self)
8399
8400 Set's the focus to this window, allowing it to receive keyboard input.
8401 """
8402 return _core_.Window_SetFocus(*args, **kwargs)
8403
8404 def SetFocusFromKbd(*args, **kwargs):
8405 """
8406 SetFocusFromKbd(self)
8407
8408 Set focus to this window as the result of a keyboard action. Normally
8409 only called internally.
8410 """
8411 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8412
8413 def FindFocus(*args, **kwargs):
8414 """
8415 FindFocus() -> Window
8416
8417 Returns the window or control that currently has the keyboard focus,
8418 or None.
8419 """
8420 return _core_.Window_FindFocus(*args, **kwargs)
8421
8422 FindFocus = staticmethod(FindFocus)
8423 def AcceptsFocus(*args, **kwargs):
8424 """
8425 AcceptsFocus(self) -> bool
8426
8427 Can this window have focus?
8428 """
8429 return _core_.Window_AcceptsFocus(*args, **kwargs)
8430
8431 def AcceptsFocusFromKeyboard(*args, **kwargs):
8432 """
8433 AcceptsFocusFromKeyboard(self) -> bool
8434
8435 Can this window be given focus by keyboard navigation? if not, the
8436 only way to give it focus (provided it accepts it at all) is to click
8437 it.
8438 """
8439 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8440
8441 def Navigate(*args, **kwargs):
8442 """
8443 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8444
8445 Does keyboard navigation from this window to another, by sending a
8446 `wx.NavigationKeyEvent`.
8447 """
8448 return _core_.Window_Navigate(*args, **kwargs)
8449
8450 def MoveAfterInTabOrder(*args, **kwargs):
8451 """
8452 MoveAfterInTabOrder(self, Window win)
8453
8454 Moves this window in the tab navigation order after the specified
8455 sibling window. This means that when the user presses the TAB key on
8456 that other window, the focus switches to this window.
8457
8458 The default tab order is the same as creation order. This function
8459 and `MoveBeforeInTabOrder` allow to change it after creating all the
8460 windows.
8461
8462 """
8463 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8464
8465 def MoveBeforeInTabOrder(*args, **kwargs):
8466 """
8467 MoveBeforeInTabOrder(self, Window win)
8468
8469 Same as `MoveAfterInTabOrder` except that it inserts this window just
8470 before win instead of putting it right after it.
8471 """
8472 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8473
8474 def GetChildren(*args, **kwargs):
8475 """
8476 GetChildren(self) -> PyObject
8477
8478 Returns a list of the window's children. NOTE: Currently this is a
8479 copy of the child window list maintained by the window, so the return
8480 value of this function is only valid as long as the window's children
8481 do not change.
8482 """
8483 return _core_.Window_GetChildren(*args, **kwargs)
8484
8485 def GetParent(*args, **kwargs):
8486 """
8487 GetParent(self) -> Window
8488
8489 Returns the parent window of this window, or None if there isn't one.
8490 """
8491 return _core_.Window_GetParent(*args, **kwargs)
8492
8493 def GetGrandParent(*args, **kwargs):
8494 """
8495 GetGrandParent(self) -> Window
8496
8497 Returns the parent of the parent of this window, or None if there
8498 isn't one.
8499 """
8500 return _core_.Window_GetGrandParent(*args, **kwargs)
8501
8502 def IsTopLevel(*args, **kwargs):
8503 """
8504 IsTopLevel(self) -> bool
8505
8506 Returns true if the given window is a top-level one. Currently all
8507 frames and dialogs are always considered to be top-level windows (even
8508 if they have a parent window).
8509 """
8510 return _core_.Window_IsTopLevel(*args, **kwargs)
8511
8512 def Reparent(*args, **kwargs):
8513 """
8514 Reparent(self, Window newParent) -> bool
8515
8516 Reparents the window, i.e the window will be removed from its current
8517 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8518 re-inserted into another. Available on Windows and GTK. Returns True
8519 if the parent was changed, False otherwise (error or newParent ==
8520 oldParent)
8521 """
8522 return _core_.Window_Reparent(*args, **kwargs)
8523
8524 def AddChild(*args, **kwargs):
8525 """
8526 AddChild(self, Window child)
8527
8528 Adds a child window. This is called automatically by window creation
8529 functions so should not be required by the application programmer.
8530 """
8531 return _core_.Window_AddChild(*args, **kwargs)
8532
8533 def RemoveChild(*args, **kwargs):
8534 """
8535 RemoveChild(self, Window child)
8536
8537 Removes a child window. This is called automatically by window
8538 deletion functions so should not be required by the application
8539 programmer.
8540 """
8541 return _core_.Window_RemoveChild(*args, **kwargs)
8542
8543 def SetDoubleBuffered(*args, **kwargs):
8544 """
8545 SetDoubleBuffered(self, bool on)
8546
8547 Currently wxGTK2 only.
8548 """
8549 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8550
8551 def FindWindowById(*args, **kwargs):
8552 """
8553 FindWindowById(self, long winid) -> Window
8554
8555 Find a chld of this window by window ID
8556 """
8557 return _core_.Window_FindWindowById(*args, **kwargs)
8558
8559 def FindWindowByName(*args, **kwargs):
8560 """
8561 FindWindowByName(self, String name) -> Window
8562
8563 Find a child of this window by name
8564 """
8565 return _core_.Window_FindWindowByName(*args, **kwargs)
8566
8567 def GetEventHandler(*args, **kwargs):
8568 """
8569 GetEventHandler(self) -> EvtHandler
8570
8571 Returns the event handler for this window. By default, the window is
8572 its own event handler.
8573 """
8574 return _core_.Window_GetEventHandler(*args, **kwargs)
8575
8576 def SetEventHandler(*args, **kwargs):
8577 """
8578 SetEventHandler(self, EvtHandler handler)
8579
8580 Sets the event handler for this window. An event handler is an object
8581 that is capable of processing the events sent to a window. By default,
8582 the window is its own event handler, but an application may wish to
8583 substitute another, for example to allow central implementation of
8584 event-handling for a variety of different window classes.
8585
8586 It is usually better to use `wx.Window.PushEventHandler` since this sets
8587 up a chain of event handlers, where an event not handled by one event
8588 handler is handed to the next one in the chain.
8589 """
8590 return _core_.Window_SetEventHandler(*args, **kwargs)
8591
8592 def PushEventHandler(*args, **kwargs):
8593 """
8594 PushEventHandler(self, EvtHandler handler)
8595
8596 Pushes this event handler onto the event handler stack for the window.
8597 An event handler is an object that is capable of processing the events
8598 sent to a window. By default, the window is its own event handler, but
8599 an application may wish to substitute another, for example to allow
8600 central implementation of event-handling for a variety of different
8601 window classes.
8602
8603 wx.Window.PushEventHandler allows an application to set up a chain of
8604 event handlers, where an event not handled by one event handler is
8605 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8606 remove the event handler.
8607 """
8608 return _core_.Window_PushEventHandler(*args, **kwargs)
8609
8610 def PopEventHandler(*args, **kwargs):
8611 """
8612 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8613
8614 Removes and returns the top-most event handler on the event handler
8615 stack. If deleteHandler is True then the wx.EvtHandler object will be
8616 destroyed after it is popped.
8617 """
8618 return _core_.Window_PopEventHandler(*args, **kwargs)
8619
8620 def RemoveEventHandler(*args, **kwargs):
8621 """
8622 RemoveEventHandler(self, EvtHandler handler) -> bool
8623
8624 Find the given handler in the event handler chain and remove (but not
8625 delete) it from the event handler chain, return True if it was found
8626 and False otherwise (this also results in an assert failure so this
8627 function should only be called when the handler is supposed to be
8628 there.)
8629 """
8630 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8631
8632 def SetValidator(*args, **kwargs):
8633 """
8634 SetValidator(self, Validator validator)
8635
8636 Deletes the current validator (if any) and sets the window validator,
8637 having called wx.Validator.Clone to create a new validator of this
8638 type.
8639 """
8640 return _core_.Window_SetValidator(*args, **kwargs)
8641
8642 def GetValidator(*args, **kwargs):
8643 """
8644 GetValidator(self) -> Validator
8645
8646 Returns a pointer to the current validator for the window, or None if
8647 there is none.
8648 """
8649 return _core_.Window_GetValidator(*args, **kwargs)
8650
8651 def Validate(*args, **kwargs):
8652 """
8653 Validate(self) -> bool
8654
8655 Validates the current values of the child controls using their
8656 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8657 style flag set, the method will also call Validate() of all child
8658 windows. Returns false if any of the validations failed.
8659 """
8660 return _core_.Window_Validate(*args, **kwargs)
8661
8662 def TransferDataToWindow(*args, **kwargs):
8663 """
8664 TransferDataToWindow(self) -> bool
8665
8666 Transfers values to child controls from data areas specified by their
8667 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8668 style flag set, the method will also call TransferDataToWindow() of
8669 all child windows.
8670 """
8671 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8672
8673 def TransferDataFromWindow(*args, **kwargs):
8674 """
8675 TransferDataFromWindow(self) -> bool
8676
8677 Transfers values from child controls to data areas specified by their
8678 validators. Returns false if a transfer failed. If the window has
8679 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8680 also call TransferDataFromWindow() of all child windows.
8681 """
8682 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8683
8684 def InitDialog(*args, **kwargs):
8685 """
8686 InitDialog(self)
8687
8688 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8689 to the dialog via validators.
8690 """
8691 return _core_.Window_InitDialog(*args, **kwargs)
8692
8693 def SetAcceleratorTable(*args, **kwargs):
8694 """
8695 SetAcceleratorTable(self, AcceleratorTable accel)
8696
8697 Sets the accelerator table for this window.
8698 """
8699 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8700
8701 def GetAcceleratorTable(*args, **kwargs):
8702 """
8703 GetAcceleratorTable(self) -> AcceleratorTable
8704
8705 Gets the accelerator table for this window.
8706 """
8707 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8708
8709 def RegisterHotKey(*args, **kwargs):
8710 """
8711 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8712
8713 Registers a system wide hotkey. Every time the user presses the hotkey
8714 registered here, this window will receive a hotkey event. It will
8715 receive the event even if the application is in the background and
8716 does not have the input focus because the user is working with some
8717 other application. To bind an event handler function to this hotkey
8718 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8719 hotkey was registered successfully.
8720 """
8721 return _core_.Window_RegisterHotKey(*args, **kwargs)
8722
8723 def UnregisterHotKey(*args, **kwargs):
8724 """
8725 UnregisterHotKey(self, int hotkeyId) -> bool
8726
8727 Unregisters a system wide hotkey.
8728 """
8729 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8730
8731 def ConvertDialogPointToPixels(*args, **kwargs):
8732 """
8733 ConvertDialogPointToPixels(self, Point pt) -> Point
8734
8735 Converts a point or size from dialog units to pixels. Dialog units
8736 are used for maintaining a dialog's proportions even if the font
8737 changes. For the x dimension, the dialog units are multiplied by the
8738 average character width and then divided by 4. For the y dimension,
8739 the dialog units are multiplied by the average character height and
8740 then divided by 8.
8741 """
8742 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8743
8744 def ConvertDialogSizeToPixels(*args, **kwargs):
8745 """
8746 ConvertDialogSizeToPixels(self, Size sz) -> Size
8747
8748 Converts a point or size from dialog units to pixels. Dialog units
8749 are used for maintaining a dialog's proportions even if the font
8750 changes. For the x dimension, the dialog units are multiplied by the
8751 average character width and then divided by 4. For the y dimension,
8752 the dialog units are multiplied by the average character height and
8753 then divided by 8.
8754 """
8755 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8756
8757 def DLG_PNT(*args, **kwargs):
8758 """
8759 DLG_PNT(self, Point pt) -> Point
8760
8761 Converts a point or size from dialog units to pixels. Dialog units
8762 are used for maintaining a dialog's proportions even if the font
8763 changes. For the x dimension, the dialog units are multiplied by the
8764 average character width and then divided by 4. For the y dimension,
8765 the dialog units are multiplied by the average character height and
8766 then divided by 8.
8767 """
8768 return _core_.Window_DLG_PNT(*args, **kwargs)
8769
8770 def DLG_SZE(*args, **kwargs):
8771 """
8772 DLG_SZE(self, Size sz) -> Size
8773
8774 Converts a point or size from dialog units to pixels. Dialog units
8775 are used for maintaining a dialog's proportions even if the font
8776 changes. For the x dimension, the dialog units are multiplied by the
8777 average character width and then divided by 4. For the y dimension,
8778 the dialog units are multiplied by the average character height and
8779 then divided by 8.
8780 """
8781 return _core_.Window_DLG_SZE(*args, **kwargs)
8782
8783 def ConvertPixelPointToDialog(*args, **kwargs):
8784 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8785 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8786
8787 def ConvertPixelSizeToDialog(*args, **kwargs):
8788 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8789 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8790
8791 def WarpPointer(*args, **kwargs):
8792 """
8793 WarpPointer(self, int x, int y)
8794
8795 Moves the pointer to the given position on the window.
8796
8797 NOTE: This function is not supported under Mac because Apple Human
8798 Interface Guidelines forbid moving the mouse cursor programmatically.
8799 """
8800 return _core_.Window_WarpPointer(*args, **kwargs)
8801
8802 def CaptureMouse(*args, **kwargs):
8803 """
8804 CaptureMouse(self)
8805
8806 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8807 release the capture.
8808
8809 Note that wxWindows maintains the stack of windows having captured the
8810 mouse and when the mouse is released the capture returns to the window
8811 which had had captured it previously and it is only really released if
8812 there were no previous window. In particular, this means that you must
8813 release the mouse as many times as you capture it, unless the window
8814 receives the `wx.MouseCaptureLostEvent` event.
8815
8816 Any application which captures the mouse in the beginning of some
8817 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8818 operation when it receives the event. The event handler must not
8819 recapture mouse.
8820 """
8821 return _core_.Window_CaptureMouse(*args, **kwargs)
8822
8823 def ReleaseMouse(*args, **kwargs):
8824 """
8825 ReleaseMouse(self)
8826
8827 Releases mouse input captured with wx.Window.CaptureMouse.
8828 """
8829 return _core_.Window_ReleaseMouse(*args, **kwargs)
8830
8831 def GetCapture(*args, **kwargs):
8832 """
8833 GetCapture() -> Window
8834
8835 Returns the window which currently captures the mouse or None
8836 """
8837 return _core_.Window_GetCapture(*args, **kwargs)
8838
8839 GetCapture = staticmethod(GetCapture)
8840 def HasCapture(*args, **kwargs):
8841 """
8842 HasCapture(self) -> bool
8843
8844 Returns true if this window has the current mouse capture.
8845 """
8846 return _core_.Window_HasCapture(*args, **kwargs)
8847
8848 def Refresh(*args, **kwargs):
8849 """
8850 Refresh(self, bool eraseBackground=True, Rect rect=None)
8851
8852 Mark the specified rectangle (or the whole window) as "dirty" so it
8853 will be repainted. Causes an EVT_PAINT event to be generated and sent
8854 to the window.
8855 """
8856 return _core_.Window_Refresh(*args, **kwargs)
8857
8858 def RefreshRect(*args, **kwargs):
8859 """
8860 RefreshRect(self, Rect rect, bool eraseBackground=True)
8861
8862 Redraws the contents of the given rectangle: the area inside it will
8863 be repainted. This is the same as Refresh but has a nicer syntax.
8864 """
8865 return _core_.Window_RefreshRect(*args, **kwargs)
8866
8867 def Update(*args, **kwargs):
8868 """
8869 Update(self)
8870
8871 Calling this method immediately repaints the invalidated area of the
8872 window instead of waiting for the EVT_PAINT event to happen, (normally
8873 this would usually only happen when the flow of control returns to the
8874 event loop.) Notice that this function doesn't refresh the window and
8875 does nothing if the window has been already repainted. Use Refresh
8876 first if you want to immediately redraw the window (or some portion of
8877 it) unconditionally.
8878 """
8879 return _core_.Window_Update(*args, **kwargs)
8880
8881 def ClearBackground(*args, **kwargs):
8882 """
8883 ClearBackground(self)
8884
8885 Clears the window by filling it with the current background
8886 colour. Does not cause an erase background event to be generated.
8887 """
8888 return _core_.Window_ClearBackground(*args, **kwargs)
8889
8890 def Freeze(*args, **kwargs):
8891 """
8892 Freeze(self)
8893
8894 Freezes the window or, in other words, prevents any updates from
8895 taking place on screen, the window is not redrawn at all. Thaw must be
8896 called to reenable window redrawing. Calls to Freeze/Thaw may be
8897 nested, with the actual Thaw being delayed until all the nesting has
8898 been undone.
8899
8900 This method is useful for visual appearance optimization (for example,
8901 it is a good idea to use it before inserting large amount of text into
8902 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8903 for all controls so it is mostly just a hint to wxWindows and not a
8904 mandatory directive.
8905 """
8906 return _core_.Window_Freeze(*args, **kwargs)
8907
8908 def Thaw(*args, **kwargs):
8909 """
8910 Thaw(self)
8911
8912 Reenables window updating after a previous call to Freeze. Calls to
8913 Freeze/Thaw may be nested, so Thaw must be called the same number of
8914 times that Freeze was before the window will be updated.
8915 """
8916 return _core_.Window_Thaw(*args, **kwargs)
8917
8918 def PrepareDC(*args, **kwargs):
8919 """
8920 PrepareDC(self, DC dc)
8921
8922 Call this function to prepare the device context for drawing a
8923 scrolled image. It sets the device origin according to the current
8924 scroll position.
8925 """
8926 return _core_.Window_PrepareDC(*args, **kwargs)
8927
8928 def GetUpdateRegion(*args, **kwargs):
8929 """
8930 GetUpdateRegion(self) -> Region
8931
8932 Returns the region specifying which parts of the window have been
8933 damaged. Should only be called within an EVT_PAINT handler.
8934 """
8935 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8936
8937 def GetUpdateClientRect(*args, **kwargs):
8938 """
8939 GetUpdateClientRect(self) -> Rect
8940
8941 Get the update rectangle region bounding box in client coords.
8942 """
8943 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8944
8945 def IsExposed(*args, **kwargs):
8946 """
8947 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8948
8949 Returns true if the given point or rectangle area has been exposed
8950 since the last repaint. Call this in an paint event handler to
8951 optimize redrawing by only redrawing those areas, which have been
8952 exposed.
8953 """
8954 return _core_.Window_IsExposed(*args, **kwargs)
8955
8956 def IsExposedPoint(*args, **kwargs):
8957 """
8958 IsExposedPoint(self, Point pt) -> bool
8959
8960 Returns true if the given point or rectangle area has been exposed
8961 since the last repaint. Call this in an paint event handler to
8962 optimize redrawing by only redrawing those areas, which have been
8963 exposed.
8964 """
8965 return _core_.Window_IsExposedPoint(*args, **kwargs)
8966
8967 def IsExposedRect(*args, **kwargs):
8968 """
8969 IsExposedRect(self, Rect rect) -> bool
8970
8971 Returns true if the given point or rectangle area has been exposed
8972 since the last repaint. Call this in an paint event handler to
8973 optimize redrawing by only redrawing those areas, which have been
8974 exposed.
8975 """
8976 return _core_.Window_IsExposedRect(*args, **kwargs)
8977
8978 def GetDefaultAttributes(*args, **kwargs):
8979 """
8980 GetDefaultAttributes(self) -> VisualAttributes
8981
8982 Get the default attributes for an instance of this class. This is
8983 useful if you want to use the same font or colour in your own control
8984 as in a standard control -- which is a much better idea than hard
8985 coding specific colours or fonts which might look completely out of
8986 place on the user's system, especially if it uses themes.
8987 """
8988 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8989
8990 def GetClassDefaultAttributes(*args, **kwargs):
8991 """
8992 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8993
8994 Get the default attributes for this class. This is useful if you want
8995 to use the same font or colour in your own control as in a standard
8996 control -- which is a much better idea than hard coding specific
8997 colours or fonts which might look completely out of place on the
8998 user's system, especially if it uses themes.
8999
9000 The variant parameter is only relevant under Mac currently and is
9001 ignore under other platforms. Under Mac, it will change the size of
9002 the returned font. See `wx.Window.SetWindowVariant` for more about
9003 this.
9004 """
9005 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9006
9007 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9008 def SetBackgroundColour(*args, **kwargs):
9009 """
9010 SetBackgroundColour(self, Colour colour) -> bool
9011
9012 Sets the background colour of the window. Returns True if the colour
9013 was changed. The background colour is usually painted by the default
9014 EVT_ERASE_BACKGROUND event handler function under Windows and
9015 automatically under GTK. Using `wx.NullColour` will reset the window
9016 to the default background colour.
9017
9018 Note that setting the background colour may not cause an immediate
9019 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9020 calling this function.
9021
9022 Using this function will disable attempts to use themes for this
9023 window, if the system supports them. Use with care since usually the
9024 themes represent the appearance chosen by the user to be used for all
9025 applications on the system.
9026 """
9027 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9028
9029 def SetOwnBackgroundColour(*args, **kwargs):
9030 """SetOwnBackgroundColour(self, Colour colour)"""
9031 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9032
9033 def SetForegroundColour(*args, **kwargs):
9034 """
9035 SetForegroundColour(self, Colour colour) -> bool
9036
9037 Sets the foreground colour of the window. Returns True is the colour
9038 was changed. The interpretation of foreground colour is dependent on
9039 the window class; it may be the text colour or other colour, or it may
9040 not be used at all.
9041 """
9042 return _core_.Window_SetForegroundColour(*args, **kwargs)
9043
9044 def SetOwnForegroundColour(*args, **kwargs):
9045 """SetOwnForegroundColour(self, Colour colour)"""
9046 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9047
9048 def GetBackgroundColour(*args, **kwargs):
9049 """
9050 GetBackgroundColour(self) -> Colour
9051
9052 Returns the background colour of the window.
9053 """
9054 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9055
9056 def GetForegroundColour(*args, **kwargs):
9057 """
9058 GetForegroundColour(self) -> Colour
9059
9060 Returns the foreground colour of the window. The interpretation of
9061 foreground colour is dependent on the window class; it may be the text
9062 colour or other colour, or it may not be used at all.
9063 """
9064 return _core_.Window_GetForegroundColour(*args, **kwargs)
9065
9066 def InheritsBackgroundColour(*args, **kwargs):
9067 """InheritsBackgroundColour(self) -> bool"""
9068 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9069
9070 def UseBgCol(*args, **kwargs):
9071 """UseBgCol(self) -> bool"""
9072 return _core_.Window_UseBgCol(*args, **kwargs)
9073
9074 def SetBackgroundStyle(*args, **kwargs):
9075 """
9076 SetBackgroundStyle(self, int style) -> bool
9077
9078 Returns the background style of the window. The background style
9079 indicates how the background of the window is drawn.
9080
9081 ====================== ========================================
9082 wx.BG_STYLE_SYSTEM The background colour or pattern should
9083 be determined by the system
9084 wx.BG_STYLE_COLOUR The background should be a solid colour
9085 wx.BG_STYLE_CUSTOM The background will be implemented by the
9086 application.
9087 ====================== ========================================
9088
9089 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9090 a custom background, such as a tiled bitmap. Currently the style has
9091 no effect on other platforms.
9092
9093 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9094 """
9095 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9096
9097 def GetBackgroundStyle(*args, **kwargs):
9098 """
9099 GetBackgroundStyle(self) -> int
9100
9101 Returns the background style of the window.
9102
9103 :see: `SetBackgroundStyle`
9104 """
9105 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9106
9107 def HasTransparentBackground(*args, **kwargs):
9108 """
9109 HasTransparentBackground(self) -> bool
9110
9111 Returns True if this window's background is transparent (as, for
9112 example, for `wx.StaticText`) and should show the parent window's
9113 background.
9114
9115 This method is mostly used internally by the library itself and you
9116 normally shouldn't have to call it. You may, however, have to override
9117 it in your custom control classes to ensure that background is painted
9118 correctly.
9119 """
9120 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9121
9122 def SetCursor(*args, **kwargs):
9123 """
9124 SetCursor(self, Cursor cursor) -> bool
9125
9126 Sets the window's cursor. Notice that the window cursor also sets it
9127 for the children of the window implicitly.
9128
9129 The cursor may be wx.NullCursor in which case the window cursor will
9130 be reset back to default.
9131 """
9132 return _core_.Window_SetCursor(*args, **kwargs)
9133
9134 def GetCursor(*args, **kwargs):
9135 """
9136 GetCursor(self) -> Cursor
9137
9138 Return the cursor associated with this window.
9139 """
9140 return _core_.Window_GetCursor(*args, **kwargs)
9141
9142 def SetFont(*args, **kwargs):
9143 """
9144 SetFont(self, Font font) -> bool
9145
9146 Sets the font for this window.
9147 """
9148 return _core_.Window_SetFont(*args, **kwargs)
9149
9150 def SetOwnFont(*args, **kwargs):
9151 """SetOwnFont(self, Font font)"""
9152 return _core_.Window_SetOwnFont(*args, **kwargs)
9153
9154 def GetFont(*args, **kwargs):
9155 """
9156 GetFont(self) -> Font
9157
9158 Returns the default font used for this window.
9159 """
9160 return _core_.Window_GetFont(*args, **kwargs)
9161
9162 def SetCaret(*args, **kwargs):
9163 """
9164 SetCaret(self, Caret caret)
9165
9166 Sets the caret associated with the window.
9167 """
9168 return _core_.Window_SetCaret(*args, **kwargs)
9169
9170 def GetCaret(*args, **kwargs):
9171 """
9172 GetCaret(self) -> Caret
9173
9174 Returns the caret associated with the window.
9175 """
9176 return _core_.Window_GetCaret(*args, **kwargs)
9177
9178 def GetCharHeight(*args, **kwargs):
9179 """
9180 GetCharHeight(self) -> int
9181
9182 Get the (average) character size for the current font.
9183 """
9184 return _core_.Window_GetCharHeight(*args, **kwargs)
9185
9186 def GetCharWidth(*args, **kwargs):
9187 """
9188 GetCharWidth(self) -> int
9189
9190 Get the (average) character size for the current font.
9191 """
9192 return _core_.Window_GetCharWidth(*args, **kwargs)
9193
9194 def GetTextExtent(*args, **kwargs):
9195 """
9196 GetTextExtent(String string) -> (width, height)
9197
9198 Get the width and height of the text using the current font.
9199 """
9200 return _core_.Window_GetTextExtent(*args, **kwargs)
9201
9202 def GetFullTextExtent(*args, **kwargs):
9203 """
9204 GetFullTextExtent(String string, Font font=None) ->
9205 (width, height, descent, externalLeading)
9206
9207 Get the width, height, decent and leading of the text using the
9208 current or specified font.
9209 """
9210 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9211
9212 def ClientToScreenXY(*args, **kwargs):
9213 """
9214 ClientToScreenXY(int x, int y) -> (x,y)
9215
9216 Converts to screen coordinates from coordinates relative to this window.
9217 """
9218 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9219
9220 def ScreenToClientXY(*args, **kwargs):
9221 """
9222 ScreenToClientXY(int x, int y) -> (x,y)
9223
9224 Converts from screen to client window coordinates.
9225 """
9226 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9227
9228 def ClientToScreen(*args, **kwargs):
9229 """
9230 ClientToScreen(self, Point pt) -> Point
9231
9232 Converts to screen coordinates from coordinates relative to this window.
9233 """
9234 return _core_.Window_ClientToScreen(*args, **kwargs)
9235
9236 def ScreenToClient(*args, **kwargs):
9237 """
9238 ScreenToClient(self, Point pt) -> Point
9239
9240 Converts from screen to client window coordinates.
9241 """
9242 return _core_.Window_ScreenToClient(*args, **kwargs)
9243
9244 def HitTestXY(*args, **kwargs):
9245 """
9246 HitTestXY(self, int x, int y) -> int
9247
9248 Test where the given (in client coords) point lies
9249 """
9250 return _core_.Window_HitTestXY(*args, **kwargs)
9251
9252 def HitTest(*args, **kwargs):
9253 """
9254 HitTest(self, Point pt) -> int
9255
9256 Test where the given (in client coords) point lies
9257 """
9258 return _core_.Window_HitTest(*args, **kwargs)
9259
9260 def GetBorder(*args):
9261 """
9262 GetBorder(self, long flags) -> int
9263 GetBorder(self) -> int
9264
9265 Get border for the flags of this window
9266 """
9267 return _core_.Window_GetBorder(*args)
9268
9269 def UpdateWindowUI(*args, **kwargs):
9270 """
9271 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9272
9273 This function sends EVT_UPDATE_UI events to the window. The particular
9274 implementation depends on the window; for example a wx.ToolBar will
9275 send an update UI event for each toolbar button, and a wx.Frame will
9276 send an update UI event for each menubar menu item. You can call this
9277 function from your application to ensure that your UI is up-to-date at
9278 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9279 concerned). This may be necessary if you have called
9280 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9281 limit the overhead that wxWindows incurs by sending update UI events
9282 in idle time.
9283 """
9284 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9285
9286 def PopupMenuXY(*args, **kwargs):
9287 """
9288 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9289
9290 Pops up the given menu at the specified coordinates, relative to this window,
9291 and returns control when the user has dismissed the menu. If a menu item is
9292 selected, the corresponding menu event is generated and will be processed as
9293 usual. If the default position is given then the current position of the
9294 mouse cursor will be used.
9295 """
9296 return _core_.Window_PopupMenuXY(*args, **kwargs)
9297
9298 def PopupMenu(*args, **kwargs):
9299 """
9300 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9301
9302 Pops up the given menu at the specified coordinates, relative to this window,
9303 and returns control when the user has dismissed the menu. If a menu item is
9304 selected, the corresponding menu event is generated and will be processed as
9305 usual. If the default position is given then the current position of the
9306 mouse cursor will be used.
9307 """
9308 return _core_.Window_PopupMenu(*args, **kwargs)
9309
9310 def HasMultiplePages(*args, **kwargs):
9311 """HasMultiplePages(self) -> bool"""
9312 return _core_.Window_HasMultiplePages(*args, **kwargs)
9313
9314 def GetHandle(*args, **kwargs):
9315 """
9316 GetHandle(self) -> long
9317
9318 Returns the platform-specific handle (as a long integer) of the
9319 physical window. Currently on wxMac it returns the handle of the
9320 toplevel parent of the window.
9321 """
9322 return _core_.Window_GetHandle(*args, **kwargs)
9323
9324 def AssociateHandle(*args, **kwargs):
9325 """
9326 AssociateHandle(self, long handle)
9327
9328 Associate the window with a new native handle
9329 """
9330 return _core_.Window_AssociateHandle(*args, **kwargs)
9331
9332 def DissociateHandle(*args, **kwargs):
9333 """
9334 DissociateHandle(self)
9335
9336 Dissociate the current native handle from the window
9337 """
9338 return _core_.Window_DissociateHandle(*args, **kwargs)
9339
9340 def HasScrollbar(*args, **kwargs):
9341 """
9342 HasScrollbar(self, int orient) -> bool
9343
9344 Does the window have the scrollbar for this orientation?
9345 """
9346 return _core_.Window_HasScrollbar(*args, **kwargs)
9347
9348 def SetScrollbar(*args, **kwargs):
9349 """
9350 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9351 bool refresh=True)
9352
9353 Sets the scrollbar properties of a built-in scrollbar.
9354 """
9355 return _core_.Window_SetScrollbar(*args, **kwargs)
9356
9357 def SetScrollPos(*args, **kwargs):
9358 """
9359 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9360
9361 Sets the position of one of the built-in scrollbars.
9362 """
9363 return _core_.Window_SetScrollPos(*args, **kwargs)
9364
9365 def GetScrollPos(*args, **kwargs):
9366 """
9367 GetScrollPos(self, int orientation) -> int
9368
9369 Returns the built-in scrollbar position.
9370 """
9371 return _core_.Window_GetScrollPos(*args, **kwargs)
9372
9373 def GetScrollThumb(*args, **kwargs):
9374 """
9375 GetScrollThumb(self, int orientation) -> int
9376
9377 Returns the built-in scrollbar thumb size.
9378 """
9379 return _core_.Window_GetScrollThumb(*args, **kwargs)
9380
9381 def GetScrollRange(*args, **kwargs):
9382 """
9383 GetScrollRange(self, int orientation) -> int
9384
9385 Returns the built-in scrollbar range.
9386 """
9387 return _core_.Window_GetScrollRange(*args, **kwargs)
9388
9389 def ScrollWindow(*args, **kwargs):
9390 """
9391 ScrollWindow(self, int dx, int dy, Rect rect=None)
9392
9393 Physically scrolls the pixels in the window and move child windows
9394 accordingly. Use this function to optimise your scrolling
9395 implementations, to minimise the area that must be redrawn. Note that
9396 it is rarely required to call this function from a user program.
9397 """
9398 return _core_.Window_ScrollWindow(*args, **kwargs)
9399
9400 def ScrollLines(*args, **kwargs):
9401 """
9402 ScrollLines(self, int lines) -> bool
9403
9404 If the platform and window class supports it, scrolls the window by
9405 the given number of lines down, if lines is positive, or up if lines
9406 is negative. Returns True if the window was scrolled, False if it was
9407 already on top/bottom and nothing was done.
9408 """
9409 return _core_.Window_ScrollLines(*args, **kwargs)
9410
9411 def ScrollPages(*args, **kwargs):
9412 """
9413 ScrollPages(self, int pages) -> bool
9414
9415 If the platform and window class supports it, scrolls the window by
9416 the given number of pages down, if pages is positive, or up if pages
9417 is negative. Returns True if the window was scrolled, False if it was
9418 already on top/bottom and nothing was done.
9419 """
9420 return _core_.Window_ScrollPages(*args, **kwargs)
9421
9422 def LineUp(*args, **kwargs):
9423 """
9424 LineUp(self) -> bool
9425
9426 This is just a wrapper for ScrollLines(-1).
9427 """
9428 return _core_.Window_LineUp(*args, **kwargs)
9429
9430 def LineDown(*args, **kwargs):
9431 """
9432 LineDown(self) -> bool
9433
9434 This is just a wrapper for ScrollLines(1).
9435 """
9436 return _core_.Window_LineDown(*args, **kwargs)
9437
9438 def PageUp(*args, **kwargs):
9439 """
9440 PageUp(self) -> bool
9441
9442 This is just a wrapper for ScrollPages(-1).
9443 """
9444 return _core_.Window_PageUp(*args, **kwargs)
9445
9446 def PageDown(*args, **kwargs):
9447 """
9448 PageDown(self) -> bool
9449
9450 This is just a wrapper for ScrollPages(1).
9451 """
9452 return _core_.Window_PageDown(*args, **kwargs)
9453
9454 def SetHelpText(*args, **kwargs):
9455 """
9456 SetHelpText(self, String text)
9457
9458 Sets the help text to be used as context-sensitive help for this
9459 window. Note that the text is actually stored by the current
9460 `wx.HelpProvider` implementation, and not in the window object itself.
9461 """
9462 return _core_.Window_SetHelpText(*args, **kwargs)
9463
9464 def SetHelpTextForId(*args, **kwargs):
9465 """
9466 SetHelpTextForId(self, String text)
9467
9468 Associate this help text with all windows with the same id as this
9469 one.
9470 """
9471 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9472
9473 def GetHelpTextAtPoint(*args, **kwargs):
9474 """
9475 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9476
9477 Get the help string associated with the given position in this window.
9478
9479 Notice that pt may be invalid if event origin is keyboard or unknown
9480 and this method should return the global window help text then
9481
9482 """
9483 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9484
9485 def GetHelpText(*args, **kwargs):
9486 """
9487 GetHelpText(self) -> String
9488
9489 Gets the help text to be used as context-sensitive help for this
9490 window. Note that the text is actually stored by the current
9491 `wx.HelpProvider` implementation, and not in the window object itself.
9492 """
9493 return _core_.Window_GetHelpText(*args, **kwargs)
9494
9495 def SetToolTipString(*args, **kwargs):
9496 """
9497 SetToolTipString(self, String tip)
9498
9499 Attach a tooltip to the window.
9500 """
9501 return _core_.Window_SetToolTipString(*args, **kwargs)
9502
9503 def SetToolTip(*args, **kwargs):
9504 """
9505 SetToolTip(self, ToolTip tip)
9506
9507 Attach a tooltip to the window.
9508 """
9509 return _core_.Window_SetToolTip(*args, **kwargs)
9510
9511 def GetToolTip(*args, **kwargs):
9512 """
9513 GetToolTip(self) -> ToolTip
9514
9515 get the associated tooltip or None if none
9516 """
9517 return _core_.Window_GetToolTip(*args, **kwargs)
9518
9519 def SetDropTarget(*args, **kwargs):
9520 """
9521 SetDropTarget(self, DropTarget dropTarget)
9522
9523 Associates a drop target with this window. If the window already has
9524 a drop target, it is deleted.
9525 """
9526 return _core_.Window_SetDropTarget(*args, **kwargs)
9527
9528 def GetDropTarget(*args, **kwargs):
9529 """
9530 GetDropTarget(self) -> DropTarget
9531
9532 Returns the associated drop target, which may be None.
9533 """
9534 return _core_.Window_GetDropTarget(*args, **kwargs)
9535
9536 def DragAcceptFiles(*args, **kwargs):
9537 """
9538 DragAcceptFiles(self, bool accept)
9539
9540 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9541 Only functional on Windows.
9542 """
9543 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9544
9545 def SetConstraints(*args, **kwargs):
9546 """
9547 SetConstraints(self, LayoutConstraints constraints)
9548
9549 Sets the window to have the given layout constraints. If an existing
9550 layout constraints object is already owned by the window, it will be
9551 deleted. Pass None to disassociate and delete the window's current
9552 constraints.
9553
9554 You must call SetAutoLayout to tell a window to use the constraints
9555 automatically in its default EVT_SIZE handler; otherwise, you must
9556 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9557 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9558 effect.
9559 """
9560 return _core_.Window_SetConstraints(*args, **kwargs)
9561
9562 def GetConstraints(*args, **kwargs):
9563 """
9564 GetConstraints(self) -> LayoutConstraints
9565
9566 Returns a pointer to the window's layout constraints, or None if there
9567 are none.
9568 """
9569 return _core_.Window_GetConstraints(*args, **kwargs)
9570
9571 def SetAutoLayout(*args, **kwargs):
9572 """
9573 SetAutoLayout(self, bool autoLayout)
9574
9575 Determines whether the Layout function will be called automatically
9576 when the window is resized. lease note that this only happens for the
9577 windows usually used to contain children, namely `wx.Panel` and
9578 `wx.TopLevelWindow` (and the classes deriving from them).
9579
9580 This method is called implicitly by `SetSizer` but if you use
9581 `SetConstraints` you should call it manually or otherwise the window
9582 layout won't be correctly updated when its size changes.
9583 """
9584 return _core_.Window_SetAutoLayout(*args, **kwargs)
9585
9586 def GetAutoLayout(*args, **kwargs):
9587 """
9588 GetAutoLayout(self) -> bool
9589
9590 Returns the current autoLayout setting
9591 """
9592 return _core_.Window_GetAutoLayout(*args, **kwargs)
9593
9594 def Layout(*args, **kwargs):
9595 """
9596 Layout(self) -> bool
9597
9598 Invokes the constraint-based layout algorithm or the sizer-based
9599 algorithm for this window. See SetAutoLayout: when auto layout is on,
9600 this function gets called automatically by the default EVT_SIZE
9601 handler when the window is resized.
9602 """
9603 return _core_.Window_Layout(*args, **kwargs)
9604
9605 def SetSizer(*args, **kwargs):
9606 """
9607 SetSizer(self, Sizer sizer, bool deleteOld=True)
9608
9609 Sets the window to have the given layout sizer. The window will then
9610 own the object, and will take care of its deletion. If an existing
9611 layout sizer object is already owned by the window, it will be deleted
9612 if the deleteOld parameter is true. Note that this function will also
9613 call SetAutoLayout implicitly with a True parameter if the sizer is
9614 non-None, and False otherwise.
9615 """
9616 return _core_.Window_SetSizer(*args, **kwargs)
9617
9618 def SetSizerAndFit(*args, **kwargs):
9619 """
9620 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9621
9622 The same as SetSizer, except it also sets the size hints for the
9623 window based on the sizer's minimum size.
9624 """
9625 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9626
9627 def GetSizer(*args, **kwargs):
9628 """
9629 GetSizer(self) -> Sizer
9630
9631 Return the sizer associated with the window by a previous call to
9632 SetSizer or None if there isn't one.
9633 """
9634 return _core_.Window_GetSizer(*args, **kwargs)
9635
9636 def SetContainingSizer(*args, **kwargs):
9637 """
9638 SetContainingSizer(self, Sizer sizer)
9639
9640 This normally does not need to be called by application code. It is
9641 called internally when a window is added to a sizer, and is used so
9642 the window can remove itself from the sizer when it is destroyed.
9643 """
9644 return _core_.Window_SetContainingSizer(*args, **kwargs)
9645
9646 def GetContainingSizer(*args, **kwargs):
9647 """
9648 GetContainingSizer(self) -> Sizer
9649
9650 Return the sizer that this window is a member of, if any, otherwise None.
9651 """
9652 return _core_.Window_GetContainingSizer(*args, **kwargs)
9653
9654 def InheritAttributes(*args, **kwargs):
9655 """
9656 InheritAttributes(self)
9657
9658 This function is (or should be, in case of custom controls) called
9659 during window creation to intelligently set up the window visual
9660 attributes, that is the font and the foreground and background
9661 colours.
9662
9663 By 'intelligently' the following is meant: by default, all windows use
9664 their own default attributes. However if some of the parent's
9665 attributes are explicitly changed (that is, using SetFont and not
9666 SetOwnFont) and if the corresponding attribute hadn't been
9667 explicitly set for this window itself, then this window takes the same
9668 value as used by the parent. In addition, if the window overrides
9669 ShouldInheritColours to return false, the colours will not be changed
9670 no matter what and only the font might.
9671
9672 This rather complicated logic is necessary in order to accommodate the
9673 different usage scenarios. The most common one is when all default
9674 attributes are used and in this case, nothing should be inherited as
9675 in modern GUIs different controls use different fonts (and colours)
9676 than their siblings so they can't inherit the same value from the
9677 parent. However it was also deemed desirable to allow to simply change
9678 the attributes of all children at once by just changing the font or
9679 colour of their common parent, hence in this case we do inherit the
9680 parents attributes.
9681
9682 """
9683 return _core_.Window_InheritAttributes(*args, **kwargs)
9684
9685 def ShouldInheritColours(*args, **kwargs):
9686 """
9687 ShouldInheritColours(self) -> bool
9688
9689 Return true from here to allow the colours of this window to be
9690 changed by InheritAttributes, returning false forbids inheriting them
9691 from the parent window.
9692
9693 The base class version returns false, but this method is overridden in
9694 wxControl where it returns true.
9695 """
9696 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9697
9698 def CanSetTransparent(*args, **kwargs):
9699 """
9700 CanSetTransparent(self) -> bool
9701
9702 Returns ``True`` if the platform supports setting the transparency for
9703 this window. Note that this method will err on the side of caution,
9704 so it is possible that this will return ``False`` when it is in fact
9705 possible to set the transparency.
9706
9707 NOTE: On X-windows systems the X server must have the composite
9708 extension loaded, and there must be a composite manager program (such
9709 as xcompmgr) running.
9710 """
9711 return _core_.Window_CanSetTransparent(*args, **kwargs)
9712
9713 def SetTransparent(*args, **kwargs):
9714 """
9715 SetTransparent(self, byte alpha) -> bool
9716
9717 Attempt to set the transparency of this window to the ``alpha`` value,
9718 returns True on success. The ``alpha`` value is an integer in the
9719 range of 0 to 255, where 0 is fully transparent and 255 is fully
9720 opaque.
9721 """
9722 return _core_.Window_SetTransparent(*args, **kwargs)
9723
9724 def PostCreate(self, pre):
9725 """
9726 Phase 3 of the 2-phase create <wink!>
9727 Call this method after precreating the window with the 2-phase create method.
9728 """
9729 self.this = pre.this
9730 self.thisown = pre.thisown
9731 pre.thisown = 0
9732 if hasattr(self, '_setOORInfo'):
9733 self._setOORInfo(self)
9734 if hasattr(self, '_setCallbackInfo'):
9735 self._setCallbackInfo(self, self.__class__)
9736
9737 def SendSizeEvent(self):
9738 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9739
9740 _core_.Window_swigregister(Window)
9741
9742 def PreWindow(*args, **kwargs):
9743 """
9744 PreWindow() -> Window
9745
9746 Precreate a Window for 2-phase creation.
9747 """
9748 val = _core_.new_PreWindow(*args, **kwargs)
9749 return val
9750
9751 def Window_NewControlId(*args):
9752 """
9753 Window_NewControlId() -> int
9754
9755 Generate a control id for the controls which were not given one.
9756 """
9757 return _core_.Window_NewControlId(*args)
9758
9759 def Window_NextControlId(*args, **kwargs):
9760 """
9761 Window_NextControlId(int winid) -> int
9762
9763 Get the id of the control following the one with the given
9764 autogenerated) id
9765 """
9766 return _core_.Window_NextControlId(*args, **kwargs)
9767
9768 def Window_PrevControlId(*args, **kwargs):
9769 """
9770 Window_PrevControlId(int winid) -> int
9771
9772 Get the id of the control preceding the one with the given
9773 autogenerated) id
9774 """
9775 return _core_.Window_PrevControlId(*args, **kwargs)
9776
9777 def Window_FindFocus(*args):
9778 """
9779 Window_FindFocus() -> Window
9780
9781 Returns the window or control that currently has the keyboard focus,
9782 or None.
9783 """
9784 return _core_.Window_FindFocus(*args)
9785
9786 def Window_GetCapture(*args):
9787 """
9788 Window_GetCapture() -> Window
9789
9790 Returns the window which currently captures the mouse or None
9791 """
9792 return _core_.Window_GetCapture(*args)
9793
9794 def Window_GetClassDefaultAttributes(*args, **kwargs):
9795 """
9796 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9797
9798 Get the default attributes for this class. This is useful if you want
9799 to use the same font or colour in your own control as in a standard
9800 control -- which is a much better idea than hard coding specific
9801 colours or fonts which might look completely out of place on the
9802 user's system, especially if it uses themes.
9803
9804 The variant parameter is only relevant under Mac currently and is
9805 ignore under other platforms. Under Mac, it will change the size of
9806 the returned font. See `wx.Window.SetWindowVariant` for more about
9807 this.
9808 """
9809 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9810
9811 def DLG_PNT(win, point_or_x, y=None):
9812 """
9813 Convenience function for converting a Point or (x,y) in
9814 dialog units to pixel units.
9815 """
9816 if y is None:
9817 return win.ConvertDialogPointToPixels(point_or_x)
9818 else:
9819 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9820
9821 def DLG_SZE(win, size_width, height=None):
9822 """
9823 Convenience function for converting a Size or (w,h) in
9824 dialog units to pixel units.
9825 """
9826 if height is None:
9827 return win.ConvertDialogSizeToPixels(size_width)
9828 else:
9829 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9830
9831
9832 def FindWindowById(*args, **kwargs):
9833 """
9834 FindWindowById(long id, Window parent=None) -> Window
9835
9836 Find the first window in the application with the given id. If parent
9837 is None, the search will start from all top-level frames and dialog
9838 boxes; if non-None, the search will be limited to the given window
9839 hierarchy. The search is recursive in both cases.
9840 """
9841 return _core_.FindWindowById(*args, **kwargs)
9842
9843 def FindWindowByName(*args, **kwargs):
9844 """
9845 FindWindowByName(String name, Window parent=None) -> Window
9846
9847 Find a window by its name (as given in a window constructor or Create
9848 function call). If parent is None, the search will start from all
9849 top-level frames and dialog boxes; if non-None, the search will be
9850 limited to the given window hierarchy. The search is recursive in both
9851 cases.
9852
9853 If no window with such name is found, wx.FindWindowByLabel is called.
9854 """
9855 return _core_.FindWindowByName(*args, **kwargs)
9856
9857 def FindWindowByLabel(*args, **kwargs):
9858 """
9859 FindWindowByLabel(String label, Window parent=None) -> Window
9860
9861 Find a window by its label. Depending on the type of window, the label
9862 may be a window title or panel item label. If parent is None, the
9863 search will start from all top-level frames and dialog boxes; if
9864 non-None, the search will be limited to the given window
9865 hierarchy. The search is recursive in both cases.
9866 """
9867 return _core_.FindWindowByLabel(*args, **kwargs)
9868
9869 def Window_FromHWND(*args, **kwargs):
9870 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9871 return _core_.Window_FromHWND(*args, **kwargs)
9872
9873 def GetTopLevelWindows(*args):
9874 """
9875 GetTopLevelWindows() -> PyObject
9876
9877 Returns a list of the the application's top-level windows, (frames,
9878 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9879 by wxWidgets, and so it is only valid as long as no top-level windows
9880 are closed or new top-level windows are created.
9881
9882 """
9883 return _core_.GetTopLevelWindows(*args)
9884 #---------------------------------------------------------------------------
9885
9886 class Validator(EvtHandler):
9887 """Proxy of C++ Validator class"""
9888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9889 __repr__ = _swig_repr
9890 def __init__(self, *args, **kwargs):
9891 """__init__(self) -> Validator"""
9892 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9893 self._setOORInfo(self)
9894
9895 def Clone(*args, **kwargs):
9896 """Clone(self) -> Validator"""
9897 return _core_.Validator_Clone(*args, **kwargs)
9898
9899 def Validate(*args, **kwargs):
9900 """Validate(self, Window parent) -> bool"""
9901 return _core_.Validator_Validate(*args, **kwargs)
9902
9903 def TransferToWindow(*args, **kwargs):
9904 """TransferToWindow(self) -> bool"""
9905 return _core_.Validator_TransferToWindow(*args, **kwargs)
9906
9907 def TransferFromWindow(*args, **kwargs):
9908 """TransferFromWindow(self) -> bool"""
9909 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9910
9911 def GetWindow(*args, **kwargs):
9912 """GetWindow(self) -> Window"""
9913 return _core_.Validator_GetWindow(*args, **kwargs)
9914
9915 def SetWindow(*args, **kwargs):
9916 """SetWindow(self, Window window)"""
9917 return _core_.Validator_SetWindow(*args, **kwargs)
9918
9919 def IsSilent(*args, **kwargs):
9920 """IsSilent() -> bool"""
9921 return _core_.Validator_IsSilent(*args, **kwargs)
9922
9923 IsSilent = staticmethod(IsSilent)
9924 def SetBellOnError(*args, **kwargs):
9925 """SetBellOnError(int doIt=True)"""
9926 return _core_.Validator_SetBellOnError(*args, **kwargs)
9927
9928 SetBellOnError = staticmethod(SetBellOnError)
9929 _core_.Validator_swigregister(Validator)
9930
9931 def Validator_IsSilent(*args):
9932 """Validator_IsSilent() -> bool"""
9933 return _core_.Validator_IsSilent(*args)
9934
9935 def Validator_SetBellOnError(*args, **kwargs):
9936 """Validator_SetBellOnError(int doIt=True)"""
9937 return _core_.Validator_SetBellOnError(*args, **kwargs)
9938
9939 class PyValidator(Validator):
9940 """Proxy of C++ PyValidator class"""
9941 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9942 __repr__ = _swig_repr
9943 def __init__(self, *args, **kwargs):
9944 """__init__(self) -> PyValidator"""
9945 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
9946
9947 self._setCallbackInfo(self, PyValidator, 1)
9948 self._setOORInfo(self)
9949
9950 def _setCallbackInfo(*args, **kwargs):
9951 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9952 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9953
9954 _core_.PyValidator_swigregister(PyValidator)
9955
9956 #---------------------------------------------------------------------------
9957
9958 class Menu(EvtHandler):
9959 """Proxy of C++ Menu class"""
9960 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9961 __repr__ = _swig_repr
9962 def __init__(self, *args, **kwargs):
9963 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9964 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
9965 self._setOORInfo(self)
9966
9967 def Append(*args, **kwargs):
9968 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9969 return _core_.Menu_Append(*args, **kwargs)
9970
9971 def AppendSeparator(*args, **kwargs):
9972 """AppendSeparator(self) -> MenuItem"""
9973 return _core_.Menu_AppendSeparator(*args, **kwargs)
9974
9975 def AppendCheckItem(*args, **kwargs):
9976 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9977 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9978
9979 def AppendRadioItem(*args, **kwargs):
9980 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9981 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9982
9983 def AppendMenu(*args, **kwargs):
9984 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9985 return _core_.Menu_AppendMenu(*args, **kwargs)
9986
9987 def AppendSubMenu(*args, **kwargs):
9988 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9989 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9990
9991 def AppendItem(*args, **kwargs):
9992 """AppendItem(self, MenuItem item) -> MenuItem"""
9993 return _core_.Menu_AppendItem(*args, **kwargs)
9994
9995 def InsertItem(*args, **kwargs):
9996 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9997 return _core_.Menu_InsertItem(*args, **kwargs)
9998
9999 def PrependItem(*args, **kwargs):
10000 """PrependItem(self, MenuItem item) -> MenuItem"""
10001 return _core_.Menu_PrependItem(*args, **kwargs)
10002
10003 def Break(*args, **kwargs):
10004 """Break(self)"""
10005 return _core_.Menu_Break(*args, **kwargs)
10006
10007 def Insert(*args, **kwargs):
10008 """
10009 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10010 int kind=ITEM_NORMAL) -> MenuItem
10011 """
10012 return _core_.Menu_Insert(*args, **kwargs)
10013
10014 def InsertSeparator(*args, **kwargs):
10015 """InsertSeparator(self, size_t pos) -> MenuItem"""
10016 return _core_.Menu_InsertSeparator(*args, **kwargs)
10017
10018 def InsertCheckItem(*args, **kwargs):
10019 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10020 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10021
10022 def InsertRadioItem(*args, **kwargs):
10023 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10024 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10025
10026 def InsertMenu(*args, **kwargs):
10027 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10028 return _core_.Menu_InsertMenu(*args, **kwargs)
10029
10030 def Prepend(*args, **kwargs):
10031 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10032 return _core_.Menu_Prepend(*args, **kwargs)
10033
10034 def PrependSeparator(*args, **kwargs):
10035 """PrependSeparator(self) -> MenuItem"""
10036 return _core_.Menu_PrependSeparator(*args, **kwargs)
10037
10038 def PrependCheckItem(*args, **kwargs):
10039 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10040 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10041
10042 def PrependRadioItem(*args, **kwargs):
10043 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10044 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10045
10046 def PrependMenu(*args, **kwargs):
10047 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10048 return _core_.Menu_PrependMenu(*args, **kwargs)
10049
10050 def Remove(*args, **kwargs):
10051 """Remove(self, int id) -> MenuItem"""
10052 return _core_.Menu_Remove(*args, **kwargs)
10053
10054 def RemoveItem(*args, **kwargs):
10055 """RemoveItem(self, MenuItem item) -> MenuItem"""
10056 return _core_.Menu_RemoveItem(*args, **kwargs)
10057
10058 def Delete(*args, **kwargs):
10059 """Delete(self, int id) -> bool"""
10060 return _core_.Menu_Delete(*args, **kwargs)
10061
10062 def DeleteItem(*args, **kwargs):
10063 """DeleteItem(self, MenuItem item) -> bool"""
10064 return _core_.Menu_DeleteItem(*args, **kwargs)
10065
10066 def Destroy(*args, **kwargs):
10067 """
10068 Destroy(self)
10069
10070 Deletes the C++ object this Python object is a proxy for.
10071 """
10072 val = _core_.Menu_Destroy(*args, **kwargs)
10073 args[0].thisown = 0
10074 return val
10075
10076 def DestroyId(*args, **kwargs):
10077 """
10078 DestroyId(self, int id) -> bool
10079
10080 Deletes the C++ object this Python object is a proxy for.
10081 """
10082 val = _core_.Menu_DestroyId(*args, **kwargs)
10083 args[0].thisown = 0
10084 return val
10085
10086 def DestroyItem(*args, **kwargs):
10087 """
10088 DestroyItem(self, MenuItem item) -> bool
10089
10090 Deletes the C++ object this Python object is a proxy for.
10091 """
10092 val = _core_.Menu_DestroyItem(*args, **kwargs)
10093 args[0].thisown = 0
10094 return val
10095
10096 def GetMenuItemCount(*args, **kwargs):
10097 """GetMenuItemCount(self) -> size_t"""
10098 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10099
10100 def GetMenuItems(*args, **kwargs):
10101 """GetMenuItems(self) -> PyObject"""
10102 return _core_.Menu_GetMenuItems(*args, **kwargs)
10103
10104 def FindItem(*args, **kwargs):
10105 """FindItem(self, String item) -> int"""
10106 return _core_.Menu_FindItem(*args, **kwargs)
10107
10108 def FindItemById(*args, **kwargs):
10109 """FindItemById(self, int id) -> MenuItem"""
10110 return _core_.Menu_FindItemById(*args, **kwargs)
10111
10112 def FindItemByPosition(*args, **kwargs):
10113 """FindItemByPosition(self, size_t position) -> MenuItem"""
10114 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10115
10116 def Enable(*args, **kwargs):
10117 """Enable(self, int id, bool enable)"""
10118 return _core_.Menu_Enable(*args, **kwargs)
10119
10120 def IsEnabled(*args, **kwargs):
10121 """IsEnabled(self, int id) -> bool"""
10122 return _core_.Menu_IsEnabled(*args, **kwargs)
10123
10124 def Check(*args, **kwargs):
10125 """Check(self, int id, bool check)"""
10126 return _core_.Menu_Check(*args, **kwargs)
10127
10128 def IsChecked(*args, **kwargs):
10129 """IsChecked(self, int id) -> bool"""
10130 return _core_.Menu_IsChecked(*args, **kwargs)
10131
10132 def SetLabel(*args, **kwargs):
10133 """SetLabel(self, int id, String label)"""
10134 return _core_.Menu_SetLabel(*args, **kwargs)
10135
10136 def GetLabel(*args, **kwargs):
10137 """GetLabel(self, int id) -> String"""
10138 return _core_.Menu_GetLabel(*args, **kwargs)
10139
10140 def SetHelpString(*args, **kwargs):
10141 """SetHelpString(self, int id, String helpString)"""
10142 return _core_.Menu_SetHelpString(*args, **kwargs)
10143
10144 def GetHelpString(*args, **kwargs):
10145 """GetHelpString(self, int id) -> String"""
10146 return _core_.Menu_GetHelpString(*args, **kwargs)
10147
10148 def SetTitle(*args, **kwargs):
10149 """SetTitle(self, String title)"""
10150 return _core_.Menu_SetTitle(*args, **kwargs)
10151
10152 def GetTitle(*args, **kwargs):
10153 """GetTitle(self) -> String"""
10154 return _core_.Menu_GetTitle(*args, **kwargs)
10155
10156 def SetEventHandler(*args, **kwargs):
10157 """SetEventHandler(self, EvtHandler handler)"""
10158 return _core_.Menu_SetEventHandler(*args, **kwargs)
10159
10160 def GetEventHandler(*args, **kwargs):
10161 """GetEventHandler(self) -> EvtHandler"""
10162 return _core_.Menu_GetEventHandler(*args, **kwargs)
10163
10164 def SetInvokingWindow(*args, **kwargs):
10165 """SetInvokingWindow(self, Window win)"""
10166 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10167
10168 def GetInvokingWindow(*args, **kwargs):
10169 """GetInvokingWindow(self) -> Window"""
10170 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10171
10172 def GetStyle(*args, **kwargs):
10173 """GetStyle(self) -> long"""
10174 return _core_.Menu_GetStyle(*args, **kwargs)
10175
10176 def UpdateUI(*args, **kwargs):
10177 """UpdateUI(self, EvtHandler source=None)"""
10178 return _core_.Menu_UpdateUI(*args, **kwargs)
10179
10180 def GetMenuBar(*args, **kwargs):
10181 """GetMenuBar(self) -> MenuBar"""
10182 return _core_.Menu_GetMenuBar(*args, **kwargs)
10183
10184 def Attach(*args, **kwargs):
10185 """Attach(self, wxMenuBarBase menubar)"""
10186 return _core_.Menu_Attach(*args, **kwargs)
10187
10188 def Detach(*args, **kwargs):
10189 """Detach(self)"""
10190 return _core_.Menu_Detach(*args, **kwargs)
10191
10192 def IsAttached(*args, **kwargs):
10193 """IsAttached(self) -> bool"""
10194 return _core_.Menu_IsAttached(*args, **kwargs)
10195
10196 def SetParent(*args, **kwargs):
10197 """SetParent(self, Menu parent)"""
10198 return _core_.Menu_SetParent(*args, **kwargs)
10199
10200 def GetParent(*args, **kwargs):
10201 """GetParent(self) -> Menu"""
10202 return _core_.Menu_GetParent(*args, **kwargs)
10203
10204 _core_.Menu_swigregister(Menu)
10205 DefaultValidator = cvar.DefaultValidator
10206
10207 #---------------------------------------------------------------------------
10208
10209 class MenuBar(Window):
10210 """Proxy of C++ MenuBar class"""
10211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10212 __repr__ = _swig_repr
10213 def __init__(self, *args, **kwargs):
10214 """__init__(self, long style=0) -> MenuBar"""
10215 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10216 self._setOORInfo(self)
10217
10218 def Append(*args, **kwargs):
10219 """Append(self, Menu menu, String title) -> bool"""
10220 return _core_.MenuBar_Append(*args, **kwargs)
10221
10222 def Insert(*args, **kwargs):
10223 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10224 return _core_.MenuBar_Insert(*args, **kwargs)
10225
10226 def GetMenuCount(*args, **kwargs):
10227 """GetMenuCount(self) -> size_t"""
10228 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10229
10230 def GetMenu(*args, **kwargs):
10231 """GetMenu(self, size_t pos) -> Menu"""
10232 return _core_.MenuBar_GetMenu(*args, **kwargs)
10233
10234 def Replace(*args, **kwargs):
10235 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10236 return _core_.MenuBar_Replace(*args, **kwargs)
10237
10238 def Remove(*args, **kwargs):
10239 """Remove(self, size_t pos) -> Menu"""
10240 return _core_.MenuBar_Remove(*args, **kwargs)
10241
10242 def EnableTop(*args, **kwargs):
10243 """EnableTop(self, size_t pos, bool enable)"""
10244 return _core_.MenuBar_EnableTop(*args, **kwargs)
10245
10246 def IsEnabledTop(*args, **kwargs):
10247 """IsEnabledTop(self, size_t pos) -> bool"""
10248 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10249
10250 def SetLabelTop(*args, **kwargs):
10251 """SetLabelTop(self, size_t pos, String label)"""
10252 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10253
10254 def GetLabelTop(*args, **kwargs):
10255 """GetLabelTop(self, size_t pos) -> String"""
10256 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10257
10258 def FindMenuItem(*args, **kwargs):
10259 """FindMenuItem(self, String menu, String item) -> int"""
10260 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10261
10262 def FindItemById(*args, **kwargs):
10263 """FindItemById(self, int id) -> MenuItem"""
10264 return _core_.MenuBar_FindItemById(*args, **kwargs)
10265
10266 def FindMenu(*args, **kwargs):
10267 """FindMenu(self, String title) -> int"""
10268 return _core_.MenuBar_FindMenu(*args, **kwargs)
10269
10270 def Enable(*args, **kwargs):
10271 """Enable(self, int id, bool enable)"""
10272 return _core_.MenuBar_Enable(*args, **kwargs)
10273
10274 def Check(*args, **kwargs):
10275 """Check(self, int id, bool check)"""
10276 return _core_.MenuBar_Check(*args, **kwargs)
10277
10278 def IsChecked(*args, **kwargs):
10279 """IsChecked(self, int id) -> bool"""
10280 return _core_.MenuBar_IsChecked(*args, **kwargs)
10281
10282 def IsEnabled(*args, **kwargs):
10283 """IsEnabled(self, int id) -> bool"""
10284 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10285
10286 def SetLabel(*args, **kwargs):
10287 """SetLabel(self, int id, String label)"""
10288 return _core_.MenuBar_SetLabel(*args, **kwargs)
10289
10290 def GetLabel(*args, **kwargs):
10291 """GetLabel(self, int id) -> String"""
10292 return _core_.MenuBar_GetLabel(*args, **kwargs)
10293
10294 def SetHelpString(*args, **kwargs):
10295 """SetHelpString(self, int id, String helpString)"""
10296 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10297
10298 def GetHelpString(*args, **kwargs):
10299 """GetHelpString(self, int id) -> String"""
10300 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10301
10302 def GetFrame(*args, **kwargs):
10303 """GetFrame(self) -> wxFrame"""
10304 return _core_.MenuBar_GetFrame(*args, **kwargs)
10305
10306 def IsAttached(*args, **kwargs):
10307 """IsAttached(self) -> bool"""
10308 return _core_.MenuBar_IsAttached(*args, **kwargs)
10309
10310 def Attach(*args, **kwargs):
10311 """Attach(self, wxFrame frame)"""
10312 return _core_.MenuBar_Attach(*args, **kwargs)
10313
10314 def Detach(*args, **kwargs):
10315 """Detach(self)"""
10316 return _core_.MenuBar_Detach(*args, **kwargs)
10317
10318 def UpdateMenus(*args, **kwargs):
10319 """UpdateMenus(self)"""
10320 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10321
10322 def SetAutoWindowMenu(*args, **kwargs):
10323 """SetAutoWindowMenu(bool enable)"""
10324 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10325
10326 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10327 def GetAutoWindowMenu(*args, **kwargs):
10328 """GetAutoWindowMenu() -> bool"""
10329 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10330
10331 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10332 _core_.MenuBar_swigregister(MenuBar)
10333
10334 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10335 """MenuBar_SetAutoWindowMenu(bool enable)"""
10336 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10337
10338 def MenuBar_GetAutoWindowMenu(*args):
10339 """MenuBar_GetAutoWindowMenu() -> bool"""
10340 return _core_.MenuBar_GetAutoWindowMenu(*args)
10341
10342 #---------------------------------------------------------------------------
10343
10344 class MenuItem(Object):
10345 """Proxy of C++ MenuItem class"""
10346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10347 __repr__ = _swig_repr
10348 def __init__(self, *args, **kwargs):
10349 """
10350 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10351 String help=EmptyString, int kind=ITEM_NORMAL,
10352 Menu subMenu=None) -> MenuItem
10353 """
10354 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10355 __swig_destroy__ = _core_.delete_MenuItem
10356 __del__ = lambda self : None;
10357 def GetMenu(*args, **kwargs):
10358 """GetMenu(self) -> Menu"""
10359 return _core_.MenuItem_GetMenu(*args, **kwargs)
10360
10361 def SetMenu(*args, **kwargs):
10362 """SetMenu(self, Menu menu)"""
10363 return _core_.MenuItem_SetMenu(*args, **kwargs)
10364
10365 def SetId(*args, **kwargs):
10366 """SetId(self, int id)"""
10367 return _core_.MenuItem_SetId(*args, **kwargs)
10368
10369 def GetId(*args, **kwargs):
10370 """GetId(self) -> int"""
10371 return _core_.MenuItem_GetId(*args, **kwargs)
10372
10373 def IsSeparator(*args, **kwargs):
10374 """IsSeparator(self) -> bool"""
10375 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10376
10377 def SetText(*args, **kwargs):
10378 """SetText(self, String str)"""
10379 return _core_.MenuItem_SetText(*args, **kwargs)
10380
10381 def GetLabel(*args, **kwargs):
10382 """GetLabel(self) -> String"""
10383 return _core_.MenuItem_GetLabel(*args, **kwargs)
10384
10385 def GetText(*args, **kwargs):
10386 """GetText(self) -> String"""
10387 return _core_.MenuItem_GetText(*args, **kwargs)
10388
10389 def GetLabelFromText(*args, **kwargs):
10390 """GetLabelFromText(String text) -> String"""
10391 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10392
10393 GetLabelFromText = staticmethod(GetLabelFromText)
10394 def GetKind(*args, **kwargs):
10395 """GetKind(self) -> int"""
10396 return _core_.MenuItem_GetKind(*args, **kwargs)
10397
10398 def SetKind(*args, **kwargs):
10399 """SetKind(self, int kind)"""
10400 return _core_.MenuItem_SetKind(*args, **kwargs)
10401
10402 def SetCheckable(*args, **kwargs):
10403 """SetCheckable(self, bool checkable)"""
10404 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10405
10406 def IsCheckable(*args, **kwargs):
10407 """IsCheckable(self) -> bool"""
10408 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10409
10410 def IsSubMenu(*args, **kwargs):
10411 """IsSubMenu(self) -> bool"""
10412 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10413
10414 def SetSubMenu(*args, **kwargs):
10415 """SetSubMenu(self, Menu menu)"""
10416 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10417
10418 def GetSubMenu(*args, **kwargs):
10419 """GetSubMenu(self) -> Menu"""
10420 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10421
10422 def Enable(*args, **kwargs):
10423 """Enable(self, bool enable=True)"""
10424 return _core_.MenuItem_Enable(*args, **kwargs)
10425
10426 def IsEnabled(*args, **kwargs):
10427 """IsEnabled(self) -> bool"""
10428 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10429
10430 def Check(*args, **kwargs):
10431 """Check(self, bool check=True)"""
10432 return _core_.MenuItem_Check(*args, **kwargs)
10433
10434 def IsChecked(*args, **kwargs):
10435 """IsChecked(self) -> bool"""
10436 return _core_.MenuItem_IsChecked(*args, **kwargs)
10437
10438 def Toggle(*args, **kwargs):
10439 """Toggle(self)"""
10440 return _core_.MenuItem_Toggle(*args, **kwargs)
10441
10442 def SetHelp(*args, **kwargs):
10443 """SetHelp(self, String str)"""
10444 return _core_.MenuItem_SetHelp(*args, **kwargs)
10445
10446 def GetHelp(*args, **kwargs):
10447 """GetHelp(self) -> String"""
10448 return _core_.MenuItem_GetHelp(*args, **kwargs)
10449
10450 def GetAccel(*args, **kwargs):
10451 """GetAccel(self) -> AcceleratorEntry"""
10452 return _core_.MenuItem_GetAccel(*args, **kwargs)
10453
10454 def SetAccel(*args, **kwargs):
10455 """SetAccel(self, AcceleratorEntry accel)"""
10456 return _core_.MenuItem_SetAccel(*args, **kwargs)
10457
10458 def SetBitmap(*args, **kwargs):
10459 """SetBitmap(self, Bitmap bitmap)"""
10460 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10461
10462 def GetBitmap(*args, **kwargs):
10463 """GetBitmap(self) -> Bitmap"""
10464 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10465
10466 def SetFont(*args, **kwargs):
10467 """SetFont(self, Font font)"""
10468 return _core_.MenuItem_SetFont(*args, **kwargs)
10469
10470 def GetFont(*args, **kwargs):
10471 """GetFont(self) -> Font"""
10472 return _core_.MenuItem_GetFont(*args, **kwargs)
10473
10474 def SetTextColour(*args, **kwargs):
10475 """SetTextColour(self, Colour colText)"""
10476 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10477
10478 def GetTextColour(*args, **kwargs):
10479 """GetTextColour(self) -> Colour"""
10480 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10481
10482 def SetBackgroundColour(*args, **kwargs):
10483 """SetBackgroundColour(self, Colour colBack)"""
10484 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10485
10486 def GetBackgroundColour(*args, **kwargs):
10487 """GetBackgroundColour(self) -> Colour"""
10488 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10489
10490 def SetBitmaps(*args, **kwargs):
10491 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10492 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10493
10494 def SetDisabledBitmap(*args, **kwargs):
10495 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10496 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10497
10498 def GetDisabledBitmap(*args, **kwargs):
10499 """GetDisabledBitmap(self) -> Bitmap"""
10500 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10501
10502 def SetMarginWidth(*args, **kwargs):
10503 """SetMarginWidth(self, int nWidth)"""
10504 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10505
10506 def GetMarginWidth(*args, **kwargs):
10507 """GetMarginWidth(self) -> int"""
10508 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10509
10510 def GetDefaultMarginWidth(*args, **kwargs):
10511 """GetDefaultMarginWidth() -> int"""
10512 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10513
10514 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10515 def IsOwnerDrawn(*args, **kwargs):
10516 """IsOwnerDrawn(self) -> bool"""
10517 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10518
10519 def SetOwnerDrawn(*args, **kwargs):
10520 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10521 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10522
10523 def ResetOwnerDrawn(*args, **kwargs):
10524 """ResetOwnerDrawn(self)"""
10525 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10526
10527 _core_.MenuItem_swigregister(MenuItem)
10528
10529 def MenuItem_GetLabelFromText(*args, **kwargs):
10530 """MenuItem_GetLabelFromText(String text) -> String"""
10531 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10532
10533 def MenuItem_GetDefaultMarginWidth(*args):
10534 """MenuItem_GetDefaultMarginWidth() -> int"""
10535 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10536
10537 #---------------------------------------------------------------------------
10538
10539 class Control(Window):
10540 """
10541 This is the base class for a control or 'widget'.
10542
10543 A control is generally a small window which processes user input
10544 and/or displays one or more item of data.
10545 """
10546 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10547 __repr__ = _swig_repr
10548 def __init__(self, *args, **kwargs):
10549 """
10550 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10551 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10552 String name=ControlNameStr) -> Control
10553
10554 Create a Control. Normally you should only call this from a subclass'
10555 __init__ as a plain old wx.Control is not very useful.
10556 """
10557 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10558 self._setOORInfo(self)
10559
10560 def Create(*args, **kwargs):
10561 """
10562 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10563 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10564 String name=ControlNameStr) -> bool
10565
10566 Do the 2nd phase and create the GUI control.
10567 """
10568 return _core_.Control_Create(*args, **kwargs)
10569
10570 def GetAlignment(*args, **kwargs):
10571 """
10572 GetAlignment(self) -> int
10573
10574 Get the control alignment (left/right/centre, top/bottom/centre)
10575 """
10576 return _core_.Control_GetAlignment(*args, **kwargs)
10577
10578 def GetLabelText(*args, **kwargs):
10579 """
10580 GetLabelText(self) -> String
10581
10582 Get just the text of the label, without mnemonic characters ('&')
10583 """
10584 return _core_.Control_GetLabelText(*args, **kwargs)
10585
10586 def Command(*args, **kwargs):
10587 """
10588 Command(self, CommandEvent event)
10589
10590 Simulates the effect of the user issuing a command to the item.
10591
10592 :see: `wx.CommandEvent`
10593
10594 """
10595 return _core_.Control_Command(*args, **kwargs)
10596
10597 def GetLabel(*args, **kwargs):
10598 """
10599 GetLabel(self) -> String
10600
10601 Return a control's text.
10602 """
10603 return _core_.Control_GetLabel(*args, **kwargs)
10604
10605 def GetClassDefaultAttributes(*args, **kwargs):
10606 """
10607 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10608
10609 Get the default attributes for this class. This is useful if you want
10610 to use the same font or colour in your own control as in a standard
10611 control -- which is a much better idea than hard coding specific
10612 colours or fonts which might look completely out of place on the
10613 user's system, especially if it uses themes.
10614
10615 The variant parameter is only relevant under Mac currently and is
10616 ignore under other platforms. Under Mac, it will change the size of
10617 the returned font. See `wx.Window.SetWindowVariant` for more about
10618 this.
10619 """
10620 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10621
10622 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10623 _core_.Control_swigregister(Control)
10624 ControlNameStr = cvar.ControlNameStr
10625
10626 def PreControl(*args, **kwargs):
10627 """
10628 PreControl() -> Control
10629
10630 Precreate a Control control for 2-phase creation
10631 """
10632 val = _core_.new_PreControl(*args, **kwargs)
10633 return val
10634
10635 def Control_GetClassDefaultAttributes(*args, **kwargs):
10636 """
10637 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10638
10639 Get the default attributes for this class. This is useful if you want
10640 to use the same font or colour in your own control as in a standard
10641 control -- which is a much better idea than hard coding specific
10642 colours or fonts which might look completely out of place on the
10643 user's system, especially if it uses themes.
10644
10645 The variant parameter is only relevant under Mac currently and is
10646 ignore under other platforms. Under Mac, it will change the size of
10647 the returned font. See `wx.Window.SetWindowVariant` for more about
10648 this.
10649 """
10650 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10651
10652 #---------------------------------------------------------------------------
10653
10654 class ItemContainer(object):
10655 """
10656 The wx.ItemContainer class defines an interface which is implemented
10657 by all controls which have string subitems, each of which may be
10658 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10659 as `wx.ComboBox` which implements an extended interface deriving from
10660 this one.
10661
10662 It defines the methods for accessing the control's items and although
10663 each of the derived classes implements them differently, they still
10664 all conform to the same interface.
10665
10666 The items in a wx.ItemContainer have (non empty) string labels and,
10667 optionally, client data associated with them.
10668
10669 """
10670 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10671 def __init__(self): raise AttributeError, "No constructor defined"
10672 __repr__ = _swig_repr
10673 def Append(*args, **kwargs):
10674 """
10675 Append(self, String item, PyObject clientData=None) -> int
10676
10677 Adds the item to the control, associating the given data with the item
10678 if not None. The return value is the index of the newly added item
10679 which may be different from the last one if the control is sorted (e.g.
10680 has wx.LB_SORT or wx.CB_SORT style).
10681 """
10682 return _core_.ItemContainer_Append(*args, **kwargs)
10683
10684 def AppendItems(*args, **kwargs):
10685 """
10686 AppendItems(self, List strings)
10687
10688 Apend several items at once to the control. Notice that calling this
10689 method may be much faster than appending the items one by one if you
10690 need to add a lot of items.
10691 """
10692 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10693
10694 def Insert(*args, **kwargs):
10695 """
10696 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10697
10698 Insert an item into the control before the item at the ``pos`` index,
10699 optionally associating some data object with the item.
10700 """
10701 return _core_.ItemContainer_Insert(*args, **kwargs)
10702
10703 def Clear(*args, **kwargs):
10704 """
10705 Clear(self)
10706
10707 Removes all items from the control.
10708 """
10709 return _core_.ItemContainer_Clear(*args, **kwargs)
10710
10711 def Delete(*args, **kwargs):
10712 """
10713 Delete(self, unsigned int n)
10714
10715 Deletes the item at the zero-based index 'n' from the control. Note
10716 that it is an error (signalled by a `wx.PyAssertionError` exception if
10717 enabled) to remove an item with the index negative or greater or equal
10718 than the number of items in the control.
10719 """
10720 return _core_.ItemContainer_Delete(*args, **kwargs)
10721
10722 def GetClientData(*args, **kwargs):
10723 """
10724 GetClientData(self, unsigned int n) -> PyObject
10725
10726 Returns the client data associated with the given item, (if any.)
10727 """
10728 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10729
10730 def SetClientData(*args, **kwargs):
10731 """
10732 SetClientData(self, unsigned int n, PyObject clientData)
10733
10734 Associate the given client data with the item at position n.
10735 """
10736 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10737
10738 def GetCount(*args, **kwargs):
10739 """
10740 GetCount(self) -> unsigned int
10741
10742 Returns the number of items in the control.
10743 """
10744 return _core_.ItemContainer_GetCount(*args, **kwargs)
10745
10746 def IsEmpty(*args, **kwargs):
10747 """
10748 IsEmpty(self) -> bool
10749
10750 Returns True if the control is empty or False if it has some items.
10751 """
10752 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10753
10754 def GetString(*args, **kwargs):
10755 """
10756 GetString(self, unsigned int n) -> String
10757
10758 Returns the label of the item with the given index.
10759 """
10760 return _core_.ItemContainer_GetString(*args, **kwargs)
10761
10762 def GetStrings(*args, **kwargs):
10763 """GetStrings(self) -> wxArrayString"""
10764 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10765
10766 def SetString(*args, **kwargs):
10767 """
10768 SetString(self, unsigned int n, String s)
10769
10770 Sets the label for the given item.
10771 """
10772 return _core_.ItemContainer_SetString(*args, **kwargs)
10773
10774 def FindString(*args, **kwargs):
10775 """
10776 FindString(self, String s) -> int
10777
10778 Finds an item whose label matches the given string. Returns the
10779 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10780 found.
10781 """
10782 return _core_.ItemContainer_FindString(*args, **kwargs)
10783
10784 def SetSelection(*args, **kwargs):
10785 """
10786 SetSelection(self, int n)
10787
10788 Sets the item at index 'n' to be the selected item.
10789 """
10790 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10791
10792 def GetSelection(*args, **kwargs):
10793 """
10794 GetSelection(self) -> int
10795
10796 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10797 is selected.
10798 """
10799 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10800
10801 def SetStringSelection(*args, **kwargs):
10802 """SetStringSelection(self, String s) -> bool"""
10803 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10804
10805 def GetStringSelection(*args, **kwargs):
10806 """
10807 GetStringSelection(self) -> String
10808
10809 Returns the label of the selected item or an empty string if no item
10810 is selected.
10811 """
10812 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10813
10814 def Select(*args, **kwargs):
10815 """
10816 Select(self, int n)
10817
10818 This is the same as `SetSelection` and exists only because it is
10819 slightly more natural for controls which support multiple selection.
10820 """
10821 return _core_.ItemContainer_Select(*args, **kwargs)
10822
10823 _core_.ItemContainer_swigregister(ItemContainer)
10824
10825 #---------------------------------------------------------------------------
10826
10827 class ControlWithItems(Control,ItemContainer):
10828 """
10829 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10830 wx.Control class, and is used for the base class of various controls
10831 that have items.
10832 """
10833 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10834 def __init__(self): raise AttributeError, "No constructor defined"
10835 __repr__ = _swig_repr
10836 _core_.ControlWithItems_swigregister(ControlWithItems)
10837
10838 #---------------------------------------------------------------------------
10839
10840 class SizerItem(Object):
10841 """
10842 The wx.SizerItem class is used to track the position, size and other
10843 attributes of each item managed by a `wx.Sizer`. It is not usually
10844 necessary to use this class because the sizer elements can also be
10845 identified by their positions or window or sizer references but
10846 sometimes it may be more convenient to use wx.SizerItem directly.
10847 Also, custom classes derived from `wx.PySizer` will probably need to
10848 use the collection of wx.SizerItems held by wx.Sizer when calculating
10849 layout.
10850
10851 :see: `wx.Sizer`, `wx.GBSizerItem`
10852 """
10853 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10854 __repr__ = _swig_repr
10855 def __init__(self, *args, **kwargs):
10856 """
10857 __init__(self) -> SizerItem
10858
10859 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10860 size will need to be set before this item can be used in a Sizer.
10861
10862 You will probably never need to create a wx.SizerItem directly as they
10863 are created automatically when the sizer's Add, Insert or Prepend
10864 methods are called.
10865
10866 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10867 """
10868 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10869 __swig_destroy__ = _core_.delete_SizerItem
10870 __del__ = lambda self : None;
10871 def DeleteWindows(*args, **kwargs):
10872 """
10873 DeleteWindows(self)
10874
10875 Destroy the window or the windows in a subsizer, depending on the type
10876 of item.
10877 """
10878 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10879
10880 def DetachSizer(*args, **kwargs):
10881 """
10882 DetachSizer(self)
10883
10884 Enable deleting the SizerItem without destroying the contained sizer.
10885 """
10886 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10887
10888 def GetSize(*args, **kwargs):
10889 """
10890 GetSize(self) -> Size
10891
10892 Get the current size of the item, as set in the last Layout.
10893 """
10894 return _core_.SizerItem_GetSize(*args, **kwargs)
10895
10896 def CalcMin(*args, **kwargs):
10897 """
10898 CalcMin(self) -> Size
10899
10900 Calculates the minimum desired size for the item, including any space
10901 needed by borders.
10902 """
10903 return _core_.SizerItem_CalcMin(*args, **kwargs)
10904
10905 def SetDimension(*args, **kwargs):
10906 """
10907 SetDimension(self, Point pos, Size size)
10908
10909 Set the position and size of the space allocated for this item by the
10910 sizer, and adjust the position and size of the item (window or
10911 subsizer) to be within that space taking alignment and borders into
10912 account.
10913 """
10914 return _core_.SizerItem_SetDimension(*args, **kwargs)
10915
10916 def GetMinSize(*args, **kwargs):
10917 """
10918 GetMinSize(self) -> Size
10919
10920 Get the minimum size needed for the item.
10921 """
10922 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10923
10924 def GetMinSizeWithBorder(*args, **kwargs):
10925 """
10926 GetMinSizeWithBorder(self) -> Size
10927
10928 Get the minimum size needed for the item with space for the borders
10929 added, if needed.
10930 """
10931 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10932
10933 def SetInitSize(*args, **kwargs):
10934 """SetInitSize(self, int x, int y)"""
10935 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10936
10937 def SetRatioWH(*args, **kwargs):
10938 """
10939 SetRatioWH(self, int width, int height)
10940
10941 Set the ratio item attribute.
10942 """
10943 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10944
10945 def SetRatioSize(*args, **kwargs):
10946 """
10947 SetRatioSize(self, Size size)
10948
10949 Set the ratio item attribute.
10950 """
10951 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10952
10953 def SetRatio(*args, **kwargs):
10954 """
10955 SetRatio(self, float ratio)
10956
10957 Set the ratio item attribute.
10958 """
10959 return _core_.SizerItem_SetRatio(*args, **kwargs)
10960
10961 def GetRatio(*args, **kwargs):
10962 """
10963 GetRatio(self) -> float
10964
10965 Set the ratio item attribute.
10966 """
10967 return _core_.SizerItem_GetRatio(*args, **kwargs)
10968
10969 def GetRect(*args, **kwargs):
10970 """
10971 GetRect(self) -> Rect
10972
10973 Returns the rectangle that the sizer item should occupy
10974 """
10975 return _core_.SizerItem_GetRect(*args, **kwargs)
10976
10977 def IsWindow(*args, **kwargs):
10978 """
10979 IsWindow(self) -> bool
10980
10981 Is this sizer item a window?
10982 """
10983 return _core_.SizerItem_IsWindow(*args, **kwargs)
10984
10985 def IsSizer(*args, **kwargs):
10986 """
10987 IsSizer(self) -> bool
10988
10989 Is this sizer item a subsizer?
10990 """
10991 return _core_.SizerItem_IsSizer(*args, **kwargs)
10992
10993 def IsSpacer(*args, **kwargs):
10994 """
10995 IsSpacer(self) -> bool
10996
10997 Is this sizer item a spacer?
10998 """
10999 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11000
11001 def SetProportion(*args, **kwargs):
11002 """
11003 SetProportion(self, int proportion)
11004
11005 Set the proportion value for this item.
11006 """
11007 return _core_.SizerItem_SetProportion(*args, **kwargs)
11008
11009 def GetProportion(*args, **kwargs):
11010 """
11011 GetProportion(self) -> int
11012
11013 Get the proportion value for this item.
11014 """
11015 return _core_.SizerItem_GetProportion(*args, **kwargs)
11016
11017 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11018 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11019 def SetFlag(*args, **kwargs):
11020 """
11021 SetFlag(self, int flag)
11022
11023 Set the flag value for this item.
11024 """
11025 return _core_.SizerItem_SetFlag(*args, **kwargs)
11026
11027 def GetFlag(*args, **kwargs):
11028 """
11029 GetFlag(self) -> int
11030
11031 Get the flag value for this item.
11032 """
11033 return _core_.SizerItem_GetFlag(*args, **kwargs)
11034
11035 def SetBorder(*args, **kwargs):
11036 """
11037 SetBorder(self, int border)
11038
11039 Set the border value for this item.
11040 """
11041 return _core_.SizerItem_SetBorder(*args, **kwargs)
11042
11043 def GetBorder(*args, **kwargs):
11044 """
11045 GetBorder(self) -> int
11046
11047 Get the border value for this item.
11048 """
11049 return _core_.SizerItem_GetBorder(*args, **kwargs)
11050
11051 def GetWindow(*args, **kwargs):
11052 """
11053 GetWindow(self) -> Window
11054
11055 Get the window (if any) that is managed by this sizer item.
11056 """
11057 return _core_.SizerItem_GetWindow(*args, **kwargs)
11058
11059 def SetWindow(*args, **kwargs):
11060 """
11061 SetWindow(self, Window window)
11062
11063 Set the window to be managed by this sizer item.
11064 """
11065 return _core_.SizerItem_SetWindow(*args, **kwargs)
11066
11067 def GetSizer(*args, **kwargs):
11068 """
11069 GetSizer(self) -> Sizer
11070
11071 Get the subsizer (if any) that is managed by this sizer item.
11072 """
11073 return _core_.SizerItem_GetSizer(*args, **kwargs)
11074
11075 def SetSizer(*args, **kwargs):
11076 """
11077 SetSizer(self, Sizer sizer)
11078
11079 Set the subsizer to be managed by this sizer item.
11080 """
11081 return _core_.SizerItem_SetSizer(*args, **kwargs)
11082
11083 def GetSpacer(*args, **kwargs):
11084 """
11085 GetSpacer(self) -> Size
11086
11087 Get the size of the spacer managed by this sizer item.
11088 """
11089 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11090
11091 def SetSpacer(*args, **kwargs):
11092 """
11093 SetSpacer(self, Size size)
11094
11095 Set the size of the spacer to be managed by this sizer item.
11096 """
11097 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11098
11099 def Show(*args, **kwargs):
11100 """
11101 Show(self, bool show)
11102
11103 Set the show item attribute, which sizers use to determine if the item
11104 is to be made part of the layout or not. If the item is tracking a
11105 window then it is shown or hidden as needed.
11106 """
11107 return _core_.SizerItem_Show(*args, **kwargs)
11108
11109 def IsShown(*args, **kwargs):
11110 """
11111 IsShown(self) -> bool
11112
11113 Is the item to be shown in the layout?
11114 """
11115 return _core_.SizerItem_IsShown(*args, **kwargs)
11116
11117 def GetPosition(*args, **kwargs):
11118 """
11119 GetPosition(self) -> Point
11120
11121 Returns the current position of the item, as set in the last Layout.
11122 """
11123 return _core_.SizerItem_GetPosition(*args, **kwargs)
11124
11125 def GetUserData(*args, **kwargs):
11126 """
11127 GetUserData(self) -> PyObject
11128
11129 Returns the userData associated with this sizer item, or None if there
11130 isn't any.
11131 """
11132 return _core_.SizerItem_GetUserData(*args, **kwargs)
11133
11134 def SetUserData(*args, **kwargs):
11135 """
11136 SetUserData(self, PyObject userData)
11137
11138 Associate a Python object with this sizer item.
11139 """
11140 return _core_.SizerItem_SetUserData(*args, **kwargs)
11141
11142 _core_.SizerItem_swigregister(SizerItem)
11143
11144 def SizerItemWindow(*args, **kwargs):
11145 """
11146 SizerItemWindow(Window window, int proportion, int flag, int border,
11147 PyObject userData=None) -> SizerItem
11148
11149 Constructs a `wx.SizerItem` for tracking a window.
11150 """
11151 val = _core_.new_SizerItemWindow(*args, **kwargs)
11152 return val
11153
11154 def SizerItemSpacer(*args, **kwargs):
11155 """
11156 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11157 PyObject userData=None) -> SizerItem
11158
11159 Constructs a `wx.SizerItem` for tracking a spacer.
11160 """
11161 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11162 return val
11163
11164 def SizerItemSizer(*args, **kwargs):
11165 """
11166 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11167 PyObject userData=None) -> SizerItem
11168
11169 Constructs a `wx.SizerItem` for tracking a subsizer
11170 """
11171 val = _core_.new_SizerItemSizer(*args, **kwargs)
11172 return val
11173
11174 class Sizer(Object):
11175 """
11176 wx.Sizer is the abstract base class used for laying out subwindows in
11177 a window. You cannot use wx.Sizer directly; instead, you will have to
11178 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11179 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11180 `wx.GridBagSizer`.
11181
11182 The concept implemented by sizers in wxWidgets is closely related to
11183 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11184 toolkit or the Qt toolkit. It is based upon the idea of the individual
11185 subwindows reporting their minimal required size and their ability to
11186 get stretched if the size of the parent window has changed. This will
11187 most often mean that the programmer does not set the original size of
11188 a dialog in the beginning, rather the dialog will assigned a sizer and
11189 this sizer will be queried about the recommended size. The sizer in
11190 turn will query its children, which can be normal windows or contorls,
11191 empty space or other sizers, so that a hierarchy of sizers can be
11192 constructed. Note that wxSizer does not derive from wxWindow and thus
11193 do not interfere with tab ordering and requires very little resources
11194 compared to a real window on screen.
11195
11196 What makes sizers so well fitted for use in wxWidgets is the fact that
11197 every control reports its own minimal size and the algorithm can
11198 handle differences in font sizes or different window (dialog item)
11199 sizes on different platforms without problems. If for example the
11200 standard font as well as the overall design of Mac widgets requires
11201 more space than on Windows, then the initial size of a dialog using a
11202 sizer will automatically be bigger on Mac than on Windows.
11203 """
11204 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11205 def __init__(self): raise AttributeError, "No constructor defined"
11206 __repr__ = _swig_repr
11207 __swig_destroy__ = _core_.delete_Sizer
11208 __del__ = lambda self : None;
11209 def _setOORInfo(*args, **kwargs):
11210 """_setOORInfo(self, PyObject _self)"""
11211 return _core_.Sizer__setOORInfo(*args, **kwargs)
11212
11213 def Add(*args, **kwargs):
11214 """
11215 Add(self, item, int proportion=0, int flag=0, int border=0,
11216 PyObject userData=None) -> wx.SizerItem
11217
11218 Appends a child item to the sizer.
11219 """
11220 return _core_.Sizer_Add(*args, **kwargs)
11221
11222 def Insert(*args, **kwargs):
11223 """
11224 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11225 PyObject userData=None) -> wx.SizerItem
11226
11227 Inserts a new item into the list of items managed by this sizer before
11228 the item at index *before*. See `Add` for a description of the parameters.
11229 """
11230 return _core_.Sizer_Insert(*args, **kwargs)
11231
11232 def Prepend(*args, **kwargs):
11233 """
11234 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11235 PyObject userData=None) -> wx.SizerItem
11236
11237 Adds a new item to the begining of the list of sizer items managed by
11238 this sizer. See `Add` for a description of the parameters.
11239 """
11240 return _core_.Sizer_Prepend(*args, **kwargs)
11241
11242 def Remove(*args, **kwargs):
11243 """
11244 Remove(self, item) -> bool
11245
11246 Removes an item from the sizer and destroys it. This method does not
11247 cause any layout or resizing to take place, call `Layout` to update
11248 the layout on screen after removing a child from the sizer. The
11249 *item* parameter can be either a window, a sizer, or the zero-based
11250 index of an item to remove. Returns True if the child item was found
11251 and removed.
11252 """
11253 return _core_.Sizer_Remove(*args, **kwargs)
11254
11255 def Detach(*args, **kwargs):
11256 """
11257 Detach(self, item) -> bool
11258
11259 Detaches an item from the sizer without destroying it. This method
11260 does not cause any layout or resizing to take place, call `Layout` to
11261 do so. The *item* parameter can be either a window, a sizer, or the
11262 zero-based index of the item to be detached. Returns True if the child item
11263 was found and detached.
11264 """
11265 return _core_.Sizer_Detach(*args, **kwargs)
11266
11267 def GetItem(*args, **kwargs):
11268 """
11269 GetItem(self, item) -> wx.SizerItem
11270
11271 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11272 parameter can be either a window, a sizer, or the zero-based index of
11273 the item to be found.
11274 """
11275 return _core_.Sizer_GetItem(*args, **kwargs)
11276
11277 def _SetItemMinSize(*args, **kwargs):
11278 """_SetItemMinSize(self, PyObject item, Size size)"""
11279 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11280
11281 def SetItemMinSize(self, item, *args):
11282 """
11283 SetItemMinSize(self, item, Size size)
11284
11285 Sets the minimum size that will be allocated for an item in the sizer.
11286 The *item* parameter can be either a window, a sizer, or the
11287 zero-based index of the item. If a window or sizer is given then it
11288 will be searched for recursivly in subsizers if neccessary.
11289 """
11290 if len(args) == 2:
11291 # for backward compatibility accept separate width,height args too
11292 return self._SetItemMinSize(item, args)
11293 else:
11294 return self._SetItemMinSize(item, args[0])
11295
11296 def AddItem(*args, **kwargs):
11297 """
11298 AddItem(self, SizerItem item)
11299
11300 Adds a `wx.SizerItem` to the sizer.
11301 """
11302 return _core_.Sizer_AddItem(*args, **kwargs)
11303
11304 def InsertItem(*args, **kwargs):
11305 """
11306 InsertItem(self, int index, SizerItem item)
11307
11308 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11309 """
11310 return _core_.Sizer_InsertItem(*args, **kwargs)
11311
11312 def PrependItem(*args, **kwargs):
11313 """
11314 PrependItem(self, SizerItem item)
11315
11316 Prepends a `wx.SizerItem` to the sizer.
11317 """
11318 return _core_.Sizer_PrependItem(*args, **kwargs)
11319
11320 def AddMany(self, items):
11321 """
11322 AddMany is a convenience method for adding several items
11323 to a sizer at one time. Simply pass it a list of tuples,
11324 where each tuple consists of the parameters that you
11325 would normally pass to the `Add` method.
11326 """
11327 for item in items:
11328 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11329 item = (item, )
11330 self.Add(*item)
11331
11332 # for backwards compatibility only, please do not use in new code
11333 def AddWindow(self, *args, **kw):
11334 """Compatibility alias for `Add`."""
11335 return self.Add(*args, **kw)
11336 def AddSizer(self, *args, **kw):
11337 """Compatibility alias for `Add`."""
11338 return self.Add(*args, **kw)
11339 def AddSpacer(self, *args, **kw):
11340 """Compatibility alias for `Add`."""
11341 return self.Add(*args, **kw)
11342
11343 def PrependWindow(self, *args, **kw):
11344 """Compatibility alias for `Prepend`."""
11345 return self.Prepend(*args, **kw)
11346 def PrependSizer(self, *args, **kw):
11347 """Compatibility alias for `Prepend`."""
11348 return self.Prepend(*args, **kw)
11349 def PrependSpacer(self, *args, **kw):
11350 """Compatibility alias for `Prepend`."""
11351 return self.Prepend(*args, **kw)
11352
11353 def InsertWindow(self, *args, **kw):
11354 """Compatibility alias for `Insert`."""
11355 return self.Insert(*args, **kw)
11356 def InsertSizer(self, *args, **kw):
11357 """Compatibility alias for `Insert`."""
11358 return self.Insert(*args, **kw)
11359 def InsertSpacer(self, *args, **kw):
11360 """Compatibility alias for `Insert`."""
11361 return self.Insert(*args, **kw)
11362
11363 def RemoveWindow(self, *args, **kw):
11364 """Compatibility alias for `Remove`."""
11365 return self.Remove(*args, **kw)
11366 def RemoveSizer(self, *args, **kw):
11367 """Compatibility alias for `Remove`."""
11368 return self.Remove(*args, **kw)
11369 def RemovePos(self, *args, **kw):
11370 """Compatibility alias for `Remove`."""
11371 return self.Remove(*args, **kw)
11372
11373
11374 def SetDimension(*args, **kwargs):
11375 """
11376 SetDimension(self, int x, int y, int width, int height)
11377
11378 Call this to force the sizer to take the given dimension and thus
11379 force the items owned by the sizer to resize themselves according to
11380 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11381 methods.
11382 """
11383 return _core_.Sizer_SetDimension(*args, **kwargs)
11384
11385 def SetMinSize(*args, **kwargs):
11386 """
11387 SetMinSize(self, Size size)
11388
11389 Call this to give the sizer a minimal size. Normally, the sizer will
11390 calculate its minimal size based purely on how much space its children
11391 need. After calling this method `GetMinSize` will return either the
11392 minimal size as requested by its children or the minimal size set
11393 here, depending on which is bigger.
11394 """
11395 return _core_.Sizer_SetMinSize(*args, **kwargs)
11396
11397 def GetSize(*args, **kwargs):
11398 """
11399 GetSize(self) -> Size
11400
11401 Returns the current size of the space managed by the sizer.
11402 """
11403 return _core_.Sizer_GetSize(*args, **kwargs)
11404
11405 def GetPosition(*args, **kwargs):
11406 """
11407 GetPosition(self) -> Point
11408
11409 Returns the current position of the sizer's managed space.
11410 """
11411 return _core_.Sizer_GetPosition(*args, **kwargs)
11412
11413 def GetMinSize(*args, **kwargs):
11414 """
11415 GetMinSize(self) -> Size
11416
11417 Returns the minimal size of the sizer. This is either the combined
11418 minimal size of all the children and their borders or the minimal size
11419 set by SetMinSize, depending on which is bigger.
11420 """
11421 return _core_.Sizer_GetMinSize(*args, **kwargs)
11422
11423 def GetSizeTuple(self):
11424 return self.GetSize().Get()
11425 def GetPositionTuple(self):
11426 return self.GetPosition().Get()
11427 def GetMinSizeTuple(self):
11428 return self.GetMinSize().Get()
11429
11430 def RecalcSizes(*args, **kwargs):
11431 """
11432 RecalcSizes(self)
11433
11434 Using the sizes calculated by `CalcMin` reposition and resize all the
11435 items managed by this sizer. You should not need to call this directly as
11436 it is called by `Layout`.
11437 """
11438 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11439
11440 def CalcMin(*args, **kwargs):
11441 """
11442 CalcMin(self) -> Size
11443
11444 This method is where the sizer will do the actual calculation of its
11445 children's minimal sizes. You should not need to call this directly as
11446 it is called by `Layout`.
11447 """
11448 return _core_.Sizer_CalcMin(*args, **kwargs)
11449
11450 def Layout(*args, **kwargs):
11451 """
11452 Layout(self)
11453
11454 This method will force the recalculation and layout of the items
11455 controlled by the sizer using the current space allocated to the
11456 sizer. Normally this is called automatically from the owning window's
11457 EVT_SIZE handler, but it is also useful to call it from user code when
11458 one of the items in a sizer change size, or items are added or
11459 removed.
11460 """
11461 return _core_.Sizer_Layout(*args, **kwargs)
11462
11463 def Fit(*args, **kwargs):
11464 """
11465 Fit(self, Window window) -> Size
11466
11467 Tell the sizer to resize the *window* to match the sizer's minimal
11468 size. This is commonly done in the constructor of the window itself in
11469 order to set its initial size to match the needs of the children as
11470 determined by the sizer. Returns the new size.
11471
11472 For a top level window this is the total window size, not the client size.
11473 """
11474 return _core_.Sizer_Fit(*args, **kwargs)
11475
11476 def FitInside(*args, **kwargs):
11477 """
11478 FitInside(self, Window window)
11479
11480 Tell the sizer to resize the *virtual size* of the *window* to match the
11481 sizer's minimal size. This will not alter the on screen size of the
11482 window, but may cause the addition/removal/alteration of scrollbars
11483 required to view the virtual area in windows which manage it.
11484
11485 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11486
11487 """
11488 return _core_.Sizer_FitInside(*args, **kwargs)
11489
11490 def SetSizeHints(*args, **kwargs):
11491 """
11492 SetSizeHints(self, Window window)
11493
11494 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11495 match the sizer's minimal size. This is commonly done in the
11496 constructor of the window itself if the window is resizable (as are
11497 many dialogs under Unix and frames on probably all platforms) in order
11498 to prevent the window from being sized smaller than the minimal size
11499 required by the sizer.
11500 """
11501 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11502
11503 def SetVirtualSizeHints(*args, **kwargs):
11504 """
11505 SetVirtualSizeHints(self, Window window)
11506
11507 Tell the sizer to set the minimal size of the window virtual area to
11508 match the sizer's minimal size. For windows with managed scrollbars
11509 this will set them appropriately.
11510
11511 :see: `wx.ScrolledWindow.SetScrollbars`
11512
11513 """
11514 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11515
11516 def Clear(*args, **kwargs):
11517 """
11518 Clear(self, bool deleteWindows=False)
11519
11520 Clear all items from the sizer, optionally destroying the window items
11521 as well.
11522 """
11523 return _core_.Sizer_Clear(*args, **kwargs)
11524
11525 def DeleteWindows(*args, **kwargs):
11526 """
11527 DeleteWindows(self)
11528
11529 Destroy all windows managed by the sizer.
11530 """
11531 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11532
11533 def GetChildren(*args, **kwargs):
11534 """
11535 GetChildren(self) -> list
11536
11537 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11538 """
11539 return _core_.Sizer_GetChildren(*args, **kwargs)
11540
11541 def Show(*args, **kwargs):
11542 """
11543 Show(self, item, bool show=True, bool recursive=false) -> bool
11544
11545 Shows or hides an item managed by the sizer. To make a sizer item
11546 disappear or reappear, use Show followed by `Layout`. The *item*
11547 parameter can be either a window, a sizer, or the zero-based index of
11548 the item. Use the recursive parameter to show or hide an item in a
11549 subsizer. Returns True if the item was found.
11550 """
11551 return _core_.Sizer_Show(*args, **kwargs)
11552
11553 def IsShown(*args, **kwargs):
11554 """
11555 IsShown(self, item)
11556
11557 Determines if the item is currently shown. To make a sizer
11558 item disappear or reappear, use Show followed by `Layout`. The *item*
11559 parameter can be either a window, a sizer, or the zero-based index of
11560 the item.
11561 """
11562 return _core_.Sizer_IsShown(*args, **kwargs)
11563
11564 def Hide(self, item, recursive=False):
11565 """
11566 A convenience method for `Show` (item, False, recursive).
11567 """
11568 return self.Show(item, False, recursive)
11569
11570 def ShowItems(*args, **kwargs):
11571 """
11572 ShowItems(self, bool show)
11573
11574 Recursively call `wx.SizerItem.Show` on all sizer items.
11575 """
11576 return _core_.Sizer_ShowItems(*args, **kwargs)
11577
11578 _core_.Sizer_swigregister(Sizer)
11579
11580 class PySizer(Sizer):
11581 """
11582 wx.PySizer is a special version of `wx.Sizer` that has been
11583 instrumented to allow the C++ virtual methods to be overloaded in
11584 Python derived classes. You would derive from this class if you are
11585 wanting to implement a custom sizer in Python code. Simply implement
11586 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11587 For example::
11588
11589 class MySizer(wx.PySizer):
11590 def __init__(self):
11591 wx.PySizer.__init__(self)
11592
11593 def CalcMin(self):
11594 for item in self.GetChildren():
11595 # calculate the total minimum width and height needed
11596 # by all items in the sizer according to this sizer's
11597 # layout algorithm.
11598 ...
11599 return wx.Size(width, height)
11600
11601 def RecalcSizes(self):
11602 # find the space allotted to this sizer
11603 pos = self.GetPosition()
11604 size = self.GetSize()
11605 for item in self.GetChildren():
11606 # Recalculate (if necessary) the position and size of
11607 # each item and then call item.SetDimension to do the
11608 # actual positioning and sizing of the items within the
11609 # space alloted to this sizer.
11610 ...
11611 item.SetDimension(itemPos, itemSize)
11612
11613
11614 When `Layout` is called it first calls `CalcMin` followed by
11615 `RecalcSizes` so you can optimize a bit by saving the results of
11616 `CalcMin` and reusing them in `RecalcSizes`.
11617
11618 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11619
11620
11621 """
11622 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11623 __repr__ = _swig_repr
11624 def __init__(self, *args, **kwargs):
11625 """
11626 __init__(self) -> PySizer
11627
11628 Creates a wx.PySizer. Must be called from the __init__ in the derived
11629 class.
11630 """
11631 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11632 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11633
11634 def _setCallbackInfo(*args, **kwargs):
11635 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11636 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11637
11638 _core_.PySizer_swigregister(PySizer)
11639
11640 #---------------------------------------------------------------------------
11641
11642 class BoxSizer(Sizer):
11643 """
11644 The basic idea behind a box sizer is that windows will most often be
11645 laid out in rather simple basic geometry, typically in a row or a
11646 column or nested hierarchies of either. A wx.BoxSizer will lay out
11647 its items in a simple row or column, depending on the orientation
11648 parameter passed to the constructor.
11649 """
11650 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11651 __repr__ = _swig_repr
11652 def __init__(self, *args, **kwargs):
11653 """
11654 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11655
11656 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11657 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11658 sizer.
11659 """
11660 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11661 self._setOORInfo(self)
11662
11663 def GetOrientation(*args, **kwargs):
11664 """
11665 GetOrientation(self) -> int
11666
11667 Returns the current orientation of the sizer.
11668 """
11669 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11670
11671 def SetOrientation(*args, **kwargs):
11672 """
11673 SetOrientation(self, int orient)
11674
11675 Resets the orientation of the sizer.
11676 """
11677 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11678
11679 _core_.BoxSizer_swigregister(BoxSizer)
11680
11681 #---------------------------------------------------------------------------
11682
11683 class StaticBoxSizer(BoxSizer):
11684 """
11685 wx.StaticBoxSizer derives from and functions identically to the
11686 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11687 manages. Note that this static box must be created separately and
11688 passed to the sizer constructor.
11689 """
11690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11691 __repr__ = _swig_repr
11692 def __init__(self, *args, **kwargs):
11693 """
11694 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11695
11696 Constructor. It takes an associated static box and the orientation
11697 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11698 ``wx.HORIZONTAL``.
11699 """
11700 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11701 self._setOORInfo(self)
11702
11703 def GetStaticBox(*args, **kwargs):
11704 """
11705 GetStaticBox(self) -> StaticBox
11706
11707 Returns the static box associated with this sizer.
11708 """
11709 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11710
11711 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11712
11713 #---------------------------------------------------------------------------
11714
11715 class GridSizer(Sizer):
11716 """
11717 A grid sizer is a sizer which lays out its children in a
11718 two-dimensional table with all cells having the same size. In other
11719 words, the width of each cell within the grid is the width of the
11720 widest item added to the sizer and the height of each grid cell is the
11721 height of the tallest item. An optional vertical and/or horizontal
11722 gap between items can also be specified (in pixels.)
11723
11724 Items are placed in the cells of the grid in the order they are added,
11725 in row-major order. In other words, the first row is filled first,
11726 then the second, and so on until all items have been added. (If
11727 neccessary, additional rows will be added as items are added.) If you
11728 need to have greater control over the cells that items are placed in
11729 then use the `wx.GridBagSizer`.
11730
11731 """
11732 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11733 __repr__ = _swig_repr
11734 def __init__(self, *args, **kwargs):
11735 """
11736 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11737
11738 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11739 of columns and rows in the sizer - if either of the parameters is
11740 zero, it will be calculated to from the total number of children in
11741 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11742 define extra space between all children.
11743 """
11744 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11745 self._setOORInfo(self)
11746
11747 def SetCols(*args, **kwargs):
11748 """
11749 SetCols(self, int cols)
11750
11751 Sets the number of columns in the sizer.
11752 """
11753 return _core_.GridSizer_SetCols(*args, **kwargs)
11754
11755 def SetRows(*args, **kwargs):
11756 """
11757 SetRows(self, int rows)
11758
11759 Sets the number of rows in the sizer.
11760 """
11761 return _core_.GridSizer_SetRows(*args, **kwargs)
11762
11763 def SetVGap(*args, **kwargs):
11764 """
11765 SetVGap(self, int gap)
11766
11767 Sets the vertical gap (in pixels) between the cells in the sizer.
11768 """
11769 return _core_.GridSizer_SetVGap(*args, **kwargs)
11770
11771 def SetHGap(*args, **kwargs):
11772 """
11773 SetHGap(self, int gap)
11774
11775 Sets the horizontal gap (in pixels) between cells in the sizer
11776 """
11777 return _core_.GridSizer_SetHGap(*args, **kwargs)
11778
11779 def GetCols(*args, **kwargs):
11780 """
11781 GetCols(self) -> int
11782
11783 Returns the number of columns in the sizer.
11784 """
11785 return _core_.GridSizer_GetCols(*args, **kwargs)
11786
11787 def GetRows(*args, **kwargs):
11788 """
11789 GetRows(self) -> int
11790
11791 Returns the number of rows in the sizer.
11792 """
11793 return _core_.GridSizer_GetRows(*args, **kwargs)
11794
11795 def GetVGap(*args, **kwargs):
11796 """
11797 GetVGap(self) -> int
11798
11799 Returns the vertical gap (in pixels) between the cells in the sizer.
11800 """
11801 return _core_.GridSizer_GetVGap(*args, **kwargs)
11802
11803 def GetHGap(*args, **kwargs):
11804 """
11805 GetHGap(self) -> int
11806
11807 Returns the horizontal gap (in pixels) between cells in the sizer.
11808 """
11809 return _core_.GridSizer_GetHGap(*args, **kwargs)
11810
11811 def CalcRowsCols(self):
11812 """
11813 CalcRowsCols() -> (rows, cols)
11814
11815 Calculates how many rows and columns will be in the sizer based
11816 on the current number of items and also the rows, cols specified
11817 in the constructor.
11818 """
11819 nitems = len(self.GetChildren())
11820 rows = self.GetRows()
11821 cols = self.GetCols()
11822 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11823 if cols != 0:
11824 rows = (nitems + cols - 1) / cols
11825 elif rows != 0:
11826 cols = (nitems + rows - 1) / rows
11827 return (rows, cols)
11828
11829 _core_.GridSizer_swigregister(GridSizer)
11830
11831 #---------------------------------------------------------------------------
11832
11833 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11834 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11835 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11836 class FlexGridSizer(GridSizer):
11837 """
11838 A flex grid sizer is a sizer which lays out its children in a
11839 two-dimensional table with all table cells in one row having the same
11840 height and all cells in one column having the same width, but all
11841 rows or all columns are not necessarily the same height or width as in
11842 the `wx.GridSizer`.
11843
11844 wx.FlexGridSizer can also size items equally in one direction but
11845 unequally ("flexibly") in the other. If the sizer is only flexible
11846 in one direction (this can be changed using `SetFlexibleDirection`), it
11847 needs to be decided how the sizer should grow in the other ("non
11848 flexible") direction in order to fill the available space. The
11849 `SetNonFlexibleGrowMode` method serves this purpose.
11850
11851
11852 """
11853 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11854 __repr__ = _swig_repr
11855 def __init__(self, *args, **kwargs):
11856 """
11857 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11858
11859 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11860 number of columns and rows in the sizer - if either of the parameters
11861 is zero, it will be calculated to from the total number of children in
11862 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11863 define extra space between all children.
11864 """
11865 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11866 self._setOORInfo(self)
11867
11868 def AddGrowableRow(*args, **kwargs):
11869 """
11870 AddGrowableRow(self, size_t idx, int proportion=0)
11871
11872 Specifies that row *idx* (starting from zero) should be grown if there
11873 is extra space available to the sizer.
11874
11875 The *proportion* parameter has the same meaning as the stretch factor
11876 for the box sizers except that if all proportions are 0, then all
11877 columns are resized equally (instead of not being resized at all).
11878 """
11879 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11880
11881 def RemoveGrowableRow(*args, **kwargs):
11882 """
11883 RemoveGrowableRow(self, size_t idx)
11884
11885 Specifies that row *idx* is no longer growable.
11886 """
11887 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11888
11889 def AddGrowableCol(*args, **kwargs):
11890 """
11891 AddGrowableCol(self, size_t idx, int proportion=0)
11892
11893 Specifies that column *idx* (starting from zero) should be grown if
11894 there is extra space available to the sizer.
11895
11896 The *proportion* parameter has the same meaning as the stretch factor
11897 for the box sizers except that if all proportions are 0, then all
11898 columns are resized equally (instead of not being resized at all).
11899 """
11900 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11901
11902 def RemoveGrowableCol(*args, **kwargs):
11903 """
11904 RemoveGrowableCol(self, size_t idx)
11905
11906 Specifies that column *idx* is no longer growable.
11907 """
11908 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11909
11910 def SetFlexibleDirection(*args, **kwargs):
11911 """
11912 SetFlexibleDirection(self, int direction)
11913
11914 Specifies whether the sizer should flexibly resize its columns, rows,
11915 or both. Argument *direction* can be one of the following values. Any
11916 other value is ignored.
11917
11918 ============== =======================================
11919 wx.VERTICAL Rows are flexibly sized.
11920 wx.HORIZONTAL Columns are flexibly sized.
11921 wx.BOTH Both rows and columns are flexibly sized
11922 (this is the default value).
11923 ============== =======================================
11924
11925 Note that this method does not trigger relayout.
11926
11927 """
11928 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11929
11930 def GetFlexibleDirection(*args, **kwargs):
11931 """
11932 GetFlexibleDirection(self) -> int
11933
11934 Returns a value that specifies whether the sizer
11935 flexibly resizes its columns, rows, or both (default).
11936
11937 :see: `SetFlexibleDirection`
11938 """
11939 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11940
11941 def SetNonFlexibleGrowMode(*args, **kwargs):
11942 """
11943 SetNonFlexibleGrowMode(self, int mode)
11944
11945 Specifies how the sizer should grow in the non-flexible direction if
11946 there is one (so `SetFlexibleDirection` must have been called
11947 previously). Argument *mode* can be one of the following values:
11948
11949 ========================== =================================================
11950 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11951 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11952 `AddGrowableCol` and `AddGrowableRow`. In this
11953 case equal sizing applies to minimum sizes of
11954 columns or rows (this is the default value).
11955 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11956 the non flexible direction, whether they are
11957 growable or not in the flexbile direction.
11958 ========================== =================================================
11959
11960 Note that this method does not trigger relayout.
11961
11962
11963 """
11964 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11965
11966 def GetNonFlexibleGrowMode(*args, **kwargs):
11967 """
11968 GetNonFlexibleGrowMode(self) -> int
11969
11970 Returns the value that specifies how the sizer grows in the
11971 non-flexible direction if there is one.
11972
11973 :see: `SetNonFlexibleGrowMode`
11974 """
11975 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11976
11977 def GetRowHeights(*args, **kwargs):
11978 """
11979 GetRowHeights(self) -> list
11980
11981 Returns a list of integers representing the heights of each of the
11982 rows in the sizer.
11983 """
11984 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11985
11986 def GetColWidths(*args, **kwargs):
11987 """
11988 GetColWidths(self) -> list
11989
11990 Returns a list of integers representing the widths of each of the
11991 columns in the sizer.
11992 """
11993 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11994
11995 _core_.FlexGridSizer_swigregister(FlexGridSizer)
11996
11997 class StdDialogButtonSizer(BoxSizer):
11998 """
11999 A special sizer that knows how to order and position standard buttons
12000 in order to conform to the current platform's standards. You simply
12001 need to add each `wx.Button` to the sizer, and be sure to create the
12002 buttons using the standard ID's. Then call `Realize` and the sizer
12003 will take care of the rest.
12004
12005 """
12006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12007 __repr__ = _swig_repr
12008 def __init__(self, *args, **kwargs):
12009 """__init__(self) -> StdDialogButtonSizer"""
12010 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12011 def AddButton(*args, **kwargs):
12012 """
12013 AddButton(self, wxButton button)
12014
12015 Use this to add the buttons to this sizer. Do not use the `Add`
12016 method in the base class.
12017 """
12018 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12019
12020 def Realize(*args, **kwargs):
12021 """
12022 Realize(self)
12023
12024 This funciton needs to be called after all the buttons have been added
12025 to the sizer. It will reorder them and position them in a platform
12026 specifc manner.
12027 """
12028 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12029
12030 def SetAffirmativeButton(*args, **kwargs):
12031 """SetAffirmativeButton(self, wxButton button)"""
12032 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12033
12034 def SetNegativeButton(*args, **kwargs):
12035 """SetNegativeButton(self, wxButton button)"""
12036 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12037
12038 def SetCancelButton(*args, **kwargs):
12039 """SetCancelButton(self, wxButton button)"""
12040 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12041
12042 def GetAffirmativeButton(*args, **kwargs):
12043 """GetAffirmativeButton(self) -> wxButton"""
12044 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12045
12046 def GetApplyButton(*args, **kwargs):
12047 """GetApplyButton(self) -> wxButton"""
12048 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12049
12050 def GetNegativeButton(*args, **kwargs):
12051 """GetNegativeButton(self) -> wxButton"""
12052 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12053
12054 def GetCancelButton(*args, **kwargs):
12055 """GetCancelButton(self) -> wxButton"""
12056 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12057
12058 def GetHelpButton(*args, **kwargs):
12059 """GetHelpButton(self) -> wxButton"""
12060 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12061
12062 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12063
12064 #---------------------------------------------------------------------------
12065
12066 class GBPosition(object):
12067 """
12068 This class represents the position of an item in a virtual grid of
12069 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12070 typemaps that will automatically convert from a 2-element sequence of
12071 integers to a wx.GBPosition, so you can use the more pythonic
12072 representation of the position nearly transparently in Python code.
12073 """
12074 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12075 __repr__ = _swig_repr
12076 def __init__(self, *args, **kwargs):
12077 """
12078 __init__(self, int row=0, int col=0) -> GBPosition
12079
12080 This class represents the position of an item in a virtual grid of
12081 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12082 typemaps that will automatically convert from a 2-element sequence of
12083 integers to a wx.GBPosition, so you can use the more pythonic
12084 representation of the position nearly transparently in Python code.
12085 """
12086 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12087 __swig_destroy__ = _core_.delete_GBPosition
12088 __del__ = lambda self : None;
12089 def GetRow(*args, **kwargs):
12090 """GetRow(self) -> int"""
12091 return _core_.GBPosition_GetRow(*args, **kwargs)
12092
12093 def GetCol(*args, **kwargs):
12094 """GetCol(self) -> int"""
12095 return _core_.GBPosition_GetCol(*args, **kwargs)
12096
12097 def SetRow(*args, **kwargs):
12098 """SetRow(self, int row)"""
12099 return _core_.GBPosition_SetRow(*args, **kwargs)
12100
12101 def SetCol(*args, **kwargs):
12102 """SetCol(self, int col)"""
12103 return _core_.GBPosition_SetCol(*args, **kwargs)
12104
12105 def __eq__(*args, **kwargs):
12106 """
12107 __eq__(self, PyObject other) -> bool
12108
12109 Compare GBPosition for equality.
12110 """
12111 return _core_.GBPosition___eq__(*args, **kwargs)
12112
12113 def __ne__(*args, **kwargs):
12114 """
12115 __ne__(self, PyObject other) -> bool
12116
12117 Compare GBPosition for inequality.
12118 """
12119 return _core_.GBPosition___ne__(*args, **kwargs)
12120
12121 def Set(*args, **kwargs):
12122 """Set(self, int row=0, int col=0)"""
12123 return _core_.GBPosition_Set(*args, **kwargs)
12124
12125 def Get(*args, **kwargs):
12126 """Get(self) -> PyObject"""
12127 return _core_.GBPosition_Get(*args, **kwargs)
12128
12129 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12130 def __str__(self): return str(self.Get())
12131 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12132 def __len__(self): return len(self.Get())
12133 def __getitem__(self, index): return self.Get()[index]
12134 def __setitem__(self, index, val):
12135 if index == 0: self.SetRow(val)
12136 elif index == 1: self.SetCol(val)
12137 else: raise IndexError
12138 def __nonzero__(self): return self.Get() != (0,0)
12139 __safe_for_unpickling__ = True
12140 def __reduce__(self): return (wx.GBPosition, self.Get())
12141
12142 row = property(GetRow, SetRow)
12143 col = property(GetCol, SetCol)
12144
12145 _core_.GBPosition_swigregister(GBPosition)
12146
12147 class GBSpan(object):
12148 """
12149 This class is used to hold the row and column spanning attributes of
12150 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12151 automatically convert from a 2-element sequence of integers to a
12152 wx.GBSpan, so you can use the more pythonic representation of the span
12153 nearly transparently in Python code.
12154
12155 """
12156 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12157 __repr__ = _swig_repr
12158 def __init__(self, *args, **kwargs):
12159 """
12160 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12161
12162 Construct a new wxGBSpan, optionally setting the rowspan and
12163 colspan. The default is (1,1). (Meaning that the item occupies one
12164 cell in each direction.
12165 """
12166 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12167 __swig_destroy__ = _core_.delete_GBSpan
12168 __del__ = lambda self : None;
12169 def GetRowspan(*args, **kwargs):
12170 """GetRowspan(self) -> int"""
12171 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12172
12173 def GetColspan(*args, **kwargs):
12174 """GetColspan(self) -> int"""
12175 return _core_.GBSpan_GetColspan(*args, **kwargs)
12176
12177 def SetRowspan(*args, **kwargs):
12178 """SetRowspan(self, int rowspan)"""
12179 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12180
12181 def SetColspan(*args, **kwargs):
12182 """SetColspan(self, int colspan)"""
12183 return _core_.GBSpan_SetColspan(*args, **kwargs)
12184
12185 def __eq__(*args, **kwargs):
12186 """
12187 __eq__(self, PyObject other) -> bool
12188
12189 Compare wxGBSpan for equality.
12190 """
12191 return _core_.GBSpan___eq__(*args, **kwargs)
12192
12193 def __ne__(*args, **kwargs):
12194 """
12195 __ne__(self, PyObject other) -> bool
12196
12197 Compare GBSpan for inequality.
12198 """
12199 return _core_.GBSpan___ne__(*args, **kwargs)
12200
12201 def Set(*args, **kwargs):
12202 """Set(self, int rowspan=1, int colspan=1)"""
12203 return _core_.GBSpan_Set(*args, **kwargs)
12204
12205 def Get(*args, **kwargs):
12206 """Get(self) -> PyObject"""
12207 return _core_.GBSpan_Get(*args, **kwargs)
12208
12209 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12210 def __str__(self): return str(self.Get())
12211 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12212 def __len__(self): return len(self.Get())
12213 def __getitem__(self, index): return self.Get()[index]
12214 def __setitem__(self, index, val):
12215 if index == 0: self.SetRowspan(val)
12216 elif index == 1: self.SetColspan(val)
12217 else: raise IndexError
12218 def __nonzero__(self): return self.Get() != (0,0)
12219 __safe_for_unpickling__ = True
12220 def __reduce__(self): return (wx.GBSpan, self.Get())
12221
12222 rowspan = property(GetRowspan, SetRowspan)
12223 colspan = property(GetColspan, SetColspan)
12224
12225 _core_.GBSpan_swigregister(GBSpan)
12226
12227 class GBSizerItem(SizerItem):
12228 """
12229 The wx.GBSizerItem class is used to track the additional data about
12230 items in a `wx.GridBagSizer` such as the item's position in the grid
12231 and how many rows or columns it spans.
12232
12233 """
12234 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12235 __repr__ = _swig_repr
12236 def __init__(self, *args, **kwargs):
12237 """
12238 __init__(self) -> GBSizerItem
12239
12240 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12241 size will need to be set, as well as a position and span before this
12242 item can be used in a Sizer.
12243
12244 You will probably never need to create a wx.GBSizerItem directly as they
12245 are created automatically when the sizer's Add method is called.
12246 """
12247 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12248 __swig_destroy__ = _core_.delete_GBSizerItem
12249 __del__ = lambda self : None;
12250 def GetPos(*args, **kwargs):
12251 """
12252 GetPos(self) -> GBPosition
12253
12254 Get the grid position of the item
12255 """
12256 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12257
12258 def GetPosTuple(self): return self.GetPos().Get()
12259 def GetSpan(*args, **kwargs):
12260 """
12261 GetSpan(self) -> GBSpan
12262
12263 Get the row and column spanning of the item
12264 """
12265 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12266
12267 def GetSpanTuple(self): return self.GetSpan().Get()
12268 def SetPos(*args, **kwargs):
12269 """
12270 SetPos(self, GBPosition pos) -> bool
12271
12272 If the item is already a member of a sizer then first ensure that
12273 there is no other item that would intersect with this one at the new
12274 position, then set the new position. Returns True if the change is
12275 successful and after the next Layout() the item will be moved.
12276 """
12277 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12278
12279 def SetSpan(*args, **kwargs):
12280 """
12281 SetSpan(self, GBSpan span) -> bool
12282
12283 If the item is already a member of a sizer then first ensure that
12284 there is no other item that would intersect with this one with its new
12285 spanning size, then set the new spanning. Returns True if the change
12286 is successful and after the next Layout() the item will be resized.
12287
12288 """
12289 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12290
12291 def Intersects(*args, **kwargs):
12292 """
12293 Intersects(self, GBSizerItem other) -> bool
12294
12295 Returns True if this item and the other item instersect.
12296 """
12297 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12298
12299 def IntersectsPos(*args, **kwargs):
12300 """
12301 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12302
12303 Returns True if the given pos/span would intersect with this item.
12304 """
12305 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12306
12307 def GetEndPos(*args, **kwargs):
12308 """
12309 GetEndPos(self) -> GBPosition
12310
12311 Get the row and column of the endpoint of this item.
12312 """
12313 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12314
12315 def GetGBSizer(*args, **kwargs):
12316 """
12317 GetGBSizer(self) -> GridBagSizer
12318
12319 Get the sizer this item is a member of.
12320 """
12321 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12322
12323 def SetGBSizer(*args, **kwargs):
12324 """
12325 SetGBSizer(self, GridBagSizer sizer)
12326
12327 Set the sizer this item is a member of.
12328 """
12329 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12330
12331 _core_.GBSizerItem_swigregister(GBSizerItem)
12332 DefaultSpan = cvar.DefaultSpan
12333
12334 def GBSizerItemWindow(*args, **kwargs):
12335 """
12336 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12337 int border, PyObject userData=None) -> GBSizerItem
12338
12339 Construct a `wx.GBSizerItem` for a window.
12340 """
12341 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12342 return val
12343
12344 def GBSizerItemSizer(*args, **kwargs):
12345 """
12346 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12347 int border, PyObject userData=None) -> GBSizerItem
12348
12349 Construct a `wx.GBSizerItem` for a sizer
12350 """
12351 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12352 return val
12353
12354 def GBSizerItemSpacer(*args, **kwargs):
12355 """
12356 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12357 int flag, int border, PyObject userData=None) -> GBSizerItem
12358
12359 Construct a `wx.GBSizerItem` for a spacer.
12360 """
12361 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12362 return val
12363
12364 class GridBagSizer(FlexGridSizer):
12365 """
12366 A `wx.Sizer` that can lay out items in a virtual grid like a
12367 `wx.FlexGridSizer` but in this case explicit positioning of the items
12368 is allowed using `wx.GBPosition`, and items can optionally span more
12369 than one row and/or column using `wx.GBSpan`. The total size of the
12370 virtual grid is determined by the largest row and column that items are
12371 positioned at, adjusted for spanning.
12372
12373 """
12374 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12375 __repr__ = _swig_repr
12376 def __init__(self, *args, **kwargs):
12377 """
12378 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12379
12380 Constructor, with optional parameters to specify the gap between the
12381 rows and columns.
12382 """
12383 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12384 self._setOORInfo(self)
12385
12386 def Add(*args, **kwargs):
12387 """
12388 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12389 int border=0, userData=None) -> wx.GBSizerItem
12390
12391 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12392 more than one row or column as specified with *span*. The remaining
12393 args behave similarly to `wx.Sizer.Add`.
12394
12395 Returns True if the item was successfully placed at the given cell
12396 position, False if something was already there.
12397
12398 """
12399 return _core_.GridBagSizer_Add(*args, **kwargs)
12400
12401 def AddItem(*args, **kwargs):
12402 """
12403 Add(self, GBSizerItem item) -> wx.GBSizerItem
12404
12405 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12406 the item was successfully placed at its given cell position, False if
12407 something was already there.
12408 """
12409 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12410
12411 def GetCellSize(*args, **kwargs):
12412 """
12413 GetCellSize(self, int row, int col) -> Size
12414
12415 Get the size of the specified cell, including hgap and
12416 vgap. Only valid after a Layout.
12417 """
12418 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12419
12420 def GetEmptyCellSize(*args, **kwargs):
12421 """
12422 GetEmptyCellSize(self) -> Size
12423
12424 Get the size used for cells in the grid with no item.
12425 """
12426 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12427
12428 def SetEmptyCellSize(*args, **kwargs):
12429 """
12430 SetEmptyCellSize(self, Size sz)
12431
12432 Set the size used for cells in the grid with no item.
12433 """
12434 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12435
12436 def GetItemPosition(*args):
12437 """
12438 GetItemPosition(self, item) -> GBPosition
12439
12440 Get the grid position of the specified *item* where *item* is either a
12441 window or subsizer that is a member of this sizer, or a zero-based
12442 index of an item.
12443 """
12444 return _core_.GridBagSizer_GetItemPosition(*args)
12445
12446 def SetItemPosition(*args):
12447 """
12448 SetItemPosition(self, item, GBPosition pos) -> bool
12449
12450 Set the grid position of the specified *item* where *item* is either a
12451 window or subsizer that is a member of this sizer, or a zero-based
12452 index of an item. Returns True on success. If the move is not
12453 allowed (because an item is already there) then False is returned.
12454
12455 """
12456 return _core_.GridBagSizer_SetItemPosition(*args)
12457
12458 def GetItemSpan(*args):
12459 """
12460 GetItemSpan(self, item) -> GBSpan
12461
12462 Get the row/col spanning of the specified *item* where *item* is
12463 either a window or subsizer that is a member of this sizer, or a
12464 zero-based index of an item.
12465 """
12466 return _core_.GridBagSizer_GetItemSpan(*args)
12467
12468 def SetItemSpan(*args):
12469 """
12470 SetItemSpan(self, item, GBSpan span) -> bool
12471
12472 Set the row/col spanning of the specified *item* where *item* is
12473 either a window or subsizer that is a member of this sizer, or a
12474 zero-based index of an item. Returns True on success. If the move is
12475 not allowed (because an item is already there) then False is returned.
12476 """
12477 return _core_.GridBagSizer_SetItemSpan(*args)
12478
12479 def FindItem(*args):
12480 """
12481 FindItem(self, item) -> GBSizerItem
12482
12483 Find the sizer item for the given window or subsizer, returns None if
12484 not found. (non-recursive)
12485 """
12486 return _core_.GridBagSizer_FindItem(*args)
12487
12488 def FindItemAtPosition(*args, **kwargs):
12489 """
12490 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12491
12492 Return the sizer item for the given grid cell, or None if there is no
12493 item at that position. (non-recursive)
12494 """
12495 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12496
12497 def FindItemAtPoint(*args, **kwargs):
12498 """
12499 FindItemAtPoint(self, Point pt) -> GBSizerItem
12500
12501 Return the sizer item located at the point given in *pt*, or None if
12502 there is no item at that point. The (x,y) coordinates in pt correspond
12503 to the client coordinates of the window using the sizer for
12504 layout. (non-recursive)
12505 """
12506 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12507
12508 def CheckForIntersection(*args, **kwargs):
12509 """
12510 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12511
12512 Look at all items and see if any intersect (or would overlap) the
12513 given *item*. Returns True if so, False if there would be no overlap.
12514 If an *excludeItem* is given then it will not be checked for
12515 intersection, for example it may be the item we are checking the
12516 position of.
12517
12518 """
12519 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12520
12521 def CheckForIntersectionPos(*args, **kwargs):
12522 """
12523 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12524
12525 Look at all items and see if any intersect (or would overlap) the
12526 given position and span. Returns True if so, False if there would be
12527 no overlap. If an *excludeItem* is given then it will not be checked
12528 for intersection, for example it may be the item we are checking the
12529 position of.
12530 """
12531 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12532
12533 _core_.GridBagSizer_swigregister(GridBagSizer)
12534
12535 #---------------------------------------------------------------------------
12536
12537 Left = _core_.Left
12538 Top = _core_.Top
12539 Right = _core_.Right
12540 Bottom = _core_.Bottom
12541 Width = _core_.Width
12542 Height = _core_.Height
12543 Centre = _core_.Centre
12544 Center = _core_.Center
12545 CentreX = _core_.CentreX
12546 CentreY = _core_.CentreY
12547 Unconstrained = _core_.Unconstrained
12548 AsIs = _core_.AsIs
12549 PercentOf = _core_.PercentOf
12550 Above = _core_.Above
12551 Below = _core_.Below
12552 LeftOf = _core_.LeftOf
12553 RightOf = _core_.RightOf
12554 SameAs = _core_.SameAs
12555 Absolute = _core_.Absolute
12556 class IndividualLayoutConstraint(Object):
12557 """
12558 Objects of this class are stored in the `wx.LayoutConstraints` class as
12559 one of eight possible constraints that a window can be involved in.
12560 You will never need to create an instance of
12561 wx.IndividualLayoutConstraint, rather you should create a
12562 `wx.LayoutConstraints` instance and use the individual contstraints
12563 that it contains.
12564 """
12565 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12566 def __init__(self): raise AttributeError, "No constructor defined"
12567 __repr__ = _swig_repr
12568 def Set(*args, **kwargs):
12569 """
12570 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12571
12572 Sets the properties of the constraint. Normally called by one of the
12573 convenience functions such as Above, RightOf, SameAs.
12574 """
12575 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12576
12577 def LeftOf(*args, **kwargs):
12578 """
12579 LeftOf(self, Window sibling, int marg=0)
12580
12581 Constrains this edge to be to the left of the given window, with an
12582 optional margin. Implicitly, this is relative to the left edge of the
12583 other window.
12584 """
12585 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12586
12587 def RightOf(*args, **kwargs):
12588 """
12589 RightOf(self, Window sibling, int marg=0)
12590
12591 Constrains this edge to be to the right of the given window, with an
12592 optional margin. Implicitly, this is relative to the right edge of the
12593 other window.
12594 """
12595 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12596
12597 def Above(*args, **kwargs):
12598 """
12599 Above(self, Window sibling, int marg=0)
12600
12601 Constrains this edge to be above the given window, with an optional
12602 margin. Implicitly, this is relative to the top edge of the other
12603 window.
12604 """
12605 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12606
12607 def Below(*args, **kwargs):
12608 """
12609 Below(self, Window sibling, int marg=0)
12610
12611 Constrains this edge to be below the given window, with an optional
12612 margin. Implicitly, this is relative to the bottom edge of the other
12613 window.
12614 """
12615 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12616
12617 def SameAs(*args, **kwargs):
12618 """
12619 SameAs(self, Window otherW, int edge, int marg=0)
12620
12621 Constrains this edge or dimension to be to the same as the edge of the
12622 given window, with an optional margin.
12623 """
12624 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12625
12626 def PercentOf(*args, **kwargs):
12627 """
12628 PercentOf(self, Window otherW, int wh, int per)
12629
12630 Constrains this edge or dimension to be to a percentage of the given
12631 window, with an optional margin.
12632 """
12633 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12634
12635 def Absolute(*args, **kwargs):
12636 """
12637 Absolute(self, int val)
12638
12639 Constrains this edge or dimension to be the given absolute value.
12640 """
12641 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12642
12643 def Unconstrained(*args, **kwargs):
12644 """
12645 Unconstrained(self)
12646
12647 Sets this edge or dimension to be unconstrained, that is, dependent on
12648 other edges and dimensions from which this value can be deduced.
12649 """
12650 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12651
12652 def AsIs(*args, **kwargs):
12653 """
12654 AsIs(self)
12655
12656 Sets this edge or constraint to be whatever the window's value is at
12657 the moment. If either of the width and height constraints are *as is*,
12658 the window will not be resized, but moved instead. This is important
12659 when considering panel items which are intended to have a default
12660 size, such as a button, which may take its size from the size of the
12661 button label.
12662 """
12663 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12664
12665 def GetOtherWindow(*args, **kwargs):
12666 """GetOtherWindow(self) -> Window"""
12667 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12668
12669 def GetMyEdge(*args, **kwargs):
12670 """GetMyEdge(self) -> int"""
12671 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12672
12673 def SetEdge(*args, **kwargs):
12674 """SetEdge(self, int which)"""
12675 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12676
12677 def SetValue(*args, **kwargs):
12678 """SetValue(self, int v)"""
12679 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12680
12681 def GetMargin(*args, **kwargs):
12682 """GetMargin(self) -> int"""
12683 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12684
12685 def SetMargin(*args, **kwargs):
12686 """SetMargin(self, int m)"""
12687 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12688
12689 def GetValue(*args, **kwargs):
12690 """GetValue(self) -> int"""
12691 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12692
12693 def GetPercent(*args, **kwargs):
12694 """GetPercent(self) -> int"""
12695 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12696
12697 def GetOtherEdge(*args, **kwargs):
12698 """GetOtherEdge(self) -> int"""
12699 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12700
12701 def GetDone(*args, **kwargs):
12702 """GetDone(self) -> bool"""
12703 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12704
12705 def SetDone(*args, **kwargs):
12706 """SetDone(self, bool d)"""
12707 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12708
12709 def GetRelationship(*args, **kwargs):
12710 """GetRelationship(self) -> int"""
12711 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12712
12713 def SetRelationship(*args, **kwargs):
12714 """SetRelationship(self, int r)"""
12715 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12716
12717 def ResetIfWin(*args, **kwargs):
12718 """
12719 ResetIfWin(self, Window otherW) -> bool
12720
12721 Reset constraint if it mentions otherWin
12722 """
12723 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12724
12725 def SatisfyConstraint(*args, **kwargs):
12726 """
12727 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12728
12729 Try to satisfy constraint
12730 """
12731 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12732
12733 def GetEdge(*args, **kwargs):
12734 """
12735 GetEdge(self, int which, Window thisWin, Window other) -> int
12736
12737 Get the value of this edge or dimension, or if this
12738 is not determinable, -1.
12739 """
12740 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12741
12742 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12743
12744 class LayoutConstraints(Object):
12745 """
12746 **Note:** constraints are now deprecated and you should use sizers
12747 instead.
12748
12749 Objects of this class can be associated with a window to define its
12750 layout constraints, with respect to siblings or its parent.
12751
12752 The class consists of the following eight constraints of class
12753 wx.IndividualLayoutConstraint, some or all of which should be accessed
12754 directly to set the appropriate constraints.
12755
12756 * left: represents the left hand edge of the window
12757 * right: represents the right hand edge of the window
12758 * top: represents the top edge of the window
12759 * bottom: represents the bottom edge of the window
12760 * width: represents the width of the window
12761 * height: represents the height of the window
12762 * centreX: represents the horizontal centre point of the window
12763 * centreY: represents the vertical centre point of the window
12764
12765 Most constraints are initially set to have the relationship
12766 wxUnconstrained, which means that their values should be calculated by
12767 looking at known constraints. The exceptions are width and height,
12768 which are set to wxAsIs to ensure that if the user does not specify a
12769 constraint, the existing width and height will be used, to be
12770 compatible with panel items which often have take a default size. If
12771 the constraint is ``wx.AsIs``, the dimension will not be changed.
12772
12773 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12774
12775 """
12776 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12777 __repr__ = _swig_repr
12778 left = property(_core_.LayoutConstraints_left_get)
12779 top = property(_core_.LayoutConstraints_top_get)
12780 right = property(_core_.LayoutConstraints_right_get)
12781 bottom = property(_core_.LayoutConstraints_bottom_get)
12782 width = property(_core_.LayoutConstraints_width_get)
12783 height = property(_core_.LayoutConstraints_height_get)
12784 centreX = property(_core_.LayoutConstraints_centreX_get)
12785 centreY = property(_core_.LayoutConstraints_centreY_get)
12786 def __init__(self, *args, **kwargs):
12787 """__init__(self) -> LayoutConstraints"""
12788 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12789 __swig_destroy__ = _core_.delete_LayoutConstraints
12790 __del__ = lambda self : None;
12791 def SatisfyConstraints(*args, **kwargs):
12792 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12793 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12794
12795 def AreSatisfied(*args, **kwargs):
12796 """AreSatisfied(self) -> bool"""
12797 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12798
12799 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12800
12801 #----------------------------------------------------------------------------
12802
12803 # Use Python's bool constants if available, make some if not
12804 try:
12805 True
12806 except NameError:
12807 __builtins__.True = 1==1
12808 __builtins__.False = 1==0
12809 def bool(value): return not not value
12810 __builtins__.bool = bool
12811
12812
12813
12814 # workarounds for bad wxRTTI names
12815 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12816 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12817 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12818
12819
12820 #----------------------------------------------------------------------------
12821 # Load version numbers from __version__... Ensure that major and minor
12822 # versions are the same for both wxPython and wxWidgets.
12823
12824 from __version__ import *
12825 __version__ = VERSION_STRING
12826
12827 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12828 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12829 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12830 import warnings
12831 warnings.warn("wxPython/wxWidgets release number mismatch")
12832
12833 #----------------------------------------------------------------------------
12834
12835 # Set wxPython's default string<-->unicode conversion encoding from
12836 # the locale, but only if Python's default hasn't been changed. (We
12837 # assume that if the user has customized it already then that is the
12838 # encoding we need to use as well.)
12839 #
12840 # The encoding selected here is used when string or unicode objects
12841 # need to be converted in order to pass them to wxWidgets. Please be
12842 # aware that the default encoding within the same locale may be
12843 # slightly different on different platforms. For example, please see
12844 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12845 # between the common latin/roman encodings.
12846
12847 default = _sys.getdefaultencoding()
12848 if default == 'ascii':
12849 import locale
12850 import codecs
12851 try:
12852 default = locale.getdefaultlocale()[1]
12853 codecs.lookup(default)
12854 except (ValueError, LookupError, TypeError):
12855 default = _sys.getdefaultencoding()
12856 del locale
12857 del codecs
12858 if default:
12859 wx.SetDefaultPyEncoding(default)
12860 del default
12861
12862 #----------------------------------------------------------------------------
12863
12864 class PyDeadObjectError(AttributeError):
12865 pass
12866
12867 class _wxPyDeadObject(object):
12868 """
12869 Instances of wx objects that are OOR capable will have their __class__
12870 changed to this class when the C++ object is deleted. This should help
12871 prevent crashes due to referencing a bogus C++ pointer.
12872 """
12873 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12874 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12875
12876 def __repr__(self):
12877 if not hasattr(self, "_name"):
12878 self._name = "[unknown]"
12879 return self.reprStr % self._name
12880
12881 def __getattr__(self, *args):
12882 if not hasattr(self, "_name"):
12883 self._name = "[unknown]"
12884 raise PyDeadObjectError(self.attrStr % self._name)
12885
12886 def __nonzero__(self):
12887 return 0
12888
12889
12890
12891 class PyUnbornObjectError(AttributeError):
12892 pass
12893
12894 class _wxPyUnbornObject(object):
12895 """
12896 Some stock objects are created when the wx._core module is
12897 imported, but their C++ instance is not created until the wx.App
12898 object is created and initialized. These object instances will
12899 temporarily have their __class__ changed to this class so an
12900 exception will be raised if they are used before the C++ instance
12901 is ready.
12902 """
12903
12904 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12905 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12906
12907 def __repr__(self):
12908 #if not hasattr(self, "_name"):
12909 # self._name = "[unknown]"
12910 return self.reprStr #% self._name
12911
12912 def __getattr__(self, *args):
12913 #if not hasattr(self, "_name"):
12914 # self._name = "[unknown]"
12915 raise PyUnbornObjectError(self.attrStr) # % self._name )
12916
12917 def __nonzero__(self):
12918 return 0
12919
12920
12921 #----------------------------------------------------------------------------
12922
12923 def CallAfter(callable, *args, **kw):
12924 """
12925 Call the specified function after the current and pending event
12926 handlers have been completed. This is also good for making GUI
12927 method calls from non-GUI threads. Any extra positional or
12928 keyword args are passed on to the callable when it is called.
12929
12930 :see: `wx.FutureCall`
12931 """
12932 app = wx.GetApp()
12933 assert app is not None, 'No wx.App created yet'
12934
12935 if not hasattr(app, "_CallAfterId"):
12936 app._CallAfterId = wx.NewEventType()
12937 app.Connect(-1, -1, app._CallAfterId,
12938 lambda event: event.callable(*event.args, **event.kw) )
12939 evt = wx.PyEvent()
12940 evt.SetEventType(app._CallAfterId)
12941 evt.callable = callable
12942 evt.args = args
12943 evt.kw = kw
12944 wx.PostEvent(app, evt)
12945
12946 #----------------------------------------------------------------------------
12947
12948
12949 class FutureCall:
12950 """
12951 A convenience class for `wx.Timer`, that calls the given callable
12952 object once after the given amount of milliseconds, passing any
12953 positional or keyword args. The return value of the callable is
12954 availbale after it has been run with the `GetResult` method.
12955
12956 If you don't need to get the return value or restart the timer
12957 then there is no need to hold a reference to this object. It will
12958 hold a reference to itself while the timer is running (the timer
12959 has a reference to self.Notify) but the cycle will be broken when
12960 the timer completes, automatically cleaning up the wx.FutureCall
12961 object.
12962
12963 :see: `wx.CallAfter`
12964 """
12965 def __init__(self, millis, callable, *args, **kwargs):
12966 self.millis = millis
12967 self.callable = callable
12968 self.SetArgs(*args, **kwargs)
12969 self.runCount = 0
12970 self.running = False
12971 self.hasRun = False
12972 self.result = None
12973 self.timer = None
12974 self.Start()
12975
12976 def __del__(self):
12977 self.Stop()
12978
12979
12980 def Start(self, millis=None, *args, **kwargs):
12981 """
12982 (Re)start the timer
12983 """
12984 self.hasRun = False
12985 if millis is not None:
12986 self.millis = millis
12987 if args or kwargs:
12988 self.SetArgs(*args, **kwargs)
12989 self.Stop()
12990 self.timer = wx.PyTimer(self.Notify)
12991 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12992 self.running = True
12993 Restart = Start
12994
12995
12996 def Stop(self):
12997 """
12998 Stop and destroy the timer.
12999 """
13000 if self.timer is not None:
13001 self.timer.Stop()
13002 self.timer = None
13003
13004
13005 def GetInterval(self):
13006 if self.timer is not None:
13007 return self.timer.GetInterval()
13008 else:
13009 return 0
13010
13011
13012 def IsRunning(self):
13013 return self.timer is not None and self.timer.IsRunning()
13014
13015
13016 def SetArgs(self, *args, **kwargs):
13017 """
13018 (Re)set the args passed to the callable object. This is
13019 useful in conjunction with Restart if you want to schedule a
13020 new call to the same callable object but with different
13021 parameters.
13022 """
13023 self.args = args
13024 self.kwargs = kwargs
13025
13026
13027 def HasRun(self):
13028 return self.hasRun
13029
13030 def GetResult(self):
13031 return self.result
13032
13033 def Notify(self):
13034 """
13035 The timer has expired so call the callable.
13036 """
13037 if self.callable and getattr(self.callable, 'im_self', True):
13038 self.runCount += 1
13039 self.running = False
13040 self.result = self.callable(*self.args, **self.kwargs)
13041 self.hasRun = True
13042 if not self.running:
13043 # if it wasn't restarted, then cleanup
13044 wx.CallAfter(self.Stop)
13045
13046
13047
13048 #----------------------------------------------------------------------------
13049 # Control which items in this module should be documented by epydoc.
13050 # We allow only classes and functions, which will help reduce the size
13051 # of the docs by filtering out the zillions of constants, EVT objects,
13052 # and etc that don't make much sense by themselves, but are instead
13053 # documented (or will be) as part of the classes/functions/methods
13054 # where they should be used.
13055
13056 class __DocFilter:
13057 """
13058 A filter for epydoc that only allows non-Ptr classes and
13059 functions, in order to reduce the clutter in the API docs.
13060 """
13061 def __init__(self, globals):
13062 self._globals = globals
13063
13064 def __call__(self, name):
13065 import types
13066 obj = self._globals.get(name, None)
13067
13068 # only document classes and function
13069 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13070 return False
13071
13072 # skip other things that are private or will be documented as part of somethign else
13073 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13074 return False
13075
13076 # skip functions that are duplicates of static functions in a class
13077 if name.find('_') != -1:
13078 cls = self._globals.get(name.split('_')[0], None)
13079 methname = name.split('_')[1]
13080 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13081 return False
13082
13083 return True
13084
13085 #----------------------------------------------------------------------------
13086 #----------------------------------------------------------------------------
13087
13088 # Import other modules in this package that should show up in the
13089 # "core" wx namespace
13090 from _gdi import *
13091 from _windows import *
13092 from _controls import *
13093 from _misc import *
13094
13095 #----------------------------------------------------------------------------
13096 #----------------------------------------------------------------------------
13097
13098
13099