]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
More bakfile changes needed for bmpcbox. Rebaked.
[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 Layout_Default = _core_.Layout_Default
682 Layout_LeftToRight = _core_.Layout_LeftToRight
683 Layout_RightToLeft = _core_.Layout_RightToLeft
684 #---------------------------------------------------------------------------
685
686 class Object(object):
687 """
688 The base class for most wx objects, although in wxPython not
689 much functionality is needed nor exposed.
690 """
691 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
692 def __init__(self): raise AttributeError, "No constructor defined"
693 __repr__ = _swig_repr
694 def GetClassName(*args, **kwargs):
695 """
696 GetClassName(self) -> String
697
698 Returns the class name of the C++ class using wxRTTI.
699 """
700 return _core_.Object_GetClassName(*args, **kwargs)
701
702 def Destroy(*args, **kwargs):
703 """
704 Destroy(self)
705
706 Deletes the C++ object this Python object is a proxy for.
707 """
708 val = _core_.Object_Destroy(*args, **kwargs)
709 args[0].thisown = 0
710 return val
711
712 ClassName = property(GetClassName,doc="See `GetClassName`")
713 _core_.Object_swigregister(Object)
714 _wxPySetDictionary = _core_._wxPySetDictionary
715 cvar = _core_.cvar
716 EmptyString = cvar.EmptyString
717
718 #---------------------------------------------------------------------------
719
720 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
721 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
722 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
723 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
724 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
725 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
726 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
727 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
728 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
729 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
730 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
731 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
732 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
733 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
734 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
735 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
736 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
737 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
738 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
739 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
740 CURSOR_NONE = _core_.CURSOR_NONE
741 CURSOR_ARROW = _core_.CURSOR_ARROW
742 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
743 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
744 CURSOR_CHAR = _core_.CURSOR_CHAR
745 CURSOR_CROSS = _core_.CURSOR_CROSS
746 CURSOR_HAND = _core_.CURSOR_HAND
747 CURSOR_IBEAM = _core_.CURSOR_IBEAM
748 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
749 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
750 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
751 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
752 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
753 CURSOR_PENCIL = _core_.CURSOR_PENCIL
754 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
755 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
756 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
757 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
758 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
759 CURSOR_SIZENS = _core_.CURSOR_SIZENS
760 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
761 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
762 CURSOR_SIZING = _core_.CURSOR_SIZING
763 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
764 CURSOR_WAIT = _core_.CURSOR_WAIT
765 CURSOR_WATCH = _core_.CURSOR_WATCH
766 CURSOR_BLANK = _core_.CURSOR_BLANK
767 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
768 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
769 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
770 CURSOR_MAX = _core_.CURSOR_MAX
771 #---------------------------------------------------------------------------
772
773 class Size(object):
774 """
775 wx.Size is a useful data structure used to represent the size of
776 something. It simply contains integer width and height
777 properties. In most places in wxPython where a wx.Size is
778 expected a (width, height) tuple can be used instead.
779 """
780 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
781 __repr__ = _swig_repr
782 width = property(_core_.Size_width_get, _core_.Size_width_set)
783 height = property(_core_.Size_height_get, _core_.Size_height_set)
784 x = width; y = height
785 def __init__(self, *args, **kwargs):
786 """
787 __init__(self, int w=0, int h=0) -> Size
788
789 Creates a size object.
790 """
791 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
792 __swig_destroy__ = _core_.delete_Size
793 __del__ = lambda self : None;
794 def __eq__(*args, **kwargs):
795 """
796 __eq__(self, PyObject other) -> bool
797
798 Test for equality of wx.Size objects.
799 """
800 return _core_.Size___eq__(*args, **kwargs)
801
802 def __ne__(*args, **kwargs):
803 """
804 __ne__(self, PyObject other) -> bool
805
806 Test for inequality of wx.Size objects.
807 """
808 return _core_.Size___ne__(*args, **kwargs)
809
810 def __add__(*args, **kwargs):
811 """
812 __add__(self, Size sz) -> Size
813
814 Add sz's proprties to this and return the result.
815 """
816 return _core_.Size___add__(*args, **kwargs)
817
818 def __sub__(*args, **kwargs):
819 """
820 __sub__(self, Size sz) -> Size
821
822 Subtract sz's properties from this and return the result.
823 """
824 return _core_.Size___sub__(*args, **kwargs)
825
826 def IncTo(*args, **kwargs):
827 """
828 IncTo(self, Size sz)
829
830 Increments this object so that both of its dimensions are not less
831 than the corresponding dimensions of the size.
832 """
833 return _core_.Size_IncTo(*args, **kwargs)
834
835 def DecTo(*args, **kwargs):
836 """
837 DecTo(self, Size sz)
838
839 Decrements this object so that both of its dimensions are not greater
840 than the corresponding dimensions of the size.
841 """
842 return _core_.Size_DecTo(*args, **kwargs)
843
844 def Scale(*args, **kwargs):
845 """
846 Scale(self, float xscale, float yscale)
847
848 Scales the dimensions of this object by the given factors.
849 """
850 return _core_.Size_Scale(*args, **kwargs)
851
852 def Set(*args, **kwargs):
853 """
854 Set(self, int w, int h)
855
856 Set both width and height.
857 """
858 return _core_.Size_Set(*args, **kwargs)
859
860 def SetWidth(*args, **kwargs):
861 """SetWidth(self, int w)"""
862 return _core_.Size_SetWidth(*args, **kwargs)
863
864 def SetHeight(*args, **kwargs):
865 """SetHeight(self, int h)"""
866 return _core_.Size_SetHeight(*args, **kwargs)
867
868 def GetWidth(*args, **kwargs):
869 """GetWidth(self) -> int"""
870 return _core_.Size_GetWidth(*args, **kwargs)
871
872 def GetHeight(*args, **kwargs):
873 """GetHeight(self) -> int"""
874 return _core_.Size_GetHeight(*args, **kwargs)
875
876 def IsFullySpecified(*args, **kwargs):
877 """
878 IsFullySpecified(self) -> bool
879
880 Returns True if both components of the size are non-default values.
881 """
882 return _core_.Size_IsFullySpecified(*args, **kwargs)
883
884 def SetDefaults(*args, **kwargs):
885 """
886 SetDefaults(self, Size size)
887
888 Combine this size with the other one replacing the default components
889 of this object (i.e. equal to -1) with those of the other.
890 """
891 return _core_.Size_SetDefaults(*args, **kwargs)
892
893 def Get(*args, **kwargs):
894 """
895 Get() -> (width,height)
896
897 Returns the width and height properties as a tuple.
898 """
899 return _core_.Size_Get(*args, **kwargs)
900
901 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
902 def __str__(self): return str(self.Get())
903 def __repr__(self): return 'wx.Size'+str(self.Get())
904 def __len__(self): return len(self.Get())
905 def __getitem__(self, index): return self.Get()[index]
906 def __setitem__(self, index, val):
907 if index == 0: self.width = val
908 elif index == 1: self.height = val
909 else: raise IndexError
910 def __nonzero__(self): return self.Get() != (0,0)
911 __safe_for_unpickling__ = True
912 def __reduce__(self): return (wx.Size, self.Get())
913
914 _core_.Size_swigregister(Size)
915
916 #---------------------------------------------------------------------------
917
918 class RealPoint(object):
919 """
920 A data structure for representing a point or position with floating
921 point x and y properties. In wxPython most places that expect a
922 wx.RealPoint can also accept a (x,y) tuple.
923 """
924 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
925 __repr__ = _swig_repr
926 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
927 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
928 def __init__(self, *args, **kwargs):
929 """
930 __init__(self, double x=0.0, double y=0.0) -> RealPoint
931
932 Create a wx.RealPoint object
933 """
934 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
935 __swig_destroy__ = _core_.delete_RealPoint
936 __del__ = lambda self : None;
937 def __eq__(*args, **kwargs):
938 """
939 __eq__(self, PyObject other) -> bool
940
941 Test for equality of wx.RealPoint objects.
942 """
943 return _core_.RealPoint___eq__(*args, **kwargs)
944
945 def __ne__(*args, **kwargs):
946 """
947 __ne__(self, PyObject other) -> bool
948
949 Test for inequality of wx.RealPoint objects.
950 """
951 return _core_.RealPoint___ne__(*args, **kwargs)
952
953 def __add__(*args, **kwargs):
954 """
955 __add__(self, RealPoint pt) -> RealPoint
956
957 Add pt's proprties to this and return the result.
958 """
959 return _core_.RealPoint___add__(*args, **kwargs)
960
961 def __sub__(*args, **kwargs):
962 """
963 __sub__(self, RealPoint pt) -> RealPoint
964
965 Subtract pt's proprties from this and return the result
966 """
967 return _core_.RealPoint___sub__(*args, **kwargs)
968
969 def Set(*args, **kwargs):
970 """
971 Set(self, double x, double y)
972
973 Set both the x and y properties
974 """
975 return _core_.RealPoint_Set(*args, **kwargs)
976
977 def Get(*args, **kwargs):
978 """
979 Get() -> (x,y)
980
981 Return the x and y properties as a tuple.
982 """
983 return _core_.RealPoint_Get(*args, **kwargs)
984
985 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
986 def __str__(self): return str(self.Get())
987 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
988 def __len__(self): return len(self.Get())
989 def __getitem__(self, index): return self.Get()[index]
990 def __setitem__(self, index, val):
991 if index == 0: self.x = val
992 elif index == 1: self.y = val
993 else: raise IndexError
994 def __nonzero__(self): return self.Get() != (0.0, 0.0)
995 __safe_for_unpickling__ = True
996 def __reduce__(self): return (wx.RealPoint, self.Get())
997
998 _core_.RealPoint_swigregister(RealPoint)
999
1000 #---------------------------------------------------------------------------
1001
1002 class Point(object):
1003 """
1004 A data structure for representing a point or position with integer x
1005 and y properties. Most places in wxPython that expect a wx.Point can
1006 also accept a (x,y) tuple.
1007 """
1008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1009 __repr__ = _swig_repr
1010 x = property(_core_.Point_x_get, _core_.Point_x_set)
1011 y = property(_core_.Point_y_get, _core_.Point_y_set)
1012 def __init__(self, *args, **kwargs):
1013 """
1014 __init__(self, int x=0, int y=0) -> Point
1015
1016 Create a wx.Point object
1017 """
1018 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1019 __swig_destroy__ = _core_.delete_Point
1020 __del__ = lambda self : None;
1021 def __eq__(*args, **kwargs):
1022 """
1023 __eq__(self, PyObject other) -> bool
1024
1025 Test for equality of wx.Point objects.
1026 """
1027 return _core_.Point___eq__(*args, **kwargs)
1028
1029 def __ne__(*args, **kwargs):
1030 """
1031 __ne__(self, PyObject other) -> bool
1032
1033 Test for inequality of wx.Point objects.
1034 """
1035 return _core_.Point___ne__(*args, **kwargs)
1036
1037 def __add__(*args, **kwargs):
1038 """
1039 __add__(self, Point pt) -> Point
1040
1041 Add pt's proprties to this and return the result.
1042 """
1043 return _core_.Point___add__(*args, **kwargs)
1044
1045 def __sub__(*args, **kwargs):
1046 """
1047 __sub__(self, Point pt) -> Point
1048
1049 Subtract pt's proprties from this and return the result
1050 """
1051 return _core_.Point___sub__(*args, **kwargs)
1052
1053 def __iadd__(*args, **kwargs):
1054 """
1055 __iadd__(self, Point pt) -> Point
1056
1057 Add pt to this object.
1058 """
1059 return _core_.Point___iadd__(*args, **kwargs)
1060
1061 def __isub__(*args, **kwargs):
1062 """
1063 __isub__(self, Point pt) -> Point
1064
1065 Subtract pt from this object.
1066 """
1067 return _core_.Point___isub__(*args, **kwargs)
1068
1069 def Set(*args, **kwargs):
1070 """
1071 Set(self, long x, long y)
1072
1073 Set both the x and y properties
1074 """
1075 return _core_.Point_Set(*args, **kwargs)
1076
1077 def Get(*args, **kwargs):
1078 """
1079 Get() -> (x,y)
1080
1081 Return the x and y properties as a tuple.
1082 """
1083 return _core_.Point_Get(*args, **kwargs)
1084
1085 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1086 def __str__(self): return str(self.Get())
1087 def __repr__(self): return 'wx.Point'+str(self.Get())
1088 def __len__(self): return len(self.Get())
1089 def __getitem__(self, index): return self.Get()[index]
1090 def __setitem__(self, index, val):
1091 if index == 0: self.x = val
1092 elif index == 1: self.y = val
1093 else: raise IndexError
1094 def __nonzero__(self): return self.Get() != (0,0)
1095 __safe_for_unpickling__ = True
1096 def __reduce__(self): return (wx.Point, self.Get())
1097
1098 _core_.Point_swigregister(Point)
1099
1100 #---------------------------------------------------------------------------
1101
1102 class Rect(object):
1103 """
1104 A class for representing and manipulating rectangles. It has x, y,
1105 width and height properties. In wxPython most palces that expect a
1106 wx.Rect can also accept a (x,y,width,height) tuple.
1107 """
1108 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1109 __repr__ = _swig_repr
1110 def __init__(self, *args, **kwargs):
1111 """
1112 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1113
1114 Create a new Rect object.
1115 """
1116 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1117 __swig_destroy__ = _core_.delete_Rect
1118 __del__ = lambda self : None;
1119 def GetX(*args, **kwargs):
1120 """GetX(self) -> int"""
1121 return _core_.Rect_GetX(*args, **kwargs)
1122
1123 def SetX(*args, **kwargs):
1124 """SetX(self, int x)"""
1125 return _core_.Rect_SetX(*args, **kwargs)
1126
1127 def GetY(*args, **kwargs):
1128 """GetY(self) -> int"""
1129 return _core_.Rect_GetY(*args, **kwargs)
1130
1131 def SetY(*args, **kwargs):
1132 """SetY(self, int y)"""
1133 return _core_.Rect_SetY(*args, **kwargs)
1134
1135 def GetWidth(*args, **kwargs):
1136 """GetWidth(self) -> int"""
1137 return _core_.Rect_GetWidth(*args, **kwargs)
1138
1139 def SetWidth(*args, **kwargs):
1140 """SetWidth(self, int w)"""
1141 return _core_.Rect_SetWidth(*args, **kwargs)
1142
1143 def GetHeight(*args, **kwargs):
1144 """GetHeight(self) -> int"""
1145 return _core_.Rect_GetHeight(*args, **kwargs)
1146
1147 def SetHeight(*args, **kwargs):
1148 """SetHeight(self, int h)"""
1149 return _core_.Rect_SetHeight(*args, **kwargs)
1150
1151 def GetPosition(*args, **kwargs):
1152 """GetPosition(self) -> Point"""
1153 return _core_.Rect_GetPosition(*args, **kwargs)
1154
1155 def SetPosition(*args, **kwargs):
1156 """SetPosition(self, Point p)"""
1157 return _core_.Rect_SetPosition(*args, **kwargs)
1158
1159 def GetSize(*args, **kwargs):
1160 """GetSize(self) -> Size"""
1161 return _core_.Rect_GetSize(*args, **kwargs)
1162
1163 def SetSize(*args, **kwargs):
1164 """SetSize(self, Size s)"""
1165 return _core_.Rect_SetSize(*args, **kwargs)
1166
1167 def IsEmpty(*args, **kwargs):
1168 """IsEmpty(self) -> bool"""
1169 return _core_.Rect_IsEmpty(*args, **kwargs)
1170
1171 def GetTopLeft(*args, **kwargs):
1172 """GetTopLeft(self) -> Point"""
1173 return _core_.Rect_GetTopLeft(*args, **kwargs)
1174
1175 def SetTopLeft(*args, **kwargs):
1176 """SetTopLeft(self, Point p)"""
1177 return _core_.Rect_SetTopLeft(*args, **kwargs)
1178
1179 def GetBottomRight(*args, **kwargs):
1180 """GetBottomRight(self) -> Point"""
1181 return _core_.Rect_GetBottomRight(*args, **kwargs)
1182
1183 def SetBottomRight(*args, **kwargs):
1184 """SetBottomRight(self, Point p)"""
1185 return _core_.Rect_SetBottomRight(*args, **kwargs)
1186
1187 def GetTopRight(*args, **kwargs):
1188 """GetTopRight(self) -> Point"""
1189 return _core_.Rect_GetTopRight(*args, **kwargs)
1190
1191 def SetTopRight(*args, **kwargs):
1192 """SetTopRight(self, Point p)"""
1193 return _core_.Rect_SetTopRight(*args, **kwargs)
1194
1195 def GetBottomLeft(*args, **kwargs):
1196 """GetBottomLeft(self) -> Point"""
1197 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1198
1199 def SetBottomLeft(*args, **kwargs):
1200 """SetBottomLeft(self, Point p)"""
1201 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1202
1203 def GetLeft(*args, **kwargs):
1204 """GetLeft(self) -> int"""
1205 return _core_.Rect_GetLeft(*args, **kwargs)
1206
1207 def GetTop(*args, **kwargs):
1208 """GetTop(self) -> int"""
1209 return _core_.Rect_GetTop(*args, **kwargs)
1210
1211 def GetBottom(*args, **kwargs):
1212 """GetBottom(self) -> int"""
1213 return _core_.Rect_GetBottom(*args, **kwargs)
1214
1215 def GetRight(*args, **kwargs):
1216 """GetRight(self) -> int"""
1217 return _core_.Rect_GetRight(*args, **kwargs)
1218
1219 def SetLeft(*args, **kwargs):
1220 """SetLeft(self, int left)"""
1221 return _core_.Rect_SetLeft(*args, **kwargs)
1222
1223 def SetRight(*args, **kwargs):
1224 """SetRight(self, int right)"""
1225 return _core_.Rect_SetRight(*args, **kwargs)
1226
1227 def SetTop(*args, **kwargs):
1228 """SetTop(self, int top)"""
1229 return _core_.Rect_SetTop(*args, **kwargs)
1230
1231 def SetBottom(*args, **kwargs):
1232 """SetBottom(self, int bottom)"""
1233 return _core_.Rect_SetBottom(*args, **kwargs)
1234
1235 position = property(GetPosition, SetPosition)
1236 size = property(GetSize, SetSize)
1237 left = property(GetLeft, SetLeft)
1238 right = property(GetRight, SetRight)
1239 top = property(GetTop, SetTop)
1240 bottom = property(GetBottom, SetBottom)
1241
1242 def Inflate(*args, **kwargs):
1243 """
1244 Inflate(self, int dx, int dy) -> Rect
1245
1246 Increases the size of the rectangle.
1247
1248 The left border is moved farther left and the right border is moved
1249 farther right by ``dx``. The upper border is moved farther up and the
1250 bottom border is moved farther down by ``dy``. (Note the the width and
1251 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1252 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1253 opposite happens: the rectangle size decreases in the respective
1254 direction.
1255
1256 The change is made to the rectangle inplace, if instead you need a
1257 copy that is inflated, preserving the original then make the copy
1258 first::
1259
1260 copy = wx.Rect(*original)
1261 copy.Inflate(10,15)
1262
1263
1264 """
1265 return _core_.Rect_Inflate(*args, **kwargs)
1266
1267 def Deflate(*args, **kwargs):
1268 """
1269 Deflate(self, int dx, int dy) -> Rect
1270
1271 Decrease the rectangle size. This method is the opposite of `Inflate`
1272 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1273 `Inflate` for a full description.
1274 """
1275 return _core_.Rect_Deflate(*args, **kwargs)
1276
1277 def OffsetXY(*args, **kwargs):
1278 """
1279 OffsetXY(self, int dx, int dy)
1280
1281 Moves the rectangle by the specified offset. If dx is positive, the
1282 rectangle is moved to the right, if dy is positive, it is moved to the
1283 bottom, otherwise it is moved to the left or top respectively.
1284 """
1285 return _core_.Rect_OffsetXY(*args, **kwargs)
1286
1287 def Offset(*args, **kwargs):
1288 """
1289 Offset(self, Point pt)
1290
1291 Same as `OffsetXY` but uses dx,dy from Point
1292 """
1293 return _core_.Rect_Offset(*args, **kwargs)
1294
1295 def Intersect(*args, **kwargs):
1296 """
1297 Intersect(self, Rect rect) -> Rect
1298
1299 Returns the intersectsion of this rectangle and rect.
1300 """
1301 return _core_.Rect_Intersect(*args, **kwargs)
1302
1303 def Union(*args, **kwargs):
1304 """
1305 Union(self, Rect rect) -> Rect
1306
1307 Returns the union of this rectangle and rect.
1308 """
1309 return _core_.Rect_Union(*args, **kwargs)
1310
1311 def __add__(*args, **kwargs):
1312 """
1313 __add__(self, Rect rect) -> Rect
1314
1315 Add the properties of rect to this rectangle and return the result.
1316 """
1317 return _core_.Rect___add__(*args, **kwargs)
1318
1319 def __iadd__(*args, **kwargs):
1320 """
1321 __iadd__(self, Rect rect) -> Rect
1322
1323 Add the properties of rect to this rectangle, updating this rectangle.
1324 """
1325 return _core_.Rect___iadd__(*args, **kwargs)
1326
1327 def __eq__(*args, **kwargs):
1328 """
1329 __eq__(self, PyObject other) -> bool
1330
1331 Test for equality of wx.Rect objects.
1332 """
1333 return _core_.Rect___eq__(*args, **kwargs)
1334
1335 def __ne__(*args, **kwargs):
1336 """
1337 __ne__(self, PyObject other) -> bool
1338
1339 Test for inequality of wx.Rect objects.
1340 """
1341 return _core_.Rect___ne__(*args, **kwargs)
1342
1343 def ContainsXY(*args, **kwargs):
1344 """
1345 ContainsXY(self, int x, int y) -> bool
1346
1347 Return True if the point is inside the rect.
1348 """
1349 return _core_.Rect_ContainsXY(*args, **kwargs)
1350
1351 def Contains(*args, **kwargs):
1352 """
1353 Contains(self, Point pt) -> bool
1354
1355 Return True if the point is inside the rect.
1356 """
1357 return _core_.Rect_Contains(*args, **kwargs)
1358
1359 def ContainsRect(*args, **kwargs):
1360 """
1361 ContainsRect(self, Rect rect) -> bool
1362
1363 Returns ``True`` if the given rectangle is completely inside this
1364 rectangle or touches its boundary.
1365 """
1366 return _core_.Rect_ContainsRect(*args, **kwargs)
1367
1368 Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1369 InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1370 InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1371
1372 def Intersects(*args, **kwargs):
1373 """
1374 Intersects(self, Rect rect) -> bool
1375
1376 Returns True if the rectangles have a non empty intersection.
1377 """
1378 return _core_.Rect_Intersects(*args, **kwargs)
1379
1380 def CenterIn(*args, **kwargs):
1381 """
1382 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1383
1384 Center this rectangle within the one passed to the method, which is
1385 usually, but not necessarily, the larger one.
1386 """
1387 return _core_.Rect_CenterIn(*args, **kwargs)
1388
1389 CentreIn = CenterIn
1390 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1391 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1392 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1393 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1394 def Set(*args, **kwargs):
1395 """
1396 Set(self, int x=0, int y=0, int width=0, int height=0)
1397
1398 Set all rectangle properties.
1399 """
1400 return _core_.Rect_Set(*args, **kwargs)
1401
1402 def Get(*args, **kwargs):
1403 """
1404 Get() -> (x,y,width,height)
1405
1406 Return the rectangle properties as a tuple.
1407 """
1408 return _core_.Rect_Get(*args, **kwargs)
1409
1410 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1411 def __str__(self): return str(self.Get())
1412 def __repr__(self): return 'wx.Rect'+str(self.Get())
1413 def __len__(self): return len(self.Get())
1414 def __getitem__(self, index): return self.Get()[index]
1415 def __setitem__(self, index, val):
1416 if index == 0: self.x = val
1417 elif index == 1: self.y = val
1418 elif index == 2: self.width = val
1419 elif index == 3: self.height = val
1420 else: raise IndexError
1421 def __nonzero__(self): return self.Get() != (0,0,0,0)
1422 __safe_for_unpickling__ = True
1423 def __reduce__(self): return (wx.Rect, self.Get())
1424
1425 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1426 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
1427 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
1428 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1429 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1430 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1431 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1432 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1433 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1434 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
1435 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
1436 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1437 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1438 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1439 Empty = property(IsEmpty,doc="See `IsEmpty`")
1440 _core_.Rect_swigregister(Rect)
1441
1442 def RectPP(*args, **kwargs):
1443 """
1444 RectPP(Point topLeft, Point bottomRight) -> Rect
1445
1446 Create a new Rect object from Points representing two corners.
1447 """
1448 val = _core_.new_RectPP(*args, **kwargs)
1449 return val
1450
1451 def RectPS(*args, **kwargs):
1452 """
1453 RectPS(Point pos, Size size) -> Rect
1454
1455 Create a new Rect from a position and size.
1456 """
1457 val = _core_.new_RectPS(*args, **kwargs)
1458 return val
1459
1460 def RectS(*args, **kwargs):
1461 """
1462 RectS(Size size) -> Rect
1463
1464 Create a new Rect from a size only.
1465 """
1466 val = _core_.new_RectS(*args, **kwargs)
1467 return val
1468
1469
1470 def IntersectRect(*args, **kwargs):
1471 """
1472 IntersectRect(Rect r1, Rect r2) -> Rect
1473
1474 Calculate and return the intersection of r1 and r2.
1475 """
1476 return _core_.IntersectRect(*args, **kwargs)
1477 #---------------------------------------------------------------------------
1478
1479 class Point2D(object):
1480 """
1481 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1482 with floating point values.
1483 """
1484 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1485 __repr__ = _swig_repr
1486 def __init__(self, *args, **kwargs):
1487 """
1488 __init__(self, double x=0.0, double y=0.0) -> Point2D
1489
1490 Create a w.Point2D object.
1491 """
1492 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1493 def GetFloor(*args, **kwargs):
1494 """
1495 GetFloor() -> (x,y)
1496
1497 Convert to integer
1498 """
1499 return _core_.Point2D_GetFloor(*args, **kwargs)
1500
1501 def GetRounded(*args, **kwargs):
1502 """
1503 GetRounded() -> (x,y)
1504
1505 Convert to integer
1506 """
1507 return _core_.Point2D_GetRounded(*args, **kwargs)
1508
1509 def GetVectorLength(*args, **kwargs):
1510 """GetVectorLength(self) -> double"""
1511 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1512
1513 def GetVectorAngle(*args, **kwargs):
1514 """GetVectorAngle(self) -> double"""
1515 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1516
1517 def SetVectorLength(*args, **kwargs):
1518 """SetVectorLength(self, double length)"""
1519 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1520
1521 def SetVectorAngle(*args, **kwargs):
1522 """SetVectorAngle(self, double degrees)"""
1523 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1524
1525 def SetPolarCoordinates(self, angle, length):
1526 self.SetVectorLength(length)
1527 self.SetVectorAngle(angle)
1528 def Normalize(self):
1529 self.SetVectorLength(1.0)
1530
1531 def GetDistance(*args, **kwargs):
1532 """GetDistance(self, Point2D pt) -> double"""
1533 return _core_.Point2D_GetDistance(*args, **kwargs)
1534
1535 def GetDistanceSquare(*args, **kwargs):
1536 """GetDistanceSquare(self, Point2D pt) -> double"""
1537 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1538
1539 def GetDotProduct(*args, **kwargs):
1540 """GetDotProduct(self, Point2D vec) -> double"""
1541 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1542
1543 def GetCrossProduct(*args, **kwargs):
1544 """GetCrossProduct(self, Point2D vec) -> double"""
1545 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1546
1547 def __neg__(*args, **kwargs):
1548 """
1549 __neg__(self) -> Point2D
1550
1551 the reflection of this point
1552 """
1553 return _core_.Point2D___neg__(*args, **kwargs)
1554
1555 def __iadd__(*args, **kwargs):
1556 """__iadd__(self, Point2D pt) -> Point2D"""
1557 return _core_.Point2D___iadd__(*args, **kwargs)
1558
1559 def __isub__(*args, **kwargs):
1560 """__isub__(self, Point2D pt) -> Point2D"""
1561 return _core_.Point2D___isub__(*args, **kwargs)
1562
1563 def __imul__(*args, **kwargs):
1564 """__imul__(self, Point2D pt) -> Point2D"""
1565 return _core_.Point2D___imul__(*args, **kwargs)
1566
1567 def __idiv__(*args, **kwargs):
1568 """__idiv__(self, Point2D pt) -> Point2D"""
1569 return _core_.Point2D___idiv__(*args, **kwargs)
1570
1571 def __eq__(*args, **kwargs):
1572 """
1573 __eq__(self, PyObject other) -> bool
1574
1575 Test for equality of wx.Point2D objects.
1576 """
1577 return _core_.Point2D___eq__(*args, **kwargs)
1578
1579 def __ne__(*args, **kwargs):
1580 """
1581 __ne__(self, PyObject other) -> bool
1582
1583 Test for inequality of wx.Point2D objects.
1584 """
1585 return _core_.Point2D___ne__(*args, **kwargs)
1586
1587 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1588 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1589 def Set(*args, **kwargs):
1590 """Set(self, double x=0, double y=0)"""
1591 return _core_.Point2D_Set(*args, **kwargs)
1592
1593 def Get(*args, **kwargs):
1594 """
1595 Get() -> (x,y)
1596
1597 Return x and y properties as a tuple.
1598 """
1599 return _core_.Point2D_Get(*args, **kwargs)
1600
1601 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1602 def __str__(self): return str(self.Get())
1603 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1604 def __len__(self): return len(self.Get())
1605 def __getitem__(self, index): return self.Get()[index]
1606 def __setitem__(self, index, val):
1607 if index == 0: self.x = val
1608 elif index == 1: self.y = val
1609 else: raise IndexError
1610 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1611 __safe_for_unpickling__ = True
1612 def __reduce__(self): return (wx.Point2D, self.Get())
1613
1614 Floor = property(GetFloor,doc="See `GetFloor`")
1615 Rounded = property(GetRounded,doc="See `GetRounded`")
1616 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1617 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
1618 _core_.Point2D_swigregister(Point2D)
1619
1620 def Point2DCopy(*args, **kwargs):
1621 """
1622 Point2DCopy(Point2D pt) -> Point2D
1623
1624 Create a w.Point2D object.
1625 """
1626 val = _core_.new_Point2DCopy(*args, **kwargs)
1627 return val
1628
1629 def Point2DFromPoint(*args, **kwargs):
1630 """
1631 Point2DFromPoint(Point pt) -> Point2D
1632
1633 Create a w.Point2D object.
1634 """
1635 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1636 return val
1637
1638 #---------------------------------------------------------------------------
1639
1640 FromStart = _core_.FromStart
1641 FromCurrent = _core_.FromCurrent
1642 FromEnd = _core_.FromEnd
1643 class InputStream(object):
1644 """Proxy of C++ InputStream class"""
1645 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1646 __repr__ = _swig_repr
1647 def __init__(self, *args, **kwargs):
1648 """__init__(self, PyObject p) -> InputStream"""
1649 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1650 __swig_destroy__ = _core_.delete_InputStream
1651 __del__ = lambda self : None;
1652 def close(*args, **kwargs):
1653 """close(self)"""
1654 return _core_.InputStream_close(*args, **kwargs)
1655
1656 def flush(*args, **kwargs):
1657 """flush(self)"""
1658 return _core_.InputStream_flush(*args, **kwargs)
1659
1660 def eof(*args, **kwargs):
1661 """eof(self) -> bool"""
1662 return _core_.InputStream_eof(*args, **kwargs)
1663
1664 def read(*args, **kwargs):
1665 """read(self, int size=-1) -> PyObject"""
1666 return _core_.InputStream_read(*args, **kwargs)
1667
1668 def readline(*args, **kwargs):
1669 """readline(self, int size=-1) -> PyObject"""
1670 return _core_.InputStream_readline(*args, **kwargs)
1671
1672 def readlines(*args, **kwargs):
1673 """readlines(self, int sizehint=-1) -> PyObject"""
1674 return _core_.InputStream_readlines(*args, **kwargs)
1675
1676 def seek(*args, **kwargs):
1677 """seek(self, int offset, int whence=0)"""
1678 return _core_.InputStream_seek(*args, **kwargs)
1679
1680 def tell(*args, **kwargs):
1681 """tell(self) -> int"""
1682 return _core_.InputStream_tell(*args, **kwargs)
1683
1684 def Peek(*args, **kwargs):
1685 """Peek(self) -> char"""
1686 return _core_.InputStream_Peek(*args, **kwargs)
1687
1688 def GetC(*args, **kwargs):
1689 """GetC(self) -> char"""
1690 return _core_.InputStream_GetC(*args, **kwargs)
1691
1692 def LastRead(*args, **kwargs):
1693 """LastRead(self) -> size_t"""
1694 return _core_.InputStream_LastRead(*args, **kwargs)
1695
1696 def CanRead(*args, **kwargs):
1697 """CanRead(self) -> bool"""
1698 return _core_.InputStream_CanRead(*args, **kwargs)
1699
1700 def Eof(*args, **kwargs):
1701 """Eof(self) -> bool"""
1702 return _core_.InputStream_Eof(*args, **kwargs)
1703
1704 def Ungetch(*args, **kwargs):
1705 """Ungetch(self, char c) -> bool"""
1706 return _core_.InputStream_Ungetch(*args, **kwargs)
1707
1708 def SeekI(*args, **kwargs):
1709 """SeekI(self, long pos, int mode=FromStart) -> long"""
1710 return _core_.InputStream_SeekI(*args, **kwargs)
1711
1712 def TellI(*args, **kwargs):
1713 """TellI(self) -> long"""
1714 return _core_.InputStream_TellI(*args, **kwargs)
1715
1716 _core_.InputStream_swigregister(InputStream)
1717 DefaultPosition = cvar.DefaultPosition
1718 DefaultSize = cvar.DefaultSize
1719
1720 class OutputStream(object):
1721 """Proxy of C++ OutputStream class"""
1722 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1723 def __init__(self): raise AttributeError, "No constructor defined"
1724 __repr__ = _swig_repr
1725 def write(*args, **kwargs):
1726 """write(self, PyObject obj)"""
1727 return _core_.OutputStream_write(*args, **kwargs)
1728
1729 def LastWrite(*args, **kwargs):
1730 """LastWrite(self) -> size_t"""
1731 return _core_.OutputStream_LastWrite(*args, **kwargs)
1732
1733 _core_.OutputStream_swigregister(OutputStream)
1734
1735 #---------------------------------------------------------------------------
1736
1737 class FSFile(Object):
1738 """Proxy of C++ FSFile class"""
1739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1740 __repr__ = _swig_repr
1741 def __init__(self, *args, **kwargs):
1742 """
1743 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1744 DateTime modif) -> FSFile
1745 """
1746 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1747 __swig_destroy__ = _core_.delete_FSFile
1748 __del__ = lambda self : None;
1749 def GetStream(*args, **kwargs):
1750 """GetStream(self) -> InputStream"""
1751 return _core_.FSFile_GetStream(*args, **kwargs)
1752
1753 def DetachStream(*args, **kwargs):
1754 """DetachStream(self)"""
1755 return _core_.FSFile_DetachStream(*args, **kwargs)
1756
1757 def GetMimeType(*args, **kwargs):
1758 """GetMimeType(self) -> String"""
1759 return _core_.FSFile_GetMimeType(*args, **kwargs)
1760
1761 def GetLocation(*args, **kwargs):
1762 """GetLocation(self) -> String"""
1763 return _core_.FSFile_GetLocation(*args, **kwargs)
1764
1765 def GetAnchor(*args, **kwargs):
1766 """GetAnchor(self) -> String"""
1767 return _core_.FSFile_GetAnchor(*args, **kwargs)
1768
1769 def GetModificationTime(*args, **kwargs):
1770 """GetModificationTime(self) -> DateTime"""
1771 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1772
1773 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1774 Location = property(GetLocation,doc="See `GetLocation`")
1775 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1776 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1777 Stream = property(GetStream,doc="See `GetStream`")
1778 _core_.FSFile_swigregister(FSFile)
1779
1780 class CPPFileSystemHandler(object):
1781 """Proxy of C++ CPPFileSystemHandler class"""
1782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1783 def __init__(self): raise AttributeError, "No constructor defined"
1784 __repr__ = _swig_repr
1785 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1786 __del__ = lambda self : None;
1787 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1788
1789 class FileSystemHandler(CPPFileSystemHandler):
1790 """Proxy of C++ FileSystemHandler class"""
1791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1792 __repr__ = _swig_repr
1793 def __init__(self, *args, **kwargs):
1794 """__init__(self) -> FileSystemHandler"""
1795 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1796 self._setCallbackInfo(self, FileSystemHandler)
1797
1798 def _setCallbackInfo(*args, **kwargs):
1799 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1800 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1801
1802 def CanOpen(*args, **kwargs):
1803 """CanOpen(self, String location) -> bool"""
1804 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1805
1806 def OpenFile(*args, **kwargs):
1807 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1808 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1809
1810 def FindFirst(*args, **kwargs):
1811 """FindFirst(self, String spec, int flags=0) -> String"""
1812 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1813
1814 def FindNext(*args, **kwargs):
1815 """FindNext(self) -> String"""
1816 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1817
1818 def GetProtocol(*args, **kwargs):
1819 """GetProtocol(self, String location) -> String"""
1820 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1821
1822 def GetLeftLocation(*args, **kwargs):
1823 """GetLeftLocation(self, String location) -> String"""
1824 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1825
1826 def GetAnchor(*args, **kwargs):
1827 """GetAnchor(self, String location) -> String"""
1828 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1829
1830 def GetRightLocation(*args, **kwargs):
1831 """GetRightLocation(self, String location) -> String"""
1832 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1833
1834 def GetMimeTypeFromExt(*args, **kwargs):
1835 """GetMimeTypeFromExt(self, String location) -> String"""
1836 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1837
1838 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1839 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1840 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1841 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1842 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
1843 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1844
1845 class FileSystem(Object):
1846 """Proxy of C++ FileSystem class"""
1847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1848 __repr__ = _swig_repr
1849 def __init__(self, *args, **kwargs):
1850 """__init__(self) -> FileSystem"""
1851 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1852 __swig_destroy__ = _core_.delete_FileSystem
1853 __del__ = lambda self : None;
1854 def ChangePathTo(*args, **kwargs):
1855 """ChangePathTo(self, String location, bool is_dir=False)"""
1856 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1857
1858 def GetPath(*args, **kwargs):
1859 """GetPath(self) -> String"""
1860 return _core_.FileSystem_GetPath(*args, **kwargs)
1861
1862 def OpenFile(*args, **kwargs):
1863 """OpenFile(self, String location) -> FSFile"""
1864 return _core_.FileSystem_OpenFile(*args, **kwargs)
1865
1866 def FindFirst(*args, **kwargs):
1867 """FindFirst(self, String spec, int flags=0) -> String"""
1868 return _core_.FileSystem_FindFirst(*args, **kwargs)
1869
1870 def FindNext(*args, **kwargs):
1871 """FindNext(self) -> String"""
1872 return _core_.FileSystem_FindNext(*args, **kwargs)
1873
1874 def AddHandler(*args, **kwargs):
1875 """AddHandler(CPPFileSystemHandler handler)"""
1876 return _core_.FileSystem_AddHandler(*args, **kwargs)
1877
1878 AddHandler = staticmethod(AddHandler)
1879 def RemoveHandler(*args, **kwargs):
1880 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1881 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1882
1883 RemoveHandler = staticmethod(RemoveHandler)
1884 def CleanUpHandlers(*args, **kwargs):
1885 """CleanUpHandlers()"""
1886 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1887
1888 CleanUpHandlers = staticmethod(CleanUpHandlers)
1889 def FileNameToURL(*args, **kwargs):
1890 """FileNameToURL(String filename) -> String"""
1891 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1892
1893 FileNameToURL = staticmethod(FileNameToURL)
1894 def URLToFileName(*args, **kwargs):
1895 """URLToFileName(String url) -> String"""
1896 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1897
1898 URLToFileName = staticmethod(URLToFileName)
1899 Path = property(GetPath,doc="See `GetPath`")
1900 _core_.FileSystem_swigregister(FileSystem)
1901
1902 def FileSystem_AddHandler(*args, **kwargs):
1903 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1904 return _core_.FileSystem_AddHandler(*args, **kwargs)
1905
1906 def FileSystem_RemoveHandler(*args, **kwargs):
1907 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1908 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1909
1910 def FileSystem_CleanUpHandlers(*args):
1911 """FileSystem_CleanUpHandlers()"""
1912 return _core_.FileSystem_CleanUpHandlers(*args)
1913
1914 def FileSystem_FileNameToURL(*args, **kwargs):
1915 """FileSystem_FileNameToURL(String filename) -> String"""
1916 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1917
1918 def FileSystem_URLToFileName(*args, **kwargs):
1919 """FileSystem_URLToFileName(String url) -> String"""
1920 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1921
1922 class InternetFSHandler(CPPFileSystemHandler):
1923 """Proxy of C++ InternetFSHandler class"""
1924 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1925 __repr__ = _swig_repr
1926 def __init__(self, *args, **kwargs):
1927 """__init__(self) -> InternetFSHandler"""
1928 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1929 def CanOpen(*args, **kwargs):
1930 """CanOpen(self, String location) -> bool"""
1931 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1932
1933 def OpenFile(*args, **kwargs):
1934 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1935 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1936
1937 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1938
1939 class ZipFSHandler(CPPFileSystemHandler):
1940 """Proxy of C++ ZipFSHandler class"""
1941 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1942 __repr__ = _swig_repr
1943 def __init__(self, *args, **kwargs):
1944 """__init__(self) -> ZipFSHandler"""
1945 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1946 def CanOpen(*args, **kwargs):
1947 """CanOpen(self, String location) -> bool"""
1948 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1949
1950 def OpenFile(*args, **kwargs):
1951 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1952 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1953
1954 def FindFirst(*args, **kwargs):
1955 """FindFirst(self, String spec, int flags=0) -> String"""
1956 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1957
1958 def FindNext(*args, **kwargs):
1959 """FindNext(self) -> String"""
1960 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1961
1962 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1963
1964
1965 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1966 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1967 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1968
1969 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1970 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1971 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1972
1973 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1974 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1975 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1976 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1977 """
1978 Add 'file' to the memory filesystem. The dataItem parameter can
1979 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1980 arbitrary data. If a bitmap or image is used then the imgType
1981 parameter should specify what kind of image file it should be
1982 written as, wx.BITMAP_TYPE_PNG, etc.
1983 """
1984 if isinstance(dataItem, wx.Image):
1985 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1986 elif isinstance(dataItem, wx.Bitmap):
1987 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1988 elif type(dataItem) == str:
1989 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1990 else:
1991 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1992
1993 class MemoryFSHandler(CPPFileSystemHandler):
1994 """Proxy of C++ MemoryFSHandler class"""
1995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1996 __repr__ = _swig_repr
1997 def __init__(self, *args, **kwargs):
1998 """__init__(self) -> MemoryFSHandler"""
1999 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
2000 def RemoveFile(*args, **kwargs):
2001 """RemoveFile(String filename)"""
2002 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2003
2004 RemoveFile = staticmethod(RemoveFile)
2005 AddFile = staticmethod(MemoryFSHandler_AddFile)
2006 def CanOpen(*args, **kwargs):
2007 """CanOpen(self, String location) -> bool"""
2008 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2009
2010 def OpenFile(*args, **kwargs):
2011 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2012 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2013
2014 def FindFirst(*args, **kwargs):
2015 """FindFirst(self, String spec, int flags=0) -> String"""
2016 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2017
2018 def FindNext(*args, **kwargs):
2019 """FindNext(self) -> String"""
2020 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2021
2022 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
2023
2024 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2025 """MemoryFSHandler_RemoveFile(String filename)"""
2026 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2027
2028 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2029 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2030 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2031 #---------------------------------------------------------------------------
2032
2033 class ImageHandler(Object):
2034 """
2035 This is the base class for implementing image file loading/saving, and
2036 image creation from data. It is used within `wx.Image` and is not
2037 normally seen by the application.
2038 """
2039 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2040 def __init__(self): raise AttributeError, "No constructor defined"
2041 __repr__ = _swig_repr
2042 def GetName(*args, **kwargs):
2043 """GetName(self) -> String"""
2044 return _core_.ImageHandler_GetName(*args, **kwargs)
2045
2046 def GetExtension(*args, **kwargs):
2047 """GetExtension(self) -> String"""
2048 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2049
2050 def GetType(*args, **kwargs):
2051 """GetType(self) -> long"""
2052 return _core_.ImageHandler_GetType(*args, **kwargs)
2053
2054 def GetMimeType(*args, **kwargs):
2055 """GetMimeType(self) -> String"""
2056 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2057
2058 def CanRead(*args, **kwargs):
2059 """CanRead(self, String name) -> bool"""
2060 return _core_.ImageHandler_CanRead(*args, **kwargs)
2061
2062 def CanReadStream(*args, **kwargs):
2063 """CanReadStream(self, InputStream stream) -> bool"""
2064 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2065
2066 def SetName(*args, **kwargs):
2067 """SetName(self, String name)"""
2068 return _core_.ImageHandler_SetName(*args, **kwargs)
2069
2070 def SetExtension(*args, **kwargs):
2071 """SetExtension(self, String extension)"""
2072 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2073
2074 def SetType(*args, **kwargs):
2075 """SetType(self, long type)"""
2076 return _core_.ImageHandler_SetType(*args, **kwargs)
2077
2078 def SetMimeType(*args, **kwargs):
2079 """SetMimeType(self, String mimetype)"""
2080 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2081
2082 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2083 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2084 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2085 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2086 _core_.ImageHandler_swigregister(ImageHandler)
2087
2088 class PyImageHandler(ImageHandler):
2089 """
2090 This is the base class for implementing image file loading/saving, and
2091 image creation from data, all written in Python. To create a custom
2092 image handler derive a new class from wx.PyImageHandler and provide
2093 the following methods::
2094
2095 def DoCanRead(self, stream) --> bool
2096 '''Check if this handler can read the image on the stream'''
2097
2098 def LoadFile(self, image, stream, verbose, index) --> bool
2099 '''Load image data from the stream and load it into image.'''
2100
2101 def SaveFile(self, image, stream, verbose) --> bool
2102 '''Save the iamge data in image to the stream using
2103 this handler's image file format.'''
2104
2105 def GetImageCount(self, stream) --> int
2106 '''If this image format can hold more than one image,
2107 how many does the image on the stream have?'''
2108
2109 To activate your handler create an instance of it and pass it to
2110 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2111 `SetExtension` from your constructor.
2112
2113 """
2114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2115 __repr__ = _swig_repr
2116 def __init__(self, *args, **kwargs):
2117 """
2118 __init__(self) -> PyImageHandler
2119
2120 This is the base class for implementing image file loading/saving, and
2121 image creation from data, all written in Python. To create a custom
2122 image handler derive a new class from wx.PyImageHandler and provide
2123 the following methods::
2124
2125 def DoCanRead(self, stream) --> bool
2126 '''Check if this handler can read the image on the stream'''
2127
2128 def LoadFile(self, image, stream, verbose, index) --> bool
2129 '''Load image data from the stream and load it into image.'''
2130
2131 def SaveFile(self, image, stream, verbose) --> bool
2132 '''Save the iamge data in image to the stream using
2133 this handler's image file format.'''
2134
2135 def GetImageCount(self, stream) --> int
2136 '''If this image format can hold more than one image,
2137 how many does the image on the stream have?'''
2138
2139 To activate your handler create an instance of it and pass it to
2140 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2141 `SetExtension` from your constructor.
2142
2143 """
2144 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2145 self._SetSelf(self)
2146
2147 def _SetSelf(*args, **kwargs):
2148 """_SetSelf(self, PyObject self)"""
2149 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2150
2151 _core_.PyImageHandler_swigregister(PyImageHandler)
2152
2153 class ImageHistogram(object):
2154 """Proxy of C++ ImageHistogram class"""
2155 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2156 __repr__ = _swig_repr
2157 def __init__(self, *args, **kwargs):
2158 """__init__(self) -> ImageHistogram"""
2159 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2160 def MakeKey(*args, **kwargs):
2161 """
2162 MakeKey(byte r, byte g, byte b) -> unsigned long
2163
2164 Get the key in the histogram for the given RGB values
2165 """
2166 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2167
2168 MakeKey = staticmethod(MakeKey)
2169 def FindFirstUnusedColour(*args, **kwargs):
2170 """
2171 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2172
2173 Find first colour that is not used in the image and has higher RGB
2174 values than startR, startG, startB. Returns a tuple consisting of a
2175 success flag and rgb values.
2176 """
2177 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2178
2179 def GetCount(*args, **kwargs):
2180 """
2181 GetCount(self, unsigned long key) -> unsigned long
2182
2183 Returns the pixel count for the given key. Use `MakeKey` to create a
2184 key value from a RGB tripple.
2185 """
2186 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2187
2188 def GetCountRGB(*args, **kwargs):
2189 """
2190 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2191
2192 Returns the pixel count for the given RGB values.
2193 """
2194 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2195
2196 def GetCountColour(*args, **kwargs):
2197 """
2198 GetCountColour(self, Colour colour) -> unsigned long
2199
2200 Returns the pixel count for the given `wx.Colour` value.
2201 """
2202 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2203
2204 _core_.ImageHistogram_swigregister(ImageHistogram)
2205
2206 def ImageHistogram_MakeKey(*args, **kwargs):
2207 """
2208 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2209
2210 Get the key in the histogram for the given RGB values
2211 """
2212 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2213
2214 class Image_RGBValue(object):
2215 """
2216 An object that contains values for red, green and blue which represent
2217 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, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2226
2227 Constructor.
2228 """
2229 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2230 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2231 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2232 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2233 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2234
2235 class Image_HSVValue(object):
2236 """
2237 An object that contains values for hue, saturation and value which
2238 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2239 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2240 color space.
2241 """
2242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2243 __repr__ = _swig_repr
2244 def __init__(self, *args, **kwargs):
2245 """
2246 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2247
2248 Constructor.
2249 """
2250 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2251 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2252 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2253 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2254 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2255
2256 class Image(Object):
2257 """
2258 A platform-independent image class. An image can be created from
2259 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2260 variety of formats. Functions are available to set and get image
2261 bits, so it can be used for basic image manipulation.
2262
2263 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2264 platform-specific `wx.Bitmap` object must be created from it using the
2265 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2266 device context, using `wx.DC.DrawBitmap`.
2267
2268 One colour value of the image may be used as a mask colour which will
2269 lead to the automatic creation of a `wx.Mask` object associated to the
2270 bitmap object.
2271
2272 wx.Image supports alpha channel data, that is in addition to a byte
2273 for the red, green and blue colour components for each pixel it also
2274 stores a byte representing the pixel opacity. An alpha value of 0
2275 corresponds to a transparent pixel (null opacity) while a value of 255
2276 means that the pixel is 100% opaque.
2277
2278 Unlike RGB data, not all images have an alpha channel and before using
2279 `GetAlpha` you should check if this image contains an alpha channel
2280 with `HasAlpha`. Note that currently only images loaded from PNG files
2281 with transparency information will have an alpha channel.
2282 """
2283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2284 __repr__ = _swig_repr
2285 def __init__(self, *args, **kwargs):
2286 """
2287 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2288
2289 Loads an image from a file.
2290 """
2291 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2292 __swig_destroy__ = _core_.delete_Image
2293 __del__ = lambda self : None;
2294 def Create(*args, **kwargs):
2295 """
2296 Create(self, int width, int height, bool clear=True)
2297
2298 Creates a fresh image. If clear is ``True``, the new image will be
2299 initialized to black. Otherwise, the image data will be uninitialized.
2300 """
2301 return _core_.Image_Create(*args, **kwargs)
2302
2303 def Destroy(*args, **kwargs):
2304 """
2305 Destroy(self)
2306
2307 Destroys the image data.
2308 """
2309 val = _core_.Image_Destroy(*args, **kwargs)
2310 args[0].thisown = 0
2311 return val
2312
2313 def Scale(*args, **kwargs):
2314 """
2315 Scale(self, int width, int height) -> Image
2316
2317 Returns a scaled version of the image. This is also useful for scaling
2318 bitmaps in general as the only other way to scale bitmaps is to blit a
2319 `wx.MemoryDC` into another `wx.MemoryDC`.
2320 """
2321 return _core_.Image_Scale(*args, **kwargs)
2322
2323 def ShrinkBy(*args, **kwargs):
2324 """
2325 ShrinkBy(self, int xFactor, int yFactor) -> Image
2326
2327 Return a version of the image scaled smaller by the given factors.
2328 """
2329 return _core_.Image_ShrinkBy(*args, **kwargs)
2330
2331 def Rescale(*args, **kwargs):
2332 """
2333 Rescale(self, int width, int height) -> Image
2334
2335 Changes the size of the image in-place by scaling it: after a call to
2336 this function, the image will have the given width and height.
2337
2338 Returns the (modified) image itself.
2339 """
2340 return _core_.Image_Rescale(*args, **kwargs)
2341
2342 def Resize(*args, **kwargs):
2343 """
2344 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2345
2346 Changes the size of the image in-place without scaling it, by adding
2347 either a border with the given colour or cropping as necessary. The
2348 image is pasted into a new image with the given size and background
2349 colour at the position pos relative to the upper left of the new
2350 image. If red = green = blue = -1 then use either the current mask
2351 colour if set or find, use, and set a suitable mask colour for any
2352 newly exposed areas.
2353
2354 Returns the (modified) image itself.
2355 """
2356 return _core_.Image_Resize(*args, **kwargs)
2357
2358 def SetRGB(*args, **kwargs):
2359 """
2360 SetRGB(self, int x, int y, byte r, byte g, byte b)
2361
2362 Sets the pixel at the given coordinate. This routine performs
2363 bounds-checks for the coordinate so it can be considered a safe way to
2364 manipulate the data, but in some cases this might be too slow so that
2365 the data will have to be set directly. In that case you will have to
2366 get access to the image data using the `GetData` method.
2367 """
2368 return _core_.Image_SetRGB(*args, **kwargs)
2369
2370 def SetRGBRect(*args, **kwargs):
2371 """
2372 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2373
2374 Sets the colour of the pixels within the given rectangle. This routine
2375 performs bounds-checks for the rectangle so it can be considered a
2376 safe way to manipulate the data.
2377 """
2378 return _core_.Image_SetRGBRect(*args, **kwargs)
2379
2380 def GetRed(*args, **kwargs):
2381 """
2382 GetRed(self, int x, int y) -> byte
2383
2384 Returns the red intensity at the given coordinate.
2385 """
2386 return _core_.Image_GetRed(*args, **kwargs)
2387
2388 def GetGreen(*args, **kwargs):
2389 """
2390 GetGreen(self, int x, int y) -> byte
2391
2392 Returns the green intensity at the given coordinate.
2393 """
2394 return _core_.Image_GetGreen(*args, **kwargs)
2395
2396 def GetBlue(*args, **kwargs):
2397 """
2398 GetBlue(self, int x, int y) -> byte
2399
2400 Returns the blue intensity at the given coordinate.
2401 """
2402 return _core_.Image_GetBlue(*args, **kwargs)
2403
2404 def SetAlpha(*args, **kwargs):
2405 """
2406 SetAlpha(self, int x, int y, byte alpha)
2407
2408 Sets the alpha value for the given pixel. This function should only be
2409 called if the image has alpha channel data, use `HasAlpha` to check
2410 for this.
2411 """
2412 return _core_.Image_SetAlpha(*args, **kwargs)
2413
2414 def GetAlpha(*args, **kwargs):
2415 """
2416 GetAlpha(self, int x, int y) -> byte
2417
2418 Returns the alpha value for the given pixel. This function may only be
2419 called for the images with alpha channel, use `HasAlpha` to check for
2420 this.
2421
2422 The returned value is the *opacity* of the image, i.e. the value of 0
2423 corresponds to the fully transparent pixels while the value of 255 to
2424 the fully opaque pixels.
2425 """
2426 return _core_.Image_GetAlpha(*args, **kwargs)
2427
2428 def HasAlpha(*args, **kwargs):
2429 """
2430 HasAlpha(self) -> bool
2431
2432 Returns true if this image has alpha channel, false otherwise.
2433 """
2434 return _core_.Image_HasAlpha(*args, **kwargs)
2435
2436 def InitAlpha(*args, **kwargs):
2437 """
2438 InitAlpha(self)
2439
2440 Initializes the image alpha channel data. It is an error to call it if
2441 the image already has alpha data. If it doesn't, alpha data will be by
2442 default initialized to all pixels being fully opaque. But if the image
2443 has a a mask colour, all mask pixels will be completely transparent.
2444 """
2445 return _core_.Image_InitAlpha(*args, **kwargs)
2446
2447 def IsTransparent(*args, **kwargs):
2448 """
2449 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2450
2451 Returns ``True`` if this pixel is masked or has an alpha value less
2452 than the spcified threshold.
2453 """
2454 return _core_.Image_IsTransparent(*args, **kwargs)
2455
2456 def FindFirstUnusedColour(*args, **kwargs):
2457 """
2458 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2459
2460 Find first colour that is not used in the image and has higher RGB
2461 values than startR, startG, startB. Returns a tuple consisting of a
2462 success flag and rgb values.
2463 """
2464 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2465
2466 def ConvertAlphaToMask(*args, **kwargs):
2467 """
2468 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2469
2470 If the image has alpha channel, this method converts it to mask. All
2471 pixels with alpha value less than ``threshold`` are replaced with the
2472 mask colour and the alpha channel is removed. The mask colour is
2473 chosen automatically using `FindFirstUnusedColour`.
2474
2475 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2476 nothing.
2477 """
2478 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2479
2480 def ConvertColourToAlpha(*args, **kwargs):
2481 """
2482 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2483
2484 This method converts an image where the original alpha information is
2485 only available as a shades of a colour (actually shades of grey)
2486 typically when you draw anti-aliased text into a bitmap. The DC
2487 drawing routines draw grey values on the black background although
2488 they actually mean to draw white with differnt alpha values. This
2489 method reverses it, assuming a black (!) background and white text.
2490 The method will then fill up the whole image with the colour given.
2491 """
2492 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2493
2494 def SetMaskFromImage(*args, **kwargs):
2495 """
2496 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2497
2498 Sets the image's mask so that the pixels that have RGB value of
2499 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2500 by first finding an unused colour in the image, setting this colour as
2501 the mask colour and then using this colour to draw all pixels in the
2502 image who corresponding pixel in mask has given RGB value.
2503
2504 Returns ``False`` if ``mask`` does not have same dimensions as the
2505 image or if there is no unused colour left. Returns ``True`` if the
2506 mask was successfully applied.
2507
2508 Note that this method involves computing the histogram, which is
2509 computationally intensive operation.
2510 """
2511 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2512
2513 def CanRead(*args, **kwargs):
2514 """
2515 CanRead(String filename) -> bool
2516
2517 Returns True if the image handlers can read this file.
2518 """
2519 return _core_.Image_CanRead(*args, **kwargs)
2520
2521 CanRead = staticmethod(CanRead)
2522 def GetImageCount(*args, **kwargs):
2523 """
2524 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2525
2526 If the image file contains more than one image and the image handler
2527 is capable of retrieving these individually, this function will return
2528 the number of available images.
2529 """
2530 return _core_.Image_GetImageCount(*args, **kwargs)
2531
2532 GetImageCount = staticmethod(GetImageCount)
2533 def LoadFile(*args, **kwargs):
2534 """
2535 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2536
2537 Loads an image from a file. If no handler type is provided, the
2538 library will try to autodetect the format.
2539 """
2540 return _core_.Image_LoadFile(*args, **kwargs)
2541
2542 def LoadMimeFile(*args, **kwargs):
2543 """
2544 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2545
2546 Loads an image from a file, specifying the image type with a MIME type
2547 string.
2548 """
2549 return _core_.Image_LoadMimeFile(*args, **kwargs)
2550
2551 def SaveFile(*args, **kwargs):
2552 """
2553 SaveFile(self, String name, int type) -> bool
2554
2555 Saves an image in the named file.
2556 """
2557 return _core_.Image_SaveFile(*args, **kwargs)
2558
2559 def SaveMimeFile(*args, **kwargs):
2560 """
2561 SaveMimeFile(self, String name, String mimetype) -> bool
2562
2563 Saves an image in the named file.
2564 """
2565 return _core_.Image_SaveMimeFile(*args, **kwargs)
2566
2567 def CanReadStream(*args, **kwargs):
2568 """
2569 CanReadStream(InputStream stream) -> bool
2570
2571 Returns True if the image handlers can read an image file from the
2572 data currently on the input stream, or a readable Python file-like
2573 object.
2574 """
2575 return _core_.Image_CanReadStream(*args, **kwargs)
2576
2577 CanReadStream = staticmethod(CanReadStream)
2578 def LoadStream(*args, **kwargs):
2579 """
2580 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2581
2582 Loads an image from an input stream or a readable Python file-like
2583 object. If no handler type is provided, the library will try to
2584 autodetect the format.
2585 """
2586 return _core_.Image_LoadStream(*args, **kwargs)
2587
2588 def LoadMimeStream(*args, **kwargs):
2589 """
2590 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2591
2592 Loads an image from an input stream or a readable Python file-like
2593 object, using a MIME type string to specify the image file format.
2594 """
2595 return _core_.Image_LoadMimeStream(*args, **kwargs)
2596
2597 def Ok(*args, **kwargs):
2598 """
2599 Ok(self) -> bool
2600
2601 Returns true if image data is present.
2602 """
2603 return _core_.Image_Ok(*args, **kwargs)
2604
2605 def GetWidth(*args, **kwargs):
2606 """
2607 GetWidth(self) -> int
2608
2609 Gets the width of the image in pixels.
2610 """
2611 return _core_.Image_GetWidth(*args, **kwargs)
2612
2613 def GetHeight(*args, **kwargs):
2614 """
2615 GetHeight(self) -> int
2616
2617 Gets the height of the image in pixels.
2618 """
2619 return _core_.Image_GetHeight(*args, **kwargs)
2620
2621 def GetSize(*args, **kwargs):
2622 """
2623 GetSize(self) -> Size
2624
2625 Returns the size of the image in pixels.
2626 """
2627 return _core_.Image_GetSize(*args, **kwargs)
2628
2629 def GetSubImage(*args, **kwargs):
2630 """
2631 GetSubImage(self, Rect rect) -> Image
2632
2633 Returns a sub image of the current one as long as the rect belongs
2634 entirely to the image.
2635 """
2636 return _core_.Image_GetSubImage(*args, **kwargs)
2637
2638 def Size(*args, **kwargs):
2639 """
2640 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2641
2642 Returns a resized version of this image without scaling it by adding
2643 either a border with the given colour or cropping as necessary. The
2644 image is pasted into a new image with the given size and background
2645 colour at the position ``pos`` relative to the upper left of the new
2646 image. If red = green = blue = -1 then use either the current mask
2647 colour if set or find, use, and set a suitable mask colour for any
2648 newly exposed areas.
2649 """
2650 return _core_.Image_Size(*args, **kwargs)
2651
2652 def Copy(*args, **kwargs):
2653 """
2654 Copy(self) -> Image
2655
2656 Returns an identical copy of the image.
2657 """
2658 return _core_.Image_Copy(*args, **kwargs)
2659
2660 def Paste(*args, **kwargs):
2661 """
2662 Paste(self, Image image, int x, int y)
2663
2664 Pastes ``image`` into this instance and takes care of the mask colour
2665 and any out of bounds problems.
2666 """
2667 return _core_.Image_Paste(*args, **kwargs)
2668
2669 def GetData(*args, **kwargs):
2670 """
2671 GetData(self) -> PyObject
2672
2673 Returns a string containing a copy of the RGB bytes of the image.
2674 """
2675 return _core_.Image_GetData(*args, **kwargs)
2676
2677 def SetData(*args, **kwargs):
2678 """
2679 SetData(self, buffer data)
2680
2681 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2682 either a string or a buffer object holding the data and the length of
2683 the data must be width*height*3.
2684 """
2685 return _core_.Image_SetData(*args, **kwargs)
2686
2687 def GetDataBuffer(*args, **kwargs):
2688 """
2689 GetDataBuffer(self) -> PyObject
2690
2691 Returns a writable Python buffer object that is pointing at the RGB
2692 image data buffer inside the wx.Image. You need to ensure that you do
2693 not use this buffer object after the image has been destroyed.
2694 """
2695 return _core_.Image_GetDataBuffer(*args, **kwargs)
2696
2697 def SetDataBuffer(*args, **kwargs):
2698 """
2699 SetDataBuffer(self, buffer data)
2700
2701 Sets the internal image data pointer to point at a Python buffer
2702 object. This can save making an extra copy of the data but you must
2703 ensure that the buffer object lives longer than the wx.Image does.
2704 """
2705 return _core_.Image_SetDataBuffer(*args, **kwargs)
2706
2707 def GetAlphaData(*args, **kwargs):
2708 """
2709 GetAlphaData(self) -> PyObject
2710
2711 Returns a string containing a copy of the alpha bytes of the image.
2712 """
2713 return _core_.Image_GetAlphaData(*args, **kwargs)
2714
2715 def SetAlphaData(*args, **kwargs):
2716 """
2717 SetAlphaData(self, buffer alpha)
2718
2719 Resets the Image's alpha data from a buffer of bytes. Accepts either
2720 a string or a buffer object holding the data and the length of the
2721 data must be width*height.
2722 """
2723 return _core_.Image_SetAlphaData(*args, **kwargs)
2724
2725 def GetAlphaBuffer(*args, **kwargs):
2726 """
2727 GetAlphaBuffer(self) -> PyObject
2728
2729 Returns a writable Python buffer object that is pointing at the Alpha
2730 data buffer inside the wx.Image. You need to ensure that you do not
2731 use this buffer object after the image has been destroyed.
2732 """
2733 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2734
2735 def SetAlphaBuffer(*args, **kwargs):
2736 """
2737 SetAlphaBuffer(self, buffer alpha)
2738
2739 Sets the internal image alpha pointer to point at a Python buffer
2740 object. This can save making an extra copy of the data but you must
2741 ensure that the buffer object lives as long as the wx.Image does.
2742 """
2743 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2744
2745 def SetMaskColour(*args, **kwargs):
2746 """
2747 SetMaskColour(self, byte r, byte g, byte b)
2748
2749 Sets the mask colour for this image (and tells the image to use the
2750 mask).
2751 """
2752 return _core_.Image_SetMaskColour(*args, **kwargs)
2753
2754 def GetOrFindMaskColour(*args, **kwargs):
2755 """
2756 GetOrFindMaskColour() -> (r,g,b)
2757
2758 Get the current mask colour or find a suitable colour.
2759 """
2760 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2761
2762 def GetMaskRed(*args, **kwargs):
2763 """
2764 GetMaskRed(self) -> byte
2765
2766 Gets the red component of the mask colour.
2767 """
2768 return _core_.Image_GetMaskRed(*args, **kwargs)
2769
2770 def GetMaskGreen(*args, **kwargs):
2771 """
2772 GetMaskGreen(self) -> byte
2773
2774 Gets the green component of the mask colour.
2775 """
2776 return _core_.Image_GetMaskGreen(*args, **kwargs)
2777
2778 def GetMaskBlue(*args, **kwargs):
2779 """
2780 GetMaskBlue(self) -> byte
2781
2782 Gets the blue component of the mask colour.
2783 """
2784 return _core_.Image_GetMaskBlue(*args, **kwargs)
2785
2786 def SetMask(*args, **kwargs):
2787 """
2788 SetMask(self, bool mask=True)
2789
2790 Specifies whether there is a mask or not. The area of the mask is
2791 determined by the current mask colour.
2792 """
2793 return _core_.Image_SetMask(*args, **kwargs)
2794
2795 def HasMask(*args, **kwargs):
2796 """
2797 HasMask(self) -> bool
2798
2799 Returns ``True`` if there is a mask active, ``False`` otherwise.
2800 """
2801 return _core_.Image_HasMask(*args, **kwargs)
2802
2803 def Rotate(*args, **kwargs):
2804 """
2805 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2806 Point offset_after_rotation=None) -> Image
2807
2808 Rotates the image about the given point, by ``angle`` radians. Passing
2809 ``True`` to ``interpolating`` results in better image quality, but is
2810 slower. If the image has a mask, then the mask colour is used for the
2811 uncovered pixels in the rotated image background. Otherwise, black
2812 will be used as the fill colour.
2813
2814 Returns the rotated image, leaving this image intact.
2815 """
2816 return _core_.Image_Rotate(*args, **kwargs)
2817
2818 def Rotate90(*args, **kwargs):
2819 """
2820 Rotate90(self, bool clockwise=True) -> Image
2821
2822 Returns a copy of the image rotated 90 degrees in the direction
2823 indicated by ``clockwise``.
2824 """
2825 return _core_.Image_Rotate90(*args, **kwargs)
2826
2827 def Mirror(*args, **kwargs):
2828 """
2829 Mirror(self, bool horizontally=True) -> Image
2830
2831 Returns a mirrored copy of the image. The parameter ``horizontally``
2832 indicates the orientation.
2833 """
2834 return _core_.Image_Mirror(*args, **kwargs)
2835
2836 def Replace(*args, **kwargs):
2837 """
2838 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2839
2840 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2841 ``(r2,g2,b2)``.
2842 """
2843 return _core_.Image_Replace(*args, **kwargs)
2844
2845 def ConvertToGreyscale(*args, **kwargs):
2846 """
2847 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2848
2849 Convert to greyscale image. Uses the luminance component (Y) of the
2850 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2851 defaults to ITU-T BT.601
2852 """
2853 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2854
2855 def ConvertToMono(*args, **kwargs):
2856 """
2857 ConvertToMono(self, byte r, byte g, byte b) -> Image
2858
2859 Returns monochromatic version of the image. The returned image has
2860 white colour where the original has ``(r,g,b)`` colour and black
2861 colour everywhere else.
2862 """
2863 return _core_.Image_ConvertToMono(*args, **kwargs)
2864
2865 def SetOption(*args, **kwargs):
2866 """
2867 SetOption(self, String name, String value)
2868
2869 Sets an image handler defined option. For example, when saving as a
2870 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2871 number between 0 and 100 (0 is terrible, 100 is very good).
2872 """
2873 return _core_.Image_SetOption(*args, **kwargs)
2874
2875 def SetOptionInt(*args, **kwargs):
2876 """
2877 SetOptionInt(self, String name, int value)
2878
2879 Sets an image option as an integer.
2880 """
2881 return _core_.Image_SetOptionInt(*args, **kwargs)
2882
2883 def GetOption(*args, **kwargs):
2884 """
2885 GetOption(self, String name) -> String
2886
2887 Gets the value of an image handler option.
2888 """
2889 return _core_.Image_GetOption(*args, **kwargs)
2890
2891 def GetOptionInt(*args, **kwargs):
2892 """
2893 GetOptionInt(self, String name) -> int
2894
2895 Gets the value of an image handler option as an integer. If the given
2896 option is not present, the function returns 0.
2897 """
2898 return _core_.Image_GetOptionInt(*args, **kwargs)
2899
2900 def HasOption(*args, **kwargs):
2901 """
2902 HasOption(self, String name) -> bool
2903
2904 Returns true if the given option is present.
2905 """
2906 return _core_.Image_HasOption(*args, **kwargs)
2907
2908 def CountColours(*args, **kwargs):
2909 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2910 return _core_.Image_CountColours(*args, **kwargs)
2911
2912 def ComputeHistogram(*args, **kwargs):
2913 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2914 return _core_.Image_ComputeHistogram(*args, **kwargs)
2915
2916 def AddHandler(*args, **kwargs):
2917 """AddHandler(ImageHandler handler)"""
2918 return _core_.Image_AddHandler(*args, **kwargs)
2919
2920 AddHandler = staticmethod(AddHandler)
2921 def InsertHandler(*args, **kwargs):
2922 """InsertHandler(ImageHandler handler)"""
2923 return _core_.Image_InsertHandler(*args, **kwargs)
2924
2925 InsertHandler = staticmethod(InsertHandler)
2926 def RemoveHandler(*args, **kwargs):
2927 """RemoveHandler(String name) -> bool"""
2928 return _core_.Image_RemoveHandler(*args, **kwargs)
2929
2930 RemoveHandler = staticmethod(RemoveHandler)
2931 def GetHandlers(*args, **kwargs):
2932 """GetHandlers() -> PyObject"""
2933 return _core_.Image_GetHandlers(*args, **kwargs)
2934
2935 GetHandlers = staticmethod(GetHandlers)
2936 def GetImageExtWildcard(*args, **kwargs):
2937 """
2938 GetImageExtWildcard() -> String
2939
2940 Iterates all registered wxImageHandler objects, and returns a string
2941 containing file extension masks suitable for passing to file open/save
2942 dialog boxes.
2943 """
2944 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2945
2946 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2947 def ConvertToBitmap(*args, **kwargs):
2948 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2949 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2950
2951 def ConvertToMonoBitmap(*args, **kwargs):
2952 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2953 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2954
2955 def RotateHue(*args, **kwargs):
2956 """
2957 RotateHue(self, double angle)
2958
2959 Rotates the hue of each pixel of the image. Hue is a double in the
2960 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2961 """
2962 return _core_.Image_RotateHue(*args, **kwargs)
2963
2964 def RGBtoHSV(*args, **kwargs):
2965 """
2966 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2967
2968 Converts a color in RGB color space to HSV color space.
2969 """
2970 return _core_.Image_RGBtoHSV(*args, **kwargs)
2971
2972 RGBtoHSV = staticmethod(RGBtoHSV)
2973 def HSVtoRGB(*args, **kwargs):
2974 """
2975 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2976
2977 Converts a color in HSV color space to RGB color space.
2978 """
2979 return _core_.Image_HSVtoRGB(*args, **kwargs)
2980
2981 HSVtoRGB = staticmethod(HSVtoRGB)
2982 def __nonzero__(self): return self.Ok()
2983 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2984 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
2985 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
2986 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
2987 Height = property(GetHeight,doc="See `GetHeight`")
2988 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
2989 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
2990 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
2991 Size = property(GetSize,doc="See `GetSize`")
2992 Width = property(GetWidth,doc="See `GetWidth`")
2993 _core_.Image_swigregister(Image)
2994
2995 def ImageFromMime(*args, **kwargs):
2996 """
2997 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2998
2999 Loads an image from a file, using a MIME type string (such as
3000 'image/jpeg') to specify image type.
3001 """
3002 val = _core_.new_ImageFromMime(*args, **kwargs)
3003 return val
3004
3005 def ImageFromStream(*args, **kwargs):
3006 """
3007 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3008
3009 Loads an image from an input stream, or any readable Python file-like
3010 object.
3011 """
3012 val = _core_.new_ImageFromStream(*args, **kwargs)
3013 return val
3014
3015 def ImageFromStreamMime(*args, **kwargs):
3016 """
3017 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3018
3019 Loads an image from an input stream, or any readable Python file-like
3020 object, specifying the image format with a MIME type string.
3021 """
3022 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3023 return val
3024
3025 def EmptyImage(*args, **kwargs):
3026 """
3027 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3028
3029 Construct an empty image of a given size, optionally setting all
3030 pixels to black.
3031 """
3032 val = _core_.new_EmptyImage(*args, **kwargs)
3033 return val
3034
3035 def ImageFromBitmap(*args, **kwargs):
3036 """
3037 ImageFromBitmap(Bitmap bitmap) -> Image
3038
3039 Construct an Image from a `wx.Bitmap`.
3040 """
3041 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3042 return val
3043
3044 def ImageFromData(*args, **kwargs):
3045 """
3046 ImageFromData(int width, int height, buffer data) -> Image
3047
3048 Construct an Image from a buffer of RGB bytes. Accepts either a
3049 string or a buffer object holding the data and the length of the data
3050 must be width*height*3.
3051 """
3052 val = _core_.new_ImageFromData(*args, **kwargs)
3053 return val
3054
3055 def ImageFromDataWithAlpha(*args, **kwargs):
3056 """
3057 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3058
3059 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3060 Accepts either a string or a buffer object holding the data and the
3061 length of the data must be width*height*3 bytes, and the length of the
3062 alpha data must be width*height bytes.
3063 """
3064 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3065 return val
3066
3067 def Image_CanRead(*args, **kwargs):
3068 """
3069 Image_CanRead(String filename) -> bool
3070
3071 Returns True if the image handlers can read this file.
3072 """
3073 return _core_.Image_CanRead(*args, **kwargs)
3074
3075 def Image_GetImageCount(*args, **kwargs):
3076 """
3077 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3078
3079 If the image file contains more than one image and the image handler
3080 is capable of retrieving these individually, this function will return
3081 the number of available images.
3082 """
3083 return _core_.Image_GetImageCount(*args, **kwargs)
3084
3085 def Image_CanReadStream(*args, **kwargs):
3086 """
3087 Image_CanReadStream(InputStream stream) -> bool
3088
3089 Returns True if the image handlers can read an image file from the
3090 data currently on the input stream, or a readable Python file-like
3091 object.
3092 """
3093 return _core_.Image_CanReadStream(*args, **kwargs)
3094
3095 def Image_AddHandler(*args, **kwargs):
3096 """Image_AddHandler(ImageHandler handler)"""
3097 return _core_.Image_AddHandler(*args, **kwargs)
3098
3099 def Image_InsertHandler(*args, **kwargs):
3100 """Image_InsertHandler(ImageHandler handler)"""
3101 return _core_.Image_InsertHandler(*args, **kwargs)
3102
3103 def Image_RemoveHandler(*args, **kwargs):
3104 """Image_RemoveHandler(String name) -> bool"""
3105 return _core_.Image_RemoveHandler(*args, **kwargs)
3106
3107 def Image_GetHandlers(*args):
3108 """Image_GetHandlers() -> PyObject"""
3109 return _core_.Image_GetHandlers(*args)
3110
3111 def Image_GetImageExtWildcard(*args):
3112 """
3113 Image_GetImageExtWildcard() -> String
3114
3115 Iterates all registered wxImageHandler objects, and returns a string
3116 containing file extension masks suitable for passing to file open/save
3117 dialog boxes.
3118 """
3119 return _core_.Image_GetImageExtWildcard(*args)
3120
3121 def Image_RGBtoHSV(*args, **kwargs):
3122 """
3123 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3124
3125 Converts a color in RGB color space to HSV color space.
3126 """
3127 return _core_.Image_RGBtoHSV(*args, **kwargs)
3128
3129 def Image_HSVtoRGB(*args, **kwargs):
3130 """
3131 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3132
3133 Converts a color in HSV color space to RGB color space.
3134 """
3135 return _core_.Image_HSVtoRGB(*args, **kwargs)
3136
3137
3138 def _ImageFromBuffer(*args, **kwargs):
3139 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3140 return _core_._ImageFromBuffer(*args, **kwargs)
3141 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3142 """
3143 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3144 parameter must be a Python object that implements the buffer interface,
3145 such as a string, array, etc. The dataBuffer object is expected to
3146 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3147 object can optionally be supplied for the image's alpha channel data, and
3148 it is expected to be width*height bytes long.
3149
3150 The wx.Image will be created with its data and alpha pointers initialized
3151 to the memory address pointed to by the buffer objects, thus saving the
3152 time needed to copy the image data from the buffer object to the wx.Image.
3153 While this has advantages, it also has the shoot-yourself-in-the-foot
3154 risks associated with sharing a C pointer between two objects.
3155
3156 To help alleviate the risk a reference to the data and alpha buffer
3157 objects are kept with the wx.Image, so that they won't get deleted until
3158 after the wx.Image is deleted. However please be aware that it is not
3159 guaranteed that an object won't move its memory buffer to a new location
3160 when it needs to resize its contents. If that happens then the wx.Image
3161 will end up referring to an invalid memory location and could cause the
3162 application to crash. Therefore care should be taken to not manipulate
3163 the objects used for the data and alpha buffers in a way that would cause
3164 them to change size.
3165 """
3166 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3167 image._buffer = dataBuffer
3168 image._alpha = alphaBuffer
3169 return image
3170
3171 def InitAllImageHandlers():
3172 """
3173 The former functionality of InitAllImageHanders is now done internal to
3174 the _core_ extension module and so this function has become a simple NOP.
3175 """
3176 pass
3177
3178 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3179 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3180 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3181 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3182 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3183 BMP_24BPP = _core_.BMP_24BPP
3184 BMP_8BPP = _core_.BMP_8BPP
3185 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3186 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3187 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3188 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3189 BMP_4BPP = _core_.BMP_4BPP
3190 BMP_1BPP = _core_.BMP_1BPP
3191 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3192 class BMPHandler(ImageHandler):
3193 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3194 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3195 __repr__ = _swig_repr
3196 def __init__(self, *args, **kwargs):
3197 """
3198 __init__(self) -> BMPHandler
3199
3200 A `wx.ImageHandler` for \*.bmp bitmap files.
3201 """
3202 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3203 _core_.BMPHandler_swigregister(BMPHandler)
3204 NullImage = cvar.NullImage
3205 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3206 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3207 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3208 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3209 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3210 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3211 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3212 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3213 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3214 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3215 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3216 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3217 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3218 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3219 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3220
3221 class ICOHandler(BMPHandler):
3222 """A `wx.ImageHandler` for \*.ico icon files."""
3223 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3224 __repr__ = _swig_repr
3225 def __init__(self, *args, **kwargs):
3226 """
3227 __init__(self) -> ICOHandler
3228
3229 A `wx.ImageHandler` for \*.ico icon files.
3230 """
3231 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3232 _core_.ICOHandler_swigregister(ICOHandler)
3233
3234 class CURHandler(ICOHandler):
3235 """A `wx.ImageHandler` for \*.cur cursor files."""
3236 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3237 __repr__ = _swig_repr
3238 def __init__(self, *args, **kwargs):
3239 """
3240 __init__(self) -> CURHandler
3241
3242 A `wx.ImageHandler` for \*.cur cursor files.
3243 """
3244 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3245 _core_.CURHandler_swigregister(CURHandler)
3246
3247 class ANIHandler(CURHandler):
3248 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3249 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3250 __repr__ = _swig_repr
3251 def __init__(self, *args, **kwargs):
3252 """
3253 __init__(self) -> ANIHandler
3254
3255 A `wx.ImageHandler` for \*.ani animated cursor files.
3256 """
3257 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3258 _core_.ANIHandler_swigregister(ANIHandler)
3259
3260 class PNGHandler(ImageHandler):
3261 """A `wx.ImageHandler` for PNG image files."""
3262 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3263 __repr__ = _swig_repr
3264 def __init__(self, *args, **kwargs):
3265 """
3266 __init__(self) -> PNGHandler
3267
3268 A `wx.ImageHandler` for PNG image files.
3269 """
3270 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3271 _core_.PNGHandler_swigregister(PNGHandler)
3272
3273 class GIFHandler(ImageHandler):
3274 """A `wx.ImageHandler` for GIF image files."""
3275 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3276 __repr__ = _swig_repr
3277 def __init__(self, *args, **kwargs):
3278 """
3279 __init__(self) -> GIFHandler
3280
3281 A `wx.ImageHandler` for GIF image files.
3282 """
3283 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3284 _core_.GIFHandler_swigregister(GIFHandler)
3285
3286 class PCXHandler(ImageHandler):
3287 """A `wx.ImageHandler` for PCX imager files."""
3288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3289 __repr__ = _swig_repr
3290 def __init__(self, *args, **kwargs):
3291 """
3292 __init__(self) -> PCXHandler
3293
3294 A `wx.ImageHandler` for PCX imager files.
3295 """
3296 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3297 _core_.PCXHandler_swigregister(PCXHandler)
3298
3299 class JPEGHandler(ImageHandler):
3300 """A `wx.ImageHandler` for JPEG/JPG image files."""
3301 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3302 __repr__ = _swig_repr
3303 def __init__(self, *args, **kwargs):
3304 """
3305 __init__(self) -> JPEGHandler
3306
3307 A `wx.ImageHandler` for JPEG/JPG image files.
3308 """
3309 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3310 _core_.JPEGHandler_swigregister(JPEGHandler)
3311
3312 class PNMHandler(ImageHandler):
3313 """A `wx.ImageHandler` for PNM image files."""
3314 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3315 __repr__ = _swig_repr
3316 def __init__(self, *args, **kwargs):
3317 """
3318 __init__(self) -> PNMHandler
3319
3320 A `wx.ImageHandler` for PNM image files.
3321 """
3322 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3323 _core_.PNMHandler_swigregister(PNMHandler)
3324
3325 class XPMHandler(ImageHandler):
3326 """A `wx.ImageHandler` for XPM image."""
3327 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3328 __repr__ = _swig_repr
3329 def __init__(self, *args, **kwargs):
3330 """
3331 __init__(self) -> XPMHandler
3332
3333 A `wx.ImageHandler` for XPM image.
3334 """
3335 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3336 _core_.XPMHandler_swigregister(XPMHandler)
3337
3338 class TIFFHandler(ImageHandler):
3339 """A `wx.ImageHandler` for TIFF image files."""
3340 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3341 __repr__ = _swig_repr
3342 def __init__(self, *args, **kwargs):
3343 """
3344 __init__(self) -> TIFFHandler
3345
3346 A `wx.ImageHandler` for TIFF image files.
3347 """
3348 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3349 _core_.TIFFHandler_swigregister(TIFFHandler)
3350
3351 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3352 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3353 class Quantize(object):
3354 """Performs quantization, or colour reduction, on a wxImage."""
3355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3356 def __init__(self): raise AttributeError, "No constructor defined"
3357 __repr__ = _swig_repr
3358 def Quantize(*args, **kwargs):
3359 """
3360 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3361
3362 Reduce the colours in the source image and put the result into the
3363 destination image, setting the palette in the destination if
3364 needed. Both images may be the same, to overwrite the source image.
3365 """
3366 return _core_.Quantize_Quantize(*args, **kwargs)
3367
3368 Quantize = staticmethod(Quantize)
3369 _core_.Quantize_swigregister(Quantize)
3370
3371 def Quantize_Quantize(*args, **kwargs):
3372 """
3373 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3374
3375 Reduce the colours in the source image and put the result into the
3376 destination image, setting the palette in the destination if
3377 needed. Both images may be the same, to overwrite the source image.
3378 """
3379 return _core_.Quantize_Quantize(*args, **kwargs)
3380
3381 #---------------------------------------------------------------------------
3382
3383 class EvtHandler(Object):
3384 """Proxy of C++ EvtHandler class"""
3385 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3386 __repr__ = _swig_repr
3387 def __init__(self, *args, **kwargs):
3388 """__init__(self) -> EvtHandler"""
3389 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3390 self._setOORInfo(self)
3391
3392 def GetNextHandler(*args, **kwargs):
3393 """GetNextHandler(self) -> EvtHandler"""
3394 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3395
3396 def GetPreviousHandler(*args, **kwargs):
3397 """GetPreviousHandler(self) -> EvtHandler"""
3398 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3399
3400 def SetNextHandler(*args, **kwargs):
3401 """SetNextHandler(self, EvtHandler handler)"""
3402 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3403
3404 def SetPreviousHandler(*args, **kwargs):
3405 """SetPreviousHandler(self, EvtHandler handler)"""
3406 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3407
3408 def GetEvtHandlerEnabled(*args, **kwargs):
3409 """GetEvtHandlerEnabled(self) -> bool"""
3410 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3411
3412 def SetEvtHandlerEnabled(*args, **kwargs):
3413 """SetEvtHandlerEnabled(self, bool enabled)"""
3414 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3415
3416 def ProcessEvent(*args, **kwargs):
3417 """ProcessEvent(self, Event event) -> bool"""
3418 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3419
3420 def AddPendingEvent(*args, **kwargs):
3421 """AddPendingEvent(self, Event event)"""
3422 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3423
3424 def ProcessPendingEvents(*args, **kwargs):
3425 """ProcessPendingEvents(self)"""
3426 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3427
3428 def Connect(*args, **kwargs):
3429 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3430 return _core_.EvtHandler_Connect(*args, **kwargs)
3431
3432 def Disconnect(*args, **kwargs):
3433 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3434 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3435
3436 def _setOORInfo(*args, **kwargs):
3437 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3438 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3439 args[0].thisown = 0
3440 return val
3441
3442 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3443 """
3444 Bind an event to an event handler.
3445
3446 :param event: One of the EVT_* objects that specifies the
3447 type of event to bind,
3448
3449 :param handler: A callable object to be invoked when the
3450 event is delivered to self. Pass None to
3451 disconnect an event handler.
3452
3453 :param source: Sometimes the event originates from a
3454 different window than self, but you still
3455 want to catch it in self. (For example, a
3456 button event delivered to a frame.) By
3457 passing the source of the event, the event
3458 handling system is able to differentiate
3459 between the same event type from different
3460 controls.
3461
3462 :param id: Used to spcify the event source by ID instead
3463 of instance.
3464
3465 :param id2: Used when it is desirable to bind a handler
3466 to a range of IDs, such as with EVT_MENU_RANGE.
3467 """
3468 if source is not None:
3469 id = source.GetId()
3470 event.Bind(self, id, id2, handler)
3471
3472 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3473 """
3474 Disconencts the event handler binding for event from self.
3475 Returns True if successful.
3476 """
3477 if source is not None:
3478 id = source.GetId()
3479 return event.Unbind(self, id, id2)
3480
3481 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3482 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3483 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3484 _core_.EvtHandler_swigregister(EvtHandler)
3485
3486 #---------------------------------------------------------------------------
3487
3488 class PyEventBinder(object):
3489 """
3490 Instances of this class are used to bind specific events to event
3491 handlers.
3492 """
3493 def __init__(self, evtType, expectedIDs=0):
3494 if expectedIDs not in [0, 1, 2]:
3495 raise ValueError, "Invalid number of expectedIDs"
3496 self.expectedIDs = expectedIDs
3497
3498 if type(evtType) == list or type(evtType) == tuple:
3499 self.evtType = evtType
3500 else:
3501 self.evtType = [evtType]
3502
3503
3504 def Bind(self, target, id1, id2, function):
3505 """Bind this set of event types to target."""
3506 for et in self.evtType:
3507 target.Connect(id1, id2, et, function)
3508
3509
3510 def Unbind(self, target, id1, id2):
3511 """Remove an event binding."""
3512 success = 0
3513 for et in self.evtType:
3514 success += target.Disconnect(id1, id2, et)
3515 return success != 0
3516
3517
3518 def __call__(self, *args):
3519 """
3520 For backwards compatibility with the old EVT_* functions.
3521 Should be called with either (window, func), (window, ID,
3522 func) or (window, ID1, ID2, func) parameters depending on the
3523 type of the event.
3524 """
3525 assert len(args) == 2 + self.expectedIDs
3526 id1 = wx.ID_ANY
3527 id2 = wx.ID_ANY
3528 target = args[0]
3529 if self.expectedIDs == 0:
3530 func = args[1]
3531 elif self.expectedIDs == 1:
3532 id1 = args[1]
3533 func = args[2]
3534 elif self.expectedIDs == 2:
3535 id1 = args[1]
3536 id2 = args[2]
3537 func = args[3]
3538 else:
3539 raise ValueError, "Unexpected number of IDs"
3540
3541 self.Bind(target, id1, id2, func)
3542
3543
3544 # These two are square pegs that don't fit the PyEventBinder hole...
3545 def EVT_COMMAND(win, id, cmd, func):
3546 win.Connect(id, -1, cmd, func)
3547 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3548 win.Connect(id1, id2, cmd, func)
3549
3550
3551 #---------------------------------------------------------------------------
3552
3553 #---------------------------------------------------------------------------
3554
3555 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3556 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3557
3558 def NewEventType(*args):
3559 """NewEventType() -> EventType"""
3560 return _core_.NewEventType(*args)
3561 wxEVT_NULL = _core_.wxEVT_NULL
3562 wxEVT_FIRST = _core_.wxEVT_FIRST
3563 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3564 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3565 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3566 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3567 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3568 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3569 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3570 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3571 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3572 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3573 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3574 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3575 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3576 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3577 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3578 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3579 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3580 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3581 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3582 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3583 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3584 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3585 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3586 wxEVT_MOTION = _core_.wxEVT_MOTION
3587 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3588 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3589 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3590 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3591 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3592 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3593 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3594 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3595 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3596 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3597 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3598 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3599 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3600 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3601 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3602 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3603 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3604 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3605 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3606 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3607 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3608 wxEVT_CHAR = _core_.wxEVT_CHAR
3609 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3610 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3611 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3612 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3613 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3614 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3615 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3616 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3617 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3618 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3619 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3620 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3621 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3622 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3623 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3624 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3625 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3626 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3627 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3628 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3629 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3630 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3631 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3632 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3633 wxEVT_SIZE = _core_.wxEVT_SIZE
3634 wxEVT_MOVE = _core_.wxEVT_MOVE
3635 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3636 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3637 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3638 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3639 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3640 wxEVT_CREATE = _core_.wxEVT_CREATE
3641 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3642 wxEVT_SHOW = _core_.wxEVT_SHOW
3643 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3644 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3645 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3646 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3647 wxEVT_PAINT = _core_.wxEVT_PAINT
3648 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3649 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3650 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3651 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3652 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3653 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3654 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3655 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3656 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3657 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3658 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3659 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3660 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3661 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3662 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3663 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3664 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3665 wxEVT_IDLE = _core_.wxEVT_IDLE
3666 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3667 wxEVT_SIZING = _core_.wxEVT_SIZING
3668 wxEVT_MOVING = _core_.wxEVT_MOVING
3669 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3670 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3671 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3672 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3673 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3674 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3675 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3676 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3677 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3678 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3679 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3680 #
3681 # Create some event binders
3682 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3683 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3684 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3685 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3686 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3687 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3688 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3689 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3690 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3691 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3692 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3693 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3694 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3695 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3696 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3697 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3698 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3699 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3700 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3701 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3702 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3703 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3704 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3705 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3706 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3707 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3708 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3709 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3710 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3711 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3712 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3713 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3714 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3715 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3716 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3717 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3718 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3719 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3720 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3721 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3722 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3723 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3724
3725 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3726 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3727 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3728 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3729 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3730 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3731 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3732 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3733 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3734 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3735 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3736 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3737 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3738
3739 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3740 wxEVT_LEFT_UP,
3741 wxEVT_MIDDLE_DOWN,
3742 wxEVT_MIDDLE_UP,
3743 wxEVT_RIGHT_DOWN,
3744 wxEVT_RIGHT_UP,
3745 wxEVT_MOTION,
3746 wxEVT_LEFT_DCLICK,
3747 wxEVT_MIDDLE_DCLICK,
3748 wxEVT_RIGHT_DCLICK,
3749 wxEVT_ENTER_WINDOW,
3750 wxEVT_LEAVE_WINDOW,
3751 wxEVT_MOUSEWHEEL
3752 ])
3753
3754
3755 # Scrolling from wxWindow (sent to wxScrolledWindow)
3756 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3757 wxEVT_SCROLLWIN_BOTTOM,
3758 wxEVT_SCROLLWIN_LINEUP,
3759 wxEVT_SCROLLWIN_LINEDOWN,
3760 wxEVT_SCROLLWIN_PAGEUP,
3761 wxEVT_SCROLLWIN_PAGEDOWN,
3762 wxEVT_SCROLLWIN_THUMBTRACK,
3763 wxEVT_SCROLLWIN_THUMBRELEASE,
3764 ])
3765
3766 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3767 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3768 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3769 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3770 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3771 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3772 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3773 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3774
3775 # Scrolling from wx.Slider and wx.ScrollBar
3776 EVT_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 ])
3786
3787 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3788 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3789 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3790 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3791 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3792 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3793 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3794 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3795 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3796 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3797
3798 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3799 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3800 wxEVT_SCROLL_BOTTOM,
3801 wxEVT_SCROLL_LINEUP,
3802 wxEVT_SCROLL_LINEDOWN,
3803 wxEVT_SCROLL_PAGEUP,
3804 wxEVT_SCROLL_PAGEDOWN,
3805 wxEVT_SCROLL_THUMBTRACK,
3806 wxEVT_SCROLL_THUMBRELEASE,
3807 wxEVT_SCROLL_CHANGED,
3808 ], 1)
3809
3810 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3811 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3812 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3813 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3814 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3815 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3816 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3817 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3818 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3819 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3820
3821 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3822 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3823 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3824 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3825 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3826 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3827 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3828 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3829 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3830 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3831
3832 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3833 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3834 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3835 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3836 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3837 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3838 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3839 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3840 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3841
3842
3843 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3844 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3845 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3846 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3847 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3848 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3849 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3850
3851 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3852
3853 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3854 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3855
3856 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3857
3858 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3859 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3860 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3861
3862
3863 #---------------------------------------------------------------------------
3864
3865 class Event(Object):
3866 """
3867 An event is a structure holding information about an event passed to a
3868 callback or member function. wx.Event is an abstract base class for
3869 other event classes
3870 """
3871 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3872 def __init__(self): raise AttributeError, "No constructor defined"
3873 __repr__ = _swig_repr
3874 __swig_destroy__ = _core_.delete_Event
3875 __del__ = lambda self : None;
3876 def SetEventType(*args, **kwargs):
3877 """
3878 SetEventType(self, EventType typ)
3879
3880 Sets the specific type of the event.
3881 """
3882 return _core_.Event_SetEventType(*args, **kwargs)
3883
3884 def GetEventType(*args, **kwargs):
3885 """
3886 GetEventType(self) -> EventType
3887
3888 Returns the identifier of the given event type, such as
3889 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3890 """
3891 return _core_.Event_GetEventType(*args, **kwargs)
3892
3893 def GetEventObject(*args, **kwargs):
3894 """
3895 GetEventObject(self) -> Object
3896
3897 Returns the object (usually a window) associated with the event, if
3898 any.
3899 """
3900 return _core_.Event_GetEventObject(*args, **kwargs)
3901
3902 def SetEventObject(*args, **kwargs):
3903 """
3904 SetEventObject(self, Object obj)
3905
3906 Sets the originating object, or in other words, obj is normally the
3907 object that is sending the event.
3908 """
3909 return _core_.Event_SetEventObject(*args, **kwargs)
3910
3911 def GetTimestamp(*args, **kwargs):
3912 """GetTimestamp(self) -> long"""
3913 return _core_.Event_GetTimestamp(*args, **kwargs)
3914
3915 def SetTimestamp(*args, **kwargs):
3916 """SetTimestamp(self, long ts=0)"""
3917 return _core_.Event_SetTimestamp(*args, **kwargs)
3918
3919 def GetId(*args, **kwargs):
3920 """
3921 GetId(self) -> int
3922
3923 Returns the identifier associated with this event, such as a button
3924 command id.
3925 """
3926 return _core_.Event_GetId(*args, **kwargs)
3927
3928 def SetId(*args, **kwargs):
3929 """
3930 SetId(self, int Id)
3931
3932 Set's the ID for the event. This is usually the ID of the window that
3933 is sending the event, but it can also be a command id from a menu
3934 item, etc.
3935 """
3936 return _core_.Event_SetId(*args, **kwargs)
3937
3938 def IsCommandEvent(*args, **kwargs):
3939 """
3940 IsCommandEvent(self) -> bool
3941
3942 Returns true if the event is or is derived from `wx.CommandEvent` else
3943 it returns false. Note: Exists only for optimization purposes.
3944 """
3945 return _core_.Event_IsCommandEvent(*args, **kwargs)
3946
3947 def Skip(*args, **kwargs):
3948 """
3949 Skip(self, bool skip=True)
3950
3951 Called by an event handler, it controls whether additional event
3952 handlers bound to this event will be called after the current event
3953 handler returns. Skip(false) (the default setting) will prevent
3954 additional event handlers from being called and control will be
3955 returned to the sender of the event immediately after the current
3956 handler has finished. Skip(True) will cause the event processing
3957 system to continue searching for a handler function for this event.
3958
3959 """
3960 return _core_.Event_Skip(*args, **kwargs)
3961
3962 def GetSkipped(*args, **kwargs):
3963 """
3964 GetSkipped(self) -> bool
3965
3966 Returns true if the event handler should be skipped, false otherwise.
3967 :see: `Skip`
3968 """
3969 return _core_.Event_GetSkipped(*args, **kwargs)
3970
3971 def ShouldPropagate(*args, **kwargs):
3972 """
3973 ShouldPropagate(self) -> bool
3974
3975 Test if this event should be propagated to the parent window or not,
3976 i.e. if the propagation level is currently greater than 0.
3977 """
3978 return _core_.Event_ShouldPropagate(*args, **kwargs)
3979
3980 def StopPropagation(*args, **kwargs):
3981 """
3982 StopPropagation(self) -> int
3983
3984 Stop the event from propagating to its parent window. Returns the old
3985 propagation level value which may be later passed to
3986 `ResumePropagation` to allow propagating the event again.
3987 """
3988 return _core_.Event_StopPropagation(*args, **kwargs)
3989
3990 def ResumePropagation(*args, **kwargs):
3991 """
3992 ResumePropagation(self, int propagationLevel)
3993
3994 Resume the event propagation by restoring the propagation level. (For
3995 example, you can use the value returned by an earlier call to
3996 `StopPropagation`.)
3997
3998 """
3999 return _core_.Event_ResumePropagation(*args, **kwargs)
4000
4001 def Clone(*args, **kwargs):
4002 """Clone(self) -> Event"""
4003 return _core_.Event_Clone(*args, **kwargs)
4004
4005 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4006 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4007 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4008 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4009 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
4010 _core_.Event_swigregister(Event)
4011
4012 #---------------------------------------------------------------------------
4013
4014 class PropagationDisabler(object):
4015 """
4016 Helper class to temporarily change an event not to propagate. Simply
4017 create an instance of this class and then whe it is destroyed the
4018 propogation of the event will be restored.
4019 """
4020 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4021 __repr__ = _swig_repr
4022 def __init__(self, *args, **kwargs):
4023 """
4024 __init__(self, Event event) -> PropagationDisabler
4025
4026 Helper class to temporarily change an event not to propagate. Simply
4027 create an instance of this class and then whe it is destroyed the
4028 propogation of the event will be restored.
4029 """
4030 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4031 __swig_destroy__ = _core_.delete_PropagationDisabler
4032 __del__ = lambda self : None;
4033 _core_.PropagationDisabler_swigregister(PropagationDisabler)
4034
4035 class PropagateOnce(object):
4036 """
4037 A helper class that will temporarily lower propagation level of an
4038 event. Simply create an instance of this class and then whe it is
4039 destroyed the propogation of the event will be restored.
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, Event event) -> PropagateOnce
4046
4047 A helper class that will temporarily lower propagation level of an
4048 event. Simply create an instance of this class and then whe it is
4049 destroyed the propogation of the event will be restored.
4050 """
4051 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4052 __swig_destroy__ = _core_.delete_PropagateOnce
4053 __del__ = lambda self : None;
4054 _core_.PropagateOnce_swigregister(PropagateOnce)
4055
4056 #---------------------------------------------------------------------------
4057
4058 class CommandEvent(Event):
4059 """
4060 This event class contains information about command events, which
4061 originate from a variety of simple controls, as well as menus and
4062 toolbars.
4063 """
4064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4065 __repr__ = _swig_repr
4066 def __init__(self, *args, **kwargs):
4067 """
4068 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4069
4070 This event class contains information about command events, which
4071 originate from a variety of simple controls, as well as menus and
4072 toolbars.
4073 """
4074 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4075 def GetSelection(*args, **kwargs):
4076 """
4077 GetSelection(self) -> int
4078
4079 Returns item index for a listbox or choice selection event (not valid
4080 for a deselection).
4081 """
4082 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4083
4084 def SetString(*args, **kwargs):
4085 """SetString(self, String s)"""
4086 return _core_.CommandEvent_SetString(*args, **kwargs)
4087
4088 def GetString(*args, **kwargs):
4089 """
4090 GetString(self) -> String
4091
4092 Returns item string for a listbox or choice selection event (not valid
4093 for a deselection).
4094 """
4095 return _core_.CommandEvent_GetString(*args, **kwargs)
4096
4097 def IsChecked(*args, **kwargs):
4098 """
4099 IsChecked(self) -> bool
4100
4101 This method can be used with checkbox and menu events: for the
4102 checkboxes, the method returns true for a selection event and false
4103 for a deselection one. For the menu events, this method indicates if
4104 the menu item just has become checked or unchecked (and thus only
4105 makes sense for checkable menu items).
4106 """
4107 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4108
4109 Checked = IsChecked
4110 def IsSelection(*args, **kwargs):
4111 """
4112 IsSelection(self) -> bool
4113
4114 For a listbox or similar event, returns true if it is a selection,
4115 false if it is a deselection.
4116 """
4117 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4118
4119 def SetExtraLong(*args, **kwargs):
4120 """SetExtraLong(self, long extraLong)"""
4121 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4122
4123 def GetExtraLong(*args, **kwargs):
4124 """
4125 GetExtraLong(self) -> long
4126
4127 Returns extra information dependant on the event objects type. If the
4128 event comes from a listbox selection, it is a boolean determining
4129 whether the event was a selection (true) or a deselection (false). A
4130 listbox deselection only occurs for multiple-selection boxes, and in
4131 this case the index and string values are indeterminate and the
4132 listbox must be examined by the application.
4133 """
4134 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4135
4136 def SetInt(*args, **kwargs):
4137 """SetInt(self, int i)"""
4138 return _core_.CommandEvent_SetInt(*args, **kwargs)
4139
4140 def GetInt(*args, **kwargs):
4141 """
4142 GetInt(self) -> int
4143
4144 Returns the integer identifier corresponding to a listbox, choice or
4145 radiobox selection (only if the event was a selection, not a
4146 deselection), or a boolean value representing the value of a checkbox.
4147 """
4148 return _core_.CommandEvent_GetInt(*args, **kwargs)
4149
4150 def GetClientData(*args, **kwargs):
4151 """
4152 GetClientData(self) -> PyObject
4153
4154 Returns the client data object for a listbox or choice selection event, (if any.)
4155 """
4156 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4157
4158 def SetClientData(*args, **kwargs):
4159 """
4160 SetClientData(self, PyObject clientData)
4161
4162 Associate the given client data with the item at position n.
4163 """
4164 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4165
4166 GetClientObject = GetClientData
4167 SetClientObject = SetClientData
4168
4169 def Clone(*args, **kwargs):
4170 """Clone(self) -> Event"""
4171 return _core_.CommandEvent_Clone(*args, **kwargs)
4172
4173 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4174 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4175 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4176 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4177 Selection = property(GetSelection,doc="See `GetSelection`")
4178 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4179 _core_.CommandEvent_swigregister(CommandEvent)
4180
4181 #---------------------------------------------------------------------------
4182
4183 class NotifyEvent(CommandEvent):
4184 """
4185 An instance of this class (or one of its derived classes) is sent from
4186 a control when the control's state is being changed and the control
4187 allows that change to be prevented from happening. The event handler
4188 can call `Veto` or `Allow` to tell the control what to do.
4189 """
4190 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4191 __repr__ = _swig_repr
4192 def __init__(self, *args, **kwargs):
4193 """
4194 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4195
4196 An instance of this class (or one of its derived classes) is sent from
4197 a control when the control's state is being changed and the control
4198 allows that change to be prevented from happening. The event handler
4199 can call `Veto` or `Allow` to tell the control what to do.
4200 """
4201 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4202 def Veto(*args, **kwargs):
4203 """
4204 Veto(self)
4205
4206 Prevents the change announced by this event from happening.
4207
4208 It is in general a good idea to notify the user about the reasons for
4209 vetoing the change because otherwise the applications behaviour (which
4210 just refuses to do what the user wants) might be quite surprising.
4211 """
4212 return _core_.NotifyEvent_Veto(*args, **kwargs)
4213
4214 def Allow(*args, **kwargs):
4215 """
4216 Allow(self)
4217
4218 This is the opposite of `Veto`: it explicitly allows the event to be
4219 processed. For most events it is not necessary to call this method as
4220 the events are allowed anyhow but some are forbidden by default (this
4221 will be mentioned in the corresponding event description).
4222 """
4223 return _core_.NotifyEvent_Allow(*args, **kwargs)
4224
4225 def IsAllowed(*args, **kwargs):
4226 """
4227 IsAllowed(self) -> bool
4228
4229 Returns true if the change is allowed (`Veto` hasn't been called) or
4230 false otherwise (if it was).
4231 """
4232 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4233
4234 _core_.NotifyEvent_swigregister(NotifyEvent)
4235
4236 #---------------------------------------------------------------------------
4237
4238 class ScrollEvent(CommandEvent):
4239 """
4240 A scroll event holds information about events sent from stand-alone
4241 scrollbars and sliders. Note that scrolled windows do not send
4242 instnaces of this event class, but send the `wx.ScrollWinEvent`
4243 instead.
4244 """
4245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4246 __repr__ = _swig_repr
4247 def __init__(self, *args, **kwargs):
4248 """
4249 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4250 int orient=0) -> ScrollEvent
4251 """
4252 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4253 def GetOrientation(*args, **kwargs):
4254 """
4255 GetOrientation(self) -> int
4256
4257 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4258 the scrollbar.
4259 """
4260 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4261
4262 def GetPosition(*args, **kwargs):
4263 """
4264 GetPosition(self) -> int
4265
4266 Returns the position of the scrollbar.
4267 """
4268 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4269
4270 def SetOrientation(*args, **kwargs):
4271 """SetOrientation(self, int orient)"""
4272 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4273
4274 def SetPosition(*args, **kwargs):
4275 """SetPosition(self, int pos)"""
4276 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4277
4278 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4279 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4280 _core_.ScrollEvent_swigregister(ScrollEvent)
4281
4282 #---------------------------------------------------------------------------
4283
4284 class ScrollWinEvent(Event):
4285 """
4286 A wx.ScrollWinEvent holds information about scrolling and is sent from
4287 scrolling windows.
4288 """
4289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4290 __repr__ = _swig_repr
4291 def __init__(self, *args, **kwargs):
4292 """
4293 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4294
4295 A wx.ScrollWinEvent holds information about scrolling and is sent from
4296 scrolling windows.
4297 """
4298 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4299 def GetOrientation(*args, **kwargs):
4300 """
4301 GetOrientation(self) -> int
4302
4303 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4304 the scrollbar.
4305 """
4306 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4307
4308 def GetPosition(*args, **kwargs):
4309 """
4310 GetPosition(self) -> int
4311
4312 Returns the position of the scrollbar for the thumb track and release
4313 events. Note that this field can't be used for the other events, you
4314 need to query the window itself for the current position in that case.
4315 """
4316 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4317
4318 def SetOrientation(*args, **kwargs):
4319 """SetOrientation(self, int orient)"""
4320 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4321
4322 def SetPosition(*args, **kwargs):
4323 """SetPosition(self, int pos)"""
4324 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4325
4326 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4327 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4328 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4329
4330 #---------------------------------------------------------------------------
4331
4332 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4333 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4334 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4335 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4336 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4337 class MouseEvent(Event):
4338 """
4339 This event class contains information about the events generated by
4340 the mouse: they include mouse buttons press and release events and
4341 mouse move events.
4342
4343 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4344 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4345 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4346 a middle button so a portable application should avoid relying on the
4347 events from it.
4348
4349 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4350 the former returns true when the event corresponds to the left mouse
4351 button click while the latter returns true if the left mouse button is
4352 currently being pressed. For example, when the user is dragging the
4353 mouse you can use `LeftIsDown` to test whether the left mouse button
4354 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4355 `LeftIsDown` will also return true in wxWidgets whatever the
4356 underlying GUI behaviour is (which is platform-dependent). The same
4357 applies, of course, to other mouse buttons as well.
4358 """
4359 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4360 __repr__ = _swig_repr
4361 def __init__(self, *args, **kwargs):
4362 """
4363 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4364
4365 Constructs a wx.MouseEvent. Valid event types are:
4366
4367 * wxEVT_ENTER_WINDOW
4368 * wxEVT_LEAVE_WINDOW
4369 * wxEVT_LEFT_DOWN
4370 * wxEVT_LEFT_UP
4371 * wxEVT_LEFT_DCLICK
4372 * wxEVT_MIDDLE_DOWN
4373 * wxEVT_MIDDLE_UP
4374 * wxEVT_MIDDLE_DCLICK
4375 * wxEVT_RIGHT_DOWN
4376 * wxEVT_RIGHT_UP
4377 * wxEVT_RIGHT_DCLICK
4378 * wxEVT_MOTION
4379 * wxEVT_MOUSEWHEEL
4380 """
4381 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4382 def IsButton(*args, **kwargs):
4383 """
4384 IsButton(self) -> bool
4385
4386 Returns true if the event was a mouse button event (not necessarily a
4387 button down event - that may be tested using `ButtonDown`).
4388 """
4389 return _core_.MouseEvent_IsButton(*args, **kwargs)
4390
4391 def ButtonDown(*args, **kwargs):
4392 """
4393 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4394
4395 If the argument is omitted, this returns true if the event was any
4396 mouse button down event. Otherwise the argument specifies which
4397 button-down event shold be checked for (see `Button` for the possible
4398 values).
4399 """
4400 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4401
4402 def ButtonDClick(*args, **kwargs):
4403 """
4404 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4405
4406 If the argument is omitted, this returns true if the event was any
4407 mouse double click event. Otherwise the argument specifies which
4408 double click event to check for (see `Button` for the possible
4409 values).
4410 """
4411 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4412
4413 def ButtonUp(*args, **kwargs):
4414 """
4415 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4416
4417 If the argument is omitted, this returns true if the event was any
4418 mouse button up event. Otherwise the argument specifies which button
4419 up event to check for (see `Button` for the possible values).
4420 """
4421 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4422
4423 def Button(*args, **kwargs):
4424 """
4425 Button(self, int button) -> bool
4426
4427 Returns true if the identified mouse button is changing state. Valid
4428 values of button are:
4429
4430 ==================== =====================================
4431 wx.MOUSE_BTN_LEFT check if left button was pressed
4432 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4433 wx.MOUSE_BTN_RIGHT check if right button was pressed
4434 wx.MOUSE_BTN_ANY check if any button was pressed
4435 ==================== =====================================
4436
4437 """
4438 return _core_.MouseEvent_Button(*args, **kwargs)
4439
4440 def ButtonIsDown(*args, **kwargs):
4441 """ButtonIsDown(self, int but) -> bool"""
4442 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4443
4444 def GetButton(*args, **kwargs):
4445 """
4446 GetButton(self) -> int
4447
4448 Returns the mouse button which generated this event or
4449 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4450 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4451 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4452 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4453 right buttons respectively.
4454 """
4455 return _core_.MouseEvent_GetButton(*args, **kwargs)
4456
4457 def ControlDown(*args, **kwargs):
4458 """
4459 ControlDown(self) -> bool
4460
4461 Returns true if the control key was down at the time of the event.
4462 """
4463 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4464
4465 def MetaDown(*args, **kwargs):
4466 """
4467 MetaDown(self) -> bool
4468
4469 Returns true if the Meta key was down at the time of the event.
4470 """
4471 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4472
4473 def AltDown(*args, **kwargs):
4474 """
4475 AltDown(self) -> bool
4476
4477 Returns true if the Alt key was down at the time of the event.
4478 """
4479 return _core_.MouseEvent_AltDown(*args, **kwargs)
4480
4481 def ShiftDown(*args, **kwargs):
4482 """
4483 ShiftDown(self) -> bool
4484
4485 Returns true if the Shift key was down at the time of the event.
4486 """
4487 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4488
4489 def CmdDown(*args, **kwargs):
4490 """
4491 CmdDown(self) -> bool
4492
4493 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4494 platforms but the special "Apple" (a.k.a as "Command") key on
4495 Macs. It often makes sense to use it instead of, say, `ControlDown`
4496 because Cmd key is used for the same thing under Mac as Ctrl
4497 elsewhere. The Ctrl key still exists, it's just not used for this
4498 purpose. So for non-Mac platforms this is the same as `ControlDown`
4499 and Macs this is the same as `MetaDown`.
4500 """
4501 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4502
4503 def LeftDown(*args, **kwargs):
4504 """
4505 LeftDown(self) -> bool
4506
4507 Returns true if the left mouse button state changed to down.
4508 """
4509 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4510
4511 def MiddleDown(*args, **kwargs):
4512 """
4513 MiddleDown(self) -> bool
4514
4515 Returns true if the middle mouse button state changed to down.
4516 """
4517 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4518
4519 def RightDown(*args, **kwargs):
4520 """
4521 RightDown(self) -> bool
4522
4523 Returns true if the right mouse button state changed to down.
4524 """
4525 return _core_.MouseEvent_RightDown(*args, **kwargs)
4526
4527 def LeftUp(*args, **kwargs):
4528 """
4529 LeftUp(self) -> bool
4530
4531 Returns true if the left mouse button state changed to up.
4532 """
4533 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4534
4535 def MiddleUp(*args, **kwargs):
4536 """
4537 MiddleUp(self) -> bool
4538
4539 Returns true if the middle mouse button state changed to up.
4540 """
4541 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4542
4543 def RightUp(*args, **kwargs):
4544 """
4545 RightUp(self) -> bool
4546
4547 Returns true if the right mouse button state changed to up.
4548 """
4549 return _core_.MouseEvent_RightUp(*args, **kwargs)
4550
4551 def LeftDClick(*args, **kwargs):
4552 """
4553 LeftDClick(self) -> bool
4554
4555 Returns true if the event was a left button double click.
4556 """
4557 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4558
4559 def MiddleDClick(*args, **kwargs):
4560 """
4561 MiddleDClick(self) -> bool
4562
4563 Returns true if the event was a middle button double click.
4564 """
4565 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4566
4567 def RightDClick(*args, **kwargs):
4568 """
4569 RightDClick(self) -> bool
4570
4571 Returns true if the event was a right button double click.
4572 """
4573 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4574
4575 def LeftIsDown(*args, **kwargs):
4576 """
4577 LeftIsDown(self) -> bool
4578
4579 Returns true if the left mouse button is currently down, independent
4580 of the current event type.
4581
4582 Please notice that it is not the same as LeftDown which returns true
4583 if the left mouse button was just pressed. Rather, it describes the
4584 state of the mouse button before the event happened.
4585
4586 This event is usually used in the mouse event handlers which process
4587 "move mouse" messages to determine whether the user is (still)
4588 dragging the mouse.
4589 """
4590 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4591
4592 def MiddleIsDown(*args, **kwargs):
4593 """
4594 MiddleIsDown(self) -> bool
4595
4596 Returns true if the middle mouse button is currently down, independent
4597 of the current event type.
4598 """
4599 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4600
4601 def RightIsDown(*args, **kwargs):
4602 """
4603 RightIsDown(self) -> bool
4604
4605 Returns true if the right mouse button is currently down, independent
4606 of the current event type.
4607 """
4608 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4609
4610 def Dragging(*args, **kwargs):
4611 """
4612 Dragging(self) -> bool
4613
4614 Returns true if this was a dragging event (motion while a button is
4615 depressed).
4616 """
4617 return _core_.MouseEvent_Dragging(*args, **kwargs)
4618
4619 def Moving(*args, **kwargs):
4620 """
4621 Moving(self) -> bool
4622
4623 Returns true if this was a motion event and no mouse buttons were
4624 pressed. If any mouse button is held pressed, then this method returns
4625 false and Dragging returns true.
4626 """
4627 return _core_.MouseEvent_Moving(*args, **kwargs)
4628
4629 def Entering(*args, **kwargs):
4630 """
4631 Entering(self) -> bool
4632
4633 Returns true if the mouse was entering the window.
4634 """
4635 return _core_.MouseEvent_Entering(*args, **kwargs)
4636
4637 def Leaving(*args, **kwargs):
4638 """
4639 Leaving(self) -> bool
4640
4641 Returns true if the mouse was leaving the window.
4642 """
4643 return _core_.MouseEvent_Leaving(*args, **kwargs)
4644
4645 def GetPosition(*args, **kwargs):
4646 """
4647 GetPosition(self) -> Point
4648
4649 Returns the pixel position of the mouse in window coordinates when the
4650 event happened.
4651 """
4652 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4653
4654 def GetPositionTuple(*args, **kwargs):
4655 """
4656 GetPositionTuple() -> (x,y)
4657
4658 Returns the pixel position of the mouse in window coordinates when the
4659 event happened.
4660 """
4661 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4662
4663 def GetLogicalPosition(*args, **kwargs):
4664 """
4665 GetLogicalPosition(self, DC dc) -> Point
4666
4667 Returns the logical mouse position in pixels (i.e. translated
4668 according to the translation set for the DC, which usually indicates
4669 that the window has been scrolled).
4670 """
4671 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4672
4673 def GetX(*args, **kwargs):
4674 """
4675 GetX(self) -> int
4676
4677 Returns X coordinate of the physical mouse event position.
4678 """
4679 return _core_.MouseEvent_GetX(*args, **kwargs)
4680
4681 def GetY(*args, **kwargs):
4682 """
4683 GetY(self) -> int
4684
4685 Returns Y coordinate of the physical mouse event position.
4686 """
4687 return _core_.MouseEvent_GetY(*args, **kwargs)
4688
4689 def GetWheelRotation(*args, **kwargs):
4690 """
4691 GetWheelRotation(self) -> int
4692
4693 Get wheel rotation, positive or negative indicates direction of
4694 rotation. Current devices all send an event when rotation is equal to
4695 +/-WheelDelta, but this allows for finer resolution devices to be
4696 created in the future. Because of this you shouldn't assume that one
4697 event is equal to 1 line or whatever, but you should be able to either
4698 do partial line scrolling or wait until +/-WheelDelta rotation values
4699 have been accumulated before scrolling.
4700 """
4701 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4702
4703 def GetWheelDelta(*args, **kwargs):
4704 """
4705 GetWheelDelta(self) -> int
4706
4707 Get wheel delta, normally 120. This is the threshold for action to be
4708 taken, and one such action (for example, scrolling one increment)
4709 should occur for each delta.
4710 """
4711 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4712
4713 def GetLinesPerAction(*args, **kwargs):
4714 """
4715 GetLinesPerAction(self) -> int
4716
4717 Returns the configured number of lines (or whatever) to be scrolled
4718 per wheel action. Defaults to three.
4719 """
4720 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4721
4722 def IsPageScroll(*args, **kwargs):
4723 """
4724 IsPageScroll(self) -> bool
4725
4726 Returns true if the system has been setup to do page scrolling with
4727 the mouse wheel instead of line scrolling.
4728 """
4729 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4730
4731 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4732 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4733 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4734 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4735 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4736 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4737 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4738 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4739 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4740 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4741 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4742 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4743 Button = property(GetButton,doc="See `GetButton`")
4744 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4745 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4746 Position = property(GetPosition,doc="See `GetPosition`")
4747 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4748 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4749 X = property(GetX,doc="See `GetX`")
4750 Y = property(GetY,doc="See `GetY`")
4751 _core_.MouseEvent_swigregister(MouseEvent)
4752
4753 #---------------------------------------------------------------------------
4754
4755 class SetCursorEvent(Event):
4756 """
4757 A SetCursorEvent is generated when the mouse cursor is about to be set
4758 as a result of mouse motion. This event gives the application the
4759 chance to perform specific mouse cursor processing based on the
4760 current position of the mouse within the window. Use the `SetCursor`
4761 method to specify the cursor you want to be displayed.
4762 """
4763 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4764 __repr__ = _swig_repr
4765 def __init__(self, *args, **kwargs):
4766 """
4767 __init__(self, int x=0, int y=0) -> SetCursorEvent
4768
4769 Construct a new `wx.SetCursorEvent`.
4770 """
4771 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4772 def GetX(*args, **kwargs):
4773 """
4774 GetX(self) -> int
4775
4776 Returns the X coordinate of the mouse in client coordinates.
4777 """
4778 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4779
4780 def GetY(*args, **kwargs):
4781 """
4782 GetY(self) -> int
4783
4784 Returns the Y coordinate of the mouse in client coordinates.
4785 """
4786 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4787
4788 def SetCursor(*args, **kwargs):
4789 """
4790 SetCursor(self, Cursor cursor)
4791
4792 Sets the cursor associated with this event.
4793 """
4794 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4795
4796 def GetCursor(*args, **kwargs):
4797 """
4798 GetCursor(self) -> Cursor
4799
4800 Returns a reference to the cursor specified by this event.
4801 """
4802 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4803
4804 def HasCursor(*args, **kwargs):
4805 """
4806 HasCursor(self) -> bool
4807
4808 Returns true if the cursor specified by this event is a valid cursor.
4809 """
4810 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4811
4812 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4813 X = property(GetX,doc="See `GetX`")
4814 Y = property(GetY,doc="See `GetY`")
4815 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4816
4817 #---------------------------------------------------------------------------
4818
4819 class KeyEvent(Event):
4820 """
4821 This event class contains information about keypress and character
4822 events. These events are only sent to the widget that currently has
4823 the keyboard focus.
4824
4825 Notice that there are three different kinds of keyboard events in
4826 wxWidgets: key down and up events and char events. The difference
4827 between the first two is clear - the first corresponds to a key press
4828 and the second to a key release - otherwise they are identical. Just
4829 note that if the key is maintained in a pressed state you will
4830 typically get a lot of (automatically generated) down events but only
4831 one up so it is wrong to assume that there is one up event
4832 corresponding to each down one.
4833
4834 Both key events provide untranslated key codes while the char event
4835 carries the translated one. The untranslated code for alphanumeric
4836 keys is always an upper case value. For the other keys it is one of
4837 WXK_XXX values from the keycodes table. The translated key is, in
4838 general, the character the user expects to appear as the result of the
4839 key combination when typing the text into a text entry zone, for
4840 example.
4841
4842 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4843 and the standard US keyboard): when the 'A' key is pressed, the key
4844 down event key code is equal to ASCII A == 65. But the char event key
4845 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4846 'A' keys simultaneously , the key code in key down event will still be
4847 just 'A' while the char event key code parameter will now be 'A' as
4848 well.
4849
4850 Although in this simple case it is clear that the correct key code
4851 could be found in the key down event handler by checking the value
4852 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4853 as for non alphanumeric keys or non-US keyboard layouts the
4854 translation is keyboard-layout dependent and can only be done properly
4855 by the system itself.
4856
4857 Another kind of translation is done when the control key is pressed:
4858 for example, for CTRL-A key press the key down event still carries the
4859 same key code 'A' as usual but the char event will have key code of 1,
4860 the ASCII value of this key combination.
4861
4862 You may discover how the other keys on your system behave
4863 interactively by running the KeyEvents sample in the wxPython demo and
4864 pressing some keys while the blue box at the top has the keyboard
4865 focus.
4866
4867 **Note**: If a key down event is caught and the event handler does not
4868 call event.Skip() then the coresponding char event will not
4869 happen. This is by design and enables the programs that handle both
4870 types of events to be a bit simpler.
4871
4872 **Note for Windows programmers**: The key and char events in wxWidgets
4873 are similar to but slightly different from Windows WM_KEYDOWN and
4874 WM_CHAR events. In particular, Alt-x combination will generate a char
4875 event in wxWidgets (unless it is used as an accelerator).
4876
4877 **Tip**: be sure to call event.Skip() for events that you don't
4878 process in key event function, otherwise menu shortcuts may cease to
4879 work under Windows.
4880
4881 """
4882 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4883 __repr__ = _swig_repr
4884 def __init__(self, *args, **kwargs):
4885 """
4886 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4887
4888 Construct a new `wx.KeyEvent`. Valid event types are:
4889 *
4890 """
4891 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4892 def GetModifiers(*args, **kwargs):
4893 """
4894 GetModifiers(self) -> int
4895
4896 Returns a bitmask of the current modifier settings. Can be used to
4897 check if the key event has exactly the given modifiers without having
4898 to explicitly check that the other modifiers are not down. For
4899 example::
4900
4901 if event.GetModifers() == wx.MOD_CONTROL:
4902 DoSomething()
4903
4904 """
4905 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4906
4907 def ControlDown(*args, **kwargs):
4908 """
4909 ControlDown(self) -> bool
4910
4911 Returns ``True`` if the Control key was down at the time of the event.
4912 """
4913 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4914
4915 def MetaDown(*args, **kwargs):
4916 """
4917 MetaDown(self) -> bool
4918
4919 Returns ``True`` if the Meta key was down at the time of the event.
4920 """
4921 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4922
4923 def AltDown(*args, **kwargs):
4924 """
4925 AltDown(self) -> bool
4926
4927 Returns ``True`` if the Alt key was down at the time of the event.
4928 """
4929 return _core_.KeyEvent_AltDown(*args, **kwargs)
4930
4931 def ShiftDown(*args, **kwargs):
4932 """
4933 ShiftDown(self) -> bool
4934
4935 Returns ``True`` if the Shift key was down at the time of the event.
4936 """
4937 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4938
4939 def CmdDown(*args, **kwargs):
4940 """
4941 CmdDown(self) -> bool
4942
4943 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4944 platforms but the special "Apple" (a.k.a as "Command") key on
4945 Macs. It makes often sense to use it instead of, say, `ControlDown`
4946 because Cmd key is used for the same thing under Mac as Ctrl
4947 elsewhere. The Ctrl still exists, it's just not used for this
4948 purpose. So for non-Mac platforms this is the same as `ControlDown`
4949 and Macs this is the same as `MetaDown`.
4950 """
4951 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4952
4953 def HasModifiers(*args, **kwargs):
4954 """
4955 HasModifiers(self) -> bool
4956
4957 Returns true if either CTRL or ALT keys was down at the time of the
4958 key event. Note that this function does not take into account neither
4959 SHIFT nor META key states (the reason for ignoring the latter is that
4960 it is common for NUMLOCK key to be configured as META under X but the
4961 key presses even while NUMLOCK is on should be still processed
4962 normally).
4963 """
4964 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4965
4966 def GetKeyCode(*args, **kwargs):
4967 """
4968 GetKeyCode(self) -> int
4969
4970 Returns the virtual key code. ASCII events return normal ASCII values,
4971 while non-ASCII events return values such as WXK_LEFT for the left
4972 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4973 codes.
4974
4975 Note that in Unicode build, the returned value is meaningful only if
4976 the user entered a character that can be represented in current
4977 locale's default charset. You can obtain the corresponding Unicode
4978 character using `GetUnicodeKey`.
4979 """
4980 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4981
4982 def GetUnicodeKey(*args, **kwargs):
4983 """
4984 GetUnicodeKey(self) -> int
4985
4986 Returns the Unicode character corresponding to this key event. This
4987 function is only meaningfule in a Unicode build of wxPython.
4988 """
4989 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4990
4991 GetUniChar = GetUnicodeKey
4992 def SetUnicodeKey(*args, **kwargs):
4993 """
4994 SetUnicodeKey(self, int uniChar)
4995
4996 Set the Unicode value of the key event, but only if this is a Unicode
4997 build of wxPython.
4998 """
4999 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5000
5001 def GetRawKeyCode(*args, **kwargs):
5002 """
5003 GetRawKeyCode(self) -> unsigned int
5004
5005 Returns the raw key code for this event. This is a platform-dependent
5006 scan code which should only be used in advanced
5007 applications. Currently the raw key codes are not supported by all
5008 ports.
5009 """
5010 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5011
5012 def GetRawKeyFlags(*args, **kwargs):
5013 """
5014 GetRawKeyFlags(self) -> unsigned int
5015
5016 Returns the low level key flags for this event. The flags are
5017 platform-dependent and should only be used in advanced applications.
5018 Currently the raw key flags are not supported by all ports.
5019 """
5020 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5021
5022 def GetPosition(*args, **kwargs):
5023 """
5024 GetPosition(self) -> Point
5025
5026 Find the position of the event, if applicable.
5027 """
5028 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5029
5030 def GetPositionTuple(*args, **kwargs):
5031 """
5032 GetPositionTuple() -> (x,y)
5033
5034 Find the position of the event, if applicable.
5035 """
5036 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5037
5038 def GetX(*args, **kwargs):
5039 """
5040 GetX(self) -> int
5041
5042 Returns the X position (in client coordinates) of the event, if
5043 applicable.
5044 """
5045 return _core_.KeyEvent_GetX(*args, **kwargs)
5046
5047 def GetY(*args, **kwargs):
5048 """
5049 GetY(self) -> int
5050
5051 Returns the Y position (in client coordinates) of the event, if
5052 applicable.
5053 """
5054 return _core_.KeyEvent_GetY(*args, **kwargs)
5055
5056 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5057 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5058 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5059 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5060 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5061 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5062 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5063 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5064 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5065 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5066 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5067 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5068 Position = property(GetPosition,doc="See `GetPosition`")
5069 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5070 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5071 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5072 X = property(GetX,doc="See `GetX`")
5073 Y = property(GetY,doc="See `GetY`")
5074 _core_.KeyEvent_swigregister(KeyEvent)
5075
5076 #---------------------------------------------------------------------------
5077
5078 class SizeEvent(Event):
5079 """
5080 A size event holds information about size change events. The EVT_SIZE
5081 handler function will be called when the window it is bound to has
5082 been resized.
5083
5084 Note that the size passed is of the whole window: call
5085 `wx.Window.GetClientSize` for the area which may be used by the
5086 application.
5087
5088 When a window is resized, usually only a small part of the window is
5089 damaged and and that area is all that is in the update region for the
5090 next paint event. However, if your drawing depends on the size of the
5091 window, you may need to clear the DC explicitly and repaint the whole
5092 window. In which case, you may need to call `wx.Window.Refresh` to
5093 invalidate the entire window.
5094
5095 """
5096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5097 __repr__ = _swig_repr
5098 def __init__(self, *args, **kwargs):
5099 """
5100 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5101
5102 Construct a new ``wx.SizeEvent``.
5103 """
5104 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5105 def GetSize(*args, **kwargs):
5106 """
5107 GetSize(self) -> Size
5108
5109 Returns the entire size of the window generating the size change
5110 event.
5111 """
5112 return _core_.SizeEvent_GetSize(*args, **kwargs)
5113
5114 def GetRect(*args, **kwargs):
5115 """GetRect(self) -> Rect"""
5116 return _core_.SizeEvent_GetRect(*args, **kwargs)
5117
5118 def SetRect(*args, **kwargs):
5119 """SetRect(self, Rect rect)"""
5120 return _core_.SizeEvent_SetRect(*args, **kwargs)
5121
5122 def SetSize(*args, **kwargs):
5123 """SetSize(self, Size size)"""
5124 return _core_.SizeEvent_SetSize(*args, **kwargs)
5125
5126 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5127 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5128 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5129 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
5130 _core_.SizeEvent_swigregister(SizeEvent)
5131
5132 #---------------------------------------------------------------------------
5133
5134 class MoveEvent(Event):
5135 """
5136 This event object is sent for EVT_MOVE event bindings when a window is
5137 moved to a new position.
5138 """
5139 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5140 __repr__ = _swig_repr
5141 def __init__(self, *args, **kwargs):
5142 """
5143 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5144
5145 Constructor.
5146 """
5147 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5148 def GetPosition(*args, **kwargs):
5149 """
5150 GetPosition(self) -> Point
5151
5152 Returns the position of the window generating the move change event.
5153 """
5154 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5155
5156 def GetRect(*args, **kwargs):
5157 """GetRect(self) -> Rect"""
5158 return _core_.MoveEvent_GetRect(*args, **kwargs)
5159
5160 def SetRect(*args, **kwargs):
5161 """SetRect(self, Rect rect)"""
5162 return _core_.MoveEvent_SetRect(*args, **kwargs)
5163
5164 def SetPosition(*args, **kwargs):
5165 """SetPosition(self, Point pos)"""
5166 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5167
5168 m_pos = property(GetPosition, SetPosition)
5169 m_rect = property(GetRect, SetRect)
5170
5171 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5172 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5173 _core_.MoveEvent_swigregister(MoveEvent)
5174
5175 #---------------------------------------------------------------------------
5176
5177 class PaintEvent(Event):
5178 """
5179 A paint event is sent when a window's contents needs to be repainted.
5180 Note that in an EVT_PAINT handler the application must *always* create
5181 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5182 Windows assumes that the window has not been painted yet and will send
5183 the event again, causing endless refreshes.
5184
5185 You can optimize painting by retrieving the rectangles that have been
5186 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5187 and only repainting these rectangles. The rectangles are in terms of
5188 the client area, and are unscrolled, so you will need to do some
5189 calculations using the current view position to obtain logical,
5190 scrolled units.
5191
5192 """
5193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5194 __repr__ = _swig_repr
5195 def __init__(self, *args, **kwargs):
5196 """__init__(self, int Id=0) -> PaintEvent"""
5197 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5198 _core_.PaintEvent_swigregister(PaintEvent)
5199
5200 class NcPaintEvent(Event):
5201 """Proxy of C++ NcPaintEvent class"""
5202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5203 __repr__ = _swig_repr
5204 def __init__(self, *args, **kwargs):
5205 """__init__(self, int winid=0) -> NcPaintEvent"""
5206 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5207 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5208
5209 #---------------------------------------------------------------------------
5210
5211 class EraseEvent(Event):
5212 """
5213 An erase event is sent whenever the background of a window needs to be
5214 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5215 binder. On some platforms, such as GTK+, this event is simulated
5216 (simply generated just before the paint event) and may cause flicker.
5217
5218 To paint a custom background use the `GetDC` method and use the returned
5219 device context if it is not ``None``, otherwise create a temporary
5220 `wx.ClientDC` and draw on that.
5221
5222 """
5223 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5224 __repr__ = _swig_repr
5225 def __init__(self, *args, **kwargs):
5226 """
5227 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5228
5229 Constructor
5230 """
5231 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5232 def GetDC(*args, **kwargs):
5233 """
5234 GetDC(self) -> DC
5235
5236 Returns the device context the event handler should draw upon. If
5237 ``None`` is returned then create a temporary `wx.ClientDC` and use
5238 that instead.
5239 """
5240 return _core_.EraseEvent_GetDC(*args, **kwargs)
5241
5242 DC = property(GetDC,doc="See `GetDC`")
5243 _core_.EraseEvent_swigregister(EraseEvent)
5244
5245 #---------------------------------------------------------------------------
5246
5247 class FocusEvent(Event):
5248 """
5249 A focus event is sent when a window's focus changes. The window losing
5250 focus receives an EVT_KILL_FOCUS event while the window gaining it
5251 gets an EVT_SET_FOCUS event.
5252
5253 Notice that the set focus event happens both when the user gives focus
5254 to the window (whether using the mouse or keyboard) and when it is
5255 done from the program itself using `wx.Window.SetFocus`.
5256
5257 """
5258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5259 __repr__ = _swig_repr
5260 def __init__(self, *args, **kwargs):
5261 """
5262 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5263
5264 Constructor
5265 """
5266 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5267 def GetWindow(*args, **kwargs):
5268 """
5269 GetWindow(self) -> Window
5270
5271 Returns the other window associated with this event, that is the
5272 window which had the focus before for the EVT_SET_FOCUS event and the
5273 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5274
5275 Warning: the window returned may be None!
5276 """
5277 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5278
5279 def SetWindow(*args, **kwargs):
5280 """SetWindow(self, Window win)"""
5281 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5282
5283 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5284 _core_.FocusEvent_swigregister(FocusEvent)
5285
5286 #---------------------------------------------------------------------------
5287
5288 class ChildFocusEvent(CommandEvent):
5289 """
5290 A child focus event is sent to a (parent-)window when one of its child
5291 windows gains focus, so that the window could restore the focus back
5292 to its corresponding child if it loses it now and regains later.
5293
5294 Notice that child window is the direct child of the window receiving
5295 the event, and so may not be the actual widget recieving focus if it
5296 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5297 to get the widget that is actually receiving focus.
5298 """
5299 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5300 __repr__ = _swig_repr
5301 def __init__(self, *args, **kwargs):
5302 """
5303 __init__(self, Window win=None) -> ChildFocusEvent
5304
5305 Constructor
5306 """
5307 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5308 def GetWindow(*args, **kwargs):
5309 """
5310 GetWindow(self) -> Window
5311
5312 The window, or (grand)parent of the window which has just received the
5313 focus.
5314 """
5315 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5316
5317 Window = property(GetWindow,doc="See `GetWindow`")
5318 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5319
5320 #---------------------------------------------------------------------------
5321
5322 class ActivateEvent(Event):
5323 """
5324 An activate event is sent when a top-level window or the entire
5325 application is being activated or deactivated.
5326
5327 A top-level window (a dialog or frame) receives an activate event when
5328 is being activated or deactivated. This is indicated visually by the
5329 title bar changing colour, and a subwindow gaining the keyboard focus.
5330 An application is activated or deactivated when one of its frames
5331 becomes activated, or a frame becomes inactivate resulting in all
5332 application frames being inactive.
5333
5334 Please note that usually you should call event.Skip() in your handlers
5335 for these events so the default handlers will still be called, as not
5336 doing so can result in strange effects.
5337
5338 """
5339 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5340 __repr__ = _swig_repr
5341 def __init__(self, *args, **kwargs):
5342 """
5343 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5344
5345 Constructor
5346 """
5347 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5348 def GetActive(*args, **kwargs):
5349 """
5350 GetActive(self) -> bool
5351
5352 Returns true if the application or window is being activated, false
5353 otherwise.
5354 """
5355 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5356
5357 Active = property(GetActive,doc="See `GetActive`")
5358 _core_.ActivateEvent_swigregister(ActivateEvent)
5359
5360 #---------------------------------------------------------------------------
5361
5362 class InitDialogEvent(Event):
5363 """
5364 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5365 any window when `wx.Window.InitDialog` is called. Handlers for this
5366 event can transfer data to the window, or anything else that should be
5367 done before the user begins editing the form. The default handler
5368 calls `wx.Window.TransferDataToWindow`.
5369 """
5370 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5371 __repr__ = _swig_repr
5372 def __init__(self, *args, **kwargs):
5373 """
5374 __init__(self, int Id=0) -> InitDialogEvent
5375
5376 Constructor
5377 """
5378 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5379 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5380
5381 #---------------------------------------------------------------------------
5382
5383 class MenuEvent(Event):
5384 """
5385 This class is used for a variety of menu-related events. Note that
5386 these do not include menu command events, which are handled by sending
5387 `wx.CommandEvent` objects.
5388
5389 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5390 text in the first field of the status bar.
5391 """
5392 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5393 __repr__ = _swig_repr
5394 def __init__(self, *args, **kwargs):
5395 """
5396 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5397
5398 Constructor
5399 """
5400 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5401 def GetMenuId(*args, **kwargs):
5402 """
5403 GetMenuId(self) -> int
5404
5405 Returns the menu identifier associated with the event. This method
5406 should be only used with the HIGHLIGHT events.
5407 """
5408 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5409
5410 def IsPopup(*args, **kwargs):
5411 """
5412 IsPopup(self) -> bool
5413
5414 Returns ``True`` if the menu which is being opened or closed is a
5415 popup menu, ``False`` if it is a normal one. This method should only
5416 be used with the OPEN and CLOSE events.
5417 """
5418 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5419
5420 def GetMenu(*args, **kwargs):
5421 """
5422 GetMenu(self) -> Menu
5423
5424 Returns the menu which is being opened or closed. This method should
5425 only be used with the OPEN and CLOSE events.
5426 """
5427 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5428
5429 Menu = property(GetMenu,doc="See `GetMenu`")
5430 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5431 _core_.MenuEvent_swigregister(MenuEvent)
5432
5433 #---------------------------------------------------------------------------
5434
5435 class CloseEvent(Event):
5436 """
5437 This event class contains information about window and session close
5438 events.
5439
5440 The handler function for EVT_CLOSE is called when the user has tried
5441 to close a a frame or dialog box using the window manager controls or
5442 the system menu. It can also be invoked by the application itself
5443 programmatically, for example by calling the `wx.Window.Close`
5444 function.
5445
5446 You should check whether the application is forcing the deletion of
5447 the window using `CanVeto`. If it returns ``False``, you must destroy
5448 the window using `wx.Window.Destroy`. If the return value is ``True``,
5449 it is up to you whether you respond by destroying the window or not.
5450 For example you may wish to display a message dialog prompting to save
5451 files or to cancel the close.
5452
5453 If you don't destroy the window, you should call `Veto` to let the
5454 calling code know that you did not destroy the window. This allows the
5455 `wx.Window.Close` function to return ``True`` or ``False`` depending
5456 on whether the close instruction was honored or not.
5457 """
5458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5459 __repr__ = _swig_repr
5460 def __init__(self, *args, **kwargs):
5461 """
5462 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5463
5464 Constructor.
5465 """
5466 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5467 def SetLoggingOff(*args, **kwargs):
5468 """
5469 SetLoggingOff(self, bool logOff)
5470
5471 Sets the 'logging off' flag.
5472 """
5473 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5474
5475 def GetLoggingOff(*args, **kwargs):
5476 """
5477 GetLoggingOff(self) -> bool
5478
5479 Returns ``True`` if the user is logging off or ``False`` if the
5480 system is shutting down. This method can only be called for end
5481 session and query end session events, it doesn't make sense for close
5482 window event.
5483 """
5484 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5485
5486 def Veto(*args, **kwargs):
5487 """
5488 Veto(self, bool veto=True)
5489
5490 Call this from your event handler to veto a system shutdown or to
5491 signal to the calling application that a window close did not happen.
5492
5493 You can only veto a shutdown or close if `CanVeto` returns true.
5494 """
5495 return _core_.CloseEvent_Veto(*args, **kwargs)
5496
5497 def GetVeto(*args, **kwargs):
5498 """GetVeto(self) -> bool"""
5499 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5500
5501 def SetCanVeto(*args, **kwargs):
5502 """
5503 SetCanVeto(self, bool canVeto)
5504
5505 Sets the 'can veto' flag.
5506 """
5507 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5508
5509 def CanVeto(*args, **kwargs):
5510 """
5511 CanVeto(self) -> bool
5512
5513 Returns true if you can veto a system shutdown or a window close
5514 event. Vetoing a window close event is not possible if the calling
5515 code wishes to force the application to exit, and so this function
5516 must be called to check this.
5517 """
5518 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5519
5520 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5521 _core_.CloseEvent_swigregister(CloseEvent)
5522
5523 #---------------------------------------------------------------------------
5524
5525 class ShowEvent(Event):
5526 """An EVT_SHOW event is sent when a window is shown or hidden."""
5527 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5528 __repr__ = _swig_repr
5529 def __init__(self, *args, **kwargs):
5530 """
5531 __init__(self, int winid=0, bool show=False) -> ShowEvent
5532
5533 An EVT_SHOW event is sent when a window is shown or hidden.
5534 """
5535 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5536 def SetShow(*args, **kwargs):
5537 """SetShow(self, bool show)"""
5538 return _core_.ShowEvent_SetShow(*args, **kwargs)
5539
5540 def GetShow(*args, **kwargs):
5541 """GetShow(self) -> bool"""
5542 return _core_.ShowEvent_GetShow(*args, **kwargs)
5543
5544 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
5545 _core_.ShowEvent_swigregister(ShowEvent)
5546
5547 #---------------------------------------------------------------------------
5548
5549 class IconizeEvent(Event):
5550 """
5551 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5552 restored.
5553 """
5554 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5555 __repr__ = _swig_repr
5556 def __init__(self, *args, **kwargs):
5557 """
5558 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5559
5560 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5561 restored.
5562 """
5563 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5564 def Iconized(*args, **kwargs):
5565 """
5566 Iconized(self) -> bool
5567
5568 Returns ``True`` if the frame has been iconized, ``False`` if it has
5569 been restored.
5570 """
5571 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5572
5573 _core_.IconizeEvent_swigregister(IconizeEvent)
5574
5575 #---------------------------------------------------------------------------
5576
5577 class MaximizeEvent(Event):
5578 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5579 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5580 __repr__ = _swig_repr
5581 def __init__(self, *args, **kwargs):
5582 """
5583 __init__(self, int id=0) -> MaximizeEvent
5584
5585 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5586 """
5587 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5588 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5589
5590 #---------------------------------------------------------------------------
5591
5592 class DropFilesEvent(Event):
5593 """
5594 This class is used for drop files events, that is, when files have
5595 been dropped onto the window. This functionality is only available
5596 under Windows. The window must have previously been enabled for
5597 dropping by calling `wx.Window.DragAcceptFiles`.
5598
5599 Important note: this is a separate implementation to the more general
5600 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5601 implementation uses the older, Windows message-based approach of
5602 dropping files.
5603
5604 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5605 events.
5606
5607 """
5608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5609 def __init__(self): raise AttributeError, "No constructor defined"
5610 __repr__ = _swig_repr
5611 def GetPosition(*args, **kwargs):
5612 """
5613 GetPosition(self) -> Point
5614
5615 Returns the position at which the files were dropped.
5616 """
5617 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5618
5619 def GetNumberOfFiles(*args, **kwargs):
5620 """
5621 GetNumberOfFiles(self) -> int
5622
5623 Returns the number of files dropped.
5624 """
5625 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5626
5627 def GetFiles(*args, **kwargs):
5628 """
5629 GetFiles(self) -> PyObject
5630
5631 Returns a list of the filenames that were dropped.
5632 """
5633 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5634
5635 Files = property(GetFiles,doc="See `GetFiles`")
5636 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5637 Position = property(GetPosition,doc="See `GetPosition`")
5638 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5639
5640 #---------------------------------------------------------------------------
5641
5642 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5643 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5644 class UpdateUIEvent(CommandEvent):
5645 """
5646 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5647 wxWidgets to give an application the chance to update various user
5648 interface elements.
5649
5650 Without update UI events, an application has to work hard to
5651 check/uncheck, enable/disable, and set the text for elements such as
5652 menu items and toolbar buttons. The code for doing this has to be
5653 mixed up with the code that is invoked when an action is invoked for a
5654 menu item or button.
5655
5656 With update UI events, you define an event handler to look at the
5657 state of the application and change UI elements accordingly. wxWidgets
5658 will call your handler functions in idle time, so you don't have to
5659 worry where to call this code. In addition to being a clearer and more
5660 declarative method, it also means you don't have to worry whether
5661 you're updating a toolbar or menubar identifier. The same handler can
5662 update a menu item and toolbar button, if the ID values are the same.
5663
5664 Instead of directly manipulating the menu or button, you call
5665 functions in the event object, such as `Check`. wxWidgets will
5666 determine whether such a call has been made, and which UI element to
5667 update.
5668
5669 These events will work for popup menus as well as menubars. Just
5670 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5671 any UI events for the window that owns the menu.
5672
5673 If you find that the overhead of UI update processing is affecting
5674 your application, you can do one or both of the following:
5675
5676 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5677 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5678 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5679 receive update events. No other windows will receive update
5680 events.
5681
5682 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5683 value to set the delay between updates. You may need to call
5684 `wx.Window.UpdateWindowUI` at critical points, for example when
5685 a dialog is about to be shown, in case the user sees a slight
5686 delay before windows are updated.
5687
5688 Note that although events are sent in idle time, defining a EVT_IDLE
5689 handler for a window does not affect this because the events are sent
5690 from an internal idle handler.
5691
5692 wxWidgets tries to optimize update events on some platforms. On
5693 Windows and GTK+, events for menubar items are only sent when the menu
5694 is about to be shown, and not in idle time.
5695
5696 """
5697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5698 __repr__ = _swig_repr
5699 def __init__(self, *args, **kwargs):
5700 """
5701 __init__(self, int commandId=0) -> UpdateUIEvent
5702
5703 Constructor
5704 """
5705 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5706 def GetChecked(*args, **kwargs):
5707 """
5708 GetChecked(self) -> bool
5709
5710 Returns ``True`` if the UI element should be checked.
5711 """
5712 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5713
5714 def GetEnabled(*args, **kwargs):
5715 """
5716 GetEnabled(self) -> bool
5717
5718 Returns ``True`` if the UI element should be enabled.
5719 """
5720 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5721
5722 def GetShown(*args, **kwargs):
5723 """
5724 GetShown(self) -> bool
5725
5726 Returns ``True`` if the UI element should be shown.
5727 """
5728 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5729
5730 def GetText(*args, **kwargs):
5731 """
5732 GetText(self) -> String
5733
5734 Returns the text that should be set for the UI element.
5735 """
5736 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5737
5738 def GetSetText(*args, **kwargs):
5739 """
5740 GetSetText(self) -> bool
5741
5742 Returns ``True`` if the application has called `SetText`. For
5743 wxWidgets internal use only.
5744 """
5745 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5746
5747 def GetSetChecked(*args, **kwargs):
5748 """
5749 GetSetChecked(self) -> bool
5750
5751 Returns ``True`` if the application has called `Check`. For wxWidgets
5752 internal use only.
5753 """
5754 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5755
5756 def GetSetEnabled(*args, **kwargs):
5757 """
5758 GetSetEnabled(self) -> bool
5759
5760 Returns ``True`` if the application has called `Enable`. For wxWidgets
5761 internal use only.
5762 """
5763 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5764
5765 def GetSetShown(*args, **kwargs):
5766 """
5767 GetSetShown(self) -> bool
5768
5769 Returns ``True`` if the application has called `Show`. For wxWidgets
5770 internal use only.
5771 """
5772 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5773
5774 def Check(*args, **kwargs):
5775 """
5776 Check(self, bool check)
5777
5778 Check or uncheck the UI element.
5779 """
5780 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5781
5782 def Enable(*args, **kwargs):
5783 """
5784 Enable(self, bool enable)
5785
5786 Enable or disable the UI element.
5787 """
5788 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5789
5790 def Show(*args, **kwargs):
5791 """
5792 Show(self, bool show)
5793
5794 Show or hide the UI element.
5795 """
5796 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5797
5798 def SetText(*args, **kwargs):
5799 """
5800 SetText(self, String text)
5801
5802 Sets the text for this UI element.
5803 """
5804 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5805
5806 def SetUpdateInterval(*args, **kwargs):
5807 """
5808 SetUpdateInterval(long updateInterval)
5809
5810 Sets the interval between updates in milliseconds. Set to -1 to
5811 disable updates, or to 0 to update as frequently as possible. The
5812 default is 0.
5813
5814 Use this to reduce the overhead of UI update events if your
5815 application has a lot of windows. If you set the value to -1 or
5816 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5817 at appropriate points in your application, such as when a dialog is
5818 about to be shown.
5819 """
5820 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5821
5822 SetUpdateInterval = staticmethod(SetUpdateInterval)
5823 def GetUpdateInterval(*args, **kwargs):
5824 """
5825 GetUpdateInterval() -> long
5826
5827 Returns the current interval between updates in milliseconds. -1
5828 disables updates, 0 updates as frequently as possible.
5829 """
5830 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5831
5832 GetUpdateInterval = staticmethod(GetUpdateInterval)
5833 def CanUpdate(*args, **kwargs):
5834 """
5835 CanUpdate(Window win) -> bool
5836
5837 Returns ``True`` if it is appropriate to update (send UI update events
5838 to) this window.
5839
5840 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5841 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5842 events were last sent in idle time, and the update interval, to
5843 determine whether events should be sent to this window now. By default
5844 this will always return true because the update mode is initially
5845 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5846 events will be sent as often as possible. You can reduce the frequency
5847 that events are sent by changing the mode and/or setting an update
5848 interval.
5849
5850 """
5851 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5852
5853 CanUpdate = staticmethod(CanUpdate)
5854 def ResetUpdateTime(*args, **kwargs):
5855 """
5856 ResetUpdateTime()
5857
5858 Used internally to reset the last-updated time to the current time. It
5859 is assumed that update events are normally sent in idle time, so this
5860 is called at the end of idle processing.
5861 """
5862 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5863
5864 ResetUpdateTime = staticmethod(ResetUpdateTime)
5865 def SetMode(*args, **kwargs):
5866 """
5867 SetMode(int mode)
5868
5869 Specify how wxWidgets will send update events: to all windows, or only
5870 to those which specify that they will process the events.
5871
5872 The mode may be one of the following values:
5873
5874 ============================= ==========================================
5875 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5876 is the default setting.
5877 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5878 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5879 style set.
5880 ============================= ==========================================
5881
5882 """
5883 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5884
5885 SetMode = staticmethod(SetMode)
5886 def GetMode(*args, **kwargs):
5887 """
5888 GetMode() -> int
5889
5890 Returns a value specifying how wxWidgets will send update events: to
5891 all windows, or only to those which specify that they will process the
5892 events.
5893 """
5894 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5895
5896 GetMode = staticmethod(GetMode)
5897 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5898 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5899 Shown = property(GetShown,Show,doc="See `GetShown`")
5900 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
5901 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5902
5903 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5904 """
5905 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5906
5907 Sets the interval between updates in milliseconds. Set to -1 to
5908 disable updates, or to 0 to update as frequently as possible. The
5909 default is 0.
5910
5911 Use this to reduce the overhead of UI update events if your
5912 application has a lot of windows. If you set the value to -1 or
5913 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5914 at appropriate points in your application, such as when a dialog is
5915 about to be shown.
5916 """
5917 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5918
5919 def UpdateUIEvent_GetUpdateInterval(*args):
5920 """
5921 UpdateUIEvent_GetUpdateInterval() -> long
5922
5923 Returns the current interval between updates in milliseconds. -1
5924 disables updates, 0 updates as frequently as possible.
5925 """
5926 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5927
5928 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5929 """
5930 UpdateUIEvent_CanUpdate(Window win) -> bool
5931
5932 Returns ``True`` if it is appropriate to update (send UI update events
5933 to) this window.
5934
5935 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5936 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5937 events were last sent in idle time, and the update interval, to
5938 determine whether events should be sent to this window now. By default
5939 this will always return true because the update mode is initially
5940 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5941 events will be sent as often as possible. You can reduce the frequency
5942 that events are sent by changing the mode and/or setting an update
5943 interval.
5944
5945 """
5946 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5947
5948 def UpdateUIEvent_ResetUpdateTime(*args):
5949 """
5950 UpdateUIEvent_ResetUpdateTime()
5951
5952 Used internally to reset the last-updated time to the current time. It
5953 is assumed that update events are normally sent in idle time, so this
5954 is called at the end of idle processing.
5955 """
5956 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5957
5958 def UpdateUIEvent_SetMode(*args, **kwargs):
5959 """
5960 UpdateUIEvent_SetMode(int mode)
5961
5962 Specify how wxWidgets will send update events: to all windows, or only
5963 to those which specify that they will process the events.
5964
5965 The mode may be one of the following values:
5966
5967 ============================= ==========================================
5968 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5969 is the default setting.
5970 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5971 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5972 style set.
5973 ============================= ==========================================
5974
5975 """
5976 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5977
5978 def UpdateUIEvent_GetMode(*args):
5979 """
5980 UpdateUIEvent_GetMode() -> int
5981
5982 Returns a value specifying how wxWidgets will send update events: to
5983 all windows, or only to those which specify that they will process the
5984 events.
5985 """
5986 return _core_.UpdateUIEvent_GetMode(*args)
5987
5988 #---------------------------------------------------------------------------
5989
5990 class SysColourChangedEvent(Event):
5991 """
5992 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5993 when the user changes the colour settings using the control
5994 panel. This is only applicable under Windows.
5995
5996 The default event handler for this event propagates the event to child
5997 windows, since Windows only sends the events to top-level windows. If
5998 intercepting this event for a top-level window, remember to call
5999 `Skip` so the the base class handler will still be executed, or to
6000 pass the event on to the window's children explicitly.
6001
6002 """
6003 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6004 __repr__ = _swig_repr
6005 def __init__(self, *args, **kwargs):
6006 """
6007 __init__(self) -> SysColourChangedEvent
6008
6009 Constructor
6010 """
6011 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
6012 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
6013
6014 #---------------------------------------------------------------------------
6015
6016 class MouseCaptureChangedEvent(Event):
6017 """
6018 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6019 a window that loses its mouse capture. This is called even if
6020 `wx.Window.ReleaseMouse` was called by the application code. Handling
6021 this event allows an application to cater for unexpected capture
6022 releases which might otherwise confuse mouse handling code.
6023
6024 This event is implemented under Windows only.
6025 """
6026 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6027 __repr__ = _swig_repr
6028 def __init__(self, *args, **kwargs):
6029 """
6030 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6031
6032 Constructor
6033 """
6034 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
6035 def GetCapturedWindow(*args, **kwargs):
6036 """
6037 GetCapturedWindow(self) -> Window
6038
6039 Returns the window that gained the capture, or ``None`` if it was a
6040 non-wxWidgets window.
6041 """
6042 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6043
6044 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
6045 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
6046
6047 #---------------------------------------------------------------------------
6048
6049 class MouseCaptureLostEvent(Event):
6050 """
6051 A mouse capture lost event is sent to a window that obtained mouse
6052 capture, which was subsequently loss due to "external" event, for
6053 example when a dialog box is shown or if another application captures
6054 the mouse.
6055
6056 If this happens, this event is sent to all windows that are on the
6057 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6058 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6059 if the capture changes because of a call to CaptureMouse or
6060 ReleaseMouse.
6061
6062 This event is currently emitted under Windows only.
6063
6064 """
6065 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6066 __repr__ = _swig_repr
6067 def __init__(self, *args, **kwargs):
6068 """
6069 __init__(self, int winid=0) -> MouseCaptureLostEvent
6070
6071 A mouse capture lost event is sent to a window that obtained mouse
6072 capture, which was subsequently loss due to "external" event, for
6073 example when a dialog box is shown or if another application captures
6074 the mouse.
6075
6076 If this happens, this event is sent to all windows that are on the
6077 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6078 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6079 if the capture changes because of a call to CaptureMouse or
6080 ReleaseMouse.
6081
6082 This event is currently emitted under Windows only.
6083
6084 """
6085 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6086 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6087
6088 #---------------------------------------------------------------------------
6089
6090 class DisplayChangedEvent(Event):
6091 """
6092 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6093 resolution has changed.
6094
6095 This event is implemented under Windows only.
6096 """
6097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6098 __repr__ = _swig_repr
6099 def __init__(self, *args, **kwargs):
6100 """__init__(self) -> DisplayChangedEvent"""
6101 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6102 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6103
6104 #---------------------------------------------------------------------------
6105
6106 class PaletteChangedEvent(Event):
6107 """
6108 An EVT_PALETTE_CHANGED event is sent when the system palette has
6109 changed, thereby giving each window a chance to redo their own to
6110 match.
6111
6112 This event is implemented under Windows only.
6113 """
6114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6115 __repr__ = _swig_repr
6116 def __init__(self, *args, **kwargs):
6117 """
6118 __init__(self, int id=0) -> PaletteChangedEvent
6119
6120 An EVT_PALETTE_CHANGED event is sent when the system palette has
6121 changed, thereby giving each window a chance to redo their own to
6122 match.
6123
6124 This event is implemented under Windows only.
6125 """
6126 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6127 def SetChangedWindow(*args, **kwargs):
6128 """SetChangedWindow(self, Window win)"""
6129 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6130
6131 def GetChangedWindow(*args, **kwargs):
6132 """GetChangedWindow(self) -> Window"""
6133 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6134
6135 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
6136 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6137
6138 #---------------------------------------------------------------------------
6139
6140 class QueryNewPaletteEvent(Event):
6141 """
6142 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6143 focus and should re-do its palette.
6144
6145 This event is implemented under Windows only.
6146 """
6147 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6148 __repr__ = _swig_repr
6149 def __init__(self, *args, **kwargs):
6150 """
6151 __init__(self, int winid=0) -> QueryNewPaletteEvent
6152
6153 Constructor.
6154 """
6155 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6156 def SetPaletteRealized(*args, **kwargs):
6157 """
6158 SetPaletteRealized(self, bool realized)
6159
6160 App should set this if it changes the palette.
6161 """
6162 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6163
6164 def GetPaletteRealized(*args, **kwargs):
6165 """GetPaletteRealized(self) -> bool"""
6166 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6167
6168 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
6169 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6170
6171 #---------------------------------------------------------------------------
6172
6173 class NavigationKeyEvent(Event):
6174 """
6175 EVT_NAVIGATION_KEY events are used to control moving the focus between
6176 widgets, otherwise known as tab-traversal. You woudl normally not
6177 catch navigation events in applications as there are already
6178 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6179 it useful to send navigation events in certain situations to change
6180 the focus in certain ways, although it's probably easier to just call
6181 `wx.Window.Navigate`.
6182 """
6183 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6184 __repr__ = _swig_repr
6185 def __init__(self, *args, **kwargs):
6186 """__init__(self) -> NavigationKeyEvent"""
6187 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6188 def GetDirection(*args, **kwargs):
6189 """
6190 GetDirection(self) -> bool
6191
6192 Returns ``True`` if the direction is forward, ``False`` otherwise.
6193 """
6194 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6195
6196 def SetDirection(*args, **kwargs):
6197 """
6198 SetDirection(self, bool forward)
6199
6200 Specify the direction that the navigation should take. Usually the
6201 difference between using Tab and Shift-Tab.
6202 """
6203 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6204
6205 def IsWindowChange(*args, **kwargs):
6206 """
6207 IsWindowChange(self) -> bool
6208
6209 Returns ``True`` if window change is allowed.
6210 """
6211 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6212
6213 def SetWindowChange(*args, **kwargs):
6214 """
6215 SetWindowChange(self, bool ischange)
6216
6217 Specify if the navigation should be able to change parent windows.
6218 For example, changing notebook pages, etc. This is usually implemented
6219 by using Control-Tab.
6220 """
6221 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6222
6223 def IsFromTab(*args, **kwargs):
6224 """
6225 IsFromTab(self) -> bool
6226
6227 Returns ``True`` if the navigation event is originated from the Tab
6228 key.
6229 """
6230 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6231
6232 def SetFromTab(*args, **kwargs):
6233 """
6234 SetFromTab(self, bool bIs)
6235
6236 Set to true under MSW if the event was generated using the tab key.
6237 This is required for proper navogation over radio buttons.
6238 """
6239 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6240
6241 def SetFlags(*args, **kwargs):
6242 """
6243 SetFlags(self, long flags)
6244
6245 Set the navigation flags to a combination of the following:
6246
6247 * wx.NavigationKeyEvent.IsBackward
6248 * wx.NavigationKeyEvent.IsForward
6249 * wx.NavigationKeyEvent.WinChange
6250 * wx.NavigationKeyEvent.FromTab
6251
6252 """
6253 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6254
6255 def GetCurrentFocus(*args, **kwargs):
6256 """
6257 GetCurrentFocus(self) -> Window
6258
6259 Returns the child window which currenty has the focus. May be
6260 ``None``.
6261 """
6262 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6263
6264 def SetCurrentFocus(*args, **kwargs):
6265 """
6266 SetCurrentFocus(self, Window win)
6267
6268 Set the window that has the focus.
6269 """
6270 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6271
6272 IsBackward = _core_.NavigationKeyEvent_IsBackward
6273 IsForward = _core_.NavigationKeyEvent_IsForward
6274 WinChange = _core_.NavigationKeyEvent_WinChange
6275 FromTab = _core_.NavigationKeyEvent_FromTab
6276 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6277 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6278 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6279
6280 #---------------------------------------------------------------------------
6281
6282 class WindowCreateEvent(CommandEvent):
6283 """
6284 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6285 underlying GUI object) exists.
6286 """
6287 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6288 __repr__ = _swig_repr
6289 def __init__(self, *args, **kwargs):
6290 """
6291 __init__(self, Window win=None) -> WindowCreateEvent
6292
6293 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6294 underlying GUI object) exists.
6295 """
6296 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6297 def GetWindow(*args, **kwargs):
6298 """
6299 GetWindow(self) -> Window
6300
6301 Returns the window that this event refers to.
6302 """
6303 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6304
6305 Window = property(GetWindow,doc="See `GetWindow`")
6306 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6307
6308 class WindowDestroyEvent(CommandEvent):
6309 """
6310 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6311 when the GUI window is destroyed.
6312
6313 When a class derived from `wx.Window` is destroyed its destructor will
6314 have already run by the time this event is sent. Therefore this event
6315 will not usually be received at all by the window itself. Since it is
6316 received after the destructor has run, an object should not try to
6317 handle its own wx.WindowDestroyEvent, but it can be used to get
6318 notification of the destruction of another window.
6319 """
6320 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6321 __repr__ = _swig_repr
6322 def __init__(self, *args, **kwargs):
6323 """
6324 __init__(self, Window win=None) -> WindowDestroyEvent
6325
6326 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6327 when the GUI window is destroyed.
6328
6329 When a class derived from `wx.Window` is destroyed its destructor will
6330 have already run by the time this event is sent. Therefore this event
6331 will not usually be received at all by the window itself. Since it is
6332 received after the destructor has run, an object should not try to
6333 handle its own wx.WindowDestroyEvent, but it can be used to get
6334 notification of the destruction of another window.
6335 """
6336 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6337 def GetWindow(*args, **kwargs):
6338 """
6339 GetWindow(self) -> Window
6340
6341 Returns the window that this event refers to.
6342 """
6343 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6344
6345 Window = property(GetWindow,doc="See `GetWindow`")
6346 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6347
6348 #---------------------------------------------------------------------------
6349
6350 class ContextMenuEvent(CommandEvent):
6351 """
6352 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6353 give the application a chance to show a context (popup) menu.
6354 """
6355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6356 __repr__ = _swig_repr
6357 def __init__(self, *args, **kwargs):
6358 """
6359 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6360
6361 Constructor.
6362 """
6363 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6364 def GetPosition(*args, **kwargs):
6365 """
6366 GetPosition(self) -> Point
6367
6368 Returns the position (in screen coordinants) at which the menu should
6369 be shown.
6370 """
6371 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6372
6373 def SetPosition(*args, **kwargs):
6374 """
6375 SetPosition(self, Point pos)
6376
6377 Sets the position at which the menu should be shown.
6378 """
6379 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6380
6381 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6382 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6383
6384 #---------------------------------------------------------------------------
6385
6386 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6387 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6388 class IdleEvent(Event):
6389 """
6390 This class is used for EVT_IDLE events, which are generated and sent
6391 when the application *becomes* idle. In other words, the when the
6392 event queue becomes empty then idle events are sent to all windows (by
6393 default) and as long as none of them call `RequestMore` then there are
6394 no more idle events until after the system event queue has some normal
6395 events and then becomes empty again.
6396
6397 By default, idle events are sent to all windows. If this is causing a
6398 significant overhead in your application, you can call
6399 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6400 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6401 which should receive idle events. Then idle events will only be sent
6402 to those windows and not to any others.
6403 """
6404 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6405 __repr__ = _swig_repr
6406 def __init__(self, *args, **kwargs):
6407 """
6408 __init__(self) -> IdleEvent
6409
6410 Constructor
6411 """
6412 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6413 def RequestMore(*args, **kwargs):
6414 """
6415 RequestMore(self, bool needMore=True)
6416
6417 Tells wxWidgets that more processing is required. This function can be
6418 called by an EVT_IDLE handler for a window to indicate that the
6419 application should forward the EVT_IDLE event once more to the
6420 application windows. If no window calls this function during its
6421 EVT_IDLE handler, then the application will remain in a passive event
6422 loop until a new event is posted to the application by the windowing
6423 system.
6424 """
6425 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6426
6427 def MoreRequested(*args, **kwargs):
6428 """
6429 MoreRequested(self) -> bool
6430
6431 Returns ``True`` if the OnIdle function processing this event
6432 requested more processing time.
6433 """
6434 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6435
6436 def SetMode(*args, **kwargs):
6437 """
6438 SetMode(int mode)
6439
6440 Static method for specifying how wxWidgets will send idle events: to
6441 all windows, or only to those which specify that they will process the
6442 events.
6443
6444 The mode can be one of the following values:
6445
6446 ========================= ========================================
6447 wx.IDLE_PROCESS_ALL Send idle events to all windows
6448 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6449 the wx.WS_EX_PROCESS_IDLE extra style
6450 flag set.
6451 ========================= ========================================
6452
6453 """
6454 return _core_.IdleEvent_SetMode(*args, **kwargs)
6455
6456 SetMode = staticmethod(SetMode)
6457 def GetMode(*args, **kwargs):
6458 """
6459 GetMode() -> int
6460
6461 Static method returning a value specifying how wxWidgets will send
6462 idle events: to all windows, or only to those which specify that they
6463 will process the events.
6464 """
6465 return _core_.IdleEvent_GetMode(*args, **kwargs)
6466
6467 GetMode = staticmethod(GetMode)
6468 def CanSend(*args, **kwargs):
6469 """
6470 CanSend(Window win) -> bool
6471
6472 Returns ``True`` if it is appropriate to send idle events to this
6473 window.
6474
6475 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6476 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6477 events should be sent to this window now. By default this will always
6478 return ``True`` because the update mode is initially
6479 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6480 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6481 """
6482 return _core_.IdleEvent_CanSend(*args, **kwargs)
6483
6484 CanSend = staticmethod(CanSend)
6485 _core_.IdleEvent_swigregister(IdleEvent)
6486
6487 def IdleEvent_SetMode(*args, **kwargs):
6488 """
6489 IdleEvent_SetMode(int mode)
6490
6491 Static method for specifying how wxWidgets will send idle events: to
6492 all windows, or only to those which specify that they will process the
6493 events.
6494
6495 The mode can be one of the following values:
6496
6497 ========================= ========================================
6498 wx.IDLE_PROCESS_ALL Send idle events to all windows
6499 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6500 the wx.WS_EX_PROCESS_IDLE extra style
6501 flag set.
6502 ========================= ========================================
6503
6504 """
6505 return _core_.IdleEvent_SetMode(*args, **kwargs)
6506
6507 def IdleEvent_GetMode(*args):
6508 """
6509 IdleEvent_GetMode() -> int
6510
6511 Static method returning a value specifying how wxWidgets will send
6512 idle events: to all windows, or only to those which specify that they
6513 will process the events.
6514 """
6515 return _core_.IdleEvent_GetMode(*args)
6516
6517 def IdleEvent_CanSend(*args, **kwargs):
6518 """
6519 IdleEvent_CanSend(Window win) -> bool
6520
6521 Returns ``True`` if it is appropriate to send idle events to this
6522 window.
6523
6524 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6525 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6526 events should be sent to this window now. By default this will always
6527 return ``True`` because the update mode is initially
6528 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6529 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6530 """
6531 return _core_.IdleEvent_CanSend(*args, **kwargs)
6532
6533 #---------------------------------------------------------------------------
6534
6535 class ClipboardTextEvent(CommandEvent):
6536 """
6537 A Clipboard Text event is sent when a window intercepts a text
6538 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6539 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6540 popup menu command, etc. NOTE : under windows these events are *NOT*
6541 generated automatically for a Rich Edit text control.
6542 """
6543 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6544 __repr__ = _swig_repr
6545 def __init__(self, *args, **kwargs):
6546 """
6547 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6548
6549 A Clipboard Text event is sent when a window intercepts a text
6550 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6551 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6552 popup menu command, etc. NOTE : under windows these events are *NOT*
6553 generated automatically for a Rich Edit text control.
6554 """
6555 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6556 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6557
6558 #---------------------------------------------------------------------------
6559
6560 class PyEvent(Event):
6561 """
6562 wx.PyEvent can be used as a base class for implementing custom event
6563 types in Python. You should derived from this class instead of
6564 `wx.Event` because this class is Python-aware and is able to transport
6565 its Python bits safely through the wxWidgets event system and have
6566 them still be there when the event handler is invoked.
6567
6568 :see: `wx.PyCommandEvent`
6569
6570 """
6571 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6572 __repr__ = _swig_repr
6573 def __init__(self, *args, **kwargs):
6574 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6575 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6576 self._SetSelf(self)
6577
6578 __swig_destroy__ = _core_.delete_PyEvent
6579 __del__ = lambda self : None;
6580 def _SetSelf(*args, **kwargs):
6581 """_SetSelf(self, PyObject self)"""
6582 return _core_.PyEvent__SetSelf(*args, **kwargs)
6583
6584 def _GetSelf(*args, **kwargs):
6585 """_GetSelf(self) -> PyObject"""
6586 return _core_.PyEvent__GetSelf(*args, **kwargs)
6587
6588 _core_.PyEvent_swigregister(PyEvent)
6589
6590 class PyCommandEvent(CommandEvent):
6591 """
6592 wx.PyCommandEvent can be used as a base class for implementing custom
6593 event types in Python, where the event shoudl travel up to parent
6594 windows looking for a handler. You should derived from this class
6595 instead of `wx.CommandEvent` because this class is Python-aware and is
6596 able to transport its Python bits safely through the wxWidgets event
6597 system and have them still be there when the event handler is invoked.
6598
6599 :see: `wx.PyEvent`
6600
6601 """
6602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6603 __repr__ = _swig_repr
6604 def __init__(self, *args, **kwargs):
6605 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6606 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6607 self._SetSelf(self)
6608
6609 __swig_destroy__ = _core_.delete_PyCommandEvent
6610 __del__ = lambda self : None;
6611 def _SetSelf(*args, **kwargs):
6612 """_SetSelf(self, PyObject self)"""
6613 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6614
6615 def _GetSelf(*args, **kwargs):
6616 """_GetSelf(self) -> PyObject"""
6617 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6618
6619 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6620
6621 class DateEvent(CommandEvent):
6622 """
6623 This event class holds information about a date change event and is
6624 used together with `wx.DatePickerCtrl`. It also serves as a base class
6625 for `wx.calendar.CalendarEvent`. Bind these event types with
6626 EVT_DATE_CHANGED.
6627 """
6628 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6629 __repr__ = _swig_repr
6630 def __init__(self, *args, **kwargs):
6631 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6632 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6633 def GetDate(*args, **kwargs):
6634 """
6635 GetDate(self) -> DateTime
6636
6637 Returns the date.
6638 """
6639 return _core_.DateEvent_GetDate(*args, **kwargs)
6640
6641 def SetDate(*args, **kwargs):
6642 """
6643 SetDate(self, DateTime date)
6644
6645 Sets the date carried by the event, normally only used by the library
6646 internally.
6647 """
6648 return _core_.DateEvent_SetDate(*args, **kwargs)
6649
6650 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6651 _core_.DateEvent_swigregister(DateEvent)
6652
6653 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6654 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6655
6656 #---------------------------------------------------------------------------
6657
6658 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6659 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6660 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6661 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6662 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6663 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6664 class PyApp(EvtHandler):
6665 """
6666 The ``wx.PyApp`` class is an *implementation detail*, please use the
6667 `wx.App` class (or some other derived class) instead.
6668 """
6669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6670 __repr__ = _swig_repr
6671 def __init__(self, *args, **kwargs):
6672 """
6673 __init__(self) -> PyApp
6674
6675 Create a new application object, starting the bootstrap process.
6676 """
6677 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6678 self._setCallbackInfo(self, PyApp, False)
6679 self._setOORInfo(self, False)
6680
6681 __swig_destroy__ = _core_.delete_PyApp
6682 __del__ = lambda self : None;
6683 def _setCallbackInfo(*args, **kwargs):
6684 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6685 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6686
6687 def GetAppName(*args, **kwargs):
6688 """
6689 GetAppName(self) -> String
6690
6691 Get the application name.
6692 """
6693 return _core_.PyApp_GetAppName(*args, **kwargs)
6694
6695 def SetAppName(*args, **kwargs):
6696 """
6697 SetAppName(self, String name)
6698
6699 Set the application name. This value may be used automatically by
6700 `wx.Config` and such.
6701 """
6702 return _core_.PyApp_SetAppName(*args, **kwargs)
6703
6704 def GetClassName(*args, **kwargs):
6705 """
6706 GetClassName(self) -> String
6707
6708 Get the application's class name.
6709 """
6710 return _core_.PyApp_GetClassName(*args, **kwargs)
6711
6712 def SetClassName(*args, **kwargs):
6713 """
6714 SetClassName(self, String name)
6715
6716 Set the application's class name. This value may be used for
6717 X-resources if applicable for the platform
6718 """
6719 return _core_.PyApp_SetClassName(*args, **kwargs)
6720
6721 def GetVendorName(*args, **kwargs):
6722 """
6723 GetVendorName(self) -> String
6724
6725 Get the application's vendor name.
6726 """
6727 return _core_.PyApp_GetVendorName(*args, **kwargs)
6728
6729 def SetVendorName(*args, **kwargs):
6730 """
6731 SetVendorName(self, String name)
6732
6733 Set the application's vendor name. This value may be used
6734 automatically by `wx.Config` and such.
6735 """
6736 return _core_.PyApp_SetVendorName(*args, **kwargs)
6737
6738 def GetTraits(*args, **kwargs):
6739 """
6740 GetTraits(self) -> wxAppTraits
6741
6742 Return (and create if necessary) the app traits object to which we
6743 delegate for everything which either should be configurable by the
6744 user (then he can change the default behaviour simply by overriding
6745 CreateTraits() and returning his own traits object) or which is
6746 GUI/console dependent as then wx.AppTraits allows us to abstract the
6747 differences behind the common facade.
6748
6749 :todo: Add support for overriding CreateAppTraits in wxPython.
6750 """
6751 return _core_.PyApp_GetTraits(*args, **kwargs)
6752
6753 def ProcessPendingEvents(*args, **kwargs):
6754 """
6755 ProcessPendingEvents(self)
6756
6757 Process all events in the Pending Events list -- it is necessary to
6758 call this function to process posted events. This normally happens
6759 during each event loop iteration.
6760 """
6761 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6762
6763 def Yield(*args, **kwargs):
6764 """
6765 Yield(self, bool onlyIfNeeded=False) -> bool
6766
6767 Process all currently pending events right now, instead of waiting
6768 until return to the event loop. It is an error to call ``Yield``
6769 recursively unless the value of ``onlyIfNeeded`` is True.
6770
6771 :warning: This function is dangerous as it can lead to unexpected
6772 reentrancies (i.e. when called from an event handler it may
6773 result in calling the same event handler again), use with
6774 extreme care or, better, don't use at all!
6775
6776 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6777
6778 """
6779 return _core_.PyApp_Yield(*args, **kwargs)
6780
6781 def WakeUpIdle(*args, **kwargs):
6782 """
6783 WakeUpIdle(self)
6784
6785 Make sure that idle events are sent again.
6786 :see: `wx.WakeUpIdle`
6787 """
6788 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6789
6790 def IsMainLoopRunning(*args, **kwargs):
6791 """
6792 IsMainLoopRunning() -> bool
6793
6794 Returns True if we're running the main loop, i.e. if the events can
6795 currently be dispatched.
6796 """
6797 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6798
6799 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6800 def MainLoop(*args, **kwargs):
6801 """
6802 MainLoop(self) -> int
6803
6804 Execute the main GUI loop, the function doesn't normally return until
6805 all top level windows have been closed and destroyed.
6806 """
6807 return _core_.PyApp_MainLoop(*args, **kwargs)
6808
6809 def Exit(*args, **kwargs):
6810 """
6811 Exit(self)
6812
6813 Exit the main loop thus terminating the application.
6814 :see: `wx.Exit`
6815 """
6816 return _core_.PyApp_Exit(*args, **kwargs)
6817
6818 def GetLayoutDirection(*args, **kwargs):
6819 """
6820 GetLayoutDirection(self) -> int
6821
6822 Return the layout direction for the current locale.
6823 """
6824 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6825
6826 def ExitMainLoop(*args, **kwargs):
6827 """
6828 ExitMainLoop(self)
6829
6830 Exit the main GUI loop during the next iteration of the main
6831 loop, (i.e. it does not stop the program immediately!)
6832 """
6833 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6834
6835 def Pending(*args, **kwargs):
6836 """
6837 Pending(self) -> bool
6838
6839 Returns True if there are unprocessed events in the event queue.
6840 """
6841 return _core_.PyApp_Pending(*args, **kwargs)
6842
6843 def Dispatch(*args, **kwargs):
6844 """
6845 Dispatch(self) -> bool
6846
6847 Process the first event in the event queue (blocks until an event
6848 appears if there are none currently)
6849 """
6850 return _core_.PyApp_Dispatch(*args, **kwargs)
6851
6852 def ProcessIdle(*args, **kwargs):
6853 """
6854 ProcessIdle(self) -> bool
6855
6856 Called from the MainLoop when the application becomes idle (there are
6857 no pending events) and sends a `wx.IdleEvent` to all interested
6858 parties. Returns True if more idle events are needed, False if not.
6859 """
6860 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6861
6862 def SendIdleEvents(*args, **kwargs):
6863 """
6864 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6865
6866 Send idle event to window and all subwindows. Returns True if more
6867 idle time is requested.
6868 """
6869 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6870
6871 def IsActive(*args, **kwargs):
6872 """
6873 IsActive(self) -> bool
6874
6875 Return True if our app has focus.
6876 """
6877 return _core_.PyApp_IsActive(*args, **kwargs)
6878
6879 def SetTopWindow(*args, **kwargs):
6880 """
6881 SetTopWindow(self, Window win)
6882
6883 Set the *main* top level window
6884 """
6885 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6886
6887 def GetTopWindow(*args, **kwargs):
6888 """
6889 GetTopWindow(self) -> Window
6890
6891 Return the *main* top level window (if it hadn't been set previously
6892 with SetTopWindow(), will return just some top level window and, if
6893 there not any, will return None)
6894 """
6895 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6896
6897 def SetExitOnFrameDelete(*args, **kwargs):
6898 """
6899 SetExitOnFrameDelete(self, bool flag)
6900
6901 Control the exit behaviour: by default, the program will exit the main
6902 loop (and so, usually, terminate) when the last top-level program
6903 window is deleted. Beware that if you disable this behaviour (with
6904 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6905 explicitly from somewhere.
6906 """
6907 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6908
6909 def GetExitOnFrameDelete(*args, **kwargs):
6910 """
6911 GetExitOnFrameDelete(self) -> bool
6912
6913 Get the current exit behaviour setting.
6914 """
6915 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6916
6917 def SetUseBestVisual(*args, **kwargs):
6918 """
6919 SetUseBestVisual(self, bool flag)
6920
6921 Set whether the app should try to use the best available visual on
6922 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6923 """
6924 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6925
6926 def GetUseBestVisual(*args, **kwargs):
6927 """
6928 GetUseBestVisual(self) -> bool
6929
6930 Get current UseBestVisual setting.
6931 """
6932 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6933
6934 def SetPrintMode(*args, **kwargs):
6935 """SetPrintMode(self, int mode)"""
6936 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6937
6938 def GetPrintMode(*args, **kwargs):
6939 """GetPrintMode(self) -> int"""
6940 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6941
6942 def SetAssertMode(*args, **kwargs):
6943 """
6944 SetAssertMode(self, int mode)
6945
6946 Set the OnAssert behaviour for debug and hybrid builds.
6947 """
6948 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6949
6950 def GetAssertMode(*args, **kwargs):
6951 """
6952 GetAssertMode(self) -> int
6953
6954 Get the current OnAssert behaviour setting.
6955 """
6956 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6957
6958 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6959 """GetMacSupportPCMenuShortcuts() -> bool"""
6960 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6961
6962 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6963 def GetMacAboutMenuItemId(*args, **kwargs):
6964 """GetMacAboutMenuItemId() -> long"""
6965 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6966
6967 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6968 def GetMacPreferencesMenuItemId(*args, **kwargs):
6969 """GetMacPreferencesMenuItemId() -> long"""
6970 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6971
6972 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6973 def GetMacExitMenuItemId(*args, **kwargs):
6974 """GetMacExitMenuItemId() -> long"""
6975 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6976
6977 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6978 def GetMacHelpMenuTitleName(*args, **kwargs):
6979 """GetMacHelpMenuTitleName() -> String"""
6980 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6981
6982 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6983 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6984 """SetMacSupportPCMenuShortcuts(bool val)"""
6985 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6986
6987 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6988 def SetMacAboutMenuItemId(*args, **kwargs):
6989 """SetMacAboutMenuItemId(long val)"""
6990 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6991
6992 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6993 def SetMacPreferencesMenuItemId(*args, **kwargs):
6994 """SetMacPreferencesMenuItemId(long val)"""
6995 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6996
6997 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6998 def SetMacExitMenuItemId(*args, **kwargs):
6999 """SetMacExitMenuItemId(long val)"""
7000 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7001
7002 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7003 def SetMacHelpMenuTitleName(*args, **kwargs):
7004 """SetMacHelpMenuTitleName(String val)"""
7005 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7006
7007 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7008 def _BootstrapApp(*args, **kwargs):
7009 """
7010 _BootstrapApp(self)
7011
7012 For internal use only
7013 """
7014 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7015
7016 def GetComCtl32Version(*args, **kwargs):
7017 """
7018 GetComCtl32Version() -> int
7019
7020 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7021 it wasn't found at all. Raises an exception on non-Windows platforms.
7022 """
7023 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7024
7025 GetComCtl32Version = staticmethod(GetComCtl32Version)
7026 def IsDisplayAvailable(*args, **kwargs):
7027 """
7028 IsDisplayAvailable() -> bool
7029
7030 Tests if it is possible to create a GUI in the current environment.
7031 This will mean different things on the different platforms.
7032
7033 * On X Windows systems this function will return ``False`` if it is
7034 not able to open a connection to the X display, which can happen
7035 if $DISPLAY is not set, or is not set correctly.
7036
7037 * On Mac OS X a ``False`` return value will mean that wx is not
7038 able to access the window manager, which can happen if logged in
7039 remotely or if running from the normal version of python instead
7040 of the framework version, (i.e., pythonw.)
7041
7042 * On MS Windows...
7043
7044 """
7045 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7046
7047 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7048 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7049 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7050 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7051 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7052 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7053 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7054 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7055 Traits = property(GetTraits,doc="See `GetTraits`")
7056 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7057 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7058 Active = property(IsActive)
7059 _core_.PyApp_swigregister(PyApp)
7060
7061 def PyApp_IsMainLoopRunning(*args):
7062 """
7063 PyApp_IsMainLoopRunning() -> bool
7064
7065 Returns True if we're running the main loop, i.e. if the events can
7066 currently be dispatched.
7067 """
7068 return _core_.PyApp_IsMainLoopRunning(*args)
7069
7070 def PyApp_GetMacSupportPCMenuShortcuts(*args):
7071 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7072 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
7073
7074 def PyApp_GetMacAboutMenuItemId(*args):
7075 """PyApp_GetMacAboutMenuItemId() -> long"""
7076 return _core_.PyApp_GetMacAboutMenuItemId(*args)
7077
7078 def PyApp_GetMacPreferencesMenuItemId(*args):
7079 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7080 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7081
7082 def PyApp_GetMacExitMenuItemId(*args):
7083 """PyApp_GetMacExitMenuItemId() -> long"""
7084 return _core_.PyApp_GetMacExitMenuItemId(*args)
7085
7086 def PyApp_GetMacHelpMenuTitleName(*args):
7087 """PyApp_GetMacHelpMenuTitleName() -> String"""
7088 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7089
7090 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7091 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7092 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7093
7094 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7095 """PyApp_SetMacAboutMenuItemId(long val)"""
7096 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7097
7098 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7099 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7100 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7101
7102 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7103 """PyApp_SetMacExitMenuItemId(long val)"""
7104 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7105
7106 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7107 """PyApp_SetMacHelpMenuTitleName(String val)"""
7108 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7109
7110 def PyApp_GetComCtl32Version(*args):
7111 """
7112 PyApp_GetComCtl32Version() -> int
7113
7114 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7115 it wasn't found at all. Raises an exception on non-Windows platforms.
7116 """
7117 return _core_.PyApp_GetComCtl32Version(*args)
7118
7119 def PyApp_IsDisplayAvailable(*args):
7120 """
7121 PyApp_IsDisplayAvailable() -> bool
7122
7123 Tests if it is possible to create a GUI in the current environment.
7124 This will mean different things on the different platforms.
7125
7126 * On X Windows systems this function will return ``False`` if it is
7127 not able to open a connection to the X display, which can happen
7128 if $DISPLAY is not set, or is not set correctly.
7129
7130 * On Mac OS X a ``False`` return value will mean that wx is not
7131 able to access the window manager, which can happen if logged in
7132 remotely or if running from the normal version of python instead
7133 of the framework version, (i.e., pythonw.)
7134
7135 * On MS Windows...
7136
7137 """
7138 return _core_.PyApp_IsDisplayAvailable(*args)
7139
7140 #---------------------------------------------------------------------------
7141
7142
7143 def Exit(*args):
7144 """
7145 Exit()
7146
7147 Force an exit of the application. Convenience for wx.GetApp().Exit()
7148 """
7149 return _core_.Exit(*args)
7150
7151 def Yield(*args):
7152 """
7153 Yield() -> bool
7154
7155 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7156 """
7157 return _core_.Yield(*args)
7158
7159 def YieldIfNeeded(*args):
7160 """
7161 YieldIfNeeded() -> bool
7162
7163 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7164 """
7165 return _core_.YieldIfNeeded(*args)
7166
7167 def SafeYield(*args, **kwargs):
7168 """
7169 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7170
7171 This function is similar to `wx.Yield`, except that it disables the
7172 user input to all program windows before calling `wx.Yield` and
7173 re-enables it again afterwards. If ``win`` is not None, this window
7174 will remain enabled, allowing the implementation of some limited user
7175 interaction.
7176
7177 :Returns: the result of the call to `wx.Yield`.
7178 """
7179 return _core_.SafeYield(*args, **kwargs)
7180
7181 def WakeUpIdle(*args):
7182 """
7183 WakeUpIdle()
7184
7185 Cause the message queue to become empty again, so idle events will be
7186 sent.
7187 """
7188 return _core_.WakeUpIdle(*args)
7189
7190 def PostEvent(*args, **kwargs):
7191 """
7192 PostEvent(EvtHandler dest, Event event)
7193
7194 Send an event to a window or other wx.EvtHandler to be processed
7195 later.
7196 """
7197 return _core_.PostEvent(*args, **kwargs)
7198
7199 def App_CleanUp(*args):
7200 """
7201 App_CleanUp()
7202
7203 For internal use only, it is used to cleanup after wxWidgets when
7204 Python shuts down.
7205 """
7206 return _core_.App_CleanUp(*args)
7207
7208 def GetApp(*args):
7209 """
7210 GetApp() -> PyApp
7211
7212 Return a reference to the current wx.App object.
7213 """
7214 return _core_.GetApp(*args)
7215
7216 def SetDefaultPyEncoding(*args, **kwargs):
7217 """
7218 SetDefaultPyEncoding(string encoding)
7219
7220 Sets the encoding that wxPython will use when it needs to convert a
7221 Python string or unicode object to or from a wxString.
7222
7223 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7224 but please be aware that the default encoding within the same locale
7225 may be slightly different on different platforms. For example, please
7226 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7227 between the common latin/roman encodings.
7228 """
7229 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7230
7231 def GetDefaultPyEncoding(*args):
7232 """
7233 GetDefaultPyEncoding() -> string
7234
7235 Gets the current encoding that wxPython will use when it needs to
7236 convert a Python string or unicode object to or from a wxString.
7237 """
7238 return _core_.GetDefaultPyEncoding(*args)
7239 #----------------------------------------------------------------------
7240
7241 class PyOnDemandOutputWindow:
7242 """
7243 A class that can be used for redirecting Python's stdout and
7244 stderr streams. It will do nothing until something is wrriten to
7245 the stream at which point it will create a Frame with a text area
7246 and write the text there.
7247 """
7248 def __init__(self, title = "wxPython: stdout/stderr"):
7249 self.frame = None
7250 self.title = title
7251 self.pos = wx.DefaultPosition
7252 self.size = (450, 300)
7253 self.parent = None
7254
7255 def SetParent(self, parent):
7256 """Set the window to be used as the popup Frame's parent."""
7257 self.parent = parent
7258
7259
7260 def CreateOutputWindow(self, st):
7261 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7262 style=wx.DEFAULT_FRAME_STYLE)
7263 self.text = wx.TextCtrl(self.frame, -1, "",
7264 style=wx.TE_MULTILINE|wx.TE_READONLY)
7265 self.text.AppendText(st)
7266 self.frame.Show(True)
7267 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7268
7269
7270 def OnCloseWindow(self, event):
7271 if self.frame is not None:
7272 self.frame.Destroy()
7273 self.frame = None
7274 self.text = None
7275
7276
7277 # These methods provide the file-like output behaviour.
7278 def write(self, text):
7279 """
7280 Create the output window if needed and write the string to it.
7281 If not called in the context of the gui thread then uses
7282 CallAfter to do the work there.
7283 """
7284 if self.frame is None:
7285 if not wx.Thread_IsMain():
7286 wx.CallAfter(self.CreateOutputWindow, text)
7287 else:
7288 self.CreateOutputWindow(text)
7289 else:
7290 if not wx.Thread_IsMain():
7291 wx.CallAfter(self.text.AppendText, text)
7292 else:
7293 self.text.AppendText(text)
7294
7295
7296 def close(self):
7297 if self.frame is not None:
7298 wx.CallAfter(self.frame.Close)
7299
7300
7301 def flush(self):
7302 pass
7303
7304
7305
7306 #----------------------------------------------------------------------
7307
7308 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7309
7310 class App(wx.PyApp):
7311 """
7312 The ``wx.App`` class represents the application and is used to:
7313
7314 * bootstrap the wxPython system and initialize the underlying
7315 gui toolkit
7316 * set and get application-wide properties
7317 * implement the windowing system main message or event loop,
7318 and to dispatch events to window instances
7319 * etc.
7320
7321 Every application must have a ``wx.App`` instance, and all
7322 creation of UI objects should be delayed until after the
7323 ``wx.App`` object has been created in order to ensure that the gui
7324 platform and wxWidgets have been fully initialized.
7325
7326 Normally you would derive from this class and implement an
7327 ``OnInit`` method that creates a frame and then calls
7328 ``self.SetTopWindow(frame)``.
7329
7330 :see: `wx.PySimpleApp` for a simpler app class that can be used
7331 directly.
7332 """
7333
7334 outputWindowClass = PyOnDemandOutputWindow
7335
7336 def __init__(self, redirect=_defRedirect, filename=None,
7337 useBestVisual=False, clearSigInt=True):
7338 """
7339 Construct a ``wx.App`` object.
7340
7341 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7342 redirected? Defaults to True on Windows and Mac, False
7343 otherwise. If `filename` is None then output will be
7344 redirected to a window that pops up as needed. (You can
7345 control what kind of window is created for the output by
7346 resetting the class variable ``outputWindowClass`` to a
7347 class of your choosing.)
7348
7349 :param filename: The name of a file to redirect output to, if
7350 redirect is True.
7351
7352 :param useBestVisual: Should the app try to use the best
7353 available visual provided by the system (only relevant on
7354 systems that have more than one visual.) This parameter
7355 must be used instead of calling `SetUseBestVisual` later
7356 on because it must be set before the underlying GUI
7357 toolkit is initialized.
7358
7359 :param clearSigInt: Should SIGINT be cleared? This allows the
7360 app to terminate upon a Ctrl-C in the console like other
7361 GUI apps will.
7362
7363 :note: You should override OnInit to do applicaition
7364 initialization to ensure that the system, toolkit and
7365 wxWidgets are fully initialized.
7366 """
7367
7368 wx.PyApp.__init__(self)
7369
7370 # make sure we can create a GUI
7371 if not self.IsDisplayAvailable():
7372
7373 if wx.Platform == "__WXMAC__":
7374 msg = """This program needs access to the screen.
7375 Please run with 'pythonw', not 'python', and only when you are logged
7376 in on the main display of your Mac."""
7377
7378 elif wx.Platform == "__WXGTK__":
7379 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7380
7381 else:
7382 msg = "Unable to create GUI"
7383 # TODO: more description is needed for wxMSW...
7384
7385 raise SystemExit(msg)
7386
7387 # This has to be done before OnInit
7388 self.SetUseBestVisual(useBestVisual)
7389
7390 # Set the default handler for SIGINT. This fixes a problem
7391 # where if Ctrl-C is pressed in the console that started this
7392 # app then it will not appear to do anything, (not even send
7393 # KeyboardInterrupt???) but will later segfault on exit. By
7394 # setting the default handler then the app will exit, as
7395 # expected (depending on platform.)
7396 if clearSigInt:
7397 try:
7398 import signal
7399 signal.signal(signal.SIGINT, signal.SIG_DFL)
7400 except:
7401 pass
7402
7403 # Save and redirect the stdio to a window?
7404 self.stdioWin = None
7405 self.saveStdio = (_sys.stdout, _sys.stderr)
7406 if redirect:
7407 self.RedirectStdio(filename)
7408
7409 # Use Python's install prefix as the default
7410 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7411
7412 # This finishes the initialization of wxWindows and then calls
7413 # the OnInit that should be present in the derived class
7414 self._BootstrapApp()
7415
7416
7417 def OnPreInit(self):
7418 """
7419 Things that must be done after _BootstrapApp has done its
7420 thing, but would be nice if they were already done by the time
7421 that OnInit is called.
7422 """
7423 wx.StockGDI._initStockObjects()
7424
7425
7426 def __del__(self, destroy=wx.PyApp.__del__):
7427 self.RestoreStdio() # Just in case the MainLoop was overridden
7428 destroy(self)
7429
7430 def Destroy(self):
7431 wx.PyApp.Destroy(self)
7432 self.thisown = 0
7433
7434 def SetTopWindow(self, frame):
7435 """Set the \"main\" top level window"""
7436 if self.stdioWin:
7437 self.stdioWin.SetParent(frame)
7438 wx.PyApp.SetTopWindow(self, frame)
7439
7440
7441 def MainLoop(self):
7442 """Execute the main GUI event loop"""
7443 wx.PyApp.MainLoop(self)
7444 self.RestoreStdio()
7445
7446
7447 def RedirectStdio(self, filename=None):
7448 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7449 if filename:
7450 _sys.stdout = _sys.stderr = open(filename, 'a')
7451 else:
7452 self.stdioWin = self.outputWindowClass()
7453 _sys.stdout = _sys.stderr = self.stdioWin
7454
7455
7456 def RestoreStdio(self):
7457 try:
7458 _sys.stdout, _sys.stderr = self.saveStdio
7459 except:
7460 pass
7461
7462
7463 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7464 """
7465 Set the title, position and/or size of the output window if
7466 the stdio has been redirected. This should be called before
7467 any output would cause the output window to be created.
7468 """
7469 if self.stdioWin:
7470 if title is not None:
7471 self.stdioWin.title = title
7472 if pos is not None:
7473 self.stdioWin.pos = pos
7474 if size is not None:
7475 self.stdioWin.size = size
7476
7477
7478
7479
7480 # change from wx.PyApp_XX to wx.App_XX
7481 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7482 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7483 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7484 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7485 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7486 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7487 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7488 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7489 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7490 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7491 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7492
7493 #----------------------------------------------------------------------------
7494
7495 class PySimpleApp(wx.App):
7496 """
7497 A simple application class. You can just create one of these and
7498 then then make your top level windows later, and not have to worry
7499 about OnInit. For example::
7500
7501 app = wx.PySimpleApp()
7502 frame = wx.Frame(None, title='Hello World')
7503 frame.Show()
7504 app.MainLoop()
7505
7506 :see: `wx.App`
7507 """
7508
7509 def __init__(self, redirect=False, filename=None,
7510 useBestVisual=False, clearSigInt=True):
7511 """
7512 :see: `wx.App.__init__`
7513 """
7514 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7515
7516 def OnInit(self):
7517 return True
7518
7519
7520
7521 # Is anybody using this one?
7522 class PyWidgetTester(wx.App):
7523 def __init__(self, size = (250, 100)):
7524 self.size = size
7525 wx.App.__init__(self, 0)
7526
7527 def OnInit(self):
7528 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7529 self.SetTopWindow(self.frame)
7530 return True
7531
7532 def SetWidget(self, widgetClass, *args, **kwargs):
7533 w = widgetClass(self.frame, *args, **kwargs)
7534 self.frame.Show(True)
7535
7536 #----------------------------------------------------------------------------
7537 # DO NOT hold any other references to this object. This is how we
7538 # know when to cleanup system resources that wxWidgets is holding. When
7539 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7540 # goes to zero and it calls the wx.App_CleanUp function.
7541
7542 class __wxPyCleanup:
7543 def __init__(self):
7544 self.cleanup = _core_.App_CleanUp
7545 def __del__(self):
7546 self.cleanup()
7547
7548 _sys.__wxPythonCleanup = __wxPyCleanup()
7549
7550 ## # another possible solution, but it gets called too early...
7551 ## import atexit
7552 ## atexit.register(_core_.wxApp_CleanUp)
7553
7554
7555 #----------------------------------------------------------------------------
7556
7557 #---------------------------------------------------------------------------
7558
7559 class EventLoop(object):
7560 """Proxy of C++ EventLoop class"""
7561 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7562 __repr__ = _swig_repr
7563 def __init__(self, *args, **kwargs):
7564 """__init__(self) -> EventLoop"""
7565 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7566 __swig_destroy__ = _core_.delete_EventLoop
7567 __del__ = lambda self : None;
7568 def Run(*args, **kwargs):
7569 """Run(self) -> int"""
7570 return _core_.EventLoop_Run(*args, **kwargs)
7571
7572 def Exit(*args, **kwargs):
7573 """Exit(self, int rc=0)"""
7574 return _core_.EventLoop_Exit(*args, **kwargs)
7575
7576 def Pending(*args, **kwargs):
7577 """Pending(self) -> bool"""
7578 return _core_.EventLoop_Pending(*args, **kwargs)
7579
7580 def Dispatch(*args, **kwargs):
7581 """Dispatch(self) -> bool"""
7582 return _core_.EventLoop_Dispatch(*args, **kwargs)
7583
7584 def IsRunning(*args, **kwargs):
7585 """IsRunning(self) -> bool"""
7586 return _core_.EventLoop_IsRunning(*args, **kwargs)
7587
7588 def GetActive(*args, **kwargs):
7589 """GetActive() -> EventLoop"""
7590 return _core_.EventLoop_GetActive(*args, **kwargs)
7591
7592 GetActive = staticmethod(GetActive)
7593 def SetActive(*args, **kwargs):
7594 """SetActive(EventLoop loop)"""
7595 return _core_.EventLoop_SetActive(*args, **kwargs)
7596
7597 SetActive = staticmethod(SetActive)
7598 _core_.EventLoop_swigregister(EventLoop)
7599
7600 def EventLoop_GetActive(*args):
7601 """EventLoop_GetActive() -> EventLoop"""
7602 return _core_.EventLoop_GetActive(*args)
7603
7604 def EventLoop_SetActive(*args, **kwargs):
7605 """EventLoop_SetActive(EventLoop loop)"""
7606 return _core_.EventLoop_SetActive(*args, **kwargs)
7607
7608 class EventLoopActivator(object):
7609 """Proxy of C++ EventLoopActivator class"""
7610 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7611 __repr__ = _swig_repr
7612 def __init__(self, *args, **kwargs):
7613 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7614 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7615 __swig_destroy__ = _core_.delete_EventLoopActivator
7616 __del__ = lambda self : None;
7617 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7618
7619 #---------------------------------------------------------------------------
7620
7621 ACCEL_ALT = _core_.ACCEL_ALT
7622 ACCEL_CTRL = _core_.ACCEL_CTRL
7623 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7624 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7625 ACCEL_CMD = _core_.ACCEL_CMD
7626 class AcceleratorEntry(object):
7627 """
7628 A class used to define items in an `wx.AcceleratorTable`. wxPython
7629 programs can choose to use wx.AcceleratorEntry objects, but using a
7630 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7631 as well. See `__init__` for of the tuple values.
7632
7633 :see: `wx.AcceleratorTable`
7634 """
7635 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7636 __repr__ = _swig_repr
7637 def __init__(self, *args, **kwargs):
7638 """
7639 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7640
7641 Construct a wx.AcceleratorEntry.
7642 """
7643 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7644 __swig_destroy__ = _core_.delete_AcceleratorEntry
7645 __del__ = lambda self : None;
7646 def Set(*args, **kwargs):
7647 """
7648 Set(self, int flags, int keyCode, int cmd)
7649
7650 (Re)set the attributes of a wx.AcceleratorEntry.
7651 :see `__init__`
7652 """
7653 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7654
7655 def Create(*args, **kwargs):
7656 """
7657 Create(String str) -> AcceleratorEntry
7658
7659 Create accelerator corresponding to the specified string, or None if
7660 it coulnd't be parsed.
7661 """
7662 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7663
7664 Create = staticmethod(Create)
7665 def GetFlags(*args, **kwargs):
7666 """
7667 GetFlags(self) -> int
7668
7669 Get the AcceleratorEntry's flags.
7670 """
7671 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7672
7673 def GetKeyCode(*args, **kwargs):
7674 """
7675 GetKeyCode(self) -> int
7676
7677 Get the AcceleratorEntry's keycode.
7678 """
7679 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7680
7681 def GetCommand(*args, **kwargs):
7682 """
7683 GetCommand(self) -> int
7684
7685 Get the AcceleratorEntry's command ID.
7686 """
7687 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7688
7689 def IsOk(*args, **kwargs):
7690 """IsOk(self) -> bool"""
7691 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7692
7693 def ToString(*args, **kwargs):
7694 """
7695 ToString(self) -> String
7696
7697 Returns a string representation for the this accelerator. The string
7698 is formatted using the <flags>-<keycode> format where <flags> maybe a
7699 hyphen-separed list of "shift|alt|ctrl"
7700
7701 """
7702 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7703
7704 def FromString(*args, **kwargs):
7705 """
7706 FromString(self, String str) -> bool
7707
7708 Returns true if the given string correctly initialized this object.
7709 """
7710 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7711
7712 Command = property(GetCommand,doc="See `GetCommand`")
7713 Flags = property(GetFlags,doc="See `GetFlags`")
7714 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7715 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7716
7717 def AcceleratorEntry_Create(*args, **kwargs):
7718 """
7719 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7720
7721 Create accelerator corresponding to the specified string, or None if
7722 it coulnd't be parsed.
7723 """
7724 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7725
7726 class AcceleratorTable(Object):
7727 """
7728 An accelerator table allows the application to specify a table of
7729 keyboard shortcuts for menus or other commands. On Windows, menu or
7730 button commands are supported; on GTK, only menu commands are
7731 supported.
7732 """
7733 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7734 __repr__ = _swig_repr
7735 def __init__(self, *args, **kwargs):
7736 """
7737 __init__(entries) -> AcceleratorTable
7738
7739 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7740 items or or of 3-tuples (flags, keyCode, cmdID)
7741
7742 :see: `wx.AcceleratorEntry`
7743 """
7744 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7745 __swig_destroy__ = _core_.delete_AcceleratorTable
7746 __del__ = lambda self : None;
7747 def Ok(*args, **kwargs):
7748 """Ok(self) -> bool"""
7749 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7750
7751 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7752
7753
7754 def GetAccelFromString(*args, **kwargs):
7755 """GetAccelFromString(String label) -> AcceleratorEntry"""
7756 return _core_.GetAccelFromString(*args, **kwargs)
7757 #---------------------------------------------------------------------------
7758
7759 class VisualAttributes(object):
7760 """struct containing all the visual attributes of a control"""
7761 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7762 __repr__ = _swig_repr
7763 def __init__(self, *args, **kwargs):
7764 """
7765 __init__(self) -> VisualAttributes
7766
7767 struct containing all the visual attributes of a control
7768 """
7769 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7770 __swig_destroy__ = _core_.delete_VisualAttributes
7771 __del__ = lambda self : None;
7772 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7773 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7774 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7775 _core_.VisualAttributes_swigregister(VisualAttributes)
7776 NullAcceleratorTable = cvar.NullAcceleratorTable
7777 PanelNameStr = cvar.PanelNameStr
7778
7779 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7780 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7781 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7782 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7783 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7784 class Window(EvtHandler):
7785 """
7786 wx.Window is the base class for all windows and represents any visible
7787 object on the screen. All controls, top level windows and so on are
7788 wx.Windows. Sizers and device contexts are not however, as they don't
7789 appear on screen themselves.
7790
7791 """
7792 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7793 __repr__ = _swig_repr
7794 def __init__(self, *args, **kwargs):
7795 """
7796 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7797 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7798
7799 Construct and show a generic Window.
7800 """
7801 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7802 self._setOORInfo(self)
7803
7804 def Create(*args, **kwargs):
7805 """
7806 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7807 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7808
7809 Create the GUI part of the Window for 2-phase creation mode.
7810 """
7811 return _core_.Window_Create(*args, **kwargs)
7812
7813 def Close(*args, **kwargs):
7814 """
7815 Close(self, bool force=False) -> bool
7816
7817 This function simply generates a EVT_CLOSE event whose handler usually
7818 tries to close the window. It doesn't close the window itself,
7819 however. If force is False (the default) then the window's close
7820 handler will be allowed to veto the destruction of the window.
7821 """
7822 return _core_.Window_Close(*args, **kwargs)
7823
7824 def Destroy(*args, **kwargs):
7825 """
7826 Destroy(self) -> bool
7827
7828 Destroys the window safely. Frames and dialogs are not destroyed
7829 immediately when this function is called -- they are added to a list
7830 of windows to be deleted on idle time, when all the window's events
7831 have been processed. This prevents problems with events being sent to
7832 non-existent windows.
7833
7834 Returns True if the window has either been successfully deleted, or it
7835 has been added to the list of windows pending real deletion.
7836 """
7837 val = _core_.Window_Destroy(*args, **kwargs)
7838 args[0].thisown = 0
7839 return val
7840
7841 def DestroyChildren(*args, **kwargs):
7842 """
7843 DestroyChildren(self) -> bool
7844
7845 Destroys all children of a window. Called automatically by the
7846 destructor.
7847 """
7848 return _core_.Window_DestroyChildren(*args, **kwargs)
7849
7850 def IsBeingDeleted(*args, **kwargs):
7851 """
7852 IsBeingDeleted(self) -> bool
7853
7854 Is the window in the process of being deleted?
7855 """
7856 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7857
7858 def SetLabel(*args, **kwargs):
7859 """
7860 SetLabel(self, String label)
7861
7862 Set the text which the window shows in its label if applicable.
7863 """
7864 return _core_.Window_SetLabel(*args, **kwargs)
7865
7866 def GetLabel(*args, **kwargs):
7867 """
7868 GetLabel(self) -> String
7869
7870 Generic way of getting a label from any window, for identification
7871 purposes. The interpretation of this function differs from class to
7872 class. For frames and dialogs, the value returned is the title. For
7873 buttons or static text controls, it is the button text. This function
7874 can be useful for meta-programs such as testing tools or special-needs
7875 access programs)which need to identify windows by name.
7876 """
7877 return _core_.Window_GetLabel(*args, **kwargs)
7878
7879 def SetName(*args, **kwargs):
7880 """
7881 SetName(self, String name)
7882
7883 Sets the window's name. The window name is used for ressource setting
7884 in X, it is not the same as the window title/label
7885 """
7886 return _core_.Window_SetName(*args, **kwargs)
7887
7888 def GetName(*args, **kwargs):
7889 """
7890 GetName(self) -> String
7891
7892 Returns the windows name. This name is not guaranteed to be unique;
7893 it is up to the programmer to supply an appropriate name in the window
7894 constructor or via wx.Window.SetName.
7895 """
7896 return _core_.Window_GetName(*args, **kwargs)
7897
7898 def SetWindowVariant(*args, **kwargs):
7899 """
7900 SetWindowVariant(self, int variant)
7901
7902 Sets the variant of the window/font size to use for this window, if
7903 the platform supports variants, for example, wxMac.
7904 """
7905 return _core_.Window_SetWindowVariant(*args, **kwargs)
7906
7907 def GetWindowVariant(*args, **kwargs):
7908 """GetWindowVariant(self) -> int"""
7909 return _core_.Window_GetWindowVariant(*args, **kwargs)
7910
7911 def SetId(*args, **kwargs):
7912 """
7913 SetId(self, int winid)
7914
7915 Sets the identifier of the window. Each window has an integer
7916 identifier. If the application has not provided one, an identifier
7917 will be generated. Normally, the identifier should be provided on
7918 creation and should not be modified subsequently.
7919 """
7920 return _core_.Window_SetId(*args, **kwargs)
7921
7922 def GetId(*args, **kwargs):
7923 """
7924 GetId(self) -> int
7925
7926 Returns the identifier of the window. Each window has an integer
7927 identifier. If the application has not provided one (or the default Id
7928 -1 is used) then an unique identifier with a negative value will be
7929 generated.
7930 """
7931 return _core_.Window_GetId(*args, **kwargs)
7932
7933 def NewControlId(*args, **kwargs):
7934 """
7935 NewControlId() -> int
7936
7937 Generate a control id for the controls which were not given one.
7938 """
7939 return _core_.Window_NewControlId(*args, **kwargs)
7940
7941 NewControlId = staticmethod(NewControlId)
7942 def NextControlId(*args, **kwargs):
7943 """
7944 NextControlId(int winid) -> int
7945
7946 Get the id of the control following the one with the given
7947 autogenerated) id
7948 """
7949 return _core_.Window_NextControlId(*args, **kwargs)
7950
7951 NextControlId = staticmethod(NextControlId)
7952 def PrevControlId(*args, **kwargs):
7953 """
7954 PrevControlId(int winid) -> int
7955
7956 Get the id of the control preceding the one with the given
7957 autogenerated) id
7958 """
7959 return _core_.Window_PrevControlId(*args, **kwargs)
7960
7961 PrevControlId = staticmethod(PrevControlId)
7962 def GetLayoutDirection(*args, **kwargs):
7963 """
7964 GetLayoutDirection(self) -> int
7965
7966 Get the layout direction (LTR or RTL) for this window. Returns
7967 ``wx.Layout_Default`` if layout direction is not supported.
7968 """
7969 return _core_.Window_GetLayoutDirection(*args, **kwargs)
7970
7971 def SetLayoutDirection(*args, **kwargs):
7972 """
7973 SetLayoutDirection(self, int dir)
7974
7975 Set the layout direction (LTR or RTL) for this window.
7976 """
7977 return _core_.Window_SetLayoutDirection(*args, **kwargs)
7978
7979 def AdjustForLayoutDirection(*args, **kwargs):
7980 """
7981 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7982
7983 Mirror coordinates for RTL layout if this window uses it and if the
7984 mirroring is not done automatically like Win32.
7985 """
7986 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
7987
7988 def SetSize(*args, **kwargs):
7989 """
7990 SetSize(self, Size size)
7991
7992 Sets the size of the window in pixels.
7993 """
7994 return _core_.Window_SetSize(*args, **kwargs)
7995
7996 def SetDimensions(*args, **kwargs):
7997 """
7998 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7999
8000 Sets the position and size of the window in pixels. The sizeFlags
8001 parameter indicates the interpretation of the other params if they are
8002 equal to -1.
8003
8004 ======================== ======================================
8005 wx.SIZE_AUTO A -1 indicates that a class-specific
8006 default should be used.
8007 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8008 -1 values are supplied.
8009 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8010 interpreted as real dimensions, not
8011 default values.
8012 ======================== ======================================
8013
8014 """
8015 return _core_.Window_SetDimensions(*args, **kwargs)
8016
8017 def SetRect(*args, **kwargs):
8018 """
8019 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8020
8021 Sets the position and size of the window in pixels using a wx.Rect.
8022 """
8023 return _core_.Window_SetRect(*args, **kwargs)
8024
8025 def SetSizeWH(*args, **kwargs):
8026 """
8027 SetSizeWH(self, int width, int height)
8028
8029 Sets the size of the window in pixels.
8030 """
8031 return _core_.Window_SetSizeWH(*args, **kwargs)
8032
8033 def Move(*args, **kwargs):
8034 """
8035 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8036
8037 Moves the window to the given position.
8038 """
8039 return _core_.Window_Move(*args, **kwargs)
8040
8041 SetPosition = Move
8042 def MoveXY(*args, **kwargs):
8043 """
8044 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8045
8046 Moves the window to the given position.
8047 """
8048 return _core_.Window_MoveXY(*args, **kwargs)
8049
8050 def SetBestFittingSize(*args, **kwargs):
8051 """
8052 SetBestFittingSize(self, Size size=DefaultSize)
8053
8054 A 'Smart' SetSize that will fill in default size components with the
8055 window's *best size* values. Also set's the minsize for use with sizers.
8056 """
8057 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8058
8059 def Raise(*args, **kwargs):
8060 """
8061 Raise(self)
8062
8063 Raises the window to the top of the window hierarchy. In current
8064 version of wxWidgets this works both for manage and child windows.
8065 """
8066 return _core_.Window_Raise(*args, **kwargs)
8067
8068 def Lower(*args, **kwargs):
8069 """
8070 Lower(self)
8071
8072 Lowers the window to the bottom of the window hierarchy. In current
8073 version of wxWidgets this works both for manage and child windows.
8074 """
8075 return _core_.Window_Lower(*args, **kwargs)
8076
8077 def SetClientSize(*args, **kwargs):
8078 """
8079 SetClientSize(self, Size size)
8080
8081 This sets the size of the window client area in pixels. Using this
8082 function to size a window tends to be more device-independent than
8083 wx.Window.SetSize, since the application need not worry about what
8084 dimensions the border or title bar have when trying to fit the window
8085 around panel items, for example.
8086 """
8087 return _core_.Window_SetClientSize(*args, **kwargs)
8088
8089 def SetClientSizeWH(*args, **kwargs):
8090 """
8091 SetClientSizeWH(self, int width, int height)
8092
8093 This sets the size of the window client area in pixels. Using this
8094 function to size a window tends to be more device-independent than
8095 wx.Window.SetSize, since the application need not worry about what
8096 dimensions the border or title bar have when trying to fit the window
8097 around panel items, for example.
8098 """
8099 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8100
8101 def SetClientRect(*args, **kwargs):
8102 """
8103 SetClientRect(self, Rect rect)
8104
8105 This sets the size of the window client area in pixels. Using this
8106 function to size a window tends to be more device-independent than
8107 wx.Window.SetSize, since the application need not worry about what
8108 dimensions the border or title bar have when trying to fit the window
8109 around panel items, for example.
8110 """
8111 return _core_.Window_SetClientRect(*args, **kwargs)
8112
8113 def GetPosition(*args, **kwargs):
8114 """
8115 GetPosition(self) -> Point
8116
8117 Get the window's position. Notice that the position is in client
8118 coordinates for child windows and screen coordinates for the top level
8119 ones, use `GetScreenPosition` if you need screen coordinates for all
8120 kinds of windows.
8121 """
8122 return _core_.Window_GetPosition(*args, **kwargs)
8123
8124 def GetPositionTuple(*args, **kwargs):
8125 """
8126 GetPositionTuple() -> (x,y)
8127
8128 Get the window's position. Notice that the position is in client
8129 coordinates for child windows and screen coordinates for the top level
8130 ones, use `GetScreenPosition` if you need screen coordinates for all
8131 kinds of windows.
8132 """
8133 return _core_.Window_GetPositionTuple(*args, **kwargs)
8134
8135 def GetScreenPosition(*args, **kwargs):
8136 """
8137 GetScreenPosition(self) -> Point
8138
8139 Get the position of the window in screen coordinantes.
8140 """
8141 return _core_.Window_GetScreenPosition(*args, **kwargs)
8142
8143 def GetScreenPositionTuple(*args, **kwargs):
8144 """
8145 GetScreenPositionTuple() -> (x,y)
8146
8147 Get the position of the window in screen coordinantes.
8148 """
8149 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8150
8151 def GetScreenRect(*args, **kwargs):
8152 """
8153 GetScreenRect(self) -> Rect
8154
8155 Returns the size and position of the window in screen coordinantes as
8156 a `wx.Rect` object.
8157 """
8158 return _core_.Window_GetScreenRect(*args, **kwargs)
8159
8160 def GetSize(*args, **kwargs):
8161 """
8162 GetSize(self) -> Size
8163
8164 Get the window size.
8165 """
8166 return _core_.Window_GetSize(*args, **kwargs)
8167
8168 def GetSizeTuple(*args, **kwargs):
8169 """
8170 GetSizeTuple() -> (width, height)
8171
8172 Get the window size.
8173 """
8174 return _core_.Window_GetSizeTuple(*args, **kwargs)
8175
8176 def GetRect(*args, **kwargs):
8177 """
8178 GetRect(self) -> Rect
8179
8180 Returns the size and position of the window as a `wx.Rect` object.
8181 """
8182 return _core_.Window_GetRect(*args, **kwargs)
8183
8184 def GetClientSize(*args, **kwargs):
8185 """
8186 GetClientSize(self) -> Size
8187
8188 This gets the size of the window's 'client area' in pixels. The client
8189 area is the area which may be drawn on by the programmer, excluding
8190 title bar, border, scrollbars, etc.
8191 """
8192 return _core_.Window_GetClientSize(*args, **kwargs)
8193
8194 def GetClientSizeTuple(*args, **kwargs):
8195 """
8196 GetClientSizeTuple() -> (width, height)
8197
8198 This gets the size of the window's 'client area' in pixels. The client
8199 area is the area which may be drawn on by the programmer, excluding
8200 title bar, border, scrollbars, etc.
8201 """
8202 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8203
8204 def GetClientAreaOrigin(*args, **kwargs):
8205 """
8206 GetClientAreaOrigin(self) -> Point
8207
8208 Get the origin of the client area of the window relative to the
8209 window's top left corner (the client area may be shifted because of
8210 the borders, scrollbars, other decorations...)
8211 """
8212 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8213
8214 def GetClientRect(*args, **kwargs):
8215 """
8216 GetClientRect(self) -> Rect
8217
8218 Get the client area position and size as a `wx.Rect` object.
8219 """
8220 return _core_.Window_GetClientRect(*args, **kwargs)
8221
8222 def GetBestSize(*args, **kwargs):
8223 """
8224 GetBestSize(self) -> Size
8225
8226 This function returns the best acceptable minimal size for the
8227 window, if applicable. For example, for a static text control, it will
8228 be the minimal size such that the control label is not truncated. For
8229 windows containing subwindows (suzh aswx.Panel), the size returned by
8230 this function will be the same as the size the window would have had
8231 after calling Fit.
8232 """
8233 return _core_.Window_GetBestSize(*args, **kwargs)
8234
8235 def GetBestSizeTuple(*args, **kwargs):
8236 """
8237 GetBestSizeTuple() -> (width, height)
8238
8239 This function returns the best acceptable minimal size for the
8240 window, if applicable. For example, for a static text control, it will
8241 be the minimal size such that the control label is not truncated. For
8242 windows containing subwindows (suzh aswx.Panel), the size returned by
8243 this function will be the same as the size the window would have had
8244 after calling Fit.
8245 """
8246 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8247
8248 def InvalidateBestSize(*args, **kwargs):
8249 """
8250 InvalidateBestSize(self)
8251
8252 Reset the cached best size value so it will be recalculated the next
8253 time it is needed.
8254 """
8255 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8256
8257 def CacheBestSize(*args, **kwargs):
8258 """
8259 CacheBestSize(self, Size size)
8260
8261 Cache the best size so it doesn't need to be calculated again, (at least until
8262 some properties of the window change.)
8263 """
8264 return _core_.Window_CacheBestSize(*args, **kwargs)
8265
8266 def GetBestFittingSize(*args, **kwargs):
8267 """
8268 GetBestFittingSize(self) -> Size
8269
8270 This function will merge the window's best size into the window's
8271 minimum size, giving priority to the min size components, and returns
8272 the results.
8273
8274 """
8275 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8276
8277 def GetAdjustedBestSize(*args, **kwargs):
8278 """
8279 GetAdjustedBestSize(self) -> Size
8280
8281 This method is similar to GetBestSize, except in one
8282 thing. GetBestSize should return the minimum untruncated size of the
8283 window, while this method will return the largest of BestSize and any
8284 user specified minimum size. ie. it is the minimum size the window
8285 should currently be drawn at, not the minimal size it can possibly
8286 tolerate.
8287 """
8288 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8289
8290 def Center(*args, **kwargs):
8291 """
8292 Center(self, int direction=BOTH)
8293
8294 Centers the window. The parameter specifies the direction for
8295 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8296 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8297 on the entire screen and not on its parent window. If it is a
8298 top-level window and has no parent then it will always be centered
8299 relative to the screen.
8300 """
8301 return _core_.Window_Center(*args, **kwargs)
8302
8303 Centre = Center
8304 def CenterOnParent(*args, **kwargs):
8305 """
8306 CenterOnParent(self, int dir=BOTH)
8307
8308 Center with respect to the the parent window
8309 """
8310 return _core_.Window_CenterOnParent(*args, **kwargs)
8311
8312 CentreOnParent = CenterOnParent
8313 def Fit(*args, **kwargs):
8314 """
8315 Fit(self)
8316
8317 Sizes the window so that it fits around its subwindows. This function
8318 won't do anything if there are no subwindows and will only really work
8319 correctly if sizers are used for the subwindows layout. Also, if the
8320 window has exactly one subwindow it is better (faster and the result
8321 is more precise as Fit adds some margin to account for fuzziness of
8322 its calculations) to call window.SetClientSize(child.GetSize())
8323 instead of calling Fit.
8324 """
8325 return _core_.Window_Fit(*args, **kwargs)
8326
8327 def FitInside(*args, **kwargs):
8328 """
8329 FitInside(self)
8330
8331 Similar to Fit, but sizes the interior (virtual) size of a
8332 window. Mainly useful with scrolled windows to reset scrollbars after
8333 sizing changes that do not trigger a size event, and/or scrolled
8334 windows without an interior sizer. This function similarly won't do
8335 anything if there are no subwindows.
8336 """
8337 return _core_.Window_FitInside(*args, **kwargs)
8338
8339 def SetSizeHints(*args, **kwargs):
8340 """
8341 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8342 int incH=-1)
8343
8344 Allows specification of minimum and maximum window sizes, and window
8345 size increments. If a pair of values is not set (or set to -1), the
8346 default values will be used. If this function is called, the user
8347 will not be able to size the window outside the given bounds (if it is
8348 a top-level window.) Sizers will also inspect the minimum window size
8349 and will use that value if set when calculating layout.
8350
8351 The resizing increments are only significant under Motif or Xt.
8352 """
8353 return _core_.Window_SetSizeHints(*args, **kwargs)
8354
8355 def SetSizeHintsSz(*args, **kwargs):
8356 """
8357 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8358
8359 Allows specification of minimum and maximum window sizes, and window
8360 size increments. If a pair of values is not set (or set to -1), the
8361 default values will be used. If this function is called, the user
8362 will not be able to size the window outside the given bounds (if it is
8363 a top-level window.) Sizers will also inspect the minimum window size
8364 and will use that value if set when calculating layout.
8365
8366 The resizing increments are only significant under Motif or Xt.
8367 """
8368 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8369
8370 def SetVirtualSizeHints(*args, **kwargs):
8371 """
8372 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8373
8374 Allows specification of minimum and maximum virtual window sizes. If a
8375 pair of values is not set (or set to -1), the default values will be
8376 used. If this function is called, the user will not be able to size
8377 the virtual area of the window outside the given bounds.
8378 """
8379 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8380
8381 def SetVirtualSizeHintsSz(*args, **kwargs):
8382 """
8383 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8384
8385 Allows specification of minimum and maximum virtual window sizes. If a
8386 pair of values is not set (or set to -1), the default values will be
8387 used. If this function is called, the user will not be able to size
8388 the virtual area of the window outside the given bounds.
8389 """
8390 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8391
8392 def GetMaxSize(*args, **kwargs):
8393 """GetMaxSize(self) -> Size"""
8394 return _core_.Window_GetMaxSize(*args, **kwargs)
8395
8396 def GetMinSize(*args, **kwargs):
8397 """GetMinSize(self) -> Size"""
8398 return _core_.Window_GetMinSize(*args, **kwargs)
8399
8400 def SetMinSize(*args, **kwargs):
8401 """
8402 SetMinSize(self, Size minSize)
8403
8404 A more convenient method than `SetSizeHints` for setting just the
8405 min size.
8406 """
8407 return _core_.Window_SetMinSize(*args, **kwargs)
8408
8409 def SetMaxSize(*args, **kwargs):
8410 """
8411 SetMaxSize(self, Size maxSize)
8412
8413 A more convenient method than `SetSizeHints` for setting just the
8414 max size.
8415 """
8416 return _core_.Window_SetMaxSize(*args, **kwargs)
8417
8418 def GetMinWidth(*args, **kwargs):
8419 """GetMinWidth(self) -> int"""
8420 return _core_.Window_GetMinWidth(*args, **kwargs)
8421
8422 def GetMinHeight(*args, **kwargs):
8423 """GetMinHeight(self) -> int"""
8424 return _core_.Window_GetMinHeight(*args, **kwargs)
8425
8426 def GetMaxWidth(*args, **kwargs):
8427 """GetMaxWidth(self) -> int"""
8428 return _core_.Window_GetMaxWidth(*args, **kwargs)
8429
8430 def GetMaxHeight(*args, **kwargs):
8431 """GetMaxHeight(self) -> int"""
8432 return _core_.Window_GetMaxHeight(*args, **kwargs)
8433
8434 def SetVirtualSize(*args, **kwargs):
8435 """
8436 SetVirtualSize(self, Size size)
8437
8438 Set the the virtual size of a window in pixels. For most windows this
8439 is just the client area of the window, but for some like scrolled
8440 windows it is more or less independent of the screen window size.
8441 """
8442 return _core_.Window_SetVirtualSize(*args, **kwargs)
8443
8444 def SetVirtualSizeWH(*args, **kwargs):
8445 """
8446 SetVirtualSizeWH(self, int w, int h)
8447
8448 Set the the virtual size of a window in pixels. For most windows this
8449 is just the client area of the window, but for some like scrolled
8450 windows it is more or less independent of the screen window size.
8451 """
8452 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8453
8454 def GetVirtualSize(*args, **kwargs):
8455 """
8456 GetVirtualSize(self) -> Size
8457
8458 Get the the virtual size of the window in pixels. For most windows
8459 this is just the client area of the window, but for some like scrolled
8460 windows it is more or less independent of the screen window size.
8461 """
8462 return _core_.Window_GetVirtualSize(*args, **kwargs)
8463
8464 def GetVirtualSizeTuple(*args, **kwargs):
8465 """
8466 GetVirtualSizeTuple() -> (width, height)
8467
8468 Get the the virtual size of the window in pixels. For most windows
8469 this is just the client area of the window, but for some like scrolled
8470 windows it is more or less independent of the screen window size.
8471 """
8472 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8473
8474 def GetBestVirtualSize(*args, **kwargs):
8475 """
8476 GetBestVirtualSize(self) -> Size
8477
8478 Return the largest of ClientSize and BestSize (as determined by a
8479 sizer, interior children, or other means)
8480 """
8481 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8482
8483 def Show(*args, **kwargs):
8484 """
8485 Show(self, bool show=True) -> bool
8486
8487 Shows or hides the window. You may need to call Raise for a top level
8488 window if you want to bring it to top, although this is not needed if
8489 Show is called immediately after the frame creation. Returns True if
8490 the window has been shown or hidden or False if nothing was done
8491 because it already was in the requested state.
8492 """
8493 return _core_.Window_Show(*args, **kwargs)
8494
8495 def Hide(*args, **kwargs):
8496 """
8497 Hide(self) -> bool
8498
8499 Equivalent to calling Show(False).
8500 """
8501 return _core_.Window_Hide(*args, **kwargs)
8502
8503 def Enable(*args, **kwargs):
8504 """
8505 Enable(self, bool enable=True) -> bool
8506
8507 Enable or disable the window for user input. Note that when a parent
8508 window is disabled, all of its children are disabled as well and they
8509 are reenabled again when the parent is. Returns true if the window
8510 has been enabled or disabled, false if nothing was done, i.e. if the
8511 window had already been in the specified state.
8512 """
8513 return _core_.Window_Enable(*args, **kwargs)
8514
8515 def Disable(*args, **kwargs):
8516 """
8517 Disable(self) -> bool
8518
8519 Disables the window, same as Enable(false).
8520 """
8521 return _core_.Window_Disable(*args, **kwargs)
8522
8523 def IsShown(*args, **kwargs):
8524 """
8525 IsShown(self) -> bool
8526
8527 Returns true if the window is shown, false if it has been hidden.
8528 """
8529 return _core_.Window_IsShown(*args, **kwargs)
8530
8531 def IsEnabled(*args, **kwargs):
8532 """
8533 IsEnabled(self) -> bool
8534
8535 Returns true if the window is enabled for input, false otherwise.
8536 """
8537 return _core_.Window_IsEnabled(*args, **kwargs)
8538
8539 def IsShownOnScreen(*args, **kwargs):
8540 """
8541 IsShownOnScreen(self) -> bool
8542
8543 Returns ``True`` if the window is physically visible on the screen,
8544 i.e. it is shown and all its parents up to the toplevel window are
8545 shown as well.
8546 """
8547 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8548
8549 def SetWindowStyleFlag(*args, **kwargs):
8550 """
8551 SetWindowStyleFlag(self, long style)
8552
8553 Sets the style of the window. Please note that some styles cannot be
8554 changed after the window creation and that Refresh() might need to be
8555 called after changing the others for the change to take place
8556 immediately.
8557 """
8558 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8559
8560 def GetWindowStyleFlag(*args, **kwargs):
8561 """
8562 GetWindowStyleFlag(self) -> long
8563
8564 Gets the window style that was passed to the constructor or Create
8565 method.
8566 """
8567 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8568
8569 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8570 def HasFlag(*args, **kwargs):
8571 """
8572 HasFlag(self, int flag) -> bool
8573
8574 Test if the given style is set for this window.
8575 """
8576 return _core_.Window_HasFlag(*args, **kwargs)
8577
8578 def IsRetained(*args, **kwargs):
8579 """
8580 IsRetained(self) -> bool
8581
8582 Returns true if the window is retained, false otherwise. Retained
8583 windows are only available on X platforms.
8584 """
8585 return _core_.Window_IsRetained(*args, **kwargs)
8586
8587 def SetExtraStyle(*args, **kwargs):
8588 """
8589 SetExtraStyle(self, long exStyle)
8590
8591 Sets the extra style bits for the window. Extra styles are the less
8592 often used style bits which can't be set with the constructor or with
8593 SetWindowStyleFlag()
8594 """
8595 return _core_.Window_SetExtraStyle(*args, **kwargs)
8596
8597 def GetExtraStyle(*args, **kwargs):
8598 """
8599 GetExtraStyle(self) -> long
8600
8601 Returns the extra style bits for the window.
8602 """
8603 return _core_.Window_GetExtraStyle(*args, **kwargs)
8604
8605 def MakeModal(*args, **kwargs):
8606 """
8607 MakeModal(self, bool modal=True)
8608
8609 Disables all other windows in the application so that the user can
8610 only interact with this window. Passing False will reverse this
8611 effect.
8612 """
8613 return _core_.Window_MakeModal(*args, **kwargs)
8614
8615 def SetThemeEnabled(*args, **kwargs):
8616 """
8617 SetThemeEnabled(self, bool enableTheme)
8618
8619 This function tells a window if it should use the system's "theme"
8620 code to draw the windows' background instead if its own background
8621 drawing code. This will only have an effect on platforms that support
8622 the notion of themes in user defined windows. One such platform is
8623 GTK+ where windows can have (very colourful) backgrounds defined by a
8624 user's selected theme.
8625
8626 Dialogs, notebook pages and the status bar have this flag set to true
8627 by default so that the default look and feel is simulated best.
8628 """
8629 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8630
8631 def GetThemeEnabled(*args, **kwargs):
8632 """
8633 GetThemeEnabled(self) -> bool
8634
8635 Return the themeEnabled flag.
8636 """
8637 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8638
8639 def SetFocus(*args, **kwargs):
8640 """
8641 SetFocus(self)
8642
8643 Set's the focus to this window, allowing it to receive keyboard input.
8644 """
8645 return _core_.Window_SetFocus(*args, **kwargs)
8646
8647 def SetFocusFromKbd(*args, **kwargs):
8648 """
8649 SetFocusFromKbd(self)
8650
8651 Set focus to this window as the result of a keyboard action. Normally
8652 only called internally.
8653 """
8654 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8655
8656 def FindFocus(*args, **kwargs):
8657 """
8658 FindFocus() -> Window
8659
8660 Returns the window or control that currently has the keyboard focus,
8661 or None.
8662 """
8663 return _core_.Window_FindFocus(*args, **kwargs)
8664
8665 FindFocus = staticmethod(FindFocus)
8666 def AcceptsFocus(*args, **kwargs):
8667 """
8668 AcceptsFocus(self) -> bool
8669
8670 Can this window have focus?
8671 """
8672 return _core_.Window_AcceptsFocus(*args, **kwargs)
8673
8674 def AcceptsFocusFromKeyboard(*args, **kwargs):
8675 """
8676 AcceptsFocusFromKeyboard(self) -> bool
8677
8678 Can this window be given focus by keyboard navigation? if not, the
8679 only way to give it focus (provided it accepts it at all) is to click
8680 it.
8681 """
8682 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8683
8684 def Navigate(*args, **kwargs):
8685 """
8686 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8687
8688 Does keyboard navigation from this window to another, by sending a
8689 `wx.NavigationKeyEvent`.
8690 """
8691 return _core_.Window_Navigate(*args, **kwargs)
8692
8693 def MoveAfterInTabOrder(*args, **kwargs):
8694 """
8695 MoveAfterInTabOrder(self, Window win)
8696
8697 Moves this window in the tab navigation order after the specified
8698 sibling window. This means that when the user presses the TAB key on
8699 that other window, the focus switches to this window.
8700
8701 The default tab order is the same as creation order. This function
8702 and `MoveBeforeInTabOrder` allow to change it after creating all the
8703 windows.
8704
8705 """
8706 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8707
8708 def MoveBeforeInTabOrder(*args, **kwargs):
8709 """
8710 MoveBeforeInTabOrder(self, Window win)
8711
8712 Same as `MoveAfterInTabOrder` except that it inserts this window just
8713 before win instead of putting it right after it.
8714 """
8715 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8716
8717 def GetChildren(*args, **kwargs):
8718 """
8719 GetChildren(self) -> PyObject
8720
8721 Returns a list of the window's children. NOTE: Currently this is a
8722 copy of the child window list maintained by the window, so the return
8723 value of this function is only valid as long as the window's children
8724 do not change.
8725 """
8726 return _core_.Window_GetChildren(*args, **kwargs)
8727
8728 def GetParent(*args, **kwargs):
8729 """
8730 GetParent(self) -> Window
8731
8732 Returns the parent window of this window, or None if there isn't one.
8733 """
8734 return _core_.Window_GetParent(*args, **kwargs)
8735
8736 def GetGrandParent(*args, **kwargs):
8737 """
8738 GetGrandParent(self) -> Window
8739
8740 Returns the parent of the parent of this window, or None if there
8741 isn't one.
8742 """
8743 return _core_.Window_GetGrandParent(*args, **kwargs)
8744
8745 def IsTopLevel(*args, **kwargs):
8746 """
8747 IsTopLevel(self) -> bool
8748
8749 Returns true if the given window is a top-level one. Currently all
8750 frames and dialogs are always considered to be top-level windows (even
8751 if they have a parent window).
8752 """
8753 return _core_.Window_IsTopLevel(*args, **kwargs)
8754
8755 def Reparent(*args, **kwargs):
8756 """
8757 Reparent(self, Window newParent) -> bool
8758
8759 Reparents the window, i.e the window will be removed from its current
8760 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8761 re-inserted into another. Available on Windows and GTK. Returns True
8762 if the parent was changed, False otherwise (error or newParent ==
8763 oldParent)
8764 """
8765 return _core_.Window_Reparent(*args, **kwargs)
8766
8767 def AddChild(*args, **kwargs):
8768 """
8769 AddChild(self, Window child)
8770
8771 Adds a child window. This is called automatically by window creation
8772 functions so should not be required by the application programmer.
8773 """
8774 return _core_.Window_AddChild(*args, **kwargs)
8775
8776 def RemoveChild(*args, **kwargs):
8777 """
8778 RemoveChild(self, Window child)
8779
8780 Removes a child window. This is called automatically by window
8781 deletion functions so should not be required by the application
8782 programmer.
8783 """
8784 return _core_.Window_RemoveChild(*args, **kwargs)
8785
8786 def SetDoubleBuffered(*args, **kwargs):
8787 """
8788 SetDoubleBuffered(self, bool on)
8789
8790 Currently wxGTK2 only.
8791 """
8792 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8793
8794 def FindWindowById(*args, **kwargs):
8795 """
8796 FindWindowById(self, long winid) -> Window
8797
8798 Find a chld of this window by window ID
8799 """
8800 return _core_.Window_FindWindowById(*args, **kwargs)
8801
8802 def FindWindowByName(*args, **kwargs):
8803 """
8804 FindWindowByName(self, String name) -> Window
8805
8806 Find a child of this window by name
8807 """
8808 return _core_.Window_FindWindowByName(*args, **kwargs)
8809
8810 def GetEventHandler(*args, **kwargs):
8811 """
8812 GetEventHandler(self) -> EvtHandler
8813
8814 Returns the event handler for this window. By default, the window is
8815 its own event handler.
8816 """
8817 return _core_.Window_GetEventHandler(*args, **kwargs)
8818
8819 def SetEventHandler(*args, **kwargs):
8820 """
8821 SetEventHandler(self, EvtHandler handler)
8822
8823 Sets the event handler for this window. An event handler is an object
8824 that is capable of processing the events sent to a window. (In other
8825 words, is able to dispatch the events to handler function.) By
8826 default, the window is its own event handler, but an application may
8827 wish to substitute another, for example to allow central
8828 implementation of event-handling for a variety of different window
8829 classes.
8830
8831 It is usually better to use `wx.Window.PushEventHandler` since this sets
8832 up a chain of event handlers, where an event not handled by one event
8833 handler is handed off to the next one in the chain.
8834 """
8835 return _core_.Window_SetEventHandler(*args, **kwargs)
8836
8837 def PushEventHandler(*args, **kwargs):
8838 """
8839 PushEventHandler(self, EvtHandler handler)
8840
8841 Pushes this event handler onto the event handler stack for the window.
8842 An event handler is an object that is capable of processing the events
8843 sent to a window. (In other words, is able to dispatch the events to
8844 handler function.) By default, the window is its own event handler,
8845 but an application may wish to substitute another, for example to
8846 allow central implementation of event-handling for a variety of
8847 different window classes.
8848
8849 wx.Window.PushEventHandler allows an application to set up a chain of
8850 event handlers, where an event not handled by one event handler is
8851 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8852 to remove the event handler. Ownership of the handler is *not* given
8853 to the window, so you should be sure to pop the handler before the
8854 window is destroyed and either let PopEventHandler destroy it, or call
8855 its Destroy method yourself.
8856 """
8857 return _core_.Window_PushEventHandler(*args, **kwargs)
8858
8859 def PopEventHandler(*args, **kwargs):
8860 """
8861 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8862
8863 Removes and returns the top-most event handler on the event handler
8864 stack. If deleteHandler is True then the wx.EvtHandler object will be
8865 destroyed after it is popped, and ``None`` will be returned instead.
8866 """
8867 return _core_.Window_PopEventHandler(*args, **kwargs)
8868
8869 def RemoveEventHandler(*args, **kwargs):
8870 """
8871 RemoveEventHandler(self, EvtHandler handler) -> bool
8872
8873 Find the given handler in the event handler chain and remove (but not
8874 delete) it from the event handler chain, returns True if it was found
8875 and False otherwise (this also results in an assert failure so this
8876 function should only be called when the handler is supposed to be
8877 there.)
8878 """
8879 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8880
8881 def SetValidator(*args, **kwargs):
8882 """
8883 SetValidator(self, Validator validator)
8884
8885 Deletes the current validator (if any) and sets the window validator,
8886 having called wx.Validator.Clone to create a new validator of this
8887 type.
8888 """
8889 return _core_.Window_SetValidator(*args, **kwargs)
8890
8891 def GetValidator(*args, **kwargs):
8892 """
8893 GetValidator(self) -> Validator
8894
8895 Returns a pointer to the current validator for the window, or None if
8896 there is none.
8897 """
8898 return _core_.Window_GetValidator(*args, **kwargs)
8899
8900 def Validate(*args, **kwargs):
8901 """
8902 Validate(self) -> bool
8903
8904 Validates the current values of the child controls using their
8905 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8906 style flag set, the method will also call Validate() of all child
8907 windows. Returns false if any of the validations failed.
8908 """
8909 return _core_.Window_Validate(*args, **kwargs)
8910
8911 def TransferDataToWindow(*args, **kwargs):
8912 """
8913 TransferDataToWindow(self) -> bool
8914
8915 Transfers values to child controls from data areas specified by their
8916 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8917 style flag set, the method will also call TransferDataToWindow() of
8918 all child windows.
8919 """
8920 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8921
8922 def TransferDataFromWindow(*args, **kwargs):
8923 """
8924 TransferDataFromWindow(self) -> bool
8925
8926 Transfers values from child controls to data areas specified by their
8927 validators. Returns false if a transfer failed. If the window has
8928 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8929 also call TransferDataFromWindow() of all child windows.
8930 """
8931 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8932
8933 def InitDialog(*args, **kwargs):
8934 """
8935 InitDialog(self)
8936
8937 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8938 to the dialog via validators.
8939 """
8940 return _core_.Window_InitDialog(*args, **kwargs)
8941
8942 def SetAcceleratorTable(*args, **kwargs):
8943 """
8944 SetAcceleratorTable(self, AcceleratorTable accel)
8945
8946 Sets the accelerator table for this window.
8947 """
8948 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8949
8950 def GetAcceleratorTable(*args, **kwargs):
8951 """
8952 GetAcceleratorTable(self) -> AcceleratorTable
8953
8954 Gets the accelerator table for this window.
8955 """
8956 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8957
8958 def RegisterHotKey(*args, **kwargs):
8959 """
8960 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8961
8962 Registers a system wide hotkey. Every time the user presses the hotkey
8963 registered here, this window will receive a hotkey event. It will
8964 receive the event even if the application is in the background and
8965 does not have the input focus because the user is working with some
8966 other application. To bind an event handler function to this hotkey
8967 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8968 hotkey was registered successfully.
8969 """
8970 return _core_.Window_RegisterHotKey(*args, **kwargs)
8971
8972 def UnregisterHotKey(*args, **kwargs):
8973 """
8974 UnregisterHotKey(self, int hotkeyId) -> bool
8975
8976 Unregisters a system wide hotkey.
8977 """
8978 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8979
8980 def ConvertDialogPointToPixels(*args, **kwargs):
8981 """
8982 ConvertDialogPointToPixels(self, Point pt) -> Point
8983
8984 Converts a point or size from dialog units to pixels. Dialog units
8985 are used for maintaining a dialog's proportions even if the font
8986 changes. For the x dimension, the dialog units are multiplied by the
8987 average character width and then divided by 4. For the y dimension,
8988 the dialog units are multiplied by the average character height and
8989 then divided by 8.
8990 """
8991 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8992
8993 def ConvertDialogSizeToPixels(*args, **kwargs):
8994 """
8995 ConvertDialogSizeToPixels(self, Size sz) -> Size
8996
8997 Converts a point or size from dialog units to pixels. Dialog units
8998 are used for maintaining a dialog's proportions even if the font
8999 changes. For the x dimension, the dialog units are multiplied by the
9000 average character width and then divided by 4. For the y dimension,
9001 the dialog units are multiplied by the average character height and
9002 then divided by 8.
9003 """
9004 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9005
9006 def DLG_PNT(*args, **kwargs):
9007 """
9008 DLG_PNT(self, Point pt) -> Point
9009
9010 Converts a point or size from dialog units to pixels. Dialog units
9011 are used for maintaining a dialog's proportions even if the font
9012 changes. For the x dimension, the dialog units are multiplied by the
9013 average character width and then divided by 4. For the y dimension,
9014 the dialog units are multiplied by the average character height and
9015 then divided by 8.
9016 """
9017 return _core_.Window_DLG_PNT(*args, **kwargs)
9018
9019 def DLG_SZE(*args, **kwargs):
9020 """
9021 DLG_SZE(self, Size sz) -> Size
9022
9023 Converts a point or size from dialog units to pixels. Dialog units
9024 are used for maintaining a dialog's proportions even if the font
9025 changes. For the x dimension, the dialog units are multiplied by the
9026 average character width and then divided by 4. For the y dimension,
9027 the dialog units are multiplied by the average character height and
9028 then divided by 8.
9029 """
9030 return _core_.Window_DLG_SZE(*args, **kwargs)
9031
9032 def ConvertPixelPointToDialog(*args, **kwargs):
9033 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9034 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9035
9036 def ConvertPixelSizeToDialog(*args, **kwargs):
9037 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9038 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9039
9040 def WarpPointer(*args, **kwargs):
9041 """
9042 WarpPointer(self, int x, int y)
9043
9044 Moves the pointer to the given position on the window.
9045
9046 NOTE: This function is not supported under Mac because Apple Human
9047 Interface Guidelines forbid moving the mouse cursor programmatically.
9048 """
9049 return _core_.Window_WarpPointer(*args, **kwargs)
9050
9051 def CaptureMouse(*args, **kwargs):
9052 """
9053 CaptureMouse(self)
9054
9055 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9056 release the capture.
9057
9058 Note that wxWindows maintains the stack of windows having captured the
9059 mouse and when the mouse is released the capture returns to the window
9060 which had had captured it previously and it is only really released if
9061 there were no previous window. In particular, this means that you must
9062 release the mouse as many times as you capture it, unless the window
9063 receives the `wx.MouseCaptureLostEvent` event.
9064
9065 Any application which captures the mouse in the beginning of some
9066 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9067 operation when it receives the event. The event handler must not
9068 recapture mouse.
9069 """
9070 return _core_.Window_CaptureMouse(*args, **kwargs)
9071
9072 def ReleaseMouse(*args, **kwargs):
9073 """
9074 ReleaseMouse(self)
9075
9076 Releases mouse input captured with wx.Window.CaptureMouse.
9077 """
9078 return _core_.Window_ReleaseMouse(*args, **kwargs)
9079
9080 def GetCapture(*args, **kwargs):
9081 """
9082 GetCapture() -> Window
9083
9084 Returns the window which currently captures the mouse or None
9085 """
9086 return _core_.Window_GetCapture(*args, **kwargs)
9087
9088 GetCapture = staticmethod(GetCapture)
9089 def HasCapture(*args, **kwargs):
9090 """
9091 HasCapture(self) -> bool
9092
9093 Returns true if this window has the current mouse capture.
9094 """
9095 return _core_.Window_HasCapture(*args, **kwargs)
9096
9097 def Refresh(*args, **kwargs):
9098 """
9099 Refresh(self, bool eraseBackground=True, Rect rect=None)
9100
9101 Mark the specified rectangle (or the whole window) as "dirty" so it
9102 will be repainted. Causes an EVT_PAINT event to be generated and sent
9103 to the window.
9104 """
9105 return _core_.Window_Refresh(*args, **kwargs)
9106
9107 def RefreshRect(*args, **kwargs):
9108 """
9109 RefreshRect(self, Rect rect, bool eraseBackground=True)
9110
9111 Redraws the contents of the given rectangle: the area inside it will
9112 be repainted. This is the same as Refresh but has a nicer syntax.
9113 """
9114 return _core_.Window_RefreshRect(*args, **kwargs)
9115
9116 def Update(*args, **kwargs):
9117 """
9118 Update(self)
9119
9120 Calling this method immediately repaints the invalidated area of the
9121 window instead of waiting for the EVT_PAINT event to happen, (normally
9122 this would usually only happen when the flow of control returns to the
9123 event loop.) Notice that this function doesn't refresh the window and
9124 does nothing if the window has been already repainted. Use Refresh
9125 first if you want to immediately redraw the window (or some portion of
9126 it) unconditionally.
9127 """
9128 return _core_.Window_Update(*args, **kwargs)
9129
9130 def ClearBackground(*args, **kwargs):
9131 """
9132 ClearBackground(self)
9133
9134 Clears the window by filling it with the current background
9135 colour. Does not cause an erase background event to be generated.
9136 """
9137 return _core_.Window_ClearBackground(*args, **kwargs)
9138
9139 def Freeze(*args, **kwargs):
9140 """
9141 Freeze(self)
9142
9143 Freezes the window or, in other words, prevents any updates from
9144 taking place on screen, the window is not redrawn at all. Thaw must be
9145 called to reenable window redrawing. Calls to Freeze/Thaw may be
9146 nested, with the actual Thaw being delayed until all the nesting has
9147 been undone.
9148
9149 This method is useful for visual appearance optimization (for example,
9150 it is a good idea to use it before inserting large amount of text into
9151 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9152 for all controls so it is mostly just a hint to wxWindows and not a
9153 mandatory directive.
9154 """
9155 return _core_.Window_Freeze(*args, **kwargs)
9156
9157 def IsFrozen(*args, **kwargs):
9158 """
9159 IsFrozen(self) -> bool
9160
9161 Returns ``True`` if the window has been frozen and not thawed yet.
9162
9163 :see: `Freeze` and `Thaw`
9164 """
9165 return _core_.Window_IsFrozen(*args, **kwargs)
9166
9167 def Thaw(*args, **kwargs):
9168 """
9169 Thaw(self)
9170
9171 Reenables window updating after a previous call to Freeze. Calls to
9172 Freeze/Thaw may be nested, so Thaw must be called the same number of
9173 times that Freeze was before the window will be updated.
9174 """
9175 return _core_.Window_Thaw(*args, **kwargs)
9176
9177 def PrepareDC(*args, **kwargs):
9178 """
9179 PrepareDC(self, DC dc)
9180
9181 Call this function to prepare the device context for drawing a
9182 scrolled image. It sets the device origin according to the current
9183 scroll position.
9184 """
9185 return _core_.Window_PrepareDC(*args, **kwargs)
9186
9187 def GetUpdateRegion(*args, **kwargs):
9188 """
9189 GetUpdateRegion(self) -> Region
9190
9191 Returns the region specifying which parts of the window have been
9192 damaged. Should only be called within an EVT_PAINT handler.
9193 """
9194 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9195
9196 def GetUpdateClientRect(*args, **kwargs):
9197 """
9198 GetUpdateClientRect(self) -> Rect
9199
9200 Get the update rectangle region bounding box in client coords.
9201 """
9202 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9203
9204 def IsExposed(*args, **kwargs):
9205 """
9206 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9207
9208 Returns true if the given point or rectangle area has been exposed
9209 since the last repaint. Call this in an paint event handler to
9210 optimize redrawing by only redrawing those areas, which have been
9211 exposed.
9212 """
9213 return _core_.Window_IsExposed(*args, **kwargs)
9214
9215 def IsExposedPoint(*args, **kwargs):
9216 """
9217 IsExposedPoint(self, Point pt) -> bool
9218
9219 Returns true if the given point or rectangle area has been exposed
9220 since the last repaint. Call this in an paint event handler to
9221 optimize redrawing by only redrawing those areas, which have been
9222 exposed.
9223 """
9224 return _core_.Window_IsExposedPoint(*args, **kwargs)
9225
9226 def IsExposedRect(*args, **kwargs):
9227 """
9228 IsExposedRect(self, Rect rect) -> bool
9229
9230 Returns true if the given point or rectangle area has been exposed
9231 since the last repaint. Call this in an paint event handler to
9232 optimize redrawing by only redrawing those areas, which have been
9233 exposed.
9234 """
9235 return _core_.Window_IsExposedRect(*args, **kwargs)
9236
9237 def GetDefaultAttributes(*args, **kwargs):
9238 """
9239 GetDefaultAttributes(self) -> VisualAttributes
9240
9241 Get the default attributes for an instance of this class. This is
9242 useful if you want to use the same font or colour in your own control
9243 as in a standard control -- which is a much better idea than hard
9244 coding specific colours or fonts which might look completely out of
9245 place on the user's system, especially if it uses themes.
9246 """
9247 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9248
9249 def GetClassDefaultAttributes(*args, **kwargs):
9250 """
9251 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9252
9253 Get the default attributes for this class. This is useful if you want
9254 to use the same font or colour in your own control as in a standard
9255 control -- which is a much better idea than hard coding specific
9256 colours or fonts which might look completely out of place on the
9257 user's system, especially if it uses themes.
9258
9259 The variant parameter is only relevant under Mac currently and is
9260 ignore under other platforms. Under Mac, it will change the size of
9261 the returned font. See `wx.Window.SetWindowVariant` for more about
9262 this.
9263 """
9264 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9265
9266 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9267 def SetBackgroundColour(*args, **kwargs):
9268 """
9269 SetBackgroundColour(self, Colour colour) -> bool
9270
9271 Sets the background colour of the window. Returns True if the colour
9272 was changed. The background colour is usually painted by the default
9273 EVT_ERASE_BACKGROUND event handler function under Windows and
9274 automatically under GTK. Using `wx.NullColour` will reset the window
9275 to the default background colour.
9276
9277 Note that setting the background colour may not cause an immediate
9278 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9279 calling this function.
9280
9281 Using this function will disable attempts to use themes for this
9282 window, if the system supports them. Use with care since usually the
9283 themes represent the appearance chosen by the user to be used for all
9284 applications on the system.
9285 """
9286 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9287
9288 def SetOwnBackgroundColour(*args, **kwargs):
9289 """SetOwnBackgroundColour(self, Colour colour)"""
9290 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9291
9292 def SetForegroundColour(*args, **kwargs):
9293 """
9294 SetForegroundColour(self, Colour colour) -> bool
9295
9296 Sets the foreground colour of the window. Returns True is the colour
9297 was changed. The interpretation of foreground colour is dependent on
9298 the window class; it may be the text colour or other colour, or it may
9299 not be used at all.
9300 """
9301 return _core_.Window_SetForegroundColour(*args, **kwargs)
9302
9303 def SetOwnForegroundColour(*args, **kwargs):
9304 """SetOwnForegroundColour(self, Colour colour)"""
9305 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9306
9307 def GetBackgroundColour(*args, **kwargs):
9308 """
9309 GetBackgroundColour(self) -> Colour
9310
9311 Returns the background colour of the window.
9312 """
9313 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9314
9315 def GetForegroundColour(*args, **kwargs):
9316 """
9317 GetForegroundColour(self) -> Colour
9318
9319 Returns the foreground colour of the window. The interpretation of
9320 foreground colour is dependent on the window class; it may be the text
9321 colour or other colour, or it may not be used at all.
9322 """
9323 return _core_.Window_GetForegroundColour(*args, **kwargs)
9324
9325 def InheritsBackgroundColour(*args, **kwargs):
9326 """InheritsBackgroundColour(self) -> bool"""
9327 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9328
9329 def UseBgCol(*args, **kwargs):
9330 """UseBgCol(self) -> bool"""
9331 return _core_.Window_UseBgCol(*args, **kwargs)
9332
9333 def SetBackgroundStyle(*args, **kwargs):
9334 """
9335 SetBackgroundStyle(self, int style) -> bool
9336
9337 Returns the background style of the window. The background style
9338 indicates how the background of the window is drawn.
9339
9340 ====================== ========================================
9341 wx.BG_STYLE_SYSTEM The background colour or pattern should
9342 be determined by the system
9343 wx.BG_STYLE_COLOUR The background should be a solid colour
9344 wx.BG_STYLE_CUSTOM The background will be implemented by the
9345 application.
9346 ====================== ========================================
9347
9348 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9349 a custom background, such as a tiled bitmap. Currently the style has
9350 no effect on other platforms.
9351
9352 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9353 """
9354 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9355
9356 def GetBackgroundStyle(*args, **kwargs):
9357 """
9358 GetBackgroundStyle(self) -> int
9359
9360 Returns the background style of the window.
9361
9362 :see: `SetBackgroundStyle`
9363 """
9364 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9365
9366 def HasTransparentBackground(*args, **kwargs):
9367 """
9368 HasTransparentBackground(self) -> bool
9369
9370 Returns True if this window's background is transparent (as, for
9371 example, for `wx.StaticText`) and should show the parent window's
9372 background.
9373
9374 This method is mostly used internally by the library itself and you
9375 normally shouldn't have to call it. You may, however, have to override
9376 it in your custom control classes to ensure that background is painted
9377 correctly.
9378 """
9379 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9380
9381 def SetCursor(*args, **kwargs):
9382 """
9383 SetCursor(self, Cursor cursor) -> bool
9384
9385 Sets the window's cursor. Notice that the window cursor also sets it
9386 for the children of the window implicitly.
9387
9388 The cursor may be wx.NullCursor in which case the window cursor will
9389 be reset back to default.
9390 """
9391 return _core_.Window_SetCursor(*args, **kwargs)
9392
9393 def GetCursor(*args, **kwargs):
9394 """
9395 GetCursor(self) -> Cursor
9396
9397 Return the cursor associated with this window.
9398 """
9399 return _core_.Window_GetCursor(*args, **kwargs)
9400
9401 def SetFont(*args, **kwargs):
9402 """
9403 SetFont(self, Font font) -> bool
9404
9405 Sets the font for this window.
9406 """
9407 return _core_.Window_SetFont(*args, **kwargs)
9408
9409 def SetOwnFont(*args, **kwargs):
9410 """SetOwnFont(self, Font font)"""
9411 return _core_.Window_SetOwnFont(*args, **kwargs)
9412
9413 def GetFont(*args, **kwargs):
9414 """
9415 GetFont(self) -> Font
9416
9417 Returns the default font used for this window.
9418 """
9419 return _core_.Window_GetFont(*args, **kwargs)
9420
9421 def SetCaret(*args, **kwargs):
9422 """
9423 SetCaret(self, Caret caret)
9424
9425 Sets the caret associated with the window.
9426 """
9427 return _core_.Window_SetCaret(*args, **kwargs)
9428
9429 def GetCaret(*args, **kwargs):
9430 """
9431 GetCaret(self) -> Caret
9432
9433 Returns the caret associated with the window.
9434 """
9435 return _core_.Window_GetCaret(*args, **kwargs)
9436
9437 def GetCharHeight(*args, **kwargs):
9438 """
9439 GetCharHeight(self) -> int
9440
9441 Get the (average) character size for the current font.
9442 """
9443 return _core_.Window_GetCharHeight(*args, **kwargs)
9444
9445 def GetCharWidth(*args, **kwargs):
9446 """
9447 GetCharWidth(self) -> int
9448
9449 Get the (average) character size for the current font.
9450 """
9451 return _core_.Window_GetCharWidth(*args, **kwargs)
9452
9453 def GetTextExtent(*args, **kwargs):
9454 """
9455 GetTextExtent(String string) -> (width, height)
9456
9457 Get the width and height of the text using the current font.
9458 """
9459 return _core_.Window_GetTextExtent(*args, **kwargs)
9460
9461 def GetFullTextExtent(*args, **kwargs):
9462 """
9463 GetFullTextExtent(String string, Font font=None) ->
9464 (width, height, descent, externalLeading)
9465
9466 Get the width, height, decent and leading of the text using the
9467 current or specified font.
9468 """
9469 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9470
9471 def ClientToScreenXY(*args, **kwargs):
9472 """
9473 ClientToScreenXY(int x, int y) -> (x,y)
9474
9475 Converts to screen coordinates from coordinates relative to this window.
9476 """
9477 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9478
9479 def ScreenToClientXY(*args, **kwargs):
9480 """
9481 ScreenToClientXY(int x, int y) -> (x,y)
9482
9483 Converts from screen to client window coordinates.
9484 """
9485 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9486
9487 def ClientToScreen(*args, **kwargs):
9488 """
9489 ClientToScreen(self, Point pt) -> Point
9490
9491 Converts to screen coordinates from coordinates relative to this window.
9492 """
9493 return _core_.Window_ClientToScreen(*args, **kwargs)
9494
9495 def ScreenToClient(*args, **kwargs):
9496 """
9497 ScreenToClient(self, Point pt) -> Point
9498
9499 Converts from screen to client window coordinates.
9500 """
9501 return _core_.Window_ScreenToClient(*args, **kwargs)
9502
9503 def HitTestXY(*args, **kwargs):
9504 """
9505 HitTestXY(self, int x, int y) -> int
9506
9507 Test where the given (in client coords) point lies
9508 """
9509 return _core_.Window_HitTestXY(*args, **kwargs)
9510
9511 def HitTest(*args, **kwargs):
9512 """
9513 HitTest(self, Point pt) -> int
9514
9515 Test where the given (in client coords) point lies
9516 """
9517 return _core_.Window_HitTest(*args, **kwargs)
9518
9519 def GetBorder(*args):
9520 """
9521 GetBorder(self, long flags) -> int
9522 GetBorder(self) -> int
9523
9524 Get border for the flags of this window
9525 """
9526 return _core_.Window_GetBorder(*args)
9527
9528 def UpdateWindowUI(*args, **kwargs):
9529 """
9530 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9531
9532 This function sends EVT_UPDATE_UI events to the window. The particular
9533 implementation depends on the window; for example a wx.ToolBar will
9534 send an update UI event for each toolbar button, and a wx.Frame will
9535 send an update UI event for each menubar menu item. You can call this
9536 function from your application to ensure that your UI is up-to-date at
9537 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9538 concerned). This may be necessary if you have called
9539 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9540 limit the overhead that wxWindows incurs by sending update UI events
9541 in idle time.
9542 """
9543 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9544
9545 def PopupMenuXY(*args, **kwargs):
9546 """
9547 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9548
9549 Pops up the given menu at the specified coordinates, relative to this window,
9550 and returns control when the user has dismissed the menu. If a menu item is
9551 selected, the corresponding menu event is generated and will be processed as
9552 usual. If the default position is given then the current position of the
9553 mouse cursor will be used.
9554 """
9555 return _core_.Window_PopupMenuXY(*args, **kwargs)
9556
9557 def PopupMenu(*args, **kwargs):
9558 """
9559 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9560
9561 Pops up the given menu at the specified coordinates, relative to this window,
9562 and returns control when the user has dismissed the menu. If a menu item is
9563 selected, the corresponding menu event is generated and will be processed as
9564 usual. If the default position is given then the current position of the
9565 mouse cursor will be used.
9566 """
9567 return _core_.Window_PopupMenu(*args, **kwargs)
9568
9569 def HasMultiplePages(*args, **kwargs):
9570 """HasMultiplePages(self) -> bool"""
9571 return _core_.Window_HasMultiplePages(*args, **kwargs)
9572
9573 def GetHandle(*args, **kwargs):
9574 """
9575 GetHandle(self) -> long
9576
9577 Returns the platform-specific handle (as a long integer) of the
9578 physical window. Currently on wxMac it returns the handle of the
9579 toplevel parent of the window.
9580 """
9581 return _core_.Window_GetHandle(*args, **kwargs)
9582
9583 def AssociateHandle(*args, **kwargs):
9584 """
9585 AssociateHandle(self, long handle)
9586
9587 Associate the window with a new native handle
9588 """
9589 return _core_.Window_AssociateHandle(*args, **kwargs)
9590
9591 def DissociateHandle(*args, **kwargs):
9592 """
9593 DissociateHandle(self)
9594
9595 Dissociate the current native handle from the window
9596 """
9597 return _core_.Window_DissociateHandle(*args, **kwargs)
9598
9599 def OnPaint(*args, **kwargs):
9600 """OnPaint(self, PaintEvent event)"""
9601 return _core_.Window_OnPaint(*args, **kwargs)
9602
9603 def HasScrollbar(*args, **kwargs):
9604 """
9605 HasScrollbar(self, int orient) -> bool
9606
9607 Does the window have the scrollbar for this orientation?
9608 """
9609 return _core_.Window_HasScrollbar(*args, **kwargs)
9610
9611 def SetScrollbar(*args, **kwargs):
9612 """
9613 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9614 bool refresh=True)
9615
9616 Sets the scrollbar properties of a built-in scrollbar.
9617 """
9618 return _core_.Window_SetScrollbar(*args, **kwargs)
9619
9620 def SetScrollPos(*args, **kwargs):
9621 """
9622 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9623
9624 Sets the position of one of the built-in scrollbars.
9625 """
9626 return _core_.Window_SetScrollPos(*args, **kwargs)
9627
9628 def GetScrollPos(*args, **kwargs):
9629 """
9630 GetScrollPos(self, int orientation) -> int
9631
9632 Returns the built-in scrollbar position.
9633 """
9634 return _core_.Window_GetScrollPos(*args, **kwargs)
9635
9636 def GetScrollThumb(*args, **kwargs):
9637 """
9638 GetScrollThumb(self, int orientation) -> int
9639
9640 Returns the built-in scrollbar thumb size.
9641 """
9642 return _core_.Window_GetScrollThumb(*args, **kwargs)
9643
9644 def GetScrollRange(*args, **kwargs):
9645 """
9646 GetScrollRange(self, int orientation) -> int
9647
9648 Returns the built-in scrollbar range.
9649 """
9650 return _core_.Window_GetScrollRange(*args, **kwargs)
9651
9652 def ScrollWindow(*args, **kwargs):
9653 """
9654 ScrollWindow(self, int dx, int dy, Rect rect=None)
9655
9656 Physically scrolls the pixels in the window and move child windows
9657 accordingly. Use this function to optimise your scrolling
9658 implementations, to minimise the area that must be redrawn. Note that
9659 it is rarely required to call this function from a user program.
9660 """
9661 return _core_.Window_ScrollWindow(*args, **kwargs)
9662
9663 def ScrollLines(*args, **kwargs):
9664 """
9665 ScrollLines(self, int lines) -> bool
9666
9667 If the platform and window class supports it, scrolls the window by
9668 the given number of lines down, if lines is positive, or up if lines
9669 is negative. Returns True if the window was scrolled, False if it was
9670 already on top/bottom and nothing was done.
9671 """
9672 return _core_.Window_ScrollLines(*args, **kwargs)
9673
9674 def ScrollPages(*args, **kwargs):
9675 """
9676 ScrollPages(self, int pages) -> bool
9677
9678 If the platform and window class supports it, scrolls the window by
9679 the given number of pages down, if pages is positive, or up if pages
9680 is negative. Returns True if the window was scrolled, False if it was
9681 already on top/bottom and nothing was done.
9682 """
9683 return _core_.Window_ScrollPages(*args, **kwargs)
9684
9685 def LineUp(*args, **kwargs):
9686 """
9687 LineUp(self) -> bool
9688
9689 This is just a wrapper for ScrollLines(-1).
9690 """
9691 return _core_.Window_LineUp(*args, **kwargs)
9692
9693 def LineDown(*args, **kwargs):
9694 """
9695 LineDown(self) -> bool
9696
9697 This is just a wrapper for ScrollLines(1).
9698 """
9699 return _core_.Window_LineDown(*args, **kwargs)
9700
9701 def PageUp(*args, **kwargs):
9702 """
9703 PageUp(self) -> bool
9704
9705 This is just a wrapper for ScrollPages(-1).
9706 """
9707 return _core_.Window_PageUp(*args, **kwargs)
9708
9709 def PageDown(*args, **kwargs):
9710 """
9711 PageDown(self) -> bool
9712
9713 This is just a wrapper for ScrollPages(1).
9714 """
9715 return _core_.Window_PageDown(*args, **kwargs)
9716
9717 def SetHelpText(*args, **kwargs):
9718 """
9719 SetHelpText(self, String text)
9720
9721 Sets the help text to be used as context-sensitive help for this
9722 window. Note that the text is actually stored by the current
9723 `wx.HelpProvider` implementation, and not in the window object itself.
9724 """
9725 return _core_.Window_SetHelpText(*args, **kwargs)
9726
9727 def SetHelpTextForId(*args, **kwargs):
9728 """
9729 SetHelpTextForId(self, String text)
9730
9731 Associate this help text with all windows with the same id as this
9732 one.
9733 """
9734 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9735
9736 def GetHelpTextAtPoint(*args, **kwargs):
9737 """
9738 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9739
9740 Get the help string associated with the given position in this window.
9741
9742 Notice that pt may be invalid if event origin is keyboard or unknown
9743 and this method should return the global window help text then
9744
9745 """
9746 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9747
9748 def GetHelpText(*args, **kwargs):
9749 """
9750 GetHelpText(self) -> String
9751
9752 Gets the help text to be used as context-sensitive help for this
9753 window. Note that the text is actually stored by the current
9754 `wx.HelpProvider` implementation, and not in the window object itself.
9755 """
9756 return _core_.Window_GetHelpText(*args, **kwargs)
9757
9758 def SetToolTipString(*args, **kwargs):
9759 """
9760 SetToolTipString(self, String tip)
9761
9762 Attach a tooltip to the window.
9763 """
9764 return _core_.Window_SetToolTipString(*args, **kwargs)
9765
9766 def SetToolTip(*args, **kwargs):
9767 """
9768 SetToolTip(self, ToolTip tip)
9769
9770 Attach a tooltip to the window.
9771 """
9772 return _core_.Window_SetToolTip(*args, **kwargs)
9773
9774 def GetToolTip(*args, **kwargs):
9775 """
9776 GetToolTip(self) -> ToolTip
9777
9778 get the associated tooltip or None if none
9779 """
9780 return _core_.Window_GetToolTip(*args, **kwargs)
9781
9782 def SetDropTarget(*args, **kwargs):
9783 """
9784 SetDropTarget(self, DropTarget dropTarget)
9785
9786 Associates a drop target with this window. If the window already has
9787 a drop target, it is deleted.
9788 """
9789 return _core_.Window_SetDropTarget(*args, **kwargs)
9790
9791 def GetDropTarget(*args, **kwargs):
9792 """
9793 GetDropTarget(self) -> DropTarget
9794
9795 Returns the associated drop target, which may be None.
9796 """
9797 return _core_.Window_GetDropTarget(*args, **kwargs)
9798
9799 def DragAcceptFiles(*args, **kwargs):
9800 """
9801 DragAcceptFiles(self, bool accept)
9802
9803 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9804 Only functional on Windows.
9805 """
9806 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9807
9808 def SetConstraints(*args, **kwargs):
9809 """
9810 SetConstraints(self, LayoutConstraints constraints)
9811
9812 Sets the window to have the given layout constraints. If an existing
9813 layout constraints object is already owned by the window, it will be
9814 deleted. Pass None to disassociate and delete the window's current
9815 constraints.
9816
9817 You must call SetAutoLayout to tell a window to use the constraints
9818 automatically in its default EVT_SIZE handler; otherwise, you must
9819 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9820 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9821 effect.
9822 """
9823 return _core_.Window_SetConstraints(*args, **kwargs)
9824
9825 def GetConstraints(*args, **kwargs):
9826 """
9827 GetConstraints(self) -> LayoutConstraints
9828
9829 Returns a pointer to the window's layout constraints, or None if there
9830 are none.
9831 """
9832 return _core_.Window_GetConstraints(*args, **kwargs)
9833
9834 def SetAutoLayout(*args, **kwargs):
9835 """
9836 SetAutoLayout(self, bool autoLayout)
9837
9838 Determines whether the Layout function will be called automatically
9839 when the window is resized. lease note that this only happens for the
9840 windows usually used to contain children, namely `wx.Panel` and
9841 `wx.TopLevelWindow` (and the classes deriving from them).
9842
9843 This method is called implicitly by `SetSizer` but if you use
9844 `SetConstraints` you should call it manually or otherwise the window
9845 layout won't be correctly updated when its size changes.
9846 """
9847 return _core_.Window_SetAutoLayout(*args, **kwargs)
9848
9849 def GetAutoLayout(*args, **kwargs):
9850 """
9851 GetAutoLayout(self) -> bool
9852
9853 Returns the current autoLayout setting
9854 """
9855 return _core_.Window_GetAutoLayout(*args, **kwargs)
9856
9857 def Layout(*args, **kwargs):
9858 """
9859 Layout(self) -> bool
9860
9861 Invokes the constraint-based layout algorithm or the sizer-based
9862 algorithm for this window. See SetAutoLayout: when auto layout is on,
9863 this function gets called automatically by the default EVT_SIZE
9864 handler when the window is resized.
9865 """
9866 return _core_.Window_Layout(*args, **kwargs)
9867
9868 def SetSizer(*args, **kwargs):
9869 """
9870 SetSizer(self, Sizer sizer, bool deleteOld=True)
9871
9872 Sets the window to have the given layout sizer. The window will then
9873 own the object, and will take care of its deletion. If an existing
9874 layout sizer object is already owned by the window, it will be deleted
9875 if the deleteOld parameter is true. Note that this function will also
9876 call SetAutoLayout implicitly with a True parameter if the sizer is
9877 non-None, and False otherwise.
9878 """
9879 return _core_.Window_SetSizer(*args, **kwargs)
9880
9881 def SetSizerAndFit(*args, **kwargs):
9882 """
9883 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9884
9885 The same as SetSizer, except it also sets the size hints for the
9886 window based on the sizer's minimum size.
9887 """
9888 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9889
9890 def GetSizer(*args, **kwargs):
9891 """
9892 GetSizer(self) -> Sizer
9893
9894 Return the sizer associated with the window by a previous call to
9895 SetSizer or None if there isn't one.
9896 """
9897 return _core_.Window_GetSizer(*args, **kwargs)
9898
9899 def SetContainingSizer(*args, **kwargs):
9900 """
9901 SetContainingSizer(self, Sizer sizer)
9902
9903 This normally does not need to be called by application code. It is
9904 called internally when a window is added to a sizer, and is used so
9905 the window can remove itself from the sizer when it is destroyed.
9906 """
9907 return _core_.Window_SetContainingSizer(*args, **kwargs)
9908
9909 def GetContainingSizer(*args, **kwargs):
9910 """
9911 GetContainingSizer(self) -> Sizer
9912
9913 Return the sizer that this window is a member of, if any, otherwise None.
9914 """
9915 return _core_.Window_GetContainingSizer(*args, **kwargs)
9916
9917 def InheritAttributes(*args, **kwargs):
9918 """
9919 InheritAttributes(self)
9920
9921 This function is (or should be, in case of custom controls) called
9922 during window creation to intelligently set up the window visual
9923 attributes, that is the font and the foreground and background
9924 colours.
9925
9926 By 'intelligently' the following is meant: by default, all windows use
9927 their own default attributes. However if some of the parent's
9928 attributes are explicitly changed (that is, using SetFont and not
9929 SetOwnFont) and if the corresponding attribute hadn't been
9930 explicitly set for this window itself, then this window takes the same
9931 value as used by the parent. In addition, if the window overrides
9932 ShouldInheritColours to return false, the colours will not be changed
9933 no matter what and only the font might.
9934
9935 This rather complicated logic is necessary in order to accommodate the
9936 different usage scenarios. The most common one is when all default
9937 attributes are used and in this case, nothing should be inherited as
9938 in modern GUIs different controls use different fonts (and colours)
9939 than their siblings so they can't inherit the same value from the
9940 parent. However it was also deemed desirable to allow to simply change
9941 the attributes of all children at once by just changing the font or
9942 colour of their common parent, hence in this case we do inherit the
9943 parents attributes.
9944
9945 """
9946 return _core_.Window_InheritAttributes(*args, **kwargs)
9947
9948 def ShouldInheritColours(*args, **kwargs):
9949 """
9950 ShouldInheritColours(self) -> bool
9951
9952 Return true from here to allow the colours of this window to be
9953 changed by InheritAttributes, returning false forbids inheriting them
9954 from the parent window.
9955
9956 The base class version returns false, but this method is overridden in
9957 wxControl where it returns true.
9958 """
9959 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9960
9961 def CanSetTransparent(*args, **kwargs):
9962 """
9963 CanSetTransparent(self) -> bool
9964
9965 Returns ``True`` if the platform supports setting the transparency for
9966 this window. Note that this method will err on the side of caution,
9967 so it is possible that this will return ``False`` when it is in fact
9968 possible to set the transparency.
9969
9970 NOTE: On X-windows systems the X server must have the composite
9971 extension loaded, and there must be a composite manager program (such
9972 as xcompmgr) running.
9973 """
9974 return _core_.Window_CanSetTransparent(*args, **kwargs)
9975
9976 def SetTransparent(*args, **kwargs):
9977 """
9978 SetTransparent(self, byte alpha) -> bool
9979
9980 Attempt to set the transparency of this window to the ``alpha`` value,
9981 returns True on success. The ``alpha`` value is an integer in the
9982 range of 0 to 255, where 0 is fully transparent and 255 is fully
9983 opaque.
9984 """
9985 return _core_.Window_SetTransparent(*args, **kwargs)
9986
9987 def PostCreate(self, pre):
9988 """
9989 Phase 3 of the 2-phase create <wink!>
9990 Call this method after precreating the window with the 2-phase create method.
9991 """
9992 self.this = pre.this
9993 self.thisown = pre.thisown
9994 pre.thisown = 0
9995 if hasattr(self, '_setOORInfo'):
9996 self._setOORInfo(self)
9997 if hasattr(self, '_setCallbackInfo'):
9998 self._setCallbackInfo(self, self.__class__)
9999
10000 def SendSizeEvent(self):
10001 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10002
10003 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10004 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10005 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10006 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10007 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10008 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10009 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10010 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10011 Border = property(GetBorder,doc="See `GetBorder`")
10012 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10013 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10014 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10015 Children = property(GetChildren,doc="See `GetChildren`")
10016 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10017 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10018 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10019 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10020 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10021 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10022 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10023 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10024 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10025 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10026 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10027 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
10028 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10029 Handle = property(GetHandle,doc="See `GetHandle`")
10030 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
10031 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10032 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
10033 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
10034 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10035 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10036 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10037 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10038 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10039 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10040 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10041 Parent = property(GetParent,doc="See `GetParent`")
10042 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10043 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10044 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10045 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
10046 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10047 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
10048 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10049 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10050 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10051 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10052 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10053 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10054 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10055 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10056 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
10057 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10058 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10059 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
10060 _core_.Window_swigregister(Window)
10061
10062 def PreWindow(*args, **kwargs):
10063 """
10064 PreWindow() -> Window
10065
10066 Precreate a Window for 2-phase creation.
10067 """
10068 val = _core_.new_PreWindow(*args, **kwargs)
10069 return val
10070
10071 def Window_NewControlId(*args):
10072 """
10073 Window_NewControlId() -> int
10074
10075 Generate a control id for the controls which were not given one.
10076 """
10077 return _core_.Window_NewControlId(*args)
10078
10079 def Window_NextControlId(*args, **kwargs):
10080 """
10081 Window_NextControlId(int winid) -> int
10082
10083 Get the id of the control following the one with the given
10084 autogenerated) id
10085 """
10086 return _core_.Window_NextControlId(*args, **kwargs)
10087
10088 def Window_PrevControlId(*args, **kwargs):
10089 """
10090 Window_PrevControlId(int winid) -> int
10091
10092 Get the id of the control preceding the one with the given
10093 autogenerated) id
10094 """
10095 return _core_.Window_PrevControlId(*args, **kwargs)
10096
10097 def Window_FindFocus(*args):
10098 """
10099 Window_FindFocus() -> Window
10100
10101 Returns the window or control that currently has the keyboard focus,
10102 or None.
10103 """
10104 return _core_.Window_FindFocus(*args)
10105
10106 def Window_GetCapture(*args):
10107 """
10108 Window_GetCapture() -> Window
10109
10110 Returns the window which currently captures the mouse or None
10111 """
10112 return _core_.Window_GetCapture(*args)
10113
10114 def Window_GetClassDefaultAttributes(*args, **kwargs):
10115 """
10116 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10117
10118 Get the default attributes for this class. This is useful if you want
10119 to use the same font or colour in your own control as in a standard
10120 control -- which is a much better idea than hard coding specific
10121 colours or fonts which might look completely out of place on the
10122 user's system, especially if it uses themes.
10123
10124 The variant parameter is only relevant under Mac currently and is
10125 ignore under other platforms. Under Mac, it will change the size of
10126 the returned font. See `wx.Window.SetWindowVariant` for more about
10127 this.
10128 """
10129 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10130
10131 def DLG_PNT(win, point_or_x, y=None):
10132 """
10133 Convenience function for converting a Point or (x,y) in
10134 dialog units to pixel units.
10135 """
10136 if y is None:
10137 return win.ConvertDialogPointToPixels(point_or_x)
10138 else:
10139 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10140
10141 def DLG_SZE(win, size_width, height=None):
10142 """
10143 Convenience function for converting a Size or (w,h) in
10144 dialog units to pixel units.
10145 """
10146 if height is None:
10147 return win.ConvertDialogSizeToPixels(size_width)
10148 else:
10149 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10150
10151
10152 def FindWindowById(*args, **kwargs):
10153 """
10154 FindWindowById(long id, Window parent=None) -> Window
10155
10156 Find the first window in the application with the given id. If parent
10157 is None, the search will start from all top-level frames and dialog
10158 boxes; if non-None, the search will be limited to the given window
10159 hierarchy. The search is recursive in both cases.
10160 """
10161 return _core_.FindWindowById(*args, **kwargs)
10162
10163 def FindWindowByName(*args, **kwargs):
10164 """
10165 FindWindowByName(String name, Window parent=None) -> Window
10166
10167 Find a window by its name (as given in a window constructor or Create
10168 function call). If parent is None, the search will start from all
10169 top-level frames and dialog boxes; if non-None, the search will be
10170 limited to the given window hierarchy. The search is recursive in both
10171 cases.
10172
10173 If no window with such name is found, wx.FindWindowByLabel is called.
10174 """
10175 return _core_.FindWindowByName(*args, **kwargs)
10176
10177 def FindWindowByLabel(*args, **kwargs):
10178 """
10179 FindWindowByLabel(String label, Window parent=None) -> Window
10180
10181 Find a window by its label. Depending on the type of window, the label
10182 may be a window title or panel item label. If parent is None, the
10183 search will start from all top-level frames and dialog boxes; if
10184 non-None, the search will be limited to the given window
10185 hierarchy. The search is recursive in both cases.
10186 """
10187 return _core_.FindWindowByLabel(*args, **kwargs)
10188
10189 def Window_FromHWND(*args, **kwargs):
10190 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10191 return _core_.Window_FromHWND(*args, **kwargs)
10192
10193 def GetTopLevelWindows(*args):
10194 """
10195 GetTopLevelWindows() -> PyObject
10196
10197 Returns a list of the the application's top-level windows, (frames,
10198 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10199 by wxWidgets, and so it is only valid as long as no top-level windows
10200 are closed or new top-level windows are created.
10201
10202 """
10203 return _core_.GetTopLevelWindows(*args)
10204 #---------------------------------------------------------------------------
10205
10206 class Validator(EvtHandler):
10207 """Proxy of C++ Validator class"""
10208 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10209 __repr__ = _swig_repr
10210 def __init__(self, *args, **kwargs):
10211 """__init__(self) -> Validator"""
10212 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10213 self._setOORInfo(self)
10214
10215 def Clone(*args, **kwargs):
10216 """Clone(self) -> Validator"""
10217 return _core_.Validator_Clone(*args, **kwargs)
10218
10219 def Validate(*args, **kwargs):
10220 """Validate(self, Window parent) -> bool"""
10221 return _core_.Validator_Validate(*args, **kwargs)
10222
10223 def TransferToWindow(*args, **kwargs):
10224 """TransferToWindow(self) -> bool"""
10225 return _core_.Validator_TransferToWindow(*args, **kwargs)
10226
10227 def TransferFromWindow(*args, **kwargs):
10228 """TransferFromWindow(self) -> bool"""
10229 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10230
10231 def GetWindow(*args, **kwargs):
10232 """GetWindow(self) -> Window"""
10233 return _core_.Validator_GetWindow(*args, **kwargs)
10234
10235 def SetWindow(*args, **kwargs):
10236 """SetWindow(self, Window window)"""
10237 return _core_.Validator_SetWindow(*args, **kwargs)
10238
10239 def IsSilent(*args, **kwargs):
10240 """IsSilent() -> bool"""
10241 return _core_.Validator_IsSilent(*args, **kwargs)
10242
10243 IsSilent = staticmethod(IsSilent)
10244 def SetBellOnError(*args, **kwargs):
10245 """SetBellOnError(int doIt=True)"""
10246 return _core_.Validator_SetBellOnError(*args, **kwargs)
10247
10248 SetBellOnError = staticmethod(SetBellOnError)
10249 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
10250 _core_.Validator_swigregister(Validator)
10251
10252 def Validator_IsSilent(*args):
10253 """Validator_IsSilent() -> bool"""
10254 return _core_.Validator_IsSilent(*args)
10255
10256 def Validator_SetBellOnError(*args, **kwargs):
10257 """Validator_SetBellOnError(int doIt=True)"""
10258 return _core_.Validator_SetBellOnError(*args, **kwargs)
10259
10260 class PyValidator(Validator):
10261 """Proxy of C++ PyValidator class"""
10262 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10263 __repr__ = _swig_repr
10264 def __init__(self, *args, **kwargs):
10265 """__init__(self) -> PyValidator"""
10266 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10267
10268 self._setCallbackInfo(self, PyValidator, 1)
10269 self._setOORInfo(self)
10270
10271 def _setCallbackInfo(*args, **kwargs):
10272 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10273 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10274
10275 _core_.PyValidator_swigregister(PyValidator)
10276
10277 #---------------------------------------------------------------------------
10278
10279 class Menu(EvtHandler):
10280 """Proxy of C++ Menu class"""
10281 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10282 __repr__ = _swig_repr
10283 def __init__(self, *args, **kwargs):
10284 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10285 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10286 self._setOORInfo(self)
10287
10288 def Append(*args, **kwargs):
10289 """
10290 Append(self, int id, String text=EmptyString, String help=EmptyString,
10291 int kind=ITEM_NORMAL) -> MenuItem
10292 """
10293 return _core_.Menu_Append(*args, **kwargs)
10294
10295 def AppendSeparator(*args, **kwargs):
10296 """AppendSeparator(self) -> MenuItem"""
10297 return _core_.Menu_AppendSeparator(*args, **kwargs)
10298
10299 def AppendCheckItem(*args, **kwargs):
10300 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10301 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10302
10303 def AppendRadioItem(*args, **kwargs):
10304 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10305 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10306
10307 def AppendMenu(*args, **kwargs):
10308 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10309 return _core_.Menu_AppendMenu(*args, **kwargs)
10310
10311 def AppendSubMenu(*args, **kwargs):
10312 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10313 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10314
10315 def AppendItem(*args, **kwargs):
10316 """AppendItem(self, MenuItem item) -> MenuItem"""
10317 return _core_.Menu_AppendItem(*args, **kwargs)
10318
10319 def InsertItem(*args, **kwargs):
10320 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10321 return _core_.Menu_InsertItem(*args, **kwargs)
10322
10323 def PrependItem(*args, **kwargs):
10324 """PrependItem(self, MenuItem item) -> MenuItem"""
10325 return _core_.Menu_PrependItem(*args, **kwargs)
10326
10327 def Break(*args, **kwargs):
10328 """Break(self)"""
10329 return _core_.Menu_Break(*args, **kwargs)
10330
10331 def Insert(*args, **kwargs):
10332 """
10333 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10334 int kind=ITEM_NORMAL) -> MenuItem
10335 """
10336 return _core_.Menu_Insert(*args, **kwargs)
10337
10338 def InsertSeparator(*args, **kwargs):
10339 """InsertSeparator(self, size_t pos) -> MenuItem"""
10340 return _core_.Menu_InsertSeparator(*args, **kwargs)
10341
10342 def InsertCheckItem(*args, **kwargs):
10343 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10344 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10345
10346 def InsertRadioItem(*args, **kwargs):
10347 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10348 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10349
10350 def InsertMenu(*args, **kwargs):
10351 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10352 return _core_.Menu_InsertMenu(*args, **kwargs)
10353
10354 def Prepend(*args, **kwargs):
10355 """
10356 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10357 int kind=ITEM_NORMAL) -> MenuItem
10358 """
10359 return _core_.Menu_Prepend(*args, **kwargs)
10360
10361 def PrependSeparator(*args, **kwargs):
10362 """PrependSeparator(self) -> MenuItem"""
10363 return _core_.Menu_PrependSeparator(*args, **kwargs)
10364
10365 def PrependCheckItem(*args, **kwargs):
10366 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10367 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10368
10369 def PrependRadioItem(*args, **kwargs):
10370 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10371 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10372
10373 def PrependMenu(*args, **kwargs):
10374 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10375 return _core_.Menu_PrependMenu(*args, **kwargs)
10376
10377 def Remove(*args, **kwargs):
10378 """Remove(self, int id) -> MenuItem"""
10379 return _core_.Menu_Remove(*args, **kwargs)
10380
10381 def RemoveItem(*args, **kwargs):
10382 """RemoveItem(self, MenuItem item) -> MenuItem"""
10383 return _core_.Menu_RemoveItem(*args, **kwargs)
10384
10385 def Delete(*args, **kwargs):
10386 """Delete(self, int id) -> bool"""
10387 return _core_.Menu_Delete(*args, **kwargs)
10388
10389 def DeleteItem(*args, **kwargs):
10390 """DeleteItem(self, MenuItem item) -> bool"""
10391 return _core_.Menu_DeleteItem(*args, **kwargs)
10392
10393 def Destroy(*args, **kwargs):
10394 """
10395 Destroy(self)
10396
10397 Deletes the C++ object this Python object is a proxy for.
10398 """
10399 val = _core_.Menu_Destroy(*args, **kwargs)
10400 args[0].thisown = 0
10401 return val
10402
10403 def DestroyId(*args, **kwargs):
10404 """
10405 DestroyId(self, int id) -> bool
10406
10407 Deletes the C++ object this Python object is a proxy for.
10408 """
10409 val = _core_.Menu_DestroyId(*args, **kwargs)
10410 args[0].thisown = 0
10411 return val
10412
10413 def DestroyItem(*args, **kwargs):
10414 """
10415 DestroyItem(self, MenuItem item) -> bool
10416
10417 Deletes the C++ object this Python object is a proxy for.
10418 """
10419 val = _core_.Menu_DestroyItem(*args, **kwargs)
10420 args[0].thisown = 0
10421 return val
10422
10423 def GetMenuItemCount(*args, **kwargs):
10424 """GetMenuItemCount(self) -> size_t"""
10425 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10426
10427 def GetMenuItems(*args, **kwargs):
10428 """GetMenuItems(self) -> PyObject"""
10429 return _core_.Menu_GetMenuItems(*args, **kwargs)
10430
10431 def FindItem(*args, **kwargs):
10432 """FindItem(self, String item) -> int"""
10433 return _core_.Menu_FindItem(*args, **kwargs)
10434
10435 def FindItemById(*args, **kwargs):
10436 """FindItemById(self, int id) -> MenuItem"""
10437 return _core_.Menu_FindItemById(*args, **kwargs)
10438
10439 def FindItemByPosition(*args, **kwargs):
10440 """FindItemByPosition(self, size_t position) -> MenuItem"""
10441 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10442
10443 def Enable(*args, **kwargs):
10444 """Enable(self, int id, bool enable)"""
10445 return _core_.Menu_Enable(*args, **kwargs)
10446
10447 def IsEnabled(*args, **kwargs):
10448 """IsEnabled(self, int id) -> bool"""
10449 return _core_.Menu_IsEnabled(*args, **kwargs)
10450
10451 def Check(*args, **kwargs):
10452 """Check(self, int id, bool check)"""
10453 return _core_.Menu_Check(*args, **kwargs)
10454
10455 def IsChecked(*args, **kwargs):
10456 """IsChecked(self, int id) -> bool"""
10457 return _core_.Menu_IsChecked(*args, **kwargs)
10458
10459 def SetLabel(*args, **kwargs):
10460 """SetLabel(self, int id, String label)"""
10461 return _core_.Menu_SetLabel(*args, **kwargs)
10462
10463 def GetLabel(*args, **kwargs):
10464 """GetLabel(self, int id) -> String"""
10465 return _core_.Menu_GetLabel(*args, **kwargs)
10466
10467 def SetHelpString(*args, **kwargs):
10468 """SetHelpString(self, int id, String helpString)"""
10469 return _core_.Menu_SetHelpString(*args, **kwargs)
10470
10471 def GetHelpString(*args, **kwargs):
10472 """GetHelpString(self, int id) -> String"""
10473 return _core_.Menu_GetHelpString(*args, **kwargs)
10474
10475 def SetTitle(*args, **kwargs):
10476 """SetTitle(self, String title)"""
10477 return _core_.Menu_SetTitle(*args, **kwargs)
10478
10479 def GetTitle(*args, **kwargs):
10480 """GetTitle(self) -> String"""
10481 return _core_.Menu_GetTitle(*args, **kwargs)
10482
10483 def SetEventHandler(*args, **kwargs):
10484 """SetEventHandler(self, EvtHandler handler)"""
10485 return _core_.Menu_SetEventHandler(*args, **kwargs)
10486
10487 def GetEventHandler(*args, **kwargs):
10488 """GetEventHandler(self) -> EvtHandler"""
10489 return _core_.Menu_GetEventHandler(*args, **kwargs)
10490
10491 def SetInvokingWindow(*args, **kwargs):
10492 """SetInvokingWindow(self, Window win)"""
10493 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10494
10495 def GetInvokingWindow(*args, **kwargs):
10496 """GetInvokingWindow(self) -> Window"""
10497 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10498
10499 def GetStyle(*args, **kwargs):
10500 """GetStyle(self) -> long"""
10501 return _core_.Menu_GetStyle(*args, **kwargs)
10502
10503 def UpdateUI(*args, **kwargs):
10504 """UpdateUI(self, EvtHandler source=None)"""
10505 return _core_.Menu_UpdateUI(*args, **kwargs)
10506
10507 def GetMenuBar(*args, **kwargs):
10508 """GetMenuBar(self) -> MenuBar"""
10509 return _core_.Menu_GetMenuBar(*args, **kwargs)
10510
10511 def Attach(*args, **kwargs):
10512 """Attach(self, wxMenuBarBase menubar)"""
10513 return _core_.Menu_Attach(*args, **kwargs)
10514
10515 def Detach(*args, **kwargs):
10516 """Detach(self)"""
10517 return _core_.Menu_Detach(*args, **kwargs)
10518
10519 def IsAttached(*args, **kwargs):
10520 """IsAttached(self) -> bool"""
10521 return _core_.Menu_IsAttached(*args, **kwargs)
10522
10523 def SetParent(*args, **kwargs):
10524 """SetParent(self, Menu parent)"""
10525 return _core_.Menu_SetParent(*args, **kwargs)
10526
10527 def GetParent(*args, **kwargs):
10528 """GetParent(self) -> Menu"""
10529 return _core_.Menu_GetParent(*args, **kwargs)
10530
10531 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10532 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10533 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10534 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10535 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10536 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10537 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10538 Style = property(GetStyle,doc="See `GetStyle`")
10539 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
10540 _core_.Menu_swigregister(Menu)
10541 DefaultValidator = cvar.DefaultValidator
10542
10543 #---------------------------------------------------------------------------
10544
10545 class MenuBar(Window):
10546 """Proxy of C++ MenuBar class"""
10547 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10548 __repr__ = _swig_repr
10549 def __init__(self, *args, **kwargs):
10550 """__init__(self, long style=0) -> MenuBar"""
10551 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10552 self._setOORInfo(self)
10553
10554 def Append(*args, **kwargs):
10555 """Append(self, Menu menu, String title) -> bool"""
10556 return _core_.MenuBar_Append(*args, **kwargs)
10557
10558 def Insert(*args, **kwargs):
10559 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10560 return _core_.MenuBar_Insert(*args, **kwargs)
10561
10562 def GetMenuCount(*args, **kwargs):
10563 """GetMenuCount(self) -> size_t"""
10564 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10565
10566 def GetMenu(*args, **kwargs):
10567 """GetMenu(self, size_t pos) -> Menu"""
10568 return _core_.MenuBar_GetMenu(*args, **kwargs)
10569
10570 def Replace(*args, **kwargs):
10571 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10572 return _core_.MenuBar_Replace(*args, **kwargs)
10573
10574 def Remove(*args, **kwargs):
10575 """Remove(self, size_t pos) -> Menu"""
10576 return _core_.MenuBar_Remove(*args, **kwargs)
10577
10578 def EnableTop(*args, **kwargs):
10579 """EnableTop(self, size_t pos, bool enable)"""
10580 return _core_.MenuBar_EnableTop(*args, **kwargs)
10581
10582 def IsEnabledTop(*args, **kwargs):
10583 """IsEnabledTop(self, size_t pos) -> bool"""
10584 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10585
10586 def SetLabelTop(*args, **kwargs):
10587 """SetLabelTop(self, size_t pos, String label)"""
10588 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10589
10590 def GetLabelTop(*args, **kwargs):
10591 """GetLabelTop(self, size_t pos) -> String"""
10592 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10593
10594 def FindMenuItem(*args, **kwargs):
10595 """FindMenuItem(self, String menu, String item) -> int"""
10596 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10597
10598 def FindItemById(*args, **kwargs):
10599 """FindItemById(self, int id) -> MenuItem"""
10600 return _core_.MenuBar_FindItemById(*args, **kwargs)
10601
10602 def FindMenu(*args, **kwargs):
10603 """FindMenu(self, String title) -> int"""
10604 return _core_.MenuBar_FindMenu(*args, **kwargs)
10605
10606 def Enable(*args, **kwargs):
10607 """Enable(self, int id, bool enable)"""
10608 return _core_.MenuBar_Enable(*args, **kwargs)
10609
10610 def Check(*args, **kwargs):
10611 """Check(self, int id, bool check)"""
10612 return _core_.MenuBar_Check(*args, **kwargs)
10613
10614 def IsChecked(*args, **kwargs):
10615 """IsChecked(self, int id) -> bool"""
10616 return _core_.MenuBar_IsChecked(*args, **kwargs)
10617
10618 def IsEnabled(*args, **kwargs):
10619 """IsEnabled(self, int id) -> bool"""
10620 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10621
10622 def SetLabel(*args, **kwargs):
10623 """SetLabel(self, int id, String label)"""
10624 return _core_.MenuBar_SetLabel(*args, **kwargs)
10625
10626 def GetLabel(*args, **kwargs):
10627 """GetLabel(self, int id) -> String"""
10628 return _core_.MenuBar_GetLabel(*args, **kwargs)
10629
10630 def SetHelpString(*args, **kwargs):
10631 """SetHelpString(self, int id, String helpString)"""
10632 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10633
10634 def GetHelpString(*args, **kwargs):
10635 """GetHelpString(self, int id) -> String"""
10636 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10637
10638 def GetFrame(*args, **kwargs):
10639 """GetFrame(self) -> wxFrame"""
10640 return _core_.MenuBar_GetFrame(*args, **kwargs)
10641
10642 def IsAttached(*args, **kwargs):
10643 """IsAttached(self) -> bool"""
10644 return _core_.MenuBar_IsAttached(*args, **kwargs)
10645
10646 def Attach(*args, **kwargs):
10647 """Attach(self, wxFrame frame)"""
10648 return _core_.MenuBar_Attach(*args, **kwargs)
10649
10650 def Detach(*args, **kwargs):
10651 """Detach(self)"""
10652 return _core_.MenuBar_Detach(*args, **kwargs)
10653
10654 def UpdateMenus(*args, **kwargs):
10655 """UpdateMenus(self)"""
10656 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10657
10658 def SetAutoWindowMenu(*args, **kwargs):
10659 """SetAutoWindowMenu(bool enable)"""
10660 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10661
10662 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10663 def GetAutoWindowMenu(*args, **kwargs):
10664 """GetAutoWindowMenu() -> bool"""
10665 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10666
10667 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10668 def GetMenus(self):
10669 """Return a list of (menu, label) items for the menus in the MenuBar. """
10670 return [(self.GetMenu(i), self.GetLabelTop(i))
10671 for i in range(self.GetMenuCount())]
10672
10673 def SetMenus(self, items):
10674 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10675 for i in range(self.GetMenuCount()-1, -1, -1):
10676 self.Remove(i)
10677 for m, l in items:
10678 self.Append(m, l)
10679
10680 Frame = property(GetFrame,doc="See `GetFrame`")
10681 Menu = property(GetMenu,doc="See `GetMenu`")
10682 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10683 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
10684 _core_.MenuBar_swigregister(MenuBar)
10685
10686 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10687 """MenuBar_SetAutoWindowMenu(bool enable)"""
10688 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10689
10690 def MenuBar_GetAutoWindowMenu(*args):
10691 """MenuBar_GetAutoWindowMenu() -> bool"""
10692 return _core_.MenuBar_GetAutoWindowMenu(*args)
10693
10694 #---------------------------------------------------------------------------
10695
10696 class MenuItem(Object):
10697 """Proxy of C++ MenuItem class"""
10698 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10699 __repr__ = _swig_repr
10700 def __init__(self, *args, **kwargs):
10701 """
10702 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10703 String help=EmptyString, int kind=ITEM_NORMAL,
10704 Menu subMenu=None) -> MenuItem
10705 """
10706 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10707 __swig_destroy__ = _core_.delete_MenuItem
10708 __del__ = lambda self : None;
10709 def GetMenu(*args, **kwargs):
10710 """GetMenu(self) -> Menu"""
10711 return _core_.MenuItem_GetMenu(*args, **kwargs)
10712
10713 def SetMenu(*args, **kwargs):
10714 """SetMenu(self, Menu menu)"""
10715 return _core_.MenuItem_SetMenu(*args, **kwargs)
10716
10717 def SetId(*args, **kwargs):
10718 """SetId(self, int id)"""
10719 return _core_.MenuItem_SetId(*args, **kwargs)
10720
10721 def GetId(*args, **kwargs):
10722 """GetId(self) -> int"""
10723 return _core_.MenuItem_GetId(*args, **kwargs)
10724
10725 def IsSeparator(*args, **kwargs):
10726 """IsSeparator(self) -> bool"""
10727 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10728
10729 def SetText(*args, **kwargs):
10730 """SetText(self, String str)"""
10731 return _core_.MenuItem_SetText(*args, **kwargs)
10732
10733 def GetLabel(*args, **kwargs):
10734 """GetLabel(self) -> String"""
10735 return _core_.MenuItem_GetLabel(*args, **kwargs)
10736
10737 def GetText(*args, **kwargs):
10738 """GetText(self) -> String"""
10739 return _core_.MenuItem_GetText(*args, **kwargs)
10740
10741 def GetLabelFromText(*args, **kwargs):
10742 """GetLabelFromText(String text) -> String"""
10743 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10744
10745 GetLabelFromText = staticmethod(GetLabelFromText)
10746 def GetKind(*args, **kwargs):
10747 """GetKind(self) -> int"""
10748 return _core_.MenuItem_GetKind(*args, **kwargs)
10749
10750 def SetKind(*args, **kwargs):
10751 """SetKind(self, int kind)"""
10752 return _core_.MenuItem_SetKind(*args, **kwargs)
10753
10754 def SetCheckable(*args, **kwargs):
10755 """SetCheckable(self, bool checkable)"""
10756 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10757
10758 def IsCheckable(*args, **kwargs):
10759 """IsCheckable(self) -> bool"""
10760 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10761
10762 def IsSubMenu(*args, **kwargs):
10763 """IsSubMenu(self) -> bool"""
10764 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10765
10766 def SetSubMenu(*args, **kwargs):
10767 """SetSubMenu(self, Menu menu)"""
10768 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10769
10770 def GetSubMenu(*args, **kwargs):
10771 """GetSubMenu(self) -> Menu"""
10772 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10773
10774 def Enable(*args, **kwargs):
10775 """Enable(self, bool enable=True)"""
10776 return _core_.MenuItem_Enable(*args, **kwargs)
10777
10778 def IsEnabled(*args, **kwargs):
10779 """IsEnabled(self) -> bool"""
10780 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10781
10782 def Check(*args, **kwargs):
10783 """Check(self, bool check=True)"""
10784 return _core_.MenuItem_Check(*args, **kwargs)
10785
10786 def IsChecked(*args, **kwargs):
10787 """IsChecked(self) -> bool"""
10788 return _core_.MenuItem_IsChecked(*args, **kwargs)
10789
10790 def Toggle(*args, **kwargs):
10791 """Toggle(self)"""
10792 return _core_.MenuItem_Toggle(*args, **kwargs)
10793
10794 def SetHelp(*args, **kwargs):
10795 """SetHelp(self, String str)"""
10796 return _core_.MenuItem_SetHelp(*args, **kwargs)
10797
10798 def GetHelp(*args, **kwargs):
10799 """GetHelp(self) -> String"""
10800 return _core_.MenuItem_GetHelp(*args, **kwargs)
10801
10802 def GetAccel(*args, **kwargs):
10803 """GetAccel(self) -> AcceleratorEntry"""
10804 return _core_.MenuItem_GetAccel(*args, **kwargs)
10805
10806 def SetAccel(*args, **kwargs):
10807 """SetAccel(self, AcceleratorEntry accel)"""
10808 return _core_.MenuItem_SetAccel(*args, **kwargs)
10809
10810 def SetBitmap(*args, **kwargs):
10811 """SetBitmap(self, Bitmap bitmap)"""
10812 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10813
10814 def GetBitmap(*args, **kwargs):
10815 """GetBitmap(self) -> Bitmap"""
10816 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10817
10818 def SetFont(*args, **kwargs):
10819 """SetFont(self, Font font)"""
10820 return _core_.MenuItem_SetFont(*args, **kwargs)
10821
10822 def GetFont(*args, **kwargs):
10823 """GetFont(self) -> Font"""
10824 return _core_.MenuItem_GetFont(*args, **kwargs)
10825
10826 def SetTextColour(*args, **kwargs):
10827 """SetTextColour(self, Colour colText)"""
10828 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10829
10830 def GetTextColour(*args, **kwargs):
10831 """GetTextColour(self) -> Colour"""
10832 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10833
10834 def SetBackgroundColour(*args, **kwargs):
10835 """SetBackgroundColour(self, Colour colBack)"""
10836 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10837
10838 def GetBackgroundColour(*args, **kwargs):
10839 """GetBackgroundColour(self) -> Colour"""
10840 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10841
10842 def SetBitmaps(*args, **kwargs):
10843 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10844 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10845
10846 def SetDisabledBitmap(*args, **kwargs):
10847 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10848 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10849
10850 def GetDisabledBitmap(*args, **kwargs):
10851 """GetDisabledBitmap(self) -> Bitmap"""
10852 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10853
10854 def SetMarginWidth(*args, **kwargs):
10855 """SetMarginWidth(self, int nWidth)"""
10856 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10857
10858 def GetMarginWidth(*args, **kwargs):
10859 """GetMarginWidth(self) -> int"""
10860 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10861
10862 def GetDefaultMarginWidth(*args, **kwargs):
10863 """GetDefaultMarginWidth() -> int"""
10864 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10865
10866 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10867 def IsOwnerDrawn(*args, **kwargs):
10868 """IsOwnerDrawn(self) -> bool"""
10869 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10870
10871 def SetOwnerDrawn(*args, **kwargs):
10872 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10873 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10874
10875 def ResetOwnerDrawn(*args, **kwargs):
10876 """ResetOwnerDrawn(self)"""
10877 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10878
10879 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10880 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10881 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10882 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10883 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10884 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10885 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10886 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10887 Label = property(GetLabel,doc="See `GetLabel`")
10888 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10889 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10890 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10891 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10892 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
10893 _core_.MenuItem_swigregister(MenuItem)
10894
10895 def MenuItem_GetLabelFromText(*args, **kwargs):
10896 """MenuItem_GetLabelFromText(String text) -> String"""
10897 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10898
10899 def MenuItem_GetDefaultMarginWidth(*args):
10900 """MenuItem_GetDefaultMarginWidth() -> int"""
10901 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10902
10903 #---------------------------------------------------------------------------
10904
10905 class Control(Window):
10906 """
10907 This is the base class for a control or 'widget'.
10908
10909 A control is generally a small window which processes user input
10910 and/or displays one or more item of data.
10911 """
10912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10913 __repr__ = _swig_repr
10914 def __init__(self, *args, **kwargs):
10915 """
10916 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10917 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10918 String name=ControlNameStr) -> Control
10919
10920 Create a Control. Normally you should only call this from a subclass'
10921 __init__ as a plain old wx.Control is not very useful.
10922 """
10923 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10924 self._setOORInfo(self)
10925
10926 def Create(*args, **kwargs):
10927 """
10928 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10929 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10930 String name=ControlNameStr) -> bool
10931
10932 Do the 2nd phase and create the GUI control.
10933 """
10934 return _core_.Control_Create(*args, **kwargs)
10935
10936 def GetAlignment(*args, **kwargs):
10937 """
10938 GetAlignment(self) -> int
10939
10940 Get the control alignment (left/right/centre, top/bottom/centre)
10941 """
10942 return _core_.Control_GetAlignment(*args, **kwargs)
10943
10944 def GetLabelText(*args, **kwargs):
10945 """
10946 GetLabelText(self) -> String
10947
10948 Get just the text of the label, without mnemonic characters ('&')
10949 """
10950 return _core_.Control_GetLabelText(*args, **kwargs)
10951
10952 def Command(*args, **kwargs):
10953 """
10954 Command(self, CommandEvent event)
10955
10956 Simulates the effect of the user issuing a command to the item.
10957
10958 :see: `wx.CommandEvent`
10959
10960 """
10961 return _core_.Control_Command(*args, **kwargs)
10962
10963 def GetLabel(*args, **kwargs):
10964 """
10965 GetLabel(self) -> String
10966
10967 Return a control's text.
10968 """
10969 return _core_.Control_GetLabel(*args, **kwargs)
10970
10971 def GetClassDefaultAttributes(*args, **kwargs):
10972 """
10973 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10974
10975 Get the default attributes for this class. This is useful if you want
10976 to use the same font or colour in your own control as in a standard
10977 control -- which is a much better idea than hard coding specific
10978 colours or fonts which might look completely out of place on the
10979 user's system, especially if it uses themes.
10980
10981 The variant parameter is only relevant under Mac currently and is
10982 ignore under other platforms. Under Mac, it will change the size of
10983 the returned font. See `wx.Window.SetWindowVariant` for more about
10984 this.
10985 """
10986 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10987
10988 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10989 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10990 Label = property(GetLabel,doc="See `GetLabel`")
10991 LabelText = property(GetLabelText,doc="See `GetLabelText`")
10992 _core_.Control_swigregister(Control)
10993 ControlNameStr = cvar.ControlNameStr
10994
10995 def PreControl(*args, **kwargs):
10996 """
10997 PreControl() -> Control
10998
10999 Precreate a Control control for 2-phase creation
11000 """
11001 val = _core_.new_PreControl(*args, **kwargs)
11002 return val
11003
11004 def Control_GetClassDefaultAttributes(*args, **kwargs):
11005 """
11006 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11007
11008 Get the default attributes for this class. This is useful if you want
11009 to use the same font or colour in your own control as in a standard
11010 control -- which is a much better idea than hard coding specific
11011 colours or fonts which might look completely out of place on the
11012 user's system, especially if it uses themes.
11013
11014 The variant parameter is only relevant under Mac currently and is
11015 ignore under other platforms. Under Mac, it will change the size of
11016 the returned font. See `wx.Window.SetWindowVariant` for more about
11017 this.
11018 """
11019 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11020
11021 #---------------------------------------------------------------------------
11022
11023 class ItemContainer(object):
11024 """
11025 The wx.ItemContainer class defines an interface which is implemented
11026 by all controls which have string subitems, each of which may be
11027 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11028 as `wx.ComboBox` which implements an extended interface deriving from
11029 this one.
11030
11031 It defines the methods for accessing the control's items and although
11032 each of the derived classes implements them differently, they still
11033 all conform to the same interface.
11034
11035 The items in a wx.ItemContainer have (non empty) string labels and,
11036 optionally, client data associated with them.
11037
11038 """
11039 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11040 def __init__(self): raise AttributeError, "No constructor defined"
11041 __repr__ = _swig_repr
11042 def Append(*args, **kwargs):
11043 """
11044 Append(self, String item, PyObject clientData=None) -> int
11045
11046 Adds the item to the control, associating the given data with the item
11047 if not None. The return value is the index of the newly added item
11048 which may be different from the last one if the control is sorted (e.g.
11049 has wx.LB_SORT or wx.CB_SORT style).
11050 """
11051 return _core_.ItemContainer_Append(*args, **kwargs)
11052
11053 def AppendItems(*args, **kwargs):
11054 """
11055 AppendItems(self, List strings)
11056
11057 Apend several items at once to the control. Notice that calling this
11058 method may be much faster than appending the items one by one if you
11059 need to add a lot of items.
11060 """
11061 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11062
11063 def Insert(*args, **kwargs):
11064 """
11065 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
11066
11067 Insert an item into the control before the item at the ``pos`` index,
11068 optionally associating some data object with the item.
11069 """
11070 return _core_.ItemContainer_Insert(*args, **kwargs)
11071
11072 def Clear(*args, **kwargs):
11073 """
11074 Clear(self)
11075
11076 Removes all items from the control.
11077 """
11078 return _core_.ItemContainer_Clear(*args, **kwargs)
11079
11080 def Delete(*args, **kwargs):
11081 """
11082 Delete(self, unsigned int n)
11083
11084 Deletes the item at the zero-based index 'n' from the control. Note
11085 that it is an error (signalled by a `wx.PyAssertionError` exception if
11086 enabled) to remove an item with the index negative or greater or equal
11087 than the number of items in the control.
11088 """
11089 return _core_.ItemContainer_Delete(*args, **kwargs)
11090
11091 def GetClientData(*args, **kwargs):
11092 """
11093 GetClientData(self, unsigned int n) -> PyObject
11094
11095 Returns the client data associated with the given item, (if any.)
11096 """
11097 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11098
11099 def SetClientData(*args, **kwargs):
11100 """
11101 SetClientData(self, unsigned int n, PyObject clientData)
11102
11103 Associate the given client data with the item at position n.
11104 """
11105 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11106
11107 def GetCount(*args, **kwargs):
11108 """
11109 GetCount(self) -> unsigned int
11110
11111 Returns the number of items in the control.
11112 """
11113 return _core_.ItemContainer_GetCount(*args, **kwargs)
11114
11115 def IsEmpty(*args, **kwargs):
11116 """
11117 IsEmpty(self) -> bool
11118
11119 Returns True if the control is empty or False if it has some items.
11120 """
11121 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11122
11123 def GetString(*args, **kwargs):
11124 """
11125 GetString(self, unsigned int n) -> String
11126
11127 Returns the label of the item with the given index.
11128 """
11129 return _core_.ItemContainer_GetString(*args, **kwargs)
11130
11131 def GetStrings(*args, **kwargs):
11132 """GetStrings(self) -> wxArrayString"""
11133 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11134
11135 def SetString(*args, **kwargs):
11136 """
11137 SetString(self, unsigned int n, String s)
11138
11139 Sets the label for the given item.
11140 """
11141 return _core_.ItemContainer_SetString(*args, **kwargs)
11142
11143 def FindString(*args, **kwargs):
11144 """
11145 FindString(self, String s) -> int
11146
11147 Finds an item whose label matches the given string. Returns the
11148 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11149 found.
11150 """
11151 return _core_.ItemContainer_FindString(*args, **kwargs)
11152
11153 def SetSelection(*args, **kwargs):
11154 """
11155 SetSelection(self, int n)
11156
11157 Sets the item at index 'n' to be the selected item.
11158 """
11159 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11160
11161 def GetSelection(*args, **kwargs):
11162 """
11163 GetSelection(self) -> int
11164
11165 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11166 is selected.
11167 """
11168 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11169
11170 def SetStringSelection(*args, **kwargs):
11171 """SetStringSelection(self, String s) -> bool"""
11172 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11173
11174 def GetStringSelection(*args, **kwargs):
11175 """
11176 GetStringSelection(self) -> String
11177
11178 Returns the label of the selected item or an empty string if no item
11179 is selected.
11180 """
11181 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11182
11183 def Select(*args, **kwargs):
11184 """
11185 Select(self, int n)
11186
11187 This is the same as `SetSelection` and exists only because it is
11188 slightly more natural for controls which support multiple selection.
11189 """
11190 return _core_.ItemContainer_Select(*args, **kwargs)
11191
11192 def GetItems(self):
11193 """Return a list of the strings in the control"""
11194 return [self.GetString(i) for i in xrange(self.GetCount())]
11195
11196 def SetItems(self, items):
11197 """Clear and set the strings in the control from a list"""
11198 self.Clear()
11199 for i in items:
11200 self.Append(i)
11201
11202 Count = property(GetCount,doc="See `GetCount`")
11203 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11204 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11205 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11206 Strings = property(GetStrings,doc="See `GetStrings`")
11207 _core_.ItemContainer_swigregister(ItemContainer)
11208
11209 #---------------------------------------------------------------------------
11210
11211 class ControlWithItems(Control,ItemContainer):
11212 """
11213 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11214 wx.Control class, and is used for the base class of various controls
11215 that have items.
11216 """
11217 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11218 def __init__(self): raise AttributeError, "No constructor defined"
11219 __repr__ = _swig_repr
11220 _core_.ControlWithItems_swigregister(ControlWithItems)
11221
11222 #---------------------------------------------------------------------------
11223
11224 class SizerItem(Object):
11225 """
11226 The wx.SizerItem class is used to track the position, size and other
11227 attributes of each item managed by a `wx.Sizer`. It is not usually
11228 necessary to use this class because the sizer elements can also be
11229 identified by their positions or window or sizer references but
11230 sometimes it may be more convenient to use wx.SizerItem directly.
11231 Also, custom classes derived from `wx.PySizer` will probably need to
11232 use the collection of wx.SizerItems held by wx.Sizer when calculating
11233 layout.
11234
11235 :see: `wx.Sizer`, `wx.GBSizerItem`
11236 """
11237 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11238 __repr__ = _swig_repr
11239 def __init__(self, *args, **kwargs):
11240 """
11241 __init__(self) -> SizerItem
11242
11243 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11244 size will need to be set before this item can be used in a Sizer.
11245
11246 You will probably never need to create a wx.SizerItem directly as they
11247 are created automatically when the sizer's Add, Insert or Prepend
11248 methods are called.
11249
11250 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11251 """
11252 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11253 __swig_destroy__ = _core_.delete_SizerItem
11254 __del__ = lambda self : None;
11255 def DeleteWindows(*args, **kwargs):
11256 """
11257 DeleteWindows(self)
11258
11259 Destroy the window or the windows in a subsizer, depending on the type
11260 of item.
11261 """
11262 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11263
11264 def DetachSizer(*args, **kwargs):
11265 """
11266 DetachSizer(self)
11267
11268 Enable deleting the SizerItem without destroying the contained sizer.
11269 """
11270 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11271
11272 def GetSize(*args, **kwargs):
11273 """
11274 GetSize(self) -> Size
11275
11276 Get the current size of the item, as set in the last Layout.
11277 """
11278 return _core_.SizerItem_GetSize(*args, **kwargs)
11279
11280 def CalcMin(*args, **kwargs):
11281 """
11282 CalcMin(self) -> Size
11283
11284 Calculates the minimum desired size for the item, including any space
11285 needed by borders.
11286 """
11287 return _core_.SizerItem_CalcMin(*args, **kwargs)
11288
11289 def SetDimension(*args, **kwargs):
11290 """
11291 SetDimension(self, Point pos, Size size)
11292
11293 Set the position and size of the space allocated for this item by the
11294 sizer, and adjust the position and size of the item (window or
11295 subsizer) to be within that space taking alignment and borders into
11296 account.
11297 """
11298 return _core_.SizerItem_SetDimension(*args, **kwargs)
11299
11300 def GetMinSize(*args, **kwargs):
11301 """
11302 GetMinSize(self) -> Size
11303
11304 Get the minimum size needed for the item.
11305 """
11306 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11307
11308 def GetMinSizeWithBorder(*args, **kwargs):
11309 """
11310 GetMinSizeWithBorder(self) -> Size
11311
11312 Get the minimum size needed for the item with space for the borders
11313 added, if needed.
11314 """
11315 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11316
11317 def SetInitSize(*args, **kwargs):
11318 """SetInitSize(self, int x, int y)"""
11319 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11320
11321 def SetRatioWH(*args, **kwargs):
11322 """
11323 SetRatioWH(self, int width, int height)
11324
11325 Set the ratio item attribute.
11326 """
11327 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11328
11329 def SetRatioSize(*args, **kwargs):
11330 """
11331 SetRatioSize(self, Size size)
11332
11333 Set the ratio item attribute.
11334 """
11335 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11336
11337 def SetRatio(*args, **kwargs):
11338 """
11339 SetRatio(self, float ratio)
11340
11341 Set the ratio item attribute.
11342 """
11343 return _core_.SizerItem_SetRatio(*args, **kwargs)
11344
11345 def GetRatio(*args, **kwargs):
11346 """
11347 GetRatio(self) -> float
11348
11349 Set the ratio item attribute.
11350 """
11351 return _core_.SizerItem_GetRatio(*args, **kwargs)
11352
11353 def GetRect(*args, **kwargs):
11354 """
11355 GetRect(self) -> Rect
11356
11357 Returns the rectangle that the sizer item should occupy
11358 """
11359 return _core_.SizerItem_GetRect(*args, **kwargs)
11360
11361 def IsWindow(*args, **kwargs):
11362 """
11363 IsWindow(self) -> bool
11364
11365 Is this sizer item a window?
11366 """
11367 return _core_.SizerItem_IsWindow(*args, **kwargs)
11368
11369 def IsSizer(*args, **kwargs):
11370 """
11371 IsSizer(self) -> bool
11372
11373 Is this sizer item a subsizer?
11374 """
11375 return _core_.SizerItem_IsSizer(*args, **kwargs)
11376
11377 def IsSpacer(*args, **kwargs):
11378 """
11379 IsSpacer(self) -> bool
11380
11381 Is this sizer item a spacer?
11382 """
11383 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11384
11385 def SetProportion(*args, **kwargs):
11386 """
11387 SetProportion(self, int proportion)
11388
11389 Set the proportion value for this item.
11390 """
11391 return _core_.SizerItem_SetProportion(*args, **kwargs)
11392
11393 def GetProportion(*args, **kwargs):
11394 """
11395 GetProportion(self) -> int
11396
11397 Get the proportion value for this item.
11398 """
11399 return _core_.SizerItem_GetProportion(*args, **kwargs)
11400
11401 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11402 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11403 def SetFlag(*args, **kwargs):
11404 """
11405 SetFlag(self, int flag)
11406
11407 Set the flag value for this item.
11408 """
11409 return _core_.SizerItem_SetFlag(*args, **kwargs)
11410
11411 def GetFlag(*args, **kwargs):
11412 """
11413 GetFlag(self) -> int
11414
11415 Get the flag value for this item.
11416 """
11417 return _core_.SizerItem_GetFlag(*args, **kwargs)
11418
11419 def SetBorder(*args, **kwargs):
11420 """
11421 SetBorder(self, int border)
11422
11423 Set the border value for this item.
11424 """
11425 return _core_.SizerItem_SetBorder(*args, **kwargs)
11426
11427 def GetBorder(*args, **kwargs):
11428 """
11429 GetBorder(self) -> int
11430
11431 Get the border value for this item.
11432 """
11433 return _core_.SizerItem_GetBorder(*args, **kwargs)
11434
11435 def GetWindow(*args, **kwargs):
11436 """
11437 GetWindow(self) -> Window
11438
11439 Get the window (if any) that is managed by this sizer item.
11440 """
11441 return _core_.SizerItem_GetWindow(*args, **kwargs)
11442
11443 def SetWindow(*args, **kwargs):
11444 """
11445 SetWindow(self, Window window)
11446
11447 Set the window to be managed by this sizer item.
11448 """
11449 return _core_.SizerItem_SetWindow(*args, **kwargs)
11450
11451 def GetSizer(*args, **kwargs):
11452 """
11453 GetSizer(self) -> Sizer
11454
11455 Get the subsizer (if any) that is managed by this sizer item.
11456 """
11457 return _core_.SizerItem_GetSizer(*args, **kwargs)
11458
11459 def SetSizer(*args, **kwargs):
11460 """
11461 SetSizer(self, Sizer sizer)
11462
11463 Set the subsizer to be managed by this sizer item.
11464 """
11465 return _core_.SizerItem_SetSizer(*args, **kwargs)
11466
11467 def GetSpacer(*args, **kwargs):
11468 """
11469 GetSpacer(self) -> Size
11470
11471 Get the size of the spacer managed by this sizer item.
11472 """
11473 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11474
11475 def SetSpacer(*args, **kwargs):
11476 """
11477 SetSpacer(self, Size size)
11478
11479 Set the size of the spacer to be managed by this sizer item.
11480 """
11481 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11482
11483 def Show(*args, **kwargs):
11484 """
11485 Show(self, bool show)
11486
11487 Set the show item attribute, which sizers use to determine if the item
11488 is to be made part of the layout or not. If the item is tracking a
11489 window then it is shown or hidden as needed.
11490 """
11491 return _core_.SizerItem_Show(*args, **kwargs)
11492
11493 def IsShown(*args, **kwargs):
11494 """
11495 IsShown(self) -> bool
11496
11497 Is the item to be shown in the layout?
11498 """
11499 return _core_.SizerItem_IsShown(*args, **kwargs)
11500
11501 def GetPosition(*args, **kwargs):
11502 """
11503 GetPosition(self) -> Point
11504
11505 Returns the current position of the item, as set in the last Layout.
11506 """
11507 return _core_.SizerItem_GetPosition(*args, **kwargs)
11508
11509 def GetUserData(*args, **kwargs):
11510 """
11511 GetUserData(self) -> PyObject
11512
11513 Returns the userData associated with this sizer item, or None if there
11514 isn't any.
11515 """
11516 return _core_.SizerItem_GetUserData(*args, **kwargs)
11517
11518 def SetUserData(*args, **kwargs):
11519 """
11520 SetUserData(self, PyObject userData)
11521
11522 Associate a Python object with this sizer item.
11523 """
11524 return _core_.SizerItem_SetUserData(*args, **kwargs)
11525
11526 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11527 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11528 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11529 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11530 Position = property(GetPosition,doc="See `GetPosition`")
11531 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11532 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11533 Rect = property(GetRect,doc="See `GetRect`")
11534 Size = property(GetSize,doc="See `GetSize`")
11535 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11536 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11537 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11538 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
11539 _core_.SizerItem_swigregister(SizerItem)
11540
11541 def SizerItemWindow(*args, **kwargs):
11542 """
11543 SizerItemWindow(Window window, int proportion, int flag, int border,
11544 PyObject userData=None) -> SizerItem
11545
11546 Constructs a `wx.SizerItem` for tracking a window.
11547 """
11548 val = _core_.new_SizerItemWindow(*args, **kwargs)
11549 return val
11550
11551 def SizerItemSpacer(*args, **kwargs):
11552 """
11553 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11554 PyObject userData=None) -> SizerItem
11555
11556 Constructs a `wx.SizerItem` for tracking a spacer.
11557 """
11558 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11559 return val
11560
11561 def SizerItemSizer(*args, **kwargs):
11562 """
11563 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11564 PyObject userData=None) -> SizerItem
11565
11566 Constructs a `wx.SizerItem` for tracking a subsizer
11567 """
11568 val = _core_.new_SizerItemSizer(*args, **kwargs)
11569 return val
11570
11571 class Sizer(Object):
11572 """
11573 wx.Sizer is the abstract base class used for laying out subwindows in
11574 a window. You cannot use wx.Sizer directly; instead, you will have to
11575 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11576 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11577 `wx.GridBagSizer`.
11578
11579 The concept implemented by sizers in wxWidgets is closely related to
11580 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11581 toolkit or the Qt toolkit. It is based upon the idea of the individual
11582 subwindows reporting their minimal required size and their ability to
11583 get stretched if the size of the parent window has changed. This will
11584 most often mean that the programmer does not set the original size of
11585 a dialog in the beginning, rather the dialog will assigned a sizer and
11586 this sizer will be queried about the recommended size. The sizer in
11587 turn will query its children, which can be normal windows or contorls,
11588 empty space or other sizers, so that a hierarchy of sizers can be
11589 constructed. Note that wxSizer does not derive from wxWindow and thus
11590 do not interfere with tab ordering and requires very little resources
11591 compared to a real window on screen.
11592
11593 What makes sizers so well fitted for use in wxWidgets is the fact that
11594 every control reports its own minimal size and the algorithm can
11595 handle differences in font sizes or different window (dialog item)
11596 sizes on different platforms without problems. If for example the
11597 standard font as well as the overall design of Mac widgets requires
11598 more space than on Windows, then the initial size of a dialog using a
11599 sizer will automatically be bigger on Mac than on Windows.
11600 """
11601 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11602 def __init__(self): raise AttributeError, "No constructor defined"
11603 __repr__ = _swig_repr
11604 __swig_destroy__ = _core_.delete_Sizer
11605 __del__ = lambda self : None;
11606 def _setOORInfo(*args, **kwargs):
11607 """_setOORInfo(self, PyObject _self)"""
11608 return _core_.Sizer__setOORInfo(*args, **kwargs)
11609
11610 def Add(*args, **kwargs):
11611 """
11612 Add(self, item, int proportion=0, int flag=0, int border=0,
11613 PyObject userData=None) -> wx.SizerItem
11614
11615 Appends a child item to the sizer.
11616 """
11617 return _core_.Sizer_Add(*args, **kwargs)
11618
11619 def Insert(*args, **kwargs):
11620 """
11621 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11622 PyObject userData=None) -> wx.SizerItem
11623
11624 Inserts a new item into the list of items managed by this sizer before
11625 the item at index *before*. See `Add` for a description of the parameters.
11626 """
11627 return _core_.Sizer_Insert(*args, **kwargs)
11628
11629 def Prepend(*args, **kwargs):
11630 """
11631 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11632 PyObject userData=None) -> wx.SizerItem
11633
11634 Adds a new item to the begining of the list of sizer items managed by
11635 this sizer. See `Add` for a description of the parameters.
11636 """
11637 return _core_.Sizer_Prepend(*args, **kwargs)
11638
11639 def Remove(*args, **kwargs):
11640 """
11641 Remove(self, item) -> bool
11642
11643 Removes an item from the sizer and destroys it. This method does not
11644 cause any layout or resizing to take place, call `Layout` to update
11645 the layout on screen after removing a child from the sizer. The
11646 *item* parameter can be either a window, a sizer, or the zero-based
11647 index of an item to remove. Returns True if the child item was found
11648 and removed.
11649 """
11650 return _core_.Sizer_Remove(*args, **kwargs)
11651
11652 def Detach(*args, **kwargs):
11653 """
11654 Detach(self, item) -> bool
11655
11656 Detaches an item from the sizer without destroying it. This method
11657 does not cause any layout or resizing to take place, call `Layout` to
11658 do so. The *item* parameter can be either a window, a sizer, or the
11659 zero-based index of the item to be detached. Returns True if the child item
11660 was found and detached.
11661 """
11662 return _core_.Sizer_Detach(*args, **kwargs)
11663
11664 def GetItem(*args, **kwargs):
11665 """
11666 GetItem(self, item) -> wx.SizerItem
11667
11668 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11669 parameter can be either a window, a sizer, or the zero-based index of
11670 the item to be found.
11671 """
11672 return _core_.Sizer_GetItem(*args, **kwargs)
11673
11674 def _SetItemMinSize(*args, **kwargs):
11675 """_SetItemMinSize(self, PyObject item, Size size)"""
11676 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11677
11678 def _ReplaceWin(*args, **kwargs):
11679 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11680 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11681
11682 def _ReplaceSizer(*args, **kwargs):
11683 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11684 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11685
11686 def _ReplaceItem(*args, **kwargs):
11687 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11688 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11689
11690 def Replace(self, olditem, item, recursive=False):
11691 """
11692 Detaches the given ``olditem`` from the sizer and replaces it with
11693 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11694 detached child is destroyed only if it is not a window, (because
11695 windows are owned by their parent, not the sizer.) The
11696 ``recursive`` parameter can be used to search for the given
11697 element recursivly in subsizers.
11698
11699 This method does not cause any layout or resizing to take place,
11700 call `Layout` to do so.
11701
11702 Returns ``True`` if the child item was found and removed.
11703 """
11704 if isinstance(olditem, wx.Window):
11705 return self._ReplaceWin(olditem, item, recursive)
11706 elif isinstnace(olditem, wx.Sizer):
11707 return self._ReplaceSizer(olditem, item, recursive)
11708 elif isinstnace(olditem, int):
11709 return self._ReplaceItem(olditem, item)
11710 else:
11711 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11712
11713 def SetContainingWindow(*args, **kwargs):
11714 """
11715 SetContainingWindow(self, Window window)
11716
11717 Set (or unset) the window this sizer is used in.
11718 """
11719 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11720
11721 def GetContainingWindow(*args, **kwargs):
11722 """
11723 GetContainingWindow(self) -> Window
11724
11725 Get the window this sizer is used in.
11726 """
11727 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11728
11729 def SetItemMinSize(self, item, *args):
11730 """
11731 SetItemMinSize(self, item, Size size)
11732
11733 Sets the minimum size that will be allocated for an item in the sizer.
11734 The *item* parameter can be either a window, a sizer, or the
11735 zero-based index of the item. If a window or sizer is given then it
11736 will be searched for recursivly in subsizers if neccessary.
11737 """
11738 if len(args) == 2:
11739 # for backward compatibility accept separate width,height args too
11740 return self._SetItemMinSize(item, args)
11741 else:
11742 return self._SetItemMinSize(item, args[0])
11743
11744 def AddItem(*args, **kwargs):
11745 """
11746 AddItem(self, SizerItem item)
11747
11748 Adds a `wx.SizerItem` to the sizer.
11749 """
11750 return _core_.Sizer_AddItem(*args, **kwargs)
11751
11752 def InsertItem(*args, **kwargs):
11753 """
11754 InsertItem(self, int index, SizerItem item)
11755
11756 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11757 """
11758 return _core_.Sizer_InsertItem(*args, **kwargs)
11759
11760 def PrependItem(*args, **kwargs):
11761 """
11762 PrependItem(self, SizerItem item)
11763
11764 Prepends a `wx.SizerItem` to the sizer.
11765 """
11766 return _core_.Sizer_PrependItem(*args, **kwargs)
11767
11768 def AddMany(self, items):
11769 """
11770 AddMany is a convenience method for adding several items
11771 to a sizer at one time. Simply pass it a list of tuples,
11772 where each tuple consists of the parameters that you
11773 would normally pass to the `Add` method.
11774 """
11775 for item in items:
11776 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11777 item = (item, )
11778 self.Add(*item)
11779
11780 def AddSpacer(self, *args, **kw):
11781 """AddSpacer(int size) --> SizerItem
11782
11783 Add a spacer that is (size,size) pixels.
11784 """
11785 if args and type(args[0]) == int:
11786 return self.Add( (args[0],args[0] ), 0)
11787 else: # otherwise stay compatible with old AddSpacer
11788 return self.Add(*args, **kw)
11789 def PrependSpacer(self, *args, **kw):
11790 """PrependSpacer(int size) --> SizerItem
11791
11792 Prepend a spacer that is (size, size) pixels."""
11793 if args and type(args[0]) == int:
11794 return self.Prepend( (args[0],args[0] ), 0)
11795 else: # otherwise stay compatible with old PrependSpacer
11796 return self.Prepend(*args, **kw)
11797 def InsertSpacer(self, index, *args, **kw):
11798 """InsertSpacer(int index, int size) --> SizerItem
11799
11800 Insert a spacer at position index that is (size, size) pixels."""
11801 if args and type(args[0]) == int:
11802 return self.Insert( index, (args[0],args[0] ), 0)
11803 else: # otherwise stay compatible with old InsertSpacer
11804 return self.Insert(index, *args, **kw)
11805
11806
11807 def AddStretchSpacer(self, prop=1):
11808 """AddStretchSpacer(int prop=1) --> SizerItem
11809
11810 Add a stretchable spacer."""
11811 return self.Add((0,0), prop)
11812 def PrependStretchSpacer(self, prop=1):
11813 """PrependStretchSpacer(int prop=1) --> SizerItem
11814
11815 Prepend a stretchable spacer."""
11816 return self.Prepend((0,0), prop)
11817 def InsertStretchSpacer(self, index, prop=1):
11818 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11819
11820 Insert a stretchable spacer."""
11821 return self.Insert(index, (0,0), prop)
11822
11823
11824 # for backwards compatibility only, please do not use in new code
11825 def AddWindow(self, *args, **kw):
11826 """Compatibility alias for `Add`."""
11827 return self.Add(*args, **kw)
11828 def AddSizer(self, *args, **kw):
11829 """Compatibility alias for `Add`."""
11830 return self.Add(*args, **kw)
11831
11832 def PrependWindow(self, *args, **kw):
11833 """Compatibility alias for `Prepend`."""
11834 return self.Prepend(*args, **kw)
11835 def PrependSizer(self, *args, **kw):
11836 """Compatibility alias for `Prepend`."""
11837 return self.Prepend(*args, **kw)
11838
11839 def InsertWindow(self, *args, **kw):
11840 """Compatibility alias for `Insert`."""
11841 return self.Insert(*args, **kw)
11842 def InsertSizer(self, *args, **kw):
11843 """Compatibility alias for `Insert`."""
11844 return self.Insert(*args, **kw)
11845
11846 def RemoveWindow(self, *args, **kw):
11847 """Compatibility alias for `Remove`."""
11848 return self.Remove(*args, **kw)
11849 def RemoveSizer(self, *args, **kw):
11850 """Compatibility alias for `Remove`."""
11851 return self.Remove(*args, **kw)
11852 def RemovePos(self, *args, **kw):
11853 """Compatibility alias for `Remove`."""
11854 return self.Remove(*args, **kw)
11855
11856
11857 def SetDimension(*args, **kwargs):
11858 """
11859 SetDimension(self, int x, int y, int width, int height)
11860
11861 Call this to force the sizer to take the given dimension and thus
11862 force the items owned by the sizer to resize themselves according to
11863 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11864 methods.
11865 """
11866 return _core_.Sizer_SetDimension(*args, **kwargs)
11867
11868 def SetMinSize(*args, **kwargs):
11869 """
11870 SetMinSize(self, Size size)
11871
11872 Call this to give the sizer a minimal size. Normally, the sizer will
11873 calculate its minimal size based purely on how much space its children
11874 need. After calling this method `GetMinSize` will return either the
11875 minimal size as requested by its children or the minimal size set
11876 here, depending on which is bigger.
11877 """
11878 return _core_.Sizer_SetMinSize(*args, **kwargs)
11879
11880 def GetSize(*args, **kwargs):
11881 """
11882 GetSize(self) -> Size
11883
11884 Returns the current size of the space managed by the sizer.
11885 """
11886 return _core_.Sizer_GetSize(*args, **kwargs)
11887
11888 def GetPosition(*args, **kwargs):
11889 """
11890 GetPosition(self) -> Point
11891
11892 Returns the current position of the sizer's managed space.
11893 """
11894 return _core_.Sizer_GetPosition(*args, **kwargs)
11895
11896 def GetMinSize(*args, **kwargs):
11897 """
11898 GetMinSize(self) -> Size
11899
11900 Returns the minimal size of the sizer. This is either the combined
11901 minimal size of all the children and their borders or the minimal size
11902 set by SetMinSize, depending on which is bigger.
11903 """
11904 return _core_.Sizer_GetMinSize(*args, **kwargs)
11905
11906 def GetSizeTuple(self):
11907 return self.GetSize().Get()
11908 def GetPositionTuple(self):
11909 return self.GetPosition().Get()
11910 def GetMinSizeTuple(self):
11911 return self.GetMinSize().Get()
11912
11913 def RecalcSizes(*args, **kwargs):
11914 """
11915 RecalcSizes(self)
11916
11917 Using the sizes calculated by `CalcMin` reposition and resize all the
11918 items managed by this sizer. You should not need to call this directly as
11919 it is called by `Layout`.
11920 """
11921 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11922
11923 def CalcMin(*args, **kwargs):
11924 """
11925 CalcMin(self) -> Size
11926
11927 This method is where the sizer will do the actual calculation of its
11928 children's minimal sizes. You should not need to call this directly as
11929 it is called by `Layout`.
11930 """
11931 return _core_.Sizer_CalcMin(*args, **kwargs)
11932
11933 def Layout(*args, **kwargs):
11934 """
11935 Layout(self)
11936
11937 This method will force the recalculation and layout of the items
11938 controlled by the sizer using the current space allocated to the
11939 sizer. Normally this is called automatically from the owning window's
11940 EVT_SIZE handler, but it is also useful to call it from user code when
11941 one of the items in a sizer change size, or items are added or
11942 removed.
11943 """
11944 return _core_.Sizer_Layout(*args, **kwargs)
11945
11946 def Fit(*args, **kwargs):
11947 """
11948 Fit(self, Window window) -> Size
11949
11950 Tell the sizer to resize the *window* to match the sizer's minimal
11951 size. This is commonly done in the constructor of the window itself in
11952 order to set its initial size to match the needs of the children as
11953 determined by the sizer. Returns the new size.
11954
11955 For a top level window this is the total window size, not the client size.
11956 """
11957 return _core_.Sizer_Fit(*args, **kwargs)
11958
11959 def FitInside(*args, **kwargs):
11960 """
11961 FitInside(self, Window window)
11962
11963 Tell the sizer to resize the *virtual size* of the *window* to match the
11964 sizer's minimal size. This will not alter the on screen size of the
11965 window, but may cause the addition/removal/alteration of scrollbars
11966 required to view the virtual area in windows which manage it.
11967
11968 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11969
11970 """
11971 return _core_.Sizer_FitInside(*args, **kwargs)
11972
11973 def SetSizeHints(*args, **kwargs):
11974 """
11975 SetSizeHints(self, Window window)
11976
11977 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11978 match the sizer's minimal size. This is commonly done in the
11979 constructor of the window itself if the window is resizable (as are
11980 many dialogs under Unix and frames on probably all platforms) in order
11981 to prevent the window from being sized smaller than the minimal size
11982 required by the sizer.
11983 """
11984 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11985
11986 def SetVirtualSizeHints(*args, **kwargs):
11987 """
11988 SetVirtualSizeHints(self, Window window)
11989
11990 Tell the sizer to set the minimal size of the window virtual area to
11991 match the sizer's minimal size. For windows with managed scrollbars
11992 this will set them appropriately.
11993
11994 :see: `wx.ScrolledWindow.SetScrollbars`
11995
11996 """
11997 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11998
11999 def Clear(*args, **kwargs):
12000 """
12001 Clear(self, bool deleteWindows=False)
12002
12003 Clear all items from the sizer, optionally destroying the window items
12004 as well.
12005 """
12006 return _core_.Sizer_Clear(*args, **kwargs)
12007
12008 def DeleteWindows(*args, **kwargs):
12009 """
12010 DeleteWindows(self)
12011
12012 Destroy all windows managed by the sizer.
12013 """
12014 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12015
12016 def GetChildren(*args, **kwargs):
12017 """
12018 GetChildren(self) -> list
12019
12020 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12021 """
12022 return _core_.Sizer_GetChildren(*args, **kwargs)
12023
12024 def Show(*args, **kwargs):
12025 """
12026 Show(self, item, bool show=True, bool recursive=false) -> bool
12027
12028 Shows or hides an item managed by the sizer. To make a sizer item
12029 disappear or reappear, use Show followed by `Layout`. The *item*
12030 parameter can be either a window, a sizer, or the zero-based index of
12031 the item. Use the recursive parameter to show or hide an item in a
12032 subsizer. Returns True if the item was found.
12033 """
12034 return _core_.Sizer_Show(*args, **kwargs)
12035
12036 def IsShown(*args, **kwargs):
12037 """
12038 IsShown(self, item)
12039
12040 Determines if the item is currently shown. To make a sizer
12041 item disappear or reappear, use Show followed by `Layout`. The *item*
12042 parameter can be either a window, a sizer, or the zero-based index of
12043 the item.
12044 """
12045 return _core_.Sizer_IsShown(*args, **kwargs)
12046
12047 def Hide(self, item, recursive=False):
12048 """
12049 A convenience method for `Show` (item, False, recursive).
12050 """
12051 return self.Show(item, False, recursive)
12052
12053 def ShowItems(*args, **kwargs):
12054 """
12055 ShowItems(self, bool show)
12056
12057 Recursively call `wx.SizerItem.Show` on all sizer items.
12058 """
12059 return _core_.Sizer_ShowItems(*args, **kwargs)
12060
12061 Children = property(GetChildren,doc="See `GetChildren`")
12062 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12063 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12064 Position = property(GetPosition,doc="See `GetPosition`")
12065 Size = property(GetSize,doc="See `GetSize`")
12066 _core_.Sizer_swigregister(Sizer)
12067
12068 class PySizer(Sizer):
12069 """
12070 wx.PySizer is a special version of `wx.Sizer` that has been
12071 instrumented to allow the C++ virtual methods to be overloaded in
12072 Python derived classes. You would derive from this class if you are
12073 wanting to implement a custom sizer in Python code. Simply implement
12074 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12075 For example::
12076
12077 class MySizer(wx.PySizer):
12078 def __init__(self):
12079 wx.PySizer.__init__(self)
12080
12081 def CalcMin(self):
12082 for item in self.GetChildren():
12083 # calculate the total minimum width and height needed
12084 # by all items in the sizer according to this sizer's
12085 # layout algorithm.
12086 ...
12087 return wx.Size(width, height)
12088
12089 def RecalcSizes(self):
12090 # find the space allotted to this sizer
12091 pos = self.GetPosition()
12092 size = self.GetSize()
12093 for item in self.GetChildren():
12094 # Recalculate (if necessary) the position and size of
12095 # each item and then call item.SetDimension to do the
12096 # actual positioning and sizing of the items within the
12097 # space alloted to this sizer.
12098 ...
12099 item.SetDimension(itemPos, itemSize)
12100
12101
12102 When `Layout` is called it first calls `CalcMin` followed by
12103 `RecalcSizes` so you can optimize a bit by saving the results of
12104 `CalcMin` and reusing them in `RecalcSizes`.
12105
12106 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12107
12108
12109 """
12110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12111 __repr__ = _swig_repr
12112 def __init__(self, *args, **kwargs):
12113 """
12114 __init__(self) -> PySizer
12115
12116 Creates a wx.PySizer. Must be called from the __init__ in the derived
12117 class.
12118 """
12119 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
12120 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12121
12122 def _setCallbackInfo(*args, **kwargs):
12123 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12124 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12125
12126 _core_.PySizer_swigregister(PySizer)
12127
12128 #---------------------------------------------------------------------------
12129
12130 class BoxSizer(Sizer):
12131 """
12132 The basic idea behind a box sizer is that windows will most often be
12133 laid out in rather simple basic geometry, typically in a row or a
12134 column or nested hierarchies of either. A wx.BoxSizer will lay out
12135 its items in a simple row or column, depending on the orientation
12136 parameter passed to the constructor.
12137 """
12138 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12139 __repr__ = _swig_repr
12140 def __init__(self, *args, **kwargs):
12141 """
12142 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12143
12144 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12145 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12146 sizer.
12147 """
12148 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12149 self._setOORInfo(self)
12150
12151 def GetOrientation(*args, **kwargs):
12152 """
12153 GetOrientation(self) -> int
12154
12155 Returns the current orientation of the sizer.
12156 """
12157 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12158
12159 def SetOrientation(*args, **kwargs):
12160 """
12161 SetOrientation(self, int orient)
12162
12163 Resets the orientation of the sizer.
12164 """
12165 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12166
12167 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12168 _core_.BoxSizer_swigregister(BoxSizer)
12169
12170 #---------------------------------------------------------------------------
12171
12172 class StaticBoxSizer(BoxSizer):
12173 """
12174 wx.StaticBoxSizer derives from and functions identically to the
12175 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12176 manages. Note that this static box must be created separately and
12177 passed to the sizer constructor.
12178 """
12179 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12180 __repr__ = _swig_repr
12181 def __init__(self, *args, **kwargs):
12182 """
12183 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12184
12185 Constructor. It takes an associated static box and the orientation
12186 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12187 ``wx.HORIZONTAL``.
12188 """
12189 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12190 self._setOORInfo(self)
12191
12192 def GetStaticBox(*args, **kwargs):
12193 """
12194 GetStaticBox(self) -> StaticBox
12195
12196 Returns the static box associated with this sizer.
12197 """
12198 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12199
12200 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
12201 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12202
12203 #---------------------------------------------------------------------------
12204
12205 class GridSizer(Sizer):
12206 """
12207 A grid sizer is a sizer which lays out its children in a
12208 two-dimensional table with all cells having the same size. In other
12209 words, the width of each cell within the grid is the width of the
12210 widest item added to the sizer and the height of each grid cell is the
12211 height of the tallest item. An optional vertical and/or horizontal
12212 gap between items can also be specified (in pixels.)
12213
12214 Items are placed in the cells of the grid in the order they are added,
12215 in row-major order. In other words, the first row is filled first,
12216 then the second, and so on until all items have been added. (If
12217 neccessary, additional rows will be added as items are added.) If you
12218 need to have greater control over the cells that items are placed in
12219 then use the `wx.GridBagSizer`.
12220
12221 """
12222 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12223 __repr__ = _swig_repr
12224 def __init__(self, *args, **kwargs):
12225 """
12226 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12227
12228 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12229 of columns and rows in the sizer - if either of the parameters is
12230 zero, it will be calculated to from the total number of children in
12231 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12232 define extra space between all children.
12233 """
12234 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
12235 self._setOORInfo(self)
12236
12237 def SetCols(*args, **kwargs):
12238 """
12239 SetCols(self, int cols)
12240
12241 Sets the number of columns in the sizer.
12242 """
12243 return _core_.GridSizer_SetCols(*args, **kwargs)
12244
12245 def SetRows(*args, **kwargs):
12246 """
12247 SetRows(self, int rows)
12248
12249 Sets the number of rows in the sizer.
12250 """
12251 return _core_.GridSizer_SetRows(*args, **kwargs)
12252
12253 def SetVGap(*args, **kwargs):
12254 """
12255 SetVGap(self, int gap)
12256
12257 Sets the vertical gap (in pixels) between the cells in the sizer.
12258 """
12259 return _core_.GridSizer_SetVGap(*args, **kwargs)
12260
12261 def SetHGap(*args, **kwargs):
12262 """
12263 SetHGap(self, int gap)
12264
12265 Sets the horizontal gap (in pixels) between cells in the sizer
12266 """
12267 return _core_.GridSizer_SetHGap(*args, **kwargs)
12268
12269 def GetCols(*args, **kwargs):
12270 """
12271 GetCols(self) -> int
12272
12273 Returns the number of columns in the sizer.
12274 """
12275 return _core_.GridSizer_GetCols(*args, **kwargs)
12276
12277 def GetRows(*args, **kwargs):
12278 """
12279 GetRows(self) -> int
12280
12281 Returns the number of rows in the sizer.
12282 """
12283 return _core_.GridSizer_GetRows(*args, **kwargs)
12284
12285 def GetVGap(*args, **kwargs):
12286 """
12287 GetVGap(self) -> int
12288
12289 Returns the vertical gap (in pixels) between the cells in the sizer.
12290 """
12291 return _core_.GridSizer_GetVGap(*args, **kwargs)
12292
12293 def GetHGap(*args, **kwargs):
12294 """
12295 GetHGap(self) -> int
12296
12297 Returns the horizontal gap (in pixels) between cells in the sizer.
12298 """
12299 return _core_.GridSizer_GetHGap(*args, **kwargs)
12300
12301 def CalcRowsCols(self):
12302 """
12303 CalcRowsCols() -> (rows, cols)
12304
12305 Calculates how many rows and columns will be in the sizer based
12306 on the current number of items and also the rows, cols specified
12307 in the constructor.
12308 """
12309 nitems = len(self.GetChildren())
12310 rows = self.GetRows()
12311 cols = self.GetCols()
12312 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12313 if cols != 0:
12314 rows = (nitems + cols - 1) / cols
12315 elif rows != 0:
12316 cols = (nitems + rows - 1) / rows
12317 return (rows, cols)
12318
12319 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12320 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12321 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12322 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
12323 _core_.GridSizer_swigregister(GridSizer)
12324
12325 #---------------------------------------------------------------------------
12326
12327 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12328 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12329 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12330 class FlexGridSizer(GridSizer):
12331 """
12332 A flex grid sizer is a sizer which lays out its children in a
12333 two-dimensional table with all table cells in one row having the same
12334 height and all cells in one column having the same width, but all
12335 rows or all columns are not necessarily the same height or width as in
12336 the `wx.GridSizer`.
12337
12338 wx.FlexGridSizer can also size items equally in one direction but
12339 unequally ("flexibly") in the other. If the sizer is only flexible
12340 in one direction (this can be changed using `SetFlexibleDirection`), it
12341 needs to be decided how the sizer should grow in the other ("non
12342 flexible") direction in order to fill the available space. The
12343 `SetNonFlexibleGrowMode` method serves this purpose.
12344
12345
12346 """
12347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12348 __repr__ = _swig_repr
12349 def __init__(self, *args, **kwargs):
12350 """
12351 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12352
12353 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12354 number of columns and rows in the sizer - if either of the parameters
12355 is zero, it will be calculated to from the total number of children in
12356 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12357 define extra space between all children.
12358 """
12359 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
12360 self._setOORInfo(self)
12361
12362 def AddGrowableRow(*args, **kwargs):
12363 """
12364 AddGrowableRow(self, size_t idx, int proportion=0)
12365
12366 Specifies that row *idx* (starting from zero) should be grown if there
12367 is extra space available to the sizer.
12368
12369 The *proportion* parameter has the same meaning as the stretch factor
12370 for the box sizers except that if all proportions are 0, then all
12371 columns are resized equally (instead of not being resized at all).
12372 """
12373 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12374
12375 def RemoveGrowableRow(*args, **kwargs):
12376 """
12377 RemoveGrowableRow(self, size_t idx)
12378
12379 Specifies that row *idx* is no longer growable.
12380 """
12381 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12382
12383 def AddGrowableCol(*args, **kwargs):
12384 """
12385 AddGrowableCol(self, size_t idx, int proportion=0)
12386
12387 Specifies that column *idx* (starting from zero) should be grown if
12388 there is extra space available to the sizer.
12389
12390 The *proportion* parameter has the same meaning as the stretch factor
12391 for the box sizers except that if all proportions are 0, then all
12392 columns are resized equally (instead of not being resized at all).
12393 """
12394 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12395
12396 def RemoveGrowableCol(*args, **kwargs):
12397 """
12398 RemoveGrowableCol(self, size_t idx)
12399
12400 Specifies that column *idx* is no longer growable.
12401 """
12402 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12403
12404 def SetFlexibleDirection(*args, **kwargs):
12405 """
12406 SetFlexibleDirection(self, int direction)
12407
12408 Specifies whether the sizer should flexibly resize its columns, rows,
12409 or both. Argument *direction* can be one of the following values. Any
12410 other value is ignored.
12411
12412 ============== =======================================
12413 wx.VERTICAL Rows are flexibly sized.
12414 wx.HORIZONTAL Columns are flexibly sized.
12415 wx.BOTH Both rows and columns are flexibly sized
12416 (this is the default value).
12417 ============== =======================================
12418
12419 Note that this method does not trigger relayout.
12420
12421 """
12422 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12423
12424 def GetFlexibleDirection(*args, **kwargs):
12425 """
12426 GetFlexibleDirection(self) -> int
12427
12428 Returns a value that specifies whether the sizer
12429 flexibly resizes its columns, rows, or both (default).
12430
12431 :see: `SetFlexibleDirection`
12432 """
12433 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12434
12435 def SetNonFlexibleGrowMode(*args, **kwargs):
12436 """
12437 SetNonFlexibleGrowMode(self, int mode)
12438
12439 Specifies how the sizer should grow in the non-flexible direction if
12440 there is one (so `SetFlexibleDirection` must have been called
12441 previously). Argument *mode* can be one of the following values:
12442
12443 ========================== =================================================
12444 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12445 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12446 `AddGrowableCol` and `AddGrowableRow`. In this
12447 case equal sizing applies to minimum sizes of
12448 columns or rows (this is the default value).
12449 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12450 the non flexible direction, whether they are
12451 growable or not in the flexbile direction.
12452 ========================== =================================================
12453
12454 Note that this method does not trigger relayout.
12455 """
12456 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12457
12458 def GetNonFlexibleGrowMode(*args, **kwargs):
12459 """
12460 GetNonFlexibleGrowMode(self) -> int
12461
12462 Returns the value that specifies how the sizer grows in the
12463 non-flexible direction if there is one.
12464
12465 :see: `SetNonFlexibleGrowMode`
12466 """
12467 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12468
12469 def GetRowHeights(*args, **kwargs):
12470 """
12471 GetRowHeights(self) -> list
12472
12473 Returns a list of integers representing the heights of each of the
12474 rows in the sizer.
12475 """
12476 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12477
12478 def GetColWidths(*args, **kwargs):
12479 """
12480 GetColWidths(self) -> list
12481
12482 Returns a list of integers representing the widths of each of the
12483 columns in the sizer.
12484 """
12485 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12486
12487 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12488 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12489 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12490 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
12491 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12492
12493 class StdDialogButtonSizer(BoxSizer):
12494 """
12495 A special sizer that knows how to order and position standard buttons
12496 in order to conform to the current platform's standards. You simply
12497 need to add each `wx.Button` to the sizer, and be sure to create the
12498 buttons using the standard ID's. Then call `Realize` and the sizer
12499 will take care of the rest.
12500
12501 """
12502 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12503 __repr__ = _swig_repr
12504 def __init__(self, *args, **kwargs):
12505 """__init__(self) -> StdDialogButtonSizer"""
12506 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12507 def AddButton(*args, **kwargs):
12508 """
12509 AddButton(self, wxButton button)
12510
12511 Use this to add the buttons to this sizer. Do not use the `Add`
12512 method in the base class.
12513 """
12514 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12515
12516 def Realize(*args, **kwargs):
12517 """
12518 Realize(self)
12519
12520 This funciton needs to be called after all the buttons have been added
12521 to the sizer. It will reorder them and position them in a platform
12522 specifc manner.
12523 """
12524 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12525
12526 def SetAffirmativeButton(*args, **kwargs):
12527 """SetAffirmativeButton(self, wxButton button)"""
12528 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12529
12530 def SetNegativeButton(*args, **kwargs):
12531 """SetNegativeButton(self, wxButton button)"""
12532 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12533
12534 def SetCancelButton(*args, **kwargs):
12535 """SetCancelButton(self, wxButton button)"""
12536 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12537
12538 def GetAffirmativeButton(*args, **kwargs):
12539 """GetAffirmativeButton(self) -> wxButton"""
12540 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12541
12542 def GetApplyButton(*args, **kwargs):
12543 """GetApplyButton(self) -> wxButton"""
12544 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12545
12546 def GetNegativeButton(*args, **kwargs):
12547 """GetNegativeButton(self) -> wxButton"""
12548 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12549
12550 def GetCancelButton(*args, **kwargs):
12551 """GetCancelButton(self) -> wxButton"""
12552 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12553
12554 def GetHelpButton(*args, **kwargs):
12555 """GetHelpButton(self) -> wxButton"""
12556 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12557
12558 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12559 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12560 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12561 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12562 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
12563 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12564
12565 #---------------------------------------------------------------------------
12566
12567 class GBPosition(object):
12568 """
12569 This class represents the position of an item in a virtual grid of
12570 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12571 typemaps that will automatically convert from a 2-element sequence of
12572 integers to a wx.GBPosition, so you can use the more pythonic
12573 representation of the position nearly transparently in Python code.
12574 """
12575 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12576 __repr__ = _swig_repr
12577 def __init__(self, *args, **kwargs):
12578 """
12579 __init__(self, int row=0, int col=0) -> GBPosition
12580
12581 This class represents the position of an item in a virtual grid of
12582 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12583 typemaps that will automatically convert from a 2-element sequence of
12584 integers to a wx.GBPosition, so you can use the more pythonic
12585 representation of the position nearly transparently in Python code.
12586 """
12587 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12588 __swig_destroy__ = _core_.delete_GBPosition
12589 __del__ = lambda self : None;
12590 def GetRow(*args, **kwargs):
12591 """GetRow(self) -> int"""
12592 return _core_.GBPosition_GetRow(*args, **kwargs)
12593
12594 def GetCol(*args, **kwargs):
12595 """GetCol(self) -> int"""
12596 return _core_.GBPosition_GetCol(*args, **kwargs)
12597
12598 def SetRow(*args, **kwargs):
12599 """SetRow(self, int row)"""
12600 return _core_.GBPosition_SetRow(*args, **kwargs)
12601
12602 def SetCol(*args, **kwargs):
12603 """SetCol(self, int col)"""
12604 return _core_.GBPosition_SetCol(*args, **kwargs)
12605
12606 def __eq__(*args, **kwargs):
12607 """
12608 __eq__(self, PyObject other) -> bool
12609
12610 Compare GBPosition for equality.
12611 """
12612 return _core_.GBPosition___eq__(*args, **kwargs)
12613
12614 def __ne__(*args, **kwargs):
12615 """
12616 __ne__(self, PyObject other) -> bool
12617
12618 Compare GBPosition for inequality.
12619 """
12620 return _core_.GBPosition___ne__(*args, **kwargs)
12621
12622 def Set(*args, **kwargs):
12623 """Set(self, int row=0, int col=0)"""
12624 return _core_.GBPosition_Set(*args, **kwargs)
12625
12626 def Get(*args, **kwargs):
12627 """Get(self) -> PyObject"""
12628 return _core_.GBPosition_Get(*args, **kwargs)
12629
12630 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12631 def __str__(self): return str(self.Get())
12632 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12633 def __len__(self): return len(self.Get())
12634 def __getitem__(self, index): return self.Get()[index]
12635 def __setitem__(self, index, val):
12636 if index == 0: self.SetRow(val)
12637 elif index == 1: self.SetCol(val)
12638 else: raise IndexError
12639 def __nonzero__(self): return self.Get() != (0,0)
12640 __safe_for_unpickling__ = True
12641 def __reduce__(self): return (wx.GBPosition, self.Get())
12642
12643 row = property(GetRow, SetRow)
12644 col = property(GetCol, SetCol)
12645
12646 _core_.GBPosition_swigregister(GBPosition)
12647
12648 class GBSpan(object):
12649 """
12650 This class is used to hold the row and column spanning attributes of
12651 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12652 automatically convert from a 2-element sequence of integers to a
12653 wx.GBSpan, so you can use the more pythonic representation of the span
12654 nearly transparently in Python code.
12655
12656 """
12657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12658 __repr__ = _swig_repr
12659 def __init__(self, *args, **kwargs):
12660 """
12661 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12662
12663 Construct a new wxGBSpan, optionally setting the rowspan and
12664 colspan. The default is (1,1). (Meaning that the item occupies one
12665 cell in each direction.
12666 """
12667 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12668 __swig_destroy__ = _core_.delete_GBSpan
12669 __del__ = lambda self : None;
12670 def GetRowspan(*args, **kwargs):
12671 """GetRowspan(self) -> int"""
12672 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12673
12674 def GetColspan(*args, **kwargs):
12675 """GetColspan(self) -> int"""
12676 return _core_.GBSpan_GetColspan(*args, **kwargs)
12677
12678 def SetRowspan(*args, **kwargs):
12679 """SetRowspan(self, int rowspan)"""
12680 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12681
12682 def SetColspan(*args, **kwargs):
12683 """SetColspan(self, int colspan)"""
12684 return _core_.GBSpan_SetColspan(*args, **kwargs)
12685
12686 def __eq__(*args, **kwargs):
12687 """
12688 __eq__(self, PyObject other) -> bool
12689
12690 Compare wxGBSpan for equality.
12691 """
12692 return _core_.GBSpan___eq__(*args, **kwargs)
12693
12694 def __ne__(*args, **kwargs):
12695 """
12696 __ne__(self, PyObject other) -> bool
12697
12698 Compare GBSpan for inequality.
12699 """
12700 return _core_.GBSpan___ne__(*args, **kwargs)
12701
12702 def Set(*args, **kwargs):
12703 """Set(self, int rowspan=1, int colspan=1)"""
12704 return _core_.GBSpan_Set(*args, **kwargs)
12705
12706 def Get(*args, **kwargs):
12707 """Get(self) -> PyObject"""
12708 return _core_.GBSpan_Get(*args, **kwargs)
12709
12710 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12711 def __str__(self): return str(self.Get())
12712 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12713 def __len__(self): return len(self.Get())
12714 def __getitem__(self, index): return self.Get()[index]
12715 def __setitem__(self, index, val):
12716 if index == 0: self.SetRowspan(val)
12717 elif index == 1: self.SetColspan(val)
12718 else: raise IndexError
12719 def __nonzero__(self): return self.Get() != (0,0)
12720 __safe_for_unpickling__ = True
12721 def __reduce__(self): return (wx.GBSpan, self.Get())
12722
12723 rowspan = property(GetRowspan, SetRowspan)
12724 colspan = property(GetColspan, SetColspan)
12725
12726 _core_.GBSpan_swigregister(GBSpan)
12727
12728 class GBSizerItem(SizerItem):
12729 """
12730 The wx.GBSizerItem class is used to track the additional data about
12731 items in a `wx.GridBagSizer` such as the item's position in the grid
12732 and how many rows or columns it spans.
12733
12734 """
12735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12736 __repr__ = _swig_repr
12737 def __init__(self, *args, **kwargs):
12738 """
12739 __init__(self) -> GBSizerItem
12740
12741 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12742 size will need to be set, as well as a position and span before this
12743 item can be used in a Sizer.
12744
12745 You will probably never need to create a wx.GBSizerItem directly as they
12746 are created automatically when the sizer's Add method is called.
12747 """
12748 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12749 __swig_destroy__ = _core_.delete_GBSizerItem
12750 __del__ = lambda self : None;
12751 def GetPos(*args, **kwargs):
12752 """
12753 GetPos(self) -> GBPosition
12754
12755 Get the grid position of the item
12756 """
12757 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12758
12759 def GetPosTuple(self): return self.GetPos().Get()
12760 def GetSpan(*args, **kwargs):
12761 """
12762 GetSpan(self) -> GBSpan
12763
12764 Get the row and column spanning of the item
12765 """
12766 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12767
12768 def GetSpanTuple(self): return self.GetSpan().Get()
12769 def SetPos(*args, **kwargs):
12770 """
12771 SetPos(self, GBPosition pos) -> bool
12772
12773 If the item is already a member of a sizer then first ensure that
12774 there is no other item that would intersect with this one at the new
12775 position, then set the new position. Returns True if the change is
12776 successful and after the next Layout() the item will be moved.
12777 """
12778 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12779
12780 def SetSpan(*args, **kwargs):
12781 """
12782 SetSpan(self, GBSpan span) -> bool
12783
12784 If the item is already a member of a sizer then first ensure that
12785 there is no other item that would intersect with this one with its new
12786 spanning size, then set the new spanning. Returns True if the change
12787 is successful and after the next Layout() the item will be resized.
12788
12789 """
12790 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12791
12792 def Intersects(*args, **kwargs):
12793 """
12794 Intersects(self, GBSizerItem other) -> bool
12795
12796 Returns True if this item and the other item instersect.
12797 """
12798 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12799
12800 def IntersectsPos(*args, **kwargs):
12801 """
12802 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12803
12804 Returns True if the given pos/span would intersect with this item.
12805 """
12806 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12807
12808 def GetEndPos(*args, **kwargs):
12809 """
12810 GetEndPos(self) -> GBPosition
12811
12812 Get the row and column of the endpoint of this item.
12813 """
12814 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12815
12816 def GetGBSizer(*args, **kwargs):
12817 """
12818 GetGBSizer(self) -> GridBagSizer
12819
12820 Get the sizer this item is a member of.
12821 """
12822 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12823
12824 def SetGBSizer(*args, **kwargs):
12825 """
12826 SetGBSizer(self, GridBagSizer sizer)
12827
12828 Set the sizer this item is a member of.
12829 """
12830 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12831
12832 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12833 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12834 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12835 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
12836 _core_.GBSizerItem_swigregister(GBSizerItem)
12837 DefaultSpan = cvar.DefaultSpan
12838
12839 def GBSizerItemWindow(*args, **kwargs):
12840 """
12841 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12842 int border, PyObject userData=None) -> GBSizerItem
12843
12844 Construct a `wx.GBSizerItem` for a window.
12845 """
12846 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12847 return val
12848
12849 def GBSizerItemSizer(*args, **kwargs):
12850 """
12851 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12852 int border, PyObject userData=None) -> GBSizerItem
12853
12854 Construct a `wx.GBSizerItem` for a sizer
12855 """
12856 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12857 return val
12858
12859 def GBSizerItemSpacer(*args, **kwargs):
12860 """
12861 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12862 int flag, int border, PyObject userData=None) -> GBSizerItem
12863
12864 Construct a `wx.GBSizerItem` for a spacer.
12865 """
12866 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12867 return val
12868
12869 class GridBagSizer(FlexGridSizer):
12870 """
12871 A `wx.Sizer` that can lay out items in a virtual grid like a
12872 `wx.FlexGridSizer` but in this case explicit positioning of the items
12873 is allowed using `wx.GBPosition`, and items can optionally span more
12874 than one row and/or column using `wx.GBSpan`. The total size of the
12875 virtual grid is determined by the largest row and column that items are
12876 positioned at, adjusted for spanning.
12877
12878 """
12879 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12880 __repr__ = _swig_repr
12881 def __init__(self, *args, **kwargs):
12882 """
12883 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12884
12885 Constructor, with optional parameters to specify the gap between the
12886 rows and columns.
12887 """
12888 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12889 self._setOORInfo(self)
12890
12891 def Add(*args, **kwargs):
12892 """
12893 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12894 int border=0, userData=None) -> wx.GBSizerItem
12895
12896 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12897 more than one row or column as specified with *span*. The remaining
12898 args behave similarly to `wx.Sizer.Add`.
12899
12900 Returns True if the item was successfully placed at the given cell
12901 position, False if something was already there.
12902
12903 """
12904 return _core_.GridBagSizer_Add(*args, **kwargs)
12905
12906 def AddItem(*args, **kwargs):
12907 """
12908 Add(self, GBSizerItem item) -> wx.GBSizerItem
12909
12910 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12911 the item was successfully placed at its given cell position, False if
12912 something was already there.
12913 """
12914 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12915
12916 def GetCellSize(*args, **kwargs):
12917 """
12918 GetCellSize(self, int row, int col) -> Size
12919
12920 Get the size of the specified cell, including hgap and
12921 vgap. Only valid after a Layout.
12922 """
12923 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12924
12925 def GetEmptyCellSize(*args, **kwargs):
12926 """
12927 GetEmptyCellSize(self) -> Size
12928
12929 Get the size used for cells in the grid with no item.
12930 """
12931 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12932
12933 def SetEmptyCellSize(*args, **kwargs):
12934 """
12935 SetEmptyCellSize(self, Size sz)
12936
12937 Set the size used for cells in the grid with no item.
12938 """
12939 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12940
12941 def GetItemPosition(*args):
12942 """
12943 GetItemPosition(self, item) -> GBPosition
12944
12945 Get the grid position of the specified *item* where *item* is either a
12946 window or subsizer that is a member of this sizer, or a zero-based
12947 index of an item.
12948 """
12949 return _core_.GridBagSizer_GetItemPosition(*args)
12950
12951 def SetItemPosition(*args):
12952 """
12953 SetItemPosition(self, item, GBPosition pos) -> bool
12954
12955 Set the grid position of the specified *item* where *item* is either a
12956 window or subsizer that is a member of this sizer, or a zero-based
12957 index of an item. Returns True on success. If the move is not
12958 allowed (because an item is already there) then False is returned.
12959
12960 """
12961 return _core_.GridBagSizer_SetItemPosition(*args)
12962
12963 def GetItemSpan(*args):
12964 """
12965 GetItemSpan(self, item) -> GBSpan
12966
12967 Get the row/col spanning of the specified *item* where *item* is
12968 either a window or subsizer that is a member of this sizer, or a
12969 zero-based index of an item.
12970 """
12971 return _core_.GridBagSizer_GetItemSpan(*args)
12972
12973 def SetItemSpan(*args):
12974 """
12975 SetItemSpan(self, item, GBSpan span) -> bool
12976
12977 Set the row/col spanning of the specified *item* where *item* is
12978 either a window or subsizer that is a member of this sizer, or a
12979 zero-based index of an item. Returns True on success. If the move is
12980 not allowed (because an item is already there) then False is returned.
12981 """
12982 return _core_.GridBagSizer_SetItemSpan(*args)
12983
12984 def FindItem(*args):
12985 """
12986 FindItem(self, item) -> GBSizerItem
12987
12988 Find the sizer item for the given window or subsizer, returns None if
12989 not found. (non-recursive)
12990 """
12991 return _core_.GridBagSizer_FindItem(*args)
12992
12993 def FindItemAtPosition(*args, **kwargs):
12994 """
12995 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12996
12997 Return the sizer item for the given grid cell, or None if there is no
12998 item at that position. (non-recursive)
12999 """
13000 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13001
13002 def FindItemAtPoint(*args, **kwargs):
13003 """
13004 FindItemAtPoint(self, Point pt) -> GBSizerItem
13005
13006 Return the sizer item located at the point given in *pt*, or None if
13007 there is no item at that point. The (x,y) coordinates in pt correspond
13008 to the client coordinates of the window using the sizer for
13009 layout. (non-recursive)
13010 """
13011 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13012
13013 def CheckForIntersection(*args, **kwargs):
13014 """
13015 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13016
13017 Look at all items and see if any intersect (or would overlap) the
13018 given *item*. Returns True if so, False if there would be no overlap.
13019 If an *excludeItem* is given then it will not be checked for
13020 intersection, for example it may be the item we are checking the
13021 position of.
13022
13023 """
13024 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
13025
13026 def CheckForIntersectionPos(*args, **kwargs):
13027 """
13028 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13029
13030 Look at all items and see if any intersect (or would overlap) the
13031 given position and span. Returns True if so, False if there would be
13032 no overlap. If an *excludeItem* is given then it will not be checked
13033 for intersection, for example it may be the item we are checking the
13034 position of.
13035 """
13036 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
13037
13038 _core_.GridBagSizer_swigregister(GridBagSizer)
13039
13040 #---------------------------------------------------------------------------
13041
13042 Left = _core_.Left
13043 Top = _core_.Top
13044 Right = _core_.Right
13045 Bottom = _core_.Bottom
13046 Width = _core_.Width
13047 Height = _core_.Height
13048 Centre = _core_.Centre
13049 Center = _core_.Center
13050 CentreX = _core_.CentreX
13051 CentreY = _core_.CentreY
13052 Unconstrained = _core_.Unconstrained
13053 AsIs = _core_.AsIs
13054 PercentOf = _core_.PercentOf
13055 Above = _core_.Above
13056 Below = _core_.Below
13057 LeftOf = _core_.LeftOf
13058 RightOf = _core_.RightOf
13059 SameAs = _core_.SameAs
13060 Absolute = _core_.Absolute
13061 class IndividualLayoutConstraint(Object):
13062 """
13063 Objects of this class are stored in the `wx.LayoutConstraints` class as
13064 one of eight possible constraints that a window can be involved in.
13065 You will never need to create an instance of
13066 wx.IndividualLayoutConstraint, rather you should create a
13067 `wx.LayoutConstraints` instance and use the individual contstraints
13068 that it contains.
13069 """
13070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13071 def __init__(self): raise AttributeError, "No constructor defined"
13072 __repr__ = _swig_repr
13073 def Set(*args, **kwargs):
13074 """
13075 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13076
13077 Sets the properties of the constraint. Normally called by one of the
13078 convenience functions such as Above, RightOf, SameAs.
13079 """
13080 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13081
13082 def LeftOf(*args, **kwargs):
13083 """
13084 LeftOf(self, Window sibling, int marg=0)
13085
13086 Constrains this edge to be to the left of the given window, with an
13087 optional margin. Implicitly, this is relative to the left edge of the
13088 other window.
13089 """
13090 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13091
13092 def RightOf(*args, **kwargs):
13093 """
13094 RightOf(self, Window sibling, int marg=0)
13095
13096 Constrains this edge to be to the right of the given window, with an
13097 optional margin. Implicitly, this is relative to the right edge of the
13098 other window.
13099 """
13100 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13101
13102 def Above(*args, **kwargs):
13103 """
13104 Above(self, Window sibling, int marg=0)
13105
13106 Constrains this edge to be above the given window, with an optional
13107 margin. Implicitly, this is relative to the top edge of the other
13108 window.
13109 """
13110 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13111
13112 def Below(*args, **kwargs):
13113 """
13114 Below(self, Window sibling, int marg=0)
13115
13116 Constrains this edge to be below the given window, with an optional
13117 margin. Implicitly, this is relative to the bottom edge of the other
13118 window.
13119 """
13120 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13121
13122 def SameAs(*args, **kwargs):
13123 """
13124 SameAs(self, Window otherW, int edge, int marg=0)
13125
13126 Constrains this edge or dimension to be to the same as the edge of the
13127 given window, with an optional margin.
13128 """
13129 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13130
13131 def PercentOf(*args, **kwargs):
13132 """
13133 PercentOf(self, Window otherW, int wh, int per)
13134
13135 Constrains this edge or dimension to be to a percentage of the given
13136 window, with an optional margin.
13137 """
13138 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13139
13140 def Absolute(*args, **kwargs):
13141 """
13142 Absolute(self, int val)
13143
13144 Constrains this edge or dimension to be the given absolute value.
13145 """
13146 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13147
13148 def Unconstrained(*args, **kwargs):
13149 """
13150 Unconstrained(self)
13151
13152 Sets this edge or dimension to be unconstrained, that is, dependent on
13153 other edges and dimensions from which this value can be deduced.
13154 """
13155 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13156
13157 def AsIs(*args, **kwargs):
13158 """
13159 AsIs(self)
13160
13161 Sets this edge or constraint to be whatever the window's value is at
13162 the moment. If either of the width and height constraints are *as is*,
13163 the window will not be resized, but moved instead. This is important
13164 when considering panel items which are intended to have a default
13165 size, such as a button, which may take its size from the size of the
13166 button label.
13167 """
13168 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13169
13170 def GetOtherWindow(*args, **kwargs):
13171 """GetOtherWindow(self) -> Window"""
13172 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13173
13174 def GetMyEdge(*args, **kwargs):
13175 """GetMyEdge(self) -> int"""
13176 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13177
13178 def SetEdge(*args, **kwargs):
13179 """SetEdge(self, int which)"""
13180 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13181
13182 def SetValue(*args, **kwargs):
13183 """SetValue(self, int v)"""
13184 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13185
13186 def GetMargin(*args, **kwargs):
13187 """GetMargin(self) -> int"""
13188 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13189
13190 def SetMargin(*args, **kwargs):
13191 """SetMargin(self, int m)"""
13192 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13193
13194 def GetValue(*args, **kwargs):
13195 """GetValue(self) -> int"""
13196 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13197
13198 def GetPercent(*args, **kwargs):
13199 """GetPercent(self) -> int"""
13200 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13201
13202 def GetOtherEdge(*args, **kwargs):
13203 """GetOtherEdge(self) -> int"""
13204 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13205
13206 def GetDone(*args, **kwargs):
13207 """GetDone(self) -> bool"""
13208 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13209
13210 def SetDone(*args, **kwargs):
13211 """SetDone(self, bool d)"""
13212 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13213
13214 def GetRelationship(*args, **kwargs):
13215 """GetRelationship(self) -> int"""
13216 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13217
13218 def SetRelationship(*args, **kwargs):
13219 """SetRelationship(self, int r)"""
13220 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13221
13222 def ResetIfWin(*args, **kwargs):
13223 """
13224 ResetIfWin(self, Window otherW) -> bool
13225
13226 Reset constraint if it mentions otherWin
13227 """
13228 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13229
13230 def SatisfyConstraint(*args, **kwargs):
13231 """
13232 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13233
13234 Try to satisfy constraint
13235 """
13236 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13237
13238 def GetEdge(*args, **kwargs):
13239 """
13240 GetEdge(self, int which, Window thisWin, Window other) -> int
13241
13242 Get the value of this edge or dimension, or if this
13243 is not determinable, -1.
13244 """
13245 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13246
13247 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13248 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13249 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13250 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13251 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13252 Percent = property(GetPercent,doc="See `GetPercent`")
13253 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13254 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
13255 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
13256
13257 class LayoutConstraints(Object):
13258 """
13259 **Note:** constraints are now deprecated and you should use sizers
13260 instead.
13261
13262 Objects of this class can be associated with a window to define its
13263 layout constraints, with respect to siblings or its parent.
13264
13265 The class consists of the following eight constraints of class
13266 wx.IndividualLayoutConstraint, some or all of which should be accessed
13267 directly to set the appropriate constraints.
13268
13269 * left: represents the left hand edge of the window
13270 * right: represents the right hand edge of the window
13271 * top: represents the top edge of the window
13272 * bottom: represents the bottom edge of the window
13273 * width: represents the width of the window
13274 * height: represents the height of the window
13275 * centreX: represents the horizontal centre point of the window
13276 * centreY: represents the vertical centre point of the window
13277
13278 Most constraints are initially set to have the relationship
13279 wxUnconstrained, which means that their values should be calculated by
13280 looking at known constraints. The exceptions are width and height,
13281 which are set to wxAsIs to ensure that if the user does not specify a
13282 constraint, the existing width and height will be used, to be
13283 compatible with panel items which often have take a default size. If
13284 the constraint is ``wx.AsIs``, the dimension will not be changed.
13285
13286 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13287
13288 """
13289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13290 __repr__ = _swig_repr
13291 left = property(_core_.LayoutConstraints_left_get)
13292 top = property(_core_.LayoutConstraints_top_get)
13293 right = property(_core_.LayoutConstraints_right_get)
13294 bottom = property(_core_.LayoutConstraints_bottom_get)
13295 width = property(_core_.LayoutConstraints_width_get)
13296 height = property(_core_.LayoutConstraints_height_get)
13297 centreX = property(_core_.LayoutConstraints_centreX_get)
13298 centreY = property(_core_.LayoutConstraints_centreY_get)
13299 def __init__(self, *args, **kwargs):
13300 """__init__(self) -> LayoutConstraints"""
13301 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13302 __swig_destroy__ = _core_.delete_LayoutConstraints
13303 __del__ = lambda self : None;
13304 def SatisfyConstraints(*args, **kwargs):
13305 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13306 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13307
13308 def AreSatisfied(*args, **kwargs):
13309 """AreSatisfied(self) -> bool"""
13310 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13311
13312 _core_.LayoutConstraints_swigregister(LayoutConstraints)
13313
13314 #----------------------------------------------------------------------------
13315
13316 # Use Python's bool constants if available, make some if not
13317 try:
13318 True
13319 except NameError:
13320 __builtins__.True = 1==1
13321 __builtins__.False = 1==0
13322 def bool(value): return not not value
13323 __builtins__.bool = bool
13324
13325
13326
13327 # workarounds for bad wxRTTI names
13328 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13329 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13330 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13331
13332
13333 #----------------------------------------------------------------------------
13334 # Load version numbers from __version__... Ensure that major and minor
13335 # versions are the same for both wxPython and wxWidgets.
13336
13337 from __version__ import *
13338 __version__ = VERSION_STRING
13339
13340 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13341 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
13342 if RELEASE_VERSION != _core_.RELEASE_VERSION:
13343 import warnings
13344 warnings.warn("wxPython/wxWidgets release number mismatch")
13345
13346 #----------------------------------------------------------------------------
13347
13348 # Set wxPython's default string<-->unicode conversion encoding from
13349 # the locale, but only if Python's default hasn't been changed. (We
13350 # assume that if the user has customized it already then that is the
13351 # encoding we need to use as well.)
13352 #
13353 # The encoding selected here is used when string or unicode objects
13354 # need to be converted in order to pass them to wxWidgets. Please be
13355 # aware that the default encoding within the same locale may be
13356 # slightly different on different platforms. For example, please see
13357 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13358 # between the common latin/roman encodings.
13359
13360 default = _sys.getdefaultencoding()
13361 if default == 'ascii':
13362 import locale
13363 import codecs
13364 try:
13365 default = locale.getdefaultlocale()[1]
13366 codecs.lookup(default)
13367 except (ValueError, LookupError, TypeError):
13368 default = _sys.getdefaultencoding()
13369 del locale
13370 del codecs
13371 if default:
13372 wx.SetDefaultPyEncoding(default)
13373 del default
13374
13375 #----------------------------------------------------------------------------
13376
13377 class PyDeadObjectError(AttributeError):
13378 pass
13379
13380 class _wxPyDeadObject(object):
13381 """
13382 Instances of wx objects that are OOR capable will have their __class__
13383 changed to this class when the C++ object is deleted. This should help
13384 prevent crashes due to referencing a bogus C++ pointer.
13385 """
13386 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13387 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13388
13389 def __repr__(self):
13390 if not hasattr(self, "_name"):
13391 self._name = "[unknown]"
13392 return self.reprStr % self._name
13393
13394 def __getattr__(self, *args):
13395 if not hasattr(self, "_name"):
13396 self._name = "[unknown]"
13397 raise PyDeadObjectError(self.attrStr % self._name)
13398
13399 def __nonzero__(self):
13400 return 0
13401
13402
13403
13404 class PyUnbornObjectError(AttributeError):
13405 pass
13406
13407 class _wxPyUnbornObject(object):
13408 """
13409 Some stock objects are created when the wx._core module is
13410 imported, but their C++ instance is not created until the wx.App
13411 object is created and initialized. These object instances will
13412 temporarily have their __class__ changed to this class so an
13413 exception will be raised if they are used before the C++ instance
13414 is ready.
13415 """
13416
13417 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13418 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13419
13420 def __repr__(self):
13421 #if not hasattr(self, "_name"):
13422 # self._name = "[unknown]"
13423 return self.reprStr #% self._name
13424
13425 def __getattr__(self, *args):
13426 #if not hasattr(self, "_name"):
13427 # self._name = "[unknown]"
13428 raise PyUnbornObjectError(self.attrStr) # % self._name )
13429
13430 def __nonzero__(self):
13431 return 0
13432
13433
13434 #----------------------------------------------------------------------------
13435
13436 def CallAfter(callable, *args, **kw):
13437 """
13438 Call the specified function after the current and pending event
13439 handlers have been completed. This is also good for making GUI
13440 method calls from non-GUI threads. Any extra positional or
13441 keyword args are passed on to the callable when it is called.
13442
13443 :see: `wx.FutureCall`
13444 """
13445 app = wx.GetApp()
13446 assert app is not None, 'No wx.App created yet'
13447
13448 if not hasattr(app, "_CallAfterId"):
13449 app._CallAfterId = wx.NewEventType()
13450 app.Connect(-1, -1, app._CallAfterId,
13451 lambda event: event.callable(*event.args, **event.kw) )
13452 evt = wx.PyEvent()
13453 evt.SetEventType(app._CallAfterId)
13454 evt.callable = callable
13455 evt.args = args
13456 evt.kw = kw
13457 wx.PostEvent(app, evt)
13458
13459 #----------------------------------------------------------------------------
13460
13461
13462 class FutureCall:
13463 """
13464 A convenience class for `wx.Timer`, that calls the given callable
13465 object once after the given amount of milliseconds, passing any
13466 positional or keyword args. The return value of the callable is
13467 availbale after it has been run with the `GetResult` method.
13468
13469 If you don't need to get the return value or restart the timer
13470 then there is no need to hold a reference to this object. It will
13471 hold a reference to itself while the timer is running (the timer
13472 has a reference to self.Notify) but the cycle will be broken when
13473 the timer completes, automatically cleaning up the wx.FutureCall
13474 object.
13475
13476 :see: `wx.CallAfter`
13477 """
13478 def __init__(self, millis, callable, *args, **kwargs):
13479 self.millis = millis
13480 self.callable = callable
13481 self.SetArgs(*args, **kwargs)
13482 self.runCount = 0
13483 self.running = False
13484 self.hasRun = False
13485 self.result = None
13486 self.timer = None
13487 self.Start()
13488
13489 def __del__(self):
13490 self.Stop()
13491
13492
13493 def Start(self, millis=None, *args, **kwargs):
13494 """
13495 (Re)start the timer
13496 """
13497 self.hasRun = False
13498 if millis is not None:
13499 self.millis = millis
13500 if args or kwargs:
13501 self.SetArgs(*args, **kwargs)
13502 self.Stop()
13503 self.timer = wx.PyTimer(self.Notify)
13504 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13505 self.running = True
13506 Restart = Start
13507
13508
13509 def Stop(self):
13510 """
13511 Stop and destroy the timer.
13512 """
13513 if self.timer is not None:
13514 self.timer.Stop()
13515 self.timer = None
13516
13517
13518 def GetInterval(self):
13519 if self.timer is not None:
13520 return self.timer.GetInterval()
13521 else:
13522 return 0
13523
13524
13525 def IsRunning(self):
13526 return self.timer is not None and self.timer.IsRunning()
13527
13528
13529 def SetArgs(self, *args, **kwargs):
13530 """
13531 (Re)set the args passed to the callable object. This is
13532 useful in conjunction with Restart if you want to schedule a
13533 new call to the same callable object but with different
13534 parameters.
13535 """
13536 self.args = args
13537 self.kwargs = kwargs
13538
13539
13540 def HasRun(self):
13541 return self.hasRun
13542
13543 def GetResult(self):
13544 return self.result
13545
13546 def Notify(self):
13547 """
13548 The timer has expired so call the callable.
13549 """
13550 if self.callable and getattr(self.callable, 'im_self', True):
13551 self.runCount += 1
13552 self.running = False
13553 self.result = self.callable(*self.args, **self.kwargs)
13554 self.hasRun = True
13555 if not self.running:
13556 # if it wasn't restarted, then cleanup
13557 wx.CallAfter(self.Stop)
13558
13559 Interval = property(GetInterval)
13560 Result = property(GetResult)
13561
13562
13563 #----------------------------------------------------------------------------
13564 # Control which items in this module should be documented by epydoc.
13565 # We allow only classes and functions, which will help reduce the size
13566 # of the docs by filtering out the zillions of constants, EVT objects,
13567 # and etc that don't make much sense by themselves, but are instead
13568 # documented (or will be) as part of the classes/functions/methods
13569 # where they should be used.
13570
13571 class __DocFilter:
13572 """
13573 A filter for epydoc that only allows non-Ptr classes and
13574 functions, in order to reduce the clutter in the API docs.
13575 """
13576 def __init__(self, globals):
13577 self._globals = globals
13578
13579 def __call__(self, name):
13580 import types
13581 obj = self._globals.get(name, None)
13582
13583 # only document classes and function
13584 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13585 return False
13586
13587 # skip other things that are private or will be documented as part of somethign else
13588 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13589 return False
13590
13591 # skip functions that are duplicates of static functions in a class
13592 if name.find('_') != -1:
13593 cls = self._globals.get(name.split('_')[0], None)
13594 methname = name.split('_')[1]
13595 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13596 return False
13597
13598 return True
13599
13600 #----------------------------------------------------------------------------
13601 #----------------------------------------------------------------------------
13602
13603 # Import other modules in this package that should show up in the
13604 # "core" wx namespace
13605 from _gdi import *
13606 from _windows import *
13607 from _controls import *
13608 from _misc import *
13609
13610 #----------------------------------------------------------------------------
13611 #----------------------------------------------------------------------------
13612
13613
13614