]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
reSWIGtged
[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 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
281 PD_APP_MODAL = _core_.PD_APP_MODAL
282 PD_CAN_ABORT = _core_.PD_CAN_ABORT
283 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
284 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
285 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
286 PD_SMOOTH = _core_.PD_SMOOTH
287 PD_CAN_SKIP = _core_.PD_CAN_SKIP
288 MENU_TEAROFF = _core_.MENU_TEAROFF
289 MB_DOCKABLE = _core_.MB_DOCKABLE
290 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
291 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
292 LI_HORIZONTAL = _core_.LI_HORIZONTAL
293 LI_VERTICAL = _core_.LI_VERTICAL
294 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
295 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
296 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
297 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
298 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
299 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
300 MM_TEXT = _core_.MM_TEXT
301 MM_LOMETRIC = _core_.MM_LOMETRIC
302 MM_HIMETRIC = _core_.MM_HIMETRIC
303 MM_LOENGLISH = _core_.MM_LOENGLISH
304 MM_HIENGLISH = _core_.MM_HIENGLISH
305 MM_TWIPS = _core_.MM_TWIPS
306 MM_ISOTROPIC = _core_.MM_ISOTROPIC
307 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
308 MM_POINTS = _core_.MM_POINTS
309 MM_METRIC = _core_.MM_METRIC
310 CENTRE = _core_.CENTRE
311 CENTER = _core_.CENTER
312 HORIZONTAL = _core_.HORIZONTAL
313 VERTICAL = _core_.VERTICAL
314 BOTH = _core_.BOTH
315 LEFT = _core_.LEFT
316 RIGHT = _core_.RIGHT
317 UP = _core_.UP
318 DOWN = _core_.DOWN
319 TOP = _core_.TOP
320 BOTTOM = _core_.BOTTOM
321 NORTH = _core_.NORTH
322 SOUTH = _core_.SOUTH
323 WEST = _core_.WEST
324 EAST = _core_.EAST
325 ALL = _core_.ALL
326 ALIGN_NOT = _core_.ALIGN_NOT
327 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
328 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
329 ALIGN_LEFT = _core_.ALIGN_LEFT
330 ALIGN_TOP = _core_.ALIGN_TOP
331 ALIGN_RIGHT = _core_.ALIGN_RIGHT
332 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
333 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
334 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
335 ALIGN_CENTER = _core_.ALIGN_CENTER
336 ALIGN_CENTRE = _core_.ALIGN_CENTRE
337 ALIGN_MASK = _core_.ALIGN_MASK
338 STRETCH_NOT = _core_.STRETCH_NOT
339 SHRINK = _core_.SHRINK
340 GROW = _core_.GROW
341 EXPAND = _core_.EXPAND
342 SHAPED = _core_.SHAPED
343 FIXED_MINSIZE = _core_.FIXED_MINSIZE
344 TILE = _core_.TILE
345 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
346 BORDER_DEFAULT = _core_.BORDER_DEFAULT
347 BORDER_NONE = _core_.BORDER_NONE
348 BORDER_STATIC = _core_.BORDER_STATIC
349 BORDER_SIMPLE = _core_.BORDER_SIMPLE
350 BORDER_RAISED = _core_.BORDER_RAISED
351 BORDER_SUNKEN = _core_.BORDER_SUNKEN
352 BORDER_DOUBLE = _core_.BORDER_DOUBLE
353 BORDER_MASK = _core_.BORDER_MASK
354 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
355 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
356 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
357 DEFAULT = _core_.DEFAULT
358 DECORATIVE = _core_.DECORATIVE
359 ROMAN = _core_.ROMAN
360 SCRIPT = _core_.SCRIPT
361 SWISS = _core_.SWISS
362 MODERN = _core_.MODERN
363 TELETYPE = _core_.TELETYPE
364 VARIABLE = _core_.VARIABLE
365 FIXED = _core_.FIXED
366 NORMAL = _core_.NORMAL
367 LIGHT = _core_.LIGHT
368 BOLD = _core_.BOLD
369 ITALIC = _core_.ITALIC
370 SLANT = _core_.SLANT
371 SOLID = _core_.SOLID
372 DOT = _core_.DOT
373 LONG_DASH = _core_.LONG_DASH
374 SHORT_DASH = _core_.SHORT_DASH
375 DOT_DASH = _core_.DOT_DASH
376 USER_DASH = _core_.USER_DASH
377 TRANSPARENT = _core_.TRANSPARENT
378 STIPPLE = _core_.STIPPLE
379 STIPPLE_MASK = _core_.STIPPLE_MASK
380 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
381 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
382 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
383 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
384 CROSS_HATCH = _core_.CROSS_HATCH
385 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
386 VERTICAL_HATCH = _core_.VERTICAL_HATCH
387 JOIN_BEVEL = _core_.JOIN_BEVEL
388 JOIN_MITER = _core_.JOIN_MITER
389 JOIN_ROUND = _core_.JOIN_ROUND
390 CAP_ROUND = _core_.CAP_ROUND
391 CAP_PROJECTING = _core_.CAP_PROJECTING
392 CAP_BUTT = _core_.CAP_BUTT
393 CLEAR = _core_.CLEAR
394 XOR = _core_.XOR
395 INVERT = _core_.INVERT
396 OR_REVERSE = _core_.OR_REVERSE
397 AND_REVERSE = _core_.AND_REVERSE
398 COPY = _core_.COPY
399 AND = _core_.AND
400 AND_INVERT = _core_.AND_INVERT
401 NO_OP = _core_.NO_OP
402 NOR = _core_.NOR
403 EQUIV = _core_.EQUIV
404 SRC_INVERT = _core_.SRC_INVERT
405 OR_INVERT = _core_.OR_INVERT
406 NAND = _core_.NAND
407 OR = _core_.OR
408 SET = _core_.SET
409 WXK_BACK = _core_.WXK_BACK
410 WXK_TAB = _core_.WXK_TAB
411 WXK_RETURN = _core_.WXK_RETURN
412 WXK_ESCAPE = _core_.WXK_ESCAPE
413 WXK_SPACE = _core_.WXK_SPACE
414 WXK_DELETE = _core_.WXK_DELETE
415 WXK_START = _core_.WXK_START
416 WXK_LBUTTON = _core_.WXK_LBUTTON
417 WXK_RBUTTON = _core_.WXK_RBUTTON
418 WXK_CANCEL = _core_.WXK_CANCEL
419 WXK_MBUTTON = _core_.WXK_MBUTTON
420 WXK_CLEAR = _core_.WXK_CLEAR
421 WXK_SHIFT = _core_.WXK_SHIFT
422 WXK_ALT = _core_.WXK_ALT
423 WXK_CONTROL = _core_.WXK_CONTROL
424 WXK_MENU = _core_.WXK_MENU
425 WXK_PAUSE = _core_.WXK_PAUSE
426 WXK_CAPITAL = _core_.WXK_CAPITAL
427 WXK_PRIOR = _core_.WXK_PRIOR
428 WXK_NEXT = _core_.WXK_NEXT
429 WXK_END = _core_.WXK_END
430 WXK_HOME = _core_.WXK_HOME
431 WXK_LEFT = _core_.WXK_LEFT
432 WXK_UP = _core_.WXK_UP
433 WXK_RIGHT = _core_.WXK_RIGHT
434 WXK_DOWN = _core_.WXK_DOWN
435 WXK_SELECT = _core_.WXK_SELECT
436 WXK_PRINT = _core_.WXK_PRINT
437 WXK_EXECUTE = _core_.WXK_EXECUTE
438 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
439 WXK_INSERT = _core_.WXK_INSERT
440 WXK_HELP = _core_.WXK_HELP
441 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
442 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
443 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
444 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
445 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
446 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
447 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
448 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
449 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
450 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
451 WXK_MULTIPLY = _core_.WXK_MULTIPLY
452 WXK_ADD = _core_.WXK_ADD
453 WXK_SEPARATOR = _core_.WXK_SEPARATOR
454 WXK_SUBTRACT = _core_.WXK_SUBTRACT
455 WXK_DECIMAL = _core_.WXK_DECIMAL
456 WXK_DIVIDE = _core_.WXK_DIVIDE
457 WXK_F1 = _core_.WXK_F1
458 WXK_F2 = _core_.WXK_F2
459 WXK_F3 = _core_.WXK_F3
460 WXK_F4 = _core_.WXK_F4
461 WXK_F5 = _core_.WXK_F5
462 WXK_F6 = _core_.WXK_F6
463 WXK_F7 = _core_.WXK_F7
464 WXK_F8 = _core_.WXK_F8
465 WXK_F9 = _core_.WXK_F9
466 WXK_F10 = _core_.WXK_F10
467 WXK_F11 = _core_.WXK_F11
468 WXK_F12 = _core_.WXK_F12
469 WXK_F13 = _core_.WXK_F13
470 WXK_F14 = _core_.WXK_F14
471 WXK_F15 = _core_.WXK_F15
472 WXK_F16 = _core_.WXK_F16
473 WXK_F17 = _core_.WXK_F17
474 WXK_F18 = _core_.WXK_F18
475 WXK_F19 = _core_.WXK_F19
476 WXK_F20 = _core_.WXK_F20
477 WXK_F21 = _core_.WXK_F21
478 WXK_F22 = _core_.WXK_F22
479 WXK_F23 = _core_.WXK_F23
480 WXK_F24 = _core_.WXK_F24
481 WXK_NUMLOCK = _core_.WXK_NUMLOCK
482 WXK_SCROLL = _core_.WXK_SCROLL
483 WXK_PAGEUP = _core_.WXK_PAGEUP
484 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
485 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
486 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
487 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
488 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
489 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
490 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
491 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
492 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
493 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
494 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
495 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
496 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
497 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
498 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
499 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
500 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
501 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
502 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
503 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
504 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
505 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
506 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
507 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
508 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
509 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
510 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
511 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
512 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
513 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
514 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
515 WXK_COMMAND = _core_.WXK_COMMAND
516 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
517 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
518 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
519 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
520 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
521 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
522 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
523 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
524 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
525 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
526 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
527 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
528 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
529 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
530 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
531 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
532 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
533 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
534 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
535 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
536 PAPER_NONE = _core_.PAPER_NONE
537 PAPER_LETTER = _core_.PAPER_LETTER
538 PAPER_LEGAL = _core_.PAPER_LEGAL
539 PAPER_A4 = _core_.PAPER_A4
540 PAPER_CSHEET = _core_.PAPER_CSHEET
541 PAPER_DSHEET = _core_.PAPER_DSHEET
542 PAPER_ESHEET = _core_.PAPER_ESHEET
543 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
544 PAPER_TABLOID = _core_.PAPER_TABLOID
545 PAPER_LEDGER = _core_.PAPER_LEDGER
546 PAPER_STATEMENT = _core_.PAPER_STATEMENT
547 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
548 PAPER_A3 = _core_.PAPER_A3
549 PAPER_A4SMALL = _core_.PAPER_A4SMALL
550 PAPER_A5 = _core_.PAPER_A5
551 PAPER_B4 = _core_.PAPER_B4
552 PAPER_B5 = _core_.PAPER_B5
553 PAPER_FOLIO = _core_.PAPER_FOLIO
554 PAPER_QUARTO = _core_.PAPER_QUARTO
555 PAPER_10X14 = _core_.PAPER_10X14
556 PAPER_11X17 = _core_.PAPER_11X17
557 PAPER_NOTE = _core_.PAPER_NOTE
558 PAPER_ENV_9 = _core_.PAPER_ENV_9
559 PAPER_ENV_10 = _core_.PAPER_ENV_10
560 PAPER_ENV_11 = _core_.PAPER_ENV_11
561 PAPER_ENV_12 = _core_.PAPER_ENV_12
562 PAPER_ENV_14 = _core_.PAPER_ENV_14
563 PAPER_ENV_DL = _core_.PAPER_ENV_DL
564 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
565 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
566 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
567 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
568 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
569 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
570 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
571 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
572 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
573 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
574 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
575 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
576 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
577 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
578 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
579 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
580 PAPER_9X11 = _core_.PAPER_9X11
581 PAPER_10X11 = _core_.PAPER_10X11
582 PAPER_15X11 = _core_.PAPER_15X11
583 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
584 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
585 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
586 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
587 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
588 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
589 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
590 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
591 PAPER_A_PLUS = _core_.PAPER_A_PLUS
592 PAPER_B_PLUS = _core_.PAPER_B_PLUS
593 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
594 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
595 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
596 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
597 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
598 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
599 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
600 PAPER_A2 = _core_.PAPER_A2
601 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
602 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
603 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
604 PAPER_A6 = _core_.PAPER_A6
605 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
606 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
607 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
608 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
609 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
610 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
611 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
612 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
613 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
614 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
615 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
616 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
617 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
618 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
619 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
620 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
621 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
622 PAPER_B6_JIS = _core_.PAPER_B6_JIS
623 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
624 PAPER_12X11 = _core_.PAPER_12X11
625 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
626 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
627 PAPER_P16K = _core_.PAPER_P16K
628 PAPER_P32K = _core_.PAPER_P32K
629 PAPER_P32KBIG = _core_.PAPER_P32KBIG
630 PAPER_PENV_1 = _core_.PAPER_PENV_1
631 PAPER_PENV_2 = _core_.PAPER_PENV_2
632 PAPER_PENV_3 = _core_.PAPER_PENV_3
633 PAPER_PENV_4 = _core_.PAPER_PENV_4
634 PAPER_PENV_5 = _core_.PAPER_PENV_5
635 PAPER_PENV_6 = _core_.PAPER_PENV_6
636 PAPER_PENV_7 = _core_.PAPER_PENV_7
637 PAPER_PENV_8 = _core_.PAPER_PENV_8
638 PAPER_PENV_9 = _core_.PAPER_PENV_9
639 PAPER_PENV_10 = _core_.PAPER_PENV_10
640 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
641 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
642 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
643 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
644 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
645 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
646 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
647 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
648 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
649 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
650 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
651 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
652 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
653 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
654 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
655 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
656 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
657 ITEM_NORMAL = _core_.ITEM_NORMAL
658 ITEM_CHECK = _core_.ITEM_CHECK
659 ITEM_RADIO = _core_.ITEM_RADIO
660 ITEM_MAX = _core_.ITEM_MAX
661 HT_NOWHERE = _core_.HT_NOWHERE
662 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
663 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
664 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
665 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
666 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
667 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
668 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
669 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
670 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
671 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
672 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
673 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
674 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
675 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
676 HT_MAX = _core_.HT_MAX
677 MOD_NONE = _core_.MOD_NONE
678 MOD_ALT = _core_.MOD_ALT
679 MOD_CONTROL = _core_.MOD_CONTROL
680 MOD_ALTGR = _core_.MOD_ALTGR
681 MOD_SHIFT = _core_.MOD_SHIFT
682 MOD_META = _core_.MOD_META
683 MOD_WIN = _core_.MOD_WIN
684 MOD_CMD = _core_.MOD_CMD
685 MOD_ALL = _core_.MOD_ALL
686 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
687 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
688 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
689 #---------------------------------------------------------------------------
690
691 class Object(object):
692 """
693 The base class for most wx objects, although in wxPython not
694 much functionality is needed nor exposed.
695 """
696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
697 def __init__(self): raise AttributeError, "No constructor defined"
698 __repr__ = _swig_repr
699 def GetClassName(*args, **kwargs):
700 """
701 GetClassName(self) -> String
702
703 Returns the class name of the C++ class using wxRTTI.
704 """
705 return _core_.Object_GetClassName(*args, **kwargs)
706
707 def Destroy(*args, **kwargs):
708 """
709 Destroy(self)
710
711 Deletes the C++ object this Python object is a proxy for.
712 """
713 val = _core_.Object_Destroy(*args, **kwargs)
714 args[0].thisown = 0
715 return val
716
717 _core_.Object_swigregister(Object)
718 _wxPySetDictionary = _core_._wxPySetDictionary
719 cvar = _core_.cvar
720 EmptyString = cvar.EmptyString
721
722 #---------------------------------------------------------------------------
723
724 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
725 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
726 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
727 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
728 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
729 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
730 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
731 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
732 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
733 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
734 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
735 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
736 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
737 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
738 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
739 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
740 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
741 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
742 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
743 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
744 CURSOR_NONE = _core_.CURSOR_NONE
745 CURSOR_ARROW = _core_.CURSOR_ARROW
746 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
747 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
748 CURSOR_CHAR = _core_.CURSOR_CHAR
749 CURSOR_CROSS = _core_.CURSOR_CROSS
750 CURSOR_HAND = _core_.CURSOR_HAND
751 CURSOR_IBEAM = _core_.CURSOR_IBEAM
752 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
753 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
754 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
755 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
756 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
757 CURSOR_PENCIL = _core_.CURSOR_PENCIL
758 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
759 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
760 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
761 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
762 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
763 CURSOR_SIZENS = _core_.CURSOR_SIZENS
764 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
765 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
766 CURSOR_SIZING = _core_.CURSOR_SIZING
767 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
768 CURSOR_WAIT = _core_.CURSOR_WAIT
769 CURSOR_WATCH = _core_.CURSOR_WATCH
770 CURSOR_BLANK = _core_.CURSOR_BLANK
771 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
772 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
773 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
774 CURSOR_MAX = _core_.CURSOR_MAX
775 #---------------------------------------------------------------------------
776
777 class Size(object):
778 """
779 wx.Size is a useful data structure used to represent the size of
780 something. It simply contains integer width and height
781 properties. In most places in wxPython where a wx.Size is
782 expected a (width, height) tuple can be used instead.
783 """
784 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
785 __repr__ = _swig_repr
786 width = property(_core_.Size_width_get, _core_.Size_width_set)
787 height = property(_core_.Size_height_get, _core_.Size_height_set)
788 x = width; y = height
789 def __init__(self, *args, **kwargs):
790 """
791 __init__(self, int w=0, int h=0) -> Size
792
793 Creates a size object.
794 """
795 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
796 __swig_destroy__ = _core_.delete_Size
797 __del__ = lambda self : None;
798 def __eq__(*args, **kwargs):
799 """
800 __eq__(self, PyObject other) -> bool
801
802 Test for equality of wx.Size objects.
803 """
804 return _core_.Size___eq__(*args, **kwargs)
805
806 def __ne__(*args, **kwargs):
807 """
808 __ne__(self, PyObject other) -> bool
809
810 Test for inequality of wx.Size objects.
811 """
812 return _core_.Size___ne__(*args, **kwargs)
813
814 def __add__(*args, **kwargs):
815 """
816 __add__(self, Size sz) -> Size
817
818 Add sz's proprties to this and return the result.
819 """
820 return _core_.Size___add__(*args, **kwargs)
821
822 def __sub__(*args, **kwargs):
823 """
824 __sub__(self, Size sz) -> Size
825
826 Subtract sz's properties from this and return the result.
827 """
828 return _core_.Size___sub__(*args, **kwargs)
829
830 def IncTo(*args, **kwargs):
831 """
832 IncTo(self, Size sz)
833
834 Increments this object so that both of its dimensions are not less
835 than the corresponding dimensions of the size.
836 """
837 return _core_.Size_IncTo(*args, **kwargs)
838
839 def DecTo(*args, **kwargs):
840 """
841 DecTo(self, Size sz)
842
843 Decrements this object so that both of its dimensions are not greater
844 than the corresponding dimensions of the size.
845 """
846 return _core_.Size_DecTo(*args, **kwargs)
847
848 def Scale(*args, **kwargs):
849 """
850 Scale(self, float xscale, float yscale)
851
852 Scales the dimensions of this object by the given factors.
853 """
854 return _core_.Size_Scale(*args, **kwargs)
855
856 def Set(*args, **kwargs):
857 """
858 Set(self, int w, int h)
859
860 Set both width and height.
861 """
862 return _core_.Size_Set(*args, **kwargs)
863
864 def SetWidth(*args, **kwargs):
865 """SetWidth(self, int w)"""
866 return _core_.Size_SetWidth(*args, **kwargs)
867
868 def SetHeight(*args, **kwargs):
869 """SetHeight(self, int h)"""
870 return _core_.Size_SetHeight(*args, **kwargs)
871
872 def GetWidth(*args, **kwargs):
873 """GetWidth(self) -> int"""
874 return _core_.Size_GetWidth(*args, **kwargs)
875
876 def GetHeight(*args, **kwargs):
877 """GetHeight(self) -> int"""
878 return _core_.Size_GetHeight(*args, **kwargs)
879
880 def IsFullySpecified(*args, **kwargs):
881 """
882 IsFullySpecified(self) -> bool
883
884 Returns True if both components of the size are non-default values.
885 """
886 return _core_.Size_IsFullySpecified(*args, **kwargs)
887
888 def SetDefaults(*args, **kwargs):
889 """
890 SetDefaults(self, Size size)
891
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
894 """
895 return _core_.Size_SetDefaults(*args, **kwargs)
896
897 def Get(*args, **kwargs):
898 """
899 Get() -> (width,height)
900
901 Returns the width and height properties as a tuple.
902 """
903 return _core_.Size_Get(*args, **kwargs)
904
905 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
906 def __str__(self): return str(self.Get())
907 def __repr__(self): return 'wx.Size'+str(self.Get())
908 def __len__(self): return len(self.Get())
909 def __getitem__(self, index): return self.Get()[index]
910 def __setitem__(self, index, val):
911 if index == 0: self.width = val
912 elif index == 1: self.height = val
913 else: raise IndexError
914 def __nonzero__(self): return self.Get() != (0,0)
915 __safe_for_unpickling__ = True
916 def __reduce__(self): return (wx.Size, self.Get())
917
918 _core_.Size_swigregister(Size)
919
920 #---------------------------------------------------------------------------
921
922 class RealPoint(object):
923 """
924 A data structure for representing a point or position with floating
925 point x and y properties. In wxPython most places that expect a
926 wx.RealPoint can also accept a (x,y) tuple.
927 """
928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
929 __repr__ = _swig_repr
930 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
931 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
932 def __init__(self, *args, **kwargs):
933 """
934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
935
936 Create a wx.RealPoint object
937 """
938 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
939 __swig_destroy__ = _core_.delete_RealPoint
940 __del__ = lambda self : None;
941 def __eq__(*args, **kwargs):
942 """
943 __eq__(self, PyObject other) -> bool
944
945 Test for equality of wx.RealPoint objects.
946 """
947 return _core_.RealPoint___eq__(*args, **kwargs)
948
949 def __ne__(*args, **kwargs):
950 """
951 __ne__(self, PyObject other) -> bool
952
953 Test for inequality of wx.RealPoint objects.
954 """
955 return _core_.RealPoint___ne__(*args, **kwargs)
956
957 def __add__(*args, **kwargs):
958 """
959 __add__(self, RealPoint pt) -> RealPoint
960
961 Add pt's proprties to this and return the result.
962 """
963 return _core_.RealPoint___add__(*args, **kwargs)
964
965 def __sub__(*args, **kwargs):
966 """
967 __sub__(self, RealPoint pt) -> RealPoint
968
969 Subtract pt's proprties from this and return the result
970 """
971 return _core_.RealPoint___sub__(*args, **kwargs)
972
973 def Set(*args, **kwargs):
974 """
975 Set(self, double x, double y)
976
977 Set both the x and y properties
978 """
979 return _core_.RealPoint_Set(*args, **kwargs)
980
981 def Get(*args, **kwargs):
982 """
983 Get() -> (x,y)
984
985 Return the x and y properties as a tuple.
986 """
987 return _core_.RealPoint_Get(*args, **kwargs)
988
989 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
990 def __str__(self): return str(self.Get())
991 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
992 def __len__(self): return len(self.Get())
993 def __getitem__(self, index): return self.Get()[index]
994 def __setitem__(self, index, val):
995 if index == 0: self.x = val
996 elif index == 1: self.y = val
997 else: raise IndexError
998 def __nonzero__(self): return self.Get() != (0.0, 0.0)
999 __safe_for_unpickling__ = True
1000 def __reduce__(self): return (wx.RealPoint, self.Get())
1001
1002 _core_.RealPoint_swigregister(RealPoint)
1003
1004 #---------------------------------------------------------------------------
1005
1006 class Point(object):
1007 """
1008 A data structure for representing a point or position with integer x
1009 and y properties. Most places in wxPython that expect a wx.Point can
1010 also accept a (x,y) tuple.
1011 """
1012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1013 __repr__ = _swig_repr
1014 x = property(_core_.Point_x_get, _core_.Point_x_set)
1015 y = property(_core_.Point_y_get, _core_.Point_y_set)
1016 def __init__(self, *args, **kwargs):
1017 """
1018 __init__(self, int x=0, int y=0) -> Point
1019
1020 Create a wx.Point object
1021 """
1022 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1023 __swig_destroy__ = _core_.delete_Point
1024 __del__ = lambda self : None;
1025 def __eq__(*args, **kwargs):
1026 """
1027 __eq__(self, PyObject other) -> bool
1028
1029 Test for equality of wx.Point objects.
1030 """
1031 return _core_.Point___eq__(*args, **kwargs)
1032
1033 def __ne__(*args, **kwargs):
1034 """
1035 __ne__(self, PyObject other) -> bool
1036
1037 Test for inequality of wx.Point objects.
1038 """
1039 return _core_.Point___ne__(*args, **kwargs)
1040
1041 def __add__(*args, **kwargs):
1042 """
1043 __add__(self, Point pt) -> Point
1044
1045 Add pt's proprties to this and return the result.
1046 """
1047 return _core_.Point___add__(*args, **kwargs)
1048
1049 def __sub__(*args, **kwargs):
1050 """
1051 __sub__(self, Point pt) -> Point
1052
1053 Subtract pt's proprties from this and return the result
1054 """
1055 return _core_.Point___sub__(*args, **kwargs)
1056
1057 def __iadd__(*args, **kwargs):
1058 """
1059 __iadd__(self, Point pt) -> Point
1060
1061 Add pt to this object.
1062 """
1063 return _core_.Point___iadd__(*args, **kwargs)
1064
1065 def __isub__(*args, **kwargs):
1066 """
1067 __isub__(self, Point pt) -> Point
1068
1069 Subtract pt from this object.
1070 """
1071 return _core_.Point___isub__(*args, **kwargs)
1072
1073 def Set(*args, **kwargs):
1074 """
1075 Set(self, long x, long y)
1076
1077 Set both the x and y properties
1078 """
1079 return _core_.Point_Set(*args, **kwargs)
1080
1081 def Get(*args, **kwargs):
1082 """
1083 Get() -> (x,y)
1084
1085 Return the x and y properties as a tuple.
1086 """
1087 return _core_.Point_Get(*args, **kwargs)
1088
1089 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1090 def __str__(self): return str(self.Get())
1091 def __repr__(self): return 'wx.Point'+str(self.Get())
1092 def __len__(self): return len(self.Get())
1093 def __getitem__(self, index): return self.Get()[index]
1094 def __setitem__(self, index, val):
1095 if index == 0: self.x = val
1096 elif index == 1: self.y = val
1097 else: raise IndexError
1098 def __nonzero__(self): return self.Get() != (0,0)
1099 __safe_for_unpickling__ = True
1100 def __reduce__(self): return (wx.Point, self.Get())
1101
1102 _core_.Point_swigregister(Point)
1103
1104 #---------------------------------------------------------------------------
1105
1106 class Rect(object):
1107 """
1108 A class for representing and manipulating rectangles. It has x, y,
1109 width and height properties. In wxPython most palces that expect a
1110 wx.Rect can also accept a (x,y,width,height) tuple.
1111 """
1112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1113 __repr__ = _swig_repr
1114 def __init__(self, *args, **kwargs):
1115 """
1116 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1117
1118 Create a new Rect object.
1119 """
1120 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1121 __swig_destroy__ = _core_.delete_Rect
1122 __del__ = lambda self : None;
1123 def GetX(*args, **kwargs):
1124 """GetX(self) -> int"""
1125 return _core_.Rect_GetX(*args, **kwargs)
1126
1127 def SetX(*args, **kwargs):
1128 """SetX(self, int x)"""
1129 return _core_.Rect_SetX(*args, **kwargs)
1130
1131 def GetY(*args, **kwargs):
1132 """GetY(self) -> int"""
1133 return _core_.Rect_GetY(*args, **kwargs)
1134
1135 def SetY(*args, **kwargs):
1136 """SetY(self, int y)"""
1137 return _core_.Rect_SetY(*args, **kwargs)
1138
1139 def GetWidth(*args, **kwargs):
1140 """GetWidth(self) -> int"""
1141 return _core_.Rect_GetWidth(*args, **kwargs)
1142
1143 def SetWidth(*args, **kwargs):
1144 """SetWidth(self, int w)"""
1145 return _core_.Rect_SetWidth(*args, **kwargs)
1146
1147 def GetHeight(*args, **kwargs):
1148 """GetHeight(self) -> int"""
1149 return _core_.Rect_GetHeight(*args, **kwargs)
1150
1151 def SetHeight(*args, **kwargs):
1152 """SetHeight(self, int h)"""
1153 return _core_.Rect_SetHeight(*args, **kwargs)
1154
1155 def GetPosition(*args, **kwargs):
1156 """GetPosition(self) -> Point"""
1157 return _core_.Rect_GetPosition(*args, **kwargs)
1158
1159 def SetPosition(*args, **kwargs):
1160 """SetPosition(self, Point p)"""
1161 return _core_.Rect_SetPosition(*args, **kwargs)
1162
1163 def GetSize(*args, **kwargs):
1164 """GetSize(self) -> Size"""
1165 return _core_.Rect_GetSize(*args, **kwargs)
1166
1167 def SetSize(*args, **kwargs):
1168 """SetSize(self, Size s)"""
1169 return _core_.Rect_SetSize(*args, **kwargs)
1170
1171 def IsEmpty(*args, **kwargs):
1172 """IsEmpty(self) -> bool"""
1173 return _core_.Rect_IsEmpty(*args, **kwargs)
1174
1175 def GetTopLeft(*args, **kwargs):
1176 """GetTopLeft(self) -> Point"""
1177 return _core_.Rect_GetTopLeft(*args, **kwargs)
1178
1179 def SetTopLeft(*args, **kwargs):
1180 """SetTopLeft(self, Point p)"""
1181 return _core_.Rect_SetTopLeft(*args, **kwargs)
1182
1183 def GetBottomRight(*args, **kwargs):
1184 """GetBottomRight(self) -> Point"""
1185 return _core_.Rect_GetBottomRight(*args, **kwargs)
1186
1187 def SetBottomRight(*args, **kwargs):
1188 """SetBottomRight(self, Point p)"""
1189 return _core_.Rect_SetBottomRight(*args, **kwargs)
1190
1191 def GetLeft(*args, **kwargs):
1192 """GetLeft(self) -> int"""
1193 return _core_.Rect_GetLeft(*args, **kwargs)
1194
1195 def GetTop(*args, **kwargs):
1196 """GetTop(self) -> int"""
1197 return _core_.Rect_GetTop(*args, **kwargs)
1198
1199 def GetBottom(*args, **kwargs):
1200 """GetBottom(self) -> int"""
1201 return _core_.Rect_GetBottom(*args, **kwargs)
1202
1203 def GetRight(*args, **kwargs):
1204 """GetRight(self) -> int"""
1205 return _core_.Rect_GetRight(*args, **kwargs)
1206
1207 def SetLeft(*args, **kwargs):
1208 """SetLeft(self, int left)"""
1209 return _core_.Rect_SetLeft(*args, **kwargs)
1210
1211 def SetRight(*args, **kwargs):
1212 """SetRight(self, int right)"""
1213 return _core_.Rect_SetRight(*args, **kwargs)
1214
1215 def SetTop(*args, **kwargs):
1216 """SetTop(self, int top)"""
1217 return _core_.Rect_SetTop(*args, **kwargs)
1218
1219 def SetBottom(*args, **kwargs):
1220 """SetBottom(self, int bottom)"""
1221 return _core_.Rect_SetBottom(*args, **kwargs)
1222
1223 position = property(GetPosition, SetPosition)
1224 size = property(GetSize, SetSize)
1225 left = property(GetLeft, SetLeft)
1226 right = property(GetRight, SetRight)
1227 top = property(GetTop, SetTop)
1228 bottom = property(GetBottom, SetBottom)
1229
1230 def Inflate(*args, **kwargs):
1231 """
1232 Inflate(self, int dx, int dy) -> Rect
1233
1234 Increases the size of the rectangle.
1235
1236 The left border is moved farther left and the right border is moved
1237 farther right by ``dx``. The upper border is moved farther up and the
1238 bottom border is moved farther down by ``dy``. (Note the the width and
1239 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1240 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1241 opposite happens: the rectangle size decreases in the respective
1242 direction.
1243
1244 The change is made to the rectangle inplace, if instead you need a
1245 copy that is inflated, preserving the original then make the copy
1246 first::
1247
1248 copy = wx.Rect(*original)
1249 copy.Inflate(10,15)
1250
1251
1252 """
1253 return _core_.Rect_Inflate(*args, **kwargs)
1254
1255 def Deflate(*args, **kwargs):
1256 """
1257 Deflate(self, int dx, int dy) -> Rect
1258
1259 Decrease the rectangle size. This method is the opposite of `Inflate`
1260 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1261 `Inflate` for a full description.
1262 """
1263 return _core_.Rect_Deflate(*args, **kwargs)
1264
1265 def OffsetXY(*args, **kwargs):
1266 """
1267 OffsetXY(self, int dx, int dy)
1268
1269 Moves the rectangle by the specified offset. If dx is positive, the
1270 rectangle is moved to the right, if dy is positive, it is moved to the
1271 bottom, otherwise it is moved to the left or top respectively.
1272 """
1273 return _core_.Rect_OffsetXY(*args, **kwargs)
1274
1275 def Offset(*args, **kwargs):
1276 """
1277 Offset(self, Point pt)
1278
1279 Same as `OffsetXY` but uses dx,dy from Point
1280 """
1281 return _core_.Rect_Offset(*args, **kwargs)
1282
1283 def Intersect(*args, **kwargs):
1284 """
1285 Intersect(self, Rect rect) -> Rect
1286
1287 Returns the intersectsion of this rectangle and rect.
1288 """
1289 return _core_.Rect_Intersect(*args, **kwargs)
1290
1291 def Union(*args, **kwargs):
1292 """
1293 Union(self, Rect rect) -> Rect
1294
1295 Returns the union of this rectangle and rect.
1296 """
1297 return _core_.Rect_Union(*args, **kwargs)
1298
1299 def __add__(*args, **kwargs):
1300 """
1301 __add__(self, Rect rect) -> Rect
1302
1303 Add the properties of rect to this rectangle and return the result.
1304 """
1305 return _core_.Rect___add__(*args, **kwargs)
1306
1307 def __iadd__(*args, **kwargs):
1308 """
1309 __iadd__(self, Rect rect) -> Rect
1310
1311 Add the properties of rect to this rectangle, updating this rectangle.
1312 """
1313 return _core_.Rect___iadd__(*args, **kwargs)
1314
1315 def __eq__(*args, **kwargs):
1316 """
1317 __eq__(self, PyObject other) -> bool
1318
1319 Test for equality of wx.Rect objects.
1320 """
1321 return _core_.Rect___eq__(*args, **kwargs)
1322
1323 def __ne__(*args, **kwargs):
1324 """
1325 __ne__(self, PyObject other) -> bool
1326
1327 Test for inequality of wx.Rect objects.
1328 """
1329 return _core_.Rect___ne__(*args, **kwargs)
1330
1331 def InsideXY(*args, **kwargs):
1332 """
1333 InsideXY(self, int x, int y) -> bool
1334
1335 Return True if the point is (not strcitly) inside the rect.
1336 """
1337 return _core_.Rect_InsideXY(*args, **kwargs)
1338
1339 def Inside(*args, **kwargs):
1340 """
1341 Inside(self, Point pt) -> bool
1342
1343 Return True if the point is (not strcitly) inside the rect.
1344 """
1345 return _core_.Rect_Inside(*args, **kwargs)
1346
1347 def InsideRect(*args, **kwargs):
1348 """
1349 InsideRect(self, Rect rect) -> bool
1350
1351 Returns ``True`` if the given rectangle is completely inside this
1352 rectangle or touches its boundary.
1353 """
1354 return _core_.Rect_InsideRect(*args, **kwargs)
1355
1356 def Intersects(*args, **kwargs):
1357 """
1358 Intersects(self, Rect rect) -> bool
1359
1360 Returns True if the rectangles have a non empty intersection.
1361 """
1362 return _core_.Rect_Intersects(*args, **kwargs)
1363
1364 def CenterIn(*args, **kwargs):
1365 """
1366 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1367
1368 Center this rectangle within the one passed to the method, which is
1369 usually, but not necessarily, the larger one.
1370 """
1371 return _core_.Rect_CenterIn(*args, **kwargs)
1372
1373 CentreIn = CenterIn
1374 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1375 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1376 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1377 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1378 def Set(*args, **kwargs):
1379 """
1380 Set(self, int x=0, int y=0, int width=0, int height=0)
1381
1382 Set all rectangle properties.
1383 """
1384 return _core_.Rect_Set(*args, **kwargs)
1385
1386 def Get(*args, **kwargs):
1387 """
1388 Get() -> (x,y,width,height)
1389
1390 Return the rectangle properties as a tuple.
1391 """
1392 return _core_.Rect_Get(*args, **kwargs)
1393
1394 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1395 def __str__(self): return str(self.Get())
1396 def __repr__(self): return 'wx.Rect'+str(self.Get())
1397 def __len__(self): return len(self.Get())
1398 def __getitem__(self, index): return self.Get()[index]
1399 def __setitem__(self, index, val):
1400 if index == 0: self.x = val
1401 elif index == 1: self.y = val
1402 elif index == 2: self.width = val
1403 elif index == 3: self.height = val
1404 else: raise IndexError
1405 def __nonzero__(self): return self.Get() != (0,0,0,0)
1406 __safe_for_unpickling__ = True
1407 def __reduce__(self): return (wx.Rect, self.Get())
1408
1409 _core_.Rect_swigregister(Rect)
1410
1411 def RectPP(*args, **kwargs):
1412 """
1413 RectPP(Point topLeft, Point bottomRight) -> Rect
1414
1415 Create a new Rect object from Points representing two corners.
1416 """
1417 val = _core_.new_RectPP(*args, **kwargs)
1418 return val
1419
1420 def RectPS(*args, **kwargs):
1421 """
1422 RectPS(Point pos, Size size) -> Rect
1423
1424 Create a new Rect from a position and size.
1425 """
1426 val = _core_.new_RectPS(*args, **kwargs)
1427 return val
1428
1429 def RectS(*args, **kwargs):
1430 """
1431 RectS(Size size) -> Rect
1432
1433 Create a new Rect from a size only.
1434 """
1435 val = _core_.new_RectS(*args, **kwargs)
1436 return val
1437
1438
1439 def IntersectRect(*args, **kwargs):
1440 """
1441 IntersectRect(Rect r1, Rect r2) -> Rect
1442
1443 Calculate and return the intersection of r1 and r2.
1444 """
1445 return _core_.IntersectRect(*args, **kwargs)
1446 #---------------------------------------------------------------------------
1447
1448 class Point2D(object):
1449 """
1450 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1451 with floating point values.
1452 """
1453 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1454 __repr__ = _swig_repr
1455 def __init__(self, *args, **kwargs):
1456 """
1457 __init__(self, double x=0.0, double y=0.0) -> Point2D
1458
1459 Create a w.Point2D object.
1460 """
1461 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1462 def GetFloor(*args, **kwargs):
1463 """
1464 GetFloor() -> (x,y)
1465
1466 Convert to integer
1467 """
1468 return _core_.Point2D_GetFloor(*args, **kwargs)
1469
1470 def GetRounded(*args, **kwargs):
1471 """
1472 GetRounded() -> (x,y)
1473
1474 Convert to integer
1475 """
1476 return _core_.Point2D_GetRounded(*args, **kwargs)
1477
1478 def GetVectorLength(*args, **kwargs):
1479 """GetVectorLength(self) -> double"""
1480 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1481
1482 def GetVectorAngle(*args, **kwargs):
1483 """GetVectorAngle(self) -> double"""
1484 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1485
1486 def SetVectorLength(*args, **kwargs):
1487 """SetVectorLength(self, double length)"""
1488 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1489
1490 def SetVectorAngle(*args, **kwargs):
1491 """SetVectorAngle(self, double degrees)"""
1492 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1493
1494 def SetPolarCoordinates(self, angle, length):
1495 self.SetVectorLength(length)
1496 self.SetVectorAngle(angle)
1497 def Normalize(self):
1498 self.SetVectorLength(1.0)
1499
1500 def GetDistance(*args, **kwargs):
1501 """GetDistance(self, Point2D pt) -> double"""
1502 return _core_.Point2D_GetDistance(*args, **kwargs)
1503
1504 def GetDistanceSquare(*args, **kwargs):
1505 """GetDistanceSquare(self, Point2D pt) -> double"""
1506 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1507
1508 def GetDotProduct(*args, **kwargs):
1509 """GetDotProduct(self, Point2D vec) -> double"""
1510 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1511
1512 def GetCrossProduct(*args, **kwargs):
1513 """GetCrossProduct(self, Point2D vec) -> double"""
1514 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1515
1516 def __neg__(*args, **kwargs):
1517 """
1518 __neg__(self) -> Point2D
1519
1520 the reflection of this point
1521 """
1522 return _core_.Point2D___neg__(*args, **kwargs)
1523
1524 def __iadd__(*args, **kwargs):
1525 """__iadd__(self, Point2D pt) -> Point2D"""
1526 return _core_.Point2D___iadd__(*args, **kwargs)
1527
1528 def __isub__(*args, **kwargs):
1529 """__isub__(self, Point2D pt) -> Point2D"""
1530 return _core_.Point2D___isub__(*args, **kwargs)
1531
1532 def __imul__(*args, **kwargs):
1533 """__imul__(self, Point2D pt) -> Point2D"""
1534 return _core_.Point2D___imul__(*args, **kwargs)
1535
1536 def __idiv__(*args, **kwargs):
1537 """__idiv__(self, Point2D pt) -> Point2D"""
1538 return _core_.Point2D___idiv__(*args, **kwargs)
1539
1540 def __eq__(*args, **kwargs):
1541 """
1542 __eq__(self, PyObject other) -> bool
1543
1544 Test for equality of wx.Point2D objects.
1545 """
1546 return _core_.Point2D___eq__(*args, **kwargs)
1547
1548 def __ne__(*args, **kwargs):
1549 """
1550 __ne__(self, PyObject other) -> bool
1551
1552 Test for inequality of wx.Point2D objects.
1553 """
1554 return _core_.Point2D___ne__(*args, **kwargs)
1555
1556 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1557 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1558 def Set(*args, **kwargs):
1559 """Set(self, double x=0, double y=0)"""
1560 return _core_.Point2D_Set(*args, **kwargs)
1561
1562 def Get(*args, **kwargs):
1563 """
1564 Get() -> (x,y)
1565
1566 Return x and y properties as a tuple.
1567 """
1568 return _core_.Point2D_Get(*args, **kwargs)
1569
1570 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1571 def __str__(self): return str(self.Get())
1572 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1573 def __len__(self): return len(self.Get())
1574 def __getitem__(self, index): return self.Get()[index]
1575 def __setitem__(self, index, val):
1576 if index == 0: self.x = val
1577 elif index == 1: self.y = val
1578 else: raise IndexError
1579 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1580 __safe_for_unpickling__ = True
1581 def __reduce__(self): return (wx.Point2D, self.Get())
1582
1583 _core_.Point2D_swigregister(Point2D)
1584
1585 def Point2DCopy(*args, **kwargs):
1586 """
1587 Point2DCopy(Point2D pt) -> Point2D
1588
1589 Create a w.Point2D object.
1590 """
1591 val = _core_.new_Point2DCopy(*args, **kwargs)
1592 return val
1593
1594 def Point2DFromPoint(*args, **kwargs):
1595 """
1596 Point2DFromPoint(Point pt) -> Point2D
1597
1598 Create a w.Point2D object.
1599 """
1600 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1601 return val
1602
1603 #---------------------------------------------------------------------------
1604
1605 FromStart = _core_.FromStart
1606 FromCurrent = _core_.FromCurrent
1607 FromEnd = _core_.FromEnd
1608 class InputStream(object):
1609 """Proxy of C++ InputStream class"""
1610 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1611 __repr__ = _swig_repr
1612 def __init__(self, *args, **kwargs):
1613 """__init__(self, PyObject p) -> InputStream"""
1614 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1615 __swig_destroy__ = _core_.delete_InputStream
1616 __del__ = lambda self : None;
1617 def close(*args, **kwargs):
1618 """close(self)"""
1619 return _core_.InputStream_close(*args, **kwargs)
1620
1621 def flush(*args, **kwargs):
1622 """flush(self)"""
1623 return _core_.InputStream_flush(*args, **kwargs)
1624
1625 def eof(*args, **kwargs):
1626 """eof(self) -> bool"""
1627 return _core_.InputStream_eof(*args, **kwargs)
1628
1629 def read(*args, **kwargs):
1630 """read(self, int size=-1) -> PyObject"""
1631 return _core_.InputStream_read(*args, **kwargs)
1632
1633 def readline(*args, **kwargs):
1634 """readline(self, int size=-1) -> PyObject"""
1635 return _core_.InputStream_readline(*args, **kwargs)
1636
1637 def readlines(*args, **kwargs):
1638 """readlines(self, int sizehint=-1) -> PyObject"""
1639 return _core_.InputStream_readlines(*args, **kwargs)
1640
1641 def seek(*args, **kwargs):
1642 """seek(self, int offset, int whence=0)"""
1643 return _core_.InputStream_seek(*args, **kwargs)
1644
1645 def tell(*args, **kwargs):
1646 """tell(self) -> int"""
1647 return _core_.InputStream_tell(*args, **kwargs)
1648
1649 def Peek(*args, **kwargs):
1650 """Peek(self) -> char"""
1651 return _core_.InputStream_Peek(*args, **kwargs)
1652
1653 def GetC(*args, **kwargs):
1654 """GetC(self) -> char"""
1655 return _core_.InputStream_GetC(*args, **kwargs)
1656
1657 def LastRead(*args, **kwargs):
1658 """LastRead(self) -> size_t"""
1659 return _core_.InputStream_LastRead(*args, **kwargs)
1660
1661 def CanRead(*args, **kwargs):
1662 """CanRead(self) -> bool"""
1663 return _core_.InputStream_CanRead(*args, **kwargs)
1664
1665 def Eof(*args, **kwargs):
1666 """Eof(self) -> bool"""
1667 return _core_.InputStream_Eof(*args, **kwargs)
1668
1669 def Ungetch(*args, **kwargs):
1670 """Ungetch(self, char c) -> bool"""
1671 return _core_.InputStream_Ungetch(*args, **kwargs)
1672
1673 def SeekI(*args, **kwargs):
1674 """SeekI(self, long pos, int mode=FromStart) -> long"""
1675 return _core_.InputStream_SeekI(*args, **kwargs)
1676
1677 def TellI(*args, **kwargs):
1678 """TellI(self) -> long"""
1679 return _core_.InputStream_TellI(*args, **kwargs)
1680
1681 _core_.InputStream_swigregister(InputStream)
1682 DefaultPosition = cvar.DefaultPosition
1683 DefaultSize = cvar.DefaultSize
1684
1685 class OutputStream(object):
1686 """Proxy of C++ OutputStream class"""
1687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1688 def __init__(self): raise AttributeError, "No constructor defined"
1689 __repr__ = _swig_repr
1690 def write(*args, **kwargs):
1691 """write(self, PyObject obj)"""
1692 return _core_.OutputStream_write(*args, **kwargs)
1693
1694 def LastWrite(*args, **kwargs):
1695 """LastWrite(self) -> size_t"""
1696 return _core_.OutputStream_LastWrite(*args, **kwargs)
1697
1698 _core_.OutputStream_swigregister(OutputStream)
1699
1700 #---------------------------------------------------------------------------
1701
1702 class FSFile(Object):
1703 """Proxy of C++ FSFile class"""
1704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1705 __repr__ = _swig_repr
1706 def __init__(self, *args, **kwargs):
1707 """
1708 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1709 DateTime modif) -> FSFile
1710 """
1711 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1712 __swig_destroy__ = _core_.delete_FSFile
1713 __del__ = lambda self : None;
1714 def GetStream(*args, **kwargs):
1715 """GetStream(self) -> InputStream"""
1716 return _core_.FSFile_GetStream(*args, **kwargs)
1717
1718 def DetachStream(*args, **kwargs):
1719 """DetachStream(self)"""
1720 return _core_.FSFile_DetachStream(*args, **kwargs)
1721
1722 def GetMimeType(*args, **kwargs):
1723 """GetMimeType(self) -> String"""
1724 return _core_.FSFile_GetMimeType(*args, **kwargs)
1725
1726 def GetLocation(*args, **kwargs):
1727 """GetLocation(self) -> String"""
1728 return _core_.FSFile_GetLocation(*args, **kwargs)
1729
1730 def GetAnchor(*args, **kwargs):
1731 """GetAnchor(self) -> String"""
1732 return _core_.FSFile_GetAnchor(*args, **kwargs)
1733
1734 def GetModificationTime(*args, **kwargs):
1735 """GetModificationTime(self) -> DateTime"""
1736 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1737
1738 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1739 Location = property(GetLocation,doc="See `GetLocation`")
1740 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1741 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1742 Stream = property(GetStream,doc="See `GetStream`")
1743 _core_.FSFile_swigregister(FSFile)
1744
1745 class CPPFileSystemHandler(object):
1746 """Proxy of C++ CPPFileSystemHandler class"""
1747 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1748 def __init__(self): raise AttributeError, "No constructor defined"
1749 __repr__ = _swig_repr
1750 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1751 __del__ = lambda self : None;
1752 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1753
1754 class FileSystemHandler(CPPFileSystemHandler):
1755 """Proxy of C++ FileSystemHandler class"""
1756 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1757 __repr__ = _swig_repr
1758 def __init__(self, *args, **kwargs):
1759 """__init__(self) -> FileSystemHandler"""
1760 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1761 self._setCallbackInfo(self, FileSystemHandler)
1762
1763 def _setCallbackInfo(*args, **kwargs):
1764 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1765 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1766
1767 def CanOpen(*args, **kwargs):
1768 """CanOpen(self, String location) -> bool"""
1769 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1770
1771 def OpenFile(*args, **kwargs):
1772 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1773 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1774
1775 def FindFirst(*args, **kwargs):
1776 """FindFirst(self, String spec, int flags=0) -> String"""
1777 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1778
1779 def FindNext(*args, **kwargs):
1780 """FindNext(self) -> String"""
1781 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1782
1783 def GetProtocol(*args, **kwargs):
1784 """GetProtocol(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1786
1787 def GetLeftLocation(*args, **kwargs):
1788 """GetLeftLocation(self, String location) -> String"""
1789 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1790
1791 def GetAnchor(*args, **kwargs):
1792 """GetAnchor(self, String location) -> String"""
1793 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1794
1795 def GetRightLocation(*args, **kwargs):
1796 """GetRightLocation(self, String location) -> String"""
1797 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1798
1799 def GetMimeTypeFromExt(*args, **kwargs):
1800 """GetMimeTypeFromExt(self, String location) -> String"""
1801 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1802
1803 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1804 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1805 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1806 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1807 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
1808 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1809
1810 class FileSystem(Object):
1811 """Proxy of C++ FileSystem class"""
1812 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1813 __repr__ = _swig_repr
1814 def __init__(self, *args, **kwargs):
1815 """__init__(self) -> FileSystem"""
1816 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1817 __swig_destroy__ = _core_.delete_FileSystem
1818 __del__ = lambda self : None;
1819 def ChangePathTo(*args, **kwargs):
1820 """ChangePathTo(self, String location, bool is_dir=False)"""
1821 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1822
1823 def GetPath(*args, **kwargs):
1824 """GetPath(self) -> String"""
1825 return _core_.FileSystem_GetPath(*args, **kwargs)
1826
1827 def OpenFile(*args, **kwargs):
1828 """OpenFile(self, String location) -> FSFile"""
1829 return _core_.FileSystem_OpenFile(*args, **kwargs)
1830
1831 def FindFirst(*args, **kwargs):
1832 """FindFirst(self, String spec, int flags=0) -> String"""
1833 return _core_.FileSystem_FindFirst(*args, **kwargs)
1834
1835 def FindNext(*args, **kwargs):
1836 """FindNext(self) -> String"""
1837 return _core_.FileSystem_FindNext(*args, **kwargs)
1838
1839 def AddHandler(*args, **kwargs):
1840 """AddHandler(CPPFileSystemHandler handler)"""
1841 return _core_.FileSystem_AddHandler(*args, **kwargs)
1842
1843 AddHandler = staticmethod(AddHandler)
1844 def RemoveHandler(*args, **kwargs):
1845 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1846 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1847
1848 RemoveHandler = staticmethod(RemoveHandler)
1849 def CleanUpHandlers(*args, **kwargs):
1850 """CleanUpHandlers()"""
1851 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1852
1853 CleanUpHandlers = staticmethod(CleanUpHandlers)
1854 def FileNameToURL(*args, **kwargs):
1855 """FileNameToURL(String filename) -> String"""
1856 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1857
1858 FileNameToURL = staticmethod(FileNameToURL)
1859 def URLToFileName(*args, **kwargs):
1860 """URLToFileName(String url) -> String"""
1861 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1862
1863 URLToFileName = staticmethod(URLToFileName)
1864 Path = property(GetPath,doc="See `GetPath`")
1865 _core_.FileSystem_swigregister(FileSystem)
1866
1867 def FileSystem_AddHandler(*args, **kwargs):
1868 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1869 return _core_.FileSystem_AddHandler(*args, **kwargs)
1870
1871 def FileSystem_RemoveHandler(*args, **kwargs):
1872 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1873 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1874
1875 def FileSystem_CleanUpHandlers(*args):
1876 """FileSystem_CleanUpHandlers()"""
1877 return _core_.FileSystem_CleanUpHandlers(*args)
1878
1879 def FileSystem_FileNameToURL(*args, **kwargs):
1880 """FileSystem_FileNameToURL(String filename) -> String"""
1881 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1882
1883 def FileSystem_URLToFileName(*args, **kwargs):
1884 """FileSystem_URLToFileName(String url) -> String"""
1885 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1886
1887 class InternetFSHandler(CPPFileSystemHandler):
1888 """Proxy of C++ InternetFSHandler class"""
1889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1890 __repr__ = _swig_repr
1891 def __init__(self, *args, **kwargs):
1892 """__init__(self) -> InternetFSHandler"""
1893 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1894 def CanOpen(*args, **kwargs):
1895 """CanOpen(self, String location) -> bool"""
1896 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1897
1898 def OpenFile(*args, **kwargs):
1899 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1900 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1901
1902 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1903
1904 class ZipFSHandler(CPPFileSystemHandler):
1905 """Proxy of C++ ZipFSHandler class"""
1906 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1907 __repr__ = _swig_repr
1908 def __init__(self, *args, **kwargs):
1909 """__init__(self) -> ZipFSHandler"""
1910 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1911 def CanOpen(*args, **kwargs):
1912 """CanOpen(self, String location) -> bool"""
1913 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1914
1915 def OpenFile(*args, **kwargs):
1916 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1917 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1918
1919 def FindFirst(*args, **kwargs):
1920 """FindFirst(self, String spec, int flags=0) -> String"""
1921 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1922
1923 def FindNext(*args, **kwargs):
1924 """FindNext(self) -> String"""
1925 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1926
1927 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1928
1929
1930 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1931 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1932 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1933
1934 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1935 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1936 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1937
1938 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1939 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1940 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1941 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1942 """
1943 Add 'file' to the memory filesystem. The dataItem parameter can
1944 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1945 arbitrary data. If a bitmap or image is used then the imgType
1946 parameter should specify what kind of image file it should be
1947 written as, wx.BITMAP_TYPE_PNG, etc.
1948 """
1949 if isinstance(dataItem, wx.Image):
1950 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1951 elif isinstance(dataItem, wx.Bitmap):
1952 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1953 elif type(dataItem) == str:
1954 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1955 else:
1956 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1957
1958 class MemoryFSHandler(CPPFileSystemHandler):
1959 """Proxy of C++ MemoryFSHandler class"""
1960 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1961 __repr__ = _swig_repr
1962 def __init__(self, *args, **kwargs):
1963 """__init__(self) -> MemoryFSHandler"""
1964 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1965 def RemoveFile(*args, **kwargs):
1966 """RemoveFile(String filename)"""
1967 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1968
1969 RemoveFile = staticmethod(RemoveFile)
1970 AddFile = staticmethod(MemoryFSHandler_AddFile)
1971 def CanOpen(*args, **kwargs):
1972 """CanOpen(self, String location) -> bool"""
1973 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1974
1975 def OpenFile(*args, **kwargs):
1976 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1977 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1978
1979 def FindFirst(*args, **kwargs):
1980 """FindFirst(self, String spec, int flags=0) -> String"""
1981 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1982
1983 def FindNext(*args, **kwargs):
1984 """FindNext(self) -> String"""
1985 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1986
1987 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1988
1989 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1990 """MemoryFSHandler_RemoveFile(String filename)"""
1991 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1992
1993 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1994 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1995 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1996 #---------------------------------------------------------------------------
1997
1998 class ImageHandler(Object):
1999 """
2000 This is the base class for implementing image file loading/saving, and
2001 image creation from data. It is used within `wx.Image` and is not
2002 normally seen by the application.
2003 """
2004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2005 def __init__(self): raise AttributeError, "No constructor defined"
2006 __repr__ = _swig_repr
2007 def GetName(*args, **kwargs):
2008 """GetName(self) -> String"""
2009 return _core_.ImageHandler_GetName(*args, **kwargs)
2010
2011 def GetExtension(*args, **kwargs):
2012 """GetExtension(self) -> String"""
2013 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2014
2015 def GetType(*args, **kwargs):
2016 """GetType(self) -> long"""
2017 return _core_.ImageHandler_GetType(*args, **kwargs)
2018
2019 def GetMimeType(*args, **kwargs):
2020 """GetMimeType(self) -> String"""
2021 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2022
2023 def CanRead(*args, **kwargs):
2024 """CanRead(self, String name) -> bool"""
2025 return _core_.ImageHandler_CanRead(*args, **kwargs)
2026
2027 def CanReadStream(*args, **kwargs):
2028 """CanReadStream(self, InputStream stream) -> bool"""
2029 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2030
2031 def SetName(*args, **kwargs):
2032 """SetName(self, String name)"""
2033 return _core_.ImageHandler_SetName(*args, **kwargs)
2034
2035 def SetExtension(*args, **kwargs):
2036 """SetExtension(self, String extension)"""
2037 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2038
2039 def SetType(*args, **kwargs):
2040 """SetType(self, long type)"""
2041 return _core_.ImageHandler_SetType(*args, **kwargs)
2042
2043 def SetMimeType(*args, **kwargs):
2044 """SetMimeType(self, String mimetype)"""
2045 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2046
2047 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2048 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2049 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2050 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2051 _core_.ImageHandler_swigregister(ImageHandler)
2052
2053 class PyImageHandler(ImageHandler):
2054 """
2055 This is the base class for implementing image file loading/saving, and
2056 image creation from data, all written in Python. To create a custom
2057 image handler derive a new class from wx.PyImageHandler and provide
2058 the following methods::
2059
2060 def DoCanRead(self, stream) --> bool
2061 '''Check if this handler can read the image on the stream'''
2062
2063 def LoadFile(self, image, stream, verbose, index) --> bool
2064 '''Load image data from the stream and load it into image.'''
2065
2066 def SaveFile(self, image, stream, verbose) --> bool
2067 '''Save the iamge data in image to the stream using
2068 this handler's image file format.'''
2069
2070 def GetImageCount(self, stream) --> int
2071 '''If this image format can hold more than one image,
2072 how many does the image on the stream have?'''
2073
2074 To activate your handler create an instance of it and pass it to
2075 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2076 `SetExtension` from your constructor.
2077
2078 """
2079 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2080 __repr__ = _swig_repr
2081 def __init__(self, *args, **kwargs):
2082 """
2083 __init__(self) -> PyImageHandler
2084
2085 This is the base class for implementing image file loading/saving, and
2086 image creation from data, all written in Python. To create a custom
2087 image handler derive a new class from wx.PyImageHandler and provide
2088 the following methods::
2089
2090 def DoCanRead(self, stream) --> bool
2091 '''Check if this handler can read the image on the stream'''
2092
2093 def LoadFile(self, image, stream, verbose, index) --> bool
2094 '''Load image data from the stream and load it into image.'''
2095
2096 def SaveFile(self, image, stream, verbose) --> bool
2097 '''Save the iamge data in image to the stream using
2098 this handler's image file format.'''
2099
2100 def GetImageCount(self, stream) --> int
2101 '''If this image format can hold more than one image,
2102 how many does the image on the stream have?'''
2103
2104 To activate your handler create an instance of it and pass it to
2105 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2106 `SetExtension` from your constructor.
2107
2108 """
2109 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2110 self._SetSelf(self)
2111
2112 def _SetSelf(*args, **kwargs):
2113 """_SetSelf(self, PyObject self)"""
2114 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2115
2116 _core_.PyImageHandler_swigregister(PyImageHandler)
2117
2118 class ImageHistogram(object):
2119 """Proxy of C++ ImageHistogram class"""
2120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2121 __repr__ = _swig_repr
2122 def __init__(self, *args, **kwargs):
2123 """__init__(self) -> ImageHistogram"""
2124 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2125 def MakeKey(*args, **kwargs):
2126 """
2127 MakeKey(byte r, byte g, byte b) -> unsigned long
2128
2129 Get the key in the histogram for the given RGB values
2130 """
2131 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2132
2133 MakeKey = staticmethod(MakeKey)
2134 def FindFirstUnusedColour(*args, **kwargs):
2135 """
2136 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2137
2138 Find first colour that is not used in the image and has higher RGB
2139 values than startR, startG, startB. Returns a tuple consisting of a
2140 success flag and rgb values.
2141 """
2142 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2143
2144 def GetCount(*args, **kwargs):
2145 """
2146 GetCount(self, unsigned long key) -> unsigned long
2147
2148 Returns the pixel count for the given key. Use `MakeKey` to create a
2149 key value from a RGB tripple.
2150 """
2151 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2152
2153 def GetCountRGB(*args, **kwargs):
2154 """
2155 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2156
2157 Returns the pixel count for the given RGB values.
2158 """
2159 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2160
2161 def GetCountColour(*args, **kwargs):
2162 """
2163 GetCountColour(self, Colour colour) -> unsigned long
2164
2165 Returns the pixel count for the given `wx.Colour` value.
2166 """
2167 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2168
2169 _core_.ImageHistogram_swigregister(ImageHistogram)
2170
2171 def ImageHistogram_MakeKey(*args, **kwargs):
2172 """
2173 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2174
2175 Get the key in the histogram for the given RGB values
2176 """
2177 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2178
2179 class Image_RGBValue(object):
2180 """
2181 An object that contains values for red, green and blue which represent
2182 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2183 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2184 color space.
2185 """
2186 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2187 __repr__ = _swig_repr
2188 def __init__(self, *args, **kwargs):
2189 """
2190 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2191
2192 Constructor.
2193 """
2194 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2195 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2196 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2197 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2198 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2199
2200 class Image_HSVValue(object):
2201 """
2202 An object that contains values for hue, saturation and value which
2203 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2204 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2205 color space.
2206 """
2207 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2208 __repr__ = _swig_repr
2209 def __init__(self, *args, **kwargs):
2210 """
2211 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2212
2213 Constructor.
2214 """
2215 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2216 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2217 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2218 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2219 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2220
2221 class Image(Object):
2222 """
2223 A platform-independent image class. An image can be created from
2224 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2225 variety of formats. Functions are available to set and get image
2226 bits, so it can be used for basic image manipulation.
2227
2228 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2229 platform-specific `wx.Bitmap` object must be created from it using the
2230 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2231 device context, using `wx.DC.DrawBitmap`.
2232
2233 One colour value of the image may be used as a mask colour which will
2234 lead to the automatic creation of a `wx.Mask` object associated to the
2235 bitmap object.
2236
2237 wx.Image supports alpha channel data, that is in addition to a byte
2238 for the red, green and blue colour components for each pixel it also
2239 stores a byte representing the pixel opacity. An alpha value of 0
2240 corresponds to a transparent pixel (null opacity) while a value of 255
2241 means that the pixel is 100% opaque.
2242
2243 Unlike RGB data, not all images have an alpha channel and before using
2244 `GetAlpha` you should check if this image contains an alpha channel
2245 with `HasAlpha`. Note that currently only images loaded from PNG files
2246 with transparency information will have an alpha channel.
2247 """
2248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2249 __repr__ = _swig_repr
2250 def __init__(self, *args, **kwargs):
2251 """
2252 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2253
2254 Loads an image from a file.
2255 """
2256 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2257 __swig_destroy__ = _core_.delete_Image
2258 __del__ = lambda self : None;
2259 def Create(*args, **kwargs):
2260 """
2261 Create(self, int width, int height, bool clear=True)
2262
2263 Creates a fresh image. If clear is ``True``, the new image will be
2264 initialized to black. Otherwise, the image data will be uninitialized.
2265 """
2266 return _core_.Image_Create(*args, **kwargs)
2267
2268 def Destroy(*args, **kwargs):
2269 """
2270 Destroy(self)
2271
2272 Destroys the image data.
2273 """
2274 val = _core_.Image_Destroy(*args, **kwargs)
2275 args[0].thisown = 0
2276 return val
2277
2278 def Scale(*args, **kwargs):
2279 """
2280 Scale(self, int width, int height) -> Image
2281
2282 Returns a scaled version of the image. This is also useful for scaling
2283 bitmaps in general as the only other way to scale bitmaps is to blit a
2284 `wx.MemoryDC` into another `wx.MemoryDC`.
2285 """
2286 return _core_.Image_Scale(*args, **kwargs)
2287
2288 def ShrinkBy(*args, **kwargs):
2289 """
2290 ShrinkBy(self, int xFactor, int yFactor) -> Image
2291
2292 Return a version of the image scaled smaller by the given factors.
2293 """
2294 return _core_.Image_ShrinkBy(*args, **kwargs)
2295
2296 def Rescale(*args, **kwargs):
2297 """
2298 Rescale(self, int width, int height) -> Image
2299
2300 Changes the size of the image in-place by scaling it: after a call to
2301 this function, the image will have the given width and height.
2302
2303 Returns the (modified) image itself.
2304 """
2305 return _core_.Image_Rescale(*args, **kwargs)
2306
2307 def Resize(*args, **kwargs):
2308 """
2309 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2310
2311 Changes the size of the image in-place without scaling it, by adding
2312 either a border with the given colour or cropping as necessary. The
2313 image is pasted into a new image with the given size and background
2314 colour at the position pos relative to the upper left of the new
2315 image. If red = green = blue = -1 then use either the current mask
2316 colour if set or find, use, and set a suitable mask colour for any
2317 newly exposed areas.
2318
2319 Returns the (modified) image itself.
2320 """
2321 return _core_.Image_Resize(*args, **kwargs)
2322
2323 def SetRGB(*args, **kwargs):
2324 """
2325 SetRGB(self, int x, int y, byte r, byte g, byte b)
2326
2327 Sets the pixel at the given coordinate. This routine performs
2328 bounds-checks for the coordinate so it can be considered a safe way to
2329 manipulate the data, but in some cases this might be too slow so that
2330 the data will have to be set directly. In that case you will have to
2331 get access to the image data using the `GetData` method.
2332 """
2333 return _core_.Image_SetRGB(*args, **kwargs)
2334
2335 def SetRGBRect(*args, **kwargs):
2336 """
2337 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2338
2339 Sets the colour of the pixels within the given rectangle. This routine
2340 performs bounds-checks for the rectangle so it can be considered a
2341 safe way to manipulate the data.
2342 """
2343 return _core_.Image_SetRGBRect(*args, **kwargs)
2344
2345 def GetRed(*args, **kwargs):
2346 """
2347 GetRed(self, int x, int y) -> byte
2348
2349 Returns the red intensity at the given coordinate.
2350 """
2351 return _core_.Image_GetRed(*args, **kwargs)
2352
2353 def GetGreen(*args, **kwargs):
2354 """
2355 GetGreen(self, int x, int y) -> byte
2356
2357 Returns the green intensity at the given coordinate.
2358 """
2359 return _core_.Image_GetGreen(*args, **kwargs)
2360
2361 def GetBlue(*args, **kwargs):
2362 """
2363 GetBlue(self, int x, int y) -> byte
2364
2365 Returns the blue intensity at the given coordinate.
2366 """
2367 return _core_.Image_GetBlue(*args, **kwargs)
2368
2369 def SetAlpha(*args, **kwargs):
2370 """
2371 SetAlpha(self, int x, int y, byte alpha)
2372
2373 Sets the alpha value for the given pixel. This function should only be
2374 called if the image has alpha channel data, use `HasAlpha` to check
2375 for this.
2376 """
2377 return _core_.Image_SetAlpha(*args, **kwargs)
2378
2379 def GetAlpha(*args, **kwargs):
2380 """
2381 GetAlpha(self, int x, int y) -> byte
2382
2383 Returns the alpha value for the given pixel. This function may only be
2384 called for the images with alpha channel, use `HasAlpha` to check for
2385 this.
2386
2387 The returned value is the *opacity* of the image, i.e. the value of 0
2388 corresponds to the fully transparent pixels while the value of 255 to
2389 the fully opaque pixels.
2390 """
2391 return _core_.Image_GetAlpha(*args, **kwargs)
2392
2393 def HasAlpha(*args, **kwargs):
2394 """
2395 HasAlpha(self) -> bool
2396
2397 Returns true if this image has alpha channel, false otherwise.
2398 """
2399 return _core_.Image_HasAlpha(*args, **kwargs)
2400
2401 def InitAlpha(*args, **kwargs):
2402 """
2403 InitAlpha(self)
2404
2405 Initializes the image alpha channel data. It is an error to call it if
2406 the image already has alpha data. If it doesn't, alpha data will be by
2407 default initialized to all pixels being fully opaque. But if the image
2408 has a a mask colour, all mask pixels will be completely transparent.
2409 """
2410 return _core_.Image_InitAlpha(*args, **kwargs)
2411
2412 def IsTransparent(*args, **kwargs):
2413 """
2414 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2415
2416 Returns ``True`` if this pixel is masked or has an alpha value less
2417 than the spcified threshold.
2418 """
2419 return _core_.Image_IsTransparent(*args, **kwargs)
2420
2421 def FindFirstUnusedColour(*args, **kwargs):
2422 """
2423 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2424
2425 Find first colour that is not used in the image and has higher RGB
2426 values than startR, startG, startB. Returns a tuple consisting of a
2427 success flag and rgb values.
2428 """
2429 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2430
2431 def ConvertAlphaToMask(*args, **kwargs):
2432 """
2433 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2434
2435 If the image has alpha channel, this method converts it to mask. All
2436 pixels with alpha value less than ``threshold`` are replaced with the
2437 mask colour and the alpha channel is removed. The mask colour is
2438 chosen automatically using `FindFirstUnusedColour`.
2439
2440 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2441 nothing.
2442 """
2443 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2444
2445 def ConvertColourToAlpha(*args, **kwargs):
2446 """
2447 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2448
2449 This method converts an image where the original alpha information is
2450 only available as a shades of a colour (actually shades of grey)
2451 typically when you draw anti-aliased text into a bitmap. The DC
2452 drawing routines draw grey values on the black background although
2453 they actually mean to draw white with differnt alpha values. This
2454 method reverses it, assuming a black (!) background and white text.
2455 The method will then fill up the whole image with the colour given.
2456 """
2457 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2458
2459 def SetMaskFromImage(*args, **kwargs):
2460 """
2461 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2462
2463 Sets the image's mask so that the pixels that have RGB value of
2464 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2465 by first finding an unused colour in the image, setting this colour as
2466 the mask colour and then using this colour to draw all pixels in the
2467 image who corresponding pixel in mask has given RGB value.
2468
2469 Returns ``False`` if ``mask`` does not have same dimensions as the
2470 image or if there is no unused colour left. Returns ``True`` if the
2471 mask was successfully applied.
2472
2473 Note that this method involves computing the histogram, which is
2474 computationally intensive operation.
2475 """
2476 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2477
2478 def CanRead(*args, **kwargs):
2479 """
2480 CanRead(String filename) -> bool
2481
2482 Returns True if the image handlers can read this file.
2483 """
2484 return _core_.Image_CanRead(*args, **kwargs)
2485
2486 CanRead = staticmethod(CanRead)
2487 def GetImageCount(*args, **kwargs):
2488 """
2489 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2490
2491 If the image file contains more than one image and the image handler
2492 is capable of retrieving these individually, this function will return
2493 the number of available images.
2494 """
2495 return _core_.Image_GetImageCount(*args, **kwargs)
2496
2497 GetImageCount = staticmethod(GetImageCount)
2498 def LoadFile(*args, **kwargs):
2499 """
2500 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2501
2502 Loads an image from a file. If no handler type is provided, the
2503 library will try to autodetect the format.
2504 """
2505 return _core_.Image_LoadFile(*args, **kwargs)
2506
2507 def LoadMimeFile(*args, **kwargs):
2508 """
2509 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2510
2511 Loads an image from a file, specifying the image type with a MIME type
2512 string.
2513 """
2514 return _core_.Image_LoadMimeFile(*args, **kwargs)
2515
2516 def SaveFile(*args, **kwargs):
2517 """
2518 SaveFile(self, String name, int type) -> bool
2519
2520 Saves an image in the named file.
2521 """
2522 return _core_.Image_SaveFile(*args, **kwargs)
2523
2524 def SaveMimeFile(*args, **kwargs):
2525 """
2526 SaveMimeFile(self, String name, String mimetype) -> bool
2527
2528 Saves an image in the named file.
2529 """
2530 return _core_.Image_SaveMimeFile(*args, **kwargs)
2531
2532 def CanReadStream(*args, **kwargs):
2533 """
2534 CanReadStream(InputStream stream) -> bool
2535
2536 Returns True if the image handlers can read an image file from the
2537 data currently on the input stream, or a readable Python file-like
2538 object.
2539 """
2540 return _core_.Image_CanReadStream(*args, **kwargs)
2541
2542 CanReadStream = staticmethod(CanReadStream)
2543 def LoadStream(*args, **kwargs):
2544 """
2545 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2546
2547 Loads an image from an input stream or a readable Python file-like
2548 object. If no handler type is provided, the library will try to
2549 autodetect the format.
2550 """
2551 return _core_.Image_LoadStream(*args, **kwargs)
2552
2553 def LoadMimeStream(*args, **kwargs):
2554 """
2555 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2556
2557 Loads an image from an input stream or a readable Python file-like
2558 object, using a MIME type string to specify the image file format.
2559 """
2560 return _core_.Image_LoadMimeStream(*args, **kwargs)
2561
2562 def Ok(*args, **kwargs):
2563 """
2564 Ok(self) -> bool
2565
2566 Returns true if image data is present.
2567 """
2568 return _core_.Image_Ok(*args, **kwargs)
2569
2570 def GetWidth(*args, **kwargs):
2571 """
2572 GetWidth(self) -> int
2573
2574 Gets the width of the image in pixels.
2575 """
2576 return _core_.Image_GetWidth(*args, **kwargs)
2577
2578 def GetHeight(*args, **kwargs):
2579 """
2580 GetHeight(self) -> int
2581
2582 Gets the height of the image in pixels.
2583 """
2584 return _core_.Image_GetHeight(*args, **kwargs)
2585
2586 def GetSize(*args, **kwargs):
2587 """
2588 GetSize(self) -> Size
2589
2590 Returns the size of the image in pixels.
2591 """
2592 return _core_.Image_GetSize(*args, **kwargs)
2593
2594 def GetSubImage(*args, **kwargs):
2595 """
2596 GetSubImage(self, Rect rect) -> Image
2597
2598 Returns a sub image of the current one as long as the rect belongs
2599 entirely to the image.
2600 """
2601 return _core_.Image_GetSubImage(*args, **kwargs)
2602
2603 def Size(*args, **kwargs):
2604 """
2605 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2606
2607 Returns a resized version of this image without scaling it by adding
2608 either a border with the given colour or cropping as necessary. The
2609 image is pasted into a new image with the given size and background
2610 colour at the position ``pos`` relative to the upper left of the new
2611 image. If red = green = blue = -1 then use either the current mask
2612 colour if set or find, use, and set a suitable mask colour for any
2613 newly exposed areas.
2614 """
2615 return _core_.Image_Size(*args, **kwargs)
2616
2617 def Copy(*args, **kwargs):
2618 """
2619 Copy(self) -> Image
2620
2621 Returns an identical copy of the image.
2622 """
2623 return _core_.Image_Copy(*args, **kwargs)
2624
2625 def Paste(*args, **kwargs):
2626 """
2627 Paste(self, Image image, int x, int y)
2628
2629 Pastes ``image`` into this instance and takes care of the mask colour
2630 and any out of bounds problems.
2631 """
2632 return _core_.Image_Paste(*args, **kwargs)
2633
2634 def GetData(*args, **kwargs):
2635 """
2636 GetData(self) -> PyObject
2637
2638 Returns a string containing a copy of the RGB bytes of the image.
2639 """
2640 return _core_.Image_GetData(*args, **kwargs)
2641
2642 def SetData(*args, **kwargs):
2643 """
2644 SetData(self, buffer data)
2645
2646 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2647 either a string or a buffer object holding the data and the length of
2648 the data must be width*height*3.
2649 """
2650 return _core_.Image_SetData(*args, **kwargs)
2651
2652 def GetDataBuffer(*args, **kwargs):
2653 """
2654 GetDataBuffer(self) -> PyObject
2655
2656 Returns a writable Python buffer object that is pointing at the RGB
2657 image data buffer inside the wx.Image. You need to ensure that you do
2658 not use this buffer object after the image has been destroyed.
2659 """
2660 return _core_.Image_GetDataBuffer(*args, **kwargs)
2661
2662 def SetDataBuffer(*args, **kwargs):
2663 """
2664 SetDataBuffer(self, buffer data)
2665
2666 Sets the internal image data pointer to point at a Python buffer
2667 object. This can save making an extra copy of the data but you must
2668 ensure that the buffer object lives longer than the wx.Image does.
2669 """
2670 return _core_.Image_SetDataBuffer(*args, **kwargs)
2671
2672 def GetAlphaData(*args, **kwargs):
2673 """
2674 GetAlphaData(self) -> PyObject
2675
2676 Returns a string containing a copy of the alpha bytes of the image.
2677 """
2678 return _core_.Image_GetAlphaData(*args, **kwargs)
2679
2680 def SetAlphaData(*args, **kwargs):
2681 """
2682 SetAlphaData(self, buffer alpha)
2683
2684 Resets the Image's alpha data from a buffer of bytes. Accepts either
2685 a string or a buffer object holding the data and the length of the
2686 data must be width*height.
2687 """
2688 return _core_.Image_SetAlphaData(*args, **kwargs)
2689
2690 def GetAlphaBuffer(*args, **kwargs):
2691 """
2692 GetAlphaBuffer(self) -> PyObject
2693
2694 Returns a writable Python buffer object that is pointing at the Alpha
2695 data buffer inside the wx.Image. You need to ensure that you do not
2696 use this buffer object after the image has been destroyed.
2697 """
2698 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2699
2700 def SetAlphaBuffer(*args, **kwargs):
2701 """
2702 SetAlphaBuffer(self, buffer alpha)
2703
2704 Sets the internal image alpha pointer to point at a Python buffer
2705 object. This can save making an extra copy of the data but you must
2706 ensure that the buffer object lives as long as the wx.Image does.
2707 """
2708 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2709
2710 def SetMaskColour(*args, **kwargs):
2711 """
2712 SetMaskColour(self, byte r, byte g, byte b)
2713
2714 Sets the mask colour for this image (and tells the image to use the
2715 mask).
2716 """
2717 return _core_.Image_SetMaskColour(*args, **kwargs)
2718
2719 def GetOrFindMaskColour(*args, **kwargs):
2720 """
2721 GetOrFindMaskColour() -> (r,g,b)
2722
2723 Get the current mask colour or find a suitable colour.
2724 """
2725 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2726
2727 def GetMaskRed(*args, **kwargs):
2728 """
2729 GetMaskRed(self) -> byte
2730
2731 Gets the red component of the mask colour.
2732 """
2733 return _core_.Image_GetMaskRed(*args, **kwargs)
2734
2735 def GetMaskGreen(*args, **kwargs):
2736 """
2737 GetMaskGreen(self) -> byte
2738
2739 Gets the green component of the mask colour.
2740 """
2741 return _core_.Image_GetMaskGreen(*args, **kwargs)
2742
2743 def GetMaskBlue(*args, **kwargs):
2744 """
2745 GetMaskBlue(self) -> byte
2746
2747 Gets the blue component of the mask colour.
2748 """
2749 return _core_.Image_GetMaskBlue(*args, **kwargs)
2750
2751 def SetMask(*args, **kwargs):
2752 """
2753 SetMask(self, bool mask=True)
2754
2755 Specifies whether there is a mask or not. The area of the mask is
2756 determined by the current mask colour.
2757 """
2758 return _core_.Image_SetMask(*args, **kwargs)
2759
2760 def HasMask(*args, **kwargs):
2761 """
2762 HasMask(self) -> bool
2763
2764 Returns ``True`` if there is a mask active, ``False`` otherwise.
2765 """
2766 return _core_.Image_HasMask(*args, **kwargs)
2767
2768 def Rotate(*args, **kwargs):
2769 """
2770 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2771 Point offset_after_rotation=None) -> Image
2772
2773 Rotates the image about the given point, by ``angle`` radians. Passing
2774 ``True`` to ``interpolating`` results in better image quality, but is
2775 slower. If the image has a mask, then the mask colour is used for the
2776 uncovered pixels in the rotated image background. Otherwise, black
2777 will be used as the fill colour.
2778
2779 Returns the rotated image, leaving this image intact.
2780 """
2781 return _core_.Image_Rotate(*args, **kwargs)
2782
2783 def Rotate90(*args, **kwargs):
2784 """
2785 Rotate90(self, bool clockwise=True) -> Image
2786
2787 Returns a copy of the image rotated 90 degrees in the direction
2788 indicated by ``clockwise``.
2789 """
2790 return _core_.Image_Rotate90(*args, **kwargs)
2791
2792 def Mirror(*args, **kwargs):
2793 """
2794 Mirror(self, bool horizontally=True) -> Image
2795
2796 Returns a mirrored copy of the image. The parameter ``horizontally``
2797 indicates the orientation.
2798 """
2799 return _core_.Image_Mirror(*args, **kwargs)
2800
2801 def Replace(*args, **kwargs):
2802 """
2803 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2804
2805 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2806 ``(r2,g2,b2)``.
2807 """
2808 return _core_.Image_Replace(*args, **kwargs)
2809
2810 def ConvertToGreyscale(*args, **kwargs):
2811 """
2812 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2813
2814 Convert to greyscale image. Uses the luminance component (Y) of the
2815 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2816 defaults to ITU-T BT.601
2817 """
2818 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2819
2820 def ConvertToMono(*args, **kwargs):
2821 """
2822 ConvertToMono(self, byte r, byte g, byte b) -> Image
2823
2824 Returns monochromatic version of the image. The returned image has
2825 white colour where the original has ``(r,g,b)`` colour and black
2826 colour everywhere else.
2827 """
2828 return _core_.Image_ConvertToMono(*args, **kwargs)
2829
2830 def SetOption(*args, **kwargs):
2831 """
2832 SetOption(self, String name, String value)
2833
2834 Sets an image handler defined option. For example, when saving as a
2835 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2836 number between 0 and 100 (0 is terrible, 100 is very good).
2837 """
2838 return _core_.Image_SetOption(*args, **kwargs)
2839
2840 def SetOptionInt(*args, **kwargs):
2841 """
2842 SetOptionInt(self, String name, int value)
2843
2844 Sets an image option as an integer.
2845 """
2846 return _core_.Image_SetOptionInt(*args, **kwargs)
2847
2848 def GetOption(*args, **kwargs):
2849 """
2850 GetOption(self, String name) -> String
2851
2852 Gets the value of an image handler option.
2853 """
2854 return _core_.Image_GetOption(*args, **kwargs)
2855
2856 def GetOptionInt(*args, **kwargs):
2857 """
2858 GetOptionInt(self, String name) -> int
2859
2860 Gets the value of an image handler option as an integer. If the given
2861 option is not present, the function returns 0.
2862 """
2863 return _core_.Image_GetOptionInt(*args, **kwargs)
2864
2865 def HasOption(*args, **kwargs):
2866 """
2867 HasOption(self, String name) -> bool
2868
2869 Returns true if the given option is present.
2870 """
2871 return _core_.Image_HasOption(*args, **kwargs)
2872
2873 def CountColours(*args, **kwargs):
2874 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2875 return _core_.Image_CountColours(*args, **kwargs)
2876
2877 def ComputeHistogram(*args, **kwargs):
2878 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2879 return _core_.Image_ComputeHistogram(*args, **kwargs)
2880
2881 def AddHandler(*args, **kwargs):
2882 """AddHandler(ImageHandler handler)"""
2883 return _core_.Image_AddHandler(*args, **kwargs)
2884
2885 AddHandler = staticmethod(AddHandler)
2886 def InsertHandler(*args, **kwargs):
2887 """InsertHandler(ImageHandler handler)"""
2888 return _core_.Image_InsertHandler(*args, **kwargs)
2889
2890 InsertHandler = staticmethod(InsertHandler)
2891 def RemoveHandler(*args, **kwargs):
2892 """RemoveHandler(String name) -> bool"""
2893 return _core_.Image_RemoveHandler(*args, **kwargs)
2894
2895 RemoveHandler = staticmethod(RemoveHandler)
2896 def GetHandlers(*args, **kwargs):
2897 """GetHandlers() -> PyObject"""
2898 return _core_.Image_GetHandlers(*args, **kwargs)
2899
2900 GetHandlers = staticmethod(GetHandlers)
2901 def GetImageExtWildcard(*args, **kwargs):
2902 """
2903 GetImageExtWildcard() -> String
2904
2905 Iterates all registered wxImageHandler objects, and returns a string
2906 containing file extension masks suitable for passing to file open/save
2907 dialog boxes.
2908 """
2909 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2910
2911 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2912 def ConvertToBitmap(*args, **kwargs):
2913 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2914 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2915
2916 def ConvertToMonoBitmap(*args, **kwargs):
2917 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2918 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2919
2920 def RotateHue(*args, **kwargs):
2921 """
2922 RotateHue(self, double angle)
2923
2924 Rotates the hue of each pixel of the image. Hue is a double in the
2925 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2926 """
2927 return _core_.Image_RotateHue(*args, **kwargs)
2928
2929 def RGBtoHSV(*args, **kwargs):
2930 """
2931 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2932
2933 Converts a color in RGB color space to HSV color space.
2934 """
2935 return _core_.Image_RGBtoHSV(*args, **kwargs)
2936
2937 RGBtoHSV = staticmethod(RGBtoHSV)
2938 def HSVtoRGB(*args, **kwargs):
2939 """
2940 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2941
2942 Converts a color in HSV color space to RGB color space.
2943 """
2944 return _core_.Image_HSVtoRGB(*args, **kwargs)
2945
2946 HSVtoRGB = staticmethod(HSVtoRGB)
2947 def __nonzero__(self): return self.Ok()
2948 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2949 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
2950 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
2951 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
2952 Height = property(GetHeight,doc="See `GetHeight`")
2953 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
2954 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
2955 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
2956 Size = property(GetSize,doc="See `GetSize`")
2957 Width = property(GetWidth,doc="See `GetWidth`")
2958 _core_.Image_swigregister(Image)
2959
2960 def ImageFromMime(*args, **kwargs):
2961 """
2962 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2963
2964 Loads an image from a file, using a MIME type string (such as
2965 'image/jpeg') to specify image type.
2966 """
2967 val = _core_.new_ImageFromMime(*args, **kwargs)
2968 return val
2969
2970 def ImageFromStream(*args, **kwargs):
2971 """
2972 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2973
2974 Loads an image from an input stream, or any readable Python file-like
2975 object.
2976 """
2977 val = _core_.new_ImageFromStream(*args, **kwargs)
2978 return val
2979
2980 def ImageFromStreamMime(*args, **kwargs):
2981 """
2982 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2983
2984 Loads an image from an input stream, or any readable Python file-like
2985 object, specifying the image format with a MIME type string.
2986 """
2987 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2988 return val
2989
2990 def EmptyImage(*args, **kwargs):
2991 """
2992 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2993
2994 Construct an empty image of a given size, optionally setting all
2995 pixels to black.
2996 """
2997 val = _core_.new_EmptyImage(*args, **kwargs)
2998 return val
2999
3000 def ImageFromBitmap(*args, **kwargs):
3001 """
3002 ImageFromBitmap(Bitmap bitmap) -> Image
3003
3004 Construct an Image from a `wx.Bitmap`.
3005 """
3006 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3007 return val
3008
3009 def ImageFromData(*args, **kwargs):
3010 """
3011 ImageFromData(int width, int height, buffer data) -> Image
3012
3013 Construct an Image from a buffer of RGB bytes. Accepts either a
3014 string or a buffer object holding the data and the length of the data
3015 must be width*height*3.
3016 """
3017 val = _core_.new_ImageFromData(*args, **kwargs)
3018 return val
3019
3020 def ImageFromDataWithAlpha(*args, **kwargs):
3021 """
3022 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3023
3024 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3025 Accepts either a string or a buffer object holding the data and the
3026 length of the data must be width*height*3 bytes, and the length of the
3027 alpha data must be width*height bytes.
3028 """
3029 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3030 return val
3031
3032 def Image_CanRead(*args, **kwargs):
3033 """
3034 Image_CanRead(String filename) -> bool
3035
3036 Returns True if the image handlers can read this file.
3037 """
3038 return _core_.Image_CanRead(*args, **kwargs)
3039
3040 def Image_GetImageCount(*args, **kwargs):
3041 """
3042 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3043
3044 If the image file contains more than one image and the image handler
3045 is capable of retrieving these individually, this function will return
3046 the number of available images.
3047 """
3048 return _core_.Image_GetImageCount(*args, **kwargs)
3049
3050 def Image_CanReadStream(*args, **kwargs):
3051 """
3052 Image_CanReadStream(InputStream stream) -> bool
3053
3054 Returns True if the image handlers can read an image file from the
3055 data currently on the input stream, or a readable Python file-like
3056 object.
3057 """
3058 return _core_.Image_CanReadStream(*args, **kwargs)
3059
3060 def Image_AddHandler(*args, **kwargs):
3061 """Image_AddHandler(ImageHandler handler)"""
3062 return _core_.Image_AddHandler(*args, **kwargs)
3063
3064 def Image_InsertHandler(*args, **kwargs):
3065 """Image_InsertHandler(ImageHandler handler)"""
3066 return _core_.Image_InsertHandler(*args, **kwargs)
3067
3068 def Image_RemoveHandler(*args, **kwargs):
3069 """Image_RemoveHandler(String name) -> bool"""
3070 return _core_.Image_RemoveHandler(*args, **kwargs)
3071
3072 def Image_GetHandlers(*args):
3073 """Image_GetHandlers() -> PyObject"""
3074 return _core_.Image_GetHandlers(*args)
3075
3076 def Image_GetImageExtWildcard(*args):
3077 """
3078 Image_GetImageExtWildcard() -> String
3079
3080 Iterates all registered wxImageHandler objects, and returns a string
3081 containing file extension masks suitable for passing to file open/save
3082 dialog boxes.
3083 """
3084 return _core_.Image_GetImageExtWildcard(*args)
3085
3086 def Image_RGBtoHSV(*args, **kwargs):
3087 """
3088 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3089
3090 Converts a color in RGB color space to HSV color space.
3091 """
3092 return _core_.Image_RGBtoHSV(*args, **kwargs)
3093
3094 def Image_HSVtoRGB(*args, **kwargs):
3095 """
3096 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3097
3098 Converts a color in HSV color space to RGB color space.
3099 """
3100 return _core_.Image_HSVtoRGB(*args, **kwargs)
3101
3102
3103 def _ImageFromBuffer(*args, **kwargs):
3104 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3105 return _core_._ImageFromBuffer(*args, **kwargs)
3106 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3107 """
3108 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3109 parameter must be a Python object that implements the buffer interface,
3110 such as a string, array, etc. The dataBuffer object is expected to
3111 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3112 object can optionally be supplied for the image's alpha channel data, and
3113 it is expected to be width*height bytes long.
3114
3115 The wx.Image will be created with its data and alpha pointers initialized
3116 to the memory address pointed to by the buffer objects, thus saving the
3117 time needed to copy the image data from the buffer object to the wx.Image.
3118 While this has advantages, it also has the shoot-yourself-in-the-foot
3119 risks associated with sharing a C pointer between two objects.
3120
3121 To help alleviate the risk a reference to the data and alpha buffer
3122 objects are kept with the wx.Image, so that they won't get deleted until
3123 after the wx.Image is deleted. However please be aware that it is not
3124 guaranteed that an object won't move its memory buffer to a new location
3125 when it needs to resize its contents. If that happens then the wx.Image
3126 will end up referring to an invalid memory location and could cause the
3127 application to crash. Therefore care should be taken to not manipulate
3128 the objects used for the data and alpha buffers in a way that would cause
3129 them to change size.
3130 """
3131 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3132 image._buffer = dataBuffer
3133 image._alpha = alphaBuffer
3134 return image
3135
3136 def InitAllImageHandlers():
3137 """
3138 The former functionality of InitAllImageHanders is now done internal to
3139 the _core_ extension module and so this function has become a simple NOP.
3140 """
3141 pass
3142
3143 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3144 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3145 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3146 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3147 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3148 BMP_24BPP = _core_.BMP_24BPP
3149 BMP_8BPP = _core_.BMP_8BPP
3150 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3151 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3152 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3153 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3154 BMP_4BPP = _core_.BMP_4BPP
3155 BMP_1BPP = _core_.BMP_1BPP
3156 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3157 class BMPHandler(ImageHandler):
3158 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3159 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3160 __repr__ = _swig_repr
3161 def __init__(self, *args, **kwargs):
3162 """
3163 __init__(self) -> BMPHandler
3164
3165 A `wx.ImageHandler` for \*.bmp bitmap files.
3166 """
3167 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3168 _core_.BMPHandler_swigregister(BMPHandler)
3169 NullImage = cvar.NullImage
3170 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3171 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3172 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3173 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3174 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3175 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3176 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3177 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3178 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3179 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3180 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3181 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3182 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3183 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3184 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3185
3186 class ICOHandler(BMPHandler):
3187 """A `wx.ImageHandler` for \*.ico icon files."""
3188 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3189 __repr__ = _swig_repr
3190 def __init__(self, *args, **kwargs):
3191 """
3192 __init__(self) -> ICOHandler
3193
3194 A `wx.ImageHandler` for \*.ico icon files.
3195 """
3196 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3197 _core_.ICOHandler_swigregister(ICOHandler)
3198
3199 class CURHandler(ICOHandler):
3200 """A `wx.ImageHandler` for \*.cur cursor files."""
3201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3202 __repr__ = _swig_repr
3203 def __init__(self, *args, **kwargs):
3204 """
3205 __init__(self) -> CURHandler
3206
3207 A `wx.ImageHandler` for \*.cur cursor files.
3208 """
3209 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3210 _core_.CURHandler_swigregister(CURHandler)
3211
3212 class ANIHandler(CURHandler):
3213 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3215 __repr__ = _swig_repr
3216 def __init__(self, *args, **kwargs):
3217 """
3218 __init__(self) -> ANIHandler
3219
3220 A `wx.ImageHandler` for \*.ani animated cursor files.
3221 """
3222 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3223 _core_.ANIHandler_swigregister(ANIHandler)
3224
3225 class PNGHandler(ImageHandler):
3226 """A `wx.ImageHandler` for PNG image files."""
3227 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3228 __repr__ = _swig_repr
3229 def __init__(self, *args, **kwargs):
3230 """
3231 __init__(self) -> PNGHandler
3232
3233 A `wx.ImageHandler` for PNG image files.
3234 """
3235 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3236 _core_.PNGHandler_swigregister(PNGHandler)
3237
3238 class GIFHandler(ImageHandler):
3239 """A `wx.ImageHandler` for GIF image files."""
3240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3241 __repr__ = _swig_repr
3242 def __init__(self, *args, **kwargs):
3243 """
3244 __init__(self) -> GIFHandler
3245
3246 A `wx.ImageHandler` for GIF image files.
3247 """
3248 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3249 _core_.GIFHandler_swigregister(GIFHandler)
3250
3251 class PCXHandler(ImageHandler):
3252 """A `wx.ImageHandler` for PCX imager files."""
3253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3254 __repr__ = _swig_repr
3255 def __init__(self, *args, **kwargs):
3256 """
3257 __init__(self) -> PCXHandler
3258
3259 A `wx.ImageHandler` for PCX imager files.
3260 """
3261 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3262 _core_.PCXHandler_swigregister(PCXHandler)
3263
3264 class JPEGHandler(ImageHandler):
3265 """A `wx.ImageHandler` for JPEG/JPG image files."""
3266 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3267 __repr__ = _swig_repr
3268 def __init__(self, *args, **kwargs):
3269 """
3270 __init__(self) -> JPEGHandler
3271
3272 A `wx.ImageHandler` for JPEG/JPG image files.
3273 """
3274 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3275 _core_.JPEGHandler_swigregister(JPEGHandler)
3276
3277 class PNMHandler(ImageHandler):
3278 """A `wx.ImageHandler` for PNM image files."""
3279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3280 __repr__ = _swig_repr
3281 def __init__(self, *args, **kwargs):
3282 """
3283 __init__(self) -> PNMHandler
3284
3285 A `wx.ImageHandler` for PNM image files.
3286 """
3287 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3288 _core_.PNMHandler_swigregister(PNMHandler)
3289
3290 class XPMHandler(ImageHandler):
3291 """A `wx.ImageHandler` for XPM image."""
3292 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3293 __repr__ = _swig_repr
3294 def __init__(self, *args, **kwargs):
3295 """
3296 __init__(self) -> XPMHandler
3297
3298 A `wx.ImageHandler` for XPM image.
3299 """
3300 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3301 _core_.XPMHandler_swigregister(XPMHandler)
3302
3303 class TIFFHandler(ImageHandler):
3304 """A `wx.ImageHandler` for TIFF image files."""
3305 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3306 __repr__ = _swig_repr
3307 def __init__(self, *args, **kwargs):
3308 """
3309 __init__(self) -> TIFFHandler
3310
3311 A `wx.ImageHandler` for TIFF image files.
3312 """
3313 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3314 _core_.TIFFHandler_swigregister(TIFFHandler)
3315
3316 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3317 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3318 class Quantize(object):
3319 """Performs quantization, or colour reduction, on a wxImage."""
3320 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3321 def __init__(self): raise AttributeError, "No constructor defined"
3322 __repr__ = _swig_repr
3323 def Quantize(*args, **kwargs):
3324 """
3325 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3326
3327 Reduce the colours in the source image and put the result into the
3328 destination image, setting the palette in the destination if
3329 needed. Both images may be the same, to overwrite the source image.
3330 """
3331 return _core_.Quantize_Quantize(*args, **kwargs)
3332
3333 Quantize = staticmethod(Quantize)
3334 _core_.Quantize_swigregister(Quantize)
3335
3336 def Quantize_Quantize(*args, **kwargs):
3337 """
3338 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3339
3340 Reduce the colours in the source image and put the result into the
3341 destination image, setting the palette in the destination if
3342 needed. Both images may be the same, to overwrite the source image.
3343 """
3344 return _core_.Quantize_Quantize(*args, **kwargs)
3345
3346 #---------------------------------------------------------------------------
3347
3348 class EvtHandler(Object):
3349 """Proxy of C++ EvtHandler class"""
3350 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3351 __repr__ = _swig_repr
3352 def __init__(self, *args, **kwargs):
3353 """__init__(self) -> EvtHandler"""
3354 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3355 def GetNextHandler(*args, **kwargs):
3356 """GetNextHandler(self) -> EvtHandler"""
3357 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3358
3359 def GetPreviousHandler(*args, **kwargs):
3360 """GetPreviousHandler(self) -> EvtHandler"""
3361 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3362
3363 def SetNextHandler(*args, **kwargs):
3364 """SetNextHandler(self, EvtHandler handler)"""
3365 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3366
3367 def SetPreviousHandler(*args, **kwargs):
3368 """SetPreviousHandler(self, EvtHandler handler)"""
3369 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3370
3371 def GetEvtHandlerEnabled(*args, **kwargs):
3372 """GetEvtHandlerEnabled(self) -> bool"""
3373 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3374
3375 def SetEvtHandlerEnabled(*args, **kwargs):
3376 """SetEvtHandlerEnabled(self, bool enabled)"""
3377 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3378
3379 def ProcessEvent(*args, **kwargs):
3380 """ProcessEvent(self, Event event) -> bool"""
3381 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3382
3383 def AddPendingEvent(*args, **kwargs):
3384 """AddPendingEvent(self, Event event)"""
3385 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3386
3387 def ProcessPendingEvents(*args, **kwargs):
3388 """ProcessPendingEvents(self)"""
3389 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3390
3391 def Connect(*args, **kwargs):
3392 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3393 return _core_.EvtHandler_Connect(*args, **kwargs)
3394
3395 def Disconnect(*args, **kwargs):
3396 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3397 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3398
3399 def _setOORInfo(*args, **kwargs):
3400 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3401 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3402 args[0].thisown = 0
3403 return val
3404
3405 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3406 """
3407 Bind an event to an event handler.
3408
3409 :param event: One of the EVT_* objects that specifies the
3410 type of event to bind,
3411
3412 :param handler: A callable object to be invoked when the
3413 event is delivered to self. Pass None to
3414 disconnect an event handler.
3415
3416 :param source: Sometimes the event originates from a
3417 different window than self, but you still
3418 want to catch it in self. (For example, a
3419 button event delivered to a frame.) By
3420 passing the source of the event, the event
3421 handling system is able to differentiate
3422 between the same event type from different
3423 controls.
3424
3425 :param id: Used to spcify the event source by ID instead
3426 of instance.
3427
3428 :param id2: Used when it is desirable to bind a handler
3429 to a range of IDs, such as with EVT_MENU_RANGE.
3430 """
3431 if source is not None:
3432 id = source.GetId()
3433 event.Bind(self, id, id2, handler)
3434
3435 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3436 """
3437 Disconencts the event handler binding for event from self.
3438 Returns True if successful.
3439 """
3440 if source is not None:
3441 id = source.GetId()
3442 return event.Unbind(self, id, id2)
3443
3444 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3445 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3446 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3447 _core_.EvtHandler_swigregister(EvtHandler)
3448
3449 #---------------------------------------------------------------------------
3450
3451 class PyEventBinder(object):
3452 """
3453 Instances of this class are used to bind specific events to event
3454 handlers.
3455 """
3456 def __init__(self, evtType, expectedIDs=0):
3457 if expectedIDs not in [0, 1, 2]:
3458 raise ValueError, "Invalid number of expectedIDs"
3459 self.expectedIDs = expectedIDs
3460
3461 if type(evtType) == list or type(evtType) == tuple:
3462 self.evtType = evtType
3463 else:
3464 self.evtType = [evtType]
3465
3466
3467 def Bind(self, target, id1, id2, function):
3468 """Bind this set of event types to target."""
3469 for et in self.evtType:
3470 target.Connect(id1, id2, et, function)
3471
3472
3473 def Unbind(self, target, id1, id2):
3474 """Remove an event binding."""
3475 success = 0
3476 for et in self.evtType:
3477 success += target.Disconnect(id1, id2, et)
3478 return success != 0
3479
3480
3481 def __call__(self, *args):
3482 """
3483 For backwards compatibility with the old EVT_* functions.
3484 Should be called with either (window, func), (window, ID,
3485 func) or (window, ID1, ID2, func) parameters depending on the
3486 type of the event.
3487 """
3488 assert len(args) == 2 + self.expectedIDs
3489 id1 = wx.ID_ANY
3490 id2 = wx.ID_ANY
3491 target = args[0]
3492 if self.expectedIDs == 0:
3493 func = args[1]
3494 elif self.expectedIDs == 1:
3495 id1 = args[1]
3496 func = args[2]
3497 elif self.expectedIDs == 2:
3498 id1 = args[1]
3499 id2 = args[2]
3500 func = args[3]
3501 else:
3502 raise ValueError, "Unexpected number of IDs"
3503
3504 self.Bind(target, id1, id2, func)
3505
3506
3507 # These two are square pegs that don't fit the PyEventBinder hole...
3508 def EVT_COMMAND(win, id, cmd, func):
3509 win.Connect(id, -1, cmd, func)
3510 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3511 win.Connect(id1, id2, cmd, func)
3512
3513
3514 #---------------------------------------------------------------------------
3515
3516 #---------------------------------------------------------------------------
3517
3518 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3519 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3520
3521 def NewEventType(*args):
3522 """NewEventType() -> EventType"""
3523 return _core_.NewEventType(*args)
3524 wxEVT_NULL = _core_.wxEVT_NULL
3525 wxEVT_FIRST = _core_.wxEVT_FIRST
3526 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3527 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3528 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3529 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3530 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3531 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3532 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3533 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3534 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3535 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3536 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3537 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3538 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3539 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3540 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3541 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3542 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3543 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3544 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3545 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3546 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3547 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3548 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3549 wxEVT_MOTION = _core_.wxEVT_MOTION
3550 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3551 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3552 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3553 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3554 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3555 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3556 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3557 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3558 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3559 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3560 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3561 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3562 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3563 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3564 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3565 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3566 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3567 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3568 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3569 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3570 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3571 wxEVT_CHAR = _core_.wxEVT_CHAR
3572 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3573 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3574 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3575 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3576 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3577 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3578 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3579 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3580 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3581 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3582 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3583 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3584 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3585 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3586 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3587 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3588 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3589 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3590 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3591 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3592 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3593 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3594 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3595 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3596 wxEVT_SIZE = _core_.wxEVT_SIZE
3597 wxEVT_MOVE = _core_.wxEVT_MOVE
3598 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3599 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3600 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3601 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3602 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3603 wxEVT_CREATE = _core_.wxEVT_CREATE
3604 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3605 wxEVT_SHOW = _core_.wxEVT_SHOW
3606 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3607 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3608 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3609 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3610 wxEVT_PAINT = _core_.wxEVT_PAINT
3611 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3612 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3613 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3614 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3615 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3616 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3617 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3618 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3619 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3620 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3621 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3622 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3623 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3624 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3625 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3626 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3627 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3628 wxEVT_IDLE = _core_.wxEVT_IDLE
3629 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3630 wxEVT_SIZING = _core_.wxEVT_SIZING
3631 wxEVT_MOVING = _core_.wxEVT_MOVING
3632 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3633 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3634 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3635 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3636 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3637 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3638 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3639 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3640 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3641 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3642 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3643 #
3644 # Create some event binders
3645 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3646 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3647 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3648 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3649 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3650 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3651 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3652 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3653 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3654 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3655 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3656 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3657 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3658 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3659 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3660 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3661 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3662 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3663 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3664 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3665 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3666 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3667 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3668 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3669 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3670 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3671 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3672 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3673 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3674 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3675 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3676 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3677 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3678 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3679 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3680 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3681 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3682 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3683 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3684 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3685 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3686 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3687
3688 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3689 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3690 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3691 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3692 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3693 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3694 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3695 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3696 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3697 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3698 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3699 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3700 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3701
3702 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3703 wxEVT_LEFT_UP,
3704 wxEVT_MIDDLE_DOWN,
3705 wxEVT_MIDDLE_UP,
3706 wxEVT_RIGHT_DOWN,
3707 wxEVT_RIGHT_UP,
3708 wxEVT_MOTION,
3709 wxEVT_LEFT_DCLICK,
3710 wxEVT_MIDDLE_DCLICK,
3711 wxEVT_RIGHT_DCLICK,
3712 wxEVT_ENTER_WINDOW,
3713 wxEVT_LEAVE_WINDOW,
3714 wxEVT_MOUSEWHEEL
3715 ])
3716
3717
3718 # Scrolling from wxWindow (sent to wxScrolledWindow)
3719 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3720 wxEVT_SCROLLWIN_BOTTOM,
3721 wxEVT_SCROLLWIN_LINEUP,
3722 wxEVT_SCROLLWIN_LINEDOWN,
3723 wxEVT_SCROLLWIN_PAGEUP,
3724 wxEVT_SCROLLWIN_PAGEDOWN,
3725 wxEVT_SCROLLWIN_THUMBTRACK,
3726 wxEVT_SCROLLWIN_THUMBRELEASE,
3727 ])
3728
3729 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3730 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3731 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3732 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3733 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3734 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3735 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3736 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3737
3738 # Scrolling from wx.Slider and wx.ScrollBar
3739 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3740 wxEVT_SCROLL_BOTTOM,
3741 wxEVT_SCROLL_LINEUP,
3742 wxEVT_SCROLL_LINEDOWN,
3743 wxEVT_SCROLL_PAGEUP,
3744 wxEVT_SCROLL_PAGEDOWN,
3745 wxEVT_SCROLL_THUMBTRACK,
3746 wxEVT_SCROLL_THUMBRELEASE,
3747 wxEVT_SCROLL_CHANGED,
3748 ])
3749
3750 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3751 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3752 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3753 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3754 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3755 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3756 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3757 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3758 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3759 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3760
3761 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3762 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3763 wxEVT_SCROLL_BOTTOM,
3764 wxEVT_SCROLL_LINEUP,
3765 wxEVT_SCROLL_LINEDOWN,
3766 wxEVT_SCROLL_PAGEUP,
3767 wxEVT_SCROLL_PAGEDOWN,
3768 wxEVT_SCROLL_THUMBTRACK,
3769 wxEVT_SCROLL_THUMBRELEASE,
3770 wxEVT_SCROLL_CHANGED,
3771 ], 1)
3772
3773 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3774 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3775 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3776 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3777 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3778 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3779 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3780 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3781 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3782 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3783
3784 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3785 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3786 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3787 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3788 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3789 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3790 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3791 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3792 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3793 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3794
3795 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3796 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3797 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3798 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3799 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3800 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3801 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3802 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3803 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3804
3805
3806 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3807 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3808 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3809 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3810 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3811 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3812 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3813
3814 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3815
3816 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3817 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3818
3819 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3820
3821 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3822 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3823 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3824
3825
3826 #---------------------------------------------------------------------------
3827
3828 class Event(Object):
3829 """
3830 An event is a structure holding information about an event passed to a
3831 callback or member function. wx.Event is an abstract base class for
3832 other event classes
3833 """
3834 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3835 def __init__(self): raise AttributeError, "No constructor defined"
3836 __repr__ = _swig_repr
3837 __swig_destroy__ = _core_.delete_Event
3838 __del__ = lambda self : None;
3839 def SetEventType(*args, **kwargs):
3840 """
3841 SetEventType(self, EventType typ)
3842
3843 Sets the specific type of the event.
3844 """
3845 return _core_.Event_SetEventType(*args, **kwargs)
3846
3847 def GetEventType(*args, **kwargs):
3848 """
3849 GetEventType(self) -> EventType
3850
3851 Returns the identifier of the given event type, such as
3852 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3853 """
3854 return _core_.Event_GetEventType(*args, **kwargs)
3855
3856 def GetEventObject(*args, **kwargs):
3857 """
3858 GetEventObject(self) -> Object
3859
3860 Returns the object (usually a window) associated with the event, if
3861 any.
3862 """
3863 return _core_.Event_GetEventObject(*args, **kwargs)
3864
3865 def SetEventObject(*args, **kwargs):
3866 """
3867 SetEventObject(self, Object obj)
3868
3869 Sets the originating object, or in other words, obj is normally the
3870 object that is sending the event.
3871 """
3872 return _core_.Event_SetEventObject(*args, **kwargs)
3873
3874 def GetTimestamp(*args, **kwargs):
3875 """GetTimestamp(self) -> long"""
3876 return _core_.Event_GetTimestamp(*args, **kwargs)
3877
3878 def SetTimestamp(*args, **kwargs):
3879 """SetTimestamp(self, long ts=0)"""
3880 return _core_.Event_SetTimestamp(*args, **kwargs)
3881
3882 def GetId(*args, **kwargs):
3883 """
3884 GetId(self) -> int
3885
3886 Returns the identifier associated with this event, such as a button
3887 command id.
3888 """
3889 return _core_.Event_GetId(*args, **kwargs)
3890
3891 def SetId(*args, **kwargs):
3892 """
3893 SetId(self, int Id)
3894
3895 Set's the ID for the event. This is usually the ID of the window that
3896 is sending the event, but it can also be a command id from a menu
3897 item, etc.
3898 """
3899 return _core_.Event_SetId(*args, **kwargs)
3900
3901 def IsCommandEvent(*args, **kwargs):
3902 """
3903 IsCommandEvent(self) -> bool
3904
3905 Returns true if the event is or is derived from `wx.CommandEvent` else
3906 it returns false. Note: Exists only for optimization purposes.
3907 """
3908 return _core_.Event_IsCommandEvent(*args, **kwargs)
3909
3910 def Skip(*args, **kwargs):
3911 """
3912 Skip(self, bool skip=True)
3913
3914 Called by an event handler, it controls whether additional event
3915 handlers bound to this event will be called after the current event
3916 handler returns. Skip(false) (the default setting) will prevent
3917 additional event handlers from being called and control will be
3918 returned to the sender of the event immediately after the current
3919 handler has finished. Skip(True) will cause the event processing
3920 system to continue searching for a handler function for this event.
3921
3922 """
3923 return _core_.Event_Skip(*args, **kwargs)
3924
3925 def GetSkipped(*args, **kwargs):
3926 """
3927 GetSkipped(self) -> bool
3928
3929 Returns true if the event handler should be skipped, false otherwise.
3930 :see: `Skip`
3931 """
3932 return _core_.Event_GetSkipped(*args, **kwargs)
3933
3934 def ShouldPropagate(*args, **kwargs):
3935 """
3936 ShouldPropagate(self) -> bool
3937
3938 Test if this event should be propagated to the parent window or not,
3939 i.e. if the propagation level is currently greater than 0.
3940 """
3941 return _core_.Event_ShouldPropagate(*args, **kwargs)
3942
3943 def StopPropagation(*args, **kwargs):
3944 """
3945 StopPropagation(self) -> int
3946
3947 Stop the event from propagating to its parent window. Returns the old
3948 propagation level value which may be later passed to
3949 `ResumePropagation` to allow propagating the event again.
3950 """
3951 return _core_.Event_StopPropagation(*args, **kwargs)
3952
3953 def ResumePropagation(*args, **kwargs):
3954 """
3955 ResumePropagation(self, int propagationLevel)
3956
3957 Resume the event propagation by restoring the propagation level. (For
3958 example, you can use the value returned by an earlier call to
3959 `StopPropagation`.)
3960
3961 """
3962 return _core_.Event_ResumePropagation(*args, **kwargs)
3963
3964 def Clone(*args, **kwargs):
3965 """Clone(self) -> Event"""
3966 return _core_.Event_Clone(*args, **kwargs)
3967
3968 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
3969 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
3970 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
3971 Skipped = property(GetSkipped,doc="See `GetSkipped`")
3972 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
3973 _core_.Event_swigregister(Event)
3974
3975 #---------------------------------------------------------------------------
3976
3977 class PropagationDisabler(object):
3978 """
3979 Helper class to temporarily change an event not to propagate. Simply
3980 create an instance of this class and then whe it is destroyed the
3981 propogation of the event will be restored.
3982 """
3983 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3984 __repr__ = _swig_repr
3985 def __init__(self, *args, **kwargs):
3986 """
3987 __init__(self, Event event) -> PropagationDisabler
3988
3989 Helper class to temporarily change an event not to propagate. Simply
3990 create an instance of this class and then whe it is destroyed the
3991 propogation of the event will be restored.
3992 """
3993 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3994 __swig_destroy__ = _core_.delete_PropagationDisabler
3995 __del__ = lambda self : None;
3996 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3997
3998 class PropagateOnce(object):
3999 """
4000 A helper class that will temporarily lower propagation level of an
4001 event. Simply create an instance of this class and then whe it is
4002 destroyed the propogation of the event will be restored.
4003 """
4004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4005 __repr__ = _swig_repr
4006 def __init__(self, *args, **kwargs):
4007 """
4008 __init__(self, Event event) -> PropagateOnce
4009
4010 A helper class that will temporarily lower propagation level of an
4011 event. Simply create an instance of this class and then whe it is
4012 destroyed the propogation of the event will be restored.
4013 """
4014 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4015 __swig_destroy__ = _core_.delete_PropagateOnce
4016 __del__ = lambda self : None;
4017 _core_.PropagateOnce_swigregister(PropagateOnce)
4018
4019 #---------------------------------------------------------------------------
4020
4021 class CommandEvent(Event):
4022 """
4023 This event class contains information about command events, which
4024 originate from a variety of simple controls, as well as menus and
4025 toolbars.
4026 """
4027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4028 __repr__ = _swig_repr
4029 def __init__(self, *args, **kwargs):
4030 """
4031 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4032
4033 This event class contains information about command events, which
4034 originate from a variety of simple controls, as well as menus and
4035 toolbars.
4036 """
4037 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4038 def GetSelection(*args, **kwargs):
4039 """
4040 GetSelection(self) -> int
4041
4042 Returns item index for a listbox or choice selection event (not valid
4043 for a deselection).
4044 """
4045 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4046
4047 def SetString(*args, **kwargs):
4048 """SetString(self, String s)"""
4049 return _core_.CommandEvent_SetString(*args, **kwargs)
4050
4051 def GetString(*args, **kwargs):
4052 """
4053 GetString(self) -> String
4054
4055 Returns item string for a listbox or choice selection event (not valid
4056 for a deselection).
4057 """
4058 return _core_.CommandEvent_GetString(*args, **kwargs)
4059
4060 def IsChecked(*args, **kwargs):
4061 """
4062 IsChecked(self) -> bool
4063
4064 This method can be used with checkbox and menu events: for the
4065 checkboxes, the method returns true for a selection event and false
4066 for a deselection one. For the menu events, this method indicates if
4067 the menu item just has become checked or unchecked (and thus only
4068 makes sense for checkable menu items).
4069 """
4070 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4071
4072 Checked = IsChecked
4073 def IsSelection(*args, **kwargs):
4074 """
4075 IsSelection(self) -> bool
4076
4077 For a listbox or similar event, returns true if it is a selection,
4078 false if it is a deselection.
4079 """
4080 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4081
4082 def SetExtraLong(*args, **kwargs):
4083 """SetExtraLong(self, long extraLong)"""
4084 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4085
4086 def GetExtraLong(*args, **kwargs):
4087 """
4088 GetExtraLong(self) -> long
4089
4090 Returns extra information dependant on the event objects type. If the
4091 event comes from a listbox selection, it is a boolean determining
4092 whether the event was a selection (true) or a deselection (false). A
4093 listbox deselection only occurs for multiple-selection boxes, and in
4094 this case the index and string values are indeterminate and the
4095 listbox must be examined by the application.
4096 """
4097 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4098
4099 def SetInt(*args, **kwargs):
4100 """SetInt(self, int i)"""
4101 return _core_.CommandEvent_SetInt(*args, **kwargs)
4102
4103 def GetInt(*args, **kwargs):
4104 """
4105 GetInt(self) -> int
4106
4107 Returns the integer identifier corresponding to a listbox, choice or
4108 radiobox selection (only if the event was a selection, not a
4109 deselection), or a boolean value representing the value of a checkbox.
4110 """
4111 return _core_.CommandEvent_GetInt(*args, **kwargs)
4112
4113 def GetClientData(*args, **kwargs):
4114 """
4115 GetClientData(self) -> PyObject
4116
4117 Returns the client data object for a listbox or choice selection event, (if any.)
4118 """
4119 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4120
4121 def SetClientData(*args, **kwargs):
4122 """
4123 SetClientData(self, PyObject clientData)
4124
4125 Associate the given client data with the item at position n.
4126 """
4127 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4128
4129 GetClientObject = GetClientData
4130 SetClientObject = SetClientData
4131
4132 def Clone(*args, **kwargs):
4133 """Clone(self) -> Event"""
4134 return _core_.CommandEvent_Clone(*args, **kwargs)
4135
4136 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4137 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4138 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4139 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4140 Selection = property(GetSelection,doc="See `GetSelection`")
4141 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4142 _core_.CommandEvent_swigregister(CommandEvent)
4143
4144 #---------------------------------------------------------------------------
4145
4146 class NotifyEvent(CommandEvent):
4147 """
4148 An instance of this class (or one of its derived classes) is sent from
4149 a control when the control's state is being changed and the control
4150 allows that change to be prevented from happening. The event handler
4151 can call `Veto` or `Allow` to tell the control what to do.
4152 """
4153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4154 __repr__ = _swig_repr
4155 def __init__(self, *args, **kwargs):
4156 """
4157 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4158
4159 An instance of this class (or one of its derived classes) is sent from
4160 a control when the control's state is being changed and the control
4161 allows that change to be prevented from happening. The event handler
4162 can call `Veto` or `Allow` to tell the control what to do.
4163 """
4164 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4165 def Veto(*args, **kwargs):
4166 """
4167 Veto(self)
4168
4169 Prevents the change announced by this event from happening.
4170
4171 It is in general a good idea to notify the user about the reasons for
4172 vetoing the change because otherwise the applications behaviour (which
4173 just refuses to do what the user wants) might be quite surprising.
4174 """
4175 return _core_.NotifyEvent_Veto(*args, **kwargs)
4176
4177 def Allow(*args, **kwargs):
4178 """
4179 Allow(self)
4180
4181 This is the opposite of `Veto`: it explicitly allows the event to be
4182 processed. For most events it is not necessary to call this method as
4183 the events are allowed anyhow but some are forbidden by default (this
4184 will be mentioned in the corresponding event description).
4185 """
4186 return _core_.NotifyEvent_Allow(*args, **kwargs)
4187
4188 def IsAllowed(*args, **kwargs):
4189 """
4190 IsAllowed(self) -> bool
4191
4192 Returns true if the change is allowed (`Veto` hasn't been called) or
4193 false otherwise (if it was).
4194 """
4195 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4196
4197 _core_.NotifyEvent_swigregister(NotifyEvent)
4198
4199 #---------------------------------------------------------------------------
4200
4201 class ScrollEvent(CommandEvent):
4202 """
4203 A scroll event holds information about events sent from stand-alone
4204 scrollbars and sliders. Note that scrolled windows do not send
4205 instnaces of this event class, but send the `wx.ScrollWinEvent`
4206 instead.
4207 """
4208 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4209 __repr__ = _swig_repr
4210 def __init__(self, *args, **kwargs):
4211 """
4212 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4213 int orient=0) -> ScrollEvent
4214 """
4215 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4216 def GetOrientation(*args, **kwargs):
4217 """
4218 GetOrientation(self) -> int
4219
4220 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4221 the scrollbar.
4222 """
4223 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4224
4225 def GetPosition(*args, **kwargs):
4226 """
4227 GetPosition(self) -> int
4228
4229 Returns the position of the scrollbar.
4230 """
4231 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4232
4233 def SetOrientation(*args, **kwargs):
4234 """SetOrientation(self, int orient)"""
4235 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4236
4237 def SetPosition(*args, **kwargs):
4238 """SetPosition(self, int pos)"""
4239 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4240
4241 _core_.ScrollEvent_swigregister(ScrollEvent)
4242
4243 #---------------------------------------------------------------------------
4244
4245 class ScrollWinEvent(Event):
4246 """
4247 A wx.ScrollWinEvent holds information about scrolling and is sent from
4248 scrolling windows.
4249 """
4250 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4251 __repr__ = _swig_repr
4252 def __init__(self, *args, **kwargs):
4253 """
4254 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4255
4256 A wx.ScrollWinEvent holds information about scrolling and is sent from
4257 scrolling windows.
4258 """
4259 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4260 def GetOrientation(*args, **kwargs):
4261 """
4262 GetOrientation(self) -> int
4263
4264 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4265 the scrollbar.
4266 """
4267 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4268
4269 def GetPosition(*args, **kwargs):
4270 """
4271 GetPosition(self) -> int
4272
4273 Returns the position of the scrollbar for the thumb track and release
4274 events. Note that this field can't be used for the other events, you
4275 need to query the window itself for the current position in that case.
4276 """
4277 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4278
4279 def SetOrientation(*args, **kwargs):
4280 """SetOrientation(self, int orient)"""
4281 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4282
4283 def SetPosition(*args, **kwargs):
4284 """SetPosition(self, int pos)"""
4285 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4286
4287 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4288
4289 #---------------------------------------------------------------------------
4290
4291 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4292 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4293 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4294 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4295 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4296 class MouseEvent(Event):
4297 """
4298 This event class contains information about the events generated by
4299 the mouse: they include mouse buttons press and release events and
4300 mouse move events.
4301
4302 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4303 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4304 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4305 a middle button so a portable application should avoid relying on the
4306 events from it.
4307
4308 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4309 the former returns true when the event corresponds to the left mouse
4310 button click while the latter returns true if the left mouse button is
4311 currently being pressed. For example, when the user is dragging the
4312 mouse you can use `LeftIsDown` to test whether the left mouse button
4313 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4314 `LeftIsDown` will also return true in wxWidgets whatever the
4315 underlying GUI behaviour is (which is platform-dependent). The same
4316 applies, of course, to other mouse buttons as well.
4317 """
4318 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4319 __repr__ = _swig_repr
4320 def __init__(self, *args, **kwargs):
4321 """
4322 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4323
4324 Constructs a wx.MouseEvent. Valid event types are:
4325
4326 * wxEVT_ENTER_WINDOW
4327 * wxEVT_LEAVE_WINDOW
4328 * wxEVT_LEFT_DOWN
4329 * wxEVT_LEFT_UP
4330 * wxEVT_LEFT_DCLICK
4331 * wxEVT_MIDDLE_DOWN
4332 * wxEVT_MIDDLE_UP
4333 * wxEVT_MIDDLE_DCLICK
4334 * wxEVT_RIGHT_DOWN
4335 * wxEVT_RIGHT_UP
4336 * wxEVT_RIGHT_DCLICK
4337 * wxEVT_MOTION
4338 * wxEVT_MOUSEWHEEL
4339 """
4340 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4341 def IsButton(*args, **kwargs):
4342 """
4343 IsButton(self) -> bool
4344
4345 Returns true if the event was a mouse button event (not necessarily a
4346 button down event - that may be tested using `ButtonDown`).
4347 """
4348 return _core_.MouseEvent_IsButton(*args, **kwargs)
4349
4350 def ButtonDown(*args, **kwargs):
4351 """
4352 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4353
4354 If the argument is omitted, this returns true if the event was any
4355 mouse button down event. Otherwise the argument specifies which
4356 button-down event shold be checked for (see `Button` for the possible
4357 values).
4358 """
4359 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4360
4361 def ButtonDClick(*args, **kwargs):
4362 """
4363 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4364
4365 If the argument is omitted, this returns true if the event was any
4366 mouse double click event. Otherwise the argument specifies which
4367 double click event to check for (see `Button` for the possible
4368 values).
4369 """
4370 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4371
4372 def ButtonUp(*args, **kwargs):
4373 """
4374 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4375
4376 If the argument is omitted, this returns true if the event was any
4377 mouse button up event. Otherwise the argument specifies which button
4378 up event to check for (see `Button` for the possible values).
4379 """
4380 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4381
4382 def Button(*args, **kwargs):
4383 """
4384 Button(self, int button) -> bool
4385
4386 Returns true if the identified mouse button is changing state. Valid
4387 values of button are:
4388
4389 ==================== =====================================
4390 wx.MOUSE_BTN_LEFT check if left button was pressed
4391 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4392 wx.MOUSE_BTN_RIGHT check if right button was pressed
4393 wx.MOUSE_BTN_ANY check if any button was pressed
4394 ==================== =====================================
4395
4396 """
4397 return _core_.MouseEvent_Button(*args, **kwargs)
4398
4399 def ButtonIsDown(*args, **kwargs):
4400 """ButtonIsDown(self, int but) -> bool"""
4401 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4402
4403 def GetButton(*args, **kwargs):
4404 """
4405 GetButton(self) -> int
4406
4407 Returns the mouse button which generated this event or
4408 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4409 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4410 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4411 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4412 right buttons respectively.
4413 """
4414 return _core_.MouseEvent_GetButton(*args, **kwargs)
4415
4416 def ControlDown(*args, **kwargs):
4417 """
4418 ControlDown(self) -> bool
4419
4420 Returns true if the control key was down at the time of the event.
4421 """
4422 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4423
4424 def MetaDown(*args, **kwargs):
4425 """
4426 MetaDown(self) -> bool
4427
4428 Returns true if the Meta key was down at the time of the event.
4429 """
4430 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4431
4432 def AltDown(*args, **kwargs):
4433 """
4434 AltDown(self) -> bool
4435
4436 Returns true if the Alt key was down at the time of the event.
4437 """
4438 return _core_.MouseEvent_AltDown(*args, **kwargs)
4439
4440 def ShiftDown(*args, **kwargs):
4441 """
4442 ShiftDown(self) -> bool
4443
4444 Returns true if the Shift key was down at the time of the event.
4445 """
4446 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4447
4448 def CmdDown(*args, **kwargs):
4449 """
4450 CmdDown(self) -> bool
4451
4452 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4453 platforms but the special "Apple" (a.k.a as "Command") key on
4454 Macs. It often makes sense to use it instead of, say, `ControlDown`
4455 because Cmd key is used for the same thing under Mac as Ctrl
4456 elsewhere. The Ctrl key still exists, it's just not used for this
4457 purpose. So for non-Mac platforms this is the same as `ControlDown`
4458 and Macs this is the same as `MetaDown`.
4459 """
4460 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4461
4462 def LeftDown(*args, **kwargs):
4463 """
4464 LeftDown(self) -> bool
4465
4466 Returns true if the left mouse button state changed to down.
4467 """
4468 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4469
4470 def MiddleDown(*args, **kwargs):
4471 """
4472 MiddleDown(self) -> bool
4473
4474 Returns true if the middle mouse button state changed to down.
4475 """
4476 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4477
4478 def RightDown(*args, **kwargs):
4479 """
4480 RightDown(self) -> bool
4481
4482 Returns true if the right mouse button state changed to down.
4483 """
4484 return _core_.MouseEvent_RightDown(*args, **kwargs)
4485
4486 def LeftUp(*args, **kwargs):
4487 """
4488 LeftUp(self) -> bool
4489
4490 Returns true if the left mouse button state changed to up.
4491 """
4492 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4493
4494 def MiddleUp(*args, **kwargs):
4495 """
4496 MiddleUp(self) -> bool
4497
4498 Returns true if the middle mouse button state changed to up.
4499 """
4500 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4501
4502 def RightUp(*args, **kwargs):
4503 """
4504 RightUp(self) -> bool
4505
4506 Returns true if the right mouse button state changed to up.
4507 """
4508 return _core_.MouseEvent_RightUp(*args, **kwargs)
4509
4510 def LeftDClick(*args, **kwargs):
4511 """
4512 LeftDClick(self) -> bool
4513
4514 Returns true if the event was a left button double click.
4515 """
4516 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4517
4518 def MiddleDClick(*args, **kwargs):
4519 """
4520 MiddleDClick(self) -> bool
4521
4522 Returns true if the event was a middle button double click.
4523 """
4524 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4525
4526 def RightDClick(*args, **kwargs):
4527 """
4528 RightDClick(self) -> bool
4529
4530 Returns true if the event was a right button double click.
4531 """
4532 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4533
4534 def LeftIsDown(*args, **kwargs):
4535 """
4536 LeftIsDown(self) -> bool
4537
4538 Returns true if the left mouse button is currently down, independent
4539 of the current event type.
4540
4541 Please notice that it is not the same as LeftDown which returns true
4542 if the left mouse button was just pressed. Rather, it describes the
4543 state of the mouse button before the event happened.
4544
4545 This event is usually used in the mouse event handlers which process
4546 "move mouse" messages to determine whether the user is (still)
4547 dragging the mouse.
4548 """
4549 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4550
4551 def MiddleIsDown(*args, **kwargs):
4552 """
4553 MiddleIsDown(self) -> bool
4554
4555 Returns true if the middle mouse button is currently down, independent
4556 of the current event type.
4557 """
4558 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4559
4560 def RightIsDown(*args, **kwargs):
4561 """
4562 RightIsDown(self) -> bool
4563
4564 Returns true if the right mouse button is currently down, independent
4565 of the current event type.
4566 """
4567 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4568
4569 def Dragging(*args, **kwargs):
4570 """
4571 Dragging(self) -> bool
4572
4573 Returns true if this was a dragging event (motion while a button is
4574 depressed).
4575 """
4576 return _core_.MouseEvent_Dragging(*args, **kwargs)
4577
4578 def Moving(*args, **kwargs):
4579 """
4580 Moving(self) -> bool
4581
4582 Returns true if this was a motion event and no mouse buttons were
4583 pressed. If any mouse button is held pressed, then this method returns
4584 false and Dragging returns true.
4585 """
4586 return _core_.MouseEvent_Moving(*args, **kwargs)
4587
4588 def Entering(*args, **kwargs):
4589 """
4590 Entering(self) -> bool
4591
4592 Returns true if the mouse was entering the window.
4593 """
4594 return _core_.MouseEvent_Entering(*args, **kwargs)
4595
4596 def Leaving(*args, **kwargs):
4597 """
4598 Leaving(self) -> bool
4599
4600 Returns true if the mouse was leaving the window.
4601 """
4602 return _core_.MouseEvent_Leaving(*args, **kwargs)
4603
4604 def GetPosition(*args, **kwargs):
4605 """
4606 GetPosition(self) -> Point
4607
4608 Returns the pixel position of the mouse in window coordinates when the
4609 event happened.
4610 """
4611 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4612
4613 def GetPositionTuple(*args, **kwargs):
4614 """
4615 GetPositionTuple() -> (x,y)
4616
4617 Returns the pixel position of the mouse in window coordinates when the
4618 event happened.
4619 """
4620 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4621
4622 def GetLogicalPosition(*args, **kwargs):
4623 """
4624 GetLogicalPosition(self, DC dc) -> Point
4625
4626 Returns the logical mouse position in pixels (i.e. translated
4627 according to the translation set for the DC, which usually indicates
4628 that the window has been scrolled).
4629 """
4630 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4631
4632 def GetX(*args, **kwargs):
4633 """
4634 GetX(self) -> int
4635
4636 Returns X coordinate of the physical mouse event position.
4637 """
4638 return _core_.MouseEvent_GetX(*args, **kwargs)
4639
4640 def GetY(*args, **kwargs):
4641 """
4642 GetY(self) -> int
4643
4644 Returns Y coordinate of the physical mouse event position.
4645 """
4646 return _core_.MouseEvent_GetY(*args, **kwargs)
4647
4648 def GetWheelRotation(*args, **kwargs):
4649 """
4650 GetWheelRotation(self) -> int
4651
4652 Get wheel rotation, positive or negative indicates direction of
4653 rotation. Current devices all send an event when rotation is equal to
4654 +/-WheelDelta, but this allows for finer resolution devices to be
4655 created in the future. Because of this you shouldn't assume that one
4656 event is equal to 1 line or whatever, but you should be able to either
4657 do partial line scrolling or wait until +/-WheelDelta rotation values
4658 have been accumulated before scrolling.
4659 """
4660 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4661
4662 def GetWheelDelta(*args, **kwargs):
4663 """
4664 GetWheelDelta(self) -> int
4665
4666 Get wheel delta, normally 120. This is the threshold for action to be
4667 taken, and one such action (for example, scrolling one increment)
4668 should occur for each delta.
4669 """
4670 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4671
4672 def GetLinesPerAction(*args, **kwargs):
4673 """
4674 GetLinesPerAction(self) -> int
4675
4676 Returns the configured number of lines (or whatever) to be scrolled
4677 per wheel action. Defaults to three.
4678 """
4679 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4680
4681 def IsPageScroll(*args, **kwargs):
4682 """
4683 IsPageScroll(self) -> bool
4684
4685 Returns true if the system has been setup to do page scrolling with
4686 the mouse wheel instead of line scrolling.
4687 """
4688 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4689
4690 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4691 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4692 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4693 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4694 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4695 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4696 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4697 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4698 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4699 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4700 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4701 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4702 _core_.MouseEvent_swigregister(MouseEvent)
4703
4704 #---------------------------------------------------------------------------
4705
4706 class SetCursorEvent(Event):
4707 """
4708 A SetCursorEvent is generated when the mouse cursor is about to be set
4709 as a result of mouse motion. This event gives the application the
4710 chance to perform specific mouse cursor processing based on the
4711 current position of the mouse within the window. Use the `SetCursor`
4712 method to specify the cursor you want to be displayed.
4713 """
4714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4715 __repr__ = _swig_repr
4716 def __init__(self, *args, **kwargs):
4717 """
4718 __init__(self, int x=0, int y=0) -> SetCursorEvent
4719
4720 Construct a new `wx.SetCursorEvent`.
4721 """
4722 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4723 def GetX(*args, **kwargs):
4724 """
4725 GetX(self) -> int
4726
4727 Returns the X coordinate of the mouse in client coordinates.
4728 """
4729 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4730
4731 def GetY(*args, **kwargs):
4732 """
4733 GetY(self) -> int
4734
4735 Returns the Y coordinate of the mouse in client coordinates.
4736 """
4737 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4738
4739 def SetCursor(*args, **kwargs):
4740 """
4741 SetCursor(self, Cursor cursor)
4742
4743 Sets the cursor associated with this event.
4744 """
4745 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4746
4747 def GetCursor(*args, **kwargs):
4748 """
4749 GetCursor(self) -> Cursor
4750
4751 Returns a reference to the cursor specified by this event.
4752 """
4753 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4754
4755 def HasCursor(*args, **kwargs):
4756 """
4757 HasCursor(self) -> bool
4758
4759 Returns true if the cursor specified by this event is a valid cursor.
4760 """
4761 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4762
4763 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4764
4765 #---------------------------------------------------------------------------
4766
4767 class KeyEvent(Event):
4768 """
4769 This event class contains information about keypress and character
4770 events. These events are only sent to the widget that currently has
4771 the keyboard focus.
4772
4773 Notice that there are three different kinds of keyboard events in
4774 wxWidgets: key down and up events and char events. The difference
4775 between the first two is clear - the first corresponds to a key press
4776 and the second to a key release - otherwise they are identical. Just
4777 note that if the key is maintained in a pressed state you will
4778 typically get a lot of (automatically generated) down events but only
4779 one up so it is wrong to assume that there is one up event
4780 corresponding to each down one.
4781
4782 Both key events provide untranslated key codes while the char event
4783 carries the translated one. The untranslated code for alphanumeric
4784 keys is always an upper case value. For the other keys it is one of
4785 WXK_XXX values from the keycodes table. The translated key is, in
4786 general, the character the user expects to appear as the result of the
4787 key combination when typing the text into a text entry zone, for
4788 example.
4789
4790 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4791 and the standard US keyboard): when the 'A' key is pressed, the key
4792 down event key code is equal to ASCII A == 65. But the char event key
4793 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4794 'A' keys simultaneously , the key code in key down event will still be
4795 just 'A' while the char event key code parameter will now be 'A' as
4796 well.
4797
4798 Although in this simple case it is clear that the correct key code
4799 could be found in the key down event handler by checking the value
4800 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4801 as for non alphanumeric keys or non-US keyboard layouts the
4802 translation is keyboard-layout dependent and can only be done properly
4803 by the system itself.
4804
4805 Another kind of translation is done when the control key is pressed:
4806 for example, for CTRL-A key press the key down event still carries the
4807 same key code 'A' as usual but the char event will have key code of 1,
4808 the ASCII value of this key combination.
4809
4810 You may discover how the other keys on your system behave
4811 interactively by running the KeyEvents sample in the wxPython demo and
4812 pressing some keys while the blue box at the top has the keyboard
4813 focus.
4814
4815 **Note**: If a key down event is caught and the event handler does not
4816 call event.Skip() then the coresponding char event will not
4817 happen. This is by design and enables the programs that handle both
4818 types of events to be a bit simpler.
4819
4820 **Note for Windows programmers**: The key and char events in wxWidgets
4821 are similar to but slightly different from Windows WM_KEYDOWN and
4822 WM_CHAR events. In particular, Alt-x combination will generate a char
4823 event in wxWidgets (unless it is used as an accelerator).
4824
4825 **Tip**: be sure to call event.Skip() for events that you don't
4826 process in key event function, otherwise menu shortcuts may cease to
4827 work under Windows.
4828
4829 """
4830 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4831 __repr__ = _swig_repr
4832 def __init__(self, *args, **kwargs):
4833 """
4834 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4835
4836 Construct a new `wx.KeyEvent`. Valid event types are:
4837 *
4838 """
4839 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4840 def GetModifiers(*args, **kwargs):
4841 """
4842 GetModifiers(self) -> int
4843
4844 Returns a bitmask of the current modifier settings. Can be used to
4845 check if the key event has exactly the given modifiers without having
4846 to explicitly check that the other modifiers are not down. For
4847 example::
4848
4849 if event.GetModifers() == wx.MOD_CONTROL:
4850 DoSomething()
4851
4852 """
4853 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4854
4855 def ControlDown(*args, **kwargs):
4856 """
4857 ControlDown(self) -> bool
4858
4859 Returns ``True`` if the Control key was down at the time of the event.
4860 """
4861 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4862
4863 def MetaDown(*args, **kwargs):
4864 """
4865 MetaDown(self) -> bool
4866
4867 Returns ``True`` if the Meta key was down at the time of the event.
4868 """
4869 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4870
4871 def AltDown(*args, **kwargs):
4872 """
4873 AltDown(self) -> bool
4874
4875 Returns ``True`` if the Alt key was down at the time of the event.
4876 """
4877 return _core_.KeyEvent_AltDown(*args, **kwargs)
4878
4879 def ShiftDown(*args, **kwargs):
4880 """
4881 ShiftDown(self) -> bool
4882
4883 Returns ``True`` if the Shift key was down at the time of the event.
4884 """
4885 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4886
4887 def CmdDown(*args, **kwargs):
4888 """
4889 CmdDown(self) -> bool
4890
4891 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4892 platforms but the special "Apple" (a.k.a as "Command") key on
4893 Macs. It makes often sense to use it instead of, say, `ControlDown`
4894 because Cmd key is used for the same thing under Mac as Ctrl
4895 elsewhere. The Ctrl still exists, it's just not used for this
4896 purpose. So for non-Mac platforms this is the same as `ControlDown`
4897 and Macs this is the same as `MetaDown`.
4898 """
4899 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4900
4901 def HasModifiers(*args, **kwargs):
4902 """
4903 HasModifiers(self) -> bool
4904
4905 Returns true if either CTRL or ALT keys was down at the time of the
4906 key event. Note that this function does not take into account neither
4907 SHIFT nor META key states (the reason for ignoring the latter is that
4908 it is common for NUMLOCK key to be configured as META under X but the
4909 key presses even while NUMLOCK is on should be still processed
4910 normally).
4911 """
4912 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4913
4914 def GetKeyCode(*args, **kwargs):
4915 """
4916 GetKeyCode(self) -> int
4917
4918 Returns the virtual key code. ASCII events return normal ASCII values,
4919 while non-ASCII events return values such as WXK_LEFT for the left
4920 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4921 codes.
4922
4923 Note that in Unicode build, the returned value is meaningful only if
4924 the user entered a character that can be represented in current
4925 locale's default charset. You can obtain the corresponding Unicode
4926 character using `GetUnicodeKey`.
4927 """
4928 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4929
4930 def GetUnicodeKey(*args, **kwargs):
4931 """
4932 GetUnicodeKey(self) -> int
4933
4934 Returns the Unicode character corresponding to this key event. This
4935 function is only meaningfule in a Unicode build of wxPython.
4936 """
4937 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4938
4939 GetUniChar = GetUnicodeKey
4940 def SetUnicodeKey(*args, **kwargs):
4941 """
4942 SetUnicodeKey(self, int uniChar)
4943
4944 Set the Unicode value of the key event, but only if this is a Unicode
4945 build of wxPython.
4946 """
4947 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4948
4949 def GetRawKeyCode(*args, **kwargs):
4950 """
4951 GetRawKeyCode(self) -> unsigned int
4952
4953 Returns the raw key code for this event. This is a platform-dependent
4954 scan code which should only be used in advanced
4955 applications. Currently the raw key codes are not supported by all
4956 ports.
4957 """
4958 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4959
4960 def GetRawKeyFlags(*args, **kwargs):
4961 """
4962 GetRawKeyFlags(self) -> unsigned int
4963
4964 Returns the low level key flags for this event. The flags are
4965 platform-dependent and should only be used in advanced applications.
4966 Currently the raw key flags are not supported by all ports.
4967 """
4968 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4969
4970 def GetPosition(*args, **kwargs):
4971 """
4972 GetPosition(self) -> Point
4973
4974 Find the position of the event, if applicable.
4975 """
4976 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4977
4978 def GetPositionTuple(*args, **kwargs):
4979 """
4980 GetPositionTuple() -> (x,y)
4981
4982 Find the position of the event, if applicable.
4983 """
4984 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4985
4986 def GetX(*args, **kwargs):
4987 """
4988 GetX(self) -> int
4989
4990 Returns the X position (in client coordinates) of the event, if
4991 applicable.
4992 """
4993 return _core_.KeyEvent_GetX(*args, **kwargs)
4994
4995 def GetY(*args, **kwargs):
4996 """
4997 GetY(self) -> int
4998
4999 Returns the Y position (in client coordinates) of the event, if
5000 applicable.
5001 """
5002 return _core_.KeyEvent_GetY(*args, **kwargs)
5003
5004 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5005 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5006 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5007 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5008 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5009 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5010 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5011 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5012 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5013 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5014 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5015 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5016 Position = property(GetPosition,doc="See `GetPosition`")
5017 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5018 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5019 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5020 X = property(GetX,doc="See `GetX`")
5021 Y = property(GetY,doc="See `GetY`")
5022 _core_.KeyEvent_swigregister(KeyEvent)
5023
5024 #---------------------------------------------------------------------------
5025
5026 class SizeEvent(Event):
5027 """
5028 A size event holds information about size change events. The EVT_SIZE
5029 handler function will be called when the window it is bound to has
5030 been resized.
5031
5032 Note that the size passed is of the whole window: call
5033 `wx.Window.GetClientSize` for the area which may be used by the
5034 application.
5035
5036 When a window is resized, usually only a small part of the window is
5037 damaged and and that area is all that is in the update region for the
5038 next paint event. However, if your drawing depends on the size of the
5039 window, you may need to clear the DC explicitly and repaint the whole
5040 window. In which case, you may need to call `wx.Window.Refresh` to
5041 invalidate the entire window.
5042
5043 """
5044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5045 __repr__ = _swig_repr
5046 def __init__(self, *args, **kwargs):
5047 """
5048 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5049
5050 Construct a new ``wx.SizeEvent``.
5051 """
5052 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5053 def GetSize(*args, **kwargs):
5054 """
5055 GetSize(self) -> Size
5056
5057 Returns the entire size of the window generating the size change
5058 event.
5059 """
5060 return _core_.SizeEvent_GetSize(*args, **kwargs)
5061
5062 def GetRect(*args, **kwargs):
5063 """GetRect(self) -> Rect"""
5064 return _core_.SizeEvent_GetRect(*args, **kwargs)
5065
5066 def SetRect(*args, **kwargs):
5067 """SetRect(self, Rect rect)"""
5068 return _core_.SizeEvent_SetRect(*args, **kwargs)
5069
5070 def SetSize(*args, **kwargs):
5071 """SetSize(self, Size size)"""
5072 return _core_.SizeEvent_SetSize(*args, **kwargs)
5073
5074 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5075 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5076 _core_.SizeEvent_swigregister(SizeEvent)
5077
5078 #---------------------------------------------------------------------------
5079
5080 class MoveEvent(Event):
5081 """
5082 This event object is sent for EVT_MOVE event bindings when a window is
5083 moved to a new position.
5084 """
5085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5086 __repr__ = _swig_repr
5087 def __init__(self, *args, **kwargs):
5088 """
5089 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5090
5091 Constructor.
5092 """
5093 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5094 def GetPosition(*args, **kwargs):
5095 """
5096 GetPosition(self) -> Point
5097
5098 Returns the position of the window generating the move change event.
5099 """
5100 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5101
5102 def GetRect(*args, **kwargs):
5103 """GetRect(self) -> Rect"""
5104 return _core_.MoveEvent_GetRect(*args, **kwargs)
5105
5106 def SetRect(*args, **kwargs):
5107 """SetRect(self, Rect rect)"""
5108 return _core_.MoveEvent_SetRect(*args, **kwargs)
5109
5110 def SetPosition(*args, **kwargs):
5111 """SetPosition(self, Point pos)"""
5112 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5113
5114 m_pos = property(GetPosition, SetPosition)
5115 m_rect = property(GetRect, SetRect)
5116
5117 _core_.MoveEvent_swigregister(MoveEvent)
5118
5119 #---------------------------------------------------------------------------
5120
5121 class PaintEvent(Event):
5122 """
5123 A paint event is sent when a window's contents needs to be repainted.
5124 Note that in an EVT_PAINT handler the application must *always* create
5125 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5126 Windows assumes that the window has not been painted yet and will send
5127 the event again, causing endless refreshes.
5128
5129 You can optimize painting by retrieving the rectangles that have been
5130 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5131 and only repainting these rectangles. The rectangles are in terms of
5132 the client area, and are unscrolled, so you will need to do some
5133 calculations using the current view position to obtain logical,
5134 scrolled units.
5135
5136 """
5137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5138 __repr__ = _swig_repr
5139 def __init__(self, *args, **kwargs):
5140 """__init__(self, int Id=0) -> PaintEvent"""
5141 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5142 _core_.PaintEvent_swigregister(PaintEvent)
5143
5144 class NcPaintEvent(Event):
5145 """Proxy of C++ NcPaintEvent class"""
5146 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5147 __repr__ = _swig_repr
5148 def __init__(self, *args, **kwargs):
5149 """__init__(self, int winid=0) -> NcPaintEvent"""
5150 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5151 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5152
5153 #---------------------------------------------------------------------------
5154
5155 class EraseEvent(Event):
5156 """
5157 An erase event is sent whenever the background of a window needs to be
5158 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5159 binder. On some platforms, such as GTK+, this event is simulated
5160 (simply generated just before the paint event) and may cause flicker.
5161
5162 To paint a custom background use the `GetDC` method and use the returned
5163 device context if it is not ``None``, otherwise create a temporary
5164 `wx.ClientDC` and draw on that.
5165
5166 """
5167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5168 __repr__ = _swig_repr
5169 def __init__(self, *args, **kwargs):
5170 """
5171 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5172
5173 Constructor
5174 """
5175 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5176 def GetDC(*args, **kwargs):
5177 """
5178 GetDC(self) -> DC
5179
5180 Returns the device context the event handler should draw upon. If
5181 ``None`` is returned then create a temporary `wx.ClientDC` and use
5182 that instead.
5183 """
5184 return _core_.EraseEvent_GetDC(*args, **kwargs)
5185
5186 DC = property(GetDC,doc="See `GetDC`")
5187 _core_.EraseEvent_swigregister(EraseEvent)
5188
5189 #---------------------------------------------------------------------------
5190
5191 class FocusEvent(Event):
5192 """
5193 A focus event is sent when a window's focus changes. The window losing
5194 focus receives an EVT_KILL_FOCUS event while the window gaining it
5195 gets an EVT_SET_FOCUS event.
5196
5197 Notice that the set focus event happens both when the user gives focus
5198 to the window (whether using the mouse or keyboard) and when it is
5199 done from the program itself using `wx.Window.SetFocus`.
5200
5201 """
5202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5203 __repr__ = _swig_repr
5204 def __init__(self, *args, **kwargs):
5205 """
5206 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5207
5208 Constructor
5209 """
5210 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5211 def GetWindow(*args, **kwargs):
5212 """
5213 GetWindow(self) -> Window
5214
5215 Returns the other window associated with this event, that is the
5216 window which had the focus before for the EVT_SET_FOCUS event and the
5217 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5218
5219 Warning: the window returned may be None!
5220 """
5221 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5222
5223 def SetWindow(*args, **kwargs):
5224 """SetWindow(self, Window win)"""
5225 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5226
5227 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5228 _core_.FocusEvent_swigregister(FocusEvent)
5229
5230 #---------------------------------------------------------------------------
5231
5232 class ChildFocusEvent(CommandEvent):
5233 """
5234 wx.ChildFocusEvent notifies the parent that a child has received the
5235 focus. Unlike `wx.FocusEvent` it is propagated up the window
5236 heirarchy.
5237 """
5238 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5239 __repr__ = _swig_repr
5240 def __init__(self, *args, **kwargs):
5241 """
5242 __init__(self, Window win=None) -> ChildFocusEvent
5243
5244 Constructor
5245 """
5246 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5247 def GetWindow(*args, **kwargs):
5248 """
5249 GetWindow(self) -> Window
5250
5251 The window which has just received the focus.
5252 """
5253 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5254
5255 Window = property(GetWindow,doc="See `GetWindow`")
5256 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5257
5258 #---------------------------------------------------------------------------
5259
5260 class ActivateEvent(Event):
5261 """
5262 An activate event is sent when a top-level window or the entire
5263 application is being activated or deactivated.
5264
5265 A top-level window (a dialog or frame) receives an activate event when
5266 is being activated or deactivated. This is indicated visually by the
5267 title bar changing colour, and a subwindow gaining the keyboard focus.
5268 An application is activated or deactivated when one of its frames
5269 becomes activated, or a frame becomes inactivate resulting in all
5270 application frames being inactive.
5271
5272 Please note that usually you should call event.Skip() in your handlers
5273 for these events so the default handlers will still be called, as not
5274 doing so can result in strange effects.
5275
5276 """
5277 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5278 __repr__ = _swig_repr
5279 def __init__(self, *args, **kwargs):
5280 """
5281 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5282
5283 Constructor
5284 """
5285 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5286 def GetActive(*args, **kwargs):
5287 """
5288 GetActive(self) -> bool
5289
5290 Returns true if the application or window is being activated, false
5291 otherwise.
5292 """
5293 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5294
5295 Active = property(GetActive,doc="See `GetActive`")
5296 _core_.ActivateEvent_swigregister(ActivateEvent)
5297
5298 #---------------------------------------------------------------------------
5299
5300 class InitDialogEvent(Event):
5301 """
5302 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5303 any window when `wx.Window.InitDialog` is called. Handlers for this
5304 event can transfer data to the window, or anything else that should be
5305 done before the user begins editing the form. The default handler
5306 calls `wx.Window.TransferDataToWindow`.
5307 """
5308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5309 __repr__ = _swig_repr
5310 def __init__(self, *args, **kwargs):
5311 """
5312 __init__(self, int Id=0) -> InitDialogEvent
5313
5314 Constructor
5315 """
5316 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5317 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5318
5319 #---------------------------------------------------------------------------
5320
5321 class MenuEvent(Event):
5322 """
5323 This class is used for a variety of menu-related events. Note that
5324 these do not include menu command events, which are handled by sending
5325 `wx.CommandEvent` objects.
5326
5327 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5328 text in the first field of the status bar.
5329 """
5330 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5331 __repr__ = _swig_repr
5332 def __init__(self, *args, **kwargs):
5333 """
5334 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5335
5336 Constructor
5337 """
5338 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5339 def GetMenuId(*args, **kwargs):
5340 """
5341 GetMenuId(self) -> int
5342
5343 Returns the menu identifier associated with the event. This method
5344 should be only used with the HIGHLIGHT events.
5345 """
5346 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5347
5348 def IsPopup(*args, **kwargs):
5349 """
5350 IsPopup(self) -> bool
5351
5352 Returns ``True`` if the menu which is being opened or closed is a
5353 popup menu, ``False`` if it is a normal one. This method should only
5354 be used with the OPEN and CLOSE events.
5355 """
5356 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5357
5358 def GetMenu(*args, **kwargs):
5359 """
5360 GetMenu(self) -> Menu
5361
5362 Returns the menu which is being opened or closed. This method should
5363 only be used with the OPEN and CLOSE events.
5364 """
5365 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5366
5367 _core_.MenuEvent_swigregister(MenuEvent)
5368
5369 #---------------------------------------------------------------------------
5370
5371 class CloseEvent(Event):
5372 """
5373 This event class contains information about window and session close
5374 events.
5375
5376 The handler function for EVT_CLOSE is called when the user has tried
5377 to close a a frame or dialog box using the window manager controls or
5378 the system menu. It can also be invoked by the application itself
5379 programmatically, for example by calling the `wx.Window.Close`
5380 function.
5381
5382 You should check whether the application is forcing the deletion of
5383 the window using `CanVeto`. If it returns ``False``, you must destroy
5384 the window using `wx.Window.Destroy`. If the return value is ``True``,
5385 it is up to you whether you respond by destroying the window or not.
5386 For example you may wish to display a message dialog prompting to save
5387 files or to cancel the close.
5388
5389 If you don't destroy the window, you should call `Veto` to let the
5390 calling code know that you did not destroy the window. This allows the
5391 `wx.Window.Close` function to return ``True`` or ``False`` depending
5392 on whether the close instruction was honored or not.
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, int winid=0) -> CloseEvent
5399
5400 Constructor.
5401 """
5402 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5403 def SetLoggingOff(*args, **kwargs):
5404 """
5405 SetLoggingOff(self, bool logOff)
5406
5407 Sets the 'logging off' flag.
5408 """
5409 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5410
5411 def GetLoggingOff(*args, **kwargs):
5412 """
5413 GetLoggingOff(self) -> bool
5414
5415 Returns ``True`` if the user is logging off or ``False`` if the
5416 system is shutting down. This method can only be called for end
5417 session and query end session events, it doesn't make sense for close
5418 window event.
5419 """
5420 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5421
5422 def Veto(*args, **kwargs):
5423 """
5424 Veto(self, bool veto=True)
5425
5426 Call this from your event handler to veto a system shutdown or to
5427 signal to the calling application that a window close did not happen.
5428
5429 You can only veto a shutdown or close if `CanVeto` returns true.
5430 """
5431 return _core_.CloseEvent_Veto(*args, **kwargs)
5432
5433 def GetVeto(*args, **kwargs):
5434 """GetVeto(self) -> bool"""
5435 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5436
5437 def SetCanVeto(*args, **kwargs):
5438 """
5439 SetCanVeto(self, bool canVeto)
5440
5441 Sets the 'can veto' flag.
5442 """
5443 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5444
5445 def CanVeto(*args, **kwargs):
5446 """
5447 CanVeto(self) -> bool
5448
5449 Returns true if you can veto a system shutdown or a window close
5450 event. Vetoing a window close event is not possible if the calling
5451 code wishes to force the application to exit, and so this function
5452 must be called to check this.
5453 """
5454 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5455
5456 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5457 _core_.CloseEvent_swigregister(CloseEvent)
5458
5459 #---------------------------------------------------------------------------
5460
5461 class ShowEvent(Event):
5462 """An EVT_SHOW event is sent when a window is shown or hidden."""
5463 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5464 __repr__ = _swig_repr
5465 def __init__(self, *args, **kwargs):
5466 """
5467 __init__(self, int winid=0, bool show=False) -> ShowEvent
5468
5469 An EVT_SHOW event is sent when a window is shown or hidden.
5470 """
5471 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5472 def SetShow(*args, **kwargs):
5473 """SetShow(self, bool show)"""
5474 return _core_.ShowEvent_SetShow(*args, **kwargs)
5475
5476 def GetShow(*args, **kwargs):
5477 """GetShow(self) -> bool"""
5478 return _core_.ShowEvent_GetShow(*args, **kwargs)
5479
5480 _core_.ShowEvent_swigregister(ShowEvent)
5481
5482 #---------------------------------------------------------------------------
5483
5484 class IconizeEvent(Event):
5485 """
5486 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5487 restored.
5488 """
5489 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5490 __repr__ = _swig_repr
5491 def __init__(self, *args, **kwargs):
5492 """
5493 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5494
5495 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5496 restored.
5497 """
5498 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5499 def Iconized(*args, **kwargs):
5500 """
5501 Iconized(self) -> bool
5502
5503 Returns ``True`` if the frame has been iconized, ``False`` if it has
5504 been restored.
5505 """
5506 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5507
5508 _core_.IconizeEvent_swigregister(IconizeEvent)
5509
5510 #---------------------------------------------------------------------------
5511
5512 class MaximizeEvent(Event):
5513 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5514 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5515 __repr__ = _swig_repr
5516 def __init__(self, *args, **kwargs):
5517 """
5518 __init__(self, int id=0) -> MaximizeEvent
5519
5520 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5521 """
5522 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5523 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5524
5525 #---------------------------------------------------------------------------
5526
5527 class DropFilesEvent(Event):
5528 """
5529 This class is used for drop files events, that is, when files have
5530 been dropped onto the window. This functionality is only available
5531 under Windows. The window must have previously been enabled for
5532 dropping by calling `wx.Window.DragAcceptFiles`.
5533
5534 Important note: this is a separate implementation to the more general
5535 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5536 implementation uses the older, Windows message-based approach of
5537 dropping files.
5538
5539 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5540 events.
5541
5542 """
5543 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5544 def __init__(self): raise AttributeError, "No constructor defined"
5545 __repr__ = _swig_repr
5546 def GetPosition(*args, **kwargs):
5547 """
5548 GetPosition(self) -> Point
5549
5550 Returns the position at which the files were dropped.
5551 """
5552 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5553
5554 def GetNumberOfFiles(*args, **kwargs):
5555 """
5556 GetNumberOfFiles(self) -> int
5557
5558 Returns the number of files dropped.
5559 """
5560 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5561
5562 def GetFiles(*args, **kwargs):
5563 """
5564 GetFiles(self) -> PyObject
5565
5566 Returns a list of the filenames that were dropped.
5567 """
5568 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5569
5570 Files = property(GetFiles,doc="See `GetFiles`")
5571 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5572 Position = property(GetPosition,doc="See `GetPosition`")
5573 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5574
5575 #---------------------------------------------------------------------------
5576
5577 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5578 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5579 class UpdateUIEvent(CommandEvent):
5580 """
5581 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5582 wxWidgets to give an application the chance to update various user
5583 interface elements.
5584
5585 Without update UI events, an application has to work hard to
5586 check/uncheck, enable/disable, and set the text for elements such as
5587 menu items and toolbar buttons. The code for doing this has to be
5588 mixed up with the code that is invoked when an action is invoked for a
5589 menu item or button.
5590
5591 With update UI events, you define an event handler to look at the
5592 state of the application and change UI elements accordingly. wxWidgets
5593 will call your handler functions in idle time, so you don't have to
5594 worry where to call this code. In addition to being a clearer and more
5595 declarative method, it also means you don't have to worry whether
5596 you're updating a toolbar or menubar identifier. The same handler can
5597 update a menu item and toolbar button, if the ID values are the same.
5598
5599 Instead of directly manipulating the menu or button, you call
5600 functions in the event object, such as `Check`. wxWidgets will
5601 determine whether such a call has been made, and which UI element to
5602 update.
5603
5604 These events will work for popup menus as well as menubars. Just
5605 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5606 any UI events for the window that owns the menu.
5607
5608 If you find that the overhead of UI update processing is affecting
5609 your application, you can do one or both of the following:
5610
5611 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5612 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5613 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5614 receive update events. No other windows will receive update
5615 events.
5616
5617 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5618 value to set the delay between updates. You may need to call
5619 `wx.Window.UpdateWindowUI` at critical points, for example when
5620 a dialog is about to be shown, in case the user sees a slight
5621 delay before windows are updated.
5622
5623 Note that although events are sent in idle time, defining a EVT_IDLE
5624 handler for a window does not affect this because the events are sent
5625 from an internal idle handler.
5626
5627 wxWidgets tries to optimize update events on some platforms. On
5628 Windows and GTK+, events for menubar items are only sent when the menu
5629 is about to be shown, and not in idle time.
5630
5631 """
5632 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5633 __repr__ = _swig_repr
5634 def __init__(self, *args, **kwargs):
5635 """
5636 __init__(self, int commandId=0) -> UpdateUIEvent
5637
5638 Constructor
5639 """
5640 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5641 def GetChecked(*args, **kwargs):
5642 """
5643 GetChecked(self) -> bool
5644
5645 Returns ``True`` if the UI element should be checked.
5646 """
5647 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5648
5649 def GetEnabled(*args, **kwargs):
5650 """
5651 GetEnabled(self) -> bool
5652
5653 Returns ``True`` if the UI element should be enabled.
5654 """
5655 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5656
5657 def GetShown(*args, **kwargs):
5658 """
5659 GetShown(self) -> bool
5660
5661 Returns ``True`` if the UI element should be shown.
5662 """
5663 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5664
5665 def GetText(*args, **kwargs):
5666 """
5667 GetText(self) -> String
5668
5669 Returns the text that should be set for the UI element.
5670 """
5671 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5672
5673 def GetSetText(*args, **kwargs):
5674 """
5675 GetSetText(self) -> bool
5676
5677 Returns ``True`` if the application has called `SetText`. For
5678 wxWidgets internal use only.
5679 """
5680 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5681
5682 def GetSetChecked(*args, **kwargs):
5683 """
5684 GetSetChecked(self) -> bool
5685
5686 Returns ``True`` if the application has called `Check`. For wxWidgets
5687 internal use only.
5688 """
5689 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5690
5691 def GetSetEnabled(*args, **kwargs):
5692 """
5693 GetSetEnabled(self) -> bool
5694
5695 Returns ``True`` if the application has called `Enable`. For wxWidgets
5696 internal use only.
5697 """
5698 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5699
5700 def GetSetShown(*args, **kwargs):
5701 """
5702 GetSetShown(self) -> bool
5703
5704 Returns ``True`` if the application has called `Show`. For wxWidgets
5705 internal use only.
5706 """
5707 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5708
5709 def Check(*args, **kwargs):
5710 """
5711 Check(self, bool check)
5712
5713 Check or uncheck the UI element.
5714 """
5715 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5716
5717 def Enable(*args, **kwargs):
5718 """
5719 Enable(self, bool enable)
5720
5721 Enable or disable the UI element.
5722 """
5723 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5724
5725 def Show(*args, **kwargs):
5726 """
5727 Show(self, bool show)
5728
5729 Show or hide the UI element.
5730 """
5731 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5732
5733 def SetText(*args, **kwargs):
5734 """
5735 SetText(self, String text)
5736
5737 Sets the text for this UI element.
5738 """
5739 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5740
5741 def SetUpdateInterval(*args, **kwargs):
5742 """
5743 SetUpdateInterval(long updateInterval)
5744
5745 Sets the interval between updates in milliseconds. Set to -1 to
5746 disable updates, or to 0 to update as frequently as possible. The
5747 default is 0.
5748
5749 Use this to reduce the overhead of UI update events if your
5750 application has a lot of windows. If you set the value to -1 or
5751 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5752 at appropriate points in your application, such as when a dialog is
5753 about to be shown.
5754 """
5755 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5756
5757 SetUpdateInterval = staticmethod(SetUpdateInterval)
5758 def GetUpdateInterval(*args, **kwargs):
5759 """
5760 GetUpdateInterval() -> long
5761
5762 Returns the current interval between updates in milliseconds. -1
5763 disables updates, 0 updates as frequently as possible.
5764 """
5765 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5766
5767 GetUpdateInterval = staticmethod(GetUpdateInterval)
5768 def CanUpdate(*args, **kwargs):
5769 """
5770 CanUpdate(Window win) -> bool
5771
5772 Returns ``True`` if it is appropriate to update (send UI update events
5773 to) this window.
5774
5775 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5776 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5777 events were last sent in idle time, and the update interval, to
5778 determine whether events should be sent to this window now. By default
5779 this will always return true because the update mode is initially
5780 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5781 events will be sent as often as possible. You can reduce the frequency
5782 that events are sent by changing the mode and/or setting an update
5783 interval.
5784
5785 """
5786 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5787
5788 CanUpdate = staticmethod(CanUpdate)
5789 def ResetUpdateTime(*args, **kwargs):
5790 """
5791 ResetUpdateTime()
5792
5793 Used internally to reset the last-updated time to the current time. It
5794 is assumed that update events are normally sent in idle time, so this
5795 is called at the end of idle processing.
5796 """
5797 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5798
5799 ResetUpdateTime = staticmethod(ResetUpdateTime)
5800 def SetMode(*args, **kwargs):
5801 """
5802 SetMode(int mode)
5803
5804 Specify how wxWidgets will send update events: to all windows, or only
5805 to those which specify that they will process the events.
5806
5807 The mode may be one of the following values:
5808
5809 ============================= ==========================================
5810 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5811 is the default setting.
5812 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5813 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5814 style set.
5815 ============================= ==========================================
5816
5817 """
5818 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5819
5820 SetMode = staticmethod(SetMode)
5821 def GetMode(*args, **kwargs):
5822 """
5823 GetMode() -> int
5824
5825 Returns a value specifying how wxWidgets will send update events: to
5826 all windows, or only to those which specify that they will process the
5827 events.
5828 """
5829 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5830
5831 GetMode = staticmethod(GetMode)
5832 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5833
5834 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5835 """
5836 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5837
5838 Sets the interval between updates in milliseconds. Set to -1 to
5839 disable updates, or to 0 to update as frequently as possible. The
5840 default is 0.
5841
5842 Use this to reduce the overhead of UI update events if your
5843 application has a lot of windows. If you set the value to -1 or
5844 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5845 at appropriate points in your application, such as when a dialog is
5846 about to be shown.
5847 """
5848 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5849
5850 def UpdateUIEvent_GetUpdateInterval(*args):
5851 """
5852 UpdateUIEvent_GetUpdateInterval() -> long
5853
5854 Returns the current interval between updates in milliseconds. -1
5855 disables updates, 0 updates as frequently as possible.
5856 """
5857 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5858
5859 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5860 """
5861 UpdateUIEvent_CanUpdate(Window win) -> bool
5862
5863 Returns ``True`` if it is appropriate to update (send UI update events
5864 to) this window.
5865
5866 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5867 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5868 events were last sent in idle time, and the update interval, to
5869 determine whether events should be sent to this window now. By default
5870 this will always return true because the update mode is initially
5871 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5872 events will be sent as often as possible. You can reduce the frequency
5873 that events are sent by changing the mode and/or setting an update
5874 interval.
5875
5876 """
5877 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5878
5879 def UpdateUIEvent_ResetUpdateTime(*args):
5880 """
5881 UpdateUIEvent_ResetUpdateTime()
5882
5883 Used internally to reset the last-updated time to the current time. It
5884 is assumed that update events are normally sent in idle time, so this
5885 is called at the end of idle processing.
5886 """
5887 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5888
5889 def UpdateUIEvent_SetMode(*args, **kwargs):
5890 """
5891 UpdateUIEvent_SetMode(int mode)
5892
5893 Specify how wxWidgets will send update events: to all windows, or only
5894 to those which specify that they will process the events.
5895
5896 The mode may be one of the following values:
5897
5898 ============================= ==========================================
5899 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5900 is the default setting.
5901 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5902 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5903 style set.
5904 ============================= ==========================================
5905
5906 """
5907 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5908
5909 def UpdateUIEvent_GetMode(*args):
5910 """
5911 UpdateUIEvent_GetMode() -> int
5912
5913 Returns a value specifying how wxWidgets will send update events: to
5914 all windows, or only to those which specify that they will process the
5915 events.
5916 """
5917 return _core_.UpdateUIEvent_GetMode(*args)
5918
5919 #---------------------------------------------------------------------------
5920
5921 class SysColourChangedEvent(Event):
5922 """
5923 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5924 when the user changes the colour settings using the control
5925 panel. This is only applicable under Windows.
5926
5927 The default event handler for this event propagates the event to child
5928 windows, since Windows only sends the events to top-level windows. If
5929 intercepting this event for a top-level window, remember to call
5930 `Skip` so the the base class handler will still be executed, or to
5931 pass the event on to the window's children explicitly.
5932
5933 """
5934 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5935 __repr__ = _swig_repr
5936 def __init__(self, *args, **kwargs):
5937 """
5938 __init__(self) -> SysColourChangedEvent
5939
5940 Constructor
5941 """
5942 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5943 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5944
5945 #---------------------------------------------------------------------------
5946
5947 class MouseCaptureChangedEvent(Event):
5948 """
5949 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5950 a window that loses its mouse capture. This is called even if
5951 `wx.Window.ReleaseMouse` was called by the application code. Handling
5952 this event allows an application to cater for unexpected capture
5953 releases which might otherwise confuse mouse handling code.
5954
5955 This event is implemented under Windows only.
5956 """
5957 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5958 __repr__ = _swig_repr
5959 def __init__(self, *args, **kwargs):
5960 """
5961 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5962
5963 Constructor
5964 """
5965 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5966 def GetCapturedWindow(*args, **kwargs):
5967 """
5968 GetCapturedWindow(self) -> Window
5969
5970 Returns the window that gained the capture, or ``None`` if it was a
5971 non-wxWidgets window.
5972 """
5973 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5974
5975 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5976
5977 #---------------------------------------------------------------------------
5978
5979 class MouseCaptureLostEvent(Event):
5980 """
5981 A mouse capture lost event is sent to a window that obtained mouse
5982 capture, which was subsequently loss due to "external" event, for
5983 example when a dialog box is shown or if another application captures
5984 the mouse.
5985
5986 If this happens, this event is sent to all windows that are on the
5987 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5988 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5989 if the capture changes because of a call to CaptureMouse or
5990 ReleaseMouse.
5991
5992 This event is currently emitted under Windows only.
5993
5994 """
5995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5996 __repr__ = _swig_repr
5997 def __init__(self, *args, **kwargs):
5998 """
5999 __init__(self, int winid=0) -> MouseCaptureLostEvent
6000
6001 A mouse capture lost event is sent to a window that obtained mouse
6002 capture, which was subsequently loss due to "external" event, for
6003 example when a dialog box is shown or if another application captures
6004 the mouse.
6005
6006 If this happens, this event is sent to all windows that are on the
6007 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6008 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6009 if the capture changes because of a call to CaptureMouse or
6010 ReleaseMouse.
6011
6012 This event is currently emitted under Windows only.
6013
6014 """
6015 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6016 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6017
6018 #---------------------------------------------------------------------------
6019
6020 class DisplayChangedEvent(Event):
6021 """
6022 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6023 resolution has changed.
6024
6025 This event is implemented under Windows only.
6026 """
6027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6028 __repr__ = _swig_repr
6029 def __init__(self, *args, **kwargs):
6030 """__init__(self) -> DisplayChangedEvent"""
6031 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6032 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6033
6034 #---------------------------------------------------------------------------
6035
6036 class PaletteChangedEvent(Event):
6037 """
6038 An EVT_PALETTE_CHANGED event is sent when the system palette has
6039 changed, thereby giving each window a chance to redo their own to
6040 match.
6041
6042 This event is implemented under Windows only.
6043 """
6044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6045 __repr__ = _swig_repr
6046 def __init__(self, *args, **kwargs):
6047 """
6048 __init__(self, int id=0) -> PaletteChangedEvent
6049
6050 An EVT_PALETTE_CHANGED event is sent when the system palette has
6051 changed, thereby giving each window a chance to redo their own to
6052 match.
6053
6054 This event is implemented under Windows only.
6055 """
6056 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6057 def SetChangedWindow(*args, **kwargs):
6058 """SetChangedWindow(self, Window win)"""
6059 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6060
6061 def GetChangedWindow(*args, **kwargs):
6062 """GetChangedWindow(self) -> Window"""
6063 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6064
6065 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6066
6067 #---------------------------------------------------------------------------
6068
6069 class QueryNewPaletteEvent(Event):
6070 """
6071 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6072 focus and should re-do its palette.
6073
6074 This event is implemented under Windows only.
6075 """
6076 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6077 __repr__ = _swig_repr
6078 def __init__(self, *args, **kwargs):
6079 """
6080 __init__(self, int winid=0) -> QueryNewPaletteEvent
6081
6082 Constructor.
6083 """
6084 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6085 def SetPaletteRealized(*args, **kwargs):
6086 """
6087 SetPaletteRealized(self, bool realized)
6088
6089 App should set this if it changes the palette.
6090 """
6091 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6092
6093 def GetPaletteRealized(*args, **kwargs):
6094 """GetPaletteRealized(self) -> bool"""
6095 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6096
6097 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6098
6099 #---------------------------------------------------------------------------
6100
6101 class NavigationKeyEvent(Event):
6102 """
6103 EVT_NAVIGATION_KEY events are used to control moving the focus between
6104 widgets, otherwise known as tab-traversal. You woudl normally not
6105 catch navigation events in applications as there are already
6106 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6107 it useful to send navigation events in certain situations to change
6108 the focus in certain ways, although it's probably easier to just call
6109 `wx.Window.Navigate`.
6110 """
6111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6112 __repr__ = _swig_repr
6113 def __init__(self, *args, **kwargs):
6114 """__init__(self) -> NavigationKeyEvent"""
6115 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6116 def GetDirection(*args, **kwargs):
6117 """
6118 GetDirection(self) -> bool
6119
6120 Returns ``True`` if the direction is forward, ``False`` otherwise.
6121 """
6122 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6123
6124 def SetDirection(*args, **kwargs):
6125 """
6126 SetDirection(self, bool forward)
6127
6128 Specify the direction that the navigation should take. Usually the
6129 difference between using Tab and Shift-Tab.
6130 """
6131 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6132
6133 def IsWindowChange(*args, **kwargs):
6134 """
6135 IsWindowChange(self) -> bool
6136
6137 Returns ``True`` if window change is allowed.
6138 """
6139 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6140
6141 def SetWindowChange(*args, **kwargs):
6142 """
6143 SetWindowChange(self, bool ischange)
6144
6145 Specify if the navigation should be able to change parent windows.
6146 For example, changing notebook pages, etc. This is usually implemented
6147 by using Control-Tab.
6148 """
6149 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6150
6151 def IsFromTab(*args, **kwargs):
6152 """
6153 IsFromTab(self) -> bool
6154
6155 Returns ``True`` if the navigation event is originated from the Tab
6156 key.
6157 """
6158 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6159
6160 def SetFromTab(*args, **kwargs):
6161 """
6162 SetFromTab(self, bool bIs)
6163
6164 Set to true under MSW if the event was generated using the tab key.
6165 This is required for proper navogation over radio buttons.
6166 """
6167 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6168
6169 def SetFlags(*args, **kwargs):
6170 """
6171 SetFlags(self, long flags)
6172
6173 Set the navigation flags to a combination of the following:
6174
6175 * wx.NavigationKeyEvent.IsBackward
6176 * wx.NavigationKeyEvent.IsForward
6177 * wx.NavigationKeyEvent.WinChange
6178 * wx.NavigationKeyEvent.FromTab
6179
6180 """
6181 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6182
6183 def GetCurrentFocus(*args, **kwargs):
6184 """
6185 GetCurrentFocus(self) -> Window
6186
6187 Returns the child window which currenty has the focus. May be
6188 ``None``.
6189 """
6190 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6191
6192 def SetCurrentFocus(*args, **kwargs):
6193 """
6194 SetCurrentFocus(self, Window win)
6195
6196 Set the window that has the focus.
6197 """
6198 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6199
6200 IsBackward = _core_.NavigationKeyEvent_IsBackward
6201 IsForward = _core_.NavigationKeyEvent_IsForward
6202 WinChange = _core_.NavigationKeyEvent_WinChange
6203 FromTab = _core_.NavigationKeyEvent_FromTab
6204 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6205
6206 #---------------------------------------------------------------------------
6207
6208 class WindowCreateEvent(CommandEvent):
6209 """
6210 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6211 underlying GUI object) exists.
6212 """
6213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6214 __repr__ = _swig_repr
6215 def __init__(self, *args, **kwargs):
6216 """
6217 __init__(self, Window win=None) -> WindowCreateEvent
6218
6219 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6220 underlying GUI object) exists.
6221 """
6222 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6223 def GetWindow(*args, **kwargs):
6224 """
6225 GetWindow(self) -> Window
6226
6227 Returns the window that this event refers to.
6228 """
6229 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6230
6231 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6232
6233 class WindowDestroyEvent(CommandEvent):
6234 """
6235 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6236 when the GUI window is destroyed.
6237
6238 When a class derived from `wx.Window` is destroyed its destructor will
6239 have already run by the time this event is sent. Therefore this event
6240 will not usually be received at all by the window itself. Since it is
6241 received after the destructor has run, an object should not try to
6242 handle its own wx.WindowDestroyEvent, but it can be used to get
6243 notification of the destruction of another window.
6244 """
6245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6246 __repr__ = _swig_repr
6247 def __init__(self, *args, **kwargs):
6248 """
6249 __init__(self, Window win=None) -> WindowDestroyEvent
6250
6251 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6252 when the GUI window is destroyed.
6253
6254 When a class derived from `wx.Window` is destroyed its destructor will
6255 have already run by the time this event is sent. Therefore this event
6256 will not usually be received at all by the window itself. Since it is
6257 received after the destructor has run, an object should not try to
6258 handle its own wx.WindowDestroyEvent, but it can be used to get
6259 notification of the destruction of another window.
6260 """
6261 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6262 def GetWindow(*args, **kwargs):
6263 """
6264 GetWindow(self) -> Window
6265
6266 Returns the window that this event refers to.
6267 """
6268 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6269
6270 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6271
6272 #---------------------------------------------------------------------------
6273
6274 class ContextMenuEvent(CommandEvent):
6275 """
6276 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6277 give the application a chance to show a context (popup) menu.
6278 """
6279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6280 __repr__ = _swig_repr
6281 def __init__(self, *args, **kwargs):
6282 """
6283 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6284
6285 Constructor.
6286 """
6287 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6288 def GetPosition(*args, **kwargs):
6289 """
6290 GetPosition(self) -> Point
6291
6292 Returns the position (in screen coordinants) at which the menu should
6293 be shown.
6294 """
6295 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6296
6297 def SetPosition(*args, **kwargs):
6298 """
6299 SetPosition(self, Point pos)
6300
6301 Sets the position at which the menu should be shown.
6302 """
6303 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6304
6305 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6306 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6307
6308 #---------------------------------------------------------------------------
6309
6310 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6311 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6312 class IdleEvent(Event):
6313 """
6314 This class is used for EVT_IDLE events, which are generated and sent
6315 when the application *becomes* idle. In other words, the when the
6316 event queue becomes empty then idle events are sent to all windows (by
6317 default) and as long as none of them call `RequestMore` then there are
6318 no more idle events until after the system event queue has some normal
6319 events and then becomes empty again.
6320
6321 By default, idle events are sent to all windows. If this is causing a
6322 significant overhead in your application, you can call
6323 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6324 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6325 which should receive idle events. Then idle events will only be sent
6326 to those windows and not to any others.
6327 """
6328 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6329 __repr__ = _swig_repr
6330 def __init__(self, *args, **kwargs):
6331 """
6332 __init__(self) -> IdleEvent
6333
6334 Constructor
6335 """
6336 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6337 def RequestMore(*args, **kwargs):
6338 """
6339 RequestMore(self, bool needMore=True)
6340
6341 Tells wxWidgets that more processing is required. This function can be
6342 called by an EVT_IDLE handler for a window to indicate that the
6343 application should forward the EVT_IDLE event once more to the
6344 application windows. If no window calls this function during its
6345 EVT_IDLE handler, then the application will remain in a passive event
6346 loop until a new event is posted to the application by the windowing
6347 system.
6348 """
6349 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6350
6351 def MoreRequested(*args, **kwargs):
6352 """
6353 MoreRequested(self) -> bool
6354
6355 Returns ``True`` if the OnIdle function processing this event
6356 requested more processing time.
6357 """
6358 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6359
6360 def SetMode(*args, **kwargs):
6361 """
6362 SetMode(int mode)
6363
6364 Static method for specifying how wxWidgets will send idle events: to
6365 all windows, or only to those which specify that they will process the
6366 events.
6367
6368 The mode can be one of the following values:
6369
6370 ========================= ========================================
6371 wx.IDLE_PROCESS_ALL Send idle events to all windows
6372 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6373 the wx.WS_EX_PROCESS_IDLE extra style
6374 flag set.
6375 ========================= ========================================
6376
6377 """
6378 return _core_.IdleEvent_SetMode(*args, **kwargs)
6379
6380 SetMode = staticmethod(SetMode)
6381 def GetMode(*args, **kwargs):
6382 """
6383 GetMode() -> int
6384
6385 Static method returning a value specifying how wxWidgets will send
6386 idle events: to all windows, or only to those which specify that they
6387 will process the events.
6388 """
6389 return _core_.IdleEvent_GetMode(*args, **kwargs)
6390
6391 GetMode = staticmethod(GetMode)
6392 def CanSend(*args, **kwargs):
6393 """
6394 CanSend(Window win) -> bool
6395
6396 Returns ``True`` if it is appropriate to send idle events to this
6397 window.
6398
6399 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6400 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6401 events should be sent to this window now. By default this will always
6402 return ``True`` because the update mode is initially
6403 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6404 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6405 """
6406 return _core_.IdleEvent_CanSend(*args, **kwargs)
6407
6408 CanSend = staticmethod(CanSend)
6409 _core_.IdleEvent_swigregister(IdleEvent)
6410
6411 def IdleEvent_SetMode(*args, **kwargs):
6412 """
6413 IdleEvent_SetMode(int mode)
6414
6415 Static method for specifying how wxWidgets will send idle events: to
6416 all windows, or only to those which specify that they will process the
6417 events.
6418
6419 The mode can be one of the following values:
6420
6421 ========================= ========================================
6422 wx.IDLE_PROCESS_ALL Send idle events to all windows
6423 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6424 the wx.WS_EX_PROCESS_IDLE extra style
6425 flag set.
6426 ========================= ========================================
6427
6428 """
6429 return _core_.IdleEvent_SetMode(*args, **kwargs)
6430
6431 def IdleEvent_GetMode(*args):
6432 """
6433 IdleEvent_GetMode() -> int
6434
6435 Static method returning a value specifying how wxWidgets will send
6436 idle events: to all windows, or only to those which specify that they
6437 will process the events.
6438 """
6439 return _core_.IdleEvent_GetMode(*args)
6440
6441 def IdleEvent_CanSend(*args, **kwargs):
6442 """
6443 IdleEvent_CanSend(Window win) -> bool
6444
6445 Returns ``True`` if it is appropriate to send idle events to this
6446 window.
6447
6448 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6449 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6450 events should be sent to this window now. By default this will always
6451 return ``True`` because the update mode is initially
6452 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6453 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6454 """
6455 return _core_.IdleEvent_CanSend(*args, **kwargs)
6456
6457 #---------------------------------------------------------------------------
6458
6459 class ClipboardTextEvent(CommandEvent):
6460 """
6461 A Clipboard Text event is sent when a window intercepts a text
6462 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6463 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6464 popup menu command, etc. NOTE : under windows these events are *NOT*
6465 generated automatically for a Rich Edit text control.
6466 """
6467 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6468 __repr__ = _swig_repr
6469 def __init__(self, *args, **kwargs):
6470 """
6471 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6472
6473 A Clipboard Text event is sent when a window intercepts a text
6474 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6475 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6476 popup menu command, etc. NOTE : under windows these events are *NOT*
6477 generated automatically for a Rich Edit text control.
6478 """
6479 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6480 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6481
6482 #---------------------------------------------------------------------------
6483
6484 class PyEvent(Event):
6485 """
6486 wx.PyEvent can be used as a base class for implementing custom event
6487 types in Python. You should derived from this class instead of
6488 `wx.Event` because this class is Python-aware and is able to transport
6489 its Python bits safely through the wxWidgets event system and have
6490 them still be there when the event handler is invoked.
6491
6492 :see: `wx.PyCommandEvent`
6493
6494 """
6495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6496 __repr__ = _swig_repr
6497 def __init__(self, *args, **kwargs):
6498 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6499 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6500 self._SetSelf(self)
6501
6502 __swig_destroy__ = _core_.delete_PyEvent
6503 __del__ = lambda self : None;
6504 def _SetSelf(*args, **kwargs):
6505 """_SetSelf(self, PyObject self)"""
6506 return _core_.PyEvent__SetSelf(*args, **kwargs)
6507
6508 def _GetSelf(*args, **kwargs):
6509 """_GetSelf(self) -> PyObject"""
6510 return _core_.PyEvent__GetSelf(*args, **kwargs)
6511
6512 _core_.PyEvent_swigregister(PyEvent)
6513
6514 class PyCommandEvent(CommandEvent):
6515 """
6516 wx.PyCommandEvent can be used as a base class for implementing custom
6517 event types in Python, where the event shoudl travel up to parent
6518 windows looking for a handler. You should derived from this class
6519 instead of `wx.CommandEvent` because this class is Python-aware and is
6520 able to transport its Python bits safely through the wxWidgets event
6521 system and have them still be there when the event handler is invoked.
6522
6523 :see: `wx.PyEvent`
6524
6525 """
6526 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6527 __repr__ = _swig_repr
6528 def __init__(self, *args, **kwargs):
6529 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6530 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6531 self._SetSelf(self)
6532
6533 __swig_destroy__ = _core_.delete_PyCommandEvent
6534 __del__ = lambda self : None;
6535 def _SetSelf(*args, **kwargs):
6536 """_SetSelf(self, PyObject self)"""
6537 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6538
6539 def _GetSelf(*args, **kwargs):
6540 """_GetSelf(self) -> PyObject"""
6541 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6542
6543 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6544
6545 class DateEvent(CommandEvent):
6546 """
6547 This event class holds information about a date change event and is
6548 used together with `wx.DatePickerCtrl`. It also serves as a base class
6549 for `wx.calendar.CalendarEvent`. Bind these event types with
6550 EVT_DATE_CHANGED.
6551 """
6552 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6553 __repr__ = _swig_repr
6554 def __init__(self, *args, **kwargs):
6555 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6556 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6557 def GetDate(*args, **kwargs):
6558 """
6559 GetDate(self) -> DateTime
6560
6561 Returns the date.
6562 """
6563 return _core_.DateEvent_GetDate(*args, **kwargs)
6564
6565 def SetDate(*args, **kwargs):
6566 """
6567 SetDate(self, DateTime date)
6568
6569 Sets the date carried by the event, normally only used by the library
6570 internally.
6571 """
6572 return _core_.DateEvent_SetDate(*args, **kwargs)
6573
6574 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6575 _core_.DateEvent_swigregister(DateEvent)
6576
6577 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6578 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6579
6580 #---------------------------------------------------------------------------
6581
6582 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6583 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6584 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6585 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6586 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6587 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6588 class PyApp(EvtHandler):
6589 """
6590 The ``wx.PyApp`` class is an *implementation detail*, please use the
6591 `wx.App` class (or some other derived class) instead.
6592 """
6593 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6594 __repr__ = _swig_repr
6595 def __init__(self, *args, **kwargs):
6596 """
6597 __init__(self) -> PyApp
6598
6599 Create a new application object, starting the bootstrap process.
6600 """
6601 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6602 self._setCallbackInfo(self, PyApp, False)
6603 self._setOORInfo(self, False)
6604
6605 __swig_destroy__ = _core_.delete_PyApp
6606 __del__ = lambda self : None;
6607 def _setCallbackInfo(*args, **kwargs):
6608 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6609 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6610
6611 def GetAppName(*args, **kwargs):
6612 """
6613 GetAppName(self) -> String
6614
6615 Get the application name.
6616 """
6617 return _core_.PyApp_GetAppName(*args, **kwargs)
6618
6619 def SetAppName(*args, **kwargs):
6620 """
6621 SetAppName(self, String name)
6622
6623 Set the application name. This value may be used automatically by
6624 `wx.Config` and such.
6625 """
6626 return _core_.PyApp_SetAppName(*args, **kwargs)
6627
6628 def GetClassName(*args, **kwargs):
6629 """
6630 GetClassName(self) -> String
6631
6632 Get the application's class name.
6633 """
6634 return _core_.PyApp_GetClassName(*args, **kwargs)
6635
6636 def SetClassName(*args, **kwargs):
6637 """
6638 SetClassName(self, String name)
6639
6640 Set the application's class name. This value may be used for
6641 X-resources if applicable for the platform
6642 """
6643 return _core_.PyApp_SetClassName(*args, **kwargs)
6644
6645 def GetVendorName(*args, **kwargs):
6646 """
6647 GetVendorName(self) -> String
6648
6649 Get the application's vendor name.
6650 """
6651 return _core_.PyApp_GetVendorName(*args, **kwargs)
6652
6653 def SetVendorName(*args, **kwargs):
6654 """
6655 SetVendorName(self, String name)
6656
6657 Set the application's vendor name. This value may be used
6658 automatically by `wx.Config` and such.
6659 """
6660 return _core_.PyApp_SetVendorName(*args, **kwargs)
6661
6662 def GetTraits(*args, **kwargs):
6663 """
6664 GetTraits(self) -> wxAppTraits
6665
6666 Return (and create if necessary) the app traits object to which we
6667 delegate for everything which either should be configurable by the
6668 user (then he can change the default behaviour simply by overriding
6669 CreateTraits() and returning his own traits object) or which is
6670 GUI/console dependent as then wx.AppTraits allows us to abstract the
6671 differences behind the common facade.
6672
6673 :todo: Add support for overriding CreateAppTraits in wxPython.
6674 """
6675 return _core_.PyApp_GetTraits(*args, **kwargs)
6676
6677 def ProcessPendingEvents(*args, **kwargs):
6678 """
6679 ProcessPendingEvents(self)
6680
6681 Process all events in the Pending Events list -- it is necessary to
6682 call this function to process posted events. This normally happens
6683 during each event loop iteration.
6684 """
6685 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6686
6687 def Yield(*args, **kwargs):
6688 """
6689 Yield(self, bool onlyIfNeeded=False) -> bool
6690
6691 Process all currently pending events right now, instead of waiting
6692 until return to the event loop. It is an error to call ``Yield``
6693 recursively unless the value of ``onlyIfNeeded`` is True.
6694
6695 :warning: This function is dangerous as it can lead to unexpected
6696 reentrancies (i.e. when called from an event handler it may
6697 result in calling the same event handler again), use with
6698 extreme care or, better, don't use at all!
6699
6700 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6701
6702 """
6703 return _core_.PyApp_Yield(*args, **kwargs)
6704
6705 def WakeUpIdle(*args, **kwargs):
6706 """
6707 WakeUpIdle(self)
6708
6709 Make sure that idle events are sent again.
6710 :see: `wx.WakeUpIdle`
6711 """
6712 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6713
6714 def IsMainLoopRunning(*args, **kwargs):
6715 """
6716 IsMainLoopRunning() -> bool
6717
6718 Returns True if we're running the main loop, i.e. if the events can
6719 currently be dispatched.
6720 """
6721 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6722
6723 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6724 def MainLoop(*args, **kwargs):
6725 """
6726 MainLoop(self) -> int
6727
6728 Execute the main GUI loop, the function doesn't normally return until
6729 all top level windows have been closed and destroyed.
6730 """
6731 return _core_.PyApp_MainLoop(*args, **kwargs)
6732
6733 def Exit(*args, **kwargs):
6734 """
6735 Exit(self)
6736
6737 Exit the main loop thus terminating the application.
6738 :see: `wx.Exit`
6739 """
6740 return _core_.PyApp_Exit(*args, **kwargs)
6741
6742 def GetLayoutDirection(*args, **kwargs):
6743 """
6744 GetLayoutDirection(self) -> wxLayoutDirection
6745
6746 Return the layout direction for the current locale.
6747 """
6748 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6749
6750 def ExitMainLoop(*args, **kwargs):
6751 """
6752 ExitMainLoop(self)
6753
6754 Exit the main GUI loop during the next iteration of the main
6755 loop, (i.e. it does not stop the program immediately!)
6756 """
6757 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6758
6759 def Pending(*args, **kwargs):
6760 """
6761 Pending(self) -> bool
6762
6763 Returns True if there are unprocessed events in the event queue.
6764 """
6765 return _core_.PyApp_Pending(*args, **kwargs)
6766
6767 def Dispatch(*args, **kwargs):
6768 """
6769 Dispatch(self) -> bool
6770
6771 Process the first event in the event queue (blocks until an event
6772 appears if there are none currently)
6773 """
6774 return _core_.PyApp_Dispatch(*args, **kwargs)
6775
6776 def ProcessIdle(*args, **kwargs):
6777 """
6778 ProcessIdle(self) -> bool
6779
6780 Called from the MainLoop when the application becomes idle (there are
6781 no pending events) and sends a `wx.IdleEvent` to all interested
6782 parties. Returns True if more idle events are needed, False if not.
6783 """
6784 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6785
6786 def SendIdleEvents(*args, **kwargs):
6787 """
6788 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6789
6790 Send idle event to window and all subwindows. Returns True if more
6791 idle time is requested.
6792 """
6793 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6794
6795 def IsActive(*args, **kwargs):
6796 """
6797 IsActive(self) -> bool
6798
6799 Return True if our app has focus.
6800 """
6801 return _core_.PyApp_IsActive(*args, **kwargs)
6802
6803 def SetTopWindow(*args, **kwargs):
6804 """
6805 SetTopWindow(self, Window win)
6806
6807 Set the *main* top level window
6808 """
6809 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6810
6811 def GetTopWindow(*args, **kwargs):
6812 """
6813 GetTopWindow(self) -> Window
6814
6815 Return the *main* top level window (if it hadn't been set previously
6816 with SetTopWindow(), will return just some top level window and, if
6817 there not any, will return None)
6818 """
6819 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6820
6821 def SetExitOnFrameDelete(*args, **kwargs):
6822 """
6823 SetExitOnFrameDelete(self, bool flag)
6824
6825 Control the exit behaviour: by default, the program will exit the main
6826 loop (and so, usually, terminate) when the last top-level program
6827 window is deleted. Beware that if you disable this behaviour (with
6828 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6829 explicitly from somewhere.
6830 """
6831 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6832
6833 def GetExitOnFrameDelete(*args, **kwargs):
6834 """
6835 GetExitOnFrameDelete(self) -> bool
6836
6837 Get the current exit behaviour setting.
6838 """
6839 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6840
6841 def SetUseBestVisual(*args, **kwargs):
6842 """
6843 SetUseBestVisual(self, bool flag)
6844
6845 Set whether the app should try to use the best available visual on
6846 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6847 """
6848 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6849
6850 def GetUseBestVisual(*args, **kwargs):
6851 """
6852 GetUseBestVisual(self) -> bool
6853
6854 Get current UseBestVisual setting.
6855 """
6856 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6857
6858 def SetPrintMode(*args, **kwargs):
6859 """SetPrintMode(self, int mode)"""
6860 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6861
6862 def GetPrintMode(*args, **kwargs):
6863 """GetPrintMode(self) -> int"""
6864 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6865
6866 def SetAssertMode(*args, **kwargs):
6867 """
6868 SetAssertMode(self, int mode)
6869
6870 Set the OnAssert behaviour for debug and hybrid builds.
6871 """
6872 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6873
6874 def GetAssertMode(*args, **kwargs):
6875 """
6876 GetAssertMode(self) -> int
6877
6878 Get the current OnAssert behaviour setting.
6879 """
6880 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6881
6882 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6883 """GetMacSupportPCMenuShortcuts() -> bool"""
6884 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6885
6886 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6887 def GetMacAboutMenuItemId(*args, **kwargs):
6888 """GetMacAboutMenuItemId() -> long"""
6889 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6890
6891 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6892 def GetMacPreferencesMenuItemId(*args, **kwargs):
6893 """GetMacPreferencesMenuItemId() -> long"""
6894 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6895
6896 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6897 def GetMacExitMenuItemId(*args, **kwargs):
6898 """GetMacExitMenuItemId() -> long"""
6899 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6900
6901 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6902 def GetMacHelpMenuTitleName(*args, **kwargs):
6903 """GetMacHelpMenuTitleName() -> String"""
6904 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6905
6906 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6907 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6908 """SetMacSupportPCMenuShortcuts(bool val)"""
6909 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6910
6911 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6912 def SetMacAboutMenuItemId(*args, **kwargs):
6913 """SetMacAboutMenuItemId(long val)"""
6914 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6915
6916 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6917 def SetMacPreferencesMenuItemId(*args, **kwargs):
6918 """SetMacPreferencesMenuItemId(long val)"""
6919 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6920
6921 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6922 def SetMacExitMenuItemId(*args, **kwargs):
6923 """SetMacExitMenuItemId(long val)"""
6924 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6925
6926 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6927 def SetMacHelpMenuTitleName(*args, **kwargs):
6928 """SetMacHelpMenuTitleName(String val)"""
6929 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6930
6931 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6932 def _BootstrapApp(*args, **kwargs):
6933 """
6934 _BootstrapApp(self)
6935
6936 For internal use only
6937 """
6938 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6939
6940 def GetComCtl32Version(*args, **kwargs):
6941 """
6942 GetComCtl32Version() -> int
6943
6944 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6945 it wasn't found at all. Raises an exception on non-Windows platforms.
6946 """
6947 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6948
6949 GetComCtl32Version = staticmethod(GetComCtl32Version)
6950 def DisplayAvailable(*args, **kwargs):
6951 """
6952 DisplayAvailable() -> bool
6953
6954 Tests if it is possible to create a GUI in the current environment.
6955 This will mean different things on the different platforms.
6956
6957 * On X Windows systems this function will return ``False`` if it is
6958 not able to open a connection to the X display, which can happen
6959 if $DISPLAY is not set, or is not set correctly.
6960
6961 * On Mac OS X a ``False`` return value will mean that wx is not
6962 able to access the window manager, which can happen if logged in
6963 remotely or if running from the normal version of python instead
6964 of the framework version, (i.e., pythonw.)
6965
6966 * On MS Windows...
6967
6968 """
6969 return _core_.PyApp_DisplayAvailable(*args, **kwargs)
6970
6971 DisplayAvailable = staticmethod(DisplayAvailable)
6972 _core_.PyApp_swigregister(PyApp)
6973
6974 def PyApp_IsMainLoopRunning(*args):
6975 """
6976 PyApp_IsMainLoopRunning() -> bool
6977
6978 Returns True if we're running the main loop, i.e. if the events can
6979 currently be dispatched.
6980 """
6981 return _core_.PyApp_IsMainLoopRunning(*args)
6982
6983 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6984 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6985 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6986
6987 def PyApp_GetMacAboutMenuItemId(*args):
6988 """PyApp_GetMacAboutMenuItemId() -> long"""
6989 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6990
6991 def PyApp_GetMacPreferencesMenuItemId(*args):
6992 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6993 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6994
6995 def PyApp_GetMacExitMenuItemId(*args):
6996 """PyApp_GetMacExitMenuItemId() -> long"""
6997 return _core_.PyApp_GetMacExitMenuItemId(*args)
6998
6999 def PyApp_GetMacHelpMenuTitleName(*args):
7000 """PyApp_GetMacHelpMenuTitleName() -> String"""
7001 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7002
7003 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7004 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7005 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7006
7007 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7008 """PyApp_SetMacAboutMenuItemId(long val)"""
7009 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7010
7011 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7012 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7013 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7014
7015 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7016 """PyApp_SetMacExitMenuItemId(long val)"""
7017 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7018
7019 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7020 """PyApp_SetMacHelpMenuTitleName(String val)"""
7021 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7022
7023 def PyApp_GetComCtl32Version(*args):
7024 """
7025 PyApp_GetComCtl32Version() -> int
7026
7027 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7028 it wasn't found at all. Raises an exception on non-Windows platforms.
7029 """
7030 return _core_.PyApp_GetComCtl32Version(*args)
7031
7032 def PyApp_DisplayAvailable(*args):
7033 """
7034 PyApp_DisplayAvailable() -> bool
7035
7036 Tests if it is possible to create a GUI in the current environment.
7037 This will mean different things on the different platforms.
7038
7039 * On X Windows systems this function will return ``False`` if it is
7040 not able to open a connection to the X display, which can happen
7041 if $DISPLAY is not set, or is not set correctly.
7042
7043 * On Mac OS X a ``False`` return value will mean that wx is not
7044 able to access the window manager, which can happen if logged in
7045 remotely or if running from the normal version of python instead
7046 of the framework version, (i.e., pythonw.)
7047
7048 * On MS Windows...
7049
7050 """
7051 return _core_.PyApp_DisplayAvailable(*args)
7052
7053 #---------------------------------------------------------------------------
7054
7055
7056 def Exit(*args):
7057 """
7058 Exit()
7059
7060 Force an exit of the application. Convenience for wx.GetApp().Exit()
7061 """
7062 return _core_.Exit(*args)
7063
7064 def Yield(*args):
7065 """
7066 Yield() -> bool
7067
7068 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7069 """
7070 return _core_.Yield(*args)
7071
7072 def YieldIfNeeded(*args):
7073 """
7074 YieldIfNeeded() -> bool
7075
7076 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7077 """
7078 return _core_.YieldIfNeeded(*args)
7079
7080 def SafeYield(*args, **kwargs):
7081 """
7082 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7083
7084 This function is similar to `wx.Yield`, except that it disables the
7085 user input to all program windows before calling `wx.Yield` and
7086 re-enables it again afterwards. If ``win`` is not None, this window
7087 will remain enabled, allowing the implementation of some limited user
7088 interaction.
7089
7090 :Returns: the result of the call to `wx.Yield`.
7091 """
7092 return _core_.SafeYield(*args, **kwargs)
7093
7094 def WakeUpIdle(*args):
7095 """
7096 WakeUpIdle()
7097
7098 Cause the message queue to become empty again, so idle events will be
7099 sent.
7100 """
7101 return _core_.WakeUpIdle(*args)
7102
7103 def PostEvent(*args, **kwargs):
7104 """
7105 PostEvent(EvtHandler dest, Event event)
7106
7107 Send an event to a window or other wx.EvtHandler to be processed
7108 later.
7109 """
7110 return _core_.PostEvent(*args, **kwargs)
7111
7112 def App_CleanUp(*args):
7113 """
7114 App_CleanUp()
7115
7116 For internal use only, it is used to cleanup after wxWidgets when
7117 Python shuts down.
7118 """
7119 return _core_.App_CleanUp(*args)
7120
7121 def GetApp(*args):
7122 """
7123 GetApp() -> PyApp
7124
7125 Return a reference to the current wx.App object.
7126 """
7127 return _core_.GetApp(*args)
7128
7129 def SetDefaultPyEncoding(*args, **kwargs):
7130 """
7131 SetDefaultPyEncoding(string encoding)
7132
7133 Sets the encoding that wxPython will use when it needs to convert a
7134 Python string or unicode object to or from a wxString.
7135
7136 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7137 but please be aware that the default encoding within the same locale
7138 may be slightly different on different platforms. For example, please
7139 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7140 between the common latin/roman encodings.
7141 """
7142 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7143
7144 def GetDefaultPyEncoding(*args):
7145 """
7146 GetDefaultPyEncoding() -> string
7147
7148 Gets the current encoding that wxPython will use when it needs to
7149 convert a Python string or unicode object to or from a wxString.
7150 """
7151 return _core_.GetDefaultPyEncoding(*args)
7152 #----------------------------------------------------------------------
7153
7154 class PyOnDemandOutputWindow:
7155 """
7156 A class that can be used for redirecting Python's stdout and
7157 stderr streams. It will do nothing until something is wrriten to
7158 the stream at which point it will create a Frame with a text area
7159 and write the text there.
7160 """
7161 def __init__(self, title = "wxPython: stdout/stderr"):
7162 self.frame = None
7163 self.title = title
7164 self.pos = wx.DefaultPosition
7165 self.size = (450, 300)
7166 self.parent = None
7167
7168 def SetParent(self, parent):
7169 """Set the window to be used as the popup Frame's parent."""
7170 self.parent = parent
7171
7172
7173 def CreateOutputWindow(self, st):
7174 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7175 style=wx.DEFAULT_FRAME_STYLE)
7176 self.text = wx.TextCtrl(self.frame, -1, "",
7177 style=wx.TE_MULTILINE|wx.TE_READONLY)
7178 self.text.AppendText(st)
7179 self.frame.Show(True)
7180 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7181
7182
7183 def OnCloseWindow(self, event):
7184 if self.frame is not None:
7185 self.frame.Destroy()
7186 self.frame = None
7187 self.text = None
7188
7189
7190 # These methods provide the file-like output behaviour.
7191 def write(self, text):
7192 """
7193 Create the output window if needed and write the string to it.
7194 If not called in the context of the gui thread then uses
7195 CallAfter to do the work there.
7196 """
7197 if self.frame is None:
7198 if not wx.Thread_IsMain():
7199 wx.CallAfter(self.CreateOutputWindow, text)
7200 else:
7201 self.CreateOutputWindow(text)
7202 else:
7203 if not wx.Thread_IsMain():
7204 wx.CallAfter(self.text.AppendText, text)
7205 else:
7206 self.text.AppendText(text)
7207
7208
7209 def close(self):
7210 if self.frame is not None:
7211 wx.CallAfter(self.frame.Close)
7212
7213
7214 def flush(self):
7215 pass
7216
7217
7218
7219 #----------------------------------------------------------------------
7220
7221 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7222
7223 class App(wx.PyApp):
7224 """
7225 The ``wx.App`` class represents the application and is used to:
7226
7227 * bootstrap the wxPython system and initialize the underlying
7228 gui toolkit
7229 * set and get application-wide properties
7230 * implement the windowing system main message or event loop,
7231 and to dispatch events to window instances
7232 * etc.
7233
7234 Every application must have a ``wx.App`` instance, and all
7235 creation of UI objects should be delayed until after the
7236 ``wx.App`` object has been created in order to ensure that the gui
7237 platform and wxWidgets have been fully initialized.
7238
7239 Normally you would derive from this class and implement an
7240 ``OnInit`` method that creates a frame and then calls
7241 ``self.SetTopWindow(frame)``.
7242
7243 :see: `wx.PySimpleApp` for a simpler app class that can be used
7244 directly.
7245 """
7246
7247 outputWindowClass = PyOnDemandOutputWindow
7248
7249 def __init__(self, redirect=_defRedirect, filename=None,
7250 useBestVisual=False, clearSigInt=True):
7251 """
7252 Construct a ``wx.App`` object.
7253
7254 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7255 redirected? Defaults to True on Windows and Mac, False
7256 otherwise. If `filename` is None then output will be
7257 redirected to a window that pops up as needed. (You can
7258 control what kind of window is created for the output by
7259 resetting the class variable ``outputWindowClass`` to a
7260 class of your choosing.)
7261
7262 :param filename: The name of a file to redirect output to, if
7263 redirect is True.
7264
7265 :param useBestVisual: Should the app try to use the best
7266 available visual provided by the system (only relevant on
7267 systems that have more than one visual.) This parameter
7268 must be used instead of calling `SetUseBestVisual` later
7269 on because it must be set before the underlying GUI
7270 toolkit is initialized.
7271
7272 :param clearSigInt: Should SIGINT be cleared? This allows the
7273 app to terminate upon a Ctrl-C in the console like other
7274 GUI apps will.
7275
7276 :note: You should override OnInit to do applicaition
7277 initialization to ensure that the system, toolkit and
7278 wxWidgets are fully initialized.
7279 """
7280
7281 wx.PyApp.__init__(self)
7282
7283 # make sure we can create a GUI
7284 if not self.DisplayAvailable():
7285
7286 if wx.Platform == "__WXMAC__":
7287 msg = """This program needs access to the screen.
7288 Please run with 'pythonw', not 'python', and only when you are logged
7289 in on the main display of your Mac."""
7290
7291 elif wx.Platform == "__WXGTK__":
7292 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7293
7294 else:
7295 msg = "Unable to create GUI"
7296 # TODO: more description is needed for wxMSW...
7297
7298 raise SystemExit(msg)
7299
7300 # This has to be done before OnInit
7301 self.SetUseBestVisual(useBestVisual)
7302
7303 # Set the default handler for SIGINT. This fixes a problem
7304 # where if Ctrl-C is pressed in the console that started this
7305 # app then it will not appear to do anything, (not even send
7306 # KeyboardInterrupt???) but will later segfault on exit. By
7307 # setting the default handler then the app will exit, as
7308 # expected (depending on platform.)
7309 if clearSigInt:
7310 try:
7311 import signal
7312 signal.signal(signal.SIGINT, signal.SIG_DFL)
7313 except:
7314 pass
7315
7316 # Save and redirect the stdio to a window?
7317 self.stdioWin = None
7318 self.saveStdio = (_sys.stdout, _sys.stderr)
7319 if redirect:
7320 self.RedirectStdio(filename)
7321
7322 # Use Python's install prefix as the default
7323 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7324
7325 # This finishes the initialization of wxWindows and then calls
7326 # the OnInit that should be present in the derived class
7327 self._BootstrapApp()
7328
7329
7330 def OnPreInit(self):
7331 """
7332 Things that must be done after _BootstrapApp has done its
7333 thing, but would be nice if they were already done by the time
7334 that OnInit is called.
7335 """
7336 wx.StockGDI._initStockObjects()
7337
7338
7339 def __del__(self, destroy=wx.PyApp.__del__):
7340 self.RestoreStdio() # Just in case the MainLoop was overridden
7341 destroy(self)
7342
7343 def Destroy(self):
7344 wx.PyApp.Destroy(self)
7345 self.thisown = 0
7346
7347 def SetTopWindow(self, frame):
7348 """Set the \"main\" top level window"""
7349 if self.stdioWin:
7350 self.stdioWin.SetParent(frame)
7351 wx.PyApp.SetTopWindow(self, frame)
7352
7353
7354 def MainLoop(self):
7355 """Execute the main GUI event loop"""
7356 wx.PyApp.MainLoop(self)
7357 self.RestoreStdio()
7358
7359
7360 def RedirectStdio(self, filename=None):
7361 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7362 if filename:
7363 _sys.stdout = _sys.stderr = open(filename, 'a')
7364 else:
7365 self.stdioWin = self.outputWindowClass()
7366 _sys.stdout = _sys.stderr = self.stdioWin
7367
7368
7369 def RestoreStdio(self):
7370 try:
7371 _sys.stdout, _sys.stderr = self.saveStdio
7372 except:
7373 pass
7374
7375
7376 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7377 """
7378 Set the title, position and/or size of the output window if
7379 the stdio has been redirected. This should be called before
7380 any output would cause the output window to be created.
7381 """
7382 if self.stdioWin:
7383 if title is not None:
7384 self.stdioWin.title = title
7385 if pos is not None:
7386 self.stdioWin.pos = pos
7387 if size is not None:
7388 self.stdioWin.size = size
7389
7390
7391
7392
7393 # change from wx.PyApp_XX to wx.App_XX
7394 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7395 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7396 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7397 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7398 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7399 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7400 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7401 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7402 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7403 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7404 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7405
7406 #----------------------------------------------------------------------------
7407
7408 class PySimpleApp(wx.App):
7409 """
7410 A simple application class. You can just create one of these and
7411 then then make your top level windows later, and not have to worry
7412 about OnInit. For example::
7413
7414 app = wx.PySimpleApp()
7415 frame = wx.Frame(None, title='Hello World')
7416 frame.Show()
7417 app.MainLoop()
7418
7419 :see: `wx.App`
7420 """
7421
7422 def __init__(self, redirect=False, filename=None,
7423 useBestVisual=False, clearSigInt=True):
7424 """
7425 :see: `wx.App.__init__`
7426 """
7427 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7428
7429 def OnInit(self):
7430 return True
7431
7432
7433
7434 # Is anybody using this one?
7435 class PyWidgetTester(wx.App):
7436 def __init__(self, size = (250, 100)):
7437 self.size = size
7438 wx.App.__init__(self, 0)
7439
7440 def OnInit(self):
7441 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7442 self.SetTopWindow(self.frame)
7443 return True
7444
7445 def SetWidget(self, widgetClass, *args, **kwargs):
7446 w = widgetClass(self.frame, *args, **kwargs)
7447 self.frame.Show(True)
7448
7449 #----------------------------------------------------------------------------
7450 # DO NOT hold any other references to this object. This is how we
7451 # know when to cleanup system resources that wxWidgets is holding. When
7452 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7453 # goes to zero and it calls the wx.App_CleanUp function.
7454
7455 class __wxPyCleanup:
7456 def __init__(self):
7457 self.cleanup = _core_.App_CleanUp
7458 def __del__(self):
7459 self.cleanup()
7460
7461 _sys.__wxPythonCleanup = __wxPyCleanup()
7462
7463 ## # another possible solution, but it gets called too early...
7464 ## import atexit
7465 ## atexit.register(_core_.wxApp_CleanUp)
7466
7467
7468 #----------------------------------------------------------------------------
7469
7470 #---------------------------------------------------------------------------
7471
7472 class EventLoop(object):
7473 """Proxy of C++ EventLoop class"""
7474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7475 __repr__ = _swig_repr
7476 def __init__(self, *args, **kwargs):
7477 """__init__(self) -> EventLoop"""
7478 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7479 __swig_destroy__ = _core_.delete_EventLoop
7480 __del__ = lambda self : None;
7481 def Run(*args, **kwargs):
7482 """Run(self) -> int"""
7483 return _core_.EventLoop_Run(*args, **kwargs)
7484
7485 def Exit(*args, **kwargs):
7486 """Exit(self, int rc=0)"""
7487 return _core_.EventLoop_Exit(*args, **kwargs)
7488
7489 def Pending(*args, **kwargs):
7490 """Pending(self) -> bool"""
7491 return _core_.EventLoop_Pending(*args, **kwargs)
7492
7493 def Dispatch(*args, **kwargs):
7494 """Dispatch(self) -> bool"""
7495 return _core_.EventLoop_Dispatch(*args, **kwargs)
7496
7497 def IsRunning(*args, **kwargs):
7498 """IsRunning(self) -> bool"""
7499 return _core_.EventLoop_IsRunning(*args, **kwargs)
7500
7501 def GetActive(*args, **kwargs):
7502 """GetActive() -> EventLoop"""
7503 return _core_.EventLoop_GetActive(*args, **kwargs)
7504
7505 GetActive = staticmethod(GetActive)
7506 def SetActive(*args, **kwargs):
7507 """SetActive(EventLoop loop)"""
7508 return _core_.EventLoop_SetActive(*args, **kwargs)
7509
7510 SetActive = staticmethod(SetActive)
7511 _core_.EventLoop_swigregister(EventLoop)
7512
7513 def EventLoop_GetActive(*args):
7514 """EventLoop_GetActive() -> EventLoop"""
7515 return _core_.EventLoop_GetActive(*args)
7516
7517 def EventLoop_SetActive(*args, **kwargs):
7518 """EventLoop_SetActive(EventLoop loop)"""
7519 return _core_.EventLoop_SetActive(*args, **kwargs)
7520
7521 class EventLoopActivator(object):
7522 """Proxy of C++ EventLoopActivator class"""
7523 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7524 __repr__ = _swig_repr
7525 def __init__(self, *args, **kwargs):
7526 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7527 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7528 __swig_destroy__ = _core_.delete_EventLoopActivator
7529 __del__ = lambda self : None;
7530 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7531
7532 #---------------------------------------------------------------------------
7533
7534 ACCEL_ALT = _core_.ACCEL_ALT
7535 ACCEL_CTRL = _core_.ACCEL_CTRL
7536 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7537 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7538 ACCEL_CMD = _core_.ACCEL_CMD
7539 class AcceleratorEntry(object):
7540 """
7541 A class used to define items in an `wx.AcceleratorTable`. wxPython
7542 programs can choose to use wx.AcceleratorEntry objects, but using a
7543 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7544 as well. See `__init__` for of the tuple values.
7545
7546 :see: `wx.AcceleratorTable`
7547 """
7548 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7549 __repr__ = _swig_repr
7550 def __init__(self, *args, **kwargs):
7551 """
7552 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7553
7554 Construct a wx.AcceleratorEntry.
7555 """
7556 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7557 __swig_destroy__ = _core_.delete_AcceleratorEntry
7558 __del__ = lambda self : None;
7559 def Set(*args, **kwargs):
7560 """
7561 Set(self, int flags, int keyCode, int cmd)
7562
7563 (Re)set the attributes of a wx.AcceleratorEntry.
7564 :see `__init__`
7565 """
7566 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7567
7568 def Create(*args, **kwargs):
7569 """
7570 Create(String str) -> AcceleratorEntry
7571
7572 Create accelerator corresponding to the specified string, or None if
7573 it coulnd't be parsed.
7574 """
7575 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7576
7577 Create = staticmethod(Create)
7578 def GetFlags(*args, **kwargs):
7579 """
7580 GetFlags(self) -> int
7581
7582 Get the AcceleratorEntry's flags.
7583 """
7584 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7585
7586 def GetKeyCode(*args, **kwargs):
7587 """
7588 GetKeyCode(self) -> int
7589
7590 Get the AcceleratorEntry's keycode.
7591 """
7592 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7593
7594 def GetCommand(*args, **kwargs):
7595 """
7596 GetCommand(self) -> int
7597
7598 Get the AcceleratorEntry's command ID.
7599 """
7600 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7601
7602 def IsOk(*args, **kwargs):
7603 """IsOk(self) -> bool"""
7604 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7605
7606 def ToString(*args, **kwargs):
7607 """
7608 ToString(self) -> String
7609
7610 Returns a string representation for the this accelerator. The string
7611 is formatted using the <flags>-<keycode> format where <flags> maybe a
7612 hyphen-separed list of "shift|alt|ctrl"
7613
7614 """
7615 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7616
7617 def FromString(*args, **kwargs):
7618 """
7619 FromString(self, String str) -> bool
7620
7621 Returns true if the given string correctly initialized this object.
7622 """
7623 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7624
7625 Command = property(GetCommand,doc="See `GetCommand`")
7626 Flags = property(GetFlags,doc="See `GetFlags`")
7627 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7628 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7629
7630 def AcceleratorEntry_Create(*args, **kwargs):
7631 """
7632 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7633
7634 Create accelerator corresponding to the specified string, or None if
7635 it coulnd't be parsed.
7636 """
7637 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7638
7639 class AcceleratorTable(Object):
7640 """
7641 An accelerator table allows the application to specify a table of
7642 keyboard shortcuts for menus or other commands. On Windows, menu or
7643 button commands are supported; on GTK, only menu commands are
7644 supported.
7645 """
7646 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7647 __repr__ = _swig_repr
7648 def __init__(self, *args, **kwargs):
7649 """
7650 __init__(entries) -> AcceleratorTable
7651
7652 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7653 items or or of 3-tuples (flags, keyCode, cmdID)
7654
7655 :see: `wx.AcceleratorEntry`
7656 """
7657 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7658 __swig_destroy__ = _core_.delete_AcceleratorTable
7659 __del__ = lambda self : None;
7660 def Ok(*args, **kwargs):
7661 """Ok(self) -> bool"""
7662 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7663
7664 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7665
7666
7667 def GetAccelFromString(*args, **kwargs):
7668 """GetAccelFromString(String label) -> AcceleratorEntry"""
7669 return _core_.GetAccelFromString(*args, **kwargs)
7670 #---------------------------------------------------------------------------
7671
7672 class VisualAttributes(object):
7673 """struct containing all the visual attributes of a control"""
7674 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7675 __repr__ = _swig_repr
7676 def __init__(self, *args, **kwargs):
7677 """
7678 __init__(self) -> VisualAttributes
7679
7680 struct containing all the visual attributes of a control
7681 """
7682 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7683 __swig_destroy__ = _core_.delete_VisualAttributes
7684 __del__ = lambda self : None;
7685 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7686 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7687 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7688 _core_.VisualAttributes_swigregister(VisualAttributes)
7689 NullAcceleratorTable = cvar.NullAcceleratorTable
7690 PanelNameStr = cvar.PanelNameStr
7691
7692 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7693 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7694 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7695 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7696 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7697 class Window(EvtHandler):
7698 """
7699 wx.Window is the base class for all windows and represents any visible
7700 object on the screen. All controls, top level windows and so on are
7701 wx.Windows. Sizers and device contexts are not however, as they don't
7702 appear on screen themselves.
7703
7704 """
7705 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7706 __repr__ = _swig_repr
7707 def __init__(self, *args, **kwargs):
7708 """
7709 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7710 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7711
7712 Construct and show a generic Window.
7713 """
7714 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7715 self._setOORInfo(self)
7716
7717 def Create(*args, **kwargs):
7718 """
7719 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7720 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7721
7722 Create the GUI part of the Window for 2-phase creation mode.
7723 """
7724 return _core_.Window_Create(*args, **kwargs)
7725
7726 def Close(*args, **kwargs):
7727 """
7728 Close(self, bool force=False) -> bool
7729
7730 This function simply generates a EVT_CLOSE event whose handler usually
7731 tries to close the window. It doesn't close the window itself,
7732 however. If force is False (the default) then the window's close
7733 handler will be allowed to veto the destruction of the window.
7734 """
7735 return _core_.Window_Close(*args, **kwargs)
7736
7737 def Destroy(*args, **kwargs):
7738 """
7739 Destroy(self) -> bool
7740
7741 Destroys the window safely. Frames and dialogs are not destroyed
7742 immediately when this function is called -- they are added to a list
7743 of windows to be deleted on idle time, when all the window's events
7744 have been processed. This prevents problems with events being sent to
7745 non-existent windows.
7746
7747 Returns True if the window has either been successfully deleted, or it
7748 has been added to the list of windows pending real deletion.
7749 """
7750 val = _core_.Window_Destroy(*args, **kwargs)
7751 args[0].thisown = 0
7752 return val
7753
7754 def DestroyChildren(*args, **kwargs):
7755 """
7756 DestroyChildren(self) -> bool
7757
7758 Destroys all children of a window. Called automatically by the
7759 destructor.
7760 """
7761 return _core_.Window_DestroyChildren(*args, **kwargs)
7762
7763 def IsBeingDeleted(*args, **kwargs):
7764 """
7765 IsBeingDeleted(self) -> bool
7766
7767 Is the window in the process of being deleted?
7768 """
7769 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7770
7771 def SetLabel(*args, **kwargs):
7772 """
7773 SetLabel(self, String label)
7774
7775 Set the text which the window shows in its label if applicable.
7776 """
7777 return _core_.Window_SetLabel(*args, **kwargs)
7778
7779 def GetLabel(*args, **kwargs):
7780 """
7781 GetLabel(self) -> String
7782
7783 Generic way of getting a label from any window, for identification
7784 purposes. The interpretation of this function differs from class to
7785 class. For frames and dialogs, the value returned is the title. For
7786 buttons or static text controls, it is the button text. This function
7787 can be useful for meta-programs such as testing tools or special-needs
7788 access programs)which need to identify windows by name.
7789 """
7790 return _core_.Window_GetLabel(*args, **kwargs)
7791
7792 def SetName(*args, **kwargs):
7793 """
7794 SetName(self, String name)
7795
7796 Sets the window's name. The window name is used for ressource setting
7797 in X, it is not the same as the window title/label
7798 """
7799 return _core_.Window_SetName(*args, **kwargs)
7800
7801 def GetName(*args, **kwargs):
7802 """
7803 GetName(self) -> String
7804
7805 Returns the windows name. This name is not guaranteed to be unique;
7806 it is up to the programmer to supply an appropriate name in the window
7807 constructor or via wx.Window.SetName.
7808 """
7809 return _core_.Window_GetName(*args, **kwargs)
7810
7811 def SetWindowVariant(*args, **kwargs):
7812 """
7813 SetWindowVariant(self, int variant)
7814
7815 Sets the variant of the window/font size to use for this window, if
7816 the platform supports variants, for example, wxMac.
7817 """
7818 return _core_.Window_SetWindowVariant(*args, **kwargs)
7819
7820 def GetWindowVariant(*args, **kwargs):
7821 """GetWindowVariant(self) -> int"""
7822 return _core_.Window_GetWindowVariant(*args, **kwargs)
7823
7824 def SetId(*args, **kwargs):
7825 """
7826 SetId(self, int winid)
7827
7828 Sets the identifier of the window. Each window has an integer
7829 identifier. If the application has not provided one, an identifier
7830 will be generated. Normally, the identifier should be provided on
7831 creation and should not be modified subsequently.
7832 """
7833 return _core_.Window_SetId(*args, **kwargs)
7834
7835 def GetId(*args, **kwargs):
7836 """
7837 GetId(self) -> int
7838
7839 Returns the identifier of the window. Each window has an integer
7840 identifier. If the application has not provided one (or the default Id
7841 -1 is used) then an unique identifier with a negative value will be
7842 generated.
7843 """
7844 return _core_.Window_GetId(*args, **kwargs)
7845
7846 def NewControlId(*args, **kwargs):
7847 """
7848 NewControlId() -> int
7849
7850 Generate a control id for the controls which were not given one.
7851 """
7852 return _core_.Window_NewControlId(*args, **kwargs)
7853
7854 NewControlId = staticmethod(NewControlId)
7855 def NextControlId(*args, **kwargs):
7856 """
7857 NextControlId(int winid) -> int
7858
7859 Get the id of the control following the one with the given
7860 autogenerated) id
7861 """
7862 return _core_.Window_NextControlId(*args, **kwargs)
7863
7864 NextControlId = staticmethod(NextControlId)
7865 def PrevControlId(*args, **kwargs):
7866 """
7867 PrevControlId(int winid) -> int
7868
7869 Get the id of the control preceding the one with the given
7870 autogenerated) id
7871 """
7872 return _core_.Window_PrevControlId(*args, **kwargs)
7873
7874 PrevControlId = staticmethod(PrevControlId)
7875 def GetLayoutDirection(*args, **kwargs):
7876 """
7877 GetLayoutDirection(self) -> wxLayoutDirection
7878
7879 Get the layout direction (LTR or RTL) for this window. Returns
7880 ``wx.Layout_Default`` if layout direction is not supported.
7881 """
7882 return _core_.Window_GetLayoutDirection(*args, **kwargs)
7883
7884 def SetLayoutDirection(*args, **kwargs):
7885 """
7886 SetLayoutDirection(self, wxLayoutDirection dir)
7887
7888 Set the layout direction (LTR or RTL) for this window.
7889 """
7890 return _core_.Window_SetLayoutDirection(*args, **kwargs)
7891
7892 def AdjustForLayoutDirection(*args, **kwargs):
7893 """
7894 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7895
7896 Mirror coordinates for RTL layout if this window uses it and if the
7897 mirroring is not done automatically like Win32.
7898 """
7899 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
7900
7901 def SetSize(*args, **kwargs):
7902 """
7903 SetSize(self, Size size)
7904
7905 Sets the size of the window in pixels.
7906 """
7907 return _core_.Window_SetSize(*args, **kwargs)
7908
7909 def SetDimensions(*args, **kwargs):
7910 """
7911 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7912
7913 Sets the position and size of the window in pixels. The sizeFlags
7914 parameter indicates the interpretation of the other params if they are
7915 equal to -1.
7916
7917 ======================== ======================================
7918 wx.SIZE_AUTO A -1 indicates that a class-specific
7919 default should be used.
7920 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7921 -1 values are supplied.
7922 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7923 interpreted as real dimensions, not
7924 default values.
7925 ======================== ======================================
7926
7927 """
7928 return _core_.Window_SetDimensions(*args, **kwargs)
7929
7930 def SetRect(*args, **kwargs):
7931 """
7932 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7933
7934 Sets the position and size of the window in pixels using a wx.Rect.
7935 """
7936 return _core_.Window_SetRect(*args, **kwargs)
7937
7938 def SetSizeWH(*args, **kwargs):
7939 """
7940 SetSizeWH(self, int width, int height)
7941
7942 Sets the size of the window in pixels.
7943 """
7944 return _core_.Window_SetSizeWH(*args, **kwargs)
7945
7946 def Move(*args, **kwargs):
7947 """
7948 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7949
7950 Moves the window to the given position.
7951 """
7952 return _core_.Window_Move(*args, **kwargs)
7953
7954 SetPosition = Move
7955 def MoveXY(*args, **kwargs):
7956 """
7957 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7958
7959 Moves the window to the given position.
7960 """
7961 return _core_.Window_MoveXY(*args, **kwargs)
7962
7963 def SetBestFittingSize(*args, **kwargs):
7964 """
7965 SetBestFittingSize(self, Size size=DefaultSize)
7966
7967 A 'Smart' SetSize that will fill in default size components with the
7968 window's *best size* values. Also set's the minsize for use with sizers.
7969 """
7970 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7971
7972 def Raise(*args, **kwargs):
7973 """
7974 Raise(self)
7975
7976 Raises the window to the top of the window hierarchy. In current
7977 version of wxWidgets this works both for manage and child windows.
7978 """
7979 return _core_.Window_Raise(*args, **kwargs)
7980
7981 def Lower(*args, **kwargs):
7982 """
7983 Lower(self)
7984
7985 Lowers the window to the bottom of the window hierarchy. In current
7986 version of wxWidgets this works both for manage and child windows.
7987 """
7988 return _core_.Window_Lower(*args, **kwargs)
7989
7990 def SetClientSize(*args, **kwargs):
7991 """
7992 SetClientSize(self, Size size)
7993
7994 This sets the size of the window client area in pixels. Using this
7995 function to size a window tends to be more device-independent than
7996 wx.Window.SetSize, since the application need not worry about what
7997 dimensions the border or title bar have when trying to fit the window
7998 around panel items, for example.
7999 """
8000 return _core_.Window_SetClientSize(*args, **kwargs)
8001
8002 def SetClientSizeWH(*args, **kwargs):
8003 """
8004 SetClientSizeWH(self, int width, int height)
8005
8006 This sets the size of the window client area in pixels. Using this
8007 function to size a window tends to be more device-independent than
8008 wx.Window.SetSize, since the application need not worry about what
8009 dimensions the border or title bar have when trying to fit the window
8010 around panel items, for example.
8011 """
8012 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8013
8014 def SetClientRect(*args, **kwargs):
8015 """
8016 SetClientRect(self, Rect rect)
8017
8018 This sets the size of the window client area in pixels. Using this
8019 function to size a window tends to be more device-independent than
8020 wx.Window.SetSize, since the application need not worry about what
8021 dimensions the border or title bar have when trying to fit the window
8022 around panel items, for example.
8023 """
8024 return _core_.Window_SetClientRect(*args, **kwargs)
8025
8026 def GetPosition(*args, **kwargs):
8027 """
8028 GetPosition(self) -> Point
8029
8030 Get the window's position. Notice that the position is in client
8031 coordinates for child windows and screen coordinates for the top level
8032 ones, use `GetScreenPosition` if you need screen coordinates for all
8033 kinds of windows.
8034 """
8035 return _core_.Window_GetPosition(*args, **kwargs)
8036
8037 def GetPositionTuple(*args, **kwargs):
8038 """
8039 GetPositionTuple() -> (x,y)
8040
8041 Get the window's position. Notice that the position is in client
8042 coordinates for child windows and screen coordinates for the top level
8043 ones, use `GetScreenPosition` if you need screen coordinates for all
8044 kinds of windows.
8045 """
8046 return _core_.Window_GetPositionTuple(*args, **kwargs)
8047
8048 def GetScreenPosition(*args, **kwargs):
8049 """
8050 GetScreenPosition(self) -> Point
8051
8052 Get the position of the window in screen coordinantes.
8053 """
8054 return _core_.Window_GetScreenPosition(*args, **kwargs)
8055
8056 def GetScreenPositionTuple(*args, **kwargs):
8057 """
8058 GetScreenPositionTuple() -> (x,y)
8059
8060 Get the position of the window in screen coordinantes.
8061 """
8062 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8063
8064 def GetScreenRect(*args, **kwargs):
8065 """
8066 GetScreenRect(self) -> Rect
8067
8068 Returns the size and position of the window in screen coordinantes as
8069 a `wx.Rect` object.
8070 """
8071 return _core_.Window_GetScreenRect(*args, **kwargs)
8072
8073 def GetSize(*args, **kwargs):
8074 """
8075 GetSize(self) -> Size
8076
8077 Get the window size.
8078 """
8079 return _core_.Window_GetSize(*args, **kwargs)
8080
8081 def GetSizeTuple(*args, **kwargs):
8082 """
8083 GetSizeTuple() -> (width, height)
8084
8085 Get the window size.
8086 """
8087 return _core_.Window_GetSizeTuple(*args, **kwargs)
8088
8089 def GetRect(*args, **kwargs):
8090 """
8091 GetRect(self) -> Rect
8092
8093 Returns the size and position of the window as a `wx.Rect` object.
8094 """
8095 return _core_.Window_GetRect(*args, **kwargs)
8096
8097 def GetClientSize(*args, **kwargs):
8098 """
8099 GetClientSize(self) -> Size
8100
8101 This gets the size of the window's 'client area' in pixels. The client
8102 area is the area which may be drawn on by the programmer, excluding
8103 title bar, border, scrollbars, etc.
8104 """
8105 return _core_.Window_GetClientSize(*args, **kwargs)
8106
8107 def GetClientSizeTuple(*args, **kwargs):
8108 """
8109 GetClientSizeTuple() -> (width, height)
8110
8111 This gets the size of the window's 'client area' in pixels. The client
8112 area is the area which may be drawn on by the programmer, excluding
8113 title bar, border, scrollbars, etc.
8114 """
8115 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8116
8117 def GetClientAreaOrigin(*args, **kwargs):
8118 """
8119 GetClientAreaOrigin(self) -> Point
8120
8121 Get the origin of the client area of the window relative to the
8122 window's top left corner (the client area may be shifted because of
8123 the borders, scrollbars, other decorations...)
8124 """
8125 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8126
8127 def GetClientRect(*args, **kwargs):
8128 """
8129 GetClientRect(self) -> Rect
8130
8131 Get the client area position and size as a `wx.Rect` object.
8132 """
8133 return _core_.Window_GetClientRect(*args, **kwargs)
8134
8135 def GetBestSize(*args, **kwargs):
8136 """
8137 GetBestSize(self) -> Size
8138
8139 This function returns the best acceptable minimal size for the
8140 window, if applicable. For example, for a static text control, it will
8141 be the minimal size such that the control label is not truncated. For
8142 windows containing subwindows (suzh aswx.Panel), the size returned by
8143 this function will be the same as the size the window would have had
8144 after calling Fit.
8145 """
8146 return _core_.Window_GetBestSize(*args, **kwargs)
8147
8148 def GetBestSizeTuple(*args, **kwargs):
8149 """
8150 GetBestSizeTuple() -> (width, height)
8151
8152 This function returns the best acceptable minimal size for the
8153 window, if applicable. For example, for a static text control, it will
8154 be the minimal size such that the control label is not truncated. For
8155 windows containing subwindows (suzh aswx.Panel), the size returned by
8156 this function will be the same as the size the window would have had
8157 after calling Fit.
8158 """
8159 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8160
8161 def InvalidateBestSize(*args, **kwargs):
8162 """
8163 InvalidateBestSize(self)
8164
8165 Reset the cached best size value so it will be recalculated the next
8166 time it is needed.
8167 """
8168 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8169
8170 def CacheBestSize(*args, **kwargs):
8171 """
8172 CacheBestSize(self, Size size)
8173
8174 Cache the best size so it doesn't need to be calculated again, (at least until
8175 some properties of the window change.)
8176 """
8177 return _core_.Window_CacheBestSize(*args, **kwargs)
8178
8179 def GetBestFittingSize(*args, **kwargs):
8180 """
8181 GetBestFittingSize(self) -> Size
8182
8183 This function will merge the window's best size into the window's
8184 minimum size, giving priority to the min size components, and returns
8185 the results.
8186
8187 """
8188 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8189
8190 def GetAdjustedBestSize(*args, **kwargs):
8191 """
8192 GetAdjustedBestSize(self) -> Size
8193
8194 This method is similar to GetBestSize, except in one
8195 thing. GetBestSize should return the minimum untruncated size of the
8196 window, while this method will return the largest of BestSize and any
8197 user specified minimum size. ie. it is the minimum size the window
8198 should currently be drawn at, not the minimal size it can possibly
8199 tolerate.
8200 """
8201 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8202
8203 def Center(*args, **kwargs):
8204 """
8205 Center(self, int direction=BOTH)
8206
8207 Centers the window. The parameter specifies the direction for
8208 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8209 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8210 on the entire screen and not on its parent window. If it is a
8211 top-level window and has no parent then it will always be centered
8212 relative to the screen.
8213 """
8214 return _core_.Window_Center(*args, **kwargs)
8215
8216 Centre = Center
8217 def CenterOnParent(*args, **kwargs):
8218 """
8219 CenterOnParent(self, int dir=BOTH)
8220
8221 Center with respect to the the parent window
8222 """
8223 return _core_.Window_CenterOnParent(*args, **kwargs)
8224
8225 CentreOnParent = CenterOnParent
8226 def Fit(*args, **kwargs):
8227 """
8228 Fit(self)
8229
8230 Sizes the window so that it fits around its subwindows. This function
8231 won't do anything if there are no subwindows and will only really work
8232 correctly if sizers are used for the subwindows layout. Also, if the
8233 window has exactly one subwindow it is better (faster and the result
8234 is more precise as Fit adds some margin to account for fuzziness of
8235 its calculations) to call window.SetClientSize(child.GetSize())
8236 instead of calling Fit.
8237 """
8238 return _core_.Window_Fit(*args, **kwargs)
8239
8240 def FitInside(*args, **kwargs):
8241 """
8242 FitInside(self)
8243
8244 Similar to Fit, but sizes the interior (virtual) size of a
8245 window. Mainly useful with scrolled windows to reset scrollbars after
8246 sizing changes that do not trigger a size event, and/or scrolled
8247 windows without an interior sizer. This function similarly won't do
8248 anything if there are no subwindows.
8249 """
8250 return _core_.Window_FitInside(*args, **kwargs)
8251
8252 def SetSizeHints(*args, **kwargs):
8253 """
8254 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8255 int incH=-1)
8256
8257 Allows specification of minimum and maximum window sizes, and window
8258 size increments. If a pair of values is not set (or set to -1), the
8259 default values will be used. If this function is called, the user
8260 will not be able to size the window outside the given bounds (if it is
8261 a top-level window.) Sizers will also inspect the minimum window size
8262 and will use that value if set when calculating layout.
8263
8264 The resizing increments are only significant under Motif or Xt.
8265 """
8266 return _core_.Window_SetSizeHints(*args, **kwargs)
8267
8268 def SetSizeHintsSz(*args, **kwargs):
8269 """
8270 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8271
8272 Allows specification of minimum and maximum window sizes, and window
8273 size increments. If a pair of values is not set (or set to -1), the
8274 default values will be used. If this function is called, the user
8275 will not be able to size the window outside the given bounds (if it is
8276 a top-level window.) Sizers will also inspect the minimum window size
8277 and will use that value if set when calculating layout.
8278
8279 The resizing increments are only significant under Motif or Xt.
8280 """
8281 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8282
8283 def SetVirtualSizeHints(*args, **kwargs):
8284 """
8285 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8286
8287 Allows specification of minimum and maximum virtual window sizes. If a
8288 pair of values is not set (or set to -1), the default values will be
8289 used. If this function is called, the user will not be able to size
8290 the virtual area of the window outside the given bounds.
8291 """
8292 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8293
8294 def SetVirtualSizeHintsSz(*args, **kwargs):
8295 """
8296 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8297
8298 Allows specification of minimum and maximum virtual window sizes. If a
8299 pair of values is not set (or set to -1), the default values will be
8300 used. If this function is called, the user will not be able to size
8301 the virtual area of the window outside the given bounds.
8302 """
8303 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8304
8305 def GetMaxSize(*args, **kwargs):
8306 """GetMaxSize(self) -> Size"""
8307 return _core_.Window_GetMaxSize(*args, **kwargs)
8308
8309 def GetMinSize(*args, **kwargs):
8310 """GetMinSize(self) -> Size"""
8311 return _core_.Window_GetMinSize(*args, **kwargs)
8312
8313 def SetMinSize(*args, **kwargs):
8314 """
8315 SetMinSize(self, Size minSize)
8316
8317 A more convenient method than `SetSizeHints` for setting just the
8318 min size.
8319 """
8320 return _core_.Window_SetMinSize(*args, **kwargs)
8321
8322 def SetMaxSize(*args, **kwargs):
8323 """
8324 SetMaxSize(self, Size maxSize)
8325
8326 A more convenient method than `SetSizeHints` for setting just the
8327 max size.
8328 """
8329 return _core_.Window_SetMaxSize(*args, **kwargs)
8330
8331 def GetMinWidth(*args, **kwargs):
8332 """GetMinWidth(self) -> int"""
8333 return _core_.Window_GetMinWidth(*args, **kwargs)
8334
8335 def GetMinHeight(*args, **kwargs):
8336 """GetMinHeight(self) -> int"""
8337 return _core_.Window_GetMinHeight(*args, **kwargs)
8338
8339 def GetMaxWidth(*args, **kwargs):
8340 """GetMaxWidth(self) -> int"""
8341 return _core_.Window_GetMaxWidth(*args, **kwargs)
8342
8343 def GetMaxHeight(*args, **kwargs):
8344 """GetMaxHeight(self) -> int"""
8345 return _core_.Window_GetMaxHeight(*args, **kwargs)
8346
8347 def SetVirtualSize(*args, **kwargs):
8348 """
8349 SetVirtualSize(self, Size size)
8350
8351 Set the the virtual size of a window in pixels. For most windows this
8352 is just the client area of the window, but for some like scrolled
8353 windows it is more or less independent of the screen window size.
8354 """
8355 return _core_.Window_SetVirtualSize(*args, **kwargs)
8356
8357 def SetVirtualSizeWH(*args, **kwargs):
8358 """
8359 SetVirtualSizeWH(self, int w, int h)
8360
8361 Set the the virtual size of a window in pixels. For most windows this
8362 is just the client area of the window, but for some like scrolled
8363 windows it is more or less independent of the screen window size.
8364 """
8365 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8366
8367 def GetVirtualSize(*args, **kwargs):
8368 """
8369 GetVirtualSize(self) -> Size
8370
8371 Get the the virtual size of the window in pixels. For most windows
8372 this is just the client area of the window, but for some like scrolled
8373 windows it is more or less independent of the screen window size.
8374 """
8375 return _core_.Window_GetVirtualSize(*args, **kwargs)
8376
8377 def GetVirtualSizeTuple(*args, **kwargs):
8378 """
8379 GetVirtualSizeTuple() -> (width, height)
8380
8381 Get the the virtual size of the window in pixels. For most windows
8382 this is just the client area of the window, but for some like scrolled
8383 windows it is more or less independent of the screen window size.
8384 """
8385 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8386
8387 def GetBestVirtualSize(*args, **kwargs):
8388 """
8389 GetBestVirtualSize(self) -> Size
8390
8391 Return the largest of ClientSize and BestSize (as determined by a
8392 sizer, interior children, or other means)
8393 """
8394 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8395
8396 def Show(*args, **kwargs):
8397 """
8398 Show(self, bool show=True) -> bool
8399
8400 Shows or hides the window. You may need to call Raise for a top level
8401 window if you want to bring it to top, although this is not needed if
8402 Show is called immediately after the frame creation. Returns True if
8403 the window has been shown or hidden or False if nothing was done
8404 because it already was in the requested state.
8405 """
8406 return _core_.Window_Show(*args, **kwargs)
8407
8408 def Hide(*args, **kwargs):
8409 """
8410 Hide(self) -> bool
8411
8412 Equivalent to calling Show(False).
8413 """
8414 return _core_.Window_Hide(*args, **kwargs)
8415
8416 def Enable(*args, **kwargs):
8417 """
8418 Enable(self, bool enable=True) -> bool
8419
8420 Enable or disable the window for user input. Note that when a parent
8421 window is disabled, all of its children are disabled as well and they
8422 are reenabled again when the parent is. Returns true if the window
8423 has been enabled or disabled, false if nothing was done, i.e. if the
8424 window had already been in the specified state.
8425 """
8426 return _core_.Window_Enable(*args, **kwargs)
8427
8428 def Disable(*args, **kwargs):
8429 """
8430 Disable(self) -> bool
8431
8432 Disables the window, same as Enable(false).
8433 """
8434 return _core_.Window_Disable(*args, **kwargs)
8435
8436 def IsShown(*args, **kwargs):
8437 """
8438 IsShown(self) -> bool
8439
8440 Returns true if the window is shown, false if it has been hidden.
8441 """
8442 return _core_.Window_IsShown(*args, **kwargs)
8443
8444 def IsEnabled(*args, **kwargs):
8445 """
8446 IsEnabled(self) -> bool
8447
8448 Returns true if the window is enabled for input, false otherwise.
8449 """
8450 return _core_.Window_IsEnabled(*args, **kwargs)
8451
8452 def SetWindowStyleFlag(*args, **kwargs):
8453 """
8454 SetWindowStyleFlag(self, long style)
8455
8456 Sets the style of the window. Please note that some styles cannot be
8457 changed after the window creation and that Refresh() might need to be
8458 called after changing the others for the change to take place
8459 immediately.
8460 """
8461 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8462
8463 def GetWindowStyleFlag(*args, **kwargs):
8464 """
8465 GetWindowStyleFlag(self) -> long
8466
8467 Gets the window style that was passed to the constructor or Create
8468 method.
8469 """
8470 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8471
8472 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8473 def HasFlag(*args, **kwargs):
8474 """
8475 HasFlag(self, int flag) -> bool
8476
8477 Test if the given style is set for this window.
8478 """
8479 return _core_.Window_HasFlag(*args, **kwargs)
8480
8481 def IsRetained(*args, **kwargs):
8482 """
8483 IsRetained(self) -> bool
8484
8485 Returns true if the window is retained, false otherwise. Retained
8486 windows are only available on X platforms.
8487 """
8488 return _core_.Window_IsRetained(*args, **kwargs)
8489
8490 def SetExtraStyle(*args, **kwargs):
8491 """
8492 SetExtraStyle(self, long exStyle)
8493
8494 Sets the extra style bits for the window. Extra styles are the less
8495 often used style bits which can't be set with the constructor or with
8496 SetWindowStyleFlag()
8497 """
8498 return _core_.Window_SetExtraStyle(*args, **kwargs)
8499
8500 def GetExtraStyle(*args, **kwargs):
8501 """
8502 GetExtraStyle(self) -> long
8503
8504 Returns the extra style bits for the window.
8505 """
8506 return _core_.Window_GetExtraStyle(*args, **kwargs)
8507
8508 def MakeModal(*args, **kwargs):
8509 """
8510 MakeModal(self, bool modal=True)
8511
8512 Disables all other windows in the application so that the user can
8513 only interact with this window. Passing False will reverse this
8514 effect.
8515 """
8516 return _core_.Window_MakeModal(*args, **kwargs)
8517
8518 def SetThemeEnabled(*args, **kwargs):
8519 """
8520 SetThemeEnabled(self, bool enableTheme)
8521
8522 This function tells a window if it should use the system's "theme"
8523 code to draw the windows' background instead if its own background
8524 drawing code. This will only have an effect on platforms that support
8525 the notion of themes in user defined windows. One such platform is
8526 GTK+ where windows can have (very colourful) backgrounds defined by a
8527 user's selected theme.
8528
8529 Dialogs, notebook pages and the status bar have this flag set to true
8530 by default so that the default look and feel is simulated best.
8531 """
8532 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8533
8534 def GetThemeEnabled(*args, **kwargs):
8535 """
8536 GetThemeEnabled(self) -> bool
8537
8538 Return the themeEnabled flag.
8539 """
8540 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8541
8542 def SetFocus(*args, **kwargs):
8543 """
8544 SetFocus(self)
8545
8546 Set's the focus to this window, allowing it to receive keyboard input.
8547 """
8548 return _core_.Window_SetFocus(*args, **kwargs)
8549
8550 def SetFocusFromKbd(*args, **kwargs):
8551 """
8552 SetFocusFromKbd(self)
8553
8554 Set focus to this window as the result of a keyboard action. Normally
8555 only called internally.
8556 """
8557 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8558
8559 def FindFocus(*args, **kwargs):
8560 """
8561 FindFocus() -> Window
8562
8563 Returns the window or control that currently has the keyboard focus,
8564 or None.
8565 """
8566 return _core_.Window_FindFocus(*args, **kwargs)
8567
8568 FindFocus = staticmethod(FindFocus)
8569 def AcceptsFocus(*args, **kwargs):
8570 """
8571 AcceptsFocus(self) -> bool
8572
8573 Can this window have focus?
8574 """
8575 return _core_.Window_AcceptsFocus(*args, **kwargs)
8576
8577 def AcceptsFocusFromKeyboard(*args, **kwargs):
8578 """
8579 AcceptsFocusFromKeyboard(self) -> bool
8580
8581 Can this window be given focus by keyboard navigation? if not, the
8582 only way to give it focus (provided it accepts it at all) is to click
8583 it.
8584 """
8585 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8586
8587 def Navigate(*args, **kwargs):
8588 """
8589 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8590
8591 Does keyboard navigation from this window to another, by sending a
8592 `wx.NavigationKeyEvent`.
8593 """
8594 return _core_.Window_Navigate(*args, **kwargs)
8595
8596 def MoveAfterInTabOrder(*args, **kwargs):
8597 """
8598 MoveAfterInTabOrder(self, Window win)
8599
8600 Moves this window in the tab navigation order after the specified
8601 sibling window. This means that when the user presses the TAB key on
8602 that other window, the focus switches to this window.
8603
8604 The default tab order is the same as creation order. This function
8605 and `MoveBeforeInTabOrder` allow to change it after creating all the
8606 windows.
8607
8608 """
8609 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8610
8611 def MoveBeforeInTabOrder(*args, **kwargs):
8612 """
8613 MoveBeforeInTabOrder(self, Window win)
8614
8615 Same as `MoveAfterInTabOrder` except that it inserts this window just
8616 before win instead of putting it right after it.
8617 """
8618 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8619
8620 def GetChildren(*args, **kwargs):
8621 """
8622 GetChildren(self) -> PyObject
8623
8624 Returns a list of the window's children. NOTE: Currently this is a
8625 copy of the child window list maintained by the window, so the return
8626 value of this function is only valid as long as the window's children
8627 do not change.
8628 """
8629 return _core_.Window_GetChildren(*args, **kwargs)
8630
8631 def GetParent(*args, **kwargs):
8632 """
8633 GetParent(self) -> Window
8634
8635 Returns the parent window of this window, or None if there isn't one.
8636 """
8637 return _core_.Window_GetParent(*args, **kwargs)
8638
8639 def GetGrandParent(*args, **kwargs):
8640 """
8641 GetGrandParent(self) -> Window
8642
8643 Returns the parent of the parent of this window, or None if there
8644 isn't one.
8645 """
8646 return _core_.Window_GetGrandParent(*args, **kwargs)
8647
8648 def IsTopLevel(*args, **kwargs):
8649 """
8650 IsTopLevel(self) -> bool
8651
8652 Returns true if the given window is a top-level one. Currently all
8653 frames and dialogs are always considered to be top-level windows (even
8654 if they have a parent window).
8655 """
8656 return _core_.Window_IsTopLevel(*args, **kwargs)
8657
8658 def Reparent(*args, **kwargs):
8659 """
8660 Reparent(self, Window newParent) -> bool
8661
8662 Reparents the window, i.e the window will be removed from its current
8663 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8664 re-inserted into another. Available on Windows and GTK. Returns True
8665 if the parent was changed, False otherwise (error or newParent ==
8666 oldParent)
8667 """
8668 return _core_.Window_Reparent(*args, **kwargs)
8669
8670 def AddChild(*args, **kwargs):
8671 """
8672 AddChild(self, Window child)
8673
8674 Adds a child window. This is called automatically by window creation
8675 functions so should not be required by the application programmer.
8676 """
8677 return _core_.Window_AddChild(*args, **kwargs)
8678
8679 def RemoveChild(*args, **kwargs):
8680 """
8681 RemoveChild(self, Window child)
8682
8683 Removes a child window. This is called automatically by window
8684 deletion functions so should not be required by the application
8685 programmer.
8686 """
8687 return _core_.Window_RemoveChild(*args, **kwargs)
8688
8689 def SetDoubleBuffered(*args, **kwargs):
8690 """
8691 SetDoubleBuffered(self, bool on)
8692
8693 Currently wxGTK2 only.
8694 """
8695 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8696
8697 def FindWindowById(*args, **kwargs):
8698 """
8699 FindWindowById(self, long winid) -> Window
8700
8701 Find a chld of this window by window ID
8702 """
8703 return _core_.Window_FindWindowById(*args, **kwargs)
8704
8705 def FindWindowByName(*args, **kwargs):
8706 """
8707 FindWindowByName(self, String name) -> Window
8708
8709 Find a child of this window by name
8710 """
8711 return _core_.Window_FindWindowByName(*args, **kwargs)
8712
8713 def GetEventHandler(*args, **kwargs):
8714 """
8715 GetEventHandler(self) -> EvtHandler
8716
8717 Returns the event handler for this window. By default, the window is
8718 its own event handler.
8719 """
8720 return _core_.Window_GetEventHandler(*args, **kwargs)
8721
8722 def SetEventHandler(*args, **kwargs):
8723 """
8724 SetEventHandler(self, EvtHandler handler)
8725
8726 Sets the event handler for this window. An event handler is an object
8727 that is capable of processing the events sent to a window. By default,
8728 the window is its own event handler, but an application may wish to
8729 substitute another, for example to allow central implementation of
8730 event-handling for a variety of different window classes.
8731
8732 It is usually better to use `wx.Window.PushEventHandler` since this sets
8733 up a chain of event handlers, where an event not handled by one event
8734 handler is handed to the next one in the chain.
8735 """
8736 return _core_.Window_SetEventHandler(*args, **kwargs)
8737
8738 def PushEventHandler(*args, **kwargs):
8739 """
8740 PushEventHandler(self, EvtHandler handler)
8741
8742 Pushes this event handler onto the event handler stack for the window.
8743 An event handler is an object that is capable of processing the events
8744 sent to a window. By default, the window is its own event handler, but
8745 an application may wish to substitute another, for example to allow
8746 central implementation of event-handling for a variety of different
8747 window classes.
8748
8749 wx.Window.PushEventHandler allows an application to set up a chain of
8750 event handlers, where an event not handled by one event handler is
8751 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8752 remove the event handler.
8753 """
8754 return _core_.Window_PushEventHandler(*args, **kwargs)
8755
8756 def PopEventHandler(*args, **kwargs):
8757 """
8758 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8759
8760 Removes and returns the top-most event handler on the event handler
8761 stack. If deleteHandler is True then the wx.EvtHandler object will be
8762 destroyed after it is popped.
8763 """
8764 return _core_.Window_PopEventHandler(*args, **kwargs)
8765
8766 def RemoveEventHandler(*args, **kwargs):
8767 """
8768 RemoveEventHandler(self, EvtHandler handler) -> bool
8769
8770 Find the given handler in the event handler chain and remove (but not
8771 delete) it from the event handler chain, return True if it was found
8772 and False otherwise (this also results in an assert failure so this
8773 function should only be called when the handler is supposed to be
8774 there.)
8775 """
8776 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8777
8778 def SetValidator(*args, **kwargs):
8779 """
8780 SetValidator(self, Validator validator)
8781
8782 Deletes the current validator (if any) and sets the window validator,
8783 having called wx.Validator.Clone to create a new validator of this
8784 type.
8785 """
8786 return _core_.Window_SetValidator(*args, **kwargs)
8787
8788 def GetValidator(*args, **kwargs):
8789 """
8790 GetValidator(self) -> Validator
8791
8792 Returns a pointer to the current validator for the window, or None if
8793 there is none.
8794 """
8795 return _core_.Window_GetValidator(*args, **kwargs)
8796
8797 def Validate(*args, **kwargs):
8798 """
8799 Validate(self) -> bool
8800
8801 Validates the current values of the child controls using their
8802 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8803 style flag set, the method will also call Validate() of all child
8804 windows. Returns false if any of the validations failed.
8805 """
8806 return _core_.Window_Validate(*args, **kwargs)
8807
8808 def TransferDataToWindow(*args, **kwargs):
8809 """
8810 TransferDataToWindow(self) -> bool
8811
8812 Transfers values to child controls from data areas specified by their
8813 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8814 style flag set, the method will also call TransferDataToWindow() of
8815 all child windows.
8816 """
8817 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8818
8819 def TransferDataFromWindow(*args, **kwargs):
8820 """
8821 TransferDataFromWindow(self) -> bool
8822
8823 Transfers values from child controls to data areas specified by their
8824 validators. Returns false if a transfer failed. If the window has
8825 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8826 also call TransferDataFromWindow() of all child windows.
8827 """
8828 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8829
8830 def InitDialog(*args, **kwargs):
8831 """
8832 InitDialog(self)
8833
8834 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8835 to the dialog via validators.
8836 """
8837 return _core_.Window_InitDialog(*args, **kwargs)
8838
8839 def SetAcceleratorTable(*args, **kwargs):
8840 """
8841 SetAcceleratorTable(self, AcceleratorTable accel)
8842
8843 Sets the accelerator table for this window.
8844 """
8845 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8846
8847 def GetAcceleratorTable(*args, **kwargs):
8848 """
8849 GetAcceleratorTable(self) -> AcceleratorTable
8850
8851 Gets the accelerator table for this window.
8852 """
8853 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8854
8855 def RegisterHotKey(*args, **kwargs):
8856 """
8857 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8858
8859 Registers a system wide hotkey. Every time the user presses the hotkey
8860 registered here, this window will receive a hotkey event. It will
8861 receive the event even if the application is in the background and
8862 does not have the input focus because the user is working with some
8863 other application. To bind an event handler function to this hotkey
8864 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8865 hotkey was registered successfully.
8866 """
8867 return _core_.Window_RegisterHotKey(*args, **kwargs)
8868
8869 def UnregisterHotKey(*args, **kwargs):
8870 """
8871 UnregisterHotKey(self, int hotkeyId) -> bool
8872
8873 Unregisters a system wide hotkey.
8874 """
8875 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8876
8877 def ConvertDialogPointToPixels(*args, **kwargs):
8878 """
8879 ConvertDialogPointToPixels(self, Point pt) -> Point
8880
8881 Converts a point or size from dialog units to pixels. Dialog units
8882 are used for maintaining a dialog's proportions even if the font
8883 changes. For the x dimension, the dialog units are multiplied by the
8884 average character width and then divided by 4. For the y dimension,
8885 the dialog units are multiplied by the average character height and
8886 then divided by 8.
8887 """
8888 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8889
8890 def ConvertDialogSizeToPixels(*args, **kwargs):
8891 """
8892 ConvertDialogSizeToPixels(self, Size sz) -> Size
8893
8894 Converts a point or size from dialog units to pixels. Dialog units
8895 are used for maintaining a dialog's proportions even if the font
8896 changes. For the x dimension, the dialog units are multiplied by the
8897 average character width and then divided by 4. For the y dimension,
8898 the dialog units are multiplied by the average character height and
8899 then divided by 8.
8900 """
8901 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8902
8903 def DLG_PNT(*args, **kwargs):
8904 """
8905 DLG_PNT(self, Point pt) -> Point
8906
8907 Converts a point or size from dialog units to pixels. Dialog units
8908 are used for maintaining a dialog's proportions even if the font
8909 changes. For the x dimension, the dialog units are multiplied by the
8910 average character width and then divided by 4. For the y dimension,
8911 the dialog units are multiplied by the average character height and
8912 then divided by 8.
8913 """
8914 return _core_.Window_DLG_PNT(*args, **kwargs)
8915
8916 def DLG_SZE(*args, **kwargs):
8917 """
8918 DLG_SZE(self, Size sz) -> Size
8919
8920 Converts a point or size from dialog units to pixels. Dialog units
8921 are used for maintaining a dialog's proportions even if the font
8922 changes. For the x dimension, the dialog units are multiplied by the
8923 average character width and then divided by 4. For the y dimension,
8924 the dialog units are multiplied by the average character height and
8925 then divided by 8.
8926 """
8927 return _core_.Window_DLG_SZE(*args, **kwargs)
8928
8929 def ConvertPixelPointToDialog(*args, **kwargs):
8930 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8931 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8932
8933 def ConvertPixelSizeToDialog(*args, **kwargs):
8934 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8935 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8936
8937 def WarpPointer(*args, **kwargs):
8938 """
8939 WarpPointer(self, int x, int y)
8940
8941 Moves the pointer to the given position on the window.
8942
8943 NOTE: This function is not supported under Mac because Apple Human
8944 Interface Guidelines forbid moving the mouse cursor programmatically.
8945 """
8946 return _core_.Window_WarpPointer(*args, **kwargs)
8947
8948 def CaptureMouse(*args, **kwargs):
8949 """
8950 CaptureMouse(self)
8951
8952 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8953 release the capture.
8954
8955 Note that wxWindows maintains the stack of windows having captured the
8956 mouse and when the mouse is released the capture returns to the window
8957 which had had captured it previously and it is only really released if
8958 there were no previous window. In particular, this means that you must
8959 release the mouse as many times as you capture it, unless the window
8960 receives the `wx.MouseCaptureLostEvent` event.
8961
8962 Any application which captures the mouse in the beginning of some
8963 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8964 operation when it receives the event. The event handler must not
8965 recapture mouse.
8966 """
8967 return _core_.Window_CaptureMouse(*args, **kwargs)
8968
8969 def ReleaseMouse(*args, **kwargs):
8970 """
8971 ReleaseMouse(self)
8972
8973 Releases mouse input captured with wx.Window.CaptureMouse.
8974 """
8975 return _core_.Window_ReleaseMouse(*args, **kwargs)
8976
8977 def GetCapture(*args, **kwargs):
8978 """
8979 GetCapture() -> Window
8980
8981 Returns the window which currently captures the mouse or None
8982 """
8983 return _core_.Window_GetCapture(*args, **kwargs)
8984
8985 GetCapture = staticmethod(GetCapture)
8986 def HasCapture(*args, **kwargs):
8987 """
8988 HasCapture(self) -> bool
8989
8990 Returns true if this window has the current mouse capture.
8991 """
8992 return _core_.Window_HasCapture(*args, **kwargs)
8993
8994 def Refresh(*args, **kwargs):
8995 """
8996 Refresh(self, bool eraseBackground=True, Rect rect=None)
8997
8998 Mark the specified rectangle (or the whole window) as "dirty" so it
8999 will be repainted. Causes an EVT_PAINT event to be generated and sent
9000 to the window.
9001 """
9002 return _core_.Window_Refresh(*args, **kwargs)
9003
9004 def RefreshRect(*args, **kwargs):
9005 """
9006 RefreshRect(self, Rect rect, bool eraseBackground=True)
9007
9008 Redraws the contents of the given rectangle: the area inside it will
9009 be repainted. This is the same as Refresh but has a nicer syntax.
9010 """
9011 return _core_.Window_RefreshRect(*args, **kwargs)
9012
9013 def Update(*args, **kwargs):
9014 """
9015 Update(self)
9016
9017 Calling this method immediately repaints the invalidated area of the
9018 window instead of waiting for the EVT_PAINT event to happen, (normally
9019 this would usually only happen when the flow of control returns to the
9020 event loop.) Notice that this function doesn't refresh the window and
9021 does nothing if the window has been already repainted. Use Refresh
9022 first if you want to immediately redraw the window (or some portion of
9023 it) unconditionally.
9024 """
9025 return _core_.Window_Update(*args, **kwargs)
9026
9027 def ClearBackground(*args, **kwargs):
9028 """
9029 ClearBackground(self)
9030
9031 Clears the window by filling it with the current background
9032 colour. Does not cause an erase background event to be generated.
9033 """
9034 return _core_.Window_ClearBackground(*args, **kwargs)
9035
9036 def Freeze(*args, **kwargs):
9037 """
9038 Freeze(self)
9039
9040 Freezes the window or, in other words, prevents any updates from
9041 taking place on screen, the window is not redrawn at all. Thaw must be
9042 called to reenable window redrawing. Calls to Freeze/Thaw may be
9043 nested, with the actual Thaw being delayed until all the nesting has
9044 been undone.
9045
9046 This method is useful for visual appearance optimization (for example,
9047 it is a good idea to use it before inserting large amount of text into
9048 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9049 for all controls so it is mostly just a hint to wxWindows and not a
9050 mandatory directive.
9051 """
9052 return _core_.Window_Freeze(*args, **kwargs)
9053
9054 def Thaw(*args, **kwargs):
9055 """
9056 Thaw(self)
9057
9058 Reenables window updating after a previous call to Freeze. Calls to
9059 Freeze/Thaw may be nested, so Thaw must be called the same number of
9060 times that Freeze was before the window will be updated.
9061 """
9062 return _core_.Window_Thaw(*args, **kwargs)
9063
9064 def PrepareDC(*args, **kwargs):
9065 """
9066 PrepareDC(self, DC dc)
9067
9068 Call this function to prepare the device context for drawing a
9069 scrolled image. It sets the device origin according to the current
9070 scroll position.
9071 """
9072 return _core_.Window_PrepareDC(*args, **kwargs)
9073
9074 def GetUpdateRegion(*args, **kwargs):
9075 """
9076 GetUpdateRegion(self) -> Region
9077
9078 Returns the region specifying which parts of the window have been
9079 damaged. Should only be called within an EVT_PAINT handler.
9080 """
9081 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9082
9083 def GetUpdateClientRect(*args, **kwargs):
9084 """
9085 GetUpdateClientRect(self) -> Rect
9086
9087 Get the update rectangle region bounding box in client coords.
9088 """
9089 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9090
9091 def IsExposed(*args, **kwargs):
9092 """
9093 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9094
9095 Returns true if the given point or rectangle area has been exposed
9096 since the last repaint. Call this in an paint event handler to
9097 optimize redrawing by only redrawing those areas, which have been
9098 exposed.
9099 """
9100 return _core_.Window_IsExposed(*args, **kwargs)
9101
9102 def IsExposedPoint(*args, **kwargs):
9103 """
9104 IsExposedPoint(self, Point pt) -> bool
9105
9106 Returns true if the given point or rectangle area has been exposed
9107 since the last repaint. Call this in an paint event handler to
9108 optimize redrawing by only redrawing those areas, which have been
9109 exposed.
9110 """
9111 return _core_.Window_IsExposedPoint(*args, **kwargs)
9112
9113 def IsExposedRect(*args, **kwargs):
9114 """
9115 IsExposedRect(self, Rect rect) -> bool
9116
9117 Returns true if the given point or rectangle area has been exposed
9118 since the last repaint. Call this in an paint event handler to
9119 optimize redrawing by only redrawing those areas, which have been
9120 exposed.
9121 """
9122 return _core_.Window_IsExposedRect(*args, **kwargs)
9123
9124 def GetDefaultAttributes(*args, **kwargs):
9125 """
9126 GetDefaultAttributes(self) -> VisualAttributes
9127
9128 Get the default attributes for an instance of this class. This is
9129 useful if you want to use the same font or colour in your own control
9130 as in a standard control -- which is a much better idea than hard
9131 coding specific colours or fonts which might look completely out of
9132 place on the user's system, especially if it uses themes.
9133 """
9134 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9135
9136 def GetClassDefaultAttributes(*args, **kwargs):
9137 """
9138 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9139
9140 Get the default attributes for this class. This is useful if you want
9141 to use the same font or colour in your own control as in a standard
9142 control -- which is a much better idea than hard coding specific
9143 colours or fonts which might look completely out of place on the
9144 user's system, especially if it uses themes.
9145
9146 The variant parameter is only relevant under Mac currently and is
9147 ignore under other platforms. Under Mac, it will change the size of
9148 the returned font. See `wx.Window.SetWindowVariant` for more about
9149 this.
9150 """
9151 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9152
9153 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9154 def SetBackgroundColour(*args, **kwargs):
9155 """
9156 SetBackgroundColour(self, Colour colour) -> bool
9157
9158 Sets the background colour of the window. Returns True if the colour
9159 was changed. The background colour is usually painted by the default
9160 EVT_ERASE_BACKGROUND event handler function under Windows and
9161 automatically under GTK. Using `wx.NullColour` will reset the window
9162 to the default background colour.
9163
9164 Note that setting the background colour may not cause an immediate
9165 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9166 calling this function.
9167
9168 Using this function will disable attempts to use themes for this
9169 window, if the system supports them. Use with care since usually the
9170 themes represent the appearance chosen by the user to be used for all
9171 applications on the system.
9172 """
9173 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9174
9175 def SetOwnBackgroundColour(*args, **kwargs):
9176 """SetOwnBackgroundColour(self, Colour colour)"""
9177 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9178
9179 def SetForegroundColour(*args, **kwargs):
9180 """
9181 SetForegroundColour(self, Colour colour) -> bool
9182
9183 Sets the foreground colour of the window. Returns True is the colour
9184 was changed. The interpretation of foreground colour is dependent on
9185 the window class; it may be the text colour or other colour, or it may
9186 not be used at all.
9187 """
9188 return _core_.Window_SetForegroundColour(*args, **kwargs)
9189
9190 def SetOwnForegroundColour(*args, **kwargs):
9191 """SetOwnForegroundColour(self, Colour colour)"""
9192 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9193
9194 def GetBackgroundColour(*args, **kwargs):
9195 """
9196 GetBackgroundColour(self) -> Colour
9197
9198 Returns the background colour of the window.
9199 """
9200 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9201
9202 def GetForegroundColour(*args, **kwargs):
9203 """
9204 GetForegroundColour(self) -> Colour
9205
9206 Returns the foreground colour of the window. The interpretation of
9207 foreground colour is dependent on the window class; it may be the text
9208 colour or other colour, or it may not be used at all.
9209 """
9210 return _core_.Window_GetForegroundColour(*args, **kwargs)
9211
9212 def InheritsBackgroundColour(*args, **kwargs):
9213 """InheritsBackgroundColour(self) -> bool"""
9214 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9215
9216 def UseBgCol(*args, **kwargs):
9217 """UseBgCol(self) -> bool"""
9218 return _core_.Window_UseBgCol(*args, **kwargs)
9219
9220 def SetBackgroundStyle(*args, **kwargs):
9221 """
9222 SetBackgroundStyle(self, int style) -> bool
9223
9224 Returns the background style of the window. The background style
9225 indicates how the background of the window is drawn.
9226
9227 ====================== ========================================
9228 wx.BG_STYLE_SYSTEM The background colour or pattern should
9229 be determined by the system
9230 wx.BG_STYLE_COLOUR The background should be a solid colour
9231 wx.BG_STYLE_CUSTOM The background will be implemented by the
9232 application.
9233 ====================== ========================================
9234
9235 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9236 a custom background, such as a tiled bitmap. Currently the style has
9237 no effect on other platforms.
9238
9239 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9240 """
9241 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9242
9243 def GetBackgroundStyle(*args, **kwargs):
9244 """
9245 GetBackgroundStyle(self) -> int
9246
9247 Returns the background style of the window.
9248
9249 :see: `SetBackgroundStyle`
9250 """
9251 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9252
9253 def HasTransparentBackground(*args, **kwargs):
9254 """
9255 HasTransparentBackground(self) -> bool
9256
9257 Returns True if this window's background is transparent (as, for
9258 example, for `wx.StaticText`) and should show the parent window's
9259 background.
9260
9261 This method is mostly used internally by the library itself and you
9262 normally shouldn't have to call it. You may, however, have to override
9263 it in your custom control classes to ensure that background is painted
9264 correctly.
9265 """
9266 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9267
9268 def SetCursor(*args, **kwargs):
9269 """
9270 SetCursor(self, Cursor cursor) -> bool
9271
9272 Sets the window's cursor. Notice that the window cursor also sets it
9273 for the children of the window implicitly.
9274
9275 The cursor may be wx.NullCursor in which case the window cursor will
9276 be reset back to default.
9277 """
9278 return _core_.Window_SetCursor(*args, **kwargs)
9279
9280 def GetCursor(*args, **kwargs):
9281 """
9282 GetCursor(self) -> Cursor
9283
9284 Return the cursor associated with this window.
9285 """
9286 return _core_.Window_GetCursor(*args, **kwargs)
9287
9288 def SetFont(*args, **kwargs):
9289 """
9290 SetFont(self, Font font) -> bool
9291
9292 Sets the font for this window.
9293 """
9294 return _core_.Window_SetFont(*args, **kwargs)
9295
9296 def SetOwnFont(*args, **kwargs):
9297 """SetOwnFont(self, Font font)"""
9298 return _core_.Window_SetOwnFont(*args, **kwargs)
9299
9300 def GetFont(*args, **kwargs):
9301 """
9302 GetFont(self) -> Font
9303
9304 Returns the default font used for this window.
9305 """
9306 return _core_.Window_GetFont(*args, **kwargs)
9307
9308 def SetCaret(*args, **kwargs):
9309 """
9310 SetCaret(self, Caret caret)
9311
9312 Sets the caret associated with the window.
9313 """
9314 return _core_.Window_SetCaret(*args, **kwargs)
9315
9316 def GetCaret(*args, **kwargs):
9317 """
9318 GetCaret(self) -> Caret
9319
9320 Returns the caret associated with the window.
9321 """
9322 return _core_.Window_GetCaret(*args, **kwargs)
9323
9324 def GetCharHeight(*args, **kwargs):
9325 """
9326 GetCharHeight(self) -> int
9327
9328 Get the (average) character size for the current font.
9329 """
9330 return _core_.Window_GetCharHeight(*args, **kwargs)
9331
9332 def GetCharWidth(*args, **kwargs):
9333 """
9334 GetCharWidth(self) -> int
9335
9336 Get the (average) character size for the current font.
9337 """
9338 return _core_.Window_GetCharWidth(*args, **kwargs)
9339
9340 def GetTextExtent(*args, **kwargs):
9341 """
9342 GetTextExtent(String string) -> (width, height)
9343
9344 Get the width and height of the text using the current font.
9345 """
9346 return _core_.Window_GetTextExtent(*args, **kwargs)
9347
9348 def GetFullTextExtent(*args, **kwargs):
9349 """
9350 GetFullTextExtent(String string, Font font=None) ->
9351 (width, height, descent, externalLeading)
9352
9353 Get the width, height, decent and leading of the text using the
9354 current or specified font.
9355 """
9356 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9357
9358 def ClientToScreenXY(*args, **kwargs):
9359 """
9360 ClientToScreenXY(int x, int y) -> (x,y)
9361
9362 Converts to screen coordinates from coordinates relative to this window.
9363 """
9364 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9365
9366 def ScreenToClientXY(*args, **kwargs):
9367 """
9368 ScreenToClientXY(int x, int y) -> (x,y)
9369
9370 Converts from screen to client window coordinates.
9371 """
9372 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9373
9374 def ClientToScreen(*args, **kwargs):
9375 """
9376 ClientToScreen(self, Point pt) -> Point
9377
9378 Converts to screen coordinates from coordinates relative to this window.
9379 """
9380 return _core_.Window_ClientToScreen(*args, **kwargs)
9381
9382 def ScreenToClient(*args, **kwargs):
9383 """
9384 ScreenToClient(self, Point pt) -> Point
9385
9386 Converts from screen to client window coordinates.
9387 """
9388 return _core_.Window_ScreenToClient(*args, **kwargs)
9389
9390 def HitTestXY(*args, **kwargs):
9391 """
9392 HitTestXY(self, int x, int y) -> int
9393
9394 Test where the given (in client coords) point lies
9395 """
9396 return _core_.Window_HitTestXY(*args, **kwargs)
9397
9398 def HitTest(*args, **kwargs):
9399 """
9400 HitTest(self, Point pt) -> int
9401
9402 Test where the given (in client coords) point lies
9403 """
9404 return _core_.Window_HitTest(*args, **kwargs)
9405
9406 def GetBorder(*args):
9407 """
9408 GetBorder(self, long flags) -> int
9409 GetBorder(self) -> int
9410
9411 Get border for the flags of this window
9412 """
9413 return _core_.Window_GetBorder(*args)
9414
9415 def UpdateWindowUI(*args, **kwargs):
9416 """
9417 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9418
9419 This function sends EVT_UPDATE_UI events to the window. The particular
9420 implementation depends on the window; for example a wx.ToolBar will
9421 send an update UI event for each toolbar button, and a wx.Frame will
9422 send an update UI event for each menubar menu item. You can call this
9423 function from your application to ensure that your UI is up-to-date at
9424 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9425 concerned). This may be necessary if you have called
9426 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9427 limit the overhead that wxWindows incurs by sending update UI events
9428 in idle time.
9429 """
9430 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9431
9432 def PopupMenuXY(*args, **kwargs):
9433 """
9434 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9435
9436 Pops up the given menu at the specified coordinates, relative to this window,
9437 and returns control when the user has dismissed the menu. If a menu item is
9438 selected, the corresponding menu event is generated and will be processed as
9439 usual. If the default position is given then the current position of the
9440 mouse cursor will be used.
9441 """
9442 return _core_.Window_PopupMenuXY(*args, **kwargs)
9443
9444 def PopupMenu(*args, **kwargs):
9445 """
9446 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9447
9448 Pops up the given menu at the specified coordinates, relative to this window,
9449 and returns control when the user has dismissed the menu. If a menu item is
9450 selected, the corresponding menu event is generated and will be processed as
9451 usual. If the default position is given then the current position of the
9452 mouse cursor will be used.
9453 """
9454 return _core_.Window_PopupMenu(*args, **kwargs)
9455
9456 def HasMultiplePages(*args, **kwargs):
9457 """HasMultiplePages(self) -> bool"""
9458 return _core_.Window_HasMultiplePages(*args, **kwargs)
9459
9460 def GetHandle(*args, **kwargs):
9461 """
9462 GetHandle(self) -> long
9463
9464 Returns the platform-specific handle (as a long integer) of the
9465 physical window. Currently on wxMac it returns the handle of the
9466 toplevel parent of the window.
9467 """
9468 return _core_.Window_GetHandle(*args, **kwargs)
9469
9470 def AssociateHandle(*args, **kwargs):
9471 """
9472 AssociateHandle(self, long handle)
9473
9474 Associate the window with a new native handle
9475 """
9476 return _core_.Window_AssociateHandle(*args, **kwargs)
9477
9478 def DissociateHandle(*args, **kwargs):
9479 """
9480 DissociateHandle(self)
9481
9482 Dissociate the current native handle from the window
9483 """
9484 return _core_.Window_DissociateHandle(*args, **kwargs)
9485
9486 def HasScrollbar(*args, **kwargs):
9487 """
9488 HasScrollbar(self, int orient) -> bool
9489
9490 Does the window have the scrollbar for this orientation?
9491 """
9492 return _core_.Window_HasScrollbar(*args, **kwargs)
9493
9494 def SetScrollbar(*args, **kwargs):
9495 """
9496 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9497 bool refresh=True)
9498
9499 Sets the scrollbar properties of a built-in scrollbar.
9500 """
9501 return _core_.Window_SetScrollbar(*args, **kwargs)
9502
9503 def SetScrollPos(*args, **kwargs):
9504 """
9505 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9506
9507 Sets the position of one of the built-in scrollbars.
9508 """
9509 return _core_.Window_SetScrollPos(*args, **kwargs)
9510
9511 def GetScrollPos(*args, **kwargs):
9512 """
9513 GetScrollPos(self, int orientation) -> int
9514
9515 Returns the built-in scrollbar position.
9516 """
9517 return _core_.Window_GetScrollPos(*args, **kwargs)
9518
9519 def GetScrollThumb(*args, **kwargs):
9520 """
9521 GetScrollThumb(self, int orientation) -> int
9522
9523 Returns the built-in scrollbar thumb size.
9524 """
9525 return _core_.Window_GetScrollThumb(*args, **kwargs)
9526
9527 def GetScrollRange(*args, **kwargs):
9528 """
9529 GetScrollRange(self, int orientation) -> int
9530
9531 Returns the built-in scrollbar range.
9532 """
9533 return _core_.Window_GetScrollRange(*args, **kwargs)
9534
9535 def ScrollWindow(*args, **kwargs):
9536 """
9537 ScrollWindow(self, int dx, int dy, Rect rect=None)
9538
9539 Physically scrolls the pixels in the window and move child windows
9540 accordingly. Use this function to optimise your scrolling
9541 implementations, to minimise the area that must be redrawn. Note that
9542 it is rarely required to call this function from a user program.
9543 """
9544 return _core_.Window_ScrollWindow(*args, **kwargs)
9545
9546 def ScrollLines(*args, **kwargs):
9547 """
9548 ScrollLines(self, int lines) -> bool
9549
9550 If the platform and window class supports it, scrolls the window by
9551 the given number of lines down, if lines is positive, or up if lines
9552 is negative. Returns True if the window was scrolled, False if it was
9553 already on top/bottom and nothing was done.
9554 """
9555 return _core_.Window_ScrollLines(*args, **kwargs)
9556
9557 def ScrollPages(*args, **kwargs):
9558 """
9559 ScrollPages(self, int pages) -> bool
9560
9561 If the platform and window class supports it, scrolls the window by
9562 the given number of pages down, if pages is positive, or up if pages
9563 is negative. Returns True if the window was scrolled, False if it was
9564 already on top/bottom and nothing was done.
9565 """
9566 return _core_.Window_ScrollPages(*args, **kwargs)
9567
9568 def LineUp(*args, **kwargs):
9569 """
9570 LineUp(self) -> bool
9571
9572 This is just a wrapper for ScrollLines(-1).
9573 """
9574 return _core_.Window_LineUp(*args, **kwargs)
9575
9576 def LineDown(*args, **kwargs):
9577 """
9578 LineDown(self) -> bool
9579
9580 This is just a wrapper for ScrollLines(1).
9581 """
9582 return _core_.Window_LineDown(*args, **kwargs)
9583
9584 def PageUp(*args, **kwargs):
9585 """
9586 PageUp(self) -> bool
9587
9588 This is just a wrapper for ScrollPages(-1).
9589 """
9590 return _core_.Window_PageUp(*args, **kwargs)
9591
9592 def PageDown(*args, **kwargs):
9593 """
9594 PageDown(self) -> bool
9595
9596 This is just a wrapper for ScrollPages(1).
9597 """
9598 return _core_.Window_PageDown(*args, **kwargs)
9599
9600 def SetHelpText(*args, **kwargs):
9601 """
9602 SetHelpText(self, String text)
9603
9604 Sets the help text to be used as context-sensitive help for this
9605 window. Note that the text is actually stored by the current
9606 `wx.HelpProvider` implementation, and not in the window object itself.
9607 """
9608 return _core_.Window_SetHelpText(*args, **kwargs)
9609
9610 def SetHelpTextForId(*args, **kwargs):
9611 """
9612 SetHelpTextForId(self, String text)
9613
9614 Associate this help text with all windows with the same id as this
9615 one.
9616 """
9617 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9618
9619 def GetHelpTextAtPoint(*args, **kwargs):
9620 """
9621 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9622
9623 Get the help string associated with the given position in this window.
9624
9625 Notice that pt may be invalid if event origin is keyboard or unknown
9626 and this method should return the global window help text then
9627
9628 """
9629 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9630
9631 def GetHelpText(*args, **kwargs):
9632 """
9633 GetHelpText(self) -> String
9634
9635 Gets the help text to be used as context-sensitive help for this
9636 window. Note that the text is actually stored by the current
9637 `wx.HelpProvider` implementation, and not in the window object itself.
9638 """
9639 return _core_.Window_GetHelpText(*args, **kwargs)
9640
9641 def SetToolTipString(*args, **kwargs):
9642 """
9643 SetToolTipString(self, String tip)
9644
9645 Attach a tooltip to the window.
9646 """
9647 return _core_.Window_SetToolTipString(*args, **kwargs)
9648
9649 def SetToolTip(*args, **kwargs):
9650 """
9651 SetToolTip(self, ToolTip tip)
9652
9653 Attach a tooltip to the window.
9654 """
9655 return _core_.Window_SetToolTip(*args, **kwargs)
9656
9657 def GetToolTip(*args, **kwargs):
9658 """
9659 GetToolTip(self) -> ToolTip
9660
9661 get the associated tooltip or None if none
9662 """
9663 return _core_.Window_GetToolTip(*args, **kwargs)
9664
9665 def SetDropTarget(*args, **kwargs):
9666 """
9667 SetDropTarget(self, DropTarget dropTarget)
9668
9669 Associates a drop target with this window. If the window already has
9670 a drop target, it is deleted.
9671 """
9672 return _core_.Window_SetDropTarget(*args, **kwargs)
9673
9674 def GetDropTarget(*args, **kwargs):
9675 """
9676 GetDropTarget(self) -> DropTarget
9677
9678 Returns the associated drop target, which may be None.
9679 """
9680 return _core_.Window_GetDropTarget(*args, **kwargs)
9681
9682 def DragAcceptFiles(*args, **kwargs):
9683 """
9684 DragAcceptFiles(self, bool accept)
9685
9686 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9687 Only functional on Windows.
9688 """
9689 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9690
9691 def SetConstraints(*args, **kwargs):
9692 """
9693 SetConstraints(self, LayoutConstraints constraints)
9694
9695 Sets the window to have the given layout constraints. If an existing
9696 layout constraints object is already owned by the window, it will be
9697 deleted. Pass None to disassociate and delete the window's current
9698 constraints.
9699
9700 You must call SetAutoLayout to tell a window to use the constraints
9701 automatically in its default EVT_SIZE handler; otherwise, you must
9702 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9703 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9704 effect.
9705 """
9706 return _core_.Window_SetConstraints(*args, **kwargs)
9707
9708 def GetConstraints(*args, **kwargs):
9709 """
9710 GetConstraints(self) -> LayoutConstraints
9711
9712 Returns a pointer to the window's layout constraints, or None if there
9713 are none.
9714 """
9715 return _core_.Window_GetConstraints(*args, **kwargs)
9716
9717 def SetAutoLayout(*args, **kwargs):
9718 """
9719 SetAutoLayout(self, bool autoLayout)
9720
9721 Determines whether the Layout function will be called automatically
9722 when the window is resized. lease note that this only happens for the
9723 windows usually used to contain children, namely `wx.Panel` and
9724 `wx.TopLevelWindow` (and the classes deriving from them).
9725
9726 This method is called implicitly by `SetSizer` but if you use
9727 `SetConstraints` you should call it manually or otherwise the window
9728 layout won't be correctly updated when its size changes.
9729 """
9730 return _core_.Window_SetAutoLayout(*args, **kwargs)
9731
9732 def GetAutoLayout(*args, **kwargs):
9733 """
9734 GetAutoLayout(self) -> bool
9735
9736 Returns the current autoLayout setting
9737 """
9738 return _core_.Window_GetAutoLayout(*args, **kwargs)
9739
9740 def Layout(*args, **kwargs):
9741 """
9742 Layout(self) -> bool
9743
9744 Invokes the constraint-based layout algorithm or the sizer-based
9745 algorithm for this window. See SetAutoLayout: when auto layout is on,
9746 this function gets called automatically by the default EVT_SIZE
9747 handler when the window is resized.
9748 """
9749 return _core_.Window_Layout(*args, **kwargs)
9750
9751 def SetSizer(*args, **kwargs):
9752 """
9753 SetSizer(self, Sizer sizer, bool deleteOld=True)
9754
9755 Sets the window to have the given layout sizer. The window will then
9756 own the object, and will take care of its deletion. If an existing
9757 layout sizer object is already owned by the window, it will be deleted
9758 if the deleteOld parameter is true. Note that this function will also
9759 call SetAutoLayout implicitly with a True parameter if the sizer is
9760 non-None, and False otherwise.
9761 """
9762 return _core_.Window_SetSizer(*args, **kwargs)
9763
9764 def SetSizerAndFit(*args, **kwargs):
9765 """
9766 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9767
9768 The same as SetSizer, except it also sets the size hints for the
9769 window based on the sizer's minimum size.
9770 """
9771 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9772
9773 def GetSizer(*args, **kwargs):
9774 """
9775 GetSizer(self) -> Sizer
9776
9777 Return the sizer associated with the window by a previous call to
9778 SetSizer or None if there isn't one.
9779 """
9780 return _core_.Window_GetSizer(*args, **kwargs)
9781
9782 def SetContainingSizer(*args, **kwargs):
9783 """
9784 SetContainingSizer(self, Sizer sizer)
9785
9786 This normally does not need to be called by application code. It is
9787 called internally when a window is added to a sizer, and is used so
9788 the window can remove itself from the sizer when it is destroyed.
9789 """
9790 return _core_.Window_SetContainingSizer(*args, **kwargs)
9791
9792 def GetContainingSizer(*args, **kwargs):
9793 """
9794 GetContainingSizer(self) -> Sizer
9795
9796 Return the sizer that this window is a member of, if any, otherwise None.
9797 """
9798 return _core_.Window_GetContainingSizer(*args, **kwargs)
9799
9800 def InheritAttributes(*args, **kwargs):
9801 """
9802 InheritAttributes(self)
9803
9804 This function is (or should be, in case of custom controls) called
9805 during window creation to intelligently set up the window visual
9806 attributes, that is the font and the foreground and background
9807 colours.
9808
9809 By 'intelligently' the following is meant: by default, all windows use
9810 their own default attributes. However if some of the parent's
9811 attributes are explicitly changed (that is, using SetFont and not
9812 SetOwnFont) and if the corresponding attribute hadn't been
9813 explicitly set for this window itself, then this window takes the same
9814 value as used by the parent. In addition, if the window overrides
9815 ShouldInheritColours to return false, the colours will not be changed
9816 no matter what and only the font might.
9817
9818 This rather complicated logic is necessary in order to accommodate the
9819 different usage scenarios. The most common one is when all default
9820 attributes are used and in this case, nothing should be inherited as
9821 in modern GUIs different controls use different fonts (and colours)
9822 than their siblings so they can't inherit the same value from the
9823 parent. However it was also deemed desirable to allow to simply change
9824 the attributes of all children at once by just changing the font or
9825 colour of their common parent, hence in this case we do inherit the
9826 parents attributes.
9827
9828 """
9829 return _core_.Window_InheritAttributes(*args, **kwargs)
9830
9831 def ShouldInheritColours(*args, **kwargs):
9832 """
9833 ShouldInheritColours(self) -> bool
9834
9835 Return true from here to allow the colours of this window to be
9836 changed by InheritAttributes, returning false forbids inheriting them
9837 from the parent window.
9838
9839 The base class version returns false, but this method is overridden in
9840 wxControl where it returns true.
9841 """
9842 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9843
9844 def CanSetTransparent(*args, **kwargs):
9845 """
9846 CanSetTransparent(self) -> bool
9847
9848 Returns ``True`` if the platform supports setting the transparency for
9849 this window. Note that this method will err on the side of caution,
9850 so it is possible that this will return ``False`` when it is in fact
9851 possible to set the transparency.
9852
9853 NOTE: On X-windows systems the X server must have the composite
9854 extension loaded, and there must be a composite manager program (such
9855 as xcompmgr) running.
9856 """
9857 return _core_.Window_CanSetTransparent(*args, **kwargs)
9858
9859 def SetTransparent(*args, **kwargs):
9860 """
9861 SetTransparent(self, byte alpha) -> bool
9862
9863 Attempt to set the transparency of this window to the ``alpha`` value,
9864 returns True on success. The ``alpha`` value is an integer in the
9865 range of 0 to 255, where 0 is fully transparent and 255 is fully
9866 opaque.
9867 """
9868 return _core_.Window_SetTransparent(*args, **kwargs)
9869
9870 def PostCreate(self, pre):
9871 """
9872 Phase 3 of the 2-phase create <wink!>
9873 Call this method after precreating the window with the 2-phase create method.
9874 """
9875 self.this = pre.this
9876 self.thisown = pre.thisown
9877 pre.thisown = 0
9878 if hasattr(self, '_setOORInfo'):
9879 self._setOORInfo(self)
9880 if hasattr(self, '_setCallbackInfo'):
9881 self._setCallbackInfo(self, self.__class__)
9882
9883 def SendSizeEvent(self):
9884 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9885
9886 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9887 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
9888 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
9889 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
9890 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9891 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
9892 BestSize = property(GetBestSize,doc="See `GetBestSize`")
9893 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
9894 Border = property(GetBorder,doc="See `GetBorder`")
9895 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
9896 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
9897 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
9898 Children = property(GetChildren,doc="See `GetChildren`")
9899 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
9900 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
9901 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
9902 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
9903 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
9904 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
9905 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
9906 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
9907 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
9908 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
9909 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
9910 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
9911 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
9912 Handle = property(GetHandle,doc="See `GetHandle`")
9913 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
9914 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
9915 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
9916 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
9917 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
9918 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
9919 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
9920 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
9921 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
9922 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
9923 Parent = property(GetParent,doc="See `GetParent`")
9924 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
9925 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
9926 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
9927 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
9928 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
9929 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
9930 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
9931 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
9932 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
9933 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
9934 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
9935 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
9936 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
9937 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9938 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
9939 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
9940 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
9941 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
9942 _core_.Window_swigregister(Window)
9943
9944 def PreWindow(*args, **kwargs):
9945 """
9946 PreWindow() -> Window
9947
9948 Precreate a Window for 2-phase creation.
9949 """
9950 val = _core_.new_PreWindow(*args, **kwargs)
9951 return val
9952
9953 def Window_NewControlId(*args):
9954 """
9955 Window_NewControlId() -> int
9956
9957 Generate a control id for the controls which were not given one.
9958 """
9959 return _core_.Window_NewControlId(*args)
9960
9961 def Window_NextControlId(*args, **kwargs):
9962 """
9963 Window_NextControlId(int winid) -> int
9964
9965 Get the id of the control following the one with the given
9966 autogenerated) id
9967 """
9968 return _core_.Window_NextControlId(*args, **kwargs)
9969
9970 def Window_PrevControlId(*args, **kwargs):
9971 """
9972 Window_PrevControlId(int winid) -> int
9973
9974 Get the id of the control preceding the one with the given
9975 autogenerated) id
9976 """
9977 return _core_.Window_PrevControlId(*args, **kwargs)
9978
9979 def Window_FindFocus(*args):
9980 """
9981 Window_FindFocus() -> Window
9982
9983 Returns the window or control that currently has the keyboard focus,
9984 or None.
9985 """
9986 return _core_.Window_FindFocus(*args)
9987
9988 def Window_GetCapture(*args):
9989 """
9990 Window_GetCapture() -> Window
9991
9992 Returns the window which currently captures the mouse or None
9993 """
9994 return _core_.Window_GetCapture(*args)
9995
9996 def Window_GetClassDefaultAttributes(*args, **kwargs):
9997 """
9998 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9999
10000 Get the default attributes for this class. This is useful if you want
10001 to use the same font or colour in your own control as in a standard
10002 control -- which is a much better idea than hard coding specific
10003 colours or fonts which might look completely out of place on the
10004 user's system, especially if it uses themes.
10005
10006 The variant parameter is only relevant under Mac currently and is
10007 ignore under other platforms. Under Mac, it will change the size of
10008 the returned font. See `wx.Window.SetWindowVariant` for more about
10009 this.
10010 """
10011 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10012
10013 def DLG_PNT(win, point_or_x, y=None):
10014 """
10015 Convenience function for converting a Point or (x,y) in
10016 dialog units to pixel units.
10017 """
10018 if y is None:
10019 return win.ConvertDialogPointToPixels(point_or_x)
10020 else:
10021 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10022
10023 def DLG_SZE(win, size_width, height=None):
10024 """
10025 Convenience function for converting a Size or (w,h) in
10026 dialog units to pixel units.
10027 """
10028 if height is None:
10029 return win.ConvertDialogSizeToPixels(size_width)
10030 else:
10031 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10032
10033
10034 def FindWindowById(*args, **kwargs):
10035 """
10036 FindWindowById(long id, Window parent=None) -> Window
10037
10038 Find the first window in the application with the given id. If parent
10039 is None, the search will start from all top-level frames and dialog
10040 boxes; if non-None, the search will be limited to the given window
10041 hierarchy. The search is recursive in both cases.
10042 """
10043 return _core_.FindWindowById(*args, **kwargs)
10044
10045 def FindWindowByName(*args, **kwargs):
10046 """
10047 FindWindowByName(String name, Window parent=None) -> Window
10048
10049 Find a window by its name (as given in a window constructor or Create
10050 function call). If parent is None, the search will start from all
10051 top-level frames and dialog boxes; if non-None, the search will be
10052 limited to the given window hierarchy. The search is recursive in both
10053 cases.
10054
10055 If no window with such name is found, wx.FindWindowByLabel is called.
10056 """
10057 return _core_.FindWindowByName(*args, **kwargs)
10058
10059 def FindWindowByLabel(*args, **kwargs):
10060 """
10061 FindWindowByLabel(String label, Window parent=None) -> Window
10062
10063 Find a window by its label. Depending on the type of window, the label
10064 may be a window title or panel item label. If parent is None, the
10065 search will start from all top-level frames and dialog boxes; if
10066 non-None, the search will be limited to the given window
10067 hierarchy. The search is recursive in both cases.
10068 """
10069 return _core_.FindWindowByLabel(*args, **kwargs)
10070
10071 def Window_FromHWND(*args, **kwargs):
10072 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10073 return _core_.Window_FromHWND(*args, **kwargs)
10074
10075 def GetTopLevelWindows(*args):
10076 """
10077 GetTopLevelWindows() -> PyObject
10078
10079 Returns a list of the the application's top-level windows, (frames,
10080 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10081 by wxWidgets, and so it is only valid as long as no top-level windows
10082 are closed or new top-level windows are created.
10083
10084 """
10085 return _core_.GetTopLevelWindows(*args)
10086 #---------------------------------------------------------------------------
10087
10088 class Validator(EvtHandler):
10089 """Proxy of C++ Validator class"""
10090 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10091 __repr__ = _swig_repr
10092 def __init__(self, *args, **kwargs):
10093 """__init__(self) -> Validator"""
10094 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10095 self._setOORInfo(self)
10096
10097 def Clone(*args, **kwargs):
10098 """Clone(self) -> Validator"""
10099 return _core_.Validator_Clone(*args, **kwargs)
10100
10101 def Validate(*args, **kwargs):
10102 """Validate(self, Window parent) -> bool"""
10103 return _core_.Validator_Validate(*args, **kwargs)
10104
10105 def TransferToWindow(*args, **kwargs):
10106 """TransferToWindow(self) -> bool"""
10107 return _core_.Validator_TransferToWindow(*args, **kwargs)
10108
10109 def TransferFromWindow(*args, **kwargs):
10110 """TransferFromWindow(self) -> bool"""
10111 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10112
10113 def GetWindow(*args, **kwargs):
10114 """GetWindow(self) -> Window"""
10115 return _core_.Validator_GetWindow(*args, **kwargs)
10116
10117 def SetWindow(*args, **kwargs):
10118 """SetWindow(self, Window window)"""
10119 return _core_.Validator_SetWindow(*args, **kwargs)
10120
10121 def IsSilent(*args, **kwargs):
10122 """IsSilent() -> bool"""
10123 return _core_.Validator_IsSilent(*args, **kwargs)
10124
10125 IsSilent = staticmethod(IsSilent)
10126 def SetBellOnError(*args, **kwargs):
10127 """SetBellOnError(int doIt=True)"""
10128 return _core_.Validator_SetBellOnError(*args, **kwargs)
10129
10130 SetBellOnError = staticmethod(SetBellOnError)
10131 _core_.Validator_swigregister(Validator)
10132
10133 def Validator_IsSilent(*args):
10134 """Validator_IsSilent() -> bool"""
10135 return _core_.Validator_IsSilent(*args)
10136
10137 def Validator_SetBellOnError(*args, **kwargs):
10138 """Validator_SetBellOnError(int doIt=True)"""
10139 return _core_.Validator_SetBellOnError(*args, **kwargs)
10140
10141 class PyValidator(Validator):
10142 """Proxy of C++ PyValidator class"""
10143 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10144 __repr__ = _swig_repr
10145 def __init__(self, *args, **kwargs):
10146 """__init__(self) -> PyValidator"""
10147 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10148
10149 self._setCallbackInfo(self, PyValidator, 1)
10150 self._setOORInfo(self)
10151
10152 def _setCallbackInfo(*args, **kwargs):
10153 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10154 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10155
10156 _core_.PyValidator_swigregister(PyValidator)
10157
10158 #---------------------------------------------------------------------------
10159
10160 class Menu(EvtHandler):
10161 """Proxy of C++ Menu class"""
10162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10163 __repr__ = _swig_repr
10164 def __init__(self, *args, **kwargs):
10165 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10166 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10167 self._setOORInfo(self)
10168
10169 def Append(*args, **kwargs):
10170 """
10171 Append(self, int id, String text=EmptyString, String help=EmptyString,
10172 int kind=ITEM_NORMAL) -> MenuItem
10173 """
10174 return _core_.Menu_Append(*args, **kwargs)
10175
10176 def AppendSeparator(*args, **kwargs):
10177 """AppendSeparator(self) -> MenuItem"""
10178 return _core_.Menu_AppendSeparator(*args, **kwargs)
10179
10180 def AppendCheckItem(*args, **kwargs):
10181 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10182 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10183
10184 def AppendRadioItem(*args, **kwargs):
10185 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10186 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10187
10188 def AppendMenu(*args, **kwargs):
10189 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10190 return _core_.Menu_AppendMenu(*args, **kwargs)
10191
10192 def AppendSubMenu(*args, **kwargs):
10193 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10194 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10195
10196 def AppendItem(*args, **kwargs):
10197 """AppendItem(self, MenuItem item) -> MenuItem"""
10198 return _core_.Menu_AppendItem(*args, **kwargs)
10199
10200 def InsertItem(*args, **kwargs):
10201 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10202 return _core_.Menu_InsertItem(*args, **kwargs)
10203
10204 def PrependItem(*args, **kwargs):
10205 """PrependItem(self, MenuItem item) -> MenuItem"""
10206 return _core_.Menu_PrependItem(*args, **kwargs)
10207
10208 def Break(*args, **kwargs):
10209 """Break(self)"""
10210 return _core_.Menu_Break(*args, **kwargs)
10211
10212 def Insert(*args, **kwargs):
10213 """
10214 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10215 int kind=ITEM_NORMAL) -> MenuItem
10216 """
10217 return _core_.Menu_Insert(*args, **kwargs)
10218
10219 def InsertSeparator(*args, **kwargs):
10220 """InsertSeparator(self, size_t pos) -> MenuItem"""
10221 return _core_.Menu_InsertSeparator(*args, **kwargs)
10222
10223 def InsertCheckItem(*args, **kwargs):
10224 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10225 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10226
10227 def InsertRadioItem(*args, **kwargs):
10228 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10229 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10230
10231 def InsertMenu(*args, **kwargs):
10232 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10233 return _core_.Menu_InsertMenu(*args, **kwargs)
10234
10235 def Prepend(*args, **kwargs):
10236 """
10237 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10238 int kind=ITEM_NORMAL) -> MenuItem
10239 """
10240 return _core_.Menu_Prepend(*args, **kwargs)
10241
10242 def PrependSeparator(*args, **kwargs):
10243 """PrependSeparator(self) -> MenuItem"""
10244 return _core_.Menu_PrependSeparator(*args, **kwargs)
10245
10246 def PrependCheckItem(*args, **kwargs):
10247 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10248 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10249
10250 def PrependRadioItem(*args, **kwargs):
10251 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10252 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10253
10254 def PrependMenu(*args, **kwargs):
10255 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10256 return _core_.Menu_PrependMenu(*args, **kwargs)
10257
10258 def Remove(*args, **kwargs):
10259 """Remove(self, int id) -> MenuItem"""
10260 return _core_.Menu_Remove(*args, **kwargs)
10261
10262 def RemoveItem(*args, **kwargs):
10263 """RemoveItem(self, MenuItem item) -> MenuItem"""
10264 return _core_.Menu_RemoveItem(*args, **kwargs)
10265
10266 def Delete(*args, **kwargs):
10267 """Delete(self, int id) -> bool"""
10268 return _core_.Menu_Delete(*args, **kwargs)
10269
10270 def DeleteItem(*args, **kwargs):
10271 """DeleteItem(self, MenuItem item) -> bool"""
10272 return _core_.Menu_DeleteItem(*args, **kwargs)
10273
10274 def Destroy(*args, **kwargs):
10275 """
10276 Destroy(self)
10277
10278 Deletes the C++ object this Python object is a proxy for.
10279 """
10280 val = _core_.Menu_Destroy(*args, **kwargs)
10281 args[0].thisown = 0
10282 return val
10283
10284 def DestroyId(*args, **kwargs):
10285 """
10286 DestroyId(self, int id) -> bool
10287
10288 Deletes the C++ object this Python object is a proxy for.
10289 """
10290 val = _core_.Menu_DestroyId(*args, **kwargs)
10291 args[0].thisown = 0
10292 return val
10293
10294 def DestroyItem(*args, **kwargs):
10295 """
10296 DestroyItem(self, MenuItem item) -> bool
10297
10298 Deletes the C++ object this Python object is a proxy for.
10299 """
10300 val = _core_.Menu_DestroyItem(*args, **kwargs)
10301 args[0].thisown = 0
10302 return val
10303
10304 def GetMenuItemCount(*args, **kwargs):
10305 """GetMenuItemCount(self) -> size_t"""
10306 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10307
10308 def GetMenuItems(*args, **kwargs):
10309 """GetMenuItems(self) -> PyObject"""
10310 return _core_.Menu_GetMenuItems(*args, **kwargs)
10311
10312 def FindItem(*args, **kwargs):
10313 """FindItem(self, String item) -> int"""
10314 return _core_.Menu_FindItem(*args, **kwargs)
10315
10316 def FindItemById(*args, **kwargs):
10317 """FindItemById(self, int id) -> MenuItem"""
10318 return _core_.Menu_FindItemById(*args, **kwargs)
10319
10320 def FindItemByPosition(*args, **kwargs):
10321 """FindItemByPosition(self, size_t position) -> MenuItem"""
10322 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10323
10324 def Enable(*args, **kwargs):
10325 """Enable(self, int id, bool enable)"""
10326 return _core_.Menu_Enable(*args, **kwargs)
10327
10328 def IsEnabled(*args, **kwargs):
10329 """IsEnabled(self, int id) -> bool"""
10330 return _core_.Menu_IsEnabled(*args, **kwargs)
10331
10332 def Check(*args, **kwargs):
10333 """Check(self, int id, bool check)"""
10334 return _core_.Menu_Check(*args, **kwargs)
10335
10336 def IsChecked(*args, **kwargs):
10337 """IsChecked(self, int id) -> bool"""
10338 return _core_.Menu_IsChecked(*args, **kwargs)
10339
10340 def SetLabel(*args, **kwargs):
10341 """SetLabel(self, int id, String label)"""
10342 return _core_.Menu_SetLabel(*args, **kwargs)
10343
10344 def GetLabel(*args, **kwargs):
10345 """GetLabel(self, int id) -> String"""
10346 return _core_.Menu_GetLabel(*args, **kwargs)
10347
10348 def SetHelpString(*args, **kwargs):
10349 """SetHelpString(self, int id, String helpString)"""
10350 return _core_.Menu_SetHelpString(*args, **kwargs)
10351
10352 def GetHelpString(*args, **kwargs):
10353 """GetHelpString(self, int id) -> String"""
10354 return _core_.Menu_GetHelpString(*args, **kwargs)
10355
10356 def SetTitle(*args, **kwargs):
10357 """SetTitle(self, String title)"""
10358 return _core_.Menu_SetTitle(*args, **kwargs)
10359
10360 def GetTitle(*args, **kwargs):
10361 """GetTitle(self) -> String"""
10362 return _core_.Menu_GetTitle(*args, **kwargs)
10363
10364 def SetEventHandler(*args, **kwargs):
10365 """SetEventHandler(self, EvtHandler handler)"""
10366 return _core_.Menu_SetEventHandler(*args, **kwargs)
10367
10368 def GetEventHandler(*args, **kwargs):
10369 """GetEventHandler(self) -> EvtHandler"""
10370 return _core_.Menu_GetEventHandler(*args, **kwargs)
10371
10372 def SetInvokingWindow(*args, **kwargs):
10373 """SetInvokingWindow(self, Window win)"""
10374 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10375
10376 def GetInvokingWindow(*args, **kwargs):
10377 """GetInvokingWindow(self) -> Window"""
10378 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10379
10380 def GetStyle(*args, **kwargs):
10381 """GetStyle(self) -> long"""
10382 return _core_.Menu_GetStyle(*args, **kwargs)
10383
10384 def UpdateUI(*args, **kwargs):
10385 """UpdateUI(self, EvtHandler source=None)"""
10386 return _core_.Menu_UpdateUI(*args, **kwargs)
10387
10388 def GetMenuBar(*args, **kwargs):
10389 """GetMenuBar(self) -> MenuBar"""
10390 return _core_.Menu_GetMenuBar(*args, **kwargs)
10391
10392 def Attach(*args, **kwargs):
10393 """Attach(self, wxMenuBarBase menubar)"""
10394 return _core_.Menu_Attach(*args, **kwargs)
10395
10396 def Detach(*args, **kwargs):
10397 """Detach(self)"""
10398 return _core_.Menu_Detach(*args, **kwargs)
10399
10400 def IsAttached(*args, **kwargs):
10401 """IsAttached(self) -> bool"""
10402 return _core_.Menu_IsAttached(*args, **kwargs)
10403
10404 def SetParent(*args, **kwargs):
10405 """SetParent(self, Menu parent)"""
10406 return _core_.Menu_SetParent(*args, **kwargs)
10407
10408 def GetParent(*args, **kwargs):
10409 """GetParent(self) -> Menu"""
10410 return _core_.Menu_GetParent(*args, **kwargs)
10411
10412 _core_.Menu_swigregister(Menu)
10413 DefaultValidator = cvar.DefaultValidator
10414
10415 #---------------------------------------------------------------------------
10416
10417 class MenuBar(Window):
10418 """Proxy of C++ MenuBar class"""
10419 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10420 __repr__ = _swig_repr
10421 def __init__(self, *args, **kwargs):
10422 """__init__(self, long style=0) -> MenuBar"""
10423 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10424 self._setOORInfo(self)
10425
10426 def Append(*args, **kwargs):
10427 """Append(self, Menu menu, String title) -> bool"""
10428 return _core_.MenuBar_Append(*args, **kwargs)
10429
10430 def Insert(*args, **kwargs):
10431 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10432 return _core_.MenuBar_Insert(*args, **kwargs)
10433
10434 def GetMenuCount(*args, **kwargs):
10435 """GetMenuCount(self) -> size_t"""
10436 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10437
10438 def GetMenu(*args, **kwargs):
10439 """GetMenu(self, size_t pos) -> Menu"""
10440 return _core_.MenuBar_GetMenu(*args, **kwargs)
10441
10442 def Replace(*args, **kwargs):
10443 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10444 return _core_.MenuBar_Replace(*args, **kwargs)
10445
10446 def Remove(*args, **kwargs):
10447 """Remove(self, size_t pos) -> Menu"""
10448 return _core_.MenuBar_Remove(*args, **kwargs)
10449
10450 def EnableTop(*args, **kwargs):
10451 """EnableTop(self, size_t pos, bool enable)"""
10452 return _core_.MenuBar_EnableTop(*args, **kwargs)
10453
10454 def IsEnabledTop(*args, **kwargs):
10455 """IsEnabledTop(self, size_t pos) -> bool"""
10456 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10457
10458 def SetLabelTop(*args, **kwargs):
10459 """SetLabelTop(self, size_t pos, String label)"""
10460 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10461
10462 def GetLabelTop(*args, **kwargs):
10463 """GetLabelTop(self, size_t pos) -> String"""
10464 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10465
10466 def FindMenuItem(*args, **kwargs):
10467 """FindMenuItem(self, String menu, String item) -> int"""
10468 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10469
10470 def FindItemById(*args, **kwargs):
10471 """FindItemById(self, int id) -> MenuItem"""
10472 return _core_.MenuBar_FindItemById(*args, **kwargs)
10473
10474 def FindMenu(*args, **kwargs):
10475 """FindMenu(self, String title) -> int"""
10476 return _core_.MenuBar_FindMenu(*args, **kwargs)
10477
10478 def Enable(*args, **kwargs):
10479 """Enable(self, int id, bool enable)"""
10480 return _core_.MenuBar_Enable(*args, **kwargs)
10481
10482 def Check(*args, **kwargs):
10483 """Check(self, int id, bool check)"""
10484 return _core_.MenuBar_Check(*args, **kwargs)
10485
10486 def IsChecked(*args, **kwargs):
10487 """IsChecked(self, int id) -> bool"""
10488 return _core_.MenuBar_IsChecked(*args, **kwargs)
10489
10490 def IsEnabled(*args, **kwargs):
10491 """IsEnabled(self, int id) -> bool"""
10492 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10493
10494 def SetLabel(*args, **kwargs):
10495 """SetLabel(self, int id, String label)"""
10496 return _core_.MenuBar_SetLabel(*args, **kwargs)
10497
10498 def GetLabel(*args, **kwargs):
10499 """GetLabel(self, int id) -> String"""
10500 return _core_.MenuBar_GetLabel(*args, **kwargs)
10501
10502 def SetHelpString(*args, **kwargs):
10503 """SetHelpString(self, int id, String helpString)"""
10504 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10505
10506 def GetHelpString(*args, **kwargs):
10507 """GetHelpString(self, int id) -> String"""
10508 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10509
10510 def GetFrame(*args, **kwargs):
10511 """GetFrame(self) -> wxFrame"""
10512 return _core_.MenuBar_GetFrame(*args, **kwargs)
10513
10514 def IsAttached(*args, **kwargs):
10515 """IsAttached(self) -> bool"""
10516 return _core_.MenuBar_IsAttached(*args, **kwargs)
10517
10518 def Attach(*args, **kwargs):
10519 """Attach(self, wxFrame frame)"""
10520 return _core_.MenuBar_Attach(*args, **kwargs)
10521
10522 def Detach(*args, **kwargs):
10523 """Detach(self)"""
10524 return _core_.MenuBar_Detach(*args, **kwargs)
10525
10526 def UpdateMenus(*args, **kwargs):
10527 """UpdateMenus(self)"""
10528 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10529
10530 def SetAutoWindowMenu(*args, **kwargs):
10531 """SetAutoWindowMenu(bool enable)"""
10532 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10533
10534 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10535 def GetAutoWindowMenu(*args, **kwargs):
10536 """GetAutoWindowMenu() -> bool"""
10537 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10538
10539 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10540 def GetMenus(self):
10541 """Return a list of (menu, label) items for the menus in the MenuBar. """
10542 return [(self.GetMenu(i), self.GetLabelTop(i))
10543 for i in range(self.GetMenuCount())]
10544
10545 def SetMenus(self, items):
10546 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10547 for i in range(self.GetMenuCount()-1, -1, -1):
10548 self.Remove(i)
10549 for m, l in items:
10550 self.Append(m, l)
10551
10552 Menus = property(GetMenus,SetMenus)
10553 _core_.MenuBar_swigregister(MenuBar)
10554
10555 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10556 """MenuBar_SetAutoWindowMenu(bool enable)"""
10557 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10558
10559 def MenuBar_GetAutoWindowMenu(*args):
10560 """MenuBar_GetAutoWindowMenu() -> bool"""
10561 return _core_.MenuBar_GetAutoWindowMenu(*args)
10562
10563 #---------------------------------------------------------------------------
10564
10565 class MenuItem(Object):
10566 """Proxy of C++ MenuItem class"""
10567 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10568 __repr__ = _swig_repr
10569 def __init__(self, *args, **kwargs):
10570 """
10571 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10572 String help=EmptyString, int kind=ITEM_NORMAL,
10573 Menu subMenu=None) -> MenuItem
10574 """
10575 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10576 __swig_destroy__ = _core_.delete_MenuItem
10577 __del__ = lambda self : None;
10578 def GetMenu(*args, **kwargs):
10579 """GetMenu(self) -> Menu"""
10580 return _core_.MenuItem_GetMenu(*args, **kwargs)
10581
10582 def SetMenu(*args, **kwargs):
10583 """SetMenu(self, Menu menu)"""
10584 return _core_.MenuItem_SetMenu(*args, **kwargs)
10585
10586 def SetId(*args, **kwargs):
10587 """SetId(self, int id)"""
10588 return _core_.MenuItem_SetId(*args, **kwargs)
10589
10590 def GetId(*args, **kwargs):
10591 """GetId(self) -> int"""
10592 return _core_.MenuItem_GetId(*args, **kwargs)
10593
10594 def IsSeparator(*args, **kwargs):
10595 """IsSeparator(self) -> bool"""
10596 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10597
10598 def SetText(*args, **kwargs):
10599 """SetText(self, String str)"""
10600 return _core_.MenuItem_SetText(*args, **kwargs)
10601
10602 def GetLabel(*args, **kwargs):
10603 """GetLabel(self) -> String"""
10604 return _core_.MenuItem_GetLabel(*args, **kwargs)
10605
10606 def GetText(*args, **kwargs):
10607 """GetText(self) -> String"""
10608 return _core_.MenuItem_GetText(*args, **kwargs)
10609
10610 def GetLabelFromText(*args, **kwargs):
10611 """GetLabelFromText(String text) -> String"""
10612 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10613
10614 GetLabelFromText = staticmethod(GetLabelFromText)
10615 def GetKind(*args, **kwargs):
10616 """GetKind(self) -> int"""
10617 return _core_.MenuItem_GetKind(*args, **kwargs)
10618
10619 def SetKind(*args, **kwargs):
10620 """SetKind(self, int kind)"""
10621 return _core_.MenuItem_SetKind(*args, **kwargs)
10622
10623 def SetCheckable(*args, **kwargs):
10624 """SetCheckable(self, bool checkable)"""
10625 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10626
10627 def IsCheckable(*args, **kwargs):
10628 """IsCheckable(self) -> bool"""
10629 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10630
10631 def IsSubMenu(*args, **kwargs):
10632 """IsSubMenu(self) -> bool"""
10633 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10634
10635 def SetSubMenu(*args, **kwargs):
10636 """SetSubMenu(self, Menu menu)"""
10637 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10638
10639 def GetSubMenu(*args, **kwargs):
10640 """GetSubMenu(self) -> Menu"""
10641 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10642
10643 def Enable(*args, **kwargs):
10644 """Enable(self, bool enable=True)"""
10645 return _core_.MenuItem_Enable(*args, **kwargs)
10646
10647 def IsEnabled(*args, **kwargs):
10648 """IsEnabled(self) -> bool"""
10649 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10650
10651 def Check(*args, **kwargs):
10652 """Check(self, bool check=True)"""
10653 return _core_.MenuItem_Check(*args, **kwargs)
10654
10655 def IsChecked(*args, **kwargs):
10656 """IsChecked(self) -> bool"""
10657 return _core_.MenuItem_IsChecked(*args, **kwargs)
10658
10659 def Toggle(*args, **kwargs):
10660 """Toggle(self)"""
10661 return _core_.MenuItem_Toggle(*args, **kwargs)
10662
10663 def SetHelp(*args, **kwargs):
10664 """SetHelp(self, String str)"""
10665 return _core_.MenuItem_SetHelp(*args, **kwargs)
10666
10667 def GetHelp(*args, **kwargs):
10668 """GetHelp(self) -> String"""
10669 return _core_.MenuItem_GetHelp(*args, **kwargs)
10670
10671 def GetAccel(*args, **kwargs):
10672 """GetAccel(self) -> AcceleratorEntry"""
10673 return _core_.MenuItem_GetAccel(*args, **kwargs)
10674
10675 def SetAccel(*args, **kwargs):
10676 """SetAccel(self, AcceleratorEntry accel)"""
10677 return _core_.MenuItem_SetAccel(*args, **kwargs)
10678
10679 def SetBitmap(*args, **kwargs):
10680 """SetBitmap(self, Bitmap bitmap)"""
10681 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10682
10683 def GetBitmap(*args, **kwargs):
10684 """GetBitmap(self) -> Bitmap"""
10685 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10686
10687 def SetFont(*args, **kwargs):
10688 """SetFont(self, Font font)"""
10689 return _core_.MenuItem_SetFont(*args, **kwargs)
10690
10691 def GetFont(*args, **kwargs):
10692 """GetFont(self) -> Font"""
10693 return _core_.MenuItem_GetFont(*args, **kwargs)
10694
10695 def SetTextColour(*args, **kwargs):
10696 """SetTextColour(self, Colour colText)"""
10697 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10698
10699 def GetTextColour(*args, **kwargs):
10700 """GetTextColour(self) -> Colour"""
10701 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10702
10703 def SetBackgroundColour(*args, **kwargs):
10704 """SetBackgroundColour(self, Colour colBack)"""
10705 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10706
10707 def GetBackgroundColour(*args, **kwargs):
10708 """GetBackgroundColour(self) -> Colour"""
10709 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10710
10711 def SetBitmaps(*args, **kwargs):
10712 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10713 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10714
10715 def SetDisabledBitmap(*args, **kwargs):
10716 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10717 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10718
10719 def GetDisabledBitmap(*args, **kwargs):
10720 """GetDisabledBitmap(self) -> Bitmap"""
10721 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10722
10723 def SetMarginWidth(*args, **kwargs):
10724 """SetMarginWidth(self, int nWidth)"""
10725 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10726
10727 def GetMarginWidth(*args, **kwargs):
10728 """GetMarginWidth(self) -> int"""
10729 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10730
10731 def GetDefaultMarginWidth(*args, **kwargs):
10732 """GetDefaultMarginWidth() -> int"""
10733 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10734
10735 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10736 def IsOwnerDrawn(*args, **kwargs):
10737 """IsOwnerDrawn(self) -> bool"""
10738 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10739
10740 def SetOwnerDrawn(*args, **kwargs):
10741 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10742 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10743
10744 def ResetOwnerDrawn(*args, **kwargs):
10745 """ResetOwnerDrawn(self)"""
10746 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10747
10748 _core_.MenuItem_swigregister(MenuItem)
10749
10750 def MenuItem_GetLabelFromText(*args, **kwargs):
10751 """MenuItem_GetLabelFromText(String text) -> String"""
10752 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10753
10754 def MenuItem_GetDefaultMarginWidth(*args):
10755 """MenuItem_GetDefaultMarginWidth() -> int"""
10756 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10757
10758 #---------------------------------------------------------------------------
10759
10760 class Control(Window):
10761 """
10762 This is the base class for a control or 'widget'.
10763
10764 A control is generally a small window which processes user input
10765 and/or displays one or more item of data.
10766 """
10767 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10768 __repr__ = _swig_repr
10769 def __init__(self, *args, **kwargs):
10770 """
10771 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10772 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10773 String name=ControlNameStr) -> Control
10774
10775 Create a Control. Normally you should only call this from a subclass'
10776 __init__ as a plain old wx.Control is not very useful.
10777 """
10778 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10779 self._setOORInfo(self)
10780
10781 def Create(*args, **kwargs):
10782 """
10783 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10784 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10785 String name=ControlNameStr) -> bool
10786
10787 Do the 2nd phase and create the GUI control.
10788 """
10789 return _core_.Control_Create(*args, **kwargs)
10790
10791 def GetAlignment(*args, **kwargs):
10792 """
10793 GetAlignment(self) -> int
10794
10795 Get the control alignment (left/right/centre, top/bottom/centre)
10796 """
10797 return _core_.Control_GetAlignment(*args, **kwargs)
10798
10799 def GetLabelText(*args, **kwargs):
10800 """
10801 GetLabelText(self) -> String
10802
10803 Get just the text of the label, without mnemonic characters ('&')
10804 """
10805 return _core_.Control_GetLabelText(*args, **kwargs)
10806
10807 def Command(*args, **kwargs):
10808 """
10809 Command(self, CommandEvent event)
10810
10811 Simulates the effect of the user issuing a command to the item.
10812
10813 :see: `wx.CommandEvent`
10814
10815 """
10816 return _core_.Control_Command(*args, **kwargs)
10817
10818 def GetLabel(*args, **kwargs):
10819 """
10820 GetLabel(self) -> String
10821
10822 Return a control's text.
10823 """
10824 return _core_.Control_GetLabel(*args, **kwargs)
10825
10826 def GetClassDefaultAttributes(*args, **kwargs):
10827 """
10828 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10829
10830 Get the default attributes for this class. This is useful if you want
10831 to use the same font or colour in your own control as in a standard
10832 control -- which is a much better idea than hard coding specific
10833 colours or fonts which might look completely out of place on the
10834 user's system, especially if it uses themes.
10835
10836 The variant parameter is only relevant under Mac currently and is
10837 ignore under other platforms. Under Mac, it will change the size of
10838 the returned font. See `wx.Window.SetWindowVariant` for more about
10839 this.
10840 """
10841 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10842
10843 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10844 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10845 Label = property(GetLabel,doc="See `GetLabel`")
10846 LabelText = property(GetLabelText,doc="See `GetLabelText`")
10847 _core_.Control_swigregister(Control)
10848 ControlNameStr = cvar.ControlNameStr
10849
10850 def PreControl(*args, **kwargs):
10851 """
10852 PreControl() -> Control
10853
10854 Precreate a Control control for 2-phase creation
10855 """
10856 val = _core_.new_PreControl(*args, **kwargs)
10857 return val
10858
10859 def Control_GetClassDefaultAttributes(*args, **kwargs):
10860 """
10861 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10862
10863 Get the default attributes for this class. This is useful if you want
10864 to use the same font or colour in your own control as in a standard
10865 control -- which is a much better idea than hard coding specific
10866 colours or fonts which might look completely out of place on the
10867 user's system, especially if it uses themes.
10868
10869 The variant parameter is only relevant under Mac currently and is
10870 ignore under other platforms. Under Mac, it will change the size of
10871 the returned font. See `wx.Window.SetWindowVariant` for more about
10872 this.
10873 """
10874 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10875
10876 #---------------------------------------------------------------------------
10877
10878 class ItemContainer(object):
10879 """
10880 The wx.ItemContainer class defines an interface which is implemented
10881 by all controls which have string subitems, each of which may be
10882 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10883 as `wx.ComboBox` which implements an extended interface deriving from
10884 this one.
10885
10886 It defines the methods for accessing the control's items and although
10887 each of the derived classes implements them differently, they still
10888 all conform to the same interface.
10889
10890 The items in a wx.ItemContainer have (non empty) string labels and,
10891 optionally, client data associated with them.
10892
10893 """
10894 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10895 def __init__(self): raise AttributeError, "No constructor defined"
10896 __repr__ = _swig_repr
10897 def Append(*args, **kwargs):
10898 """
10899 Append(self, String item, PyObject clientData=None) -> int
10900
10901 Adds the item to the control, associating the given data with the item
10902 if not None. The return value is the index of the newly added item
10903 which may be different from the last one if the control is sorted (e.g.
10904 has wx.LB_SORT or wx.CB_SORT style).
10905 """
10906 return _core_.ItemContainer_Append(*args, **kwargs)
10907
10908 def AppendItems(*args, **kwargs):
10909 """
10910 AppendItems(self, List strings)
10911
10912 Apend several items at once to the control. Notice that calling this
10913 method may be much faster than appending the items one by one if you
10914 need to add a lot of items.
10915 """
10916 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10917
10918 def Insert(*args, **kwargs):
10919 """
10920 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10921
10922 Insert an item into the control before the item at the ``pos`` index,
10923 optionally associating some data object with the item.
10924 """
10925 return _core_.ItemContainer_Insert(*args, **kwargs)
10926
10927 def Clear(*args, **kwargs):
10928 """
10929 Clear(self)
10930
10931 Removes all items from the control.
10932 """
10933 return _core_.ItemContainer_Clear(*args, **kwargs)
10934
10935 def Delete(*args, **kwargs):
10936 """
10937 Delete(self, unsigned int n)
10938
10939 Deletes the item at the zero-based index 'n' from the control. Note
10940 that it is an error (signalled by a `wx.PyAssertionError` exception if
10941 enabled) to remove an item with the index negative or greater or equal
10942 than the number of items in the control.
10943 """
10944 return _core_.ItemContainer_Delete(*args, **kwargs)
10945
10946 def GetClientData(*args, **kwargs):
10947 """
10948 GetClientData(self, unsigned int n) -> PyObject
10949
10950 Returns the client data associated with the given item, (if any.)
10951 """
10952 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10953
10954 def SetClientData(*args, **kwargs):
10955 """
10956 SetClientData(self, unsigned int n, PyObject clientData)
10957
10958 Associate the given client data with the item at position n.
10959 """
10960 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10961
10962 def GetCount(*args, **kwargs):
10963 """
10964 GetCount(self) -> unsigned int
10965
10966 Returns the number of items in the control.
10967 """
10968 return _core_.ItemContainer_GetCount(*args, **kwargs)
10969
10970 def IsEmpty(*args, **kwargs):
10971 """
10972 IsEmpty(self) -> bool
10973
10974 Returns True if the control is empty or False if it has some items.
10975 """
10976 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10977
10978 def GetString(*args, **kwargs):
10979 """
10980 GetString(self, unsigned int n) -> String
10981
10982 Returns the label of the item with the given index.
10983 """
10984 return _core_.ItemContainer_GetString(*args, **kwargs)
10985
10986 def GetStrings(*args, **kwargs):
10987 """GetStrings(self) -> wxArrayString"""
10988 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10989
10990 def SetString(*args, **kwargs):
10991 """
10992 SetString(self, unsigned int n, String s)
10993
10994 Sets the label for the given item.
10995 """
10996 return _core_.ItemContainer_SetString(*args, **kwargs)
10997
10998 def FindString(*args, **kwargs):
10999 """
11000 FindString(self, String s) -> int
11001
11002 Finds an item whose label matches the given string. Returns the
11003 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11004 found.
11005 """
11006 return _core_.ItemContainer_FindString(*args, **kwargs)
11007
11008 def SetSelection(*args, **kwargs):
11009 """
11010 SetSelection(self, int n)
11011
11012 Sets the item at index 'n' to be the selected item.
11013 """
11014 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11015
11016 def GetSelection(*args, **kwargs):
11017 """
11018 GetSelection(self) -> int
11019
11020 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11021 is selected.
11022 """
11023 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11024
11025 def SetStringSelection(*args, **kwargs):
11026 """SetStringSelection(self, String s) -> bool"""
11027 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11028
11029 def GetStringSelection(*args, **kwargs):
11030 """
11031 GetStringSelection(self) -> String
11032
11033 Returns the label of the selected item or an empty string if no item
11034 is selected.
11035 """
11036 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11037
11038 def Select(*args, **kwargs):
11039 """
11040 Select(self, int n)
11041
11042 This is the same as `SetSelection` and exists only because it is
11043 slightly more natural for controls which support multiple selection.
11044 """
11045 return _core_.ItemContainer_Select(*args, **kwargs)
11046
11047 def GetItems(self):
11048 """Return a list of the strings in the control"""
11049 return [self.GetString(i) for i in xrange(self.GetCount())]
11050
11051 def SetItems(self, items):
11052 """Clear and set the strings in the control from a list"""
11053 self.Clear()
11054 for i in items:
11055 self.Append(i)
11056
11057 Count = property(GetCount,doc="See `GetCount`")
11058 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11059 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11060 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11061 Strings = property(GetStrings,doc="See `GetStrings`")
11062 _core_.ItemContainer_swigregister(ItemContainer)
11063
11064 #---------------------------------------------------------------------------
11065
11066 class ControlWithItems(Control,ItemContainer):
11067 """
11068 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11069 wx.Control class, and is used for the base class of various controls
11070 that have items.
11071 """
11072 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11073 def __init__(self): raise AttributeError, "No constructor defined"
11074 __repr__ = _swig_repr
11075 _core_.ControlWithItems_swigregister(ControlWithItems)
11076
11077 #---------------------------------------------------------------------------
11078
11079 class SizerItem(Object):
11080 """
11081 The wx.SizerItem class is used to track the position, size and other
11082 attributes of each item managed by a `wx.Sizer`. It is not usually
11083 necessary to use this class because the sizer elements can also be
11084 identified by their positions or window or sizer references but
11085 sometimes it may be more convenient to use wx.SizerItem directly.
11086 Also, custom classes derived from `wx.PySizer` will probably need to
11087 use the collection of wx.SizerItems held by wx.Sizer when calculating
11088 layout.
11089
11090 :see: `wx.Sizer`, `wx.GBSizerItem`
11091 """
11092 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11093 __repr__ = _swig_repr
11094 def __init__(self, *args, **kwargs):
11095 """
11096 __init__(self) -> SizerItem
11097
11098 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11099 size will need to be set before this item can be used in a Sizer.
11100
11101 You will probably never need to create a wx.SizerItem directly as they
11102 are created automatically when the sizer's Add, Insert or Prepend
11103 methods are called.
11104
11105 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11106 """
11107 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11108 __swig_destroy__ = _core_.delete_SizerItem
11109 __del__ = lambda self : None;
11110 def DeleteWindows(*args, **kwargs):
11111 """
11112 DeleteWindows(self)
11113
11114 Destroy the window or the windows in a subsizer, depending on the type
11115 of item.
11116 """
11117 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11118
11119 def DetachSizer(*args, **kwargs):
11120 """
11121 DetachSizer(self)
11122
11123 Enable deleting the SizerItem without destroying the contained sizer.
11124 """
11125 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11126
11127 def GetSize(*args, **kwargs):
11128 """
11129 GetSize(self) -> Size
11130
11131 Get the current size of the item, as set in the last Layout.
11132 """
11133 return _core_.SizerItem_GetSize(*args, **kwargs)
11134
11135 def CalcMin(*args, **kwargs):
11136 """
11137 CalcMin(self) -> Size
11138
11139 Calculates the minimum desired size for the item, including any space
11140 needed by borders.
11141 """
11142 return _core_.SizerItem_CalcMin(*args, **kwargs)
11143
11144 def SetDimension(*args, **kwargs):
11145 """
11146 SetDimension(self, Point pos, Size size)
11147
11148 Set the position and size of the space allocated for this item by the
11149 sizer, and adjust the position and size of the item (window or
11150 subsizer) to be within that space taking alignment and borders into
11151 account.
11152 """
11153 return _core_.SizerItem_SetDimension(*args, **kwargs)
11154
11155 def GetMinSize(*args, **kwargs):
11156 """
11157 GetMinSize(self) -> Size
11158
11159 Get the minimum size needed for the item.
11160 """
11161 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11162
11163 def GetMinSizeWithBorder(*args, **kwargs):
11164 """
11165 GetMinSizeWithBorder(self) -> Size
11166
11167 Get the minimum size needed for the item with space for the borders
11168 added, if needed.
11169 """
11170 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11171
11172 def SetInitSize(*args, **kwargs):
11173 """SetInitSize(self, int x, int y)"""
11174 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11175
11176 def SetRatioWH(*args, **kwargs):
11177 """
11178 SetRatioWH(self, int width, int height)
11179
11180 Set the ratio item attribute.
11181 """
11182 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11183
11184 def SetRatioSize(*args, **kwargs):
11185 """
11186 SetRatioSize(self, Size size)
11187
11188 Set the ratio item attribute.
11189 """
11190 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11191
11192 def SetRatio(*args, **kwargs):
11193 """
11194 SetRatio(self, float ratio)
11195
11196 Set the ratio item attribute.
11197 """
11198 return _core_.SizerItem_SetRatio(*args, **kwargs)
11199
11200 def GetRatio(*args, **kwargs):
11201 """
11202 GetRatio(self) -> float
11203
11204 Set the ratio item attribute.
11205 """
11206 return _core_.SizerItem_GetRatio(*args, **kwargs)
11207
11208 def GetRect(*args, **kwargs):
11209 """
11210 GetRect(self) -> Rect
11211
11212 Returns the rectangle that the sizer item should occupy
11213 """
11214 return _core_.SizerItem_GetRect(*args, **kwargs)
11215
11216 def IsWindow(*args, **kwargs):
11217 """
11218 IsWindow(self) -> bool
11219
11220 Is this sizer item a window?
11221 """
11222 return _core_.SizerItem_IsWindow(*args, **kwargs)
11223
11224 def IsSizer(*args, **kwargs):
11225 """
11226 IsSizer(self) -> bool
11227
11228 Is this sizer item a subsizer?
11229 """
11230 return _core_.SizerItem_IsSizer(*args, **kwargs)
11231
11232 def IsSpacer(*args, **kwargs):
11233 """
11234 IsSpacer(self) -> bool
11235
11236 Is this sizer item a spacer?
11237 """
11238 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11239
11240 def SetProportion(*args, **kwargs):
11241 """
11242 SetProportion(self, int proportion)
11243
11244 Set the proportion value for this item.
11245 """
11246 return _core_.SizerItem_SetProportion(*args, **kwargs)
11247
11248 def GetProportion(*args, **kwargs):
11249 """
11250 GetProportion(self) -> int
11251
11252 Get the proportion value for this item.
11253 """
11254 return _core_.SizerItem_GetProportion(*args, **kwargs)
11255
11256 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11257 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11258 def SetFlag(*args, **kwargs):
11259 """
11260 SetFlag(self, int flag)
11261
11262 Set the flag value for this item.
11263 """
11264 return _core_.SizerItem_SetFlag(*args, **kwargs)
11265
11266 def GetFlag(*args, **kwargs):
11267 """
11268 GetFlag(self) -> int
11269
11270 Get the flag value for this item.
11271 """
11272 return _core_.SizerItem_GetFlag(*args, **kwargs)
11273
11274 def SetBorder(*args, **kwargs):
11275 """
11276 SetBorder(self, int border)
11277
11278 Set the border value for this item.
11279 """
11280 return _core_.SizerItem_SetBorder(*args, **kwargs)
11281
11282 def GetBorder(*args, **kwargs):
11283 """
11284 GetBorder(self) -> int
11285
11286 Get the border value for this item.
11287 """
11288 return _core_.SizerItem_GetBorder(*args, **kwargs)
11289
11290 def GetWindow(*args, **kwargs):
11291 """
11292 GetWindow(self) -> Window
11293
11294 Get the window (if any) that is managed by this sizer item.
11295 """
11296 return _core_.SizerItem_GetWindow(*args, **kwargs)
11297
11298 def SetWindow(*args, **kwargs):
11299 """
11300 SetWindow(self, Window window)
11301
11302 Set the window to be managed by this sizer item.
11303 """
11304 return _core_.SizerItem_SetWindow(*args, **kwargs)
11305
11306 def GetSizer(*args, **kwargs):
11307 """
11308 GetSizer(self) -> Sizer
11309
11310 Get the subsizer (if any) that is managed by this sizer item.
11311 """
11312 return _core_.SizerItem_GetSizer(*args, **kwargs)
11313
11314 def SetSizer(*args, **kwargs):
11315 """
11316 SetSizer(self, Sizer sizer)
11317
11318 Set the subsizer to be managed by this sizer item.
11319 """
11320 return _core_.SizerItem_SetSizer(*args, **kwargs)
11321
11322 def GetSpacer(*args, **kwargs):
11323 """
11324 GetSpacer(self) -> Size
11325
11326 Get the size of the spacer managed by this sizer item.
11327 """
11328 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11329
11330 def SetSpacer(*args, **kwargs):
11331 """
11332 SetSpacer(self, Size size)
11333
11334 Set the size of the spacer to be managed by this sizer item.
11335 """
11336 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11337
11338 def Show(*args, **kwargs):
11339 """
11340 Show(self, bool show)
11341
11342 Set the show item attribute, which sizers use to determine if the item
11343 is to be made part of the layout or not. If the item is tracking a
11344 window then it is shown or hidden as needed.
11345 """
11346 return _core_.SizerItem_Show(*args, **kwargs)
11347
11348 def IsShown(*args, **kwargs):
11349 """
11350 IsShown(self) -> bool
11351
11352 Is the item to be shown in the layout?
11353 """
11354 return _core_.SizerItem_IsShown(*args, **kwargs)
11355
11356 def GetPosition(*args, **kwargs):
11357 """
11358 GetPosition(self) -> Point
11359
11360 Returns the current position of the item, as set in the last Layout.
11361 """
11362 return _core_.SizerItem_GetPosition(*args, **kwargs)
11363
11364 def GetUserData(*args, **kwargs):
11365 """
11366 GetUserData(self) -> PyObject
11367
11368 Returns the userData associated with this sizer item, or None if there
11369 isn't any.
11370 """
11371 return _core_.SizerItem_GetUserData(*args, **kwargs)
11372
11373 def SetUserData(*args, **kwargs):
11374 """
11375 SetUserData(self, PyObject userData)
11376
11377 Associate a Python object with this sizer item.
11378 """
11379 return _core_.SizerItem_SetUserData(*args, **kwargs)
11380
11381 _core_.SizerItem_swigregister(SizerItem)
11382
11383 def SizerItemWindow(*args, **kwargs):
11384 """
11385 SizerItemWindow(Window window, int proportion, int flag, int border,
11386 PyObject userData=None) -> SizerItem
11387
11388 Constructs a `wx.SizerItem` for tracking a window.
11389 """
11390 val = _core_.new_SizerItemWindow(*args, **kwargs)
11391 return val
11392
11393 def SizerItemSpacer(*args, **kwargs):
11394 """
11395 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11396 PyObject userData=None) -> SizerItem
11397
11398 Constructs a `wx.SizerItem` for tracking a spacer.
11399 """
11400 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11401 return val
11402
11403 def SizerItemSizer(*args, **kwargs):
11404 """
11405 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11406 PyObject userData=None) -> SizerItem
11407
11408 Constructs a `wx.SizerItem` for tracking a subsizer
11409 """
11410 val = _core_.new_SizerItemSizer(*args, **kwargs)
11411 return val
11412
11413 class Sizer(Object):
11414 """
11415 wx.Sizer is the abstract base class used for laying out subwindows in
11416 a window. You cannot use wx.Sizer directly; instead, you will have to
11417 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11418 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11419 `wx.GridBagSizer`.
11420
11421 The concept implemented by sizers in wxWidgets is closely related to
11422 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11423 toolkit or the Qt toolkit. It is based upon the idea of the individual
11424 subwindows reporting their minimal required size and their ability to
11425 get stretched if the size of the parent window has changed. This will
11426 most often mean that the programmer does not set the original size of
11427 a dialog in the beginning, rather the dialog will assigned a sizer and
11428 this sizer will be queried about the recommended size. The sizer in
11429 turn will query its children, which can be normal windows or contorls,
11430 empty space or other sizers, so that a hierarchy of sizers can be
11431 constructed. Note that wxSizer does not derive from wxWindow and thus
11432 do not interfere with tab ordering and requires very little resources
11433 compared to a real window on screen.
11434
11435 What makes sizers so well fitted for use in wxWidgets is the fact that
11436 every control reports its own minimal size and the algorithm can
11437 handle differences in font sizes or different window (dialog item)
11438 sizes on different platforms without problems. If for example the
11439 standard font as well as the overall design of Mac widgets requires
11440 more space than on Windows, then the initial size of a dialog using a
11441 sizer will automatically be bigger on Mac than on Windows.
11442 """
11443 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11444 def __init__(self): raise AttributeError, "No constructor defined"
11445 __repr__ = _swig_repr
11446 __swig_destroy__ = _core_.delete_Sizer
11447 __del__ = lambda self : None;
11448 def _setOORInfo(*args, **kwargs):
11449 """_setOORInfo(self, PyObject _self)"""
11450 return _core_.Sizer__setOORInfo(*args, **kwargs)
11451
11452 def Add(*args, **kwargs):
11453 """
11454 Add(self, item, int proportion=0, int flag=0, int border=0,
11455 PyObject userData=None) -> wx.SizerItem
11456
11457 Appends a child item to the sizer.
11458 """
11459 return _core_.Sizer_Add(*args, **kwargs)
11460
11461 def Insert(*args, **kwargs):
11462 """
11463 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11464 PyObject userData=None) -> wx.SizerItem
11465
11466 Inserts a new item into the list of items managed by this sizer before
11467 the item at index *before*. See `Add` for a description of the parameters.
11468 """
11469 return _core_.Sizer_Insert(*args, **kwargs)
11470
11471 def Prepend(*args, **kwargs):
11472 """
11473 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11474 PyObject userData=None) -> wx.SizerItem
11475
11476 Adds a new item to the begining of the list of sizer items managed by
11477 this sizer. See `Add` for a description of the parameters.
11478 """
11479 return _core_.Sizer_Prepend(*args, **kwargs)
11480
11481 def Remove(*args, **kwargs):
11482 """
11483 Remove(self, item) -> bool
11484
11485 Removes an item from the sizer and destroys it. This method does not
11486 cause any layout or resizing to take place, call `Layout` to update
11487 the layout on screen after removing a child from the sizer. The
11488 *item* parameter can be either a window, a sizer, or the zero-based
11489 index of an item to remove. Returns True if the child item was found
11490 and removed.
11491 """
11492 return _core_.Sizer_Remove(*args, **kwargs)
11493
11494 def Detach(*args, **kwargs):
11495 """
11496 Detach(self, item) -> bool
11497
11498 Detaches an item from the sizer without destroying it. This method
11499 does not cause any layout or resizing to take place, call `Layout` to
11500 do so. The *item* parameter can be either a window, a sizer, or the
11501 zero-based index of the item to be detached. Returns True if the child item
11502 was found and detached.
11503 """
11504 return _core_.Sizer_Detach(*args, **kwargs)
11505
11506 def GetItem(*args, **kwargs):
11507 """
11508 GetItem(self, item) -> wx.SizerItem
11509
11510 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11511 parameter can be either a window, a sizer, or the zero-based index of
11512 the item to be found.
11513 """
11514 return _core_.Sizer_GetItem(*args, **kwargs)
11515
11516 def _SetItemMinSize(*args, **kwargs):
11517 """_SetItemMinSize(self, PyObject item, Size size)"""
11518 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11519
11520 def _ReplaceWin(*args, **kwargs):
11521 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11522 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11523
11524 def _ReplaceSizer(*args, **kwargs):
11525 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11526 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11527
11528 def _ReplaceItem(*args, **kwargs):
11529 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11530 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11531
11532 def Replace(self, olditem, item, recursive=False):
11533 """
11534 Detaches the given ``olditem`` from the sizer and replaces it with
11535 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11536 detached child is destroyed only if it is not a window, (because
11537 windows are owned by their parent, not the sizer.) The
11538 ``recursive`` parameter can be used to search for the given
11539 element recursivly in subsizers.
11540
11541 This method does not cause any layout or resizing to take place,
11542 call `Layout` to do so.
11543
11544 Returns ``True`` if the child item was found and removed.
11545 """
11546 if isinstance(olditem, wx.Window):
11547 return self._ReplaceWin(olditem, item, recursive)
11548 elif isinstnace(olditem, wx.Sizer):
11549 return self._ReplaceSizer(olditem, item, recursive)
11550 elif isinstnace(olditem, int):
11551 return self._ReplaceItem(olditem, item)
11552 else:
11553 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11554
11555 def SetContainingWindow(*args, **kwargs):
11556 """
11557 SetContainingWindow(self, Window window)
11558
11559 Set (or unset) the window this sizer is used in.
11560 """
11561 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11562
11563 def GetContainingWindow(*args, **kwargs):
11564 """
11565 GetContainingWindow(self) -> Window
11566
11567 Get the window this sizer is used in.
11568 """
11569 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11570
11571 def SetItemMinSize(self, item, *args):
11572 """
11573 SetItemMinSize(self, item, Size size)
11574
11575 Sets the minimum size that will be allocated for an item in the sizer.
11576 The *item* parameter can be either a window, a sizer, or the
11577 zero-based index of the item. If a window or sizer is given then it
11578 will be searched for recursivly in subsizers if neccessary.
11579 """
11580 if len(args) == 2:
11581 # for backward compatibility accept separate width,height args too
11582 return self._SetItemMinSize(item, args)
11583 else:
11584 return self._SetItemMinSize(item, args[0])
11585
11586 def AddItem(*args, **kwargs):
11587 """
11588 AddItem(self, SizerItem item)
11589
11590 Adds a `wx.SizerItem` to the sizer.
11591 """
11592 return _core_.Sizer_AddItem(*args, **kwargs)
11593
11594 def InsertItem(*args, **kwargs):
11595 """
11596 InsertItem(self, int index, SizerItem item)
11597
11598 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11599 """
11600 return _core_.Sizer_InsertItem(*args, **kwargs)
11601
11602 def PrependItem(*args, **kwargs):
11603 """
11604 PrependItem(self, SizerItem item)
11605
11606 Prepends a `wx.SizerItem` to the sizer.
11607 """
11608 return _core_.Sizer_PrependItem(*args, **kwargs)
11609
11610 def AddMany(self, items):
11611 """
11612 AddMany is a convenience method for adding several items
11613 to a sizer at one time. Simply pass it a list of tuples,
11614 where each tuple consists of the parameters that you
11615 would normally pass to the `Add` method.
11616 """
11617 for item in items:
11618 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11619 item = (item, )
11620 self.Add(*item)
11621
11622 # for backwards compatibility only, please do not use in new code
11623 def AddWindow(self, *args, **kw):
11624 """Compatibility alias for `Add`."""
11625 return self.Add(*args, **kw)
11626 def AddSizer(self, *args, **kw):
11627 """Compatibility alias for `Add`."""
11628 return self.Add(*args, **kw)
11629 def AddSpacer(self, *args, **kw):
11630 """Compatibility alias for `Add`."""
11631 return self.Add(*args, **kw)
11632
11633 def PrependWindow(self, *args, **kw):
11634 """Compatibility alias for `Prepend`."""
11635 return self.Prepend(*args, **kw)
11636 def PrependSizer(self, *args, **kw):
11637 """Compatibility alias for `Prepend`."""
11638 return self.Prepend(*args, **kw)
11639 def PrependSpacer(self, *args, **kw):
11640 """Compatibility alias for `Prepend`."""
11641 return self.Prepend(*args, **kw)
11642
11643 def InsertWindow(self, *args, **kw):
11644 """Compatibility alias for `Insert`."""
11645 return self.Insert(*args, **kw)
11646 def InsertSizer(self, *args, **kw):
11647 """Compatibility alias for `Insert`."""
11648 return self.Insert(*args, **kw)
11649 def InsertSpacer(self, *args, **kw):
11650 """Compatibility alias for `Insert`."""
11651 return self.Insert(*args, **kw)
11652
11653 def RemoveWindow(self, *args, **kw):
11654 """Compatibility alias for `Remove`."""
11655 return self.Remove(*args, **kw)
11656 def RemoveSizer(self, *args, **kw):
11657 """Compatibility alias for `Remove`."""
11658 return self.Remove(*args, **kw)
11659 def RemovePos(self, *args, **kw):
11660 """Compatibility alias for `Remove`."""
11661 return self.Remove(*args, **kw)
11662
11663
11664 def SetDimension(*args, **kwargs):
11665 """
11666 SetDimension(self, int x, int y, int width, int height)
11667
11668 Call this to force the sizer to take the given dimension and thus
11669 force the items owned by the sizer to resize themselves according to
11670 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11671 methods.
11672 """
11673 return _core_.Sizer_SetDimension(*args, **kwargs)
11674
11675 def SetMinSize(*args, **kwargs):
11676 """
11677 SetMinSize(self, Size size)
11678
11679 Call this to give the sizer a minimal size. Normally, the sizer will
11680 calculate its minimal size based purely on how much space its children
11681 need. After calling this method `GetMinSize` will return either the
11682 minimal size as requested by its children or the minimal size set
11683 here, depending on which is bigger.
11684 """
11685 return _core_.Sizer_SetMinSize(*args, **kwargs)
11686
11687 def GetSize(*args, **kwargs):
11688 """
11689 GetSize(self) -> Size
11690
11691 Returns the current size of the space managed by the sizer.
11692 """
11693 return _core_.Sizer_GetSize(*args, **kwargs)
11694
11695 def GetPosition(*args, **kwargs):
11696 """
11697 GetPosition(self) -> Point
11698
11699 Returns the current position of the sizer's managed space.
11700 """
11701 return _core_.Sizer_GetPosition(*args, **kwargs)
11702
11703 def GetMinSize(*args, **kwargs):
11704 """
11705 GetMinSize(self) -> Size
11706
11707 Returns the minimal size of the sizer. This is either the combined
11708 minimal size of all the children and their borders or the minimal size
11709 set by SetMinSize, depending on which is bigger.
11710 """
11711 return _core_.Sizer_GetMinSize(*args, **kwargs)
11712
11713 def GetSizeTuple(self):
11714 return self.GetSize().Get()
11715 def GetPositionTuple(self):
11716 return self.GetPosition().Get()
11717 def GetMinSizeTuple(self):
11718 return self.GetMinSize().Get()
11719
11720 def RecalcSizes(*args, **kwargs):
11721 """
11722 RecalcSizes(self)
11723
11724 Using the sizes calculated by `CalcMin` reposition and resize all the
11725 items managed by this sizer. You should not need to call this directly as
11726 it is called by `Layout`.
11727 """
11728 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11729
11730 def CalcMin(*args, **kwargs):
11731 """
11732 CalcMin(self) -> Size
11733
11734 This method is where the sizer will do the actual calculation of its
11735 children's minimal sizes. You should not need to call this directly as
11736 it is called by `Layout`.
11737 """
11738 return _core_.Sizer_CalcMin(*args, **kwargs)
11739
11740 def Layout(*args, **kwargs):
11741 """
11742 Layout(self)
11743
11744 This method will force the recalculation and layout of the items
11745 controlled by the sizer using the current space allocated to the
11746 sizer. Normally this is called automatically from the owning window's
11747 EVT_SIZE handler, but it is also useful to call it from user code when
11748 one of the items in a sizer change size, or items are added or
11749 removed.
11750 """
11751 return _core_.Sizer_Layout(*args, **kwargs)
11752
11753 def Fit(*args, **kwargs):
11754 """
11755 Fit(self, Window window) -> Size
11756
11757 Tell the sizer to resize the *window* to match the sizer's minimal
11758 size. This is commonly done in the constructor of the window itself in
11759 order to set its initial size to match the needs of the children as
11760 determined by the sizer. Returns the new size.
11761
11762 For a top level window this is the total window size, not the client size.
11763 """
11764 return _core_.Sizer_Fit(*args, **kwargs)
11765
11766 def FitInside(*args, **kwargs):
11767 """
11768 FitInside(self, Window window)
11769
11770 Tell the sizer to resize the *virtual size* of the *window* to match the
11771 sizer's minimal size. This will not alter the on screen size of the
11772 window, but may cause the addition/removal/alteration of scrollbars
11773 required to view the virtual area in windows which manage it.
11774
11775 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11776
11777 """
11778 return _core_.Sizer_FitInside(*args, **kwargs)
11779
11780 def SetSizeHints(*args, **kwargs):
11781 """
11782 SetSizeHints(self, Window window)
11783
11784 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11785 match the sizer's minimal size. This is commonly done in the
11786 constructor of the window itself if the window is resizable (as are
11787 many dialogs under Unix and frames on probably all platforms) in order
11788 to prevent the window from being sized smaller than the minimal size
11789 required by the sizer.
11790 """
11791 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11792
11793 def SetVirtualSizeHints(*args, **kwargs):
11794 """
11795 SetVirtualSizeHints(self, Window window)
11796
11797 Tell the sizer to set the minimal size of the window virtual area to
11798 match the sizer's minimal size. For windows with managed scrollbars
11799 this will set them appropriately.
11800
11801 :see: `wx.ScrolledWindow.SetScrollbars`
11802
11803 """
11804 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11805
11806 def Clear(*args, **kwargs):
11807 """
11808 Clear(self, bool deleteWindows=False)
11809
11810 Clear all items from the sizer, optionally destroying the window items
11811 as well.
11812 """
11813 return _core_.Sizer_Clear(*args, **kwargs)
11814
11815 def DeleteWindows(*args, **kwargs):
11816 """
11817 DeleteWindows(self)
11818
11819 Destroy all windows managed by the sizer.
11820 """
11821 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11822
11823 def GetChildren(*args, **kwargs):
11824 """
11825 GetChildren(self) -> list
11826
11827 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11828 """
11829 return _core_.Sizer_GetChildren(*args, **kwargs)
11830
11831 def Show(*args, **kwargs):
11832 """
11833 Show(self, item, bool show=True, bool recursive=false) -> bool
11834
11835 Shows or hides an item managed by the sizer. To make a sizer item
11836 disappear or reappear, use Show followed by `Layout`. The *item*
11837 parameter can be either a window, a sizer, or the zero-based index of
11838 the item. Use the recursive parameter to show or hide an item in a
11839 subsizer. Returns True if the item was found.
11840 """
11841 return _core_.Sizer_Show(*args, **kwargs)
11842
11843 def IsShown(*args, **kwargs):
11844 """
11845 IsShown(self, item)
11846
11847 Determines if the item is currently shown. To make a sizer
11848 item disappear or reappear, use Show followed by `Layout`. The *item*
11849 parameter can be either a window, a sizer, or the zero-based index of
11850 the item.
11851 """
11852 return _core_.Sizer_IsShown(*args, **kwargs)
11853
11854 def Hide(self, item, recursive=False):
11855 """
11856 A convenience method for `Show` (item, False, recursive).
11857 """
11858 return self.Show(item, False, recursive)
11859
11860 def ShowItems(*args, **kwargs):
11861 """
11862 ShowItems(self, bool show)
11863
11864 Recursively call `wx.SizerItem.Show` on all sizer items.
11865 """
11866 return _core_.Sizer_ShowItems(*args, **kwargs)
11867
11868 _core_.Sizer_swigregister(Sizer)
11869
11870 class PySizer(Sizer):
11871 """
11872 wx.PySizer is a special version of `wx.Sizer` that has been
11873 instrumented to allow the C++ virtual methods to be overloaded in
11874 Python derived classes. You would derive from this class if you are
11875 wanting to implement a custom sizer in Python code. Simply implement
11876 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11877 For example::
11878
11879 class MySizer(wx.PySizer):
11880 def __init__(self):
11881 wx.PySizer.__init__(self)
11882
11883 def CalcMin(self):
11884 for item in self.GetChildren():
11885 # calculate the total minimum width and height needed
11886 # by all items in the sizer according to this sizer's
11887 # layout algorithm.
11888 ...
11889 return wx.Size(width, height)
11890
11891 def RecalcSizes(self):
11892 # find the space allotted to this sizer
11893 pos = self.GetPosition()
11894 size = self.GetSize()
11895 for item in self.GetChildren():
11896 # Recalculate (if necessary) the position and size of
11897 # each item and then call item.SetDimension to do the
11898 # actual positioning and sizing of the items within the
11899 # space alloted to this sizer.
11900 ...
11901 item.SetDimension(itemPos, itemSize)
11902
11903
11904 When `Layout` is called it first calls `CalcMin` followed by
11905 `RecalcSizes` so you can optimize a bit by saving the results of
11906 `CalcMin` and reusing them in `RecalcSizes`.
11907
11908 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11909
11910
11911 """
11912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11913 __repr__ = _swig_repr
11914 def __init__(self, *args, **kwargs):
11915 """
11916 __init__(self) -> PySizer
11917
11918 Creates a wx.PySizer. Must be called from the __init__ in the derived
11919 class.
11920 """
11921 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11922 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11923
11924 def _setCallbackInfo(*args, **kwargs):
11925 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11926 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11927
11928 _core_.PySizer_swigregister(PySizer)
11929
11930 #---------------------------------------------------------------------------
11931
11932 class BoxSizer(Sizer):
11933 """
11934 The basic idea behind a box sizer is that windows will most often be
11935 laid out in rather simple basic geometry, typically in a row or a
11936 column or nested hierarchies of either. A wx.BoxSizer will lay out
11937 its items in a simple row or column, depending on the orientation
11938 parameter passed to the constructor.
11939 """
11940 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11941 __repr__ = _swig_repr
11942 def __init__(self, *args, **kwargs):
11943 """
11944 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11945
11946 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11947 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11948 sizer.
11949 """
11950 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11951 self._setOORInfo(self)
11952
11953 def GetOrientation(*args, **kwargs):
11954 """
11955 GetOrientation(self) -> int
11956
11957 Returns the current orientation of the sizer.
11958 """
11959 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11960
11961 def SetOrientation(*args, **kwargs):
11962 """
11963 SetOrientation(self, int orient)
11964
11965 Resets the orientation of the sizer.
11966 """
11967 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11968
11969 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
11970 _core_.BoxSizer_swigregister(BoxSizer)
11971
11972 #---------------------------------------------------------------------------
11973
11974 class StaticBoxSizer(BoxSizer):
11975 """
11976 wx.StaticBoxSizer derives from and functions identically to the
11977 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11978 manages. Note that this static box must be created separately and
11979 passed to the sizer constructor.
11980 """
11981 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11982 __repr__ = _swig_repr
11983 def __init__(self, *args, **kwargs):
11984 """
11985 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11986
11987 Constructor. It takes an associated static box and the orientation
11988 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11989 ``wx.HORIZONTAL``.
11990 """
11991 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11992 self._setOORInfo(self)
11993
11994 def GetStaticBox(*args, **kwargs):
11995 """
11996 GetStaticBox(self) -> StaticBox
11997
11998 Returns the static box associated with this sizer.
11999 """
12000 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12001
12002 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12003
12004 #---------------------------------------------------------------------------
12005
12006 class GridSizer(Sizer):
12007 """
12008 A grid sizer is a sizer which lays out its children in a
12009 two-dimensional table with all cells having the same size. In other
12010 words, the width of each cell within the grid is the width of the
12011 widest item added to the sizer and the height of each grid cell is the
12012 height of the tallest item. An optional vertical and/or horizontal
12013 gap between items can also be specified (in pixels.)
12014
12015 Items are placed in the cells of the grid in the order they are added,
12016 in row-major order. In other words, the first row is filled first,
12017 then the second, and so on until all items have been added. (If
12018 neccessary, additional rows will be added as items are added.) If you
12019 need to have greater control over the cells that items are placed in
12020 then use the `wx.GridBagSizer`.
12021
12022 """
12023 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12024 __repr__ = _swig_repr
12025 def __init__(self, *args, **kwargs):
12026 """
12027 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12028
12029 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12030 of columns and rows in the sizer - if either of the parameters is
12031 zero, it will be calculated to from the total number of children in
12032 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12033 define extra space between all children.
12034 """
12035 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
12036 self._setOORInfo(self)
12037
12038 def SetCols(*args, **kwargs):
12039 """
12040 SetCols(self, int cols)
12041
12042 Sets the number of columns in the sizer.
12043 """
12044 return _core_.GridSizer_SetCols(*args, **kwargs)
12045
12046 def SetRows(*args, **kwargs):
12047 """
12048 SetRows(self, int rows)
12049
12050 Sets the number of rows in the sizer.
12051 """
12052 return _core_.GridSizer_SetRows(*args, **kwargs)
12053
12054 def SetVGap(*args, **kwargs):
12055 """
12056 SetVGap(self, int gap)
12057
12058 Sets the vertical gap (in pixels) between the cells in the sizer.
12059 """
12060 return _core_.GridSizer_SetVGap(*args, **kwargs)
12061
12062 def SetHGap(*args, **kwargs):
12063 """
12064 SetHGap(self, int gap)
12065
12066 Sets the horizontal gap (in pixels) between cells in the sizer
12067 """
12068 return _core_.GridSizer_SetHGap(*args, **kwargs)
12069
12070 def GetCols(*args, **kwargs):
12071 """
12072 GetCols(self) -> int
12073
12074 Returns the number of columns in the sizer.
12075 """
12076 return _core_.GridSizer_GetCols(*args, **kwargs)
12077
12078 def GetRows(*args, **kwargs):
12079 """
12080 GetRows(self) -> int
12081
12082 Returns the number of rows in the sizer.
12083 """
12084 return _core_.GridSizer_GetRows(*args, **kwargs)
12085
12086 def GetVGap(*args, **kwargs):
12087 """
12088 GetVGap(self) -> int
12089
12090 Returns the vertical gap (in pixels) between the cells in the sizer.
12091 """
12092 return _core_.GridSizer_GetVGap(*args, **kwargs)
12093
12094 def GetHGap(*args, **kwargs):
12095 """
12096 GetHGap(self) -> int
12097
12098 Returns the horizontal gap (in pixels) between cells in the sizer.
12099 """
12100 return _core_.GridSizer_GetHGap(*args, **kwargs)
12101
12102 def CalcRowsCols(self):
12103 """
12104 CalcRowsCols() -> (rows, cols)
12105
12106 Calculates how many rows and columns will be in the sizer based
12107 on the current number of items and also the rows, cols specified
12108 in the constructor.
12109 """
12110 nitems = len(self.GetChildren())
12111 rows = self.GetRows()
12112 cols = self.GetCols()
12113 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12114 if cols != 0:
12115 rows = (nitems + cols - 1) / cols
12116 elif rows != 0:
12117 cols = (nitems + rows - 1) / rows
12118 return (rows, cols)
12119
12120 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12121 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12122 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12123 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
12124 _core_.GridSizer_swigregister(GridSizer)
12125
12126 #---------------------------------------------------------------------------
12127
12128 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12129 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12130 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12131 class FlexGridSizer(GridSizer):
12132 """
12133 A flex grid sizer is a sizer which lays out its children in a
12134 two-dimensional table with all table cells in one row having the same
12135 height and all cells in one column having the same width, but all
12136 rows or all columns are not necessarily the same height or width as in
12137 the `wx.GridSizer`.
12138
12139 wx.FlexGridSizer can also size items equally in one direction but
12140 unequally ("flexibly") in the other. If the sizer is only flexible
12141 in one direction (this can be changed using `SetFlexibleDirection`), it
12142 needs to be decided how the sizer should grow in the other ("non
12143 flexible") direction in order to fill the available space. The
12144 `SetNonFlexibleGrowMode` method serves this purpose.
12145
12146
12147 """
12148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12149 __repr__ = _swig_repr
12150 def __init__(self, *args, **kwargs):
12151 """
12152 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12153
12154 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12155 number of columns and rows in the sizer - if either of the parameters
12156 is zero, it will be calculated to from the total number of children in
12157 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12158 define extra space between all children.
12159 """
12160 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
12161 self._setOORInfo(self)
12162
12163 def AddGrowableRow(*args, **kwargs):
12164 """
12165 AddGrowableRow(self, size_t idx, int proportion=0)
12166
12167 Specifies that row *idx* (starting from zero) should be grown if there
12168 is extra space available to the sizer.
12169
12170 The *proportion* parameter has the same meaning as the stretch factor
12171 for the box sizers except that if all proportions are 0, then all
12172 columns are resized equally (instead of not being resized at all).
12173 """
12174 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12175
12176 def RemoveGrowableRow(*args, **kwargs):
12177 """
12178 RemoveGrowableRow(self, size_t idx)
12179
12180 Specifies that row *idx* is no longer growable.
12181 """
12182 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12183
12184 def AddGrowableCol(*args, **kwargs):
12185 """
12186 AddGrowableCol(self, size_t idx, int proportion=0)
12187
12188 Specifies that column *idx* (starting from zero) should be grown if
12189 there is extra space available to the sizer.
12190
12191 The *proportion* parameter has the same meaning as the stretch factor
12192 for the box sizers except that if all proportions are 0, then all
12193 columns are resized equally (instead of not being resized at all).
12194 """
12195 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12196
12197 def RemoveGrowableCol(*args, **kwargs):
12198 """
12199 RemoveGrowableCol(self, size_t idx)
12200
12201 Specifies that column *idx* is no longer growable.
12202 """
12203 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12204
12205 def SetFlexibleDirection(*args, **kwargs):
12206 """
12207 SetFlexibleDirection(self, int direction)
12208
12209 Specifies whether the sizer should flexibly resize its columns, rows,
12210 or both. Argument *direction* can be one of the following values. Any
12211 other value is ignored.
12212
12213 ============== =======================================
12214 wx.VERTICAL Rows are flexibly sized.
12215 wx.HORIZONTAL Columns are flexibly sized.
12216 wx.BOTH Both rows and columns are flexibly sized
12217 (this is the default value).
12218 ============== =======================================
12219
12220 Note that this method does not trigger relayout.
12221
12222 """
12223 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12224
12225 def GetFlexibleDirection(*args, **kwargs):
12226 """
12227 GetFlexibleDirection(self) -> int
12228
12229 Returns a value that specifies whether the sizer
12230 flexibly resizes its columns, rows, or both (default).
12231
12232 :see: `SetFlexibleDirection`
12233 """
12234 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12235
12236 def SetNonFlexibleGrowMode(*args, **kwargs):
12237 """
12238 SetNonFlexibleGrowMode(self, int mode)
12239
12240 Specifies how the sizer should grow in the non-flexible direction if
12241 there is one (so `SetFlexibleDirection` must have been called
12242 previously). Argument *mode* can be one of the following values:
12243
12244 ========================== =================================================
12245 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12246 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12247 `AddGrowableCol` and `AddGrowableRow`. In this
12248 case equal sizing applies to minimum sizes of
12249 columns or rows (this is the default value).
12250 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12251 the non flexible direction, whether they are
12252 growable or not in the flexbile direction.
12253 ========================== =================================================
12254
12255 Note that this method does not trigger relayout.
12256 """
12257 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12258
12259 def GetNonFlexibleGrowMode(*args, **kwargs):
12260 """
12261 GetNonFlexibleGrowMode(self) -> int
12262
12263 Returns the value that specifies how the sizer grows in the
12264 non-flexible direction if there is one.
12265
12266 :see: `SetNonFlexibleGrowMode`
12267 """
12268 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12269
12270 def GetRowHeights(*args, **kwargs):
12271 """
12272 GetRowHeights(self) -> list
12273
12274 Returns a list of integers representing the heights of each of the
12275 rows in the sizer.
12276 """
12277 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12278
12279 def GetColWidths(*args, **kwargs):
12280 """
12281 GetColWidths(self) -> list
12282
12283 Returns a list of integers representing the widths of each of the
12284 columns in the sizer.
12285 """
12286 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12287
12288 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12289 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12290 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12291 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
12292 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12293
12294 class StdDialogButtonSizer(BoxSizer):
12295 """
12296 A special sizer that knows how to order and position standard buttons
12297 in order to conform to the current platform's standards. You simply
12298 need to add each `wx.Button` to the sizer, and be sure to create the
12299 buttons using the standard ID's. Then call `Realize` and the sizer
12300 will take care of the rest.
12301
12302 """
12303 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12304 __repr__ = _swig_repr
12305 def __init__(self, *args, **kwargs):
12306 """__init__(self) -> StdDialogButtonSizer"""
12307 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12308 def AddButton(*args, **kwargs):
12309 """
12310 AddButton(self, wxButton button)
12311
12312 Use this to add the buttons to this sizer. Do not use the `Add`
12313 method in the base class.
12314 """
12315 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12316
12317 def Realize(*args, **kwargs):
12318 """
12319 Realize(self)
12320
12321 This funciton needs to be called after all the buttons have been added
12322 to the sizer. It will reorder them and position them in a platform
12323 specifc manner.
12324 """
12325 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12326
12327 def SetAffirmativeButton(*args, **kwargs):
12328 """SetAffirmativeButton(self, wxButton button)"""
12329 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12330
12331 def SetNegativeButton(*args, **kwargs):
12332 """SetNegativeButton(self, wxButton button)"""
12333 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12334
12335 def SetCancelButton(*args, **kwargs):
12336 """SetCancelButton(self, wxButton button)"""
12337 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12338
12339 def GetAffirmativeButton(*args, **kwargs):
12340 """GetAffirmativeButton(self) -> wxButton"""
12341 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12342
12343 def GetApplyButton(*args, **kwargs):
12344 """GetApplyButton(self) -> wxButton"""
12345 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12346
12347 def GetNegativeButton(*args, **kwargs):
12348 """GetNegativeButton(self) -> wxButton"""
12349 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12350
12351 def GetCancelButton(*args, **kwargs):
12352 """GetCancelButton(self) -> wxButton"""
12353 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12354
12355 def GetHelpButton(*args, **kwargs):
12356 """GetHelpButton(self) -> wxButton"""
12357 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12358
12359 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12360
12361 #---------------------------------------------------------------------------
12362
12363 class GBPosition(object):
12364 """
12365 This class represents the position of an item in a virtual grid of
12366 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12367 typemaps that will automatically convert from a 2-element sequence of
12368 integers to a wx.GBPosition, so you can use the more pythonic
12369 representation of the position nearly transparently in Python code.
12370 """
12371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12372 __repr__ = _swig_repr
12373 def __init__(self, *args, **kwargs):
12374 """
12375 __init__(self, int row=0, int col=0) -> GBPosition
12376
12377 This class represents the position of an item in a virtual grid of
12378 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12379 typemaps that will automatically convert from a 2-element sequence of
12380 integers to a wx.GBPosition, so you can use the more pythonic
12381 representation of the position nearly transparently in Python code.
12382 """
12383 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12384 __swig_destroy__ = _core_.delete_GBPosition
12385 __del__ = lambda self : None;
12386 def GetRow(*args, **kwargs):
12387 """GetRow(self) -> int"""
12388 return _core_.GBPosition_GetRow(*args, **kwargs)
12389
12390 def GetCol(*args, **kwargs):
12391 """GetCol(self) -> int"""
12392 return _core_.GBPosition_GetCol(*args, **kwargs)
12393
12394 def SetRow(*args, **kwargs):
12395 """SetRow(self, int row)"""
12396 return _core_.GBPosition_SetRow(*args, **kwargs)
12397
12398 def SetCol(*args, **kwargs):
12399 """SetCol(self, int col)"""
12400 return _core_.GBPosition_SetCol(*args, **kwargs)
12401
12402 def __eq__(*args, **kwargs):
12403 """
12404 __eq__(self, PyObject other) -> bool
12405
12406 Compare GBPosition for equality.
12407 """
12408 return _core_.GBPosition___eq__(*args, **kwargs)
12409
12410 def __ne__(*args, **kwargs):
12411 """
12412 __ne__(self, PyObject other) -> bool
12413
12414 Compare GBPosition for inequality.
12415 """
12416 return _core_.GBPosition___ne__(*args, **kwargs)
12417
12418 def Set(*args, **kwargs):
12419 """Set(self, int row=0, int col=0)"""
12420 return _core_.GBPosition_Set(*args, **kwargs)
12421
12422 def Get(*args, **kwargs):
12423 """Get(self) -> PyObject"""
12424 return _core_.GBPosition_Get(*args, **kwargs)
12425
12426 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12427 def __str__(self): return str(self.Get())
12428 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12429 def __len__(self): return len(self.Get())
12430 def __getitem__(self, index): return self.Get()[index]
12431 def __setitem__(self, index, val):
12432 if index == 0: self.SetRow(val)
12433 elif index == 1: self.SetCol(val)
12434 else: raise IndexError
12435 def __nonzero__(self): return self.Get() != (0,0)
12436 __safe_for_unpickling__ = True
12437 def __reduce__(self): return (wx.GBPosition, self.Get())
12438
12439 row = property(GetRow, SetRow)
12440 col = property(GetCol, SetCol)
12441
12442 _core_.GBPosition_swigregister(GBPosition)
12443
12444 class GBSpan(object):
12445 """
12446 This class is used to hold the row and column spanning attributes of
12447 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12448 automatically convert from a 2-element sequence of integers to a
12449 wx.GBSpan, so you can use the more pythonic representation of the span
12450 nearly transparently in Python code.
12451
12452 """
12453 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12454 __repr__ = _swig_repr
12455 def __init__(self, *args, **kwargs):
12456 """
12457 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12458
12459 Construct a new wxGBSpan, optionally setting the rowspan and
12460 colspan. The default is (1,1). (Meaning that the item occupies one
12461 cell in each direction.
12462 """
12463 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12464 __swig_destroy__ = _core_.delete_GBSpan
12465 __del__ = lambda self : None;
12466 def GetRowspan(*args, **kwargs):
12467 """GetRowspan(self) -> int"""
12468 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12469
12470 def GetColspan(*args, **kwargs):
12471 """GetColspan(self) -> int"""
12472 return _core_.GBSpan_GetColspan(*args, **kwargs)
12473
12474 def SetRowspan(*args, **kwargs):
12475 """SetRowspan(self, int rowspan)"""
12476 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12477
12478 def SetColspan(*args, **kwargs):
12479 """SetColspan(self, int colspan)"""
12480 return _core_.GBSpan_SetColspan(*args, **kwargs)
12481
12482 def __eq__(*args, **kwargs):
12483 """
12484 __eq__(self, PyObject other) -> bool
12485
12486 Compare wxGBSpan for equality.
12487 """
12488 return _core_.GBSpan___eq__(*args, **kwargs)
12489
12490 def __ne__(*args, **kwargs):
12491 """
12492 __ne__(self, PyObject other) -> bool
12493
12494 Compare GBSpan for inequality.
12495 """
12496 return _core_.GBSpan___ne__(*args, **kwargs)
12497
12498 def Set(*args, **kwargs):
12499 """Set(self, int rowspan=1, int colspan=1)"""
12500 return _core_.GBSpan_Set(*args, **kwargs)
12501
12502 def Get(*args, **kwargs):
12503 """Get(self) -> PyObject"""
12504 return _core_.GBSpan_Get(*args, **kwargs)
12505
12506 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12507 def __str__(self): return str(self.Get())
12508 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12509 def __len__(self): return len(self.Get())
12510 def __getitem__(self, index): return self.Get()[index]
12511 def __setitem__(self, index, val):
12512 if index == 0: self.SetRowspan(val)
12513 elif index == 1: self.SetColspan(val)
12514 else: raise IndexError
12515 def __nonzero__(self): return self.Get() != (0,0)
12516 __safe_for_unpickling__ = True
12517 def __reduce__(self): return (wx.GBSpan, self.Get())
12518
12519 rowspan = property(GetRowspan, SetRowspan)
12520 colspan = property(GetColspan, SetColspan)
12521
12522 _core_.GBSpan_swigregister(GBSpan)
12523
12524 class GBSizerItem(SizerItem):
12525 """
12526 The wx.GBSizerItem class is used to track the additional data about
12527 items in a `wx.GridBagSizer` such as the item's position in the grid
12528 and how many rows or columns it spans.
12529
12530 """
12531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12532 __repr__ = _swig_repr
12533 def __init__(self, *args, **kwargs):
12534 """
12535 __init__(self) -> GBSizerItem
12536
12537 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12538 size will need to be set, as well as a position and span before this
12539 item can be used in a Sizer.
12540
12541 You will probably never need to create a wx.GBSizerItem directly as they
12542 are created automatically when the sizer's Add method is called.
12543 """
12544 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12545 __swig_destroy__ = _core_.delete_GBSizerItem
12546 __del__ = lambda self : None;
12547 def GetPos(*args, **kwargs):
12548 """
12549 GetPos(self) -> GBPosition
12550
12551 Get the grid position of the item
12552 """
12553 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12554
12555 def GetPosTuple(self): return self.GetPos().Get()
12556 def GetSpan(*args, **kwargs):
12557 """
12558 GetSpan(self) -> GBSpan
12559
12560 Get the row and column spanning of the item
12561 """
12562 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12563
12564 def GetSpanTuple(self): return self.GetSpan().Get()
12565 def SetPos(*args, **kwargs):
12566 """
12567 SetPos(self, GBPosition pos) -> bool
12568
12569 If the item is already a member of a sizer then first ensure that
12570 there is no other item that would intersect with this one at the new
12571 position, then set the new position. Returns True if the change is
12572 successful and after the next Layout() the item will be moved.
12573 """
12574 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12575
12576 def SetSpan(*args, **kwargs):
12577 """
12578 SetSpan(self, GBSpan span) -> bool
12579
12580 If the item is already a member of a sizer then first ensure that
12581 there is no other item that would intersect with this one with its new
12582 spanning size, then set the new spanning. Returns True if the change
12583 is successful and after the next Layout() the item will be resized.
12584
12585 """
12586 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12587
12588 def Intersects(*args, **kwargs):
12589 """
12590 Intersects(self, GBSizerItem other) -> bool
12591
12592 Returns True if this item and the other item instersect.
12593 """
12594 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12595
12596 def IntersectsPos(*args, **kwargs):
12597 """
12598 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12599
12600 Returns True if the given pos/span would intersect with this item.
12601 """
12602 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12603
12604 def GetEndPos(*args, **kwargs):
12605 """
12606 GetEndPos(self) -> GBPosition
12607
12608 Get the row and column of the endpoint of this item.
12609 """
12610 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12611
12612 def GetGBSizer(*args, **kwargs):
12613 """
12614 GetGBSizer(self) -> GridBagSizer
12615
12616 Get the sizer this item is a member of.
12617 """
12618 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12619
12620 def SetGBSizer(*args, **kwargs):
12621 """
12622 SetGBSizer(self, GridBagSizer sizer)
12623
12624 Set the sizer this item is a member of.
12625 """
12626 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12627
12628 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12629 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12630 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12631 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
12632 _core_.GBSizerItem_swigregister(GBSizerItem)
12633 DefaultSpan = cvar.DefaultSpan
12634
12635 def GBSizerItemWindow(*args, **kwargs):
12636 """
12637 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12638 int border, PyObject userData=None) -> GBSizerItem
12639
12640 Construct a `wx.GBSizerItem` for a window.
12641 """
12642 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12643 return val
12644
12645 def GBSizerItemSizer(*args, **kwargs):
12646 """
12647 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12648 int border, PyObject userData=None) -> GBSizerItem
12649
12650 Construct a `wx.GBSizerItem` for a sizer
12651 """
12652 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12653 return val
12654
12655 def GBSizerItemSpacer(*args, **kwargs):
12656 """
12657 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12658 int flag, int border, PyObject userData=None) -> GBSizerItem
12659
12660 Construct a `wx.GBSizerItem` for a spacer.
12661 """
12662 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12663 return val
12664
12665 class GridBagSizer(FlexGridSizer):
12666 """
12667 A `wx.Sizer` that can lay out items in a virtual grid like a
12668 `wx.FlexGridSizer` but in this case explicit positioning of the items
12669 is allowed using `wx.GBPosition`, and items can optionally span more
12670 than one row and/or column using `wx.GBSpan`. The total size of the
12671 virtual grid is determined by the largest row and column that items are
12672 positioned at, adjusted for spanning.
12673
12674 """
12675 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12676 __repr__ = _swig_repr
12677 def __init__(self, *args, **kwargs):
12678 """
12679 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12680
12681 Constructor, with optional parameters to specify the gap between the
12682 rows and columns.
12683 """
12684 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12685 self._setOORInfo(self)
12686
12687 def Add(*args, **kwargs):
12688 """
12689 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12690 int border=0, userData=None) -> wx.GBSizerItem
12691
12692 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12693 more than one row or column as specified with *span*. The remaining
12694 args behave similarly to `wx.Sizer.Add`.
12695
12696 Returns True if the item was successfully placed at the given cell
12697 position, False if something was already there.
12698
12699 """
12700 return _core_.GridBagSizer_Add(*args, **kwargs)
12701
12702 def AddItem(*args, **kwargs):
12703 """
12704 Add(self, GBSizerItem item) -> wx.GBSizerItem
12705
12706 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12707 the item was successfully placed at its given cell position, False if
12708 something was already there.
12709 """
12710 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12711
12712 def GetCellSize(*args, **kwargs):
12713 """
12714 GetCellSize(self, int row, int col) -> Size
12715
12716 Get the size of the specified cell, including hgap and
12717 vgap. Only valid after a Layout.
12718 """
12719 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12720
12721 def GetEmptyCellSize(*args, **kwargs):
12722 """
12723 GetEmptyCellSize(self) -> Size
12724
12725 Get the size used for cells in the grid with no item.
12726 """
12727 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12728
12729 def SetEmptyCellSize(*args, **kwargs):
12730 """
12731 SetEmptyCellSize(self, Size sz)
12732
12733 Set the size used for cells in the grid with no item.
12734 """
12735 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12736
12737 def GetItemPosition(*args):
12738 """
12739 GetItemPosition(self, item) -> GBPosition
12740
12741 Get the grid position of the specified *item* where *item* is either a
12742 window or subsizer that is a member of this sizer, or a zero-based
12743 index of an item.
12744 """
12745 return _core_.GridBagSizer_GetItemPosition(*args)
12746
12747 def SetItemPosition(*args):
12748 """
12749 SetItemPosition(self, item, GBPosition pos) -> bool
12750
12751 Set the grid position of the specified *item* where *item* is either a
12752 window or subsizer that is a member of this sizer, or a zero-based
12753 index of an item. Returns True on success. If the move is not
12754 allowed (because an item is already there) then False is returned.
12755
12756 """
12757 return _core_.GridBagSizer_SetItemPosition(*args)
12758
12759 def GetItemSpan(*args):
12760 """
12761 GetItemSpan(self, item) -> GBSpan
12762
12763 Get the row/col spanning of the specified *item* where *item* is
12764 either a window or subsizer that is a member of this sizer, or a
12765 zero-based index of an item.
12766 """
12767 return _core_.GridBagSizer_GetItemSpan(*args)
12768
12769 def SetItemSpan(*args):
12770 """
12771 SetItemSpan(self, item, GBSpan span) -> bool
12772
12773 Set the row/col spanning of the specified *item* where *item* is
12774 either a window or subsizer that is a member of this sizer, or a
12775 zero-based index of an item. Returns True on success. If the move is
12776 not allowed (because an item is already there) then False is returned.
12777 """
12778 return _core_.GridBagSizer_SetItemSpan(*args)
12779
12780 def FindItem(*args):
12781 """
12782 FindItem(self, item) -> GBSizerItem
12783
12784 Find the sizer item for the given window or subsizer, returns None if
12785 not found. (non-recursive)
12786 """
12787 return _core_.GridBagSizer_FindItem(*args)
12788
12789 def FindItemAtPosition(*args, **kwargs):
12790 """
12791 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12792
12793 Return the sizer item for the given grid cell, or None if there is no
12794 item at that position. (non-recursive)
12795 """
12796 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12797
12798 def FindItemAtPoint(*args, **kwargs):
12799 """
12800 FindItemAtPoint(self, Point pt) -> GBSizerItem
12801
12802 Return the sizer item located at the point given in *pt*, or None if
12803 there is no item at that point. The (x,y) coordinates in pt correspond
12804 to the client coordinates of the window using the sizer for
12805 layout. (non-recursive)
12806 """
12807 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12808
12809 def CheckForIntersection(*args, **kwargs):
12810 """
12811 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12812
12813 Look at all items and see if any intersect (or would overlap) the
12814 given *item*. Returns True if so, False if there would be no overlap.
12815 If an *excludeItem* is given then it will not be checked for
12816 intersection, for example it may be the item we are checking the
12817 position of.
12818
12819 """
12820 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12821
12822 def CheckForIntersectionPos(*args, **kwargs):
12823 """
12824 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12825
12826 Look at all items and see if any intersect (or would overlap) the
12827 given position and span. Returns True if so, False if there would be
12828 no overlap. If an *excludeItem* is given then it will not be checked
12829 for intersection, for example it may be the item we are checking the
12830 position of.
12831 """
12832 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12833
12834 _core_.GridBagSizer_swigregister(GridBagSizer)
12835
12836 #---------------------------------------------------------------------------
12837
12838 Left = _core_.Left
12839 Top = _core_.Top
12840 Right = _core_.Right
12841 Bottom = _core_.Bottom
12842 Width = _core_.Width
12843 Height = _core_.Height
12844 Centre = _core_.Centre
12845 Center = _core_.Center
12846 CentreX = _core_.CentreX
12847 CentreY = _core_.CentreY
12848 Unconstrained = _core_.Unconstrained
12849 AsIs = _core_.AsIs
12850 PercentOf = _core_.PercentOf
12851 Above = _core_.Above
12852 Below = _core_.Below
12853 LeftOf = _core_.LeftOf
12854 RightOf = _core_.RightOf
12855 SameAs = _core_.SameAs
12856 Absolute = _core_.Absolute
12857 class IndividualLayoutConstraint(Object):
12858 """
12859 Objects of this class are stored in the `wx.LayoutConstraints` class as
12860 one of eight possible constraints that a window can be involved in.
12861 You will never need to create an instance of
12862 wx.IndividualLayoutConstraint, rather you should create a
12863 `wx.LayoutConstraints` instance and use the individual contstraints
12864 that it contains.
12865 """
12866 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12867 def __init__(self): raise AttributeError, "No constructor defined"
12868 __repr__ = _swig_repr
12869 def Set(*args, **kwargs):
12870 """
12871 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12872
12873 Sets the properties of the constraint. Normally called by one of the
12874 convenience functions such as Above, RightOf, SameAs.
12875 """
12876 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12877
12878 def LeftOf(*args, **kwargs):
12879 """
12880 LeftOf(self, Window sibling, int marg=0)
12881
12882 Constrains this edge to be to the left of the given window, with an
12883 optional margin. Implicitly, this is relative to the left edge of the
12884 other window.
12885 """
12886 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12887
12888 def RightOf(*args, **kwargs):
12889 """
12890 RightOf(self, Window sibling, int marg=0)
12891
12892 Constrains this edge to be to the right of the given window, with an
12893 optional margin. Implicitly, this is relative to the right edge of the
12894 other window.
12895 """
12896 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12897
12898 def Above(*args, **kwargs):
12899 """
12900 Above(self, Window sibling, int marg=0)
12901
12902 Constrains this edge to be above the given window, with an optional
12903 margin. Implicitly, this is relative to the top edge of the other
12904 window.
12905 """
12906 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12907
12908 def Below(*args, **kwargs):
12909 """
12910 Below(self, Window sibling, int marg=0)
12911
12912 Constrains this edge to be below the given window, with an optional
12913 margin. Implicitly, this is relative to the bottom edge of the other
12914 window.
12915 """
12916 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12917
12918 def SameAs(*args, **kwargs):
12919 """
12920 SameAs(self, Window otherW, int edge, int marg=0)
12921
12922 Constrains this edge or dimension to be to the same as the edge of the
12923 given window, with an optional margin.
12924 """
12925 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12926
12927 def PercentOf(*args, **kwargs):
12928 """
12929 PercentOf(self, Window otherW, int wh, int per)
12930
12931 Constrains this edge or dimension to be to a percentage of the given
12932 window, with an optional margin.
12933 """
12934 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12935
12936 def Absolute(*args, **kwargs):
12937 """
12938 Absolute(self, int val)
12939
12940 Constrains this edge or dimension to be the given absolute value.
12941 """
12942 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12943
12944 def Unconstrained(*args, **kwargs):
12945 """
12946 Unconstrained(self)
12947
12948 Sets this edge or dimension to be unconstrained, that is, dependent on
12949 other edges and dimensions from which this value can be deduced.
12950 """
12951 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12952
12953 def AsIs(*args, **kwargs):
12954 """
12955 AsIs(self)
12956
12957 Sets this edge or constraint to be whatever the window's value is at
12958 the moment. If either of the width and height constraints are *as is*,
12959 the window will not be resized, but moved instead. This is important
12960 when considering panel items which are intended to have a default
12961 size, such as a button, which may take its size from the size of the
12962 button label.
12963 """
12964 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12965
12966 def GetOtherWindow(*args, **kwargs):
12967 """GetOtherWindow(self) -> Window"""
12968 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12969
12970 def GetMyEdge(*args, **kwargs):
12971 """GetMyEdge(self) -> int"""
12972 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12973
12974 def SetEdge(*args, **kwargs):
12975 """SetEdge(self, int which)"""
12976 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12977
12978 def SetValue(*args, **kwargs):
12979 """SetValue(self, int v)"""
12980 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12981
12982 def GetMargin(*args, **kwargs):
12983 """GetMargin(self) -> int"""
12984 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12985
12986 def SetMargin(*args, **kwargs):
12987 """SetMargin(self, int m)"""
12988 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12989
12990 def GetValue(*args, **kwargs):
12991 """GetValue(self) -> int"""
12992 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12993
12994 def GetPercent(*args, **kwargs):
12995 """GetPercent(self) -> int"""
12996 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12997
12998 def GetOtherEdge(*args, **kwargs):
12999 """GetOtherEdge(self) -> int"""
13000 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13001
13002 def GetDone(*args, **kwargs):
13003 """GetDone(self) -> bool"""
13004 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13005
13006 def SetDone(*args, **kwargs):
13007 """SetDone(self, bool d)"""
13008 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13009
13010 def GetRelationship(*args, **kwargs):
13011 """GetRelationship(self) -> int"""
13012 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13013
13014 def SetRelationship(*args, **kwargs):
13015 """SetRelationship(self, int r)"""
13016 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13017
13018 def ResetIfWin(*args, **kwargs):
13019 """
13020 ResetIfWin(self, Window otherW) -> bool
13021
13022 Reset constraint if it mentions otherWin
13023 """
13024 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13025
13026 def SatisfyConstraint(*args, **kwargs):
13027 """
13028 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13029
13030 Try to satisfy constraint
13031 """
13032 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13033
13034 def GetEdge(*args, **kwargs):
13035 """
13036 GetEdge(self, int which, Window thisWin, Window other) -> int
13037
13038 Get the value of this edge or dimension, or if this
13039 is not determinable, -1.
13040 """
13041 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13042
13043 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13044 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13045 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13046 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13047 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13048 Percent = property(GetPercent,doc="See `GetPercent`")
13049 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13050 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
13051 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
13052
13053 class LayoutConstraints(Object):
13054 """
13055 **Note:** constraints are now deprecated and you should use sizers
13056 instead.
13057
13058 Objects of this class can be associated with a window to define its
13059 layout constraints, with respect to siblings or its parent.
13060
13061 The class consists of the following eight constraints of class
13062 wx.IndividualLayoutConstraint, some or all of which should be accessed
13063 directly to set the appropriate constraints.
13064
13065 * left: represents the left hand edge of the window
13066 * right: represents the right hand edge of the window
13067 * top: represents the top edge of the window
13068 * bottom: represents the bottom edge of the window
13069 * width: represents the width of the window
13070 * height: represents the height of the window
13071 * centreX: represents the horizontal centre point of the window
13072 * centreY: represents the vertical centre point of the window
13073
13074 Most constraints are initially set to have the relationship
13075 wxUnconstrained, which means that their values should be calculated by
13076 looking at known constraints. The exceptions are width and height,
13077 which are set to wxAsIs to ensure that if the user does not specify a
13078 constraint, the existing width and height will be used, to be
13079 compatible with panel items which often have take a default size. If
13080 the constraint is ``wx.AsIs``, the dimension will not be changed.
13081
13082 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13083
13084 """
13085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13086 __repr__ = _swig_repr
13087 left = property(_core_.LayoutConstraints_left_get)
13088 top = property(_core_.LayoutConstraints_top_get)
13089 right = property(_core_.LayoutConstraints_right_get)
13090 bottom = property(_core_.LayoutConstraints_bottom_get)
13091 width = property(_core_.LayoutConstraints_width_get)
13092 height = property(_core_.LayoutConstraints_height_get)
13093 centreX = property(_core_.LayoutConstraints_centreX_get)
13094 centreY = property(_core_.LayoutConstraints_centreY_get)
13095 def __init__(self, *args, **kwargs):
13096 """__init__(self) -> LayoutConstraints"""
13097 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13098 __swig_destroy__ = _core_.delete_LayoutConstraints
13099 __del__ = lambda self : None;
13100 def SatisfyConstraints(*args, **kwargs):
13101 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13102 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13103
13104 def AreSatisfied(*args, **kwargs):
13105 """AreSatisfied(self) -> bool"""
13106 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13107
13108 _core_.LayoutConstraints_swigregister(LayoutConstraints)
13109
13110 #----------------------------------------------------------------------------
13111
13112 # Use Python's bool constants if available, make some if not
13113 try:
13114 True
13115 except NameError:
13116 __builtins__.True = 1==1
13117 __builtins__.False = 1==0
13118 def bool(value): return not not value
13119 __builtins__.bool = bool
13120
13121
13122
13123 # workarounds for bad wxRTTI names
13124 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13125 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13126 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13127
13128
13129 #----------------------------------------------------------------------------
13130 # Load version numbers from __version__... Ensure that major and minor
13131 # versions are the same for both wxPython and wxWidgets.
13132
13133 from __version__ import *
13134 __version__ = VERSION_STRING
13135
13136 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13137 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
13138 if RELEASE_VERSION != _core_.RELEASE_VERSION:
13139 import warnings
13140 warnings.warn("wxPython/wxWidgets release number mismatch")
13141
13142 #----------------------------------------------------------------------------
13143
13144 # Set wxPython's default string<-->unicode conversion encoding from
13145 # the locale, but only if Python's default hasn't been changed. (We
13146 # assume that if the user has customized it already then that is the
13147 # encoding we need to use as well.)
13148 #
13149 # The encoding selected here is used when string or unicode objects
13150 # need to be converted in order to pass them to wxWidgets. Please be
13151 # aware that the default encoding within the same locale may be
13152 # slightly different on different platforms. For example, please see
13153 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13154 # between the common latin/roman encodings.
13155
13156 default = _sys.getdefaultencoding()
13157 if default == 'ascii':
13158 import locale
13159 import codecs
13160 try:
13161 default = locale.getdefaultlocale()[1]
13162 codecs.lookup(default)
13163 except (ValueError, LookupError, TypeError):
13164 default = _sys.getdefaultencoding()
13165 del locale
13166 del codecs
13167 if default:
13168 wx.SetDefaultPyEncoding(default)
13169 del default
13170
13171 #----------------------------------------------------------------------------
13172
13173 class PyDeadObjectError(AttributeError):
13174 pass
13175
13176 class _wxPyDeadObject(object):
13177 """
13178 Instances of wx objects that are OOR capable will have their __class__
13179 changed to this class when the C++ object is deleted. This should help
13180 prevent crashes due to referencing a bogus C++ pointer.
13181 """
13182 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13183 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13184
13185 def __repr__(self):
13186 if not hasattr(self, "_name"):
13187 self._name = "[unknown]"
13188 return self.reprStr % self._name
13189
13190 def __getattr__(self, *args):
13191 if not hasattr(self, "_name"):
13192 self._name = "[unknown]"
13193 raise PyDeadObjectError(self.attrStr % self._name)
13194
13195 def __nonzero__(self):
13196 return 0
13197
13198
13199
13200 class PyUnbornObjectError(AttributeError):
13201 pass
13202
13203 class _wxPyUnbornObject(object):
13204 """
13205 Some stock objects are created when the wx._core module is
13206 imported, but their C++ instance is not created until the wx.App
13207 object is created and initialized. These object instances will
13208 temporarily have their __class__ changed to this class so an
13209 exception will be raised if they are used before the C++ instance
13210 is ready.
13211 """
13212
13213 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13214 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13215
13216 def __repr__(self):
13217 #if not hasattr(self, "_name"):
13218 # self._name = "[unknown]"
13219 return self.reprStr #% self._name
13220
13221 def __getattr__(self, *args):
13222 #if not hasattr(self, "_name"):
13223 # self._name = "[unknown]"
13224 raise PyUnbornObjectError(self.attrStr) # % self._name )
13225
13226 def __nonzero__(self):
13227 return 0
13228
13229
13230 #----------------------------------------------------------------------------
13231
13232 def CallAfter(callable, *args, **kw):
13233 """
13234 Call the specified function after the current and pending event
13235 handlers have been completed. This is also good for making GUI
13236 method calls from non-GUI threads. Any extra positional or
13237 keyword args are passed on to the callable when it is called.
13238
13239 :see: `wx.FutureCall`
13240 """
13241 app = wx.GetApp()
13242 assert app is not None, 'No wx.App created yet'
13243
13244 if not hasattr(app, "_CallAfterId"):
13245 app._CallAfterId = wx.NewEventType()
13246 app.Connect(-1, -1, app._CallAfterId,
13247 lambda event: event.callable(*event.args, **event.kw) )
13248 evt = wx.PyEvent()
13249 evt.SetEventType(app._CallAfterId)
13250 evt.callable = callable
13251 evt.args = args
13252 evt.kw = kw
13253 wx.PostEvent(app, evt)
13254
13255 #----------------------------------------------------------------------------
13256
13257
13258 class FutureCall:
13259 """
13260 A convenience class for `wx.Timer`, that calls the given callable
13261 object once after the given amount of milliseconds, passing any
13262 positional or keyword args. The return value of the callable is
13263 availbale after it has been run with the `GetResult` method.
13264
13265 If you don't need to get the return value or restart the timer
13266 then there is no need to hold a reference to this object. It will
13267 hold a reference to itself while the timer is running (the timer
13268 has a reference to self.Notify) but the cycle will be broken when
13269 the timer completes, automatically cleaning up the wx.FutureCall
13270 object.
13271
13272 :see: `wx.CallAfter`
13273 """
13274 def __init__(self, millis, callable, *args, **kwargs):
13275 self.millis = millis
13276 self.callable = callable
13277 self.SetArgs(*args, **kwargs)
13278 self.runCount = 0
13279 self.running = False
13280 self.hasRun = False
13281 self.result = None
13282 self.timer = None
13283 self.Start()
13284
13285 def __del__(self):
13286 self.Stop()
13287
13288
13289 def Start(self, millis=None, *args, **kwargs):
13290 """
13291 (Re)start the timer
13292 """
13293 self.hasRun = False
13294 if millis is not None:
13295 self.millis = millis
13296 if args or kwargs:
13297 self.SetArgs(*args, **kwargs)
13298 self.Stop()
13299 self.timer = wx.PyTimer(self.Notify)
13300 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13301 self.running = True
13302 Restart = Start
13303
13304
13305 def Stop(self):
13306 """
13307 Stop and destroy the timer.
13308 """
13309 if self.timer is not None:
13310 self.timer.Stop()
13311 self.timer = None
13312
13313
13314 def GetInterval(self):
13315 if self.timer is not None:
13316 return self.timer.GetInterval()
13317 else:
13318 return 0
13319
13320
13321 def IsRunning(self):
13322 return self.timer is not None and self.timer.IsRunning()
13323
13324
13325 def SetArgs(self, *args, **kwargs):
13326 """
13327 (Re)set the args passed to the callable object. This is
13328 useful in conjunction with Restart if you want to schedule a
13329 new call to the same callable object but with different
13330 parameters.
13331 """
13332 self.args = args
13333 self.kwargs = kwargs
13334
13335
13336 def HasRun(self):
13337 return self.hasRun
13338
13339 def GetResult(self):
13340 return self.result
13341
13342 def Notify(self):
13343 """
13344 The timer has expired so call the callable.
13345 """
13346 if self.callable and getattr(self.callable, 'im_self', True):
13347 self.runCount += 1
13348 self.running = False
13349 self.result = self.callable(*self.args, **self.kwargs)
13350 self.hasRun = True
13351 if not self.running:
13352 # if it wasn't restarted, then cleanup
13353 wx.CallAfter(self.Stop)
13354
13355 Interval = property(GetInterval)
13356 Result = property(GetResult)
13357
13358
13359 #----------------------------------------------------------------------------
13360 # Control which items in this module should be documented by epydoc.
13361 # We allow only classes and functions, which will help reduce the size
13362 # of the docs by filtering out the zillions of constants, EVT objects,
13363 # and etc that don't make much sense by themselves, but are instead
13364 # documented (or will be) as part of the classes/functions/methods
13365 # where they should be used.
13366
13367 class __DocFilter:
13368 """
13369 A filter for epydoc that only allows non-Ptr classes and
13370 functions, in order to reduce the clutter in the API docs.
13371 """
13372 def __init__(self, globals):
13373 self._globals = globals
13374
13375 def __call__(self, name):
13376 import types
13377 obj = self._globals.get(name, None)
13378
13379 # only document classes and function
13380 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13381 return False
13382
13383 # skip other things that are private or will be documented as part of somethign else
13384 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13385 return False
13386
13387 # skip functions that are duplicates of static functions in a class
13388 if name.find('_') != -1:
13389 cls = self._globals.get(name.split('_')[0], None)
13390 methname = name.split('_')[1]
13391 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13392 return False
13393
13394 return True
13395
13396 #----------------------------------------------------------------------------
13397 #----------------------------------------------------------------------------
13398
13399 # Import other modules in this package that should show up in the
13400 # "core" wx namespace
13401 from _gdi import *
13402 from _windows import *
13403 from _controls import *
13404 from _misc import *
13405
13406 #----------------------------------------------------------------------------
13407 #----------------------------------------------------------------------------
13408
13409
13410