]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
reSWIGged
[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_EDIT = _core_.ID_EDIT
209 ID_CUT = _core_.ID_CUT
210 ID_COPY = _core_.ID_COPY
211 ID_PASTE = _core_.ID_PASTE
212 ID_CLEAR = _core_.ID_CLEAR
213 ID_FIND = _core_.ID_FIND
214 ID_DUPLICATE = _core_.ID_DUPLICATE
215 ID_SELECTALL = _core_.ID_SELECTALL
216 ID_DELETE = _core_.ID_DELETE
217 ID_REPLACE = _core_.ID_REPLACE
218 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219 ID_PROPERTIES = _core_.ID_PROPERTIES
220 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223 ID_VIEW_LIST = _core_.ID_VIEW_LIST
224 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
228 ID_FILE = _core_.ID_FILE
229 ID_FILE1 = _core_.ID_FILE1
230 ID_FILE2 = _core_.ID_FILE2
231 ID_FILE3 = _core_.ID_FILE3
232 ID_FILE4 = _core_.ID_FILE4
233 ID_FILE5 = _core_.ID_FILE5
234 ID_FILE6 = _core_.ID_FILE6
235 ID_FILE7 = _core_.ID_FILE7
236 ID_FILE8 = _core_.ID_FILE8
237 ID_FILE9 = _core_.ID_FILE9
238 ID_OK = _core_.ID_OK
239 ID_CANCEL = _core_.ID_CANCEL
240 ID_APPLY = _core_.ID_APPLY
241 ID_YES = _core_.ID_YES
242 ID_NO = _core_.ID_NO
243 ID_STATIC = _core_.ID_STATIC
244 ID_FORWARD = _core_.ID_FORWARD
245 ID_BACKWARD = _core_.ID_BACKWARD
246 ID_DEFAULT = _core_.ID_DEFAULT
247 ID_MORE = _core_.ID_MORE
248 ID_SETUP = _core_.ID_SETUP
249 ID_RESET = _core_.ID_RESET
250 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
251 ID_YESTOALL = _core_.ID_YESTOALL
252 ID_NOTOALL = _core_.ID_NOTOALL
253 ID_ABORT = _core_.ID_ABORT
254 ID_RETRY = _core_.ID_RETRY
255 ID_IGNORE = _core_.ID_IGNORE
256 ID_ADD = _core_.ID_ADD
257 ID_REMOVE = _core_.ID_REMOVE
258 ID_UP = _core_.ID_UP
259 ID_DOWN = _core_.ID_DOWN
260 ID_HOME = _core_.ID_HOME
261 ID_REFRESH = _core_.ID_REFRESH
262 ID_STOP = _core_.ID_STOP
263 ID_INDEX = _core_.ID_INDEX
264 ID_BOLD = _core_.ID_BOLD
265 ID_ITALIC = _core_.ID_ITALIC
266 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270 ID_UNDERLINE = _core_.ID_UNDERLINE
271 ID_INDENT = _core_.ID_INDENT
272 ID_UNINDENT = _core_.ID_UNINDENT
273 ID_ZOOM_100 = _core_.ID_ZOOM_100
274 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275 ID_ZOOM_IN = _core_.ID_ZOOM_IN
276 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277 ID_UNDELETE = _core_.ID_UNDELETE
278 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
279 ID_HIGHEST = _core_.ID_HIGHEST
280 MENU_TEAROFF = _core_.MENU_TEAROFF
281 MB_DOCKABLE = _core_.MB_DOCKABLE
282 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
283 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
284 LI_HORIZONTAL = _core_.LI_HORIZONTAL
285 LI_VERTICAL = _core_.LI_VERTICAL
286 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
287 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
288 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
289 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
290 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
291 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
292 MM_TEXT = _core_.MM_TEXT
293 MM_LOMETRIC = _core_.MM_LOMETRIC
294 MM_HIMETRIC = _core_.MM_HIMETRIC
295 MM_LOENGLISH = _core_.MM_LOENGLISH
296 MM_HIENGLISH = _core_.MM_HIENGLISH
297 MM_TWIPS = _core_.MM_TWIPS
298 MM_ISOTROPIC = _core_.MM_ISOTROPIC
299 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
300 MM_POINTS = _core_.MM_POINTS
301 MM_METRIC = _core_.MM_METRIC
302 CENTRE = _core_.CENTRE
303 CENTER = _core_.CENTER
304 HORIZONTAL = _core_.HORIZONTAL
305 VERTICAL = _core_.VERTICAL
306 BOTH = _core_.BOTH
307 LEFT = _core_.LEFT
308 RIGHT = _core_.RIGHT
309 UP = _core_.UP
310 DOWN = _core_.DOWN
311 TOP = _core_.TOP
312 BOTTOM = _core_.BOTTOM
313 NORTH = _core_.NORTH
314 SOUTH = _core_.SOUTH
315 WEST = _core_.WEST
316 EAST = _core_.EAST
317 ALL = _core_.ALL
318 ALIGN_NOT = _core_.ALIGN_NOT
319 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
320 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
321 ALIGN_LEFT = _core_.ALIGN_LEFT
322 ALIGN_TOP = _core_.ALIGN_TOP
323 ALIGN_RIGHT = _core_.ALIGN_RIGHT
324 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
325 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
326 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
327 ALIGN_CENTER = _core_.ALIGN_CENTER
328 ALIGN_CENTRE = _core_.ALIGN_CENTRE
329 ALIGN_MASK = _core_.ALIGN_MASK
330 STRETCH_NOT = _core_.STRETCH_NOT
331 SHRINK = _core_.SHRINK
332 GROW = _core_.GROW
333 EXPAND = _core_.EXPAND
334 SHAPED = _core_.SHAPED
335 FIXED_MINSIZE = _core_.FIXED_MINSIZE
336 TILE = _core_.TILE
337 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
338 BORDER_DEFAULT = _core_.BORDER_DEFAULT
339 BORDER_NONE = _core_.BORDER_NONE
340 BORDER_STATIC = _core_.BORDER_STATIC
341 BORDER_SIMPLE = _core_.BORDER_SIMPLE
342 BORDER_RAISED = _core_.BORDER_RAISED
343 BORDER_SUNKEN = _core_.BORDER_SUNKEN
344 BORDER_DOUBLE = _core_.BORDER_DOUBLE
345 BORDER_MASK = _core_.BORDER_MASK
346 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
349 DEFAULT = _core_.DEFAULT
350 DECORATIVE = _core_.DECORATIVE
351 ROMAN = _core_.ROMAN
352 SCRIPT = _core_.SCRIPT
353 SWISS = _core_.SWISS
354 MODERN = _core_.MODERN
355 TELETYPE = _core_.TELETYPE
356 VARIABLE = _core_.VARIABLE
357 FIXED = _core_.FIXED
358 NORMAL = _core_.NORMAL
359 LIGHT = _core_.LIGHT
360 BOLD = _core_.BOLD
361 ITALIC = _core_.ITALIC
362 SLANT = _core_.SLANT
363 SOLID = _core_.SOLID
364 DOT = _core_.DOT
365 LONG_DASH = _core_.LONG_DASH
366 SHORT_DASH = _core_.SHORT_DASH
367 DOT_DASH = _core_.DOT_DASH
368 USER_DASH = _core_.USER_DASH
369 TRANSPARENT = _core_.TRANSPARENT
370 STIPPLE = _core_.STIPPLE
371 STIPPLE_MASK = _core_.STIPPLE_MASK
372 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
373 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376 CROSS_HATCH = _core_.CROSS_HATCH
377 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378 VERTICAL_HATCH = _core_.VERTICAL_HATCH
379 JOIN_BEVEL = _core_.JOIN_BEVEL
380 JOIN_MITER = _core_.JOIN_MITER
381 JOIN_ROUND = _core_.JOIN_ROUND
382 CAP_ROUND = _core_.CAP_ROUND
383 CAP_PROJECTING = _core_.CAP_PROJECTING
384 CAP_BUTT = _core_.CAP_BUTT
385 CLEAR = _core_.CLEAR
386 XOR = _core_.XOR
387 INVERT = _core_.INVERT
388 OR_REVERSE = _core_.OR_REVERSE
389 AND_REVERSE = _core_.AND_REVERSE
390 COPY = _core_.COPY
391 AND = _core_.AND
392 AND_INVERT = _core_.AND_INVERT
393 NO_OP = _core_.NO_OP
394 NOR = _core_.NOR
395 EQUIV = _core_.EQUIV
396 SRC_INVERT = _core_.SRC_INVERT
397 OR_INVERT = _core_.OR_INVERT
398 NAND = _core_.NAND
399 OR = _core_.OR
400 SET = _core_.SET
401 WXK_BACK = _core_.WXK_BACK
402 WXK_TAB = _core_.WXK_TAB
403 WXK_RETURN = _core_.WXK_RETURN
404 WXK_ESCAPE = _core_.WXK_ESCAPE
405 WXK_SPACE = _core_.WXK_SPACE
406 WXK_DELETE = _core_.WXK_DELETE
407 WXK_START = _core_.WXK_START
408 WXK_LBUTTON = _core_.WXK_LBUTTON
409 WXK_RBUTTON = _core_.WXK_RBUTTON
410 WXK_CANCEL = _core_.WXK_CANCEL
411 WXK_MBUTTON = _core_.WXK_MBUTTON
412 WXK_CLEAR = _core_.WXK_CLEAR
413 WXK_SHIFT = _core_.WXK_SHIFT
414 WXK_ALT = _core_.WXK_ALT
415 WXK_CONTROL = _core_.WXK_CONTROL
416 WXK_MENU = _core_.WXK_MENU
417 WXK_PAUSE = _core_.WXK_PAUSE
418 WXK_CAPITAL = _core_.WXK_CAPITAL
419 WXK_PRIOR = _core_.WXK_PRIOR
420 WXK_NEXT = _core_.WXK_NEXT
421 WXK_END = _core_.WXK_END
422 WXK_HOME = _core_.WXK_HOME
423 WXK_LEFT = _core_.WXK_LEFT
424 WXK_UP = _core_.WXK_UP
425 WXK_RIGHT = _core_.WXK_RIGHT
426 WXK_DOWN = _core_.WXK_DOWN
427 WXK_SELECT = _core_.WXK_SELECT
428 WXK_PRINT = _core_.WXK_PRINT
429 WXK_EXECUTE = _core_.WXK_EXECUTE
430 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431 WXK_INSERT = _core_.WXK_INSERT
432 WXK_HELP = _core_.WXK_HELP
433 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443 WXK_MULTIPLY = _core_.WXK_MULTIPLY
444 WXK_ADD = _core_.WXK_ADD
445 WXK_SEPARATOR = _core_.WXK_SEPARATOR
446 WXK_SUBTRACT = _core_.WXK_SUBTRACT
447 WXK_DECIMAL = _core_.WXK_DECIMAL
448 WXK_DIVIDE = _core_.WXK_DIVIDE
449 WXK_F1 = _core_.WXK_F1
450 WXK_F2 = _core_.WXK_F2
451 WXK_F3 = _core_.WXK_F3
452 WXK_F4 = _core_.WXK_F4
453 WXK_F5 = _core_.WXK_F5
454 WXK_F6 = _core_.WXK_F6
455 WXK_F7 = _core_.WXK_F7
456 WXK_F8 = _core_.WXK_F8
457 WXK_F9 = _core_.WXK_F9
458 WXK_F10 = _core_.WXK_F10
459 WXK_F11 = _core_.WXK_F11
460 WXK_F12 = _core_.WXK_F12
461 WXK_F13 = _core_.WXK_F13
462 WXK_F14 = _core_.WXK_F14
463 WXK_F15 = _core_.WXK_F15
464 WXK_F16 = _core_.WXK_F16
465 WXK_F17 = _core_.WXK_F17
466 WXK_F18 = _core_.WXK_F18
467 WXK_F19 = _core_.WXK_F19
468 WXK_F20 = _core_.WXK_F20
469 WXK_F21 = _core_.WXK_F21
470 WXK_F22 = _core_.WXK_F22
471 WXK_F23 = _core_.WXK_F23
472 WXK_F24 = _core_.WXK_F24
473 WXK_NUMLOCK = _core_.WXK_NUMLOCK
474 WXK_SCROLL = _core_.WXK_SCROLL
475 WXK_PAGEUP = _core_.WXK_PAGEUP
476 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
507 WXK_COMMAND = _core_.WXK_COMMAND
508 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
528 PAPER_NONE = _core_.PAPER_NONE
529 PAPER_LETTER = _core_.PAPER_LETTER
530 PAPER_LEGAL = _core_.PAPER_LEGAL
531 PAPER_A4 = _core_.PAPER_A4
532 PAPER_CSHEET = _core_.PAPER_CSHEET
533 PAPER_DSHEET = _core_.PAPER_DSHEET
534 PAPER_ESHEET = _core_.PAPER_ESHEET
535 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536 PAPER_TABLOID = _core_.PAPER_TABLOID
537 PAPER_LEDGER = _core_.PAPER_LEDGER
538 PAPER_STATEMENT = _core_.PAPER_STATEMENT
539 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540 PAPER_A3 = _core_.PAPER_A3
541 PAPER_A4SMALL = _core_.PAPER_A4SMALL
542 PAPER_A5 = _core_.PAPER_A5
543 PAPER_B4 = _core_.PAPER_B4
544 PAPER_B5 = _core_.PAPER_B5
545 PAPER_FOLIO = _core_.PAPER_FOLIO
546 PAPER_QUARTO = _core_.PAPER_QUARTO
547 PAPER_10X14 = _core_.PAPER_10X14
548 PAPER_11X17 = _core_.PAPER_11X17
549 PAPER_NOTE = _core_.PAPER_NOTE
550 PAPER_ENV_9 = _core_.PAPER_ENV_9
551 PAPER_ENV_10 = _core_.PAPER_ENV_10
552 PAPER_ENV_11 = _core_.PAPER_ENV_11
553 PAPER_ENV_12 = _core_.PAPER_ENV_12
554 PAPER_ENV_14 = _core_.PAPER_ENV_14
555 PAPER_ENV_DL = _core_.PAPER_ENV_DL
556 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572 PAPER_9X11 = _core_.PAPER_9X11
573 PAPER_10X11 = _core_.PAPER_10X11
574 PAPER_15X11 = _core_.PAPER_15X11
575 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583 PAPER_A_PLUS = _core_.PAPER_A_PLUS
584 PAPER_B_PLUS = _core_.PAPER_B_PLUS
585 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592 PAPER_A2 = _core_.PAPER_A2
593 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
595 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
596 PAPER_A6 = _core_.PAPER_A6
597 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
598 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
599 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
600 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
601 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
602 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
603 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
604 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
605 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
606 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
607 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
608 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
610 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
611 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
612 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
613 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
614 PAPER_B6_JIS = _core_.PAPER_B6_JIS
615 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
616 PAPER_12X11 = _core_.PAPER_12X11
617 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
618 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
619 PAPER_P16K = _core_.PAPER_P16K
620 PAPER_P32K = _core_.PAPER_P32K
621 PAPER_P32KBIG = _core_.PAPER_P32KBIG
622 PAPER_PENV_1 = _core_.PAPER_PENV_1
623 PAPER_PENV_2 = _core_.PAPER_PENV_2
624 PAPER_PENV_3 = _core_.PAPER_PENV_3
625 PAPER_PENV_4 = _core_.PAPER_PENV_4
626 PAPER_PENV_5 = _core_.PAPER_PENV_5
627 PAPER_PENV_6 = _core_.PAPER_PENV_6
628 PAPER_PENV_7 = _core_.PAPER_PENV_7
629 PAPER_PENV_8 = _core_.PAPER_PENV_8
630 PAPER_PENV_9 = _core_.PAPER_PENV_9
631 PAPER_PENV_10 = _core_.PAPER_PENV_10
632 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
633 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
634 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
635 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
636 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
637 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
638 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
639 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
640 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
641 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
642 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
643 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
644 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
645 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
646 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
647 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
648 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
649 ITEM_NORMAL = _core_.ITEM_NORMAL
650 ITEM_CHECK = _core_.ITEM_CHECK
651 ITEM_RADIO = _core_.ITEM_RADIO
652 ITEM_MAX = _core_.ITEM_MAX
653 HT_NOWHERE = _core_.HT_NOWHERE
654 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
655 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
656 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
657 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
658 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
659 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
660 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
661 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
662 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
663 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
664 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
665 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
666 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
667 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
668 HT_MAX = _core_.HT_MAX
669 MOD_NONE = _core_.MOD_NONE
670 MOD_ALT = _core_.MOD_ALT
671 MOD_CONTROL = _core_.MOD_CONTROL
672 MOD_ALTGR = _core_.MOD_ALTGR
673 MOD_SHIFT = _core_.MOD_SHIFT
674 MOD_META = _core_.MOD_META
675 MOD_WIN = _core_.MOD_WIN
676 MOD_CMD = _core_.MOD_CMD
677 MOD_ALL = _core_.MOD_ALL
678 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
681 Layout_Default = _core_.Layout_Default
682 Layout_LeftToRight = _core_.Layout_LeftToRight
683 Layout_RightToLeft = _core_.Layout_RightToLeft
684 #---------------------------------------------------------------------------
685
686 class Object(object):
687 """
688 The base class for most wx objects, although in wxPython not
689 much functionality is needed nor exposed.
690 """
691 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
692 def __init__(self): raise AttributeError, "No constructor defined"
693 __repr__ = _swig_repr
694 def GetClassName(*args, **kwargs):
695 """
696 GetClassName(self) -> String
697
698 Returns the class name of the C++ class using wxRTTI.
699 """
700 return _core_.Object_GetClassName(*args, **kwargs)
701
702 def Destroy(*args, **kwargs):
703 """
704 Destroy(self)
705
706 Deletes the C++ object this Python object is a proxy for.
707 """
708 val = _core_.Object_Destroy(*args, **kwargs)
709 args[0].thisown = 0
710 return val
711
712 ClassName = property(GetClassName,doc="See `GetClassName`")
713 _core_.Object_swigregister(Object)
714 _wxPySetDictionary = _core_._wxPySetDictionary
715 cvar = _core_.cvar
716 EmptyString = cvar.EmptyString
717
718 #---------------------------------------------------------------------------
719
720 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
721 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
722 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
723 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
724 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
725 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
726 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
727 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
728 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
729 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
730 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
731 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
732 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
733 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
734 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
735 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
736 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
737 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
738 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
739 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
740 CURSOR_NONE = _core_.CURSOR_NONE
741 CURSOR_ARROW = _core_.CURSOR_ARROW
742 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
743 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
744 CURSOR_CHAR = _core_.CURSOR_CHAR
745 CURSOR_CROSS = _core_.CURSOR_CROSS
746 CURSOR_HAND = _core_.CURSOR_HAND
747 CURSOR_IBEAM = _core_.CURSOR_IBEAM
748 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
749 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
750 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
751 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
752 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
753 CURSOR_PENCIL = _core_.CURSOR_PENCIL
754 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
755 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
756 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
757 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
758 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
759 CURSOR_SIZENS = _core_.CURSOR_SIZENS
760 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
761 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
762 CURSOR_SIZING = _core_.CURSOR_SIZING
763 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
764 CURSOR_WAIT = _core_.CURSOR_WAIT
765 CURSOR_WATCH = _core_.CURSOR_WATCH
766 CURSOR_BLANK = _core_.CURSOR_BLANK
767 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
768 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
769 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
770 CURSOR_MAX = _core_.CURSOR_MAX
771 #---------------------------------------------------------------------------
772
773 class Size(object):
774 """
775 wx.Size is a useful data structure used to represent the size of
776 something. It simply contains integer width and height
777 properties. In most places in wxPython where a wx.Size is
778 expected a (width, height) tuple can be used instead.
779 """
780 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
781 __repr__ = _swig_repr
782 width = property(_core_.Size_width_get, _core_.Size_width_set)
783 height = property(_core_.Size_height_get, _core_.Size_height_set)
784 x = width; y = height
785 def __init__(self, *args, **kwargs):
786 """
787 __init__(self, int w=0, int h=0) -> Size
788
789 Creates a size object.
790 """
791 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
792 __swig_destroy__ = _core_.delete_Size
793 __del__ = lambda self : None;
794 def __eq__(*args, **kwargs):
795 """
796 __eq__(self, PyObject other) -> bool
797
798 Test for equality of wx.Size objects.
799 """
800 return _core_.Size___eq__(*args, **kwargs)
801
802 def __ne__(*args, **kwargs):
803 """
804 __ne__(self, PyObject other) -> bool
805
806 Test for inequality of wx.Size objects.
807 """
808 return _core_.Size___ne__(*args, **kwargs)
809
810 def __add__(*args, **kwargs):
811 """
812 __add__(self, Size sz) -> Size
813
814 Add sz's proprties to this and return the result.
815 """
816 return _core_.Size___add__(*args, **kwargs)
817
818 def __sub__(*args, **kwargs):
819 """
820 __sub__(self, Size sz) -> Size
821
822 Subtract sz's properties from this and return the result.
823 """
824 return _core_.Size___sub__(*args, **kwargs)
825
826 def IncTo(*args, **kwargs):
827 """
828 IncTo(self, Size sz)
829
830 Increments this object so that both of its dimensions are not less
831 than the corresponding dimensions of the size.
832 """
833 return _core_.Size_IncTo(*args, **kwargs)
834
835 def DecTo(*args, **kwargs):
836 """
837 DecTo(self, Size sz)
838
839 Decrements this object so that both of its dimensions are not greater
840 than the corresponding dimensions of the size.
841 """
842 return _core_.Size_DecTo(*args, **kwargs)
843
844 def IncBy(*args, **kwargs):
845 """IncBy(self, int dx, int dy)"""
846 return _core_.Size_IncBy(*args, **kwargs)
847
848 def DecBy(*args, **kwargs):
849 """DecBy(self, int dx, int dy)"""
850 return _core_.Size_DecBy(*args, **kwargs)
851
852 def Scale(*args, **kwargs):
853 """
854 Scale(self, float xscale, float yscale)
855
856 Scales the dimensions of this object by the given factors.
857 """
858 return _core_.Size_Scale(*args, **kwargs)
859
860 def Set(*args, **kwargs):
861 """
862 Set(self, int w, int h)
863
864 Set both width and height.
865 """
866 return _core_.Size_Set(*args, **kwargs)
867
868 def SetWidth(*args, **kwargs):
869 """SetWidth(self, int w)"""
870 return _core_.Size_SetWidth(*args, **kwargs)
871
872 def SetHeight(*args, **kwargs):
873 """SetHeight(self, int h)"""
874 return _core_.Size_SetHeight(*args, **kwargs)
875
876 def GetWidth(*args, **kwargs):
877 """GetWidth(self) -> int"""
878 return _core_.Size_GetWidth(*args, **kwargs)
879
880 def GetHeight(*args, **kwargs):
881 """GetHeight(self) -> int"""
882 return _core_.Size_GetHeight(*args, **kwargs)
883
884 def IsFullySpecified(*args, **kwargs):
885 """
886 IsFullySpecified(self) -> bool
887
888 Returns True if both components of the size are non-default values.
889 """
890 return _core_.Size_IsFullySpecified(*args, **kwargs)
891
892 def SetDefaults(*args, **kwargs):
893 """
894 SetDefaults(self, Size size)
895
896 Combine this size with the other one replacing the default components
897 of this object (i.e. equal to -1) with those of the other.
898 """
899 return _core_.Size_SetDefaults(*args, **kwargs)
900
901 def Get(*args, **kwargs):
902 """
903 Get() -> (width,height)
904
905 Returns the width and height properties as a tuple.
906 """
907 return _core_.Size_Get(*args, **kwargs)
908
909 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
910 def __str__(self): return str(self.Get())
911 def __repr__(self): return 'wx.Size'+str(self.Get())
912 def __len__(self): return len(self.Get())
913 def __getitem__(self, index): return self.Get()[index]
914 def __setitem__(self, index, val):
915 if index == 0: self.width = val
916 elif index == 1: self.height = val
917 else: raise IndexError
918 def __nonzero__(self): return self.Get() != (0,0)
919 __safe_for_unpickling__ = True
920 def __reduce__(self): return (wx.Size, self.Get())
921
922 _core_.Size_swigregister(Size)
923
924 #---------------------------------------------------------------------------
925
926 class RealPoint(object):
927 """
928 A data structure for representing a point or position with floating
929 point x and y properties. In wxPython most places that expect a
930 wx.RealPoint can also accept a (x,y) tuple.
931 """
932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
933 __repr__ = _swig_repr
934 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
935 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
936 def __init__(self, *args, **kwargs):
937 """
938 __init__(self, double x=0.0, double y=0.0) -> RealPoint
939
940 Create a wx.RealPoint object
941 """
942 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
943 __swig_destroy__ = _core_.delete_RealPoint
944 __del__ = lambda self : None;
945 def __eq__(*args, **kwargs):
946 """
947 __eq__(self, PyObject other) -> bool
948
949 Test for equality of wx.RealPoint objects.
950 """
951 return _core_.RealPoint___eq__(*args, **kwargs)
952
953 def __ne__(*args, **kwargs):
954 """
955 __ne__(self, PyObject other) -> bool
956
957 Test for inequality of wx.RealPoint objects.
958 """
959 return _core_.RealPoint___ne__(*args, **kwargs)
960
961 def __add__(*args, **kwargs):
962 """
963 __add__(self, RealPoint pt) -> RealPoint
964
965 Add pt's proprties to this and return the result.
966 """
967 return _core_.RealPoint___add__(*args, **kwargs)
968
969 def __sub__(*args, **kwargs):
970 """
971 __sub__(self, RealPoint pt) -> RealPoint
972
973 Subtract pt's proprties from this and return the result
974 """
975 return _core_.RealPoint___sub__(*args, **kwargs)
976
977 def Set(*args, **kwargs):
978 """
979 Set(self, double x, double y)
980
981 Set both the x and y properties
982 """
983 return _core_.RealPoint_Set(*args, **kwargs)
984
985 def Get(*args, **kwargs):
986 """
987 Get() -> (x,y)
988
989 Return the x and y properties as a tuple.
990 """
991 return _core_.RealPoint_Get(*args, **kwargs)
992
993 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
994 def __str__(self): return str(self.Get())
995 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
996 def __len__(self): return len(self.Get())
997 def __getitem__(self, index): return self.Get()[index]
998 def __setitem__(self, index, val):
999 if index == 0: self.x = val
1000 elif index == 1: self.y = val
1001 else: raise IndexError
1002 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1003 __safe_for_unpickling__ = True
1004 def __reduce__(self): return (wx.RealPoint, self.Get())
1005
1006 _core_.RealPoint_swigregister(RealPoint)
1007
1008 #---------------------------------------------------------------------------
1009
1010 class Point(object):
1011 """
1012 A data structure for representing a point or position with integer x
1013 and y properties. Most places in wxPython that expect a wx.Point can
1014 also accept a (x,y) tuple.
1015 """
1016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1017 __repr__ = _swig_repr
1018 x = property(_core_.Point_x_get, _core_.Point_x_set)
1019 y = property(_core_.Point_y_get, _core_.Point_y_set)
1020 def __init__(self, *args, **kwargs):
1021 """
1022 __init__(self, int x=0, int y=0) -> Point
1023
1024 Create a wx.Point object
1025 """
1026 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1027 __swig_destroy__ = _core_.delete_Point
1028 __del__ = lambda self : None;
1029 def __eq__(*args, **kwargs):
1030 """
1031 __eq__(self, PyObject other) -> bool
1032
1033 Test for equality of wx.Point objects.
1034 """
1035 return _core_.Point___eq__(*args, **kwargs)
1036
1037 def __ne__(*args, **kwargs):
1038 """
1039 __ne__(self, PyObject other) -> bool
1040
1041 Test for inequality of wx.Point objects.
1042 """
1043 return _core_.Point___ne__(*args, **kwargs)
1044
1045 def __add__(*args, **kwargs):
1046 """
1047 __add__(self, Point pt) -> Point
1048
1049 Add pt's proprties to this and return the result.
1050 """
1051 return _core_.Point___add__(*args, **kwargs)
1052
1053 def __sub__(*args, **kwargs):
1054 """
1055 __sub__(self, Point pt) -> Point
1056
1057 Subtract pt's proprties from this and return the result
1058 """
1059 return _core_.Point___sub__(*args, **kwargs)
1060
1061 def __iadd__(*args, **kwargs):
1062 """
1063 __iadd__(self, Point pt) -> Point
1064
1065 Add pt to this object.
1066 """
1067 return _core_.Point___iadd__(*args, **kwargs)
1068
1069 def __isub__(*args, **kwargs):
1070 """
1071 __isub__(self, Point pt) -> Point
1072
1073 Subtract pt from this object.
1074 """
1075 return _core_.Point___isub__(*args, **kwargs)
1076
1077 def Set(*args, **kwargs):
1078 """
1079 Set(self, long x, long y)
1080
1081 Set both the x and y properties
1082 """
1083 return _core_.Point_Set(*args, **kwargs)
1084
1085 def Get(*args, **kwargs):
1086 """
1087 Get() -> (x,y)
1088
1089 Return the x and y properties as a tuple.
1090 """
1091 return _core_.Point_Get(*args, **kwargs)
1092
1093 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1094 def __str__(self): return str(self.Get())
1095 def __repr__(self): return 'wx.Point'+str(self.Get())
1096 def __len__(self): return len(self.Get())
1097 def __getitem__(self, index): return self.Get()[index]
1098 def __setitem__(self, index, val):
1099 if index == 0: self.x = val
1100 elif index == 1: self.y = val
1101 else: raise IndexError
1102 def __nonzero__(self): return self.Get() != (0,0)
1103 __safe_for_unpickling__ = True
1104 def __reduce__(self): return (wx.Point, self.Get())
1105
1106 _core_.Point_swigregister(Point)
1107
1108 #---------------------------------------------------------------------------
1109
1110 class Rect(object):
1111 """
1112 A class for representing and manipulating rectangles. It has x, y,
1113 width and height properties. In wxPython most palces that expect a
1114 wx.Rect can also accept a (x,y,width,height) tuple.
1115 """
1116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1117 __repr__ = _swig_repr
1118 def __init__(self, *args, **kwargs):
1119 """
1120 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1121
1122 Create a new Rect object.
1123 """
1124 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1125 __swig_destroy__ = _core_.delete_Rect
1126 __del__ = lambda self : None;
1127 def GetX(*args, **kwargs):
1128 """GetX(self) -> int"""
1129 return _core_.Rect_GetX(*args, **kwargs)
1130
1131 def SetX(*args, **kwargs):
1132 """SetX(self, int x)"""
1133 return _core_.Rect_SetX(*args, **kwargs)
1134
1135 def GetY(*args, **kwargs):
1136 """GetY(self) -> int"""
1137 return _core_.Rect_GetY(*args, **kwargs)
1138
1139 def SetY(*args, **kwargs):
1140 """SetY(self, int y)"""
1141 return _core_.Rect_SetY(*args, **kwargs)
1142
1143 def GetWidth(*args, **kwargs):
1144 """GetWidth(self) -> int"""
1145 return _core_.Rect_GetWidth(*args, **kwargs)
1146
1147 def SetWidth(*args, **kwargs):
1148 """SetWidth(self, int w)"""
1149 return _core_.Rect_SetWidth(*args, **kwargs)
1150
1151 def GetHeight(*args, **kwargs):
1152 """GetHeight(self) -> int"""
1153 return _core_.Rect_GetHeight(*args, **kwargs)
1154
1155 def SetHeight(*args, **kwargs):
1156 """SetHeight(self, int h)"""
1157 return _core_.Rect_SetHeight(*args, **kwargs)
1158
1159 def GetPosition(*args, **kwargs):
1160 """GetPosition(self) -> Point"""
1161 return _core_.Rect_GetPosition(*args, **kwargs)
1162
1163 def SetPosition(*args, **kwargs):
1164 """SetPosition(self, Point p)"""
1165 return _core_.Rect_SetPosition(*args, **kwargs)
1166
1167 def GetSize(*args, **kwargs):
1168 """GetSize(self) -> Size"""
1169 return _core_.Rect_GetSize(*args, **kwargs)
1170
1171 def SetSize(*args, **kwargs):
1172 """SetSize(self, Size s)"""
1173 return _core_.Rect_SetSize(*args, **kwargs)
1174
1175 def IsEmpty(*args, **kwargs):
1176 """IsEmpty(self) -> bool"""
1177 return _core_.Rect_IsEmpty(*args, **kwargs)
1178
1179 def GetTopLeft(*args, **kwargs):
1180 """GetTopLeft(self) -> Point"""
1181 return _core_.Rect_GetTopLeft(*args, **kwargs)
1182
1183 def SetTopLeft(*args, **kwargs):
1184 """SetTopLeft(self, Point p)"""
1185 return _core_.Rect_SetTopLeft(*args, **kwargs)
1186
1187 def GetBottomRight(*args, **kwargs):
1188 """GetBottomRight(self) -> Point"""
1189 return _core_.Rect_GetBottomRight(*args, **kwargs)
1190
1191 def SetBottomRight(*args, **kwargs):
1192 """SetBottomRight(self, Point p)"""
1193 return _core_.Rect_SetBottomRight(*args, **kwargs)
1194
1195 def GetTopRight(*args, **kwargs):
1196 """GetTopRight(self) -> Point"""
1197 return _core_.Rect_GetTopRight(*args, **kwargs)
1198
1199 def SetTopRight(*args, **kwargs):
1200 """SetTopRight(self, Point p)"""
1201 return _core_.Rect_SetTopRight(*args, **kwargs)
1202
1203 def GetBottomLeft(*args, **kwargs):
1204 """GetBottomLeft(self) -> Point"""
1205 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1206
1207 def SetBottomLeft(*args, **kwargs):
1208 """SetBottomLeft(self, Point p)"""
1209 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1210
1211 def GetLeft(*args, **kwargs):
1212 """GetLeft(self) -> int"""
1213 return _core_.Rect_GetLeft(*args, **kwargs)
1214
1215 def GetTop(*args, **kwargs):
1216 """GetTop(self) -> int"""
1217 return _core_.Rect_GetTop(*args, **kwargs)
1218
1219 def GetBottom(*args, **kwargs):
1220 """GetBottom(self) -> int"""
1221 return _core_.Rect_GetBottom(*args, **kwargs)
1222
1223 def GetRight(*args, **kwargs):
1224 """GetRight(self) -> int"""
1225 return _core_.Rect_GetRight(*args, **kwargs)
1226
1227 def SetLeft(*args, **kwargs):
1228 """SetLeft(self, int left)"""
1229 return _core_.Rect_SetLeft(*args, **kwargs)
1230
1231 def SetRight(*args, **kwargs):
1232 """SetRight(self, int right)"""
1233 return _core_.Rect_SetRight(*args, **kwargs)
1234
1235 def SetTop(*args, **kwargs):
1236 """SetTop(self, int top)"""
1237 return _core_.Rect_SetTop(*args, **kwargs)
1238
1239 def SetBottom(*args, **kwargs):
1240 """SetBottom(self, int bottom)"""
1241 return _core_.Rect_SetBottom(*args, **kwargs)
1242
1243 position = property(GetPosition, SetPosition)
1244 size = property(GetSize, SetSize)
1245 left = property(GetLeft, SetLeft)
1246 right = property(GetRight, SetRight)
1247 top = property(GetTop, SetTop)
1248 bottom = property(GetBottom, SetBottom)
1249
1250 def Inflate(*args, **kwargs):
1251 """
1252 Inflate(self, int dx, int dy) -> Rect
1253
1254 Increases the size of the rectangle.
1255
1256 The left border is moved farther left and the right border is moved
1257 farther right by ``dx``. The upper border is moved farther up and the
1258 bottom border is moved farther down by ``dy``. (Note the the width and
1259 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1260 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1261 opposite happens: the rectangle size decreases in the respective
1262 direction.
1263
1264 The change is made to the rectangle inplace, if instead you need a
1265 copy that is inflated, preserving the original then make the copy
1266 first::
1267
1268 copy = wx.Rect(*original)
1269 copy.Inflate(10,15)
1270
1271
1272 """
1273 return _core_.Rect_Inflate(*args, **kwargs)
1274
1275 def Deflate(*args, **kwargs):
1276 """
1277 Deflate(self, int dx, int dy) -> Rect
1278
1279 Decrease the rectangle size. This method is the opposite of `Inflate`
1280 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1281 `Inflate` for a full description.
1282 """
1283 return _core_.Rect_Deflate(*args, **kwargs)
1284
1285 def OffsetXY(*args, **kwargs):
1286 """
1287 OffsetXY(self, int dx, int dy)
1288
1289 Moves the rectangle by the specified offset. If dx is positive, the
1290 rectangle is moved to the right, if dy is positive, it is moved to the
1291 bottom, otherwise it is moved to the left or top respectively.
1292 """
1293 return _core_.Rect_OffsetXY(*args, **kwargs)
1294
1295 def Offset(*args, **kwargs):
1296 """
1297 Offset(self, Point pt)
1298
1299 Same as `OffsetXY` but uses dx,dy from Point
1300 """
1301 return _core_.Rect_Offset(*args, **kwargs)
1302
1303 def Intersect(*args, **kwargs):
1304 """
1305 Intersect(self, Rect rect) -> Rect
1306
1307 Returns the intersectsion of this rectangle and rect.
1308 """
1309 return _core_.Rect_Intersect(*args, **kwargs)
1310
1311 def Union(*args, **kwargs):
1312 """
1313 Union(self, Rect rect) -> Rect
1314
1315 Returns the union of this rectangle and rect.
1316 """
1317 return _core_.Rect_Union(*args, **kwargs)
1318
1319 def __add__(*args, **kwargs):
1320 """
1321 __add__(self, Rect rect) -> Rect
1322
1323 Add the properties of rect to this rectangle and return the result.
1324 """
1325 return _core_.Rect___add__(*args, **kwargs)
1326
1327 def __iadd__(*args, **kwargs):
1328 """
1329 __iadd__(self, Rect rect) -> Rect
1330
1331 Add the properties of rect to this rectangle, updating this rectangle.
1332 """
1333 return _core_.Rect___iadd__(*args, **kwargs)
1334
1335 def __eq__(*args, **kwargs):
1336 """
1337 __eq__(self, PyObject other) -> bool
1338
1339 Test for equality of wx.Rect objects.
1340 """
1341 return _core_.Rect___eq__(*args, **kwargs)
1342
1343 def __ne__(*args, **kwargs):
1344 """
1345 __ne__(self, PyObject other) -> bool
1346
1347 Test for inequality of wx.Rect objects.
1348 """
1349 return _core_.Rect___ne__(*args, **kwargs)
1350
1351 def ContainsXY(*args, **kwargs):
1352 """
1353 ContainsXY(self, int x, int y) -> bool
1354
1355 Return True if the point is inside the rect.
1356 """
1357 return _core_.Rect_ContainsXY(*args, **kwargs)
1358
1359 def Contains(*args, **kwargs):
1360 """
1361 Contains(self, Point pt) -> bool
1362
1363 Return True if the point is inside the rect.
1364 """
1365 return _core_.Rect_Contains(*args, **kwargs)
1366
1367 def ContainsRect(*args, **kwargs):
1368 """
1369 ContainsRect(self, Rect rect) -> bool
1370
1371 Returns ``True`` if the given rectangle is completely inside this
1372 rectangle or touches its boundary.
1373 """
1374 return _core_.Rect_ContainsRect(*args, **kwargs)
1375
1376 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1377 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1378 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1379 Inside = Contains
1380 InsideXY = ContainsXY
1381 InsideRect = ContainsRect
1382
1383 def Intersects(*args, **kwargs):
1384 """
1385 Intersects(self, Rect rect) -> bool
1386
1387 Returns True if the rectangles have a non empty intersection.
1388 """
1389 return _core_.Rect_Intersects(*args, **kwargs)
1390
1391 def CenterIn(*args, **kwargs):
1392 """
1393 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1394
1395 Center this rectangle within the one passed to the method, which is
1396 usually, but not necessarily, the larger one.
1397 """
1398 return _core_.Rect_CenterIn(*args, **kwargs)
1399
1400 CentreIn = CenterIn
1401 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1402 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1403 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1404 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1405 def Set(*args, **kwargs):
1406 """
1407 Set(self, int x=0, int y=0, int width=0, int height=0)
1408
1409 Set all rectangle properties.
1410 """
1411 return _core_.Rect_Set(*args, **kwargs)
1412
1413 def Get(*args, **kwargs):
1414 """
1415 Get() -> (x,y,width,height)
1416
1417 Return the rectangle properties as a tuple.
1418 """
1419 return _core_.Rect_Get(*args, **kwargs)
1420
1421 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1422 def __str__(self): return str(self.Get())
1423 def __repr__(self): return 'wx.Rect'+str(self.Get())
1424 def __len__(self): return len(self.Get())
1425 def __getitem__(self, index): return self.Get()[index]
1426 def __setitem__(self, index, val):
1427 if index == 0: self.x = val
1428 elif index == 1: self.y = val
1429 elif index == 2: self.width = val
1430 elif index == 3: self.height = val
1431 else: raise IndexError
1432 def __nonzero__(self): return self.Get() != (0,0,0,0)
1433 __safe_for_unpickling__ = True
1434 def __reduce__(self): return (wx.Rect, self.Get())
1435
1436 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1437 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
1438 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
1439 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1440 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1441 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1442 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1443 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1444 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1445 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
1446 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
1447 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1448 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1449 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1450 Empty = property(IsEmpty,doc="See `IsEmpty`")
1451 _core_.Rect_swigregister(Rect)
1452
1453 def RectPP(*args, **kwargs):
1454 """
1455 RectPP(Point topLeft, Point bottomRight) -> Rect
1456
1457 Create a new Rect object from Points representing two corners.
1458 """
1459 val = _core_.new_RectPP(*args, **kwargs)
1460 return val
1461
1462 def RectPS(*args, **kwargs):
1463 """
1464 RectPS(Point pos, Size size) -> Rect
1465
1466 Create a new Rect from a position and size.
1467 """
1468 val = _core_.new_RectPS(*args, **kwargs)
1469 return val
1470
1471 def RectS(*args, **kwargs):
1472 """
1473 RectS(Size size) -> Rect
1474
1475 Create a new Rect from a size only.
1476 """
1477 val = _core_.new_RectS(*args, **kwargs)
1478 return val
1479
1480
1481 def IntersectRect(*args, **kwargs):
1482 """
1483 IntersectRect(Rect r1, Rect r2) -> Rect
1484
1485 Calculate and return the intersection of r1 and r2.
1486 """
1487 return _core_.IntersectRect(*args, **kwargs)
1488 #---------------------------------------------------------------------------
1489
1490 class Point2D(object):
1491 """
1492 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1493 with floating point values.
1494 """
1495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1496 __repr__ = _swig_repr
1497 def __init__(self, *args, **kwargs):
1498 """
1499 __init__(self, double x=0.0, double y=0.0) -> Point2D
1500
1501 Create a w.Point2D object.
1502 """
1503 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1504 def GetFloor(*args, **kwargs):
1505 """
1506 GetFloor() -> (x,y)
1507
1508 Convert to integer
1509 """
1510 return _core_.Point2D_GetFloor(*args, **kwargs)
1511
1512 def GetRounded(*args, **kwargs):
1513 """
1514 GetRounded() -> (x,y)
1515
1516 Convert to integer
1517 """
1518 return _core_.Point2D_GetRounded(*args, **kwargs)
1519
1520 def GetVectorLength(*args, **kwargs):
1521 """GetVectorLength(self) -> double"""
1522 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1523
1524 def GetVectorAngle(*args, **kwargs):
1525 """GetVectorAngle(self) -> double"""
1526 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1527
1528 def SetVectorLength(*args, **kwargs):
1529 """SetVectorLength(self, double length)"""
1530 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1531
1532 def SetVectorAngle(*args, **kwargs):
1533 """SetVectorAngle(self, double degrees)"""
1534 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1535
1536 def SetPolarCoordinates(self, angle, length):
1537 self.SetVectorLength(length)
1538 self.SetVectorAngle(angle)
1539 def Normalize(self):
1540 self.SetVectorLength(1.0)
1541
1542 def GetDistance(*args, **kwargs):
1543 """GetDistance(self, Point2D pt) -> double"""
1544 return _core_.Point2D_GetDistance(*args, **kwargs)
1545
1546 def GetDistanceSquare(*args, **kwargs):
1547 """GetDistanceSquare(self, Point2D pt) -> double"""
1548 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1549
1550 def GetDotProduct(*args, **kwargs):
1551 """GetDotProduct(self, Point2D vec) -> double"""
1552 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1553
1554 def GetCrossProduct(*args, **kwargs):
1555 """GetCrossProduct(self, Point2D vec) -> double"""
1556 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1557
1558 def __neg__(*args, **kwargs):
1559 """
1560 __neg__(self) -> Point2D
1561
1562 the reflection of this point
1563 """
1564 return _core_.Point2D___neg__(*args, **kwargs)
1565
1566 def __iadd__(*args, **kwargs):
1567 """__iadd__(self, Point2D pt) -> Point2D"""
1568 return _core_.Point2D___iadd__(*args, **kwargs)
1569
1570 def __isub__(*args, **kwargs):
1571 """__isub__(self, Point2D pt) -> Point2D"""
1572 return _core_.Point2D___isub__(*args, **kwargs)
1573
1574 def __imul__(*args, **kwargs):
1575 """__imul__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___imul__(*args, **kwargs)
1577
1578 def __idiv__(*args, **kwargs):
1579 """__idiv__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___idiv__(*args, **kwargs)
1581
1582 def __eq__(*args, **kwargs):
1583 """
1584 __eq__(self, PyObject other) -> bool
1585
1586 Test for equality of wx.Point2D objects.
1587 """
1588 return _core_.Point2D___eq__(*args, **kwargs)
1589
1590 def __ne__(*args, **kwargs):
1591 """
1592 __ne__(self, PyObject other) -> bool
1593
1594 Test for inequality of wx.Point2D objects.
1595 """
1596 return _core_.Point2D___ne__(*args, **kwargs)
1597
1598 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1599 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1600 def Set(*args, **kwargs):
1601 """Set(self, double x=0, double y=0)"""
1602 return _core_.Point2D_Set(*args, **kwargs)
1603
1604 def Get(*args, **kwargs):
1605 """
1606 Get() -> (x,y)
1607
1608 Return x and y properties as a tuple.
1609 """
1610 return _core_.Point2D_Get(*args, **kwargs)
1611
1612 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1613 def __str__(self): return str(self.Get())
1614 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1615 def __len__(self): return len(self.Get())
1616 def __getitem__(self, index): return self.Get()[index]
1617 def __setitem__(self, index, val):
1618 if index == 0: self.x = val
1619 elif index == 1: self.y = val
1620 else: raise IndexError
1621 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1622 __safe_for_unpickling__ = True
1623 def __reduce__(self): return (wx.Point2D, self.Get())
1624
1625 Floor = property(GetFloor,doc="See `GetFloor`")
1626 Rounded = property(GetRounded,doc="See `GetRounded`")
1627 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1628 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
1629 _core_.Point2D_swigregister(Point2D)
1630
1631 def Point2DCopy(*args, **kwargs):
1632 """
1633 Point2DCopy(Point2D pt) -> Point2D
1634
1635 Create a w.Point2D object.
1636 """
1637 val = _core_.new_Point2DCopy(*args, **kwargs)
1638 return val
1639
1640 def Point2DFromPoint(*args, **kwargs):
1641 """
1642 Point2DFromPoint(Point pt) -> Point2D
1643
1644 Create a w.Point2D object.
1645 """
1646 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1647 return val
1648
1649 #---------------------------------------------------------------------------
1650
1651 FromStart = _core_.FromStart
1652 FromCurrent = _core_.FromCurrent
1653 FromEnd = _core_.FromEnd
1654 class InputStream(object):
1655 """Proxy of C++ InputStream class"""
1656 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1657 __repr__ = _swig_repr
1658 def __init__(self, *args, **kwargs):
1659 """__init__(self, PyObject p) -> InputStream"""
1660 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1661 __swig_destroy__ = _core_.delete_InputStream
1662 __del__ = lambda self : None;
1663 def close(*args, **kwargs):
1664 """close(self)"""
1665 return _core_.InputStream_close(*args, **kwargs)
1666
1667 def flush(*args, **kwargs):
1668 """flush(self)"""
1669 return _core_.InputStream_flush(*args, **kwargs)
1670
1671 def eof(*args, **kwargs):
1672 """eof(self) -> bool"""
1673 return _core_.InputStream_eof(*args, **kwargs)
1674
1675 def read(*args, **kwargs):
1676 """read(self, int size=-1) -> PyObject"""
1677 return _core_.InputStream_read(*args, **kwargs)
1678
1679 def readline(*args, **kwargs):
1680 """readline(self, int size=-1) -> PyObject"""
1681 return _core_.InputStream_readline(*args, **kwargs)
1682
1683 def readlines(*args, **kwargs):
1684 """readlines(self, int sizehint=-1) -> PyObject"""
1685 return _core_.InputStream_readlines(*args, **kwargs)
1686
1687 def seek(*args, **kwargs):
1688 """seek(self, int offset, int whence=0)"""
1689 return _core_.InputStream_seek(*args, **kwargs)
1690
1691 def tell(*args, **kwargs):
1692 """tell(self) -> int"""
1693 return _core_.InputStream_tell(*args, **kwargs)
1694
1695 def Peek(*args, **kwargs):
1696 """Peek(self) -> char"""
1697 return _core_.InputStream_Peek(*args, **kwargs)
1698
1699 def GetC(*args, **kwargs):
1700 """GetC(self) -> char"""
1701 return _core_.InputStream_GetC(*args, **kwargs)
1702
1703 def LastRead(*args, **kwargs):
1704 """LastRead(self) -> size_t"""
1705 return _core_.InputStream_LastRead(*args, **kwargs)
1706
1707 def CanRead(*args, **kwargs):
1708 """CanRead(self) -> bool"""
1709 return _core_.InputStream_CanRead(*args, **kwargs)
1710
1711 def Eof(*args, **kwargs):
1712 """Eof(self) -> bool"""
1713 return _core_.InputStream_Eof(*args, **kwargs)
1714
1715 def Ungetch(*args, **kwargs):
1716 """Ungetch(self, char c) -> bool"""
1717 return _core_.InputStream_Ungetch(*args, **kwargs)
1718
1719 def SeekI(*args, **kwargs):
1720 """SeekI(self, long pos, int mode=FromStart) -> long"""
1721 return _core_.InputStream_SeekI(*args, **kwargs)
1722
1723 def TellI(*args, **kwargs):
1724 """TellI(self) -> long"""
1725 return _core_.InputStream_TellI(*args, **kwargs)
1726
1727 _core_.InputStream_swigregister(InputStream)
1728 DefaultPosition = cvar.DefaultPosition
1729 DefaultSize = cvar.DefaultSize
1730
1731 class OutputStream(object):
1732 """Proxy of C++ OutputStream class"""
1733 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1734 def __init__(self): raise AttributeError, "No constructor defined"
1735 __repr__ = _swig_repr
1736 def write(*args, **kwargs):
1737 """write(self, PyObject obj)"""
1738 return _core_.OutputStream_write(*args, **kwargs)
1739
1740 def LastWrite(*args, **kwargs):
1741 """LastWrite(self) -> size_t"""
1742 return _core_.OutputStream_LastWrite(*args, **kwargs)
1743
1744 _core_.OutputStream_swigregister(OutputStream)
1745
1746 #---------------------------------------------------------------------------
1747
1748 class FSFile(Object):
1749 """Proxy of C++ FSFile class"""
1750 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1751 __repr__ = _swig_repr
1752 def __init__(self, *args, **kwargs):
1753 """
1754 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1755 DateTime modif) -> FSFile
1756 """
1757 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1758 __swig_destroy__ = _core_.delete_FSFile
1759 __del__ = lambda self : None;
1760 def GetStream(*args, **kwargs):
1761 """GetStream(self) -> InputStream"""
1762 return _core_.FSFile_GetStream(*args, **kwargs)
1763
1764 def DetachStream(*args, **kwargs):
1765 """DetachStream(self)"""
1766 return _core_.FSFile_DetachStream(*args, **kwargs)
1767
1768 def GetMimeType(*args, **kwargs):
1769 """GetMimeType(self) -> String"""
1770 return _core_.FSFile_GetMimeType(*args, **kwargs)
1771
1772 def GetLocation(*args, **kwargs):
1773 """GetLocation(self) -> String"""
1774 return _core_.FSFile_GetLocation(*args, **kwargs)
1775
1776 def GetAnchor(*args, **kwargs):
1777 """GetAnchor(self) -> String"""
1778 return _core_.FSFile_GetAnchor(*args, **kwargs)
1779
1780 def GetModificationTime(*args, **kwargs):
1781 """GetModificationTime(self) -> DateTime"""
1782 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1783
1784 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1785 Location = property(GetLocation,doc="See `GetLocation`")
1786 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1787 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1788 Stream = property(GetStream,doc="See `GetStream`")
1789 _core_.FSFile_swigregister(FSFile)
1790
1791 class CPPFileSystemHandler(object):
1792 """Proxy of C++ CPPFileSystemHandler class"""
1793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1794 def __init__(self): raise AttributeError, "No constructor defined"
1795 __repr__ = _swig_repr
1796 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1797 __del__ = lambda self : None;
1798 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1799
1800 class FileSystemHandler(CPPFileSystemHandler):
1801 """Proxy of C++ FileSystemHandler class"""
1802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1803 __repr__ = _swig_repr
1804 def __init__(self, *args, **kwargs):
1805 """__init__(self) -> FileSystemHandler"""
1806 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1807 self._setCallbackInfo(self, FileSystemHandler)
1808
1809 def _setCallbackInfo(*args, **kwargs):
1810 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1811 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1812
1813 def CanOpen(*args, **kwargs):
1814 """CanOpen(self, String location) -> bool"""
1815 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1816
1817 def OpenFile(*args, **kwargs):
1818 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1819 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1820
1821 def FindFirst(*args, **kwargs):
1822 """FindFirst(self, String spec, int flags=0) -> String"""
1823 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1824
1825 def FindNext(*args, **kwargs):
1826 """FindNext(self) -> String"""
1827 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1828
1829 def GetProtocol(*args, **kwargs):
1830 """GetProtocol(self, String location) -> String"""
1831 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1832
1833 def GetLeftLocation(*args, **kwargs):
1834 """GetLeftLocation(self, String location) -> String"""
1835 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1836
1837 def GetAnchor(*args, **kwargs):
1838 """GetAnchor(self, String location) -> String"""
1839 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1840
1841 def GetRightLocation(*args, **kwargs):
1842 """GetRightLocation(self, String location) -> String"""
1843 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1844
1845 def GetMimeTypeFromExt(*args, **kwargs):
1846 """GetMimeTypeFromExt(self, String location) -> String"""
1847 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1848
1849 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1850 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1851 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1852 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1853 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
1854 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1855
1856 class FileSystem(Object):
1857 """Proxy of C++ FileSystem class"""
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
1861 """__init__(self) -> FileSystem"""
1862 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1863 __swig_destroy__ = _core_.delete_FileSystem
1864 __del__ = lambda self : None;
1865 def ChangePathTo(*args, **kwargs):
1866 """ChangePathTo(self, String location, bool is_dir=False)"""
1867 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1868
1869 def GetPath(*args, **kwargs):
1870 """GetPath(self) -> String"""
1871 return _core_.FileSystem_GetPath(*args, **kwargs)
1872
1873 def OpenFile(*args, **kwargs):
1874 """OpenFile(self, String location) -> FSFile"""
1875 return _core_.FileSystem_OpenFile(*args, **kwargs)
1876
1877 def FindFirst(*args, **kwargs):
1878 """FindFirst(self, String spec, int flags=0) -> String"""
1879 return _core_.FileSystem_FindFirst(*args, **kwargs)
1880
1881 def FindNext(*args, **kwargs):
1882 """FindNext(self) -> String"""
1883 return _core_.FileSystem_FindNext(*args, **kwargs)
1884
1885 def AddHandler(*args, **kwargs):
1886 """AddHandler(CPPFileSystemHandler handler)"""
1887 return _core_.FileSystem_AddHandler(*args, **kwargs)
1888
1889 AddHandler = staticmethod(AddHandler)
1890 def RemoveHandler(*args, **kwargs):
1891 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1892 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1893
1894 RemoveHandler = staticmethod(RemoveHandler)
1895 def CleanUpHandlers(*args, **kwargs):
1896 """CleanUpHandlers()"""
1897 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1898
1899 CleanUpHandlers = staticmethod(CleanUpHandlers)
1900 def FileNameToURL(*args, **kwargs):
1901 """FileNameToURL(String filename) -> String"""
1902 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1903
1904 FileNameToURL = staticmethod(FileNameToURL)
1905 def URLToFileName(*args, **kwargs):
1906 """URLToFileName(String url) -> String"""
1907 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1908
1909 URLToFileName = staticmethod(URLToFileName)
1910 Path = property(GetPath,doc="See `GetPath`")
1911 _core_.FileSystem_swigregister(FileSystem)
1912
1913 def FileSystem_AddHandler(*args, **kwargs):
1914 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1915 return _core_.FileSystem_AddHandler(*args, **kwargs)
1916
1917 def FileSystem_RemoveHandler(*args, **kwargs):
1918 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1919 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1920
1921 def FileSystem_CleanUpHandlers(*args):
1922 """FileSystem_CleanUpHandlers()"""
1923 return _core_.FileSystem_CleanUpHandlers(*args)
1924
1925 def FileSystem_FileNameToURL(*args, **kwargs):
1926 """FileSystem_FileNameToURL(String filename) -> String"""
1927 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1928
1929 def FileSystem_URLToFileName(*args, **kwargs):
1930 """FileSystem_URLToFileName(String url) -> String"""
1931 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1932
1933 class InternetFSHandler(CPPFileSystemHandler):
1934 """Proxy of C++ InternetFSHandler class"""
1935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1936 __repr__ = _swig_repr
1937 def __init__(self, *args, **kwargs):
1938 """__init__(self) -> InternetFSHandler"""
1939 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1940 def CanOpen(*args, **kwargs):
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1943
1944 def OpenFile(*args, **kwargs):
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1947
1948 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1949
1950 class ZipFSHandler(CPPFileSystemHandler):
1951 """Proxy of C++ ZipFSHandler class"""
1952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1953 __repr__ = _swig_repr
1954 def __init__(self, *args, **kwargs):
1955 """__init__(self) -> ZipFSHandler"""
1956 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1957 def CanOpen(*args, **kwargs):
1958 """CanOpen(self, String location) -> bool"""
1959 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1960
1961 def OpenFile(*args, **kwargs):
1962 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1963 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1964
1965 def FindFirst(*args, **kwargs):
1966 """FindFirst(self, String spec, int flags=0) -> String"""
1967 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1968
1969 def FindNext(*args, **kwargs):
1970 """FindNext(self) -> String"""
1971 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1972
1973 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1974
1975
1976 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1977 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1978 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1979
1980 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1981 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1982 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1983
1984 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1985 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1986 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1987 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1988 """
1989 Add 'file' to the memory filesystem. The dataItem parameter can
1990 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1991 arbitrary data. If a bitmap or image is used then the imgType
1992 parameter should specify what kind of image file it should be
1993 written as, wx.BITMAP_TYPE_PNG, etc.
1994 """
1995 if isinstance(dataItem, wx.Image):
1996 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1997 elif isinstance(dataItem, wx.Bitmap):
1998 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1999 elif type(dataItem) == str:
2000 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2001 else:
2002 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2003
2004 class MemoryFSHandler(CPPFileSystemHandler):
2005 """Proxy of C++ MemoryFSHandler class"""
2006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2007 __repr__ = _swig_repr
2008 def __init__(self, *args, **kwargs):
2009 """__init__(self) -> MemoryFSHandler"""
2010 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
2011 def RemoveFile(*args, **kwargs):
2012 """RemoveFile(String filename)"""
2013 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2014
2015 RemoveFile = staticmethod(RemoveFile)
2016 AddFile = staticmethod(MemoryFSHandler_AddFile)
2017 def CanOpen(*args, **kwargs):
2018 """CanOpen(self, String location) -> bool"""
2019 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2020
2021 def OpenFile(*args, **kwargs):
2022 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2023 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2024
2025 def FindFirst(*args, **kwargs):
2026 """FindFirst(self, String spec, int flags=0) -> String"""
2027 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2028
2029 def FindNext(*args, **kwargs):
2030 """FindNext(self) -> String"""
2031 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2032
2033 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
2034
2035 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2036 """MemoryFSHandler_RemoveFile(String filename)"""
2037 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2038
2039 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2040 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2041 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2042 IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2043 IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
2044 #---------------------------------------------------------------------------
2045
2046 class ImageHandler(Object):
2047 """
2048 This is the base class for implementing image file loading/saving, and
2049 image creation from data. It is used within `wx.Image` and is not
2050 normally seen by the application.
2051 """
2052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2053 def __init__(self): raise AttributeError, "No constructor defined"
2054 __repr__ = _swig_repr
2055 def GetName(*args, **kwargs):
2056 """GetName(self) -> String"""
2057 return _core_.ImageHandler_GetName(*args, **kwargs)
2058
2059 def GetExtension(*args, **kwargs):
2060 """GetExtension(self) -> String"""
2061 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2062
2063 def GetType(*args, **kwargs):
2064 """GetType(self) -> long"""
2065 return _core_.ImageHandler_GetType(*args, **kwargs)
2066
2067 def GetMimeType(*args, **kwargs):
2068 """GetMimeType(self) -> String"""
2069 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2070
2071 def CanRead(*args, **kwargs):
2072 """CanRead(self, String name) -> bool"""
2073 return _core_.ImageHandler_CanRead(*args, **kwargs)
2074
2075 def CanReadStream(*args, **kwargs):
2076 """CanReadStream(self, InputStream stream) -> bool"""
2077 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2078
2079 def SetName(*args, **kwargs):
2080 """SetName(self, String name)"""
2081 return _core_.ImageHandler_SetName(*args, **kwargs)
2082
2083 def SetExtension(*args, **kwargs):
2084 """SetExtension(self, String extension)"""
2085 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2086
2087 def SetType(*args, **kwargs):
2088 """SetType(self, long type)"""
2089 return _core_.ImageHandler_SetType(*args, **kwargs)
2090
2091 def SetMimeType(*args, **kwargs):
2092 """SetMimeType(self, String mimetype)"""
2093 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2094
2095 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2096 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2097 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2098 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2099 _core_.ImageHandler_swigregister(ImageHandler)
2100
2101 class PyImageHandler(ImageHandler):
2102 """
2103 This is the base class for implementing image file loading/saving, and
2104 image creation from data, all written in Python. To create a custom
2105 image handler derive a new class from wx.PyImageHandler and provide
2106 the following methods::
2107
2108 def DoCanRead(self, stream) --> bool
2109 '''Check if this handler can read the image on the stream'''
2110
2111 def LoadFile(self, image, stream, verbose, index) --> bool
2112 '''Load image data from the stream and load it into image.'''
2113
2114 def SaveFile(self, image, stream, verbose) --> bool
2115 '''Save the iamge data in image to the stream using
2116 this handler's image file format.'''
2117
2118 def GetImageCount(self, stream) --> int
2119 '''If this image format can hold more than one image,
2120 how many does the image on the stream have?'''
2121
2122 To activate your handler create an instance of it and pass it to
2123 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2124 `SetExtension` from your constructor.
2125
2126 """
2127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2128 __repr__ = _swig_repr
2129 def __init__(self, *args, **kwargs):
2130 """
2131 __init__(self) -> PyImageHandler
2132
2133 This is the base class for implementing image file loading/saving, and
2134 image creation from data, all written in Python. To create a custom
2135 image handler derive a new class from wx.PyImageHandler and provide
2136 the following methods::
2137
2138 def DoCanRead(self, stream) --> bool
2139 '''Check if this handler can read the image on the stream'''
2140
2141 def LoadFile(self, image, stream, verbose, index) --> bool
2142 '''Load image data from the stream and load it into image.'''
2143
2144 def SaveFile(self, image, stream, verbose) --> bool
2145 '''Save the iamge data in image to the stream using
2146 this handler's image file format.'''
2147
2148 def GetImageCount(self, stream) --> int
2149 '''If this image format can hold more than one image,
2150 how many does the image on the stream have?'''
2151
2152 To activate your handler create an instance of it and pass it to
2153 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2154 `SetExtension` from your constructor.
2155
2156 """
2157 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2158 self._SetSelf(self)
2159
2160 def _SetSelf(*args, **kwargs):
2161 """_SetSelf(self, PyObject self)"""
2162 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2163
2164 _core_.PyImageHandler_swigregister(PyImageHandler)
2165
2166 class ImageHistogram(object):
2167 """Proxy of C++ ImageHistogram class"""
2168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2169 __repr__ = _swig_repr
2170 def __init__(self, *args, **kwargs):
2171 """__init__(self) -> ImageHistogram"""
2172 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2173 def MakeKey(*args, **kwargs):
2174 """
2175 MakeKey(byte r, byte g, byte b) -> unsigned long
2176
2177 Get the key in the histogram for the given RGB values
2178 """
2179 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2180
2181 MakeKey = staticmethod(MakeKey)
2182 def FindFirstUnusedColour(*args, **kwargs):
2183 """
2184 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2185
2186 Find first colour that is not used in the image and has higher RGB
2187 values than startR, startG, startB. Returns a tuple consisting of a
2188 success flag and rgb values.
2189 """
2190 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2191
2192 def GetCount(*args, **kwargs):
2193 """
2194 GetCount(self, unsigned long key) -> unsigned long
2195
2196 Returns the pixel count for the given key. Use `MakeKey` to create a
2197 key value from a RGB tripple.
2198 """
2199 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2200
2201 def GetCountRGB(*args, **kwargs):
2202 """
2203 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2204
2205 Returns the pixel count for the given RGB values.
2206 """
2207 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2208
2209 def GetCountColour(*args, **kwargs):
2210 """
2211 GetCountColour(self, Colour colour) -> unsigned long
2212
2213 Returns the pixel count for the given `wx.Colour` value.
2214 """
2215 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2216
2217 _core_.ImageHistogram_swigregister(ImageHistogram)
2218
2219 def ImageHistogram_MakeKey(*args, **kwargs):
2220 """
2221 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2222
2223 Get the key in the histogram for the given RGB values
2224 """
2225 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2226
2227 class Image_RGBValue(object):
2228 """
2229 An object that contains values for red, green and blue which represent
2230 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2231 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2232 color space.
2233 """
2234 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2235 __repr__ = _swig_repr
2236 def __init__(self, *args, **kwargs):
2237 """
2238 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2239
2240 Constructor.
2241 """
2242 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2243 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2244 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2245 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2246 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2247
2248 class Image_HSVValue(object):
2249 """
2250 An object that contains values for hue, saturation and value which
2251 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2252 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2253 color space.
2254 """
2255 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2256 __repr__ = _swig_repr
2257 def __init__(self, *args, **kwargs):
2258 """
2259 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2260
2261 Constructor.
2262 """
2263 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2264 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2265 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2266 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2267 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2268
2269 class Image(Object):
2270 """
2271 A platform-independent image class. An image can be created from
2272 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2273 variety of formats. Functions are available to set and get image
2274 bits, so it can be used for basic image manipulation.
2275
2276 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2277 platform-specific `wx.Bitmap` object must be created from it using the
2278 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2279 device context, using `wx.DC.DrawBitmap`.
2280
2281 One colour value of the image may be used as a mask colour which will
2282 lead to the automatic creation of a `wx.Mask` object associated to the
2283 bitmap object.
2284
2285 wx.Image supports alpha channel data, that is in addition to a byte
2286 for the red, green and blue colour components for each pixel it also
2287 stores a byte representing the pixel opacity. An alpha value of 0
2288 corresponds to a transparent pixel (null opacity) while a value of 255
2289 means that the pixel is 100% opaque.
2290
2291 Unlike RGB data, not all images have an alpha channel and before using
2292 `GetAlpha` you should check if this image contains an alpha channel
2293 with `HasAlpha`. Note that currently only images loaded from PNG files
2294 with transparency information will have an alpha channel.
2295 """
2296 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2297 __repr__ = _swig_repr
2298 def __init__(self, *args, **kwargs):
2299 """
2300 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2301
2302 Loads an image from a file.
2303 """
2304 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2305 __swig_destroy__ = _core_.delete_Image
2306 __del__ = lambda self : None;
2307 def Create(*args, **kwargs):
2308 """
2309 Create(self, int width, int height, bool clear=True)
2310
2311 Creates a fresh image. If clear is ``True``, the new image will be
2312 initialized to black. Otherwise, the image data will be uninitialized.
2313 """
2314 return _core_.Image_Create(*args, **kwargs)
2315
2316 def Destroy(*args, **kwargs):
2317 """
2318 Destroy(self)
2319
2320 Destroys the image data.
2321 """
2322 val = _core_.Image_Destroy(*args, **kwargs)
2323 args[0].thisown = 0
2324 return val
2325
2326 def Scale(*args, **kwargs):
2327 """
2328 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2329
2330 Returns a scaled version of the image. This is also useful for scaling
2331 bitmaps in general as the only other way to scale bitmaps is to blit a
2332 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2333 specifies what method to use for resampling the image. It can be
2334 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2335 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2336 bicubic and box averaging resampling methods for upsampling and
2337 downsampling respectively.
2338 """
2339 return _core_.Image_Scale(*args, **kwargs)
2340
2341 def ResampleBox(*args, **kwargs):
2342 """ResampleBox(self, int width, int height) -> Image"""
2343 return _core_.Image_ResampleBox(*args, **kwargs)
2344
2345 def ResampleBicubic(*args, **kwargs):
2346 """ResampleBicubic(self, int width, int height) -> Image"""
2347 return _core_.Image_ResampleBicubic(*args, **kwargs)
2348
2349 def Blur(*args, **kwargs):
2350 """
2351 Blur(self, int radius) -> Image
2352
2353 Blurs the image in both horizontal and vertical directions by the
2354 specified pixel ``radius``. This should not be used when using a
2355 single mask colour for transparency.
2356 """
2357 return _core_.Image_Blur(*args, **kwargs)
2358
2359 def BlurHorizontal(*args, **kwargs):
2360 """
2361 BlurHorizontal(self, int radius) -> Image
2362
2363 Blurs the image in the horizontal direction only. This should not be
2364 used when using a single mask colour for transparency.
2365
2366 """
2367 return _core_.Image_BlurHorizontal(*args, **kwargs)
2368
2369 def BlurVertical(*args, **kwargs):
2370 """
2371 BlurVertical(self, int radius) -> Image
2372
2373 Blurs the image in the vertical direction only. This should not be
2374 used when using a single mask colour for transparency.
2375 """
2376 return _core_.Image_BlurVertical(*args, **kwargs)
2377
2378 def ShrinkBy(*args, **kwargs):
2379 """
2380 ShrinkBy(self, int xFactor, int yFactor) -> Image
2381
2382 Return a version of the image scaled smaller by the given factors.
2383 """
2384 return _core_.Image_ShrinkBy(*args, **kwargs)
2385
2386 def Rescale(*args, **kwargs):
2387 """
2388 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2389
2390 Changes the size of the image in-place by scaling it: after a call to
2391 this function, the image will have the given width and height.
2392
2393 Returns the (modified) image itself.
2394 """
2395 return _core_.Image_Rescale(*args, **kwargs)
2396
2397 def Resize(*args, **kwargs):
2398 """
2399 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2400
2401 Changes the size of the image in-place without scaling it, by adding
2402 either a border with the given colour or cropping as necessary. The
2403 image is pasted into a new image with the given size and background
2404 colour at the position pos relative to the upper left of the new
2405 image. If red = green = blue = -1 then use either the current mask
2406 colour if set or find, use, and set a suitable mask colour for any
2407 newly exposed areas.
2408
2409 Returns the (modified) image itself.
2410 """
2411 return _core_.Image_Resize(*args, **kwargs)
2412
2413 def SetRGB(*args, **kwargs):
2414 """
2415 SetRGB(self, int x, int y, byte r, byte g, byte b)
2416
2417 Sets the pixel at the given coordinate. This routine performs
2418 bounds-checks for the coordinate so it can be considered a safe way to
2419 manipulate the data, but in some cases this might be too slow so that
2420 the data will have to be set directly. In that case you will have to
2421 get access to the image data using the `GetData` method.
2422 """
2423 return _core_.Image_SetRGB(*args, **kwargs)
2424
2425 def SetRGBRect(*args, **kwargs):
2426 """
2427 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2428
2429 Sets the colour of the pixels within the given rectangle. This routine
2430 performs bounds-checks for the rectangle so it can be considered a
2431 safe way to manipulate the data.
2432 """
2433 return _core_.Image_SetRGBRect(*args, **kwargs)
2434
2435 def GetRed(*args, **kwargs):
2436 """
2437 GetRed(self, int x, int y) -> byte
2438
2439 Returns the red intensity at the given coordinate.
2440 """
2441 return _core_.Image_GetRed(*args, **kwargs)
2442
2443 def GetGreen(*args, **kwargs):
2444 """
2445 GetGreen(self, int x, int y) -> byte
2446
2447 Returns the green intensity at the given coordinate.
2448 """
2449 return _core_.Image_GetGreen(*args, **kwargs)
2450
2451 def GetBlue(*args, **kwargs):
2452 """
2453 GetBlue(self, int x, int y) -> byte
2454
2455 Returns the blue intensity at the given coordinate.
2456 """
2457 return _core_.Image_GetBlue(*args, **kwargs)
2458
2459 def SetAlpha(*args, **kwargs):
2460 """
2461 SetAlpha(self, int x, int y, byte alpha)
2462
2463 Sets the alpha value for the given pixel. This function should only be
2464 called if the image has alpha channel data, use `HasAlpha` to check
2465 for this.
2466 """
2467 return _core_.Image_SetAlpha(*args, **kwargs)
2468
2469 def GetAlpha(*args, **kwargs):
2470 """
2471 GetAlpha(self, int x, int y) -> byte
2472
2473 Returns the alpha value for the given pixel. This function may only be
2474 called for the images with alpha channel, use `HasAlpha` to check for
2475 this.
2476
2477 The returned value is the *opacity* of the image, i.e. the value of 0
2478 corresponds to the fully transparent pixels while the value of 255 to
2479 the fully opaque pixels.
2480 """
2481 return _core_.Image_GetAlpha(*args, **kwargs)
2482
2483 def HasAlpha(*args, **kwargs):
2484 """
2485 HasAlpha(self) -> bool
2486
2487 Returns true if this image has alpha channel, false otherwise.
2488 """
2489 return _core_.Image_HasAlpha(*args, **kwargs)
2490
2491 def InitAlpha(*args, **kwargs):
2492 """
2493 InitAlpha(self)
2494
2495 Initializes the image alpha channel data. It is an error to call it if
2496 the image already has alpha data. If it doesn't, alpha data will be by
2497 default initialized to all pixels being fully opaque. But if the image
2498 has a a mask colour, all mask pixels will be completely transparent.
2499 """
2500 return _core_.Image_InitAlpha(*args, **kwargs)
2501
2502 def IsTransparent(*args, **kwargs):
2503 """
2504 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2505
2506 Returns ``True`` if this pixel is masked or has an alpha value less
2507 than the spcified threshold.
2508 """
2509 return _core_.Image_IsTransparent(*args, **kwargs)
2510
2511 def FindFirstUnusedColour(*args, **kwargs):
2512 """
2513 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2514
2515 Find first colour that is not used in the image and has higher RGB
2516 values than startR, startG, startB. Returns a tuple consisting of a
2517 success flag and rgb values.
2518 """
2519 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2520
2521 def ConvertAlphaToMask(*args, **kwargs):
2522 """
2523 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2524
2525 If the image has alpha channel, this method converts it to mask. All
2526 pixels with alpha value less than ``threshold`` are replaced with the
2527 mask colour and the alpha channel is removed. The mask colour is
2528 chosen automatically using `FindFirstUnusedColour`.
2529
2530 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2531 nothing.
2532 """
2533 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2534
2535 def ConvertColourToAlpha(*args, **kwargs):
2536 """
2537 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2538
2539 This method converts an image where the original alpha information is
2540 only available as a shades of a colour (actually shades of grey)
2541 typically when you draw anti-aliased text into a bitmap. The DC
2542 drawing routines draw grey values on the black background although
2543 they actually mean to draw white with differnt alpha values. This
2544 method reverses it, assuming a black (!) background and white text.
2545 The method will then fill up the whole image with the colour given.
2546 """
2547 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2548
2549 def SetMaskFromImage(*args, **kwargs):
2550 """
2551 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2552
2553 Sets the image's mask so that the pixels that have RGB value of
2554 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2555 by first finding an unused colour in the image, setting this colour as
2556 the mask colour and then using this colour to draw all pixels in the
2557 image who corresponding pixel in mask has given RGB value.
2558
2559 Returns ``False`` if ``mask`` does not have same dimensions as the
2560 image or if there is no unused colour left. Returns ``True`` if the
2561 mask was successfully applied.
2562
2563 Note that this method involves computing the histogram, which is
2564 computationally intensive operation.
2565 """
2566 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2567
2568 def CanRead(*args, **kwargs):
2569 """
2570 CanRead(String filename) -> bool
2571
2572 Returns True if the image handlers can read this file.
2573 """
2574 return _core_.Image_CanRead(*args, **kwargs)
2575
2576 CanRead = staticmethod(CanRead)
2577 def GetImageCount(*args, **kwargs):
2578 """
2579 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2580
2581 If the image file contains more than one image and the image handler
2582 is capable of retrieving these individually, this function will return
2583 the number of available images.
2584 """
2585 return _core_.Image_GetImageCount(*args, **kwargs)
2586
2587 GetImageCount = staticmethod(GetImageCount)
2588 def LoadFile(*args, **kwargs):
2589 """
2590 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2591
2592 Loads an image from a file. If no handler type is provided, the
2593 library will try to autodetect the format.
2594 """
2595 return _core_.Image_LoadFile(*args, **kwargs)
2596
2597 def LoadMimeFile(*args, **kwargs):
2598 """
2599 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2600
2601 Loads an image from a file, specifying the image type with a MIME type
2602 string.
2603 """
2604 return _core_.Image_LoadMimeFile(*args, **kwargs)
2605
2606 def SaveFile(*args, **kwargs):
2607 """
2608 SaveFile(self, String name, int type) -> bool
2609
2610 Saves an image in the named file.
2611 """
2612 return _core_.Image_SaveFile(*args, **kwargs)
2613
2614 def SaveMimeFile(*args, **kwargs):
2615 """
2616 SaveMimeFile(self, String name, String mimetype) -> bool
2617
2618 Saves an image in the named file.
2619 """
2620 return _core_.Image_SaveMimeFile(*args, **kwargs)
2621
2622 def CanReadStream(*args, **kwargs):
2623 """
2624 CanReadStream(InputStream stream) -> bool
2625
2626 Returns True if the image handlers can read an image file from the
2627 data currently on the input stream, or a readable Python file-like
2628 object.
2629 """
2630 return _core_.Image_CanReadStream(*args, **kwargs)
2631
2632 CanReadStream = staticmethod(CanReadStream)
2633 def LoadStream(*args, **kwargs):
2634 """
2635 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2636
2637 Loads an image from an input stream or a readable Python file-like
2638 object. If no handler type is provided, the library will try to
2639 autodetect the format.
2640 """
2641 return _core_.Image_LoadStream(*args, **kwargs)
2642
2643 def LoadMimeStream(*args, **kwargs):
2644 """
2645 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2646
2647 Loads an image from an input stream or a readable Python file-like
2648 object, using a MIME type string to specify the image file format.
2649 """
2650 return _core_.Image_LoadMimeStream(*args, **kwargs)
2651
2652 def Ok(*args, **kwargs):
2653 """
2654 Ok(self) -> bool
2655
2656 Returns true if image data is present.
2657 """
2658 return _core_.Image_Ok(*args, **kwargs)
2659
2660 def GetWidth(*args, **kwargs):
2661 """
2662 GetWidth(self) -> int
2663
2664 Gets the width of the image in pixels.
2665 """
2666 return _core_.Image_GetWidth(*args, **kwargs)
2667
2668 def GetHeight(*args, **kwargs):
2669 """
2670 GetHeight(self) -> int
2671
2672 Gets the height of the image in pixels.
2673 """
2674 return _core_.Image_GetHeight(*args, **kwargs)
2675
2676 def GetSize(*args, **kwargs):
2677 """
2678 GetSize(self) -> Size
2679
2680 Returns the size of the image in pixels.
2681 """
2682 return _core_.Image_GetSize(*args, **kwargs)
2683
2684 def GetSubImage(*args, **kwargs):
2685 """
2686 GetSubImage(self, Rect rect) -> Image
2687
2688 Returns a sub image of the current one as long as the rect belongs
2689 entirely to the image.
2690 """
2691 return _core_.Image_GetSubImage(*args, **kwargs)
2692
2693 def Size(*args, **kwargs):
2694 """
2695 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2696
2697 Returns a resized version of this image without scaling it by adding
2698 either a border with the given colour or cropping as necessary. The
2699 image is pasted into a new image with the given size and background
2700 colour at the position ``pos`` relative to the upper left of the new
2701 image. If red = green = blue = -1 then use either the current mask
2702 colour if set or find, use, and set a suitable mask colour for any
2703 newly exposed areas.
2704 """
2705 return _core_.Image_Size(*args, **kwargs)
2706
2707 def Copy(*args, **kwargs):
2708 """
2709 Copy(self) -> Image
2710
2711 Returns an identical copy of the image.
2712 """
2713 return _core_.Image_Copy(*args, **kwargs)
2714
2715 def Paste(*args, **kwargs):
2716 """
2717 Paste(self, Image image, int x, int y)
2718
2719 Pastes ``image`` into this instance and takes care of the mask colour
2720 and any out of bounds problems.
2721 """
2722 return _core_.Image_Paste(*args, **kwargs)
2723
2724 def GetData(*args, **kwargs):
2725 """
2726 GetData(self) -> PyObject
2727
2728 Returns a string containing a copy of the RGB bytes of the image.
2729 """
2730 return _core_.Image_GetData(*args, **kwargs)
2731
2732 def SetData(*args, **kwargs):
2733 """
2734 SetData(self, buffer data)
2735
2736 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2737 either a string or a buffer object holding the data and the length of
2738 the data must be width*height*3.
2739 """
2740 return _core_.Image_SetData(*args, **kwargs)
2741
2742 def GetDataBuffer(*args, **kwargs):
2743 """
2744 GetDataBuffer(self) -> PyObject
2745
2746 Returns a writable Python buffer object that is pointing at the RGB
2747 image data buffer inside the wx.Image. You need to ensure that you do
2748 not use this buffer object after the image has been destroyed.
2749 """
2750 return _core_.Image_GetDataBuffer(*args, **kwargs)
2751
2752 def SetDataBuffer(*args, **kwargs):
2753 """
2754 SetDataBuffer(self, buffer data)
2755
2756 Sets the internal image data pointer to point at a Python buffer
2757 object. This can save making an extra copy of the data but you must
2758 ensure that the buffer object lives longer than the wx.Image does.
2759 """
2760 return _core_.Image_SetDataBuffer(*args, **kwargs)
2761
2762 def GetAlphaData(*args, **kwargs):
2763 """
2764 GetAlphaData(self) -> PyObject
2765
2766 Returns a string containing a copy of the alpha bytes of the image.
2767 """
2768 return _core_.Image_GetAlphaData(*args, **kwargs)
2769
2770 def SetAlphaData(*args, **kwargs):
2771 """
2772 SetAlphaData(self, buffer alpha)
2773
2774 Resets the Image's alpha data from a buffer of bytes. Accepts either
2775 a string or a buffer object holding the data and the length of the
2776 data must be width*height.
2777 """
2778 return _core_.Image_SetAlphaData(*args, **kwargs)
2779
2780 def GetAlphaBuffer(*args, **kwargs):
2781 """
2782 GetAlphaBuffer(self) -> PyObject
2783
2784 Returns a writable Python buffer object that is pointing at the Alpha
2785 data buffer inside the wx.Image. You need to ensure that you do not
2786 use this buffer object after the image has been destroyed.
2787 """
2788 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2789
2790 def SetAlphaBuffer(*args, **kwargs):
2791 """
2792 SetAlphaBuffer(self, buffer alpha)
2793
2794 Sets the internal image alpha pointer to point at a Python buffer
2795 object. This can save making an extra copy of the data but you must
2796 ensure that the buffer object lives as long as the wx.Image does.
2797 """
2798 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2799
2800 def SetMaskColour(*args, **kwargs):
2801 """
2802 SetMaskColour(self, byte r, byte g, byte b)
2803
2804 Sets the mask colour for this image (and tells the image to use the
2805 mask).
2806 """
2807 return _core_.Image_SetMaskColour(*args, **kwargs)
2808
2809 def GetOrFindMaskColour(*args, **kwargs):
2810 """
2811 GetOrFindMaskColour() -> (r,g,b)
2812
2813 Get the current mask colour or find a suitable colour.
2814 """
2815 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2816
2817 def GetMaskRed(*args, **kwargs):
2818 """
2819 GetMaskRed(self) -> byte
2820
2821 Gets the red component of the mask colour.
2822 """
2823 return _core_.Image_GetMaskRed(*args, **kwargs)
2824
2825 def GetMaskGreen(*args, **kwargs):
2826 """
2827 GetMaskGreen(self) -> byte
2828
2829 Gets the green component of the mask colour.
2830 """
2831 return _core_.Image_GetMaskGreen(*args, **kwargs)
2832
2833 def GetMaskBlue(*args, **kwargs):
2834 """
2835 GetMaskBlue(self) -> byte
2836
2837 Gets the blue component of the mask colour.
2838 """
2839 return _core_.Image_GetMaskBlue(*args, **kwargs)
2840
2841 def SetMask(*args, **kwargs):
2842 """
2843 SetMask(self, bool mask=True)
2844
2845 Specifies whether there is a mask or not. The area of the mask is
2846 determined by the current mask colour.
2847 """
2848 return _core_.Image_SetMask(*args, **kwargs)
2849
2850 def HasMask(*args, **kwargs):
2851 """
2852 HasMask(self) -> bool
2853
2854 Returns ``True`` if there is a mask active, ``False`` otherwise.
2855 """
2856 return _core_.Image_HasMask(*args, **kwargs)
2857
2858 def Rotate(*args, **kwargs):
2859 """
2860 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2861 Point offset_after_rotation=None) -> Image
2862
2863 Rotates the image about the given point, by ``angle`` radians. Passing
2864 ``True`` to ``interpolating`` results in better image quality, but is
2865 slower. If the image has a mask, then the mask colour is used for the
2866 uncovered pixels in the rotated image background. Otherwise, black
2867 will be used as the fill colour.
2868
2869 Returns the rotated image, leaving this image intact.
2870 """
2871 return _core_.Image_Rotate(*args, **kwargs)
2872
2873 def Rotate90(*args, **kwargs):
2874 """
2875 Rotate90(self, bool clockwise=True) -> Image
2876
2877 Returns a copy of the image rotated 90 degrees in the direction
2878 indicated by ``clockwise``.
2879 """
2880 return _core_.Image_Rotate90(*args, **kwargs)
2881
2882 def Mirror(*args, **kwargs):
2883 """
2884 Mirror(self, bool horizontally=True) -> Image
2885
2886 Returns a mirrored copy of the image. The parameter ``horizontally``
2887 indicates the orientation.
2888 """
2889 return _core_.Image_Mirror(*args, **kwargs)
2890
2891 def Replace(*args, **kwargs):
2892 """
2893 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2894
2895 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2896 ``(r2,g2,b2)``.
2897 """
2898 return _core_.Image_Replace(*args, **kwargs)
2899
2900 def ConvertToGreyscale(*args, **kwargs):
2901 """
2902 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2903
2904 Convert to greyscale image. Uses the luminance component (Y) of the
2905 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2906 defaults to ITU-T BT.601
2907 """
2908 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2909
2910 def ConvertToMono(*args, **kwargs):
2911 """
2912 ConvertToMono(self, byte r, byte g, byte b) -> Image
2913
2914 Returns monochromatic version of the image. The returned image has
2915 white colour where the original has ``(r,g,b)`` colour and black
2916 colour everywhere else.
2917 """
2918 return _core_.Image_ConvertToMono(*args, **kwargs)
2919
2920 def SetOption(*args, **kwargs):
2921 """
2922 SetOption(self, String name, String value)
2923
2924 Sets an image handler defined option. For example, when saving as a
2925 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2926 number between 0 and 100 (0 is terrible, 100 is very good).
2927 """
2928 return _core_.Image_SetOption(*args, **kwargs)
2929
2930 def SetOptionInt(*args, **kwargs):
2931 """
2932 SetOptionInt(self, String name, int value)
2933
2934 Sets an image option as an integer.
2935 """
2936 return _core_.Image_SetOptionInt(*args, **kwargs)
2937
2938 def GetOption(*args, **kwargs):
2939 """
2940 GetOption(self, String name) -> String
2941
2942 Gets the value of an image handler option.
2943 """
2944 return _core_.Image_GetOption(*args, **kwargs)
2945
2946 def GetOptionInt(*args, **kwargs):
2947 """
2948 GetOptionInt(self, String name) -> int
2949
2950 Gets the value of an image handler option as an integer. If the given
2951 option is not present, the function returns 0.
2952 """
2953 return _core_.Image_GetOptionInt(*args, **kwargs)
2954
2955 def HasOption(*args, **kwargs):
2956 """
2957 HasOption(self, String name) -> bool
2958
2959 Returns true if the given option is present.
2960 """
2961 return _core_.Image_HasOption(*args, **kwargs)
2962
2963 def CountColours(*args, **kwargs):
2964 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2965 return _core_.Image_CountColours(*args, **kwargs)
2966
2967 def ComputeHistogram(*args, **kwargs):
2968 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2969 return _core_.Image_ComputeHistogram(*args, **kwargs)
2970
2971 def AddHandler(*args, **kwargs):
2972 """AddHandler(ImageHandler handler)"""
2973 return _core_.Image_AddHandler(*args, **kwargs)
2974
2975 AddHandler = staticmethod(AddHandler)
2976 def InsertHandler(*args, **kwargs):
2977 """InsertHandler(ImageHandler handler)"""
2978 return _core_.Image_InsertHandler(*args, **kwargs)
2979
2980 InsertHandler = staticmethod(InsertHandler)
2981 def RemoveHandler(*args, **kwargs):
2982 """RemoveHandler(String name) -> bool"""
2983 return _core_.Image_RemoveHandler(*args, **kwargs)
2984
2985 RemoveHandler = staticmethod(RemoveHandler)
2986 def GetHandlers(*args, **kwargs):
2987 """GetHandlers() -> PyObject"""
2988 return _core_.Image_GetHandlers(*args, **kwargs)
2989
2990 GetHandlers = staticmethod(GetHandlers)
2991 def GetImageExtWildcard(*args, **kwargs):
2992 """
2993 GetImageExtWildcard() -> String
2994
2995 Iterates all registered wxImageHandler objects, and returns a string
2996 containing file extension masks suitable for passing to file open/save
2997 dialog boxes.
2998 """
2999 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3000
3001 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3002 def ConvertToBitmap(*args, **kwargs):
3003 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3004 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3005
3006 def ConvertToMonoBitmap(*args, **kwargs):
3007 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3008 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3009
3010 def RotateHue(*args, **kwargs):
3011 """
3012 RotateHue(self, double angle)
3013
3014 Rotates the hue of each pixel of the image. Hue is a double in the
3015 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3016 """
3017 return _core_.Image_RotateHue(*args, **kwargs)
3018
3019 def RGBtoHSV(*args, **kwargs):
3020 """
3021 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3022
3023 Converts a color in RGB color space to HSV color space.
3024 """
3025 return _core_.Image_RGBtoHSV(*args, **kwargs)
3026
3027 RGBtoHSV = staticmethod(RGBtoHSV)
3028 def HSVtoRGB(*args, **kwargs):
3029 """
3030 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3031
3032 Converts a color in HSV color space to RGB color space.
3033 """
3034 return _core_.Image_HSVtoRGB(*args, **kwargs)
3035
3036 HSVtoRGB = staticmethod(HSVtoRGB)
3037 def __nonzero__(self): return self.Ok()
3038 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3039 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3040 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3041 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3042 Height = property(GetHeight,doc="See `GetHeight`")
3043 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3044 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3045 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3046 Size = property(GetSize,doc="See `GetSize`")
3047 Width = property(GetWidth,doc="See `GetWidth`")
3048 _core_.Image_swigregister(Image)
3049
3050 def ImageFromMime(*args, **kwargs):
3051 """
3052 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3053
3054 Loads an image from a file, using a MIME type string (such as
3055 'image/jpeg') to specify image type.
3056 """
3057 val = _core_.new_ImageFromMime(*args, **kwargs)
3058 return val
3059
3060 def ImageFromStream(*args, **kwargs):
3061 """
3062 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3063
3064 Loads an image from an input stream, or any readable Python file-like
3065 object.
3066 """
3067 val = _core_.new_ImageFromStream(*args, **kwargs)
3068 return val
3069
3070 def ImageFromStreamMime(*args, **kwargs):
3071 """
3072 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3073
3074 Loads an image from an input stream, or any readable Python file-like
3075 object, specifying the image format with a MIME type string.
3076 """
3077 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3078 return val
3079
3080 def EmptyImage(*args, **kwargs):
3081 """
3082 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3083
3084 Construct an empty image of a given size, optionally setting all
3085 pixels to black.
3086 """
3087 val = _core_.new_EmptyImage(*args, **kwargs)
3088 return val
3089
3090 def ImageFromBitmap(*args, **kwargs):
3091 """
3092 ImageFromBitmap(Bitmap bitmap) -> Image
3093
3094 Construct an Image from a `wx.Bitmap`.
3095 """
3096 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3097 return val
3098
3099 def ImageFromData(*args, **kwargs):
3100 """
3101 ImageFromData(int width, int height, buffer data) -> Image
3102
3103 Construct an Image from a buffer of RGB bytes. Accepts either a
3104 string or a buffer object holding the data and the length of the data
3105 must be width*height*3.
3106 """
3107 val = _core_.new_ImageFromData(*args, **kwargs)
3108 return val
3109
3110 def ImageFromDataWithAlpha(*args, **kwargs):
3111 """
3112 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3113
3114 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3115 Accepts either a string or a buffer object holding the data and the
3116 length of the data must be width*height*3 bytes, and the length of the
3117 alpha data must be width*height bytes.
3118 """
3119 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3120 return val
3121
3122 def Image_CanRead(*args, **kwargs):
3123 """
3124 Image_CanRead(String filename) -> bool
3125
3126 Returns True if the image handlers can read this file.
3127 """
3128 return _core_.Image_CanRead(*args, **kwargs)
3129
3130 def Image_GetImageCount(*args, **kwargs):
3131 """
3132 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3133
3134 If the image file contains more than one image and the image handler
3135 is capable of retrieving these individually, this function will return
3136 the number of available images.
3137 """
3138 return _core_.Image_GetImageCount(*args, **kwargs)
3139
3140 def Image_CanReadStream(*args, **kwargs):
3141 """
3142 Image_CanReadStream(InputStream stream) -> bool
3143
3144 Returns True if the image handlers can read an image file from the
3145 data currently on the input stream, or a readable Python file-like
3146 object.
3147 """
3148 return _core_.Image_CanReadStream(*args, **kwargs)
3149
3150 def Image_AddHandler(*args, **kwargs):
3151 """Image_AddHandler(ImageHandler handler)"""
3152 return _core_.Image_AddHandler(*args, **kwargs)
3153
3154 def Image_InsertHandler(*args, **kwargs):
3155 """Image_InsertHandler(ImageHandler handler)"""
3156 return _core_.Image_InsertHandler(*args, **kwargs)
3157
3158 def Image_RemoveHandler(*args, **kwargs):
3159 """Image_RemoveHandler(String name) -> bool"""
3160 return _core_.Image_RemoveHandler(*args, **kwargs)
3161
3162 def Image_GetHandlers(*args):
3163 """Image_GetHandlers() -> PyObject"""
3164 return _core_.Image_GetHandlers(*args)
3165
3166 def Image_GetImageExtWildcard(*args):
3167 """
3168 Image_GetImageExtWildcard() -> String
3169
3170 Iterates all registered wxImageHandler objects, and returns a string
3171 containing file extension masks suitable for passing to file open/save
3172 dialog boxes.
3173 """
3174 return _core_.Image_GetImageExtWildcard(*args)
3175
3176 def Image_RGBtoHSV(*args, **kwargs):
3177 """
3178 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3179
3180 Converts a color in RGB color space to HSV color space.
3181 """
3182 return _core_.Image_RGBtoHSV(*args, **kwargs)
3183
3184 def Image_HSVtoRGB(*args, **kwargs):
3185 """
3186 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3187
3188 Converts a color in HSV color space to RGB color space.
3189 """
3190 return _core_.Image_HSVtoRGB(*args, **kwargs)
3191
3192
3193 def _ImageFromBuffer(*args, **kwargs):
3194 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3195 return _core_._ImageFromBuffer(*args, **kwargs)
3196 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3197 """
3198 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3199 parameter must be a Python object that implements the buffer interface,
3200 such as a string, array, etc. The dataBuffer object is expected to
3201 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3202 object can optionally be supplied for the image's alpha channel data, and
3203 it is expected to be width*height bytes long.
3204
3205 The wx.Image will be created with its data and alpha pointers initialized
3206 to the memory address pointed to by the buffer objects, thus saving the
3207 time needed to copy the image data from the buffer object to the wx.Image.
3208 While this has advantages, it also has the shoot-yourself-in-the-foot
3209 risks associated with sharing a C pointer between two objects.
3210
3211 To help alleviate the risk a reference to the data and alpha buffer
3212 objects are kept with the wx.Image, so that they won't get deleted until
3213 after the wx.Image is deleted. However please be aware that it is not
3214 guaranteed that an object won't move its memory buffer to a new location
3215 when it needs to resize its contents. If that happens then the wx.Image
3216 will end up referring to an invalid memory location and could cause the
3217 application to crash. Therefore care should be taken to not manipulate
3218 the objects used for the data and alpha buffers in a way that would cause
3219 them to change size.
3220 """
3221 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3222 image._buffer = dataBuffer
3223 image._alpha = alphaBuffer
3224 return image
3225
3226 def InitAllImageHandlers():
3227 """
3228 The former functionality of InitAllImageHanders is now done internal to
3229 the _core_ extension module and so this function has become a simple NOP.
3230 """
3231 pass
3232
3233 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3234 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3235 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3236 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3237 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3238 BMP_24BPP = _core_.BMP_24BPP
3239 BMP_8BPP = _core_.BMP_8BPP
3240 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3241 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3242 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3243 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3244 BMP_4BPP = _core_.BMP_4BPP
3245 BMP_1BPP = _core_.BMP_1BPP
3246 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3247 class BMPHandler(ImageHandler):
3248 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3249 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3250 __repr__ = _swig_repr
3251 def __init__(self, *args, **kwargs):
3252 """
3253 __init__(self) -> BMPHandler
3254
3255 A `wx.ImageHandler` for \*.bmp bitmap files.
3256 """
3257 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3258 _core_.BMPHandler_swigregister(BMPHandler)
3259 NullImage = cvar.NullImage
3260 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3261 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3262 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3263 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3264 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3265 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3266 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3267 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3268 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3269 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3270 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3271 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3272 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3273 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3274 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3275
3276 class ICOHandler(BMPHandler):
3277 """A `wx.ImageHandler` for \*.ico icon files."""
3278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3279 __repr__ = _swig_repr
3280 def __init__(self, *args, **kwargs):
3281 """
3282 __init__(self) -> ICOHandler
3283
3284 A `wx.ImageHandler` for \*.ico icon files.
3285 """
3286 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3287 _core_.ICOHandler_swigregister(ICOHandler)
3288
3289 class CURHandler(ICOHandler):
3290 """A `wx.ImageHandler` for \*.cur cursor files."""
3291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3292 __repr__ = _swig_repr
3293 def __init__(self, *args, **kwargs):
3294 """
3295 __init__(self) -> CURHandler
3296
3297 A `wx.ImageHandler` for \*.cur cursor files.
3298 """
3299 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3300 _core_.CURHandler_swigregister(CURHandler)
3301
3302 class ANIHandler(CURHandler):
3303 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3304 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3305 __repr__ = _swig_repr
3306 def __init__(self, *args, **kwargs):
3307 """
3308 __init__(self) -> ANIHandler
3309
3310 A `wx.ImageHandler` for \*.ani animated cursor files.
3311 """
3312 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3313 _core_.ANIHandler_swigregister(ANIHandler)
3314
3315 class PNGHandler(ImageHandler):
3316 """A `wx.ImageHandler` for PNG image files."""
3317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3318 __repr__ = _swig_repr
3319 def __init__(self, *args, **kwargs):
3320 """
3321 __init__(self) -> PNGHandler
3322
3323 A `wx.ImageHandler` for PNG image files.
3324 """
3325 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3326 _core_.PNGHandler_swigregister(PNGHandler)
3327
3328 class GIFHandler(ImageHandler):
3329 """A `wx.ImageHandler` for GIF image files."""
3330 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3331 __repr__ = _swig_repr
3332 def __init__(self, *args, **kwargs):
3333 """
3334 __init__(self) -> GIFHandler
3335
3336 A `wx.ImageHandler` for GIF image files.
3337 """
3338 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3339 _core_.GIFHandler_swigregister(GIFHandler)
3340
3341 class PCXHandler(ImageHandler):
3342 """A `wx.ImageHandler` for PCX imager files."""
3343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3344 __repr__ = _swig_repr
3345 def __init__(self, *args, **kwargs):
3346 """
3347 __init__(self) -> PCXHandler
3348
3349 A `wx.ImageHandler` for PCX imager files.
3350 """
3351 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3352 _core_.PCXHandler_swigregister(PCXHandler)
3353
3354 class JPEGHandler(ImageHandler):
3355 """A `wx.ImageHandler` for JPEG/JPG image files."""
3356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3357 __repr__ = _swig_repr
3358 def __init__(self, *args, **kwargs):
3359 """
3360 __init__(self) -> JPEGHandler
3361
3362 A `wx.ImageHandler` for JPEG/JPG image files.
3363 """
3364 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3365 _core_.JPEGHandler_swigregister(JPEGHandler)
3366
3367 class PNMHandler(ImageHandler):
3368 """A `wx.ImageHandler` for PNM image files."""
3369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3370 __repr__ = _swig_repr
3371 def __init__(self, *args, **kwargs):
3372 """
3373 __init__(self) -> PNMHandler
3374
3375 A `wx.ImageHandler` for PNM image files.
3376 """
3377 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3378 _core_.PNMHandler_swigregister(PNMHandler)
3379
3380 class XPMHandler(ImageHandler):
3381 """A `wx.ImageHandler` for XPM image."""
3382 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3383 __repr__ = _swig_repr
3384 def __init__(self, *args, **kwargs):
3385 """
3386 __init__(self) -> XPMHandler
3387
3388 A `wx.ImageHandler` for XPM image.
3389 """
3390 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3391 _core_.XPMHandler_swigregister(XPMHandler)
3392
3393 class TIFFHandler(ImageHandler):
3394 """A `wx.ImageHandler` for TIFF image files."""
3395 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3396 __repr__ = _swig_repr
3397 def __init__(self, *args, **kwargs):
3398 """
3399 __init__(self) -> TIFFHandler
3400
3401 A `wx.ImageHandler` for TIFF image files.
3402 """
3403 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3404 _core_.TIFFHandler_swigregister(TIFFHandler)
3405
3406 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3407 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3408 class Quantize(object):
3409 """Performs quantization, or colour reduction, on a wxImage."""
3410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3411 def __init__(self): raise AttributeError, "No constructor defined"
3412 __repr__ = _swig_repr
3413 def Quantize(*args, **kwargs):
3414 """
3415 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3416
3417 Reduce the colours in the source image and put the result into the
3418 destination image, setting the palette in the destination if
3419 needed. Both images may be the same, to overwrite the source image.
3420 """
3421 return _core_.Quantize_Quantize(*args, **kwargs)
3422
3423 Quantize = staticmethod(Quantize)
3424 _core_.Quantize_swigregister(Quantize)
3425
3426 def Quantize_Quantize(*args, **kwargs):
3427 """
3428 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3429
3430 Reduce the colours in the source image and put the result into the
3431 destination image, setting the palette in the destination if
3432 needed. Both images may be the same, to overwrite the source image.
3433 """
3434 return _core_.Quantize_Quantize(*args, **kwargs)
3435
3436 #---------------------------------------------------------------------------
3437
3438 class EvtHandler(Object):
3439 """Proxy of C++ EvtHandler class"""
3440 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3441 __repr__ = _swig_repr
3442 def __init__(self, *args, **kwargs):
3443 """__init__(self) -> EvtHandler"""
3444 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3445 self._setOORInfo(self)
3446
3447 def GetNextHandler(*args, **kwargs):
3448 """GetNextHandler(self) -> EvtHandler"""
3449 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3450
3451 def GetPreviousHandler(*args, **kwargs):
3452 """GetPreviousHandler(self) -> EvtHandler"""
3453 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3454
3455 def SetNextHandler(*args, **kwargs):
3456 """SetNextHandler(self, EvtHandler handler)"""
3457 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3458
3459 def SetPreviousHandler(*args, **kwargs):
3460 """SetPreviousHandler(self, EvtHandler handler)"""
3461 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3462
3463 def GetEvtHandlerEnabled(*args, **kwargs):
3464 """GetEvtHandlerEnabled(self) -> bool"""
3465 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3466
3467 def SetEvtHandlerEnabled(*args, **kwargs):
3468 """SetEvtHandlerEnabled(self, bool enabled)"""
3469 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3470
3471 def ProcessEvent(*args, **kwargs):
3472 """ProcessEvent(self, Event event) -> bool"""
3473 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3474
3475 def AddPendingEvent(*args, **kwargs):
3476 """AddPendingEvent(self, Event event)"""
3477 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3478
3479 def ProcessPendingEvents(*args, **kwargs):
3480 """ProcessPendingEvents(self)"""
3481 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3482
3483 def Connect(*args, **kwargs):
3484 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3485 return _core_.EvtHandler_Connect(*args, **kwargs)
3486
3487 def Disconnect(*args, **kwargs):
3488 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3489 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3490
3491 def _setOORInfo(*args, **kwargs):
3492 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3493 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3494 args[0].thisown = 0
3495 return val
3496
3497 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3498 """
3499 Bind an event to an event handler.
3500
3501 :param event: One of the EVT_* objects that specifies the
3502 type of event to bind,
3503
3504 :param handler: A callable object to be invoked when the
3505 event is delivered to self. Pass None to
3506 disconnect an event handler.
3507
3508 :param source: Sometimes the event originates from a
3509 different window than self, but you still
3510 want to catch it in self. (For example, a
3511 button event delivered to a frame.) By
3512 passing the source of the event, the event
3513 handling system is able to differentiate
3514 between the same event type from different
3515 controls.
3516
3517 :param id: Used to spcify the event source by ID instead
3518 of instance.
3519
3520 :param id2: Used when it is desirable to bind a handler
3521 to a range of IDs, such as with EVT_MENU_RANGE.
3522 """
3523 if source is not None:
3524 id = source.GetId()
3525 event.Bind(self, id, id2, handler)
3526
3527 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3528 """
3529 Disconencts the event handler binding for event from self.
3530 Returns True if successful.
3531 """
3532 if source is not None:
3533 id = source.GetId()
3534 return event.Unbind(self, id, id2)
3535
3536 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3537 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3538 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3539 _core_.EvtHandler_swigregister(EvtHandler)
3540
3541 #---------------------------------------------------------------------------
3542
3543 class PyEventBinder(object):
3544 """
3545 Instances of this class are used to bind specific events to event
3546 handlers.
3547 """
3548 def __init__(self, evtType, expectedIDs=0):
3549 if expectedIDs not in [0, 1, 2]:
3550 raise ValueError, "Invalid number of expectedIDs"
3551 self.expectedIDs = expectedIDs
3552
3553 if type(evtType) == list or type(evtType) == tuple:
3554 self.evtType = evtType
3555 else:
3556 self.evtType = [evtType]
3557
3558
3559 def Bind(self, target, id1, id2, function):
3560 """Bind this set of event types to target."""
3561 for et in self.evtType:
3562 target.Connect(id1, id2, et, function)
3563
3564
3565 def Unbind(self, target, id1, id2):
3566 """Remove an event binding."""
3567 success = 0
3568 for et in self.evtType:
3569 success += target.Disconnect(id1, id2, et)
3570 return success != 0
3571
3572
3573 def __call__(self, *args):
3574 """
3575 For backwards compatibility with the old EVT_* functions.
3576 Should be called with either (window, func), (window, ID,
3577 func) or (window, ID1, ID2, func) parameters depending on the
3578 type of the event.
3579 """
3580 assert len(args) == 2 + self.expectedIDs
3581 id1 = wx.ID_ANY
3582 id2 = wx.ID_ANY
3583 target = args[0]
3584 if self.expectedIDs == 0:
3585 func = args[1]
3586 elif self.expectedIDs == 1:
3587 id1 = args[1]
3588 func = args[2]
3589 elif self.expectedIDs == 2:
3590 id1 = args[1]
3591 id2 = args[2]
3592 func = args[3]
3593 else:
3594 raise ValueError, "Unexpected number of IDs"
3595
3596 self.Bind(target, id1, id2, func)
3597
3598
3599 # These two are square pegs that don't fit the PyEventBinder hole...
3600 def EVT_COMMAND(win, id, cmd, func):
3601 win.Connect(id, -1, cmd, func)
3602 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3603 win.Connect(id1, id2, cmd, func)
3604
3605
3606 #---------------------------------------------------------------------------
3607
3608 #---------------------------------------------------------------------------
3609
3610 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3611 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3612
3613 def NewEventType(*args):
3614 """NewEventType() -> EventType"""
3615 return _core_.NewEventType(*args)
3616 wxEVT_NULL = _core_.wxEVT_NULL
3617 wxEVT_FIRST = _core_.wxEVT_FIRST
3618 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3619 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3620 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3621 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3622 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3623 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3624 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3625 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3626 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3627 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3628 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3629 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3630 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3631 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3632 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3633 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3634 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3635 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3636 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3637 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3638 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3639 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3640 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3641 wxEVT_MOTION = _core_.wxEVT_MOTION
3642 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3643 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3644 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3645 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3646 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3647 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3648 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3649 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3650 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3651 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3652 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3653 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3654 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3655 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3656 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3657 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3658 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3659 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3660 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3661 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3662 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3663 wxEVT_CHAR = _core_.wxEVT_CHAR
3664 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3665 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3666 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3667 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3668 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3669 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3670 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3671 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3672 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3673 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3674 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3675 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3676 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3677 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3678 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3679 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3680 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3681 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3682 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3683 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3684 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3685 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3686 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3687 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3688 wxEVT_SIZE = _core_.wxEVT_SIZE
3689 wxEVT_MOVE = _core_.wxEVT_MOVE
3690 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3691 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3692 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3693 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3694 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3695 wxEVT_CREATE = _core_.wxEVT_CREATE
3696 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3697 wxEVT_SHOW = _core_.wxEVT_SHOW
3698 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3699 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3700 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3701 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3702 wxEVT_PAINT = _core_.wxEVT_PAINT
3703 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3704 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3705 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3706 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3707 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3708 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3709 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3710 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3711 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3712 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3713 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3714 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3715 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3716 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3717 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3718 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3719 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3720 wxEVT_IDLE = _core_.wxEVT_IDLE
3721 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3722 wxEVT_SIZING = _core_.wxEVT_SIZING
3723 wxEVT_MOVING = _core_.wxEVT_MOVING
3724 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3725 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3726 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3727 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3728 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3729 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3730 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3731 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3732 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3733 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3734 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3735 #
3736 # Create some event binders
3737 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3738 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3739 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3740 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3741 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3742 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3743 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3744 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3745 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3746 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3747 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3748 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3749 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3750 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3751 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3752 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3753 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3754 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3755 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3756 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3757 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3758 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3759 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3760 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3761 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3762 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3763 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3764 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3765 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3766 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3767 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3768 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3769 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3770 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3771 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3772 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3773 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3774 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3775 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3776 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3777 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3778 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3779
3780 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3781 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3782 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3783 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3784 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3785 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3786 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3787 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3788 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3789 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3790 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3791 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3792 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3793
3794 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3795 wxEVT_LEFT_UP,
3796 wxEVT_MIDDLE_DOWN,
3797 wxEVT_MIDDLE_UP,
3798 wxEVT_RIGHT_DOWN,
3799 wxEVT_RIGHT_UP,
3800 wxEVT_MOTION,
3801 wxEVT_LEFT_DCLICK,
3802 wxEVT_MIDDLE_DCLICK,
3803 wxEVT_RIGHT_DCLICK,
3804 wxEVT_ENTER_WINDOW,
3805 wxEVT_LEAVE_WINDOW,
3806 wxEVT_MOUSEWHEEL
3807 ])
3808
3809
3810 # Scrolling from wxWindow (sent to wxScrolledWindow)
3811 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3812 wxEVT_SCROLLWIN_BOTTOM,
3813 wxEVT_SCROLLWIN_LINEUP,
3814 wxEVT_SCROLLWIN_LINEDOWN,
3815 wxEVT_SCROLLWIN_PAGEUP,
3816 wxEVT_SCROLLWIN_PAGEDOWN,
3817 wxEVT_SCROLLWIN_THUMBTRACK,
3818 wxEVT_SCROLLWIN_THUMBRELEASE,
3819 ])
3820
3821 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3822 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3823 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3824 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3825 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3826 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3827 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3828 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3829
3830 # Scrolling from wx.Slider and wx.ScrollBar
3831 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3832 wxEVT_SCROLL_BOTTOM,
3833 wxEVT_SCROLL_LINEUP,
3834 wxEVT_SCROLL_LINEDOWN,
3835 wxEVT_SCROLL_PAGEUP,
3836 wxEVT_SCROLL_PAGEDOWN,
3837 wxEVT_SCROLL_THUMBTRACK,
3838 wxEVT_SCROLL_THUMBRELEASE,
3839 wxEVT_SCROLL_CHANGED,
3840 ])
3841
3842 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3843 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3844 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3845 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3846 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3847 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3848 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3849 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3850 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3851 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3852
3853 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3854 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3855 wxEVT_SCROLL_BOTTOM,
3856 wxEVT_SCROLL_LINEUP,
3857 wxEVT_SCROLL_LINEDOWN,
3858 wxEVT_SCROLL_PAGEUP,
3859 wxEVT_SCROLL_PAGEDOWN,
3860 wxEVT_SCROLL_THUMBTRACK,
3861 wxEVT_SCROLL_THUMBRELEASE,
3862 wxEVT_SCROLL_CHANGED,
3863 ], 1)
3864
3865 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3866 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3867 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3868 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3869 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3870 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3871 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3872 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3873 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3874 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3875
3876 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3877 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3878 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3879 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3880 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3881 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3882 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3883 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3884 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3885 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3886
3887 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3888 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3889 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3890 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3891 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3892 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3893 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3894 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3895 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3896
3897
3898 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3899 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3900 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3901 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3902 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3903 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3904 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3905
3906 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3907
3908 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3909 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3910
3911 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3912
3913 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3914 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3915 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3916
3917
3918 #---------------------------------------------------------------------------
3919
3920 class Event(Object):
3921 """
3922 An event is a structure holding information about an event passed to a
3923 callback or member function. wx.Event is an abstract base class for
3924 other event classes
3925 """
3926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3927 def __init__(self): raise AttributeError, "No constructor defined"
3928 __repr__ = _swig_repr
3929 __swig_destroy__ = _core_.delete_Event
3930 __del__ = lambda self : None;
3931 def SetEventType(*args, **kwargs):
3932 """
3933 SetEventType(self, EventType typ)
3934
3935 Sets the specific type of the event.
3936 """
3937 return _core_.Event_SetEventType(*args, **kwargs)
3938
3939 def GetEventType(*args, **kwargs):
3940 """
3941 GetEventType(self) -> EventType
3942
3943 Returns the identifier of the given event type, such as
3944 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3945 """
3946 return _core_.Event_GetEventType(*args, **kwargs)
3947
3948 def GetEventObject(*args, **kwargs):
3949 """
3950 GetEventObject(self) -> Object
3951
3952 Returns the object (usually a window) associated with the event, if
3953 any.
3954 """
3955 return _core_.Event_GetEventObject(*args, **kwargs)
3956
3957 def SetEventObject(*args, **kwargs):
3958 """
3959 SetEventObject(self, Object obj)
3960
3961 Sets the originating object, or in other words, obj is normally the
3962 object that is sending the event.
3963 """
3964 return _core_.Event_SetEventObject(*args, **kwargs)
3965
3966 def GetTimestamp(*args, **kwargs):
3967 """GetTimestamp(self) -> long"""
3968 return _core_.Event_GetTimestamp(*args, **kwargs)
3969
3970 def SetTimestamp(*args, **kwargs):
3971 """SetTimestamp(self, long ts=0)"""
3972 return _core_.Event_SetTimestamp(*args, **kwargs)
3973
3974 def GetId(*args, **kwargs):
3975 """
3976 GetId(self) -> int
3977
3978 Returns the identifier associated with this event, such as a button
3979 command id.
3980 """
3981 return _core_.Event_GetId(*args, **kwargs)
3982
3983 def SetId(*args, **kwargs):
3984 """
3985 SetId(self, int Id)
3986
3987 Set's the ID for the event. This is usually the ID of the window that
3988 is sending the event, but it can also be a command id from a menu
3989 item, etc.
3990 """
3991 return _core_.Event_SetId(*args, **kwargs)
3992
3993 def IsCommandEvent(*args, **kwargs):
3994 """
3995 IsCommandEvent(self) -> bool
3996
3997 Returns true if the event is or is derived from `wx.CommandEvent` else
3998 it returns false. Note: Exists only for optimization purposes.
3999 """
4000 return _core_.Event_IsCommandEvent(*args, **kwargs)
4001
4002 def Skip(*args, **kwargs):
4003 """
4004 Skip(self, bool skip=True)
4005
4006 Called by an event handler, it controls whether additional event
4007 handlers bound to this event will be called after the current event
4008 handler returns. Skip(false) (the default setting) will prevent
4009 additional event handlers from being called and control will be
4010 returned to the sender of the event immediately after the current
4011 handler has finished. Skip(True) will cause the event processing
4012 system to continue searching for a handler function for this event.
4013
4014 """
4015 return _core_.Event_Skip(*args, **kwargs)
4016
4017 def GetSkipped(*args, **kwargs):
4018 """
4019 GetSkipped(self) -> bool
4020
4021 Returns true if the event handler should be skipped, false otherwise.
4022 :see: `Skip`
4023 """
4024 return _core_.Event_GetSkipped(*args, **kwargs)
4025
4026 def ShouldPropagate(*args, **kwargs):
4027 """
4028 ShouldPropagate(self) -> bool
4029
4030 Test if this event should be propagated to the parent window or not,
4031 i.e. if the propagation level is currently greater than 0.
4032 """
4033 return _core_.Event_ShouldPropagate(*args, **kwargs)
4034
4035 def StopPropagation(*args, **kwargs):
4036 """
4037 StopPropagation(self) -> int
4038
4039 Stop the event from propagating to its parent window. Returns the old
4040 propagation level value which may be later passed to
4041 `ResumePropagation` to allow propagating the event again.
4042 """
4043 return _core_.Event_StopPropagation(*args, **kwargs)
4044
4045 def ResumePropagation(*args, **kwargs):
4046 """
4047 ResumePropagation(self, int propagationLevel)
4048
4049 Resume the event propagation by restoring the propagation level. (For
4050 example, you can use the value returned by an earlier call to
4051 `StopPropagation`.)
4052
4053 """
4054 return _core_.Event_ResumePropagation(*args, **kwargs)
4055
4056 def Clone(*args, **kwargs):
4057 """Clone(self) -> Event"""
4058 return _core_.Event_Clone(*args, **kwargs)
4059
4060 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4061 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4062 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4063 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4064 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
4065 _core_.Event_swigregister(Event)
4066
4067 #---------------------------------------------------------------------------
4068
4069 class PropagationDisabler(object):
4070 """
4071 Helper class to temporarily change an event not to propagate. Simply
4072 create an instance of this class and then whe it is destroyed the
4073 propogation of the event will be restored.
4074 """
4075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4076 __repr__ = _swig_repr
4077 def __init__(self, *args, **kwargs):
4078 """
4079 __init__(self, Event event) -> PropagationDisabler
4080
4081 Helper class to temporarily change an event not to propagate. Simply
4082 create an instance of this class and then whe it is destroyed the
4083 propogation of the event will be restored.
4084 """
4085 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4086 __swig_destroy__ = _core_.delete_PropagationDisabler
4087 __del__ = lambda self : None;
4088 _core_.PropagationDisabler_swigregister(PropagationDisabler)
4089
4090 class PropagateOnce(object):
4091 """
4092 A helper class that will temporarily lower propagation level of an
4093 event. Simply create an instance of this class and then whe it is
4094 destroyed the propogation of the event will be restored.
4095 """
4096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4097 __repr__ = _swig_repr
4098 def __init__(self, *args, **kwargs):
4099 """
4100 __init__(self, Event event) -> PropagateOnce
4101
4102 A helper class that will temporarily lower propagation level of an
4103 event. Simply create an instance of this class and then whe it is
4104 destroyed the propogation of the event will be restored.
4105 """
4106 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4107 __swig_destroy__ = _core_.delete_PropagateOnce
4108 __del__ = lambda self : None;
4109 _core_.PropagateOnce_swigregister(PropagateOnce)
4110
4111 #---------------------------------------------------------------------------
4112
4113 class CommandEvent(Event):
4114 """
4115 This event class contains information about command events, which
4116 originate from a variety of simple controls, as well as menus and
4117 toolbars.
4118 """
4119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4120 __repr__ = _swig_repr
4121 def __init__(self, *args, **kwargs):
4122 """
4123 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4124
4125 This event class contains information about command events, which
4126 originate from a variety of simple controls, as well as menus and
4127 toolbars.
4128 """
4129 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4130 def GetSelection(*args, **kwargs):
4131 """
4132 GetSelection(self) -> int
4133
4134 Returns item index for a listbox or choice selection event (not valid
4135 for a deselection).
4136 """
4137 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4138
4139 def SetString(*args, **kwargs):
4140 """SetString(self, String s)"""
4141 return _core_.CommandEvent_SetString(*args, **kwargs)
4142
4143 def GetString(*args, **kwargs):
4144 """
4145 GetString(self) -> String
4146
4147 Returns item string for a listbox or choice selection event (not valid
4148 for a deselection).
4149 """
4150 return _core_.CommandEvent_GetString(*args, **kwargs)
4151
4152 def IsChecked(*args, **kwargs):
4153 """
4154 IsChecked(self) -> bool
4155
4156 This method can be used with checkbox and menu events: for the
4157 checkboxes, the method returns true for a selection event and false
4158 for a deselection one. For the menu events, this method indicates if
4159 the menu item just has become checked or unchecked (and thus only
4160 makes sense for checkable menu items).
4161 """
4162 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4163
4164 Checked = IsChecked
4165 def IsSelection(*args, **kwargs):
4166 """
4167 IsSelection(self) -> bool
4168
4169 For a listbox or similar event, returns true if it is a selection,
4170 false if it is a deselection.
4171 """
4172 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4173
4174 def SetExtraLong(*args, **kwargs):
4175 """SetExtraLong(self, long extraLong)"""
4176 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4177
4178 def GetExtraLong(*args, **kwargs):
4179 """
4180 GetExtraLong(self) -> long
4181
4182 Returns extra information dependant on the event objects type. If the
4183 event comes from a listbox selection, it is a boolean determining
4184 whether the event was a selection (true) or a deselection (false). A
4185 listbox deselection only occurs for multiple-selection boxes, and in
4186 this case the index and string values are indeterminate and the
4187 listbox must be examined by the application.
4188 """
4189 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4190
4191 def SetInt(*args, **kwargs):
4192 """SetInt(self, int i)"""
4193 return _core_.CommandEvent_SetInt(*args, **kwargs)
4194
4195 def GetInt(*args, **kwargs):
4196 """
4197 GetInt(self) -> int
4198
4199 Returns the integer identifier corresponding to a listbox, choice or
4200 radiobox selection (only if the event was a selection, not a
4201 deselection), or a boolean value representing the value of a checkbox.
4202 """
4203 return _core_.CommandEvent_GetInt(*args, **kwargs)
4204
4205 def GetClientData(*args, **kwargs):
4206 """
4207 GetClientData(self) -> PyObject
4208
4209 Returns the client data object for a listbox or choice selection event, (if any.)
4210 """
4211 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4212
4213 def SetClientData(*args, **kwargs):
4214 """
4215 SetClientData(self, PyObject clientData)
4216
4217 Associate the given client data with the item at position n.
4218 """
4219 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4220
4221 GetClientObject = GetClientData
4222 SetClientObject = SetClientData
4223
4224 def Clone(*args, **kwargs):
4225 """Clone(self) -> Event"""
4226 return _core_.CommandEvent_Clone(*args, **kwargs)
4227
4228 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4229 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4230 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4231 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4232 Selection = property(GetSelection,doc="See `GetSelection`")
4233 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4234 _core_.CommandEvent_swigregister(CommandEvent)
4235
4236 #---------------------------------------------------------------------------
4237
4238 class NotifyEvent(CommandEvent):
4239 """
4240 An instance of this class (or one of its derived classes) is sent from
4241 a control when the control's state is being changed and the control
4242 allows that change to be prevented from happening. The event handler
4243 can call `Veto` or `Allow` to tell the control what to do.
4244 """
4245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4246 __repr__ = _swig_repr
4247 def __init__(self, *args, **kwargs):
4248 """
4249 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4250
4251 An instance of this class (or one of its derived classes) is sent from
4252 a control when the control's state is being changed and the control
4253 allows that change to be prevented from happening. The event handler
4254 can call `Veto` or `Allow` to tell the control what to do.
4255 """
4256 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4257 def Veto(*args, **kwargs):
4258 """
4259 Veto(self)
4260
4261 Prevents the change announced by this event from happening.
4262
4263 It is in general a good idea to notify the user about the reasons for
4264 vetoing the change because otherwise the applications behaviour (which
4265 just refuses to do what the user wants) might be quite surprising.
4266 """
4267 return _core_.NotifyEvent_Veto(*args, **kwargs)
4268
4269 def Allow(*args, **kwargs):
4270 """
4271 Allow(self)
4272
4273 This is the opposite of `Veto`: it explicitly allows the event to be
4274 processed. For most events it is not necessary to call this method as
4275 the events are allowed anyhow but some are forbidden by default (this
4276 will be mentioned in the corresponding event description).
4277 """
4278 return _core_.NotifyEvent_Allow(*args, **kwargs)
4279
4280 def IsAllowed(*args, **kwargs):
4281 """
4282 IsAllowed(self) -> bool
4283
4284 Returns true if the change is allowed (`Veto` hasn't been called) or
4285 false otherwise (if it was).
4286 """
4287 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4288
4289 _core_.NotifyEvent_swigregister(NotifyEvent)
4290
4291 #---------------------------------------------------------------------------
4292
4293 class ScrollEvent(CommandEvent):
4294 """
4295 A scroll event holds information about events sent from stand-alone
4296 scrollbars and sliders. Note that scrolled windows do not send
4297 instnaces of this event class, but send the `wx.ScrollWinEvent`
4298 instead.
4299 """
4300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4301 __repr__ = _swig_repr
4302 def __init__(self, *args, **kwargs):
4303 """
4304 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4305 int orient=0) -> ScrollEvent
4306 """
4307 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4308 def GetOrientation(*args, **kwargs):
4309 """
4310 GetOrientation(self) -> int
4311
4312 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4313 the scrollbar.
4314 """
4315 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4316
4317 def GetPosition(*args, **kwargs):
4318 """
4319 GetPosition(self) -> int
4320
4321 Returns the position of the scrollbar.
4322 """
4323 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4324
4325 def SetOrientation(*args, **kwargs):
4326 """SetOrientation(self, int orient)"""
4327 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4328
4329 def SetPosition(*args, **kwargs):
4330 """SetPosition(self, int pos)"""
4331 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4332
4333 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4334 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4335 _core_.ScrollEvent_swigregister(ScrollEvent)
4336
4337 #---------------------------------------------------------------------------
4338
4339 class ScrollWinEvent(Event):
4340 """
4341 A wx.ScrollWinEvent holds information about scrolling and is sent from
4342 scrolling windows.
4343 """
4344 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4345 __repr__ = _swig_repr
4346 def __init__(self, *args, **kwargs):
4347 """
4348 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4349
4350 A wx.ScrollWinEvent holds information about scrolling and is sent from
4351 scrolling windows.
4352 """
4353 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4354 def GetOrientation(*args, **kwargs):
4355 """
4356 GetOrientation(self) -> int
4357
4358 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4359 the scrollbar.
4360 """
4361 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4362
4363 def GetPosition(*args, **kwargs):
4364 """
4365 GetPosition(self) -> int
4366
4367 Returns the position of the scrollbar for the thumb track and release
4368 events. Note that this field can't be used for the other events, you
4369 need to query the window itself for the current position in that case.
4370 """
4371 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4372
4373 def SetOrientation(*args, **kwargs):
4374 """SetOrientation(self, int orient)"""
4375 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4376
4377 def SetPosition(*args, **kwargs):
4378 """SetPosition(self, int pos)"""
4379 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4380
4381 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4382 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4383 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4384
4385 #---------------------------------------------------------------------------
4386
4387 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4388 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4389 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4390 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4391 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4392 class MouseEvent(Event):
4393 """
4394 This event class contains information about the events generated by
4395 the mouse: they include mouse buttons press and release events and
4396 mouse move events.
4397
4398 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4399 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4400 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4401 a middle button so a portable application should avoid relying on the
4402 events from it.
4403
4404 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4405 the former returns true when the event corresponds to the left mouse
4406 button click while the latter returns true if the left mouse button is
4407 currently being pressed. For example, when the user is dragging the
4408 mouse you can use `LeftIsDown` to test whether the left mouse button
4409 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4410 `LeftIsDown` will also return true in wxWidgets whatever the
4411 underlying GUI behaviour is (which is platform-dependent). The same
4412 applies, of course, to other mouse buttons as well.
4413 """
4414 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4415 __repr__ = _swig_repr
4416 def __init__(self, *args, **kwargs):
4417 """
4418 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4419
4420 Constructs a wx.MouseEvent. Valid event types are:
4421
4422 * wxEVT_ENTER_WINDOW
4423 * wxEVT_LEAVE_WINDOW
4424 * wxEVT_LEFT_DOWN
4425 * wxEVT_LEFT_UP
4426 * wxEVT_LEFT_DCLICK
4427 * wxEVT_MIDDLE_DOWN
4428 * wxEVT_MIDDLE_UP
4429 * wxEVT_MIDDLE_DCLICK
4430 * wxEVT_RIGHT_DOWN
4431 * wxEVT_RIGHT_UP
4432 * wxEVT_RIGHT_DCLICK
4433 * wxEVT_MOTION
4434 * wxEVT_MOUSEWHEEL
4435 """
4436 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4437 def IsButton(*args, **kwargs):
4438 """
4439 IsButton(self) -> bool
4440
4441 Returns true if the event was a mouse button event (not necessarily a
4442 button down event - that may be tested using `ButtonDown`).
4443 """
4444 return _core_.MouseEvent_IsButton(*args, **kwargs)
4445
4446 def ButtonDown(*args, **kwargs):
4447 """
4448 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4449
4450 If the argument is omitted, this returns true if the event was any
4451 mouse button down event. Otherwise the argument specifies which
4452 button-down event shold be checked for (see `Button` for the possible
4453 values).
4454 """
4455 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4456
4457 def ButtonDClick(*args, **kwargs):
4458 """
4459 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4460
4461 If the argument is omitted, this returns true if the event was any
4462 mouse double click event. Otherwise the argument specifies which
4463 double click event to check for (see `Button` for the possible
4464 values).
4465 """
4466 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4467
4468 def ButtonUp(*args, **kwargs):
4469 """
4470 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4471
4472 If the argument is omitted, this returns true if the event was any
4473 mouse button up event. Otherwise the argument specifies which button
4474 up event to check for (see `Button` for the possible values).
4475 """
4476 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4477
4478 def Button(*args, **kwargs):
4479 """
4480 Button(self, int button) -> bool
4481
4482 Returns true if the identified mouse button is changing state. Valid
4483 values of button are:
4484
4485 ==================== =====================================
4486 wx.MOUSE_BTN_LEFT check if left button was pressed
4487 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4488 wx.MOUSE_BTN_RIGHT check if right button was pressed
4489 wx.MOUSE_BTN_ANY check if any button was pressed
4490 ==================== =====================================
4491
4492 """
4493 return _core_.MouseEvent_Button(*args, **kwargs)
4494
4495 def ButtonIsDown(*args, **kwargs):
4496 """ButtonIsDown(self, int but) -> bool"""
4497 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4498
4499 def GetButton(*args, **kwargs):
4500 """
4501 GetButton(self) -> int
4502
4503 Returns the mouse button which generated this event or
4504 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4505 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4506 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4507 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4508 right buttons respectively.
4509 """
4510 return _core_.MouseEvent_GetButton(*args, **kwargs)
4511
4512 def ControlDown(*args, **kwargs):
4513 """
4514 ControlDown(self) -> bool
4515
4516 Returns true if the control key was down at the time of the event.
4517 """
4518 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4519
4520 def MetaDown(*args, **kwargs):
4521 """
4522 MetaDown(self) -> bool
4523
4524 Returns true if the Meta key was down at the time of the event.
4525 """
4526 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4527
4528 def AltDown(*args, **kwargs):
4529 """
4530 AltDown(self) -> bool
4531
4532 Returns true if the Alt key was down at the time of the event.
4533 """
4534 return _core_.MouseEvent_AltDown(*args, **kwargs)
4535
4536 def ShiftDown(*args, **kwargs):
4537 """
4538 ShiftDown(self) -> bool
4539
4540 Returns true if the Shift key was down at the time of the event.
4541 """
4542 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4543
4544 def CmdDown(*args, **kwargs):
4545 """
4546 CmdDown(self) -> bool
4547
4548 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4549 platforms but the special "Apple" (a.k.a as "Command") key on
4550 Macs. It often makes sense to use it instead of, say, `ControlDown`
4551 because Cmd key is used for the same thing under Mac as Ctrl
4552 elsewhere. The Ctrl key still exists, it's just not used for this
4553 purpose. So for non-Mac platforms this is the same as `ControlDown`
4554 and Macs this is the same as `MetaDown`.
4555 """
4556 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4557
4558 def LeftDown(*args, **kwargs):
4559 """
4560 LeftDown(self) -> bool
4561
4562 Returns true if the left mouse button state changed to down.
4563 """
4564 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4565
4566 def MiddleDown(*args, **kwargs):
4567 """
4568 MiddleDown(self) -> bool
4569
4570 Returns true if the middle mouse button state changed to down.
4571 """
4572 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4573
4574 def RightDown(*args, **kwargs):
4575 """
4576 RightDown(self) -> bool
4577
4578 Returns true if the right mouse button state changed to down.
4579 """
4580 return _core_.MouseEvent_RightDown(*args, **kwargs)
4581
4582 def LeftUp(*args, **kwargs):
4583 """
4584 LeftUp(self) -> bool
4585
4586 Returns true if the left mouse button state changed to up.
4587 """
4588 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4589
4590 def MiddleUp(*args, **kwargs):
4591 """
4592 MiddleUp(self) -> bool
4593
4594 Returns true if the middle mouse button state changed to up.
4595 """
4596 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4597
4598 def RightUp(*args, **kwargs):
4599 """
4600 RightUp(self) -> bool
4601
4602 Returns true if the right mouse button state changed to up.
4603 """
4604 return _core_.MouseEvent_RightUp(*args, **kwargs)
4605
4606 def LeftDClick(*args, **kwargs):
4607 """
4608 LeftDClick(self) -> bool
4609
4610 Returns true if the event was a left button double click.
4611 """
4612 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4613
4614 def MiddleDClick(*args, **kwargs):
4615 """
4616 MiddleDClick(self) -> bool
4617
4618 Returns true if the event was a middle button double click.
4619 """
4620 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4621
4622 def RightDClick(*args, **kwargs):
4623 """
4624 RightDClick(self) -> bool
4625
4626 Returns true if the event was a right button double click.
4627 """
4628 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4629
4630 def LeftIsDown(*args, **kwargs):
4631 """
4632 LeftIsDown(self) -> bool
4633
4634 Returns true if the left mouse button is currently down, independent
4635 of the current event type.
4636
4637 Please notice that it is not the same as LeftDown which returns true
4638 if the left mouse button was just pressed. Rather, it describes the
4639 state of the mouse button before the event happened.
4640
4641 This event is usually used in the mouse event handlers which process
4642 "move mouse" messages to determine whether the user is (still)
4643 dragging the mouse.
4644 """
4645 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4646
4647 def MiddleIsDown(*args, **kwargs):
4648 """
4649 MiddleIsDown(self) -> bool
4650
4651 Returns true if the middle mouse button is currently down, independent
4652 of the current event type.
4653 """
4654 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4655
4656 def RightIsDown(*args, **kwargs):
4657 """
4658 RightIsDown(self) -> bool
4659
4660 Returns true if the right mouse button is currently down, independent
4661 of the current event type.
4662 """
4663 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4664
4665 def Dragging(*args, **kwargs):
4666 """
4667 Dragging(self) -> bool
4668
4669 Returns true if this was a dragging event (motion while a button is
4670 depressed).
4671 """
4672 return _core_.MouseEvent_Dragging(*args, **kwargs)
4673
4674 def Moving(*args, **kwargs):
4675 """
4676 Moving(self) -> bool
4677
4678 Returns true if this was a motion event and no mouse buttons were
4679 pressed. If any mouse button is held pressed, then this method returns
4680 false and Dragging returns true.
4681 """
4682 return _core_.MouseEvent_Moving(*args, **kwargs)
4683
4684 def Entering(*args, **kwargs):
4685 """
4686 Entering(self) -> bool
4687
4688 Returns true if the mouse was entering the window.
4689 """
4690 return _core_.MouseEvent_Entering(*args, **kwargs)
4691
4692 def Leaving(*args, **kwargs):
4693 """
4694 Leaving(self) -> bool
4695
4696 Returns true if the mouse was leaving the window.
4697 """
4698 return _core_.MouseEvent_Leaving(*args, **kwargs)
4699
4700 def GetPosition(*args, **kwargs):
4701 """
4702 GetPosition(self) -> Point
4703
4704 Returns the pixel position of the mouse in window coordinates when the
4705 event happened.
4706 """
4707 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4708
4709 def GetPositionTuple(*args, **kwargs):
4710 """
4711 GetPositionTuple() -> (x,y)
4712
4713 Returns the pixel position of the mouse in window coordinates when the
4714 event happened.
4715 """
4716 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4717
4718 def GetLogicalPosition(*args, **kwargs):
4719 """
4720 GetLogicalPosition(self, DC dc) -> Point
4721
4722 Returns the logical mouse position in pixels (i.e. translated
4723 according to the translation set for the DC, which usually indicates
4724 that the window has been scrolled).
4725 """
4726 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4727
4728 def GetX(*args, **kwargs):
4729 """
4730 GetX(self) -> int
4731
4732 Returns X coordinate of the physical mouse event position.
4733 """
4734 return _core_.MouseEvent_GetX(*args, **kwargs)
4735
4736 def GetY(*args, **kwargs):
4737 """
4738 GetY(self) -> int
4739
4740 Returns Y coordinate of the physical mouse event position.
4741 """
4742 return _core_.MouseEvent_GetY(*args, **kwargs)
4743
4744 def GetWheelRotation(*args, **kwargs):
4745 """
4746 GetWheelRotation(self) -> int
4747
4748 Get wheel rotation, positive or negative indicates direction of
4749 rotation. Current devices all send an event when rotation is equal to
4750 +/-WheelDelta, but this allows for finer resolution devices to be
4751 created in the future. Because of this you shouldn't assume that one
4752 event is equal to 1 line or whatever, but you should be able to either
4753 do partial line scrolling or wait until +/-WheelDelta rotation values
4754 have been accumulated before scrolling.
4755 """
4756 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4757
4758 def GetWheelDelta(*args, **kwargs):
4759 """
4760 GetWheelDelta(self) -> int
4761
4762 Get wheel delta, normally 120. This is the threshold for action to be
4763 taken, and one such action (for example, scrolling one increment)
4764 should occur for each delta.
4765 """
4766 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4767
4768 def GetLinesPerAction(*args, **kwargs):
4769 """
4770 GetLinesPerAction(self) -> int
4771
4772 Returns the configured number of lines (or whatever) to be scrolled
4773 per wheel action. Defaults to three.
4774 """
4775 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4776
4777 def IsPageScroll(*args, **kwargs):
4778 """
4779 IsPageScroll(self) -> bool
4780
4781 Returns true if the system has been setup to do page scrolling with
4782 the mouse wheel instead of line scrolling.
4783 """
4784 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4785
4786 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4787 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4788 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4789 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4790 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4791 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4792 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4793 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4794 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4795 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4796 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4797 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4798 Button = property(GetButton,doc="See `GetButton`")
4799 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4800 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4801 Position = property(GetPosition,doc="See `GetPosition`")
4802 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4803 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4804 X = property(GetX,doc="See `GetX`")
4805 Y = property(GetY,doc="See `GetY`")
4806 _core_.MouseEvent_swigregister(MouseEvent)
4807
4808 #---------------------------------------------------------------------------
4809
4810 class SetCursorEvent(Event):
4811 """
4812 A SetCursorEvent is generated when the mouse cursor is about to be set
4813 as a result of mouse motion. This event gives the application the
4814 chance to perform specific mouse cursor processing based on the
4815 current position of the mouse within the window. Use the `SetCursor`
4816 method to specify the cursor you want to be displayed.
4817 """
4818 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4819 __repr__ = _swig_repr
4820 def __init__(self, *args, **kwargs):
4821 """
4822 __init__(self, int x=0, int y=0) -> SetCursorEvent
4823
4824 Construct a new `wx.SetCursorEvent`.
4825 """
4826 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4827 def GetX(*args, **kwargs):
4828 """
4829 GetX(self) -> int
4830
4831 Returns the X coordinate of the mouse in client coordinates.
4832 """
4833 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4834
4835 def GetY(*args, **kwargs):
4836 """
4837 GetY(self) -> int
4838
4839 Returns the Y coordinate of the mouse in client coordinates.
4840 """
4841 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4842
4843 def SetCursor(*args, **kwargs):
4844 """
4845 SetCursor(self, Cursor cursor)
4846
4847 Sets the cursor associated with this event.
4848 """
4849 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4850
4851 def GetCursor(*args, **kwargs):
4852 """
4853 GetCursor(self) -> Cursor
4854
4855 Returns a reference to the cursor specified by this event.
4856 """
4857 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4858
4859 def HasCursor(*args, **kwargs):
4860 """
4861 HasCursor(self) -> bool
4862
4863 Returns true if the cursor specified by this event is a valid cursor.
4864 """
4865 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4866
4867 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4868 X = property(GetX,doc="See `GetX`")
4869 Y = property(GetY,doc="See `GetY`")
4870 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4871
4872 #---------------------------------------------------------------------------
4873
4874 class KeyEvent(Event):
4875 """
4876 This event class contains information about keypress and character
4877 events. These events are only sent to the widget that currently has
4878 the keyboard focus.
4879
4880 Notice that there are three different kinds of keyboard events in
4881 wxWidgets: key down and up events and char events. The difference
4882 between the first two is clear - the first corresponds to a key press
4883 and the second to a key release - otherwise they are identical. Just
4884 note that if the key is maintained in a pressed state you will
4885 typically get a lot of (automatically generated) down events but only
4886 one up so it is wrong to assume that there is one up event
4887 corresponding to each down one.
4888
4889 Both key events provide untranslated key codes while the char event
4890 carries the translated one. The untranslated code for alphanumeric
4891 keys is always an upper case value. For the other keys it is one of
4892 WXK_XXX values from the keycodes table. The translated key is, in
4893 general, the character the user expects to appear as the result of the
4894 key combination when typing the text into a text entry zone, for
4895 example.
4896
4897 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4898 and the standard US keyboard): when the 'A' key is pressed, the key
4899 down event key code is equal to ASCII A == 65. But the char event key
4900 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4901 'A' keys simultaneously , the key code in key down event will still be
4902 just 'A' while the char event key code parameter will now be 'A' as
4903 well.
4904
4905 Although in this simple case it is clear that the correct key code
4906 could be found in the key down event handler by checking the value
4907 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4908 as for non alphanumeric keys or non-US keyboard layouts the
4909 translation is keyboard-layout dependent and can only be done properly
4910 by the system itself.
4911
4912 Another kind of translation is done when the control key is pressed:
4913 for example, for CTRL-A key press the key down event still carries the
4914 same key code 'A' as usual but the char event will have key code of 1,
4915 the ASCII value of this key combination.
4916
4917 You may discover how the other keys on your system behave
4918 interactively by running the KeyEvents sample in the wxPython demo and
4919 pressing some keys while the blue box at the top has the keyboard
4920 focus.
4921
4922 **Note**: If a key down event is caught and the event handler does not
4923 call event.Skip() then the coresponding char event will not
4924 happen. This is by design and enables the programs that handle both
4925 types of events to be a bit simpler.
4926
4927 **Note for Windows programmers**: The key and char events in wxWidgets
4928 are similar to but slightly different from Windows WM_KEYDOWN and
4929 WM_CHAR events. In particular, Alt-x combination will generate a char
4930 event in wxWidgets (unless it is used as an accelerator).
4931
4932 **Tip**: be sure to call event.Skip() for events that you don't
4933 process in key event function, otherwise menu shortcuts may cease to
4934 work under Windows.
4935
4936 """
4937 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4938 __repr__ = _swig_repr
4939 def __init__(self, *args, **kwargs):
4940 """
4941 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4942
4943 Construct a new `wx.KeyEvent`. Valid event types are:
4944 *
4945 """
4946 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4947 def GetModifiers(*args, **kwargs):
4948 """
4949 GetModifiers(self) -> int
4950
4951 Returns a bitmask of the current modifier settings. Can be used to
4952 check if the key event has exactly the given modifiers without having
4953 to explicitly check that the other modifiers are not down. For
4954 example::
4955
4956 if event.GetModifers() == wx.MOD_CONTROL:
4957 DoSomething()
4958
4959 """
4960 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4961
4962 def ControlDown(*args, **kwargs):
4963 """
4964 ControlDown(self) -> bool
4965
4966 Returns ``True`` if the Control key was down at the time of the event.
4967 """
4968 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4969
4970 def MetaDown(*args, **kwargs):
4971 """
4972 MetaDown(self) -> bool
4973
4974 Returns ``True`` if the Meta key was down at the time of the event.
4975 """
4976 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4977
4978 def AltDown(*args, **kwargs):
4979 """
4980 AltDown(self) -> bool
4981
4982 Returns ``True`` if the Alt key was down at the time of the event.
4983 """
4984 return _core_.KeyEvent_AltDown(*args, **kwargs)
4985
4986 def ShiftDown(*args, **kwargs):
4987 """
4988 ShiftDown(self) -> bool
4989
4990 Returns ``True`` if the Shift key was down at the time of the event.
4991 """
4992 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4993
4994 def CmdDown(*args, **kwargs):
4995 """
4996 CmdDown(self) -> bool
4997
4998 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4999 platforms but the special "Apple" (a.k.a as "Command") key on
5000 Macs. It makes often sense to use it instead of, say, `ControlDown`
5001 because Cmd key is used for the same thing under Mac as Ctrl
5002 elsewhere. The Ctrl still exists, it's just not used for this
5003 purpose. So for non-Mac platforms this is the same as `ControlDown`
5004 and Macs this is the same as `MetaDown`.
5005 """
5006 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5007
5008 def HasModifiers(*args, **kwargs):
5009 """
5010 HasModifiers(self) -> bool
5011
5012 Returns true if either CTRL or ALT keys was down at the time of the
5013 key event. Note that this function does not take into account neither
5014 SHIFT nor META key states (the reason for ignoring the latter is that
5015 it is common for NUMLOCK key to be configured as META under X but the
5016 key presses even while NUMLOCK is on should be still processed
5017 normally).
5018 """
5019 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5020
5021 def GetKeyCode(*args, **kwargs):
5022 """
5023 GetKeyCode(self) -> int
5024
5025 Returns the virtual key code. ASCII events return normal ASCII values,
5026 while non-ASCII events return values such as WXK_LEFT for the left
5027 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5028 codes.
5029
5030 Note that in Unicode build, the returned value is meaningful only if
5031 the user entered a character that can be represented in current
5032 locale's default charset. You can obtain the corresponding Unicode
5033 character using `GetUnicodeKey`.
5034 """
5035 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5036
5037 def GetUnicodeKey(*args, **kwargs):
5038 """
5039 GetUnicodeKey(self) -> int
5040
5041 Returns the Unicode character corresponding to this key event. This
5042 function is only meaningfule in a Unicode build of wxPython.
5043 """
5044 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
5045
5046 GetUniChar = GetUnicodeKey
5047 def SetUnicodeKey(*args, **kwargs):
5048 """
5049 SetUnicodeKey(self, int uniChar)
5050
5051 Set the Unicode value of the key event, but only if this is a Unicode
5052 build of wxPython.
5053 """
5054 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5055
5056 def GetRawKeyCode(*args, **kwargs):
5057 """
5058 GetRawKeyCode(self) -> unsigned int
5059
5060 Returns the raw key code for this event. This is a platform-dependent
5061 scan code which should only be used in advanced
5062 applications. Currently the raw key codes are not supported by all
5063 ports.
5064 """
5065 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5066
5067 def GetRawKeyFlags(*args, **kwargs):
5068 """
5069 GetRawKeyFlags(self) -> unsigned int
5070
5071 Returns the low level key flags for this event. The flags are
5072 platform-dependent and should only be used in advanced applications.
5073 Currently the raw key flags are not supported by all ports.
5074 """
5075 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5076
5077 def GetPosition(*args, **kwargs):
5078 """
5079 GetPosition(self) -> Point
5080
5081 Find the position of the event, if applicable.
5082 """
5083 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5084
5085 def GetPositionTuple(*args, **kwargs):
5086 """
5087 GetPositionTuple() -> (x,y)
5088
5089 Find the position of the event, if applicable.
5090 """
5091 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5092
5093 def GetX(*args, **kwargs):
5094 """
5095 GetX(self) -> int
5096
5097 Returns the X position (in client coordinates) of the event, if
5098 applicable.
5099 """
5100 return _core_.KeyEvent_GetX(*args, **kwargs)
5101
5102 def GetY(*args, **kwargs):
5103 """
5104 GetY(self) -> int
5105
5106 Returns the Y position (in client coordinates) of the event, if
5107 applicable.
5108 """
5109 return _core_.KeyEvent_GetY(*args, **kwargs)
5110
5111 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5112 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5113 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5114 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5115 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5116 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5117 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5118 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5119 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5120 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5121 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5122 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5123 Position = property(GetPosition,doc="See `GetPosition`")
5124 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5125 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5126 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5127 X = property(GetX,doc="See `GetX`")
5128 Y = property(GetY,doc="See `GetY`")
5129 _core_.KeyEvent_swigregister(KeyEvent)
5130
5131 #---------------------------------------------------------------------------
5132
5133 class SizeEvent(Event):
5134 """
5135 A size event holds information about size change events. The EVT_SIZE
5136 handler function will be called when the window it is bound to has
5137 been resized.
5138
5139 Note that the size passed is of the whole window: call
5140 `wx.Window.GetClientSize` for the area which may be used by the
5141 application.
5142
5143 When a window is resized, usually only a small part of the window is
5144 damaged and and that area is all that is in the update region for the
5145 next paint event. However, if your drawing depends on the size of the
5146 window, you may need to clear the DC explicitly and repaint the whole
5147 window. In which case, you may need to call `wx.Window.Refresh` to
5148 invalidate the entire window.
5149
5150 """
5151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5152 __repr__ = _swig_repr
5153 def __init__(self, *args, **kwargs):
5154 """
5155 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5156
5157 Construct a new ``wx.SizeEvent``.
5158 """
5159 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5160 def GetSize(*args, **kwargs):
5161 """
5162 GetSize(self) -> Size
5163
5164 Returns the entire size of the window generating the size change
5165 event.
5166 """
5167 return _core_.SizeEvent_GetSize(*args, **kwargs)
5168
5169 def GetRect(*args, **kwargs):
5170 """GetRect(self) -> Rect"""
5171 return _core_.SizeEvent_GetRect(*args, **kwargs)
5172
5173 def SetRect(*args, **kwargs):
5174 """SetRect(self, Rect rect)"""
5175 return _core_.SizeEvent_SetRect(*args, **kwargs)
5176
5177 def SetSize(*args, **kwargs):
5178 """SetSize(self, Size size)"""
5179 return _core_.SizeEvent_SetSize(*args, **kwargs)
5180
5181 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5182 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5183 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5184 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
5185 _core_.SizeEvent_swigregister(SizeEvent)
5186
5187 #---------------------------------------------------------------------------
5188
5189 class MoveEvent(Event):
5190 """
5191 This event object is sent for EVT_MOVE event bindings when a window is
5192 moved to a new position.
5193 """
5194 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5195 __repr__ = _swig_repr
5196 def __init__(self, *args, **kwargs):
5197 """
5198 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5199
5200 Constructor.
5201 """
5202 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5203 def GetPosition(*args, **kwargs):
5204 """
5205 GetPosition(self) -> Point
5206
5207 Returns the position of the window generating the move change event.
5208 """
5209 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5210
5211 def GetRect(*args, **kwargs):
5212 """GetRect(self) -> Rect"""
5213 return _core_.MoveEvent_GetRect(*args, **kwargs)
5214
5215 def SetRect(*args, **kwargs):
5216 """SetRect(self, Rect rect)"""
5217 return _core_.MoveEvent_SetRect(*args, **kwargs)
5218
5219 def SetPosition(*args, **kwargs):
5220 """SetPosition(self, Point pos)"""
5221 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5222
5223 m_pos = property(GetPosition, SetPosition)
5224 m_rect = property(GetRect, SetRect)
5225
5226 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5227 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5228 _core_.MoveEvent_swigregister(MoveEvent)
5229
5230 #---------------------------------------------------------------------------
5231
5232 class PaintEvent(Event):
5233 """
5234 A paint event is sent when a window's contents needs to be repainted.
5235 Note that in an EVT_PAINT handler the application must *always* create
5236 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5237 Windows assumes that the window has not been painted yet and will send
5238 the event again, causing endless refreshes.
5239
5240 You can optimize painting by retrieving the rectangles that have been
5241 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5242 and only repainting these rectangles. The rectangles are in terms of
5243 the client area, and are unscrolled, so you will need to do some
5244 calculations using the current view position to obtain logical,
5245 scrolled units.
5246
5247 """
5248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5249 __repr__ = _swig_repr
5250 def __init__(self, *args, **kwargs):
5251 """__init__(self, int Id=0) -> PaintEvent"""
5252 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5253 _core_.PaintEvent_swigregister(PaintEvent)
5254
5255 class NcPaintEvent(Event):
5256 """Proxy of C++ NcPaintEvent class"""
5257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5258 __repr__ = _swig_repr
5259 def __init__(self, *args, **kwargs):
5260 """__init__(self, int winid=0) -> NcPaintEvent"""
5261 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5262 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5263
5264 #---------------------------------------------------------------------------
5265
5266 class EraseEvent(Event):
5267 """
5268 An erase event is sent whenever the background of a window needs to be
5269 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5270 binder. On some platforms, such as GTK+, this event is simulated
5271 (simply generated just before the paint event) and may cause flicker.
5272
5273 To paint a custom background use the `GetDC` method and use the returned
5274 device context if it is not ``None``, otherwise create a temporary
5275 `wx.ClientDC` and draw on that.
5276
5277 """
5278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5279 __repr__ = _swig_repr
5280 def __init__(self, *args, **kwargs):
5281 """
5282 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5283
5284 Constructor
5285 """
5286 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5287 def GetDC(*args, **kwargs):
5288 """
5289 GetDC(self) -> DC
5290
5291 Returns the device context the event handler should draw upon. If
5292 ``None`` is returned then create a temporary `wx.ClientDC` and use
5293 that instead.
5294 """
5295 return _core_.EraseEvent_GetDC(*args, **kwargs)
5296
5297 DC = property(GetDC,doc="See `GetDC`")
5298 _core_.EraseEvent_swigregister(EraseEvent)
5299
5300 #---------------------------------------------------------------------------
5301
5302 class FocusEvent(Event):
5303 """
5304 A focus event is sent when a window's focus changes. The window losing
5305 focus receives an EVT_KILL_FOCUS event while the window gaining it
5306 gets an EVT_SET_FOCUS event.
5307
5308 Notice that the set focus event happens both when the user gives focus
5309 to the window (whether using the mouse or keyboard) and when it is
5310 done from the program itself using `wx.Window.SetFocus`.
5311
5312 """
5313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5314 __repr__ = _swig_repr
5315 def __init__(self, *args, **kwargs):
5316 """
5317 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5318
5319 Constructor
5320 """
5321 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5322 def GetWindow(*args, **kwargs):
5323 """
5324 GetWindow(self) -> Window
5325
5326 Returns the other window associated with this event, that is the
5327 window which had the focus before for the EVT_SET_FOCUS event and the
5328 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5329
5330 Warning: the window returned may be None!
5331 """
5332 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5333
5334 def SetWindow(*args, **kwargs):
5335 """SetWindow(self, Window win)"""
5336 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5337
5338 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5339 _core_.FocusEvent_swigregister(FocusEvent)
5340
5341 #---------------------------------------------------------------------------
5342
5343 class ChildFocusEvent(CommandEvent):
5344 """
5345 A child focus event is sent to a (parent-)window when one of its child
5346 windows gains focus, so that the window could restore the focus back
5347 to its corresponding child if it loses it now and regains later.
5348
5349 Notice that child window is the direct child of the window receiving
5350 the event, and so may not be the actual widget recieving focus if it
5351 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5352 to get the widget that is actually receiving focus.
5353 """
5354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5355 __repr__ = _swig_repr
5356 def __init__(self, *args, **kwargs):
5357 """
5358 __init__(self, Window win=None) -> ChildFocusEvent
5359
5360 Constructor
5361 """
5362 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5363 def GetWindow(*args, **kwargs):
5364 """
5365 GetWindow(self) -> Window
5366
5367 The window, or (grand)parent of the window which has just received the
5368 focus.
5369 """
5370 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5371
5372 Window = property(GetWindow,doc="See `GetWindow`")
5373 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5374
5375 #---------------------------------------------------------------------------
5376
5377 class ActivateEvent(Event):
5378 """
5379 An activate event is sent when a top-level window or the entire
5380 application is being activated or deactivated.
5381
5382 A top-level window (a dialog or frame) receives an activate event when
5383 is being activated or deactivated. This is indicated visually by the
5384 title bar changing colour, and a subwindow gaining the keyboard focus.
5385 An application is activated or deactivated when one of its frames
5386 becomes activated, or a frame becomes inactivate resulting in all
5387 application frames being inactive.
5388
5389 Please note that usually you should call event.Skip() in your handlers
5390 for these events so the default handlers will still be called, as not
5391 doing so can result in strange effects.
5392
5393 """
5394 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5395 __repr__ = _swig_repr
5396 def __init__(self, *args, **kwargs):
5397 """
5398 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5399
5400 Constructor
5401 """
5402 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5403 def GetActive(*args, **kwargs):
5404 """
5405 GetActive(self) -> bool
5406
5407 Returns true if the application or window is being activated, false
5408 otherwise.
5409 """
5410 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5411
5412 Active = property(GetActive,doc="See `GetActive`")
5413 _core_.ActivateEvent_swigregister(ActivateEvent)
5414
5415 #---------------------------------------------------------------------------
5416
5417 class InitDialogEvent(Event):
5418 """
5419 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5420 any window when `wx.Window.InitDialog` is called. Handlers for this
5421 event can transfer data to the window, or anything else that should be
5422 done before the user begins editing the form. The default handler
5423 calls `wx.Window.TransferDataToWindow`.
5424 """
5425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5426 __repr__ = _swig_repr
5427 def __init__(self, *args, **kwargs):
5428 """
5429 __init__(self, int Id=0) -> InitDialogEvent
5430
5431 Constructor
5432 """
5433 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5434 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5435
5436 #---------------------------------------------------------------------------
5437
5438 class MenuEvent(Event):
5439 """
5440 This class is used for a variety of menu-related events. Note that
5441 these do not include menu command events, which are handled by sending
5442 `wx.CommandEvent` objects.
5443
5444 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5445 text in the first field of the status bar.
5446 """
5447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5448 __repr__ = _swig_repr
5449 def __init__(self, *args, **kwargs):
5450 """
5451 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5452
5453 Constructor
5454 """
5455 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5456 def GetMenuId(*args, **kwargs):
5457 """
5458 GetMenuId(self) -> int
5459
5460 Returns the menu identifier associated with the event. This method
5461 should be only used with the HIGHLIGHT events.
5462 """
5463 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5464
5465 def IsPopup(*args, **kwargs):
5466 """
5467 IsPopup(self) -> bool
5468
5469 Returns ``True`` if the menu which is being opened or closed is a
5470 popup menu, ``False`` if it is a normal one. This method should only
5471 be used with the OPEN and CLOSE events.
5472 """
5473 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5474
5475 def GetMenu(*args, **kwargs):
5476 """
5477 GetMenu(self) -> Menu
5478
5479 Returns the menu which is being opened or closed. This method should
5480 only be used with the OPEN and CLOSE events.
5481 """
5482 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5483
5484 Menu = property(GetMenu,doc="See `GetMenu`")
5485 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5486 _core_.MenuEvent_swigregister(MenuEvent)
5487
5488 #---------------------------------------------------------------------------
5489
5490 class CloseEvent(Event):
5491 """
5492 This event class contains information about window and session close
5493 events.
5494
5495 The handler function for EVT_CLOSE is called when the user has tried
5496 to close a a frame or dialog box using the window manager controls or
5497 the system menu. It can also be invoked by the application itself
5498 programmatically, for example by calling the `wx.Window.Close`
5499 function.
5500
5501 You should check whether the application is forcing the deletion of
5502 the window using `CanVeto`. If it returns ``False``, you must destroy
5503 the window using `wx.Window.Destroy`. If the return value is ``True``,
5504 it is up to you whether you respond by destroying the window or not.
5505 For example you may wish to display a message dialog prompting to save
5506 files or to cancel the close.
5507
5508 If you don't destroy the window, you should call `Veto` to let the
5509 calling code know that you did not destroy the window. This allows the
5510 `wx.Window.Close` function to return ``True`` or ``False`` depending
5511 on whether the close instruction was honored or not.
5512 """
5513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5514 __repr__ = _swig_repr
5515 def __init__(self, *args, **kwargs):
5516 """
5517 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5518
5519 Constructor.
5520 """
5521 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5522 def SetLoggingOff(*args, **kwargs):
5523 """
5524 SetLoggingOff(self, bool logOff)
5525
5526 Sets the 'logging off' flag.
5527 """
5528 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5529
5530 def GetLoggingOff(*args, **kwargs):
5531 """
5532 GetLoggingOff(self) -> bool
5533
5534 Returns ``True`` if the user is logging off or ``False`` if the
5535 system is shutting down. This method can only be called for end
5536 session and query end session events, it doesn't make sense for close
5537 window event.
5538 """
5539 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5540
5541 def Veto(*args, **kwargs):
5542 """
5543 Veto(self, bool veto=True)
5544
5545 Call this from your event handler to veto a system shutdown or to
5546 signal to the calling application that a window close did not happen.
5547
5548 You can only veto a shutdown or close if `CanVeto` returns true.
5549 """
5550 return _core_.CloseEvent_Veto(*args, **kwargs)
5551
5552 def GetVeto(*args, **kwargs):
5553 """GetVeto(self) -> bool"""
5554 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5555
5556 def SetCanVeto(*args, **kwargs):
5557 """
5558 SetCanVeto(self, bool canVeto)
5559
5560 Sets the 'can veto' flag.
5561 """
5562 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5563
5564 def CanVeto(*args, **kwargs):
5565 """
5566 CanVeto(self) -> bool
5567
5568 Returns true if you can veto a system shutdown or a window close
5569 event. Vetoing a window close event is not possible if the calling
5570 code wishes to force the application to exit, and so this function
5571 must be called to check this.
5572 """
5573 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5574
5575 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5576 _core_.CloseEvent_swigregister(CloseEvent)
5577
5578 #---------------------------------------------------------------------------
5579
5580 class ShowEvent(Event):
5581 """An EVT_SHOW event is sent when a window is shown or hidden."""
5582 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5583 __repr__ = _swig_repr
5584 def __init__(self, *args, **kwargs):
5585 """
5586 __init__(self, int winid=0, bool show=False) -> ShowEvent
5587
5588 An EVT_SHOW event is sent when a window is shown or hidden.
5589 """
5590 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5591 def SetShow(*args, **kwargs):
5592 """SetShow(self, bool show)"""
5593 return _core_.ShowEvent_SetShow(*args, **kwargs)
5594
5595 def GetShow(*args, **kwargs):
5596 """GetShow(self) -> bool"""
5597 return _core_.ShowEvent_GetShow(*args, **kwargs)
5598
5599 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
5600 _core_.ShowEvent_swigregister(ShowEvent)
5601
5602 #---------------------------------------------------------------------------
5603
5604 class IconizeEvent(Event):
5605 """
5606 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5607 restored.
5608 """
5609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5610 __repr__ = _swig_repr
5611 def __init__(self, *args, **kwargs):
5612 """
5613 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5614
5615 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5616 restored.
5617 """
5618 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5619 def Iconized(*args, **kwargs):
5620 """
5621 Iconized(self) -> bool
5622
5623 Returns ``True`` if the frame has been iconized, ``False`` if it has
5624 been restored.
5625 """
5626 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5627
5628 _core_.IconizeEvent_swigregister(IconizeEvent)
5629
5630 #---------------------------------------------------------------------------
5631
5632 class MaximizeEvent(Event):
5633 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5634 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5635 __repr__ = _swig_repr
5636 def __init__(self, *args, **kwargs):
5637 """
5638 __init__(self, int id=0) -> MaximizeEvent
5639
5640 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5641 """
5642 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5643 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5644
5645 #---------------------------------------------------------------------------
5646
5647 class DropFilesEvent(Event):
5648 """
5649 This class is used for drop files events, that is, when files have
5650 been dropped onto the window. This functionality is only available
5651 under Windows. The window must have previously been enabled for
5652 dropping by calling `wx.Window.DragAcceptFiles`.
5653
5654 Important note: this is a separate implementation to the more general
5655 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5656 implementation uses the older, Windows message-based approach of
5657 dropping files.
5658
5659 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5660 events.
5661
5662 """
5663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5664 def __init__(self): raise AttributeError, "No constructor defined"
5665 __repr__ = _swig_repr
5666 def GetPosition(*args, **kwargs):
5667 """
5668 GetPosition(self) -> Point
5669
5670 Returns the position at which the files were dropped.
5671 """
5672 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5673
5674 def GetNumberOfFiles(*args, **kwargs):
5675 """
5676 GetNumberOfFiles(self) -> int
5677
5678 Returns the number of files dropped.
5679 """
5680 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5681
5682 def GetFiles(*args, **kwargs):
5683 """
5684 GetFiles(self) -> PyObject
5685
5686 Returns a list of the filenames that were dropped.
5687 """
5688 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5689
5690 Files = property(GetFiles,doc="See `GetFiles`")
5691 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5692 Position = property(GetPosition,doc="See `GetPosition`")
5693 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5694
5695 #---------------------------------------------------------------------------
5696
5697 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5698 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5699 class UpdateUIEvent(CommandEvent):
5700 """
5701 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5702 wxWidgets to give an application the chance to update various user
5703 interface elements.
5704
5705 Without update UI events, an application has to work hard to
5706 check/uncheck, enable/disable, and set the text for elements such as
5707 menu items and toolbar buttons. The code for doing this has to be
5708 mixed up with the code that is invoked when an action is invoked for a
5709 menu item or button.
5710
5711 With update UI events, you define an event handler to look at the
5712 state of the application and change UI elements accordingly. wxWidgets
5713 will call your handler functions in idle time, so you don't have to
5714 worry where to call this code. In addition to being a clearer and more
5715 declarative method, it also means you don't have to worry whether
5716 you're updating a toolbar or menubar identifier. The same handler can
5717 update a menu item and toolbar button, if the ID values are the same.
5718
5719 Instead of directly manipulating the menu or button, you call
5720 functions in the event object, such as `Check`. wxWidgets will
5721 determine whether such a call has been made, and which UI element to
5722 update.
5723
5724 These events will work for popup menus as well as menubars. Just
5725 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5726 any UI events for the window that owns the menu.
5727
5728 If you find that the overhead of UI update processing is affecting
5729 your application, you can do one or both of the following:
5730
5731 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5732 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5733 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5734 receive update events. No other windows will receive update
5735 events.
5736
5737 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5738 value to set the delay between updates. You may need to call
5739 `wx.Window.UpdateWindowUI` at critical points, for example when
5740 a dialog is about to be shown, in case the user sees a slight
5741 delay before windows are updated.
5742
5743 Note that although events are sent in idle time, defining a EVT_IDLE
5744 handler for a window does not affect this because the events are sent
5745 from an internal idle handler.
5746
5747 wxWidgets tries to optimize update events on some platforms. On
5748 Windows and GTK+, events for menubar items are only sent when the menu
5749 is about to be shown, and not in idle time.
5750
5751 """
5752 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5753 __repr__ = _swig_repr
5754 def __init__(self, *args, **kwargs):
5755 """
5756 __init__(self, int commandId=0) -> UpdateUIEvent
5757
5758 Constructor
5759 """
5760 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5761 def GetChecked(*args, **kwargs):
5762 """
5763 GetChecked(self) -> bool
5764
5765 Returns ``True`` if the UI element should be checked.
5766 """
5767 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5768
5769 def GetEnabled(*args, **kwargs):
5770 """
5771 GetEnabled(self) -> bool
5772
5773 Returns ``True`` if the UI element should be enabled.
5774 """
5775 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5776
5777 def GetShown(*args, **kwargs):
5778 """
5779 GetShown(self) -> bool
5780
5781 Returns ``True`` if the UI element should be shown.
5782 """
5783 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5784
5785 def GetText(*args, **kwargs):
5786 """
5787 GetText(self) -> String
5788
5789 Returns the text that should be set for the UI element.
5790 """
5791 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5792
5793 def GetSetText(*args, **kwargs):
5794 """
5795 GetSetText(self) -> bool
5796
5797 Returns ``True`` if the application has called `SetText`. For
5798 wxWidgets internal use only.
5799 """
5800 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5801
5802 def GetSetChecked(*args, **kwargs):
5803 """
5804 GetSetChecked(self) -> bool
5805
5806 Returns ``True`` if the application has called `Check`. For wxWidgets
5807 internal use only.
5808 """
5809 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5810
5811 def GetSetEnabled(*args, **kwargs):
5812 """
5813 GetSetEnabled(self) -> bool
5814
5815 Returns ``True`` if the application has called `Enable`. For wxWidgets
5816 internal use only.
5817 """
5818 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5819
5820 def GetSetShown(*args, **kwargs):
5821 """
5822 GetSetShown(self) -> bool
5823
5824 Returns ``True`` if the application has called `Show`. For wxWidgets
5825 internal use only.
5826 """
5827 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5828
5829 def Check(*args, **kwargs):
5830 """
5831 Check(self, bool check)
5832
5833 Check or uncheck the UI element.
5834 """
5835 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5836
5837 def Enable(*args, **kwargs):
5838 """
5839 Enable(self, bool enable)
5840
5841 Enable or disable the UI element.
5842 """
5843 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5844
5845 def Show(*args, **kwargs):
5846 """
5847 Show(self, bool show)
5848
5849 Show or hide the UI element.
5850 """
5851 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5852
5853 def SetText(*args, **kwargs):
5854 """
5855 SetText(self, String text)
5856
5857 Sets the text for this UI element.
5858 """
5859 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5860
5861 def SetUpdateInterval(*args, **kwargs):
5862 """
5863 SetUpdateInterval(long updateInterval)
5864
5865 Sets the interval between updates in milliseconds. Set to -1 to
5866 disable updates, or to 0 to update as frequently as possible. The
5867 default is 0.
5868
5869 Use this to reduce the overhead of UI update events if your
5870 application has a lot of windows. If you set the value to -1 or
5871 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5872 at appropriate points in your application, such as when a dialog is
5873 about to be shown.
5874 """
5875 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5876
5877 SetUpdateInterval = staticmethod(SetUpdateInterval)
5878 def GetUpdateInterval(*args, **kwargs):
5879 """
5880 GetUpdateInterval() -> long
5881
5882 Returns the current interval between updates in milliseconds. -1
5883 disables updates, 0 updates as frequently as possible.
5884 """
5885 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5886
5887 GetUpdateInterval = staticmethod(GetUpdateInterval)
5888 def CanUpdate(*args, **kwargs):
5889 """
5890 CanUpdate(Window win) -> bool
5891
5892 Returns ``True`` if it is appropriate to update (send UI update events
5893 to) this window.
5894
5895 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5896 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5897 events were last sent in idle time, and the update interval, to
5898 determine whether events should be sent to this window now. By default
5899 this will always return true because the update mode is initially
5900 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5901 events will be sent as often as possible. You can reduce the frequency
5902 that events are sent by changing the mode and/or setting an update
5903 interval.
5904
5905 """
5906 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5907
5908 CanUpdate = staticmethod(CanUpdate)
5909 def ResetUpdateTime(*args, **kwargs):
5910 """
5911 ResetUpdateTime()
5912
5913 Used internally to reset the last-updated time to the current time. It
5914 is assumed that update events are normally sent in idle time, so this
5915 is called at the end of idle processing.
5916 """
5917 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5918
5919 ResetUpdateTime = staticmethod(ResetUpdateTime)
5920 def SetMode(*args, **kwargs):
5921 """
5922 SetMode(int mode)
5923
5924 Specify how wxWidgets will send update events: to all windows, or only
5925 to those which specify that they will process the events.
5926
5927 The mode may be one of the following values:
5928
5929 ============================= ==========================================
5930 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5931 is the default setting.
5932 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5933 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5934 style set.
5935 ============================= ==========================================
5936
5937 """
5938 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5939
5940 SetMode = staticmethod(SetMode)
5941 def GetMode(*args, **kwargs):
5942 """
5943 GetMode() -> int
5944
5945 Returns a value specifying how wxWidgets will send update events: to
5946 all windows, or only to those which specify that they will process the
5947 events.
5948 """
5949 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5950
5951 GetMode = staticmethod(GetMode)
5952 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5953 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5954 Shown = property(GetShown,Show,doc="See `GetShown`")
5955 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
5956 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5957
5958 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5959 """
5960 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5961
5962 Sets the interval between updates in milliseconds. Set to -1 to
5963 disable updates, or to 0 to update as frequently as possible. The
5964 default is 0.
5965
5966 Use this to reduce the overhead of UI update events if your
5967 application has a lot of windows. If you set the value to -1 or
5968 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5969 at appropriate points in your application, such as when a dialog is
5970 about to be shown.
5971 """
5972 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5973
5974 def UpdateUIEvent_GetUpdateInterval(*args):
5975 """
5976 UpdateUIEvent_GetUpdateInterval() -> long
5977
5978 Returns the current interval between updates in milliseconds. -1
5979 disables updates, 0 updates as frequently as possible.
5980 """
5981 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5982
5983 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5984 """
5985 UpdateUIEvent_CanUpdate(Window win) -> bool
5986
5987 Returns ``True`` if it is appropriate to update (send UI update events
5988 to) this window.
5989
5990 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5991 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5992 events were last sent in idle time, and the update interval, to
5993 determine whether events should be sent to this window now. By default
5994 this will always return true because the update mode is initially
5995 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5996 events will be sent as often as possible. You can reduce the frequency
5997 that events are sent by changing the mode and/or setting an update
5998 interval.
5999
6000 """
6001 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6002
6003 def UpdateUIEvent_ResetUpdateTime(*args):
6004 """
6005 UpdateUIEvent_ResetUpdateTime()
6006
6007 Used internally to reset the last-updated time to the current time. It
6008 is assumed that update events are normally sent in idle time, so this
6009 is called at the end of idle processing.
6010 """
6011 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
6012
6013 def UpdateUIEvent_SetMode(*args, **kwargs):
6014 """
6015 UpdateUIEvent_SetMode(int mode)
6016
6017 Specify how wxWidgets will send update events: to all windows, or only
6018 to those which specify that they will process the events.
6019
6020 The mode may be one of the following values:
6021
6022 ============================= ==========================================
6023 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6024 is the default setting.
6025 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6026 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6027 style set.
6028 ============================= ==========================================
6029
6030 """
6031 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6032
6033 def UpdateUIEvent_GetMode(*args):
6034 """
6035 UpdateUIEvent_GetMode() -> int
6036
6037 Returns a value specifying how wxWidgets will send update events: to
6038 all windows, or only to those which specify that they will process the
6039 events.
6040 """
6041 return _core_.UpdateUIEvent_GetMode(*args)
6042
6043 #---------------------------------------------------------------------------
6044
6045 class SysColourChangedEvent(Event):
6046 """
6047 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6048 when the user changes the colour settings using the control
6049 panel. This is only applicable under Windows.
6050
6051 The default event handler for this event propagates the event to child
6052 windows, since Windows only sends the events to top-level windows. If
6053 intercepting this event for a top-level window, remember to call
6054 `Skip` so the the base class handler will still be executed, or to
6055 pass the event on to the window's children explicitly.
6056
6057 """
6058 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6059 __repr__ = _swig_repr
6060 def __init__(self, *args, **kwargs):
6061 """
6062 __init__(self) -> SysColourChangedEvent
6063
6064 Constructor
6065 """
6066 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
6067 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
6068
6069 #---------------------------------------------------------------------------
6070
6071 class MouseCaptureChangedEvent(Event):
6072 """
6073 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6074 a window that loses its mouse capture. This is called even if
6075 `wx.Window.ReleaseMouse` was called by the application code. Handling
6076 this event allows an application to cater for unexpected capture
6077 releases which might otherwise confuse mouse handling code.
6078
6079 This event is implemented under Windows only.
6080 """
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
6084 """
6085 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6086
6087 Constructor
6088 """
6089 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
6090 def GetCapturedWindow(*args, **kwargs):
6091 """
6092 GetCapturedWindow(self) -> Window
6093
6094 Returns the window that gained the capture, or ``None`` if it was a
6095 non-wxWidgets window.
6096 """
6097 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6098
6099 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
6100 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
6101
6102 #---------------------------------------------------------------------------
6103
6104 class MouseCaptureLostEvent(Event):
6105 """
6106 A mouse capture lost event is sent to a window that obtained mouse
6107 capture, which was subsequently loss due to "external" event, for
6108 example when a dialog box is shown or if another application captures
6109 the mouse.
6110
6111 If this happens, this event is sent to all windows that are on the
6112 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6113 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6114 if the capture changes because of a call to CaptureMouse or
6115 ReleaseMouse.
6116
6117 This event is currently emitted under Windows only.
6118
6119 """
6120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6121 __repr__ = _swig_repr
6122 def __init__(self, *args, **kwargs):
6123 """
6124 __init__(self, int winid=0) -> MouseCaptureLostEvent
6125
6126 A mouse capture lost event is sent to a window that obtained mouse
6127 capture, which was subsequently loss due to "external" event, for
6128 example when a dialog box is shown or if another application captures
6129 the mouse.
6130
6131 If this happens, this event is sent to all windows that are on the
6132 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6133 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6134 if the capture changes because of a call to CaptureMouse or
6135 ReleaseMouse.
6136
6137 This event is currently emitted under Windows only.
6138
6139 """
6140 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6141 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6142
6143 #---------------------------------------------------------------------------
6144
6145 class DisplayChangedEvent(Event):
6146 """
6147 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6148 resolution has changed.
6149
6150 This event is implemented under Windows only.
6151 """
6152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6153 __repr__ = _swig_repr
6154 def __init__(self, *args, **kwargs):
6155 """__init__(self) -> DisplayChangedEvent"""
6156 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6157 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6158
6159 #---------------------------------------------------------------------------
6160
6161 class PaletteChangedEvent(Event):
6162 """
6163 An EVT_PALETTE_CHANGED event is sent when the system palette has
6164 changed, thereby giving each window a chance to redo their own to
6165 match.
6166
6167 This event is implemented under Windows only.
6168 """
6169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6170 __repr__ = _swig_repr
6171 def __init__(self, *args, **kwargs):
6172 """
6173 __init__(self, int id=0) -> PaletteChangedEvent
6174
6175 An EVT_PALETTE_CHANGED event is sent when the system palette has
6176 changed, thereby giving each window a chance to redo their own to
6177 match.
6178
6179 This event is implemented under Windows only.
6180 """
6181 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6182 def SetChangedWindow(*args, **kwargs):
6183 """SetChangedWindow(self, Window win)"""
6184 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6185
6186 def GetChangedWindow(*args, **kwargs):
6187 """GetChangedWindow(self) -> Window"""
6188 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6189
6190 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
6191 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6192
6193 #---------------------------------------------------------------------------
6194
6195 class QueryNewPaletteEvent(Event):
6196 """
6197 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6198 focus and should re-do its palette.
6199
6200 This event is implemented under Windows only.
6201 """
6202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6203 __repr__ = _swig_repr
6204 def __init__(self, *args, **kwargs):
6205 """
6206 __init__(self, int winid=0) -> QueryNewPaletteEvent
6207
6208 Constructor.
6209 """
6210 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6211 def SetPaletteRealized(*args, **kwargs):
6212 """
6213 SetPaletteRealized(self, bool realized)
6214
6215 App should set this if it changes the palette.
6216 """
6217 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6218
6219 def GetPaletteRealized(*args, **kwargs):
6220 """GetPaletteRealized(self) -> bool"""
6221 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6222
6223 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
6224 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6225
6226 #---------------------------------------------------------------------------
6227
6228 class NavigationKeyEvent(Event):
6229 """
6230 EVT_NAVIGATION_KEY events are used to control moving the focus between
6231 widgets, otherwise known as tab-traversal. You woudl normally not
6232 catch navigation events in applications as there are already
6233 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6234 it useful to send navigation events in certain situations to change
6235 the focus in certain ways, although it's probably easier to just call
6236 `wx.Window.Navigate`.
6237 """
6238 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6239 __repr__ = _swig_repr
6240 def __init__(self, *args, **kwargs):
6241 """__init__(self) -> NavigationKeyEvent"""
6242 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6243 def GetDirection(*args, **kwargs):
6244 """
6245 GetDirection(self) -> bool
6246
6247 Returns ``True`` if the direction is forward, ``False`` otherwise.
6248 """
6249 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6250
6251 def SetDirection(*args, **kwargs):
6252 """
6253 SetDirection(self, bool forward)
6254
6255 Specify the direction that the navigation should take. Usually the
6256 difference between using Tab and Shift-Tab.
6257 """
6258 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6259
6260 def IsWindowChange(*args, **kwargs):
6261 """
6262 IsWindowChange(self) -> bool
6263
6264 Returns ``True`` if window change is allowed.
6265 """
6266 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6267
6268 def SetWindowChange(*args, **kwargs):
6269 """
6270 SetWindowChange(self, bool ischange)
6271
6272 Specify if the navigation should be able to change parent windows.
6273 For example, changing notebook pages, etc. This is usually implemented
6274 by using Control-Tab.
6275 """
6276 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6277
6278 def IsFromTab(*args, **kwargs):
6279 """
6280 IsFromTab(self) -> bool
6281
6282 Returns ``True`` if the navigation event is originated from the Tab
6283 key.
6284 """
6285 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6286
6287 def SetFromTab(*args, **kwargs):
6288 """
6289 SetFromTab(self, bool bIs)
6290
6291 Set to true under MSW if the event was generated using the tab key.
6292 This is required for proper navogation over radio buttons.
6293 """
6294 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6295
6296 def SetFlags(*args, **kwargs):
6297 """
6298 SetFlags(self, long flags)
6299
6300 Set the navigation flags to a combination of the following:
6301
6302 * wx.NavigationKeyEvent.IsBackward
6303 * wx.NavigationKeyEvent.IsForward
6304 * wx.NavigationKeyEvent.WinChange
6305 * wx.NavigationKeyEvent.FromTab
6306
6307 """
6308 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6309
6310 def GetCurrentFocus(*args, **kwargs):
6311 """
6312 GetCurrentFocus(self) -> Window
6313
6314 Returns the child window which currenty has the focus. May be
6315 ``None``.
6316 """
6317 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6318
6319 def SetCurrentFocus(*args, **kwargs):
6320 """
6321 SetCurrentFocus(self, Window win)
6322
6323 Set the window that has the focus.
6324 """
6325 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6326
6327 IsBackward = _core_.NavigationKeyEvent_IsBackward
6328 IsForward = _core_.NavigationKeyEvent_IsForward
6329 WinChange = _core_.NavigationKeyEvent_WinChange
6330 FromTab = _core_.NavigationKeyEvent_FromTab
6331 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6332 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6333 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6334
6335 #---------------------------------------------------------------------------
6336
6337 class WindowCreateEvent(CommandEvent):
6338 """
6339 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6340 underlying GUI object) exists.
6341 """
6342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6343 __repr__ = _swig_repr
6344 def __init__(self, *args, **kwargs):
6345 """
6346 __init__(self, Window win=None) -> WindowCreateEvent
6347
6348 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6349 underlying GUI object) exists.
6350 """
6351 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6352 def GetWindow(*args, **kwargs):
6353 """
6354 GetWindow(self) -> Window
6355
6356 Returns the window that this event refers to.
6357 """
6358 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6359
6360 Window = property(GetWindow,doc="See `GetWindow`")
6361 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6362
6363 class WindowDestroyEvent(CommandEvent):
6364 """
6365 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6366 when the GUI window is destroyed.
6367
6368 When a class derived from `wx.Window` is destroyed its destructor will
6369 have already run by the time this event is sent. Therefore this event
6370 will not usually be received at all by the window itself. Since it is
6371 received after the destructor has run, an object should not try to
6372 handle its own wx.WindowDestroyEvent, but it can be used to get
6373 notification of the destruction of another window.
6374 """
6375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6376 __repr__ = _swig_repr
6377 def __init__(self, *args, **kwargs):
6378 """
6379 __init__(self, Window win=None) -> WindowDestroyEvent
6380
6381 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6382 when the GUI window is destroyed.
6383
6384 When a class derived from `wx.Window` is destroyed its destructor will
6385 have already run by the time this event is sent. Therefore this event
6386 will not usually be received at all by the window itself. Since it is
6387 received after the destructor has run, an object should not try to
6388 handle its own wx.WindowDestroyEvent, but it can be used to get
6389 notification of the destruction of another window.
6390 """
6391 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6392 def GetWindow(*args, **kwargs):
6393 """
6394 GetWindow(self) -> Window
6395
6396 Returns the window that this event refers to.
6397 """
6398 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6399
6400 Window = property(GetWindow,doc="See `GetWindow`")
6401 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6402
6403 #---------------------------------------------------------------------------
6404
6405 class ContextMenuEvent(CommandEvent):
6406 """
6407 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6408 give the application a chance to show a context (popup) menu.
6409 """
6410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6411 __repr__ = _swig_repr
6412 def __init__(self, *args, **kwargs):
6413 """
6414 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6415
6416 Constructor.
6417 """
6418 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6419 def GetPosition(*args, **kwargs):
6420 """
6421 GetPosition(self) -> Point
6422
6423 Returns the position (in screen coordinants) at which the menu should
6424 be shown.
6425 """
6426 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6427
6428 def SetPosition(*args, **kwargs):
6429 """
6430 SetPosition(self, Point pos)
6431
6432 Sets the position at which the menu should be shown.
6433 """
6434 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6435
6436 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6437 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6438
6439 #---------------------------------------------------------------------------
6440
6441 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6442 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6443 class IdleEvent(Event):
6444 """
6445 This class is used for EVT_IDLE events, which are generated and sent
6446 when the application *becomes* idle. In other words, the when the
6447 event queue becomes empty then idle events are sent to all windows (by
6448 default) and as long as none of them call `RequestMore` then there are
6449 no more idle events until after the system event queue has some normal
6450 events and then becomes empty again.
6451
6452 By default, idle events are sent to all windows. If this is causing a
6453 significant overhead in your application, you can call
6454 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6455 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6456 which should receive idle events. Then idle events will only be sent
6457 to those windows and not to any others.
6458 """
6459 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6460 __repr__ = _swig_repr
6461 def __init__(self, *args, **kwargs):
6462 """
6463 __init__(self) -> IdleEvent
6464
6465 Constructor
6466 """
6467 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6468 def RequestMore(*args, **kwargs):
6469 """
6470 RequestMore(self, bool needMore=True)
6471
6472 Tells wxWidgets that more processing is required. This function can be
6473 called by an EVT_IDLE handler for a window to indicate that the
6474 application should forward the EVT_IDLE event once more to the
6475 application windows. If no window calls this function during its
6476 EVT_IDLE handler, then the application will remain in a passive event
6477 loop until a new event is posted to the application by the windowing
6478 system.
6479 """
6480 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6481
6482 def MoreRequested(*args, **kwargs):
6483 """
6484 MoreRequested(self) -> bool
6485
6486 Returns ``True`` if the OnIdle function processing this event
6487 requested more processing time.
6488 """
6489 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6490
6491 def SetMode(*args, **kwargs):
6492 """
6493 SetMode(int mode)
6494
6495 Static method for specifying how wxWidgets will send idle events: to
6496 all windows, or only to those which specify that they will process the
6497 events.
6498
6499 The mode can be one of the following values:
6500
6501 ========================= ========================================
6502 wx.IDLE_PROCESS_ALL Send idle events to all windows
6503 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6504 the wx.WS_EX_PROCESS_IDLE extra style
6505 flag set.
6506 ========================= ========================================
6507
6508 """
6509 return _core_.IdleEvent_SetMode(*args, **kwargs)
6510
6511 SetMode = staticmethod(SetMode)
6512 def GetMode(*args, **kwargs):
6513 """
6514 GetMode() -> int
6515
6516 Static method returning a value specifying how wxWidgets will send
6517 idle events: to all windows, or only to those which specify that they
6518 will process the events.
6519 """
6520 return _core_.IdleEvent_GetMode(*args, **kwargs)
6521
6522 GetMode = staticmethod(GetMode)
6523 def CanSend(*args, **kwargs):
6524 """
6525 CanSend(Window win) -> bool
6526
6527 Returns ``True`` if it is appropriate to send idle events to this
6528 window.
6529
6530 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6531 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6532 events should be sent to this window now. By default this will always
6533 return ``True`` because the update mode is initially
6534 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6535 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6536 """
6537 return _core_.IdleEvent_CanSend(*args, **kwargs)
6538
6539 CanSend = staticmethod(CanSend)
6540 _core_.IdleEvent_swigregister(IdleEvent)
6541
6542 def IdleEvent_SetMode(*args, **kwargs):
6543 """
6544 IdleEvent_SetMode(int mode)
6545
6546 Static method for specifying how wxWidgets will send idle events: to
6547 all windows, or only to those which specify that they will process the
6548 events.
6549
6550 The mode can be one of the following values:
6551
6552 ========================= ========================================
6553 wx.IDLE_PROCESS_ALL Send idle events to all windows
6554 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6555 the wx.WS_EX_PROCESS_IDLE extra style
6556 flag set.
6557 ========================= ========================================
6558
6559 """
6560 return _core_.IdleEvent_SetMode(*args, **kwargs)
6561
6562 def IdleEvent_GetMode(*args):
6563 """
6564 IdleEvent_GetMode() -> int
6565
6566 Static method returning a value specifying how wxWidgets will send
6567 idle events: to all windows, or only to those which specify that they
6568 will process the events.
6569 """
6570 return _core_.IdleEvent_GetMode(*args)
6571
6572 def IdleEvent_CanSend(*args, **kwargs):
6573 """
6574 IdleEvent_CanSend(Window win) -> bool
6575
6576 Returns ``True`` if it is appropriate to send idle events to this
6577 window.
6578
6579 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6580 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6581 events should be sent to this window now. By default this will always
6582 return ``True`` because the update mode is initially
6583 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6584 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6585 """
6586 return _core_.IdleEvent_CanSend(*args, **kwargs)
6587
6588 #---------------------------------------------------------------------------
6589
6590 class ClipboardTextEvent(CommandEvent):
6591 """
6592 A Clipboard Text event is sent when a window intercepts a text
6593 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6594 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6595 popup menu command, etc. NOTE : under windows these events are *NOT*
6596 generated automatically for a Rich Edit text control.
6597 """
6598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6599 __repr__ = _swig_repr
6600 def __init__(self, *args, **kwargs):
6601 """
6602 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6603
6604 A Clipboard Text event is sent when a window intercepts a text
6605 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6606 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6607 popup menu command, etc. NOTE : under windows these events are *NOT*
6608 generated automatically for a Rich Edit text control.
6609 """
6610 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6611 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6612
6613 #---------------------------------------------------------------------------
6614
6615 class PyEvent(Event):
6616 """
6617 wx.PyEvent can be used as a base class for implementing custom event
6618 types in Python. You should derived from this class instead of
6619 `wx.Event` because this class is Python-aware and is able to transport
6620 its Python bits safely through the wxWidgets event system and have
6621 them still be there when the event handler is invoked.
6622
6623 :see: `wx.PyCommandEvent`
6624
6625 """
6626 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6627 __repr__ = _swig_repr
6628 def __init__(self, *args, **kwargs):
6629 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6630 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6631 self._SetSelf(self)
6632
6633 __swig_destroy__ = _core_.delete_PyEvent
6634 __del__ = lambda self : None;
6635 def _SetSelf(*args, **kwargs):
6636 """_SetSelf(self, PyObject self)"""
6637 return _core_.PyEvent__SetSelf(*args, **kwargs)
6638
6639 def _GetSelf(*args, **kwargs):
6640 """_GetSelf(self) -> PyObject"""
6641 return _core_.PyEvent__GetSelf(*args, **kwargs)
6642
6643 _core_.PyEvent_swigregister(PyEvent)
6644
6645 class PyCommandEvent(CommandEvent):
6646 """
6647 wx.PyCommandEvent can be used as a base class for implementing custom
6648 event types in Python, where the event shoudl travel up to parent
6649 windows looking for a handler. You should derived from this class
6650 instead of `wx.CommandEvent` because this class is Python-aware and is
6651 able to transport its Python bits safely through the wxWidgets event
6652 system and have them still be there when the event handler is invoked.
6653
6654 :see: `wx.PyEvent`
6655
6656 """
6657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6658 __repr__ = _swig_repr
6659 def __init__(self, *args, **kwargs):
6660 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6661 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6662 self._SetSelf(self)
6663
6664 __swig_destroy__ = _core_.delete_PyCommandEvent
6665 __del__ = lambda self : None;
6666 def _SetSelf(*args, **kwargs):
6667 """_SetSelf(self, PyObject self)"""
6668 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6669
6670 def _GetSelf(*args, **kwargs):
6671 """_GetSelf(self) -> PyObject"""
6672 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6673
6674 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6675
6676 class DateEvent(CommandEvent):
6677 """
6678 This event class holds information about a date change event and is
6679 used together with `wx.DatePickerCtrl`. It also serves as a base class
6680 for `wx.calendar.CalendarEvent`. Bind these event types with
6681 EVT_DATE_CHANGED.
6682 """
6683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6684 __repr__ = _swig_repr
6685 def __init__(self, *args, **kwargs):
6686 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6687 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6688 def GetDate(*args, **kwargs):
6689 """
6690 GetDate(self) -> DateTime
6691
6692 Returns the date.
6693 """
6694 return _core_.DateEvent_GetDate(*args, **kwargs)
6695
6696 def SetDate(*args, **kwargs):
6697 """
6698 SetDate(self, DateTime date)
6699
6700 Sets the date carried by the event, normally only used by the library
6701 internally.
6702 """
6703 return _core_.DateEvent_SetDate(*args, **kwargs)
6704
6705 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6706 _core_.DateEvent_swigregister(DateEvent)
6707
6708 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6709 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6710
6711 #---------------------------------------------------------------------------
6712
6713 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6714 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6715 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6716 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6717 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6718 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6719 class PyApp(EvtHandler):
6720 """
6721 The ``wx.PyApp`` class is an *implementation detail*, please use the
6722 `wx.App` class (or some other derived class) instead.
6723 """
6724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6725 __repr__ = _swig_repr
6726 def __init__(self, *args, **kwargs):
6727 """
6728 __init__(self) -> PyApp
6729
6730 Create a new application object, starting the bootstrap process.
6731 """
6732 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6733 self._setCallbackInfo(self, PyApp, False)
6734 self._setOORInfo(self, False)
6735
6736 __swig_destroy__ = _core_.delete_PyApp
6737 __del__ = lambda self : None;
6738 def _setCallbackInfo(*args, **kwargs):
6739 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6740 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6741
6742 def GetAppName(*args, **kwargs):
6743 """
6744 GetAppName(self) -> String
6745
6746 Get the application name.
6747 """
6748 return _core_.PyApp_GetAppName(*args, **kwargs)
6749
6750 def SetAppName(*args, **kwargs):
6751 """
6752 SetAppName(self, String name)
6753
6754 Set the application name. This value may be used automatically by
6755 `wx.Config` and such.
6756 """
6757 return _core_.PyApp_SetAppName(*args, **kwargs)
6758
6759 def GetClassName(*args, **kwargs):
6760 """
6761 GetClassName(self) -> String
6762
6763 Get the application's class name.
6764 """
6765 return _core_.PyApp_GetClassName(*args, **kwargs)
6766
6767 def SetClassName(*args, **kwargs):
6768 """
6769 SetClassName(self, String name)
6770
6771 Set the application's class name. This value may be used for
6772 X-resources if applicable for the platform
6773 """
6774 return _core_.PyApp_SetClassName(*args, **kwargs)
6775
6776 def GetVendorName(*args, **kwargs):
6777 """
6778 GetVendorName(self) -> String
6779
6780 Get the application's vendor name.
6781 """
6782 return _core_.PyApp_GetVendorName(*args, **kwargs)
6783
6784 def SetVendorName(*args, **kwargs):
6785 """
6786 SetVendorName(self, String name)
6787
6788 Set the application's vendor name. This value may be used
6789 automatically by `wx.Config` and such.
6790 """
6791 return _core_.PyApp_SetVendorName(*args, **kwargs)
6792
6793 def GetTraits(*args, **kwargs):
6794 """
6795 GetTraits(self) -> wxAppTraits
6796
6797 Return (and create if necessary) the app traits object to which we
6798 delegate for everything which either should be configurable by the
6799 user (then he can change the default behaviour simply by overriding
6800 CreateTraits() and returning his own traits object) or which is
6801 GUI/console dependent as then wx.AppTraits allows us to abstract the
6802 differences behind the common facade.
6803
6804 :todo: Add support for overriding CreateAppTraits in wxPython.
6805 """
6806 return _core_.PyApp_GetTraits(*args, **kwargs)
6807
6808 def ProcessPendingEvents(*args, **kwargs):
6809 """
6810 ProcessPendingEvents(self)
6811
6812 Process all events in the Pending Events list -- it is necessary to
6813 call this function to process posted events. This normally happens
6814 during each event loop iteration.
6815 """
6816 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6817
6818 def Yield(*args, **kwargs):
6819 """
6820 Yield(self, bool onlyIfNeeded=False) -> bool
6821
6822 Process all currently pending events right now, instead of waiting
6823 until return to the event loop. It is an error to call ``Yield``
6824 recursively unless the value of ``onlyIfNeeded`` is True.
6825
6826 :warning: This function is dangerous as it can lead to unexpected
6827 reentrancies (i.e. when called from an event handler it may
6828 result in calling the same event handler again), use with
6829 extreme care or, better, don't use at all!
6830
6831 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6832
6833 """
6834 return _core_.PyApp_Yield(*args, **kwargs)
6835
6836 def WakeUpIdle(*args, **kwargs):
6837 """
6838 WakeUpIdle(self)
6839
6840 Make sure that idle events are sent again.
6841 :see: `wx.WakeUpIdle`
6842 """
6843 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6844
6845 def IsMainLoopRunning(*args, **kwargs):
6846 """
6847 IsMainLoopRunning() -> bool
6848
6849 Returns True if we're running the main loop, i.e. if the events can
6850 currently be dispatched.
6851 """
6852 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6853
6854 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6855 def MainLoop(*args, **kwargs):
6856 """
6857 MainLoop(self) -> int
6858
6859 Execute the main GUI loop, the function doesn't normally return until
6860 all top level windows have been closed and destroyed.
6861 """
6862 return _core_.PyApp_MainLoop(*args, **kwargs)
6863
6864 def Exit(*args, **kwargs):
6865 """
6866 Exit(self)
6867
6868 Exit the main loop thus terminating the application.
6869 :see: `wx.Exit`
6870 """
6871 return _core_.PyApp_Exit(*args, **kwargs)
6872
6873 def GetLayoutDirection(*args, **kwargs):
6874 """
6875 GetLayoutDirection(self) -> int
6876
6877 Return the layout direction for the current locale.
6878 """
6879 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6880
6881 def ExitMainLoop(*args, **kwargs):
6882 """
6883 ExitMainLoop(self)
6884
6885 Exit the main GUI loop during the next iteration of the main
6886 loop, (i.e. it does not stop the program immediately!)
6887 """
6888 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6889
6890 def Pending(*args, **kwargs):
6891 """
6892 Pending(self) -> bool
6893
6894 Returns True if there are unprocessed events in the event queue.
6895 """
6896 return _core_.PyApp_Pending(*args, **kwargs)
6897
6898 def Dispatch(*args, **kwargs):
6899 """
6900 Dispatch(self) -> bool
6901
6902 Process the first event in the event queue (blocks until an event
6903 appears if there are none currently)
6904 """
6905 return _core_.PyApp_Dispatch(*args, **kwargs)
6906
6907 def ProcessIdle(*args, **kwargs):
6908 """
6909 ProcessIdle(self) -> bool
6910
6911 Called from the MainLoop when the application becomes idle (there are
6912 no pending events) and sends a `wx.IdleEvent` to all interested
6913 parties. Returns True if more idle events are needed, False if not.
6914 """
6915 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6916
6917 def SendIdleEvents(*args, **kwargs):
6918 """
6919 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6920
6921 Send idle event to window and all subwindows. Returns True if more
6922 idle time is requested.
6923 """
6924 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6925
6926 def IsActive(*args, **kwargs):
6927 """
6928 IsActive(self) -> bool
6929
6930 Return True if our app has focus.
6931 """
6932 return _core_.PyApp_IsActive(*args, **kwargs)
6933
6934 def SetTopWindow(*args, **kwargs):
6935 """
6936 SetTopWindow(self, Window win)
6937
6938 Set the *main* top level window
6939 """
6940 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6941
6942 def GetTopWindow(*args, **kwargs):
6943 """
6944 GetTopWindow(self) -> Window
6945
6946 Return the *main* top level window (if it hadn't been set previously
6947 with SetTopWindow(), will return just some top level window and, if
6948 there not any, will return None)
6949 """
6950 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6951
6952 def SetExitOnFrameDelete(*args, **kwargs):
6953 """
6954 SetExitOnFrameDelete(self, bool flag)
6955
6956 Control the exit behaviour: by default, the program will exit the main
6957 loop (and so, usually, terminate) when the last top-level program
6958 window is deleted. Beware that if you disable this behaviour (with
6959 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6960 explicitly from somewhere.
6961 """
6962 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6963
6964 def GetExitOnFrameDelete(*args, **kwargs):
6965 """
6966 GetExitOnFrameDelete(self) -> bool
6967
6968 Get the current exit behaviour setting.
6969 """
6970 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6971
6972 def SetUseBestVisual(*args, **kwargs):
6973 """
6974 SetUseBestVisual(self, bool flag)
6975
6976 Set whether the app should try to use the best available visual on
6977 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6978 """
6979 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6980
6981 def GetUseBestVisual(*args, **kwargs):
6982 """
6983 GetUseBestVisual(self) -> bool
6984
6985 Get current UseBestVisual setting.
6986 """
6987 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6988
6989 def SetPrintMode(*args, **kwargs):
6990 """SetPrintMode(self, int mode)"""
6991 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6992
6993 def GetPrintMode(*args, **kwargs):
6994 """GetPrintMode(self) -> int"""
6995 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6996
6997 def SetAssertMode(*args, **kwargs):
6998 """
6999 SetAssertMode(self, int mode)
7000
7001 Set the OnAssert behaviour for debug and hybrid builds.
7002 """
7003 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7004
7005 def GetAssertMode(*args, **kwargs):
7006 """
7007 GetAssertMode(self) -> int
7008
7009 Get the current OnAssert behaviour setting.
7010 """
7011 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7012
7013 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
7014 """GetMacSupportPCMenuShortcuts() -> bool"""
7015 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7016
7017 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7018 def GetMacAboutMenuItemId(*args, **kwargs):
7019 """GetMacAboutMenuItemId() -> long"""
7020 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7021
7022 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7023 def GetMacPreferencesMenuItemId(*args, **kwargs):
7024 """GetMacPreferencesMenuItemId() -> long"""
7025 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7026
7027 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7028 def GetMacExitMenuItemId(*args, **kwargs):
7029 """GetMacExitMenuItemId() -> long"""
7030 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7031
7032 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7033 def GetMacHelpMenuTitleName(*args, **kwargs):
7034 """GetMacHelpMenuTitleName() -> String"""
7035 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7036
7037 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7038 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
7039 """SetMacSupportPCMenuShortcuts(bool val)"""
7040 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7041
7042 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7043 def SetMacAboutMenuItemId(*args, **kwargs):
7044 """SetMacAboutMenuItemId(long val)"""
7045 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7046
7047 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7048 def SetMacPreferencesMenuItemId(*args, **kwargs):
7049 """SetMacPreferencesMenuItemId(long val)"""
7050 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7051
7052 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7053 def SetMacExitMenuItemId(*args, **kwargs):
7054 """SetMacExitMenuItemId(long val)"""
7055 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7056
7057 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7058 def SetMacHelpMenuTitleName(*args, **kwargs):
7059 """SetMacHelpMenuTitleName(String val)"""
7060 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7061
7062 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7063 def _BootstrapApp(*args, **kwargs):
7064 """
7065 _BootstrapApp(self)
7066
7067 For internal use only
7068 """
7069 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7070
7071 def GetComCtl32Version(*args, **kwargs):
7072 """
7073 GetComCtl32Version() -> int
7074
7075 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7076 it wasn't found at all. Raises an exception on non-Windows platforms.
7077 """
7078 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7079
7080 GetComCtl32Version = staticmethod(GetComCtl32Version)
7081 def IsDisplayAvailable(*args, **kwargs):
7082 """
7083 IsDisplayAvailable() -> bool
7084
7085 Tests if it is possible to create a GUI in the current environment.
7086 This will mean different things on the different platforms.
7087
7088 * On X Windows systems this function will return ``False`` if it is
7089 not able to open a connection to the X display, which can happen
7090 if $DISPLAY is not set, or is not set correctly.
7091
7092 * On Mac OS X a ``False`` return value will mean that wx is not
7093 able to access the window manager, which can happen if logged in
7094 remotely or if running from the normal version of python instead
7095 of the framework version, (i.e., pythonw.)
7096
7097 * On MS Windows...
7098
7099 """
7100 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7101
7102 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7103 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7104 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7105 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7106 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7107 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7108 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7109 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7110 Traits = property(GetTraits,doc="See `GetTraits`")
7111 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7112 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7113 Active = property(IsActive)
7114 _core_.PyApp_swigregister(PyApp)
7115
7116 def PyApp_IsMainLoopRunning(*args):
7117 """
7118 PyApp_IsMainLoopRunning() -> bool
7119
7120 Returns True if we're running the main loop, i.e. if the events can
7121 currently be dispatched.
7122 """
7123 return _core_.PyApp_IsMainLoopRunning(*args)
7124
7125 def PyApp_GetMacSupportPCMenuShortcuts(*args):
7126 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7127 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
7128
7129 def PyApp_GetMacAboutMenuItemId(*args):
7130 """PyApp_GetMacAboutMenuItemId() -> long"""
7131 return _core_.PyApp_GetMacAboutMenuItemId(*args)
7132
7133 def PyApp_GetMacPreferencesMenuItemId(*args):
7134 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7135 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7136
7137 def PyApp_GetMacExitMenuItemId(*args):
7138 """PyApp_GetMacExitMenuItemId() -> long"""
7139 return _core_.PyApp_GetMacExitMenuItemId(*args)
7140
7141 def PyApp_GetMacHelpMenuTitleName(*args):
7142 """PyApp_GetMacHelpMenuTitleName() -> String"""
7143 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7144
7145 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7146 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7147 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7148
7149 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7150 """PyApp_SetMacAboutMenuItemId(long val)"""
7151 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7152
7153 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7154 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7155 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7156
7157 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7158 """PyApp_SetMacExitMenuItemId(long val)"""
7159 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7160
7161 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7162 """PyApp_SetMacHelpMenuTitleName(String val)"""
7163 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7164
7165 def PyApp_GetComCtl32Version(*args):
7166 """
7167 PyApp_GetComCtl32Version() -> int
7168
7169 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7170 it wasn't found at all. Raises an exception on non-Windows platforms.
7171 """
7172 return _core_.PyApp_GetComCtl32Version(*args)
7173
7174 def PyApp_IsDisplayAvailable(*args):
7175 """
7176 PyApp_IsDisplayAvailable() -> bool
7177
7178 Tests if it is possible to create a GUI in the current environment.
7179 This will mean different things on the different platforms.
7180
7181 * On X Windows systems this function will return ``False`` if it is
7182 not able to open a connection to the X display, which can happen
7183 if $DISPLAY is not set, or is not set correctly.
7184
7185 * On Mac OS X a ``False`` return value will mean that wx is not
7186 able to access the window manager, which can happen if logged in
7187 remotely or if running from the normal version of python instead
7188 of the framework version, (i.e., pythonw.)
7189
7190 * On MS Windows...
7191
7192 """
7193 return _core_.PyApp_IsDisplayAvailable(*args)
7194
7195 #---------------------------------------------------------------------------
7196
7197
7198 def Exit(*args):
7199 """
7200 Exit()
7201
7202 Force an exit of the application. Convenience for wx.GetApp().Exit()
7203 """
7204 return _core_.Exit(*args)
7205
7206 def Yield(*args):
7207 """
7208 Yield() -> bool
7209
7210 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7211 """
7212 return _core_.Yield(*args)
7213
7214 def YieldIfNeeded(*args):
7215 """
7216 YieldIfNeeded() -> bool
7217
7218 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7219 """
7220 return _core_.YieldIfNeeded(*args)
7221
7222 def SafeYield(*args, **kwargs):
7223 """
7224 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7225
7226 This function is similar to `wx.Yield`, except that it disables the
7227 user input to all program windows before calling `wx.Yield` and
7228 re-enables it again afterwards. If ``win`` is not None, this window
7229 will remain enabled, allowing the implementation of some limited user
7230 interaction.
7231
7232 :Returns: the result of the call to `wx.Yield`.
7233 """
7234 return _core_.SafeYield(*args, **kwargs)
7235
7236 def WakeUpIdle(*args):
7237 """
7238 WakeUpIdle()
7239
7240 Cause the message queue to become empty again, so idle events will be
7241 sent.
7242 """
7243 return _core_.WakeUpIdle(*args)
7244
7245 def PostEvent(*args, **kwargs):
7246 """
7247 PostEvent(EvtHandler dest, Event event)
7248
7249 Send an event to a window or other wx.EvtHandler to be processed
7250 later.
7251 """
7252 return _core_.PostEvent(*args, **kwargs)
7253
7254 def App_CleanUp(*args):
7255 """
7256 App_CleanUp()
7257
7258 For internal use only, it is used to cleanup after wxWidgets when
7259 Python shuts down.
7260 """
7261 return _core_.App_CleanUp(*args)
7262
7263 def GetApp(*args):
7264 """
7265 GetApp() -> PyApp
7266
7267 Return a reference to the current wx.App object.
7268 """
7269 return _core_.GetApp(*args)
7270
7271 def SetDefaultPyEncoding(*args, **kwargs):
7272 """
7273 SetDefaultPyEncoding(string encoding)
7274
7275 Sets the encoding that wxPython will use when it needs to convert a
7276 Python string or unicode object to or from a wxString.
7277
7278 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7279 but please be aware that the default encoding within the same locale
7280 may be slightly different on different platforms. For example, please
7281 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7282 between the common latin/roman encodings.
7283 """
7284 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7285
7286 def GetDefaultPyEncoding(*args):
7287 """
7288 GetDefaultPyEncoding() -> string
7289
7290 Gets the current encoding that wxPython will use when it needs to
7291 convert a Python string or unicode object to or from a wxString.
7292 """
7293 return _core_.GetDefaultPyEncoding(*args)
7294 #----------------------------------------------------------------------
7295
7296 class PyOnDemandOutputWindow:
7297 """
7298 A class that can be used for redirecting Python's stdout and
7299 stderr streams. It will do nothing until something is wrriten to
7300 the stream at which point it will create a Frame with a text area
7301 and write the text there.
7302 """
7303 def __init__(self, title = "wxPython: stdout/stderr"):
7304 self.frame = None
7305 self.title = title
7306 self.pos = wx.DefaultPosition
7307 self.size = (450, 300)
7308 self.parent = None
7309
7310 def SetParent(self, parent):
7311 """Set the window to be used as the popup Frame's parent."""
7312 self.parent = parent
7313
7314
7315 def CreateOutputWindow(self, st):
7316 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7317 style=wx.DEFAULT_FRAME_STYLE)
7318 self.text = wx.TextCtrl(self.frame, -1, "",
7319 style=wx.TE_MULTILINE|wx.TE_READONLY)
7320 self.text.AppendText(st)
7321 self.frame.Show(True)
7322 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7323
7324
7325 def OnCloseWindow(self, event):
7326 if self.frame is not None:
7327 self.frame.Destroy()
7328 self.frame = None
7329 self.text = None
7330
7331
7332 # These methods provide the file-like output behaviour.
7333 def write(self, text):
7334 """
7335 Create the output window if needed and write the string to it.
7336 If not called in the context of the gui thread then uses
7337 CallAfter to do the work there.
7338 """
7339 if self.frame is None:
7340 if not wx.Thread_IsMain():
7341 wx.CallAfter(self.CreateOutputWindow, text)
7342 else:
7343 self.CreateOutputWindow(text)
7344 else:
7345 if not wx.Thread_IsMain():
7346 wx.CallAfter(self.text.AppendText, text)
7347 else:
7348 self.text.AppendText(text)
7349
7350
7351 def close(self):
7352 if self.frame is not None:
7353 wx.CallAfter(self.frame.Close)
7354
7355
7356 def flush(self):
7357 pass
7358
7359
7360
7361 #----------------------------------------------------------------------
7362
7363 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7364
7365 class App(wx.PyApp):
7366 """
7367 The ``wx.App`` class represents the application and is used to:
7368
7369 * bootstrap the wxPython system and initialize the underlying
7370 gui toolkit
7371 * set and get application-wide properties
7372 * implement the windowing system main message or event loop,
7373 and to dispatch events to window instances
7374 * etc.
7375
7376 Every application must have a ``wx.App`` instance, and all
7377 creation of UI objects should be delayed until after the
7378 ``wx.App`` object has been created in order to ensure that the gui
7379 platform and wxWidgets have been fully initialized.
7380
7381 Normally you would derive from this class and implement an
7382 ``OnInit`` method that creates a frame and then calls
7383 ``self.SetTopWindow(frame)``.
7384
7385 :see: `wx.PySimpleApp` for a simpler app class that can be used
7386 directly.
7387 """
7388
7389 outputWindowClass = PyOnDemandOutputWindow
7390
7391 def __init__(self, redirect=_defRedirect, filename=None,
7392 useBestVisual=False, clearSigInt=True):
7393 """
7394 Construct a ``wx.App`` object.
7395
7396 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7397 redirected? Defaults to True on Windows and Mac, False
7398 otherwise. If `filename` is None then output will be
7399 redirected to a window that pops up as needed. (You can
7400 control what kind of window is created for the output by
7401 resetting the class variable ``outputWindowClass`` to a
7402 class of your choosing.)
7403
7404 :param filename: The name of a file to redirect output to, if
7405 redirect is True.
7406
7407 :param useBestVisual: Should the app try to use the best
7408 available visual provided by the system (only relevant on
7409 systems that have more than one visual.) This parameter
7410 must be used instead of calling `SetUseBestVisual` later
7411 on because it must be set before the underlying GUI
7412 toolkit is initialized.
7413
7414 :param clearSigInt: Should SIGINT be cleared? This allows the
7415 app to terminate upon a Ctrl-C in the console like other
7416 GUI apps will.
7417
7418 :note: You should override OnInit to do applicaition
7419 initialization to ensure that the system, toolkit and
7420 wxWidgets are fully initialized.
7421 """
7422
7423 wx.PyApp.__init__(self)
7424
7425 # make sure we can create a GUI
7426 if not self.IsDisplayAvailable():
7427
7428 if wx.Platform == "__WXMAC__":
7429 msg = """This program needs access to the screen.
7430 Please run with 'pythonw', not 'python', and only when you are logged
7431 in on the main display of your Mac."""
7432
7433 elif wx.Platform == "__WXGTK__":
7434 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7435
7436 else:
7437 msg = "Unable to create GUI"
7438 # TODO: more description is needed for wxMSW...
7439
7440 raise SystemExit(msg)
7441
7442 # This has to be done before OnInit
7443 self.SetUseBestVisual(useBestVisual)
7444
7445 # Set the default handler for SIGINT. This fixes a problem
7446 # where if Ctrl-C is pressed in the console that started this
7447 # app then it will not appear to do anything, (not even send
7448 # KeyboardInterrupt???) but will later segfault on exit. By
7449 # setting the default handler then the app will exit, as
7450 # expected (depending on platform.)
7451 if clearSigInt:
7452 try:
7453 import signal
7454 signal.signal(signal.SIGINT, signal.SIG_DFL)
7455 except:
7456 pass
7457
7458 # Save and redirect the stdio to a window?
7459 self.stdioWin = None
7460 self.saveStdio = (_sys.stdout, _sys.stderr)
7461 if redirect:
7462 self.RedirectStdio(filename)
7463
7464 # Use Python's install prefix as the default
7465 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7466
7467 # This finishes the initialization of wxWindows and then calls
7468 # the OnInit that should be present in the derived class
7469 self._BootstrapApp()
7470
7471
7472 def OnPreInit(self):
7473 """
7474 Things that must be done after _BootstrapApp has done its
7475 thing, but would be nice if they were already done by the time
7476 that OnInit is called.
7477 """
7478 wx.StockGDI._initStockObjects()
7479
7480
7481 def __del__(self, destroy=wx.PyApp.__del__):
7482 self.RestoreStdio() # Just in case the MainLoop was overridden
7483 destroy(self)
7484
7485 def Destroy(self):
7486 wx.PyApp.Destroy(self)
7487 self.thisown = 0
7488
7489 def SetTopWindow(self, frame):
7490 """Set the \"main\" top level window"""
7491 if self.stdioWin:
7492 self.stdioWin.SetParent(frame)
7493 wx.PyApp.SetTopWindow(self, frame)
7494
7495
7496 def MainLoop(self):
7497 """Execute the main GUI event loop"""
7498 wx.PyApp.MainLoop(self)
7499 self.RestoreStdio()
7500
7501
7502 def RedirectStdio(self, filename=None):
7503 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7504 if filename:
7505 _sys.stdout = _sys.stderr = open(filename, 'a')
7506 else:
7507 self.stdioWin = self.outputWindowClass()
7508 _sys.stdout = _sys.stderr = self.stdioWin
7509
7510
7511 def RestoreStdio(self):
7512 try:
7513 _sys.stdout, _sys.stderr = self.saveStdio
7514 except:
7515 pass
7516
7517
7518 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7519 """
7520 Set the title, position and/or size of the output window if
7521 the stdio has been redirected. This should be called before
7522 any output would cause the output window to be created.
7523 """
7524 if self.stdioWin:
7525 if title is not None:
7526 self.stdioWin.title = title
7527 if pos is not None:
7528 self.stdioWin.pos = pos
7529 if size is not None:
7530 self.stdioWin.size = size
7531
7532
7533
7534
7535 # change from wx.PyApp_XX to wx.App_XX
7536 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7537 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7538 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7539 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7540 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7541 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7542 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7543 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7544 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7545 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7546 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7547
7548 #----------------------------------------------------------------------------
7549
7550 class PySimpleApp(wx.App):
7551 """
7552 A simple application class. You can just create one of these and
7553 then then make your top level windows later, and not have to worry
7554 about OnInit. For example::
7555
7556 app = wx.PySimpleApp()
7557 frame = wx.Frame(None, title='Hello World')
7558 frame.Show()
7559 app.MainLoop()
7560
7561 :see: `wx.App`
7562 """
7563
7564 def __init__(self, redirect=False, filename=None,
7565 useBestVisual=False, clearSigInt=True):
7566 """
7567 :see: `wx.App.__init__`
7568 """
7569 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7570
7571 def OnInit(self):
7572 return True
7573
7574
7575
7576 # Is anybody using this one?
7577 class PyWidgetTester(wx.App):
7578 def __init__(self, size = (250, 100)):
7579 self.size = size
7580 wx.App.__init__(self, 0)
7581
7582 def OnInit(self):
7583 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7584 self.SetTopWindow(self.frame)
7585 return True
7586
7587 def SetWidget(self, widgetClass, *args, **kwargs):
7588 w = widgetClass(self.frame, *args, **kwargs)
7589 self.frame.Show(True)
7590
7591 #----------------------------------------------------------------------------
7592 # DO NOT hold any other references to this object. This is how we
7593 # know when to cleanup system resources that wxWidgets is holding. When
7594 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7595 # goes to zero and it calls the wx.App_CleanUp function.
7596
7597 class __wxPyCleanup:
7598 def __init__(self):
7599 self.cleanup = _core_.App_CleanUp
7600 def __del__(self):
7601 self.cleanup()
7602
7603 _sys.__wxPythonCleanup = __wxPyCleanup()
7604
7605 ## # another possible solution, but it gets called too early...
7606 ## import atexit
7607 ## atexit.register(_core_.wxApp_CleanUp)
7608
7609
7610 #----------------------------------------------------------------------------
7611
7612 #---------------------------------------------------------------------------
7613
7614 class EventLoop(object):
7615 """Proxy of C++ EventLoop class"""
7616 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7617 __repr__ = _swig_repr
7618 def __init__(self, *args, **kwargs):
7619 """__init__(self) -> EventLoop"""
7620 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7621 __swig_destroy__ = _core_.delete_EventLoop
7622 __del__ = lambda self : None;
7623 def Run(*args, **kwargs):
7624 """Run(self) -> int"""
7625 return _core_.EventLoop_Run(*args, **kwargs)
7626
7627 def Exit(*args, **kwargs):
7628 """Exit(self, int rc=0)"""
7629 return _core_.EventLoop_Exit(*args, **kwargs)
7630
7631 def Pending(*args, **kwargs):
7632 """Pending(self) -> bool"""
7633 return _core_.EventLoop_Pending(*args, **kwargs)
7634
7635 def Dispatch(*args, **kwargs):
7636 """Dispatch(self) -> bool"""
7637 return _core_.EventLoop_Dispatch(*args, **kwargs)
7638
7639 def IsRunning(*args, **kwargs):
7640 """IsRunning(self) -> bool"""
7641 return _core_.EventLoop_IsRunning(*args, **kwargs)
7642
7643 def GetActive(*args, **kwargs):
7644 """GetActive() -> EventLoop"""
7645 return _core_.EventLoop_GetActive(*args, **kwargs)
7646
7647 GetActive = staticmethod(GetActive)
7648 def SetActive(*args, **kwargs):
7649 """SetActive(EventLoop loop)"""
7650 return _core_.EventLoop_SetActive(*args, **kwargs)
7651
7652 SetActive = staticmethod(SetActive)
7653 _core_.EventLoop_swigregister(EventLoop)
7654
7655 def EventLoop_GetActive(*args):
7656 """EventLoop_GetActive() -> EventLoop"""
7657 return _core_.EventLoop_GetActive(*args)
7658
7659 def EventLoop_SetActive(*args, **kwargs):
7660 """EventLoop_SetActive(EventLoop loop)"""
7661 return _core_.EventLoop_SetActive(*args, **kwargs)
7662
7663 class EventLoopActivator(object):
7664 """Proxy of C++ EventLoopActivator class"""
7665 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7666 __repr__ = _swig_repr
7667 def __init__(self, *args, **kwargs):
7668 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7669 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7670 __swig_destroy__ = _core_.delete_EventLoopActivator
7671 __del__ = lambda self : None;
7672 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7673
7674 #---------------------------------------------------------------------------
7675
7676 ACCEL_ALT = _core_.ACCEL_ALT
7677 ACCEL_CTRL = _core_.ACCEL_CTRL
7678 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7679 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7680 ACCEL_CMD = _core_.ACCEL_CMD
7681 class AcceleratorEntry(object):
7682 """
7683 A class used to define items in an `wx.AcceleratorTable`. wxPython
7684 programs can choose to use wx.AcceleratorEntry objects, but using a
7685 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7686 as well. See `__init__` for of the tuple values.
7687
7688 :see: `wx.AcceleratorTable`
7689 """
7690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7691 __repr__ = _swig_repr
7692 def __init__(self, *args, **kwargs):
7693 """
7694 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7695
7696 Construct a wx.AcceleratorEntry.
7697 """
7698 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7699 __swig_destroy__ = _core_.delete_AcceleratorEntry
7700 __del__ = lambda self : None;
7701 def Set(*args, **kwargs):
7702 """
7703 Set(self, int flags, int keyCode, int cmd)
7704
7705 (Re)set the attributes of a wx.AcceleratorEntry.
7706 :see `__init__`
7707 """
7708 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7709
7710 def Create(*args, **kwargs):
7711 """
7712 Create(String str) -> AcceleratorEntry
7713
7714 Create accelerator corresponding to the specified string, or None if
7715 it coulnd't be parsed.
7716 """
7717 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7718
7719 Create = staticmethod(Create)
7720 def GetFlags(*args, **kwargs):
7721 """
7722 GetFlags(self) -> int
7723
7724 Get the AcceleratorEntry's flags.
7725 """
7726 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7727
7728 def GetKeyCode(*args, **kwargs):
7729 """
7730 GetKeyCode(self) -> int
7731
7732 Get the AcceleratorEntry's keycode.
7733 """
7734 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7735
7736 def GetCommand(*args, **kwargs):
7737 """
7738 GetCommand(self) -> int
7739
7740 Get the AcceleratorEntry's command ID.
7741 """
7742 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7743
7744 def IsOk(*args, **kwargs):
7745 """IsOk(self) -> bool"""
7746 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7747
7748 def ToString(*args, **kwargs):
7749 """
7750 ToString(self) -> String
7751
7752 Returns a string representation for the this accelerator. The string
7753 is formatted using the <flags>-<keycode> format where <flags> maybe a
7754 hyphen-separed list of "shift|alt|ctrl"
7755
7756 """
7757 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7758
7759 def FromString(*args, **kwargs):
7760 """
7761 FromString(self, String str) -> bool
7762
7763 Returns true if the given string correctly initialized this object.
7764 """
7765 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7766
7767 Command = property(GetCommand,doc="See `GetCommand`")
7768 Flags = property(GetFlags,doc="See `GetFlags`")
7769 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7770 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7771
7772 def AcceleratorEntry_Create(*args, **kwargs):
7773 """
7774 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7775
7776 Create accelerator corresponding to the specified string, or None if
7777 it coulnd't be parsed.
7778 """
7779 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7780
7781 class AcceleratorTable(Object):
7782 """
7783 An accelerator table allows the application to specify a table of
7784 keyboard shortcuts for menus or other commands. On Windows, menu or
7785 button commands are supported; on GTK, only menu commands are
7786 supported.
7787 """
7788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7789 __repr__ = _swig_repr
7790 def __init__(self, *args, **kwargs):
7791 """
7792 __init__(entries) -> AcceleratorTable
7793
7794 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7795 items or or of 3-tuples (flags, keyCode, cmdID)
7796
7797 :see: `wx.AcceleratorEntry`
7798 """
7799 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7800 __swig_destroy__ = _core_.delete_AcceleratorTable
7801 __del__ = lambda self : None;
7802 def Ok(*args, **kwargs):
7803 """Ok(self) -> bool"""
7804 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7805
7806 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7807
7808
7809 def GetAccelFromString(*args, **kwargs):
7810 """GetAccelFromString(String label) -> AcceleratorEntry"""
7811 return _core_.GetAccelFromString(*args, **kwargs)
7812 #---------------------------------------------------------------------------
7813
7814 class VisualAttributes(object):
7815 """struct containing all the visual attributes of a control"""
7816 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7817 __repr__ = _swig_repr
7818 def __init__(self, *args, **kwargs):
7819 """
7820 __init__(self) -> VisualAttributes
7821
7822 struct containing all the visual attributes of a control
7823 """
7824 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7825 __swig_destroy__ = _core_.delete_VisualAttributes
7826 __del__ = lambda self : None;
7827 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7828 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7829 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7830 _core_.VisualAttributes_swigregister(VisualAttributes)
7831 NullAcceleratorTable = cvar.NullAcceleratorTable
7832 PanelNameStr = cvar.PanelNameStr
7833
7834 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7835 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7836 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7837 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7838 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7839 class Window(EvtHandler):
7840 """
7841 wx.Window is the base class for all windows and represents any visible
7842 object on the screen. All controls, top level windows and so on are
7843 wx.Windows. Sizers and device contexts are not however, as they don't
7844 appear on screen themselves.
7845
7846 """
7847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7848 __repr__ = _swig_repr
7849 def __init__(self, *args, **kwargs):
7850 """
7851 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7852 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7853
7854 Construct and show a generic Window.
7855 """
7856 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7857 self._setOORInfo(self)
7858
7859 def Create(*args, **kwargs):
7860 """
7861 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7862 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7863
7864 Create the GUI part of the Window for 2-phase creation mode.
7865 """
7866 return _core_.Window_Create(*args, **kwargs)
7867
7868 def Close(*args, **kwargs):
7869 """
7870 Close(self, bool force=False) -> bool
7871
7872 This function simply generates a EVT_CLOSE event whose handler usually
7873 tries to close the window. It doesn't close the window itself,
7874 however. If force is False (the default) then the window's close
7875 handler will be allowed to veto the destruction of the window.
7876 """
7877 return _core_.Window_Close(*args, **kwargs)
7878
7879 def Destroy(*args, **kwargs):
7880 """
7881 Destroy(self) -> bool
7882
7883 Destroys the window safely. Frames and dialogs are not destroyed
7884 immediately when this function is called -- they are added to a list
7885 of windows to be deleted on idle time, when all the window's events
7886 have been processed. This prevents problems with events being sent to
7887 non-existent windows.
7888
7889 Returns True if the window has either been successfully deleted, or it
7890 has been added to the list of windows pending real deletion.
7891 """
7892 val = _core_.Window_Destroy(*args, **kwargs)
7893 args[0].thisown = 0
7894 return val
7895
7896 def DestroyChildren(*args, **kwargs):
7897 """
7898 DestroyChildren(self) -> bool
7899
7900 Destroys all children of a window. Called automatically by the
7901 destructor.
7902 """
7903 return _core_.Window_DestroyChildren(*args, **kwargs)
7904
7905 def IsBeingDeleted(*args, **kwargs):
7906 """
7907 IsBeingDeleted(self) -> bool
7908
7909 Is the window in the process of being deleted?
7910 """
7911 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7912
7913 def SetLabel(*args, **kwargs):
7914 """
7915 SetLabel(self, String label)
7916
7917 Set the text which the window shows in its label if applicable.
7918 """
7919 return _core_.Window_SetLabel(*args, **kwargs)
7920
7921 def GetLabel(*args, **kwargs):
7922 """
7923 GetLabel(self) -> String
7924
7925 Generic way of getting a label from any window, for identification
7926 purposes. The interpretation of this function differs from class to
7927 class. For frames and dialogs, the value returned is the title. For
7928 buttons or static text controls, it is the button text. This function
7929 can be useful for meta-programs such as testing tools or special-needs
7930 access programs)which need to identify windows by name.
7931 """
7932 return _core_.Window_GetLabel(*args, **kwargs)
7933
7934 def SetName(*args, **kwargs):
7935 """
7936 SetName(self, String name)
7937
7938 Sets the window's name. The window name is used for ressource setting
7939 in X, it is not the same as the window title/label
7940 """
7941 return _core_.Window_SetName(*args, **kwargs)
7942
7943 def GetName(*args, **kwargs):
7944 """
7945 GetName(self) -> String
7946
7947 Returns the windows name. This name is not guaranteed to be unique;
7948 it is up to the programmer to supply an appropriate name in the window
7949 constructor or via wx.Window.SetName.
7950 """
7951 return _core_.Window_GetName(*args, **kwargs)
7952
7953 def SetWindowVariant(*args, **kwargs):
7954 """
7955 SetWindowVariant(self, int variant)
7956
7957 Sets the variant of the window/font size to use for this window, if
7958 the platform supports variants, for example, wxMac.
7959 """
7960 return _core_.Window_SetWindowVariant(*args, **kwargs)
7961
7962 def GetWindowVariant(*args, **kwargs):
7963 """GetWindowVariant(self) -> int"""
7964 return _core_.Window_GetWindowVariant(*args, **kwargs)
7965
7966 def SetId(*args, **kwargs):
7967 """
7968 SetId(self, int winid)
7969
7970 Sets the identifier of the window. Each window has an integer
7971 identifier. If the application has not provided one, an identifier
7972 will be generated. Normally, the identifier should be provided on
7973 creation and should not be modified subsequently.
7974 """
7975 return _core_.Window_SetId(*args, **kwargs)
7976
7977 def GetId(*args, **kwargs):
7978 """
7979 GetId(self) -> int
7980
7981 Returns the identifier of the window. Each window has an integer
7982 identifier. If the application has not provided one (or the default Id
7983 -1 is used) then an unique identifier with a negative value will be
7984 generated.
7985 """
7986 return _core_.Window_GetId(*args, **kwargs)
7987
7988 def NewControlId(*args, **kwargs):
7989 """
7990 NewControlId() -> int
7991
7992 Generate a control id for the controls which were not given one.
7993 """
7994 return _core_.Window_NewControlId(*args, **kwargs)
7995
7996 NewControlId = staticmethod(NewControlId)
7997 def NextControlId(*args, **kwargs):
7998 """
7999 NextControlId(int winid) -> int
8000
8001 Get the id of the control following the one with the given
8002 autogenerated) id
8003 """
8004 return _core_.Window_NextControlId(*args, **kwargs)
8005
8006 NextControlId = staticmethod(NextControlId)
8007 def PrevControlId(*args, **kwargs):
8008 """
8009 PrevControlId(int winid) -> int
8010
8011 Get the id of the control preceding the one with the given
8012 autogenerated) id
8013 """
8014 return _core_.Window_PrevControlId(*args, **kwargs)
8015
8016 PrevControlId = staticmethod(PrevControlId)
8017 def GetLayoutDirection(*args, **kwargs):
8018 """
8019 GetLayoutDirection(self) -> int
8020
8021 Get the layout direction (LTR or RTL) for this window. Returns
8022 ``wx.Layout_Default`` if layout direction is not supported.
8023 """
8024 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8025
8026 def SetLayoutDirection(*args, **kwargs):
8027 """
8028 SetLayoutDirection(self, int dir)
8029
8030 Set the layout direction (LTR or RTL) for this window.
8031 """
8032 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8033
8034 def AdjustForLayoutDirection(*args, **kwargs):
8035 """
8036 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8037
8038 Mirror coordinates for RTL layout if this window uses it and if the
8039 mirroring is not done automatically like Win32.
8040 """
8041 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8042
8043 def SetSize(*args, **kwargs):
8044 """
8045 SetSize(self, Size size)
8046
8047 Sets the size of the window in pixels.
8048 """
8049 return _core_.Window_SetSize(*args, **kwargs)
8050
8051 def SetDimensions(*args, **kwargs):
8052 """
8053 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8054
8055 Sets the position and size of the window in pixels. The sizeFlags
8056 parameter indicates the interpretation of the other params if they are
8057 equal to -1.
8058
8059 ======================== ======================================
8060 wx.SIZE_AUTO A -1 indicates that a class-specific
8061 default should be used.
8062 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8063 -1 values are supplied.
8064 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8065 interpreted as real dimensions, not
8066 default values.
8067 ======================== ======================================
8068
8069 """
8070 return _core_.Window_SetDimensions(*args, **kwargs)
8071
8072 def SetRect(*args, **kwargs):
8073 """
8074 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8075
8076 Sets the position and size of the window in pixels using a wx.Rect.
8077 """
8078 return _core_.Window_SetRect(*args, **kwargs)
8079
8080 def SetSizeWH(*args, **kwargs):
8081 """
8082 SetSizeWH(self, int width, int height)
8083
8084 Sets the size of the window in pixels.
8085 """
8086 return _core_.Window_SetSizeWH(*args, **kwargs)
8087
8088 def Move(*args, **kwargs):
8089 """
8090 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8091
8092 Moves the window to the given position.
8093 """
8094 return _core_.Window_Move(*args, **kwargs)
8095
8096 SetPosition = Move
8097 def MoveXY(*args, **kwargs):
8098 """
8099 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8100
8101 Moves the window to the given position.
8102 """
8103 return _core_.Window_MoveXY(*args, **kwargs)
8104
8105 def SetBestFittingSize(*args, **kwargs):
8106 """
8107 SetBestFittingSize(self, Size size=DefaultSize)
8108
8109 A 'Smart' SetSize that will fill in default size components with the
8110 window's *best size* values. Also set's the minsize for use with sizers.
8111 """
8112 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8113
8114 def Raise(*args, **kwargs):
8115 """
8116 Raise(self)
8117
8118 Raises the window to the top of the window hierarchy. In current
8119 version of wxWidgets this works both for manage and child windows.
8120 """
8121 return _core_.Window_Raise(*args, **kwargs)
8122
8123 def Lower(*args, **kwargs):
8124 """
8125 Lower(self)
8126
8127 Lowers the window to the bottom of the window hierarchy. In current
8128 version of wxWidgets this works both for manage and child windows.
8129 """
8130 return _core_.Window_Lower(*args, **kwargs)
8131
8132 def SetClientSize(*args, **kwargs):
8133 """
8134 SetClientSize(self, Size size)
8135
8136 This sets the size of the window client area in pixels. Using this
8137 function to size a window tends to be more device-independent than
8138 wx.Window.SetSize, since the application need not worry about what
8139 dimensions the border or title bar have when trying to fit the window
8140 around panel items, for example.
8141 """
8142 return _core_.Window_SetClientSize(*args, **kwargs)
8143
8144 def SetClientSizeWH(*args, **kwargs):
8145 """
8146 SetClientSizeWH(self, int width, int height)
8147
8148 This sets the size of the window client area in pixels. Using this
8149 function to size a window tends to be more device-independent than
8150 wx.Window.SetSize, since the application need not worry about what
8151 dimensions the border or title bar have when trying to fit the window
8152 around panel items, for example.
8153 """
8154 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8155
8156 def SetClientRect(*args, **kwargs):
8157 """
8158 SetClientRect(self, Rect rect)
8159
8160 This sets the size of the window client area in pixels. Using this
8161 function to size a window tends to be more device-independent than
8162 wx.Window.SetSize, since the application need not worry about what
8163 dimensions the border or title bar have when trying to fit the window
8164 around panel items, for example.
8165 """
8166 return _core_.Window_SetClientRect(*args, **kwargs)
8167
8168 def GetPosition(*args, **kwargs):
8169 """
8170 GetPosition(self) -> Point
8171
8172 Get the window's position. Notice that the position is in client
8173 coordinates for child windows and screen coordinates for the top level
8174 ones, use `GetScreenPosition` if you need screen coordinates for all
8175 kinds of windows.
8176 """
8177 return _core_.Window_GetPosition(*args, **kwargs)
8178
8179 def GetPositionTuple(*args, **kwargs):
8180 """
8181 GetPositionTuple() -> (x,y)
8182
8183 Get the window's position. Notice that the position is in client
8184 coordinates for child windows and screen coordinates for the top level
8185 ones, use `GetScreenPosition` if you need screen coordinates for all
8186 kinds of windows.
8187 """
8188 return _core_.Window_GetPositionTuple(*args, **kwargs)
8189
8190 def GetScreenPosition(*args, **kwargs):
8191 """
8192 GetScreenPosition(self) -> Point
8193
8194 Get the position of the window in screen coordinantes.
8195 """
8196 return _core_.Window_GetScreenPosition(*args, **kwargs)
8197
8198 def GetScreenPositionTuple(*args, **kwargs):
8199 """
8200 GetScreenPositionTuple() -> (x,y)
8201
8202 Get the position of the window in screen coordinantes.
8203 """
8204 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8205
8206 def GetScreenRect(*args, **kwargs):
8207 """
8208 GetScreenRect(self) -> Rect
8209
8210 Returns the size and position of the window in screen coordinantes as
8211 a `wx.Rect` object.
8212 """
8213 return _core_.Window_GetScreenRect(*args, **kwargs)
8214
8215 def GetSize(*args, **kwargs):
8216 """
8217 GetSize(self) -> Size
8218
8219 Get the window size.
8220 """
8221 return _core_.Window_GetSize(*args, **kwargs)
8222
8223 def GetSizeTuple(*args, **kwargs):
8224 """
8225 GetSizeTuple() -> (width, height)
8226
8227 Get the window size.
8228 """
8229 return _core_.Window_GetSizeTuple(*args, **kwargs)
8230
8231 def GetRect(*args, **kwargs):
8232 """
8233 GetRect(self) -> Rect
8234
8235 Returns the size and position of the window as a `wx.Rect` object.
8236 """
8237 return _core_.Window_GetRect(*args, **kwargs)
8238
8239 def GetClientSize(*args, **kwargs):
8240 """
8241 GetClientSize(self) -> Size
8242
8243 This gets the size of the window's 'client area' in pixels. The client
8244 area is the area which may be drawn on by the programmer, excluding
8245 title bar, border, scrollbars, etc.
8246 """
8247 return _core_.Window_GetClientSize(*args, **kwargs)
8248
8249 def GetClientSizeTuple(*args, **kwargs):
8250 """
8251 GetClientSizeTuple() -> (width, height)
8252
8253 This gets the size of the window's 'client area' in pixels. The client
8254 area is the area which may be drawn on by the programmer, excluding
8255 title bar, border, scrollbars, etc.
8256 """
8257 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8258
8259 def GetClientAreaOrigin(*args, **kwargs):
8260 """
8261 GetClientAreaOrigin(self) -> Point
8262
8263 Get the origin of the client area of the window relative to the
8264 window's top left corner (the client area may be shifted because of
8265 the borders, scrollbars, other decorations...)
8266 """
8267 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8268
8269 def GetClientRect(*args, **kwargs):
8270 """
8271 GetClientRect(self) -> Rect
8272
8273 Get the client area position and size as a `wx.Rect` object.
8274 """
8275 return _core_.Window_GetClientRect(*args, **kwargs)
8276
8277 def GetBestSize(*args, **kwargs):
8278 """
8279 GetBestSize(self) -> Size
8280
8281 This function returns the best acceptable minimal size for the
8282 window, if applicable. For example, for a static text control, it will
8283 be the minimal size such that the control label is not truncated. For
8284 windows containing subwindows (suzh aswx.Panel), the size returned by
8285 this function will be the same as the size the window would have had
8286 after calling Fit.
8287 """
8288 return _core_.Window_GetBestSize(*args, **kwargs)
8289
8290 def GetBestSizeTuple(*args, **kwargs):
8291 """
8292 GetBestSizeTuple() -> (width, height)
8293
8294 This function returns the best acceptable minimal size for the
8295 window, if applicable. For example, for a static text control, it will
8296 be the minimal size such that the control label is not truncated. For
8297 windows containing subwindows (suzh aswx.Panel), the size returned by
8298 this function will be the same as the size the window would have had
8299 after calling Fit.
8300 """
8301 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8302
8303 def InvalidateBestSize(*args, **kwargs):
8304 """
8305 InvalidateBestSize(self)
8306
8307 Reset the cached best size value so it will be recalculated the next
8308 time it is needed.
8309 """
8310 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8311
8312 def CacheBestSize(*args, **kwargs):
8313 """
8314 CacheBestSize(self, Size size)
8315
8316 Cache the best size so it doesn't need to be calculated again, (at least until
8317 some properties of the window change.)
8318 """
8319 return _core_.Window_CacheBestSize(*args, **kwargs)
8320
8321 def GetBestFittingSize(*args, **kwargs):
8322 """
8323 GetBestFittingSize(self) -> Size
8324
8325 This function will merge the window's best size into the window's
8326 minimum size, giving priority to the min size components, and returns
8327 the results.
8328
8329 """
8330 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8331
8332 def GetAdjustedBestSize(*args, **kwargs):
8333 """
8334 GetAdjustedBestSize(self) -> Size
8335
8336 This method is similar to GetBestSize, except in one
8337 thing. GetBestSize should return the minimum untruncated size of the
8338 window, while this method will return the largest of BestSize and any
8339 user specified minimum size. ie. it is the minimum size the window
8340 should currently be drawn at, not the minimal size it can possibly
8341 tolerate.
8342 """
8343 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8344
8345 def Center(*args, **kwargs):
8346 """
8347 Center(self, int direction=BOTH)
8348
8349 Centers the window. The parameter specifies the direction for
8350 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8351 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8352 on the entire screen and not on its parent window. If it is a
8353 top-level window and has no parent then it will always be centered
8354 relative to the screen.
8355 """
8356 return _core_.Window_Center(*args, **kwargs)
8357
8358 Centre = Center
8359 def CenterOnParent(*args, **kwargs):
8360 """
8361 CenterOnParent(self, int dir=BOTH)
8362
8363 Center with respect to the the parent window
8364 """
8365 return _core_.Window_CenterOnParent(*args, **kwargs)
8366
8367 CentreOnParent = CenterOnParent
8368 def Fit(*args, **kwargs):
8369 """
8370 Fit(self)
8371
8372 Sizes the window so that it fits around its subwindows. This function
8373 won't do anything if there are no subwindows and will only really work
8374 correctly if sizers are used for the subwindows layout. Also, if the
8375 window has exactly one subwindow it is better (faster and the result
8376 is more precise as Fit adds some margin to account for fuzziness of
8377 its calculations) to call window.SetClientSize(child.GetSize())
8378 instead of calling Fit.
8379 """
8380 return _core_.Window_Fit(*args, **kwargs)
8381
8382 def FitInside(*args, **kwargs):
8383 """
8384 FitInside(self)
8385
8386 Similar to Fit, but sizes the interior (virtual) size of a
8387 window. Mainly useful with scrolled windows to reset scrollbars after
8388 sizing changes that do not trigger a size event, and/or scrolled
8389 windows without an interior sizer. This function similarly won't do
8390 anything if there are no subwindows.
8391 """
8392 return _core_.Window_FitInside(*args, **kwargs)
8393
8394 def SetSizeHints(*args, **kwargs):
8395 """
8396 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8397 int incH=-1)
8398
8399 Allows specification of minimum and maximum window sizes, and window
8400 size increments. If a pair of values is not set (or set to -1), the
8401 default values will be used. If this function is called, the user
8402 will not be able to size the window outside the given bounds (if it is
8403 a top-level window.) Sizers will also inspect the minimum window size
8404 and will use that value if set when calculating layout.
8405
8406 The resizing increments are only significant under Motif or Xt.
8407 """
8408 return _core_.Window_SetSizeHints(*args, **kwargs)
8409
8410 def SetSizeHintsSz(*args, **kwargs):
8411 """
8412 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8413
8414 Allows specification of minimum and maximum window sizes, and window
8415 size increments. If a pair of values is not set (or set to -1), the
8416 default values will be used. If this function is called, the user
8417 will not be able to size the window outside the given bounds (if it is
8418 a top-level window.) Sizers will also inspect the minimum window size
8419 and will use that value if set when calculating layout.
8420
8421 The resizing increments are only significant under Motif or Xt.
8422 """
8423 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8424
8425 def SetVirtualSizeHints(*args, **kwargs):
8426 """
8427 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8428
8429 Allows specification of minimum and maximum virtual window sizes. If a
8430 pair of values is not set (or set to -1), the default values will be
8431 used. If this function is called, the user will not be able to size
8432 the virtual area of the window outside the given bounds.
8433 """
8434 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8435
8436 def SetVirtualSizeHintsSz(*args, **kwargs):
8437 """
8438 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8439
8440 Allows specification of minimum and maximum virtual window sizes. If a
8441 pair of values is not set (or set to -1), the default values will be
8442 used. If this function is called, the user will not be able to size
8443 the virtual area of the window outside the given bounds.
8444 """
8445 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8446
8447 def GetMaxSize(*args, **kwargs):
8448 """GetMaxSize(self) -> Size"""
8449 return _core_.Window_GetMaxSize(*args, **kwargs)
8450
8451 def GetMinSize(*args, **kwargs):
8452 """GetMinSize(self) -> Size"""
8453 return _core_.Window_GetMinSize(*args, **kwargs)
8454
8455 def SetMinSize(*args, **kwargs):
8456 """
8457 SetMinSize(self, Size minSize)
8458
8459 A more convenient method than `SetSizeHints` for setting just the
8460 min size.
8461 """
8462 return _core_.Window_SetMinSize(*args, **kwargs)
8463
8464 def SetMaxSize(*args, **kwargs):
8465 """
8466 SetMaxSize(self, Size maxSize)
8467
8468 A more convenient method than `SetSizeHints` for setting just the
8469 max size.
8470 """
8471 return _core_.Window_SetMaxSize(*args, **kwargs)
8472
8473 def GetMinWidth(*args, **kwargs):
8474 """GetMinWidth(self) -> int"""
8475 return _core_.Window_GetMinWidth(*args, **kwargs)
8476
8477 def GetMinHeight(*args, **kwargs):
8478 """GetMinHeight(self) -> int"""
8479 return _core_.Window_GetMinHeight(*args, **kwargs)
8480
8481 def GetMaxWidth(*args, **kwargs):
8482 """GetMaxWidth(self) -> int"""
8483 return _core_.Window_GetMaxWidth(*args, **kwargs)
8484
8485 def GetMaxHeight(*args, **kwargs):
8486 """GetMaxHeight(self) -> int"""
8487 return _core_.Window_GetMaxHeight(*args, **kwargs)
8488
8489 def SetVirtualSize(*args, **kwargs):
8490 """
8491 SetVirtualSize(self, Size size)
8492
8493 Set the the virtual size of a window in pixels. For most windows this
8494 is just the client area of the window, but for some like scrolled
8495 windows it is more or less independent of the screen window size.
8496 """
8497 return _core_.Window_SetVirtualSize(*args, **kwargs)
8498
8499 def SetVirtualSizeWH(*args, **kwargs):
8500 """
8501 SetVirtualSizeWH(self, int w, int h)
8502
8503 Set the the virtual size of a window in pixels. For most windows this
8504 is just the client area of the window, but for some like scrolled
8505 windows it is more or less independent of the screen window size.
8506 """
8507 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8508
8509 def GetVirtualSize(*args, **kwargs):
8510 """
8511 GetVirtualSize(self) -> Size
8512
8513 Get the the virtual size of the window in pixels. For most windows
8514 this is just the client area of the window, but for some like scrolled
8515 windows it is more or less independent of the screen window size.
8516 """
8517 return _core_.Window_GetVirtualSize(*args, **kwargs)
8518
8519 def GetVirtualSizeTuple(*args, **kwargs):
8520 """
8521 GetVirtualSizeTuple() -> (width, height)
8522
8523 Get the the virtual size of the window in pixels. For most windows
8524 this is just the client area of the window, but for some like scrolled
8525 windows it is more or less independent of the screen window size.
8526 """
8527 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8528
8529 def GetBestVirtualSize(*args, **kwargs):
8530 """
8531 GetBestVirtualSize(self) -> Size
8532
8533 Return the largest of ClientSize and BestSize (as determined by a
8534 sizer, interior children, or other means)
8535 """
8536 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8537
8538 def Show(*args, **kwargs):
8539 """
8540 Show(self, bool show=True) -> bool
8541
8542 Shows or hides the window. You may need to call Raise for a top level
8543 window if you want to bring it to top, although this is not needed if
8544 Show is called immediately after the frame creation. Returns True if
8545 the window has been shown or hidden or False if nothing was done
8546 because it already was in the requested state.
8547 """
8548 return _core_.Window_Show(*args, **kwargs)
8549
8550 def Hide(*args, **kwargs):
8551 """
8552 Hide(self) -> bool
8553
8554 Equivalent to calling Show(False).
8555 """
8556 return _core_.Window_Hide(*args, **kwargs)
8557
8558 def Enable(*args, **kwargs):
8559 """
8560 Enable(self, bool enable=True) -> bool
8561
8562 Enable or disable the window for user input. Note that when a parent
8563 window is disabled, all of its children are disabled as well and they
8564 are reenabled again when the parent is. Returns true if the window
8565 has been enabled or disabled, false if nothing was done, i.e. if the
8566 window had already been in the specified state.
8567 """
8568 return _core_.Window_Enable(*args, **kwargs)
8569
8570 def Disable(*args, **kwargs):
8571 """
8572 Disable(self) -> bool
8573
8574 Disables the window, same as Enable(false).
8575 """
8576 return _core_.Window_Disable(*args, **kwargs)
8577
8578 def IsShown(*args, **kwargs):
8579 """
8580 IsShown(self) -> bool
8581
8582 Returns true if the window is shown, false if it has been hidden.
8583 """
8584 return _core_.Window_IsShown(*args, **kwargs)
8585
8586 def IsEnabled(*args, **kwargs):
8587 """
8588 IsEnabled(self) -> bool
8589
8590 Returns true if the window is enabled for input, false otherwise.
8591 """
8592 return _core_.Window_IsEnabled(*args, **kwargs)
8593
8594 def IsShownOnScreen(*args, **kwargs):
8595 """
8596 IsShownOnScreen(self) -> bool
8597
8598 Returns ``True`` if the window is physically visible on the screen,
8599 i.e. it is shown and all its parents up to the toplevel window are
8600 shown as well.
8601 """
8602 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8603
8604 def SetWindowStyleFlag(*args, **kwargs):
8605 """
8606 SetWindowStyleFlag(self, long style)
8607
8608 Sets the style of the window. Please note that some styles cannot be
8609 changed after the window creation and that Refresh() might need to be
8610 called after changing the others for the change to take place
8611 immediately.
8612 """
8613 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8614
8615 def GetWindowStyleFlag(*args, **kwargs):
8616 """
8617 GetWindowStyleFlag(self) -> long
8618
8619 Gets the window style that was passed to the constructor or Create
8620 method.
8621 """
8622 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8623
8624 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8625 def HasFlag(*args, **kwargs):
8626 """
8627 HasFlag(self, int flag) -> bool
8628
8629 Test if the given style is set for this window.
8630 """
8631 return _core_.Window_HasFlag(*args, **kwargs)
8632
8633 def IsRetained(*args, **kwargs):
8634 """
8635 IsRetained(self) -> bool
8636
8637 Returns true if the window is retained, false otherwise. Retained
8638 windows are only available on X platforms.
8639 """
8640 return _core_.Window_IsRetained(*args, **kwargs)
8641
8642 def SetExtraStyle(*args, **kwargs):
8643 """
8644 SetExtraStyle(self, long exStyle)
8645
8646 Sets the extra style bits for the window. Extra styles are the less
8647 often used style bits which can't be set with the constructor or with
8648 SetWindowStyleFlag()
8649 """
8650 return _core_.Window_SetExtraStyle(*args, **kwargs)
8651
8652 def GetExtraStyle(*args, **kwargs):
8653 """
8654 GetExtraStyle(self) -> long
8655
8656 Returns the extra style bits for the window.
8657 """
8658 return _core_.Window_GetExtraStyle(*args, **kwargs)
8659
8660 def MakeModal(*args, **kwargs):
8661 """
8662 MakeModal(self, bool modal=True)
8663
8664 Disables all other windows in the application so that the user can
8665 only interact with this window. Passing False will reverse this
8666 effect.
8667 """
8668 return _core_.Window_MakeModal(*args, **kwargs)
8669
8670 def SetThemeEnabled(*args, **kwargs):
8671 """
8672 SetThemeEnabled(self, bool enableTheme)
8673
8674 This function tells a window if it should use the system's "theme"
8675 code to draw the windows' background instead if its own background
8676 drawing code. This will only have an effect on platforms that support
8677 the notion of themes in user defined windows. One such platform is
8678 GTK+ where windows can have (very colourful) backgrounds defined by a
8679 user's selected theme.
8680
8681 Dialogs, notebook pages and the status bar have this flag set to true
8682 by default so that the default look and feel is simulated best.
8683 """
8684 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8685
8686 def GetThemeEnabled(*args, **kwargs):
8687 """
8688 GetThemeEnabled(self) -> bool
8689
8690 Return the themeEnabled flag.
8691 """
8692 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8693
8694 def SetFocus(*args, **kwargs):
8695 """
8696 SetFocus(self)
8697
8698 Set's the focus to this window, allowing it to receive keyboard input.
8699 """
8700 return _core_.Window_SetFocus(*args, **kwargs)
8701
8702 def SetFocusFromKbd(*args, **kwargs):
8703 """
8704 SetFocusFromKbd(self)
8705
8706 Set focus to this window as the result of a keyboard action. Normally
8707 only called internally.
8708 """
8709 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8710
8711 def FindFocus(*args, **kwargs):
8712 """
8713 FindFocus() -> Window
8714
8715 Returns the window or control that currently has the keyboard focus,
8716 or None.
8717 """
8718 return _core_.Window_FindFocus(*args, **kwargs)
8719
8720 FindFocus = staticmethod(FindFocus)
8721 def AcceptsFocus(*args, **kwargs):
8722 """
8723 AcceptsFocus(self) -> bool
8724
8725 Can this window have focus?
8726 """
8727 return _core_.Window_AcceptsFocus(*args, **kwargs)
8728
8729 def AcceptsFocusFromKeyboard(*args, **kwargs):
8730 """
8731 AcceptsFocusFromKeyboard(self) -> bool
8732
8733 Can this window be given focus by keyboard navigation? if not, the
8734 only way to give it focus (provided it accepts it at all) is to click
8735 it.
8736 """
8737 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8738
8739 def Navigate(*args, **kwargs):
8740 """
8741 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8742
8743 Does keyboard navigation from this window to another, by sending a
8744 `wx.NavigationKeyEvent`.
8745 """
8746 return _core_.Window_Navigate(*args, **kwargs)
8747
8748 def MoveAfterInTabOrder(*args, **kwargs):
8749 """
8750 MoveAfterInTabOrder(self, Window win)
8751
8752 Moves this window in the tab navigation order after the specified
8753 sibling window. This means that when the user presses the TAB key on
8754 that other window, the focus switches to this window.
8755
8756 The default tab order is the same as creation order. This function
8757 and `MoveBeforeInTabOrder` allow to change it after creating all the
8758 windows.
8759
8760 """
8761 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8762
8763 def MoveBeforeInTabOrder(*args, **kwargs):
8764 """
8765 MoveBeforeInTabOrder(self, Window win)
8766
8767 Same as `MoveAfterInTabOrder` except that it inserts this window just
8768 before win instead of putting it right after it.
8769 """
8770 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8771
8772 def GetChildren(*args, **kwargs):
8773 """
8774 GetChildren(self) -> PyObject
8775
8776 Returns a list of the window's children. NOTE: Currently this is a
8777 copy of the child window list maintained by the window, so the return
8778 value of this function is only valid as long as the window's children
8779 do not change.
8780 """
8781 return _core_.Window_GetChildren(*args, **kwargs)
8782
8783 def GetParent(*args, **kwargs):
8784 """
8785 GetParent(self) -> Window
8786
8787 Returns the parent window of this window, or None if there isn't one.
8788 """
8789 return _core_.Window_GetParent(*args, **kwargs)
8790
8791 def GetGrandParent(*args, **kwargs):
8792 """
8793 GetGrandParent(self) -> Window
8794
8795 Returns the parent of the parent of this window, or None if there
8796 isn't one.
8797 """
8798 return _core_.Window_GetGrandParent(*args, **kwargs)
8799
8800 def IsTopLevel(*args, **kwargs):
8801 """
8802 IsTopLevel(self) -> bool
8803
8804 Returns true if the given window is a top-level one. Currently all
8805 frames and dialogs are always considered to be top-level windows (even
8806 if they have a parent window).
8807 """
8808 return _core_.Window_IsTopLevel(*args, **kwargs)
8809
8810 def Reparent(*args, **kwargs):
8811 """
8812 Reparent(self, Window newParent) -> bool
8813
8814 Reparents the window, i.e the window will be removed from its current
8815 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8816 re-inserted into another. Available on Windows and GTK. Returns True
8817 if the parent was changed, False otherwise (error or newParent ==
8818 oldParent)
8819 """
8820 return _core_.Window_Reparent(*args, **kwargs)
8821
8822 def AddChild(*args, **kwargs):
8823 """
8824 AddChild(self, Window child)
8825
8826 Adds a child window. This is called automatically by window creation
8827 functions so should not be required by the application programmer.
8828 """
8829 return _core_.Window_AddChild(*args, **kwargs)
8830
8831 def RemoveChild(*args, **kwargs):
8832 """
8833 RemoveChild(self, Window child)
8834
8835 Removes a child window. This is called automatically by window
8836 deletion functions so should not be required by the application
8837 programmer.
8838 """
8839 return _core_.Window_RemoveChild(*args, **kwargs)
8840
8841 def SetDoubleBuffered(*args, **kwargs):
8842 """
8843 SetDoubleBuffered(self, bool on)
8844
8845 Currently wxGTK2 only.
8846 """
8847 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8848
8849 def FindWindowById(*args, **kwargs):
8850 """
8851 FindWindowById(self, long winid) -> Window
8852
8853 Find a chld of this window by window ID
8854 """
8855 return _core_.Window_FindWindowById(*args, **kwargs)
8856
8857 def FindWindowByName(*args, **kwargs):
8858 """
8859 FindWindowByName(self, String name) -> Window
8860
8861 Find a child of this window by name
8862 """
8863 return _core_.Window_FindWindowByName(*args, **kwargs)
8864
8865 def GetEventHandler(*args, **kwargs):
8866 """
8867 GetEventHandler(self) -> EvtHandler
8868
8869 Returns the event handler for this window. By default, the window is
8870 its own event handler.
8871 """
8872 return _core_.Window_GetEventHandler(*args, **kwargs)
8873
8874 def SetEventHandler(*args, **kwargs):
8875 """
8876 SetEventHandler(self, EvtHandler handler)
8877
8878 Sets the event handler for this window. An event handler is an object
8879 that is capable of processing the events sent to a window. (In other
8880 words, is able to dispatch the events to handler function.) By
8881 default, the window is its own event handler, but an application may
8882 wish to substitute another, for example to allow central
8883 implementation of event-handling for a variety of different window
8884 classes.
8885
8886 It is usually better to use `wx.Window.PushEventHandler` since this sets
8887 up a chain of event handlers, where an event not handled by one event
8888 handler is handed off to the next one in the chain.
8889 """
8890 return _core_.Window_SetEventHandler(*args, **kwargs)
8891
8892 def PushEventHandler(*args, **kwargs):
8893 """
8894 PushEventHandler(self, EvtHandler handler)
8895
8896 Pushes this event handler onto the event handler stack for the window.
8897 An event handler is an object that is capable of processing the events
8898 sent to a window. (In other words, is able to dispatch the events to
8899 handler function.) By default, the window is its own event handler,
8900 but an application may wish to substitute another, for example to
8901 allow central implementation of event-handling for a variety of
8902 different window classes.
8903
8904 wx.Window.PushEventHandler allows an application to set up a chain of
8905 event handlers, where an event not handled by one event handler is
8906 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8907 to remove the event handler. Ownership of the handler is *not* given
8908 to the window, so you should be sure to pop the handler before the
8909 window is destroyed and either let PopEventHandler destroy it, or call
8910 its Destroy method yourself.
8911 """
8912 return _core_.Window_PushEventHandler(*args, **kwargs)
8913
8914 def PopEventHandler(*args, **kwargs):
8915 """
8916 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8917
8918 Removes and returns the top-most event handler on the event handler
8919 stack. If deleteHandler is True then the wx.EvtHandler object will be
8920 destroyed after it is popped, and ``None`` will be returned instead.
8921 """
8922 return _core_.Window_PopEventHandler(*args, **kwargs)
8923
8924 def RemoveEventHandler(*args, **kwargs):
8925 """
8926 RemoveEventHandler(self, EvtHandler handler) -> bool
8927
8928 Find the given handler in the event handler chain and remove (but not
8929 delete) it from the event handler chain, returns True if it was found
8930 and False otherwise (this also results in an assert failure so this
8931 function should only be called when the handler is supposed to be
8932 there.)
8933 """
8934 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8935
8936 def SetValidator(*args, **kwargs):
8937 """
8938 SetValidator(self, Validator validator)
8939
8940 Deletes the current validator (if any) and sets the window validator,
8941 having called wx.Validator.Clone to create a new validator of this
8942 type.
8943 """
8944 return _core_.Window_SetValidator(*args, **kwargs)
8945
8946 def GetValidator(*args, **kwargs):
8947 """
8948 GetValidator(self) -> Validator
8949
8950 Returns a pointer to the current validator for the window, or None if
8951 there is none.
8952 """
8953 return _core_.Window_GetValidator(*args, **kwargs)
8954
8955 def Validate(*args, **kwargs):
8956 """
8957 Validate(self) -> bool
8958
8959 Validates the current values of the child controls using their
8960 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8961 style flag set, the method will also call Validate() of all child
8962 windows. Returns false if any of the validations failed.
8963 """
8964 return _core_.Window_Validate(*args, **kwargs)
8965
8966 def TransferDataToWindow(*args, **kwargs):
8967 """
8968 TransferDataToWindow(self) -> bool
8969
8970 Transfers values to child controls from data areas specified by their
8971 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8972 style flag set, the method will also call TransferDataToWindow() of
8973 all child windows.
8974 """
8975 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8976
8977 def TransferDataFromWindow(*args, **kwargs):
8978 """
8979 TransferDataFromWindow(self) -> bool
8980
8981 Transfers values from child controls to data areas specified by their
8982 validators. Returns false if a transfer failed. If the window has
8983 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8984 also call TransferDataFromWindow() of all child windows.
8985 """
8986 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8987
8988 def InitDialog(*args, **kwargs):
8989 """
8990 InitDialog(self)
8991
8992 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8993 to the dialog via validators.
8994 """
8995 return _core_.Window_InitDialog(*args, **kwargs)
8996
8997 def SetAcceleratorTable(*args, **kwargs):
8998 """
8999 SetAcceleratorTable(self, AcceleratorTable accel)
9000
9001 Sets the accelerator table for this window.
9002 """
9003 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9004
9005 def GetAcceleratorTable(*args, **kwargs):
9006 """
9007 GetAcceleratorTable(self) -> AcceleratorTable
9008
9009 Gets the accelerator table for this window.
9010 """
9011 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9012
9013 def RegisterHotKey(*args, **kwargs):
9014 """
9015 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9016
9017 Registers a system wide hotkey. Every time the user presses the hotkey
9018 registered here, this window will receive a hotkey event. It will
9019 receive the event even if the application is in the background and
9020 does not have the input focus because the user is working with some
9021 other application. To bind an event handler function to this hotkey
9022 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9023 hotkey was registered successfully.
9024 """
9025 return _core_.Window_RegisterHotKey(*args, **kwargs)
9026
9027 def UnregisterHotKey(*args, **kwargs):
9028 """
9029 UnregisterHotKey(self, int hotkeyId) -> bool
9030
9031 Unregisters a system wide hotkey.
9032 """
9033 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9034
9035 def ConvertDialogPointToPixels(*args, **kwargs):
9036 """
9037 ConvertDialogPointToPixels(self, Point pt) -> Point
9038
9039 Converts a point or size from dialog units to pixels. Dialog units
9040 are used for maintaining a dialog's proportions even if the font
9041 changes. For the x dimension, the dialog units are multiplied by the
9042 average character width and then divided by 4. For the y dimension,
9043 the dialog units are multiplied by the average character height and
9044 then divided by 8.
9045 """
9046 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9047
9048 def ConvertDialogSizeToPixels(*args, **kwargs):
9049 """
9050 ConvertDialogSizeToPixels(self, Size sz) -> Size
9051
9052 Converts a point or size from dialog units to pixels. Dialog units
9053 are used for maintaining a dialog's proportions even if the font
9054 changes. For the x dimension, the dialog units are multiplied by the
9055 average character width and then divided by 4. For the y dimension,
9056 the dialog units are multiplied by the average character height and
9057 then divided by 8.
9058 """
9059 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9060
9061 def DLG_PNT(*args, **kwargs):
9062 """
9063 DLG_PNT(self, Point pt) -> Point
9064
9065 Converts a point or size from dialog units to pixels. Dialog units
9066 are used for maintaining a dialog's proportions even if the font
9067 changes. For the x dimension, the dialog units are multiplied by the
9068 average character width and then divided by 4. For the y dimension,
9069 the dialog units are multiplied by the average character height and
9070 then divided by 8.
9071 """
9072 return _core_.Window_DLG_PNT(*args, **kwargs)
9073
9074 def DLG_SZE(*args, **kwargs):
9075 """
9076 DLG_SZE(self, Size sz) -> Size
9077
9078 Converts a point or size from dialog units to pixels. Dialog units
9079 are used for maintaining a dialog's proportions even if the font
9080 changes. For the x dimension, the dialog units are multiplied by the
9081 average character width and then divided by 4. For the y dimension,
9082 the dialog units are multiplied by the average character height and
9083 then divided by 8.
9084 """
9085 return _core_.Window_DLG_SZE(*args, **kwargs)
9086
9087 def ConvertPixelPointToDialog(*args, **kwargs):
9088 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9089 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9090
9091 def ConvertPixelSizeToDialog(*args, **kwargs):
9092 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9093 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9094
9095 def WarpPointer(*args, **kwargs):
9096 """
9097 WarpPointer(self, int x, int y)
9098
9099 Moves the pointer to the given position on the window.
9100
9101 NOTE: This function is not supported under Mac because Apple Human
9102 Interface Guidelines forbid moving the mouse cursor programmatically.
9103 """
9104 return _core_.Window_WarpPointer(*args, **kwargs)
9105
9106 def CaptureMouse(*args, **kwargs):
9107 """
9108 CaptureMouse(self)
9109
9110 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9111 release the capture.
9112
9113 Note that wxWindows maintains the stack of windows having captured the
9114 mouse and when the mouse is released the capture returns to the window
9115 which had had captured it previously and it is only really released if
9116 there were no previous window. In particular, this means that you must
9117 release the mouse as many times as you capture it, unless the window
9118 receives the `wx.MouseCaptureLostEvent` event.
9119
9120 Any application which captures the mouse in the beginning of some
9121 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9122 operation when it receives the event. The event handler must not
9123 recapture mouse.
9124 """
9125 return _core_.Window_CaptureMouse(*args, **kwargs)
9126
9127 def ReleaseMouse(*args, **kwargs):
9128 """
9129 ReleaseMouse(self)
9130
9131 Releases mouse input captured with wx.Window.CaptureMouse.
9132 """
9133 return _core_.Window_ReleaseMouse(*args, **kwargs)
9134
9135 def GetCapture(*args, **kwargs):
9136 """
9137 GetCapture() -> Window
9138
9139 Returns the window which currently captures the mouse or None
9140 """
9141 return _core_.Window_GetCapture(*args, **kwargs)
9142
9143 GetCapture = staticmethod(GetCapture)
9144 def HasCapture(*args, **kwargs):
9145 """
9146 HasCapture(self) -> bool
9147
9148 Returns true if this window has the current mouse capture.
9149 """
9150 return _core_.Window_HasCapture(*args, **kwargs)
9151
9152 def Refresh(*args, **kwargs):
9153 """
9154 Refresh(self, bool eraseBackground=True, Rect rect=None)
9155
9156 Mark the specified rectangle (or the whole window) as "dirty" so it
9157 will be repainted. Causes an EVT_PAINT event to be generated and sent
9158 to the window.
9159 """
9160 return _core_.Window_Refresh(*args, **kwargs)
9161
9162 def RefreshRect(*args, **kwargs):
9163 """
9164 RefreshRect(self, Rect rect, bool eraseBackground=True)
9165
9166 Redraws the contents of the given rectangle: the area inside it will
9167 be repainted. This is the same as Refresh but has a nicer syntax.
9168 """
9169 return _core_.Window_RefreshRect(*args, **kwargs)
9170
9171 def Update(*args, **kwargs):
9172 """
9173 Update(self)
9174
9175 Calling this method immediately repaints the invalidated area of the
9176 window instead of waiting for the EVT_PAINT event to happen, (normally
9177 this would usually only happen when the flow of control returns to the
9178 event loop.) Notice that this function doesn't refresh the window and
9179 does nothing if the window has been already repainted. Use Refresh
9180 first if you want to immediately redraw the window (or some portion of
9181 it) unconditionally.
9182 """
9183 return _core_.Window_Update(*args, **kwargs)
9184
9185 def ClearBackground(*args, **kwargs):
9186 """
9187 ClearBackground(self)
9188
9189 Clears the window by filling it with the current background
9190 colour. Does not cause an erase background event to be generated.
9191 """
9192 return _core_.Window_ClearBackground(*args, **kwargs)
9193
9194 def Freeze(*args, **kwargs):
9195 """
9196 Freeze(self)
9197
9198 Freezes the window or, in other words, prevents any updates from
9199 taking place on screen, the window is not redrawn at all. Thaw must be
9200 called to reenable window redrawing. Calls to Freeze/Thaw may be
9201 nested, with the actual Thaw being delayed until all the nesting has
9202 been undone.
9203
9204 This method is useful for visual appearance optimization (for example,
9205 it is a good idea to use it before inserting large amount of text into
9206 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9207 for all controls so it is mostly just a hint to wxWindows and not a
9208 mandatory directive.
9209 """
9210 return _core_.Window_Freeze(*args, **kwargs)
9211
9212 def IsFrozen(*args, **kwargs):
9213 """
9214 IsFrozen(self) -> bool
9215
9216 Returns ``True`` if the window has been frozen and not thawed yet.
9217
9218 :see: `Freeze` and `Thaw`
9219 """
9220 return _core_.Window_IsFrozen(*args, **kwargs)
9221
9222 def Thaw(*args, **kwargs):
9223 """
9224 Thaw(self)
9225
9226 Reenables window updating after a previous call to Freeze. Calls to
9227 Freeze/Thaw may be nested, so Thaw must be called the same number of
9228 times that Freeze was before the window will be updated.
9229 """
9230 return _core_.Window_Thaw(*args, **kwargs)
9231
9232 def PrepareDC(*args, **kwargs):
9233 """
9234 PrepareDC(self, DC dc)
9235
9236 Call this function to prepare the device context for drawing a
9237 scrolled image. It sets the device origin according to the current
9238 scroll position.
9239 """
9240 return _core_.Window_PrepareDC(*args, **kwargs)
9241
9242 def GetUpdateRegion(*args, **kwargs):
9243 """
9244 GetUpdateRegion(self) -> Region
9245
9246 Returns the region specifying which parts of the window have been
9247 damaged. Should only be called within an EVT_PAINT handler.
9248 """
9249 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9250
9251 def GetUpdateClientRect(*args, **kwargs):
9252 """
9253 GetUpdateClientRect(self) -> Rect
9254
9255 Get the update rectangle region bounding box in client coords.
9256 """
9257 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9258
9259 def IsExposed(*args, **kwargs):
9260 """
9261 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9262
9263 Returns true if the given point or rectangle area has been exposed
9264 since the last repaint. Call this in an paint event handler to
9265 optimize redrawing by only redrawing those areas, which have been
9266 exposed.
9267 """
9268 return _core_.Window_IsExposed(*args, **kwargs)
9269
9270 def IsExposedPoint(*args, **kwargs):
9271 """
9272 IsExposedPoint(self, Point pt) -> bool
9273
9274 Returns true if the given point or rectangle area has been exposed
9275 since the last repaint. Call this in an paint event handler to
9276 optimize redrawing by only redrawing those areas, which have been
9277 exposed.
9278 """
9279 return _core_.Window_IsExposedPoint(*args, **kwargs)
9280
9281 def IsExposedRect(*args, **kwargs):
9282 """
9283 IsExposedRect(self, Rect rect) -> bool
9284
9285 Returns true if the given point or rectangle area has been exposed
9286 since the last repaint. Call this in an paint event handler to
9287 optimize redrawing by only redrawing those areas, which have been
9288 exposed.
9289 """
9290 return _core_.Window_IsExposedRect(*args, **kwargs)
9291
9292 def GetDefaultAttributes(*args, **kwargs):
9293 """
9294 GetDefaultAttributes(self) -> VisualAttributes
9295
9296 Get the default attributes for an instance of this class. This is
9297 useful if you want to use the same font or colour in your own control
9298 as in a standard control -- which is a much better idea than hard
9299 coding specific colours or fonts which might look completely out of
9300 place on the user's system, especially if it uses themes.
9301 """
9302 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9303
9304 def GetClassDefaultAttributes(*args, **kwargs):
9305 """
9306 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9307
9308 Get the default attributes for this class. This is useful if you want
9309 to use the same font or colour in your own control as in a standard
9310 control -- which is a much better idea than hard coding specific
9311 colours or fonts which might look completely out of place on the
9312 user's system, especially if it uses themes.
9313
9314 The variant parameter is only relevant under Mac currently and is
9315 ignore under other platforms. Under Mac, it will change the size of
9316 the returned font. See `wx.Window.SetWindowVariant` for more about
9317 this.
9318 """
9319 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9320
9321 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9322 def SetBackgroundColour(*args, **kwargs):
9323 """
9324 SetBackgroundColour(self, Colour colour) -> bool
9325
9326 Sets the background colour of the window. Returns True if the colour
9327 was changed. The background colour is usually painted by the default
9328 EVT_ERASE_BACKGROUND event handler function under Windows and
9329 automatically under GTK. Using `wx.NullColour` will reset the window
9330 to the default background colour.
9331
9332 Note that setting the background colour may not cause an immediate
9333 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9334 calling this function.
9335
9336 Using this function will disable attempts to use themes for this
9337 window, if the system supports them. Use with care since usually the
9338 themes represent the appearance chosen by the user to be used for all
9339 applications on the system.
9340 """
9341 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9342
9343 def SetOwnBackgroundColour(*args, **kwargs):
9344 """SetOwnBackgroundColour(self, Colour colour)"""
9345 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9346
9347 def SetForegroundColour(*args, **kwargs):
9348 """
9349 SetForegroundColour(self, Colour colour) -> bool
9350
9351 Sets the foreground colour of the window. Returns True is the colour
9352 was changed. The interpretation of foreground colour is dependent on
9353 the window class; it may be the text colour or other colour, or it may
9354 not be used at all.
9355 """
9356 return _core_.Window_SetForegroundColour(*args, **kwargs)
9357
9358 def SetOwnForegroundColour(*args, **kwargs):
9359 """SetOwnForegroundColour(self, Colour colour)"""
9360 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9361
9362 def GetBackgroundColour(*args, **kwargs):
9363 """
9364 GetBackgroundColour(self) -> Colour
9365
9366 Returns the background colour of the window.
9367 """
9368 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9369
9370 def GetForegroundColour(*args, **kwargs):
9371 """
9372 GetForegroundColour(self) -> Colour
9373
9374 Returns the foreground colour of the window. The interpretation of
9375 foreground colour is dependent on the window class; it may be the text
9376 colour or other colour, or it may not be used at all.
9377 """
9378 return _core_.Window_GetForegroundColour(*args, **kwargs)
9379
9380 def InheritsBackgroundColour(*args, **kwargs):
9381 """InheritsBackgroundColour(self) -> bool"""
9382 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9383
9384 def UseBgCol(*args, **kwargs):
9385 """UseBgCol(self) -> bool"""
9386 return _core_.Window_UseBgCol(*args, **kwargs)
9387
9388 def SetBackgroundStyle(*args, **kwargs):
9389 """
9390 SetBackgroundStyle(self, int style) -> bool
9391
9392 Returns the background style of the window. The background style
9393 indicates how the background of the window is drawn.
9394
9395 ====================== ========================================
9396 wx.BG_STYLE_SYSTEM The background colour or pattern should
9397 be determined by the system
9398 wx.BG_STYLE_COLOUR The background should be a solid colour
9399 wx.BG_STYLE_CUSTOM The background will be implemented by the
9400 application.
9401 ====================== ========================================
9402
9403 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9404 a custom background, such as a tiled bitmap. Currently the style has
9405 no effect on other platforms.
9406
9407 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9408 """
9409 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9410
9411 def GetBackgroundStyle(*args, **kwargs):
9412 """
9413 GetBackgroundStyle(self) -> int
9414
9415 Returns the background style of the window.
9416
9417 :see: `SetBackgroundStyle`
9418 """
9419 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9420
9421 def HasTransparentBackground(*args, **kwargs):
9422 """
9423 HasTransparentBackground(self) -> bool
9424
9425 Returns True if this window's background is transparent (as, for
9426 example, for `wx.StaticText`) and should show the parent window's
9427 background.
9428
9429 This method is mostly used internally by the library itself and you
9430 normally shouldn't have to call it. You may, however, have to override
9431 it in your custom control classes to ensure that background is painted
9432 correctly.
9433 """
9434 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9435
9436 def SetCursor(*args, **kwargs):
9437 """
9438 SetCursor(self, Cursor cursor) -> bool
9439
9440 Sets the window's cursor. Notice that the window cursor also sets it
9441 for the children of the window implicitly.
9442
9443 The cursor may be wx.NullCursor in which case the window cursor will
9444 be reset back to default.
9445 """
9446 return _core_.Window_SetCursor(*args, **kwargs)
9447
9448 def GetCursor(*args, **kwargs):
9449 """
9450 GetCursor(self) -> Cursor
9451
9452 Return the cursor associated with this window.
9453 """
9454 return _core_.Window_GetCursor(*args, **kwargs)
9455
9456 def SetFont(*args, **kwargs):
9457 """
9458 SetFont(self, Font font) -> bool
9459
9460 Sets the font for this window.
9461 """
9462 return _core_.Window_SetFont(*args, **kwargs)
9463
9464 def SetOwnFont(*args, **kwargs):
9465 """SetOwnFont(self, Font font)"""
9466 return _core_.Window_SetOwnFont(*args, **kwargs)
9467
9468 def GetFont(*args, **kwargs):
9469 """
9470 GetFont(self) -> Font
9471
9472 Returns the default font used for this window.
9473 """
9474 return _core_.Window_GetFont(*args, **kwargs)
9475
9476 def SetCaret(*args, **kwargs):
9477 """
9478 SetCaret(self, Caret caret)
9479
9480 Sets the caret associated with the window.
9481 """
9482 return _core_.Window_SetCaret(*args, **kwargs)
9483
9484 def GetCaret(*args, **kwargs):
9485 """
9486 GetCaret(self) -> Caret
9487
9488 Returns the caret associated with the window.
9489 """
9490 return _core_.Window_GetCaret(*args, **kwargs)
9491
9492 def GetCharHeight(*args, **kwargs):
9493 """
9494 GetCharHeight(self) -> int
9495
9496 Get the (average) character size for the current font.
9497 """
9498 return _core_.Window_GetCharHeight(*args, **kwargs)
9499
9500 def GetCharWidth(*args, **kwargs):
9501 """
9502 GetCharWidth(self) -> int
9503
9504 Get the (average) character size for the current font.
9505 """
9506 return _core_.Window_GetCharWidth(*args, **kwargs)
9507
9508 def GetTextExtent(*args, **kwargs):
9509 """
9510 GetTextExtent(String string) -> (width, height)
9511
9512 Get the width and height of the text using the current font.
9513 """
9514 return _core_.Window_GetTextExtent(*args, **kwargs)
9515
9516 def GetFullTextExtent(*args, **kwargs):
9517 """
9518 GetFullTextExtent(String string, Font font=None) ->
9519 (width, height, descent, externalLeading)
9520
9521 Get the width, height, decent and leading of the text using the
9522 current or specified font.
9523 """
9524 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9525
9526 def ClientToScreenXY(*args, **kwargs):
9527 """
9528 ClientToScreenXY(int x, int y) -> (x,y)
9529
9530 Converts to screen coordinates from coordinates relative to this window.
9531 """
9532 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9533
9534 def ScreenToClientXY(*args, **kwargs):
9535 """
9536 ScreenToClientXY(int x, int y) -> (x,y)
9537
9538 Converts from screen to client window coordinates.
9539 """
9540 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9541
9542 def ClientToScreen(*args, **kwargs):
9543 """
9544 ClientToScreen(self, Point pt) -> Point
9545
9546 Converts to screen coordinates from coordinates relative to this window.
9547 """
9548 return _core_.Window_ClientToScreen(*args, **kwargs)
9549
9550 def ScreenToClient(*args, **kwargs):
9551 """
9552 ScreenToClient(self, Point pt) -> Point
9553
9554 Converts from screen to client window coordinates.
9555 """
9556 return _core_.Window_ScreenToClient(*args, **kwargs)
9557
9558 def HitTestXY(*args, **kwargs):
9559 """
9560 HitTestXY(self, int x, int y) -> int
9561
9562 Test where the given (in client coords) point lies
9563 """
9564 return _core_.Window_HitTestXY(*args, **kwargs)
9565
9566 def HitTest(*args, **kwargs):
9567 """
9568 HitTest(self, Point pt) -> int
9569
9570 Test where the given (in client coords) point lies
9571 """
9572 return _core_.Window_HitTest(*args, **kwargs)
9573
9574 def GetBorder(*args):
9575 """
9576 GetBorder(self, long flags) -> int
9577 GetBorder(self) -> int
9578
9579 Get border for the flags of this window
9580 """
9581 return _core_.Window_GetBorder(*args)
9582
9583 def UpdateWindowUI(*args, **kwargs):
9584 """
9585 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9586
9587 This function sends EVT_UPDATE_UI events to the window. The particular
9588 implementation depends on the window; for example a wx.ToolBar will
9589 send an update UI event for each toolbar button, and a wx.Frame will
9590 send an update UI event for each menubar menu item. You can call this
9591 function from your application to ensure that your UI is up-to-date at
9592 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9593 concerned). This may be necessary if you have called
9594 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9595 limit the overhead that wxWindows incurs by sending update UI events
9596 in idle time.
9597 """
9598 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9599
9600 def PopupMenuXY(*args, **kwargs):
9601 """
9602 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9603
9604 Pops up the given menu at the specified coordinates, relative to this window,
9605 and returns control when the user has dismissed the menu. If a menu item is
9606 selected, the corresponding menu event is generated and will be processed as
9607 usual. If the default position is given then the current position of the
9608 mouse cursor will be used.
9609 """
9610 return _core_.Window_PopupMenuXY(*args, **kwargs)
9611
9612 def PopupMenu(*args, **kwargs):
9613 """
9614 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9615
9616 Pops up the given menu at the specified coordinates, relative to this window,
9617 and returns control when the user has dismissed the menu. If a menu item is
9618 selected, the corresponding menu event is generated and will be processed as
9619 usual. If the default position is given then the current position of the
9620 mouse cursor will be used.
9621 """
9622 return _core_.Window_PopupMenu(*args, **kwargs)
9623
9624 def HasMultiplePages(*args, **kwargs):
9625 """HasMultiplePages(self) -> bool"""
9626 return _core_.Window_HasMultiplePages(*args, **kwargs)
9627
9628 def GetHandle(*args, **kwargs):
9629 """
9630 GetHandle(self) -> long
9631
9632 Returns the platform-specific handle (as a long integer) of the
9633 physical window. Currently on wxMac it returns the handle of the
9634 toplevel parent of the window.
9635 """
9636 return _core_.Window_GetHandle(*args, **kwargs)
9637
9638 def AssociateHandle(*args, **kwargs):
9639 """
9640 AssociateHandle(self, long handle)
9641
9642 Associate the window with a new native handle
9643 """
9644 return _core_.Window_AssociateHandle(*args, **kwargs)
9645
9646 def DissociateHandle(*args, **kwargs):
9647 """
9648 DissociateHandle(self)
9649
9650 Dissociate the current native handle from the window
9651 """
9652 return _core_.Window_DissociateHandle(*args, **kwargs)
9653
9654 def HasScrollbar(*args, **kwargs):
9655 """
9656 HasScrollbar(self, int orient) -> bool
9657
9658 Does the window have the scrollbar for this orientation?
9659 """
9660 return _core_.Window_HasScrollbar(*args, **kwargs)
9661
9662 def SetScrollbar(*args, **kwargs):
9663 """
9664 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9665 bool refresh=True)
9666
9667 Sets the scrollbar properties of a built-in scrollbar.
9668 """
9669 return _core_.Window_SetScrollbar(*args, **kwargs)
9670
9671 def SetScrollPos(*args, **kwargs):
9672 """
9673 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9674
9675 Sets the position of one of the built-in scrollbars.
9676 """
9677 return _core_.Window_SetScrollPos(*args, **kwargs)
9678
9679 def GetScrollPos(*args, **kwargs):
9680 """
9681 GetScrollPos(self, int orientation) -> int
9682
9683 Returns the built-in scrollbar position.
9684 """
9685 return _core_.Window_GetScrollPos(*args, **kwargs)
9686
9687 def GetScrollThumb(*args, **kwargs):
9688 """
9689 GetScrollThumb(self, int orientation) -> int
9690
9691 Returns the built-in scrollbar thumb size.
9692 """
9693 return _core_.Window_GetScrollThumb(*args, **kwargs)
9694
9695 def GetScrollRange(*args, **kwargs):
9696 """
9697 GetScrollRange(self, int orientation) -> int
9698
9699 Returns the built-in scrollbar range.
9700 """
9701 return _core_.Window_GetScrollRange(*args, **kwargs)
9702
9703 def ScrollWindow(*args, **kwargs):
9704 """
9705 ScrollWindow(self, int dx, int dy, Rect rect=None)
9706
9707 Physically scrolls the pixels in the window and move child windows
9708 accordingly. Use this function to optimise your scrolling
9709 implementations, to minimise the area that must be redrawn. Note that
9710 it is rarely required to call this function from a user program.
9711 """
9712 return _core_.Window_ScrollWindow(*args, **kwargs)
9713
9714 def ScrollLines(*args, **kwargs):
9715 """
9716 ScrollLines(self, int lines) -> bool
9717
9718 If the platform and window class supports it, scrolls the window by
9719 the given number of lines down, if lines is positive, or up if lines
9720 is negative. Returns True if the window was scrolled, False if it was
9721 already on top/bottom and nothing was done.
9722 """
9723 return _core_.Window_ScrollLines(*args, **kwargs)
9724
9725 def ScrollPages(*args, **kwargs):
9726 """
9727 ScrollPages(self, int pages) -> bool
9728
9729 If the platform and window class supports it, scrolls the window by
9730 the given number of pages down, if pages is positive, or up if pages
9731 is negative. Returns True if the window was scrolled, False if it was
9732 already on top/bottom and nothing was done.
9733 """
9734 return _core_.Window_ScrollPages(*args, **kwargs)
9735
9736 def LineUp(*args, **kwargs):
9737 """
9738 LineUp(self) -> bool
9739
9740 This is just a wrapper for ScrollLines(-1).
9741 """
9742 return _core_.Window_LineUp(*args, **kwargs)
9743
9744 def LineDown(*args, **kwargs):
9745 """
9746 LineDown(self) -> bool
9747
9748 This is just a wrapper for ScrollLines(1).
9749 """
9750 return _core_.Window_LineDown(*args, **kwargs)
9751
9752 def PageUp(*args, **kwargs):
9753 """
9754 PageUp(self) -> bool
9755
9756 This is just a wrapper for ScrollPages(-1).
9757 """
9758 return _core_.Window_PageUp(*args, **kwargs)
9759
9760 def PageDown(*args, **kwargs):
9761 """
9762 PageDown(self) -> bool
9763
9764 This is just a wrapper for ScrollPages(1).
9765 """
9766 return _core_.Window_PageDown(*args, **kwargs)
9767
9768 def SetHelpText(*args, **kwargs):
9769 """
9770 SetHelpText(self, String text)
9771
9772 Sets the help text to be used as context-sensitive help for this
9773 window. Note that the text is actually stored by the current
9774 `wx.HelpProvider` implementation, and not in the window object itself.
9775 """
9776 return _core_.Window_SetHelpText(*args, **kwargs)
9777
9778 def SetHelpTextForId(*args, **kwargs):
9779 """
9780 SetHelpTextForId(self, String text)
9781
9782 Associate this help text with all windows with the same id as this
9783 one.
9784 """
9785 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9786
9787 def GetHelpTextAtPoint(*args, **kwargs):
9788 """
9789 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9790
9791 Get the help string associated with the given position in this window.
9792
9793 Notice that pt may be invalid if event origin is keyboard or unknown
9794 and this method should return the global window help text then
9795
9796 """
9797 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9798
9799 def GetHelpText(*args, **kwargs):
9800 """
9801 GetHelpText(self) -> String
9802
9803 Gets the help text to be used as context-sensitive help for this
9804 window. Note that the text is actually stored by the current
9805 `wx.HelpProvider` implementation, and not in the window object itself.
9806 """
9807 return _core_.Window_GetHelpText(*args, **kwargs)
9808
9809 def SetToolTipString(*args, **kwargs):
9810 """
9811 SetToolTipString(self, String tip)
9812
9813 Attach a tooltip to the window.
9814 """
9815 return _core_.Window_SetToolTipString(*args, **kwargs)
9816
9817 def SetToolTip(*args, **kwargs):
9818 """
9819 SetToolTip(self, ToolTip tip)
9820
9821 Attach a tooltip to the window.
9822 """
9823 return _core_.Window_SetToolTip(*args, **kwargs)
9824
9825 def GetToolTip(*args, **kwargs):
9826 """
9827 GetToolTip(self) -> ToolTip
9828
9829 get the associated tooltip or None if none
9830 """
9831 return _core_.Window_GetToolTip(*args, **kwargs)
9832
9833 def SetDropTarget(*args, **kwargs):
9834 """
9835 SetDropTarget(self, DropTarget dropTarget)
9836
9837 Associates a drop target with this window. If the window already has
9838 a drop target, it is deleted.
9839 """
9840 return _core_.Window_SetDropTarget(*args, **kwargs)
9841
9842 def GetDropTarget(*args, **kwargs):
9843 """
9844 GetDropTarget(self) -> DropTarget
9845
9846 Returns the associated drop target, which may be None.
9847 """
9848 return _core_.Window_GetDropTarget(*args, **kwargs)
9849
9850 def DragAcceptFiles(*args, **kwargs):
9851 """
9852 DragAcceptFiles(self, bool accept)
9853
9854 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9855 Only functional on Windows.
9856 """
9857 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9858
9859 def SetConstraints(*args, **kwargs):
9860 """
9861 SetConstraints(self, LayoutConstraints constraints)
9862
9863 Sets the window to have the given layout constraints. If an existing
9864 layout constraints object is already owned by the window, it will be
9865 deleted. Pass None to disassociate and delete the window's current
9866 constraints.
9867
9868 You must call SetAutoLayout to tell a window to use the constraints
9869 automatically in its default EVT_SIZE handler; otherwise, you must
9870 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9871 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9872 effect.
9873 """
9874 return _core_.Window_SetConstraints(*args, **kwargs)
9875
9876 def GetConstraints(*args, **kwargs):
9877 """
9878 GetConstraints(self) -> LayoutConstraints
9879
9880 Returns a pointer to the window's layout constraints, or None if there
9881 are none.
9882 """
9883 return _core_.Window_GetConstraints(*args, **kwargs)
9884
9885 def SetAutoLayout(*args, **kwargs):
9886 """
9887 SetAutoLayout(self, bool autoLayout)
9888
9889 Determines whether the Layout function will be called automatically
9890 when the window is resized. lease note that this only happens for the
9891 windows usually used to contain children, namely `wx.Panel` and
9892 `wx.TopLevelWindow` (and the classes deriving from them).
9893
9894 This method is called implicitly by `SetSizer` but if you use
9895 `SetConstraints` you should call it manually or otherwise the window
9896 layout won't be correctly updated when its size changes.
9897 """
9898 return _core_.Window_SetAutoLayout(*args, **kwargs)
9899
9900 def GetAutoLayout(*args, **kwargs):
9901 """
9902 GetAutoLayout(self) -> bool
9903
9904 Returns the current autoLayout setting
9905 """
9906 return _core_.Window_GetAutoLayout(*args, **kwargs)
9907
9908 def Layout(*args, **kwargs):
9909 """
9910 Layout(self) -> bool
9911
9912 Invokes the constraint-based layout algorithm or the sizer-based
9913 algorithm for this window. See SetAutoLayout: when auto layout is on,
9914 this function gets called automatically by the default EVT_SIZE
9915 handler when the window is resized.
9916 """
9917 return _core_.Window_Layout(*args, **kwargs)
9918
9919 def SetSizer(*args, **kwargs):
9920 """
9921 SetSizer(self, Sizer sizer, bool deleteOld=True)
9922
9923 Sets the window to have the given layout sizer. The window will then
9924 own the object, and will take care of its deletion. If an existing
9925 layout sizer object is already owned by the window, it will be deleted
9926 if the deleteOld parameter is true. Note that this function will also
9927 call SetAutoLayout implicitly with a True parameter if the sizer is
9928 non-None, and False otherwise.
9929 """
9930 return _core_.Window_SetSizer(*args, **kwargs)
9931
9932 def SetSizerAndFit(*args, **kwargs):
9933 """
9934 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9935
9936 The same as SetSizer, except it also sets the size hints for the
9937 window based on the sizer's minimum size.
9938 """
9939 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9940
9941 def GetSizer(*args, **kwargs):
9942 """
9943 GetSizer(self) -> Sizer
9944
9945 Return the sizer associated with the window by a previous call to
9946 SetSizer or None if there isn't one.
9947 """
9948 return _core_.Window_GetSizer(*args, **kwargs)
9949
9950 def SetContainingSizer(*args, **kwargs):
9951 """
9952 SetContainingSizer(self, Sizer sizer)
9953
9954 This normally does not need to be called by application code. It is
9955 called internally when a window is added to a sizer, and is used so
9956 the window can remove itself from the sizer when it is destroyed.
9957 """
9958 return _core_.Window_SetContainingSizer(*args, **kwargs)
9959
9960 def GetContainingSizer(*args, **kwargs):
9961 """
9962 GetContainingSizer(self) -> Sizer
9963
9964 Return the sizer that this window is a member of, if any, otherwise None.
9965 """
9966 return _core_.Window_GetContainingSizer(*args, **kwargs)
9967
9968 def InheritAttributes(*args, **kwargs):
9969 """
9970 InheritAttributes(self)
9971
9972 This function is (or should be, in case of custom controls) called
9973 during window creation to intelligently set up the window visual
9974 attributes, that is the font and the foreground and background
9975 colours.
9976
9977 By 'intelligently' the following is meant: by default, all windows use
9978 their own default attributes. However if some of the parent's
9979 attributes are explicitly changed (that is, using SetFont and not
9980 SetOwnFont) and if the corresponding attribute hadn't been
9981 explicitly set for this window itself, then this window takes the same
9982 value as used by the parent. In addition, if the window overrides
9983 ShouldInheritColours to return false, the colours will not be changed
9984 no matter what and only the font might.
9985
9986 This rather complicated logic is necessary in order to accommodate the
9987 different usage scenarios. The most common one is when all default
9988 attributes are used and in this case, nothing should be inherited as
9989 in modern GUIs different controls use different fonts (and colours)
9990 than their siblings so they can't inherit the same value from the
9991 parent. However it was also deemed desirable to allow to simply change
9992 the attributes of all children at once by just changing the font or
9993 colour of their common parent, hence in this case we do inherit the
9994 parents attributes.
9995
9996 """
9997 return _core_.Window_InheritAttributes(*args, **kwargs)
9998
9999 def ShouldInheritColours(*args, **kwargs):
10000 """
10001 ShouldInheritColours(self) -> bool
10002
10003 Return true from here to allow the colours of this window to be
10004 changed by InheritAttributes, returning false forbids inheriting them
10005 from the parent window.
10006
10007 The base class version returns false, but this method is overridden in
10008 wxControl where it returns true.
10009 """
10010 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10011
10012 def CanSetTransparent(*args, **kwargs):
10013 """
10014 CanSetTransparent(self) -> bool
10015
10016 Returns ``True`` if the platform supports setting the transparency for
10017 this window. Note that this method will err on the side of caution,
10018 so it is possible that this will return ``False`` when it is in fact
10019 possible to set the transparency.
10020
10021 NOTE: On X-windows systems the X server must have the composite
10022 extension loaded, and there must be a composite manager program (such
10023 as xcompmgr) running.
10024 """
10025 return _core_.Window_CanSetTransparent(*args, **kwargs)
10026
10027 def SetTransparent(*args, **kwargs):
10028 """
10029 SetTransparent(self, byte alpha) -> bool
10030
10031 Attempt to set the transparency of this window to the ``alpha`` value,
10032 returns True on success. The ``alpha`` value is an integer in the
10033 range of 0 to 255, where 0 is fully transparent and 255 is fully
10034 opaque.
10035 """
10036 return _core_.Window_SetTransparent(*args, **kwargs)
10037
10038 def PostCreate(self, pre):
10039 """
10040 Phase 3 of the 2-phase create <wink!>
10041 Call this method after precreating the window with the 2-phase create method.
10042 """
10043 self.this = pre.this
10044 self.thisown = pre.thisown
10045 pre.thisown = 0
10046 if hasattr(self, '_setOORInfo'):
10047 self._setOORInfo(self)
10048 if hasattr(self, '_setCallbackInfo'):
10049 self._setCallbackInfo(self, self.__class__)
10050
10051 def SendSizeEvent(self):
10052 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10053
10054 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10055 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10056 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10057 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10058 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10059 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10060 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10061 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10062 Border = property(GetBorder,doc="See `GetBorder`")
10063 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10064 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10065 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10066 Children = property(GetChildren,doc="See `GetChildren`")
10067 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10068 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10069 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10070 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10071 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10072 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10073 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10074 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10075 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10076 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10077 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10078 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
10079 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10080 Handle = property(GetHandle,doc="See `GetHandle`")
10081 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
10082 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10083 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
10084 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
10085 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10086 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10087 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10088 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10089 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10090 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10091 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10092 Parent = property(GetParent,doc="See `GetParent`")
10093 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10094 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10095 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10096 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
10097 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10098 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
10099 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10100 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10101 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10102 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10103 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10104 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10105 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10106 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10107 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
10108 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10109 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10110 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
10111 _core_.Window_swigregister(Window)
10112
10113 def PreWindow(*args, **kwargs):
10114 """
10115 PreWindow() -> Window
10116
10117 Precreate a Window for 2-phase creation.
10118 """
10119 val = _core_.new_PreWindow(*args, **kwargs)
10120 return val
10121
10122 def Window_NewControlId(*args):
10123 """
10124 Window_NewControlId() -> int
10125
10126 Generate a control id for the controls which were not given one.
10127 """
10128 return _core_.Window_NewControlId(*args)
10129
10130 def Window_NextControlId(*args, **kwargs):
10131 """
10132 Window_NextControlId(int winid) -> int
10133
10134 Get the id of the control following the one with the given
10135 autogenerated) id
10136 """
10137 return _core_.Window_NextControlId(*args, **kwargs)
10138
10139 def Window_PrevControlId(*args, **kwargs):
10140 """
10141 Window_PrevControlId(int winid) -> int
10142
10143 Get the id of the control preceding the one with the given
10144 autogenerated) id
10145 """
10146 return _core_.Window_PrevControlId(*args, **kwargs)
10147
10148 def Window_FindFocus(*args):
10149 """
10150 Window_FindFocus() -> Window
10151
10152 Returns the window or control that currently has the keyboard focus,
10153 or None.
10154 """
10155 return _core_.Window_FindFocus(*args)
10156
10157 def Window_GetCapture(*args):
10158 """
10159 Window_GetCapture() -> Window
10160
10161 Returns the window which currently captures the mouse or None
10162 """
10163 return _core_.Window_GetCapture(*args)
10164
10165 def Window_GetClassDefaultAttributes(*args, **kwargs):
10166 """
10167 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10168
10169 Get the default attributes for this class. This is useful if you want
10170 to use the same font or colour in your own control as in a standard
10171 control -- which is a much better idea than hard coding specific
10172 colours or fonts which might look completely out of place on the
10173 user's system, especially if it uses themes.
10174
10175 The variant parameter is only relevant under Mac currently and is
10176 ignore under other platforms. Under Mac, it will change the size of
10177 the returned font. See `wx.Window.SetWindowVariant` for more about
10178 this.
10179 """
10180 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10181
10182 def DLG_PNT(win, point_or_x, y=None):
10183 """
10184 Convenience function for converting a Point or (x,y) in
10185 dialog units to pixel units.
10186 """
10187 if y is None:
10188 return win.ConvertDialogPointToPixels(point_or_x)
10189 else:
10190 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10191
10192 def DLG_SZE(win, size_width, height=None):
10193 """
10194 Convenience function for converting a Size or (w,h) in
10195 dialog units to pixel units.
10196 """
10197 if height is None:
10198 return win.ConvertDialogSizeToPixels(size_width)
10199 else:
10200 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10201
10202
10203 def FindWindowById(*args, **kwargs):
10204 """
10205 FindWindowById(long id, Window parent=None) -> Window
10206
10207 Find the first window in the application with the given id. If parent
10208 is None, the search will start from all top-level frames and dialog
10209 boxes; if non-None, the search will be limited to the given window
10210 hierarchy. The search is recursive in both cases.
10211 """
10212 return _core_.FindWindowById(*args, **kwargs)
10213
10214 def FindWindowByName(*args, **kwargs):
10215 """
10216 FindWindowByName(String name, Window parent=None) -> Window
10217
10218 Find a window by its name (as given in a window constructor or Create
10219 function call). If parent is None, the search will start from all
10220 top-level frames and dialog boxes; if non-None, the search will be
10221 limited to the given window hierarchy. The search is recursive in both
10222 cases.
10223
10224 If no window with such name is found, wx.FindWindowByLabel is called.
10225 """
10226 return _core_.FindWindowByName(*args, **kwargs)
10227
10228 def FindWindowByLabel(*args, **kwargs):
10229 """
10230 FindWindowByLabel(String label, Window parent=None) -> Window
10231
10232 Find a window by its label. Depending on the type of window, the label
10233 may be a window title or panel item label. If parent is None, the
10234 search will start from all top-level frames and dialog boxes; if
10235 non-None, the search will be limited to the given window
10236 hierarchy. The search is recursive in both cases.
10237 """
10238 return _core_.FindWindowByLabel(*args, **kwargs)
10239
10240 def Window_FromHWND(*args, **kwargs):
10241 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10242 return _core_.Window_FromHWND(*args, **kwargs)
10243
10244 def GetTopLevelWindows(*args):
10245 """
10246 GetTopLevelWindows() -> PyObject
10247
10248 Returns a list of the the application's top-level windows, (frames,
10249 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10250 by wxWidgets, and so it is only valid as long as no top-level windows
10251 are closed or new top-level windows are created.
10252
10253 """
10254 return _core_.GetTopLevelWindows(*args)
10255 #---------------------------------------------------------------------------
10256
10257 class Validator(EvtHandler):
10258 """Proxy of C++ Validator class"""
10259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10260 __repr__ = _swig_repr
10261 def __init__(self, *args, **kwargs):
10262 """__init__(self) -> Validator"""
10263 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10264 self._setOORInfo(self)
10265
10266 def Clone(*args, **kwargs):
10267 """Clone(self) -> Validator"""
10268 return _core_.Validator_Clone(*args, **kwargs)
10269
10270 def Validate(*args, **kwargs):
10271 """Validate(self, Window parent) -> bool"""
10272 return _core_.Validator_Validate(*args, **kwargs)
10273
10274 def TransferToWindow(*args, **kwargs):
10275 """TransferToWindow(self) -> bool"""
10276 return _core_.Validator_TransferToWindow(*args, **kwargs)
10277
10278 def TransferFromWindow(*args, **kwargs):
10279 """TransferFromWindow(self) -> bool"""
10280 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10281
10282 def GetWindow(*args, **kwargs):
10283 """GetWindow(self) -> Window"""
10284 return _core_.Validator_GetWindow(*args, **kwargs)
10285
10286 def SetWindow(*args, **kwargs):
10287 """SetWindow(self, Window window)"""
10288 return _core_.Validator_SetWindow(*args, **kwargs)
10289
10290 def IsSilent(*args, **kwargs):
10291 """IsSilent() -> bool"""
10292 return _core_.Validator_IsSilent(*args, **kwargs)
10293
10294 IsSilent = staticmethod(IsSilent)
10295 def SetBellOnError(*args, **kwargs):
10296 """SetBellOnError(int doIt=True)"""
10297 return _core_.Validator_SetBellOnError(*args, **kwargs)
10298
10299 SetBellOnError = staticmethod(SetBellOnError)
10300 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
10301 _core_.Validator_swigregister(Validator)
10302
10303 def Validator_IsSilent(*args):
10304 """Validator_IsSilent() -> bool"""
10305 return _core_.Validator_IsSilent(*args)
10306
10307 def Validator_SetBellOnError(*args, **kwargs):
10308 """Validator_SetBellOnError(int doIt=True)"""
10309 return _core_.Validator_SetBellOnError(*args, **kwargs)
10310
10311 class PyValidator(Validator):
10312 """Proxy of C++ PyValidator class"""
10313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10314 __repr__ = _swig_repr
10315 def __init__(self, *args, **kwargs):
10316 """__init__(self) -> PyValidator"""
10317 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10318
10319 self._setCallbackInfo(self, PyValidator, 1)
10320 self._setOORInfo(self)
10321
10322 def _setCallbackInfo(*args, **kwargs):
10323 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10324 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10325
10326 _core_.PyValidator_swigregister(PyValidator)
10327
10328 #---------------------------------------------------------------------------
10329
10330 class Menu(EvtHandler):
10331 """Proxy of C++ Menu class"""
10332 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10333 __repr__ = _swig_repr
10334 def __init__(self, *args, **kwargs):
10335 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10336 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10337 self._setOORInfo(self)
10338
10339 def Append(*args, **kwargs):
10340 """
10341 Append(self, int id, String text=EmptyString, String help=EmptyString,
10342 int kind=ITEM_NORMAL) -> MenuItem
10343 """
10344 return _core_.Menu_Append(*args, **kwargs)
10345
10346 def AppendSeparator(*args, **kwargs):
10347 """AppendSeparator(self) -> MenuItem"""
10348 return _core_.Menu_AppendSeparator(*args, **kwargs)
10349
10350 def AppendCheckItem(*args, **kwargs):
10351 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10352 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10353
10354 def AppendRadioItem(*args, **kwargs):
10355 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10356 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10357
10358 def AppendMenu(*args, **kwargs):
10359 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10360 return _core_.Menu_AppendMenu(*args, **kwargs)
10361
10362 def AppendSubMenu(*args, **kwargs):
10363 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10364 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10365
10366 def AppendItem(*args, **kwargs):
10367 """AppendItem(self, MenuItem item) -> MenuItem"""
10368 return _core_.Menu_AppendItem(*args, **kwargs)
10369
10370 def InsertItem(*args, **kwargs):
10371 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10372 return _core_.Menu_InsertItem(*args, **kwargs)
10373
10374 def PrependItem(*args, **kwargs):
10375 """PrependItem(self, MenuItem item) -> MenuItem"""
10376 return _core_.Menu_PrependItem(*args, **kwargs)
10377
10378 def Break(*args, **kwargs):
10379 """Break(self)"""
10380 return _core_.Menu_Break(*args, **kwargs)
10381
10382 def Insert(*args, **kwargs):
10383 """
10384 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10385 int kind=ITEM_NORMAL) -> MenuItem
10386 """
10387 return _core_.Menu_Insert(*args, **kwargs)
10388
10389 def InsertSeparator(*args, **kwargs):
10390 """InsertSeparator(self, size_t pos) -> MenuItem"""
10391 return _core_.Menu_InsertSeparator(*args, **kwargs)
10392
10393 def InsertCheckItem(*args, **kwargs):
10394 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10395 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10396
10397 def InsertRadioItem(*args, **kwargs):
10398 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10399 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10400
10401 def InsertMenu(*args, **kwargs):
10402 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10403 return _core_.Menu_InsertMenu(*args, **kwargs)
10404
10405 def Prepend(*args, **kwargs):
10406 """
10407 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10408 int kind=ITEM_NORMAL) -> MenuItem
10409 """
10410 return _core_.Menu_Prepend(*args, **kwargs)
10411
10412 def PrependSeparator(*args, **kwargs):
10413 """PrependSeparator(self) -> MenuItem"""
10414 return _core_.Menu_PrependSeparator(*args, **kwargs)
10415
10416 def PrependCheckItem(*args, **kwargs):
10417 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10418 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10419
10420 def PrependRadioItem(*args, **kwargs):
10421 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10422 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10423
10424 def PrependMenu(*args, **kwargs):
10425 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10426 return _core_.Menu_PrependMenu(*args, **kwargs)
10427
10428 def Remove(*args, **kwargs):
10429 """Remove(self, int id) -> MenuItem"""
10430 return _core_.Menu_Remove(*args, **kwargs)
10431
10432 def RemoveItem(*args, **kwargs):
10433 """RemoveItem(self, MenuItem item) -> MenuItem"""
10434 return _core_.Menu_RemoveItem(*args, **kwargs)
10435
10436 def Delete(*args, **kwargs):
10437 """Delete(self, int id) -> bool"""
10438 return _core_.Menu_Delete(*args, **kwargs)
10439
10440 def DeleteItem(*args, **kwargs):
10441 """DeleteItem(self, MenuItem item) -> bool"""
10442 return _core_.Menu_DeleteItem(*args, **kwargs)
10443
10444 def Destroy(*args, **kwargs):
10445 """
10446 Destroy(self)
10447
10448 Deletes the C++ object this Python object is a proxy for.
10449 """
10450 val = _core_.Menu_Destroy(*args, **kwargs)
10451 args[0].thisown = 0
10452 return val
10453
10454 def DestroyId(*args, **kwargs):
10455 """
10456 DestroyId(self, int id) -> bool
10457
10458 Deletes the C++ object this Python object is a proxy for.
10459 """
10460 val = _core_.Menu_DestroyId(*args, **kwargs)
10461 args[0].thisown = 0
10462 return val
10463
10464 def DestroyItem(*args, **kwargs):
10465 """
10466 DestroyItem(self, MenuItem item) -> bool
10467
10468 Deletes the C++ object this Python object is a proxy for.
10469 """
10470 val = _core_.Menu_DestroyItem(*args, **kwargs)
10471 args[0].thisown = 0
10472 return val
10473
10474 def GetMenuItemCount(*args, **kwargs):
10475 """GetMenuItemCount(self) -> size_t"""
10476 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10477
10478 def GetMenuItems(*args, **kwargs):
10479 """GetMenuItems(self) -> PyObject"""
10480 return _core_.Menu_GetMenuItems(*args, **kwargs)
10481
10482 def FindItem(*args, **kwargs):
10483 """FindItem(self, String item) -> int"""
10484 return _core_.Menu_FindItem(*args, **kwargs)
10485
10486 def FindItemById(*args, **kwargs):
10487 """FindItemById(self, int id) -> MenuItem"""
10488 return _core_.Menu_FindItemById(*args, **kwargs)
10489
10490 def FindItemByPosition(*args, **kwargs):
10491 """FindItemByPosition(self, size_t position) -> MenuItem"""
10492 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10493
10494 def Enable(*args, **kwargs):
10495 """Enable(self, int id, bool enable)"""
10496 return _core_.Menu_Enable(*args, **kwargs)
10497
10498 def IsEnabled(*args, **kwargs):
10499 """IsEnabled(self, int id) -> bool"""
10500 return _core_.Menu_IsEnabled(*args, **kwargs)
10501
10502 def Check(*args, **kwargs):
10503 """Check(self, int id, bool check)"""
10504 return _core_.Menu_Check(*args, **kwargs)
10505
10506 def IsChecked(*args, **kwargs):
10507 """IsChecked(self, int id) -> bool"""
10508 return _core_.Menu_IsChecked(*args, **kwargs)
10509
10510 def SetLabel(*args, **kwargs):
10511 """SetLabel(self, int id, String label)"""
10512 return _core_.Menu_SetLabel(*args, **kwargs)
10513
10514 def GetLabel(*args, **kwargs):
10515 """GetLabel(self, int id) -> String"""
10516 return _core_.Menu_GetLabel(*args, **kwargs)
10517
10518 def SetHelpString(*args, **kwargs):
10519 """SetHelpString(self, int id, String helpString)"""
10520 return _core_.Menu_SetHelpString(*args, **kwargs)
10521
10522 def GetHelpString(*args, **kwargs):
10523 """GetHelpString(self, int id) -> String"""
10524 return _core_.Menu_GetHelpString(*args, **kwargs)
10525
10526 def SetTitle(*args, **kwargs):
10527 """SetTitle(self, String title)"""
10528 return _core_.Menu_SetTitle(*args, **kwargs)
10529
10530 def GetTitle(*args, **kwargs):
10531 """GetTitle(self) -> String"""
10532 return _core_.Menu_GetTitle(*args, **kwargs)
10533
10534 def SetEventHandler(*args, **kwargs):
10535 """SetEventHandler(self, EvtHandler handler)"""
10536 return _core_.Menu_SetEventHandler(*args, **kwargs)
10537
10538 def GetEventHandler(*args, **kwargs):
10539 """GetEventHandler(self) -> EvtHandler"""
10540 return _core_.Menu_GetEventHandler(*args, **kwargs)
10541
10542 def SetInvokingWindow(*args, **kwargs):
10543 """SetInvokingWindow(self, Window win)"""
10544 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10545
10546 def GetInvokingWindow(*args, **kwargs):
10547 """GetInvokingWindow(self) -> Window"""
10548 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10549
10550 def GetStyle(*args, **kwargs):
10551 """GetStyle(self) -> long"""
10552 return _core_.Menu_GetStyle(*args, **kwargs)
10553
10554 def UpdateUI(*args, **kwargs):
10555 """UpdateUI(self, EvtHandler source=None)"""
10556 return _core_.Menu_UpdateUI(*args, **kwargs)
10557
10558 def GetMenuBar(*args, **kwargs):
10559 """GetMenuBar(self) -> MenuBar"""
10560 return _core_.Menu_GetMenuBar(*args, **kwargs)
10561
10562 def Attach(*args, **kwargs):
10563 """Attach(self, wxMenuBarBase menubar)"""
10564 return _core_.Menu_Attach(*args, **kwargs)
10565
10566 def Detach(*args, **kwargs):
10567 """Detach(self)"""
10568 return _core_.Menu_Detach(*args, **kwargs)
10569
10570 def IsAttached(*args, **kwargs):
10571 """IsAttached(self) -> bool"""
10572 return _core_.Menu_IsAttached(*args, **kwargs)
10573
10574 def SetParent(*args, **kwargs):
10575 """SetParent(self, Menu parent)"""
10576 return _core_.Menu_SetParent(*args, **kwargs)
10577
10578 def GetParent(*args, **kwargs):
10579 """GetParent(self) -> Menu"""
10580 return _core_.Menu_GetParent(*args, **kwargs)
10581
10582 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10583 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10584 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10585 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10586 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10587 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10588 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10589 Style = property(GetStyle,doc="See `GetStyle`")
10590 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
10591 _core_.Menu_swigregister(Menu)
10592 DefaultValidator = cvar.DefaultValidator
10593
10594 #---------------------------------------------------------------------------
10595
10596 class MenuBar(Window):
10597 """Proxy of C++ MenuBar class"""
10598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10599 __repr__ = _swig_repr
10600 def __init__(self, *args, **kwargs):
10601 """__init__(self, long style=0) -> MenuBar"""
10602 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10603 self._setOORInfo(self)
10604
10605 def Append(*args, **kwargs):
10606 """Append(self, Menu menu, String title) -> bool"""
10607 return _core_.MenuBar_Append(*args, **kwargs)
10608
10609 def Insert(*args, **kwargs):
10610 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10611 return _core_.MenuBar_Insert(*args, **kwargs)
10612
10613 def GetMenuCount(*args, **kwargs):
10614 """GetMenuCount(self) -> size_t"""
10615 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10616
10617 def GetMenu(*args, **kwargs):
10618 """GetMenu(self, size_t pos) -> Menu"""
10619 return _core_.MenuBar_GetMenu(*args, **kwargs)
10620
10621 def Replace(*args, **kwargs):
10622 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10623 return _core_.MenuBar_Replace(*args, **kwargs)
10624
10625 def Remove(*args, **kwargs):
10626 """Remove(self, size_t pos) -> Menu"""
10627 return _core_.MenuBar_Remove(*args, **kwargs)
10628
10629 def EnableTop(*args, **kwargs):
10630 """EnableTop(self, size_t pos, bool enable)"""
10631 return _core_.MenuBar_EnableTop(*args, **kwargs)
10632
10633 def IsEnabledTop(*args, **kwargs):
10634 """IsEnabledTop(self, size_t pos) -> bool"""
10635 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10636
10637 def SetLabelTop(*args, **kwargs):
10638 """SetLabelTop(self, size_t pos, String label)"""
10639 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10640
10641 def GetLabelTop(*args, **kwargs):
10642 """GetLabelTop(self, size_t pos) -> String"""
10643 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10644
10645 def FindMenuItem(*args, **kwargs):
10646 """FindMenuItem(self, String menu, String item) -> int"""
10647 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10648
10649 def FindItemById(*args, **kwargs):
10650 """FindItemById(self, int id) -> MenuItem"""
10651 return _core_.MenuBar_FindItemById(*args, **kwargs)
10652
10653 def FindMenu(*args, **kwargs):
10654 """FindMenu(self, String title) -> int"""
10655 return _core_.MenuBar_FindMenu(*args, **kwargs)
10656
10657 def Enable(*args, **kwargs):
10658 """Enable(self, int id, bool enable)"""
10659 return _core_.MenuBar_Enable(*args, **kwargs)
10660
10661 def Check(*args, **kwargs):
10662 """Check(self, int id, bool check)"""
10663 return _core_.MenuBar_Check(*args, **kwargs)
10664
10665 def IsChecked(*args, **kwargs):
10666 """IsChecked(self, int id) -> bool"""
10667 return _core_.MenuBar_IsChecked(*args, **kwargs)
10668
10669 def IsEnabled(*args, **kwargs):
10670 """IsEnabled(self, int id) -> bool"""
10671 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10672
10673 def SetLabel(*args, **kwargs):
10674 """SetLabel(self, int id, String label)"""
10675 return _core_.MenuBar_SetLabel(*args, **kwargs)
10676
10677 def GetLabel(*args, **kwargs):
10678 """GetLabel(self, int id) -> String"""
10679 return _core_.MenuBar_GetLabel(*args, **kwargs)
10680
10681 def SetHelpString(*args, **kwargs):
10682 """SetHelpString(self, int id, String helpString)"""
10683 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10684
10685 def GetHelpString(*args, **kwargs):
10686 """GetHelpString(self, int id) -> String"""
10687 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10688
10689 def GetFrame(*args, **kwargs):
10690 """GetFrame(self) -> wxFrame"""
10691 return _core_.MenuBar_GetFrame(*args, **kwargs)
10692
10693 def IsAttached(*args, **kwargs):
10694 """IsAttached(self) -> bool"""
10695 return _core_.MenuBar_IsAttached(*args, **kwargs)
10696
10697 def Attach(*args, **kwargs):
10698 """Attach(self, wxFrame frame)"""
10699 return _core_.MenuBar_Attach(*args, **kwargs)
10700
10701 def Detach(*args, **kwargs):
10702 """Detach(self)"""
10703 return _core_.MenuBar_Detach(*args, **kwargs)
10704
10705 def UpdateMenus(*args, **kwargs):
10706 """UpdateMenus(self)"""
10707 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10708
10709 def SetAutoWindowMenu(*args, **kwargs):
10710 """SetAutoWindowMenu(bool enable)"""
10711 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10712
10713 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10714 def GetAutoWindowMenu(*args, **kwargs):
10715 """GetAutoWindowMenu() -> bool"""
10716 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10717
10718 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10719 def GetMenus(self):
10720 """Return a list of (menu, label) items for the menus in the MenuBar. """
10721 return [(self.GetMenu(i), self.GetLabelTop(i))
10722 for i in range(self.GetMenuCount())]
10723
10724 def SetMenus(self, items):
10725 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10726 for i in range(self.GetMenuCount()-1, -1, -1):
10727 self.Remove(i)
10728 for m, l in items:
10729 self.Append(m, l)
10730
10731 Frame = property(GetFrame,doc="See `GetFrame`")
10732 Menu = property(GetMenu,doc="See `GetMenu`")
10733 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10734 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
10735 _core_.MenuBar_swigregister(MenuBar)
10736
10737 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10738 """MenuBar_SetAutoWindowMenu(bool enable)"""
10739 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10740
10741 def MenuBar_GetAutoWindowMenu(*args):
10742 """MenuBar_GetAutoWindowMenu() -> bool"""
10743 return _core_.MenuBar_GetAutoWindowMenu(*args)
10744
10745 #---------------------------------------------------------------------------
10746
10747 class MenuItem(Object):
10748 """Proxy of C++ MenuItem class"""
10749 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10750 __repr__ = _swig_repr
10751 def __init__(self, *args, **kwargs):
10752 """
10753 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10754 String help=EmptyString, int kind=ITEM_NORMAL,
10755 Menu subMenu=None) -> MenuItem
10756 """
10757 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10758 __swig_destroy__ = _core_.delete_MenuItem
10759 __del__ = lambda self : None;
10760 def GetMenu(*args, **kwargs):
10761 """GetMenu(self) -> Menu"""
10762 return _core_.MenuItem_GetMenu(*args, **kwargs)
10763
10764 def SetMenu(*args, **kwargs):
10765 """SetMenu(self, Menu menu)"""
10766 return _core_.MenuItem_SetMenu(*args, **kwargs)
10767
10768 def SetId(*args, **kwargs):
10769 """SetId(self, int id)"""
10770 return _core_.MenuItem_SetId(*args, **kwargs)
10771
10772 def GetId(*args, **kwargs):
10773 """GetId(self) -> int"""
10774 return _core_.MenuItem_GetId(*args, **kwargs)
10775
10776 def IsSeparator(*args, **kwargs):
10777 """IsSeparator(self) -> bool"""
10778 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10779
10780 def SetText(*args, **kwargs):
10781 """SetText(self, String str)"""
10782 return _core_.MenuItem_SetText(*args, **kwargs)
10783
10784 def GetLabel(*args, **kwargs):
10785 """GetLabel(self) -> String"""
10786 return _core_.MenuItem_GetLabel(*args, **kwargs)
10787
10788 def GetText(*args, **kwargs):
10789 """GetText(self) -> String"""
10790 return _core_.MenuItem_GetText(*args, **kwargs)
10791
10792 def GetLabelFromText(*args, **kwargs):
10793 """GetLabelFromText(String text) -> String"""
10794 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10795
10796 GetLabelFromText = staticmethod(GetLabelFromText)
10797 def GetKind(*args, **kwargs):
10798 """GetKind(self) -> int"""
10799 return _core_.MenuItem_GetKind(*args, **kwargs)
10800
10801 def SetKind(*args, **kwargs):
10802 """SetKind(self, int kind)"""
10803 return _core_.MenuItem_SetKind(*args, **kwargs)
10804
10805 def SetCheckable(*args, **kwargs):
10806 """SetCheckable(self, bool checkable)"""
10807 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10808
10809 def IsCheckable(*args, **kwargs):
10810 """IsCheckable(self) -> bool"""
10811 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10812
10813 def IsSubMenu(*args, **kwargs):
10814 """IsSubMenu(self) -> bool"""
10815 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10816
10817 def SetSubMenu(*args, **kwargs):
10818 """SetSubMenu(self, Menu menu)"""
10819 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10820
10821 def GetSubMenu(*args, **kwargs):
10822 """GetSubMenu(self) -> Menu"""
10823 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10824
10825 def Enable(*args, **kwargs):
10826 """Enable(self, bool enable=True)"""
10827 return _core_.MenuItem_Enable(*args, **kwargs)
10828
10829 def IsEnabled(*args, **kwargs):
10830 """IsEnabled(self) -> bool"""
10831 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10832
10833 def Check(*args, **kwargs):
10834 """Check(self, bool check=True)"""
10835 return _core_.MenuItem_Check(*args, **kwargs)
10836
10837 def IsChecked(*args, **kwargs):
10838 """IsChecked(self) -> bool"""
10839 return _core_.MenuItem_IsChecked(*args, **kwargs)
10840
10841 def Toggle(*args, **kwargs):
10842 """Toggle(self)"""
10843 return _core_.MenuItem_Toggle(*args, **kwargs)
10844
10845 def SetHelp(*args, **kwargs):
10846 """SetHelp(self, String str)"""
10847 return _core_.MenuItem_SetHelp(*args, **kwargs)
10848
10849 def GetHelp(*args, **kwargs):
10850 """GetHelp(self) -> String"""
10851 return _core_.MenuItem_GetHelp(*args, **kwargs)
10852
10853 def GetAccel(*args, **kwargs):
10854 """GetAccel(self) -> AcceleratorEntry"""
10855 return _core_.MenuItem_GetAccel(*args, **kwargs)
10856
10857 def SetAccel(*args, **kwargs):
10858 """SetAccel(self, AcceleratorEntry accel)"""
10859 return _core_.MenuItem_SetAccel(*args, **kwargs)
10860
10861 def SetBitmap(*args, **kwargs):
10862 """SetBitmap(self, Bitmap bitmap)"""
10863 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10864
10865 def GetBitmap(*args, **kwargs):
10866 """GetBitmap(self) -> Bitmap"""
10867 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10868
10869 def SetFont(*args, **kwargs):
10870 """SetFont(self, Font font)"""
10871 return _core_.MenuItem_SetFont(*args, **kwargs)
10872
10873 def GetFont(*args, **kwargs):
10874 """GetFont(self) -> Font"""
10875 return _core_.MenuItem_GetFont(*args, **kwargs)
10876
10877 def SetTextColour(*args, **kwargs):
10878 """SetTextColour(self, Colour colText)"""
10879 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10880
10881 def GetTextColour(*args, **kwargs):
10882 """GetTextColour(self) -> Colour"""
10883 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10884
10885 def SetBackgroundColour(*args, **kwargs):
10886 """SetBackgroundColour(self, Colour colBack)"""
10887 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10888
10889 def GetBackgroundColour(*args, **kwargs):
10890 """GetBackgroundColour(self) -> Colour"""
10891 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10892
10893 def SetBitmaps(*args, **kwargs):
10894 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10895 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10896
10897 def SetDisabledBitmap(*args, **kwargs):
10898 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10899 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10900
10901 def GetDisabledBitmap(*args, **kwargs):
10902 """GetDisabledBitmap(self) -> Bitmap"""
10903 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10904
10905 def SetMarginWidth(*args, **kwargs):
10906 """SetMarginWidth(self, int nWidth)"""
10907 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10908
10909 def GetMarginWidth(*args, **kwargs):
10910 """GetMarginWidth(self) -> int"""
10911 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10912
10913 def GetDefaultMarginWidth(*args, **kwargs):
10914 """GetDefaultMarginWidth() -> int"""
10915 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10916
10917 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10918 def IsOwnerDrawn(*args, **kwargs):
10919 """IsOwnerDrawn(self) -> bool"""
10920 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10921
10922 def SetOwnerDrawn(*args, **kwargs):
10923 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10924 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10925
10926 def ResetOwnerDrawn(*args, **kwargs):
10927 """ResetOwnerDrawn(self)"""
10928 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10929
10930 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10931 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10932 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10933 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10934 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10935 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10936 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10937 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10938 Label = property(GetLabel,doc="See `GetLabel`")
10939 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10940 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10941 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10942 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10943 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
10944 _core_.MenuItem_swigregister(MenuItem)
10945
10946 def MenuItem_GetLabelFromText(*args, **kwargs):
10947 """MenuItem_GetLabelFromText(String text) -> String"""
10948 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10949
10950 def MenuItem_GetDefaultMarginWidth(*args):
10951 """MenuItem_GetDefaultMarginWidth() -> int"""
10952 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10953
10954 #---------------------------------------------------------------------------
10955
10956 class Control(Window):
10957 """
10958 This is the base class for a control or 'widget'.
10959
10960 A control is generally a small window which processes user input
10961 and/or displays one or more item of data.
10962 """
10963 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10964 __repr__ = _swig_repr
10965 def __init__(self, *args, **kwargs):
10966 """
10967 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10968 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10969 String name=ControlNameStr) -> Control
10970
10971 Create a Control. Normally you should only call this from a subclass'
10972 __init__ as a plain old wx.Control is not very useful.
10973 """
10974 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10975 self._setOORInfo(self)
10976
10977 def Create(*args, **kwargs):
10978 """
10979 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10980 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10981 String name=ControlNameStr) -> bool
10982
10983 Do the 2nd phase and create the GUI control.
10984 """
10985 return _core_.Control_Create(*args, **kwargs)
10986
10987 def GetAlignment(*args, **kwargs):
10988 """
10989 GetAlignment(self) -> int
10990
10991 Get the control alignment (left/right/centre, top/bottom/centre)
10992 """
10993 return _core_.Control_GetAlignment(*args, **kwargs)
10994
10995 def GetLabelText(*args, **kwargs):
10996 """
10997 GetLabelText(self) -> String
10998
10999 Get just the text of the label, without mnemonic characters ('&')
11000 """
11001 return _core_.Control_GetLabelText(*args, **kwargs)
11002
11003 def Command(*args, **kwargs):
11004 """
11005 Command(self, CommandEvent event)
11006
11007 Simulates the effect of the user issuing a command to the item.
11008
11009 :see: `wx.CommandEvent`
11010
11011 """
11012 return _core_.Control_Command(*args, **kwargs)
11013
11014 def GetClassDefaultAttributes(*args, **kwargs):
11015 """
11016 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11017
11018 Get the default attributes for this class. This is useful if you want
11019 to use the same font or colour in your own control as in a standard
11020 control -- which is a much better idea than hard coding specific
11021 colours or fonts which might look completely out of place on the
11022 user's system, especially if it uses themes.
11023
11024 The variant parameter is only relevant under Mac currently and is
11025 ignore under other platforms. Under Mac, it will change the size of
11026 the returned font. See `wx.Window.SetWindowVariant` for more about
11027 this.
11028 """
11029 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11030
11031 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11032 Alignment = property(GetAlignment,doc="See `GetAlignment`")
11033 LabelText = property(GetLabelText,doc="See `GetLabelText`")
11034 _core_.Control_swigregister(Control)
11035 ControlNameStr = cvar.ControlNameStr
11036
11037 def PreControl(*args, **kwargs):
11038 """
11039 PreControl() -> Control
11040
11041 Precreate a Control control for 2-phase creation
11042 """
11043 val = _core_.new_PreControl(*args, **kwargs)
11044 return val
11045
11046 def Control_GetClassDefaultAttributes(*args, **kwargs):
11047 """
11048 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11049
11050 Get the default attributes for this class. This is useful if you want
11051 to use the same font or colour in your own control as in a standard
11052 control -- which is a much better idea than hard coding specific
11053 colours or fonts which might look completely out of place on the
11054 user's system, especially if it uses themes.
11055
11056 The variant parameter is only relevant under Mac currently and is
11057 ignore under other platforms. Under Mac, it will change the size of
11058 the returned font. See `wx.Window.SetWindowVariant` for more about
11059 this.
11060 """
11061 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11062
11063 #---------------------------------------------------------------------------
11064
11065 class ItemContainer(object):
11066 """
11067 The wx.ItemContainer class defines an interface which is implemented
11068 by all controls which have string subitems, each of which may be
11069 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11070 as `wx.ComboBox` which implements an extended interface deriving from
11071 this one.
11072
11073 It defines the methods for accessing the control's items and although
11074 each of the derived classes implements them differently, they still
11075 all conform to the same interface.
11076
11077 The items in a wx.ItemContainer have (non empty) string labels and,
11078 optionally, client data associated with them.
11079
11080 """
11081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11082 def __init__(self): raise AttributeError, "No constructor defined"
11083 __repr__ = _swig_repr
11084 def Append(*args, **kwargs):
11085 """
11086 Append(self, String item, PyObject clientData=None) -> int
11087
11088 Adds the item to the control, associating the given data with the item
11089 if not None. The return value is the index of the newly added item
11090 which may be different from the last one if the control is sorted (e.g.
11091 has wx.LB_SORT or wx.CB_SORT style).
11092 """
11093 return _core_.ItemContainer_Append(*args, **kwargs)
11094
11095 def AppendItems(*args, **kwargs):
11096 """
11097 AppendItems(self, List strings)
11098
11099 Apend several items at once to the control. Notice that calling this
11100 method may be much faster than appending the items one by one if you
11101 need to add a lot of items.
11102 """
11103 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11104
11105 def Insert(*args, **kwargs):
11106 """
11107 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
11108
11109 Insert an item into the control before the item at the ``pos`` index,
11110 optionally associating some data object with the item.
11111 """
11112 return _core_.ItemContainer_Insert(*args, **kwargs)
11113
11114 def Clear(*args, **kwargs):
11115 """
11116 Clear(self)
11117
11118 Removes all items from the control.
11119 """
11120 return _core_.ItemContainer_Clear(*args, **kwargs)
11121
11122 def Delete(*args, **kwargs):
11123 """
11124 Delete(self, unsigned int n)
11125
11126 Deletes the item at the zero-based index 'n' from the control. Note
11127 that it is an error (signalled by a `wx.PyAssertionError` exception if
11128 enabled) to remove an item with the index negative or greater or equal
11129 than the number of items in the control.
11130 """
11131 return _core_.ItemContainer_Delete(*args, **kwargs)
11132
11133 def GetClientData(*args, **kwargs):
11134 """
11135 GetClientData(self, unsigned int n) -> PyObject
11136
11137 Returns the client data associated with the given item, (if any.)
11138 """
11139 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11140
11141 def SetClientData(*args, **kwargs):
11142 """
11143 SetClientData(self, unsigned int n, PyObject clientData)
11144
11145 Associate the given client data with the item at position n.
11146 """
11147 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11148
11149 def GetCount(*args, **kwargs):
11150 """
11151 GetCount(self) -> unsigned int
11152
11153 Returns the number of items in the control.
11154 """
11155 return _core_.ItemContainer_GetCount(*args, **kwargs)
11156
11157 def IsEmpty(*args, **kwargs):
11158 """
11159 IsEmpty(self) -> bool
11160
11161 Returns True if the control is empty or False if it has some items.
11162 """
11163 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11164
11165 def GetString(*args, **kwargs):
11166 """
11167 GetString(self, unsigned int n) -> String
11168
11169 Returns the label of the item with the given index.
11170 """
11171 return _core_.ItemContainer_GetString(*args, **kwargs)
11172
11173 def GetStrings(*args, **kwargs):
11174 """GetStrings(self) -> wxArrayString"""
11175 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11176
11177 def SetString(*args, **kwargs):
11178 """
11179 SetString(self, unsigned int n, String s)
11180
11181 Sets the label for the given item.
11182 """
11183 return _core_.ItemContainer_SetString(*args, **kwargs)
11184
11185 def FindString(*args, **kwargs):
11186 """
11187 FindString(self, String s) -> int
11188
11189 Finds an item whose label matches the given string. Returns the
11190 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11191 found.
11192 """
11193 return _core_.ItemContainer_FindString(*args, **kwargs)
11194
11195 def SetSelection(*args, **kwargs):
11196 """
11197 SetSelection(self, int n)
11198
11199 Sets the item at index 'n' to be the selected item.
11200 """
11201 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11202
11203 def GetSelection(*args, **kwargs):
11204 """
11205 GetSelection(self) -> int
11206
11207 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11208 is selected.
11209 """
11210 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11211
11212 def SetStringSelection(*args, **kwargs):
11213 """SetStringSelection(self, String s) -> bool"""
11214 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11215
11216 def GetStringSelection(*args, **kwargs):
11217 """
11218 GetStringSelection(self) -> String
11219
11220 Returns the label of the selected item or an empty string if no item
11221 is selected.
11222 """
11223 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11224
11225 def Select(*args, **kwargs):
11226 """
11227 Select(self, int n)
11228
11229 This is the same as `SetSelection` and exists only because it is
11230 slightly more natural for controls which support multiple selection.
11231 """
11232 return _core_.ItemContainer_Select(*args, **kwargs)
11233
11234 def GetItems(self):
11235 """Return a list of the strings in the control"""
11236 return [self.GetString(i) for i in xrange(self.GetCount())]
11237
11238 def SetItems(self, items):
11239 """Clear and set the strings in the control from a list"""
11240 self.Clear()
11241 for i in items:
11242 self.Append(i)
11243
11244 Count = property(GetCount,doc="See `GetCount`")
11245 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11246 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11247 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11248 Strings = property(GetStrings,doc="See `GetStrings`")
11249 _core_.ItemContainer_swigregister(ItemContainer)
11250
11251 #---------------------------------------------------------------------------
11252
11253 class ControlWithItems(Control,ItemContainer):
11254 """
11255 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11256 wx.Control class, and is used for the base class of various controls
11257 that have items.
11258 """
11259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11260 def __init__(self): raise AttributeError, "No constructor defined"
11261 __repr__ = _swig_repr
11262 _core_.ControlWithItems_swigregister(ControlWithItems)
11263
11264 #---------------------------------------------------------------------------
11265
11266 class SizerItem(Object):
11267 """
11268 The wx.SizerItem class is used to track the position, size and other
11269 attributes of each item managed by a `wx.Sizer`. It is not usually
11270 necessary to use this class because the sizer elements can also be
11271 identified by their positions or window or sizer references but
11272 sometimes it may be more convenient to use wx.SizerItem directly.
11273 Also, custom classes derived from `wx.PySizer` will probably need to
11274 use the collection of wx.SizerItems held by wx.Sizer when calculating
11275 layout.
11276
11277 :see: `wx.Sizer`, `wx.GBSizerItem`
11278 """
11279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11280 __repr__ = _swig_repr
11281 def __init__(self, *args, **kwargs):
11282 """
11283 __init__(self) -> SizerItem
11284
11285 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11286 size will need to be set before this item can be used in a Sizer.
11287
11288 You will probably never need to create a wx.SizerItem directly as they
11289 are created automatically when the sizer's Add, Insert or Prepend
11290 methods are called.
11291
11292 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11293 """
11294 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11295 __swig_destroy__ = _core_.delete_SizerItem
11296 __del__ = lambda self : None;
11297 def DeleteWindows(*args, **kwargs):
11298 """
11299 DeleteWindows(self)
11300
11301 Destroy the window or the windows in a subsizer, depending on the type
11302 of item.
11303 """
11304 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11305
11306 def DetachSizer(*args, **kwargs):
11307 """
11308 DetachSizer(self)
11309
11310 Enable deleting the SizerItem without destroying the contained sizer.
11311 """
11312 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11313
11314 def GetSize(*args, **kwargs):
11315 """
11316 GetSize(self) -> Size
11317
11318 Get the current size of the item, as set in the last Layout.
11319 """
11320 return _core_.SizerItem_GetSize(*args, **kwargs)
11321
11322 def CalcMin(*args, **kwargs):
11323 """
11324 CalcMin(self) -> Size
11325
11326 Calculates the minimum desired size for the item, including any space
11327 needed by borders.
11328 """
11329 return _core_.SizerItem_CalcMin(*args, **kwargs)
11330
11331 def SetDimension(*args, **kwargs):
11332 """
11333 SetDimension(self, Point pos, Size size)
11334
11335 Set the position and size of the space allocated for this item by the
11336 sizer, and adjust the position and size of the item (window or
11337 subsizer) to be within that space taking alignment and borders into
11338 account.
11339 """
11340 return _core_.SizerItem_SetDimension(*args, **kwargs)
11341
11342 def GetMinSize(*args, **kwargs):
11343 """
11344 GetMinSize(self) -> Size
11345
11346 Get the minimum size needed for the item.
11347 """
11348 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11349
11350 def GetMinSizeWithBorder(*args, **kwargs):
11351 """
11352 GetMinSizeWithBorder(self) -> Size
11353
11354 Get the minimum size needed for the item with space for the borders
11355 added, if needed.
11356 """
11357 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11358
11359 def SetInitSize(*args, **kwargs):
11360 """SetInitSize(self, int x, int y)"""
11361 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11362
11363 def SetRatioWH(*args, **kwargs):
11364 """
11365 SetRatioWH(self, int width, int height)
11366
11367 Set the ratio item attribute.
11368 """
11369 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11370
11371 def SetRatioSize(*args, **kwargs):
11372 """
11373 SetRatioSize(self, Size size)
11374
11375 Set the ratio item attribute.
11376 """
11377 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11378
11379 def SetRatio(*args, **kwargs):
11380 """
11381 SetRatio(self, float ratio)
11382
11383 Set the ratio item attribute.
11384 """
11385 return _core_.SizerItem_SetRatio(*args, **kwargs)
11386
11387 def GetRatio(*args, **kwargs):
11388 """
11389 GetRatio(self) -> float
11390
11391 Set the ratio item attribute.
11392 """
11393 return _core_.SizerItem_GetRatio(*args, **kwargs)
11394
11395 def GetRect(*args, **kwargs):
11396 """
11397 GetRect(self) -> Rect
11398
11399 Returns the rectangle that the sizer item should occupy
11400 """
11401 return _core_.SizerItem_GetRect(*args, **kwargs)
11402
11403 def IsWindow(*args, **kwargs):
11404 """
11405 IsWindow(self) -> bool
11406
11407 Is this sizer item a window?
11408 """
11409 return _core_.SizerItem_IsWindow(*args, **kwargs)
11410
11411 def IsSizer(*args, **kwargs):
11412 """
11413 IsSizer(self) -> bool
11414
11415 Is this sizer item a subsizer?
11416 """
11417 return _core_.SizerItem_IsSizer(*args, **kwargs)
11418
11419 def IsSpacer(*args, **kwargs):
11420 """
11421 IsSpacer(self) -> bool
11422
11423 Is this sizer item a spacer?
11424 """
11425 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11426
11427 def SetProportion(*args, **kwargs):
11428 """
11429 SetProportion(self, int proportion)
11430
11431 Set the proportion value for this item.
11432 """
11433 return _core_.SizerItem_SetProportion(*args, **kwargs)
11434
11435 def GetProportion(*args, **kwargs):
11436 """
11437 GetProportion(self) -> int
11438
11439 Get the proportion value for this item.
11440 """
11441 return _core_.SizerItem_GetProportion(*args, **kwargs)
11442
11443 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11444 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11445 def SetFlag(*args, **kwargs):
11446 """
11447 SetFlag(self, int flag)
11448
11449 Set the flag value for this item.
11450 """
11451 return _core_.SizerItem_SetFlag(*args, **kwargs)
11452
11453 def GetFlag(*args, **kwargs):
11454 """
11455 GetFlag(self) -> int
11456
11457 Get the flag value for this item.
11458 """
11459 return _core_.SizerItem_GetFlag(*args, **kwargs)
11460
11461 def SetBorder(*args, **kwargs):
11462 """
11463 SetBorder(self, int border)
11464
11465 Set the border value for this item.
11466 """
11467 return _core_.SizerItem_SetBorder(*args, **kwargs)
11468
11469 def GetBorder(*args, **kwargs):
11470 """
11471 GetBorder(self) -> int
11472
11473 Get the border value for this item.
11474 """
11475 return _core_.SizerItem_GetBorder(*args, **kwargs)
11476
11477 def GetWindow(*args, **kwargs):
11478 """
11479 GetWindow(self) -> Window
11480
11481 Get the window (if any) that is managed by this sizer item.
11482 """
11483 return _core_.SizerItem_GetWindow(*args, **kwargs)
11484
11485 def SetWindow(*args, **kwargs):
11486 """
11487 SetWindow(self, Window window)
11488
11489 Set the window to be managed by this sizer item.
11490 """
11491 return _core_.SizerItem_SetWindow(*args, **kwargs)
11492
11493 def GetSizer(*args, **kwargs):
11494 """
11495 GetSizer(self) -> Sizer
11496
11497 Get the subsizer (if any) that is managed by this sizer item.
11498 """
11499 return _core_.SizerItem_GetSizer(*args, **kwargs)
11500
11501 def SetSizer(*args, **kwargs):
11502 """
11503 SetSizer(self, Sizer sizer)
11504
11505 Set the subsizer to be managed by this sizer item.
11506 """
11507 return _core_.SizerItem_SetSizer(*args, **kwargs)
11508
11509 def GetSpacer(*args, **kwargs):
11510 """
11511 GetSpacer(self) -> Size
11512
11513 Get the size of the spacer managed by this sizer item.
11514 """
11515 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11516
11517 def SetSpacer(*args, **kwargs):
11518 """
11519 SetSpacer(self, Size size)
11520
11521 Set the size of the spacer to be managed by this sizer item.
11522 """
11523 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11524
11525 def Show(*args, **kwargs):
11526 """
11527 Show(self, bool show)
11528
11529 Set the show item attribute, which sizers use to determine if the item
11530 is to be made part of the layout or not. If the item is tracking a
11531 window then it is shown or hidden as needed.
11532 """
11533 return _core_.SizerItem_Show(*args, **kwargs)
11534
11535 def IsShown(*args, **kwargs):
11536 """
11537 IsShown(self) -> bool
11538
11539 Is the item to be shown in the layout?
11540 """
11541 return _core_.SizerItem_IsShown(*args, **kwargs)
11542
11543 def GetPosition(*args, **kwargs):
11544 """
11545 GetPosition(self) -> Point
11546
11547 Returns the current position of the item, as set in the last Layout.
11548 """
11549 return _core_.SizerItem_GetPosition(*args, **kwargs)
11550
11551 def GetUserData(*args, **kwargs):
11552 """
11553 GetUserData(self) -> PyObject
11554
11555 Returns the userData associated with this sizer item, or None if there
11556 isn't any.
11557 """
11558 return _core_.SizerItem_GetUserData(*args, **kwargs)
11559
11560 def SetUserData(*args, **kwargs):
11561 """
11562 SetUserData(self, PyObject userData)
11563
11564 Associate a Python object with this sizer item.
11565 """
11566 return _core_.SizerItem_SetUserData(*args, **kwargs)
11567
11568 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11569 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11570 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11571 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11572 Position = property(GetPosition,doc="See `GetPosition`")
11573 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11574 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11575 Rect = property(GetRect,doc="See `GetRect`")
11576 Size = property(GetSize,doc="See `GetSize`")
11577 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11578 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11579 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11580 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
11581 _core_.SizerItem_swigregister(SizerItem)
11582
11583 def SizerItemWindow(*args, **kwargs):
11584 """
11585 SizerItemWindow(Window window, int proportion, int flag, int border,
11586 PyObject userData=None) -> SizerItem
11587
11588 Constructs a `wx.SizerItem` for tracking a window.
11589 """
11590 val = _core_.new_SizerItemWindow(*args, **kwargs)
11591 return val
11592
11593 def SizerItemSpacer(*args, **kwargs):
11594 """
11595 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11596 PyObject userData=None) -> SizerItem
11597
11598 Constructs a `wx.SizerItem` for tracking a spacer.
11599 """
11600 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11601 return val
11602
11603 def SizerItemSizer(*args, **kwargs):
11604 """
11605 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11606 PyObject userData=None) -> SizerItem
11607
11608 Constructs a `wx.SizerItem` for tracking a subsizer
11609 """
11610 val = _core_.new_SizerItemSizer(*args, **kwargs)
11611 return val
11612
11613 class Sizer(Object):
11614 """
11615 wx.Sizer is the abstract base class used for laying out subwindows in
11616 a window. You cannot use wx.Sizer directly; instead, you will have to
11617 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11618 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11619 `wx.GridBagSizer`.
11620
11621 The concept implemented by sizers in wxWidgets is closely related to
11622 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11623 toolkit or the Qt toolkit. It is based upon the idea of the individual
11624 subwindows reporting their minimal required size and their ability to
11625 get stretched if the size of the parent window has changed. This will
11626 most often mean that the programmer does not set the original size of
11627 a dialog in the beginning, rather the dialog will assigned a sizer and
11628 this sizer will be queried about the recommended size. The sizer in
11629 turn will query its children, which can be normal windows or contorls,
11630 empty space or other sizers, so that a hierarchy of sizers can be
11631 constructed. Note that wxSizer does not derive from wxWindow and thus
11632 do not interfere with tab ordering and requires very little resources
11633 compared to a real window on screen.
11634
11635 What makes sizers so well fitted for use in wxWidgets is the fact that
11636 every control reports its own minimal size and the algorithm can
11637 handle differences in font sizes or different window (dialog item)
11638 sizes on different platforms without problems. If for example the
11639 standard font as well as the overall design of Mac widgets requires
11640 more space than on Windows, then the initial size of a dialog using a
11641 sizer will automatically be bigger on Mac than on Windows.
11642 """
11643 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11644 def __init__(self): raise AttributeError, "No constructor defined"
11645 __repr__ = _swig_repr
11646 __swig_destroy__ = _core_.delete_Sizer
11647 __del__ = lambda self : None;
11648 def _setOORInfo(*args, **kwargs):
11649 """_setOORInfo(self, PyObject _self)"""
11650 return _core_.Sizer__setOORInfo(*args, **kwargs)
11651
11652 def Add(*args, **kwargs):
11653 """
11654 Add(self, item, int proportion=0, int flag=0, int border=0,
11655 PyObject userData=None) -> wx.SizerItem
11656
11657 Appends a child item to the sizer.
11658 """
11659 return _core_.Sizer_Add(*args, **kwargs)
11660
11661 def Insert(*args, **kwargs):
11662 """
11663 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11664 PyObject userData=None) -> wx.SizerItem
11665
11666 Inserts a new item into the list of items managed by this sizer before
11667 the item at index *before*. See `Add` for a description of the parameters.
11668 """
11669 return _core_.Sizer_Insert(*args, **kwargs)
11670
11671 def Prepend(*args, **kwargs):
11672 """
11673 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11674 PyObject userData=None) -> wx.SizerItem
11675
11676 Adds a new item to the begining of the list of sizer items managed by
11677 this sizer. See `Add` for a description of the parameters.
11678 """
11679 return _core_.Sizer_Prepend(*args, **kwargs)
11680
11681 def Remove(*args, **kwargs):
11682 """
11683 Remove(self, item) -> bool
11684
11685 Removes an item from the sizer and destroys it. This method does not
11686 cause any layout or resizing to take place, call `Layout` to update
11687 the layout on screen after removing a child from the sizer. The
11688 *item* parameter can be either a window, a sizer, or the zero-based
11689 index of an item to remove. Returns True if the child item was found
11690 and removed.
11691 """
11692 return _core_.Sizer_Remove(*args, **kwargs)
11693
11694 def Detach(*args, **kwargs):
11695 """
11696 Detach(self, item) -> bool
11697
11698 Detaches an item from the sizer without destroying it. This method
11699 does not cause any layout or resizing to take place, call `Layout` to
11700 do so. The *item* parameter can be either a window, a sizer, or the
11701 zero-based index of the item to be detached. Returns True if the child item
11702 was found and detached.
11703 """
11704 return _core_.Sizer_Detach(*args, **kwargs)
11705
11706 def GetItem(*args, **kwargs):
11707 """
11708 GetItem(self, item) -> wx.SizerItem
11709
11710 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11711 parameter can be either a window, a sizer, or the zero-based index of
11712 the item to be found.
11713 """
11714 return _core_.Sizer_GetItem(*args, **kwargs)
11715
11716 def _SetItemMinSize(*args, **kwargs):
11717 """_SetItemMinSize(self, PyObject item, Size size)"""
11718 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11719
11720 def _ReplaceWin(*args, **kwargs):
11721 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11722 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11723
11724 def _ReplaceSizer(*args, **kwargs):
11725 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11726 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11727
11728 def _ReplaceItem(*args, **kwargs):
11729 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11730 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11731
11732 def Replace(self, olditem, item, recursive=False):
11733 """
11734 Detaches the given ``olditem`` from the sizer and replaces it with
11735 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11736 detached child is destroyed only if it is not a window, (because
11737 windows are owned by their parent, not the sizer.) The
11738 ``recursive`` parameter can be used to search for the given
11739 element recursivly in subsizers.
11740
11741 This method does not cause any layout or resizing to take place,
11742 call `Layout` to do so.
11743
11744 Returns ``True`` if the child item was found and removed.
11745 """
11746 if isinstance(olditem, wx.Window):
11747 return self._ReplaceWin(olditem, item, recursive)
11748 elif isinstnace(olditem, wx.Sizer):
11749 return self._ReplaceSizer(olditem, item, recursive)
11750 elif isinstnace(olditem, int):
11751 return self._ReplaceItem(olditem, item)
11752 else:
11753 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11754
11755 def SetContainingWindow(*args, **kwargs):
11756 """
11757 SetContainingWindow(self, Window window)
11758
11759 Set (or unset) the window this sizer is used in.
11760 """
11761 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11762
11763 def GetContainingWindow(*args, **kwargs):
11764 """
11765 GetContainingWindow(self) -> Window
11766
11767 Get the window this sizer is used in.
11768 """
11769 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11770
11771 def SetItemMinSize(self, item, *args):
11772 """
11773 SetItemMinSize(self, item, Size size)
11774
11775 Sets the minimum size that will be allocated for an item in the sizer.
11776 The *item* parameter can be either a window, a sizer, or the
11777 zero-based index of the item. If a window or sizer is given then it
11778 will be searched for recursivly in subsizers if neccessary.
11779 """
11780 if len(args) == 2:
11781 # for backward compatibility accept separate width,height args too
11782 return self._SetItemMinSize(item, args)
11783 else:
11784 return self._SetItemMinSize(item, args[0])
11785
11786 def AddItem(*args, **kwargs):
11787 """
11788 AddItem(self, SizerItem item)
11789
11790 Adds a `wx.SizerItem` to the sizer.
11791 """
11792 return _core_.Sizer_AddItem(*args, **kwargs)
11793
11794 def InsertItem(*args, **kwargs):
11795 """
11796 InsertItem(self, int index, SizerItem item)
11797
11798 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11799 """
11800 return _core_.Sizer_InsertItem(*args, **kwargs)
11801
11802 def PrependItem(*args, **kwargs):
11803 """
11804 PrependItem(self, SizerItem item)
11805
11806 Prepends a `wx.SizerItem` to the sizer.
11807 """
11808 return _core_.Sizer_PrependItem(*args, **kwargs)
11809
11810 def AddMany(self, items):
11811 """
11812 AddMany is a convenience method for adding several items
11813 to a sizer at one time. Simply pass it a list of tuples,
11814 where each tuple consists of the parameters that you
11815 would normally pass to the `Add` method.
11816 """
11817 for item in items:
11818 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11819 item = (item, )
11820 self.Add(*item)
11821
11822 def AddSpacer(self, *args, **kw):
11823 """AddSpacer(int size) --> SizerItem
11824
11825 Add a spacer that is (size,size) pixels.
11826 """
11827 if args and type(args[0]) == int:
11828 return self.Add( (args[0],args[0] ), 0)
11829 else: # otherwise stay compatible with old AddSpacer
11830 return self.Add(*args, **kw)
11831 def PrependSpacer(self, *args, **kw):
11832 """PrependSpacer(int size) --> SizerItem
11833
11834 Prepend a spacer that is (size, size) pixels."""
11835 if args and type(args[0]) == int:
11836 return self.Prepend( (args[0],args[0] ), 0)
11837 else: # otherwise stay compatible with old PrependSpacer
11838 return self.Prepend(*args, **kw)
11839 def InsertSpacer(self, index, *args, **kw):
11840 """InsertSpacer(int index, int size) --> SizerItem
11841
11842 Insert a spacer at position index that is (size, size) pixels."""
11843 if args and type(args[0]) == int:
11844 return self.Insert( index, (args[0],args[0] ), 0)
11845 else: # otherwise stay compatible with old InsertSpacer
11846 return self.Insert(index, *args, **kw)
11847
11848
11849 def AddStretchSpacer(self, prop=1):
11850 """AddStretchSpacer(int prop=1) --> SizerItem
11851
11852 Add a stretchable spacer."""
11853 return self.Add((0,0), prop)
11854 def PrependStretchSpacer(self, prop=1):
11855 """PrependStretchSpacer(int prop=1) --> SizerItem
11856
11857 Prepend a stretchable spacer."""
11858 return self.Prepend((0,0), prop)
11859 def InsertStretchSpacer(self, index, prop=1):
11860 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11861
11862 Insert a stretchable spacer."""
11863 return self.Insert(index, (0,0), prop)
11864
11865
11866 # for backwards compatibility only, please do not use in new code
11867 def AddWindow(self, *args, **kw):
11868 """Compatibility alias for `Add`."""
11869 return self.Add(*args, **kw)
11870 def AddSizer(self, *args, **kw):
11871 """Compatibility alias for `Add`."""
11872 return self.Add(*args, **kw)
11873
11874 def PrependWindow(self, *args, **kw):
11875 """Compatibility alias for `Prepend`."""
11876 return self.Prepend(*args, **kw)
11877 def PrependSizer(self, *args, **kw):
11878 """Compatibility alias for `Prepend`."""
11879 return self.Prepend(*args, **kw)
11880
11881 def InsertWindow(self, *args, **kw):
11882 """Compatibility alias for `Insert`."""
11883 return self.Insert(*args, **kw)
11884 def InsertSizer(self, *args, **kw):
11885 """Compatibility alias for `Insert`."""
11886 return self.Insert(*args, **kw)
11887
11888 def RemoveWindow(self, *args, **kw):
11889 """Compatibility alias for `Remove`."""
11890 return self.Remove(*args, **kw)
11891 def RemoveSizer(self, *args, **kw):
11892 """Compatibility alias for `Remove`."""
11893 return self.Remove(*args, **kw)
11894 def RemovePos(self, *args, **kw):
11895 """Compatibility alias for `Remove`."""
11896 return self.Remove(*args, **kw)
11897
11898
11899 def SetDimension(*args, **kwargs):
11900 """
11901 SetDimension(self, int x, int y, int width, int height)
11902
11903 Call this to force the sizer to take the given dimension and thus
11904 force the items owned by the sizer to resize themselves according to
11905 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11906 methods.
11907 """
11908 return _core_.Sizer_SetDimension(*args, **kwargs)
11909
11910 def SetMinSize(*args, **kwargs):
11911 """
11912 SetMinSize(self, Size size)
11913
11914 Call this to give the sizer a minimal size. Normally, the sizer will
11915 calculate its minimal size based purely on how much space its children
11916 need. After calling this method `GetMinSize` will return either the
11917 minimal size as requested by its children or the minimal size set
11918 here, depending on which is bigger.
11919 """
11920 return _core_.Sizer_SetMinSize(*args, **kwargs)
11921
11922 def GetSize(*args, **kwargs):
11923 """
11924 GetSize(self) -> Size
11925
11926 Returns the current size of the space managed by the sizer.
11927 """
11928 return _core_.Sizer_GetSize(*args, **kwargs)
11929
11930 def GetPosition(*args, **kwargs):
11931 """
11932 GetPosition(self) -> Point
11933
11934 Returns the current position of the sizer's managed space.
11935 """
11936 return _core_.Sizer_GetPosition(*args, **kwargs)
11937
11938 def GetMinSize(*args, **kwargs):
11939 """
11940 GetMinSize(self) -> Size
11941
11942 Returns the minimal size of the sizer. This is either the combined
11943 minimal size of all the children and their borders or the minimal size
11944 set by SetMinSize, depending on which is bigger.
11945 """
11946 return _core_.Sizer_GetMinSize(*args, **kwargs)
11947
11948 def GetSizeTuple(self):
11949 return self.GetSize().Get()
11950 def GetPositionTuple(self):
11951 return self.GetPosition().Get()
11952 def GetMinSizeTuple(self):
11953 return self.GetMinSize().Get()
11954
11955 def RecalcSizes(*args, **kwargs):
11956 """
11957 RecalcSizes(self)
11958
11959 Using the sizes calculated by `CalcMin` reposition and resize all the
11960 items managed by this sizer. You should not need to call this directly as
11961 it is called by `Layout`.
11962 """
11963 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11964
11965 def CalcMin(*args, **kwargs):
11966 """
11967 CalcMin(self) -> Size
11968
11969 This method is where the sizer will do the actual calculation of its
11970 children's minimal sizes. You should not need to call this directly as
11971 it is called by `Layout`.
11972 """
11973 return _core_.Sizer_CalcMin(*args, **kwargs)
11974
11975 def Layout(*args, **kwargs):
11976 """
11977 Layout(self)
11978
11979 This method will force the recalculation and layout of the items
11980 controlled by the sizer using the current space allocated to the
11981 sizer. Normally this is called automatically from the owning window's
11982 EVT_SIZE handler, but it is also useful to call it from user code when
11983 one of the items in a sizer change size, or items are added or
11984 removed.
11985 """
11986 return _core_.Sizer_Layout(*args, **kwargs)
11987
11988 def Fit(*args, **kwargs):
11989 """
11990 Fit(self, Window window) -> Size
11991
11992 Tell the sizer to resize the *window* to match the sizer's minimal
11993 size. This is commonly done in the constructor of the window itself in
11994 order to set its initial size to match the needs of the children as
11995 determined by the sizer. Returns the new size.
11996
11997 For a top level window this is the total window size, not the client size.
11998 """
11999 return _core_.Sizer_Fit(*args, **kwargs)
12000
12001 def FitInside(*args, **kwargs):
12002 """
12003 FitInside(self, Window window)
12004
12005 Tell the sizer to resize the *virtual size* of the *window* to match the
12006 sizer's minimal size. This will not alter the on screen size of the
12007 window, but may cause the addition/removal/alteration of scrollbars
12008 required to view the virtual area in windows which manage it.
12009
12010 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12011
12012 """
12013 return _core_.Sizer_FitInside(*args, **kwargs)
12014
12015 def SetSizeHints(*args, **kwargs):
12016 """
12017 SetSizeHints(self, Window window)
12018
12019 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12020 match the sizer's minimal size. This is commonly done in the
12021 constructor of the window itself if the window is resizable (as are
12022 many dialogs under Unix and frames on probably all platforms) in order
12023 to prevent the window from being sized smaller than the minimal size
12024 required by the sizer.
12025 """
12026 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12027
12028 def SetVirtualSizeHints(*args, **kwargs):
12029 """
12030 SetVirtualSizeHints(self, Window window)
12031
12032 Tell the sizer to set the minimal size of the window virtual area to
12033 match the sizer's minimal size. For windows with managed scrollbars
12034 this will set them appropriately.
12035
12036 :see: `wx.ScrolledWindow.SetScrollbars`
12037
12038 """
12039 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12040
12041 def Clear(*args, **kwargs):
12042 """
12043 Clear(self, bool deleteWindows=False)
12044
12045 Clear all items from the sizer, optionally destroying the window items
12046 as well.
12047 """
12048 return _core_.Sizer_Clear(*args, **kwargs)
12049
12050 def DeleteWindows(*args, **kwargs):
12051 """
12052 DeleteWindows(self)
12053
12054 Destroy all windows managed by the sizer.
12055 """
12056 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12057
12058 def GetChildren(*args, **kwargs):
12059 """
12060 GetChildren(self) -> list
12061
12062 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12063 """
12064 return _core_.Sizer_GetChildren(*args, **kwargs)
12065
12066 def Show(*args, **kwargs):
12067 """
12068 Show(self, item, bool show=True, bool recursive=false) -> bool
12069
12070 Shows or hides an item managed by the sizer. To make a sizer item
12071 disappear or reappear, use Show followed by `Layout`. The *item*
12072 parameter can be either a window, a sizer, or the zero-based index of
12073 the item. Use the recursive parameter to show or hide an item in a
12074 subsizer. Returns True if the item was found.
12075 """
12076 return _core_.Sizer_Show(*args, **kwargs)
12077
12078 def IsShown(*args, **kwargs):
12079 """
12080 IsShown(self, item)
12081
12082 Determines if the item is currently shown. To make a sizer
12083 item disappear or reappear, use Show followed by `Layout`. The *item*
12084 parameter can be either a window, a sizer, or the zero-based index of
12085 the item.
12086 """
12087 return _core_.Sizer_IsShown(*args, **kwargs)
12088
12089 def Hide(self, item, recursive=False):
12090 """
12091 A convenience method for `Show` (item, False, recursive).
12092 """
12093 return self.Show(item, False, recursive)
12094
12095 def ShowItems(*args, **kwargs):
12096 """
12097 ShowItems(self, bool show)
12098
12099 Recursively call `wx.SizerItem.Show` on all sizer items.
12100 """
12101 return _core_.Sizer_ShowItems(*args, **kwargs)
12102
12103 Children = property(GetChildren,doc="See `GetChildren`")
12104 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12105 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12106 Position = property(GetPosition,doc="See `GetPosition`")
12107 Size = property(GetSize,doc="See `GetSize`")
12108 _core_.Sizer_swigregister(Sizer)
12109
12110 class PySizer(Sizer):
12111 """
12112 wx.PySizer is a special version of `wx.Sizer` that has been
12113 instrumented to allow the C++ virtual methods to be overloaded in
12114 Python derived classes. You would derive from this class if you are
12115 wanting to implement a custom sizer in Python code. Simply implement
12116 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12117 For example::
12118
12119 class MySizer(wx.PySizer):
12120 def __init__(self):
12121 wx.PySizer.__init__(self)
12122
12123 def CalcMin(self):
12124 for item in self.GetChildren():
12125 # calculate the total minimum width and height needed
12126 # by all items in the sizer according to this sizer's
12127 # layout algorithm.
12128 ...
12129 return wx.Size(width, height)
12130
12131 def RecalcSizes(self):
12132 # find the space allotted to this sizer
12133 pos = self.GetPosition()
12134 size = self.GetSize()
12135 for item in self.GetChildren():
12136 # Recalculate (if necessary) the position and size of
12137 # each item and then call item.SetDimension to do the
12138 # actual positioning and sizing of the items within the
12139 # space alloted to this sizer.
12140 ...
12141 item.SetDimension(itemPos, itemSize)
12142
12143
12144 When `Layout` is called it first calls `CalcMin` followed by
12145 `RecalcSizes` so you can optimize a bit by saving the results of
12146 `CalcMin` and reusing them in `RecalcSizes`.
12147
12148 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12149
12150
12151 """
12152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12153 __repr__ = _swig_repr
12154 def __init__(self, *args, **kwargs):
12155 """
12156 __init__(self) -> PySizer
12157
12158 Creates a wx.PySizer. Must be called from the __init__ in the derived
12159 class.
12160 """
12161 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
12162 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12163
12164 def _setCallbackInfo(*args, **kwargs):
12165 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12166 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12167
12168 _core_.PySizer_swigregister(PySizer)
12169
12170 #---------------------------------------------------------------------------
12171
12172 class BoxSizer(Sizer):
12173 """
12174 The basic idea behind a box sizer is that windows will most often be
12175 laid out in rather simple basic geometry, typically in a row or a
12176 column or nested hierarchies of either. A wx.BoxSizer will lay out
12177 its items in a simple row or column, depending on the orientation
12178 parameter passed to the constructor.
12179 """
12180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12181 __repr__ = _swig_repr
12182 def __init__(self, *args, **kwargs):
12183 """
12184 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12185
12186 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12187 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12188 sizer.
12189 """
12190 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12191 self._setOORInfo(self)
12192
12193 def GetOrientation(*args, **kwargs):
12194 """
12195 GetOrientation(self) -> int
12196
12197 Returns the current orientation of the sizer.
12198 """
12199 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12200
12201 def SetOrientation(*args, **kwargs):
12202 """
12203 SetOrientation(self, int orient)
12204
12205 Resets the orientation of the sizer.
12206 """
12207 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12208
12209 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12210 _core_.BoxSizer_swigregister(BoxSizer)
12211
12212 #---------------------------------------------------------------------------
12213
12214 class StaticBoxSizer(BoxSizer):
12215 """
12216 wx.StaticBoxSizer derives from and functions identically to the
12217 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12218 manages. Note that this static box must be created separately and
12219 passed to the sizer constructor.
12220 """
12221 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12222 __repr__ = _swig_repr
12223 def __init__(self, *args, **kwargs):
12224 """
12225 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12226
12227 Constructor. It takes an associated static box and the orientation
12228 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12229 ``wx.HORIZONTAL``.
12230 """
12231 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12232 self._setOORInfo(self)
12233
12234 def GetStaticBox(*args, **kwargs):
12235 """
12236 GetStaticBox(self) -> StaticBox
12237
12238 Returns the static box associated with this sizer.
12239 """
12240 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12241
12242 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
12243 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12244
12245 #---------------------------------------------------------------------------
12246
12247 class GridSizer(Sizer):
12248 """
12249 A grid sizer is a sizer which lays out its children in a
12250 two-dimensional table with all cells having the same size. In other
12251 words, the width of each cell within the grid is the width of the
12252 widest item added to the sizer and the height of each grid cell is the
12253 height of the tallest item. An optional vertical and/or horizontal
12254 gap between items can also be specified (in pixels.)
12255
12256 Items are placed in the cells of the grid in the order they are added,
12257 in row-major order. In other words, the first row is filled first,
12258 then the second, and so on until all items have been added. (If
12259 neccessary, additional rows will be added as items are added.) If you
12260 need to have greater control over the cells that items are placed in
12261 then use the `wx.GridBagSizer`.
12262
12263 """
12264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12265 __repr__ = _swig_repr
12266 def __init__(self, *args, **kwargs):
12267 """
12268 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12269
12270 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12271 of columns and rows in the sizer - if either of the parameters is
12272 zero, it will be calculated to from the total number of children in
12273 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12274 define extra space between all children.
12275 """
12276 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
12277 self._setOORInfo(self)
12278
12279 def SetCols(*args, **kwargs):
12280 """
12281 SetCols(self, int cols)
12282
12283 Sets the number of columns in the sizer.
12284 """
12285 return _core_.GridSizer_SetCols(*args, **kwargs)
12286
12287 def SetRows(*args, **kwargs):
12288 """
12289 SetRows(self, int rows)
12290
12291 Sets the number of rows in the sizer.
12292 """
12293 return _core_.GridSizer_SetRows(*args, **kwargs)
12294
12295 def SetVGap(*args, **kwargs):
12296 """
12297 SetVGap(self, int gap)
12298
12299 Sets the vertical gap (in pixels) between the cells in the sizer.
12300 """
12301 return _core_.GridSizer_SetVGap(*args, **kwargs)
12302
12303 def SetHGap(*args, **kwargs):
12304 """
12305 SetHGap(self, int gap)
12306
12307 Sets the horizontal gap (in pixels) between cells in the sizer
12308 """
12309 return _core_.GridSizer_SetHGap(*args, **kwargs)
12310
12311 def GetCols(*args, **kwargs):
12312 """
12313 GetCols(self) -> int
12314
12315 Returns the number of columns in the sizer.
12316 """
12317 return _core_.GridSizer_GetCols(*args, **kwargs)
12318
12319 def GetRows(*args, **kwargs):
12320 """
12321 GetRows(self) -> int
12322
12323 Returns the number of rows in the sizer.
12324 """
12325 return _core_.GridSizer_GetRows(*args, **kwargs)
12326
12327 def GetVGap(*args, **kwargs):
12328 """
12329 GetVGap(self) -> int
12330
12331 Returns the vertical gap (in pixels) between the cells in the sizer.
12332 """
12333 return _core_.GridSizer_GetVGap(*args, **kwargs)
12334
12335 def GetHGap(*args, **kwargs):
12336 """
12337 GetHGap(self) -> int
12338
12339 Returns the horizontal gap (in pixels) between cells in the sizer.
12340 """
12341 return _core_.GridSizer_GetHGap(*args, **kwargs)
12342
12343 def CalcRowsCols(self):
12344 """
12345 CalcRowsCols() -> (rows, cols)
12346
12347 Calculates how many rows and columns will be in the sizer based
12348 on the current number of items and also the rows, cols specified
12349 in the constructor.
12350 """
12351 nitems = len(self.GetChildren())
12352 rows = self.GetRows()
12353 cols = self.GetCols()
12354 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12355 if cols != 0:
12356 rows = (nitems + cols - 1) / cols
12357 elif rows != 0:
12358 cols = (nitems + rows - 1) / rows
12359 return (rows, cols)
12360
12361 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12362 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12363 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12364 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
12365 _core_.GridSizer_swigregister(GridSizer)
12366
12367 #---------------------------------------------------------------------------
12368
12369 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12370 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12371 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12372 class FlexGridSizer(GridSizer):
12373 """
12374 A flex grid sizer is a sizer which lays out its children in a
12375 two-dimensional table with all table cells in one row having the same
12376 height and all cells in one column having the same width, but all
12377 rows or all columns are not necessarily the same height or width as in
12378 the `wx.GridSizer`.
12379
12380 wx.FlexGridSizer can also size items equally in one direction but
12381 unequally ("flexibly") in the other. If the sizer is only flexible
12382 in one direction (this can be changed using `SetFlexibleDirection`), it
12383 needs to be decided how the sizer should grow in the other ("non
12384 flexible") direction in order to fill the available space. The
12385 `SetNonFlexibleGrowMode` method serves this purpose.
12386
12387
12388 """
12389 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12390 __repr__ = _swig_repr
12391 def __init__(self, *args, **kwargs):
12392 """
12393 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12394
12395 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12396 number of columns and rows in the sizer - if either of the parameters
12397 is zero, it will be calculated to from the total number of children in
12398 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12399 define extra space between all children.
12400 """
12401 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
12402 self._setOORInfo(self)
12403
12404 def AddGrowableRow(*args, **kwargs):
12405 """
12406 AddGrowableRow(self, size_t idx, int proportion=0)
12407
12408 Specifies that row *idx* (starting from zero) should be grown if there
12409 is extra space available to the sizer.
12410
12411 The *proportion* parameter has the same meaning as the stretch factor
12412 for the box sizers except that if all proportions are 0, then all
12413 columns are resized equally (instead of not being resized at all).
12414 """
12415 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12416
12417 def RemoveGrowableRow(*args, **kwargs):
12418 """
12419 RemoveGrowableRow(self, size_t idx)
12420
12421 Specifies that row *idx* is no longer growable.
12422 """
12423 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12424
12425 def AddGrowableCol(*args, **kwargs):
12426 """
12427 AddGrowableCol(self, size_t idx, int proportion=0)
12428
12429 Specifies that column *idx* (starting from zero) should be grown if
12430 there is extra space available to the sizer.
12431
12432 The *proportion* parameter has the same meaning as the stretch factor
12433 for the box sizers except that if all proportions are 0, then all
12434 columns are resized equally (instead of not being resized at all).
12435 """
12436 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12437
12438 def RemoveGrowableCol(*args, **kwargs):
12439 """
12440 RemoveGrowableCol(self, size_t idx)
12441
12442 Specifies that column *idx* is no longer growable.
12443 """
12444 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12445
12446 def SetFlexibleDirection(*args, **kwargs):
12447 """
12448 SetFlexibleDirection(self, int direction)
12449
12450 Specifies whether the sizer should flexibly resize its columns, rows,
12451 or both. Argument *direction* can be one of the following values. Any
12452 other value is ignored.
12453
12454 ============== =======================================
12455 wx.VERTICAL Rows are flexibly sized.
12456 wx.HORIZONTAL Columns are flexibly sized.
12457 wx.BOTH Both rows and columns are flexibly sized
12458 (this is the default value).
12459 ============== =======================================
12460
12461 Note that this method does not trigger relayout.
12462
12463 """
12464 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12465
12466 def GetFlexibleDirection(*args, **kwargs):
12467 """
12468 GetFlexibleDirection(self) -> int
12469
12470 Returns a value that specifies whether the sizer
12471 flexibly resizes its columns, rows, or both (default).
12472
12473 :see: `SetFlexibleDirection`
12474 """
12475 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12476
12477 def SetNonFlexibleGrowMode(*args, **kwargs):
12478 """
12479 SetNonFlexibleGrowMode(self, int mode)
12480
12481 Specifies how the sizer should grow in the non-flexible direction if
12482 there is one (so `SetFlexibleDirection` must have been called
12483 previously). Argument *mode* can be one of the following values:
12484
12485 ========================== =================================================
12486 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12487 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12488 `AddGrowableCol` and `AddGrowableRow`. In this
12489 case equal sizing applies to minimum sizes of
12490 columns or rows (this is the default value).
12491 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12492 the non flexible direction, whether they are
12493 growable or not in the flexbile direction.
12494 ========================== =================================================
12495
12496 Note that this method does not trigger relayout.
12497 """
12498 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12499
12500 def GetNonFlexibleGrowMode(*args, **kwargs):
12501 """
12502 GetNonFlexibleGrowMode(self) -> int
12503
12504 Returns the value that specifies how the sizer grows in the
12505 non-flexible direction if there is one.
12506
12507 :see: `SetNonFlexibleGrowMode`
12508 """
12509 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12510
12511 def GetRowHeights(*args, **kwargs):
12512 """
12513 GetRowHeights(self) -> list
12514
12515 Returns a list of integers representing the heights of each of the
12516 rows in the sizer.
12517 """
12518 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12519
12520 def GetColWidths(*args, **kwargs):
12521 """
12522 GetColWidths(self) -> list
12523
12524 Returns a list of integers representing the widths of each of the
12525 columns in the sizer.
12526 """
12527 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12528
12529 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12530 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12531 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12532 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
12533 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12534
12535 class StdDialogButtonSizer(BoxSizer):
12536 """
12537 A special sizer that knows how to order and position standard buttons
12538 in order to conform to the current platform's standards. You simply
12539 need to add each `wx.Button` to the sizer, and be sure to create the
12540 buttons using the standard ID's. Then call `Realize` and the sizer
12541 will take care of the rest.
12542
12543 """
12544 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12545 __repr__ = _swig_repr
12546 def __init__(self, *args, **kwargs):
12547 """__init__(self) -> StdDialogButtonSizer"""
12548 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12549 def AddButton(*args, **kwargs):
12550 """
12551 AddButton(self, wxButton button)
12552
12553 Use this to add the buttons to this sizer. Do not use the `Add`
12554 method in the base class.
12555 """
12556 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12557
12558 def Realize(*args, **kwargs):
12559 """
12560 Realize(self)
12561
12562 This funciton needs to be called after all the buttons have been added
12563 to the sizer. It will reorder them and position them in a platform
12564 specifc manner.
12565 """
12566 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12567
12568 def SetAffirmativeButton(*args, **kwargs):
12569 """SetAffirmativeButton(self, wxButton button)"""
12570 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12571
12572 def SetNegativeButton(*args, **kwargs):
12573 """SetNegativeButton(self, wxButton button)"""
12574 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12575
12576 def SetCancelButton(*args, **kwargs):
12577 """SetCancelButton(self, wxButton button)"""
12578 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12579
12580 def GetAffirmativeButton(*args, **kwargs):
12581 """GetAffirmativeButton(self) -> wxButton"""
12582 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12583
12584 def GetApplyButton(*args, **kwargs):
12585 """GetApplyButton(self) -> wxButton"""
12586 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12587
12588 def GetNegativeButton(*args, **kwargs):
12589 """GetNegativeButton(self) -> wxButton"""
12590 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12591
12592 def GetCancelButton(*args, **kwargs):
12593 """GetCancelButton(self) -> wxButton"""
12594 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12595
12596 def GetHelpButton(*args, **kwargs):
12597 """GetHelpButton(self) -> wxButton"""
12598 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12599
12600 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12601 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12602 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12603 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12604 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
12605 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12606
12607 #---------------------------------------------------------------------------
12608
12609 class GBPosition(object):
12610 """
12611 This class represents the position of an item in a virtual grid of
12612 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12613 typemaps that will automatically convert from a 2-element sequence of
12614 integers to a wx.GBPosition, so you can use the more pythonic
12615 representation of the position nearly transparently in Python code.
12616 """
12617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12618 __repr__ = _swig_repr
12619 def __init__(self, *args, **kwargs):
12620 """
12621 __init__(self, int row=0, int col=0) -> GBPosition
12622
12623 This class represents the position of an item in a virtual grid of
12624 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12625 typemaps that will automatically convert from a 2-element sequence of
12626 integers to a wx.GBPosition, so you can use the more pythonic
12627 representation of the position nearly transparently in Python code.
12628 """
12629 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12630 __swig_destroy__ = _core_.delete_GBPosition
12631 __del__ = lambda self : None;
12632 def GetRow(*args, **kwargs):
12633 """GetRow(self) -> int"""
12634 return _core_.GBPosition_GetRow(*args, **kwargs)
12635
12636 def GetCol(*args, **kwargs):
12637 """GetCol(self) -> int"""
12638 return _core_.GBPosition_GetCol(*args, **kwargs)
12639
12640 def SetRow(*args, **kwargs):
12641 """SetRow(self, int row)"""
12642 return _core_.GBPosition_SetRow(*args, **kwargs)
12643
12644 def SetCol(*args, **kwargs):
12645 """SetCol(self, int col)"""
12646 return _core_.GBPosition_SetCol(*args, **kwargs)
12647
12648 def __eq__(*args, **kwargs):
12649 """
12650 __eq__(self, PyObject other) -> bool
12651
12652 Compare GBPosition for equality.
12653 """
12654 return _core_.GBPosition___eq__(*args, **kwargs)
12655
12656 def __ne__(*args, **kwargs):
12657 """
12658 __ne__(self, PyObject other) -> bool
12659
12660 Compare GBPosition for inequality.
12661 """
12662 return _core_.GBPosition___ne__(*args, **kwargs)
12663
12664 def Set(*args, **kwargs):
12665 """Set(self, int row=0, int col=0)"""
12666 return _core_.GBPosition_Set(*args, **kwargs)
12667
12668 def Get(*args, **kwargs):
12669 """Get(self) -> PyObject"""
12670 return _core_.GBPosition_Get(*args, **kwargs)
12671
12672 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12673 def __str__(self): return str(self.Get())
12674 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12675 def __len__(self): return len(self.Get())
12676 def __getitem__(self, index): return self.Get()[index]
12677 def __setitem__(self, index, val):
12678 if index == 0: self.SetRow(val)
12679 elif index == 1: self.SetCol(val)
12680 else: raise IndexError
12681 def __nonzero__(self): return self.Get() != (0,0)
12682 __safe_for_unpickling__ = True
12683 def __reduce__(self): return (wx.GBPosition, self.Get())
12684
12685 row = property(GetRow, SetRow)
12686 col = property(GetCol, SetCol)
12687
12688 _core_.GBPosition_swigregister(GBPosition)
12689
12690 class GBSpan(object):
12691 """
12692 This class is used to hold the row and column spanning attributes of
12693 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12694 automatically convert from a 2-element sequence of integers to a
12695 wx.GBSpan, so you can use the more pythonic representation of the span
12696 nearly transparently in Python code.
12697
12698 """
12699 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12700 __repr__ = _swig_repr
12701 def __init__(self, *args, **kwargs):
12702 """
12703 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12704
12705 Construct a new wxGBSpan, optionally setting the rowspan and
12706 colspan. The default is (1,1). (Meaning that the item occupies one
12707 cell in each direction.
12708 """
12709 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12710 __swig_destroy__ = _core_.delete_GBSpan
12711 __del__ = lambda self : None;
12712 def GetRowspan(*args, **kwargs):
12713 """GetRowspan(self) -> int"""
12714 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12715
12716 def GetColspan(*args, **kwargs):
12717 """GetColspan(self) -> int"""
12718 return _core_.GBSpan_GetColspan(*args, **kwargs)
12719
12720 def SetRowspan(*args, **kwargs):
12721 """SetRowspan(self, int rowspan)"""
12722 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12723
12724 def SetColspan(*args, **kwargs):
12725 """SetColspan(self, int colspan)"""
12726 return _core_.GBSpan_SetColspan(*args, **kwargs)
12727
12728 def __eq__(*args, **kwargs):
12729 """
12730 __eq__(self, PyObject other) -> bool
12731
12732 Compare wxGBSpan for equality.
12733 """
12734 return _core_.GBSpan___eq__(*args, **kwargs)
12735
12736 def __ne__(*args, **kwargs):
12737 """
12738 __ne__(self, PyObject other) -> bool
12739
12740 Compare GBSpan for inequality.
12741 """
12742 return _core_.GBSpan___ne__(*args, **kwargs)
12743
12744 def Set(*args, **kwargs):
12745 """Set(self, int rowspan=1, int colspan=1)"""
12746 return _core_.GBSpan_Set(*args, **kwargs)
12747
12748 def Get(*args, **kwargs):
12749 """Get(self) -> PyObject"""
12750 return _core_.GBSpan_Get(*args, **kwargs)
12751
12752 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12753 def __str__(self): return str(self.Get())
12754 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12755 def __len__(self): return len(self.Get())
12756 def __getitem__(self, index): return self.Get()[index]
12757 def __setitem__(self, index, val):
12758 if index == 0: self.SetRowspan(val)
12759 elif index == 1: self.SetColspan(val)
12760 else: raise IndexError
12761 def __nonzero__(self): return self.Get() != (0,0)
12762 __safe_for_unpickling__ = True
12763 def __reduce__(self): return (wx.GBSpan, self.Get())
12764
12765 rowspan = property(GetRowspan, SetRowspan)
12766 colspan = property(GetColspan, SetColspan)
12767
12768 _core_.GBSpan_swigregister(GBSpan)
12769
12770 class GBSizerItem(SizerItem):
12771 """
12772 The wx.GBSizerItem class is used to track the additional data about
12773 items in a `wx.GridBagSizer` such as the item's position in the grid
12774 and how many rows or columns it spans.
12775
12776 """
12777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12778 __repr__ = _swig_repr
12779 def __init__(self, *args, **kwargs):
12780 """
12781 __init__(self) -> GBSizerItem
12782
12783 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12784 size will need to be set, as well as a position and span before this
12785 item can be used in a Sizer.
12786
12787 You will probably never need to create a wx.GBSizerItem directly as they
12788 are created automatically when the sizer's Add method is called.
12789 """
12790 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12791 __swig_destroy__ = _core_.delete_GBSizerItem
12792 __del__ = lambda self : None;
12793 def GetPos(*args, **kwargs):
12794 """
12795 GetPos(self) -> GBPosition
12796
12797 Get the grid position of the item
12798 """
12799 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12800
12801 def GetPosTuple(self): return self.GetPos().Get()
12802 def GetSpan(*args, **kwargs):
12803 """
12804 GetSpan(self) -> GBSpan
12805
12806 Get the row and column spanning of the item
12807 """
12808 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12809
12810 def GetSpanTuple(self): return self.GetSpan().Get()
12811 def SetPos(*args, **kwargs):
12812 """
12813 SetPos(self, GBPosition pos) -> bool
12814
12815 If the item is already a member of a sizer then first ensure that
12816 there is no other item that would intersect with this one at the new
12817 position, then set the new position. Returns True if the change is
12818 successful and after the next Layout() the item will be moved.
12819 """
12820 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12821
12822 def SetSpan(*args, **kwargs):
12823 """
12824 SetSpan(self, GBSpan span) -> bool
12825
12826 If the item is already a member of a sizer then first ensure that
12827 there is no other item that would intersect with this one with its new
12828 spanning size, then set the new spanning. Returns True if the change
12829 is successful and after the next Layout() the item will be resized.
12830
12831 """
12832 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12833
12834 def Intersects(*args, **kwargs):
12835 """
12836 Intersects(self, GBSizerItem other) -> bool
12837
12838 Returns True if this item and the other item instersect.
12839 """
12840 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12841
12842 def IntersectsPos(*args, **kwargs):
12843 """
12844 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12845
12846 Returns True if the given pos/span would intersect with this item.
12847 """
12848 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12849
12850 def GetEndPos(*args, **kwargs):
12851 """
12852 GetEndPos(self) -> GBPosition
12853
12854 Get the row and column of the endpoint of this item.
12855 """
12856 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12857
12858 def GetGBSizer(*args, **kwargs):
12859 """
12860 GetGBSizer(self) -> GridBagSizer
12861
12862 Get the sizer this item is a member of.
12863 """
12864 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12865
12866 def SetGBSizer(*args, **kwargs):
12867 """
12868 SetGBSizer(self, GridBagSizer sizer)
12869
12870 Set the sizer this item is a member of.
12871 """
12872 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12873
12874 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12875 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12876 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12877 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
12878 _core_.GBSizerItem_swigregister(GBSizerItem)
12879 DefaultSpan = cvar.DefaultSpan
12880
12881 def GBSizerItemWindow(*args, **kwargs):
12882 """
12883 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12884 int border, PyObject userData=None) -> GBSizerItem
12885
12886 Construct a `wx.GBSizerItem` for a window.
12887 """
12888 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12889 return val
12890
12891 def GBSizerItemSizer(*args, **kwargs):
12892 """
12893 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12894 int border, PyObject userData=None) -> GBSizerItem
12895
12896 Construct a `wx.GBSizerItem` for a sizer
12897 """
12898 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12899 return val
12900
12901 def GBSizerItemSpacer(*args, **kwargs):
12902 """
12903 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12904 int flag, int border, PyObject userData=None) -> GBSizerItem
12905
12906 Construct a `wx.GBSizerItem` for a spacer.
12907 """
12908 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12909 return val
12910
12911 class GridBagSizer(FlexGridSizer):
12912 """
12913 A `wx.Sizer` that can lay out items in a virtual grid like a
12914 `wx.FlexGridSizer` but in this case explicit positioning of the items
12915 is allowed using `wx.GBPosition`, and items can optionally span more
12916 than one row and/or column using `wx.GBSpan`. The total size of the
12917 virtual grid is determined by the largest row and column that items are
12918 positioned at, adjusted for spanning.
12919
12920 """
12921 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12922 __repr__ = _swig_repr
12923 def __init__(self, *args, **kwargs):
12924 """
12925 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12926
12927 Constructor, with optional parameters to specify the gap between the
12928 rows and columns.
12929 """
12930 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12931 self._setOORInfo(self)
12932
12933 def Add(*args, **kwargs):
12934 """
12935 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12936 int border=0, userData=None) -> wx.GBSizerItem
12937
12938 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12939 more than one row or column as specified with *span*. The remaining
12940 args behave similarly to `wx.Sizer.Add`.
12941
12942 Returns True if the item was successfully placed at the given cell
12943 position, False if something was already there.
12944
12945 """
12946 return _core_.GridBagSizer_Add(*args, **kwargs)
12947
12948 def AddItem(*args, **kwargs):
12949 """
12950 Add(self, GBSizerItem item) -> wx.GBSizerItem
12951
12952 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12953 the item was successfully placed at its given cell position, False if
12954 something was already there.
12955 """
12956 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12957
12958 def GetCellSize(*args, **kwargs):
12959 """
12960 GetCellSize(self, int row, int col) -> Size
12961
12962 Get the size of the specified cell, including hgap and
12963 vgap. Only valid after a Layout.
12964 """
12965 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12966
12967 def GetEmptyCellSize(*args, **kwargs):
12968 """
12969 GetEmptyCellSize(self) -> Size
12970
12971 Get the size used for cells in the grid with no item.
12972 """
12973 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12974
12975 def SetEmptyCellSize(*args, **kwargs):
12976 """
12977 SetEmptyCellSize(self, Size sz)
12978
12979 Set the size used for cells in the grid with no item.
12980 """
12981 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12982
12983 def GetItemPosition(*args):
12984 """
12985 GetItemPosition(self, item) -> GBPosition
12986
12987 Get the grid position of the specified *item* where *item* is either a
12988 window or subsizer that is a member of this sizer, or a zero-based
12989 index of an item.
12990 """
12991 return _core_.GridBagSizer_GetItemPosition(*args)
12992
12993 def SetItemPosition(*args):
12994 """
12995 SetItemPosition(self, item, GBPosition pos) -> bool
12996
12997 Set the grid position of the specified *item* where *item* is either a
12998 window or subsizer that is a member of this sizer, or a zero-based
12999 index of an item. Returns True on success. If the move is not
13000 allowed (because an item is already there) then False is returned.
13001
13002 """
13003 return _core_.GridBagSizer_SetItemPosition(*args)
13004
13005 def GetItemSpan(*args):
13006 """
13007 GetItemSpan(self, item) -> GBSpan
13008
13009 Get the row/col spanning of the specified *item* where *item* is
13010 either a window or subsizer that is a member of this sizer, or a
13011 zero-based index of an item.
13012 """
13013 return _core_.GridBagSizer_GetItemSpan(*args)
13014
13015 def SetItemSpan(*args):
13016 """
13017 SetItemSpan(self, item, GBSpan span) -> bool
13018
13019 Set the row/col spanning of the specified *item* where *item* is
13020 either a window or subsizer that is a member of this sizer, or a
13021 zero-based index of an item. Returns True on success. If the move is
13022 not allowed (because an item is already there) then False is returned.
13023 """
13024 return _core_.GridBagSizer_SetItemSpan(*args)
13025
13026 def FindItem(*args):
13027 """
13028 FindItem(self, item) -> GBSizerItem
13029
13030 Find the sizer item for the given window or subsizer, returns None if
13031 not found. (non-recursive)
13032 """
13033 return _core_.GridBagSizer_FindItem(*args)
13034
13035 def FindItemAtPosition(*args, **kwargs):
13036 """
13037 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13038
13039 Return the sizer item for the given grid cell, or None if there is no
13040 item at that position. (non-recursive)
13041 """
13042 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13043
13044 def FindItemAtPoint(*args, **kwargs):
13045 """
13046 FindItemAtPoint(self, Point pt) -> GBSizerItem
13047
13048 Return the sizer item located at the point given in *pt*, or None if
13049 there is no item at that point. The (x,y) coordinates in pt correspond
13050 to the client coordinates of the window using the sizer for
13051 layout. (non-recursive)
13052 """
13053 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13054
13055 def CheckForIntersection(*args, **kwargs):
13056 """
13057 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13058
13059 Look at all items and see if any intersect (or would overlap) the
13060 given *item*. Returns True if so, False if there would be no overlap.
13061 If an *excludeItem* is given then it will not be checked for
13062 intersection, for example it may be the item we are checking the
13063 position of.
13064
13065 """
13066 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
13067
13068 def CheckForIntersectionPos(*args, **kwargs):
13069 """
13070 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13071
13072 Look at all items and see if any intersect (or would overlap) the
13073 given position and span. Returns True if so, False if there would be
13074 no overlap. If an *excludeItem* is given then it will not be checked
13075 for intersection, for example it may be the item we are checking the
13076 position of.
13077 """
13078 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
13079
13080 _core_.GridBagSizer_swigregister(GridBagSizer)
13081
13082 #---------------------------------------------------------------------------
13083
13084 Left = _core_.Left
13085 Top = _core_.Top
13086 Right = _core_.Right
13087 Bottom = _core_.Bottom
13088 Width = _core_.Width
13089 Height = _core_.Height
13090 Centre = _core_.Centre
13091 Center = _core_.Center
13092 CentreX = _core_.CentreX
13093 CentreY = _core_.CentreY
13094 Unconstrained = _core_.Unconstrained
13095 AsIs = _core_.AsIs
13096 PercentOf = _core_.PercentOf
13097 Above = _core_.Above
13098 Below = _core_.Below
13099 LeftOf = _core_.LeftOf
13100 RightOf = _core_.RightOf
13101 SameAs = _core_.SameAs
13102 Absolute = _core_.Absolute
13103 class IndividualLayoutConstraint(Object):
13104 """
13105 Objects of this class are stored in the `wx.LayoutConstraints` class as
13106 one of eight possible constraints that a window can be involved in.
13107 You will never need to create an instance of
13108 wx.IndividualLayoutConstraint, rather you should create a
13109 `wx.LayoutConstraints` instance and use the individual contstraints
13110 that it contains.
13111 """
13112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13113 def __init__(self): raise AttributeError, "No constructor defined"
13114 __repr__ = _swig_repr
13115 def Set(*args, **kwargs):
13116 """
13117 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13118
13119 Sets the properties of the constraint. Normally called by one of the
13120 convenience functions such as Above, RightOf, SameAs.
13121 """
13122 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13123
13124 def LeftOf(*args, **kwargs):
13125 """
13126 LeftOf(self, Window sibling, int marg=0)
13127
13128 Constrains this edge to be to the left of the given window, with an
13129 optional margin. Implicitly, this is relative to the left edge of the
13130 other window.
13131 """
13132 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13133
13134 def RightOf(*args, **kwargs):
13135 """
13136 RightOf(self, Window sibling, int marg=0)
13137
13138 Constrains this edge to be to the right of the given window, with an
13139 optional margin. Implicitly, this is relative to the right edge of the
13140 other window.
13141 """
13142 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13143
13144 def Above(*args, **kwargs):
13145 """
13146 Above(self, Window sibling, int marg=0)
13147
13148 Constrains this edge to be above the given window, with an optional
13149 margin. Implicitly, this is relative to the top edge of the other
13150 window.
13151 """
13152 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13153
13154 def Below(*args, **kwargs):
13155 """
13156 Below(self, Window sibling, int marg=0)
13157
13158 Constrains this edge to be below the given window, with an optional
13159 margin. Implicitly, this is relative to the bottom edge of the other
13160 window.
13161 """
13162 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13163
13164 def SameAs(*args, **kwargs):
13165 """
13166 SameAs(self, Window otherW, int edge, int marg=0)
13167
13168 Constrains this edge or dimension to be to the same as the edge of the
13169 given window, with an optional margin.
13170 """
13171 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13172
13173 def PercentOf(*args, **kwargs):
13174 """
13175 PercentOf(self, Window otherW, int wh, int per)
13176
13177 Constrains this edge or dimension to be to a percentage of the given
13178 window, with an optional margin.
13179 """
13180 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13181
13182 def Absolute(*args, **kwargs):
13183 """
13184 Absolute(self, int val)
13185
13186 Constrains this edge or dimension to be the given absolute value.
13187 """
13188 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13189
13190 def Unconstrained(*args, **kwargs):
13191 """
13192 Unconstrained(self)
13193
13194 Sets this edge or dimension to be unconstrained, that is, dependent on
13195 other edges and dimensions from which this value can be deduced.
13196 """
13197 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13198
13199 def AsIs(*args, **kwargs):
13200 """
13201 AsIs(self)
13202
13203 Sets this edge or constraint to be whatever the window's value is at
13204 the moment. If either of the width and height constraints are *as is*,
13205 the window will not be resized, but moved instead. This is important
13206 when considering panel items which are intended to have a default
13207 size, such as a button, which may take its size from the size of the
13208 button label.
13209 """
13210 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13211
13212 def GetOtherWindow(*args, **kwargs):
13213 """GetOtherWindow(self) -> Window"""
13214 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13215
13216 def GetMyEdge(*args, **kwargs):
13217 """GetMyEdge(self) -> int"""
13218 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13219
13220 def SetEdge(*args, **kwargs):
13221 """SetEdge(self, int which)"""
13222 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13223
13224 def SetValue(*args, **kwargs):
13225 """SetValue(self, int v)"""
13226 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13227
13228 def GetMargin(*args, **kwargs):
13229 """GetMargin(self) -> int"""
13230 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13231
13232 def SetMargin(*args, **kwargs):
13233 """SetMargin(self, int m)"""
13234 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13235
13236 def GetValue(*args, **kwargs):
13237 """GetValue(self) -> int"""
13238 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13239
13240 def GetPercent(*args, **kwargs):
13241 """GetPercent(self) -> int"""
13242 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13243
13244 def GetOtherEdge(*args, **kwargs):
13245 """GetOtherEdge(self) -> int"""
13246 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13247
13248 def GetDone(*args, **kwargs):
13249 """GetDone(self) -> bool"""
13250 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13251
13252 def SetDone(*args, **kwargs):
13253 """SetDone(self, bool d)"""
13254 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13255
13256 def GetRelationship(*args, **kwargs):
13257 """GetRelationship(self) -> int"""
13258 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13259
13260 def SetRelationship(*args, **kwargs):
13261 """SetRelationship(self, int r)"""
13262 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13263
13264 def ResetIfWin(*args, **kwargs):
13265 """
13266 ResetIfWin(self, Window otherW) -> bool
13267
13268 Reset constraint if it mentions otherWin
13269 """
13270 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13271
13272 def SatisfyConstraint(*args, **kwargs):
13273 """
13274 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13275
13276 Try to satisfy constraint
13277 """
13278 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13279
13280 def GetEdge(*args, **kwargs):
13281 """
13282 GetEdge(self, int which, Window thisWin, Window other) -> int
13283
13284 Get the value of this edge or dimension, or if this
13285 is not determinable, -1.
13286 """
13287 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13288
13289 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13290 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13291 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13292 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13293 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13294 Percent = property(GetPercent,doc="See `GetPercent`")
13295 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13296 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
13297 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
13298
13299 class LayoutConstraints(Object):
13300 """
13301 **Note:** constraints are now deprecated and you should use sizers
13302 instead.
13303
13304 Objects of this class can be associated with a window to define its
13305 layout constraints, with respect to siblings or its parent.
13306
13307 The class consists of the following eight constraints of class
13308 wx.IndividualLayoutConstraint, some or all of which should be accessed
13309 directly to set the appropriate constraints.
13310
13311 * left: represents the left hand edge of the window
13312 * right: represents the right hand edge of the window
13313 * top: represents the top edge of the window
13314 * bottom: represents the bottom edge of the window
13315 * width: represents the width of the window
13316 * height: represents the height of the window
13317 * centreX: represents the horizontal centre point of the window
13318 * centreY: represents the vertical centre point of the window
13319
13320 Most constraints are initially set to have the relationship
13321 wxUnconstrained, which means that their values should be calculated by
13322 looking at known constraints. The exceptions are width and height,
13323 which are set to wxAsIs to ensure that if the user does not specify a
13324 constraint, the existing width and height will be used, to be
13325 compatible with panel items which often have take a default size. If
13326 the constraint is ``wx.AsIs``, the dimension will not be changed.
13327
13328 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13329
13330 """
13331 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13332 __repr__ = _swig_repr
13333 left = property(_core_.LayoutConstraints_left_get)
13334 top = property(_core_.LayoutConstraints_top_get)
13335 right = property(_core_.LayoutConstraints_right_get)
13336 bottom = property(_core_.LayoutConstraints_bottom_get)
13337 width = property(_core_.LayoutConstraints_width_get)
13338 height = property(_core_.LayoutConstraints_height_get)
13339 centreX = property(_core_.LayoutConstraints_centreX_get)
13340 centreY = property(_core_.LayoutConstraints_centreY_get)
13341 def __init__(self, *args, **kwargs):
13342 """__init__(self) -> LayoutConstraints"""
13343 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13344 __swig_destroy__ = _core_.delete_LayoutConstraints
13345 __del__ = lambda self : None;
13346 def SatisfyConstraints(*args, **kwargs):
13347 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13348 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13349
13350 def AreSatisfied(*args, **kwargs):
13351 """AreSatisfied(self) -> bool"""
13352 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13353
13354 _core_.LayoutConstraints_swigregister(LayoutConstraints)
13355
13356 #----------------------------------------------------------------------------
13357
13358 # Use Python's bool constants if available, make some if not
13359 try:
13360 True
13361 except NameError:
13362 __builtins__.True = 1==1
13363 __builtins__.False = 1==0
13364 def bool(value): return not not value
13365 __builtins__.bool = bool
13366
13367
13368
13369 # workarounds for bad wxRTTI names
13370 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13371 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13372 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13373
13374
13375 #----------------------------------------------------------------------------
13376 # Load version numbers from __version__... Ensure that major and minor
13377 # versions are the same for both wxPython and wxWidgets.
13378
13379 from __version__ import *
13380 __version__ = VERSION_STRING
13381
13382 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13383 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
13384 if RELEASE_VERSION != _core_.RELEASE_VERSION:
13385 import warnings
13386 warnings.warn("wxPython/wxWidgets release number mismatch")
13387
13388 #----------------------------------------------------------------------------
13389
13390 # Set wxPython's default string<-->unicode conversion encoding from
13391 # the locale, but only if Python's default hasn't been changed. (We
13392 # assume that if the user has customized it already then that is the
13393 # encoding we need to use as well.)
13394 #
13395 # The encoding selected here is used when string or unicode objects
13396 # need to be converted in order to pass them to wxWidgets. Please be
13397 # aware that the default encoding within the same locale may be
13398 # slightly different on different platforms. For example, please see
13399 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13400 # between the common latin/roman encodings.
13401
13402 default = _sys.getdefaultencoding()
13403 if default == 'ascii':
13404 import locale
13405 import codecs
13406 try:
13407 default = locale.getdefaultlocale()[1]
13408 codecs.lookup(default)
13409 except (ValueError, LookupError, TypeError):
13410 default = _sys.getdefaultencoding()
13411 del locale
13412 del codecs
13413 if default:
13414 wx.SetDefaultPyEncoding(default)
13415 del default
13416
13417 #----------------------------------------------------------------------------
13418
13419 class PyDeadObjectError(AttributeError):
13420 pass
13421
13422 class _wxPyDeadObject(object):
13423 """
13424 Instances of wx objects that are OOR capable will have their __class__
13425 changed to this class when the C++ object is deleted. This should help
13426 prevent crashes due to referencing a bogus C++ pointer.
13427 """
13428 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13429 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13430
13431 def __repr__(self):
13432 if not hasattr(self, "_name"):
13433 self._name = "[unknown]"
13434 return self.reprStr % self._name
13435
13436 def __getattr__(self, *args):
13437 if not hasattr(self, "_name"):
13438 self._name = "[unknown]"
13439 raise PyDeadObjectError(self.attrStr % self._name)
13440
13441 def __nonzero__(self):
13442 return 0
13443
13444
13445
13446 class PyUnbornObjectError(AttributeError):
13447 pass
13448
13449 class _wxPyUnbornObject(object):
13450 """
13451 Some stock objects are created when the wx._core module is
13452 imported, but their C++ instance is not created until the wx.App
13453 object is created and initialized. These object instances will
13454 temporarily have their __class__ changed to this class so an
13455 exception will be raised if they are used before the C++ instance
13456 is ready.
13457 """
13458
13459 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13460 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13461
13462 def __repr__(self):
13463 #if not hasattr(self, "_name"):
13464 # self._name = "[unknown]"
13465 return self.reprStr #% self._name
13466
13467 def __getattr__(self, *args):
13468 #if not hasattr(self, "_name"):
13469 # self._name = "[unknown]"
13470 raise PyUnbornObjectError(self.attrStr) # % self._name )
13471
13472 def __nonzero__(self):
13473 return 0
13474
13475
13476 #----------------------------------------------------------------------------
13477
13478 def CallAfter(callable, *args, **kw):
13479 """
13480 Call the specified function after the current and pending event
13481 handlers have been completed. This is also good for making GUI
13482 method calls from non-GUI threads. Any extra positional or
13483 keyword args are passed on to the callable when it is called.
13484
13485 :see: `wx.CallLater`
13486 """
13487 app = wx.GetApp()
13488 assert app is not None, 'No wx.App created yet'
13489
13490 if not hasattr(app, "_CallAfterId"):
13491 app._CallAfterId = wx.NewEventType()
13492 app.Connect(-1, -1, app._CallAfterId,
13493 lambda event: event.callable(*event.args, **event.kw) )
13494 evt = wx.PyEvent()
13495 evt.SetEventType(app._CallAfterId)
13496 evt.callable = callable
13497 evt.args = args
13498 evt.kw = kw
13499 wx.PostEvent(app, evt)
13500
13501 #----------------------------------------------------------------------------
13502
13503
13504 class CallLater:
13505 """
13506 A convenience class for `wx.Timer`, that calls the given callable
13507 object once after the given amount of milliseconds, passing any
13508 positional or keyword args. The return value of the callable is
13509 availbale after it has been run with the `GetResult` method.
13510
13511 If you don't need to get the return value or restart the timer
13512 then there is no need to hold a reference to this object. It will
13513 hold a reference to itself while the timer is running (the timer
13514 has a reference to self.Notify) but the cycle will be broken when
13515 the timer completes, automatically cleaning up the wx.CallLater
13516 object.
13517
13518 :see: `wx.CallAfter`
13519 """
13520 def __init__(self, millis, callable, *args, **kwargs):
13521 self.millis = millis
13522 self.callable = callable
13523 self.SetArgs(*args, **kwargs)
13524 self.runCount = 0
13525 self.running = False
13526 self.hasRun = False
13527 self.result = None
13528 self.timer = None
13529 self.Start()
13530
13531 def __del__(self):
13532 self.Stop()
13533
13534
13535 def Start(self, millis=None, *args, **kwargs):
13536 """
13537 (Re)start the timer
13538 """
13539 self.hasRun = False
13540 if millis is not None:
13541 self.millis = millis
13542 if args or kwargs:
13543 self.SetArgs(*args, **kwargs)
13544 self.Stop()
13545 self.timer = wx.PyTimer(self.Notify)
13546 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13547 self.running = True
13548 Restart = Start
13549
13550
13551 def Stop(self):
13552 """
13553 Stop and destroy the timer.
13554 """
13555 if self.timer is not None:
13556 self.timer.Stop()
13557 self.timer = None
13558
13559
13560 def GetInterval(self):
13561 if self.timer is not None:
13562 return self.timer.GetInterval()
13563 else:
13564 return 0
13565
13566
13567 def IsRunning(self):
13568 return self.timer is not None and self.timer.IsRunning()
13569
13570
13571 def SetArgs(self, *args, **kwargs):
13572 """
13573 (Re)set the args passed to the callable object. This is
13574 useful in conjunction with Restart if you want to schedule a
13575 new call to the same callable object but with different
13576 parameters.
13577 """
13578 self.args = args
13579 self.kwargs = kwargs
13580
13581
13582 def HasRun(self):
13583 return self.hasRun
13584
13585 def GetResult(self):
13586 return self.result
13587
13588 def Notify(self):
13589 """
13590 The timer has expired so call the callable.
13591 """
13592 if self.callable and getattr(self.callable, 'im_self', True):
13593 self.runCount += 1
13594 self.running = False
13595 self.result = self.callable(*self.args, **self.kwargs)
13596 self.hasRun = True
13597 if not self.running:
13598 # if it wasn't restarted, then cleanup
13599 wx.CallAfter(self.Stop)
13600
13601 Interval = property(GetInterval)
13602 Result = property(GetResult)
13603
13604
13605 class FutureCall(CallLater):
13606 """A compatibility alias for `CallLater`."""
13607
13608 #----------------------------------------------------------------------------
13609 # Control which items in this module should be documented by epydoc.
13610 # We allow only classes and functions, which will help reduce the size
13611 # of the docs by filtering out the zillions of constants, EVT objects,
13612 # and etc that don't make much sense by themselves, but are instead
13613 # documented (or will be) as part of the classes/functions/methods
13614 # where they should be used.
13615
13616 class __DocFilter:
13617 """
13618 A filter for epydoc that only allows non-Ptr classes and
13619 functions, in order to reduce the clutter in the API docs.
13620 """
13621 def __init__(self, globals):
13622 self._globals = globals
13623
13624 def __call__(self, name):
13625 import types
13626 obj = self._globals.get(name, None)
13627
13628 # only document classes and function
13629 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13630 return False
13631
13632 # skip other things that are private or will be documented as part of somethign else
13633 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13634 return False
13635
13636 # skip functions that are duplicates of static functions in a class
13637 if name.find('_') != -1:
13638 cls = self._globals.get(name.split('_')[0], None)
13639 methname = name.split('_')[1]
13640 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13641 return False
13642
13643 return True
13644
13645 #----------------------------------------------------------------------------
13646 #----------------------------------------------------------------------------
13647
13648 # Import other modules in this package that should show up in the
13649 # "core" wx namespace
13650 from _gdi import *
13651 from _windows import *
13652 from _controls import *
13653 from _misc import *
13654
13655 #----------------------------------------------------------------------------
13656 #----------------------------------------------------------------------------
13657
13658
13659