]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / msw / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 PROCESS_ENTER = _core_.PROCESS_ENTER
120 PASSWORD = _core_.PASSWORD
121 CB_SIMPLE = _core_.CB_SIMPLE
122 CB_DROPDOWN = _core_.CB_DROPDOWN
123 CB_SORT = _core_.CB_SORT
124 CB_READONLY = _core_.CB_READONLY
125 RA_HORIZONTAL = _core_.RA_HORIZONTAL
126 RA_VERTICAL = _core_.RA_VERTICAL
127 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130 RB_GROUP = _core_.RB_GROUP
131 RB_SINGLE = _core_.RB_SINGLE
132 SB_HORIZONTAL = _core_.SB_HORIZONTAL
133 SB_VERTICAL = _core_.SB_VERTICAL
134 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135 ST_SIZEGRIP = _core_.ST_SIZEGRIP
136 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138 ST_DOTS_END = _core_.ST_DOTS_END
139 FLOOD_SURFACE = _core_.FLOOD_SURFACE
140 FLOOD_BORDER = _core_.FLOOD_BORDER
141 ODDEVEN_RULE = _core_.ODDEVEN_RULE
142 WINDING_RULE = _core_.WINDING_RULE
143 TOOL_TOP = _core_.TOOL_TOP
144 TOOL_BOTTOM = _core_.TOOL_BOTTOM
145 TOOL_LEFT = _core_.TOOL_LEFT
146 TOOL_RIGHT = _core_.TOOL_RIGHT
147 OK = _core_.OK
148 YES_NO = _core_.YES_NO
149 CANCEL = _core_.CANCEL
150 YES = _core_.YES
151 NO = _core_.NO
152 NO_DEFAULT = _core_.NO_DEFAULT
153 YES_DEFAULT = _core_.YES_DEFAULT
154 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155 ICON_HAND = _core_.ICON_HAND
156 ICON_QUESTION = _core_.ICON_QUESTION
157 ICON_INFORMATION = _core_.ICON_INFORMATION
158 ICON_STOP = _core_.ICON_STOP
159 ICON_ASTERISK = _core_.ICON_ASTERISK
160 ICON_MASK = _core_.ICON_MASK
161 ICON_WARNING = _core_.ICON_WARNING
162 ICON_ERROR = _core_.ICON_ERROR
163 FORWARD = _core_.FORWARD
164 BACKWARD = _core_.BACKWARD
165 RESET = _core_.RESET
166 HELP = _core_.HELP
167 MORE = _core_.MORE
168 SETUP = _core_.SETUP
169 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171 SIZE_AUTO = _core_.SIZE_AUTO
172 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE = _core_.SIZE_FORCE
175 PORTRAIT = _core_.PORTRAIT
176 LANDSCAPE = _core_.LANDSCAPE
177 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181 ID_ANY = _core_.ID_ANY
182 ID_SEPARATOR = _core_.ID_SEPARATOR
183 ID_NONE = _core_.ID_NONE
184 ID_LOWEST = _core_.ID_LOWEST
185 ID_OPEN = _core_.ID_OPEN
186 ID_CLOSE = _core_.ID_CLOSE
187 ID_NEW = _core_.ID_NEW
188 ID_SAVE = _core_.ID_SAVE
189 ID_SAVEAS = _core_.ID_SAVEAS
190 ID_REVERT = _core_.ID_REVERT
191 ID_EXIT = _core_.ID_EXIT
192 ID_UNDO = _core_.ID_UNDO
193 ID_REDO = _core_.ID_REDO
194 ID_HELP = _core_.ID_HELP
195 ID_PRINT = _core_.ID_PRINT
196 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
198 ID_PREVIEW = _core_.ID_PREVIEW
199 ID_ABOUT = _core_.ID_ABOUT
200 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
204 ID_HELP_INDEX = _core_.ID_HELP_INDEX
205 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
206 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207 ID_PREFERENCES = _core_.ID_PREFERENCES
208 ID_EDIT = _core_.ID_EDIT
209 ID_CUT = _core_.ID_CUT
210 ID_COPY = _core_.ID_COPY
211 ID_PASTE = _core_.ID_PASTE
212 ID_CLEAR = _core_.ID_CLEAR
213 ID_FIND = _core_.ID_FIND
214 ID_DUPLICATE = _core_.ID_DUPLICATE
215 ID_SELECTALL = _core_.ID_SELECTALL
216 ID_DELETE = _core_.ID_DELETE
217 ID_REPLACE = _core_.ID_REPLACE
218 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219 ID_PROPERTIES = _core_.ID_PROPERTIES
220 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223 ID_VIEW_LIST = _core_.ID_VIEW_LIST
224 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
228 ID_FILE = _core_.ID_FILE
229 ID_FILE1 = _core_.ID_FILE1
230 ID_FILE2 = _core_.ID_FILE2
231 ID_FILE3 = _core_.ID_FILE3
232 ID_FILE4 = _core_.ID_FILE4
233 ID_FILE5 = _core_.ID_FILE5
234 ID_FILE6 = _core_.ID_FILE6
235 ID_FILE7 = _core_.ID_FILE7
236 ID_FILE8 = _core_.ID_FILE8
237 ID_FILE9 = _core_.ID_FILE9
238 ID_OK = _core_.ID_OK
239 ID_CANCEL = _core_.ID_CANCEL
240 ID_APPLY = _core_.ID_APPLY
241 ID_YES = _core_.ID_YES
242 ID_NO = _core_.ID_NO
243 ID_STATIC = _core_.ID_STATIC
244 ID_FORWARD = _core_.ID_FORWARD
245 ID_BACKWARD = _core_.ID_BACKWARD
246 ID_DEFAULT = _core_.ID_DEFAULT
247 ID_MORE = _core_.ID_MORE
248 ID_SETUP = _core_.ID_SETUP
249 ID_RESET = _core_.ID_RESET
250 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
251 ID_YESTOALL = _core_.ID_YESTOALL
252 ID_NOTOALL = _core_.ID_NOTOALL
253 ID_ABORT = _core_.ID_ABORT
254 ID_RETRY = _core_.ID_RETRY
255 ID_IGNORE = _core_.ID_IGNORE
256 ID_ADD = _core_.ID_ADD
257 ID_REMOVE = _core_.ID_REMOVE
258 ID_UP = _core_.ID_UP
259 ID_DOWN = _core_.ID_DOWN
260 ID_HOME = _core_.ID_HOME
261 ID_REFRESH = _core_.ID_REFRESH
262 ID_STOP = _core_.ID_STOP
263 ID_INDEX = _core_.ID_INDEX
264 ID_BOLD = _core_.ID_BOLD
265 ID_ITALIC = _core_.ID_ITALIC
266 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270 ID_UNDERLINE = _core_.ID_UNDERLINE
271 ID_INDENT = _core_.ID_INDENT
272 ID_UNINDENT = _core_.ID_UNINDENT
273 ID_ZOOM_100 = _core_.ID_ZOOM_100
274 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275 ID_ZOOM_IN = _core_.ID_ZOOM_IN
276 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277 ID_UNDELETE = _core_.ID_UNDELETE
278 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
279 ID_HIGHEST = _core_.ID_HIGHEST
280 MENU_TEAROFF = _core_.MENU_TEAROFF
281 MB_DOCKABLE = _core_.MB_DOCKABLE
282 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
283 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
284 LI_HORIZONTAL = _core_.LI_HORIZONTAL
285 LI_VERTICAL = _core_.LI_VERTICAL
286 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
287 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
288 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
289 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
290 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
291 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
292 MM_TEXT = _core_.MM_TEXT
293 MM_LOMETRIC = _core_.MM_LOMETRIC
294 MM_HIMETRIC = _core_.MM_HIMETRIC
295 MM_LOENGLISH = _core_.MM_LOENGLISH
296 MM_HIENGLISH = _core_.MM_HIENGLISH
297 MM_TWIPS = _core_.MM_TWIPS
298 MM_ISOTROPIC = _core_.MM_ISOTROPIC
299 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
300 MM_POINTS = _core_.MM_POINTS
301 MM_METRIC = _core_.MM_METRIC
302 CENTRE = _core_.CENTRE
303 CENTER = _core_.CENTER
304 HORIZONTAL = _core_.HORIZONTAL
305 VERTICAL = _core_.VERTICAL
306 BOTH = _core_.BOTH
307 LEFT = _core_.LEFT
308 RIGHT = _core_.RIGHT
309 UP = _core_.UP
310 DOWN = _core_.DOWN
311 TOP = _core_.TOP
312 BOTTOM = _core_.BOTTOM
313 NORTH = _core_.NORTH
314 SOUTH = _core_.SOUTH
315 WEST = _core_.WEST
316 EAST = _core_.EAST
317 ALL = _core_.ALL
318 ALIGN_NOT = _core_.ALIGN_NOT
319 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
320 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
321 ALIGN_LEFT = _core_.ALIGN_LEFT
322 ALIGN_TOP = _core_.ALIGN_TOP
323 ALIGN_RIGHT = _core_.ALIGN_RIGHT
324 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
325 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
326 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
327 ALIGN_CENTER = _core_.ALIGN_CENTER
328 ALIGN_CENTRE = _core_.ALIGN_CENTRE
329 ALIGN_MASK = _core_.ALIGN_MASK
330 STRETCH_NOT = _core_.STRETCH_NOT
331 SHRINK = _core_.SHRINK
332 GROW = _core_.GROW
333 EXPAND = _core_.EXPAND
334 SHAPED = _core_.SHAPED
335 FIXED_MINSIZE = _core_.FIXED_MINSIZE
336 TILE = _core_.TILE
337 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
338 BORDER_DEFAULT = _core_.BORDER_DEFAULT
339 BORDER_NONE = _core_.BORDER_NONE
340 BORDER_STATIC = _core_.BORDER_STATIC
341 BORDER_SIMPLE = _core_.BORDER_SIMPLE
342 BORDER_RAISED = _core_.BORDER_RAISED
343 BORDER_SUNKEN = _core_.BORDER_SUNKEN
344 BORDER_DOUBLE = _core_.BORDER_DOUBLE
345 BORDER_MASK = _core_.BORDER_MASK
346 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
349 DEFAULT = _core_.DEFAULT
350 DECORATIVE = _core_.DECORATIVE
351 ROMAN = _core_.ROMAN
352 SCRIPT = _core_.SCRIPT
353 SWISS = _core_.SWISS
354 MODERN = _core_.MODERN
355 TELETYPE = _core_.TELETYPE
356 VARIABLE = _core_.VARIABLE
357 FIXED = _core_.FIXED
358 NORMAL = _core_.NORMAL
359 LIGHT = _core_.LIGHT
360 BOLD = _core_.BOLD
361 ITALIC = _core_.ITALIC
362 SLANT = _core_.SLANT
363 SOLID = _core_.SOLID
364 DOT = _core_.DOT
365 LONG_DASH = _core_.LONG_DASH
366 SHORT_DASH = _core_.SHORT_DASH
367 DOT_DASH = _core_.DOT_DASH
368 USER_DASH = _core_.USER_DASH
369 TRANSPARENT = _core_.TRANSPARENT
370 STIPPLE = _core_.STIPPLE
371 STIPPLE_MASK = _core_.STIPPLE_MASK
372 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
373 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376 CROSS_HATCH = _core_.CROSS_HATCH
377 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378 VERTICAL_HATCH = _core_.VERTICAL_HATCH
379 JOIN_BEVEL = _core_.JOIN_BEVEL
380 JOIN_MITER = _core_.JOIN_MITER
381 JOIN_ROUND = _core_.JOIN_ROUND
382 CAP_ROUND = _core_.CAP_ROUND
383 CAP_PROJECTING = _core_.CAP_PROJECTING
384 CAP_BUTT = _core_.CAP_BUTT
385 CLEAR = _core_.CLEAR
386 XOR = _core_.XOR
387 INVERT = _core_.INVERT
388 OR_REVERSE = _core_.OR_REVERSE
389 AND_REVERSE = _core_.AND_REVERSE
390 COPY = _core_.COPY
391 AND = _core_.AND
392 AND_INVERT = _core_.AND_INVERT
393 NO_OP = _core_.NO_OP
394 NOR = _core_.NOR
395 EQUIV = _core_.EQUIV
396 SRC_INVERT = _core_.SRC_INVERT
397 OR_INVERT = _core_.OR_INVERT
398 NAND = _core_.NAND
399 OR = _core_.OR
400 SET = _core_.SET
401 WXK_BACK = _core_.WXK_BACK
402 WXK_TAB = _core_.WXK_TAB
403 WXK_RETURN = _core_.WXK_RETURN
404 WXK_ESCAPE = _core_.WXK_ESCAPE
405 WXK_SPACE = _core_.WXK_SPACE
406 WXK_DELETE = _core_.WXK_DELETE
407 WXK_START = _core_.WXK_START
408 WXK_LBUTTON = _core_.WXK_LBUTTON
409 WXK_RBUTTON = _core_.WXK_RBUTTON
410 WXK_CANCEL = _core_.WXK_CANCEL
411 WXK_MBUTTON = _core_.WXK_MBUTTON
412 WXK_CLEAR = _core_.WXK_CLEAR
413 WXK_SHIFT = _core_.WXK_SHIFT
414 WXK_ALT = _core_.WXK_ALT
415 WXK_CONTROL = _core_.WXK_CONTROL
416 WXK_MENU = _core_.WXK_MENU
417 WXK_PAUSE = _core_.WXK_PAUSE
418 WXK_CAPITAL = _core_.WXK_CAPITAL
419 WXK_PRIOR = _core_.WXK_PRIOR
420 WXK_NEXT = _core_.WXK_NEXT
421 WXK_END = _core_.WXK_END
422 WXK_HOME = _core_.WXK_HOME
423 WXK_LEFT = _core_.WXK_LEFT
424 WXK_UP = _core_.WXK_UP
425 WXK_RIGHT = _core_.WXK_RIGHT
426 WXK_DOWN = _core_.WXK_DOWN
427 WXK_SELECT = _core_.WXK_SELECT
428 WXK_PRINT = _core_.WXK_PRINT
429 WXK_EXECUTE = _core_.WXK_EXECUTE
430 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431 WXK_INSERT = _core_.WXK_INSERT
432 WXK_HELP = _core_.WXK_HELP
433 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443 WXK_MULTIPLY = _core_.WXK_MULTIPLY
444 WXK_ADD = _core_.WXK_ADD
445 WXK_SEPARATOR = _core_.WXK_SEPARATOR
446 WXK_SUBTRACT = _core_.WXK_SUBTRACT
447 WXK_DECIMAL = _core_.WXK_DECIMAL
448 WXK_DIVIDE = _core_.WXK_DIVIDE
449 WXK_F1 = _core_.WXK_F1
450 WXK_F2 = _core_.WXK_F2
451 WXK_F3 = _core_.WXK_F3
452 WXK_F4 = _core_.WXK_F4
453 WXK_F5 = _core_.WXK_F5
454 WXK_F6 = _core_.WXK_F6
455 WXK_F7 = _core_.WXK_F7
456 WXK_F8 = _core_.WXK_F8
457 WXK_F9 = _core_.WXK_F9
458 WXK_F10 = _core_.WXK_F10
459 WXK_F11 = _core_.WXK_F11
460 WXK_F12 = _core_.WXK_F12
461 WXK_F13 = _core_.WXK_F13
462 WXK_F14 = _core_.WXK_F14
463 WXK_F15 = _core_.WXK_F15
464 WXK_F16 = _core_.WXK_F16
465 WXK_F17 = _core_.WXK_F17
466 WXK_F18 = _core_.WXK_F18
467 WXK_F19 = _core_.WXK_F19
468 WXK_F20 = _core_.WXK_F20
469 WXK_F21 = _core_.WXK_F21
470 WXK_F22 = _core_.WXK_F22
471 WXK_F23 = _core_.WXK_F23
472 WXK_F24 = _core_.WXK_F24
473 WXK_NUMLOCK = _core_.WXK_NUMLOCK
474 WXK_SCROLL = _core_.WXK_SCROLL
475 WXK_PAGEUP = _core_.WXK_PAGEUP
476 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
507 WXK_COMMAND = _core_.WXK_COMMAND
508 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
528 PAPER_NONE = _core_.PAPER_NONE
529 PAPER_LETTER = _core_.PAPER_LETTER
530 PAPER_LEGAL = _core_.PAPER_LEGAL
531 PAPER_A4 = _core_.PAPER_A4
532 PAPER_CSHEET = _core_.PAPER_CSHEET
533 PAPER_DSHEET = _core_.PAPER_DSHEET
534 PAPER_ESHEET = _core_.PAPER_ESHEET
535 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536 PAPER_TABLOID = _core_.PAPER_TABLOID
537 PAPER_LEDGER = _core_.PAPER_LEDGER
538 PAPER_STATEMENT = _core_.PAPER_STATEMENT
539 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540 PAPER_A3 = _core_.PAPER_A3
541 PAPER_A4SMALL = _core_.PAPER_A4SMALL
542 PAPER_A5 = _core_.PAPER_A5
543 PAPER_B4 = _core_.PAPER_B4
544 PAPER_B5 = _core_.PAPER_B5
545 PAPER_FOLIO = _core_.PAPER_FOLIO
546 PAPER_QUARTO = _core_.PAPER_QUARTO
547 PAPER_10X14 = _core_.PAPER_10X14
548 PAPER_11X17 = _core_.PAPER_11X17
549 PAPER_NOTE = _core_.PAPER_NOTE
550 PAPER_ENV_9 = _core_.PAPER_ENV_9
551 PAPER_ENV_10 = _core_.PAPER_ENV_10
552 PAPER_ENV_11 = _core_.PAPER_ENV_11
553 PAPER_ENV_12 = _core_.PAPER_ENV_12
554 PAPER_ENV_14 = _core_.PAPER_ENV_14
555 PAPER_ENV_DL = _core_.PAPER_ENV_DL
556 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572 PAPER_9X11 = _core_.PAPER_9X11
573 PAPER_10X11 = _core_.PAPER_10X11
574 PAPER_15X11 = _core_.PAPER_15X11
575 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583 PAPER_A_PLUS = _core_.PAPER_A_PLUS
584 PAPER_B_PLUS = _core_.PAPER_B_PLUS
585 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592 PAPER_A2 = _core_.PAPER_A2
593 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
595 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
596 PAPER_A6 = _core_.PAPER_A6
597 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
598 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
599 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
600 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
601 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
602 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
603 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
604 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
605 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
606 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
607 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
608 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
610 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
611 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
612 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
613 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
614 PAPER_B6_JIS = _core_.PAPER_B6_JIS
615 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
616 PAPER_12X11 = _core_.PAPER_12X11
617 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
618 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
619 PAPER_P16K = _core_.PAPER_P16K
620 PAPER_P32K = _core_.PAPER_P32K
621 PAPER_P32KBIG = _core_.PAPER_P32KBIG
622 PAPER_PENV_1 = _core_.PAPER_PENV_1
623 PAPER_PENV_2 = _core_.PAPER_PENV_2
624 PAPER_PENV_3 = _core_.PAPER_PENV_3
625 PAPER_PENV_4 = _core_.PAPER_PENV_4
626 PAPER_PENV_5 = _core_.PAPER_PENV_5
627 PAPER_PENV_6 = _core_.PAPER_PENV_6
628 PAPER_PENV_7 = _core_.PAPER_PENV_7
629 PAPER_PENV_8 = _core_.PAPER_PENV_8
630 PAPER_PENV_9 = _core_.PAPER_PENV_9
631 PAPER_PENV_10 = _core_.PAPER_PENV_10
632 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
633 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
634 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
635 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
636 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
637 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
638 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
639 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
640 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
641 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
642 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
643 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
644 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
645 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
646 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
647 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
648 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
649 ITEM_NORMAL = _core_.ITEM_NORMAL
650 ITEM_CHECK = _core_.ITEM_CHECK
651 ITEM_RADIO = _core_.ITEM_RADIO
652 ITEM_MAX = _core_.ITEM_MAX
653 HT_NOWHERE = _core_.HT_NOWHERE
654 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
655 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
656 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
657 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
658 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
659 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
660 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
661 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
662 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
663 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
664 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
665 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
666 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
667 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
668 HT_MAX = _core_.HT_MAX
669 MOD_NONE = _core_.MOD_NONE
670 MOD_ALT = _core_.MOD_ALT
671 MOD_CONTROL = _core_.MOD_CONTROL
672 MOD_ALTGR = _core_.MOD_ALTGR
673 MOD_SHIFT = _core_.MOD_SHIFT
674 MOD_META = _core_.MOD_META
675 MOD_WIN = _core_.MOD_WIN
676 MOD_CMD = _core_.MOD_CMD
677 MOD_ALL = _core_.MOD_ALL
678 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
681 #---------------------------------------------------------------------------
682
683 class Object(object):
684 """
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
687 """
688 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
689 def __init__(self): raise AttributeError, "No constructor defined"
690 __repr__ = _swig_repr
691 def GetClassName(*args, **kwargs):
692 """
693 GetClassName(self) -> String
694
695 Returns the class name of the C++ class using wxRTTI.
696 """
697 return _core_.Object_GetClassName(*args, **kwargs)
698
699 def Destroy(*args, **kwargs):
700 """
701 Destroy(self)
702
703 Deletes the C++ object this Python object is a proxy for.
704 """
705 val = _core_.Object_Destroy(*args, **kwargs)
706 args[0].thisown = 0
707 return val
708
709 ClassName = property(GetClassName,doc="See `GetClassName`")
710 _core_.Object_swigregister(Object)
711 _wxPySetDictionary = _core_._wxPySetDictionary
712 cvar = _core_.cvar
713 EmptyString = cvar.EmptyString
714
715 #---------------------------------------------------------------------------
716
717 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
718 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
719 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
720 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
721 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
722 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
723 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
724 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
725 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
726 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
727 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
728 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
729 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
730 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
731 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
732 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
733 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
734 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
735 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
736 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
737 CURSOR_NONE = _core_.CURSOR_NONE
738 CURSOR_ARROW = _core_.CURSOR_ARROW
739 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
740 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
741 CURSOR_CHAR = _core_.CURSOR_CHAR
742 CURSOR_CROSS = _core_.CURSOR_CROSS
743 CURSOR_HAND = _core_.CURSOR_HAND
744 CURSOR_IBEAM = _core_.CURSOR_IBEAM
745 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
746 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
747 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
748 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
749 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
750 CURSOR_PENCIL = _core_.CURSOR_PENCIL
751 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
752 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
753 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
754 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
755 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
756 CURSOR_SIZENS = _core_.CURSOR_SIZENS
757 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
758 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
759 CURSOR_SIZING = _core_.CURSOR_SIZING
760 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
761 CURSOR_WAIT = _core_.CURSOR_WAIT
762 CURSOR_WATCH = _core_.CURSOR_WATCH
763 CURSOR_BLANK = _core_.CURSOR_BLANK
764 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
765 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
766 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
767 CURSOR_MAX = _core_.CURSOR_MAX
768 #---------------------------------------------------------------------------
769
770 class Size(object):
771 """
772 wx.Size is a useful data structure used to represent the size of
773 something. It simply contains integer width and height
774 properties. In most places in wxPython where a wx.Size is
775 expected a (width, height) tuple can be used instead.
776 """
777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
778 __repr__ = _swig_repr
779 width = property(_core_.Size_width_get, _core_.Size_width_set)
780 height = property(_core_.Size_height_get, _core_.Size_height_set)
781 x = width; y = height
782 def __init__(self, *args, **kwargs):
783 """
784 __init__(self, int w=0, int h=0) -> Size
785
786 Creates a size object.
787 """
788 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
789 __swig_destroy__ = _core_.delete_Size
790 __del__ = lambda self : None;
791 def __eq__(*args, **kwargs):
792 """
793 __eq__(self, PyObject other) -> bool
794
795 Test for equality of wx.Size objects.
796 """
797 return _core_.Size___eq__(*args, **kwargs)
798
799 def __ne__(*args, **kwargs):
800 """
801 __ne__(self, PyObject other) -> bool
802
803 Test for inequality of wx.Size objects.
804 """
805 return _core_.Size___ne__(*args, **kwargs)
806
807 def __add__(*args, **kwargs):
808 """
809 __add__(self, Size sz) -> Size
810
811 Add sz's proprties to this and return the result.
812 """
813 return _core_.Size___add__(*args, **kwargs)
814
815 def __sub__(*args, **kwargs):
816 """
817 __sub__(self, Size sz) -> Size
818
819 Subtract sz's properties from this and return the result.
820 """
821 return _core_.Size___sub__(*args, **kwargs)
822
823 def IncTo(*args, **kwargs):
824 """
825 IncTo(self, Size sz)
826
827 Increments this object so that both of its dimensions are not less
828 than the corresponding dimensions of the size.
829 """
830 return _core_.Size_IncTo(*args, **kwargs)
831
832 def DecTo(*args, **kwargs):
833 """
834 DecTo(self, Size sz)
835
836 Decrements this object so that both of its dimensions are not greater
837 than the corresponding dimensions of the size.
838 """
839 return _core_.Size_DecTo(*args, **kwargs)
840
841 def Scale(*args, **kwargs):
842 """
843 Scale(self, float xscale, float yscale)
844
845 Scales the dimensions of this object by the given factors.
846 """
847 return _core_.Size_Scale(*args, **kwargs)
848
849 def Set(*args, **kwargs):
850 """
851 Set(self, int w, int h)
852
853 Set both width and height.
854 """
855 return _core_.Size_Set(*args, **kwargs)
856
857 def SetWidth(*args, **kwargs):
858 """SetWidth(self, int w)"""
859 return _core_.Size_SetWidth(*args, **kwargs)
860
861 def SetHeight(*args, **kwargs):
862 """SetHeight(self, int h)"""
863 return _core_.Size_SetHeight(*args, **kwargs)
864
865 def GetWidth(*args, **kwargs):
866 """GetWidth(self) -> int"""
867 return _core_.Size_GetWidth(*args, **kwargs)
868
869 def GetHeight(*args, **kwargs):
870 """GetHeight(self) -> int"""
871 return _core_.Size_GetHeight(*args, **kwargs)
872
873 def IsFullySpecified(*args, **kwargs):
874 """
875 IsFullySpecified(self) -> bool
876
877 Returns True if both components of the size are non-default values.
878 """
879 return _core_.Size_IsFullySpecified(*args, **kwargs)
880
881 def SetDefaults(*args, **kwargs):
882 """
883 SetDefaults(self, Size size)
884
885 Combine this size with the other one replacing the default components
886 of this object (i.e. equal to -1) with those of the other.
887 """
888 return _core_.Size_SetDefaults(*args, **kwargs)
889
890 def Get(*args, **kwargs):
891 """
892 Get() -> (width,height)
893
894 Returns the width and height properties as a tuple.
895 """
896 return _core_.Size_Get(*args, **kwargs)
897
898 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
899 def __str__(self): return str(self.Get())
900 def __repr__(self): return 'wx.Size'+str(self.Get())
901 def __len__(self): return len(self.Get())
902 def __getitem__(self, index): return self.Get()[index]
903 def __setitem__(self, index, val):
904 if index == 0: self.width = val
905 elif index == 1: self.height = val
906 else: raise IndexError
907 def __nonzero__(self): return self.Get() != (0,0)
908 __safe_for_unpickling__ = True
909 def __reduce__(self): return (wx.Size, self.Get())
910
911 _core_.Size_swigregister(Size)
912
913 #---------------------------------------------------------------------------
914
915 class RealPoint(object):
916 """
917 A data structure for representing a point or position with floating
918 point x and y properties. In wxPython most places that expect a
919 wx.RealPoint can also accept a (x,y) tuple.
920 """
921 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
922 __repr__ = _swig_repr
923 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
924 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
925 def __init__(self, *args, **kwargs):
926 """
927 __init__(self, double x=0.0, double y=0.0) -> RealPoint
928
929 Create a wx.RealPoint object
930 """
931 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
932 __swig_destroy__ = _core_.delete_RealPoint
933 __del__ = lambda self : None;
934 def __eq__(*args, **kwargs):
935 """
936 __eq__(self, PyObject other) -> bool
937
938 Test for equality of wx.RealPoint objects.
939 """
940 return _core_.RealPoint___eq__(*args, **kwargs)
941
942 def __ne__(*args, **kwargs):
943 """
944 __ne__(self, PyObject other) -> bool
945
946 Test for inequality of wx.RealPoint objects.
947 """
948 return _core_.RealPoint___ne__(*args, **kwargs)
949
950 def __add__(*args, **kwargs):
951 """
952 __add__(self, RealPoint pt) -> RealPoint
953
954 Add pt's proprties to this and return the result.
955 """
956 return _core_.RealPoint___add__(*args, **kwargs)
957
958 def __sub__(*args, **kwargs):
959 """
960 __sub__(self, RealPoint pt) -> RealPoint
961
962 Subtract pt's proprties from this and return the result
963 """
964 return _core_.RealPoint___sub__(*args, **kwargs)
965
966 def Set(*args, **kwargs):
967 """
968 Set(self, double x, double y)
969
970 Set both the x and y properties
971 """
972 return _core_.RealPoint_Set(*args, **kwargs)
973
974 def Get(*args, **kwargs):
975 """
976 Get() -> (x,y)
977
978 Return the x and y properties as a tuple.
979 """
980 return _core_.RealPoint_Get(*args, **kwargs)
981
982 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
983 def __str__(self): return str(self.Get())
984 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
985 def __len__(self): return len(self.Get())
986 def __getitem__(self, index): return self.Get()[index]
987 def __setitem__(self, index, val):
988 if index == 0: self.x = val
989 elif index == 1: self.y = val
990 else: raise IndexError
991 def __nonzero__(self): return self.Get() != (0.0, 0.0)
992 __safe_for_unpickling__ = True
993 def __reduce__(self): return (wx.RealPoint, self.Get())
994
995 _core_.RealPoint_swigregister(RealPoint)
996
997 #---------------------------------------------------------------------------
998
999 class Point(object):
1000 """
1001 A data structure for representing a point or position with integer x
1002 and y properties. Most places in wxPython that expect a wx.Point can
1003 also accept a (x,y) tuple.
1004 """
1005 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1006 __repr__ = _swig_repr
1007 x = property(_core_.Point_x_get, _core_.Point_x_set)
1008 y = property(_core_.Point_y_get, _core_.Point_y_set)
1009 def __init__(self, *args, **kwargs):
1010 """
1011 __init__(self, int x=0, int y=0) -> Point
1012
1013 Create a wx.Point object
1014 """
1015 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1016 __swig_destroy__ = _core_.delete_Point
1017 __del__ = lambda self : None;
1018 def __eq__(*args, **kwargs):
1019 """
1020 __eq__(self, PyObject other) -> bool
1021
1022 Test for equality of wx.Point objects.
1023 """
1024 return _core_.Point___eq__(*args, **kwargs)
1025
1026 def __ne__(*args, **kwargs):
1027 """
1028 __ne__(self, PyObject other) -> bool
1029
1030 Test for inequality of wx.Point objects.
1031 """
1032 return _core_.Point___ne__(*args, **kwargs)
1033
1034 def __add__(*args, **kwargs):
1035 """
1036 __add__(self, Point pt) -> Point
1037
1038 Add pt's proprties to this and return the result.
1039 """
1040 return _core_.Point___add__(*args, **kwargs)
1041
1042 def __sub__(*args, **kwargs):
1043 """
1044 __sub__(self, Point pt) -> Point
1045
1046 Subtract pt's proprties from this and return the result
1047 """
1048 return _core_.Point___sub__(*args, **kwargs)
1049
1050 def __iadd__(*args, **kwargs):
1051 """
1052 __iadd__(self, Point pt) -> Point
1053
1054 Add pt to this object.
1055 """
1056 return _core_.Point___iadd__(*args, **kwargs)
1057
1058 def __isub__(*args, **kwargs):
1059 """
1060 __isub__(self, Point pt) -> Point
1061
1062 Subtract pt from this object.
1063 """
1064 return _core_.Point___isub__(*args, **kwargs)
1065
1066 def Set(*args, **kwargs):
1067 """
1068 Set(self, long x, long y)
1069
1070 Set both the x and y properties
1071 """
1072 return _core_.Point_Set(*args, **kwargs)
1073
1074 def Get(*args, **kwargs):
1075 """
1076 Get() -> (x,y)
1077
1078 Return the x and y properties as a tuple.
1079 """
1080 return _core_.Point_Get(*args, **kwargs)
1081
1082 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1083 def __str__(self): return str(self.Get())
1084 def __repr__(self): return 'wx.Point'+str(self.Get())
1085 def __len__(self): return len(self.Get())
1086 def __getitem__(self, index): return self.Get()[index]
1087 def __setitem__(self, index, val):
1088 if index == 0: self.x = val
1089 elif index == 1: self.y = val
1090 else: raise IndexError
1091 def __nonzero__(self): return self.Get() != (0,0)
1092 __safe_for_unpickling__ = True
1093 def __reduce__(self): return (wx.Point, self.Get())
1094
1095 _core_.Point_swigregister(Point)
1096
1097 #---------------------------------------------------------------------------
1098
1099 class Rect(object):
1100 """
1101 A class for representing and manipulating rectangles. It has x, y,
1102 width and height properties. In wxPython most palces that expect a
1103 wx.Rect can also accept a (x,y,width,height) tuple.
1104 """
1105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1106 __repr__ = _swig_repr
1107 def __init__(self, *args, **kwargs):
1108 """
1109 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1110
1111 Create a new Rect object.
1112 """
1113 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1114 __swig_destroy__ = _core_.delete_Rect
1115 __del__ = lambda self : None;
1116 def GetX(*args, **kwargs):
1117 """GetX(self) -> int"""
1118 return _core_.Rect_GetX(*args, **kwargs)
1119
1120 def SetX(*args, **kwargs):
1121 """SetX(self, int x)"""
1122 return _core_.Rect_SetX(*args, **kwargs)
1123
1124 def GetY(*args, **kwargs):
1125 """GetY(self) -> int"""
1126 return _core_.Rect_GetY(*args, **kwargs)
1127
1128 def SetY(*args, **kwargs):
1129 """SetY(self, int y)"""
1130 return _core_.Rect_SetY(*args, **kwargs)
1131
1132 def GetWidth(*args, **kwargs):
1133 """GetWidth(self) -> int"""
1134 return _core_.Rect_GetWidth(*args, **kwargs)
1135
1136 def SetWidth(*args, **kwargs):
1137 """SetWidth(self, int w)"""
1138 return _core_.Rect_SetWidth(*args, **kwargs)
1139
1140 def GetHeight(*args, **kwargs):
1141 """GetHeight(self) -> int"""
1142 return _core_.Rect_GetHeight(*args, **kwargs)
1143
1144 def SetHeight(*args, **kwargs):
1145 """SetHeight(self, int h)"""
1146 return _core_.Rect_SetHeight(*args, **kwargs)
1147
1148 def GetPosition(*args, **kwargs):
1149 """GetPosition(self) -> Point"""
1150 return _core_.Rect_GetPosition(*args, **kwargs)
1151
1152 def SetPosition(*args, **kwargs):
1153 """SetPosition(self, Point p)"""
1154 return _core_.Rect_SetPosition(*args, **kwargs)
1155
1156 def GetSize(*args, **kwargs):
1157 """GetSize(self) -> Size"""
1158 return _core_.Rect_GetSize(*args, **kwargs)
1159
1160 def SetSize(*args, **kwargs):
1161 """SetSize(self, Size s)"""
1162 return _core_.Rect_SetSize(*args, **kwargs)
1163
1164 def IsEmpty(*args, **kwargs):
1165 """IsEmpty(self) -> bool"""
1166 return _core_.Rect_IsEmpty(*args, **kwargs)
1167
1168 def GetTopLeft(*args, **kwargs):
1169 """GetTopLeft(self) -> Point"""
1170 return _core_.Rect_GetTopLeft(*args, **kwargs)
1171
1172 def SetTopLeft(*args, **kwargs):
1173 """SetTopLeft(self, Point p)"""
1174 return _core_.Rect_SetTopLeft(*args, **kwargs)
1175
1176 def GetBottomRight(*args, **kwargs):
1177 """GetBottomRight(self) -> Point"""
1178 return _core_.Rect_GetBottomRight(*args, **kwargs)
1179
1180 def SetBottomRight(*args, **kwargs):
1181 """SetBottomRight(self, Point p)"""
1182 return _core_.Rect_SetBottomRight(*args, **kwargs)
1183
1184 def GetLeft(*args, **kwargs):
1185 """GetLeft(self) -> int"""
1186 return _core_.Rect_GetLeft(*args, **kwargs)
1187
1188 def GetTop(*args, **kwargs):
1189 """GetTop(self) -> int"""
1190 return _core_.Rect_GetTop(*args, **kwargs)
1191
1192 def GetBottom(*args, **kwargs):
1193 """GetBottom(self) -> int"""
1194 return _core_.Rect_GetBottom(*args, **kwargs)
1195
1196 def GetRight(*args, **kwargs):
1197 """GetRight(self) -> int"""
1198 return _core_.Rect_GetRight(*args, **kwargs)
1199
1200 def SetLeft(*args, **kwargs):
1201 """SetLeft(self, int left)"""
1202 return _core_.Rect_SetLeft(*args, **kwargs)
1203
1204 def SetRight(*args, **kwargs):
1205 """SetRight(self, int right)"""
1206 return _core_.Rect_SetRight(*args, **kwargs)
1207
1208 def SetTop(*args, **kwargs):
1209 """SetTop(self, int top)"""
1210 return _core_.Rect_SetTop(*args, **kwargs)
1211
1212 def SetBottom(*args, **kwargs):
1213 """SetBottom(self, int bottom)"""
1214 return _core_.Rect_SetBottom(*args, **kwargs)
1215
1216 position = property(GetPosition, SetPosition)
1217 size = property(GetSize, SetSize)
1218 left = property(GetLeft, SetLeft)
1219 right = property(GetRight, SetRight)
1220 top = property(GetTop, SetTop)
1221 bottom = property(GetBottom, SetBottom)
1222
1223 def Inflate(*args, **kwargs):
1224 """
1225 Inflate(self, int dx, int dy) -> Rect
1226
1227 Increases the size of the rectangle.
1228
1229 The left border is moved farther left and the right border is moved
1230 farther right by ``dx``. The upper border is moved farther up and the
1231 bottom border is moved farther down by ``dy``. (Note the the width and
1232 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1233 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1234 opposite happens: the rectangle size decreases in the respective
1235 direction.
1236
1237 The change is made to the rectangle inplace, if instead you need a
1238 copy that is inflated, preserving the original then make the copy
1239 first::
1240
1241 copy = wx.Rect(*original)
1242 copy.Inflate(10,15)
1243
1244
1245 """
1246 return _core_.Rect_Inflate(*args, **kwargs)
1247
1248 def Deflate(*args, **kwargs):
1249 """
1250 Deflate(self, int dx, int dy) -> Rect
1251
1252 Decrease the rectangle size. This method is the opposite of `Inflate`
1253 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1254 `Inflate` for a full description.
1255 """
1256 return _core_.Rect_Deflate(*args, **kwargs)
1257
1258 def OffsetXY(*args, **kwargs):
1259 """
1260 OffsetXY(self, int dx, int dy)
1261
1262 Moves the rectangle by the specified offset. If dx is positive, the
1263 rectangle is moved to the right, if dy is positive, it is moved to the
1264 bottom, otherwise it is moved to the left or top respectively.
1265 """
1266 return _core_.Rect_OffsetXY(*args, **kwargs)
1267
1268 def Offset(*args, **kwargs):
1269 """
1270 Offset(self, Point pt)
1271
1272 Same as `OffsetXY` but uses dx,dy from Point
1273 """
1274 return _core_.Rect_Offset(*args, **kwargs)
1275
1276 def Intersect(*args, **kwargs):
1277 """
1278 Intersect(self, Rect rect) -> Rect
1279
1280 Returns the intersectsion of this rectangle and rect.
1281 """
1282 return _core_.Rect_Intersect(*args, **kwargs)
1283
1284 def Union(*args, **kwargs):
1285 """
1286 Union(self, Rect rect) -> Rect
1287
1288 Returns the union of this rectangle and rect.
1289 """
1290 return _core_.Rect_Union(*args, **kwargs)
1291
1292 def __add__(*args, **kwargs):
1293 """
1294 __add__(self, Rect rect) -> Rect
1295
1296 Add the properties of rect to this rectangle and return the result.
1297 """
1298 return _core_.Rect___add__(*args, **kwargs)
1299
1300 def __iadd__(*args, **kwargs):
1301 """
1302 __iadd__(self, Rect rect) -> Rect
1303
1304 Add the properties of rect to this rectangle, updating this rectangle.
1305 """
1306 return _core_.Rect___iadd__(*args, **kwargs)
1307
1308 def __eq__(*args, **kwargs):
1309 """
1310 __eq__(self, PyObject other) -> bool
1311
1312 Test for equality of wx.Rect objects.
1313 """
1314 return _core_.Rect___eq__(*args, **kwargs)
1315
1316 def __ne__(*args, **kwargs):
1317 """
1318 __ne__(self, PyObject other) -> bool
1319
1320 Test for inequality of wx.Rect objects.
1321 """
1322 return _core_.Rect___ne__(*args, **kwargs)
1323
1324 def ContainsXY(*args, **kwargs):
1325 """
1326 ContainsXY(self, int x, int y) -> bool
1327
1328 Return True if the point is inside the rect.
1329 """
1330 return _core_.Rect_ContainsXY(*args, **kwargs)
1331
1332 def Contains(*args, **kwargs):
1333 """
1334 Contains(self, Point pt) -> bool
1335
1336 Return True if the point is inside the rect.
1337 """
1338 return _core_.Rect_Contains(*args, **kwargs)
1339
1340 def ContainsRect(*args, **kwargs):
1341 """
1342 ContainsRect(self, Rect rect) -> bool
1343
1344 Returns ``True`` if the given rectangle is completely inside this
1345 rectangle or touches its boundary.
1346 """
1347 return _core_.Rect_ContainsRect(*args, **kwargs)
1348
1349 Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1350 InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1351 InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1352
1353 def Intersects(*args, **kwargs):
1354 """
1355 Intersects(self, Rect rect) -> bool
1356
1357 Returns True if the rectangles have a non empty intersection.
1358 """
1359 return _core_.Rect_Intersects(*args, **kwargs)
1360
1361 def CenterIn(*args, **kwargs):
1362 """
1363 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1364
1365 Center this rectangle within the one passed to the method, which is
1366 usually, but not necessarily, the larger one.
1367 """
1368 return _core_.Rect_CenterIn(*args, **kwargs)
1369
1370 CentreIn = CenterIn
1371 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1372 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1373 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1374 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1375 def Set(*args, **kwargs):
1376 """
1377 Set(self, int x=0, int y=0, int width=0, int height=0)
1378
1379 Set all rectangle properties.
1380 """
1381 return _core_.Rect_Set(*args, **kwargs)
1382
1383 def Get(*args, **kwargs):
1384 """
1385 Get() -> (x,y,width,height)
1386
1387 Return the rectangle properties as a tuple.
1388 """
1389 return _core_.Rect_Get(*args, **kwargs)
1390
1391 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1392 def __str__(self): return str(self.Get())
1393 def __repr__(self): return 'wx.Rect'+str(self.Get())
1394 def __len__(self): return len(self.Get())
1395 def __getitem__(self, index): return self.Get()[index]
1396 def __setitem__(self, index, val):
1397 if index == 0: self.x = val
1398 elif index == 1: self.y = val
1399 elif index == 2: self.width = val
1400 elif index == 3: self.height = val
1401 else: raise IndexError
1402 def __nonzero__(self): return self.Get() != (0,0,0,0)
1403 __safe_for_unpickling__ = True
1404 def __reduce__(self): return (wx.Rect, self.Get())
1405
1406 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1407 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
1408 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1409 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1410 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1411 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1412 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1413 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1414 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
1415 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1416 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1417 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1418 Empty = property(IsEmpty,doc="See `IsEmpty`")
1419 _core_.Rect_swigregister(Rect)
1420
1421 def RectPP(*args, **kwargs):
1422 """
1423 RectPP(Point topLeft, Point bottomRight) -> Rect
1424
1425 Create a new Rect object from Points representing two corners.
1426 """
1427 val = _core_.new_RectPP(*args, **kwargs)
1428 return val
1429
1430 def RectPS(*args, **kwargs):
1431 """
1432 RectPS(Point pos, Size size) -> Rect
1433
1434 Create a new Rect from a position and size.
1435 """
1436 val = _core_.new_RectPS(*args, **kwargs)
1437 return val
1438
1439 def RectS(*args, **kwargs):
1440 """
1441 RectS(Size size) -> Rect
1442
1443 Create a new Rect from a size only.
1444 """
1445 val = _core_.new_RectS(*args, **kwargs)
1446 return val
1447
1448
1449 def IntersectRect(*args, **kwargs):
1450 """
1451 IntersectRect(Rect r1, Rect r2) -> Rect
1452
1453 Calculate and return the intersection of r1 and r2.
1454 """
1455 return _core_.IntersectRect(*args, **kwargs)
1456 #---------------------------------------------------------------------------
1457
1458 class Point2D(object):
1459 """
1460 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1461 with floating point values.
1462 """
1463 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1464 __repr__ = _swig_repr
1465 def __init__(self, *args, **kwargs):
1466 """
1467 __init__(self, double x=0.0, double y=0.0) -> Point2D
1468
1469 Create a w.Point2D object.
1470 """
1471 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1472 def GetFloor(*args, **kwargs):
1473 """
1474 GetFloor() -> (x,y)
1475
1476 Convert to integer
1477 """
1478 return _core_.Point2D_GetFloor(*args, **kwargs)
1479
1480 def GetRounded(*args, **kwargs):
1481 """
1482 GetRounded() -> (x,y)
1483
1484 Convert to integer
1485 """
1486 return _core_.Point2D_GetRounded(*args, **kwargs)
1487
1488 def GetVectorLength(*args, **kwargs):
1489 """GetVectorLength(self) -> double"""
1490 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1491
1492 def GetVectorAngle(*args, **kwargs):
1493 """GetVectorAngle(self) -> double"""
1494 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1495
1496 def SetVectorLength(*args, **kwargs):
1497 """SetVectorLength(self, double length)"""
1498 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1499
1500 def SetVectorAngle(*args, **kwargs):
1501 """SetVectorAngle(self, double degrees)"""
1502 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1503
1504 def SetPolarCoordinates(self, angle, length):
1505 self.SetVectorLength(length)
1506 self.SetVectorAngle(angle)
1507 def Normalize(self):
1508 self.SetVectorLength(1.0)
1509
1510 def GetDistance(*args, **kwargs):
1511 """GetDistance(self, Point2D pt) -> double"""
1512 return _core_.Point2D_GetDistance(*args, **kwargs)
1513
1514 def GetDistanceSquare(*args, **kwargs):
1515 """GetDistanceSquare(self, Point2D pt) -> double"""
1516 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1517
1518 def GetDotProduct(*args, **kwargs):
1519 """GetDotProduct(self, Point2D vec) -> double"""
1520 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1521
1522 def GetCrossProduct(*args, **kwargs):
1523 """GetCrossProduct(self, Point2D vec) -> double"""
1524 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1525
1526 def __neg__(*args, **kwargs):
1527 """
1528 __neg__(self) -> Point2D
1529
1530 the reflection of this point
1531 """
1532 return _core_.Point2D___neg__(*args, **kwargs)
1533
1534 def __iadd__(*args, **kwargs):
1535 """__iadd__(self, Point2D pt) -> Point2D"""
1536 return _core_.Point2D___iadd__(*args, **kwargs)
1537
1538 def __isub__(*args, **kwargs):
1539 """__isub__(self, Point2D pt) -> Point2D"""
1540 return _core_.Point2D___isub__(*args, **kwargs)
1541
1542 def __imul__(*args, **kwargs):
1543 """__imul__(self, Point2D pt) -> Point2D"""
1544 return _core_.Point2D___imul__(*args, **kwargs)
1545
1546 def __idiv__(*args, **kwargs):
1547 """__idiv__(self, Point2D pt) -> Point2D"""
1548 return _core_.Point2D___idiv__(*args, **kwargs)
1549
1550 def __eq__(*args, **kwargs):
1551 """
1552 __eq__(self, PyObject other) -> bool
1553
1554 Test for equality of wx.Point2D objects.
1555 """
1556 return _core_.Point2D___eq__(*args, **kwargs)
1557
1558 def __ne__(*args, **kwargs):
1559 """
1560 __ne__(self, PyObject other) -> bool
1561
1562 Test for inequality of wx.Point2D objects.
1563 """
1564 return _core_.Point2D___ne__(*args, **kwargs)
1565
1566 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1567 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1568 def Set(*args, **kwargs):
1569 """Set(self, double x=0, double y=0)"""
1570 return _core_.Point2D_Set(*args, **kwargs)
1571
1572 def Get(*args, **kwargs):
1573 """
1574 Get() -> (x,y)
1575
1576 Return x and y properties as a tuple.
1577 """
1578 return _core_.Point2D_Get(*args, **kwargs)
1579
1580 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1581 def __str__(self): return str(self.Get())
1582 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1583 def __len__(self): return len(self.Get())
1584 def __getitem__(self, index): return self.Get()[index]
1585 def __setitem__(self, index, val):
1586 if index == 0: self.x = val
1587 elif index == 1: self.y = val
1588 else: raise IndexError
1589 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1590 __safe_for_unpickling__ = True
1591 def __reduce__(self): return (wx.Point2D, self.Get())
1592
1593 Floor = property(GetFloor,doc="See `GetFloor`")
1594 Rounded = property(GetRounded,doc="See `GetRounded`")
1595 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1596 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
1597 _core_.Point2D_swigregister(Point2D)
1598
1599 def Point2DCopy(*args, **kwargs):
1600 """
1601 Point2DCopy(Point2D pt) -> Point2D
1602
1603 Create a w.Point2D object.
1604 """
1605 val = _core_.new_Point2DCopy(*args, **kwargs)
1606 return val
1607
1608 def Point2DFromPoint(*args, **kwargs):
1609 """
1610 Point2DFromPoint(Point pt) -> Point2D
1611
1612 Create a w.Point2D object.
1613 """
1614 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1615 return val
1616
1617 #---------------------------------------------------------------------------
1618
1619 FromStart = _core_.FromStart
1620 FromCurrent = _core_.FromCurrent
1621 FromEnd = _core_.FromEnd
1622 class InputStream(object):
1623 """Proxy of C++ InputStream class"""
1624 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1625 __repr__ = _swig_repr
1626 def __init__(self, *args, **kwargs):
1627 """__init__(self, PyObject p) -> InputStream"""
1628 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1629 __swig_destroy__ = _core_.delete_InputStream
1630 __del__ = lambda self : None;
1631 def close(*args, **kwargs):
1632 """close(self)"""
1633 return _core_.InputStream_close(*args, **kwargs)
1634
1635 def flush(*args, **kwargs):
1636 """flush(self)"""
1637 return _core_.InputStream_flush(*args, **kwargs)
1638
1639 def eof(*args, **kwargs):
1640 """eof(self) -> bool"""
1641 return _core_.InputStream_eof(*args, **kwargs)
1642
1643 def read(*args, **kwargs):
1644 """read(self, int size=-1) -> PyObject"""
1645 return _core_.InputStream_read(*args, **kwargs)
1646
1647 def readline(*args, **kwargs):
1648 """readline(self, int size=-1) -> PyObject"""
1649 return _core_.InputStream_readline(*args, **kwargs)
1650
1651 def readlines(*args, **kwargs):
1652 """readlines(self, int sizehint=-1) -> PyObject"""
1653 return _core_.InputStream_readlines(*args, **kwargs)
1654
1655 def seek(*args, **kwargs):
1656 """seek(self, int offset, int whence=0)"""
1657 return _core_.InputStream_seek(*args, **kwargs)
1658
1659 def tell(*args, **kwargs):
1660 """tell(self) -> int"""
1661 return _core_.InputStream_tell(*args, **kwargs)
1662
1663 def Peek(*args, **kwargs):
1664 """Peek(self) -> char"""
1665 return _core_.InputStream_Peek(*args, **kwargs)
1666
1667 def GetC(*args, **kwargs):
1668 """GetC(self) -> char"""
1669 return _core_.InputStream_GetC(*args, **kwargs)
1670
1671 def LastRead(*args, **kwargs):
1672 """LastRead(self) -> size_t"""
1673 return _core_.InputStream_LastRead(*args, **kwargs)
1674
1675 def CanRead(*args, **kwargs):
1676 """CanRead(self) -> bool"""
1677 return _core_.InputStream_CanRead(*args, **kwargs)
1678
1679 def Eof(*args, **kwargs):
1680 """Eof(self) -> bool"""
1681 return _core_.InputStream_Eof(*args, **kwargs)
1682
1683 def Ungetch(*args, **kwargs):
1684 """Ungetch(self, char c) -> bool"""
1685 return _core_.InputStream_Ungetch(*args, **kwargs)
1686
1687 def SeekI(*args, **kwargs):
1688 """SeekI(self, long pos, int mode=FromStart) -> long"""
1689 return _core_.InputStream_SeekI(*args, **kwargs)
1690
1691 def TellI(*args, **kwargs):
1692 """TellI(self) -> long"""
1693 return _core_.InputStream_TellI(*args, **kwargs)
1694
1695 _core_.InputStream_swigregister(InputStream)
1696 DefaultPosition = cvar.DefaultPosition
1697 DefaultSize = cvar.DefaultSize
1698
1699 class OutputStream(object):
1700 """Proxy of C++ OutputStream class"""
1701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1702 def __init__(self): raise AttributeError, "No constructor defined"
1703 __repr__ = _swig_repr
1704 def write(*args, **kwargs):
1705 """write(self, PyObject obj)"""
1706 return _core_.OutputStream_write(*args, **kwargs)
1707
1708 def LastWrite(*args, **kwargs):
1709 """LastWrite(self) -> size_t"""
1710 return _core_.OutputStream_LastWrite(*args, **kwargs)
1711
1712 _core_.OutputStream_swigregister(OutputStream)
1713
1714 #---------------------------------------------------------------------------
1715
1716 class FSFile(Object):
1717 """Proxy of C++ FSFile class"""
1718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1719 __repr__ = _swig_repr
1720 def __init__(self, *args, **kwargs):
1721 """
1722 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1723 DateTime modif) -> FSFile
1724 """
1725 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1726 __swig_destroy__ = _core_.delete_FSFile
1727 __del__ = lambda self : None;
1728 def GetStream(*args, **kwargs):
1729 """GetStream(self) -> InputStream"""
1730 return _core_.FSFile_GetStream(*args, **kwargs)
1731
1732 def DetachStream(*args, **kwargs):
1733 """DetachStream(self)"""
1734 return _core_.FSFile_DetachStream(*args, **kwargs)
1735
1736 def GetMimeType(*args, **kwargs):
1737 """GetMimeType(self) -> String"""
1738 return _core_.FSFile_GetMimeType(*args, **kwargs)
1739
1740 def GetLocation(*args, **kwargs):
1741 """GetLocation(self) -> String"""
1742 return _core_.FSFile_GetLocation(*args, **kwargs)
1743
1744 def GetAnchor(*args, **kwargs):
1745 """GetAnchor(self) -> String"""
1746 return _core_.FSFile_GetAnchor(*args, **kwargs)
1747
1748 def GetModificationTime(*args, **kwargs):
1749 """GetModificationTime(self) -> DateTime"""
1750 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1751
1752 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1753 Location = property(GetLocation,doc="See `GetLocation`")
1754 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1755 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1756 Stream = property(GetStream,doc="See `GetStream`")
1757 _core_.FSFile_swigregister(FSFile)
1758
1759 class CPPFileSystemHandler(object):
1760 """Proxy of C++ CPPFileSystemHandler class"""
1761 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1762 def __init__(self): raise AttributeError, "No constructor defined"
1763 __repr__ = _swig_repr
1764 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1765 __del__ = lambda self : None;
1766 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1767
1768 class FileSystemHandler(CPPFileSystemHandler):
1769 """Proxy of C++ FileSystemHandler class"""
1770 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1771 __repr__ = _swig_repr
1772 def __init__(self, *args, **kwargs):
1773 """__init__(self) -> FileSystemHandler"""
1774 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1775 self._setCallbackInfo(self, FileSystemHandler)
1776
1777 def _setCallbackInfo(*args, **kwargs):
1778 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1779 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1780
1781 def CanOpen(*args, **kwargs):
1782 """CanOpen(self, String location) -> bool"""
1783 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1784
1785 def OpenFile(*args, **kwargs):
1786 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1787 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1788
1789 def FindFirst(*args, **kwargs):
1790 """FindFirst(self, String spec, int flags=0) -> String"""
1791 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1792
1793 def FindNext(*args, **kwargs):
1794 """FindNext(self) -> String"""
1795 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1796
1797 def GetProtocol(*args, **kwargs):
1798 """GetProtocol(self, String location) -> String"""
1799 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1800
1801 def GetLeftLocation(*args, **kwargs):
1802 """GetLeftLocation(self, String location) -> String"""
1803 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1804
1805 def GetAnchor(*args, **kwargs):
1806 """GetAnchor(self, String location) -> String"""
1807 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1808
1809 def GetRightLocation(*args, **kwargs):
1810 """GetRightLocation(self, String location) -> String"""
1811 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1812
1813 def GetMimeTypeFromExt(*args, **kwargs):
1814 """GetMimeTypeFromExt(self, String location) -> String"""
1815 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1816
1817 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1818 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1819 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1820 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1821 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
1822 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1823
1824 class FileSystem(Object):
1825 """Proxy of C++ FileSystem class"""
1826 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1827 __repr__ = _swig_repr
1828 def __init__(self, *args, **kwargs):
1829 """__init__(self) -> FileSystem"""
1830 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1831 __swig_destroy__ = _core_.delete_FileSystem
1832 __del__ = lambda self : None;
1833 def ChangePathTo(*args, **kwargs):
1834 """ChangePathTo(self, String location, bool is_dir=False)"""
1835 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1836
1837 def GetPath(*args, **kwargs):
1838 """GetPath(self) -> String"""
1839 return _core_.FileSystem_GetPath(*args, **kwargs)
1840
1841 def OpenFile(*args, **kwargs):
1842 """OpenFile(self, String location) -> FSFile"""
1843 return _core_.FileSystem_OpenFile(*args, **kwargs)
1844
1845 def FindFirst(*args, **kwargs):
1846 """FindFirst(self, String spec, int flags=0) -> String"""
1847 return _core_.FileSystem_FindFirst(*args, **kwargs)
1848
1849 def FindNext(*args, **kwargs):
1850 """FindNext(self) -> String"""
1851 return _core_.FileSystem_FindNext(*args, **kwargs)
1852
1853 def AddHandler(*args, **kwargs):
1854 """AddHandler(CPPFileSystemHandler handler)"""
1855 return _core_.FileSystem_AddHandler(*args, **kwargs)
1856
1857 AddHandler = staticmethod(AddHandler)
1858 def RemoveHandler(*args, **kwargs):
1859 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1860 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1861
1862 RemoveHandler = staticmethod(RemoveHandler)
1863 def CleanUpHandlers(*args, **kwargs):
1864 """CleanUpHandlers()"""
1865 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1866
1867 CleanUpHandlers = staticmethod(CleanUpHandlers)
1868 def FileNameToURL(*args, **kwargs):
1869 """FileNameToURL(String filename) -> String"""
1870 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1871
1872 FileNameToURL = staticmethod(FileNameToURL)
1873 def URLToFileName(*args, **kwargs):
1874 """URLToFileName(String url) -> String"""
1875 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1876
1877 URLToFileName = staticmethod(URLToFileName)
1878 Path = property(GetPath,doc="See `GetPath`")
1879 _core_.FileSystem_swigregister(FileSystem)
1880
1881 def FileSystem_AddHandler(*args, **kwargs):
1882 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1883 return _core_.FileSystem_AddHandler(*args, **kwargs)
1884
1885 def FileSystem_RemoveHandler(*args, **kwargs):
1886 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1887 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1888
1889 def FileSystem_CleanUpHandlers(*args):
1890 """FileSystem_CleanUpHandlers()"""
1891 return _core_.FileSystem_CleanUpHandlers(*args)
1892
1893 def FileSystem_FileNameToURL(*args, **kwargs):
1894 """FileSystem_FileNameToURL(String filename) -> String"""
1895 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1896
1897 def FileSystem_URLToFileName(*args, **kwargs):
1898 """FileSystem_URLToFileName(String url) -> String"""
1899 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1900
1901 class InternetFSHandler(CPPFileSystemHandler):
1902 """Proxy of C++ InternetFSHandler class"""
1903 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1904 __repr__ = _swig_repr
1905 def __init__(self, *args, **kwargs):
1906 """__init__(self) -> InternetFSHandler"""
1907 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1908 def CanOpen(*args, **kwargs):
1909 """CanOpen(self, String location) -> bool"""
1910 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1911
1912 def OpenFile(*args, **kwargs):
1913 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1914 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1915
1916 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1917
1918 class ZipFSHandler(CPPFileSystemHandler):
1919 """Proxy of C++ ZipFSHandler class"""
1920 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1921 __repr__ = _swig_repr
1922 def __init__(self, *args, **kwargs):
1923 """__init__(self) -> ZipFSHandler"""
1924 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1925 def CanOpen(*args, **kwargs):
1926 """CanOpen(self, String location) -> bool"""
1927 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1928
1929 def OpenFile(*args, **kwargs):
1930 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1931 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1932
1933 def FindFirst(*args, **kwargs):
1934 """FindFirst(self, String spec, int flags=0) -> String"""
1935 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1936
1937 def FindNext(*args, **kwargs):
1938 """FindNext(self) -> String"""
1939 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1940
1941 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1942
1943
1944 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1945 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1946 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1947
1948 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1949 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1950 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1951
1952 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1953 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1954 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1955 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1956 """
1957 Add 'file' to the memory filesystem. The dataItem parameter can
1958 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1959 arbitrary data. If a bitmap or image is used then the imgType
1960 parameter should specify what kind of image file it should be
1961 written as, wx.BITMAP_TYPE_PNG, etc.
1962 """
1963 if isinstance(dataItem, wx.Image):
1964 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1965 elif isinstance(dataItem, wx.Bitmap):
1966 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1967 elif type(dataItem) == str:
1968 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1969 else:
1970 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1971
1972 class MemoryFSHandler(CPPFileSystemHandler):
1973 """Proxy of C++ MemoryFSHandler class"""
1974 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1975 __repr__ = _swig_repr
1976 def __init__(self, *args, **kwargs):
1977 """__init__(self) -> MemoryFSHandler"""
1978 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1979 def RemoveFile(*args, **kwargs):
1980 """RemoveFile(String filename)"""
1981 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1982
1983 RemoveFile = staticmethod(RemoveFile)
1984 AddFile = staticmethod(MemoryFSHandler_AddFile)
1985 def CanOpen(*args, **kwargs):
1986 """CanOpen(self, String location) -> bool"""
1987 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1988
1989 def OpenFile(*args, **kwargs):
1990 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1991 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1992
1993 def FindFirst(*args, **kwargs):
1994 """FindFirst(self, String spec, int flags=0) -> String"""
1995 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1996
1997 def FindNext(*args, **kwargs):
1998 """FindNext(self) -> String"""
1999 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2000
2001 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
2002
2003 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2004 """MemoryFSHandler_RemoveFile(String filename)"""
2005 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2006
2007 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2008 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2009 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2010 #---------------------------------------------------------------------------
2011
2012 class ImageHandler(Object):
2013 """
2014 This is the base class for implementing image file loading/saving, and
2015 image creation from data. It is used within `wx.Image` and is not
2016 normally seen by the application.
2017 """
2018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2019 def __init__(self): raise AttributeError, "No constructor defined"
2020 __repr__ = _swig_repr
2021 def GetName(*args, **kwargs):
2022 """GetName(self) -> String"""
2023 return _core_.ImageHandler_GetName(*args, **kwargs)
2024
2025 def GetExtension(*args, **kwargs):
2026 """GetExtension(self) -> String"""
2027 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2028
2029 def GetType(*args, **kwargs):
2030 """GetType(self) -> long"""
2031 return _core_.ImageHandler_GetType(*args, **kwargs)
2032
2033 def GetMimeType(*args, **kwargs):
2034 """GetMimeType(self) -> String"""
2035 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2036
2037 def CanRead(*args, **kwargs):
2038 """CanRead(self, String name) -> bool"""
2039 return _core_.ImageHandler_CanRead(*args, **kwargs)
2040
2041 def CanReadStream(*args, **kwargs):
2042 """CanReadStream(self, InputStream stream) -> bool"""
2043 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2044
2045 def SetName(*args, **kwargs):
2046 """SetName(self, String name)"""
2047 return _core_.ImageHandler_SetName(*args, **kwargs)
2048
2049 def SetExtension(*args, **kwargs):
2050 """SetExtension(self, String extension)"""
2051 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2052
2053 def SetType(*args, **kwargs):
2054 """SetType(self, long type)"""
2055 return _core_.ImageHandler_SetType(*args, **kwargs)
2056
2057 def SetMimeType(*args, **kwargs):
2058 """SetMimeType(self, String mimetype)"""
2059 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2060
2061 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2062 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2063 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2064 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2065 _core_.ImageHandler_swigregister(ImageHandler)
2066
2067 class PyImageHandler(ImageHandler):
2068 """
2069 This is the base class for implementing image file loading/saving, and
2070 image creation from data, all written in Python. To create a custom
2071 image handler derive a new class from wx.PyImageHandler and provide
2072 the following methods::
2073
2074 def DoCanRead(self, stream) --> bool
2075 '''Check if this handler can read the image on the stream'''
2076
2077 def LoadFile(self, image, stream, verbose, index) --> bool
2078 '''Load image data from the stream and load it into image.'''
2079
2080 def SaveFile(self, image, stream, verbose) --> bool
2081 '''Save the iamge data in image to the stream using
2082 this handler's image file format.'''
2083
2084 def GetImageCount(self, stream) --> int
2085 '''If this image format can hold more than one image,
2086 how many does the image on the stream have?'''
2087
2088 To activate your handler create an instance of it and pass it to
2089 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2090 `SetExtension` from your constructor.
2091
2092 """
2093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2094 __repr__ = _swig_repr
2095 def __init__(self, *args, **kwargs):
2096 """
2097 __init__(self) -> PyImageHandler
2098
2099 This is the base class for implementing image file loading/saving, and
2100 image creation from data, all written in Python. To create a custom
2101 image handler derive a new class from wx.PyImageHandler and provide
2102 the following methods::
2103
2104 def DoCanRead(self, stream) --> bool
2105 '''Check if this handler can read the image on the stream'''
2106
2107 def LoadFile(self, image, stream, verbose, index) --> bool
2108 '''Load image data from the stream and load it into image.'''
2109
2110 def SaveFile(self, image, stream, verbose) --> bool
2111 '''Save the iamge data in image to the stream using
2112 this handler's image file format.'''
2113
2114 def GetImageCount(self, stream) --> int
2115 '''If this image format can hold more than one image,
2116 how many does the image on the stream have?'''
2117
2118 To activate your handler create an instance of it and pass it to
2119 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2120 `SetExtension` from your constructor.
2121
2122 """
2123 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2124 self._SetSelf(self)
2125
2126 def _SetSelf(*args, **kwargs):
2127 """_SetSelf(self, PyObject self)"""
2128 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2129
2130 _core_.PyImageHandler_swigregister(PyImageHandler)
2131
2132 class ImageHistogram(object):
2133 """Proxy of C++ ImageHistogram class"""
2134 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2135 __repr__ = _swig_repr
2136 def __init__(self, *args, **kwargs):
2137 """__init__(self) -> ImageHistogram"""
2138 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2139 def MakeKey(*args, **kwargs):
2140 """
2141 MakeKey(byte r, byte g, byte b) -> unsigned long
2142
2143 Get the key in the histogram for the given RGB values
2144 """
2145 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2146
2147 MakeKey = staticmethod(MakeKey)
2148 def FindFirstUnusedColour(*args, **kwargs):
2149 """
2150 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2151
2152 Find first colour that is not used in the image and has higher RGB
2153 values than startR, startG, startB. Returns a tuple consisting of a
2154 success flag and rgb values.
2155 """
2156 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2157
2158 def GetCount(*args, **kwargs):
2159 """
2160 GetCount(self, unsigned long key) -> unsigned long
2161
2162 Returns the pixel count for the given key. Use `MakeKey` to create a
2163 key value from a RGB tripple.
2164 """
2165 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2166
2167 def GetCountRGB(*args, **kwargs):
2168 """
2169 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2170
2171 Returns the pixel count for the given RGB values.
2172 """
2173 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2174
2175 def GetCountColour(*args, **kwargs):
2176 """
2177 GetCountColour(self, Colour colour) -> unsigned long
2178
2179 Returns the pixel count for the given `wx.Colour` value.
2180 """
2181 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2182
2183 _core_.ImageHistogram_swigregister(ImageHistogram)
2184
2185 def ImageHistogram_MakeKey(*args, **kwargs):
2186 """
2187 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2188
2189 Get the key in the histogram for the given RGB values
2190 """
2191 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2192
2193 class Image_RGBValue(object):
2194 """
2195 An object that contains values for red, green and blue which represent
2196 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2197 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2198 color space.
2199 """
2200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2201 __repr__ = _swig_repr
2202 def __init__(self, *args, **kwargs):
2203 """
2204 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2205
2206 Constructor.
2207 """
2208 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2209 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2210 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2211 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2212 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2213
2214 class Image_HSVValue(object):
2215 """
2216 An object that contains values for hue, saturation and value which
2217 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2218 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2219 color space.
2220 """
2221 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2222 __repr__ = _swig_repr
2223 def __init__(self, *args, **kwargs):
2224 """
2225 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2226
2227 Constructor.
2228 """
2229 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2230 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2231 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2232 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2233 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2234
2235 class Image(Object):
2236 """
2237 A platform-independent image class. An image can be created from
2238 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2239 variety of formats. Functions are available to set and get image
2240 bits, so it can be used for basic image manipulation.
2241
2242 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2243 platform-specific `wx.Bitmap` object must be created from it using the
2244 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2245 device context, using `wx.DC.DrawBitmap`.
2246
2247 One colour value of the image may be used as a mask colour which will
2248 lead to the automatic creation of a `wx.Mask` object associated to the
2249 bitmap object.
2250
2251 wx.Image supports alpha channel data, that is in addition to a byte
2252 for the red, green and blue colour components for each pixel it also
2253 stores a byte representing the pixel opacity. An alpha value of 0
2254 corresponds to a transparent pixel (null opacity) while a value of 255
2255 means that the pixel is 100% opaque.
2256
2257 Unlike RGB data, not all images have an alpha channel and before using
2258 `GetAlpha` you should check if this image contains an alpha channel
2259 with `HasAlpha`. Note that currently only images loaded from PNG files
2260 with transparency information will have an alpha channel.
2261 """
2262 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2263 __repr__ = _swig_repr
2264 def __init__(self, *args, **kwargs):
2265 """
2266 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2267
2268 Loads an image from a file.
2269 """
2270 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2271 __swig_destroy__ = _core_.delete_Image
2272 __del__ = lambda self : None;
2273 def Create(*args, **kwargs):
2274 """
2275 Create(self, int width, int height, bool clear=True)
2276
2277 Creates a fresh image. If clear is ``True``, the new image will be
2278 initialized to black. Otherwise, the image data will be uninitialized.
2279 """
2280 return _core_.Image_Create(*args, **kwargs)
2281
2282 def Destroy(*args, **kwargs):
2283 """
2284 Destroy(self)
2285
2286 Destroys the image data.
2287 """
2288 val = _core_.Image_Destroy(*args, **kwargs)
2289 args[0].thisown = 0
2290 return val
2291
2292 def Scale(*args, **kwargs):
2293 """
2294 Scale(self, int width, int height) -> Image
2295
2296 Returns a scaled version of the image. This is also useful for scaling
2297 bitmaps in general as the only other way to scale bitmaps is to blit a
2298 `wx.MemoryDC` into another `wx.MemoryDC`.
2299 """
2300 return _core_.Image_Scale(*args, **kwargs)
2301
2302 def ShrinkBy(*args, **kwargs):
2303 """
2304 ShrinkBy(self, int xFactor, int yFactor) -> Image
2305
2306 Return a version of the image scaled smaller by the given factors.
2307 """
2308 return _core_.Image_ShrinkBy(*args, **kwargs)
2309
2310 def Rescale(*args, **kwargs):
2311 """
2312 Rescale(self, int width, int height) -> Image
2313
2314 Changes the size of the image in-place by scaling it: after a call to
2315 this function, the image will have the given width and height.
2316
2317 Returns the (modified) image itself.
2318 """
2319 return _core_.Image_Rescale(*args, **kwargs)
2320
2321 def Resize(*args, **kwargs):
2322 """
2323 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2324
2325 Changes the size of the image in-place without scaling it, by adding
2326 either a border with the given colour or cropping as necessary. The
2327 image is pasted into a new image with the given size and background
2328 colour at the position pos relative to the upper left of the new
2329 image. If red = green = blue = -1 then use either the current mask
2330 colour if set or find, use, and set a suitable mask colour for any
2331 newly exposed areas.
2332
2333 Returns the (modified) image itself.
2334 """
2335 return _core_.Image_Resize(*args, **kwargs)
2336
2337 def SetRGB(*args, **kwargs):
2338 """
2339 SetRGB(self, int x, int y, byte r, byte g, byte b)
2340
2341 Sets the pixel at the given coordinate. This routine performs
2342 bounds-checks for the coordinate so it can be considered a safe way to
2343 manipulate the data, but in some cases this might be too slow so that
2344 the data will have to be set directly. In that case you will have to
2345 get access to the image data using the `GetData` method.
2346 """
2347 return _core_.Image_SetRGB(*args, **kwargs)
2348
2349 def SetRGBRect(*args, **kwargs):
2350 """
2351 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2352
2353 Sets the colour of the pixels within the given rectangle. This routine
2354 performs bounds-checks for the rectangle so it can be considered a
2355 safe way to manipulate the data.
2356 """
2357 return _core_.Image_SetRGBRect(*args, **kwargs)
2358
2359 def GetRed(*args, **kwargs):
2360 """
2361 GetRed(self, int x, int y) -> byte
2362
2363 Returns the red intensity at the given coordinate.
2364 """
2365 return _core_.Image_GetRed(*args, **kwargs)
2366
2367 def GetGreen(*args, **kwargs):
2368 """
2369 GetGreen(self, int x, int y) -> byte
2370
2371 Returns the green intensity at the given coordinate.
2372 """
2373 return _core_.Image_GetGreen(*args, **kwargs)
2374
2375 def GetBlue(*args, **kwargs):
2376 """
2377 GetBlue(self, int x, int y) -> byte
2378
2379 Returns the blue intensity at the given coordinate.
2380 """
2381 return _core_.Image_GetBlue(*args, **kwargs)
2382
2383 def SetAlpha(*args, **kwargs):
2384 """
2385 SetAlpha(self, int x, int y, byte alpha)
2386
2387 Sets the alpha value for the given pixel. This function should only be
2388 called if the image has alpha channel data, use `HasAlpha` to check
2389 for this.
2390 """
2391 return _core_.Image_SetAlpha(*args, **kwargs)
2392
2393 def GetAlpha(*args, **kwargs):
2394 """
2395 GetAlpha(self, int x, int y) -> byte
2396
2397 Returns the alpha value for the given pixel. This function may only be
2398 called for the images with alpha channel, use `HasAlpha` to check for
2399 this.
2400
2401 The returned value is the *opacity* of the image, i.e. the value of 0
2402 corresponds to the fully transparent pixels while the value of 255 to
2403 the fully opaque pixels.
2404 """
2405 return _core_.Image_GetAlpha(*args, **kwargs)
2406
2407 def HasAlpha(*args, **kwargs):
2408 """
2409 HasAlpha(self) -> bool
2410
2411 Returns true if this image has alpha channel, false otherwise.
2412 """
2413 return _core_.Image_HasAlpha(*args, **kwargs)
2414
2415 def InitAlpha(*args, **kwargs):
2416 """
2417 InitAlpha(self)
2418
2419 Initializes the image alpha channel data. It is an error to call it if
2420 the image already has alpha data. If it doesn't, alpha data will be by
2421 default initialized to all pixels being fully opaque. But if the image
2422 has a a mask colour, all mask pixels will be completely transparent.
2423 """
2424 return _core_.Image_InitAlpha(*args, **kwargs)
2425
2426 def IsTransparent(*args, **kwargs):
2427 """
2428 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2429
2430 Returns ``True`` if this pixel is masked or has an alpha value less
2431 than the spcified threshold.
2432 """
2433 return _core_.Image_IsTransparent(*args, **kwargs)
2434
2435 def FindFirstUnusedColour(*args, **kwargs):
2436 """
2437 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2438
2439 Find first colour that is not used in the image and has higher RGB
2440 values than startR, startG, startB. Returns a tuple consisting of a
2441 success flag and rgb values.
2442 """
2443 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2444
2445 def ConvertAlphaToMask(*args, **kwargs):
2446 """
2447 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2448
2449 If the image has alpha channel, this method converts it to mask. All
2450 pixels with alpha value less than ``threshold`` are replaced with the
2451 mask colour and the alpha channel is removed. The mask colour is
2452 chosen automatically using `FindFirstUnusedColour`.
2453
2454 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2455 nothing.
2456 """
2457 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2458
2459 def ConvertColourToAlpha(*args, **kwargs):
2460 """
2461 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2462
2463 This method converts an image where the original alpha information is
2464 only available as a shades of a colour (actually shades of grey)
2465 typically when you draw anti-aliased text into a bitmap. The DC
2466 drawing routines draw grey values on the black background although
2467 they actually mean to draw white with differnt alpha values. This
2468 method reverses it, assuming a black (!) background and white text.
2469 The method will then fill up the whole image with the colour given.
2470 """
2471 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2472
2473 def SetMaskFromImage(*args, **kwargs):
2474 """
2475 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2476
2477 Sets the image's mask so that the pixels that have RGB value of
2478 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2479 by first finding an unused colour in the image, setting this colour as
2480 the mask colour and then using this colour to draw all pixels in the
2481 image who corresponding pixel in mask has given RGB value.
2482
2483 Returns ``False`` if ``mask`` does not have same dimensions as the
2484 image or if there is no unused colour left. Returns ``True`` if the
2485 mask was successfully applied.
2486
2487 Note that this method involves computing the histogram, which is
2488 computationally intensive operation.
2489 """
2490 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2491
2492 def CanRead(*args, **kwargs):
2493 """
2494 CanRead(String filename) -> bool
2495
2496 Returns True if the image handlers can read this file.
2497 """
2498 return _core_.Image_CanRead(*args, **kwargs)
2499
2500 CanRead = staticmethod(CanRead)
2501 def GetImageCount(*args, **kwargs):
2502 """
2503 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2504
2505 If the image file contains more than one image and the image handler
2506 is capable of retrieving these individually, this function will return
2507 the number of available images.
2508 """
2509 return _core_.Image_GetImageCount(*args, **kwargs)
2510
2511 GetImageCount = staticmethod(GetImageCount)
2512 def LoadFile(*args, **kwargs):
2513 """
2514 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2515
2516 Loads an image from a file. If no handler type is provided, the
2517 library will try to autodetect the format.
2518 """
2519 return _core_.Image_LoadFile(*args, **kwargs)
2520
2521 def LoadMimeFile(*args, **kwargs):
2522 """
2523 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2524
2525 Loads an image from a file, specifying the image type with a MIME type
2526 string.
2527 """
2528 return _core_.Image_LoadMimeFile(*args, **kwargs)
2529
2530 def SaveFile(*args, **kwargs):
2531 """
2532 SaveFile(self, String name, int type) -> bool
2533
2534 Saves an image in the named file.
2535 """
2536 return _core_.Image_SaveFile(*args, **kwargs)
2537
2538 def SaveMimeFile(*args, **kwargs):
2539 """
2540 SaveMimeFile(self, String name, String mimetype) -> bool
2541
2542 Saves an image in the named file.
2543 """
2544 return _core_.Image_SaveMimeFile(*args, **kwargs)
2545
2546 def CanReadStream(*args, **kwargs):
2547 """
2548 CanReadStream(InputStream stream) -> bool
2549
2550 Returns True if the image handlers can read an image file from the
2551 data currently on the input stream, or a readable Python file-like
2552 object.
2553 """
2554 return _core_.Image_CanReadStream(*args, **kwargs)
2555
2556 CanReadStream = staticmethod(CanReadStream)
2557 def LoadStream(*args, **kwargs):
2558 """
2559 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2560
2561 Loads an image from an input stream or a readable Python file-like
2562 object. If no handler type is provided, the library will try to
2563 autodetect the format.
2564 """
2565 return _core_.Image_LoadStream(*args, **kwargs)
2566
2567 def LoadMimeStream(*args, **kwargs):
2568 """
2569 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2570
2571 Loads an image from an input stream or a readable Python file-like
2572 object, using a MIME type string to specify the image file format.
2573 """
2574 return _core_.Image_LoadMimeStream(*args, **kwargs)
2575
2576 def Ok(*args, **kwargs):
2577 """
2578 Ok(self) -> bool
2579
2580 Returns true if image data is present.
2581 """
2582 return _core_.Image_Ok(*args, **kwargs)
2583
2584 def GetWidth(*args, **kwargs):
2585 """
2586 GetWidth(self) -> int
2587
2588 Gets the width of the image in pixels.
2589 """
2590 return _core_.Image_GetWidth(*args, **kwargs)
2591
2592 def GetHeight(*args, **kwargs):
2593 """
2594 GetHeight(self) -> int
2595
2596 Gets the height of the image in pixels.
2597 """
2598 return _core_.Image_GetHeight(*args, **kwargs)
2599
2600 def GetSize(*args, **kwargs):
2601 """
2602 GetSize(self) -> Size
2603
2604 Returns the size of the image in pixels.
2605 """
2606 return _core_.Image_GetSize(*args, **kwargs)
2607
2608 def GetSubImage(*args, **kwargs):
2609 """
2610 GetSubImage(self, Rect rect) -> Image
2611
2612 Returns a sub image of the current one as long as the rect belongs
2613 entirely to the image.
2614 """
2615 return _core_.Image_GetSubImage(*args, **kwargs)
2616
2617 def Size(*args, **kwargs):
2618 """
2619 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2620
2621 Returns a resized version of this image without scaling it by adding
2622 either a border with the given colour or cropping as necessary. The
2623 image is pasted into a new image with the given size and background
2624 colour at the position ``pos`` relative to the upper left of the new
2625 image. If red = green = blue = -1 then use either the current mask
2626 colour if set or find, use, and set a suitable mask colour for any
2627 newly exposed areas.
2628 """
2629 return _core_.Image_Size(*args, **kwargs)
2630
2631 def Copy(*args, **kwargs):
2632 """
2633 Copy(self) -> Image
2634
2635 Returns an identical copy of the image.
2636 """
2637 return _core_.Image_Copy(*args, **kwargs)
2638
2639 def Paste(*args, **kwargs):
2640 """
2641 Paste(self, Image image, int x, int y)
2642
2643 Pastes ``image`` into this instance and takes care of the mask colour
2644 and any out of bounds problems.
2645 """
2646 return _core_.Image_Paste(*args, **kwargs)
2647
2648 def GetData(*args, **kwargs):
2649 """
2650 GetData(self) -> PyObject
2651
2652 Returns a string containing a copy of the RGB bytes of the image.
2653 """
2654 return _core_.Image_GetData(*args, **kwargs)
2655
2656 def SetData(*args, **kwargs):
2657 """
2658 SetData(self, buffer data)
2659
2660 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2661 either a string or a buffer object holding the data and the length of
2662 the data must be width*height*3.
2663 """
2664 return _core_.Image_SetData(*args, **kwargs)
2665
2666 def GetDataBuffer(*args, **kwargs):
2667 """
2668 GetDataBuffer(self) -> PyObject
2669
2670 Returns a writable Python buffer object that is pointing at the RGB
2671 image data buffer inside the wx.Image. You need to ensure that you do
2672 not use this buffer object after the image has been destroyed.
2673 """
2674 return _core_.Image_GetDataBuffer(*args, **kwargs)
2675
2676 def SetDataBuffer(*args, **kwargs):
2677 """
2678 SetDataBuffer(self, buffer data)
2679
2680 Sets the internal image data pointer to point at a Python buffer
2681 object. This can save making an extra copy of the data but you must
2682 ensure that the buffer object lives longer than the wx.Image does.
2683 """
2684 return _core_.Image_SetDataBuffer(*args, **kwargs)
2685
2686 def GetAlphaData(*args, **kwargs):
2687 """
2688 GetAlphaData(self) -> PyObject
2689
2690 Returns a string containing a copy of the alpha bytes of the image.
2691 """
2692 return _core_.Image_GetAlphaData(*args, **kwargs)
2693
2694 def SetAlphaData(*args, **kwargs):
2695 """
2696 SetAlphaData(self, buffer alpha)
2697
2698 Resets the Image's alpha data from a buffer of bytes. Accepts either
2699 a string or a buffer object holding the data and the length of the
2700 data must be width*height.
2701 """
2702 return _core_.Image_SetAlphaData(*args, **kwargs)
2703
2704 def GetAlphaBuffer(*args, **kwargs):
2705 """
2706 GetAlphaBuffer(self) -> PyObject
2707
2708 Returns a writable Python buffer object that is pointing at the Alpha
2709 data buffer inside the wx.Image. You need to ensure that you do not
2710 use this buffer object after the image has been destroyed.
2711 """
2712 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2713
2714 def SetAlphaBuffer(*args, **kwargs):
2715 """
2716 SetAlphaBuffer(self, buffer alpha)
2717
2718 Sets the internal image alpha pointer to point at a Python buffer
2719 object. This can save making an extra copy of the data but you must
2720 ensure that the buffer object lives as long as the wx.Image does.
2721 """
2722 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2723
2724 def SetMaskColour(*args, **kwargs):
2725 """
2726 SetMaskColour(self, byte r, byte g, byte b)
2727
2728 Sets the mask colour for this image (and tells the image to use the
2729 mask).
2730 """
2731 return _core_.Image_SetMaskColour(*args, **kwargs)
2732
2733 def GetOrFindMaskColour(*args, **kwargs):
2734 """
2735 GetOrFindMaskColour() -> (r,g,b)
2736
2737 Get the current mask colour or find a suitable colour.
2738 """
2739 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2740
2741 def GetMaskRed(*args, **kwargs):
2742 """
2743 GetMaskRed(self) -> byte
2744
2745 Gets the red component of the mask colour.
2746 """
2747 return _core_.Image_GetMaskRed(*args, **kwargs)
2748
2749 def GetMaskGreen(*args, **kwargs):
2750 """
2751 GetMaskGreen(self) -> byte
2752
2753 Gets the green component of the mask colour.
2754 """
2755 return _core_.Image_GetMaskGreen(*args, **kwargs)
2756
2757 def GetMaskBlue(*args, **kwargs):
2758 """
2759 GetMaskBlue(self) -> byte
2760
2761 Gets the blue component of the mask colour.
2762 """
2763 return _core_.Image_GetMaskBlue(*args, **kwargs)
2764
2765 def SetMask(*args, **kwargs):
2766 """
2767 SetMask(self, bool mask=True)
2768
2769 Specifies whether there is a mask or not. The area of the mask is
2770 determined by the current mask colour.
2771 """
2772 return _core_.Image_SetMask(*args, **kwargs)
2773
2774 def HasMask(*args, **kwargs):
2775 """
2776 HasMask(self) -> bool
2777
2778 Returns ``True`` if there is a mask active, ``False`` otherwise.
2779 """
2780 return _core_.Image_HasMask(*args, **kwargs)
2781
2782 def Rotate(*args, **kwargs):
2783 """
2784 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2785 Point offset_after_rotation=None) -> Image
2786
2787 Rotates the image about the given point, by ``angle`` radians. Passing
2788 ``True`` to ``interpolating`` results in better image quality, but is
2789 slower. If the image has a mask, then the mask colour is used for the
2790 uncovered pixels in the rotated image background. Otherwise, black
2791 will be used as the fill colour.
2792
2793 Returns the rotated image, leaving this image intact.
2794 """
2795 return _core_.Image_Rotate(*args, **kwargs)
2796
2797 def Rotate90(*args, **kwargs):
2798 """
2799 Rotate90(self, bool clockwise=True) -> Image
2800
2801 Returns a copy of the image rotated 90 degrees in the direction
2802 indicated by ``clockwise``.
2803 """
2804 return _core_.Image_Rotate90(*args, **kwargs)
2805
2806 def Mirror(*args, **kwargs):
2807 """
2808 Mirror(self, bool horizontally=True) -> Image
2809
2810 Returns a mirrored copy of the image. The parameter ``horizontally``
2811 indicates the orientation.
2812 """
2813 return _core_.Image_Mirror(*args, **kwargs)
2814
2815 def Replace(*args, **kwargs):
2816 """
2817 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2818
2819 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2820 ``(r2,g2,b2)``.
2821 """
2822 return _core_.Image_Replace(*args, **kwargs)
2823
2824 def ConvertToGreyscale(*args, **kwargs):
2825 """
2826 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2827
2828 Convert to greyscale image. Uses the luminance component (Y) of the
2829 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2830 defaults to ITU-T BT.601
2831 """
2832 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2833
2834 def ConvertToMono(*args, **kwargs):
2835 """
2836 ConvertToMono(self, byte r, byte g, byte b) -> Image
2837
2838 Returns monochromatic version of the image. The returned image has
2839 white colour where the original has ``(r,g,b)`` colour and black
2840 colour everywhere else.
2841 """
2842 return _core_.Image_ConvertToMono(*args, **kwargs)
2843
2844 def SetOption(*args, **kwargs):
2845 """
2846 SetOption(self, String name, String value)
2847
2848 Sets an image handler defined option. For example, when saving as a
2849 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2850 number between 0 and 100 (0 is terrible, 100 is very good).
2851 """
2852 return _core_.Image_SetOption(*args, **kwargs)
2853
2854 def SetOptionInt(*args, **kwargs):
2855 """
2856 SetOptionInt(self, String name, int value)
2857
2858 Sets an image option as an integer.
2859 """
2860 return _core_.Image_SetOptionInt(*args, **kwargs)
2861
2862 def GetOption(*args, **kwargs):
2863 """
2864 GetOption(self, String name) -> String
2865
2866 Gets the value of an image handler option.
2867 """
2868 return _core_.Image_GetOption(*args, **kwargs)
2869
2870 def GetOptionInt(*args, **kwargs):
2871 """
2872 GetOptionInt(self, String name) -> int
2873
2874 Gets the value of an image handler option as an integer. If the given
2875 option is not present, the function returns 0.
2876 """
2877 return _core_.Image_GetOptionInt(*args, **kwargs)
2878
2879 def HasOption(*args, **kwargs):
2880 """
2881 HasOption(self, String name) -> bool
2882
2883 Returns true if the given option is present.
2884 """
2885 return _core_.Image_HasOption(*args, **kwargs)
2886
2887 def CountColours(*args, **kwargs):
2888 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2889 return _core_.Image_CountColours(*args, **kwargs)
2890
2891 def ComputeHistogram(*args, **kwargs):
2892 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2893 return _core_.Image_ComputeHistogram(*args, **kwargs)
2894
2895 def AddHandler(*args, **kwargs):
2896 """AddHandler(ImageHandler handler)"""
2897 return _core_.Image_AddHandler(*args, **kwargs)
2898
2899 AddHandler = staticmethod(AddHandler)
2900 def InsertHandler(*args, **kwargs):
2901 """InsertHandler(ImageHandler handler)"""
2902 return _core_.Image_InsertHandler(*args, **kwargs)
2903
2904 InsertHandler = staticmethod(InsertHandler)
2905 def RemoveHandler(*args, **kwargs):
2906 """RemoveHandler(String name) -> bool"""
2907 return _core_.Image_RemoveHandler(*args, **kwargs)
2908
2909 RemoveHandler = staticmethod(RemoveHandler)
2910 def GetHandlers(*args, **kwargs):
2911 """GetHandlers() -> PyObject"""
2912 return _core_.Image_GetHandlers(*args, **kwargs)
2913
2914 GetHandlers = staticmethod(GetHandlers)
2915 def GetImageExtWildcard(*args, **kwargs):
2916 """
2917 GetImageExtWildcard() -> String
2918
2919 Iterates all registered wxImageHandler objects, and returns a string
2920 containing file extension masks suitable for passing to file open/save
2921 dialog boxes.
2922 """
2923 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2924
2925 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2926 def ConvertToBitmap(*args, **kwargs):
2927 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2928 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2929
2930 def ConvertToMonoBitmap(*args, **kwargs):
2931 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2932 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2933
2934 def RotateHue(*args, **kwargs):
2935 """
2936 RotateHue(self, double angle)
2937
2938 Rotates the hue of each pixel of the image. Hue is a double in the
2939 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2940 """
2941 return _core_.Image_RotateHue(*args, **kwargs)
2942
2943 def RGBtoHSV(*args, **kwargs):
2944 """
2945 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2946
2947 Converts a color in RGB color space to HSV color space.
2948 """
2949 return _core_.Image_RGBtoHSV(*args, **kwargs)
2950
2951 RGBtoHSV = staticmethod(RGBtoHSV)
2952 def HSVtoRGB(*args, **kwargs):
2953 """
2954 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2955
2956 Converts a color in HSV color space to RGB color space.
2957 """
2958 return _core_.Image_HSVtoRGB(*args, **kwargs)
2959
2960 HSVtoRGB = staticmethod(HSVtoRGB)
2961 def __nonzero__(self): return self.Ok()
2962 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2963 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
2964 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
2965 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
2966 Height = property(GetHeight,doc="See `GetHeight`")
2967 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
2968 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
2969 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
2970 Size = property(GetSize,doc="See `GetSize`")
2971 Width = property(GetWidth,doc="See `GetWidth`")
2972 _core_.Image_swigregister(Image)
2973
2974 def ImageFromMime(*args, **kwargs):
2975 """
2976 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2977
2978 Loads an image from a file, using a MIME type string (such as
2979 'image/jpeg') to specify image type.
2980 """
2981 val = _core_.new_ImageFromMime(*args, **kwargs)
2982 return val
2983
2984 def ImageFromStream(*args, **kwargs):
2985 """
2986 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2987
2988 Loads an image from an input stream, or any readable Python file-like
2989 object.
2990 """
2991 val = _core_.new_ImageFromStream(*args, **kwargs)
2992 return val
2993
2994 def ImageFromStreamMime(*args, **kwargs):
2995 """
2996 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2997
2998 Loads an image from an input stream, or any readable Python file-like
2999 object, specifying the image format with a MIME type string.
3000 """
3001 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3002 return val
3003
3004 def EmptyImage(*args, **kwargs):
3005 """
3006 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3007
3008 Construct an empty image of a given size, optionally setting all
3009 pixels to black.
3010 """
3011 val = _core_.new_EmptyImage(*args, **kwargs)
3012 return val
3013
3014 def ImageFromBitmap(*args, **kwargs):
3015 """
3016 ImageFromBitmap(Bitmap bitmap) -> Image
3017
3018 Construct an Image from a `wx.Bitmap`.
3019 """
3020 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3021 return val
3022
3023 def ImageFromData(*args, **kwargs):
3024 """
3025 ImageFromData(int width, int height, buffer data) -> Image
3026
3027 Construct an Image from a buffer of RGB bytes. Accepts either a
3028 string or a buffer object holding the data and the length of the data
3029 must be width*height*3.
3030 """
3031 val = _core_.new_ImageFromData(*args, **kwargs)
3032 return val
3033
3034 def ImageFromDataWithAlpha(*args, **kwargs):
3035 """
3036 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3037
3038 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3039 Accepts either a string or a buffer object holding the data and the
3040 length of the data must be width*height*3 bytes, and the length of the
3041 alpha data must be width*height bytes.
3042 """
3043 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3044 return val
3045
3046 def Image_CanRead(*args, **kwargs):
3047 """
3048 Image_CanRead(String filename) -> bool
3049
3050 Returns True if the image handlers can read this file.
3051 """
3052 return _core_.Image_CanRead(*args, **kwargs)
3053
3054 def Image_GetImageCount(*args, **kwargs):
3055 """
3056 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3057
3058 If the image file contains more than one image and the image handler
3059 is capable of retrieving these individually, this function will return
3060 the number of available images.
3061 """
3062 return _core_.Image_GetImageCount(*args, **kwargs)
3063
3064 def Image_CanReadStream(*args, **kwargs):
3065 """
3066 Image_CanReadStream(InputStream stream) -> bool
3067
3068 Returns True if the image handlers can read an image file from the
3069 data currently on the input stream, or a readable Python file-like
3070 object.
3071 """
3072 return _core_.Image_CanReadStream(*args, **kwargs)
3073
3074 def Image_AddHandler(*args, **kwargs):
3075 """Image_AddHandler(ImageHandler handler)"""
3076 return _core_.Image_AddHandler(*args, **kwargs)
3077
3078 def Image_InsertHandler(*args, **kwargs):
3079 """Image_InsertHandler(ImageHandler handler)"""
3080 return _core_.Image_InsertHandler(*args, **kwargs)
3081
3082 def Image_RemoveHandler(*args, **kwargs):
3083 """Image_RemoveHandler(String name) -> bool"""
3084 return _core_.Image_RemoveHandler(*args, **kwargs)
3085
3086 def Image_GetHandlers(*args):
3087 """Image_GetHandlers() -> PyObject"""
3088 return _core_.Image_GetHandlers(*args)
3089
3090 def Image_GetImageExtWildcard(*args):
3091 """
3092 Image_GetImageExtWildcard() -> String
3093
3094 Iterates all registered wxImageHandler objects, and returns a string
3095 containing file extension masks suitable for passing to file open/save
3096 dialog boxes.
3097 """
3098 return _core_.Image_GetImageExtWildcard(*args)
3099
3100 def Image_RGBtoHSV(*args, **kwargs):
3101 """
3102 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3103
3104 Converts a color in RGB color space to HSV color space.
3105 """
3106 return _core_.Image_RGBtoHSV(*args, **kwargs)
3107
3108 def Image_HSVtoRGB(*args, **kwargs):
3109 """
3110 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3111
3112 Converts a color in HSV color space to RGB color space.
3113 """
3114 return _core_.Image_HSVtoRGB(*args, **kwargs)
3115
3116
3117 def _ImageFromBuffer(*args, **kwargs):
3118 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3119 return _core_._ImageFromBuffer(*args, **kwargs)
3120 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3121 """
3122 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3123 parameter must be a Python object that implements the buffer interface,
3124 such as a string, array, etc. The dataBuffer object is expected to
3125 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3126 object can optionally be supplied for the image's alpha channel data, and
3127 it is expected to be width*height bytes long.
3128
3129 The wx.Image will be created with its data and alpha pointers initialized
3130 to the memory address pointed to by the buffer objects, thus saving the
3131 time needed to copy the image data from the buffer object to the wx.Image.
3132 While this has advantages, it also has the shoot-yourself-in-the-foot
3133 risks associated with sharing a C pointer between two objects.
3134
3135 To help alleviate the risk a reference to the data and alpha buffer
3136 objects are kept with the wx.Image, so that they won't get deleted until
3137 after the wx.Image is deleted. However please be aware that it is not
3138 guaranteed that an object won't move its memory buffer to a new location
3139 when it needs to resize its contents. If that happens then the wx.Image
3140 will end up referring to an invalid memory location and could cause the
3141 application to crash. Therefore care should be taken to not manipulate
3142 the objects used for the data and alpha buffers in a way that would cause
3143 them to change size.
3144 """
3145 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3146 image._buffer = dataBuffer
3147 image._alpha = alphaBuffer
3148 return image
3149
3150 def InitAllImageHandlers():
3151 """
3152 The former functionality of InitAllImageHanders is now done internal to
3153 the _core_ extension module and so this function has become a simple NOP.
3154 """
3155 pass
3156
3157 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3158 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3159 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3160 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3161 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3162 BMP_24BPP = _core_.BMP_24BPP
3163 BMP_8BPP = _core_.BMP_8BPP
3164 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3165 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3166 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3167 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3168 BMP_4BPP = _core_.BMP_4BPP
3169 BMP_1BPP = _core_.BMP_1BPP
3170 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3171 class BMPHandler(ImageHandler):
3172 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3173 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3174 __repr__ = _swig_repr
3175 def __init__(self, *args, **kwargs):
3176 """
3177 __init__(self) -> BMPHandler
3178
3179 A `wx.ImageHandler` for \*.bmp bitmap files.
3180 """
3181 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3182 _core_.BMPHandler_swigregister(BMPHandler)
3183 NullImage = cvar.NullImage
3184 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3185 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3186 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3187 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3188 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3189 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3190 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3191 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3192 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3193 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3194 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3195 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3196 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3197 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3198 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3199
3200 class ICOHandler(BMPHandler):
3201 """A `wx.ImageHandler` for \*.ico icon files."""
3202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3203 __repr__ = _swig_repr
3204 def __init__(self, *args, **kwargs):
3205 """
3206 __init__(self) -> ICOHandler
3207
3208 A `wx.ImageHandler` for \*.ico icon files.
3209 """
3210 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3211 _core_.ICOHandler_swigregister(ICOHandler)
3212
3213 class CURHandler(ICOHandler):
3214 """A `wx.ImageHandler` for \*.cur cursor files."""
3215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3216 __repr__ = _swig_repr
3217 def __init__(self, *args, **kwargs):
3218 """
3219 __init__(self) -> CURHandler
3220
3221 A `wx.ImageHandler` for \*.cur cursor files.
3222 """
3223 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3224 _core_.CURHandler_swigregister(CURHandler)
3225
3226 class ANIHandler(CURHandler):
3227 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3228 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3229 __repr__ = _swig_repr
3230 def __init__(self, *args, **kwargs):
3231 """
3232 __init__(self) -> ANIHandler
3233
3234 A `wx.ImageHandler` for \*.ani animated cursor files.
3235 """
3236 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3237 _core_.ANIHandler_swigregister(ANIHandler)
3238
3239 class PNGHandler(ImageHandler):
3240 """A `wx.ImageHandler` for PNG image files."""
3241 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3242 __repr__ = _swig_repr
3243 def __init__(self, *args, **kwargs):
3244 """
3245 __init__(self) -> PNGHandler
3246
3247 A `wx.ImageHandler` for PNG image files.
3248 """
3249 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3250 _core_.PNGHandler_swigregister(PNGHandler)
3251
3252 class GIFHandler(ImageHandler):
3253 """A `wx.ImageHandler` for GIF image files."""
3254 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3255 __repr__ = _swig_repr
3256 def __init__(self, *args, **kwargs):
3257 """
3258 __init__(self) -> GIFHandler
3259
3260 A `wx.ImageHandler` for GIF image files.
3261 """
3262 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3263 _core_.GIFHandler_swigregister(GIFHandler)
3264
3265 class PCXHandler(ImageHandler):
3266 """A `wx.ImageHandler` for PCX imager files."""
3267 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3268 __repr__ = _swig_repr
3269 def __init__(self, *args, **kwargs):
3270 """
3271 __init__(self) -> PCXHandler
3272
3273 A `wx.ImageHandler` for PCX imager files.
3274 """
3275 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3276 _core_.PCXHandler_swigregister(PCXHandler)
3277
3278 class JPEGHandler(ImageHandler):
3279 """A `wx.ImageHandler` for JPEG/JPG image files."""
3280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3281 __repr__ = _swig_repr
3282 def __init__(self, *args, **kwargs):
3283 """
3284 __init__(self) -> JPEGHandler
3285
3286 A `wx.ImageHandler` for JPEG/JPG image files.
3287 """
3288 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3289 _core_.JPEGHandler_swigregister(JPEGHandler)
3290
3291 class PNMHandler(ImageHandler):
3292 """A `wx.ImageHandler` for PNM image files."""
3293 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3294 __repr__ = _swig_repr
3295 def __init__(self, *args, **kwargs):
3296 """
3297 __init__(self) -> PNMHandler
3298
3299 A `wx.ImageHandler` for PNM image files.
3300 """
3301 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3302 _core_.PNMHandler_swigregister(PNMHandler)
3303
3304 class XPMHandler(ImageHandler):
3305 """A `wx.ImageHandler` for XPM image."""
3306 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3307 __repr__ = _swig_repr
3308 def __init__(self, *args, **kwargs):
3309 """
3310 __init__(self) -> XPMHandler
3311
3312 A `wx.ImageHandler` for XPM image.
3313 """
3314 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3315 _core_.XPMHandler_swigregister(XPMHandler)
3316
3317 class TIFFHandler(ImageHandler):
3318 """A `wx.ImageHandler` for TIFF image files."""
3319 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3320 __repr__ = _swig_repr
3321 def __init__(self, *args, **kwargs):
3322 """
3323 __init__(self) -> TIFFHandler
3324
3325 A `wx.ImageHandler` for TIFF image files.
3326 """
3327 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3328 _core_.TIFFHandler_swigregister(TIFFHandler)
3329
3330 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3331 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3332 class Quantize(object):
3333 """Performs quantization, or colour reduction, on a wxImage."""
3334 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3335 def __init__(self): raise AttributeError, "No constructor defined"
3336 __repr__ = _swig_repr
3337 def Quantize(*args, **kwargs):
3338 """
3339 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3340
3341 Reduce the colours in the source image and put the result into the
3342 destination image, setting the palette in the destination if
3343 needed. Both images may be the same, to overwrite the source image.
3344 """
3345 return _core_.Quantize_Quantize(*args, **kwargs)
3346
3347 Quantize = staticmethod(Quantize)
3348 _core_.Quantize_swigregister(Quantize)
3349
3350 def Quantize_Quantize(*args, **kwargs):
3351 """
3352 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3353
3354 Reduce the colours in the source image and put the result into the
3355 destination image, setting the palette in the destination if
3356 needed. Both images may be the same, to overwrite the source image.
3357 """
3358 return _core_.Quantize_Quantize(*args, **kwargs)
3359
3360 #---------------------------------------------------------------------------
3361
3362 class EvtHandler(Object):
3363 """Proxy of C++ EvtHandler class"""
3364 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3365 __repr__ = _swig_repr
3366 def __init__(self, *args, **kwargs):
3367 """__init__(self) -> EvtHandler"""
3368 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3369 def GetNextHandler(*args, **kwargs):
3370 """GetNextHandler(self) -> EvtHandler"""
3371 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3372
3373 def GetPreviousHandler(*args, **kwargs):
3374 """GetPreviousHandler(self) -> EvtHandler"""
3375 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3376
3377 def SetNextHandler(*args, **kwargs):
3378 """SetNextHandler(self, EvtHandler handler)"""
3379 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3380
3381 def SetPreviousHandler(*args, **kwargs):
3382 """SetPreviousHandler(self, EvtHandler handler)"""
3383 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3384
3385 def GetEvtHandlerEnabled(*args, **kwargs):
3386 """GetEvtHandlerEnabled(self) -> bool"""
3387 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3388
3389 def SetEvtHandlerEnabled(*args, **kwargs):
3390 """SetEvtHandlerEnabled(self, bool enabled)"""
3391 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3392
3393 def ProcessEvent(*args, **kwargs):
3394 """ProcessEvent(self, Event event) -> bool"""
3395 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3396
3397 def AddPendingEvent(*args, **kwargs):
3398 """AddPendingEvent(self, Event event)"""
3399 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3400
3401 def ProcessPendingEvents(*args, **kwargs):
3402 """ProcessPendingEvents(self)"""
3403 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3404
3405 def Connect(*args, **kwargs):
3406 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3407 return _core_.EvtHandler_Connect(*args, **kwargs)
3408
3409 def Disconnect(*args, **kwargs):
3410 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3411 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3412
3413 def _setOORInfo(*args, **kwargs):
3414 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3415 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3416 args[0].thisown = 0
3417 return val
3418
3419 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3420 """
3421 Bind an event to an event handler.
3422
3423 :param event: One of the EVT_* objects that specifies the
3424 type of event to bind,
3425
3426 :param handler: A callable object to be invoked when the
3427 event is delivered to self. Pass None to
3428 disconnect an event handler.
3429
3430 :param source: Sometimes the event originates from a
3431 different window than self, but you still
3432 want to catch it in self. (For example, a
3433 button event delivered to a frame.) By
3434 passing the source of the event, the event
3435 handling system is able to differentiate
3436 between the same event type from different
3437 controls.
3438
3439 :param id: Used to spcify the event source by ID instead
3440 of instance.
3441
3442 :param id2: Used when it is desirable to bind a handler
3443 to a range of IDs, such as with EVT_MENU_RANGE.
3444 """
3445 if source is not None:
3446 id = source.GetId()
3447 event.Bind(self, id, id2, handler)
3448
3449 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3450 """
3451 Disconencts the event handler binding for event from self.
3452 Returns True if successful.
3453 """
3454 if source is not None:
3455 id = source.GetId()
3456 return event.Unbind(self, id, id2)
3457
3458 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3459 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3460 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3461 _core_.EvtHandler_swigregister(EvtHandler)
3462
3463 #---------------------------------------------------------------------------
3464
3465 class PyEventBinder(object):
3466 """
3467 Instances of this class are used to bind specific events to event
3468 handlers.
3469 """
3470 def __init__(self, evtType, expectedIDs=0):
3471 if expectedIDs not in [0, 1, 2]:
3472 raise ValueError, "Invalid number of expectedIDs"
3473 self.expectedIDs = expectedIDs
3474
3475 if type(evtType) == list or type(evtType) == tuple:
3476 self.evtType = evtType
3477 else:
3478 self.evtType = [evtType]
3479
3480
3481 def Bind(self, target, id1, id2, function):
3482 """Bind this set of event types to target."""
3483 for et in self.evtType:
3484 target.Connect(id1, id2, et, function)
3485
3486
3487 def Unbind(self, target, id1, id2):
3488 """Remove an event binding."""
3489 success = 0
3490 for et in self.evtType:
3491 success += target.Disconnect(id1, id2, et)
3492 return success != 0
3493
3494
3495 def __call__(self, *args):
3496 """
3497 For backwards compatibility with the old EVT_* functions.
3498 Should be called with either (window, func), (window, ID,
3499 func) or (window, ID1, ID2, func) parameters depending on the
3500 type of the event.
3501 """
3502 assert len(args) == 2 + self.expectedIDs
3503 id1 = wx.ID_ANY
3504 id2 = wx.ID_ANY
3505 target = args[0]
3506 if self.expectedIDs == 0:
3507 func = args[1]
3508 elif self.expectedIDs == 1:
3509 id1 = args[1]
3510 func = args[2]
3511 elif self.expectedIDs == 2:
3512 id1 = args[1]
3513 id2 = args[2]
3514 func = args[3]
3515 else:
3516 raise ValueError, "Unexpected number of IDs"
3517
3518 self.Bind(target, id1, id2, func)
3519
3520
3521 # These two are square pegs that don't fit the PyEventBinder hole...
3522 def EVT_COMMAND(win, id, cmd, func):
3523 win.Connect(id, -1, cmd, func)
3524 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3525 win.Connect(id1, id2, cmd, func)
3526
3527
3528 #---------------------------------------------------------------------------
3529
3530 #---------------------------------------------------------------------------
3531
3532 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3533 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3534
3535 def NewEventType(*args):
3536 """NewEventType() -> EventType"""
3537 return _core_.NewEventType(*args)
3538 wxEVT_NULL = _core_.wxEVT_NULL
3539 wxEVT_FIRST = _core_.wxEVT_FIRST
3540 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3541 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3542 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3543 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3544 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3545 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3546 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3547 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3548 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3549 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3550 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3551 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3552 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3553 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3554 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3555 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3556 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3557 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3558 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3559 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3560 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3561 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3562 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3563 wxEVT_MOTION = _core_.wxEVT_MOTION
3564 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3565 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3566 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3567 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3568 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3569 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3570 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3571 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3572 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3573 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3574 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3575 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3576 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3577 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3578 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3579 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3580 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3581 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3582 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3583 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3584 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3585 wxEVT_CHAR = _core_.wxEVT_CHAR
3586 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3587 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3588 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3589 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3590 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3591 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3592 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3593 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3594 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3595 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3596 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3597 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3598 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3599 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3600 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3601 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3602 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3603 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3604 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3605 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3606 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3607 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3608 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3609 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3610 wxEVT_SIZE = _core_.wxEVT_SIZE
3611 wxEVT_MOVE = _core_.wxEVT_MOVE
3612 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3613 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3614 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3615 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3616 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3617 wxEVT_CREATE = _core_.wxEVT_CREATE
3618 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3619 wxEVT_SHOW = _core_.wxEVT_SHOW
3620 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3621 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3622 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3623 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3624 wxEVT_PAINT = _core_.wxEVT_PAINT
3625 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3626 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3627 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3628 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3629 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3630 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3631 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3632 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3633 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3634 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3635 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3636 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3637 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3638 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3639 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3640 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3641 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3642 wxEVT_IDLE = _core_.wxEVT_IDLE
3643 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3644 wxEVT_SIZING = _core_.wxEVT_SIZING
3645 wxEVT_MOVING = _core_.wxEVT_MOVING
3646 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3647 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3648 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3649 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3650 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3651 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3652 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3653 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3654 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3655 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3656 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3657 #
3658 # Create some event binders
3659 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3660 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3661 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3662 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3663 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3664 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3665 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3666 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3667 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3668 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3669 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3670 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3671 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3672 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3673 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3674 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3675 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3676 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3677 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3678 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3679 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3680 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3681 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3682 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3683 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3684 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3685 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3686 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3687 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3688 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3689 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3690 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3691 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3692 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3693 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3694 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3695 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3696 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3697 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3698 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3699 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3700 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3701
3702 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3703 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3704 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3705 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3706 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3707 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3708 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3709 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3710 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3711 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3712 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3713 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3714 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3715
3716 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3717 wxEVT_LEFT_UP,
3718 wxEVT_MIDDLE_DOWN,
3719 wxEVT_MIDDLE_UP,
3720 wxEVT_RIGHT_DOWN,
3721 wxEVT_RIGHT_UP,
3722 wxEVT_MOTION,
3723 wxEVT_LEFT_DCLICK,
3724 wxEVT_MIDDLE_DCLICK,
3725 wxEVT_RIGHT_DCLICK,
3726 wxEVT_ENTER_WINDOW,
3727 wxEVT_LEAVE_WINDOW,
3728 wxEVT_MOUSEWHEEL
3729 ])
3730
3731
3732 # Scrolling from wxWindow (sent to wxScrolledWindow)
3733 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3734 wxEVT_SCROLLWIN_BOTTOM,
3735 wxEVT_SCROLLWIN_LINEUP,
3736 wxEVT_SCROLLWIN_LINEDOWN,
3737 wxEVT_SCROLLWIN_PAGEUP,
3738 wxEVT_SCROLLWIN_PAGEDOWN,
3739 wxEVT_SCROLLWIN_THUMBTRACK,
3740 wxEVT_SCROLLWIN_THUMBRELEASE,
3741 ])
3742
3743 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3744 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3745 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3746 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3747 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3748 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3749 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3750 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3751
3752 # Scrolling from wx.Slider and wx.ScrollBar
3753 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3754 wxEVT_SCROLL_BOTTOM,
3755 wxEVT_SCROLL_LINEUP,
3756 wxEVT_SCROLL_LINEDOWN,
3757 wxEVT_SCROLL_PAGEUP,
3758 wxEVT_SCROLL_PAGEDOWN,
3759 wxEVT_SCROLL_THUMBTRACK,
3760 wxEVT_SCROLL_THUMBRELEASE,
3761 wxEVT_SCROLL_CHANGED,
3762 ])
3763
3764 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3765 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3766 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3767 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3768 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3769 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3770 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3771 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3772 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3773 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3774
3775 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3776 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3777 wxEVT_SCROLL_BOTTOM,
3778 wxEVT_SCROLL_LINEUP,
3779 wxEVT_SCROLL_LINEDOWN,
3780 wxEVT_SCROLL_PAGEUP,
3781 wxEVT_SCROLL_PAGEDOWN,
3782 wxEVT_SCROLL_THUMBTRACK,
3783 wxEVT_SCROLL_THUMBRELEASE,
3784 wxEVT_SCROLL_CHANGED,
3785 ], 1)
3786
3787 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3788 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3789 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3790 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3791 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3792 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3793 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3794 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3795 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3796 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3797
3798 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3799 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3800 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3801 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3802 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3803 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3804 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3805 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3806 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3807 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3808
3809 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3810 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3811 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3812 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3813 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3814 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3815 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3816 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3817 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3818
3819
3820 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3821 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3822 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3823 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3824 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3825 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3826 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3827
3828 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3829
3830 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3831 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3832
3833 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3834
3835 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3836 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3837 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3838
3839
3840 #---------------------------------------------------------------------------
3841
3842 class Event(Object):
3843 """
3844 An event is a structure holding information about an event passed to a
3845 callback or member function. wx.Event is an abstract base class for
3846 other event classes
3847 """
3848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3849 def __init__(self): raise AttributeError, "No constructor defined"
3850 __repr__ = _swig_repr
3851 __swig_destroy__ = _core_.delete_Event
3852 __del__ = lambda self : None;
3853 def SetEventType(*args, **kwargs):
3854 """
3855 SetEventType(self, EventType typ)
3856
3857 Sets the specific type of the event.
3858 """
3859 return _core_.Event_SetEventType(*args, **kwargs)
3860
3861 def GetEventType(*args, **kwargs):
3862 """
3863 GetEventType(self) -> EventType
3864
3865 Returns the identifier of the given event type, such as
3866 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3867 """
3868 return _core_.Event_GetEventType(*args, **kwargs)
3869
3870 def GetEventObject(*args, **kwargs):
3871 """
3872 GetEventObject(self) -> Object
3873
3874 Returns the object (usually a window) associated with the event, if
3875 any.
3876 """
3877 return _core_.Event_GetEventObject(*args, **kwargs)
3878
3879 def SetEventObject(*args, **kwargs):
3880 """
3881 SetEventObject(self, Object obj)
3882
3883 Sets the originating object, or in other words, obj is normally the
3884 object that is sending the event.
3885 """
3886 return _core_.Event_SetEventObject(*args, **kwargs)
3887
3888 def GetTimestamp(*args, **kwargs):
3889 """GetTimestamp(self) -> long"""
3890 return _core_.Event_GetTimestamp(*args, **kwargs)
3891
3892 def SetTimestamp(*args, **kwargs):
3893 """SetTimestamp(self, long ts=0)"""
3894 return _core_.Event_SetTimestamp(*args, **kwargs)
3895
3896 def GetId(*args, **kwargs):
3897 """
3898 GetId(self) -> int
3899
3900 Returns the identifier associated with this event, such as a button
3901 command id.
3902 """
3903 return _core_.Event_GetId(*args, **kwargs)
3904
3905 def SetId(*args, **kwargs):
3906 """
3907 SetId(self, int Id)
3908
3909 Set's the ID for the event. This is usually the ID of the window that
3910 is sending the event, but it can also be a command id from a menu
3911 item, etc.
3912 """
3913 return _core_.Event_SetId(*args, **kwargs)
3914
3915 def IsCommandEvent(*args, **kwargs):
3916 """
3917 IsCommandEvent(self) -> bool
3918
3919 Returns true if the event is or is derived from `wx.CommandEvent` else
3920 it returns false. Note: Exists only for optimization purposes.
3921 """
3922 return _core_.Event_IsCommandEvent(*args, **kwargs)
3923
3924 def Skip(*args, **kwargs):
3925 """
3926 Skip(self, bool skip=True)
3927
3928 Called by an event handler, it controls whether additional event
3929 handlers bound to this event will be called after the current event
3930 handler returns. Skip(false) (the default setting) will prevent
3931 additional event handlers from being called and control will be
3932 returned to the sender of the event immediately after the current
3933 handler has finished. Skip(True) will cause the event processing
3934 system to continue searching for a handler function for this event.
3935
3936 """
3937 return _core_.Event_Skip(*args, **kwargs)
3938
3939 def GetSkipped(*args, **kwargs):
3940 """
3941 GetSkipped(self) -> bool
3942
3943 Returns true if the event handler should be skipped, false otherwise.
3944 :see: `Skip`
3945 """
3946 return _core_.Event_GetSkipped(*args, **kwargs)
3947
3948 def ShouldPropagate(*args, **kwargs):
3949 """
3950 ShouldPropagate(self) -> bool
3951
3952 Test if this event should be propagated to the parent window or not,
3953 i.e. if the propagation level is currently greater than 0.
3954 """
3955 return _core_.Event_ShouldPropagate(*args, **kwargs)
3956
3957 def StopPropagation(*args, **kwargs):
3958 """
3959 StopPropagation(self) -> int
3960
3961 Stop the event from propagating to its parent window. Returns the old
3962 propagation level value which may be later passed to
3963 `ResumePropagation` to allow propagating the event again.
3964 """
3965 return _core_.Event_StopPropagation(*args, **kwargs)
3966
3967 def ResumePropagation(*args, **kwargs):
3968 """
3969 ResumePropagation(self, int propagationLevel)
3970
3971 Resume the event propagation by restoring the propagation level. (For
3972 example, you can use the value returned by an earlier call to
3973 `StopPropagation`.)
3974
3975 """
3976 return _core_.Event_ResumePropagation(*args, **kwargs)
3977
3978 def Clone(*args, **kwargs):
3979 """Clone(self) -> Event"""
3980 return _core_.Event_Clone(*args, **kwargs)
3981
3982 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
3983 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
3984 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
3985 Skipped = property(GetSkipped,doc="See `GetSkipped`")
3986 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
3987 _core_.Event_swigregister(Event)
3988
3989 #---------------------------------------------------------------------------
3990
3991 class PropagationDisabler(object):
3992 """
3993 Helper class to temporarily change an event not to propagate. Simply
3994 create an instance of this class and then whe it is destroyed the
3995 propogation of the event will be restored.
3996 """
3997 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3998 __repr__ = _swig_repr
3999 def __init__(self, *args, **kwargs):
4000 """
4001 __init__(self, Event event) -> PropagationDisabler
4002
4003 Helper class to temporarily change an event not to propagate. Simply
4004 create an instance of this class and then whe it is destroyed the
4005 propogation of the event will be restored.
4006 """
4007 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4008 __swig_destroy__ = _core_.delete_PropagationDisabler
4009 __del__ = lambda self : None;
4010 _core_.PropagationDisabler_swigregister(PropagationDisabler)
4011
4012 class PropagateOnce(object):
4013 """
4014 A helper class that will temporarily lower propagation level of an
4015 event. Simply create an instance of this class and then whe it is
4016 destroyed the propogation of the event will be restored.
4017 """
4018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4019 __repr__ = _swig_repr
4020 def __init__(self, *args, **kwargs):
4021 """
4022 __init__(self, Event event) -> PropagateOnce
4023
4024 A helper class that will temporarily lower propagation level of an
4025 event. Simply create an instance of this class and then whe it is
4026 destroyed the propogation of the event will be restored.
4027 """
4028 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4029 __swig_destroy__ = _core_.delete_PropagateOnce
4030 __del__ = lambda self : None;
4031 _core_.PropagateOnce_swigregister(PropagateOnce)
4032
4033 #---------------------------------------------------------------------------
4034
4035 class CommandEvent(Event):
4036 """
4037 This event class contains information about command events, which
4038 originate from a variety of simple controls, as well as menus and
4039 toolbars.
4040 """
4041 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4042 __repr__ = _swig_repr
4043 def __init__(self, *args, **kwargs):
4044 """
4045 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4046
4047 This event class contains information about command events, which
4048 originate from a variety of simple controls, as well as menus and
4049 toolbars.
4050 """
4051 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4052 def GetSelection(*args, **kwargs):
4053 """
4054 GetSelection(self) -> int
4055
4056 Returns item index for a listbox or choice selection event (not valid
4057 for a deselection).
4058 """
4059 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4060
4061 def SetString(*args, **kwargs):
4062 """SetString(self, String s)"""
4063 return _core_.CommandEvent_SetString(*args, **kwargs)
4064
4065 def GetString(*args, **kwargs):
4066 """
4067 GetString(self) -> String
4068
4069 Returns item string for a listbox or choice selection event (not valid
4070 for a deselection).
4071 """
4072 return _core_.CommandEvent_GetString(*args, **kwargs)
4073
4074 def IsChecked(*args, **kwargs):
4075 """
4076 IsChecked(self) -> bool
4077
4078 This method can be used with checkbox and menu events: for the
4079 checkboxes, the method returns true for a selection event and false
4080 for a deselection one. For the menu events, this method indicates if
4081 the menu item just has become checked or unchecked (and thus only
4082 makes sense for checkable menu items).
4083 """
4084 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4085
4086 Checked = IsChecked
4087 def IsSelection(*args, **kwargs):
4088 """
4089 IsSelection(self) -> bool
4090
4091 For a listbox or similar event, returns true if it is a selection,
4092 false if it is a deselection.
4093 """
4094 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4095
4096 def SetExtraLong(*args, **kwargs):
4097 """SetExtraLong(self, long extraLong)"""
4098 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4099
4100 def GetExtraLong(*args, **kwargs):
4101 """
4102 GetExtraLong(self) -> long
4103
4104 Returns extra information dependant on the event objects type. If the
4105 event comes from a listbox selection, it is a boolean determining
4106 whether the event was a selection (true) or a deselection (false). A
4107 listbox deselection only occurs for multiple-selection boxes, and in
4108 this case the index and string values are indeterminate and the
4109 listbox must be examined by the application.
4110 """
4111 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4112
4113 def SetInt(*args, **kwargs):
4114 """SetInt(self, int i)"""
4115 return _core_.CommandEvent_SetInt(*args, **kwargs)
4116
4117 def GetInt(*args, **kwargs):
4118 """
4119 GetInt(self) -> int
4120
4121 Returns the integer identifier corresponding to a listbox, choice or
4122 radiobox selection (only if the event was a selection, not a
4123 deselection), or a boolean value representing the value of a checkbox.
4124 """
4125 return _core_.CommandEvent_GetInt(*args, **kwargs)
4126
4127 def GetClientData(*args, **kwargs):
4128 """
4129 GetClientData(self) -> PyObject
4130
4131 Returns the client data object for a listbox or choice selection event, (if any.)
4132 """
4133 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4134
4135 def SetClientData(*args, **kwargs):
4136 """
4137 SetClientData(self, PyObject clientData)
4138
4139 Associate the given client data with the item at position n.
4140 """
4141 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4142
4143 GetClientObject = GetClientData
4144 SetClientObject = SetClientData
4145
4146 def Clone(*args, **kwargs):
4147 """Clone(self) -> Event"""
4148 return _core_.CommandEvent_Clone(*args, **kwargs)
4149
4150 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4151 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4152 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4153 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4154 Selection = property(GetSelection,doc="See `GetSelection`")
4155 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4156 _core_.CommandEvent_swigregister(CommandEvent)
4157
4158 #---------------------------------------------------------------------------
4159
4160 class NotifyEvent(CommandEvent):
4161 """
4162 An instance of this class (or one of its derived classes) is sent from
4163 a control when the control's state is being changed and the control
4164 allows that change to be prevented from happening. The event handler
4165 can call `Veto` or `Allow` to tell the control what to do.
4166 """
4167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4168 __repr__ = _swig_repr
4169 def __init__(self, *args, **kwargs):
4170 """
4171 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4172
4173 An instance of this class (or one of its derived classes) is sent from
4174 a control when the control's state is being changed and the control
4175 allows that change to be prevented from happening. The event handler
4176 can call `Veto` or `Allow` to tell the control what to do.
4177 """
4178 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4179 def Veto(*args, **kwargs):
4180 """
4181 Veto(self)
4182
4183 Prevents the change announced by this event from happening.
4184
4185 It is in general a good idea to notify the user about the reasons for
4186 vetoing the change because otherwise the applications behaviour (which
4187 just refuses to do what the user wants) might be quite surprising.
4188 """
4189 return _core_.NotifyEvent_Veto(*args, **kwargs)
4190
4191 def Allow(*args, **kwargs):
4192 """
4193 Allow(self)
4194
4195 This is the opposite of `Veto`: it explicitly allows the event to be
4196 processed. For most events it is not necessary to call this method as
4197 the events are allowed anyhow but some are forbidden by default (this
4198 will be mentioned in the corresponding event description).
4199 """
4200 return _core_.NotifyEvent_Allow(*args, **kwargs)
4201
4202 def IsAllowed(*args, **kwargs):
4203 """
4204 IsAllowed(self) -> bool
4205
4206 Returns true if the change is allowed (`Veto` hasn't been called) or
4207 false otherwise (if it was).
4208 """
4209 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4210
4211 _core_.NotifyEvent_swigregister(NotifyEvent)
4212
4213 #---------------------------------------------------------------------------
4214
4215 class ScrollEvent(CommandEvent):
4216 """
4217 A scroll event holds information about events sent from stand-alone
4218 scrollbars and sliders. Note that scrolled windows do not send
4219 instnaces of this event class, but send the `wx.ScrollWinEvent`
4220 instead.
4221 """
4222 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4223 __repr__ = _swig_repr
4224 def __init__(self, *args, **kwargs):
4225 """
4226 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4227 int orient=0) -> ScrollEvent
4228 """
4229 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4230 def GetOrientation(*args, **kwargs):
4231 """
4232 GetOrientation(self) -> int
4233
4234 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4235 the scrollbar.
4236 """
4237 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4238
4239 def GetPosition(*args, **kwargs):
4240 """
4241 GetPosition(self) -> int
4242
4243 Returns the position of the scrollbar.
4244 """
4245 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4246
4247 def SetOrientation(*args, **kwargs):
4248 """SetOrientation(self, int orient)"""
4249 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4250
4251 def SetPosition(*args, **kwargs):
4252 """SetPosition(self, int pos)"""
4253 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4254
4255 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4256 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4257 _core_.ScrollEvent_swigregister(ScrollEvent)
4258
4259 #---------------------------------------------------------------------------
4260
4261 class ScrollWinEvent(Event):
4262 """
4263 A wx.ScrollWinEvent holds information about scrolling and is sent from
4264 scrolling windows.
4265 """
4266 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4267 __repr__ = _swig_repr
4268 def __init__(self, *args, **kwargs):
4269 """
4270 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4271
4272 A wx.ScrollWinEvent holds information about scrolling and is sent from
4273 scrolling windows.
4274 """
4275 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4276 def GetOrientation(*args, **kwargs):
4277 """
4278 GetOrientation(self) -> int
4279
4280 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4281 the scrollbar.
4282 """
4283 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4284
4285 def GetPosition(*args, **kwargs):
4286 """
4287 GetPosition(self) -> int
4288
4289 Returns the position of the scrollbar for the thumb track and release
4290 events. Note that this field can't be used for the other events, you
4291 need to query the window itself for the current position in that case.
4292 """
4293 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4294
4295 def SetOrientation(*args, **kwargs):
4296 """SetOrientation(self, int orient)"""
4297 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4298
4299 def SetPosition(*args, **kwargs):
4300 """SetPosition(self, int pos)"""
4301 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4302
4303 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4304 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4305 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4306
4307 #---------------------------------------------------------------------------
4308
4309 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4310 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4311 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4312 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4313 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4314 class MouseEvent(Event):
4315 """
4316 This event class contains information about the events generated by
4317 the mouse: they include mouse buttons press and release events and
4318 mouse move events.
4319
4320 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4321 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4322 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4323 a middle button so a portable application should avoid relying on the
4324 events from it.
4325
4326 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4327 the former returns true when the event corresponds to the left mouse
4328 button click while the latter returns true if the left mouse button is
4329 currently being pressed. For example, when the user is dragging the
4330 mouse you can use `LeftIsDown` to test whether the left mouse button
4331 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4332 `LeftIsDown` will also return true in wxWidgets whatever the
4333 underlying GUI behaviour is (which is platform-dependent). The same
4334 applies, of course, to other mouse buttons as well.
4335 """
4336 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4337 __repr__ = _swig_repr
4338 def __init__(self, *args, **kwargs):
4339 """
4340 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4341
4342 Constructs a wx.MouseEvent. Valid event types are:
4343
4344 * wxEVT_ENTER_WINDOW
4345 * wxEVT_LEAVE_WINDOW
4346 * wxEVT_LEFT_DOWN
4347 * wxEVT_LEFT_UP
4348 * wxEVT_LEFT_DCLICK
4349 * wxEVT_MIDDLE_DOWN
4350 * wxEVT_MIDDLE_UP
4351 * wxEVT_MIDDLE_DCLICK
4352 * wxEVT_RIGHT_DOWN
4353 * wxEVT_RIGHT_UP
4354 * wxEVT_RIGHT_DCLICK
4355 * wxEVT_MOTION
4356 * wxEVT_MOUSEWHEEL
4357 """
4358 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4359 def IsButton(*args, **kwargs):
4360 """
4361 IsButton(self) -> bool
4362
4363 Returns true if the event was a mouse button event (not necessarily a
4364 button down event - that may be tested using `ButtonDown`).
4365 """
4366 return _core_.MouseEvent_IsButton(*args, **kwargs)
4367
4368 def ButtonDown(*args, **kwargs):
4369 """
4370 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4371
4372 If the argument is omitted, this returns true if the event was any
4373 mouse button down event. Otherwise the argument specifies which
4374 button-down event shold be checked for (see `Button` for the possible
4375 values).
4376 """
4377 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4378
4379 def ButtonDClick(*args, **kwargs):
4380 """
4381 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4382
4383 If the argument is omitted, this returns true if the event was any
4384 mouse double click event. Otherwise the argument specifies which
4385 double click event to check for (see `Button` for the possible
4386 values).
4387 """
4388 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4389
4390 def ButtonUp(*args, **kwargs):
4391 """
4392 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4393
4394 If the argument is omitted, this returns true if the event was any
4395 mouse button up event. Otherwise the argument specifies which button
4396 up event to check for (see `Button` for the possible values).
4397 """
4398 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4399
4400 def Button(*args, **kwargs):
4401 """
4402 Button(self, int button) -> bool
4403
4404 Returns true if the identified mouse button is changing state. Valid
4405 values of button are:
4406
4407 ==================== =====================================
4408 wx.MOUSE_BTN_LEFT check if left button was pressed
4409 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4410 wx.MOUSE_BTN_RIGHT check if right button was pressed
4411 wx.MOUSE_BTN_ANY check if any button was pressed
4412 ==================== =====================================
4413
4414 """
4415 return _core_.MouseEvent_Button(*args, **kwargs)
4416
4417 def ButtonIsDown(*args, **kwargs):
4418 """ButtonIsDown(self, int but) -> bool"""
4419 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4420
4421 def GetButton(*args, **kwargs):
4422 """
4423 GetButton(self) -> int
4424
4425 Returns the mouse button which generated this event or
4426 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4427 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4428 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4429 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4430 right buttons respectively.
4431 """
4432 return _core_.MouseEvent_GetButton(*args, **kwargs)
4433
4434 def ControlDown(*args, **kwargs):
4435 """
4436 ControlDown(self) -> bool
4437
4438 Returns true if the control key was down at the time of the event.
4439 """
4440 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4441
4442 def MetaDown(*args, **kwargs):
4443 """
4444 MetaDown(self) -> bool
4445
4446 Returns true if the Meta key was down at the time of the event.
4447 """
4448 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4449
4450 def AltDown(*args, **kwargs):
4451 """
4452 AltDown(self) -> bool
4453
4454 Returns true if the Alt key was down at the time of the event.
4455 """
4456 return _core_.MouseEvent_AltDown(*args, **kwargs)
4457
4458 def ShiftDown(*args, **kwargs):
4459 """
4460 ShiftDown(self) -> bool
4461
4462 Returns true if the Shift key was down at the time of the event.
4463 """
4464 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4465
4466 def CmdDown(*args, **kwargs):
4467 """
4468 CmdDown(self) -> bool
4469
4470 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4471 platforms but the special "Apple" (a.k.a as "Command") key on
4472 Macs. It often makes sense to use it instead of, say, `ControlDown`
4473 because Cmd key is used for the same thing under Mac as Ctrl
4474 elsewhere. The Ctrl key still exists, it's just not used for this
4475 purpose. So for non-Mac platforms this is the same as `ControlDown`
4476 and Macs this is the same as `MetaDown`.
4477 """
4478 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4479
4480 def LeftDown(*args, **kwargs):
4481 """
4482 LeftDown(self) -> bool
4483
4484 Returns true if the left mouse button state changed to down.
4485 """
4486 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4487
4488 def MiddleDown(*args, **kwargs):
4489 """
4490 MiddleDown(self) -> bool
4491
4492 Returns true if the middle mouse button state changed to down.
4493 """
4494 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4495
4496 def RightDown(*args, **kwargs):
4497 """
4498 RightDown(self) -> bool
4499
4500 Returns true if the right mouse button state changed to down.
4501 """
4502 return _core_.MouseEvent_RightDown(*args, **kwargs)
4503
4504 def LeftUp(*args, **kwargs):
4505 """
4506 LeftUp(self) -> bool
4507
4508 Returns true if the left mouse button state changed to up.
4509 """
4510 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4511
4512 def MiddleUp(*args, **kwargs):
4513 """
4514 MiddleUp(self) -> bool
4515
4516 Returns true if the middle mouse button state changed to up.
4517 """
4518 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4519
4520 def RightUp(*args, **kwargs):
4521 """
4522 RightUp(self) -> bool
4523
4524 Returns true if the right mouse button state changed to up.
4525 """
4526 return _core_.MouseEvent_RightUp(*args, **kwargs)
4527
4528 def LeftDClick(*args, **kwargs):
4529 """
4530 LeftDClick(self) -> bool
4531
4532 Returns true if the event was a left button double click.
4533 """
4534 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4535
4536 def MiddleDClick(*args, **kwargs):
4537 """
4538 MiddleDClick(self) -> bool
4539
4540 Returns true if the event was a middle button double click.
4541 """
4542 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4543
4544 def RightDClick(*args, **kwargs):
4545 """
4546 RightDClick(self) -> bool
4547
4548 Returns true if the event was a right button double click.
4549 """
4550 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4551
4552 def LeftIsDown(*args, **kwargs):
4553 """
4554 LeftIsDown(self) -> bool
4555
4556 Returns true if the left mouse button is currently down, independent
4557 of the current event type.
4558
4559 Please notice that it is not the same as LeftDown which returns true
4560 if the left mouse button was just pressed. Rather, it describes the
4561 state of the mouse button before the event happened.
4562
4563 This event is usually used in the mouse event handlers which process
4564 "move mouse" messages to determine whether the user is (still)
4565 dragging the mouse.
4566 """
4567 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4568
4569 def MiddleIsDown(*args, **kwargs):
4570 """
4571 MiddleIsDown(self) -> bool
4572
4573 Returns true if the middle mouse button is currently down, independent
4574 of the current event type.
4575 """
4576 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4577
4578 def RightIsDown(*args, **kwargs):
4579 """
4580 RightIsDown(self) -> bool
4581
4582 Returns true if the right mouse button is currently down, independent
4583 of the current event type.
4584 """
4585 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4586
4587 def Dragging(*args, **kwargs):
4588 """
4589 Dragging(self) -> bool
4590
4591 Returns true if this was a dragging event (motion while a button is
4592 depressed).
4593 """
4594 return _core_.MouseEvent_Dragging(*args, **kwargs)
4595
4596 def Moving(*args, **kwargs):
4597 """
4598 Moving(self) -> bool
4599
4600 Returns true if this was a motion event and no mouse buttons were
4601 pressed. If any mouse button is held pressed, then this method returns
4602 false and Dragging returns true.
4603 """
4604 return _core_.MouseEvent_Moving(*args, **kwargs)
4605
4606 def Entering(*args, **kwargs):
4607 """
4608 Entering(self) -> bool
4609
4610 Returns true if the mouse was entering the window.
4611 """
4612 return _core_.MouseEvent_Entering(*args, **kwargs)
4613
4614 def Leaving(*args, **kwargs):
4615 """
4616 Leaving(self) -> bool
4617
4618 Returns true if the mouse was leaving the window.
4619 """
4620 return _core_.MouseEvent_Leaving(*args, **kwargs)
4621
4622 def GetPosition(*args, **kwargs):
4623 """
4624 GetPosition(self) -> Point
4625
4626 Returns the pixel position of the mouse in window coordinates when the
4627 event happened.
4628 """
4629 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4630
4631 def GetPositionTuple(*args, **kwargs):
4632 """
4633 GetPositionTuple() -> (x,y)
4634
4635 Returns the pixel position of the mouse in window coordinates when the
4636 event happened.
4637 """
4638 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4639
4640 def GetLogicalPosition(*args, **kwargs):
4641 """
4642 GetLogicalPosition(self, DC dc) -> Point
4643
4644 Returns the logical mouse position in pixels (i.e. translated
4645 according to the translation set for the DC, which usually indicates
4646 that the window has been scrolled).
4647 """
4648 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4649
4650 def GetX(*args, **kwargs):
4651 """
4652 GetX(self) -> int
4653
4654 Returns X coordinate of the physical mouse event position.
4655 """
4656 return _core_.MouseEvent_GetX(*args, **kwargs)
4657
4658 def GetY(*args, **kwargs):
4659 """
4660 GetY(self) -> int
4661
4662 Returns Y coordinate of the physical mouse event position.
4663 """
4664 return _core_.MouseEvent_GetY(*args, **kwargs)
4665
4666 def GetWheelRotation(*args, **kwargs):
4667 """
4668 GetWheelRotation(self) -> int
4669
4670 Get wheel rotation, positive or negative indicates direction of
4671 rotation. Current devices all send an event when rotation is equal to
4672 +/-WheelDelta, but this allows for finer resolution devices to be
4673 created in the future. Because of this you shouldn't assume that one
4674 event is equal to 1 line or whatever, but you should be able to either
4675 do partial line scrolling or wait until +/-WheelDelta rotation values
4676 have been accumulated before scrolling.
4677 """
4678 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4679
4680 def GetWheelDelta(*args, **kwargs):
4681 """
4682 GetWheelDelta(self) -> int
4683
4684 Get wheel delta, normally 120. This is the threshold for action to be
4685 taken, and one such action (for example, scrolling one increment)
4686 should occur for each delta.
4687 """
4688 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4689
4690 def GetLinesPerAction(*args, **kwargs):
4691 """
4692 GetLinesPerAction(self) -> int
4693
4694 Returns the configured number of lines (or whatever) to be scrolled
4695 per wheel action. Defaults to three.
4696 """
4697 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4698
4699 def IsPageScroll(*args, **kwargs):
4700 """
4701 IsPageScroll(self) -> bool
4702
4703 Returns true if the system has been setup to do page scrolling with
4704 the mouse wheel instead of line scrolling.
4705 """
4706 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4707
4708 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4709 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4710 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4711 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4712 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4713 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4714 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4715 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4716 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4717 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4718 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4719 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4720 Button = property(GetButton,doc="See `GetButton`")
4721 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4722 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4723 Position = property(GetPosition,doc="See `GetPosition`")
4724 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4725 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4726 X = property(GetX,doc="See `GetX`")
4727 Y = property(GetY,doc="See `GetY`")
4728 _core_.MouseEvent_swigregister(MouseEvent)
4729
4730 #---------------------------------------------------------------------------
4731
4732 class SetCursorEvent(Event):
4733 """
4734 A SetCursorEvent is generated when the mouse cursor is about to be set
4735 as a result of mouse motion. This event gives the application the
4736 chance to perform specific mouse cursor processing based on the
4737 current position of the mouse within the window. Use the `SetCursor`
4738 method to specify the cursor you want to be displayed.
4739 """
4740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4741 __repr__ = _swig_repr
4742 def __init__(self, *args, **kwargs):
4743 """
4744 __init__(self, int x=0, int y=0) -> SetCursorEvent
4745
4746 Construct a new `wx.SetCursorEvent`.
4747 """
4748 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4749 def GetX(*args, **kwargs):
4750 """
4751 GetX(self) -> int
4752
4753 Returns the X coordinate of the mouse in client coordinates.
4754 """
4755 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4756
4757 def GetY(*args, **kwargs):
4758 """
4759 GetY(self) -> int
4760
4761 Returns the Y coordinate of the mouse in client coordinates.
4762 """
4763 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4764
4765 def SetCursor(*args, **kwargs):
4766 """
4767 SetCursor(self, Cursor cursor)
4768
4769 Sets the cursor associated with this event.
4770 """
4771 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4772
4773 def GetCursor(*args, **kwargs):
4774 """
4775 GetCursor(self) -> Cursor
4776
4777 Returns a reference to the cursor specified by this event.
4778 """
4779 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4780
4781 def HasCursor(*args, **kwargs):
4782 """
4783 HasCursor(self) -> bool
4784
4785 Returns true if the cursor specified by this event is a valid cursor.
4786 """
4787 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4788
4789 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4790 X = property(GetX,doc="See `GetX`")
4791 Y = property(GetY,doc="See `GetY`")
4792 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4793
4794 #---------------------------------------------------------------------------
4795
4796 class KeyEvent(Event):
4797 """
4798 This event class contains information about keypress and character
4799 events. These events are only sent to the widget that currently has
4800 the keyboard focus.
4801
4802 Notice that there are three different kinds of keyboard events in
4803 wxWidgets: key down and up events and char events. The difference
4804 between the first two is clear - the first corresponds to a key press
4805 and the second to a key release - otherwise they are identical. Just
4806 note that if the key is maintained in a pressed state you will
4807 typically get a lot of (automatically generated) down events but only
4808 one up so it is wrong to assume that there is one up event
4809 corresponding to each down one.
4810
4811 Both key events provide untranslated key codes while the char event
4812 carries the translated one. The untranslated code for alphanumeric
4813 keys is always an upper case value. For the other keys it is one of
4814 WXK_XXX values from the keycodes table. The translated key is, in
4815 general, the character the user expects to appear as the result of the
4816 key combination when typing the text into a text entry zone, for
4817 example.
4818
4819 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4820 and the standard US keyboard): when the 'A' key is pressed, the key
4821 down event key code is equal to ASCII A == 65. But the char event key
4822 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4823 'A' keys simultaneously , the key code in key down event will still be
4824 just 'A' while the char event key code parameter will now be 'A' as
4825 well.
4826
4827 Although in this simple case it is clear that the correct key code
4828 could be found in the key down event handler by checking the value
4829 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4830 as for non alphanumeric keys or non-US keyboard layouts the
4831 translation is keyboard-layout dependent and can only be done properly
4832 by the system itself.
4833
4834 Another kind of translation is done when the control key is pressed:
4835 for example, for CTRL-A key press the key down event still carries the
4836 same key code 'A' as usual but the char event will have key code of 1,
4837 the ASCII value of this key combination.
4838
4839 You may discover how the other keys on your system behave
4840 interactively by running the KeyEvents sample in the wxPython demo and
4841 pressing some keys while the blue box at the top has the keyboard
4842 focus.
4843
4844 **Note**: If a key down event is caught and the event handler does not
4845 call event.Skip() then the coresponding char event will not
4846 happen. This is by design and enables the programs that handle both
4847 types of events to be a bit simpler.
4848
4849 **Note for Windows programmers**: The key and char events in wxWidgets
4850 are similar to but slightly different from Windows WM_KEYDOWN and
4851 WM_CHAR events. In particular, Alt-x combination will generate a char
4852 event in wxWidgets (unless it is used as an accelerator).
4853
4854 **Tip**: be sure to call event.Skip() for events that you don't
4855 process in key event function, otherwise menu shortcuts may cease to
4856 work under Windows.
4857
4858 """
4859 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4860 __repr__ = _swig_repr
4861 def __init__(self, *args, **kwargs):
4862 """
4863 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4864
4865 Construct a new `wx.KeyEvent`. Valid event types are:
4866 *
4867 """
4868 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4869 def GetModifiers(*args, **kwargs):
4870 """
4871 GetModifiers(self) -> int
4872
4873 Returns a bitmask of the current modifier settings. Can be used to
4874 check if the key event has exactly the given modifiers without having
4875 to explicitly check that the other modifiers are not down. For
4876 example::
4877
4878 if event.GetModifers() == wx.MOD_CONTROL:
4879 DoSomething()
4880
4881 """
4882 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4883
4884 def ControlDown(*args, **kwargs):
4885 """
4886 ControlDown(self) -> bool
4887
4888 Returns ``True`` if the Control key was down at the time of the event.
4889 """
4890 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4891
4892 def MetaDown(*args, **kwargs):
4893 """
4894 MetaDown(self) -> bool
4895
4896 Returns ``True`` if the Meta key was down at the time of the event.
4897 """
4898 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4899
4900 def AltDown(*args, **kwargs):
4901 """
4902 AltDown(self) -> bool
4903
4904 Returns ``True`` if the Alt key was down at the time of the event.
4905 """
4906 return _core_.KeyEvent_AltDown(*args, **kwargs)
4907
4908 def ShiftDown(*args, **kwargs):
4909 """
4910 ShiftDown(self) -> bool
4911
4912 Returns ``True`` if the Shift key was down at the time of the event.
4913 """
4914 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4915
4916 def CmdDown(*args, **kwargs):
4917 """
4918 CmdDown(self) -> bool
4919
4920 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4921 platforms but the special "Apple" (a.k.a as "Command") key on
4922 Macs. It makes often sense to use it instead of, say, `ControlDown`
4923 because Cmd key is used for the same thing under Mac as Ctrl
4924 elsewhere. The Ctrl still exists, it's just not used for this
4925 purpose. So for non-Mac platforms this is the same as `ControlDown`
4926 and Macs this is the same as `MetaDown`.
4927 """
4928 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4929
4930 def HasModifiers(*args, **kwargs):
4931 """
4932 HasModifiers(self) -> bool
4933
4934 Returns true if either CTRL or ALT keys was down at the time of the
4935 key event. Note that this function does not take into account neither
4936 SHIFT nor META key states (the reason for ignoring the latter is that
4937 it is common for NUMLOCK key to be configured as META under X but the
4938 key presses even while NUMLOCK is on should be still processed
4939 normally).
4940 """
4941 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4942
4943 def GetKeyCode(*args, **kwargs):
4944 """
4945 GetKeyCode(self) -> int
4946
4947 Returns the virtual key code. ASCII events return normal ASCII values,
4948 while non-ASCII events return values such as WXK_LEFT for the left
4949 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4950 codes.
4951
4952 Note that in Unicode build, the returned value is meaningful only if
4953 the user entered a character that can be represented in current
4954 locale's default charset. You can obtain the corresponding Unicode
4955 character using `GetUnicodeKey`.
4956 """
4957 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4958
4959 def GetUnicodeKey(*args, **kwargs):
4960 """
4961 GetUnicodeKey(self) -> int
4962
4963 Returns the Unicode character corresponding to this key event. This
4964 function is only meaningfule in a Unicode build of wxPython.
4965 """
4966 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4967
4968 GetUniChar = GetUnicodeKey
4969 def SetUnicodeKey(*args, **kwargs):
4970 """
4971 SetUnicodeKey(self, int uniChar)
4972
4973 Set the Unicode value of the key event, but only if this is a Unicode
4974 build of wxPython.
4975 """
4976 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4977
4978 def GetRawKeyCode(*args, **kwargs):
4979 """
4980 GetRawKeyCode(self) -> unsigned int
4981
4982 Returns the raw key code for this event. This is a platform-dependent
4983 scan code which should only be used in advanced
4984 applications. Currently the raw key codes are not supported by all
4985 ports.
4986 """
4987 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4988
4989 def GetRawKeyFlags(*args, **kwargs):
4990 """
4991 GetRawKeyFlags(self) -> unsigned int
4992
4993 Returns the low level key flags for this event. The flags are
4994 platform-dependent and should only be used in advanced applications.
4995 Currently the raw key flags are not supported by all ports.
4996 """
4997 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4998
4999 def GetPosition(*args, **kwargs):
5000 """
5001 GetPosition(self) -> Point
5002
5003 Find the position of the event, if applicable.
5004 """
5005 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5006
5007 def GetPositionTuple(*args, **kwargs):
5008 """
5009 GetPositionTuple() -> (x,y)
5010
5011 Find the position of the event, if applicable.
5012 """
5013 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5014
5015 def GetX(*args, **kwargs):
5016 """
5017 GetX(self) -> int
5018
5019 Returns the X position (in client coordinates) of the event, if
5020 applicable.
5021 """
5022 return _core_.KeyEvent_GetX(*args, **kwargs)
5023
5024 def GetY(*args, **kwargs):
5025 """
5026 GetY(self) -> int
5027
5028 Returns the Y position (in client coordinates) of the event, if
5029 applicable.
5030 """
5031 return _core_.KeyEvent_GetY(*args, **kwargs)
5032
5033 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5034 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5035 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5036 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5037 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5038 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5039 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5040 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5041 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5042 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5043 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5044 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5045 Position = property(GetPosition,doc="See `GetPosition`")
5046 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5047 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5048 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5049 X = property(GetX,doc="See `GetX`")
5050 Y = property(GetY,doc="See `GetY`")
5051 _core_.KeyEvent_swigregister(KeyEvent)
5052
5053 #---------------------------------------------------------------------------
5054
5055 class SizeEvent(Event):
5056 """
5057 A size event holds information about size change events. The EVT_SIZE
5058 handler function will be called when the window it is bound to has
5059 been resized.
5060
5061 Note that the size passed is of the whole window: call
5062 `wx.Window.GetClientSize` for the area which may be used by the
5063 application.
5064
5065 When a window is resized, usually only a small part of the window is
5066 damaged and and that area is all that is in the update region for the
5067 next paint event. However, if your drawing depends on the size of the
5068 window, you may need to clear the DC explicitly and repaint the whole
5069 window. In which case, you may need to call `wx.Window.Refresh` to
5070 invalidate the entire window.
5071
5072 """
5073 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5074 __repr__ = _swig_repr
5075 def __init__(self, *args, **kwargs):
5076 """
5077 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5078
5079 Construct a new ``wx.SizeEvent``.
5080 """
5081 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5082 def GetSize(*args, **kwargs):
5083 """
5084 GetSize(self) -> Size
5085
5086 Returns the entire size of the window generating the size change
5087 event.
5088 """
5089 return _core_.SizeEvent_GetSize(*args, **kwargs)
5090
5091 def GetRect(*args, **kwargs):
5092 """GetRect(self) -> Rect"""
5093 return _core_.SizeEvent_GetRect(*args, **kwargs)
5094
5095 def SetRect(*args, **kwargs):
5096 """SetRect(self, Rect rect)"""
5097 return _core_.SizeEvent_SetRect(*args, **kwargs)
5098
5099 def SetSize(*args, **kwargs):
5100 """SetSize(self, Size size)"""
5101 return _core_.SizeEvent_SetSize(*args, **kwargs)
5102
5103 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5104 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5105 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5106 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
5107 _core_.SizeEvent_swigregister(SizeEvent)
5108
5109 #---------------------------------------------------------------------------
5110
5111 class MoveEvent(Event):
5112 """
5113 This event object is sent for EVT_MOVE event bindings when a window is
5114 moved to a new position.
5115 """
5116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5117 __repr__ = _swig_repr
5118 def __init__(self, *args, **kwargs):
5119 """
5120 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5121
5122 Constructor.
5123 """
5124 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5125 def GetPosition(*args, **kwargs):
5126 """
5127 GetPosition(self) -> Point
5128
5129 Returns the position of the window generating the move change event.
5130 """
5131 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5132
5133 def GetRect(*args, **kwargs):
5134 """GetRect(self) -> Rect"""
5135 return _core_.MoveEvent_GetRect(*args, **kwargs)
5136
5137 def SetRect(*args, **kwargs):
5138 """SetRect(self, Rect rect)"""
5139 return _core_.MoveEvent_SetRect(*args, **kwargs)
5140
5141 def SetPosition(*args, **kwargs):
5142 """SetPosition(self, Point pos)"""
5143 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5144
5145 m_pos = property(GetPosition, SetPosition)
5146 m_rect = property(GetRect, SetRect)
5147
5148 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5149 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5150 _core_.MoveEvent_swigregister(MoveEvent)
5151
5152 #---------------------------------------------------------------------------
5153
5154 class PaintEvent(Event):
5155 """
5156 A paint event is sent when a window's contents needs to be repainted.
5157 Note that in an EVT_PAINT handler the application must *always* create
5158 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5159 Windows assumes that the window has not been painted yet and will send
5160 the event again, causing endless refreshes.
5161
5162 You can optimize painting by retrieving the rectangles that have been
5163 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5164 and only repainting these rectangles. The rectangles are in terms of
5165 the client area, and are unscrolled, so you will need to do some
5166 calculations using the current view position to obtain logical,
5167 scrolled units.
5168
5169 """
5170 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5171 __repr__ = _swig_repr
5172 def __init__(self, *args, **kwargs):
5173 """__init__(self, int Id=0) -> PaintEvent"""
5174 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5175 _core_.PaintEvent_swigregister(PaintEvent)
5176
5177 class NcPaintEvent(Event):
5178 """Proxy of C++ NcPaintEvent class"""
5179 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5180 __repr__ = _swig_repr
5181 def __init__(self, *args, **kwargs):
5182 """__init__(self, int winid=0) -> NcPaintEvent"""
5183 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5184 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5185
5186 #---------------------------------------------------------------------------
5187
5188 class EraseEvent(Event):
5189 """
5190 An erase event is sent whenever the background of a window needs to be
5191 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5192 binder. On some platforms, such as GTK+, this event is simulated
5193 (simply generated just before the paint event) and may cause flicker.
5194
5195 To paint a custom background use the `GetDC` method and use the returned
5196 device context if it is not ``None``, otherwise create a temporary
5197 `wx.ClientDC` and draw on that.
5198
5199 """
5200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5201 __repr__ = _swig_repr
5202 def __init__(self, *args, **kwargs):
5203 """
5204 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5205
5206 Constructor
5207 """
5208 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5209 def GetDC(*args, **kwargs):
5210 """
5211 GetDC(self) -> DC
5212
5213 Returns the device context the event handler should draw upon. If
5214 ``None`` is returned then create a temporary `wx.ClientDC` and use
5215 that instead.
5216 """
5217 return _core_.EraseEvent_GetDC(*args, **kwargs)
5218
5219 DC = property(GetDC,doc="See `GetDC`")
5220 _core_.EraseEvent_swigregister(EraseEvent)
5221
5222 #---------------------------------------------------------------------------
5223
5224 class FocusEvent(Event):
5225 """
5226 A focus event is sent when a window's focus changes. The window losing
5227 focus receives an EVT_KILL_FOCUS event while the window gaining it
5228 gets an EVT_SET_FOCUS event.
5229
5230 Notice that the set focus event happens both when the user gives focus
5231 to the window (whether using the mouse or keyboard) and when it is
5232 done from the program itself using `wx.Window.SetFocus`.
5233
5234 """
5235 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5236 __repr__ = _swig_repr
5237 def __init__(self, *args, **kwargs):
5238 """
5239 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5240
5241 Constructor
5242 """
5243 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5244 def GetWindow(*args, **kwargs):
5245 """
5246 GetWindow(self) -> Window
5247
5248 Returns the other window associated with this event, that is the
5249 window which had the focus before for the EVT_SET_FOCUS event and the
5250 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5251
5252 Warning: the window returned may be None!
5253 """
5254 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5255
5256 def SetWindow(*args, **kwargs):
5257 """SetWindow(self, Window win)"""
5258 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5259
5260 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5261 _core_.FocusEvent_swigregister(FocusEvent)
5262
5263 #---------------------------------------------------------------------------
5264
5265 class ChildFocusEvent(CommandEvent):
5266 """
5267 A child focus event is sent to a (parent-)window when one of its child
5268 windows gains focus, so that the window could restore the focus back
5269 to its corresponding child if it loses it now and regains later.
5270
5271 Notice that child window is the direct child of the window receiving
5272 the event, and so may not be the actual widget recieving focus if it
5273 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5274 to get the widget that is actually receiving focus.
5275 """
5276 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5277 __repr__ = _swig_repr
5278 def __init__(self, *args, **kwargs):
5279 """
5280 __init__(self, Window win=None) -> ChildFocusEvent
5281
5282 Constructor
5283 """
5284 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5285 def GetWindow(*args, **kwargs):
5286 """
5287 GetWindow(self) -> Window
5288
5289 The window, or (grand)parent of the window which has just received the
5290 focus.
5291 """
5292 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5293
5294 Window = property(GetWindow,doc="See `GetWindow`")
5295 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5296
5297 #---------------------------------------------------------------------------
5298
5299 class ActivateEvent(Event):
5300 """
5301 An activate event is sent when a top-level window or the entire
5302 application is being activated or deactivated.
5303
5304 A top-level window (a dialog or frame) receives an activate event when
5305 is being activated or deactivated. This is indicated visually by the
5306 title bar changing colour, and a subwindow gaining the keyboard focus.
5307 An application is activated or deactivated when one of its frames
5308 becomes activated, or a frame becomes inactivate resulting in all
5309 application frames being inactive.
5310
5311 Please note that usually you should call event.Skip() in your handlers
5312 for these events so the default handlers will still be called, as not
5313 doing so can result in strange effects.
5314
5315 """
5316 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5317 __repr__ = _swig_repr
5318 def __init__(self, *args, **kwargs):
5319 """
5320 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5321
5322 Constructor
5323 """
5324 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5325 def GetActive(*args, **kwargs):
5326 """
5327 GetActive(self) -> bool
5328
5329 Returns true if the application or window is being activated, false
5330 otherwise.
5331 """
5332 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5333
5334 Active = property(GetActive,doc="See `GetActive`")
5335 _core_.ActivateEvent_swigregister(ActivateEvent)
5336
5337 #---------------------------------------------------------------------------
5338
5339 class InitDialogEvent(Event):
5340 """
5341 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5342 any window when `wx.Window.InitDialog` is called. Handlers for this
5343 event can transfer data to the window, or anything else that should be
5344 done before the user begins editing the form. The default handler
5345 calls `wx.Window.TransferDataToWindow`.
5346 """
5347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5348 __repr__ = _swig_repr
5349 def __init__(self, *args, **kwargs):
5350 """
5351 __init__(self, int Id=0) -> InitDialogEvent
5352
5353 Constructor
5354 """
5355 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5356 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5357
5358 #---------------------------------------------------------------------------
5359
5360 class MenuEvent(Event):
5361 """
5362 This class is used for a variety of menu-related events. Note that
5363 these do not include menu command events, which are handled by sending
5364 `wx.CommandEvent` objects.
5365
5366 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5367 text in the first field of the status bar.
5368 """
5369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5370 __repr__ = _swig_repr
5371 def __init__(self, *args, **kwargs):
5372 """
5373 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5374
5375 Constructor
5376 """
5377 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5378 def GetMenuId(*args, **kwargs):
5379 """
5380 GetMenuId(self) -> int
5381
5382 Returns the menu identifier associated with the event. This method
5383 should be only used with the HIGHLIGHT events.
5384 """
5385 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5386
5387 def IsPopup(*args, **kwargs):
5388 """
5389 IsPopup(self) -> bool
5390
5391 Returns ``True`` if the menu which is being opened or closed is a
5392 popup menu, ``False`` if it is a normal one. This method should only
5393 be used with the OPEN and CLOSE events.
5394 """
5395 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5396
5397 def GetMenu(*args, **kwargs):
5398 """
5399 GetMenu(self) -> Menu
5400
5401 Returns the menu which is being opened or closed. This method should
5402 only be used with the OPEN and CLOSE events.
5403 """
5404 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5405
5406 Menu = property(GetMenu,doc="See `GetMenu`")
5407 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5408 _core_.MenuEvent_swigregister(MenuEvent)
5409
5410 #---------------------------------------------------------------------------
5411
5412 class CloseEvent(Event):
5413 """
5414 This event class contains information about window and session close
5415 events.
5416
5417 The handler function for EVT_CLOSE is called when the user has tried
5418 to close a a frame or dialog box using the window manager controls or
5419 the system menu. It can also be invoked by the application itself
5420 programmatically, for example by calling the `wx.Window.Close`
5421 function.
5422
5423 You should check whether the application is forcing the deletion of
5424 the window using `CanVeto`. If it returns ``False``, you must destroy
5425 the window using `wx.Window.Destroy`. If the return value is ``True``,
5426 it is up to you whether you respond by destroying the window or not.
5427 For example you may wish to display a message dialog prompting to save
5428 files or to cancel the close.
5429
5430 If you don't destroy the window, you should call `Veto` to let the
5431 calling code know that you did not destroy the window. This allows the
5432 `wx.Window.Close` function to return ``True`` or ``False`` depending
5433 on whether the close instruction was honored or not.
5434 """
5435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5436 __repr__ = _swig_repr
5437 def __init__(self, *args, **kwargs):
5438 """
5439 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5440
5441 Constructor.
5442 """
5443 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5444 def SetLoggingOff(*args, **kwargs):
5445 """
5446 SetLoggingOff(self, bool logOff)
5447
5448 Sets the 'logging off' flag.
5449 """
5450 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5451
5452 def GetLoggingOff(*args, **kwargs):
5453 """
5454 GetLoggingOff(self) -> bool
5455
5456 Returns ``True`` if the user is logging off or ``False`` if the
5457 system is shutting down. This method can only be called for end
5458 session and query end session events, it doesn't make sense for close
5459 window event.
5460 """
5461 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5462
5463 def Veto(*args, **kwargs):
5464 """
5465 Veto(self, bool veto=True)
5466
5467 Call this from your event handler to veto a system shutdown or to
5468 signal to the calling application that a window close did not happen.
5469
5470 You can only veto a shutdown or close if `CanVeto` returns true.
5471 """
5472 return _core_.CloseEvent_Veto(*args, **kwargs)
5473
5474 def GetVeto(*args, **kwargs):
5475 """GetVeto(self) -> bool"""
5476 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5477
5478 def SetCanVeto(*args, **kwargs):
5479 """
5480 SetCanVeto(self, bool canVeto)
5481
5482 Sets the 'can veto' flag.
5483 """
5484 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5485
5486 def CanVeto(*args, **kwargs):
5487 """
5488 CanVeto(self) -> bool
5489
5490 Returns true if you can veto a system shutdown or a window close
5491 event. Vetoing a window close event is not possible if the calling
5492 code wishes to force the application to exit, and so this function
5493 must be called to check this.
5494 """
5495 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5496
5497 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5498 _core_.CloseEvent_swigregister(CloseEvent)
5499
5500 #---------------------------------------------------------------------------
5501
5502 class ShowEvent(Event):
5503 """An EVT_SHOW event is sent when a window is shown or hidden."""
5504 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5505 __repr__ = _swig_repr
5506 def __init__(self, *args, **kwargs):
5507 """
5508 __init__(self, int winid=0, bool show=False) -> ShowEvent
5509
5510 An EVT_SHOW event is sent when a window is shown or hidden.
5511 """
5512 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5513 def SetShow(*args, **kwargs):
5514 """SetShow(self, bool show)"""
5515 return _core_.ShowEvent_SetShow(*args, **kwargs)
5516
5517 def GetShow(*args, **kwargs):
5518 """GetShow(self) -> bool"""
5519 return _core_.ShowEvent_GetShow(*args, **kwargs)
5520
5521 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
5522 _core_.ShowEvent_swigregister(ShowEvent)
5523
5524 #---------------------------------------------------------------------------
5525
5526 class IconizeEvent(Event):
5527 """
5528 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5529 restored.
5530 """
5531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5532 __repr__ = _swig_repr
5533 def __init__(self, *args, **kwargs):
5534 """
5535 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5536
5537 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5538 restored.
5539 """
5540 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5541 def Iconized(*args, **kwargs):
5542 """
5543 Iconized(self) -> bool
5544
5545 Returns ``True`` if the frame has been iconized, ``False`` if it has
5546 been restored.
5547 """
5548 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5549
5550 _core_.IconizeEvent_swigregister(IconizeEvent)
5551
5552 #---------------------------------------------------------------------------
5553
5554 class MaximizeEvent(Event):
5555 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5556 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5557 __repr__ = _swig_repr
5558 def __init__(self, *args, **kwargs):
5559 """
5560 __init__(self, int id=0) -> MaximizeEvent
5561
5562 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5563 """
5564 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5565 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5566
5567 #---------------------------------------------------------------------------
5568
5569 class DropFilesEvent(Event):
5570 """
5571 This class is used for drop files events, that is, when files have
5572 been dropped onto the window. This functionality is only available
5573 under Windows. The window must have previously been enabled for
5574 dropping by calling `wx.Window.DragAcceptFiles`.
5575
5576 Important note: this is a separate implementation to the more general
5577 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5578 implementation uses the older, Windows message-based approach of
5579 dropping files.
5580
5581 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5582 events.
5583
5584 """
5585 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5586 def __init__(self): raise AttributeError, "No constructor defined"
5587 __repr__ = _swig_repr
5588 def GetPosition(*args, **kwargs):
5589 """
5590 GetPosition(self) -> Point
5591
5592 Returns the position at which the files were dropped.
5593 """
5594 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5595
5596 def GetNumberOfFiles(*args, **kwargs):
5597 """
5598 GetNumberOfFiles(self) -> int
5599
5600 Returns the number of files dropped.
5601 """
5602 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5603
5604 def GetFiles(*args, **kwargs):
5605 """
5606 GetFiles(self) -> PyObject
5607
5608 Returns a list of the filenames that were dropped.
5609 """
5610 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5611
5612 Files = property(GetFiles,doc="See `GetFiles`")
5613 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5614 Position = property(GetPosition,doc="See `GetPosition`")
5615 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5616
5617 #---------------------------------------------------------------------------
5618
5619 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5620 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5621 class UpdateUIEvent(CommandEvent):
5622 """
5623 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5624 wxWidgets to give an application the chance to update various user
5625 interface elements.
5626
5627 Without update UI events, an application has to work hard to
5628 check/uncheck, enable/disable, and set the text for elements such as
5629 menu items and toolbar buttons. The code for doing this has to be
5630 mixed up with the code that is invoked when an action is invoked for a
5631 menu item or button.
5632
5633 With update UI events, you define an event handler to look at the
5634 state of the application and change UI elements accordingly. wxWidgets
5635 will call your handler functions in idle time, so you don't have to
5636 worry where to call this code. In addition to being a clearer and more
5637 declarative method, it also means you don't have to worry whether
5638 you're updating a toolbar or menubar identifier. The same handler can
5639 update a menu item and toolbar button, if the ID values are the same.
5640
5641 Instead of directly manipulating the menu or button, you call
5642 functions in the event object, such as `Check`. wxWidgets will
5643 determine whether such a call has been made, and which UI element to
5644 update.
5645
5646 These events will work for popup menus as well as menubars. Just
5647 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5648 any UI events for the window that owns the menu.
5649
5650 If you find that the overhead of UI update processing is affecting
5651 your application, you can do one or both of the following:
5652
5653 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5654 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5655 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5656 receive update events. No other windows will receive update
5657 events.
5658
5659 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5660 value to set the delay between updates. You may need to call
5661 `wx.Window.UpdateWindowUI` at critical points, for example when
5662 a dialog is about to be shown, in case the user sees a slight
5663 delay before windows are updated.
5664
5665 Note that although events are sent in idle time, defining a EVT_IDLE
5666 handler for a window does not affect this because the events are sent
5667 from an internal idle handler.
5668
5669 wxWidgets tries to optimize update events on some platforms. On
5670 Windows and GTK+, events for menubar items are only sent when the menu
5671 is about to be shown, and not in idle time.
5672
5673 """
5674 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5675 __repr__ = _swig_repr
5676 def __init__(self, *args, **kwargs):
5677 """
5678 __init__(self, int commandId=0) -> UpdateUIEvent
5679
5680 Constructor
5681 """
5682 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5683 def GetChecked(*args, **kwargs):
5684 """
5685 GetChecked(self) -> bool
5686
5687 Returns ``True`` if the UI element should be checked.
5688 """
5689 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5690
5691 def GetEnabled(*args, **kwargs):
5692 """
5693 GetEnabled(self) -> bool
5694
5695 Returns ``True`` if the UI element should be enabled.
5696 """
5697 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5698
5699 def GetShown(*args, **kwargs):
5700 """
5701 GetShown(self) -> bool
5702
5703 Returns ``True`` if the UI element should be shown.
5704 """
5705 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5706
5707 def GetText(*args, **kwargs):
5708 """
5709 GetText(self) -> String
5710
5711 Returns the text that should be set for the UI element.
5712 """
5713 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5714
5715 def GetSetText(*args, **kwargs):
5716 """
5717 GetSetText(self) -> bool
5718
5719 Returns ``True`` if the application has called `SetText`. For
5720 wxWidgets internal use only.
5721 """
5722 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5723
5724 def GetSetChecked(*args, **kwargs):
5725 """
5726 GetSetChecked(self) -> bool
5727
5728 Returns ``True`` if the application has called `Check`. For wxWidgets
5729 internal use only.
5730 """
5731 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5732
5733 def GetSetEnabled(*args, **kwargs):
5734 """
5735 GetSetEnabled(self) -> bool
5736
5737 Returns ``True`` if the application has called `Enable`. For wxWidgets
5738 internal use only.
5739 """
5740 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5741
5742 def GetSetShown(*args, **kwargs):
5743 """
5744 GetSetShown(self) -> bool
5745
5746 Returns ``True`` if the application has called `Show`. For wxWidgets
5747 internal use only.
5748 """
5749 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5750
5751 def Check(*args, **kwargs):
5752 """
5753 Check(self, bool check)
5754
5755 Check or uncheck the UI element.
5756 """
5757 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5758
5759 def Enable(*args, **kwargs):
5760 """
5761 Enable(self, bool enable)
5762
5763 Enable or disable the UI element.
5764 """
5765 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5766
5767 def Show(*args, **kwargs):
5768 """
5769 Show(self, bool show)
5770
5771 Show or hide the UI element.
5772 """
5773 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5774
5775 def SetText(*args, **kwargs):
5776 """
5777 SetText(self, String text)
5778
5779 Sets the text for this UI element.
5780 """
5781 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5782
5783 def SetUpdateInterval(*args, **kwargs):
5784 """
5785 SetUpdateInterval(long updateInterval)
5786
5787 Sets the interval between updates in milliseconds. Set to -1 to
5788 disable updates, or to 0 to update as frequently as possible. The
5789 default is 0.
5790
5791 Use this to reduce the overhead of UI update events if your
5792 application has a lot of windows. If you set the value to -1 or
5793 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5794 at appropriate points in your application, such as when a dialog is
5795 about to be shown.
5796 """
5797 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5798
5799 SetUpdateInterval = staticmethod(SetUpdateInterval)
5800 def GetUpdateInterval(*args, **kwargs):
5801 """
5802 GetUpdateInterval() -> long
5803
5804 Returns the current interval between updates in milliseconds. -1
5805 disables updates, 0 updates as frequently as possible.
5806 """
5807 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5808
5809 GetUpdateInterval = staticmethod(GetUpdateInterval)
5810 def CanUpdate(*args, **kwargs):
5811 """
5812 CanUpdate(Window win) -> bool
5813
5814 Returns ``True`` if it is appropriate to update (send UI update events
5815 to) this window.
5816
5817 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5818 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5819 events were last sent in idle time, and the update interval, to
5820 determine whether events should be sent to this window now. By default
5821 this will always return true because the update mode is initially
5822 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5823 events will be sent as often as possible. You can reduce the frequency
5824 that events are sent by changing the mode and/or setting an update
5825 interval.
5826
5827 """
5828 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5829
5830 CanUpdate = staticmethod(CanUpdate)
5831 def ResetUpdateTime(*args, **kwargs):
5832 """
5833 ResetUpdateTime()
5834
5835 Used internally to reset the last-updated time to the current time. It
5836 is assumed that update events are normally sent in idle time, so this
5837 is called at the end of idle processing.
5838 """
5839 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5840
5841 ResetUpdateTime = staticmethod(ResetUpdateTime)
5842 def SetMode(*args, **kwargs):
5843 """
5844 SetMode(int mode)
5845
5846 Specify how wxWidgets will send update events: to all windows, or only
5847 to those which specify that they will process the events.
5848
5849 The mode may be one of the following values:
5850
5851 ============================= ==========================================
5852 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5853 is the default setting.
5854 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5855 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5856 style set.
5857 ============================= ==========================================
5858
5859 """
5860 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5861
5862 SetMode = staticmethod(SetMode)
5863 def GetMode(*args, **kwargs):
5864 """
5865 GetMode() -> int
5866
5867 Returns a value specifying how wxWidgets will send update events: to
5868 all windows, or only to those which specify that they will process the
5869 events.
5870 """
5871 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5872
5873 GetMode = staticmethod(GetMode)
5874 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5875
5876 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5877 """
5878 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5879
5880 Sets the interval between updates in milliseconds. Set to -1 to
5881 disable updates, or to 0 to update as frequently as possible. The
5882 default is 0.
5883
5884 Use this to reduce the overhead of UI update events if your
5885 application has a lot of windows. If you set the value to -1 or
5886 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5887 at appropriate points in your application, such as when a dialog is
5888 about to be shown.
5889 """
5890 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5891
5892 def UpdateUIEvent_GetUpdateInterval(*args):
5893 """
5894 UpdateUIEvent_GetUpdateInterval() -> long
5895
5896 Returns the current interval between updates in milliseconds. -1
5897 disables updates, 0 updates as frequently as possible.
5898 """
5899 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5900
5901 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5902 """
5903 UpdateUIEvent_CanUpdate(Window win) -> bool
5904
5905 Returns ``True`` if it is appropriate to update (send UI update events
5906 to) this window.
5907
5908 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5909 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5910 events were last sent in idle time, and the update interval, to
5911 determine whether events should be sent to this window now. By default
5912 this will always return true because the update mode is initially
5913 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5914 events will be sent as often as possible. You can reduce the frequency
5915 that events are sent by changing the mode and/or setting an update
5916 interval.
5917
5918 """
5919 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5920
5921 def UpdateUIEvent_ResetUpdateTime(*args):
5922 """
5923 UpdateUIEvent_ResetUpdateTime()
5924
5925 Used internally to reset the last-updated time to the current time. It
5926 is assumed that update events are normally sent in idle time, so this
5927 is called at the end of idle processing.
5928 """
5929 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5930
5931 def UpdateUIEvent_SetMode(*args, **kwargs):
5932 """
5933 UpdateUIEvent_SetMode(int mode)
5934
5935 Specify how wxWidgets will send update events: to all windows, or only
5936 to those which specify that they will process the events.
5937
5938 The mode may be one of the following values:
5939
5940 ============================= ==========================================
5941 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5942 is the default setting.
5943 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5944 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5945 style set.
5946 ============================= ==========================================
5947
5948 """
5949 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5950
5951 def UpdateUIEvent_GetMode(*args):
5952 """
5953 UpdateUIEvent_GetMode() -> int
5954
5955 Returns a value specifying how wxWidgets will send update events: to
5956 all windows, or only to those which specify that they will process the
5957 events.
5958 """
5959 return _core_.UpdateUIEvent_GetMode(*args)
5960
5961 #---------------------------------------------------------------------------
5962
5963 class SysColourChangedEvent(Event):
5964 """
5965 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5966 when the user changes the colour settings using the control
5967 panel. This is only applicable under Windows.
5968
5969 The default event handler for this event propagates the event to child
5970 windows, since Windows only sends the events to top-level windows. If
5971 intercepting this event for a top-level window, remember to call
5972 `Skip` so the the base class handler will still be executed, or to
5973 pass the event on to the window's children explicitly.
5974
5975 """
5976 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5977 __repr__ = _swig_repr
5978 def __init__(self, *args, **kwargs):
5979 """
5980 __init__(self) -> SysColourChangedEvent
5981
5982 Constructor
5983 """
5984 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5985 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5986
5987 #---------------------------------------------------------------------------
5988
5989 class MouseCaptureChangedEvent(Event):
5990 """
5991 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5992 a window that loses its mouse capture. This is called even if
5993 `wx.Window.ReleaseMouse` was called by the application code. Handling
5994 this event allows an application to cater for unexpected capture
5995 releases which might otherwise confuse mouse handling code.
5996
5997 This event is implemented under Windows only.
5998 """
5999 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6000 __repr__ = _swig_repr
6001 def __init__(self, *args, **kwargs):
6002 """
6003 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6004
6005 Constructor
6006 """
6007 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
6008 def GetCapturedWindow(*args, **kwargs):
6009 """
6010 GetCapturedWindow(self) -> Window
6011
6012 Returns the window that gained the capture, or ``None`` if it was a
6013 non-wxWidgets window.
6014 """
6015 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6016
6017 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
6018 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
6019
6020 #---------------------------------------------------------------------------
6021
6022 class MouseCaptureLostEvent(Event):
6023 """
6024 A mouse capture lost event is sent to a window that obtained mouse
6025 capture, which was subsequently loss due to "external" event, for
6026 example when a dialog box is shown or if another application captures
6027 the mouse.
6028
6029 If this happens, this event is sent to all windows that are on the
6030 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6031 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6032 if the capture changes because of a call to CaptureMouse or
6033 ReleaseMouse.
6034
6035 This event is currently emitted under Windows only.
6036
6037 """
6038 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6039 __repr__ = _swig_repr
6040 def __init__(self, *args, **kwargs):
6041 """
6042 __init__(self, int winid=0) -> MouseCaptureLostEvent
6043
6044 A mouse capture lost event is sent to a window that obtained mouse
6045 capture, which was subsequently loss due to "external" event, for
6046 example when a dialog box is shown or if another application captures
6047 the mouse.
6048
6049 If this happens, this event is sent to all windows that are on the
6050 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6051 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6052 if the capture changes because of a call to CaptureMouse or
6053 ReleaseMouse.
6054
6055 This event is currently emitted under Windows only.
6056
6057 """
6058 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6059 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6060
6061 #---------------------------------------------------------------------------
6062
6063 class DisplayChangedEvent(Event):
6064 """
6065 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6066 resolution has changed.
6067
6068 This event is implemented under Windows only.
6069 """
6070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6071 __repr__ = _swig_repr
6072 def __init__(self, *args, **kwargs):
6073 """__init__(self) -> DisplayChangedEvent"""
6074 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6075 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6076
6077 #---------------------------------------------------------------------------
6078
6079 class PaletteChangedEvent(Event):
6080 """
6081 An EVT_PALETTE_CHANGED event is sent when the system palette has
6082 changed, thereby giving each window a chance to redo their own to
6083 match.
6084
6085 This event is implemented under Windows only.
6086 """
6087 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6088 __repr__ = _swig_repr
6089 def __init__(self, *args, **kwargs):
6090 """
6091 __init__(self, int id=0) -> PaletteChangedEvent
6092
6093 An EVT_PALETTE_CHANGED event is sent when the system palette has
6094 changed, thereby giving each window a chance to redo their own to
6095 match.
6096
6097 This event is implemented under Windows only.
6098 """
6099 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6100 def SetChangedWindow(*args, **kwargs):
6101 """SetChangedWindow(self, Window win)"""
6102 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6103
6104 def GetChangedWindow(*args, **kwargs):
6105 """GetChangedWindow(self) -> Window"""
6106 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6107
6108 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
6109 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6110
6111 #---------------------------------------------------------------------------
6112
6113 class QueryNewPaletteEvent(Event):
6114 """
6115 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6116 focus and should re-do its palette.
6117
6118 This event is implemented under Windows only.
6119 """
6120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6121 __repr__ = _swig_repr
6122 def __init__(self, *args, **kwargs):
6123 """
6124 __init__(self, int winid=0) -> QueryNewPaletteEvent
6125
6126 Constructor.
6127 """
6128 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6129 def SetPaletteRealized(*args, **kwargs):
6130 """
6131 SetPaletteRealized(self, bool realized)
6132
6133 App should set this if it changes the palette.
6134 """
6135 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6136
6137 def GetPaletteRealized(*args, **kwargs):
6138 """GetPaletteRealized(self) -> bool"""
6139 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6140
6141 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
6142 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6143
6144 #---------------------------------------------------------------------------
6145
6146 class NavigationKeyEvent(Event):
6147 """
6148 EVT_NAVIGATION_KEY events are used to control moving the focus between
6149 widgets, otherwise known as tab-traversal. You woudl normally not
6150 catch navigation events in applications as there are already
6151 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6152 it useful to send navigation events in certain situations to change
6153 the focus in certain ways, although it's probably easier to just call
6154 `wx.Window.Navigate`.
6155 """
6156 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6157 __repr__ = _swig_repr
6158 def __init__(self, *args, **kwargs):
6159 """__init__(self) -> NavigationKeyEvent"""
6160 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6161 def GetDirection(*args, **kwargs):
6162 """
6163 GetDirection(self) -> bool
6164
6165 Returns ``True`` if the direction is forward, ``False`` otherwise.
6166 """
6167 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6168
6169 def SetDirection(*args, **kwargs):
6170 """
6171 SetDirection(self, bool forward)
6172
6173 Specify the direction that the navigation should take. Usually the
6174 difference between using Tab and Shift-Tab.
6175 """
6176 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6177
6178 def IsWindowChange(*args, **kwargs):
6179 """
6180 IsWindowChange(self) -> bool
6181
6182 Returns ``True`` if window change is allowed.
6183 """
6184 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6185
6186 def SetWindowChange(*args, **kwargs):
6187 """
6188 SetWindowChange(self, bool ischange)
6189
6190 Specify if the navigation should be able to change parent windows.
6191 For example, changing notebook pages, etc. This is usually implemented
6192 by using Control-Tab.
6193 """
6194 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6195
6196 def IsFromTab(*args, **kwargs):
6197 """
6198 IsFromTab(self) -> bool
6199
6200 Returns ``True`` if the navigation event is originated from the Tab
6201 key.
6202 """
6203 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6204
6205 def SetFromTab(*args, **kwargs):
6206 """
6207 SetFromTab(self, bool bIs)
6208
6209 Set to true under MSW if the event was generated using the tab key.
6210 This is required for proper navogation over radio buttons.
6211 """
6212 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6213
6214 def SetFlags(*args, **kwargs):
6215 """
6216 SetFlags(self, long flags)
6217
6218 Set the navigation flags to a combination of the following:
6219
6220 * wx.NavigationKeyEvent.IsBackward
6221 * wx.NavigationKeyEvent.IsForward
6222 * wx.NavigationKeyEvent.WinChange
6223 * wx.NavigationKeyEvent.FromTab
6224
6225 """
6226 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6227
6228 def GetCurrentFocus(*args, **kwargs):
6229 """
6230 GetCurrentFocus(self) -> Window
6231
6232 Returns the child window which currenty has the focus. May be
6233 ``None``.
6234 """
6235 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6236
6237 def SetCurrentFocus(*args, **kwargs):
6238 """
6239 SetCurrentFocus(self, Window win)
6240
6241 Set the window that has the focus.
6242 """
6243 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6244
6245 IsBackward = _core_.NavigationKeyEvent_IsBackward
6246 IsForward = _core_.NavigationKeyEvent_IsForward
6247 WinChange = _core_.NavigationKeyEvent_WinChange
6248 FromTab = _core_.NavigationKeyEvent_FromTab
6249 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6250 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6251 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6252
6253 #---------------------------------------------------------------------------
6254
6255 class WindowCreateEvent(CommandEvent):
6256 """
6257 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6258 underlying GUI object) exists.
6259 """
6260 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6261 __repr__ = _swig_repr
6262 def __init__(self, *args, **kwargs):
6263 """
6264 __init__(self, Window win=None) -> WindowCreateEvent
6265
6266 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6267 underlying GUI object) exists.
6268 """
6269 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6270 def GetWindow(*args, **kwargs):
6271 """
6272 GetWindow(self) -> Window
6273
6274 Returns the window that this event refers to.
6275 """
6276 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6277
6278 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6279
6280 class WindowDestroyEvent(CommandEvent):
6281 """
6282 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6283 when the GUI window is destroyed.
6284
6285 When a class derived from `wx.Window` is destroyed its destructor will
6286 have already run by the time this event is sent. Therefore this event
6287 will not usually be received at all by the window itself. Since it is
6288 received after the destructor has run, an object should not try to
6289 handle its own wx.WindowDestroyEvent, but it can be used to get
6290 notification of the destruction of another window.
6291 """
6292 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6293 __repr__ = _swig_repr
6294 def __init__(self, *args, **kwargs):
6295 """
6296 __init__(self, Window win=None) -> WindowDestroyEvent
6297
6298 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6299 when the GUI window is destroyed.
6300
6301 When a class derived from `wx.Window` is destroyed its destructor will
6302 have already run by the time this event is sent. Therefore this event
6303 will not usually be received at all by the window itself. Since it is
6304 received after the destructor has run, an object should not try to
6305 handle its own wx.WindowDestroyEvent, but it can be used to get
6306 notification of the destruction of another window.
6307 """
6308 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6309 def GetWindow(*args, **kwargs):
6310 """
6311 GetWindow(self) -> Window
6312
6313 Returns the window that this event refers to.
6314 """
6315 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6316
6317 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6318
6319 #---------------------------------------------------------------------------
6320
6321 class ContextMenuEvent(CommandEvent):
6322 """
6323 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6324 give the application a chance to show a context (popup) menu.
6325 """
6326 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6327 __repr__ = _swig_repr
6328 def __init__(self, *args, **kwargs):
6329 """
6330 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6331
6332 Constructor.
6333 """
6334 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6335 def GetPosition(*args, **kwargs):
6336 """
6337 GetPosition(self) -> Point
6338
6339 Returns the position (in screen coordinants) at which the menu should
6340 be shown.
6341 """
6342 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6343
6344 def SetPosition(*args, **kwargs):
6345 """
6346 SetPosition(self, Point pos)
6347
6348 Sets the position at which the menu should be shown.
6349 """
6350 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6351
6352 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6353 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6354
6355 #---------------------------------------------------------------------------
6356
6357 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6358 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6359 class IdleEvent(Event):
6360 """
6361 This class is used for EVT_IDLE events, which are generated and sent
6362 when the application *becomes* idle. In other words, the when the
6363 event queue becomes empty then idle events are sent to all windows (by
6364 default) and as long as none of them call `RequestMore` then there are
6365 no more idle events until after the system event queue has some normal
6366 events and then becomes empty again.
6367
6368 By default, idle events are sent to all windows. If this is causing a
6369 significant overhead in your application, you can call
6370 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6371 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6372 which should receive idle events. Then idle events will only be sent
6373 to those windows and not to any others.
6374 """
6375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6376 __repr__ = _swig_repr
6377 def __init__(self, *args, **kwargs):
6378 """
6379 __init__(self) -> IdleEvent
6380
6381 Constructor
6382 """
6383 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6384 def RequestMore(*args, **kwargs):
6385 """
6386 RequestMore(self, bool needMore=True)
6387
6388 Tells wxWidgets that more processing is required. This function can be
6389 called by an EVT_IDLE handler for a window to indicate that the
6390 application should forward the EVT_IDLE event once more to the
6391 application windows. If no window calls this function during its
6392 EVT_IDLE handler, then the application will remain in a passive event
6393 loop until a new event is posted to the application by the windowing
6394 system.
6395 """
6396 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6397
6398 def MoreRequested(*args, **kwargs):
6399 """
6400 MoreRequested(self) -> bool
6401
6402 Returns ``True`` if the OnIdle function processing this event
6403 requested more processing time.
6404 """
6405 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6406
6407 def SetMode(*args, **kwargs):
6408 """
6409 SetMode(int mode)
6410
6411 Static method for specifying how wxWidgets will send idle events: to
6412 all windows, or only to those which specify that they will process the
6413 events.
6414
6415 The mode can be one of the following values:
6416
6417 ========================= ========================================
6418 wx.IDLE_PROCESS_ALL Send idle events to all windows
6419 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6420 the wx.WS_EX_PROCESS_IDLE extra style
6421 flag set.
6422 ========================= ========================================
6423
6424 """
6425 return _core_.IdleEvent_SetMode(*args, **kwargs)
6426
6427 SetMode = staticmethod(SetMode)
6428 def GetMode(*args, **kwargs):
6429 """
6430 GetMode() -> int
6431
6432 Static method returning a value specifying how wxWidgets will send
6433 idle events: to all windows, or only to those which specify that they
6434 will process the events.
6435 """
6436 return _core_.IdleEvent_GetMode(*args, **kwargs)
6437
6438 GetMode = staticmethod(GetMode)
6439 def CanSend(*args, **kwargs):
6440 """
6441 CanSend(Window win) -> bool
6442
6443 Returns ``True`` if it is appropriate to send idle events to this
6444 window.
6445
6446 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6447 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6448 events should be sent to this window now. By default this will always
6449 return ``True`` because the update mode is initially
6450 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6451 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6452 """
6453 return _core_.IdleEvent_CanSend(*args, **kwargs)
6454
6455 CanSend = staticmethod(CanSend)
6456 _core_.IdleEvent_swigregister(IdleEvent)
6457
6458 def IdleEvent_SetMode(*args, **kwargs):
6459 """
6460 IdleEvent_SetMode(int mode)
6461
6462 Static method for specifying how wxWidgets will send idle events: to
6463 all windows, or only to those which specify that they will process the
6464 events.
6465
6466 The mode can be one of the following values:
6467
6468 ========================= ========================================
6469 wx.IDLE_PROCESS_ALL Send idle events to all windows
6470 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6471 the wx.WS_EX_PROCESS_IDLE extra style
6472 flag set.
6473 ========================= ========================================
6474
6475 """
6476 return _core_.IdleEvent_SetMode(*args, **kwargs)
6477
6478 def IdleEvent_GetMode(*args):
6479 """
6480 IdleEvent_GetMode() -> int
6481
6482 Static method returning a value specifying how wxWidgets will send
6483 idle events: to all windows, or only to those which specify that they
6484 will process the events.
6485 """
6486 return _core_.IdleEvent_GetMode(*args)
6487
6488 def IdleEvent_CanSend(*args, **kwargs):
6489 """
6490 IdleEvent_CanSend(Window win) -> bool
6491
6492 Returns ``True`` if it is appropriate to send idle events to this
6493 window.
6494
6495 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6496 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6497 events should be sent to this window now. By default this will always
6498 return ``True`` because the update mode is initially
6499 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6500 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6501 """
6502 return _core_.IdleEvent_CanSend(*args, **kwargs)
6503
6504 #---------------------------------------------------------------------------
6505
6506 class ClipboardTextEvent(CommandEvent):
6507 """
6508 A Clipboard Text event is sent when a window intercepts a text
6509 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6510 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6511 popup menu command, etc. NOTE : under windows these events are *NOT*
6512 generated automatically for a Rich Edit text control.
6513 """
6514 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6515 __repr__ = _swig_repr
6516 def __init__(self, *args, **kwargs):
6517 """
6518 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6519
6520 A Clipboard Text event is sent when a window intercepts a text
6521 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6522 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6523 popup menu command, etc. NOTE : under windows these events are *NOT*
6524 generated automatically for a Rich Edit text control.
6525 """
6526 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6527 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6528
6529 #---------------------------------------------------------------------------
6530
6531 class PyEvent(Event):
6532 """
6533 wx.PyEvent can be used as a base class for implementing custom event
6534 types in Python. You should derived from this class instead of
6535 `wx.Event` because this class is Python-aware and is able to transport
6536 its Python bits safely through the wxWidgets event system and have
6537 them still be there when the event handler is invoked.
6538
6539 :see: `wx.PyCommandEvent`
6540
6541 """
6542 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6543 __repr__ = _swig_repr
6544 def __init__(self, *args, **kwargs):
6545 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6546 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6547 self._SetSelf(self)
6548
6549 __swig_destroy__ = _core_.delete_PyEvent
6550 __del__ = lambda self : None;
6551 def _SetSelf(*args, **kwargs):
6552 """_SetSelf(self, PyObject self)"""
6553 return _core_.PyEvent__SetSelf(*args, **kwargs)
6554
6555 def _GetSelf(*args, **kwargs):
6556 """_GetSelf(self) -> PyObject"""
6557 return _core_.PyEvent__GetSelf(*args, **kwargs)
6558
6559 _core_.PyEvent_swigregister(PyEvent)
6560
6561 class PyCommandEvent(CommandEvent):
6562 """
6563 wx.PyCommandEvent can be used as a base class for implementing custom
6564 event types in Python, where the event shoudl travel up to parent
6565 windows looking for a handler. You should derived from this class
6566 instead of `wx.CommandEvent` because this class is Python-aware and is
6567 able to transport its Python bits safely through the wxWidgets event
6568 system and have them still be there when the event handler is invoked.
6569
6570 :see: `wx.PyEvent`
6571
6572 """
6573 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6574 __repr__ = _swig_repr
6575 def __init__(self, *args, **kwargs):
6576 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6577 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6578 self._SetSelf(self)
6579
6580 __swig_destroy__ = _core_.delete_PyCommandEvent
6581 __del__ = lambda self : None;
6582 def _SetSelf(*args, **kwargs):
6583 """_SetSelf(self, PyObject self)"""
6584 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6585
6586 def _GetSelf(*args, **kwargs):
6587 """_GetSelf(self) -> PyObject"""
6588 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6589
6590 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6591
6592 class DateEvent(CommandEvent):
6593 """
6594 This event class holds information about a date change event and is
6595 used together with `wx.DatePickerCtrl`. It also serves as a base class
6596 for `wx.calendar.CalendarEvent`. Bind these event types with
6597 EVT_DATE_CHANGED.
6598 """
6599 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6600 __repr__ = _swig_repr
6601 def __init__(self, *args, **kwargs):
6602 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6603 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6604 def GetDate(*args, **kwargs):
6605 """
6606 GetDate(self) -> DateTime
6607
6608 Returns the date.
6609 """
6610 return _core_.DateEvent_GetDate(*args, **kwargs)
6611
6612 def SetDate(*args, **kwargs):
6613 """
6614 SetDate(self, DateTime date)
6615
6616 Sets the date carried by the event, normally only used by the library
6617 internally.
6618 """
6619 return _core_.DateEvent_SetDate(*args, **kwargs)
6620
6621 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6622 _core_.DateEvent_swigregister(DateEvent)
6623
6624 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6625 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6626
6627 #---------------------------------------------------------------------------
6628
6629 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6630 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6631 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6632 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6633 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6634 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6635 class PyApp(EvtHandler):
6636 """
6637 The ``wx.PyApp`` class is an *implementation detail*, please use the
6638 `wx.App` class (or some other derived class) instead.
6639 """
6640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6641 __repr__ = _swig_repr
6642 def __init__(self, *args, **kwargs):
6643 """
6644 __init__(self) -> PyApp
6645
6646 Create a new application object, starting the bootstrap process.
6647 """
6648 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6649 self._setCallbackInfo(self, PyApp, False)
6650 self._setOORInfo(self, False)
6651
6652 __swig_destroy__ = _core_.delete_PyApp
6653 __del__ = lambda self : None;
6654 def _setCallbackInfo(*args, **kwargs):
6655 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6656 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6657
6658 def GetAppName(*args, **kwargs):
6659 """
6660 GetAppName(self) -> String
6661
6662 Get the application name.
6663 """
6664 return _core_.PyApp_GetAppName(*args, **kwargs)
6665
6666 def SetAppName(*args, **kwargs):
6667 """
6668 SetAppName(self, String name)
6669
6670 Set the application name. This value may be used automatically by
6671 `wx.Config` and such.
6672 """
6673 return _core_.PyApp_SetAppName(*args, **kwargs)
6674
6675 def GetClassName(*args, **kwargs):
6676 """
6677 GetClassName(self) -> String
6678
6679 Get the application's class name.
6680 """
6681 return _core_.PyApp_GetClassName(*args, **kwargs)
6682
6683 def SetClassName(*args, **kwargs):
6684 """
6685 SetClassName(self, String name)
6686
6687 Set the application's class name. This value may be used for
6688 X-resources if applicable for the platform
6689 """
6690 return _core_.PyApp_SetClassName(*args, **kwargs)
6691
6692 def GetVendorName(*args, **kwargs):
6693 """
6694 GetVendorName(self) -> String
6695
6696 Get the application's vendor name.
6697 """
6698 return _core_.PyApp_GetVendorName(*args, **kwargs)
6699
6700 def SetVendorName(*args, **kwargs):
6701 """
6702 SetVendorName(self, String name)
6703
6704 Set the application's vendor name. This value may be used
6705 automatically by `wx.Config` and such.
6706 """
6707 return _core_.PyApp_SetVendorName(*args, **kwargs)
6708
6709 def GetTraits(*args, **kwargs):
6710 """
6711 GetTraits(self) -> wxAppTraits
6712
6713 Return (and create if necessary) the app traits object to which we
6714 delegate for everything which either should be configurable by the
6715 user (then he can change the default behaviour simply by overriding
6716 CreateTraits() and returning his own traits object) or which is
6717 GUI/console dependent as then wx.AppTraits allows us to abstract the
6718 differences behind the common facade.
6719
6720 :todo: Add support for overriding CreateAppTraits in wxPython.
6721 """
6722 return _core_.PyApp_GetTraits(*args, **kwargs)
6723
6724 def ProcessPendingEvents(*args, **kwargs):
6725 """
6726 ProcessPendingEvents(self)
6727
6728 Process all events in the Pending Events list -- it is necessary to
6729 call this function to process posted events. This normally happens
6730 during each event loop iteration.
6731 """
6732 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6733
6734 def Yield(*args, **kwargs):
6735 """
6736 Yield(self, bool onlyIfNeeded=False) -> bool
6737
6738 Process all currently pending events right now, instead of waiting
6739 until return to the event loop. It is an error to call ``Yield``
6740 recursively unless the value of ``onlyIfNeeded`` is True.
6741
6742 :warning: This function is dangerous as it can lead to unexpected
6743 reentrancies (i.e. when called from an event handler it may
6744 result in calling the same event handler again), use with
6745 extreme care or, better, don't use at all!
6746
6747 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6748
6749 """
6750 return _core_.PyApp_Yield(*args, **kwargs)
6751
6752 def WakeUpIdle(*args, **kwargs):
6753 """
6754 WakeUpIdle(self)
6755
6756 Make sure that idle events are sent again.
6757 :see: `wx.WakeUpIdle`
6758 """
6759 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6760
6761 def IsMainLoopRunning(*args, **kwargs):
6762 """
6763 IsMainLoopRunning() -> bool
6764
6765 Returns True if we're running the main loop, i.e. if the events can
6766 currently be dispatched.
6767 """
6768 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6769
6770 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6771 def MainLoop(*args, **kwargs):
6772 """
6773 MainLoop(self) -> int
6774
6775 Execute the main GUI loop, the function doesn't normally return until
6776 all top level windows have been closed and destroyed.
6777 """
6778 return _core_.PyApp_MainLoop(*args, **kwargs)
6779
6780 def Exit(*args, **kwargs):
6781 """
6782 Exit(self)
6783
6784 Exit the main loop thus terminating the application.
6785 :see: `wx.Exit`
6786 """
6787 return _core_.PyApp_Exit(*args, **kwargs)
6788
6789 def GetLayoutDirection(*args, **kwargs):
6790 """
6791 GetLayoutDirection(self) -> wxLayoutDirection
6792
6793 Return the layout direction for the current locale.
6794 """
6795 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6796
6797 def ExitMainLoop(*args, **kwargs):
6798 """
6799 ExitMainLoop(self)
6800
6801 Exit the main GUI loop during the next iteration of the main
6802 loop, (i.e. it does not stop the program immediately!)
6803 """
6804 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6805
6806 def Pending(*args, **kwargs):
6807 """
6808 Pending(self) -> bool
6809
6810 Returns True if there are unprocessed events in the event queue.
6811 """
6812 return _core_.PyApp_Pending(*args, **kwargs)
6813
6814 def Dispatch(*args, **kwargs):
6815 """
6816 Dispatch(self) -> bool
6817
6818 Process the first event in the event queue (blocks until an event
6819 appears if there are none currently)
6820 """
6821 return _core_.PyApp_Dispatch(*args, **kwargs)
6822
6823 def ProcessIdle(*args, **kwargs):
6824 """
6825 ProcessIdle(self) -> bool
6826
6827 Called from the MainLoop when the application becomes idle (there are
6828 no pending events) and sends a `wx.IdleEvent` to all interested
6829 parties. Returns True if more idle events are needed, False if not.
6830 """
6831 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6832
6833 def SendIdleEvents(*args, **kwargs):
6834 """
6835 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6836
6837 Send idle event to window and all subwindows. Returns True if more
6838 idle time is requested.
6839 """
6840 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6841
6842 def IsActive(*args, **kwargs):
6843 """
6844 IsActive(self) -> bool
6845
6846 Return True if our app has focus.
6847 """
6848 return _core_.PyApp_IsActive(*args, **kwargs)
6849
6850 def SetTopWindow(*args, **kwargs):
6851 """
6852 SetTopWindow(self, Window win)
6853
6854 Set the *main* top level window
6855 """
6856 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6857
6858 def GetTopWindow(*args, **kwargs):
6859 """
6860 GetTopWindow(self) -> Window
6861
6862 Return the *main* top level window (if it hadn't been set previously
6863 with SetTopWindow(), will return just some top level window and, if
6864 there not any, will return None)
6865 """
6866 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6867
6868 def SetExitOnFrameDelete(*args, **kwargs):
6869 """
6870 SetExitOnFrameDelete(self, bool flag)
6871
6872 Control the exit behaviour: by default, the program will exit the main
6873 loop (and so, usually, terminate) when the last top-level program
6874 window is deleted. Beware that if you disable this behaviour (with
6875 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6876 explicitly from somewhere.
6877 """
6878 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6879
6880 def GetExitOnFrameDelete(*args, **kwargs):
6881 """
6882 GetExitOnFrameDelete(self) -> bool
6883
6884 Get the current exit behaviour setting.
6885 """
6886 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6887
6888 def SetUseBestVisual(*args, **kwargs):
6889 """
6890 SetUseBestVisual(self, bool flag)
6891
6892 Set whether the app should try to use the best available visual on
6893 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6894 """
6895 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6896
6897 def GetUseBestVisual(*args, **kwargs):
6898 """
6899 GetUseBestVisual(self) -> bool
6900
6901 Get current UseBestVisual setting.
6902 """
6903 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6904
6905 def SetPrintMode(*args, **kwargs):
6906 """SetPrintMode(self, int mode)"""
6907 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6908
6909 def GetPrintMode(*args, **kwargs):
6910 """GetPrintMode(self) -> int"""
6911 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6912
6913 def SetAssertMode(*args, **kwargs):
6914 """
6915 SetAssertMode(self, int mode)
6916
6917 Set the OnAssert behaviour for debug and hybrid builds.
6918 """
6919 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6920
6921 def GetAssertMode(*args, **kwargs):
6922 """
6923 GetAssertMode(self) -> int
6924
6925 Get the current OnAssert behaviour setting.
6926 """
6927 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6928
6929 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6930 """GetMacSupportPCMenuShortcuts() -> bool"""
6931 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6932
6933 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6934 def GetMacAboutMenuItemId(*args, **kwargs):
6935 """GetMacAboutMenuItemId() -> long"""
6936 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6937
6938 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6939 def GetMacPreferencesMenuItemId(*args, **kwargs):
6940 """GetMacPreferencesMenuItemId() -> long"""
6941 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6942
6943 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6944 def GetMacExitMenuItemId(*args, **kwargs):
6945 """GetMacExitMenuItemId() -> long"""
6946 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6947
6948 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6949 def GetMacHelpMenuTitleName(*args, **kwargs):
6950 """GetMacHelpMenuTitleName() -> String"""
6951 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6952
6953 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6954 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6955 """SetMacSupportPCMenuShortcuts(bool val)"""
6956 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6957
6958 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6959 def SetMacAboutMenuItemId(*args, **kwargs):
6960 """SetMacAboutMenuItemId(long val)"""
6961 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6962
6963 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6964 def SetMacPreferencesMenuItemId(*args, **kwargs):
6965 """SetMacPreferencesMenuItemId(long val)"""
6966 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6967
6968 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6969 def SetMacExitMenuItemId(*args, **kwargs):
6970 """SetMacExitMenuItemId(long val)"""
6971 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6972
6973 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6974 def SetMacHelpMenuTitleName(*args, **kwargs):
6975 """SetMacHelpMenuTitleName(String val)"""
6976 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6977
6978 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6979 def _BootstrapApp(*args, **kwargs):
6980 """
6981 _BootstrapApp(self)
6982
6983 For internal use only
6984 """
6985 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6986
6987 def GetComCtl32Version(*args, **kwargs):
6988 """
6989 GetComCtl32Version() -> int
6990
6991 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6992 it wasn't found at all. Raises an exception on non-Windows platforms.
6993 """
6994 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6995
6996 GetComCtl32Version = staticmethod(GetComCtl32Version)
6997 def IsDisplayAvailable(*args, **kwargs):
6998 """
6999 IsDisplayAvailable() -> bool
7000
7001 Tests if it is possible to create a GUI in the current environment.
7002 This will mean different things on the different platforms.
7003
7004 * On X Windows systems this function will return ``False`` if it is
7005 not able to open a connection to the X display, which can happen
7006 if $DISPLAY is not set, or is not set correctly.
7007
7008 * On Mac OS X a ``False`` return value will mean that wx is not
7009 able to access the window manager, which can happen if logged in
7010 remotely or if running from the normal version of python instead
7011 of the framework version, (i.e., pythonw.)
7012
7013 * On MS Windows...
7014
7015 """
7016 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7017
7018 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7019 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7020 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7021 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7022 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7023 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7024 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7025 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7026 Traits = property(GetTraits,doc="See `GetTraits`")
7027 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7028 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7029 Active = property(IsActive)
7030 _core_.PyApp_swigregister(PyApp)
7031
7032 def PyApp_IsMainLoopRunning(*args):
7033 """
7034 PyApp_IsMainLoopRunning() -> bool
7035
7036 Returns True if we're running the main loop, i.e. if the events can
7037 currently be dispatched.
7038 """
7039 return _core_.PyApp_IsMainLoopRunning(*args)
7040
7041 def PyApp_GetMacSupportPCMenuShortcuts(*args):
7042 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7043 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
7044
7045 def PyApp_GetMacAboutMenuItemId(*args):
7046 """PyApp_GetMacAboutMenuItemId() -> long"""
7047 return _core_.PyApp_GetMacAboutMenuItemId(*args)
7048
7049 def PyApp_GetMacPreferencesMenuItemId(*args):
7050 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7051 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7052
7053 def PyApp_GetMacExitMenuItemId(*args):
7054 """PyApp_GetMacExitMenuItemId() -> long"""
7055 return _core_.PyApp_GetMacExitMenuItemId(*args)
7056
7057 def PyApp_GetMacHelpMenuTitleName(*args):
7058 """PyApp_GetMacHelpMenuTitleName() -> String"""
7059 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7060
7061 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7062 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7063 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7064
7065 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7066 """PyApp_SetMacAboutMenuItemId(long val)"""
7067 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7068
7069 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7070 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7071 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7072
7073 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7074 """PyApp_SetMacExitMenuItemId(long val)"""
7075 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7076
7077 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7078 """PyApp_SetMacHelpMenuTitleName(String val)"""
7079 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7080
7081 def PyApp_GetComCtl32Version(*args):
7082 """
7083 PyApp_GetComCtl32Version() -> int
7084
7085 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7086 it wasn't found at all. Raises an exception on non-Windows platforms.
7087 """
7088 return _core_.PyApp_GetComCtl32Version(*args)
7089
7090 def PyApp_IsDisplayAvailable(*args):
7091 """
7092 PyApp_IsDisplayAvailable() -> bool
7093
7094 Tests if it is possible to create a GUI in the current environment.
7095 This will mean different things on the different platforms.
7096
7097 * On X Windows systems this function will return ``False`` if it is
7098 not able to open a connection to the X display, which can happen
7099 if $DISPLAY is not set, or is not set correctly.
7100
7101 * On Mac OS X a ``False`` return value will mean that wx is not
7102 able to access the window manager, which can happen if logged in
7103 remotely or if running from the normal version of python instead
7104 of the framework version, (i.e., pythonw.)
7105
7106 * On MS Windows...
7107
7108 """
7109 return _core_.PyApp_IsDisplayAvailable(*args)
7110
7111 #---------------------------------------------------------------------------
7112
7113
7114 def Exit(*args):
7115 """
7116 Exit()
7117
7118 Force an exit of the application. Convenience for wx.GetApp().Exit()
7119 """
7120 return _core_.Exit(*args)
7121
7122 def Yield(*args):
7123 """
7124 Yield() -> bool
7125
7126 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7127 """
7128 return _core_.Yield(*args)
7129
7130 def YieldIfNeeded(*args):
7131 """
7132 YieldIfNeeded() -> bool
7133
7134 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7135 """
7136 return _core_.YieldIfNeeded(*args)
7137
7138 def SafeYield(*args, **kwargs):
7139 """
7140 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7141
7142 This function is similar to `wx.Yield`, except that it disables the
7143 user input to all program windows before calling `wx.Yield` and
7144 re-enables it again afterwards. If ``win`` is not None, this window
7145 will remain enabled, allowing the implementation of some limited user
7146 interaction.
7147
7148 :Returns: the result of the call to `wx.Yield`.
7149 """
7150 return _core_.SafeYield(*args, **kwargs)
7151
7152 def WakeUpIdle(*args):
7153 """
7154 WakeUpIdle()
7155
7156 Cause the message queue to become empty again, so idle events will be
7157 sent.
7158 """
7159 return _core_.WakeUpIdle(*args)
7160
7161 def PostEvent(*args, **kwargs):
7162 """
7163 PostEvent(EvtHandler dest, Event event)
7164
7165 Send an event to a window or other wx.EvtHandler to be processed
7166 later.
7167 """
7168 return _core_.PostEvent(*args, **kwargs)
7169
7170 def App_CleanUp(*args):
7171 """
7172 App_CleanUp()
7173
7174 For internal use only, it is used to cleanup after wxWidgets when
7175 Python shuts down.
7176 """
7177 return _core_.App_CleanUp(*args)
7178
7179 def GetApp(*args):
7180 """
7181 GetApp() -> PyApp
7182
7183 Return a reference to the current wx.App object.
7184 """
7185 return _core_.GetApp(*args)
7186
7187 def SetDefaultPyEncoding(*args, **kwargs):
7188 """
7189 SetDefaultPyEncoding(string encoding)
7190
7191 Sets the encoding that wxPython will use when it needs to convert a
7192 Python string or unicode object to or from a wxString.
7193
7194 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7195 but please be aware that the default encoding within the same locale
7196 may be slightly different on different platforms. For example, please
7197 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7198 between the common latin/roman encodings.
7199 """
7200 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7201
7202 def GetDefaultPyEncoding(*args):
7203 """
7204 GetDefaultPyEncoding() -> string
7205
7206 Gets the current encoding that wxPython will use when it needs to
7207 convert a Python string or unicode object to or from a wxString.
7208 """
7209 return _core_.GetDefaultPyEncoding(*args)
7210 #----------------------------------------------------------------------
7211
7212 class PyOnDemandOutputWindow:
7213 """
7214 A class that can be used for redirecting Python's stdout and
7215 stderr streams. It will do nothing until something is wrriten to
7216 the stream at which point it will create a Frame with a text area
7217 and write the text there.
7218 """
7219 def __init__(self, title = "wxPython: stdout/stderr"):
7220 self.frame = None
7221 self.title = title
7222 self.pos = wx.DefaultPosition
7223 self.size = (450, 300)
7224 self.parent = None
7225
7226 def SetParent(self, parent):
7227 """Set the window to be used as the popup Frame's parent."""
7228 self.parent = parent
7229
7230
7231 def CreateOutputWindow(self, st):
7232 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7233 style=wx.DEFAULT_FRAME_STYLE)
7234 self.text = wx.TextCtrl(self.frame, -1, "",
7235 style=wx.TE_MULTILINE|wx.TE_READONLY)
7236 self.text.AppendText(st)
7237 self.frame.Show(True)
7238 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7239
7240
7241 def OnCloseWindow(self, event):
7242 if self.frame is not None:
7243 self.frame.Destroy()
7244 self.frame = None
7245 self.text = None
7246
7247
7248 # These methods provide the file-like output behaviour.
7249 def write(self, text):
7250 """
7251 Create the output window if needed and write the string to it.
7252 If not called in the context of the gui thread then uses
7253 CallAfter to do the work there.
7254 """
7255 if self.frame is None:
7256 if not wx.Thread_IsMain():
7257 wx.CallAfter(self.CreateOutputWindow, text)
7258 else:
7259 self.CreateOutputWindow(text)
7260 else:
7261 if not wx.Thread_IsMain():
7262 wx.CallAfter(self.text.AppendText, text)
7263 else:
7264 self.text.AppendText(text)
7265
7266
7267 def close(self):
7268 if self.frame is not None:
7269 wx.CallAfter(self.frame.Close)
7270
7271
7272 def flush(self):
7273 pass
7274
7275
7276
7277 #----------------------------------------------------------------------
7278
7279 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7280
7281 class App(wx.PyApp):
7282 """
7283 The ``wx.App`` class represents the application and is used to:
7284
7285 * bootstrap the wxPython system and initialize the underlying
7286 gui toolkit
7287 * set and get application-wide properties
7288 * implement the windowing system main message or event loop,
7289 and to dispatch events to window instances
7290 * etc.
7291
7292 Every application must have a ``wx.App`` instance, and all
7293 creation of UI objects should be delayed until after the
7294 ``wx.App`` object has been created in order to ensure that the gui
7295 platform and wxWidgets have been fully initialized.
7296
7297 Normally you would derive from this class and implement an
7298 ``OnInit`` method that creates a frame and then calls
7299 ``self.SetTopWindow(frame)``.
7300
7301 :see: `wx.PySimpleApp` for a simpler app class that can be used
7302 directly.
7303 """
7304
7305 outputWindowClass = PyOnDemandOutputWindow
7306
7307 def __init__(self, redirect=_defRedirect, filename=None,
7308 useBestVisual=False, clearSigInt=True):
7309 """
7310 Construct a ``wx.App`` object.
7311
7312 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7313 redirected? Defaults to True on Windows and Mac, False
7314 otherwise. If `filename` is None then output will be
7315 redirected to a window that pops up as needed. (You can
7316 control what kind of window is created for the output by
7317 resetting the class variable ``outputWindowClass`` to a
7318 class of your choosing.)
7319
7320 :param filename: The name of a file to redirect output to, if
7321 redirect is True.
7322
7323 :param useBestVisual: Should the app try to use the best
7324 available visual provided by the system (only relevant on
7325 systems that have more than one visual.) This parameter
7326 must be used instead of calling `SetUseBestVisual` later
7327 on because it must be set before the underlying GUI
7328 toolkit is initialized.
7329
7330 :param clearSigInt: Should SIGINT be cleared? This allows the
7331 app to terminate upon a Ctrl-C in the console like other
7332 GUI apps will.
7333
7334 :note: You should override OnInit to do applicaition
7335 initialization to ensure that the system, toolkit and
7336 wxWidgets are fully initialized.
7337 """
7338
7339 wx.PyApp.__init__(self)
7340
7341 # make sure we can create a GUI
7342 if not self.IsDisplayAvailable():
7343
7344 if wx.Platform == "__WXMAC__":
7345 msg = """This program needs access to the screen.
7346 Please run with 'pythonw', not 'python', and only when you are logged
7347 in on the main display of your Mac."""
7348
7349 elif wx.Platform == "__WXGTK__":
7350 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7351
7352 else:
7353 msg = "Unable to create GUI"
7354 # TODO: more description is needed for wxMSW...
7355
7356 raise SystemExit(msg)
7357
7358 # This has to be done before OnInit
7359 self.SetUseBestVisual(useBestVisual)
7360
7361 # Set the default handler for SIGINT. This fixes a problem
7362 # where if Ctrl-C is pressed in the console that started this
7363 # app then it will not appear to do anything, (not even send
7364 # KeyboardInterrupt???) but will later segfault on exit. By
7365 # setting the default handler then the app will exit, as
7366 # expected (depending on platform.)
7367 if clearSigInt:
7368 try:
7369 import signal
7370 signal.signal(signal.SIGINT, signal.SIG_DFL)
7371 except:
7372 pass
7373
7374 # Save and redirect the stdio to a window?
7375 self.stdioWin = None
7376 self.saveStdio = (_sys.stdout, _sys.stderr)
7377 if redirect:
7378 self.RedirectStdio(filename)
7379
7380 # Use Python's install prefix as the default
7381 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7382
7383 # This finishes the initialization of wxWindows and then calls
7384 # the OnInit that should be present in the derived class
7385 self._BootstrapApp()
7386
7387
7388 def OnPreInit(self):
7389 """
7390 Things that must be done after _BootstrapApp has done its
7391 thing, but would be nice if they were already done by the time
7392 that OnInit is called.
7393 """
7394 wx.StockGDI._initStockObjects()
7395
7396
7397 def __del__(self, destroy=wx.PyApp.__del__):
7398 self.RestoreStdio() # Just in case the MainLoop was overridden
7399 destroy(self)
7400
7401 def Destroy(self):
7402 wx.PyApp.Destroy(self)
7403 self.thisown = 0
7404
7405 def SetTopWindow(self, frame):
7406 """Set the \"main\" top level window"""
7407 if self.stdioWin:
7408 self.stdioWin.SetParent(frame)
7409 wx.PyApp.SetTopWindow(self, frame)
7410
7411
7412 def MainLoop(self):
7413 """Execute the main GUI event loop"""
7414 wx.PyApp.MainLoop(self)
7415 self.RestoreStdio()
7416
7417
7418 def RedirectStdio(self, filename=None):
7419 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7420 if filename:
7421 _sys.stdout = _sys.stderr = open(filename, 'a')
7422 else:
7423 self.stdioWin = self.outputWindowClass()
7424 _sys.stdout = _sys.stderr = self.stdioWin
7425
7426
7427 def RestoreStdio(self):
7428 try:
7429 _sys.stdout, _sys.stderr = self.saveStdio
7430 except:
7431 pass
7432
7433
7434 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7435 """
7436 Set the title, position and/or size of the output window if
7437 the stdio has been redirected. This should be called before
7438 any output would cause the output window to be created.
7439 """
7440 if self.stdioWin:
7441 if title is not None:
7442 self.stdioWin.title = title
7443 if pos is not None:
7444 self.stdioWin.pos = pos
7445 if size is not None:
7446 self.stdioWin.size = size
7447
7448
7449
7450
7451 # change from wx.PyApp_XX to wx.App_XX
7452 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7453 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7454 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7455 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7456 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7457 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7458 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7459 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7460 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7461 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7462 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7463
7464 #----------------------------------------------------------------------------
7465
7466 class PySimpleApp(wx.App):
7467 """
7468 A simple application class. You can just create one of these and
7469 then then make your top level windows later, and not have to worry
7470 about OnInit. For example::
7471
7472 app = wx.PySimpleApp()
7473 frame = wx.Frame(None, title='Hello World')
7474 frame.Show()
7475 app.MainLoop()
7476
7477 :see: `wx.App`
7478 """
7479
7480 def __init__(self, redirect=False, filename=None,
7481 useBestVisual=False, clearSigInt=True):
7482 """
7483 :see: `wx.App.__init__`
7484 """
7485 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7486
7487 def OnInit(self):
7488 return True
7489
7490
7491
7492 # Is anybody using this one?
7493 class PyWidgetTester(wx.App):
7494 def __init__(self, size = (250, 100)):
7495 self.size = size
7496 wx.App.__init__(self, 0)
7497
7498 def OnInit(self):
7499 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7500 self.SetTopWindow(self.frame)
7501 return True
7502
7503 def SetWidget(self, widgetClass, *args, **kwargs):
7504 w = widgetClass(self.frame, *args, **kwargs)
7505 self.frame.Show(True)
7506
7507 #----------------------------------------------------------------------------
7508 # DO NOT hold any other references to this object. This is how we
7509 # know when to cleanup system resources that wxWidgets is holding. When
7510 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7511 # goes to zero and it calls the wx.App_CleanUp function.
7512
7513 class __wxPyCleanup:
7514 def __init__(self):
7515 self.cleanup = _core_.App_CleanUp
7516 def __del__(self):
7517 self.cleanup()
7518
7519 _sys.__wxPythonCleanup = __wxPyCleanup()
7520
7521 ## # another possible solution, but it gets called too early...
7522 ## import atexit
7523 ## atexit.register(_core_.wxApp_CleanUp)
7524
7525
7526 #----------------------------------------------------------------------------
7527
7528 #---------------------------------------------------------------------------
7529
7530 class EventLoop(object):
7531 """Proxy of C++ EventLoop class"""
7532 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7533 __repr__ = _swig_repr
7534 def __init__(self, *args, **kwargs):
7535 """__init__(self) -> EventLoop"""
7536 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7537 __swig_destroy__ = _core_.delete_EventLoop
7538 __del__ = lambda self : None;
7539 def Run(*args, **kwargs):
7540 """Run(self) -> int"""
7541 return _core_.EventLoop_Run(*args, **kwargs)
7542
7543 def Exit(*args, **kwargs):
7544 """Exit(self, int rc=0)"""
7545 return _core_.EventLoop_Exit(*args, **kwargs)
7546
7547 def Pending(*args, **kwargs):
7548 """Pending(self) -> bool"""
7549 return _core_.EventLoop_Pending(*args, **kwargs)
7550
7551 def Dispatch(*args, **kwargs):
7552 """Dispatch(self) -> bool"""
7553 return _core_.EventLoop_Dispatch(*args, **kwargs)
7554
7555 def IsRunning(*args, **kwargs):
7556 """IsRunning(self) -> bool"""
7557 return _core_.EventLoop_IsRunning(*args, **kwargs)
7558
7559 def GetActive(*args, **kwargs):
7560 """GetActive() -> EventLoop"""
7561 return _core_.EventLoop_GetActive(*args, **kwargs)
7562
7563 GetActive = staticmethod(GetActive)
7564 def SetActive(*args, **kwargs):
7565 """SetActive(EventLoop loop)"""
7566 return _core_.EventLoop_SetActive(*args, **kwargs)
7567
7568 SetActive = staticmethod(SetActive)
7569 _core_.EventLoop_swigregister(EventLoop)
7570
7571 def EventLoop_GetActive(*args):
7572 """EventLoop_GetActive() -> EventLoop"""
7573 return _core_.EventLoop_GetActive(*args)
7574
7575 def EventLoop_SetActive(*args, **kwargs):
7576 """EventLoop_SetActive(EventLoop loop)"""
7577 return _core_.EventLoop_SetActive(*args, **kwargs)
7578
7579 class EventLoopActivator(object):
7580 """Proxy of C++ EventLoopActivator class"""
7581 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7582 __repr__ = _swig_repr
7583 def __init__(self, *args, **kwargs):
7584 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7585 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7586 __swig_destroy__ = _core_.delete_EventLoopActivator
7587 __del__ = lambda self : None;
7588 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7589
7590 #---------------------------------------------------------------------------
7591
7592 ACCEL_ALT = _core_.ACCEL_ALT
7593 ACCEL_CTRL = _core_.ACCEL_CTRL
7594 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7595 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7596 ACCEL_CMD = _core_.ACCEL_CMD
7597 class AcceleratorEntry(object):
7598 """
7599 A class used to define items in an `wx.AcceleratorTable`. wxPython
7600 programs can choose to use wx.AcceleratorEntry objects, but using a
7601 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7602 as well. See `__init__` for of the tuple values.
7603
7604 :see: `wx.AcceleratorTable`
7605 """
7606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7607 __repr__ = _swig_repr
7608 def __init__(self, *args, **kwargs):
7609 """
7610 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7611
7612 Construct a wx.AcceleratorEntry.
7613 """
7614 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7615 __swig_destroy__ = _core_.delete_AcceleratorEntry
7616 __del__ = lambda self : None;
7617 def Set(*args, **kwargs):
7618 """
7619 Set(self, int flags, int keyCode, int cmd)
7620
7621 (Re)set the attributes of a wx.AcceleratorEntry.
7622 :see `__init__`
7623 """
7624 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7625
7626 def Create(*args, **kwargs):
7627 """
7628 Create(String str) -> AcceleratorEntry
7629
7630 Create accelerator corresponding to the specified string, or None if
7631 it coulnd't be parsed.
7632 """
7633 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7634
7635 Create = staticmethod(Create)
7636 def GetFlags(*args, **kwargs):
7637 """
7638 GetFlags(self) -> int
7639
7640 Get the AcceleratorEntry's flags.
7641 """
7642 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7643
7644 def GetKeyCode(*args, **kwargs):
7645 """
7646 GetKeyCode(self) -> int
7647
7648 Get the AcceleratorEntry's keycode.
7649 """
7650 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7651
7652 def GetCommand(*args, **kwargs):
7653 """
7654 GetCommand(self) -> int
7655
7656 Get the AcceleratorEntry's command ID.
7657 """
7658 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7659
7660 def IsOk(*args, **kwargs):
7661 """IsOk(self) -> bool"""
7662 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7663
7664 def ToString(*args, **kwargs):
7665 """
7666 ToString(self) -> String
7667
7668 Returns a string representation for the this accelerator. The string
7669 is formatted using the <flags>-<keycode> format where <flags> maybe a
7670 hyphen-separed list of "shift|alt|ctrl"
7671
7672 """
7673 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7674
7675 def FromString(*args, **kwargs):
7676 """
7677 FromString(self, String str) -> bool
7678
7679 Returns true if the given string correctly initialized this object.
7680 """
7681 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7682
7683 Command = property(GetCommand,doc="See `GetCommand`")
7684 Flags = property(GetFlags,doc="See `GetFlags`")
7685 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7686 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7687
7688 def AcceleratorEntry_Create(*args, **kwargs):
7689 """
7690 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7691
7692 Create accelerator corresponding to the specified string, or None if
7693 it coulnd't be parsed.
7694 """
7695 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7696
7697 class AcceleratorTable(Object):
7698 """
7699 An accelerator table allows the application to specify a table of
7700 keyboard shortcuts for menus or other commands. On Windows, menu or
7701 button commands are supported; on GTK, only menu commands are
7702 supported.
7703 """
7704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7705 __repr__ = _swig_repr
7706 def __init__(self, *args, **kwargs):
7707 """
7708 __init__(entries) -> AcceleratorTable
7709
7710 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7711 items or or of 3-tuples (flags, keyCode, cmdID)
7712
7713 :see: `wx.AcceleratorEntry`
7714 """
7715 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7716 __swig_destroy__ = _core_.delete_AcceleratorTable
7717 __del__ = lambda self : None;
7718 def Ok(*args, **kwargs):
7719 """Ok(self) -> bool"""
7720 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7721
7722 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7723
7724
7725 def GetAccelFromString(*args, **kwargs):
7726 """GetAccelFromString(String label) -> AcceleratorEntry"""
7727 return _core_.GetAccelFromString(*args, **kwargs)
7728 #---------------------------------------------------------------------------
7729
7730 class VisualAttributes(object):
7731 """struct containing all the visual attributes of a control"""
7732 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7733 __repr__ = _swig_repr
7734 def __init__(self, *args, **kwargs):
7735 """
7736 __init__(self) -> VisualAttributes
7737
7738 struct containing all the visual attributes of a control
7739 """
7740 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7741 __swig_destroy__ = _core_.delete_VisualAttributes
7742 __del__ = lambda self : None;
7743 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7744 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7745 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7746 _core_.VisualAttributes_swigregister(VisualAttributes)
7747 NullAcceleratorTable = cvar.NullAcceleratorTable
7748 PanelNameStr = cvar.PanelNameStr
7749
7750 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7751 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7752 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7753 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7754 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7755 class Window(EvtHandler):
7756 """
7757 wx.Window is the base class for all windows and represents any visible
7758 object on the screen. All controls, top level windows and so on are
7759 wx.Windows. Sizers and device contexts are not however, as they don't
7760 appear on screen themselves.
7761
7762 """
7763 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7764 __repr__ = _swig_repr
7765 def __init__(self, *args, **kwargs):
7766 """
7767 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7768 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7769
7770 Construct and show a generic Window.
7771 """
7772 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7773 self._setOORInfo(self)
7774
7775 def Create(*args, **kwargs):
7776 """
7777 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7778 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7779
7780 Create the GUI part of the Window for 2-phase creation mode.
7781 """
7782 return _core_.Window_Create(*args, **kwargs)
7783
7784 def Close(*args, **kwargs):
7785 """
7786 Close(self, bool force=False) -> bool
7787
7788 This function simply generates a EVT_CLOSE event whose handler usually
7789 tries to close the window. It doesn't close the window itself,
7790 however. If force is False (the default) then the window's close
7791 handler will be allowed to veto the destruction of the window.
7792 """
7793 return _core_.Window_Close(*args, **kwargs)
7794
7795 def Destroy(*args, **kwargs):
7796 """
7797 Destroy(self) -> bool
7798
7799 Destroys the window safely. Frames and dialogs are not destroyed
7800 immediately when this function is called -- they are added to a list
7801 of windows to be deleted on idle time, when all the window's events
7802 have been processed. This prevents problems with events being sent to
7803 non-existent windows.
7804
7805 Returns True if the window has either been successfully deleted, or it
7806 has been added to the list of windows pending real deletion.
7807 """
7808 val = _core_.Window_Destroy(*args, **kwargs)
7809 args[0].thisown = 0
7810 return val
7811
7812 def DestroyChildren(*args, **kwargs):
7813 """
7814 DestroyChildren(self) -> bool
7815
7816 Destroys all children of a window. Called automatically by the
7817 destructor.
7818 """
7819 return _core_.Window_DestroyChildren(*args, **kwargs)
7820
7821 def IsBeingDeleted(*args, **kwargs):
7822 """
7823 IsBeingDeleted(self) -> bool
7824
7825 Is the window in the process of being deleted?
7826 """
7827 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7828
7829 def SetLabel(*args, **kwargs):
7830 """
7831 SetLabel(self, String label)
7832
7833 Set the text which the window shows in its label if applicable.
7834 """
7835 return _core_.Window_SetLabel(*args, **kwargs)
7836
7837 def GetLabel(*args, **kwargs):
7838 """
7839 GetLabel(self) -> String
7840
7841 Generic way of getting a label from any window, for identification
7842 purposes. The interpretation of this function differs from class to
7843 class. For frames and dialogs, the value returned is the title. For
7844 buttons or static text controls, it is the button text. This function
7845 can be useful for meta-programs such as testing tools or special-needs
7846 access programs)which need to identify windows by name.
7847 """
7848 return _core_.Window_GetLabel(*args, **kwargs)
7849
7850 def SetName(*args, **kwargs):
7851 """
7852 SetName(self, String name)
7853
7854 Sets the window's name. The window name is used for ressource setting
7855 in X, it is not the same as the window title/label
7856 """
7857 return _core_.Window_SetName(*args, **kwargs)
7858
7859 def GetName(*args, **kwargs):
7860 """
7861 GetName(self) -> String
7862
7863 Returns the windows name. This name is not guaranteed to be unique;
7864 it is up to the programmer to supply an appropriate name in the window
7865 constructor or via wx.Window.SetName.
7866 """
7867 return _core_.Window_GetName(*args, **kwargs)
7868
7869 def SetWindowVariant(*args, **kwargs):
7870 """
7871 SetWindowVariant(self, int variant)
7872
7873 Sets the variant of the window/font size to use for this window, if
7874 the platform supports variants, for example, wxMac.
7875 """
7876 return _core_.Window_SetWindowVariant(*args, **kwargs)
7877
7878 def GetWindowVariant(*args, **kwargs):
7879 """GetWindowVariant(self) -> int"""
7880 return _core_.Window_GetWindowVariant(*args, **kwargs)
7881
7882 def SetId(*args, **kwargs):
7883 """
7884 SetId(self, int winid)
7885
7886 Sets the identifier of the window. Each window has an integer
7887 identifier. If the application has not provided one, an identifier
7888 will be generated. Normally, the identifier should be provided on
7889 creation and should not be modified subsequently.
7890 """
7891 return _core_.Window_SetId(*args, **kwargs)
7892
7893 def GetId(*args, **kwargs):
7894 """
7895 GetId(self) -> int
7896
7897 Returns the identifier of the window. Each window has an integer
7898 identifier. If the application has not provided one (or the default Id
7899 -1 is used) then an unique identifier with a negative value will be
7900 generated.
7901 """
7902 return _core_.Window_GetId(*args, **kwargs)
7903
7904 def NewControlId(*args, **kwargs):
7905 """
7906 NewControlId() -> int
7907
7908 Generate a control id for the controls which were not given one.
7909 """
7910 return _core_.Window_NewControlId(*args, **kwargs)
7911
7912 NewControlId = staticmethod(NewControlId)
7913 def NextControlId(*args, **kwargs):
7914 """
7915 NextControlId(int winid) -> int
7916
7917 Get the id of the control following the one with the given
7918 autogenerated) id
7919 """
7920 return _core_.Window_NextControlId(*args, **kwargs)
7921
7922 NextControlId = staticmethod(NextControlId)
7923 def PrevControlId(*args, **kwargs):
7924 """
7925 PrevControlId(int winid) -> int
7926
7927 Get the id of the control preceding the one with the given
7928 autogenerated) id
7929 """
7930 return _core_.Window_PrevControlId(*args, **kwargs)
7931
7932 PrevControlId = staticmethod(PrevControlId)
7933 def GetLayoutDirection(*args, **kwargs):
7934 """
7935 GetLayoutDirection(self) -> wxLayoutDirection
7936
7937 Get the layout direction (LTR or RTL) for this window. Returns
7938 ``wx.Layout_Default`` if layout direction is not supported.
7939 """
7940 return _core_.Window_GetLayoutDirection(*args, **kwargs)
7941
7942 def SetLayoutDirection(*args, **kwargs):
7943 """
7944 SetLayoutDirection(self, wxLayoutDirection dir)
7945
7946 Set the layout direction (LTR or RTL) for this window.
7947 """
7948 return _core_.Window_SetLayoutDirection(*args, **kwargs)
7949
7950 def AdjustForLayoutDirection(*args, **kwargs):
7951 """
7952 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7953
7954 Mirror coordinates for RTL layout if this window uses it and if the
7955 mirroring is not done automatically like Win32.
7956 """
7957 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
7958
7959 def SetSize(*args, **kwargs):
7960 """
7961 SetSize(self, Size size)
7962
7963 Sets the size of the window in pixels.
7964 """
7965 return _core_.Window_SetSize(*args, **kwargs)
7966
7967 def SetDimensions(*args, **kwargs):
7968 """
7969 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7970
7971 Sets the position and size of the window in pixels. The sizeFlags
7972 parameter indicates the interpretation of the other params if they are
7973 equal to -1.
7974
7975 ======================== ======================================
7976 wx.SIZE_AUTO A -1 indicates that a class-specific
7977 default should be used.
7978 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7979 -1 values are supplied.
7980 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7981 interpreted as real dimensions, not
7982 default values.
7983 ======================== ======================================
7984
7985 """
7986 return _core_.Window_SetDimensions(*args, **kwargs)
7987
7988 def SetRect(*args, **kwargs):
7989 """
7990 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7991
7992 Sets the position and size of the window in pixels using a wx.Rect.
7993 """
7994 return _core_.Window_SetRect(*args, **kwargs)
7995
7996 def SetSizeWH(*args, **kwargs):
7997 """
7998 SetSizeWH(self, int width, int height)
7999
8000 Sets the size of the window in pixels.
8001 """
8002 return _core_.Window_SetSizeWH(*args, **kwargs)
8003
8004 def Move(*args, **kwargs):
8005 """
8006 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8007
8008 Moves the window to the given position.
8009 """
8010 return _core_.Window_Move(*args, **kwargs)
8011
8012 SetPosition = Move
8013 def MoveXY(*args, **kwargs):
8014 """
8015 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8016
8017 Moves the window to the given position.
8018 """
8019 return _core_.Window_MoveXY(*args, **kwargs)
8020
8021 def SetBestFittingSize(*args, **kwargs):
8022 """
8023 SetBestFittingSize(self, Size size=DefaultSize)
8024
8025 A 'Smart' SetSize that will fill in default size components with the
8026 window's *best size* values. Also set's the minsize for use with sizers.
8027 """
8028 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8029
8030 def Raise(*args, **kwargs):
8031 """
8032 Raise(self)
8033
8034 Raises the window to the top of the window hierarchy. In current
8035 version of wxWidgets this works both for manage and child windows.
8036 """
8037 return _core_.Window_Raise(*args, **kwargs)
8038
8039 def Lower(*args, **kwargs):
8040 """
8041 Lower(self)
8042
8043 Lowers the window to the bottom of the window hierarchy. In current
8044 version of wxWidgets this works both for manage and child windows.
8045 """
8046 return _core_.Window_Lower(*args, **kwargs)
8047
8048 def SetClientSize(*args, **kwargs):
8049 """
8050 SetClientSize(self, Size size)
8051
8052 This sets the size of the window client area in pixels. Using this
8053 function to size a window tends to be more device-independent than
8054 wx.Window.SetSize, since the application need not worry about what
8055 dimensions the border or title bar have when trying to fit the window
8056 around panel items, for example.
8057 """
8058 return _core_.Window_SetClientSize(*args, **kwargs)
8059
8060 def SetClientSizeWH(*args, **kwargs):
8061 """
8062 SetClientSizeWH(self, int width, int height)
8063
8064 This sets the size of the window client area in pixels. Using this
8065 function to size a window tends to be more device-independent than
8066 wx.Window.SetSize, since the application need not worry about what
8067 dimensions the border or title bar have when trying to fit the window
8068 around panel items, for example.
8069 """
8070 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8071
8072 def SetClientRect(*args, **kwargs):
8073 """
8074 SetClientRect(self, Rect rect)
8075
8076 This sets the size of the window client area in pixels. Using this
8077 function to size a window tends to be more device-independent than
8078 wx.Window.SetSize, since the application need not worry about what
8079 dimensions the border or title bar have when trying to fit the window
8080 around panel items, for example.
8081 """
8082 return _core_.Window_SetClientRect(*args, **kwargs)
8083
8084 def GetPosition(*args, **kwargs):
8085 """
8086 GetPosition(self) -> Point
8087
8088 Get the window's position. Notice that the position is in client
8089 coordinates for child windows and screen coordinates for the top level
8090 ones, use `GetScreenPosition` if you need screen coordinates for all
8091 kinds of windows.
8092 """
8093 return _core_.Window_GetPosition(*args, **kwargs)
8094
8095 def GetPositionTuple(*args, **kwargs):
8096 """
8097 GetPositionTuple() -> (x,y)
8098
8099 Get the window's position. Notice that the position is in client
8100 coordinates for child windows and screen coordinates for the top level
8101 ones, use `GetScreenPosition` if you need screen coordinates for all
8102 kinds of windows.
8103 """
8104 return _core_.Window_GetPositionTuple(*args, **kwargs)
8105
8106 def GetScreenPosition(*args, **kwargs):
8107 """
8108 GetScreenPosition(self) -> Point
8109
8110 Get the position of the window in screen coordinantes.
8111 """
8112 return _core_.Window_GetScreenPosition(*args, **kwargs)
8113
8114 def GetScreenPositionTuple(*args, **kwargs):
8115 """
8116 GetScreenPositionTuple() -> (x,y)
8117
8118 Get the position of the window in screen coordinantes.
8119 """
8120 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8121
8122 def GetScreenRect(*args, **kwargs):
8123 """
8124 GetScreenRect(self) -> Rect
8125
8126 Returns the size and position of the window in screen coordinantes as
8127 a `wx.Rect` object.
8128 """
8129 return _core_.Window_GetScreenRect(*args, **kwargs)
8130
8131 def GetSize(*args, **kwargs):
8132 """
8133 GetSize(self) -> Size
8134
8135 Get the window size.
8136 """
8137 return _core_.Window_GetSize(*args, **kwargs)
8138
8139 def GetSizeTuple(*args, **kwargs):
8140 """
8141 GetSizeTuple() -> (width, height)
8142
8143 Get the window size.
8144 """
8145 return _core_.Window_GetSizeTuple(*args, **kwargs)
8146
8147 def GetRect(*args, **kwargs):
8148 """
8149 GetRect(self) -> Rect
8150
8151 Returns the size and position of the window as a `wx.Rect` object.
8152 """
8153 return _core_.Window_GetRect(*args, **kwargs)
8154
8155 def GetClientSize(*args, **kwargs):
8156 """
8157 GetClientSize(self) -> Size
8158
8159 This gets the size of the window's 'client area' in pixels. The client
8160 area is the area which may be drawn on by the programmer, excluding
8161 title bar, border, scrollbars, etc.
8162 """
8163 return _core_.Window_GetClientSize(*args, **kwargs)
8164
8165 def GetClientSizeTuple(*args, **kwargs):
8166 """
8167 GetClientSizeTuple() -> (width, height)
8168
8169 This gets the size of the window's 'client area' in pixels. The client
8170 area is the area which may be drawn on by the programmer, excluding
8171 title bar, border, scrollbars, etc.
8172 """
8173 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8174
8175 def GetClientAreaOrigin(*args, **kwargs):
8176 """
8177 GetClientAreaOrigin(self) -> Point
8178
8179 Get the origin of the client area of the window relative to the
8180 window's top left corner (the client area may be shifted because of
8181 the borders, scrollbars, other decorations...)
8182 """
8183 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8184
8185 def GetClientRect(*args, **kwargs):
8186 """
8187 GetClientRect(self) -> Rect
8188
8189 Get the client area position and size as a `wx.Rect` object.
8190 """
8191 return _core_.Window_GetClientRect(*args, **kwargs)
8192
8193 def GetBestSize(*args, **kwargs):
8194 """
8195 GetBestSize(self) -> Size
8196
8197 This function returns the best acceptable minimal size for the
8198 window, if applicable. For example, for a static text control, it will
8199 be the minimal size such that the control label is not truncated. For
8200 windows containing subwindows (suzh aswx.Panel), the size returned by
8201 this function will be the same as the size the window would have had
8202 after calling Fit.
8203 """
8204 return _core_.Window_GetBestSize(*args, **kwargs)
8205
8206 def GetBestSizeTuple(*args, **kwargs):
8207 """
8208 GetBestSizeTuple() -> (width, height)
8209
8210 This function returns the best acceptable minimal size for the
8211 window, if applicable. For example, for a static text control, it will
8212 be the minimal size such that the control label is not truncated. For
8213 windows containing subwindows (suzh aswx.Panel), the size returned by
8214 this function will be the same as the size the window would have had
8215 after calling Fit.
8216 """
8217 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8218
8219 def InvalidateBestSize(*args, **kwargs):
8220 """
8221 InvalidateBestSize(self)
8222
8223 Reset the cached best size value so it will be recalculated the next
8224 time it is needed.
8225 """
8226 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8227
8228 def CacheBestSize(*args, **kwargs):
8229 """
8230 CacheBestSize(self, Size size)
8231
8232 Cache the best size so it doesn't need to be calculated again, (at least until
8233 some properties of the window change.)
8234 """
8235 return _core_.Window_CacheBestSize(*args, **kwargs)
8236
8237 def GetBestFittingSize(*args, **kwargs):
8238 """
8239 GetBestFittingSize(self) -> Size
8240
8241 This function will merge the window's best size into the window's
8242 minimum size, giving priority to the min size components, and returns
8243 the results.
8244
8245 """
8246 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8247
8248 def GetAdjustedBestSize(*args, **kwargs):
8249 """
8250 GetAdjustedBestSize(self) -> Size
8251
8252 This method is similar to GetBestSize, except in one
8253 thing. GetBestSize should return the minimum untruncated size of the
8254 window, while this method will return the largest of BestSize and any
8255 user specified minimum size. ie. it is the minimum size the window
8256 should currently be drawn at, not the minimal size it can possibly
8257 tolerate.
8258 """
8259 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8260
8261 def Center(*args, **kwargs):
8262 """
8263 Center(self, int direction=BOTH)
8264
8265 Centers the window. The parameter specifies the direction for
8266 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8267 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8268 on the entire screen and not on its parent window. If it is a
8269 top-level window and has no parent then it will always be centered
8270 relative to the screen.
8271 """
8272 return _core_.Window_Center(*args, **kwargs)
8273
8274 Centre = Center
8275 def CenterOnParent(*args, **kwargs):
8276 """
8277 CenterOnParent(self, int dir=BOTH)
8278
8279 Center with respect to the the parent window
8280 """
8281 return _core_.Window_CenterOnParent(*args, **kwargs)
8282
8283 CentreOnParent = CenterOnParent
8284 def Fit(*args, **kwargs):
8285 """
8286 Fit(self)
8287
8288 Sizes the window so that it fits around its subwindows. This function
8289 won't do anything if there are no subwindows and will only really work
8290 correctly if sizers are used for the subwindows layout. Also, if the
8291 window has exactly one subwindow it is better (faster and the result
8292 is more precise as Fit adds some margin to account for fuzziness of
8293 its calculations) to call window.SetClientSize(child.GetSize())
8294 instead of calling Fit.
8295 """
8296 return _core_.Window_Fit(*args, **kwargs)
8297
8298 def FitInside(*args, **kwargs):
8299 """
8300 FitInside(self)
8301
8302 Similar to Fit, but sizes the interior (virtual) size of a
8303 window. Mainly useful with scrolled windows to reset scrollbars after
8304 sizing changes that do not trigger a size event, and/or scrolled
8305 windows without an interior sizer. This function similarly won't do
8306 anything if there are no subwindows.
8307 """
8308 return _core_.Window_FitInside(*args, **kwargs)
8309
8310 def SetSizeHints(*args, **kwargs):
8311 """
8312 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8313 int incH=-1)
8314
8315 Allows specification of minimum and maximum window sizes, and window
8316 size increments. If a pair of values is not set (or set to -1), the
8317 default values will be used. If this function is called, the user
8318 will not be able to size the window outside the given bounds (if it is
8319 a top-level window.) Sizers will also inspect the minimum window size
8320 and will use that value if set when calculating layout.
8321
8322 The resizing increments are only significant under Motif or Xt.
8323 """
8324 return _core_.Window_SetSizeHints(*args, **kwargs)
8325
8326 def SetSizeHintsSz(*args, **kwargs):
8327 """
8328 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8329
8330 Allows specification of minimum and maximum window sizes, and window
8331 size increments. If a pair of values is not set (or set to -1), the
8332 default values will be used. If this function is called, the user
8333 will not be able to size the window outside the given bounds (if it is
8334 a top-level window.) Sizers will also inspect the minimum window size
8335 and will use that value if set when calculating layout.
8336
8337 The resizing increments are only significant under Motif or Xt.
8338 """
8339 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8340
8341 def SetVirtualSizeHints(*args, **kwargs):
8342 """
8343 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8344
8345 Allows specification of minimum and maximum virtual window sizes. If a
8346 pair of values is not set (or set to -1), the default values will be
8347 used. If this function is called, the user will not be able to size
8348 the virtual area of the window outside the given bounds.
8349 """
8350 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8351
8352 def SetVirtualSizeHintsSz(*args, **kwargs):
8353 """
8354 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8355
8356 Allows specification of minimum and maximum virtual window sizes. If a
8357 pair of values is not set (or set to -1), the default values will be
8358 used. If this function is called, the user will not be able to size
8359 the virtual area of the window outside the given bounds.
8360 """
8361 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8362
8363 def GetMaxSize(*args, **kwargs):
8364 """GetMaxSize(self) -> Size"""
8365 return _core_.Window_GetMaxSize(*args, **kwargs)
8366
8367 def GetMinSize(*args, **kwargs):
8368 """GetMinSize(self) -> Size"""
8369 return _core_.Window_GetMinSize(*args, **kwargs)
8370
8371 def SetMinSize(*args, **kwargs):
8372 """
8373 SetMinSize(self, Size minSize)
8374
8375 A more convenient method than `SetSizeHints` for setting just the
8376 min size.
8377 """
8378 return _core_.Window_SetMinSize(*args, **kwargs)
8379
8380 def SetMaxSize(*args, **kwargs):
8381 """
8382 SetMaxSize(self, Size maxSize)
8383
8384 A more convenient method than `SetSizeHints` for setting just the
8385 max size.
8386 """
8387 return _core_.Window_SetMaxSize(*args, **kwargs)
8388
8389 def GetMinWidth(*args, **kwargs):
8390 """GetMinWidth(self) -> int"""
8391 return _core_.Window_GetMinWidth(*args, **kwargs)
8392
8393 def GetMinHeight(*args, **kwargs):
8394 """GetMinHeight(self) -> int"""
8395 return _core_.Window_GetMinHeight(*args, **kwargs)
8396
8397 def GetMaxWidth(*args, **kwargs):
8398 """GetMaxWidth(self) -> int"""
8399 return _core_.Window_GetMaxWidth(*args, **kwargs)
8400
8401 def GetMaxHeight(*args, **kwargs):
8402 """GetMaxHeight(self) -> int"""
8403 return _core_.Window_GetMaxHeight(*args, **kwargs)
8404
8405 def SetVirtualSize(*args, **kwargs):
8406 """
8407 SetVirtualSize(self, Size size)
8408
8409 Set the the virtual size of a window in pixels. For most windows this
8410 is just the client area of the window, but for some like scrolled
8411 windows it is more or less independent of the screen window size.
8412 """
8413 return _core_.Window_SetVirtualSize(*args, **kwargs)
8414
8415 def SetVirtualSizeWH(*args, **kwargs):
8416 """
8417 SetVirtualSizeWH(self, int w, int h)
8418
8419 Set the the virtual size of a window in pixels. For most windows this
8420 is just the client area of the window, but for some like scrolled
8421 windows it is more or less independent of the screen window size.
8422 """
8423 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8424
8425 def GetVirtualSize(*args, **kwargs):
8426 """
8427 GetVirtualSize(self) -> Size
8428
8429 Get the the virtual size of the window in pixels. For most windows
8430 this is just the client area of the window, but for some like scrolled
8431 windows it is more or less independent of the screen window size.
8432 """
8433 return _core_.Window_GetVirtualSize(*args, **kwargs)
8434
8435 def GetVirtualSizeTuple(*args, **kwargs):
8436 """
8437 GetVirtualSizeTuple() -> (width, height)
8438
8439 Get the the virtual size of the window in pixels. For most windows
8440 this is just the client area of the window, but for some like scrolled
8441 windows it is more or less independent of the screen window size.
8442 """
8443 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8444
8445 def GetBestVirtualSize(*args, **kwargs):
8446 """
8447 GetBestVirtualSize(self) -> Size
8448
8449 Return the largest of ClientSize and BestSize (as determined by a
8450 sizer, interior children, or other means)
8451 """
8452 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8453
8454 def Show(*args, **kwargs):
8455 """
8456 Show(self, bool show=True) -> bool
8457
8458 Shows or hides the window. You may need to call Raise for a top level
8459 window if you want to bring it to top, although this is not needed if
8460 Show is called immediately after the frame creation. Returns True if
8461 the window has been shown or hidden or False if nothing was done
8462 because it already was in the requested state.
8463 """
8464 return _core_.Window_Show(*args, **kwargs)
8465
8466 def Hide(*args, **kwargs):
8467 """
8468 Hide(self) -> bool
8469
8470 Equivalent to calling Show(False).
8471 """
8472 return _core_.Window_Hide(*args, **kwargs)
8473
8474 def Enable(*args, **kwargs):
8475 """
8476 Enable(self, bool enable=True) -> bool
8477
8478 Enable or disable the window for user input. Note that when a parent
8479 window is disabled, all of its children are disabled as well and they
8480 are reenabled again when the parent is. Returns true if the window
8481 has been enabled or disabled, false if nothing was done, i.e. if the
8482 window had already been in the specified state.
8483 """
8484 return _core_.Window_Enable(*args, **kwargs)
8485
8486 def Disable(*args, **kwargs):
8487 """
8488 Disable(self) -> bool
8489
8490 Disables the window, same as Enable(false).
8491 """
8492 return _core_.Window_Disable(*args, **kwargs)
8493
8494 def IsShown(*args, **kwargs):
8495 """
8496 IsShown(self) -> bool
8497
8498 Returns true if the window is shown, false if it has been hidden.
8499 """
8500 return _core_.Window_IsShown(*args, **kwargs)
8501
8502 def IsEnabled(*args, **kwargs):
8503 """
8504 IsEnabled(self) -> bool
8505
8506 Returns true if the window is enabled for input, false otherwise.
8507 """
8508 return _core_.Window_IsEnabled(*args, **kwargs)
8509
8510 def IsShownOnScreen(*args, **kwargs):
8511 """
8512 IsShownOnScreen(self) -> bool
8513
8514 Returns ``True`` if the window is physically visible on the screen,
8515 i.e. it is shown and all its parents up to the toplevel window are
8516 shown as well.
8517 """
8518 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8519
8520 def SetWindowStyleFlag(*args, **kwargs):
8521 """
8522 SetWindowStyleFlag(self, long style)
8523
8524 Sets the style of the window. Please note that some styles cannot be
8525 changed after the window creation and that Refresh() might need to be
8526 called after changing the others for the change to take place
8527 immediately.
8528 """
8529 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8530
8531 def GetWindowStyleFlag(*args, **kwargs):
8532 """
8533 GetWindowStyleFlag(self) -> long
8534
8535 Gets the window style that was passed to the constructor or Create
8536 method.
8537 """
8538 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8539
8540 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8541 def HasFlag(*args, **kwargs):
8542 """
8543 HasFlag(self, int flag) -> bool
8544
8545 Test if the given style is set for this window.
8546 """
8547 return _core_.Window_HasFlag(*args, **kwargs)
8548
8549 def IsRetained(*args, **kwargs):
8550 """
8551 IsRetained(self) -> bool
8552
8553 Returns true if the window is retained, false otherwise. Retained
8554 windows are only available on X platforms.
8555 """
8556 return _core_.Window_IsRetained(*args, **kwargs)
8557
8558 def SetExtraStyle(*args, **kwargs):
8559 """
8560 SetExtraStyle(self, long exStyle)
8561
8562 Sets the extra style bits for the window. Extra styles are the less
8563 often used style bits which can't be set with the constructor or with
8564 SetWindowStyleFlag()
8565 """
8566 return _core_.Window_SetExtraStyle(*args, **kwargs)
8567
8568 def GetExtraStyle(*args, **kwargs):
8569 """
8570 GetExtraStyle(self) -> long
8571
8572 Returns the extra style bits for the window.
8573 """
8574 return _core_.Window_GetExtraStyle(*args, **kwargs)
8575
8576 def MakeModal(*args, **kwargs):
8577 """
8578 MakeModal(self, bool modal=True)
8579
8580 Disables all other windows in the application so that the user can
8581 only interact with this window. Passing False will reverse this
8582 effect.
8583 """
8584 return _core_.Window_MakeModal(*args, **kwargs)
8585
8586 def SetThemeEnabled(*args, **kwargs):
8587 """
8588 SetThemeEnabled(self, bool enableTheme)
8589
8590 This function tells a window if it should use the system's "theme"
8591 code to draw the windows' background instead if its own background
8592 drawing code. This will only have an effect on platforms that support
8593 the notion of themes in user defined windows. One such platform is
8594 GTK+ where windows can have (very colourful) backgrounds defined by a
8595 user's selected theme.
8596
8597 Dialogs, notebook pages and the status bar have this flag set to true
8598 by default so that the default look and feel is simulated best.
8599 """
8600 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8601
8602 def GetThemeEnabled(*args, **kwargs):
8603 """
8604 GetThemeEnabled(self) -> bool
8605
8606 Return the themeEnabled flag.
8607 """
8608 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8609
8610 def SetFocus(*args, **kwargs):
8611 """
8612 SetFocus(self)
8613
8614 Set's the focus to this window, allowing it to receive keyboard input.
8615 """
8616 return _core_.Window_SetFocus(*args, **kwargs)
8617
8618 def SetFocusFromKbd(*args, **kwargs):
8619 """
8620 SetFocusFromKbd(self)
8621
8622 Set focus to this window as the result of a keyboard action. Normally
8623 only called internally.
8624 """
8625 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8626
8627 def FindFocus(*args, **kwargs):
8628 """
8629 FindFocus() -> Window
8630
8631 Returns the window or control that currently has the keyboard focus,
8632 or None.
8633 """
8634 return _core_.Window_FindFocus(*args, **kwargs)
8635
8636 FindFocus = staticmethod(FindFocus)
8637 def AcceptsFocus(*args, **kwargs):
8638 """
8639 AcceptsFocus(self) -> bool
8640
8641 Can this window have focus?
8642 """
8643 return _core_.Window_AcceptsFocus(*args, **kwargs)
8644
8645 def AcceptsFocusFromKeyboard(*args, **kwargs):
8646 """
8647 AcceptsFocusFromKeyboard(self) -> bool
8648
8649 Can this window be given focus by keyboard navigation? if not, the
8650 only way to give it focus (provided it accepts it at all) is to click
8651 it.
8652 """
8653 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8654
8655 def Navigate(*args, **kwargs):
8656 """
8657 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8658
8659 Does keyboard navigation from this window to another, by sending a
8660 `wx.NavigationKeyEvent`.
8661 """
8662 return _core_.Window_Navigate(*args, **kwargs)
8663
8664 def MoveAfterInTabOrder(*args, **kwargs):
8665 """
8666 MoveAfterInTabOrder(self, Window win)
8667
8668 Moves this window in the tab navigation order after the specified
8669 sibling window. This means that when the user presses the TAB key on
8670 that other window, the focus switches to this window.
8671
8672 The default tab order is the same as creation order. This function
8673 and `MoveBeforeInTabOrder` allow to change it after creating all the
8674 windows.
8675
8676 """
8677 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8678
8679 def MoveBeforeInTabOrder(*args, **kwargs):
8680 """
8681 MoveBeforeInTabOrder(self, Window win)
8682
8683 Same as `MoveAfterInTabOrder` except that it inserts this window just
8684 before win instead of putting it right after it.
8685 """
8686 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8687
8688 def GetChildren(*args, **kwargs):
8689 """
8690 GetChildren(self) -> PyObject
8691
8692 Returns a list of the window's children. NOTE: Currently this is a
8693 copy of the child window list maintained by the window, so the return
8694 value of this function is only valid as long as the window's children
8695 do not change.
8696 """
8697 return _core_.Window_GetChildren(*args, **kwargs)
8698
8699 def GetParent(*args, **kwargs):
8700 """
8701 GetParent(self) -> Window
8702
8703 Returns the parent window of this window, or None if there isn't one.
8704 """
8705 return _core_.Window_GetParent(*args, **kwargs)
8706
8707 def GetGrandParent(*args, **kwargs):
8708 """
8709 GetGrandParent(self) -> Window
8710
8711 Returns the parent of the parent of this window, or None if there
8712 isn't one.
8713 """
8714 return _core_.Window_GetGrandParent(*args, **kwargs)
8715
8716 def IsTopLevel(*args, **kwargs):
8717 """
8718 IsTopLevel(self) -> bool
8719
8720 Returns true if the given window is a top-level one. Currently all
8721 frames and dialogs are always considered to be top-level windows (even
8722 if they have a parent window).
8723 """
8724 return _core_.Window_IsTopLevel(*args, **kwargs)
8725
8726 def Reparent(*args, **kwargs):
8727 """
8728 Reparent(self, Window newParent) -> bool
8729
8730 Reparents the window, i.e the window will be removed from its current
8731 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8732 re-inserted into another. Available on Windows and GTK. Returns True
8733 if the parent was changed, False otherwise (error or newParent ==
8734 oldParent)
8735 """
8736 return _core_.Window_Reparent(*args, **kwargs)
8737
8738 def AddChild(*args, **kwargs):
8739 """
8740 AddChild(self, Window child)
8741
8742 Adds a child window. This is called automatically by window creation
8743 functions so should not be required by the application programmer.
8744 """
8745 return _core_.Window_AddChild(*args, **kwargs)
8746
8747 def RemoveChild(*args, **kwargs):
8748 """
8749 RemoveChild(self, Window child)
8750
8751 Removes a child window. This is called automatically by window
8752 deletion functions so should not be required by the application
8753 programmer.
8754 """
8755 return _core_.Window_RemoveChild(*args, **kwargs)
8756
8757 def SetDoubleBuffered(*args, **kwargs):
8758 """
8759 SetDoubleBuffered(self, bool on)
8760
8761 Currently wxGTK2 only.
8762 """
8763 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8764
8765 def FindWindowById(*args, **kwargs):
8766 """
8767 FindWindowById(self, long winid) -> Window
8768
8769 Find a chld of this window by window ID
8770 """
8771 return _core_.Window_FindWindowById(*args, **kwargs)
8772
8773 def FindWindowByName(*args, **kwargs):
8774 """
8775 FindWindowByName(self, String name) -> Window
8776
8777 Find a child of this window by name
8778 """
8779 return _core_.Window_FindWindowByName(*args, **kwargs)
8780
8781 def GetEventHandler(*args, **kwargs):
8782 """
8783 GetEventHandler(self) -> EvtHandler
8784
8785 Returns the event handler for this window. By default, the window is
8786 its own event handler.
8787 """
8788 return _core_.Window_GetEventHandler(*args, **kwargs)
8789
8790 def SetEventHandler(*args, **kwargs):
8791 """
8792 SetEventHandler(self, EvtHandler handler)
8793
8794 Sets the event handler for this window. An event handler is an object
8795 that is capable of processing the events sent to a window. By default,
8796 the window is its own event handler, but an application may wish to
8797 substitute another, for example to allow central implementation of
8798 event-handling for a variety of different window classes.
8799
8800 It is usually better to use `wx.Window.PushEventHandler` since this sets
8801 up a chain of event handlers, where an event not handled by one event
8802 handler is handed to the next one in the chain.
8803 """
8804 return _core_.Window_SetEventHandler(*args, **kwargs)
8805
8806 def PushEventHandler(*args, **kwargs):
8807 """
8808 PushEventHandler(self, EvtHandler handler)
8809
8810 Pushes this event handler onto the event handler stack for the window.
8811 An event handler is an object that is capable of processing the events
8812 sent to a window. By default, the window is its own event handler, but
8813 an application may wish to substitute another, for example to allow
8814 central implementation of event-handling for a variety of different
8815 window classes.
8816
8817 wx.Window.PushEventHandler allows an application to set up a chain of
8818 event handlers, where an event not handled by one event handler is
8819 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8820 remove the event handler.
8821 """
8822 return _core_.Window_PushEventHandler(*args, **kwargs)
8823
8824 def PopEventHandler(*args, **kwargs):
8825 """
8826 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8827
8828 Removes and returns the top-most event handler on the event handler
8829 stack. If deleteHandler is True then the wx.EvtHandler object will be
8830 destroyed after it is popped.
8831 """
8832 return _core_.Window_PopEventHandler(*args, **kwargs)
8833
8834 def RemoveEventHandler(*args, **kwargs):
8835 """
8836 RemoveEventHandler(self, EvtHandler handler) -> bool
8837
8838 Find the given handler in the event handler chain and remove (but not
8839 delete) it from the event handler chain, return True if it was found
8840 and False otherwise (this also results in an assert failure so this
8841 function should only be called when the handler is supposed to be
8842 there.)
8843 """
8844 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8845
8846 def SetValidator(*args, **kwargs):
8847 """
8848 SetValidator(self, Validator validator)
8849
8850 Deletes the current validator (if any) and sets the window validator,
8851 having called wx.Validator.Clone to create a new validator of this
8852 type.
8853 """
8854 return _core_.Window_SetValidator(*args, **kwargs)
8855
8856 def GetValidator(*args, **kwargs):
8857 """
8858 GetValidator(self) -> Validator
8859
8860 Returns a pointer to the current validator for the window, or None if
8861 there is none.
8862 """
8863 return _core_.Window_GetValidator(*args, **kwargs)
8864
8865 def Validate(*args, **kwargs):
8866 """
8867 Validate(self) -> bool
8868
8869 Validates the current values of the child controls using their
8870 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8871 style flag set, the method will also call Validate() of all child
8872 windows. Returns false if any of the validations failed.
8873 """
8874 return _core_.Window_Validate(*args, **kwargs)
8875
8876 def TransferDataToWindow(*args, **kwargs):
8877 """
8878 TransferDataToWindow(self) -> bool
8879
8880 Transfers values to child controls from data areas specified by their
8881 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8882 style flag set, the method will also call TransferDataToWindow() of
8883 all child windows.
8884 """
8885 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8886
8887 def TransferDataFromWindow(*args, **kwargs):
8888 """
8889 TransferDataFromWindow(self) -> bool
8890
8891 Transfers values from child controls to data areas specified by their
8892 validators. Returns false if a transfer failed. If the window has
8893 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8894 also call TransferDataFromWindow() of all child windows.
8895 """
8896 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8897
8898 def InitDialog(*args, **kwargs):
8899 """
8900 InitDialog(self)
8901
8902 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8903 to the dialog via validators.
8904 """
8905 return _core_.Window_InitDialog(*args, **kwargs)
8906
8907 def SetAcceleratorTable(*args, **kwargs):
8908 """
8909 SetAcceleratorTable(self, AcceleratorTable accel)
8910
8911 Sets the accelerator table for this window.
8912 """
8913 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8914
8915 def GetAcceleratorTable(*args, **kwargs):
8916 """
8917 GetAcceleratorTable(self) -> AcceleratorTable
8918
8919 Gets the accelerator table for this window.
8920 """
8921 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8922
8923 def RegisterHotKey(*args, **kwargs):
8924 """
8925 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8926
8927 Registers a system wide hotkey. Every time the user presses the hotkey
8928 registered here, this window will receive a hotkey event. It will
8929 receive the event even if the application is in the background and
8930 does not have the input focus because the user is working with some
8931 other application. To bind an event handler function to this hotkey
8932 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8933 hotkey was registered successfully.
8934 """
8935 return _core_.Window_RegisterHotKey(*args, **kwargs)
8936
8937 def UnregisterHotKey(*args, **kwargs):
8938 """
8939 UnregisterHotKey(self, int hotkeyId) -> bool
8940
8941 Unregisters a system wide hotkey.
8942 """
8943 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8944
8945 def ConvertDialogPointToPixels(*args, **kwargs):
8946 """
8947 ConvertDialogPointToPixels(self, Point pt) -> Point
8948
8949 Converts a point or size from dialog units to pixels. Dialog units
8950 are used for maintaining a dialog's proportions even if the font
8951 changes. For the x dimension, the dialog units are multiplied by the
8952 average character width and then divided by 4. For the y dimension,
8953 the dialog units are multiplied by the average character height and
8954 then divided by 8.
8955 """
8956 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8957
8958 def ConvertDialogSizeToPixels(*args, **kwargs):
8959 """
8960 ConvertDialogSizeToPixels(self, Size sz) -> Size
8961
8962 Converts a point or size from dialog units to pixels. Dialog units
8963 are used for maintaining a dialog's proportions even if the font
8964 changes. For the x dimension, the dialog units are multiplied by the
8965 average character width and then divided by 4. For the y dimension,
8966 the dialog units are multiplied by the average character height and
8967 then divided by 8.
8968 """
8969 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8970
8971 def DLG_PNT(*args, **kwargs):
8972 """
8973 DLG_PNT(self, Point pt) -> Point
8974
8975 Converts a point or size from dialog units to pixels. Dialog units
8976 are used for maintaining a dialog's proportions even if the font
8977 changes. For the x dimension, the dialog units are multiplied by the
8978 average character width and then divided by 4. For the y dimension,
8979 the dialog units are multiplied by the average character height and
8980 then divided by 8.
8981 """
8982 return _core_.Window_DLG_PNT(*args, **kwargs)
8983
8984 def DLG_SZE(*args, **kwargs):
8985 """
8986 DLG_SZE(self, Size sz) -> Size
8987
8988 Converts a point or size from dialog units to pixels. Dialog units
8989 are used for maintaining a dialog's proportions even if the font
8990 changes. For the x dimension, the dialog units are multiplied by the
8991 average character width and then divided by 4. For the y dimension,
8992 the dialog units are multiplied by the average character height and
8993 then divided by 8.
8994 """
8995 return _core_.Window_DLG_SZE(*args, **kwargs)
8996
8997 def ConvertPixelPointToDialog(*args, **kwargs):
8998 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8999 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9000
9001 def ConvertPixelSizeToDialog(*args, **kwargs):
9002 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9003 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9004
9005 def WarpPointer(*args, **kwargs):
9006 """
9007 WarpPointer(self, int x, int y)
9008
9009 Moves the pointer to the given position on the window.
9010
9011 NOTE: This function is not supported under Mac because Apple Human
9012 Interface Guidelines forbid moving the mouse cursor programmatically.
9013 """
9014 return _core_.Window_WarpPointer(*args, **kwargs)
9015
9016 def CaptureMouse(*args, **kwargs):
9017 """
9018 CaptureMouse(self)
9019
9020 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9021 release the capture.
9022
9023 Note that wxWindows maintains the stack of windows having captured the
9024 mouse and when the mouse is released the capture returns to the window
9025 which had had captured it previously and it is only really released if
9026 there were no previous window. In particular, this means that you must
9027 release the mouse as many times as you capture it, unless the window
9028 receives the `wx.MouseCaptureLostEvent` event.
9029
9030 Any application which captures the mouse in the beginning of some
9031 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9032 operation when it receives the event. The event handler must not
9033 recapture mouse.
9034 """
9035 return _core_.Window_CaptureMouse(*args, **kwargs)
9036
9037 def ReleaseMouse(*args, **kwargs):
9038 """
9039 ReleaseMouse(self)
9040
9041 Releases mouse input captured with wx.Window.CaptureMouse.
9042 """
9043 return _core_.Window_ReleaseMouse(*args, **kwargs)
9044
9045 def GetCapture(*args, **kwargs):
9046 """
9047 GetCapture() -> Window
9048
9049 Returns the window which currently captures the mouse or None
9050 """
9051 return _core_.Window_GetCapture(*args, **kwargs)
9052
9053 GetCapture = staticmethod(GetCapture)
9054 def HasCapture(*args, **kwargs):
9055 """
9056 HasCapture(self) -> bool
9057
9058 Returns true if this window has the current mouse capture.
9059 """
9060 return _core_.Window_HasCapture(*args, **kwargs)
9061
9062 def Refresh(*args, **kwargs):
9063 """
9064 Refresh(self, bool eraseBackground=True, Rect rect=None)
9065
9066 Mark the specified rectangle (or the whole window) as "dirty" so it
9067 will be repainted. Causes an EVT_PAINT event to be generated and sent
9068 to the window.
9069 """
9070 return _core_.Window_Refresh(*args, **kwargs)
9071
9072 def RefreshRect(*args, **kwargs):
9073 """
9074 RefreshRect(self, Rect rect, bool eraseBackground=True)
9075
9076 Redraws the contents of the given rectangle: the area inside it will
9077 be repainted. This is the same as Refresh but has a nicer syntax.
9078 """
9079 return _core_.Window_RefreshRect(*args, **kwargs)
9080
9081 def Update(*args, **kwargs):
9082 """
9083 Update(self)
9084
9085 Calling this method immediately repaints the invalidated area of the
9086 window instead of waiting for the EVT_PAINT event to happen, (normally
9087 this would usually only happen when the flow of control returns to the
9088 event loop.) Notice that this function doesn't refresh the window and
9089 does nothing if the window has been already repainted. Use Refresh
9090 first if you want to immediately redraw the window (or some portion of
9091 it) unconditionally.
9092 """
9093 return _core_.Window_Update(*args, **kwargs)
9094
9095 def ClearBackground(*args, **kwargs):
9096 """
9097 ClearBackground(self)
9098
9099 Clears the window by filling it with the current background
9100 colour. Does not cause an erase background event to be generated.
9101 """
9102 return _core_.Window_ClearBackground(*args, **kwargs)
9103
9104 def Freeze(*args, **kwargs):
9105 """
9106 Freeze(self)
9107
9108 Freezes the window or, in other words, prevents any updates from
9109 taking place on screen, the window is not redrawn at all. Thaw must be
9110 called to reenable window redrawing. Calls to Freeze/Thaw may be
9111 nested, with the actual Thaw being delayed until all the nesting has
9112 been undone.
9113
9114 This method is useful for visual appearance optimization (for example,
9115 it is a good idea to use it before inserting large amount of text into
9116 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9117 for all controls so it is mostly just a hint to wxWindows and not a
9118 mandatory directive.
9119 """
9120 return _core_.Window_Freeze(*args, **kwargs)
9121
9122 def IsFrozen(*args, **kwargs):
9123 """
9124 IsFrozen(self) -> bool
9125
9126 Returns ``True`` if the window has been frozen and not thawed yet.
9127
9128 :see: `Freeze` and `Thaw`
9129 """
9130 return _core_.Window_IsFrozen(*args, **kwargs)
9131
9132 def Thaw(*args, **kwargs):
9133 """
9134 Thaw(self)
9135
9136 Reenables window updating after a previous call to Freeze. Calls to
9137 Freeze/Thaw may be nested, so Thaw must be called the same number of
9138 times that Freeze was before the window will be updated.
9139 """
9140 return _core_.Window_Thaw(*args, **kwargs)
9141
9142 def PrepareDC(*args, **kwargs):
9143 """
9144 PrepareDC(self, DC dc)
9145
9146 Call this function to prepare the device context for drawing a
9147 scrolled image. It sets the device origin according to the current
9148 scroll position.
9149 """
9150 return _core_.Window_PrepareDC(*args, **kwargs)
9151
9152 def GetUpdateRegion(*args, **kwargs):
9153 """
9154 GetUpdateRegion(self) -> Region
9155
9156 Returns the region specifying which parts of the window have been
9157 damaged. Should only be called within an EVT_PAINT handler.
9158 """
9159 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9160
9161 def GetUpdateClientRect(*args, **kwargs):
9162 """
9163 GetUpdateClientRect(self) -> Rect
9164
9165 Get the update rectangle region bounding box in client coords.
9166 """
9167 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9168
9169 def IsExposed(*args, **kwargs):
9170 """
9171 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9172
9173 Returns true if the given point or rectangle area has been exposed
9174 since the last repaint. Call this in an paint event handler to
9175 optimize redrawing by only redrawing those areas, which have been
9176 exposed.
9177 """
9178 return _core_.Window_IsExposed(*args, **kwargs)
9179
9180 def IsExposedPoint(*args, **kwargs):
9181 """
9182 IsExposedPoint(self, Point pt) -> bool
9183
9184 Returns true if the given point or rectangle area has been exposed
9185 since the last repaint. Call this in an paint event handler to
9186 optimize redrawing by only redrawing those areas, which have been
9187 exposed.
9188 """
9189 return _core_.Window_IsExposedPoint(*args, **kwargs)
9190
9191 def IsExposedRect(*args, **kwargs):
9192 """
9193 IsExposedRect(self, Rect rect) -> bool
9194
9195 Returns true if the given point or rectangle area has been exposed
9196 since the last repaint. Call this in an paint event handler to
9197 optimize redrawing by only redrawing those areas, which have been
9198 exposed.
9199 """
9200 return _core_.Window_IsExposedRect(*args, **kwargs)
9201
9202 def GetDefaultAttributes(*args, **kwargs):
9203 """
9204 GetDefaultAttributes(self) -> VisualAttributes
9205
9206 Get the default attributes for an instance of this class. This is
9207 useful if you want to use the same font or colour in your own control
9208 as in a standard control -- which is a much better idea than hard
9209 coding specific colours or fonts which might look completely out of
9210 place on the user's system, especially if it uses themes.
9211 """
9212 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9213
9214 def GetClassDefaultAttributes(*args, **kwargs):
9215 """
9216 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9217
9218 Get the default attributes for this class. This is useful if you want
9219 to use the same font or colour in your own control as in a standard
9220 control -- which is a much better idea than hard coding specific
9221 colours or fonts which might look completely out of place on the
9222 user's system, especially if it uses themes.
9223
9224 The variant parameter is only relevant under Mac currently and is
9225 ignore under other platforms. Under Mac, it will change the size of
9226 the returned font. See `wx.Window.SetWindowVariant` for more about
9227 this.
9228 """
9229 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9230
9231 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9232 def SetBackgroundColour(*args, **kwargs):
9233 """
9234 SetBackgroundColour(self, Colour colour) -> bool
9235
9236 Sets the background colour of the window. Returns True if the colour
9237 was changed. The background colour is usually painted by the default
9238 EVT_ERASE_BACKGROUND event handler function under Windows and
9239 automatically under GTK. Using `wx.NullColour` will reset the window
9240 to the default background colour.
9241
9242 Note that setting the background colour may not cause an immediate
9243 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9244 calling this function.
9245
9246 Using this function will disable attempts to use themes for this
9247 window, if the system supports them. Use with care since usually the
9248 themes represent the appearance chosen by the user to be used for all
9249 applications on the system.
9250 """
9251 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9252
9253 def SetOwnBackgroundColour(*args, **kwargs):
9254 """SetOwnBackgroundColour(self, Colour colour)"""
9255 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9256
9257 def SetForegroundColour(*args, **kwargs):
9258 """
9259 SetForegroundColour(self, Colour colour) -> bool
9260
9261 Sets the foreground colour of the window. Returns True is the colour
9262 was changed. The interpretation of foreground colour is dependent on
9263 the window class; it may be the text colour or other colour, or it may
9264 not be used at all.
9265 """
9266 return _core_.Window_SetForegroundColour(*args, **kwargs)
9267
9268 def SetOwnForegroundColour(*args, **kwargs):
9269 """SetOwnForegroundColour(self, Colour colour)"""
9270 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9271
9272 def GetBackgroundColour(*args, **kwargs):
9273 """
9274 GetBackgroundColour(self) -> Colour
9275
9276 Returns the background colour of the window.
9277 """
9278 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9279
9280 def GetForegroundColour(*args, **kwargs):
9281 """
9282 GetForegroundColour(self) -> Colour
9283
9284 Returns the foreground colour of the window. The interpretation of
9285 foreground colour is dependent on the window class; it may be the text
9286 colour or other colour, or it may not be used at all.
9287 """
9288 return _core_.Window_GetForegroundColour(*args, **kwargs)
9289
9290 def InheritsBackgroundColour(*args, **kwargs):
9291 """InheritsBackgroundColour(self) -> bool"""
9292 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9293
9294 def UseBgCol(*args, **kwargs):
9295 """UseBgCol(self) -> bool"""
9296 return _core_.Window_UseBgCol(*args, **kwargs)
9297
9298 def SetBackgroundStyle(*args, **kwargs):
9299 """
9300 SetBackgroundStyle(self, int style) -> bool
9301
9302 Returns the background style of the window. The background style
9303 indicates how the background of the window is drawn.
9304
9305 ====================== ========================================
9306 wx.BG_STYLE_SYSTEM The background colour or pattern should
9307 be determined by the system
9308 wx.BG_STYLE_COLOUR The background should be a solid colour
9309 wx.BG_STYLE_CUSTOM The background will be implemented by the
9310 application.
9311 ====================== ========================================
9312
9313 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9314 a custom background, such as a tiled bitmap. Currently the style has
9315 no effect on other platforms.
9316
9317 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9318 """
9319 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9320
9321 def GetBackgroundStyle(*args, **kwargs):
9322 """
9323 GetBackgroundStyle(self) -> int
9324
9325 Returns the background style of the window.
9326
9327 :see: `SetBackgroundStyle`
9328 """
9329 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9330
9331 def HasTransparentBackground(*args, **kwargs):
9332 """
9333 HasTransparentBackground(self) -> bool
9334
9335 Returns True if this window's background is transparent (as, for
9336 example, for `wx.StaticText`) and should show the parent window's
9337 background.
9338
9339 This method is mostly used internally by the library itself and you
9340 normally shouldn't have to call it. You may, however, have to override
9341 it in your custom control classes to ensure that background is painted
9342 correctly.
9343 """
9344 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9345
9346 def SetCursor(*args, **kwargs):
9347 """
9348 SetCursor(self, Cursor cursor) -> bool
9349
9350 Sets the window's cursor. Notice that the window cursor also sets it
9351 for the children of the window implicitly.
9352
9353 The cursor may be wx.NullCursor in which case the window cursor will
9354 be reset back to default.
9355 """
9356 return _core_.Window_SetCursor(*args, **kwargs)
9357
9358 def GetCursor(*args, **kwargs):
9359 """
9360 GetCursor(self) -> Cursor
9361
9362 Return the cursor associated with this window.
9363 """
9364 return _core_.Window_GetCursor(*args, **kwargs)
9365
9366 def SetFont(*args, **kwargs):
9367 """
9368 SetFont(self, Font font) -> bool
9369
9370 Sets the font for this window.
9371 """
9372 return _core_.Window_SetFont(*args, **kwargs)
9373
9374 def SetOwnFont(*args, **kwargs):
9375 """SetOwnFont(self, Font font)"""
9376 return _core_.Window_SetOwnFont(*args, **kwargs)
9377
9378 def GetFont(*args, **kwargs):
9379 """
9380 GetFont(self) -> Font
9381
9382 Returns the default font used for this window.
9383 """
9384 return _core_.Window_GetFont(*args, **kwargs)
9385
9386 def SetCaret(*args, **kwargs):
9387 """
9388 SetCaret(self, Caret caret)
9389
9390 Sets the caret associated with the window.
9391 """
9392 return _core_.Window_SetCaret(*args, **kwargs)
9393
9394 def GetCaret(*args, **kwargs):
9395 """
9396 GetCaret(self) -> Caret
9397
9398 Returns the caret associated with the window.
9399 """
9400 return _core_.Window_GetCaret(*args, **kwargs)
9401
9402 def GetCharHeight(*args, **kwargs):
9403 """
9404 GetCharHeight(self) -> int
9405
9406 Get the (average) character size for the current font.
9407 """
9408 return _core_.Window_GetCharHeight(*args, **kwargs)
9409
9410 def GetCharWidth(*args, **kwargs):
9411 """
9412 GetCharWidth(self) -> int
9413
9414 Get the (average) character size for the current font.
9415 """
9416 return _core_.Window_GetCharWidth(*args, **kwargs)
9417
9418 def GetTextExtent(*args, **kwargs):
9419 """
9420 GetTextExtent(String string) -> (width, height)
9421
9422 Get the width and height of the text using the current font.
9423 """
9424 return _core_.Window_GetTextExtent(*args, **kwargs)
9425
9426 def GetFullTextExtent(*args, **kwargs):
9427 """
9428 GetFullTextExtent(String string, Font font=None) ->
9429 (width, height, descent, externalLeading)
9430
9431 Get the width, height, decent and leading of the text using the
9432 current or specified font.
9433 """
9434 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9435
9436 def ClientToScreenXY(*args, **kwargs):
9437 """
9438 ClientToScreenXY(int x, int y) -> (x,y)
9439
9440 Converts to screen coordinates from coordinates relative to this window.
9441 """
9442 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9443
9444 def ScreenToClientXY(*args, **kwargs):
9445 """
9446 ScreenToClientXY(int x, int y) -> (x,y)
9447
9448 Converts from screen to client window coordinates.
9449 """
9450 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9451
9452 def ClientToScreen(*args, **kwargs):
9453 """
9454 ClientToScreen(self, Point pt) -> Point
9455
9456 Converts to screen coordinates from coordinates relative to this window.
9457 """
9458 return _core_.Window_ClientToScreen(*args, **kwargs)
9459
9460 def ScreenToClient(*args, **kwargs):
9461 """
9462 ScreenToClient(self, Point pt) -> Point
9463
9464 Converts from screen to client window coordinates.
9465 """
9466 return _core_.Window_ScreenToClient(*args, **kwargs)
9467
9468 def HitTestXY(*args, **kwargs):
9469 """
9470 HitTestXY(self, int x, int y) -> int
9471
9472 Test where the given (in client coords) point lies
9473 """
9474 return _core_.Window_HitTestXY(*args, **kwargs)
9475
9476 def HitTest(*args, **kwargs):
9477 """
9478 HitTest(self, Point pt) -> int
9479
9480 Test where the given (in client coords) point lies
9481 """
9482 return _core_.Window_HitTest(*args, **kwargs)
9483
9484 def GetBorder(*args):
9485 """
9486 GetBorder(self, long flags) -> int
9487 GetBorder(self) -> int
9488
9489 Get border for the flags of this window
9490 """
9491 return _core_.Window_GetBorder(*args)
9492
9493 def UpdateWindowUI(*args, **kwargs):
9494 """
9495 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9496
9497 This function sends EVT_UPDATE_UI events to the window. The particular
9498 implementation depends on the window; for example a wx.ToolBar will
9499 send an update UI event for each toolbar button, and a wx.Frame will
9500 send an update UI event for each menubar menu item. You can call this
9501 function from your application to ensure that your UI is up-to-date at
9502 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9503 concerned). This may be necessary if you have called
9504 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9505 limit the overhead that wxWindows incurs by sending update UI events
9506 in idle time.
9507 """
9508 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9509
9510 def PopupMenuXY(*args, **kwargs):
9511 """
9512 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9513
9514 Pops up the given menu at the specified coordinates, relative to this window,
9515 and returns control when the user has dismissed the menu. If a menu item is
9516 selected, the corresponding menu event is generated and will be processed as
9517 usual. If the default position is given then the current position of the
9518 mouse cursor will be used.
9519 """
9520 return _core_.Window_PopupMenuXY(*args, **kwargs)
9521
9522 def PopupMenu(*args, **kwargs):
9523 """
9524 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9525
9526 Pops up the given menu at the specified coordinates, relative to this window,
9527 and returns control when the user has dismissed the menu. If a menu item is
9528 selected, the corresponding menu event is generated and will be processed as
9529 usual. If the default position is given then the current position of the
9530 mouse cursor will be used.
9531 """
9532 return _core_.Window_PopupMenu(*args, **kwargs)
9533
9534 def HasMultiplePages(*args, **kwargs):
9535 """HasMultiplePages(self) -> bool"""
9536 return _core_.Window_HasMultiplePages(*args, **kwargs)
9537
9538 def GetHandle(*args, **kwargs):
9539 """
9540 GetHandle(self) -> long
9541
9542 Returns the platform-specific handle (as a long integer) of the
9543 physical window. Currently on wxMac it returns the handle of the
9544 toplevel parent of the window.
9545 """
9546 return _core_.Window_GetHandle(*args, **kwargs)
9547
9548 def AssociateHandle(*args, **kwargs):
9549 """
9550 AssociateHandle(self, long handle)
9551
9552 Associate the window with a new native handle
9553 """
9554 return _core_.Window_AssociateHandle(*args, **kwargs)
9555
9556 def DissociateHandle(*args, **kwargs):
9557 """
9558 DissociateHandle(self)
9559
9560 Dissociate the current native handle from the window
9561 """
9562 return _core_.Window_DissociateHandle(*args, **kwargs)
9563
9564 def OnPaint(*args, **kwargs):
9565 """OnPaint(self, PaintEvent event)"""
9566 return _core_.Window_OnPaint(*args, **kwargs)
9567
9568 def HasScrollbar(*args, **kwargs):
9569 """
9570 HasScrollbar(self, int orient) -> bool
9571
9572 Does the window have the scrollbar for this orientation?
9573 """
9574 return _core_.Window_HasScrollbar(*args, **kwargs)
9575
9576 def SetScrollbar(*args, **kwargs):
9577 """
9578 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9579 bool refresh=True)
9580
9581 Sets the scrollbar properties of a built-in scrollbar.
9582 """
9583 return _core_.Window_SetScrollbar(*args, **kwargs)
9584
9585 def SetScrollPos(*args, **kwargs):
9586 """
9587 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9588
9589 Sets the position of one of the built-in scrollbars.
9590 """
9591 return _core_.Window_SetScrollPos(*args, **kwargs)
9592
9593 def GetScrollPos(*args, **kwargs):
9594 """
9595 GetScrollPos(self, int orientation) -> int
9596
9597 Returns the built-in scrollbar position.
9598 """
9599 return _core_.Window_GetScrollPos(*args, **kwargs)
9600
9601 def GetScrollThumb(*args, **kwargs):
9602 """
9603 GetScrollThumb(self, int orientation) -> int
9604
9605 Returns the built-in scrollbar thumb size.
9606 """
9607 return _core_.Window_GetScrollThumb(*args, **kwargs)
9608
9609 def GetScrollRange(*args, **kwargs):
9610 """
9611 GetScrollRange(self, int orientation) -> int
9612
9613 Returns the built-in scrollbar range.
9614 """
9615 return _core_.Window_GetScrollRange(*args, **kwargs)
9616
9617 def ScrollWindow(*args, **kwargs):
9618 """
9619 ScrollWindow(self, int dx, int dy, Rect rect=None)
9620
9621 Physically scrolls the pixels in the window and move child windows
9622 accordingly. Use this function to optimise your scrolling
9623 implementations, to minimise the area that must be redrawn. Note that
9624 it is rarely required to call this function from a user program.
9625 """
9626 return _core_.Window_ScrollWindow(*args, **kwargs)
9627
9628 def ScrollLines(*args, **kwargs):
9629 """
9630 ScrollLines(self, int lines) -> bool
9631
9632 If the platform and window class supports it, scrolls the window by
9633 the given number of lines down, if lines is positive, or up if lines
9634 is negative. Returns True if the window was scrolled, False if it was
9635 already on top/bottom and nothing was done.
9636 """
9637 return _core_.Window_ScrollLines(*args, **kwargs)
9638
9639 def ScrollPages(*args, **kwargs):
9640 """
9641 ScrollPages(self, int pages) -> bool
9642
9643 If the platform and window class supports it, scrolls the window by
9644 the given number of pages down, if pages is positive, or up if pages
9645 is negative. Returns True if the window was scrolled, False if it was
9646 already on top/bottom and nothing was done.
9647 """
9648 return _core_.Window_ScrollPages(*args, **kwargs)
9649
9650 def LineUp(*args, **kwargs):
9651 """
9652 LineUp(self) -> bool
9653
9654 This is just a wrapper for ScrollLines(-1).
9655 """
9656 return _core_.Window_LineUp(*args, **kwargs)
9657
9658 def LineDown(*args, **kwargs):
9659 """
9660 LineDown(self) -> bool
9661
9662 This is just a wrapper for ScrollLines(1).
9663 """
9664 return _core_.Window_LineDown(*args, **kwargs)
9665
9666 def PageUp(*args, **kwargs):
9667 """
9668 PageUp(self) -> bool
9669
9670 This is just a wrapper for ScrollPages(-1).
9671 """
9672 return _core_.Window_PageUp(*args, **kwargs)
9673
9674 def PageDown(*args, **kwargs):
9675 """
9676 PageDown(self) -> bool
9677
9678 This is just a wrapper for ScrollPages(1).
9679 """
9680 return _core_.Window_PageDown(*args, **kwargs)
9681
9682 def SetHelpText(*args, **kwargs):
9683 """
9684 SetHelpText(self, String text)
9685
9686 Sets the help text to be used as context-sensitive help for this
9687 window. Note that the text is actually stored by the current
9688 `wx.HelpProvider` implementation, and not in the window object itself.
9689 """
9690 return _core_.Window_SetHelpText(*args, **kwargs)
9691
9692 def SetHelpTextForId(*args, **kwargs):
9693 """
9694 SetHelpTextForId(self, String text)
9695
9696 Associate this help text with all windows with the same id as this
9697 one.
9698 """
9699 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9700
9701 def GetHelpTextAtPoint(*args, **kwargs):
9702 """
9703 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9704
9705 Get the help string associated with the given position in this window.
9706
9707 Notice that pt may be invalid if event origin is keyboard or unknown
9708 and this method should return the global window help text then
9709
9710 """
9711 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9712
9713 def GetHelpText(*args, **kwargs):
9714 """
9715 GetHelpText(self) -> String
9716
9717 Gets the help text to be used as context-sensitive help for this
9718 window. Note that the text is actually stored by the current
9719 `wx.HelpProvider` implementation, and not in the window object itself.
9720 """
9721 return _core_.Window_GetHelpText(*args, **kwargs)
9722
9723 def SetToolTipString(*args, **kwargs):
9724 """
9725 SetToolTipString(self, String tip)
9726
9727 Attach a tooltip to the window.
9728 """
9729 return _core_.Window_SetToolTipString(*args, **kwargs)
9730
9731 def SetToolTip(*args, **kwargs):
9732 """
9733 SetToolTip(self, ToolTip tip)
9734
9735 Attach a tooltip to the window.
9736 """
9737 return _core_.Window_SetToolTip(*args, **kwargs)
9738
9739 def GetToolTip(*args, **kwargs):
9740 """
9741 GetToolTip(self) -> ToolTip
9742
9743 get the associated tooltip or None if none
9744 """
9745 return _core_.Window_GetToolTip(*args, **kwargs)
9746
9747 def SetDropTarget(*args, **kwargs):
9748 """
9749 SetDropTarget(self, DropTarget dropTarget)
9750
9751 Associates a drop target with this window. If the window already has
9752 a drop target, it is deleted.
9753 """
9754 return _core_.Window_SetDropTarget(*args, **kwargs)
9755
9756 def GetDropTarget(*args, **kwargs):
9757 """
9758 GetDropTarget(self) -> DropTarget
9759
9760 Returns the associated drop target, which may be None.
9761 """
9762 return _core_.Window_GetDropTarget(*args, **kwargs)
9763
9764 def DragAcceptFiles(*args, **kwargs):
9765 """
9766 DragAcceptFiles(self, bool accept)
9767
9768 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9769 Only functional on Windows.
9770 """
9771 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9772
9773 def SetConstraints(*args, **kwargs):
9774 """
9775 SetConstraints(self, LayoutConstraints constraints)
9776
9777 Sets the window to have the given layout constraints. If an existing
9778 layout constraints object is already owned by the window, it will be
9779 deleted. Pass None to disassociate and delete the window's current
9780 constraints.
9781
9782 You must call SetAutoLayout to tell a window to use the constraints
9783 automatically in its default EVT_SIZE handler; otherwise, you must
9784 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9785 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9786 effect.
9787 """
9788 return _core_.Window_SetConstraints(*args, **kwargs)
9789
9790 def GetConstraints(*args, **kwargs):
9791 """
9792 GetConstraints(self) -> LayoutConstraints
9793
9794 Returns a pointer to the window's layout constraints, or None if there
9795 are none.
9796 """
9797 return _core_.Window_GetConstraints(*args, **kwargs)
9798
9799 def SetAutoLayout(*args, **kwargs):
9800 """
9801 SetAutoLayout(self, bool autoLayout)
9802
9803 Determines whether the Layout function will be called automatically
9804 when the window is resized. lease note that this only happens for the
9805 windows usually used to contain children, namely `wx.Panel` and
9806 `wx.TopLevelWindow` (and the classes deriving from them).
9807
9808 This method is called implicitly by `SetSizer` but if you use
9809 `SetConstraints` you should call it manually or otherwise the window
9810 layout won't be correctly updated when its size changes.
9811 """
9812 return _core_.Window_SetAutoLayout(*args, **kwargs)
9813
9814 def GetAutoLayout(*args, **kwargs):
9815 """
9816 GetAutoLayout(self) -> bool
9817
9818 Returns the current autoLayout setting
9819 """
9820 return _core_.Window_GetAutoLayout(*args, **kwargs)
9821
9822 def Layout(*args, **kwargs):
9823 """
9824 Layout(self) -> bool
9825
9826 Invokes the constraint-based layout algorithm or the sizer-based
9827 algorithm for this window. See SetAutoLayout: when auto layout is on,
9828 this function gets called automatically by the default EVT_SIZE
9829 handler when the window is resized.
9830 """
9831 return _core_.Window_Layout(*args, **kwargs)
9832
9833 def SetSizer(*args, **kwargs):
9834 """
9835 SetSizer(self, Sizer sizer, bool deleteOld=True)
9836
9837 Sets the window to have the given layout sizer. The window will then
9838 own the object, and will take care of its deletion. If an existing
9839 layout sizer object is already owned by the window, it will be deleted
9840 if the deleteOld parameter is true. Note that this function will also
9841 call SetAutoLayout implicitly with a True parameter if the sizer is
9842 non-None, and False otherwise.
9843 """
9844 return _core_.Window_SetSizer(*args, **kwargs)
9845
9846 def SetSizerAndFit(*args, **kwargs):
9847 """
9848 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9849
9850 The same as SetSizer, except it also sets the size hints for the
9851 window based on the sizer's minimum size.
9852 """
9853 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9854
9855 def GetSizer(*args, **kwargs):
9856 """
9857 GetSizer(self) -> Sizer
9858
9859 Return the sizer associated with the window by a previous call to
9860 SetSizer or None if there isn't one.
9861 """
9862 return _core_.Window_GetSizer(*args, **kwargs)
9863
9864 def SetContainingSizer(*args, **kwargs):
9865 """
9866 SetContainingSizer(self, Sizer sizer)
9867
9868 This normally does not need to be called by application code. It is
9869 called internally when a window is added to a sizer, and is used so
9870 the window can remove itself from the sizer when it is destroyed.
9871 """
9872 return _core_.Window_SetContainingSizer(*args, **kwargs)
9873
9874 def GetContainingSizer(*args, **kwargs):
9875 """
9876 GetContainingSizer(self) -> Sizer
9877
9878 Return the sizer that this window is a member of, if any, otherwise None.
9879 """
9880 return _core_.Window_GetContainingSizer(*args, **kwargs)
9881
9882 def InheritAttributes(*args, **kwargs):
9883 """
9884 InheritAttributes(self)
9885
9886 This function is (or should be, in case of custom controls) called
9887 during window creation to intelligently set up the window visual
9888 attributes, that is the font and the foreground and background
9889 colours.
9890
9891 By 'intelligently' the following is meant: by default, all windows use
9892 their own default attributes. However if some of the parent's
9893 attributes are explicitly changed (that is, using SetFont and not
9894 SetOwnFont) and if the corresponding attribute hadn't been
9895 explicitly set for this window itself, then this window takes the same
9896 value as used by the parent. In addition, if the window overrides
9897 ShouldInheritColours to return false, the colours will not be changed
9898 no matter what and only the font might.
9899
9900 This rather complicated logic is necessary in order to accommodate the
9901 different usage scenarios. The most common one is when all default
9902 attributes are used and in this case, nothing should be inherited as
9903 in modern GUIs different controls use different fonts (and colours)
9904 than their siblings so they can't inherit the same value from the
9905 parent. However it was also deemed desirable to allow to simply change
9906 the attributes of all children at once by just changing the font or
9907 colour of their common parent, hence in this case we do inherit the
9908 parents attributes.
9909
9910 """
9911 return _core_.Window_InheritAttributes(*args, **kwargs)
9912
9913 def ShouldInheritColours(*args, **kwargs):
9914 """
9915 ShouldInheritColours(self) -> bool
9916
9917 Return true from here to allow the colours of this window to be
9918 changed by InheritAttributes, returning false forbids inheriting them
9919 from the parent window.
9920
9921 The base class version returns false, but this method is overridden in
9922 wxControl where it returns true.
9923 """
9924 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9925
9926 def CanSetTransparent(*args, **kwargs):
9927 """
9928 CanSetTransparent(self) -> bool
9929
9930 Returns ``True`` if the platform supports setting the transparency for
9931 this window. Note that this method will err on the side of caution,
9932 so it is possible that this will return ``False`` when it is in fact
9933 possible to set the transparency.
9934
9935 NOTE: On X-windows systems the X server must have the composite
9936 extension loaded, and there must be a composite manager program (such
9937 as xcompmgr) running.
9938 """
9939 return _core_.Window_CanSetTransparent(*args, **kwargs)
9940
9941 def SetTransparent(*args, **kwargs):
9942 """
9943 SetTransparent(self, byte alpha) -> bool
9944
9945 Attempt to set the transparency of this window to the ``alpha`` value,
9946 returns True on success. The ``alpha`` value is an integer in the
9947 range of 0 to 255, where 0 is fully transparent and 255 is fully
9948 opaque.
9949 """
9950 return _core_.Window_SetTransparent(*args, **kwargs)
9951
9952 def PostCreate(self, pre):
9953 """
9954 Phase 3 of the 2-phase create <wink!>
9955 Call this method after precreating the window with the 2-phase create method.
9956 """
9957 self.this = pre.this
9958 self.thisown = pre.thisown
9959 pre.thisown = 0
9960 if hasattr(self, '_setOORInfo'):
9961 self._setOORInfo(self)
9962 if hasattr(self, '_setCallbackInfo'):
9963 self._setCallbackInfo(self, self.__class__)
9964
9965 def SendSizeEvent(self):
9966 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9967
9968 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9969 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
9970 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
9971 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
9972 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9973 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
9974 BestSize = property(GetBestSize,doc="See `GetBestSize`")
9975 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
9976 Border = property(GetBorder,doc="See `GetBorder`")
9977 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
9978 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
9979 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
9980 Children = property(GetChildren,doc="See `GetChildren`")
9981 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
9982 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
9983 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
9984 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
9985 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
9986 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
9987 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
9988 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
9989 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
9990 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
9991 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
9992 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
9993 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
9994 Handle = property(GetHandle,doc="See `GetHandle`")
9995 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
9996 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
9997 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
9998 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
9999 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10000 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10001 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10002 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10003 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10004 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10005 Parent = property(GetParent,doc="See `GetParent`")
10006 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10007 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10008 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10009 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
10010 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10011 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
10012 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10013 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10014 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10015 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10016 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10017 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10018 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10019 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10020 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
10021 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10022 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10023 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
10024 _core_.Window_swigregister(Window)
10025
10026 def PreWindow(*args, **kwargs):
10027 """
10028 PreWindow() -> Window
10029
10030 Precreate a Window for 2-phase creation.
10031 """
10032 val = _core_.new_PreWindow(*args, **kwargs)
10033 return val
10034
10035 def Window_NewControlId(*args):
10036 """
10037 Window_NewControlId() -> int
10038
10039 Generate a control id for the controls which were not given one.
10040 """
10041 return _core_.Window_NewControlId(*args)
10042
10043 def Window_NextControlId(*args, **kwargs):
10044 """
10045 Window_NextControlId(int winid) -> int
10046
10047 Get the id of the control following the one with the given
10048 autogenerated) id
10049 """
10050 return _core_.Window_NextControlId(*args, **kwargs)
10051
10052 def Window_PrevControlId(*args, **kwargs):
10053 """
10054 Window_PrevControlId(int winid) -> int
10055
10056 Get the id of the control preceding the one with the given
10057 autogenerated) id
10058 """
10059 return _core_.Window_PrevControlId(*args, **kwargs)
10060
10061 def Window_FindFocus(*args):
10062 """
10063 Window_FindFocus() -> Window
10064
10065 Returns the window or control that currently has the keyboard focus,
10066 or None.
10067 """
10068 return _core_.Window_FindFocus(*args)
10069
10070 def Window_GetCapture(*args):
10071 """
10072 Window_GetCapture() -> Window
10073
10074 Returns the window which currently captures the mouse or None
10075 """
10076 return _core_.Window_GetCapture(*args)
10077
10078 def Window_GetClassDefaultAttributes(*args, **kwargs):
10079 """
10080 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10081
10082 Get the default attributes for this class. This is useful if you want
10083 to use the same font or colour in your own control as in a standard
10084 control -- which is a much better idea than hard coding specific
10085 colours or fonts which might look completely out of place on the
10086 user's system, especially if it uses themes.
10087
10088 The variant parameter is only relevant under Mac currently and is
10089 ignore under other platforms. Under Mac, it will change the size of
10090 the returned font. See `wx.Window.SetWindowVariant` for more about
10091 this.
10092 """
10093 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10094
10095 def DLG_PNT(win, point_or_x, y=None):
10096 """
10097 Convenience function for converting a Point or (x,y) in
10098 dialog units to pixel units.
10099 """
10100 if y is None:
10101 return win.ConvertDialogPointToPixels(point_or_x)
10102 else:
10103 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10104
10105 def DLG_SZE(win, size_width, height=None):
10106 """
10107 Convenience function for converting a Size or (w,h) in
10108 dialog units to pixel units.
10109 """
10110 if height is None:
10111 return win.ConvertDialogSizeToPixels(size_width)
10112 else:
10113 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10114
10115
10116 def FindWindowById(*args, **kwargs):
10117 """
10118 FindWindowById(long id, Window parent=None) -> Window
10119
10120 Find the first window in the application with the given id. If parent
10121 is None, the search will start from all top-level frames and dialog
10122 boxes; if non-None, the search will be limited to the given window
10123 hierarchy. The search is recursive in both cases.
10124 """
10125 return _core_.FindWindowById(*args, **kwargs)
10126
10127 def FindWindowByName(*args, **kwargs):
10128 """
10129 FindWindowByName(String name, Window parent=None) -> Window
10130
10131 Find a window by its name (as given in a window constructor or Create
10132 function call). If parent is None, the search will start from all
10133 top-level frames and dialog boxes; if non-None, the search will be
10134 limited to the given window hierarchy. The search is recursive in both
10135 cases.
10136
10137 If no window with such name is found, wx.FindWindowByLabel is called.
10138 """
10139 return _core_.FindWindowByName(*args, **kwargs)
10140
10141 def FindWindowByLabel(*args, **kwargs):
10142 """
10143 FindWindowByLabel(String label, Window parent=None) -> Window
10144
10145 Find a window by its label. Depending on the type of window, the label
10146 may be a window title or panel item label. If parent is None, the
10147 search will start from all top-level frames and dialog boxes; if
10148 non-None, the search will be limited to the given window
10149 hierarchy. The search is recursive in both cases.
10150 """
10151 return _core_.FindWindowByLabel(*args, **kwargs)
10152
10153 def Window_FromHWND(*args, **kwargs):
10154 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10155 return _core_.Window_FromHWND(*args, **kwargs)
10156
10157 def GetTopLevelWindows(*args):
10158 """
10159 GetTopLevelWindows() -> PyObject
10160
10161 Returns a list of the the application's top-level windows, (frames,
10162 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10163 by wxWidgets, and so it is only valid as long as no top-level windows
10164 are closed or new top-level windows are created.
10165
10166 """
10167 return _core_.GetTopLevelWindows(*args)
10168 #---------------------------------------------------------------------------
10169
10170 class Validator(EvtHandler):
10171 """Proxy of C++ Validator class"""
10172 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10173 __repr__ = _swig_repr
10174 def __init__(self, *args, **kwargs):
10175 """__init__(self) -> Validator"""
10176 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10177 self._setOORInfo(self)
10178
10179 def Clone(*args, **kwargs):
10180 """Clone(self) -> Validator"""
10181 return _core_.Validator_Clone(*args, **kwargs)
10182
10183 def Validate(*args, **kwargs):
10184 """Validate(self, Window parent) -> bool"""
10185 return _core_.Validator_Validate(*args, **kwargs)
10186
10187 def TransferToWindow(*args, **kwargs):
10188 """TransferToWindow(self) -> bool"""
10189 return _core_.Validator_TransferToWindow(*args, **kwargs)
10190
10191 def TransferFromWindow(*args, **kwargs):
10192 """TransferFromWindow(self) -> bool"""
10193 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10194
10195 def GetWindow(*args, **kwargs):
10196 """GetWindow(self) -> Window"""
10197 return _core_.Validator_GetWindow(*args, **kwargs)
10198
10199 def SetWindow(*args, **kwargs):
10200 """SetWindow(self, Window window)"""
10201 return _core_.Validator_SetWindow(*args, **kwargs)
10202
10203 def IsSilent(*args, **kwargs):
10204 """IsSilent() -> bool"""
10205 return _core_.Validator_IsSilent(*args, **kwargs)
10206
10207 IsSilent = staticmethod(IsSilent)
10208 def SetBellOnError(*args, **kwargs):
10209 """SetBellOnError(int doIt=True)"""
10210 return _core_.Validator_SetBellOnError(*args, **kwargs)
10211
10212 SetBellOnError = staticmethod(SetBellOnError)
10213 _core_.Validator_swigregister(Validator)
10214
10215 def Validator_IsSilent(*args):
10216 """Validator_IsSilent() -> bool"""
10217 return _core_.Validator_IsSilent(*args)
10218
10219 def Validator_SetBellOnError(*args, **kwargs):
10220 """Validator_SetBellOnError(int doIt=True)"""
10221 return _core_.Validator_SetBellOnError(*args, **kwargs)
10222
10223 class PyValidator(Validator):
10224 """Proxy of C++ PyValidator class"""
10225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10226 __repr__ = _swig_repr
10227 def __init__(self, *args, **kwargs):
10228 """__init__(self) -> PyValidator"""
10229 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10230
10231 self._setCallbackInfo(self, PyValidator, 1)
10232 self._setOORInfo(self)
10233
10234 def _setCallbackInfo(*args, **kwargs):
10235 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10236 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10237
10238 _core_.PyValidator_swigregister(PyValidator)
10239
10240 #---------------------------------------------------------------------------
10241
10242 class Menu(EvtHandler):
10243 """Proxy of C++ Menu class"""
10244 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10245 __repr__ = _swig_repr
10246 def __init__(self, *args, **kwargs):
10247 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10248 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10249 self._setOORInfo(self)
10250
10251 def Append(*args, **kwargs):
10252 """
10253 Append(self, int id, String text=EmptyString, String help=EmptyString,
10254 int kind=ITEM_NORMAL) -> MenuItem
10255 """
10256 return _core_.Menu_Append(*args, **kwargs)
10257
10258 def AppendSeparator(*args, **kwargs):
10259 """AppendSeparator(self) -> MenuItem"""
10260 return _core_.Menu_AppendSeparator(*args, **kwargs)
10261
10262 def AppendCheckItem(*args, **kwargs):
10263 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10264 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10265
10266 def AppendRadioItem(*args, **kwargs):
10267 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10268 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10269
10270 def AppendMenu(*args, **kwargs):
10271 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10272 return _core_.Menu_AppendMenu(*args, **kwargs)
10273
10274 def AppendSubMenu(*args, **kwargs):
10275 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10276 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10277
10278 def AppendItem(*args, **kwargs):
10279 """AppendItem(self, MenuItem item) -> MenuItem"""
10280 return _core_.Menu_AppendItem(*args, **kwargs)
10281
10282 def InsertItem(*args, **kwargs):
10283 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10284 return _core_.Menu_InsertItem(*args, **kwargs)
10285
10286 def PrependItem(*args, **kwargs):
10287 """PrependItem(self, MenuItem item) -> MenuItem"""
10288 return _core_.Menu_PrependItem(*args, **kwargs)
10289
10290 def Break(*args, **kwargs):
10291 """Break(self)"""
10292 return _core_.Menu_Break(*args, **kwargs)
10293
10294 def Insert(*args, **kwargs):
10295 """
10296 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10297 int kind=ITEM_NORMAL) -> MenuItem
10298 """
10299 return _core_.Menu_Insert(*args, **kwargs)
10300
10301 def InsertSeparator(*args, **kwargs):
10302 """InsertSeparator(self, size_t pos) -> MenuItem"""
10303 return _core_.Menu_InsertSeparator(*args, **kwargs)
10304
10305 def InsertCheckItem(*args, **kwargs):
10306 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10307 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10308
10309 def InsertRadioItem(*args, **kwargs):
10310 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10311 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10312
10313 def InsertMenu(*args, **kwargs):
10314 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10315 return _core_.Menu_InsertMenu(*args, **kwargs)
10316
10317 def Prepend(*args, **kwargs):
10318 """
10319 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10320 int kind=ITEM_NORMAL) -> MenuItem
10321 """
10322 return _core_.Menu_Prepend(*args, **kwargs)
10323
10324 def PrependSeparator(*args, **kwargs):
10325 """PrependSeparator(self) -> MenuItem"""
10326 return _core_.Menu_PrependSeparator(*args, **kwargs)
10327
10328 def PrependCheckItem(*args, **kwargs):
10329 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10330 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10331
10332 def PrependRadioItem(*args, **kwargs):
10333 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10334 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10335
10336 def PrependMenu(*args, **kwargs):
10337 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10338 return _core_.Menu_PrependMenu(*args, **kwargs)
10339
10340 def Remove(*args, **kwargs):
10341 """Remove(self, int id) -> MenuItem"""
10342 return _core_.Menu_Remove(*args, **kwargs)
10343
10344 def RemoveItem(*args, **kwargs):
10345 """RemoveItem(self, MenuItem item) -> MenuItem"""
10346 return _core_.Menu_RemoveItem(*args, **kwargs)
10347
10348 def Delete(*args, **kwargs):
10349 """Delete(self, int id) -> bool"""
10350 return _core_.Menu_Delete(*args, **kwargs)
10351
10352 def DeleteItem(*args, **kwargs):
10353 """DeleteItem(self, MenuItem item) -> bool"""
10354 return _core_.Menu_DeleteItem(*args, **kwargs)
10355
10356 def Destroy(*args, **kwargs):
10357 """
10358 Destroy(self)
10359
10360 Deletes the C++ object this Python object is a proxy for.
10361 """
10362 val = _core_.Menu_Destroy(*args, **kwargs)
10363 args[0].thisown = 0
10364 return val
10365
10366 def DestroyId(*args, **kwargs):
10367 """
10368 DestroyId(self, int id) -> bool
10369
10370 Deletes the C++ object this Python object is a proxy for.
10371 """
10372 val = _core_.Menu_DestroyId(*args, **kwargs)
10373 args[0].thisown = 0
10374 return val
10375
10376 def DestroyItem(*args, **kwargs):
10377 """
10378 DestroyItem(self, MenuItem item) -> bool
10379
10380 Deletes the C++ object this Python object is a proxy for.
10381 """
10382 val = _core_.Menu_DestroyItem(*args, **kwargs)
10383 args[0].thisown = 0
10384 return val
10385
10386 def GetMenuItemCount(*args, **kwargs):
10387 """GetMenuItemCount(self) -> size_t"""
10388 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10389
10390 def GetMenuItems(*args, **kwargs):
10391 """GetMenuItems(self) -> PyObject"""
10392 return _core_.Menu_GetMenuItems(*args, **kwargs)
10393
10394 def FindItem(*args, **kwargs):
10395 """FindItem(self, String item) -> int"""
10396 return _core_.Menu_FindItem(*args, **kwargs)
10397
10398 def FindItemById(*args, **kwargs):
10399 """FindItemById(self, int id) -> MenuItem"""
10400 return _core_.Menu_FindItemById(*args, **kwargs)
10401
10402 def FindItemByPosition(*args, **kwargs):
10403 """FindItemByPosition(self, size_t position) -> MenuItem"""
10404 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10405
10406 def Enable(*args, **kwargs):
10407 """Enable(self, int id, bool enable)"""
10408 return _core_.Menu_Enable(*args, **kwargs)
10409
10410 def IsEnabled(*args, **kwargs):
10411 """IsEnabled(self, int id) -> bool"""
10412 return _core_.Menu_IsEnabled(*args, **kwargs)
10413
10414 def Check(*args, **kwargs):
10415 """Check(self, int id, bool check)"""
10416 return _core_.Menu_Check(*args, **kwargs)
10417
10418 def IsChecked(*args, **kwargs):
10419 """IsChecked(self, int id) -> bool"""
10420 return _core_.Menu_IsChecked(*args, **kwargs)
10421
10422 def SetLabel(*args, **kwargs):
10423 """SetLabel(self, int id, String label)"""
10424 return _core_.Menu_SetLabel(*args, **kwargs)
10425
10426 def GetLabel(*args, **kwargs):
10427 """GetLabel(self, int id) -> String"""
10428 return _core_.Menu_GetLabel(*args, **kwargs)
10429
10430 def SetHelpString(*args, **kwargs):
10431 """SetHelpString(self, int id, String helpString)"""
10432 return _core_.Menu_SetHelpString(*args, **kwargs)
10433
10434 def GetHelpString(*args, **kwargs):
10435 """GetHelpString(self, int id) -> String"""
10436 return _core_.Menu_GetHelpString(*args, **kwargs)
10437
10438 def SetTitle(*args, **kwargs):
10439 """SetTitle(self, String title)"""
10440 return _core_.Menu_SetTitle(*args, **kwargs)
10441
10442 def GetTitle(*args, **kwargs):
10443 """GetTitle(self) -> String"""
10444 return _core_.Menu_GetTitle(*args, **kwargs)
10445
10446 def SetEventHandler(*args, **kwargs):
10447 """SetEventHandler(self, EvtHandler handler)"""
10448 return _core_.Menu_SetEventHandler(*args, **kwargs)
10449
10450 def GetEventHandler(*args, **kwargs):
10451 """GetEventHandler(self) -> EvtHandler"""
10452 return _core_.Menu_GetEventHandler(*args, **kwargs)
10453
10454 def SetInvokingWindow(*args, **kwargs):
10455 """SetInvokingWindow(self, Window win)"""
10456 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10457
10458 def GetInvokingWindow(*args, **kwargs):
10459 """GetInvokingWindow(self) -> Window"""
10460 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10461
10462 def GetStyle(*args, **kwargs):
10463 """GetStyle(self) -> long"""
10464 return _core_.Menu_GetStyle(*args, **kwargs)
10465
10466 def UpdateUI(*args, **kwargs):
10467 """UpdateUI(self, EvtHandler source=None)"""
10468 return _core_.Menu_UpdateUI(*args, **kwargs)
10469
10470 def GetMenuBar(*args, **kwargs):
10471 """GetMenuBar(self) -> MenuBar"""
10472 return _core_.Menu_GetMenuBar(*args, **kwargs)
10473
10474 def Attach(*args, **kwargs):
10475 """Attach(self, wxMenuBarBase menubar)"""
10476 return _core_.Menu_Attach(*args, **kwargs)
10477
10478 def Detach(*args, **kwargs):
10479 """Detach(self)"""
10480 return _core_.Menu_Detach(*args, **kwargs)
10481
10482 def IsAttached(*args, **kwargs):
10483 """IsAttached(self) -> bool"""
10484 return _core_.Menu_IsAttached(*args, **kwargs)
10485
10486 def SetParent(*args, **kwargs):
10487 """SetParent(self, Menu parent)"""
10488 return _core_.Menu_SetParent(*args, **kwargs)
10489
10490 def GetParent(*args, **kwargs):
10491 """GetParent(self) -> Menu"""
10492 return _core_.Menu_GetParent(*args, **kwargs)
10493
10494 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10495 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10496 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10497 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10498 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10499 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10500 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10501 Style = property(GetStyle,doc="See `GetStyle`")
10502 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
10503 _core_.Menu_swigregister(Menu)
10504 DefaultValidator = cvar.DefaultValidator
10505
10506 #---------------------------------------------------------------------------
10507
10508 class MenuBar(Window):
10509 """Proxy of C++ MenuBar class"""
10510 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10511 __repr__ = _swig_repr
10512 def __init__(self, *args, **kwargs):
10513 """__init__(self, long style=0) -> MenuBar"""
10514 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10515 self._setOORInfo(self)
10516
10517 def Append(*args, **kwargs):
10518 """Append(self, Menu menu, String title) -> bool"""
10519 return _core_.MenuBar_Append(*args, **kwargs)
10520
10521 def Insert(*args, **kwargs):
10522 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10523 return _core_.MenuBar_Insert(*args, **kwargs)
10524
10525 def GetMenuCount(*args, **kwargs):
10526 """GetMenuCount(self) -> size_t"""
10527 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10528
10529 def GetMenu(*args, **kwargs):
10530 """GetMenu(self, size_t pos) -> Menu"""
10531 return _core_.MenuBar_GetMenu(*args, **kwargs)
10532
10533 def Replace(*args, **kwargs):
10534 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10535 return _core_.MenuBar_Replace(*args, **kwargs)
10536
10537 def Remove(*args, **kwargs):
10538 """Remove(self, size_t pos) -> Menu"""
10539 return _core_.MenuBar_Remove(*args, **kwargs)
10540
10541 def EnableTop(*args, **kwargs):
10542 """EnableTop(self, size_t pos, bool enable)"""
10543 return _core_.MenuBar_EnableTop(*args, **kwargs)
10544
10545 def IsEnabledTop(*args, **kwargs):
10546 """IsEnabledTop(self, size_t pos) -> bool"""
10547 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10548
10549 def SetLabelTop(*args, **kwargs):
10550 """SetLabelTop(self, size_t pos, String label)"""
10551 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10552
10553 def GetLabelTop(*args, **kwargs):
10554 """GetLabelTop(self, size_t pos) -> String"""
10555 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10556
10557 def FindMenuItem(*args, **kwargs):
10558 """FindMenuItem(self, String menu, String item) -> int"""
10559 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10560
10561 def FindItemById(*args, **kwargs):
10562 """FindItemById(self, int id) -> MenuItem"""
10563 return _core_.MenuBar_FindItemById(*args, **kwargs)
10564
10565 def FindMenu(*args, **kwargs):
10566 """FindMenu(self, String title) -> int"""
10567 return _core_.MenuBar_FindMenu(*args, **kwargs)
10568
10569 def Enable(*args, **kwargs):
10570 """Enable(self, int id, bool enable)"""
10571 return _core_.MenuBar_Enable(*args, **kwargs)
10572
10573 def Check(*args, **kwargs):
10574 """Check(self, int id, bool check)"""
10575 return _core_.MenuBar_Check(*args, **kwargs)
10576
10577 def IsChecked(*args, **kwargs):
10578 """IsChecked(self, int id) -> bool"""
10579 return _core_.MenuBar_IsChecked(*args, **kwargs)
10580
10581 def IsEnabled(*args, **kwargs):
10582 """IsEnabled(self, int id) -> bool"""
10583 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10584
10585 def SetLabel(*args, **kwargs):
10586 """SetLabel(self, int id, String label)"""
10587 return _core_.MenuBar_SetLabel(*args, **kwargs)
10588
10589 def GetLabel(*args, **kwargs):
10590 """GetLabel(self, int id) -> String"""
10591 return _core_.MenuBar_GetLabel(*args, **kwargs)
10592
10593 def SetHelpString(*args, **kwargs):
10594 """SetHelpString(self, int id, String helpString)"""
10595 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10596
10597 def GetHelpString(*args, **kwargs):
10598 """GetHelpString(self, int id) -> String"""
10599 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10600
10601 def GetFrame(*args, **kwargs):
10602 """GetFrame(self) -> wxFrame"""
10603 return _core_.MenuBar_GetFrame(*args, **kwargs)
10604
10605 def IsAttached(*args, **kwargs):
10606 """IsAttached(self) -> bool"""
10607 return _core_.MenuBar_IsAttached(*args, **kwargs)
10608
10609 def Attach(*args, **kwargs):
10610 """Attach(self, wxFrame frame)"""
10611 return _core_.MenuBar_Attach(*args, **kwargs)
10612
10613 def Detach(*args, **kwargs):
10614 """Detach(self)"""
10615 return _core_.MenuBar_Detach(*args, **kwargs)
10616
10617 def UpdateMenus(*args, **kwargs):
10618 """UpdateMenus(self)"""
10619 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10620
10621 def SetAutoWindowMenu(*args, **kwargs):
10622 """SetAutoWindowMenu(bool enable)"""
10623 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10624
10625 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10626 def GetAutoWindowMenu(*args, **kwargs):
10627 """GetAutoWindowMenu() -> bool"""
10628 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10629
10630 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10631 def GetMenus(self):
10632 """Return a list of (menu, label) items for the menus in the MenuBar. """
10633 return [(self.GetMenu(i), self.GetLabelTop(i))
10634 for i in range(self.GetMenuCount())]
10635
10636 def SetMenus(self, items):
10637 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10638 for i in range(self.GetMenuCount()-1, -1, -1):
10639 self.Remove(i)
10640 for m, l in items:
10641 self.Append(m, l)
10642
10643 Frame = property(GetFrame,doc="See `GetFrame`")
10644 Menu = property(GetMenu,doc="See `GetMenu`")
10645 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10646 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
10647 _core_.MenuBar_swigregister(MenuBar)
10648
10649 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10650 """MenuBar_SetAutoWindowMenu(bool enable)"""
10651 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10652
10653 def MenuBar_GetAutoWindowMenu(*args):
10654 """MenuBar_GetAutoWindowMenu() -> bool"""
10655 return _core_.MenuBar_GetAutoWindowMenu(*args)
10656
10657 #---------------------------------------------------------------------------
10658
10659 class MenuItem(Object):
10660 """Proxy of C++ MenuItem class"""
10661 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10662 __repr__ = _swig_repr
10663 def __init__(self, *args, **kwargs):
10664 """
10665 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10666 String help=EmptyString, int kind=ITEM_NORMAL,
10667 Menu subMenu=None) -> MenuItem
10668 """
10669 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10670 __swig_destroy__ = _core_.delete_MenuItem
10671 __del__ = lambda self : None;
10672 def GetMenu(*args, **kwargs):
10673 """GetMenu(self) -> Menu"""
10674 return _core_.MenuItem_GetMenu(*args, **kwargs)
10675
10676 def SetMenu(*args, **kwargs):
10677 """SetMenu(self, Menu menu)"""
10678 return _core_.MenuItem_SetMenu(*args, **kwargs)
10679
10680 def SetId(*args, **kwargs):
10681 """SetId(self, int id)"""
10682 return _core_.MenuItem_SetId(*args, **kwargs)
10683
10684 def GetId(*args, **kwargs):
10685 """GetId(self) -> int"""
10686 return _core_.MenuItem_GetId(*args, **kwargs)
10687
10688 def IsSeparator(*args, **kwargs):
10689 """IsSeparator(self) -> bool"""
10690 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10691
10692 def SetText(*args, **kwargs):
10693 """SetText(self, String str)"""
10694 return _core_.MenuItem_SetText(*args, **kwargs)
10695
10696 def GetLabel(*args, **kwargs):
10697 """GetLabel(self) -> String"""
10698 return _core_.MenuItem_GetLabel(*args, **kwargs)
10699
10700 def GetText(*args, **kwargs):
10701 """GetText(self) -> String"""
10702 return _core_.MenuItem_GetText(*args, **kwargs)
10703
10704 def GetLabelFromText(*args, **kwargs):
10705 """GetLabelFromText(String text) -> String"""
10706 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10707
10708 GetLabelFromText = staticmethod(GetLabelFromText)
10709 def GetKind(*args, **kwargs):
10710 """GetKind(self) -> int"""
10711 return _core_.MenuItem_GetKind(*args, **kwargs)
10712
10713 def SetKind(*args, **kwargs):
10714 """SetKind(self, int kind)"""
10715 return _core_.MenuItem_SetKind(*args, **kwargs)
10716
10717 def SetCheckable(*args, **kwargs):
10718 """SetCheckable(self, bool checkable)"""
10719 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10720
10721 def IsCheckable(*args, **kwargs):
10722 """IsCheckable(self) -> bool"""
10723 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10724
10725 def IsSubMenu(*args, **kwargs):
10726 """IsSubMenu(self) -> bool"""
10727 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10728
10729 def SetSubMenu(*args, **kwargs):
10730 """SetSubMenu(self, Menu menu)"""
10731 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10732
10733 def GetSubMenu(*args, **kwargs):
10734 """GetSubMenu(self) -> Menu"""
10735 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10736
10737 def Enable(*args, **kwargs):
10738 """Enable(self, bool enable=True)"""
10739 return _core_.MenuItem_Enable(*args, **kwargs)
10740
10741 def IsEnabled(*args, **kwargs):
10742 """IsEnabled(self) -> bool"""
10743 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10744
10745 def Check(*args, **kwargs):
10746 """Check(self, bool check=True)"""
10747 return _core_.MenuItem_Check(*args, **kwargs)
10748
10749 def IsChecked(*args, **kwargs):
10750 """IsChecked(self) -> bool"""
10751 return _core_.MenuItem_IsChecked(*args, **kwargs)
10752
10753 def Toggle(*args, **kwargs):
10754 """Toggle(self)"""
10755 return _core_.MenuItem_Toggle(*args, **kwargs)
10756
10757 def SetHelp(*args, **kwargs):
10758 """SetHelp(self, String str)"""
10759 return _core_.MenuItem_SetHelp(*args, **kwargs)
10760
10761 def GetHelp(*args, **kwargs):
10762 """GetHelp(self) -> String"""
10763 return _core_.MenuItem_GetHelp(*args, **kwargs)
10764
10765 def GetAccel(*args, **kwargs):
10766 """GetAccel(self) -> AcceleratorEntry"""
10767 return _core_.MenuItem_GetAccel(*args, **kwargs)
10768
10769 def SetAccel(*args, **kwargs):
10770 """SetAccel(self, AcceleratorEntry accel)"""
10771 return _core_.MenuItem_SetAccel(*args, **kwargs)
10772
10773 def SetBitmap(*args, **kwargs):
10774 """SetBitmap(self, Bitmap bitmap)"""
10775 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10776
10777 def GetBitmap(*args, **kwargs):
10778 """GetBitmap(self) -> Bitmap"""
10779 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10780
10781 def SetFont(*args, **kwargs):
10782 """SetFont(self, Font font)"""
10783 return _core_.MenuItem_SetFont(*args, **kwargs)
10784
10785 def GetFont(*args, **kwargs):
10786 """GetFont(self) -> Font"""
10787 return _core_.MenuItem_GetFont(*args, **kwargs)
10788
10789 def SetTextColour(*args, **kwargs):
10790 """SetTextColour(self, Colour colText)"""
10791 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10792
10793 def GetTextColour(*args, **kwargs):
10794 """GetTextColour(self) -> Colour"""
10795 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10796
10797 def SetBackgroundColour(*args, **kwargs):
10798 """SetBackgroundColour(self, Colour colBack)"""
10799 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10800
10801 def GetBackgroundColour(*args, **kwargs):
10802 """GetBackgroundColour(self) -> Colour"""
10803 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10804
10805 def SetBitmaps(*args, **kwargs):
10806 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10807 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10808
10809 def SetDisabledBitmap(*args, **kwargs):
10810 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10811 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10812
10813 def GetDisabledBitmap(*args, **kwargs):
10814 """GetDisabledBitmap(self) -> Bitmap"""
10815 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10816
10817 def SetMarginWidth(*args, **kwargs):
10818 """SetMarginWidth(self, int nWidth)"""
10819 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10820
10821 def GetMarginWidth(*args, **kwargs):
10822 """GetMarginWidth(self) -> int"""
10823 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10824
10825 def GetDefaultMarginWidth(*args, **kwargs):
10826 """GetDefaultMarginWidth() -> int"""
10827 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10828
10829 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10830 def IsOwnerDrawn(*args, **kwargs):
10831 """IsOwnerDrawn(self) -> bool"""
10832 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10833
10834 def SetOwnerDrawn(*args, **kwargs):
10835 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10836 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10837
10838 def ResetOwnerDrawn(*args, **kwargs):
10839 """ResetOwnerDrawn(self)"""
10840 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10841
10842 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10843 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10844 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10845 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10846 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10847 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10848 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10849 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10850 Label = property(GetLabel,doc="See `GetLabel`")
10851 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10852 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10853 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10854 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10855 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
10856 _core_.MenuItem_swigregister(MenuItem)
10857
10858 def MenuItem_GetLabelFromText(*args, **kwargs):
10859 """MenuItem_GetLabelFromText(String text) -> String"""
10860 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10861
10862 def MenuItem_GetDefaultMarginWidth(*args):
10863 """MenuItem_GetDefaultMarginWidth() -> int"""
10864 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10865
10866 #---------------------------------------------------------------------------
10867
10868 class Control(Window):
10869 """
10870 This is the base class for a control or 'widget'.
10871
10872 A control is generally a small window which processes user input
10873 and/or displays one or more item of data.
10874 """
10875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10876 __repr__ = _swig_repr
10877 def __init__(self, *args, **kwargs):
10878 """
10879 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10880 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10881 String name=ControlNameStr) -> Control
10882
10883 Create a Control. Normally you should only call this from a subclass'
10884 __init__ as a plain old wx.Control is not very useful.
10885 """
10886 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10887 self._setOORInfo(self)
10888
10889 def Create(*args, **kwargs):
10890 """
10891 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10892 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10893 String name=ControlNameStr) -> bool
10894
10895 Do the 2nd phase and create the GUI control.
10896 """
10897 return _core_.Control_Create(*args, **kwargs)
10898
10899 def GetAlignment(*args, **kwargs):
10900 """
10901 GetAlignment(self) -> int
10902
10903 Get the control alignment (left/right/centre, top/bottom/centre)
10904 """
10905 return _core_.Control_GetAlignment(*args, **kwargs)
10906
10907 def GetLabelText(*args, **kwargs):
10908 """
10909 GetLabelText(self) -> String
10910
10911 Get just the text of the label, without mnemonic characters ('&')
10912 """
10913 return _core_.Control_GetLabelText(*args, **kwargs)
10914
10915 def Command(*args, **kwargs):
10916 """
10917 Command(self, CommandEvent event)
10918
10919 Simulates the effect of the user issuing a command to the item.
10920
10921 :see: `wx.CommandEvent`
10922
10923 """
10924 return _core_.Control_Command(*args, **kwargs)
10925
10926 def GetLabel(*args, **kwargs):
10927 """
10928 GetLabel(self) -> String
10929
10930 Return a control's text.
10931 """
10932 return _core_.Control_GetLabel(*args, **kwargs)
10933
10934 def GetClassDefaultAttributes(*args, **kwargs):
10935 """
10936 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10937
10938 Get the default attributes for this class. This is useful if you want
10939 to use the same font or colour in your own control as in a standard
10940 control -- which is a much better idea than hard coding specific
10941 colours or fonts which might look completely out of place on the
10942 user's system, especially if it uses themes.
10943
10944 The variant parameter is only relevant under Mac currently and is
10945 ignore under other platforms. Under Mac, it will change the size of
10946 the returned font. See `wx.Window.SetWindowVariant` for more about
10947 this.
10948 """
10949 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10950
10951 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10952 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10953 Label = property(GetLabel,doc="See `GetLabel`")
10954 LabelText = property(GetLabelText,doc="See `GetLabelText`")
10955 _core_.Control_swigregister(Control)
10956 ControlNameStr = cvar.ControlNameStr
10957
10958 def PreControl(*args, **kwargs):
10959 """
10960 PreControl() -> Control
10961
10962 Precreate a Control control for 2-phase creation
10963 """
10964 val = _core_.new_PreControl(*args, **kwargs)
10965 return val
10966
10967 def Control_GetClassDefaultAttributes(*args, **kwargs):
10968 """
10969 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10970
10971 Get the default attributes for this class. This is useful if you want
10972 to use the same font or colour in your own control as in a standard
10973 control -- which is a much better idea than hard coding specific
10974 colours or fonts which might look completely out of place on the
10975 user's system, especially if it uses themes.
10976
10977 The variant parameter is only relevant under Mac currently and is
10978 ignore under other platforms. Under Mac, it will change the size of
10979 the returned font. See `wx.Window.SetWindowVariant` for more about
10980 this.
10981 """
10982 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10983
10984 #---------------------------------------------------------------------------
10985
10986 class ItemContainer(object):
10987 """
10988 The wx.ItemContainer class defines an interface which is implemented
10989 by all controls which have string subitems, each of which may be
10990 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10991 as `wx.ComboBox` which implements an extended interface deriving from
10992 this one.
10993
10994 It defines the methods for accessing the control's items and although
10995 each of the derived classes implements them differently, they still
10996 all conform to the same interface.
10997
10998 The items in a wx.ItemContainer have (non empty) string labels and,
10999 optionally, client data associated with them.
11000
11001 """
11002 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11003 def __init__(self): raise AttributeError, "No constructor defined"
11004 __repr__ = _swig_repr
11005 def Append(*args, **kwargs):
11006 """
11007 Append(self, String item, PyObject clientData=None) -> int
11008
11009 Adds the item to the control, associating the given data with the item
11010 if not None. The return value is the index of the newly added item
11011 which may be different from the last one if the control is sorted (e.g.
11012 has wx.LB_SORT or wx.CB_SORT style).
11013 """
11014 return _core_.ItemContainer_Append(*args, **kwargs)
11015
11016 def AppendItems(*args, **kwargs):
11017 """
11018 AppendItems(self, List strings)
11019
11020 Apend several items at once to the control. Notice that calling this
11021 method may be much faster than appending the items one by one if you
11022 need to add a lot of items.
11023 """
11024 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11025
11026 def Insert(*args, **kwargs):
11027 """
11028 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
11029
11030 Insert an item into the control before the item at the ``pos`` index,
11031 optionally associating some data object with the item.
11032 """
11033 return _core_.ItemContainer_Insert(*args, **kwargs)
11034
11035 def Clear(*args, **kwargs):
11036 """
11037 Clear(self)
11038
11039 Removes all items from the control.
11040 """
11041 return _core_.ItemContainer_Clear(*args, **kwargs)
11042
11043 def Delete(*args, **kwargs):
11044 """
11045 Delete(self, unsigned int n)
11046
11047 Deletes the item at the zero-based index 'n' from the control. Note
11048 that it is an error (signalled by a `wx.PyAssertionError` exception if
11049 enabled) to remove an item with the index negative or greater or equal
11050 than the number of items in the control.
11051 """
11052 return _core_.ItemContainer_Delete(*args, **kwargs)
11053
11054 def GetClientData(*args, **kwargs):
11055 """
11056 GetClientData(self, unsigned int n) -> PyObject
11057
11058 Returns the client data associated with the given item, (if any.)
11059 """
11060 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11061
11062 def SetClientData(*args, **kwargs):
11063 """
11064 SetClientData(self, unsigned int n, PyObject clientData)
11065
11066 Associate the given client data with the item at position n.
11067 """
11068 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11069
11070 def GetCount(*args, **kwargs):
11071 """
11072 GetCount(self) -> unsigned int
11073
11074 Returns the number of items in the control.
11075 """
11076 return _core_.ItemContainer_GetCount(*args, **kwargs)
11077
11078 def IsEmpty(*args, **kwargs):
11079 """
11080 IsEmpty(self) -> bool
11081
11082 Returns True if the control is empty or False if it has some items.
11083 """
11084 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11085
11086 def GetString(*args, **kwargs):
11087 """
11088 GetString(self, unsigned int n) -> String
11089
11090 Returns the label of the item with the given index.
11091 """
11092 return _core_.ItemContainer_GetString(*args, **kwargs)
11093
11094 def GetStrings(*args, **kwargs):
11095 """GetStrings(self) -> wxArrayString"""
11096 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11097
11098 def SetString(*args, **kwargs):
11099 """
11100 SetString(self, unsigned int n, String s)
11101
11102 Sets the label for the given item.
11103 """
11104 return _core_.ItemContainer_SetString(*args, **kwargs)
11105
11106 def FindString(*args, **kwargs):
11107 """
11108 FindString(self, String s) -> int
11109
11110 Finds an item whose label matches the given string. Returns the
11111 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11112 found.
11113 """
11114 return _core_.ItemContainer_FindString(*args, **kwargs)
11115
11116 def SetSelection(*args, **kwargs):
11117 """
11118 SetSelection(self, int n)
11119
11120 Sets the item at index 'n' to be the selected item.
11121 """
11122 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11123
11124 def GetSelection(*args, **kwargs):
11125 """
11126 GetSelection(self) -> int
11127
11128 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11129 is selected.
11130 """
11131 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11132
11133 def SetStringSelection(*args, **kwargs):
11134 """SetStringSelection(self, String s) -> bool"""
11135 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11136
11137 def GetStringSelection(*args, **kwargs):
11138 """
11139 GetStringSelection(self) -> String
11140
11141 Returns the label of the selected item or an empty string if no item
11142 is selected.
11143 """
11144 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11145
11146 def Select(*args, **kwargs):
11147 """
11148 Select(self, int n)
11149
11150 This is the same as `SetSelection` and exists only because it is
11151 slightly more natural for controls which support multiple selection.
11152 """
11153 return _core_.ItemContainer_Select(*args, **kwargs)
11154
11155 def GetItems(self):
11156 """Return a list of the strings in the control"""
11157 return [self.GetString(i) for i in xrange(self.GetCount())]
11158
11159 def SetItems(self, items):
11160 """Clear and set the strings in the control from a list"""
11161 self.Clear()
11162 for i in items:
11163 self.Append(i)
11164
11165 Count = property(GetCount,doc="See `GetCount`")
11166 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11167 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11168 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11169 Strings = property(GetStrings,doc="See `GetStrings`")
11170 _core_.ItemContainer_swigregister(ItemContainer)
11171
11172 #---------------------------------------------------------------------------
11173
11174 class ControlWithItems(Control,ItemContainer):
11175 """
11176 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11177 wx.Control class, and is used for the base class of various controls
11178 that have items.
11179 """
11180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11181 def __init__(self): raise AttributeError, "No constructor defined"
11182 __repr__ = _swig_repr
11183 _core_.ControlWithItems_swigregister(ControlWithItems)
11184
11185 #---------------------------------------------------------------------------
11186
11187 class SizerItem(Object):
11188 """
11189 The wx.SizerItem class is used to track the position, size and other
11190 attributes of each item managed by a `wx.Sizer`. It is not usually
11191 necessary to use this class because the sizer elements can also be
11192 identified by their positions or window or sizer references but
11193 sometimes it may be more convenient to use wx.SizerItem directly.
11194 Also, custom classes derived from `wx.PySizer` will probably need to
11195 use the collection of wx.SizerItems held by wx.Sizer when calculating
11196 layout.
11197
11198 :see: `wx.Sizer`, `wx.GBSizerItem`
11199 """
11200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11201 __repr__ = _swig_repr
11202 def __init__(self, *args, **kwargs):
11203 """
11204 __init__(self) -> SizerItem
11205
11206 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11207 size will need to be set before this item can be used in a Sizer.
11208
11209 You will probably never need to create a wx.SizerItem directly as they
11210 are created automatically when the sizer's Add, Insert or Prepend
11211 methods are called.
11212
11213 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11214 """
11215 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11216 __swig_destroy__ = _core_.delete_SizerItem
11217 __del__ = lambda self : None;
11218 def DeleteWindows(*args, **kwargs):
11219 """
11220 DeleteWindows(self)
11221
11222 Destroy the window or the windows in a subsizer, depending on the type
11223 of item.
11224 """
11225 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11226
11227 def DetachSizer(*args, **kwargs):
11228 """
11229 DetachSizer(self)
11230
11231 Enable deleting the SizerItem without destroying the contained sizer.
11232 """
11233 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11234
11235 def GetSize(*args, **kwargs):
11236 """
11237 GetSize(self) -> Size
11238
11239 Get the current size of the item, as set in the last Layout.
11240 """
11241 return _core_.SizerItem_GetSize(*args, **kwargs)
11242
11243 def CalcMin(*args, **kwargs):
11244 """
11245 CalcMin(self) -> Size
11246
11247 Calculates the minimum desired size for the item, including any space
11248 needed by borders.
11249 """
11250 return _core_.SizerItem_CalcMin(*args, **kwargs)
11251
11252 def SetDimension(*args, **kwargs):
11253 """
11254 SetDimension(self, Point pos, Size size)
11255
11256 Set the position and size of the space allocated for this item by the
11257 sizer, and adjust the position and size of the item (window or
11258 subsizer) to be within that space taking alignment and borders into
11259 account.
11260 """
11261 return _core_.SizerItem_SetDimension(*args, **kwargs)
11262
11263 def GetMinSize(*args, **kwargs):
11264 """
11265 GetMinSize(self) -> Size
11266
11267 Get the minimum size needed for the item.
11268 """
11269 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11270
11271 def GetMinSizeWithBorder(*args, **kwargs):
11272 """
11273 GetMinSizeWithBorder(self) -> Size
11274
11275 Get the minimum size needed for the item with space for the borders
11276 added, if needed.
11277 """
11278 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11279
11280 def SetInitSize(*args, **kwargs):
11281 """SetInitSize(self, int x, int y)"""
11282 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11283
11284 def SetRatioWH(*args, **kwargs):
11285 """
11286 SetRatioWH(self, int width, int height)
11287
11288 Set the ratio item attribute.
11289 """
11290 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11291
11292 def SetRatioSize(*args, **kwargs):
11293 """
11294 SetRatioSize(self, Size size)
11295
11296 Set the ratio item attribute.
11297 """
11298 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11299
11300 def SetRatio(*args, **kwargs):
11301 """
11302 SetRatio(self, float ratio)
11303
11304 Set the ratio item attribute.
11305 """
11306 return _core_.SizerItem_SetRatio(*args, **kwargs)
11307
11308 def GetRatio(*args, **kwargs):
11309 """
11310 GetRatio(self) -> float
11311
11312 Set the ratio item attribute.
11313 """
11314 return _core_.SizerItem_GetRatio(*args, **kwargs)
11315
11316 def GetRect(*args, **kwargs):
11317 """
11318 GetRect(self) -> Rect
11319
11320 Returns the rectangle that the sizer item should occupy
11321 """
11322 return _core_.SizerItem_GetRect(*args, **kwargs)
11323
11324 def IsWindow(*args, **kwargs):
11325 """
11326 IsWindow(self) -> bool
11327
11328 Is this sizer item a window?
11329 """
11330 return _core_.SizerItem_IsWindow(*args, **kwargs)
11331
11332 def IsSizer(*args, **kwargs):
11333 """
11334 IsSizer(self) -> bool
11335
11336 Is this sizer item a subsizer?
11337 """
11338 return _core_.SizerItem_IsSizer(*args, **kwargs)
11339
11340 def IsSpacer(*args, **kwargs):
11341 """
11342 IsSpacer(self) -> bool
11343
11344 Is this sizer item a spacer?
11345 """
11346 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11347
11348 def SetProportion(*args, **kwargs):
11349 """
11350 SetProportion(self, int proportion)
11351
11352 Set the proportion value for this item.
11353 """
11354 return _core_.SizerItem_SetProportion(*args, **kwargs)
11355
11356 def GetProportion(*args, **kwargs):
11357 """
11358 GetProportion(self) -> int
11359
11360 Get the proportion value for this item.
11361 """
11362 return _core_.SizerItem_GetProportion(*args, **kwargs)
11363
11364 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11365 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11366 def SetFlag(*args, **kwargs):
11367 """
11368 SetFlag(self, int flag)
11369
11370 Set the flag value for this item.
11371 """
11372 return _core_.SizerItem_SetFlag(*args, **kwargs)
11373
11374 def GetFlag(*args, **kwargs):
11375 """
11376 GetFlag(self) -> int
11377
11378 Get the flag value for this item.
11379 """
11380 return _core_.SizerItem_GetFlag(*args, **kwargs)
11381
11382 def SetBorder(*args, **kwargs):
11383 """
11384 SetBorder(self, int border)
11385
11386 Set the border value for this item.
11387 """
11388 return _core_.SizerItem_SetBorder(*args, **kwargs)
11389
11390 def GetBorder(*args, **kwargs):
11391 """
11392 GetBorder(self) -> int
11393
11394 Get the border value for this item.
11395 """
11396 return _core_.SizerItem_GetBorder(*args, **kwargs)
11397
11398 def GetWindow(*args, **kwargs):
11399 """
11400 GetWindow(self) -> Window
11401
11402 Get the window (if any) that is managed by this sizer item.
11403 """
11404 return _core_.SizerItem_GetWindow(*args, **kwargs)
11405
11406 def SetWindow(*args, **kwargs):
11407 """
11408 SetWindow(self, Window window)
11409
11410 Set the window to be managed by this sizer item.
11411 """
11412 return _core_.SizerItem_SetWindow(*args, **kwargs)
11413
11414 def GetSizer(*args, **kwargs):
11415 """
11416 GetSizer(self) -> Sizer
11417
11418 Get the subsizer (if any) that is managed by this sizer item.
11419 """
11420 return _core_.SizerItem_GetSizer(*args, **kwargs)
11421
11422 def SetSizer(*args, **kwargs):
11423 """
11424 SetSizer(self, Sizer sizer)
11425
11426 Set the subsizer to be managed by this sizer item.
11427 """
11428 return _core_.SizerItem_SetSizer(*args, **kwargs)
11429
11430 def GetSpacer(*args, **kwargs):
11431 """
11432 GetSpacer(self) -> Size
11433
11434 Get the size of the spacer managed by this sizer item.
11435 """
11436 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11437
11438 def SetSpacer(*args, **kwargs):
11439 """
11440 SetSpacer(self, Size size)
11441
11442 Set the size of the spacer to be managed by this sizer item.
11443 """
11444 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11445
11446 def Show(*args, **kwargs):
11447 """
11448 Show(self, bool show)
11449
11450 Set the show item attribute, which sizers use to determine if the item
11451 is to be made part of the layout or not. If the item is tracking a
11452 window then it is shown or hidden as needed.
11453 """
11454 return _core_.SizerItem_Show(*args, **kwargs)
11455
11456 def IsShown(*args, **kwargs):
11457 """
11458 IsShown(self) -> bool
11459
11460 Is the item to be shown in the layout?
11461 """
11462 return _core_.SizerItem_IsShown(*args, **kwargs)
11463
11464 def GetPosition(*args, **kwargs):
11465 """
11466 GetPosition(self) -> Point
11467
11468 Returns the current position of the item, as set in the last Layout.
11469 """
11470 return _core_.SizerItem_GetPosition(*args, **kwargs)
11471
11472 def GetUserData(*args, **kwargs):
11473 """
11474 GetUserData(self) -> PyObject
11475
11476 Returns the userData associated with this sizer item, or None if there
11477 isn't any.
11478 """
11479 return _core_.SizerItem_GetUserData(*args, **kwargs)
11480
11481 def SetUserData(*args, **kwargs):
11482 """
11483 SetUserData(self, PyObject userData)
11484
11485 Associate a Python object with this sizer item.
11486 """
11487 return _core_.SizerItem_SetUserData(*args, **kwargs)
11488
11489 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11490 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11491 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11492 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11493 Position = property(GetPosition,doc="See `GetPosition`")
11494 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11495 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11496 Rect = property(GetRect,doc="See `GetRect`")
11497 Size = property(GetSize,doc="See `GetSize`")
11498 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11499 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11500 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11501 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
11502 _core_.SizerItem_swigregister(SizerItem)
11503
11504 def SizerItemWindow(*args, **kwargs):
11505 """
11506 SizerItemWindow(Window window, int proportion, int flag, int border,
11507 PyObject userData=None) -> SizerItem
11508
11509 Constructs a `wx.SizerItem` for tracking a window.
11510 """
11511 val = _core_.new_SizerItemWindow(*args, **kwargs)
11512 return val
11513
11514 def SizerItemSpacer(*args, **kwargs):
11515 """
11516 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11517 PyObject userData=None) -> SizerItem
11518
11519 Constructs a `wx.SizerItem` for tracking a spacer.
11520 """
11521 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11522 return val
11523
11524 def SizerItemSizer(*args, **kwargs):
11525 """
11526 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11527 PyObject userData=None) -> SizerItem
11528
11529 Constructs a `wx.SizerItem` for tracking a subsizer
11530 """
11531 val = _core_.new_SizerItemSizer(*args, **kwargs)
11532 return val
11533
11534 class Sizer(Object):
11535 """
11536 wx.Sizer is the abstract base class used for laying out subwindows in
11537 a window. You cannot use wx.Sizer directly; instead, you will have to
11538 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11539 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11540 `wx.GridBagSizer`.
11541
11542 The concept implemented by sizers in wxWidgets is closely related to
11543 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11544 toolkit or the Qt toolkit. It is based upon the idea of the individual
11545 subwindows reporting their minimal required size and their ability to
11546 get stretched if the size of the parent window has changed. This will
11547 most often mean that the programmer does not set the original size of
11548 a dialog in the beginning, rather the dialog will assigned a sizer and
11549 this sizer will be queried about the recommended size. The sizer in
11550 turn will query its children, which can be normal windows or contorls,
11551 empty space or other sizers, so that a hierarchy of sizers can be
11552 constructed. Note that wxSizer does not derive from wxWindow and thus
11553 do not interfere with tab ordering and requires very little resources
11554 compared to a real window on screen.
11555
11556 What makes sizers so well fitted for use in wxWidgets is the fact that
11557 every control reports its own minimal size and the algorithm can
11558 handle differences in font sizes or different window (dialog item)
11559 sizes on different platforms without problems. If for example the
11560 standard font as well as the overall design of Mac widgets requires
11561 more space than on Windows, then the initial size of a dialog using a
11562 sizer will automatically be bigger on Mac than on Windows.
11563 """
11564 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11565 def __init__(self): raise AttributeError, "No constructor defined"
11566 __repr__ = _swig_repr
11567 __swig_destroy__ = _core_.delete_Sizer
11568 __del__ = lambda self : None;
11569 def _setOORInfo(*args, **kwargs):
11570 """_setOORInfo(self, PyObject _self)"""
11571 return _core_.Sizer__setOORInfo(*args, **kwargs)
11572
11573 def Add(*args, **kwargs):
11574 """
11575 Add(self, item, int proportion=0, int flag=0, int border=0,
11576 PyObject userData=None) -> wx.SizerItem
11577
11578 Appends a child item to the sizer.
11579 """
11580 return _core_.Sizer_Add(*args, **kwargs)
11581
11582 def Insert(*args, **kwargs):
11583 """
11584 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11585 PyObject userData=None) -> wx.SizerItem
11586
11587 Inserts a new item into the list of items managed by this sizer before
11588 the item at index *before*. See `Add` for a description of the parameters.
11589 """
11590 return _core_.Sizer_Insert(*args, **kwargs)
11591
11592 def Prepend(*args, **kwargs):
11593 """
11594 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11595 PyObject userData=None) -> wx.SizerItem
11596
11597 Adds a new item to the begining of the list of sizer items managed by
11598 this sizer. See `Add` for a description of the parameters.
11599 """
11600 return _core_.Sizer_Prepend(*args, **kwargs)
11601
11602 def Remove(*args, **kwargs):
11603 """
11604 Remove(self, item) -> bool
11605
11606 Removes an item from the sizer and destroys it. This method does not
11607 cause any layout or resizing to take place, call `Layout` to update
11608 the layout on screen after removing a child from the sizer. The
11609 *item* parameter can be either a window, a sizer, or the zero-based
11610 index of an item to remove. Returns True if the child item was found
11611 and removed.
11612 """
11613 return _core_.Sizer_Remove(*args, **kwargs)
11614
11615 def Detach(*args, **kwargs):
11616 """
11617 Detach(self, item) -> bool
11618
11619 Detaches an item from the sizer without destroying it. This method
11620 does not cause any layout or resizing to take place, call `Layout` to
11621 do so. The *item* parameter can be either a window, a sizer, or the
11622 zero-based index of the item to be detached. Returns True if the child item
11623 was found and detached.
11624 """
11625 return _core_.Sizer_Detach(*args, **kwargs)
11626
11627 def GetItem(*args, **kwargs):
11628 """
11629 GetItem(self, item) -> wx.SizerItem
11630
11631 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11632 parameter can be either a window, a sizer, or the zero-based index of
11633 the item to be found.
11634 """
11635 return _core_.Sizer_GetItem(*args, **kwargs)
11636
11637 def _SetItemMinSize(*args, **kwargs):
11638 """_SetItemMinSize(self, PyObject item, Size size)"""
11639 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11640
11641 def _ReplaceWin(*args, **kwargs):
11642 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11643 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11644
11645 def _ReplaceSizer(*args, **kwargs):
11646 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11647 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11648
11649 def _ReplaceItem(*args, **kwargs):
11650 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11651 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11652
11653 def Replace(self, olditem, item, recursive=False):
11654 """
11655 Detaches the given ``olditem`` from the sizer and replaces it with
11656 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11657 detached child is destroyed only if it is not a window, (because
11658 windows are owned by their parent, not the sizer.) The
11659 ``recursive`` parameter can be used to search for the given
11660 element recursivly in subsizers.
11661
11662 This method does not cause any layout or resizing to take place,
11663 call `Layout` to do so.
11664
11665 Returns ``True`` if the child item was found and removed.
11666 """
11667 if isinstance(olditem, wx.Window):
11668 return self._ReplaceWin(olditem, item, recursive)
11669 elif isinstnace(olditem, wx.Sizer):
11670 return self._ReplaceSizer(olditem, item, recursive)
11671 elif isinstnace(olditem, int):
11672 return self._ReplaceItem(olditem, item)
11673 else:
11674 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11675
11676 def SetContainingWindow(*args, **kwargs):
11677 """
11678 SetContainingWindow(self, Window window)
11679
11680 Set (or unset) the window this sizer is used in.
11681 """
11682 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11683
11684 def GetContainingWindow(*args, **kwargs):
11685 """
11686 GetContainingWindow(self) -> Window
11687
11688 Get the window this sizer is used in.
11689 """
11690 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11691
11692 def SetItemMinSize(self, item, *args):
11693 """
11694 SetItemMinSize(self, item, Size size)
11695
11696 Sets the minimum size that will be allocated for an item in the sizer.
11697 The *item* parameter can be either a window, a sizer, or the
11698 zero-based index of the item. If a window or sizer is given then it
11699 will be searched for recursivly in subsizers if neccessary.
11700 """
11701 if len(args) == 2:
11702 # for backward compatibility accept separate width,height args too
11703 return self._SetItemMinSize(item, args)
11704 else:
11705 return self._SetItemMinSize(item, args[0])
11706
11707 def AddItem(*args, **kwargs):
11708 """
11709 AddItem(self, SizerItem item)
11710
11711 Adds a `wx.SizerItem` to the sizer.
11712 """
11713 return _core_.Sizer_AddItem(*args, **kwargs)
11714
11715 def InsertItem(*args, **kwargs):
11716 """
11717 InsertItem(self, int index, SizerItem item)
11718
11719 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11720 """
11721 return _core_.Sizer_InsertItem(*args, **kwargs)
11722
11723 def PrependItem(*args, **kwargs):
11724 """
11725 PrependItem(self, SizerItem item)
11726
11727 Prepends a `wx.SizerItem` to the sizer.
11728 """
11729 return _core_.Sizer_PrependItem(*args, **kwargs)
11730
11731 def AddMany(self, items):
11732 """
11733 AddMany is a convenience method for adding several items
11734 to a sizer at one time. Simply pass it a list of tuples,
11735 where each tuple consists of the parameters that you
11736 would normally pass to the `Add` method.
11737 """
11738 for item in items:
11739 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11740 item = (item, )
11741 self.Add(*item)
11742
11743 def AddSpacer(self, *args, **kw):
11744 """AddSpacer(int size) --> SizerItem
11745
11746 Add a spacer that is (size,size) pixels.
11747 """
11748 if args and type(args[0]) == int:
11749 return self.Add( (args[0],args[0] ), 0)
11750 else: # otherwise stay compatible with old AddSpacer
11751 return self.Add(*args, **kw)
11752 def PrependSpacer(self, *args, **kw):
11753 """PrependSpacer(int size) --> SizerItem
11754
11755 Prepend a spacer that is (size, size) pixels."""
11756 if args and type(args[0]) == int:
11757 return self.Prepend( (args[0],args[0] ), 0)
11758 else: # otherwise stay compatible with old PrependSpacer
11759 return self.Prepend(*args, **kw)
11760 def InsertSpacer(self, index, *args, **kw):
11761 """InsertSpacer(int index, int size) --> SizerItem
11762
11763 Insert a spacer at position index that is (size, size) pixels."""
11764 if args and type(args[0]) == int:
11765 return self.Insert( index, (args[0],args[0] ), 0)
11766 else: # otherwise stay compatible with old InsertSpacer
11767 return self.Insert(index, *args, **kw)
11768
11769
11770 def AddStretchSpacer(self, prop=1):
11771 """AddStretchSpacer(int prop=1) --> SizerItem
11772
11773 Add a stretchable spacer."""
11774 return self.Add((0,0), prop)
11775 def PrependStretchSpacer(self, prop=1):
11776 """PrependStretchSpacer(int prop=1) --> SizerItem
11777
11778 Prepend a stretchable spacer."""
11779 return self.Prepend((0,0), prop)
11780 def InsertStretchSpacer(self, index, prop=1):
11781 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11782
11783 Insert a stretchable spacer."""
11784 return self.Insert(index, (0,0), prop)
11785
11786
11787 # for backwards compatibility only, please do not use in new code
11788 def AddWindow(self, *args, **kw):
11789 """Compatibility alias for `Add`."""
11790 return self.Add(*args, **kw)
11791 def AddSizer(self, *args, **kw):
11792 """Compatibility alias for `Add`."""
11793 return self.Add(*args, **kw)
11794
11795 def PrependWindow(self, *args, **kw):
11796 """Compatibility alias for `Prepend`."""
11797 return self.Prepend(*args, **kw)
11798 def PrependSizer(self, *args, **kw):
11799 """Compatibility alias for `Prepend`."""
11800 return self.Prepend(*args, **kw)
11801
11802 def InsertWindow(self, *args, **kw):
11803 """Compatibility alias for `Insert`."""
11804 return self.Insert(*args, **kw)
11805 def InsertSizer(self, *args, **kw):
11806 """Compatibility alias for `Insert`."""
11807 return self.Insert(*args, **kw)
11808
11809 def RemoveWindow(self, *args, **kw):
11810 """Compatibility alias for `Remove`."""
11811 return self.Remove(*args, **kw)
11812 def RemoveSizer(self, *args, **kw):
11813 """Compatibility alias for `Remove`."""
11814 return self.Remove(*args, **kw)
11815 def RemovePos(self, *args, **kw):
11816 """Compatibility alias for `Remove`."""
11817 return self.Remove(*args, **kw)
11818
11819
11820 def SetDimension(*args, **kwargs):
11821 """
11822 SetDimension(self, int x, int y, int width, int height)
11823
11824 Call this to force the sizer to take the given dimension and thus
11825 force the items owned by the sizer to resize themselves according to
11826 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11827 methods.
11828 """
11829 return _core_.Sizer_SetDimension(*args, **kwargs)
11830
11831 def SetMinSize(*args, **kwargs):
11832 """
11833 SetMinSize(self, Size size)
11834
11835 Call this to give the sizer a minimal size. Normally, the sizer will
11836 calculate its minimal size based purely on how much space its children
11837 need. After calling this method `GetMinSize` will return either the
11838 minimal size as requested by its children or the minimal size set
11839 here, depending on which is bigger.
11840 """
11841 return _core_.Sizer_SetMinSize(*args, **kwargs)
11842
11843 def GetSize(*args, **kwargs):
11844 """
11845 GetSize(self) -> Size
11846
11847 Returns the current size of the space managed by the sizer.
11848 """
11849 return _core_.Sizer_GetSize(*args, **kwargs)
11850
11851 def GetPosition(*args, **kwargs):
11852 """
11853 GetPosition(self) -> Point
11854
11855 Returns the current position of the sizer's managed space.
11856 """
11857 return _core_.Sizer_GetPosition(*args, **kwargs)
11858
11859 def GetMinSize(*args, **kwargs):
11860 """
11861 GetMinSize(self) -> Size
11862
11863 Returns the minimal size of the sizer. This is either the combined
11864 minimal size of all the children and their borders or the minimal size
11865 set by SetMinSize, depending on which is bigger.
11866 """
11867 return _core_.Sizer_GetMinSize(*args, **kwargs)
11868
11869 def GetSizeTuple(self):
11870 return self.GetSize().Get()
11871 def GetPositionTuple(self):
11872 return self.GetPosition().Get()
11873 def GetMinSizeTuple(self):
11874 return self.GetMinSize().Get()
11875
11876 def RecalcSizes(*args, **kwargs):
11877 """
11878 RecalcSizes(self)
11879
11880 Using the sizes calculated by `CalcMin` reposition and resize all the
11881 items managed by this sizer. You should not need to call this directly as
11882 it is called by `Layout`.
11883 """
11884 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11885
11886 def CalcMin(*args, **kwargs):
11887 """
11888 CalcMin(self) -> Size
11889
11890 This method is where the sizer will do the actual calculation of its
11891 children's minimal sizes. You should not need to call this directly as
11892 it is called by `Layout`.
11893 """
11894 return _core_.Sizer_CalcMin(*args, **kwargs)
11895
11896 def Layout(*args, **kwargs):
11897 """
11898 Layout(self)
11899
11900 This method will force the recalculation and layout of the items
11901 controlled by the sizer using the current space allocated to the
11902 sizer. Normally this is called automatically from the owning window's
11903 EVT_SIZE handler, but it is also useful to call it from user code when
11904 one of the items in a sizer change size, or items are added or
11905 removed.
11906 """
11907 return _core_.Sizer_Layout(*args, **kwargs)
11908
11909 def Fit(*args, **kwargs):
11910 """
11911 Fit(self, Window window) -> Size
11912
11913 Tell the sizer to resize the *window* to match the sizer's minimal
11914 size. This is commonly done in the constructor of the window itself in
11915 order to set its initial size to match the needs of the children as
11916 determined by the sizer. Returns the new size.
11917
11918 For a top level window this is the total window size, not the client size.
11919 """
11920 return _core_.Sizer_Fit(*args, **kwargs)
11921
11922 def FitInside(*args, **kwargs):
11923 """
11924 FitInside(self, Window window)
11925
11926 Tell the sizer to resize the *virtual size* of the *window* to match the
11927 sizer's minimal size. This will not alter the on screen size of the
11928 window, but may cause the addition/removal/alteration of scrollbars
11929 required to view the virtual area in windows which manage it.
11930
11931 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11932
11933 """
11934 return _core_.Sizer_FitInside(*args, **kwargs)
11935
11936 def SetSizeHints(*args, **kwargs):
11937 """
11938 SetSizeHints(self, Window window)
11939
11940 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11941 match the sizer's minimal size. This is commonly done in the
11942 constructor of the window itself if the window is resizable (as are
11943 many dialogs under Unix and frames on probably all platforms) in order
11944 to prevent the window from being sized smaller than the minimal size
11945 required by the sizer.
11946 """
11947 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11948
11949 def SetVirtualSizeHints(*args, **kwargs):
11950 """
11951 SetVirtualSizeHints(self, Window window)
11952
11953 Tell the sizer to set the minimal size of the window virtual area to
11954 match the sizer's minimal size. For windows with managed scrollbars
11955 this will set them appropriately.
11956
11957 :see: `wx.ScrolledWindow.SetScrollbars`
11958
11959 """
11960 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11961
11962 def Clear(*args, **kwargs):
11963 """
11964 Clear(self, bool deleteWindows=False)
11965
11966 Clear all items from the sizer, optionally destroying the window items
11967 as well.
11968 """
11969 return _core_.Sizer_Clear(*args, **kwargs)
11970
11971 def DeleteWindows(*args, **kwargs):
11972 """
11973 DeleteWindows(self)
11974
11975 Destroy all windows managed by the sizer.
11976 """
11977 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11978
11979 def GetChildren(*args, **kwargs):
11980 """
11981 GetChildren(self) -> list
11982
11983 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11984 """
11985 return _core_.Sizer_GetChildren(*args, **kwargs)
11986
11987 def Show(*args, **kwargs):
11988 """
11989 Show(self, item, bool show=True, bool recursive=false) -> bool
11990
11991 Shows or hides an item managed by the sizer. To make a sizer item
11992 disappear or reappear, use Show followed by `Layout`. The *item*
11993 parameter can be either a window, a sizer, or the zero-based index of
11994 the item. Use the recursive parameter to show or hide an item in a
11995 subsizer. Returns True if the item was found.
11996 """
11997 return _core_.Sizer_Show(*args, **kwargs)
11998
11999 def IsShown(*args, **kwargs):
12000 """
12001 IsShown(self, item)
12002
12003 Determines if the item is currently shown. To make a sizer
12004 item disappear or reappear, use Show followed by `Layout`. The *item*
12005 parameter can be either a window, a sizer, or the zero-based index of
12006 the item.
12007 """
12008 return _core_.Sizer_IsShown(*args, **kwargs)
12009
12010 def Hide(self, item, recursive=False):
12011 """
12012 A convenience method for `Show` (item, False, recursive).
12013 """
12014 return self.Show(item, False, recursive)
12015
12016 def ShowItems(*args, **kwargs):
12017 """
12018 ShowItems(self, bool show)
12019
12020 Recursively call `wx.SizerItem.Show` on all sizer items.
12021 """
12022 return _core_.Sizer_ShowItems(*args, **kwargs)
12023
12024 Children = property(GetChildren,doc="See `GetChildren`")
12025 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12026 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12027 Position = property(GetPosition,doc="See `GetPosition`")
12028 Size = property(GetSize,doc="See `GetSize`")
12029 _core_.Sizer_swigregister(Sizer)
12030
12031 class PySizer(Sizer):
12032 """
12033 wx.PySizer is a special version of `wx.Sizer` that has been
12034 instrumented to allow the C++ virtual methods to be overloaded in
12035 Python derived classes. You would derive from this class if you are
12036 wanting to implement a custom sizer in Python code. Simply implement
12037 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12038 For example::
12039
12040 class MySizer(wx.PySizer):
12041 def __init__(self):
12042 wx.PySizer.__init__(self)
12043
12044 def CalcMin(self):
12045 for item in self.GetChildren():
12046 # calculate the total minimum width and height needed
12047 # by all items in the sizer according to this sizer's
12048 # layout algorithm.
12049 ...
12050 return wx.Size(width, height)
12051
12052 def RecalcSizes(self):
12053 # find the space allotted to this sizer
12054 pos = self.GetPosition()
12055 size = self.GetSize()
12056 for item in self.GetChildren():
12057 # Recalculate (if necessary) the position and size of
12058 # each item and then call item.SetDimension to do the
12059 # actual positioning and sizing of the items within the
12060 # space alloted to this sizer.
12061 ...
12062 item.SetDimension(itemPos, itemSize)
12063
12064
12065 When `Layout` is called it first calls `CalcMin` followed by
12066 `RecalcSizes` so you can optimize a bit by saving the results of
12067 `CalcMin` and reusing them in `RecalcSizes`.
12068
12069 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12070
12071
12072 """
12073 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12074 __repr__ = _swig_repr
12075 def __init__(self, *args, **kwargs):
12076 """
12077 __init__(self) -> PySizer
12078
12079 Creates a wx.PySizer. Must be called from the __init__ in the derived
12080 class.
12081 """
12082 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
12083 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12084
12085 def _setCallbackInfo(*args, **kwargs):
12086 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12087 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12088
12089 _core_.PySizer_swigregister(PySizer)
12090
12091 #---------------------------------------------------------------------------
12092
12093 class BoxSizer(Sizer):
12094 """
12095 The basic idea behind a box sizer is that windows will most often be
12096 laid out in rather simple basic geometry, typically in a row or a
12097 column or nested hierarchies of either. A wx.BoxSizer will lay out
12098 its items in a simple row or column, depending on the orientation
12099 parameter passed to the constructor.
12100 """
12101 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12102 __repr__ = _swig_repr
12103 def __init__(self, *args, **kwargs):
12104 """
12105 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12106
12107 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12108 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12109 sizer.
12110 """
12111 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12112 self._setOORInfo(self)
12113
12114 def GetOrientation(*args, **kwargs):
12115 """
12116 GetOrientation(self) -> int
12117
12118 Returns the current orientation of the sizer.
12119 """
12120 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12121
12122 def SetOrientation(*args, **kwargs):
12123 """
12124 SetOrientation(self, int orient)
12125
12126 Resets the orientation of the sizer.
12127 """
12128 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12129
12130 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12131 _core_.BoxSizer_swigregister(BoxSizer)
12132
12133 #---------------------------------------------------------------------------
12134
12135 class StaticBoxSizer(BoxSizer):
12136 """
12137 wx.StaticBoxSizer derives from and functions identically to the
12138 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12139 manages. Note that this static box must be created separately and
12140 passed to the sizer constructor.
12141 """
12142 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12143 __repr__ = _swig_repr
12144 def __init__(self, *args, **kwargs):
12145 """
12146 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12147
12148 Constructor. It takes an associated static box and the orientation
12149 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12150 ``wx.HORIZONTAL``.
12151 """
12152 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12153 self._setOORInfo(self)
12154
12155 def GetStaticBox(*args, **kwargs):
12156 """
12157 GetStaticBox(self) -> StaticBox
12158
12159 Returns the static box associated with this sizer.
12160 """
12161 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12162
12163 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
12164 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12165
12166 #---------------------------------------------------------------------------
12167
12168 class GridSizer(Sizer):
12169 """
12170 A grid sizer is a sizer which lays out its children in a
12171 two-dimensional table with all cells having the same size. In other
12172 words, the width of each cell within the grid is the width of the
12173 widest item added to the sizer and the height of each grid cell is the
12174 height of the tallest item. An optional vertical and/or horizontal
12175 gap between items can also be specified (in pixels.)
12176
12177 Items are placed in the cells of the grid in the order they are added,
12178 in row-major order. In other words, the first row is filled first,
12179 then the second, and so on until all items have been added. (If
12180 neccessary, additional rows will be added as items are added.) If you
12181 need to have greater control over the cells that items are placed in
12182 then use the `wx.GridBagSizer`.
12183
12184 """
12185 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12186 __repr__ = _swig_repr
12187 def __init__(self, *args, **kwargs):
12188 """
12189 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12190
12191 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12192 of columns and rows in the sizer - if either of the parameters is
12193 zero, it will be calculated to from the total number of children in
12194 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12195 define extra space between all children.
12196 """
12197 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
12198 self._setOORInfo(self)
12199
12200 def SetCols(*args, **kwargs):
12201 """
12202 SetCols(self, int cols)
12203
12204 Sets the number of columns in the sizer.
12205 """
12206 return _core_.GridSizer_SetCols(*args, **kwargs)
12207
12208 def SetRows(*args, **kwargs):
12209 """
12210 SetRows(self, int rows)
12211
12212 Sets the number of rows in the sizer.
12213 """
12214 return _core_.GridSizer_SetRows(*args, **kwargs)
12215
12216 def SetVGap(*args, **kwargs):
12217 """
12218 SetVGap(self, int gap)
12219
12220 Sets the vertical gap (in pixels) between the cells in the sizer.
12221 """
12222 return _core_.GridSizer_SetVGap(*args, **kwargs)
12223
12224 def SetHGap(*args, **kwargs):
12225 """
12226 SetHGap(self, int gap)
12227
12228 Sets the horizontal gap (in pixels) between cells in the sizer
12229 """
12230 return _core_.GridSizer_SetHGap(*args, **kwargs)
12231
12232 def GetCols(*args, **kwargs):
12233 """
12234 GetCols(self) -> int
12235
12236 Returns the number of columns in the sizer.
12237 """
12238 return _core_.GridSizer_GetCols(*args, **kwargs)
12239
12240 def GetRows(*args, **kwargs):
12241 """
12242 GetRows(self) -> int
12243
12244 Returns the number of rows in the sizer.
12245 """
12246 return _core_.GridSizer_GetRows(*args, **kwargs)
12247
12248 def GetVGap(*args, **kwargs):
12249 """
12250 GetVGap(self) -> int
12251
12252 Returns the vertical gap (in pixels) between the cells in the sizer.
12253 """
12254 return _core_.GridSizer_GetVGap(*args, **kwargs)
12255
12256 def GetHGap(*args, **kwargs):
12257 """
12258 GetHGap(self) -> int
12259
12260 Returns the horizontal gap (in pixels) between cells in the sizer.
12261 """
12262 return _core_.GridSizer_GetHGap(*args, **kwargs)
12263
12264 def CalcRowsCols(self):
12265 """
12266 CalcRowsCols() -> (rows, cols)
12267
12268 Calculates how many rows and columns will be in the sizer based
12269 on the current number of items and also the rows, cols specified
12270 in the constructor.
12271 """
12272 nitems = len(self.GetChildren())
12273 rows = self.GetRows()
12274 cols = self.GetCols()
12275 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12276 if cols != 0:
12277 rows = (nitems + cols - 1) / cols
12278 elif rows != 0:
12279 cols = (nitems + rows - 1) / rows
12280 return (rows, cols)
12281
12282 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12283 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12284 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12285 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
12286 _core_.GridSizer_swigregister(GridSizer)
12287
12288 #---------------------------------------------------------------------------
12289
12290 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12291 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12292 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12293 class FlexGridSizer(GridSizer):
12294 """
12295 A flex grid sizer is a sizer which lays out its children in a
12296 two-dimensional table with all table cells in one row having the same
12297 height and all cells in one column having the same width, but all
12298 rows or all columns are not necessarily the same height or width as in
12299 the `wx.GridSizer`.
12300
12301 wx.FlexGridSizer can also size items equally in one direction but
12302 unequally ("flexibly") in the other. If the sizer is only flexible
12303 in one direction (this can be changed using `SetFlexibleDirection`), it
12304 needs to be decided how the sizer should grow in the other ("non
12305 flexible") direction in order to fill the available space. The
12306 `SetNonFlexibleGrowMode` method serves this purpose.
12307
12308
12309 """
12310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12311 __repr__ = _swig_repr
12312 def __init__(self, *args, **kwargs):
12313 """
12314 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12315
12316 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12317 number of columns and rows in the sizer - if either of the parameters
12318 is zero, it will be calculated to from the total number of children in
12319 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12320 define extra space between all children.
12321 """
12322 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
12323 self._setOORInfo(self)
12324
12325 def AddGrowableRow(*args, **kwargs):
12326 """
12327 AddGrowableRow(self, size_t idx, int proportion=0)
12328
12329 Specifies that row *idx* (starting from zero) should be grown if there
12330 is extra space available to the sizer.
12331
12332 The *proportion* parameter has the same meaning as the stretch factor
12333 for the box sizers except that if all proportions are 0, then all
12334 columns are resized equally (instead of not being resized at all).
12335 """
12336 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12337
12338 def RemoveGrowableRow(*args, **kwargs):
12339 """
12340 RemoveGrowableRow(self, size_t idx)
12341
12342 Specifies that row *idx* is no longer growable.
12343 """
12344 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12345
12346 def AddGrowableCol(*args, **kwargs):
12347 """
12348 AddGrowableCol(self, size_t idx, int proportion=0)
12349
12350 Specifies that column *idx* (starting from zero) should be grown if
12351 there is extra space available to the sizer.
12352
12353 The *proportion* parameter has the same meaning as the stretch factor
12354 for the box sizers except that if all proportions are 0, then all
12355 columns are resized equally (instead of not being resized at all).
12356 """
12357 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12358
12359 def RemoveGrowableCol(*args, **kwargs):
12360 """
12361 RemoveGrowableCol(self, size_t idx)
12362
12363 Specifies that column *idx* is no longer growable.
12364 """
12365 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12366
12367 def SetFlexibleDirection(*args, **kwargs):
12368 """
12369 SetFlexibleDirection(self, int direction)
12370
12371 Specifies whether the sizer should flexibly resize its columns, rows,
12372 or both. Argument *direction* can be one of the following values. Any
12373 other value is ignored.
12374
12375 ============== =======================================
12376 wx.VERTICAL Rows are flexibly sized.
12377 wx.HORIZONTAL Columns are flexibly sized.
12378 wx.BOTH Both rows and columns are flexibly sized
12379 (this is the default value).
12380 ============== =======================================
12381
12382 Note that this method does not trigger relayout.
12383
12384 """
12385 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12386
12387 def GetFlexibleDirection(*args, **kwargs):
12388 """
12389 GetFlexibleDirection(self) -> int
12390
12391 Returns a value that specifies whether the sizer
12392 flexibly resizes its columns, rows, or both (default).
12393
12394 :see: `SetFlexibleDirection`
12395 """
12396 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12397
12398 def SetNonFlexibleGrowMode(*args, **kwargs):
12399 """
12400 SetNonFlexibleGrowMode(self, int mode)
12401
12402 Specifies how the sizer should grow in the non-flexible direction if
12403 there is one (so `SetFlexibleDirection` must have been called
12404 previously). Argument *mode* can be one of the following values:
12405
12406 ========================== =================================================
12407 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12408 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12409 `AddGrowableCol` and `AddGrowableRow`. In this
12410 case equal sizing applies to minimum sizes of
12411 columns or rows (this is the default value).
12412 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12413 the non flexible direction, whether they are
12414 growable or not in the flexbile direction.
12415 ========================== =================================================
12416
12417 Note that this method does not trigger relayout.
12418 """
12419 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12420
12421 def GetNonFlexibleGrowMode(*args, **kwargs):
12422 """
12423 GetNonFlexibleGrowMode(self) -> int
12424
12425 Returns the value that specifies how the sizer grows in the
12426 non-flexible direction if there is one.
12427
12428 :see: `SetNonFlexibleGrowMode`
12429 """
12430 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12431
12432 def GetRowHeights(*args, **kwargs):
12433 """
12434 GetRowHeights(self) -> list
12435
12436 Returns a list of integers representing the heights of each of the
12437 rows in the sizer.
12438 """
12439 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12440
12441 def GetColWidths(*args, **kwargs):
12442 """
12443 GetColWidths(self) -> list
12444
12445 Returns a list of integers representing the widths of each of the
12446 columns in the sizer.
12447 """
12448 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12449
12450 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12451 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12452 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12453 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
12454 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12455
12456 class StdDialogButtonSizer(BoxSizer):
12457 """
12458 A special sizer that knows how to order and position standard buttons
12459 in order to conform to the current platform's standards. You simply
12460 need to add each `wx.Button` to the sizer, and be sure to create the
12461 buttons using the standard ID's. Then call `Realize` and the sizer
12462 will take care of the rest.
12463
12464 """
12465 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12466 __repr__ = _swig_repr
12467 def __init__(self, *args, **kwargs):
12468 """__init__(self) -> StdDialogButtonSizer"""
12469 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12470 def AddButton(*args, **kwargs):
12471 """
12472 AddButton(self, wxButton button)
12473
12474 Use this to add the buttons to this sizer. Do not use the `Add`
12475 method in the base class.
12476 """
12477 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12478
12479 def Realize(*args, **kwargs):
12480 """
12481 Realize(self)
12482
12483 This funciton needs to be called after all the buttons have been added
12484 to the sizer. It will reorder them and position them in a platform
12485 specifc manner.
12486 """
12487 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12488
12489 def SetAffirmativeButton(*args, **kwargs):
12490 """SetAffirmativeButton(self, wxButton button)"""
12491 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12492
12493 def SetNegativeButton(*args, **kwargs):
12494 """SetNegativeButton(self, wxButton button)"""
12495 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12496
12497 def SetCancelButton(*args, **kwargs):
12498 """SetCancelButton(self, wxButton button)"""
12499 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12500
12501 def GetAffirmativeButton(*args, **kwargs):
12502 """GetAffirmativeButton(self) -> wxButton"""
12503 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12504
12505 def GetApplyButton(*args, **kwargs):
12506 """GetApplyButton(self) -> wxButton"""
12507 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12508
12509 def GetNegativeButton(*args, **kwargs):
12510 """GetNegativeButton(self) -> wxButton"""
12511 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12512
12513 def GetCancelButton(*args, **kwargs):
12514 """GetCancelButton(self) -> wxButton"""
12515 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12516
12517 def GetHelpButton(*args, **kwargs):
12518 """GetHelpButton(self) -> wxButton"""
12519 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12520
12521 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12522 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12523 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12524 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12525 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
12526 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12527
12528 #---------------------------------------------------------------------------
12529
12530 class GBPosition(object):
12531 """
12532 This class represents the position of an item in a virtual grid of
12533 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12534 typemaps that will automatically convert from a 2-element sequence of
12535 integers to a wx.GBPosition, so you can use the more pythonic
12536 representation of the position nearly transparently in Python code.
12537 """
12538 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12539 __repr__ = _swig_repr
12540 def __init__(self, *args, **kwargs):
12541 """
12542 __init__(self, int row=0, int col=0) -> GBPosition
12543
12544 This class represents the position of an item in a virtual grid of
12545 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12546 typemaps that will automatically convert from a 2-element sequence of
12547 integers to a wx.GBPosition, so you can use the more pythonic
12548 representation of the position nearly transparently in Python code.
12549 """
12550 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12551 __swig_destroy__ = _core_.delete_GBPosition
12552 __del__ = lambda self : None;
12553 def GetRow(*args, **kwargs):
12554 """GetRow(self) -> int"""
12555 return _core_.GBPosition_GetRow(*args, **kwargs)
12556
12557 def GetCol(*args, **kwargs):
12558 """GetCol(self) -> int"""
12559 return _core_.GBPosition_GetCol(*args, **kwargs)
12560
12561 def SetRow(*args, **kwargs):
12562 """SetRow(self, int row)"""
12563 return _core_.GBPosition_SetRow(*args, **kwargs)
12564
12565 def SetCol(*args, **kwargs):
12566 """SetCol(self, int col)"""
12567 return _core_.GBPosition_SetCol(*args, **kwargs)
12568
12569 def __eq__(*args, **kwargs):
12570 """
12571 __eq__(self, PyObject other) -> bool
12572
12573 Compare GBPosition for equality.
12574 """
12575 return _core_.GBPosition___eq__(*args, **kwargs)
12576
12577 def __ne__(*args, **kwargs):
12578 """
12579 __ne__(self, PyObject other) -> bool
12580
12581 Compare GBPosition for inequality.
12582 """
12583 return _core_.GBPosition___ne__(*args, **kwargs)
12584
12585 def Set(*args, **kwargs):
12586 """Set(self, int row=0, int col=0)"""
12587 return _core_.GBPosition_Set(*args, **kwargs)
12588
12589 def Get(*args, **kwargs):
12590 """Get(self) -> PyObject"""
12591 return _core_.GBPosition_Get(*args, **kwargs)
12592
12593 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12594 def __str__(self): return str(self.Get())
12595 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12596 def __len__(self): return len(self.Get())
12597 def __getitem__(self, index): return self.Get()[index]
12598 def __setitem__(self, index, val):
12599 if index == 0: self.SetRow(val)
12600 elif index == 1: self.SetCol(val)
12601 else: raise IndexError
12602 def __nonzero__(self): return self.Get() != (0,0)
12603 __safe_for_unpickling__ = True
12604 def __reduce__(self): return (wx.GBPosition, self.Get())
12605
12606 row = property(GetRow, SetRow)
12607 col = property(GetCol, SetCol)
12608
12609 _core_.GBPosition_swigregister(GBPosition)
12610
12611 class GBSpan(object):
12612 """
12613 This class is used to hold the row and column spanning attributes of
12614 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12615 automatically convert from a 2-element sequence of integers to a
12616 wx.GBSpan, so you can use the more pythonic representation of the span
12617 nearly transparently in Python code.
12618
12619 """
12620 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12621 __repr__ = _swig_repr
12622 def __init__(self, *args, **kwargs):
12623 """
12624 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12625
12626 Construct a new wxGBSpan, optionally setting the rowspan and
12627 colspan. The default is (1,1). (Meaning that the item occupies one
12628 cell in each direction.
12629 """
12630 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12631 __swig_destroy__ = _core_.delete_GBSpan
12632 __del__ = lambda self : None;
12633 def GetRowspan(*args, **kwargs):
12634 """GetRowspan(self) -> int"""
12635 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12636
12637 def GetColspan(*args, **kwargs):
12638 """GetColspan(self) -> int"""
12639 return _core_.GBSpan_GetColspan(*args, **kwargs)
12640
12641 def SetRowspan(*args, **kwargs):
12642 """SetRowspan(self, int rowspan)"""
12643 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12644
12645 def SetColspan(*args, **kwargs):
12646 """SetColspan(self, int colspan)"""
12647 return _core_.GBSpan_SetColspan(*args, **kwargs)
12648
12649 def __eq__(*args, **kwargs):
12650 """
12651 __eq__(self, PyObject other) -> bool
12652
12653 Compare wxGBSpan for equality.
12654 """
12655 return _core_.GBSpan___eq__(*args, **kwargs)
12656
12657 def __ne__(*args, **kwargs):
12658 """
12659 __ne__(self, PyObject other) -> bool
12660
12661 Compare GBSpan for inequality.
12662 """
12663 return _core_.GBSpan___ne__(*args, **kwargs)
12664
12665 def Set(*args, **kwargs):
12666 """Set(self, int rowspan=1, int colspan=1)"""
12667 return _core_.GBSpan_Set(*args, **kwargs)
12668
12669 def Get(*args, **kwargs):
12670 """Get(self) -> PyObject"""
12671 return _core_.GBSpan_Get(*args, **kwargs)
12672
12673 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12674 def __str__(self): return str(self.Get())
12675 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12676 def __len__(self): return len(self.Get())
12677 def __getitem__(self, index): return self.Get()[index]
12678 def __setitem__(self, index, val):
12679 if index == 0: self.SetRowspan(val)
12680 elif index == 1: self.SetColspan(val)
12681 else: raise IndexError
12682 def __nonzero__(self): return self.Get() != (0,0)
12683 __safe_for_unpickling__ = True
12684 def __reduce__(self): return (wx.GBSpan, self.Get())
12685
12686 rowspan = property(GetRowspan, SetRowspan)
12687 colspan = property(GetColspan, SetColspan)
12688
12689 _core_.GBSpan_swigregister(GBSpan)
12690
12691 class GBSizerItem(SizerItem):
12692 """
12693 The wx.GBSizerItem class is used to track the additional data about
12694 items in a `wx.GridBagSizer` such as the item's position in the grid
12695 and how many rows or columns it spans.
12696
12697 """
12698 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12699 __repr__ = _swig_repr
12700 def __init__(self, *args, **kwargs):
12701 """
12702 __init__(self) -> GBSizerItem
12703
12704 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12705 size will need to be set, as well as a position and span before this
12706 item can be used in a Sizer.
12707
12708 You will probably never need to create a wx.GBSizerItem directly as they
12709 are created automatically when the sizer's Add method is called.
12710 """
12711 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12712 __swig_destroy__ = _core_.delete_GBSizerItem
12713 __del__ = lambda self : None;
12714 def GetPos(*args, **kwargs):
12715 """
12716 GetPos(self) -> GBPosition
12717
12718 Get the grid position of the item
12719 """
12720 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12721
12722 def GetPosTuple(self): return self.GetPos().Get()
12723 def GetSpan(*args, **kwargs):
12724 """
12725 GetSpan(self) -> GBSpan
12726
12727 Get the row and column spanning of the item
12728 """
12729 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12730
12731 def GetSpanTuple(self): return self.GetSpan().Get()
12732 def SetPos(*args, **kwargs):
12733 """
12734 SetPos(self, GBPosition pos) -> bool
12735
12736 If the item is already a member of a sizer then first ensure that
12737 there is no other item that would intersect with this one at the new
12738 position, then set the new position. Returns True if the change is
12739 successful and after the next Layout() the item will be moved.
12740 """
12741 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12742
12743 def SetSpan(*args, **kwargs):
12744 """
12745 SetSpan(self, GBSpan span) -> bool
12746
12747 If the item is already a member of a sizer then first ensure that
12748 there is no other item that would intersect with this one with its new
12749 spanning size, then set the new spanning. Returns True if the change
12750 is successful and after the next Layout() the item will be resized.
12751
12752 """
12753 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12754
12755 def Intersects(*args, **kwargs):
12756 """
12757 Intersects(self, GBSizerItem other) -> bool
12758
12759 Returns True if this item and the other item instersect.
12760 """
12761 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12762
12763 def IntersectsPos(*args, **kwargs):
12764 """
12765 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12766
12767 Returns True if the given pos/span would intersect with this item.
12768 """
12769 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12770
12771 def GetEndPos(*args, **kwargs):
12772 """
12773 GetEndPos(self) -> GBPosition
12774
12775 Get the row and column of the endpoint of this item.
12776 """
12777 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12778
12779 def GetGBSizer(*args, **kwargs):
12780 """
12781 GetGBSizer(self) -> GridBagSizer
12782
12783 Get the sizer this item is a member of.
12784 """
12785 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12786
12787 def SetGBSizer(*args, **kwargs):
12788 """
12789 SetGBSizer(self, GridBagSizer sizer)
12790
12791 Set the sizer this item is a member of.
12792 """
12793 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12794
12795 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12796 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12797 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12798 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
12799 _core_.GBSizerItem_swigregister(GBSizerItem)
12800 DefaultSpan = cvar.DefaultSpan
12801
12802 def GBSizerItemWindow(*args, **kwargs):
12803 """
12804 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12805 int border, PyObject userData=None) -> GBSizerItem
12806
12807 Construct a `wx.GBSizerItem` for a window.
12808 """
12809 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12810 return val
12811
12812 def GBSizerItemSizer(*args, **kwargs):
12813 """
12814 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12815 int border, PyObject userData=None) -> GBSizerItem
12816
12817 Construct a `wx.GBSizerItem` for a sizer
12818 """
12819 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12820 return val
12821
12822 def GBSizerItemSpacer(*args, **kwargs):
12823 """
12824 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12825 int flag, int border, PyObject userData=None) -> GBSizerItem
12826
12827 Construct a `wx.GBSizerItem` for a spacer.
12828 """
12829 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12830 return val
12831
12832 class GridBagSizer(FlexGridSizer):
12833 """
12834 A `wx.Sizer` that can lay out items in a virtual grid like a
12835 `wx.FlexGridSizer` but in this case explicit positioning of the items
12836 is allowed using `wx.GBPosition`, and items can optionally span more
12837 than one row and/or column using `wx.GBSpan`. The total size of the
12838 virtual grid is determined by the largest row and column that items are
12839 positioned at, adjusted for spanning.
12840
12841 """
12842 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12843 __repr__ = _swig_repr
12844 def __init__(self, *args, **kwargs):
12845 """
12846 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12847
12848 Constructor, with optional parameters to specify the gap between the
12849 rows and columns.
12850 """
12851 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12852 self._setOORInfo(self)
12853
12854 def Add(*args, **kwargs):
12855 """
12856 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12857 int border=0, userData=None) -> wx.GBSizerItem
12858
12859 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12860 more than one row or column as specified with *span*. The remaining
12861 args behave similarly to `wx.Sizer.Add`.
12862
12863 Returns True if the item was successfully placed at the given cell
12864 position, False if something was already there.
12865
12866 """
12867 return _core_.GridBagSizer_Add(*args, **kwargs)
12868
12869 def AddItem(*args, **kwargs):
12870 """
12871 Add(self, GBSizerItem item) -> wx.GBSizerItem
12872
12873 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12874 the item was successfully placed at its given cell position, False if
12875 something was already there.
12876 """
12877 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12878
12879 def GetCellSize(*args, **kwargs):
12880 """
12881 GetCellSize(self, int row, int col) -> Size
12882
12883 Get the size of the specified cell, including hgap and
12884 vgap. Only valid after a Layout.
12885 """
12886 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12887
12888 def GetEmptyCellSize(*args, **kwargs):
12889 """
12890 GetEmptyCellSize(self) -> Size
12891
12892 Get the size used for cells in the grid with no item.
12893 """
12894 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12895
12896 def SetEmptyCellSize(*args, **kwargs):
12897 """
12898 SetEmptyCellSize(self, Size sz)
12899
12900 Set the size used for cells in the grid with no item.
12901 """
12902 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12903
12904 def GetItemPosition(*args):
12905 """
12906 GetItemPosition(self, item) -> GBPosition
12907
12908 Get the grid position of the specified *item* where *item* is either a
12909 window or subsizer that is a member of this sizer, or a zero-based
12910 index of an item.
12911 """
12912 return _core_.GridBagSizer_GetItemPosition(*args)
12913
12914 def SetItemPosition(*args):
12915 """
12916 SetItemPosition(self, item, GBPosition pos) -> bool
12917
12918 Set the grid position of the specified *item* where *item* is either a
12919 window or subsizer that is a member of this sizer, or a zero-based
12920 index of an item. Returns True on success. If the move is not
12921 allowed (because an item is already there) then False is returned.
12922
12923 """
12924 return _core_.GridBagSizer_SetItemPosition(*args)
12925
12926 def GetItemSpan(*args):
12927 """
12928 GetItemSpan(self, item) -> GBSpan
12929
12930 Get the row/col spanning of the specified *item* where *item* is
12931 either a window or subsizer that is a member of this sizer, or a
12932 zero-based index of an item.
12933 """
12934 return _core_.GridBagSizer_GetItemSpan(*args)
12935
12936 def SetItemSpan(*args):
12937 """
12938 SetItemSpan(self, item, GBSpan span) -> bool
12939
12940 Set the row/col spanning of the specified *item* where *item* is
12941 either a window or subsizer that is a member of this sizer, or a
12942 zero-based index of an item. Returns True on success. If the move is
12943 not allowed (because an item is already there) then False is returned.
12944 """
12945 return _core_.GridBagSizer_SetItemSpan(*args)
12946
12947 def FindItem(*args):
12948 """
12949 FindItem(self, item) -> GBSizerItem
12950
12951 Find the sizer item for the given window or subsizer, returns None if
12952 not found. (non-recursive)
12953 """
12954 return _core_.GridBagSizer_FindItem(*args)
12955
12956 def FindItemAtPosition(*args, **kwargs):
12957 """
12958 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12959
12960 Return the sizer item for the given grid cell, or None if there is no
12961 item at that position. (non-recursive)
12962 """
12963 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12964
12965 def FindItemAtPoint(*args, **kwargs):
12966 """
12967 FindItemAtPoint(self, Point pt) -> GBSizerItem
12968
12969 Return the sizer item located at the point given in *pt*, or None if
12970 there is no item at that point. The (x,y) coordinates in pt correspond
12971 to the client coordinates of the window using the sizer for
12972 layout. (non-recursive)
12973 """
12974 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12975
12976 def CheckForIntersection(*args, **kwargs):
12977 """
12978 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12979
12980 Look at all items and see if any intersect (or would overlap) the
12981 given *item*. Returns True if so, False if there would be no overlap.
12982 If an *excludeItem* is given then it will not be checked for
12983 intersection, for example it may be the item we are checking the
12984 position of.
12985
12986 """
12987 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12988
12989 def CheckForIntersectionPos(*args, **kwargs):
12990 """
12991 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12992
12993 Look at all items and see if any intersect (or would overlap) the
12994 given position and span. Returns True if so, False if there would be
12995 no overlap. If an *excludeItem* is given then it will not be checked
12996 for intersection, for example it may be the item we are checking the
12997 position of.
12998 """
12999 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
13000
13001 _core_.GridBagSizer_swigregister(GridBagSizer)
13002
13003 #---------------------------------------------------------------------------
13004
13005 Left = _core_.Left
13006 Top = _core_.Top
13007 Right = _core_.Right
13008 Bottom = _core_.Bottom
13009 Width = _core_.Width
13010 Height = _core_.Height
13011 Centre = _core_.Centre
13012 Center = _core_.Center
13013 CentreX = _core_.CentreX
13014 CentreY = _core_.CentreY
13015 Unconstrained = _core_.Unconstrained
13016 AsIs = _core_.AsIs
13017 PercentOf = _core_.PercentOf
13018 Above = _core_.Above
13019 Below = _core_.Below
13020 LeftOf = _core_.LeftOf
13021 RightOf = _core_.RightOf
13022 SameAs = _core_.SameAs
13023 Absolute = _core_.Absolute
13024 class IndividualLayoutConstraint(Object):
13025 """
13026 Objects of this class are stored in the `wx.LayoutConstraints` class as
13027 one of eight possible constraints that a window can be involved in.
13028 You will never need to create an instance of
13029 wx.IndividualLayoutConstraint, rather you should create a
13030 `wx.LayoutConstraints` instance and use the individual contstraints
13031 that it contains.
13032 """
13033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13034 def __init__(self): raise AttributeError, "No constructor defined"
13035 __repr__ = _swig_repr
13036 def Set(*args, **kwargs):
13037 """
13038 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13039
13040 Sets the properties of the constraint. Normally called by one of the
13041 convenience functions such as Above, RightOf, SameAs.
13042 """
13043 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13044
13045 def LeftOf(*args, **kwargs):
13046 """
13047 LeftOf(self, Window sibling, int marg=0)
13048
13049 Constrains this edge to be to the left of the given window, with an
13050 optional margin. Implicitly, this is relative to the left edge of the
13051 other window.
13052 """
13053 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13054
13055 def RightOf(*args, **kwargs):
13056 """
13057 RightOf(self, Window sibling, int marg=0)
13058
13059 Constrains this edge to be to the right of the given window, with an
13060 optional margin. Implicitly, this is relative to the right edge of the
13061 other window.
13062 """
13063 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13064
13065 def Above(*args, **kwargs):
13066 """
13067 Above(self, Window sibling, int marg=0)
13068
13069 Constrains this edge to be above the given window, with an optional
13070 margin. Implicitly, this is relative to the top edge of the other
13071 window.
13072 """
13073 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13074
13075 def Below(*args, **kwargs):
13076 """
13077 Below(self, Window sibling, int marg=0)
13078
13079 Constrains this edge to be below the given window, with an optional
13080 margin. Implicitly, this is relative to the bottom edge of the other
13081 window.
13082 """
13083 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13084
13085 def SameAs(*args, **kwargs):
13086 """
13087 SameAs(self, Window otherW, int edge, int marg=0)
13088
13089 Constrains this edge or dimension to be to the same as the edge of the
13090 given window, with an optional margin.
13091 """
13092 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13093
13094 def PercentOf(*args, **kwargs):
13095 """
13096 PercentOf(self, Window otherW, int wh, int per)
13097
13098 Constrains this edge or dimension to be to a percentage of the given
13099 window, with an optional margin.
13100 """
13101 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13102
13103 def Absolute(*args, **kwargs):
13104 """
13105 Absolute(self, int val)
13106
13107 Constrains this edge or dimension to be the given absolute value.
13108 """
13109 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13110
13111 def Unconstrained(*args, **kwargs):
13112 """
13113 Unconstrained(self)
13114
13115 Sets this edge or dimension to be unconstrained, that is, dependent on
13116 other edges and dimensions from which this value can be deduced.
13117 """
13118 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13119
13120 def AsIs(*args, **kwargs):
13121 """
13122 AsIs(self)
13123
13124 Sets this edge or constraint to be whatever the window's value is at
13125 the moment. If either of the width and height constraints are *as is*,
13126 the window will not be resized, but moved instead. This is important
13127 when considering panel items which are intended to have a default
13128 size, such as a button, which may take its size from the size of the
13129 button label.
13130 """
13131 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13132
13133 def GetOtherWindow(*args, **kwargs):
13134 """GetOtherWindow(self) -> Window"""
13135 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13136
13137 def GetMyEdge(*args, **kwargs):
13138 """GetMyEdge(self) -> int"""
13139 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13140
13141 def SetEdge(*args, **kwargs):
13142 """SetEdge(self, int which)"""
13143 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13144
13145 def SetValue(*args, **kwargs):
13146 """SetValue(self, int v)"""
13147 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13148
13149 def GetMargin(*args, **kwargs):
13150 """GetMargin(self) -> int"""
13151 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13152
13153 def SetMargin(*args, **kwargs):
13154 """SetMargin(self, int m)"""
13155 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13156
13157 def GetValue(*args, **kwargs):
13158 """GetValue(self) -> int"""
13159 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13160
13161 def GetPercent(*args, **kwargs):
13162 """GetPercent(self) -> int"""
13163 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13164
13165 def GetOtherEdge(*args, **kwargs):
13166 """GetOtherEdge(self) -> int"""
13167 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13168
13169 def GetDone(*args, **kwargs):
13170 """GetDone(self) -> bool"""
13171 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13172
13173 def SetDone(*args, **kwargs):
13174 """SetDone(self, bool d)"""
13175 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13176
13177 def GetRelationship(*args, **kwargs):
13178 """GetRelationship(self) -> int"""
13179 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13180
13181 def SetRelationship(*args, **kwargs):
13182 """SetRelationship(self, int r)"""
13183 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13184
13185 def ResetIfWin(*args, **kwargs):
13186 """
13187 ResetIfWin(self, Window otherW) -> bool
13188
13189 Reset constraint if it mentions otherWin
13190 """
13191 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13192
13193 def SatisfyConstraint(*args, **kwargs):
13194 """
13195 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13196
13197 Try to satisfy constraint
13198 """
13199 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13200
13201 def GetEdge(*args, **kwargs):
13202 """
13203 GetEdge(self, int which, Window thisWin, Window other) -> int
13204
13205 Get the value of this edge or dimension, or if this
13206 is not determinable, -1.
13207 """
13208 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13209
13210 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13211 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13212 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13213 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13214 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13215 Percent = property(GetPercent,doc="See `GetPercent`")
13216 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13217 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
13218 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
13219
13220 class LayoutConstraints(Object):
13221 """
13222 **Note:** constraints are now deprecated and you should use sizers
13223 instead.
13224
13225 Objects of this class can be associated with a window to define its
13226 layout constraints, with respect to siblings or its parent.
13227
13228 The class consists of the following eight constraints of class
13229 wx.IndividualLayoutConstraint, some or all of which should be accessed
13230 directly to set the appropriate constraints.
13231
13232 * left: represents the left hand edge of the window
13233 * right: represents the right hand edge of the window
13234 * top: represents the top edge of the window
13235 * bottom: represents the bottom edge of the window
13236 * width: represents the width of the window
13237 * height: represents the height of the window
13238 * centreX: represents the horizontal centre point of the window
13239 * centreY: represents the vertical centre point of the window
13240
13241 Most constraints are initially set to have the relationship
13242 wxUnconstrained, which means that their values should be calculated by
13243 looking at known constraints. The exceptions are width and height,
13244 which are set to wxAsIs to ensure that if the user does not specify a
13245 constraint, the existing width and height will be used, to be
13246 compatible with panel items which often have take a default size. If
13247 the constraint is ``wx.AsIs``, the dimension will not be changed.
13248
13249 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13250
13251 """
13252 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13253 __repr__ = _swig_repr
13254 left = property(_core_.LayoutConstraints_left_get)
13255 top = property(_core_.LayoutConstraints_top_get)
13256 right = property(_core_.LayoutConstraints_right_get)
13257 bottom = property(_core_.LayoutConstraints_bottom_get)
13258 width = property(_core_.LayoutConstraints_width_get)
13259 height = property(_core_.LayoutConstraints_height_get)
13260 centreX = property(_core_.LayoutConstraints_centreX_get)
13261 centreY = property(_core_.LayoutConstraints_centreY_get)
13262 def __init__(self, *args, **kwargs):
13263 """__init__(self) -> LayoutConstraints"""
13264 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13265 __swig_destroy__ = _core_.delete_LayoutConstraints
13266 __del__ = lambda self : None;
13267 def SatisfyConstraints(*args, **kwargs):
13268 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13269 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13270
13271 def AreSatisfied(*args, **kwargs):
13272 """AreSatisfied(self) -> bool"""
13273 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13274
13275 _core_.LayoutConstraints_swigregister(LayoutConstraints)
13276
13277 #----------------------------------------------------------------------------
13278
13279 # Use Python's bool constants if available, make some if not
13280 try:
13281 True
13282 except NameError:
13283 __builtins__.True = 1==1
13284 __builtins__.False = 1==0
13285 def bool(value): return not not value
13286 __builtins__.bool = bool
13287
13288
13289
13290 # workarounds for bad wxRTTI names
13291 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13292 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13293 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13294
13295
13296 #----------------------------------------------------------------------------
13297 # Load version numbers from __version__... Ensure that major and minor
13298 # versions are the same for both wxPython and wxWidgets.
13299
13300 from __version__ import *
13301 __version__ = VERSION_STRING
13302
13303 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13304 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
13305 if RELEASE_VERSION != _core_.RELEASE_VERSION:
13306 import warnings
13307 warnings.warn("wxPython/wxWidgets release number mismatch")
13308
13309 #----------------------------------------------------------------------------
13310
13311 # Set wxPython's default string<-->unicode conversion encoding from
13312 # the locale, but only if Python's default hasn't been changed. (We
13313 # assume that if the user has customized it already then that is the
13314 # encoding we need to use as well.)
13315 #
13316 # The encoding selected here is used when string or unicode objects
13317 # need to be converted in order to pass them to wxWidgets. Please be
13318 # aware that the default encoding within the same locale may be
13319 # slightly different on different platforms. For example, please see
13320 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13321 # between the common latin/roman encodings.
13322
13323 default = _sys.getdefaultencoding()
13324 if default == 'ascii':
13325 import locale
13326 import codecs
13327 try:
13328 default = locale.getdefaultlocale()[1]
13329 codecs.lookup(default)
13330 except (ValueError, LookupError, TypeError):
13331 default = _sys.getdefaultencoding()
13332 del locale
13333 del codecs
13334 if default:
13335 wx.SetDefaultPyEncoding(default)
13336 del default
13337
13338 #----------------------------------------------------------------------------
13339
13340 class PyDeadObjectError(AttributeError):
13341 pass
13342
13343 class _wxPyDeadObject(object):
13344 """
13345 Instances of wx objects that are OOR capable will have their __class__
13346 changed to this class when the C++ object is deleted. This should help
13347 prevent crashes due to referencing a bogus C++ pointer.
13348 """
13349 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13350 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13351
13352 def __repr__(self):
13353 if not hasattr(self, "_name"):
13354 self._name = "[unknown]"
13355 return self.reprStr % self._name
13356
13357 def __getattr__(self, *args):
13358 if not hasattr(self, "_name"):
13359 self._name = "[unknown]"
13360 raise PyDeadObjectError(self.attrStr % self._name)
13361
13362 def __nonzero__(self):
13363 return 0
13364
13365
13366
13367 class PyUnbornObjectError(AttributeError):
13368 pass
13369
13370 class _wxPyUnbornObject(object):
13371 """
13372 Some stock objects are created when the wx._core module is
13373 imported, but their C++ instance is not created until the wx.App
13374 object is created and initialized. These object instances will
13375 temporarily have their __class__ changed to this class so an
13376 exception will be raised if they are used before the C++ instance
13377 is ready.
13378 """
13379
13380 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13381 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13382
13383 def __repr__(self):
13384 #if not hasattr(self, "_name"):
13385 # self._name = "[unknown]"
13386 return self.reprStr #% self._name
13387
13388 def __getattr__(self, *args):
13389 #if not hasattr(self, "_name"):
13390 # self._name = "[unknown]"
13391 raise PyUnbornObjectError(self.attrStr) # % self._name )
13392
13393 def __nonzero__(self):
13394 return 0
13395
13396
13397 #----------------------------------------------------------------------------
13398
13399 def CallAfter(callable, *args, **kw):
13400 """
13401 Call the specified function after the current and pending event
13402 handlers have been completed. This is also good for making GUI
13403 method calls from non-GUI threads. Any extra positional or
13404 keyword args are passed on to the callable when it is called.
13405
13406 :see: `wx.FutureCall`
13407 """
13408 app = wx.GetApp()
13409 assert app is not None, 'No wx.App created yet'
13410
13411 if not hasattr(app, "_CallAfterId"):
13412 app._CallAfterId = wx.NewEventType()
13413 app.Connect(-1, -1, app._CallAfterId,
13414 lambda event: event.callable(*event.args, **event.kw) )
13415 evt = wx.PyEvent()
13416 evt.SetEventType(app._CallAfterId)
13417 evt.callable = callable
13418 evt.args = args
13419 evt.kw = kw
13420 wx.PostEvent(app, evt)
13421
13422 #----------------------------------------------------------------------------
13423
13424
13425 class FutureCall:
13426 """
13427 A convenience class for `wx.Timer`, that calls the given callable
13428 object once after the given amount of milliseconds, passing any
13429 positional or keyword args. The return value of the callable is
13430 availbale after it has been run with the `GetResult` method.
13431
13432 If you don't need to get the return value or restart the timer
13433 then there is no need to hold a reference to this object. It will
13434 hold a reference to itself while the timer is running (the timer
13435 has a reference to self.Notify) but the cycle will be broken when
13436 the timer completes, automatically cleaning up the wx.FutureCall
13437 object.
13438
13439 :see: `wx.CallAfter`
13440 """
13441 def __init__(self, millis, callable, *args, **kwargs):
13442 self.millis = millis
13443 self.callable = callable
13444 self.SetArgs(*args, **kwargs)
13445 self.runCount = 0
13446 self.running = False
13447 self.hasRun = False
13448 self.result = None
13449 self.timer = None
13450 self.Start()
13451
13452 def __del__(self):
13453 self.Stop()
13454
13455
13456 def Start(self, millis=None, *args, **kwargs):
13457 """
13458 (Re)start the timer
13459 """
13460 self.hasRun = False
13461 if millis is not None:
13462 self.millis = millis
13463 if args or kwargs:
13464 self.SetArgs(*args, **kwargs)
13465 self.Stop()
13466 self.timer = wx.PyTimer(self.Notify)
13467 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13468 self.running = True
13469 Restart = Start
13470
13471
13472 def Stop(self):
13473 """
13474 Stop and destroy the timer.
13475 """
13476 if self.timer is not None:
13477 self.timer.Stop()
13478 self.timer = None
13479
13480
13481 def GetInterval(self):
13482 if self.timer is not None:
13483 return self.timer.GetInterval()
13484 else:
13485 return 0
13486
13487
13488 def IsRunning(self):
13489 return self.timer is not None and self.timer.IsRunning()
13490
13491
13492 def SetArgs(self, *args, **kwargs):
13493 """
13494 (Re)set the args passed to the callable object. This is
13495 useful in conjunction with Restart if you want to schedule a
13496 new call to the same callable object but with different
13497 parameters.
13498 """
13499 self.args = args
13500 self.kwargs = kwargs
13501
13502
13503 def HasRun(self):
13504 return self.hasRun
13505
13506 def GetResult(self):
13507 return self.result
13508
13509 def Notify(self):
13510 """
13511 The timer has expired so call the callable.
13512 """
13513 if self.callable and getattr(self.callable, 'im_self', True):
13514 self.runCount += 1
13515 self.running = False
13516 self.result = self.callable(*self.args, **self.kwargs)
13517 self.hasRun = True
13518 if not self.running:
13519 # if it wasn't restarted, then cleanup
13520 wx.CallAfter(self.Stop)
13521
13522 Interval = property(GetInterval)
13523 Result = property(GetResult)
13524
13525
13526 #----------------------------------------------------------------------------
13527 # Control which items in this module should be documented by epydoc.
13528 # We allow only classes and functions, which will help reduce the size
13529 # of the docs by filtering out the zillions of constants, EVT objects,
13530 # and etc that don't make much sense by themselves, but are instead
13531 # documented (or will be) as part of the classes/functions/methods
13532 # where they should be used.
13533
13534 class __DocFilter:
13535 """
13536 A filter for epydoc that only allows non-Ptr classes and
13537 functions, in order to reduce the clutter in the API docs.
13538 """
13539 def __init__(self, globals):
13540 self._globals = globals
13541
13542 def __call__(self, name):
13543 import types
13544 obj = self._globals.get(name, None)
13545
13546 # only document classes and function
13547 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13548 return False
13549
13550 # skip other things that are private or will be documented as part of somethign else
13551 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13552 return False
13553
13554 # skip functions that are duplicates of static functions in a class
13555 if name.find('_') != -1:
13556 cls = self._globals.get(name.split('_')[0], None)
13557 methname = name.split('_')[1]
13558 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13559 return False
13560
13561 return True
13562
13563 #----------------------------------------------------------------------------
13564 #----------------------------------------------------------------------------
13565
13566 # Import other modules in this package that should show up in the
13567 # "core" wx namespace
13568 from _gdi import *
13569 from _windows import *
13570 from _controls import *
13571 from _misc import *
13572
13573 #----------------------------------------------------------------------------
13574 #----------------------------------------------------------------------------
13575
13576
13577