]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/_core.py
ff15cd415fd25ff3a4896ca12c8070db701bbacc
[wxWidgets.git] / wxPython / src / gtk / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 PROCESS_ENTER = _core_.PROCESS_ENTER
120 PASSWORD = _core_.PASSWORD
121 CB_SIMPLE = _core_.CB_SIMPLE
122 CB_DROPDOWN = _core_.CB_DROPDOWN
123 CB_SORT = _core_.CB_SORT
124 CB_READONLY = _core_.CB_READONLY
125 RA_HORIZONTAL = _core_.RA_HORIZONTAL
126 RA_VERTICAL = _core_.RA_VERTICAL
127 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130 RB_GROUP = _core_.RB_GROUP
131 RB_SINGLE = _core_.RB_SINGLE
132 SB_HORIZONTAL = _core_.SB_HORIZONTAL
133 SB_VERTICAL = _core_.SB_VERTICAL
134 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135 ST_SIZEGRIP = _core_.ST_SIZEGRIP
136 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138 ST_DOTS_END = _core_.ST_DOTS_END
139 FLOOD_SURFACE = _core_.FLOOD_SURFACE
140 FLOOD_BORDER = _core_.FLOOD_BORDER
141 ODDEVEN_RULE = _core_.ODDEVEN_RULE
142 WINDING_RULE = _core_.WINDING_RULE
143 TOOL_TOP = _core_.TOOL_TOP
144 TOOL_BOTTOM = _core_.TOOL_BOTTOM
145 TOOL_LEFT = _core_.TOOL_LEFT
146 TOOL_RIGHT = _core_.TOOL_RIGHT
147 OK = _core_.OK
148 YES_NO = _core_.YES_NO
149 CANCEL = _core_.CANCEL
150 YES = _core_.YES
151 NO = _core_.NO
152 NO_DEFAULT = _core_.NO_DEFAULT
153 YES_DEFAULT = _core_.YES_DEFAULT
154 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155 ICON_HAND = _core_.ICON_HAND
156 ICON_QUESTION = _core_.ICON_QUESTION
157 ICON_INFORMATION = _core_.ICON_INFORMATION
158 ICON_STOP = _core_.ICON_STOP
159 ICON_ASTERISK = _core_.ICON_ASTERISK
160 ICON_MASK = _core_.ICON_MASK
161 ICON_WARNING = _core_.ICON_WARNING
162 ICON_ERROR = _core_.ICON_ERROR
163 FORWARD = _core_.FORWARD
164 BACKWARD = _core_.BACKWARD
165 RESET = _core_.RESET
166 HELP = _core_.HELP
167 MORE = _core_.MORE
168 SETUP = _core_.SETUP
169 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171 SIZE_AUTO = _core_.SIZE_AUTO
172 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE = _core_.SIZE_FORCE
175 PORTRAIT = _core_.PORTRAIT
176 LANDSCAPE = _core_.LANDSCAPE
177 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181 ID_ANY = _core_.ID_ANY
182 ID_SEPARATOR = _core_.ID_SEPARATOR
183 ID_NONE = _core_.ID_NONE
184 ID_LOWEST = _core_.ID_LOWEST
185 ID_OPEN = _core_.ID_OPEN
186 ID_CLOSE = _core_.ID_CLOSE
187 ID_NEW = _core_.ID_NEW
188 ID_SAVE = _core_.ID_SAVE
189 ID_SAVEAS = _core_.ID_SAVEAS
190 ID_REVERT = _core_.ID_REVERT
191 ID_EXIT = _core_.ID_EXIT
192 ID_UNDO = _core_.ID_UNDO
193 ID_REDO = _core_.ID_REDO
194 ID_HELP = _core_.ID_HELP
195 ID_PRINT = _core_.ID_PRINT
196 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
198 ID_PREVIEW = _core_.ID_PREVIEW
199 ID_ABOUT = _core_.ID_ABOUT
200 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
204 ID_HELP_INDEX = _core_.ID_HELP_INDEX
205 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
206 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207 ID_PREFERENCES = _core_.ID_PREFERENCES
208 ID_EDIT = _core_.ID_EDIT
209 ID_CUT = _core_.ID_CUT
210 ID_COPY = _core_.ID_COPY
211 ID_PASTE = _core_.ID_PASTE
212 ID_CLEAR = _core_.ID_CLEAR
213 ID_FIND = _core_.ID_FIND
214 ID_DUPLICATE = _core_.ID_DUPLICATE
215 ID_SELECTALL = _core_.ID_SELECTALL
216 ID_DELETE = _core_.ID_DELETE
217 ID_REPLACE = _core_.ID_REPLACE
218 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219 ID_PROPERTIES = _core_.ID_PROPERTIES
220 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223 ID_VIEW_LIST = _core_.ID_VIEW_LIST
224 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
228 ID_FILE = _core_.ID_FILE
229 ID_FILE1 = _core_.ID_FILE1
230 ID_FILE2 = _core_.ID_FILE2
231 ID_FILE3 = _core_.ID_FILE3
232 ID_FILE4 = _core_.ID_FILE4
233 ID_FILE5 = _core_.ID_FILE5
234 ID_FILE6 = _core_.ID_FILE6
235 ID_FILE7 = _core_.ID_FILE7
236 ID_FILE8 = _core_.ID_FILE8
237 ID_FILE9 = _core_.ID_FILE9
238 ID_OK = _core_.ID_OK
239 ID_CANCEL = _core_.ID_CANCEL
240 ID_APPLY = _core_.ID_APPLY
241 ID_YES = _core_.ID_YES
242 ID_NO = _core_.ID_NO
243 ID_STATIC = _core_.ID_STATIC
244 ID_FORWARD = _core_.ID_FORWARD
245 ID_BACKWARD = _core_.ID_BACKWARD
246 ID_DEFAULT = _core_.ID_DEFAULT
247 ID_MORE = _core_.ID_MORE
248 ID_SETUP = _core_.ID_SETUP
249 ID_RESET = _core_.ID_RESET
250 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
251 ID_YESTOALL = _core_.ID_YESTOALL
252 ID_NOTOALL = _core_.ID_NOTOALL
253 ID_ABORT = _core_.ID_ABORT
254 ID_RETRY = _core_.ID_RETRY
255 ID_IGNORE = _core_.ID_IGNORE
256 ID_ADD = _core_.ID_ADD
257 ID_REMOVE = _core_.ID_REMOVE
258 ID_UP = _core_.ID_UP
259 ID_DOWN = _core_.ID_DOWN
260 ID_HOME = _core_.ID_HOME
261 ID_REFRESH = _core_.ID_REFRESH
262 ID_STOP = _core_.ID_STOP
263 ID_INDEX = _core_.ID_INDEX
264 ID_BOLD = _core_.ID_BOLD
265 ID_ITALIC = _core_.ID_ITALIC
266 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270 ID_UNDERLINE = _core_.ID_UNDERLINE
271 ID_INDENT = _core_.ID_INDENT
272 ID_UNINDENT = _core_.ID_UNINDENT
273 ID_ZOOM_100 = _core_.ID_ZOOM_100
274 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275 ID_ZOOM_IN = _core_.ID_ZOOM_IN
276 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277 ID_UNDELETE = _core_.ID_UNDELETE
278 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
279 ID_HIGHEST = _core_.ID_HIGHEST
280 MENU_TEAROFF = _core_.MENU_TEAROFF
281 MB_DOCKABLE = _core_.MB_DOCKABLE
282 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
283 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
284 LI_HORIZONTAL = _core_.LI_HORIZONTAL
285 LI_VERTICAL = _core_.LI_VERTICAL
286 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
287 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
288 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
289 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
290 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
291 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
292 MM_TEXT = _core_.MM_TEXT
293 MM_LOMETRIC = _core_.MM_LOMETRIC
294 MM_HIMETRIC = _core_.MM_HIMETRIC
295 MM_LOENGLISH = _core_.MM_LOENGLISH
296 MM_HIENGLISH = _core_.MM_HIENGLISH
297 MM_TWIPS = _core_.MM_TWIPS
298 MM_ISOTROPIC = _core_.MM_ISOTROPIC
299 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
300 MM_POINTS = _core_.MM_POINTS
301 MM_METRIC = _core_.MM_METRIC
302 CENTRE = _core_.CENTRE
303 CENTER = _core_.CENTER
304 HORIZONTAL = _core_.HORIZONTAL
305 VERTICAL = _core_.VERTICAL
306 BOTH = _core_.BOTH
307 LEFT = _core_.LEFT
308 RIGHT = _core_.RIGHT
309 UP = _core_.UP
310 DOWN = _core_.DOWN
311 TOP = _core_.TOP
312 BOTTOM = _core_.BOTTOM
313 NORTH = _core_.NORTH
314 SOUTH = _core_.SOUTH
315 WEST = _core_.WEST
316 EAST = _core_.EAST
317 ALL = _core_.ALL
318 ALIGN_NOT = _core_.ALIGN_NOT
319 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
320 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
321 ALIGN_LEFT = _core_.ALIGN_LEFT
322 ALIGN_TOP = _core_.ALIGN_TOP
323 ALIGN_RIGHT = _core_.ALIGN_RIGHT
324 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
325 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
326 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
327 ALIGN_CENTER = _core_.ALIGN_CENTER
328 ALIGN_CENTRE = _core_.ALIGN_CENTRE
329 ALIGN_MASK = _core_.ALIGN_MASK
330 STRETCH_NOT = _core_.STRETCH_NOT
331 SHRINK = _core_.SHRINK
332 GROW = _core_.GROW
333 EXPAND = _core_.EXPAND
334 SHAPED = _core_.SHAPED
335 FIXED_MINSIZE = _core_.FIXED_MINSIZE
336 TILE = _core_.TILE
337 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
338 BORDER_DEFAULT = _core_.BORDER_DEFAULT
339 BORDER_NONE = _core_.BORDER_NONE
340 BORDER_STATIC = _core_.BORDER_STATIC
341 BORDER_SIMPLE = _core_.BORDER_SIMPLE
342 BORDER_RAISED = _core_.BORDER_RAISED
343 BORDER_SUNKEN = _core_.BORDER_SUNKEN
344 BORDER_DOUBLE = _core_.BORDER_DOUBLE
345 BORDER_MASK = _core_.BORDER_MASK
346 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
349 DEFAULT = _core_.DEFAULT
350 DECORATIVE = _core_.DECORATIVE
351 ROMAN = _core_.ROMAN
352 SCRIPT = _core_.SCRIPT
353 SWISS = _core_.SWISS
354 MODERN = _core_.MODERN
355 TELETYPE = _core_.TELETYPE
356 VARIABLE = _core_.VARIABLE
357 FIXED = _core_.FIXED
358 NORMAL = _core_.NORMAL
359 LIGHT = _core_.LIGHT
360 BOLD = _core_.BOLD
361 ITALIC = _core_.ITALIC
362 SLANT = _core_.SLANT
363 SOLID = _core_.SOLID
364 DOT = _core_.DOT
365 LONG_DASH = _core_.LONG_DASH
366 SHORT_DASH = _core_.SHORT_DASH
367 DOT_DASH = _core_.DOT_DASH
368 USER_DASH = _core_.USER_DASH
369 TRANSPARENT = _core_.TRANSPARENT
370 STIPPLE = _core_.STIPPLE
371 STIPPLE_MASK = _core_.STIPPLE_MASK
372 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
373 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376 CROSS_HATCH = _core_.CROSS_HATCH
377 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378 VERTICAL_HATCH = _core_.VERTICAL_HATCH
379 JOIN_BEVEL = _core_.JOIN_BEVEL
380 JOIN_MITER = _core_.JOIN_MITER
381 JOIN_ROUND = _core_.JOIN_ROUND
382 CAP_ROUND = _core_.CAP_ROUND
383 CAP_PROJECTING = _core_.CAP_PROJECTING
384 CAP_BUTT = _core_.CAP_BUTT
385 CLEAR = _core_.CLEAR
386 XOR = _core_.XOR
387 INVERT = _core_.INVERT
388 OR_REVERSE = _core_.OR_REVERSE
389 AND_REVERSE = _core_.AND_REVERSE
390 COPY = _core_.COPY
391 AND = _core_.AND
392 AND_INVERT = _core_.AND_INVERT
393 NO_OP = _core_.NO_OP
394 NOR = _core_.NOR
395 EQUIV = _core_.EQUIV
396 SRC_INVERT = _core_.SRC_INVERT
397 OR_INVERT = _core_.OR_INVERT
398 NAND = _core_.NAND
399 OR = _core_.OR
400 SET = _core_.SET
401 WXK_BACK = _core_.WXK_BACK
402 WXK_TAB = _core_.WXK_TAB
403 WXK_RETURN = _core_.WXK_RETURN
404 WXK_ESCAPE = _core_.WXK_ESCAPE
405 WXK_SPACE = _core_.WXK_SPACE
406 WXK_DELETE = _core_.WXK_DELETE
407 WXK_START = _core_.WXK_START
408 WXK_LBUTTON = _core_.WXK_LBUTTON
409 WXK_RBUTTON = _core_.WXK_RBUTTON
410 WXK_CANCEL = _core_.WXK_CANCEL
411 WXK_MBUTTON = _core_.WXK_MBUTTON
412 WXK_CLEAR = _core_.WXK_CLEAR
413 WXK_SHIFT = _core_.WXK_SHIFT
414 WXK_ALT = _core_.WXK_ALT
415 WXK_CONTROL = _core_.WXK_CONTROL
416 WXK_MENU = _core_.WXK_MENU
417 WXK_PAUSE = _core_.WXK_PAUSE
418 WXK_CAPITAL = _core_.WXK_CAPITAL
419 WXK_PRIOR = _core_.WXK_PRIOR
420 WXK_NEXT = _core_.WXK_NEXT
421 WXK_END = _core_.WXK_END
422 WXK_HOME = _core_.WXK_HOME
423 WXK_LEFT = _core_.WXK_LEFT
424 WXK_UP = _core_.WXK_UP
425 WXK_RIGHT = _core_.WXK_RIGHT
426 WXK_DOWN = _core_.WXK_DOWN
427 WXK_SELECT = _core_.WXK_SELECT
428 WXK_PRINT = _core_.WXK_PRINT
429 WXK_EXECUTE = _core_.WXK_EXECUTE
430 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431 WXK_INSERT = _core_.WXK_INSERT
432 WXK_HELP = _core_.WXK_HELP
433 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443 WXK_MULTIPLY = _core_.WXK_MULTIPLY
444 WXK_ADD = _core_.WXK_ADD
445 WXK_SEPARATOR = _core_.WXK_SEPARATOR
446 WXK_SUBTRACT = _core_.WXK_SUBTRACT
447 WXK_DECIMAL = _core_.WXK_DECIMAL
448 WXK_DIVIDE = _core_.WXK_DIVIDE
449 WXK_F1 = _core_.WXK_F1
450 WXK_F2 = _core_.WXK_F2
451 WXK_F3 = _core_.WXK_F3
452 WXK_F4 = _core_.WXK_F4
453 WXK_F5 = _core_.WXK_F5
454 WXK_F6 = _core_.WXK_F6
455 WXK_F7 = _core_.WXK_F7
456 WXK_F8 = _core_.WXK_F8
457 WXK_F9 = _core_.WXK_F9
458 WXK_F10 = _core_.WXK_F10
459 WXK_F11 = _core_.WXK_F11
460 WXK_F12 = _core_.WXK_F12
461 WXK_F13 = _core_.WXK_F13
462 WXK_F14 = _core_.WXK_F14
463 WXK_F15 = _core_.WXK_F15
464 WXK_F16 = _core_.WXK_F16
465 WXK_F17 = _core_.WXK_F17
466 WXK_F18 = _core_.WXK_F18
467 WXK_F19 = _core_.WXK_F19
468 WXK_F20 = _core_.WXK_F20
469 WXK_F21 = _core_.WXK_F21
470 WXK_F22 = _core_.WXK_F22
471 WXK_F23 = _core_.WXK_F23
472 WXK_F24 = _core_.WXK_F24
473 WXK_NUMLOCK = _core_.WXK_NUMLOCK
474 WXK_SCROLL = _core_.WXK_SCROLL
475 WXK_PAGEUP = _core_.WXK_PAGEUP
476 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
507 WXK_COMMAND = _core_.WXK_COMMAND
508 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
528 PAPER_NONE = _core_.PAPER_NONE
529 PAPER_LETTER = _core_.PAPER_LETTER
530 PAPER_LEGAL = _core_.PAPER_LEGAL
531 PAPER_A4 = _core_.PAPER_A4
532 PAPER_CSHEET = _core_.PAPER_CSHEET
533 PAPER_DSHEET = _core_.PAPER_DSHEET
534 PAPER_ESHEET = _core_.PAPER_ESHEET
535 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536 PAPER_TABLOID = _core_.PAPER_TABLOID
537 PAPER_LEDGER = _core_.PAPER_LEDGER
538 PAPER_STATEMENT = _core_.PAPER_STATEMENT
539 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540 PAPER_A3 = _core_.PAPER_A3
541 PAPER_A4SMALL = _core_.PAPER_A4SMALL
542 PAPER_A5 = _core_.PAPER_A5
543 PAPER_B4 = _core_.PAPER_B4
544 PAPER_B5 = _core_.PAPER_B5
545 PAPER_FOLIO = _core_.PAPER_FOLIO
546 PAPER_QUARTO = _core_.PAPER_QUARTO
547 PAPER_10X14 = _core_.PAPER_10X14
548 PAPER_11X17 = _core_.PAPER_11X17
549 PAPER_NOTE = _core_.PAPER_NOTE
550 PAPER_ENV_9 = _core_.PAPER_ENV_9
551 PAPER_ENV_10 = _core_.PAPER_ENV_10
552 PAPER_ENV_11 = _core_.PAPER_ENV_11
553 PAPER_ENV_12 = _core_.PAPER_ENV_12
554 PAPER_ENV_14 = _core_.PAPER_ENV_14
555 PAPER_ENV_DL = _core_.PAPER_ENV_DL
556 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572 PAPER_9X11 = _core_.PAPER_9X11
573 PAPER_10X11 = _core_.PAPER_10X11
574 PAPER_15X11 = _core_.PAPER_15X11
575 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583 PAPER_A_PLUS = _core_.PAPER_A_PLUS
584 PAPER_B_PLUS = _core_.PAPER_B_PLUS
585 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592 PAPER_A2 = _core_.PAPER_A2
593 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
595 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
596 PAPER_A6 = _core_.PAPER_A6
597 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
598 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
599 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
600 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
601 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
602 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
603 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
604 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
605 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
606 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
607 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
608 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
610 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
611 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
612 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
613 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
614 PAPER_B6_JIS = _core_.PAPER_B6_JIS
615 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
616 PAPER_12X11 = _core_.PAPER_12X11
617 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
618 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
619 PAPER_P16K = _core_.PAPER_P16K
620 PAPER_P32K = _core_.PAPER_P32K
621 PAPER_P32KBIG = _core_.PAPER_P32KBIG
622 PAPER_PENV_1 = _core_.PAPER_PENV_1
623 PAPER_PENV_2 = _core_.PAPER_PENV_2
624 PAPER_PENV_3 = _core_.PAPER_PENV_3
625 PAPER_PENV_4 = _core_.PAPER_PENV_4
626 PAPER_PENV_5 = _core_.PAPER_PENV_5
627 PAPER_PENV_6 = _core_.PAPER_PENV_6
628 PAPER_PENV_7 = _core_.PAPER_PENV_7
629 PAPER_PENV_8 = _core_.PAPER_PENV_8
630 PAPER_PENV_9 = _core_.PAPER_PENV_9
631 PAPER_PENV_10 = _core_.PAPER_PENV_10
632 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
633 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
634 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
635 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
636 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
637 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
638 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
639 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
640 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
641 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
642 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
643 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
644 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
645 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
646 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
647 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
648 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
649 ITEM_NORMAL = _core_.ITEM_NORMAL
650 ITEM_CHECK = _core_.ITEM_CHECK
651 ITEM_RADIO = _core_.ITEM_RADIO
652 ITEM_MAX = _core_.ITEM_MAX
653 HT_NOWHERE = _core_.HT_NOWHERE
654 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
655 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
656 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
657 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
658 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
659 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
660 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
661 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
662 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
663 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
664 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
665 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
666 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
667 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
668 HT_MAX = _core_.HT_MAX
669 MOD_NONE = _core_.MOD_NONE
670 MOD_ALT = _core_.MOD_ALT
671 MOD_CONTROL = _core_.MOD_CONTROL
672 MOD_ALTGR = _core_.MOD_ALTGR
673 MOD_SHIFT = _core_.MOD_SHIFT
674 MOD_META = _core_.MOD_META
675 MOD_WIN = _core_.MOD_WIN
676 MOD_CMD = _core_.MOD_CMD
677 MOD_ALL = _core_.MOD_ALL
678 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
681 #---------------------------------------------------------------------------
682
683 class Object(object):
684 """
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
687 """
688 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
689 def __init__(self): raise AttributeError, "No constructor defined"
690 __repr__ = _swig_repr
691 def GetClassName(*args, **kwargs):
692 """
693 GetClassName(self) -> String
694
695 Returns the class name of the C++ class using wxRTTI.
696 """
697 return _core_.Object_GetClassName(*args, **kwargs)
698
699 def Destroy(*args, **kwargs):
700 """
701 Destroy(self)
702
703 Deletes the C++ object this Python object is a proxy for.
704 """
705 val = _core_.Object_Destroy(*args, **kwargs)
706 args[0].thisown = 0
707 return val
708
709 _core_.Object_swigregister(Object)
710 _wxPySetDictionary = _core_._wxPySetDictionary
711 cvar = _core_.cvar
712 EmptyString = cvar.EmptyString
713
714 #---------------------------------------------------------------------------
715
716 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
717 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
718 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
719 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
720 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
721 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
722 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
723 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
724 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
725 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
726 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
727 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
728 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
729 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
730 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
731 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
732 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
733 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
734 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
735 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
736 CURSOR_NONE = _core_.CURSOR_NONE
737 CURSOR_ARROW = _core_.CURSOR_ARROW
738 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
739 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
740 CURSOR_CHAR = _core_.CURSOR_CHAR
741 CURSOR_CROSS = _core_.CURSOR_CROSS
742 CURSOR_HAND = _core_.CURSOR_HAND
743 CURSOR_IBEAM = _core_.CURSOR_IBEAM
744 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
745 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
746 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
747 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
748 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
749 CURSOR_PENCIL = _core_.CURSOR_PENCIL
750 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
751 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
752 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
753 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
754 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
755 CURSOR_SIZENS = _core_.CURSOR_SIZENS
756 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
757 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
758 CURSOR_SIZING = _core_.CURSOR_SIZING
759 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
760 CURSOR_WAIT = _core_.CURSOR_WAIT
761 CURSOR_WATCH = _core_.CURSOR_WATCH
762 CURSOR_BLANK = _core_.CURSOR_BLANK
763 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
764 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
765 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
766 CURSOR_MAX = _core_.CURSOR_MAX
767 #---------------------------------------------------------------------------
768
769 class Size(object):
770 """
771 wx.Size is a useful data structure used to represent the size of
772 something. It simply contains integer width and height
773 properties. In most places in wxPython where a wx.Size is
774 expected a (width, height) tuple can be used instead.
775 """
776 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
777 __repr__ = _swig_repr
778 width = property(_core_.Size_width_get, _core_.Size_width_set)
779 height = property(_core_.Size_height_get, _core_.Size_height_set)
780 x = width; y = height
781 def __init__(self, *args, **kwargs):
782 """
783 __init__(self, int w=0, int h=0) -> Size
784
785 Creates a size object.
786 """
787 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
788 __swig_destroy__ = _core_.delete_Size
789 __del__ = lambda self : None;
790 def __eq__(*args, **kwargs):
791 """
792 __eq__(self, PyObject other) -> bool
793
794 Test for equality of wx.Size objects.
795 """
796 return _core_.Size___eq__(*args, **kwargs)
797
798 def __ne__(*args, **kwargs):
799 """
800 __ne__(self, PyObject other) -> bool
801
802 Test for inequality of wx.Size objects.
803 """
804 return _core_.Size___ne__(*args, **kwargs)
805
806 def __add__(*args, **kwargs):
807 """
808 __add__(self, Size sz) -> Size
809
810 Add sz's proprties to this and return the result.
811 """
812 return _core_.Size___add__(*args, **kwargs)
813
814 def __sub__(*args, **kwargs):
815 """
816 __sub__(self, Size sz) -> Size
817
818 Subtract sz's properties from this and return the result.
819 """
820 return _core_.Size___sub__(*args, **kwargs)
821
822 def IncTo(*args, **kwargs):
823 """
824 IncTo(self, Size sz)
825
826 Increments this object so that both of its dimensions are not less
827 than the corresponding dimensions of the size.
828 """
829 return _core_.Size_IncTo(*args, **kwargs)
830
831 def DecTo(*args, **kwargs):
832 """
833 DecTo(self, Size sz)
834
835 Decrements this object so that both of its dimensions are not greater
836 than the corresponding dimensions of the size.
837 """
838 return _core_.Size_DecTo(*args, **kwargs)
839
840 def Scale(*args, **kwargs):
841 """
842 Scale(self, float xscale, float yscale)
843
844 Scales the dimensions of this object by the given factors.
845 """
846 return _core_.Size_Scale(*args, **kwargs)
847
848 def Set(*args, **kwargs):
849 """
850 Set(self, int w, int h)
851
852 Set both width and height.
853 """
854 return _core_.Size_Set(*args, **kwargs)
855
856 def SetWidth(*args, **kwargs):
857 """SetWidth(self, int w)"""
858 return _core_.Size_SetWidth(*args, **kwargs)
859
860 def SetHeight(*args, **kwargs):
861 """SetHeight(self, int h)"""
862 return _core_.Size_SetHeight(*args, **kwargs)
863
864 def GetWidth(*args, **kwargs):
865 """GetWidth(self) -> int"""
866 return _core_.Size_GetWidth(*args, **kwargs)
867
868 def GetHeight(*args, **kwargs):
869 """GetHeight(self) -> int"""
870 return _core_.Size_GetHeight(*args, **kwargs)
871
872 def IsFullySpecified(*args, **kwargs):
873 """
874 IsFullySpecified(self) -> bool
875
876 Returns True if both components of the size are non-default values.
877 """
878 return _core_.Size_IsFullySpecified(*args, **kwargs)
879
880 def SetDefaults(*args, **kwargs):
881 """
882 SetDefaults(self, Size size)
883
884 Combine this size with the other one replacing the default components
885 of this object (i.e. equal to -1) with those of the other.
886 """
887 return _core_.Size_SetDefaults(*args, **kwargs)
888
889 def Get(*args, **kwargs):
890 """
891 Get() -> (width,height)
892
893 Returns the width and height properties as a tuple.
894 """
895 return _core_.Size_Get(*args, **kwargs)
896
897 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
898 def __str__(self): return str(self.Get())
899 def __repr__(self): return 'wx.Size'+str(self.Get())
900 def __len__(self): return len(self.Get())
901 def __getitem__(self, index): return self.Get()[index]
902 def __setitem__(self, index, val):
903 if index == 0: self.width = val
904 elif index == 1: self.height = val
905 else: raise IndexError
906 def __nonzero__(self): return self.Get() != (0,0)
907 __safe_for_unpickling__ = True
908 def __reduce__(self): return (wx.Size, self.Get())
909
910 _core_.Size_swigregister(Size)
911
912 #---------------------------------------------------------------------------
913
914 class RealPoint(object):
915 """
916 A data structure for representing a point or position with floating
917 point x and y properties. In wxPython most places that expect a
918 wx.RealPoint can also accept a (x,y) tuple.
919 """
920 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
921 __repr__ = _swig_repr
922 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
923 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
924 def __init__(self, *args, **kwargs):
925 """
926 __init__(self, double x=0.0, double y=0.0) -> RealPoint
927
928 Create a wx.RealPoint object
929 """
930 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
931 __swig_destroy__ = _core_.delete_RealPoint
932 __del__ = lambda self : None;
933 def __eq__(*args, **kwargs):
934 """
935 __eq__(self, PyObject other) -> bool
936
937 Test for equality of wx.RealPoint objects.
938 """
939 return _core_.RealPoint___eq__(*args, **kwargs)
940
941 def __ne__(*args, **kwargs):
942 """
943 __ne__(self, PyObject other) -> bool
944
945 Test for inequality of wx.RealPoint objects.
946 """
947 return _core_.RealPoint___ne__(*args, **kwargs)
948
949 def __add__(*args, **kwargs):
950 """
951 __add__(self, RealPoint pt) -> RealPoint
952
953 Add pt's proprties to this and return the result.
954 """
955 return _core_.RealPoint___add__(*args, **kwargs)
956
957 def __sub__(*args, **kwargs):
958 """
959 __sub__(self, RealPoint pt) -> RealPoint
960
961 Subtract pt's proprties from this and return the result
962 """
963 return _core_.RealPoint___sub__(*args, **kwargs)
964
965 def Set(*args, **kwargs):
966 """
967 Set(self, double x, double y)
968
969 Set both the x and y properties
970 """
971 return _core_.RealPoint_Set(*args, **kwargs)
972
973 def Get(*args, **kwargs):
974 """
975 Get() -> (x,y)
976
977 Return the x and y properties as a tuple.
978 """
979 return _core_.RealPoint_Get(*args, **kwargs)
980
981 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
982 def __str__(self): return str(self.Get())
983 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
984 def __len__(self): return len(self.Get())
985 def __getitem__(self, index): return self.Get()[index]
986 def __setitem__(self, index, val):
987 if index == 0: self.x = val
988 elif index == 1: self.y = val
989 else: raise IndexError
990 def __nonzero__(self): return self.Get() != (0.0, 0.0)
991 __safe_for_unpickling__ = True
992 def __reduce__(self): return (wx.RealPoint, self.Get())
993
994 _core_.RealPoint_swigregister(RealPoint)
995
996 #---------------------------------------------------------------------------
997
998 class Point(object):
999 """
1000 A data structure for representing a point or position with integer x
1001 and y properties. Most places in wxPython that expect a wx.Point can
1002 also accept a (x,y) tuple.
1003 """
1004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1005 __repr__ = _swig_repr
1006 x = property(_core_.Point_x_get, _core_.Point_x_set)
1007 y = property(_core_.Point_y_get, _core_.Point_y_set)
1008 def __init__(self, *args, **kwargs):
1009 """
1010 __init__(self, int x=0, int y=0) -> Point
1011
1012 Create a wx.Point object
1013 """
1014 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1015 __swig_destroy__ = _core_.delete_Point
1016 __del__ = lambda self : None;
1017 def __eq__(*args, **kwargs):
1018 """
1019 __eq__(self, PyObject other) -> bool
1020
1021 Test for equality of wx.Point objects.
1022 """
1023 return _core_.Point___eq__(*args, **kwargs)
1024
1025 def __ne__(*args, **kwargs):
1026 """
1027 __ne__(self, PyObject other) -> bool
1028
1029 Test for inequality of wx.Point objects.
1030 """
1031 return _core_.Point___ne__(*args, **kwargs)
1032
1033 def __add__(*args, **kwargs):
1034 """
1035 __add__(self, Point pt) -> Point
1036
1037 Add pt's proprties to this and return the result.
1038 """
1039 return _core_.Point___add__(*args, **kwargs)
1040
1041 def __sub__(*args, **kwargs):
1042 """
1043 __sub__(self, Point pt) -> Point
1044
1045 Subtract pt's proprties from this and return the result
1046 """
1047 return _core_.Point___sub__(*args, **kwargs)
1048
1049 def __iadd__(*args, **kwargs):
1050 """
1051 __iadd__(self, Point pt) -> Point
1052
1053 Add pt to this object.
1054 """
1055 return _core_.Point___iadd__(*args, **kwargs)
1056
1057 def __isub__(*args, **kwargs):
1058 """
1059 __isub__(self, Point pt) -> Point
1060
1061 Subtract pt from this object.
1062 """
1063 return _core_.Point___isub__(*args, **kwargs)
1064
1065 def Set(*args, **kwargs):
1066 """
1067 Set(self, long x, long y)
1068
1069 Set both the x and y properties
1070 """
1071 return _core_.Point_Set(*args, **kwargs)
1072
1073 def Get(*args, **kwargs):
1074 """
1075 Get() -> (x,y)
1076
1077 Return the x and y properties as a tuple.
1078 """
1079 return _core_.Point_Get(*args, **kwargs)
1080
1081 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1082 def __str__(self): return str(self.Get())
1083 def __repr__(self): return 'wx.Point'+str(self.Get())
1084 def __len__(self): return len(self.Get())
1085 def __getitem__(self, index): return self.Get()[index]
1086 def __setitem__(self, index, val):
1087 if index == 0: self.x = val
1088 elif index == 1: self.y = val
1089 else: raise IndexError
1090 def __nonzero__(self): return self.Get() != (0,0)
1091 __safe_for_unpickling__ = True
1092 def __reduce__(self): return (wx.Point, self.Get())
1093
1094 _core_.Point_swigregister(Point)
1095
1096 #---------------------------------------------------------------------------
1097
1098 class Rect(object):
1099 """
1100 A class for representing and manipulating rectangles. It has x, y,
1101 width and height properties. In wxPython most palces that expect a
1102 wx.Rect can also accept a (x,y,width,height) tuple.
1103 """
1104 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1105 __repr__ = _swig_repr
1106 def __init__(self, *args, **kwargs):
1107 """
1108 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1109
1110 Create a new Rect object.
1111 """
1112 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1113 __swig_destroy__ = _core_.delete_Rect
1114 __del__ = lambda self : None;
1115 def GetX(*args, **kwargs):
1116 """GetX(self) -> int"""
1117 return _core_.Rect_GetX(*args, **kwargs)
1118
1119 def SetX(*args, **kwargs):
1120 """SetX(self, int x)"""
1121 return _core_.Rect_SetX(*args, **kwargs)
1122
1123 def GetY(*args, **kwargs):
1124 """GetY(self) -> int"""
1125 return _core_.Rect_GetY(*args, **kwargs)
1126
1127 def SetY(*args, **kwargs):
1128 """SetY(self, int y)"""
1129 return _core_.Rect_SetY(*args, **kwargs)
1130
1131 def GetWidth(*args, **kwargs):
1132 """GetWidth(self) -> int"""
1133 return _core_.Rect_GetWidth(*args, **kwargs)
1134
1135 def SetWidth(*args, **kwargs):
1136 """SetWidth(self, int w)"""
1137 return _core_.Rect_SetWidth(*args, **kwargs)
1138
1139 def GetHeight(*args, **kwargs):
1140 """GetHeight(self) -> int"""
1141 return _core_.Rect_GetHeight(*args, **kwargs)
1142
1143 def SetHeight(*args, **kwargs):
1144 """SetHeight(self, int h)"""
1145 return _core_.Rect_SetHeight(*args, **kwargs)
1146
1147 def GetPosition(*args, **kwargs):
1148 """GetPosition(self) -> Point"""
1149 return _core_.Rect_GetPosition(*args, **kwargs)
1150
1151 def SetPosition(*args, **kwargs):
1152 """SetPosition(self, Point p)"""
1153 return _core_.Rect_SetPosition(*args, **kwargs)
1154
1155 def GetSize(*args, **kwargs):
1156 """GetSize(self) -> Size"""
1157 return _core_.Rect_GetSize(*args, **kwargs)
1158
1159 def SetSize(*args, **kwargs):
1160 """SetSize(self, Size s)"""
1161 return _core_.Rect_SetSize(*args, **kwargs)
1162
1163 def IsEmpty(*args, **kwargs):
1164 """IsEmpty(self) -> bool"""
1165 return _core_.Rect_IsEmpty(*args, **kwargs)
1166
1167 def GetTopLeft(*args, **kwargs):
1168 """GetTopLeft(self) -> Point"""
1169 return _core_.Rect_GetTopLeft(*args, **kwargs)
1170
1171 def SetTopLeft(*args, **kwargs):
1172 """SetTopLeft(self, Point p)"""
1173 return _core_.Rect_SetTopLeft(*args, **kwargs)
1174
1175 def GetBottomRight(*args, **kwargs):
1176 """GetBottomRight(self) -> Point"""
1177 return _core_.Rect_GetBottomRight(*args, **kwargs)
1178
1179 def SetBottomRight(*args, **kwargs):
1180 """SetBottomRight(self, Point p)"""
1181 return _core_.Rect_SetBottomRight(*args, **kwargs)
1182
1183 def GetLeft(*args, **kwargs):
1184 """GetLeft(self) -> int"""
1185 return _core_.Rect_GetLeft(*args, **kwargs)
1186
1187 def GetTop(*args, **kwargs):
1188 """GetTop(self) -> int"""
1189 return _core_.Rect_GetTop(*args, **kwargs)
1190
1191 def GetBottom(*args, **kwargs):
1192 """GetBottom(self) -> int"""
1193 return _core_.Rect_GetBottom(*args, **kwargs)
1194
1195 def GetRight(*args, **kwargs):
1196 """GetRight(self) -> int"""
1197 return _core_.Rect_GetRight(*args, **kwargs)
1198
1199 def SetLeft(*args, **kwargs):
1200 """SetLeft(self, int left)"""
1201 return _core_.Rect_SetLeft(*args, **kwargs)
1202
1203 def SetRight(*args, **kwargs):
1204 """SetRight(self, int right)"""
1205 return _core_.Rect_SetRight(*args, **kwargs)
1206
1207 def SetTop(*args, **kwargs):
1208 """SetTop(self, int top)"""
1209 return _core_.Rect_SetTop(*args, **kwargs)
1210
1211 def SetBottom(*args, **kwargs):
1212 """SetBottom(self, int bottom)"""
1213 return _core_.Rect_SetBottom(*args, **kwargs)
1214
1215 position = property(GetPosition, SetPosition)
1216 size = property(GetSize, SetSize)
1217 left = property(GetLeft, SetLeft)
1218 right = property(GetRight, SetRight)
1219 top = property(GetTop, SetTop)
1220 bottom = property(GetBottom, SetBottom)
1221
1222 def Inflate(*args, **kwargs):
1223 """
1224 Inflate(self, int dx, int dy) -> Rect
1225
1226 Increases the size of the rectangle.
1227
1228 The left border is moved farther left and the right border is moved
1229 farther right by ``dx``. The upper border is moved farther up and the
1230 bottom border is moved farther down by ``dy``. (Note the the width and
1231 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1232 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1233 opposite happens: the rectangle size decreases in the respective
1234 direction.
1235
1236 The change is made to the rectangle inplace, if instead you need a
1237 copy that is inflated, preserving the original then make the copy
1238 first::
1239
1240 copy = wx.Rect(*original)
1241 copy.Inflate(10,15)
1242
1243
1244 """
1245 return _core_.Rect_Inflate(*args, **kwargs)
1246
1247 def Deflate(*args, **kwargs):
1248 """
1249 Deflate(self, int dx, int dy) -> Rect
1250
1251 Decrease the rectangle size. This method is the opposite of `Inflate`
1252 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1253 `Inflate` for a full description.
1254 """
1255 return _core_.Rect_Deflate(*args, **kwargs)
1256
1257 def OffsetXY(*args, **kwargs):
1258 """
1259 OffsetXY(self, int dx, int dy)
1260
1261 Moves the rectangle by the specified offset. If dx is positive, the
1262 rectangle is moved to the right, if dy is positive, it is moved to the
1263 bottom, otherwise it is moved to the left or top respectively.
1264 """
1265 return _core_.Rect_OffsetXY(*args, **kwargs)
1266
1267 def Offset(*args, **kwargs):
1268 """
1269 Offset(self, Point pt)
1270
1271 Same as `OffsetXY` but uses dx,dy from Point
1272 """
1273 return _core_.Rect_Offset(*args, **kwargs)
1274
1275 def Intersect(*args, **kwargs):
1276 """
1277 Intersect(self, Rect rect) -> Rect
1278
1279 Returns the intersectsion of this rectangle and rect.
1280 """
1281 return _core_.Rect_Intersect(*args, **kwargs)
1282
1283 def Union(*args, **kwargs):
1284 """
1285 Union(self, Rect rect) -> Rect
1286
1287 Returns the union of this rectangle and rect.
1288 """
1289 return _core_.Rect_Union(*args, **kwargs)
1290
1291 def __add__(*args, **kwargs):
1292 """
1293 __add__(self, Rect rect) -> Rect
1294
1295 Add the properties of rect to this rectangle and return the result.
1296 """
1297 return _core_.Rect___add__(*args, **kwargs)
1298
1299 def __iadd__(*args, **kwargs):
1300 """
1301 __iadd__(self, Rect rect) -> Rect
1302
1303 Add the properties of rect to this rectangle, updating this rectangle.
1304 """
1305 return _core_.Rect___iadd__(*args, **kwargs)
1306
1307 def __eq__(*args, **kwargs):
1308 """
1309 __eq__(self, PyObject other) -> bool
1310
1311 Test for equality of wx.Rect objects.
1312 """
1313 return _core_.Rect___eq__(*args, **kwargs)
1314
1315 def __ne__(*args, **kwargs):
1316 """
1317 __ne__(self, PyObject other) -> bool
1318
1319 Test for inequality of wx.Rect objects.
1320 """
1321 return _core_.Rect___ne__(*args, **kwargs)
1322
1323 def InsideXY(*args, **kwargs):
1324 """
1325 InsideXY(self, int x, int y) -> bool
1326
1327 Return True if the point is (not strcitly) inside the rect.
1328 """
1329 return _core_.Rect_InsideXY(*args, **kwargs)
1330
1331 def Inside(*args, **kwargs):
1332 """
1333 Inside(self, Point pt) -> bool
1334
1335 Return True if the point is (not strcitly) inside the rect.
1336 """
1337 return _core_.Rect_Inside(*args, **kwargs)
1338
1339 def InsideRect(*args, **kwargs):
1340 """
1341 InsideRect(self, Rect rect) -> bool
1342
1343 Returns ``True`` if the given rectangle is completely inside this
1344 rectangle or touches its boundary.
1345 """
1346 return _core_.Rect_InsideRect(*args, **kwargs)
1347
1348 def Intersects(*args, **kwargs):
1349 """
1350 Intersects(self, Rect rect) -> bool
1351
1352 Returns True if the rectangles have a non empty intersection.
1353 """
1354 return _core_.Rect_Intersects(*args, **kwargs)
1355
1356 def CenterIn(*args, **kwargs):
1357 """
1358 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1359
1360 Center this rectangle within the one passed to the method, which is
1361 usually, but not necessarily, the larger one.
1362 """
1363 return _core_.Rect_CenterIn(*args, **kwargs)
1364
1365 CentreIn = CenterIn
1366 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1367 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1368 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1369 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1370 def Set(*args, **kwargs):
1371 """
1372 Set(self, int x=0, int y=0, int width=0, int height=0)
1373
1374 Set all rectangle properties.
1375 """
1376 return _core_.Rect_Set(*args, **kwargs)
1377
1378 def Get(*args, **kwargs):
1379 """
1380 Get() -> (x,y,width,height)
1381
1382 Return the rectangle properties as a tuple.
1383 """
1384 return _core_.Rect_Get(*args, **kwargs)
1385
1386 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1387 def __str__(self): return str(self.Get())
1388 def __repr__(self): return 'wx.Rect'+str(self.Get())
1389 def __len__(self): return len(self.Get())
1390 def __getitem__(self, index): return self.Get()[index]
1391 def __setitem__(self, index, val):
1392 if index == 0: self.x = val
1393 elif index == 1: self.y = val
1394 elif index == 2: self.width = val
1395 elif index == 3: self.height = val
1396 else: raise IndexError
1397 def __nonzero__(self): return self.Get() != (0,0,0,0)
1398 __safe_for_unpickling__ = True
1399 def __reduce__(self): return (wx.Rect, self.Get())
1400
1401 _core_.Rect_swigregister(Rect)
1402
1403 def RectPP(*args, **kwargs):
1404 """
1405 RectPP(Point topLeft, Point bottomRight) -> Rect
1406
1407 Create a new Rect object from Points representing two corners.
1408 """
1409 val = _core_.new_RectPP(*args, **kwargs)
1410 return val
1411
1412 def RectPS(*args, **kwargs):
1413 """
1414 RectPS(Point pos, Size size) -> Rect
1415
1416 Create a new Rect from a position and size.
1417 """
1418 val = _core_.new_RectPS(*args, **kwargs)
1419 return val
1420
1421 def RectS(*args, **kwargs):
1422 """
1423 RectS(Size size) -> Rect
1424
1425 Create a new Rect from a size only.
1426 """
1427 val = _core_.new_RectS(*args, **kwargs)
1428 return val
1429
1430
1431 def IntersectRect(*args, **kwargs):
1432 """
1433 IntersectRect(Rect r1, Rect r2) -> Rect
1434
1435 Calculate and return the intersection of r1 and r2.
1436 """
1437 return _core_.IntersectRect(*args, **kwargs)
1438 #---------------------------------------------------------------------------
1439
1440 class Point2D(object):
1441 """
1442 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1443 with floating point values.
1444 """
1445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1446 __repr__ = _swig_repr
1447 def __init__(self, *args, **kwargs):
1448 """
1449 __init__(self, double x=0.0, double y=0.0) -> Point2D
1450
1451 Create a w.Point2D object.
1452 """
1453 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1454 def GetFloor(*args, **kwargs):
1455 """
1456 GetFloor() -> (x,y)
1457
1458 Convert to integer
1459 """
1460 return _core_.Point2D_GetFloor(*args, **kwargs)
1461
1462 def GetRounded(*args, **kwargs):
1463 """
1464 GetRounded() -> (x,y)
1465
1466 Convert to integer
1467 """
1468 return _core_.Point2D_GetRounded(*args, **kwargs)
1469
1470 def GetVectorLength(*args, **kwargs):
1471 """GetVectorLength(self) -> double"""
1472 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1473
1474 def GetVectorAngle(*args, **kwargs):
1475 """GetVectorAngle(self) -> double"""
1476 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1477
1478 def SetVectorLength(*args, **kwargs):
1479 """SetVectorLength(self, double length)"""
1480 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1481
1482 def SetVectorAngle(*args, **kwargs):
1483 """SetVectorAngle(self, double degrees)"""
1484 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1485
1486 def SetPolarCoordinates(self, angle, length):
1487 self.SetVectorLength(length)
1488 self.SetVectorAngle(angle)
1489 def Normalize(self):
1490 self.SetVectorLength(1.0)
1491
1492 def GetDistance(*args, **kwargs):
1493 """GetDistance(self, Point2D pt) -> double"""
1494 return _core_.Point2D_GetDistance(*args, **kwargs)
1495
1496 def GetDistanceSquare(*args, **kwargs):
1497 """GetDistanceSquare(self, Point2D pt) -> double"""
1498 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1499
1500 def GetDotProduct(*args, **kwargs):
1501 """GetDotProduct(self, Point2D vec) -> double"""
1502 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1503
1504 def GetCrossProduct(*args, **kwargs):
1505 """GetCrossProduct(self, Point2D vec) -> double"""
1506 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1507
1508 def __neg__(*args, **kwargs):
1509 """
1510 __neg__(self) -> Point2D
1511
1512 the reflection of this point
1513 """
1514 return _core_.Point2D___neg__(*args, **kwargs)
1515
1516 def __iadd__(*args, **kwargs):
1517 """__iadd__(self, Point2D pt) -> Point2D"""
1518 return _core_.Point2D___iadd__(*args, **kwargs)
1519
1520 def __isub__(*args, **kwargs):
1521 """__isub__(self, Point2D pt) -> Point2D"""
1522 return _core_.Point2D___isub__(*args, **kwargs)
1523
1524 def __imul__(*args, **kwargs):
1525 """__imul__(self, Point2D pt) -> Point2D"""
1526 return _core_.Point2D___imul__(*args, **kwargs)
1527
1528 def __idiv__(*args, **kwargs):
1529 """__idiv__(self, Point2D pt) -> Point2D"""
1530 return _core_.Point2D___idiv__(*args, **kwargs)
1531
1532 def __eq__(*args, **kwargs):
1533 """
1534 __eq__(self, PyObject other) -> bool
1535
1536 Test for equality of wx.Point2D objects.
1537 """
1538 return _core_.Point2D___eq__(*args, **kwargs)
1539
1540 def __ne__(*args, **kwargs):
1541 """
1542 __ne__(self, PyObject other) -> bool
1543
1544 Test for inequality of wx.Point2D objects.
1545 """
1546 return _core_.Point2D___ne__(*args, **kwargs)
1547
1548 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1549 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1550 def Set(*args, **kwargs):
1551 """Set(self, double x=0, double y=0)"""
1552 return _core_.Point2D_Set(*args, **kwargs)
1553
1554 def Get(*args, **kwargs):
1555 """
1556 Get() -> (x,y)
1557
1558 Return x and y properties as a tuple.
1559 """
1560 return _core_.Point2D_Get(*args, **kwargs)
1561
1562 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1563 def __str__(self): return str(self.Get())
1564 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1565 def __len__(self): return len(self.Get())
1566 def __getitem__(self, index): return self.Get()[index]
1567 def __setitem__(self, index, val):
1568 if index == 0: self.x = val
1569 elif index == 1: self.y = val
1570 else: raise IndexError
1571 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1572 __safe_for_unpickling__ = True
1573 def __reduce__(self): return (wx.Point2D, self.Get())
1574
1575 _core_.Point2D_swigregister(Point2D)
1576
1577 def Point2DCopy(*args, **kwargs):
1578 """
1579 Point2DCopy(Point2D pt) -> Point2D
1580
1581 Create a w.Point2D object.
1582 """
1583 val = _core_.new_Point2DCopy(*args, **kwargs)
1584 return val
1585
1586 def Point2DFromPoint(*args, **kwargs):
1587 """
1588 Point2DFromPoint(Point pt) -> Point2D
1589
1590 Create a w.Point2D object.
1591 """
1592 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1593 return val
1594
1595 #---------------------------------------------------------------------------
1596
1597 FromStart = _core_.FromStart
1598 FromCurrent = _core_.FromCurrent
1599 FromEnd = _core_.FromEnd
1600 class InputStream(object):
1601 """Proxy of C++ InputStream class"""
1602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1603 __repr__ = _swig_repr
1604 def __init__(self, *args, **kwargs):
1605 """__init__(self, PyObject p) -> InputStream"""
1606 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1607 __swig_destroy__ = _core_.delete_InputStream
1608 __del__ = lambda self : None;
1609 def close(*args, **kwargs):
1610 """close(self)"""
1611 return _core_.InputStream_close(*args, **kwargs)
1612
1613 def flush(*args, **kwargs):
1614 """flush(self)"""
1615 return _core_.InputStream_flush(*args, **kwargs)
1616
1617 def eof(*args, **kwargs):
1618 """eof(self) -> bool"""
1619 return _core_.InputStream_eof(*args, **kwargs)
1620
1621 def read(*args, **kwargs):
1622 """read(self, int size=-1) -> PyObject"""
1623 return _core_.InputStream_read(*args, **kwargs)
1624
1625 def readline(*args, **kwargs):
1626 """readline(self, int size=-1) -> PyObject"""
1627 return _core_.InputStream_readline(*args, **kwargs)
1628
1629 def readlines(*args, **kwargs):
1630 """readlines(self, int sizehint=-1) -> PyObject"""
1631 return _core_.InputStream_readlines(*args, **kwargs)
1632
1633 def seek(*args, **kwargs):
1634 """seek(self, int offset, int whence=0)"""
1635 return _core_.InputStream_seek(*args, **kwargs)
1636
1637 def tell(*args, **kwargs):
1638 """tell(self) -> int"""
1639 return _core_.InputStream_tell(*args, **kwargs)
1640
1641 def Peek(*args, **kwargs):
1642 """Peek(self) -> char"""
1643 return _core_.InputStream_Peek(*args, **kwargs)
1644
1645 def GetC(*args, **kwargs):
1646 """GetC(self) -> char"""
1647 return _core_.InputStream_GetC(*args, **kwargs)
1648
1649 def LastRead(*args, **kwargs):
1650 """LastRead(self) -> size_t"""
1651 return _core_.InputStream_LastRead(*args, **kwargs)
1652
1653 def CanRead(*args, **kwargs):
1654 """CanRead(self) -> bool"""
1655 return _core_.InputStream_CanRead(*args, **kwargs)
1656
1657 def Eof(*args, **kwargs):
1658 """Eof(self) -> bool"""
1659 return _core_.InputStream_Eof(*args, **kwargs)
1660
1661 def Ungetch(*args, **kwargs):
1662 """Ungetch(self, char c) -> bool"""
1663 return _core_.InputStream_Ungetch(*args, **kwargs)
1664
1665 def SeekI(*args, **kwargs):
1666 """SeekI(self, long pos, int mode=FromStart) -> long"""
1667 return _core_.InputStream_SeekI(*args, **kwargs)
1668
1669 def TellI(*args, **kwargs):
1670 """TellI(self) -> long"""
1671 return _core_.InputStream_TellI(*args, **kwargs)
1672
1673 _core_.InputStream_swigregister(InputStream)
1674 DefaultPosition = cvar.DefaultPosition
1675 DefaultSize = cvar.DefaultSize
1676
1677 class OutputStream(object):
1678 """Proxy of C++ OutputStream class"""
1679 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1680 def __init__(self): raise AttributeError, "No constructor defined"
1681 __repr__ = _swig_repr
1682 def write(*args, **kwargs):
1683 """write(self, PyObject obj)"""
1684 return _core_.OutputStream_write(*args, **kwargs)
1685
1686 def LastWrite(*args, **kwargs):
1687 """LastWrite(self) -> size_t"""
1688 return _core_.OutputStream_LastWrite(*args, **kwargs)
1689
1690 _core_.OutputStream_swigregister(OutputStream)
1691
1692 #---------------------------------------------------------------------------
1693
1694 class FSFile(Object):
1695 """Proxy of C++ FSFile class"""
1696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1697 __repr__ = _swig_repr
1698 def __init__(self, *args, **kwargs):
1699 """
1700 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1701 DateTime modif) -> FSFile
1702 """
1703 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1704 __swig_destroy__ = _core_.delete_FSFile
1705 __del__ = lambda self : None;
1706 def GetStream(*args, **kwargs):
1707 """GetStream(self) -> InputStream"""
1708 return _core_.FSFile_GetStream(*args, **kwargs)
1709
1710 def DetachStream(*args, **kwargs):
1711 """DetachStream(self)"""
1712 return _core_.FSFile_DetachStream(*args, **kwargs)
1713
1714 def GetMimeType(*args, **kwargs):
1715 """GetMimeType(self) -> String"""
1716 return _core_.FSFile_GetMimeType(*args, **kwargs)
1717
1718 def GetLocation(*args, **kwargs):
1719 """GetLocation(self) -> String"""
1720 return _core_.FSFile_GetLocation(*args, **kwargs)
1721
1722 def GetAnchor(*args, **kwargs):
1723 """GetAnchor(self) -> String"""
1724 return _core_.FSFile_GetAnchor(*args, **kwargs)
1725
1726 def GetModificationTime(*args, **kwargs):
1727 """GetModificationTime(self) -> DateTime"""
1728 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1729
1730 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1731 Location = property(GetLocation,doc="See `GetLocation`")
1732 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1733 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1734 Stream = property(GetStream,doc="See `GetStream`")
1735 _core_.FSFile_swigregister(FSFile)
1736
1737 class CPPFileSystemHandler(object):
1738 """Proxy of C++ CPPFileSystemHandler class"""
1739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1740 def __init__(self): raise AttributeError, "No constructor defined"
1741 __repr__ = _swig_repr
1742 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1743 __del__ = lambda self : None;
1744 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1745
1746 class FileSystemHandler(CPPFileSystemHandler):
1747 """Proxy of C++ FileSystemHandler class"""
1748 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1749 __repr__ = _swig_repr
1750 def __init__(self, *args, **kwargs):
1751 """__init__(self) -> FileSystemHandler"""
1752 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1753 self._setCallbackInfo(self, FileSystemHandler)
1754
1755 def _setCallbackInfo(*args, **kwargs):
1756 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1757 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1758
1759 def CanOpen(*args, **kwargs):
1760 """CanOpen(self, String location) -> bool"""
1761 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1762
1763 def OpenFile(*args, **kwargs):
1764 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1765 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1766
1767 def FindFirst(*args, **kwargs):
1768 """FindFirst(self, String spec, int flags=0) -> String"""
1769 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1770
1771 def FindNext(*args, **kwargs):
1772 """FindNext(self) -> String"""
1773 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1774
1775 def GetProtocol(*args, **kwargs):
1776 """GetProtocol(self, String location) -> String"""
1777 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1778
1779 def GetLeftLocation(*args, **kwargs):
1780 """GetLeftLocation(self, String location) -> String"""
1781 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1782
1783 def GetAnchor(*args, **kwargs):
1784 """GetAnchor(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1786
1787 def GetRightLocation(*args, **kwargs):
1788 """GetRightLocation(self, String location) -> String"""
1789 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1790
1791 def GetMimeTypeFromExt(*args, **kwargs):
1792 """GetMimeTypeFromExt(self, String location) -> String"""
1793 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1794
1795 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1796 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1797 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1798 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1799 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
1800 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1801
1802 class FileSystem(Object):
1803 """Proxy of C++ FileSystem class"""
1804 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1805 __repr__ = _swig_repr
1806 def __init__(self, *args, **kwargs):
1807 """__init__(self) -> FileSystem"""
1808 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1809 __swig_destroy__ = _core_.delete_FileSystem
1810 __del__ = lambda self : None;
1811 def ChangePathTo(*args, **kwargs):
1812 """ChangePathTo(self, String location, bool is_dir=False)"""
1813 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1814
1815 def GetPath(*args, **kwargs):
1816 """GetPath(self) -> String"""
1817 return _core_.FileSystem_GetPath(*args, **kwargs)
1818
1819 def OpenFile(*args, **kwargs):
1820 """OpenFile(self, String location) -> FSFile"""
1821 return _core_.FileSystem_OpenFile(*args, **kwargs)
1822
1823 def FindFirst(*args, **kwargs):
1824 """FindFirst(self, String spec, int flags=0) -> String"""
1825 return _core_.FileSystem_FindFirst(*args, **kwargs)
1826
1827 def FindNext(*args, **kwargs):
1828 """FindNext(self) -> String"""
1829 return _core_.FileSystem_FindNext(*args, **kwargs)
1830
1831 def AddHandler(*args, **kwargs):
1832 """AddHandler(CPPFileSystemHandler handler)"""
1833 return _core_.FileSystem_AddHandler(*args, **kwargs)
1834
1835 AddHandler = staticmethod(AddHandler)
1836 def RemoveHandler(*args, **kwargs):
1837 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1838 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1839
1840 RemoveHandler = staticmethod(RemoveHandler)
1841 def CleanUpHandlers(*args, **kwargs):
1842 """CleanUpHandlers()"""
1843 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1844
1845 CleanUpHandlers = staticmethod(CleanUpHandlers)
1846 def FileNameToURL(*args, **kwargs):
1847 """FileNameToURL(String filename) -> String"""
1848 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1849
1850 FileNameToURL = staticmethod(FileNameToURL)
1851 def URLToFileName(*args, **kwargs):
1852 """URLToFileName(String url) -> String"""
1853 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1854
1855 URLToFileName = staticmethod(URLToFileName)
1856 Path = property(GetPath,doc="See `GetPath`")
1857 _core_.FileSystem_swigregister(FileSystem)
1858
1859 def FileSystem_AddHandler(*args, **kwargs):
1860 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1861 return _core_.FileSystem_AddHandler(*args, **kwargs)
1862
1863 def FileSystem_RemoveHandler(*args, **kwargs):
1864 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1865 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1866
1867 def FileSystem_CleanUpHandlers(*args):
1868 """FileSystem_CleanUpHandlers()"""
1869 return _core_.FileSystem_CleanUpHandlers(*args)
1870
1871 def FileSystem_FileNameToURL(*args, **kwargs):
1872 """FileSystem_FileNameToURL(String filename) -> String"""
1873 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1874
1875 def FileSystem_URLToFileName(*args, **kwargs):
1876 """FileSystem_URLToFileName(String url) -> String"""
1877 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1878
1879 class InternetFSHandler(CPPFileSystemHandler):
1880 """Proxy of C++ InternetFSHandler class"""
1881 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1882 __repr__ = _swig_repr
1883 def __init__(self, *args, **kwargs):
1884 """__init__(self) -> InternetFSHandler"""
1885 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1886 def CanOpen(*args, **kwargs):
1887 """CanOpen(self, String location) -> bool"""
1888 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1889
1890 def OpenFile(*args, **kwargs):
1891 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1892 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1893
1894 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1895
1896 class ZipFSHandler(CPPFileSystemHandler):
1897 """Proxy of C++ ZipFSHandler class"""
1898 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1899 __repr__ = _swig_repr
1900 def __init__(self, *args, **kwargs):
1901 """__init__(self) -> ZipFSHandler"""
1902 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1903 def CanOpen(*args, **kwargs):
1904 """CanOpen(self, String location) -> bool"""
1905 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1906
1907 def OpenFile(*args, **kwargs):
1908 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1909 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1910
1911 def FindFirst(*args, **kwargs):
1912 """FindFirst(self, String spec, int flags=0) -> String"""
1913 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1914
1915 def FindNext(*args, **kwargs):
1916 """FindNext(self) -> String"""
1917 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1918
1919 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1920
1921
1922 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1923 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1924 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1925
1926 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1927 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1928 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1929
1930 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1931 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1932 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1933 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1934 """
1935 Add 'file' to the memory filesystem. The dataItem parameter can
1936 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1937 arbitrary data. If a bitmap or image is used then the imgType
1938 parameter should specify what kind of image file it should be
1939 written as, wx.BITMAP_TYPE_PNG, etc.
1940 """
1941 if isinstance(dataItem, wx.Image):
1942 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1943 elif isinstance(dataItem, wx.Bitmap):
1944 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1945 elif type(dataItem) == str:
1946 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1947 else:
1948 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1949
1950 class MemoryFSHandler(CPPFileSystemHandler):
1951 """Proxy of C++ MemoryFSHandler class"""
1952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1953 __repr__ = _swig_repr
1954 def __init__(self, *args, **kwargs):
1955 """__init__(self) -> MemoryFSHandler"""
1956 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1957 def RemoveFile(*args, **kwargs):
1958 """RemoveFile(String filename)"""
1959 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1960
1961 RemoveFile = staticmethod(RemoveFile)
1962 AddFile = staticmethod(MemoryFSHandler_AddFile)
1963 def CanOpen(*args, **kwargs):
1964 """CanOpen(self, String location) -> bool"""
1965 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1966
1967 def OpenFile(*args, **kwargs):
1968 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1969 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1970
1971 def FindFirst(*args, **kwargs):
1972 """FindFirst(self, String spec, int flags=0) -> String"""
1973 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1974
1975 def FindNext(*args, **kwargs):
1976 """FindNext(self) -> String"""
1977 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1978
1979 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1980
1981 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1982 """MemoryFSHandler_RemoveFile(String filename)"""
1983 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1984
1985 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1986 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1987 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1988 #---------------------------------------------------------------------------
1989
1990 class ImageHandler(Object):
1991 """
1992 This is the base class for implementing image file loading/saving, and
1993 image creation from data. It is used within `wx.Image` and is not
1994 normally seen by the application.
1995 """
1996 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1997 def __init__(self): raise AttributeError, "No constructor defined"
1998 __repr__ = _swig_repr
1999 def GetName(*args, **kwargs):
2000 """GetName(self) -> String"""
2001 return _core_.ImageHandler_GetName(*args, **kwargs)
2002
2003 def GetExtension(*args, **kwargs):
2004 """GetExtension(self) -> String"""
2005 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2006
2007 def GetType(*args, **kwargs):
2008 """GetType(self) -> long"""
2009 return _core_.ImageHandler_GetType(*args, **kwargs)
2010
2011 def GetMimeType(*args, **kwargs):
2012 """GetMimeType(self) -> String"""
2013 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2014
2015 def CanRead(*args, **kwargs):
2016 """CanRead(self, String name) -> bool"""
2017 return _core_.ImageHandler_CanRead(*args, **kwargs)
2018
2019 def CanReadStream(*args, **kwargs):
2020 """CanReadStream(self, InputStream stream) -> bool"""
2021 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2022
2023 def SetName(*args, **kwargs):
2024 """SetName(self, String name)"""
2025 return _core_.ImageHandler_SetName(*args, **kwargs)
2026
2027 def SetExtension(*args, **kwargs):
2028 """SetExtension(self, String extension)"""
2029 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2030
2031 def SetType(*args, **kwargs):
2032 """SetType(self, long type)"""
2033 return _core_.ImageHandler_SetType(*args, **kwargs)
2034
2035 def SetMimeType(*args, **kwargs):
2036 """SetMimeType(self, String mimetype)"""
2037 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2038
2039 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2040 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2041 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2042 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2043 _core_.ImageHandler_swigregister(ImageHandler)
2044
2045 class PyImageHandler(ImageHandler):
2046 """
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data, all written in Python. To create a custom
2049 image handler derive a new class from wx.PyImageHandler and provide
2050 the following methods::
2051
2052 def DoCanRead(self, stream) --> bool
2053 '''Check if this handler can read the image on the stream'''
2054
2055 def LoadFile(self, image, stream, verbose, index) --> bool
2056 '''Load image data from the stream and load it into image.'''
2057
2058 def SaveFile(self, image, stream, verbose) --> bool
2059 '''Save the iamge data in image to the stream using
2060 this handler's image file format.'''
2061
2062 def GetImageCount(self, stream) --> int
2063 '''If this image format can hold more than one image,
2064 how many does the image on the stream have?'''
2065
2066 To activate your handler create an instance of it and pass it to
2067 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2068 `SetExtension` from your constructor.
2069
2070 """
2071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2072 __repr__ = _swig_repr
2073 def __init__(self, *args, **kwargs):
2074 """
2075 __init__(self) -> PyImageHandler
2076
2077 This is the base class for implementing image file loading/saving, and
2078 image creation from data, all written in Python. To create a custom
2079 image handler derive a new class from wx.PyImageHandler and provide
2080 the following methods::
2081
2082 def DoCanRead(self, stream) --> bool
2083 '''Check if this handler can read the image on the stream'''
2084
2085 def LoadFile(self, image, stream, verbose, index) --> bool
2086 '''Load image data from the stream and load it into image.'''
2087
2088 def SaveFile(self, image, stream, verbose) --> bool
2089 '''Save the iamge data in image to the stream using
2090 this handler's image file format.'''
2091
2092 def GetImageCount(self, stream) --> int
2093 '''If this image format can hold more than one image,
2094 how many does the image on the stream have?'''
2095
2096 To activate your handler create an instance of it and pass it to
2097 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2098 `SetExtension` from your constructor.
2099
2100 """
2101 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2102 self._SetSelf(self)
2103
2104 def _SetSelf(*args, **kwargs):
2105 """_SetSelf(self, PyObject self)"""
2106 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2107
2108 _core_.PyImageHandler_swigregister(PyImageHandler)
2109
2110 class ImageHistogram(object):
2111 """Proxy of C++ ImageHistogram class"""
2112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2113 __repr__ = _swig_repr
2114 def __init__(self, *args, **kwargs):
2115 """__init__(self) -> ImageHistogram"""
2116 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2117 def MakeKey(*args, **kwargs):
2118 """
2119 MakeKey(byte r, byte g, byte b) -> unsigned long
2120
2121 Get the key in the histogram for the given RGB values
2122 """
2123 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2124
2125 MakeKey = staticmethod(MakeKey)
2126 def FindFirstUnusedColour(*args, **kwargs):
2127 """
2128 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2129
2130 Find first colour that is not used in the image and has higher RGB
2131 values than startR, startG, startB. Returns a tuple consisting of a
2132 success flag and rgb values.
2133 """
2134 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2135
2136 def GetCount(*args, **kwargs):
2137 """
2138 GetCount(self, unsigned long key) -> unsigned long
2139
2140 Returns the pixel count for the given key. Use `MakeKey` to create a
2141 key value from a RGB tripple.
2142 """
2143 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2144
2145 def GetCountRGB(*args, **kwargs):
2146 """
2147 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2148
2149 Returns the pixel count for the given RGB values.
2150 """
2151 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2152
2153 def GetCountColour(*args, **kwargs):
2154 """
2155 GetCountColour(self, Colour colour) -> unsigned long
2156
2157 Returns the pixel count for the given `wx.Colour` value.
2158 """
2159 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2160
2161 _core_.ImageHistogram_swigregister(ImageHistogram)
2162
2163 def ImageHistogram_MakeKey(*args, **kwargs):
2164 """
2165 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2166
2167 Get the key in the histogram for the given RGB values
2168 """
2169 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2170
2171 class Image_RGBValue(object):
2172 """
2173 An object that contains values for red, green and blue which represent
2174 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2175 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2176 color space.
2177 """
2178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2179 __repr__ = _swig_repr
2180 def __init__(self, *args, **kwargs):
2181 """
2182 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2183
2184 Constructor.
2185 """
2186 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2187 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2188 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2189 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2190 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2191
2192 class Image_HSVValue(object):
2193 """
2194 An object that contains values for hue, saturation and value which
2195 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2196 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2197 color space.
2198 """
2199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2200 __repr__ = _swig_repr
2201 def __init__(self, *args, **kwargs):
2202 """
2203 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2204
2205 Constructor.
2206 """
2207 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2208 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2209 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2210 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2211 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2212
2213 class Image(Object):
2214 """
2215 A platform-independent image class. An image can be created from
2216 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2217 variety of formats. Functions are available to set and get image
2218 bits, so it can be used for basic image manipulation.
2219
2220 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2221 platform-specific `wx.Bitmap` object must be created from it using the
2222 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2223 device context, using `wx.DC.DrawBitmap`.
2224
2225 One colour value of the image may be used as a mask colour which will
2226 lead to the automatic creation of a `wx.Mask` object associated to the
2227 bitmap object.
2228
2229 wx.Image supports alpha channel data, that is in addition to a byte
2230 for the red, green and blue colour components for each pixel it also
2231 stores a byte representing the pixel opacity. An alpha value of 0
2232 corresponds to a transparent pixel (null opacity) while a value of 255
2233 means that the pixel is 100% opaque.
2234
2235 Unlike RGB data, not all images have an alpha channel and before using
2236 `GetAlpha` you should check if this image contains an alpha channel
2237 with `HasAlpha`. Note that currently only images loaded from PNG files
2238 with transparency information will have an alpha channel.
2239 """
2240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2241 __repr__ = _swig_repr
2242 def __init__(self, *args, **kwargs):
2243 """
2244 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2245
2246 Loads an image from a file.
2247 """
2248 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2249 __swig_destroy__ = _core_.delete_Image
2250 __del__ = lambda self : None;
2251 def Create(*args, **kwargs):
2252 """
2253 Create(self, int width, int height, bool clear=True)
2254
2255 Creates a fresh image. If clear is ``True``, the new image will be
2256 initialized to black. Otherwise, the image data will be uninitialized.
2257 """
2258 return _core_.Image_Create(*args, **kwargs)
2259
2260 def Destroy(*args, **kwargs):
2261 """
2262 Destroy(self)
2263
2264 Destroys the image data.
2265 """
2266 val = _core_.Image_Destroy(*args, **kwargs)
2267 args[0].thisown = 0
2268 return val
2269
2270 def Scale(*args, **kwargs):
2271 """
2272 Scale(self, int width, int height) -> Image
2273
2274 Returns a scaled version of the image. This is also useful for scaling
2275 bitmaps in general as the only other way to scale bitmaps is to blit a
2276 `wx.MemoryDC` into another `wx.MemoryDC`.
2277 """
2278 return _core_.Image_Scale(*args, **kwargs)
2279
2280 def ShrinkBy(*args, **kwargs):
2281 """
2282 ShrinkBy(self, int xFactor, int yFactor) -> Image
2283
2284 Return a version of the image scaled smaller by the given factors.
2285 """
2286 return _core_.Image_ShrinkBy(*args, **kwargs)
2287
2288 def Rescale(*args, **kwargs):
2289 """
2290 Rescale(self, int width, int height) -> Image
2291
2292 Changes the size of the image in-place by scaling it: after a call to
2293 this function, the image will have the given width and height.
2294
2295 Returns the (modified) image itself.
2296 """
2297 return _core_.Image_Rescale(*args, **kwargs)
2298
2299 def Resize(*args, **kwargs):
2300 """
2301 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2302
2303 Changes the size of the image in-place without scaling it, by adding
2304 either a border with the given colour or cropping as necessary. The
2305 image is pasted into a new image with the given size and background
2306 colour at the position pos relative to the upper left of the new
2307 image. If red = green = blue = -1 then use either the current mask
2308 colour if set or find, use, and set a suitable mask colour for any
2309 newly exposed areas.
2310
2311 Returns the (modified) image itself.
2312 """
2313 return _core_.Image_Resize(*args, **kwargs)
2314
2315 def SetRGB(*args, **kwargs):
2316 """
2317 SetRGB(self, int x, int y, byte r, byte g, byte b)
2318
2319 Sets the pixel at the given coordinate. This routine performs
2320 bounds-checks for the coordinate so it can be considered a safe way to
2321 manipulate the data, but in some cases this might be too slow so that
2322 the data will have to be set directly. In that case you will have to
2323 get access to the image data using the `GetData` method.
2324 """
2325 return _core_.Image_SetRGB(*args, **kwargs)
2326
2327 def SetRGBRect(*args, **kwargs):
2328 """
2329 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2330
2331 Sets the colour of the pixels within the given rectangle. This routine
2332 performs bounds-checks for the rectangle so it can be considered a
2333 safe way to manipulate the data.
2334 """
2335 return _core_.Image_SetRGBRect(*args, **kwargs)
2336
2337 def GetRed(*args, **kwargs):
2338 """
2339 GetRed(self, int x, int y) -> byte
2340
2341 Returns the red intensity at the given coordinate.
2342 """
2343 return _core_.Image_GetRed(*args, **kwargs)
2344
2345 def GetGreen(*args, **kwargs):
2346 """
2347 GetGreen(self, int x, int y) -> byte
2348
2349 Returns the green intensity at the given coordinate.
2350 """
2351 return _core_.Image_GetGreen(*args, **kwargs)
2352
2353 def GetBlue(*args, **kwargs):
2354 """
2355 GetBlue(self, int x, int y) -> byte
2356
2357 Returns the blue intensity at the given coordinate.
2358 """
2359 return _core_.Image_GetBlue(*args, **kwargs)
2360
2361 def SetAlpha(*args, **kwargs):
2362 """
2363 SetAlpha(self, int x, int y, byte alpha)
2364
2365 Sets the alpha value for the given pixel. This function should only be
2366 called if the image has alpha channel data, use `HasAlpha` to check
2367 for this.
2368 """
2369 return _core_.Image_SetAlpha(*args, **kwargs)
2370
2371 def GetAlpha(*args, **kwargs):
2372 """
2373 GetAlpha(self, int x, int y) -> byte
2374
2375 Returns the alpha value for the given pixel. This function may only be
2376 called for the images with alpha channel, use `HasAlpha` to check for
2377 this.
2378
2379 The returned value is the *opacity* of the image, i.e. the value of 0
2380 corresponds to the fully transparent pixels while the value of 255 to
2381 the fully opaque pixels.
2382 """
2383 return _core_.Image_GetAlpha(*args, **kwargs)
2384
2385 def HasAlpha(*args, **kwargs):
2386 """
2387 HasAlpha(self) -> bool
2388
2389 Returns true if this image has alpha channel, false otherwise.
2390 """
2391 return _core_.Image_HasAlpha(*args, **kwargs)
2392
2393 def InitAlpha(*args, **kwargs):
2394 """
2395 InitAlpha(self)
2396
2397 Initializes the image alpha channel data. It is an error to call it if
2398 the image already has alpha data. If it doesn't, alpha data will be by
2399 default initialized to all pixels being fully opaque. But if the image
2400 has a a mask colour, all mask pixels will be completely transparent.
2401 """
2402 return _core_.Image_InitAlpha(*args, **kwargs)
2403
2404 def IsTransparent(*args, **kwargs):
2405 """
2406 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2407
2408 Returns ``True`` if this pixel is masked or has an alpha value less
2409 than the spcified threshold.
2410 """
2411 return _core_.Image_IsTransparent(*args, **kwargs)
2412
2413 def FindFirstUnusedColour(*args, **kwargs):
2414 """
2415 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2416
2417 Find first colour that is not used in the image and has higher RGB
2418 values than startR, startG, startB. Returns a tuple consisting of a
2419 success flag and rgb values.
2420 """
2421 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2422
2423 def ConvertAlphaToMask(*args, **kwargs):
2424 """
2425 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2426
2427 If the image has alpha channel, this method converts it to mask. All
2428 pixels with alpha value less than ``threshold`` are replaced with the
2429 mask colour and the alpha channel is removed. The mask colour is
2430 chosen automatically using `FindFirstUnusedColour`.
2431
2432 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2433 nothing.
2434 """
2435 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2436
2437 def ConvertColourToAlpha(*args, **kwargs):
2438 """
2439 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2440
2441 This method converts an image where the original alpha information is
2442 only available as a shades of a colour (actually shades of grey)
2443 typically when you draw anti-aliased text into a bitmap. The DC
2444 drawing routines draw grey values on the black background although
2445 they actually mean to draw white with differnt alpha values. This
2446 method reverses it, assuming a black (!) background and white text.
2447 The method will then fill up the whole image with the colour given.
2448 """
2449 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2450
2451 def SetMaskFromImage(*args, **kwargs):
2452 """
2453 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2454
2455 Sets the image's mask so that the pixels that have RGB value of
2456 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2457 by first finding an unused colour in the image, setting this colour as
2458 the mask colour and then using this colour to draw all pixels in the
2459 image who corresponding pixel in mask has given RGB value.
2460
2461 Returns ``False`` if ``mask`` does not have same dimensions as the
2462 image or if there is no unused colour left. Returns ``True`` if the
2463 mask was successfully applied.
2464
2465 Note that this method involves computing the histogram, which is
2466 computationally intensive operation.
2467 """
2468 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2469
2470 def CanRead(*args, **kwargs):
2471 """
2472 CanRead(String filename) -> bool
2473
2474 Returns True if the image handlers can read this file.
2475 """
2476 return _core_.Image_CanRead(*args, **kwargs)
2477
2478 CanRead = staticmethod(CanRead)
2479 def GetImageCount(*args, **kwargs):
2480 """
2481 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2482
2483 If the image file contains more than one image and the image handler
2484 is capable of retrieving these individually, this function will return
2485 the number of available images.
2486 """
2487 return _core_.Image_GetImageCount(*args, **kwargs)
2488
2489 GetImageCount = staticmethod(GetImageCount)
2490 def LoadFile(*args, **kwargs):
2491 """
2492 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2493
2494 Loads an image from a file. If no handler type is provided, the
2495 library will try to autodetect the format.
2496 """
2497 return _core_.Image_LoadFile(*args, **kwargs)
2498
2499 def LoadMimeFile(*args, **kwargs):
2500 """
2501 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2502
2503 Loads an image from a file, specifying the image type with a MIME type
2504 string.
2505 """
2506 return _core_.Image_LoadMimeFile(*args, **kwargs)
2507
2508 def SaveFile(*args, **kwargs):
2509 """
2510 SaveFile(self, String name, int type) -> bool
2511
2512 Saves an image in the named file.
2513 """
2514 return _core_.Image_SaveFile(*args, **kwargs)
2515
2516 def SaveMimeFile(*args, **kwargs):
2517 """
2518 SaveMimeFile(self, String name, String mimetype) -> bool
2519
2520 Saves an image in the named file.
2521 """
2522 return _core_.Image_SaveMimeFile(*args, **kwargs)
2523
2524 def CanReadStream(*args, **kwargs):
2525 """
2526 CanReadStream(InputStream stream) -> bool
2527
2528 Returns True if the image handlers can read an image file from the
2529 data currently on the input stream, or a readable Python file-like
2530 object.
2531 """
2532 return _core_.Image_CanReadStream(*args, **kwargs)
2533
2534 CanReadStream = staticmethod(CanReadStream)
2535 def LoadStream(*args, **kwargs):
2536 """
2537 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2538
2539 Loads an image from an input stream or a readable Python file-like
2540 object. If no handler type is provided, the library will try to
2541 autodetect the format.
2542 """
2543 return _core_.Image_LoadStream(*args, **kwargs)
2544
2545 def LoadMimeStream(*args, **kwargs):
2546 """
2547 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2548
2549 Loads an image from an input stream or a readable Python file-like
2550 object, using a MIME type string to specify the image file format.
2551 """
2552 return _core_.Image_LoadMimeStream(*args, **kwargs)
2553
2554 def Ok(*args, **kwargs):
2555 """
2556 Ok(self) -> bool
2557
2558 Returns true if image data is present.
2559 """
2560 return _core_.Image_Ok(*args, **kwargs)
2561
2562 def GetWidth(*args, **kwargs):
2563 """
2564 GetWidth(self) -> int
2565
2566 Gets the width of the image in pixels.
2567 """
2568 return _core_.Image_GetWidth(*args, **kwargs)
2569
2570 def GetHeight(*args, **kwargs):
2571 """
2572 GetHeight(self) -> int
2573
2574 Gets the height of the image in pixels.
2575 """
2576 return _core_.Image_GetHeight(*args, **kwargs)
2577
2578 def GetSize(*args, **kwargs):
2579 """
2580 GetSize(self) -> Size
2581
2582 Returns the size of the image in pixels.
2583 """
2584 return _core_.Image_GetSize(*args, **kwargs)
2585
2586 def GetSubImage(*args, **kwargs):
2587 """
2588 GetSubImage(self, Rect rect) -> Image
2589
2590 Returns a sub image of the current one as long as the rect belongs
2591 entirely to the image.
2592 """
2593 return _core_.Image_GetSubImage(*args, **kwargs)
2594
2595 def Size(*args, **kwargs):
2596 """
2597 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2598
2599 Returns a resized version of this image without scaling it by adding
2600 either a border with the given colour or cropping as necessary. The
2601 image is pasted into a new image with the given size and background
2602 colour at the position ``pos`` relative to the upper left of the new
2603 image. If red = green = blue = -1 then use either the current mask
2604 colour if set or find, use, and set a suitable mask colour for any
2605 newly exposed areas.
2606 """
2607 return _core_.Image_Size(*args, **kwargs)
2608
2609 def Copy(*args, **kwargs):
2610 """
2611 Copy(self) -> Image
2612
2613 Returns an identical copy of the image.
2614 """
2615 return _core_.Image_Copy(*args, **kwargs)
2616
2617 def Paste(*args, **kwargs):
2618 """
2619 Paste(self, Image image, int x, int y)
2620
2621 Pastes ``image`` into this instance and takes care of the mask colour
2622 and any out of bounds problems.
2623 """
2624 return _core_.Image_Paste(*args, **kwargs)
2625
2626 def GetData(*args, **kwargs):
2627 """
2628 GetData(self) -> PyObject
2629
2630 Returns a string containing a copy of the RGB bytes of the image.
2631 """
2632 return _core_.Image_GetData(*args, **kwargs)
2633
2634 def SetData(*args, **kwargs):
2635 """
2636 SetData(self, buffer data)
2637
2638 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2639 either a string or a buffer object holding the data and the length of
2640 the data must be width*height*3.
2641 """
2642 return _core_.Image_SetData(*args, **kwargs)
2643
2644 def GetDataBuffer(*args, **kwargs):
2645 """
2646 GetDataBuffer(self) -> PyObject
2647
2648 Returns a writable Python buffer object that is pointing at the RGB
2649 image data buffer inside the wx.Image. You need to ensure that you do
2650 not use this buffer object after the image has been destroyed.
2651 """
2652 return _core_.Image_GetDataBuffer(*args, **kwargs)
2653
2654 def SetDataBuffer(*args, **kwargs):
2655 """
2656 SetDataBuffer(self, buffer data)
2657
2658 Sets the internal image data pointer to point at a Python buffer
2659 object. This can save making an extra copy of the data but you must
2660 ensure that the buffer object lives longer than the wx.Image does.
2661 """
2662 return _core_.Image_SetDataBuffer(*args, **kwargs)
2663
2664 def GetAlphaData(*args, **kwargs):
2665 """
2666 GetAlphaData(self) -> PyObject
2667
2668 Returns a string containing a copy of the alpha bytes of the image.
2669 """
2670 return _core_.Image_GetAlphaData(*args, **kwargs)
2671
2672 def SetAlphaData(*args, **kwargs):
2673 """
2674 SetAlphaData(self, buffer alpha)
2675
2676 Resets the Image's alpha data from a buffer of bytes. Accepts either
2677 a string or a buffer object holding the data and the length of the
2678 data must be width*height.
2679 """
2680 return _core_.Image_SetAlphaData(*args, **kwargs)
2681
2682 def GetAlphaBuffer(*args, **kwargs):
2683 """
2684 GetAlphaBuffer(self) -> PyObject
2685
2686 Returns a writable Python buffer object that is pointing at the Alpha
2687 data buffer inside the wx.Image. You need to ensure that you do not
2688 use this buffer object after the image has been destroyed.
2689 """
2690 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2691
2692 def SetAlphaBuffer(*args, **kwargs):
2693 """
2694 SetAlphaBuffer(self, buffer alpha)
2695
2696 Sets the internal image alpha pointer to point at a Python buffer
2697 object. This can save making an extra copy of the data but you must
2698 ensure that the buffer object lives as long as the wx.Image does.
2699 """
2700 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2701
2702 def SetMaskColour(*args, **kwargs):
2703 """
2704 SetMaskColour(self, byte r, byte g, byte b)
2705
2706 Sets the mask colour for this image (and tells the image to use the
2707 mask).
2708 """
2709 return _core_.Image_SetMaskColour(*args, **kwargs)
2710
2711 def GetOrFindMaskColour(*args, **kwargs):
2712 """
2713 GetOrFindMaskColour() -> (r,g,b)
2714
2715 Get the current mask colour or find a suitable colour.
2716 """
2717 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2718
2719 def GetMaskRed(*args, **kwargs):
2720 """
2721 GetMaskRed(self) -> byte
2722
2723 Gets the red component of the mask colour.
2724 """
2725 return _core_.Image_GetMaskRed(*args, **kwargs)
2726
2727 def GetMaskGreen(*args, **kwargs):
2728 """
2729 GetMaskGreen(self) -> byte
2730
2731 Gets the green component of the mask colour.
2732 """
2733 return _core_.Image_GetMaskGreen(*args, **kwargs)
2734
2735 def GetMaskBlue(*args, **kwargs):
2736 """
2737 GetMaskBlue(self) -> byte
2738
2739 Gets the blue component of the mask colour.
2740 """
2741 return _core_.Image_GetMaskBlue(*args, **kwargs)
2742
2743 def SetMask(*args, **kwargs):
2744 """
2745 SetMask(self, bool mask=True)
2746
2747 Specifies whether there is a mask or not. The area of the mask is
2748 determined by the current mask colour.
2749 """
2750 return _core_.Image_SetMask(*args, **kwargs)
2751
2752 def HasMask(*args, **kwargs):
2753 """
2754 HasMask(self) -> bool
2755
2756 Returns ``True`` if there is a mask active, ``False`` otherwise.
2757 """
2758 return _core_.Image_HasMask(*args, **kwargs)
2759
2760 def Rotate(*args, **kwargs):
2761 """
2762 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2763 Point offset_after_rotation=None) -> Image
2764
2765 Rotates the image about the given point, by ``angle`` radians. Passing
2766 ``True`` to ``interpolating`` results in better image quality, but is
2767 slower. If the image has a mask, then the mask colour is used for the
2768 uncovered pixels in the rotated image background. Otherwise, black
2769 will be used as the fill colour.
2770
2771 Returns the rotated image, leaving this image intact.
2772 """
2773 return _core_.Image_Rotate(*args, **kwargs)
2774
2775 def Rotate90(*args, **kwargs):
2776 """
2777 Rotate90(self, bool clockwise=True) -> Image
2778
2779 Returns a copy of the image rotated 90 degrees in the direction
2780 indicated by ``clockwise``.
2781 """
2782 return _core_.Image_Rotate90(*args, **kwargs)
2783
2784 def Mirror(*args, **kwargs):
2785 """
2786 Mirror(self, bool horizontally=True) -> Image
2787
2788 Returns a mirrored copy of the image. The parameter ``horizontally``
2789 indicates the orientation.
2790 """
2791 return _core_.Image_Mirror(*args, **kwargs)
2792
2793 def Replace(*args, **kwargs):
2794 """
2795 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2796
2797 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2798 ``(r2,g2,b2)``.
2799 """
2800 return _core_.Image_Replace(*args, **kwargs)
2801
2802 def ConvertToGreyscale(*args, **kwargs):
2803 """
2804 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2805
2806 Convert to greyscale image. Uses the luminance component (Y) of the
2807 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2808 defaults to ITU-T BT.601
2809 """
2810 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2811
2812 def ConvertToMono(*args, **kwargs):
2813 """
2814 ConvertToMono(self, byte r, byte g, byte b) -> Image
2815
2816 Returns monochromatic version of the image. The returned image has
2817 white colour where the original has ``(r,g,b)`` colour and black
2818 colour everywhere else.
2819 """
2820 return _core_.Image_ConvertToMono(*args, **kwargs)
2821
2822 def SetOption(*args, **kwargs):
2823 """
2824 SetOption(self, String name, String value)
2825
2826 Sets an image handler defined option. For example, when saving as a
2827 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2828 number between 0 and 100 (0 is terrible, 100 is very good).
2829 """
2830 return _core_.Image_SetOption(*args, **kwargs)
2831
2832 def SetOptionInt(*args, **kwargs):
2833 """
2834 SetOptionInt(self, String name, int value)
2835
2836 Sets an image option as an integer.
2837 """
2838 return _core_.Image_SetOptionInt(*args, **kwargs)
2839
2840 def GetOption(*args, **kwargs):
2841 """
2842 GetOption(self, String name) -> String
2843
2844 Gets the value of an image handler option.
2845 """
2846 return _core_.Image_GetOption(*args, **kwargs)
2847
2848 def GetOptionInt(*args, **kwargs):
2849 """
2850 GetOptionInt(self, String name) -> int
2851
2852 Gets the value of an image handler option as an integer. If the given
2853 option is not present, the function returns 0.
2854 """
2855 return _core_.Image_GetOptionInt(*args, **kwargs)
2856
2857 def HasOption(*args, **kwargs):
2858 """
2859 HasOption(self, String name) -> bool
2860
2861 Returns true if the given option is present.
2862 """
2863 return _core_.Image_HasOption(*args, **kwargs)
2864
2865 def CountColours(*args, **kwargs):
2866 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2867 return _core_.Image_CountColours(*args, **kwargs)
2868
2869 def ComputeHistogram(*args, **kwargs):
2870 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2871 return _core_.Image_ComputeHistogram(*args, **kwargs)
2872
2873 def AddHandler(*args, **kwargs):
2874 """AddHandler(ImageHandler handler)"""
2875 return _core_.Image_AddHandler(*args, **kwargs)
2876
2877 AddHandler = staticmethod(AddHandler)
2878 def InsertHandler(*args, **kwargs):
2879 """InsertHandler(ImageHandler handler)"""
2880 return _core_.Image_InsertHandler(*args, **kwargs)
2881
2882 InsertHandler = staticmethod(InsertHandler)
2883 def RemoveHandler(*args, **kwargs):
2884 """RemoveHandler(String name) -> bool"""
2885 return _core_.Image_RemoveHandler(*args, **kwargs)
2886
2887 RemoveHandler = staticmethod(RemoveHandler)
2888 def GetHandlers(*args, **kwargs):
2889 """GetHandlers() -> PyObject"""
2890 return _core_.Image_GetHandlers(*args, **kwargs)
2891
2892 GetHandlers = staticmethod(GetHandlers)
2893 def GetImageExtWildcard(*args, **kwargs):
2894 """
2895 GetImageExtWildcard() -> String
2896
2897 Iterates all registered wxImageHandler objects, and returns a string
2898 containing file extension masks suitable for passing to file open/save
2899 dialog boxes.
2900 """
2901 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2902
2903 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2904 def ConvertToBitmap(*args, **kwargs):
2905 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2906 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2907
2908 def ConvertToMonoBitmap(*args, **kwargs):
2909 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2910 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2911
2912 def RotateHue(*args, **kwargs):
2913 """
2914 RotateHue(self, double angle)
2915
2916 Rotates the hue of each pixel of the image. Hue is a double in the
2917 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2918 """
2919 return _core_.Image_RotateHue(*args, **kwargs)
2920
2921 def RGBtoHSV(*args, **kwargs):
2922 """
2923 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2924
2925 Converts a color in RGB color space to HSV color space.
2926 """
2927 return _core_.Image_RGBtoHSV(*args, **kwargs)
2928
2929 RGBtoHSV = staticmethod(RGBtoHSV)
2930 def HSVtoRGB(*args, **kwargs):
2931 """
2932 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2933
2934 Converts a color in HSV color space to RGB color space.
2935 """
2936 return _core_.Image_HSVtoRGB(*args, **kwargs)
2937
2938 HSVtoRGB = staticmethod(HSVtoRGB)
2939 def __nonzero__(self): return self.Ok()
2940 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2941 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
2942 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
2943 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
2944 Height = property(GetHeight,doc="See `GetHeight`")
2945 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
2946 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
2947 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
2948 Size = property(GetSize,doc="See `GetSize`")
2949 Width = property(GetWidth,doc="See `GetWidth`")
2950 _core_.Image_swigregister(Image)
2951
2952 def ImageFromMime(*args, **kwargs):
2953 """
2954 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2955
2956 Loads an image from a file, using a MIME type string (such as
2957 'image/jpeg') to specify image type.
2958 """
2959 val = _core_.new_ImageFromMime(*args, **kwargs)
2960 return val
2961
2962 def ImageFromStream(*args, **kwargs):
2963 """
2964 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2965
2966 Loads an image from an input stream, or any readable Python file-like
2967 object.
2968 """
2969 val = _core_.new_ImageFromStream(*args, **kwargs)
2970 return val
2971
2972 def ImageFromStreamMime(*args, **kwargs):
2973 """
2974 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2975
2976 Loads an image from an input stream, or any readable Python file-like
2977 object, specifying the image format with a MIME type string.
2978 """
2979 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2980 return val
2981
2982 def EmptyImage(*args, **kwargs):
2983 """
2984 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2985
2986 Construct an empty image of a given size, optionally setting all
2987 pixels to black.
2988 """
2989 val = _core_.new_EmptyImage(*args, **kwargs)
2990 return val
2991
2992 def ImageFromBitmap(*args, **kwargs):
2993 """
2994 ImageFromBitmap(Bitmap bitmap) -> Image
2995
2996 Construct an Image from a `wx.Bitmap`.
2997 """
2998 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2999 return val
3000
3001 def ImageFromData(*args, **kwargs):
3002 """
3003 ImageFromData(int width, int height, buffer data) -> Image
3004
3005 Construct an Image from a buffer of RGB bytes. Accepts either a
3006 string or a buffer object holding the data and the length of the data
3007 must be width*height*3.
3008 """
3009 val = _core_.new_ImageFromData(*args, **kwargs)
3010 return val
3011
3012 def ImageFromDataWithAlpha(*args, **kwargs):
3013 """
3014 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3015
3016 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3017 Accepts either a string or a buffer object holding the data and the
3018 length of the data must be width*height*3 bytes, and the length of the
3019 alpha data must be width*height bytes.
3020 """
3021 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3022 return val
3023
3024 def Image_CanRead(*args, **kwargs):
3025 """
3026 Image_CanRead(String filename) -> bool
3027
3028 Returns True if the image handlers can read this file.
3029 """
3030 return _core_.Image_CanRead(*args, **kwargs)
3031
3032 def Image_GetImageCount(*args, **kwargs):
3033 """
3034 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3035
3036 If the image file contains more than one image and the image handler
3037 is capable of retrieving these individually, this function will return
3038 the number of available images.
3039 """
3040 return _core_.Image_GetImageCount(*args, **kwargs)
3041
3042 def Image_CanReadStream(*args, **kwargs):
3043 """
3044 Image_CanReadStream(InputStream stream) -> bool
3045
3046 Returns True if the image handlers can read an image file from the
3047 data currently on the input stream, or a readable Python file-like
3048 object.
3049 """
3050 return _core_.Image_CanReadStream(*args, **kwargs)
3051
3052 def Image_AddHandler(*args, **kwargs):
3053 """Image_AddHandler(ImageHandler handler)"""
3054 return _core_.Image_AddHandler(*args, **kwargs)
3055
3056 def Image_InsertHandler(*args, **kwargs):
3057 """Image_InsertHandler(ImageHandler handler)"""
3058 return _core_.Image_InsertHandler(*args, **kwargs)
3059
3060 def Image_RemoveHandler(*args, **kwargs):
3061 """Image_RemoveHandler(String name) -> bool"""
3062 return _core_.Image_RemoveHandler(*args, **kwargs)
3063
3064 def Image_GetHandlers(*args):
3065 """Image_GetHandlers() -> PyObject"""
3066 return _core_.Image_GetHandlers(*args)
3067
3068 def Image_GetImageExtWildcard(*args):
3069 """
3070 Image_GetImageExtWildcard() -> String
3071
3072 Iterates all registered wxImageHandler objects, and returns a string
3073 containing file extension masks suitable for passing to file open/save
3074 dialog boxes.
3075 """
3076 return _core_.Image_GetImageExtWildcard(*args)
3077
3078 def Image_RGBtoHSV(*args, **kwargs):
3079 """
3080 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3081
3082 Converts a color in RGB color space to HSV color space.
3083 """
3084 return _core_.Image_RGBtoHSV(*args, **kwargs)
3085
3086 def Image_HSVtoRGB(*args, **kwargs):
3087 """
3088 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3089
3090 Converts a color in HSV color space to RGB color space.
3091 """
3092 return _core_.Image_HSVtoRGB(*args, **kwargs)
3093
3094
3095 def _ImageFromBuffer(*args, **kwargs):
3096 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3097 return _core_._ImageFromBuffer(*args, **kwargs)
3098 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3099 """
3100 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3101 parameter must be a Python object that implements the buffer interface,
3102 such as a string, array, etc. The dataBuffer object is expected to
3103 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3104 object can optionally be supplied for the image's alpha channel data, and
3105 it is expected to be width*height bytes long.
3106
3107 The wx.Image will be created with its data and alpha pointers initialized
3108 to the memory address pointed to by the buffer objects, thus saving the
3109 time needed to copy the image data from the buffer object to the wx.Image.
3110 While this has advantages, it also has the shoot-yourself-in-the-foot
3111 risks associated with sharing a C pointer between two objects.
3112
3113 To help alleviate the risk a reference to the data and alpha buffer
3114 objects are kept with the wx.Image, so that they won't get deleted until
3115 after the wx.Image is deleted. However please be aware that it is not
3116 guaranteed that an object won't move its memory buffer to a new location
3117 when it needs to resize its contents. If that happens then the wx.Image
3118 will end up referring to an invalid memory location and could cause the
3119 application to crash. Therefore care should be taken to not manipulate
3120 the objects used for the data and alpha buffers in a way that would cause
3121 them to change size.
3122 """
3123 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3124 image._buffer = dataBuffer
3125 image._alpha = alphaBuffer
3126 return image
3127
3128 def InitAllImageHandlers():
3129 """
3130 The former functionality of InitAllImageHanders is now done internal to
3131 the _core_ extension module and so this function has become a simple NOP.
3132 """
3133 pass
3134
3135 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3136 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3137 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3138 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3139 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3140 BMP_24BPP = _core_.BMP_24BPP
3141 BMP_8BPP = _core_.BMP_8BPP
3142 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3143 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3144 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3145 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3146 BMP_4BPP = _core_.BMP_4BPP
3147 BMP_1BPP = _core_.BMP_1BPP
3148 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3149 class BMPHandler(ImageHandler):
3150 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3152 __repr__ = _swig_repr
3153 def __init__(self, *args, **kwargs):
3154 """
3155 __init__(self) -> BMPHandler
3156
3157 A `wx.ImageHandler` for \*.bmp bitmap files.
3158 """
3159 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3160 _core_.BMPHandler_swigregister(BMPHandler)
3161 NullImage = cvar.NullImage
3162 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3163 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3164 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3165 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3166 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3167 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3168 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3169 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3170 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3171 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3172 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3173 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3174 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3175 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3176 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3177
3178 class ICOHandler(BMPHandler):
3179 """A `wx.ImageHandler` for \*.ico icon files."""
3180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3181 __repr__ = _swig_repr
3182 def __init__(self, *args, **kwargs):
3183 """
3184 __init__(self) -> ICOHandler
3185
3186 A `wx.ImageHandler` for \*.ico icon files.
3187 """
3188 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3189 _core_.ICOHandler_swigregister(ICOHandler)
3190
3191 class CURHandler(ICOHandler):
3192 """A `wx.ImageHandler` for \*.cur cursor files."""
3193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3194 __repr__ = _swig_repr
3195 def __init__(self, *args, **kwargs):
3196 """
3197 __init__(self) -> CURHandler
3198
3199 A `wx.ImageHandler` for \*.cur cursor files.
3200 """
3201 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3202 _core_.CURHandler_swigregister(CURHandler)
3203
3204 class ANIHandler(CURHandler):
3205 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3206 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3207 __repr__ = _swig_repr
3208 def __init__(self, *args, **kwargs):
3209 """
3210 __init__(self) -> ANIHandler
3211
3212 A `wx.ImageHandler` for \*.ani animated cursor files.
3213 """
3214 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3215 _core_.ANIHandler_swigregister(ANIHandler)
3216
3217 class PNGHandler(ImageHandler):
3218 """A `wx.ImageHandler` for PNG image files."""
3219 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3220 __repr__ = _swig_repr
3221 def __init__(self, *args, **kwargs):
3222 """
3223 __init__(self) -> PNGHandler
3224
3225 A `wx.ImageHandler` for PNG image files.
3226 """
3227 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3228 _core_.PNGHandler_swigregister(PNGHandler)
3229
3230 class GIFHandler(ImageHandler):
3231 """A `wx.ImageHandler` for GIF image files."""
3232 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3233 __repr__ = _swig_repr
3234 def __init__(self, *args, **kwargs):
3235 """
3236 __init__(self) -> GIFHandler
3237
3238 A `wx.ImageHandler` for GIF image files.
3239 """
3240 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3241 _core_.GIFHandler_swigregister(GIFHandler)
3242
3243 class PCXHandler(ImageHandler):
3244 """A `wx.ImageHandler` for PCX imager files."""
3245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3246 __repr__ = _swig_repr
3247 def __init__(self, *args, **kwargs):
3248 """
3249 __init__(self) -> PCXHandler
3250
3251 A `wx.ImageHandler` for PCX imager files.
3252 """
3253 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3254 _core_.PCXHandler_swigregister(PCXHandler)
3255
3256 class JPEGHandler(ImageHandler):
3257 """A `wx.ImageHandler` for JPEG/JPG image files."""
3258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3259 __repr__ = _swig_repr
3260 def __init__(self, *args, **kwargs):
3261 """
3262 __init__(self) -> JPEGHandler
3263
3264 A `wx.ImageHandler` for JPEG/JPG image files.
3265 """
3266 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3267 _core_.JPEGHandler_swigregister(JPEGHandler)
3268
3269 class PNMHandler(ImageHandler):
3270 """A `wx.ImageHandler` for PNM image files."""
3271 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3272 __repr__ = _swig_repr
3273 def __init__(self, *args, **kwargs):
3274 """
3275 __init__(self) -> PNMHandler
3276
3277 A `wx.ImageHandler` for PNM image files.
3278 """
3279 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3280 _core_.PNMHandler_swigregister(PNMHandler)
3281
3282 class XPMHandler(ImageHandler):
3283 """A `wx.ImageHandler` for XPM image."""
3284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3285 __repr__ = _swig_repr
3286 def __init__(self, *args, **kwargs):
3287 """
3288 __init__(self) -> XPMHandler
3289
3290 A `wx.ImageHandler` for XPM image.
3291 """
3292 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3293 _core_.XPMHandler_swigregister(XPMHandler)
3294
3295 class TIFFHandler(ImageHandler):
3296 """A `wx.ImageHandler` for TIFF image files."""
3297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3298 __repr__ = _swig_repr
3299 def __init__(self, *args, **kwargs):
3300 """
3301 __init__(self) -> TIFFHandler
3302
3303 A `wx.ImageHandler` for TIFF image files.
3304 """
3305 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3306 _core_.TIFFHandler_swigregister(TIFFHandler)
3307
3308 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3309 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3310 class Quantize(object):
3311 """Performs quantization, or colour reduction, on a wxImage."""
3312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3313 def __init__(self): raise AttributeError, "No constructor defined"
3314 __repr__ = _swig_repr
3315 def Quantize(*args, **kwargs):
3316 """
3317 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3318
3319 Reduce the colours in the source image and put the result into the
3320 destination image, setting the palette in the destination if
3321 needed. Both images may be the same, to overwrite the source image.
3322 """
3323 return _core_.Quantize_Quantize(*args, **kwargs)
3324
3325 Quantize = staticmethod(Quantize)
3326 _core_.Quantize_swigregister(Quantize)
3327
3328 def Quantize_Quantize(*args, **kwargs):
3329 """
3330 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3331
3332 Reduce the colours in the source image and put the result into the
3333 destination image, setting the palette in the destination if
3334 needed. Both images may be the same, to overwrite the source image.
3335 """
3336 return _core_.Quantize_Quantize(*args, **kwargs)
3337
3338 #---------------------------------------------------------------------------
3339
3340 class EvtHandler(Object):
3341 """Proxy of C++ EvtHandler class"""
3342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3343 __repr__ = _swig_repr
3344 def __init__(self, *args, **kwargs):
3345 """__init__(self) -> EvtHandler"""
3346 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3347 def GetNextHandler(*args, **kwargs):
3348 """GetNextHandler(self) -> EvtHandler"""
3349 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3350
3351 def GetPreviousHandler(*args, **kwargs):
3352 """GetPreviousHandler(self) -> EvtHandler"""
3353 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3354
3355 def SetNextHandler(*args, **kwargs):
3356 """SetNextHandler(self, EvtHandler handler)"""
3357 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3358
3359 def SetPreviousHandler(*args, **kwargs):
3360 """SetPreviousHandler(self, EvtHandler handler)"""
3361 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3362
3363 def GetEvtHandlerEnabled(*args, **kwargs):
3364 """GetEvtHandlerEnabled(self) -> bool"""
3365 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3366
3367 def SetEvtHandlerEnabled(*args, **kwargs):
3368 """SetEvtHandlerEnabled(self, bool enabled)"""
3369 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3370
3371 def ProcessEvent(*args, **kwargs):
3372 """ProcessEvent(self, Event event) -> bool"""
3373 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3374
3375 def AddPendingEvent(*args, **kwargs):
3376 """AddPendingEvent(self, Event event)"""
3377 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3378
3379 def ProcessPendingEvents(*args, **kwargs):
3380 """ProcessPendingEvents(self)"""
3381 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3382
3383 def Connect(*args, **kwargs):
3384 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3385 return _core_.EvtHandler_Connect(*args, **kwargs)
3386
3387 def Disconnect(*args, **kwargs):
3388 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3389 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3390
3391 def _setOORInfo(*args, **kwargs):
3392 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3393 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3394 args[0].thisown = 0
3395 return val
3396
3397 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3398 """
3399 Bind an event to an event handler.
3400
3401 :param event: One of the EVT_* objects that specifies the
3402 type of event to bind,
3403
3404 :param handler: A callable object to be invoked when the
3405 event is delivered to self. Pass None to
3406 disconnect an event handler.
3407
3408 :param source: Sometimes the event originates from a
3409 different window than self, but you still
3410 want to catch it in self. (For example, a
3411 button event delivered to a frame.) By
3412 passing the source of the event, the event
3413 handling system is able to differentiate
3414 between the same event type from different
3415 controls.
3416
3417 :param id: Used to spcify the event source by ID instead
3418 of instance.
3419
3420 :param id2: Used when it is desirable to bind a handler
3421 to a range of IDs, such as with EVT_MENU_RANGE.
3422 """
3423 if source is not None:
3424 id = source.GetId()
3425 event.Bind(self, id, id2, handler)
3426
3427 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3428 """
3429 Disconencts the event handler binding for event from self.
3430 Returns True if successful.
3431 """
3432 if source is not None:
3433 id = source.GetId()
3434 return event.Unbind(self, id, id2)
3435
3436 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3437 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3438 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3439 _core_.EvtHandler_swigregister(EvtHandler)
3440
3441 #---------------------------------------------------------------------------
3442
3443 class PyEventBinder(object):
3444 """
3445 Instances of this class are used to bind specific events to event
3446 handlers.
3447 """
3448 def __init__(self, evtType, expectedIDs=0):
3449 if expectedIDs not in [0, 1, 2]:
3450 raise ValueError, "Invalid number of expectedIDs"
3451 self.expectedIDs = expectedIDs
3452
3453 if type(evtType) == list or type(evtType) == tuple:
3454 self.evtType = evtType
3455 else:
3456 self.evtType = [evtType]
3457
3458
3459 def Bind(self, target, id1, id2, function):
3460 """Bind this set of event types to target."""
3461 for et in self.evtType:
3462 target.Connect(id1, id2, et, function)
3463
3464
3465 def Unbind(self, target, id1, id2):
3466 """Remove an event binding."""
3467 success = 0
3468 for et in self.evtType:
3469 success += target.Disconnect(id1, id2, et)
3470 return success != 0
3471
3472
3473 def __call__(self, *args):
3474 """
3475 For backwards compatibility with the old EVT_* functions.
3476 Should be called with either (window, func), (window, ID,
3477 func) or (window, ID1, ID2, func) parameters depending on the
3478 type of the event.
3479 """
3480 assert len(args) == 2 + self.expectedIDs
3481 id1 = wx.ID_ANY
3482 id2 = wx.ID_ANY
3483 target = args[0]
3484 if self.expectedIDs == 0:
3485 func = args[1]
3486 elif self.expectedIDs == 1:
3487 id1 = args[1]
3488 func = args[2]
3489 elif self.expectedIDs == 2:
3490 id1 = args[1]
3491 id2 = args[2]
3492 func = args[3]
3493 else:
3494 raise ValueError, "Unexpected number of IDs"
3495
3496 self.Bind(target, id1, id2, func)
3497
3498
3499 # These two are square pegs that don't fit the PyEventBinder hole...
3500 def EVT_COMMAND(win, id, cmd, func):
3501 win.Connect(id, -1, cmd, func)
3502 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3503 win.Connect(id1, id2, cmd, func)
3504
3505
3506 #---------------------------------------------------------------------------
3507
3508 #---------------------------------------------------------------------------
3509
3510 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3511 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3512
3513 def NewEventType(*args):
3514 """NewEventType() -> EventType"""
3515 return _core_.NewEventType(*args)
3516 wxEVT_NULL = _core_.wxEVT_NULL
3517 wxEVT_FIRST = _core_.wxEVT_FIRST
3518 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3519 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3520 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3521 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3522 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3523 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3524 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3525 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3526 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3527 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3528 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3529 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3530 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3531 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3532 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3533 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3534 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3535 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3536 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3537 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3538 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3539 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3540 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3541 wxEVT_MOTION = _core_.wxEVT_MOTION
3542 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3543 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3544 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3545 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3546 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3547 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3548 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3549 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3550 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3551 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3552 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3553 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3554 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3555 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3556 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3557 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3558 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3559 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3560 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3561 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3562 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3563 wxEVT_CHAR = _core_.wxEVT_CHAR
3564 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3565 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3566 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3567 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3568 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3569 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3570 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3571 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3572 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3573 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3574 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3575 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3576 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3577 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3578 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3579 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3580 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3581 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3582 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3583 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3584 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3585 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3586 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3587 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3588 wxEVT_SIZE = _core_.wxEVT_SIZE
3589 wxEVT_MOVE = _core_.wxEVT_MOVE
3590 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3591 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3592 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3593 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3594 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3595 wxEVT_CREATE = _core_.wxEVT_CREATE
3596 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3597 wxEVT_SHOW = _core_.wxEVT_SHOW
3598 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3599 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3600 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3601 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3602 wxEVT_PAINT = _core_.wxEVT_PAINT
3603 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3604 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3605 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3606 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3607 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3608 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3609 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3610 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3611 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3612 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3613 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3614 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3615 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3616 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3617 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3618 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3619 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3620 wxEVT_IDLE = _core_.wxEVT_IDLE
3621 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3622 wxEVT_SIZING = _core_.wxEVT_SIZING
3623 wxEVT_MOVING = _core_.wxEVT_MOVING
3624 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3625 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3626 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3627 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3628 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3629 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3630 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3631 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3632 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3633 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3634 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3635 #
3636 # Create some event binders
3637 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3638 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3639 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3640 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3641 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3642 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3643 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3644 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3645 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3646 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3647 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3648 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3649 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3650 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3651 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3652 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3653 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3654 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3655 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3656 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3657 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3658 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3659 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3660 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3661 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3662 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3663 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3664 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3665 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3666 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3667 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3668 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3669 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3670 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3671 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3672 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3673 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3674 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3675 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3676 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3677 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3678 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3679
3680 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3681 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3682 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3683 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3684 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3685 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3686 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3687 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3688 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3689 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3690 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3691 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3692 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3693
3694 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3695 wxEVT_LEFT_UP,
3696 wxEVT_MIDDLE_DOWN,
3697 wxEVT_MIDDLE_UP,
3698 wxEVT_RIGHT_DOWN,
3699 wxEVT_RIGHT_UP,
3700 wxEVT_MOTION,
3701 wxEVT_LEFT_DCLICK,
3702 wxEVT_MIDDLE_DCLICK,
3703 wxEVT_RIGHT_DCLICK,
3704 wxEVT_ENTER_WINDOW,
3705 wxEVT_LEAVE_WINDOW,
3706 wxEVT_MOUSEWHEEL
3707 ])
3708
3709
3710 # Scrolling from wxWindow (sent to wxScrolledWindow)
3711 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3712 wxEVT_SCROLLWIN_BOTTOM,
3713 wxEVT_SCROLLWIN_LINEUP,
3714 wxEVT_SCROLLWIN_LINEDOWN,
3715 wxEVT_SCROLLWIN_PAGEUP,
3716 wxEVT_SCROLLWIN_PAGEDOWN,
3717 wxEVT_SCROLLWIN_THUMBTRACK,
3718 wxEVT_SCROLLWIN_THUMBRELEASE,
3719 ])
3720
3721 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3722 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3723 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3724 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3725 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3726 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3727 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3728 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3729
3730 # Scrolling from wx.Slider and wx.ScrollBar
3731 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3732 wxEVT_SCROLL_BOTTOM,
3733 wxEVT_SCROLL_LINEUP,
3734 wxEVT_SCROLL_LINEDOWN,
3735 wxEVT_SCROLL_PAGEUP,
3736 wxEVT_SCROLL_PAGEDOWN,
3737 wxEVT_SCROLL_THUMBTRACK,
3738 wxEVT_SCROLL_THUMBRELEASE,
3739 wxEVT_SCROLL_CHANGED,
3740 ])
3741
3742 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3743 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3744 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3745 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3746 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3747 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3748 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3749 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3750 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3751 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3752
3753 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3754 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3755 wxEVT_SCROLL_BOTTOM,
3756 wxEVT_SCROLL_LINEUP,
3757 wxEVT_SCROLL_LINEDOWN,
3758 wxEVT_SCROLL_PAGEUP,
3759 wxEVT_SCROLL_PAGEDOWN,
3760 wxEVT_SCROLL_THUMBTRACK,
3761 wxEVT_SCROLL_THUMBRELEASE,
3762 wxEVT_SCROLL_CHANGED,
3763 ], 1)
3764
3765 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3766 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3767 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3768 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3769 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3770 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3771 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3772 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3773 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3774 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3775
3776 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3777 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3778 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3779 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3780 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3781 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3782 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3783 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3784 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3785 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3786
3787 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3788 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3789 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3790 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3791 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3792 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3793 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3794 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3795 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3796
3797
3798 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3799 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3800 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3801 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3802 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3803 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3804 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3805
3806 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3807
3808 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3809 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3810
3811 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3812
3813 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3814 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3815 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3816
3817
3818 #---------------------------------------------------------------------------
3819
3820 class Event(Object):
3821 """
3822 An event is a structure holding information about an event passed to a
3823 callback or member function. wx.Event is an abstract base class for
3824 other event classes
3825 """
3826 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3827 def __init__(self): raise AttributeError, "No constructor defined"
3828 __repr__ = _swig_repr
3829 __swig_destroy__ = _core_.delete_Event
3830 __del__ = lambda self : None;
3831 def SetEventType(*args, **kwargs):
3832 """
3833 SetEventType(self, EventType typ)
3834
3835 Sets the specific type of the event.
3836 """
3837 return _core_.Event_SetEventType(*args, **kwargs)
3838
3839 def GetEventType(*args, **kwargs):
3840 """
3841 GetEventType(self) -> EventType
3842
3843 Returns the identifier of the given event type, such as
3844 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3845 """
3846 return _core_.Event_GetEventType(*args, **kwargs)
3847
3848 def GetEventObject(*args, **kwargs):
3849 """
3850 GetEventObject(self) -> Object
3851
3852 Returns the object (usually a window) associated with the event, if
3853 any.
3854 """
3855 return _core_.Event_GetEventObject(*args, **kwargs)
3856
3857 def SetEventObject(*args, **kwargs):
3858 """
3859 SetEventObject(self, Object obj)
3860
3861 Sets the originating object, or in other words, obj is normally the
3862 object that is sending the event.
3863 """
3864 return _core_.Event_SetEventObject(*args, **kwargs)
3865
3866 def GetTimestamp(*args, **kwargs):
3867 """GetTimestamp(self) -> long"""
3868 return _core_.Event_GetTimestamp(*args, **kwargs)
3869
3870 def SetTimestamp(*args, **kwargs):
3871 """SetTimestamp(self, long ts=0)"""
3872 return _core_.Event_SetTimestamp(*args, **kwargs)
3873
3874 def GetId(*args, **kwargs):
3875 """
3876 GetId(self) -> int
3877
3878 Returns the identifier associated with this event, such as a button
3879 command id.
3880 """
3881 return _core_.Event_GetId(*args, **kwargs)
3882
3883 def SetId(*args, **kwargs):
3884 """
3885 SetId(self, int Id)
3886
3887 Set's the ID for the event. This is usually the ID of the window that
3888 is sending the event, but it can also be a command id from a menu
3889 item, etc.
3890 """
3891 return _core_.Event_SetId(*args, **kwargs)
3892
3893 def IsCommandEvent(*args, **kwargs):
3894 """
3895 IsCommandEvent(self) -> bool
3896
3897 Returns true if the event is or is derived from `wx.CommandEvent` else
3898 it returns false. Note: Exists only for optimization purposes.
3899 """
3900 return _core_.Event_IsCommandEvent(*args, **kwargs)
3901
3902 def Skip(*args, **kwargs):
3903 """
3904 Skip(self, bool skip=True)
3905
3906 Called by an event handler, it controls whether additional event
3907 handlers bound to this event will be called after the current event
3908 handler returns. Skip(false) (the default setting) will prevent
3909 additional event handlers from being called and control will be
3910 returned to the sender of the event immediately after the current
3911 handler has finished. Skip(True) will cause the event processing
3912 system to continue searching for a handler function for this event.
3913
3914 """
3915 return _core_.Event_Skip(*args, **kwargs)
3916
3917 def GetSkipped(*args, **kwargs):
3918 """
3919 GetSkipped(self) -> bool
3920
3921 Returns true if the event handler should be skipped, false otherwise.
3922 :see: `Skip`
3923 """
3924 return _core_.Event_GetSkipped(*args, **kwargs)
3925
3926 def ShouldPropagate(*args, **kwargs):
3927 """
3928 ShouldPropagate(self) -> bool
3929
3930 Test if this event should be propagated to the parent window or not,
3931 i.e. if the propagation level is currently greater than 0.
3932 """
3933 return _core_.Event_ShouldPropagate(*args, **kwargs)
3934
3935 def StopPropagation(*args, **kwargs):
3936 """
3937 StopPropagation(self) -> int
3938
3939 Stop the event from propagating to its parent window. Returns the old
3940 propagation level value which may be later passed to
3941 `ResumePropagation` to allow propagating the event again.
3942 """
3943 return _core_.Event_StopPropagation(*args, **kwargs)
3944
3945 def ResumePropagation(*args, **kwargs):
3946 """
3947 ResumePropagation(self, int propagationLevel)
3948
3949 Resume the event propagation by restoring the propagation level. (For
3950 example, you can use the value returned by an earlier call to
3951 `StopPropagation`.)
3952
3953 """
3954 return _core_.Event_ResumePropagation(*args, **kwargs)
3955
3956 def Clone(*args, **kwargs):
3957 """Clone(self) -> Event"""
3958 return _core_.Event_Clone(*args, **kwargs)
3959
3960 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
3961 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
3962 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
3963 Skipped = property(GetSkipped,doc="See `GetSkipped`")
3964 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
3965 _core_.Event_swigregister(Event)
3966
3967 #---------------------------------------------------------------------------
3968
3969 class PropagationDisabler(object):
3970 """
3971 Helper class to temporarily change an event not to propagate. Simply
3972 create an instance of this class and then whe it is destroyed the
3973 propogation of the event will be restored.
3974 """
3975 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3976 __repr__ = _swig_repr
3977 def __init__(self, *args, **kwargs):
3978 """
3979 __init__(self, Event event) -> PropagationDisabler
3980
3981 Helper class to temporarily change an event not to propagate. Simply
3982 create an instance of this class and then whe it is destroyed the
3983 propogation of the event will be restored.
3984 """
3985 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3986 __swig_destroy__ = _core_.delete_PropagationDisabler
3987 __del__ = lambda self : None;
3988 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3989
3990 class PropagateOnce(object):
3991 """
3992 A helper class that will temporarily lower propagation level of an
3993 event. Simply create an instance of this class and then whe it is
3994 destroyed the propogation of the event will be restored.
3995 """
3996 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3997 __repr__ = _swig_repr
3998 def __init__(self, *args, **kwargs):
3999 """
4000 __init__(self, Event event) -> PropagateOnce
4001
4002 A helper class that will temporarily lower propagation level of an
4003 event. Simply create an instance of this class and then whe it is
4004 destroyed the propogation of the event will be restored.
4005 """
4006 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4007 __swig_destroy__ = _core_.delete_PropagateOnce
4008 __del__ = lambda self : None;
4009 _core_.PropagateOnce_swigregister(PropagateOnce)
4010
4011 #---------------------------------------------------------------------------
4012
4013 class CommandEvent(Event):
4014 """
4015 This event class contains information about command events, which
4016 originate from a variety of simple controls, as well as menus and
4017 toolbars.
4018 """
4019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4020 __repr__ = _swig_repr
4021 def __init__(self, *args, **kwargs):
4022 """
4023 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4024
4025 This event class contains information about command events, which
4026 originate from a variety of simple controls, as well as menus and
4027 toolbars.
4028 """
4029 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4030 def GetSelection(*args, **kwargs):
4031 """
4032 GetSelection(self) -> int
4033
4034 Returns item index for a listbox or choice selection event (not valid
4035 for a deselection).
4036 """
4037 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4038
4039 def SetString(*args, **kwargs):
4040 """SetString(self, String s)"""
4041 return _core_.CommandEvent_SetString(*args, **kwargs)
4042
4043 def GetString(*args, **kwargs):
4044 """
4045 GetString(self) -> String
4046
4047 Returns item string for a listbox or choice selection event (not valid
4048 for a deselection).
4049 """
4050 return _core_.CommandEvent_GetString(*args, **kwargs)
4051
4052 def IsChecked(*args, **kwargs):
4053 """
4054 IsChecked(self) -> bool
4055
4056 This method can be used with checkbox and menu events: for the
4057 checkboxes, the method returns true for a selection event and false
4058 for a deselection one. For the menu events, this method indicates if
4059 the menu item just has become checked or unchecked (and thus only
4060 makes sense for checkable menu items).
4061 """
4062 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4063
4064 Checked = IsChecked
4065 def IsSelection(*args, **kwargs):
4066 """
4067 IsSelection(self) -> bool
4068
4069 For a listbox or similar event, returns true if it is a selection,
4070 false if it is a deselection.
4071 """
4072 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4073
4074 def SetExtraLong(*args, **kwargs):
4075 """SetExtraLong(self, long extraLong)"""
4076 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4077
4078 def GetExtraLong(*args, **kwargs):
4079 """
4080 GetExtraLong(self) -> long
4081
4082 Returns extra information dependant on the event objects type. If the
4083 event comes from a listbox selection, it is a boolean determining
4084 whether the event was a selection (true) or a deselection (false). A
4085 listbox deselection only occurs for multiple-selection boxes, and in
4086 this case the index and string values are indeterminate and the
4087 listbox must be examined by the application.
4088 """
4089 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4090
4091 def SetInt(*args, **kwargs):
4092 """SetInt(self, int i)"""
4093 return _core_.CommandEvent_SetInt(*args, **kwargs)
4094
4095 def GetInt(*args, **kwargs):
4096 """
4097 GetInt(self) -> int
4098
4099 Returns the integer identifier corresponding to a listbox, choice or
4100 radiobox selection (only if the event was a selection, not a
4101 deselection), or a boolean value representing the value of a checkbox.
4102 """
4103 return _core_.CommandEvent_GetInt(*args, **kwargs)
4104
4105 def GetClientData(*args, **kwargs):
4106 """
4107 GetClientData(self) -> PyObject
4108
4109 Returns the client data object for a listbox or choice selection event, (if any.)
4110 """
4111 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4112
4113 def SetClientData(*args, **kwargs):
4114 """
4115 SetClientData(self, PyObject clientData)
4116
4117 Associate the given client data with the item at position n.
4118 """
4119 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4120
4121 GetClientObject = GetClientData
4122 SetClientObject = SetClientData
4123
4124 def Clone(*args, **kwargs):
4125 """Clone(self) -> Event"""
4126 return _core_.CommandEvent_Clone(*args, **kwargs)
4127
4128 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4129 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4130 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4131 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4132 Selection = property(GetSelection,doc="See `GetSelection`")
4133 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4134 _core_.CommandEvent_swigregister(CommandEvent)
4135
4136 #---------------------------------------------------------------------------
4137
4138 class NotifyEvent(CommandEvent):
4139 """
4140 An instance of this class (or one of its derived classes) is sent from
4141 a control when the control's state is being changed and the control
4142 allows that change to be prevented from happening. The event handler
4143 can call `Veto` or `Allow` to tell the control what to do.
4144 """
4145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4146 __repr__ = _swig_repr
4147 def __init__(self, *args, **kwargs):
4148 """
4149 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4150
4151 An instance of this class (or one of its derived classes) is sent from
4152 a control when the control's state is being changed and the control
4153 allows that change to be prevented from happening. The event handler
4154 can call `Veto` or `Allow` to tell the control what to do.
4155 """
4156 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4157 def Veto(*args, **kwargs):
4158 """
4159 Veto(self)
4160
4161 Prevents the change announced by this event from happening.
4162
4163 It is in general a good idea to notify the user about the reasons for
4164 vetoing the change because otherwise the applications behaviour (which
4165 just refuses to do what the user wants) might be quite surprising.
4166 """
4167 return _core_.NotifyEvent_Veto(*args, **kwargs)
4168
4169 def Allow(*args, **kwargs):
4170 """
4171 Allow(self)
4172
4173 This is the opposite of `Veto`: it explicitly allows the event to be
4174 processed. For most events it is not necessary to call this method as
4175 the events are allowed anyhow but some are forbidden by default (this
4176 will be mentioned in the corresponding event description).
4177 """
4178 return _core_.NotifyEvent_Allow(*args, **kwargs)
4179
4180 def IsAllowed(*args, **kwargs):
4181 """
4182 IsAllowed(self) -> bool
4183
4184 Returns true if the change is allowed (`Veto` hasn't been called) or
4185 false otherwise (if it was).
4186 """
4187 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4188
4189 _core_.NotifyEvent_swigregister(NotifyEvent)
4190
4191 #---------------------------------------------------------------------------
4192
4193 class ScrollEvent(CommandEvent):
4194 """
4195 A scroll event holds information about events sent from stand-alone
4196 scrollbars and sliders. Note that scrolled windows do not send
4197 instnaces of this event class, but send the `wx.ScrollWinEvent`
4198 instead.
4199 """
4200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4201 __repr__ = _swig_repr
4202 def __init__(self, *args, **kwargs):
4203 """
4204 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4205 int orient=0) -> ScrollEvent
4206 """
4207 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4208 def GetOrientation(*args, **kwargs):
4209 """
4210 GetOrientation(self) -> int
4211
4212 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4213 the scrollbar.
4214 """
4215 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4216
4217 def GetPosition(*args, **kwargs):
4218 """
4219 GetPosition(self) -> int
4220
4221 Returns the position of the scrollbar.
4222 """
4223 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4224
4225 def SetOrientation(*args, **kwargs):
4226 """SetOrientation(self, int orient)"""
4227 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4228
4229 def SetPosition(*args, **kwargs):
4230 """SetPosition(self, int pos)"""
4231 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4232
4233 _core_.ScrollEvent_swigregister(ScrollEvent)
4234
4235 #---------------------------------------------------------------------------
4236
4237 class ScrollWinEvent(Event):
4238 """
4239 A wx.ScrollWinEvent holds information about scrolling and is sent from
4240 scrolling windows.
4241 """
4242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4243 __repr__ = _swig_repr
4244 def __init__(self, *args, **kwargs):
4245 """
4246 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4247
4248 A wx.ScrollWinEvent holds information about scrolling and is sent from
4249 scrolling windows.
4250 """
4251 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4252 def GetOrientation(*args, **kwargs):
4253 """
4254 GetOrientation(self) -> int
4255
4256 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4257 the scrollbar.
4258 """
4259 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4260
4261 def GetPosition(*args, **kwargs):
4262 """
4263 GetPosition(self) -> int
4264
4265 Returns the position of the scrollbar for the thumb track and release
4266 events. Note that this field can't be used for the other events, you
4267 need to query the window itself for the current position in that case.
4268 """
4269 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4270
4271 def SetOrientation(*args, **kwargs):
4272 """SetOrientation(self, int orient)"""
4273 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4274
4275 def SetPosition(*args, **kwargs):
4276 """SetPosition(self, int pos)"""
4277 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4278
4279 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4280
4281 #---------------------------------------------------------------------------
4282
4283 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4284 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4285 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4286 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4287 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4288 class MouseEvent(Event):
4289 """
4290 This event class contains information about the events generated by
4291 the mouse: they include mouse buttons press and release events and
4292 mouse move events.
4293
4294 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4295 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4296 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4297 a middle button so a portable application should avoid relying on the
4298 events from it.
4299
4300 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4301 the former returns true when the event corresponds to the left mouse
4302 button click while the latter returns true if the left mouse button is
4303 currently being pressed. For example, when the user is dragging the
4304 mouse you can use `LeftIsDown` to test whether the left mouse button
4305 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4306 `LeftIsDown` will also return true in wxWidgets whatever the
4307 underlying GUI behaviour is (which is platform-dependent). The same
4308 applies, of course, to other mouse buttons as well.
4309 """
4310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4311 __repr__ = _swig_repr
4312 def __init__(self, *args, **kwargs):
4313 """
4314 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4315
4316 Constructs a wx.MouseEvent. Valid event types are:
4317
4318 * wxEVT_ENTER_WINDOW
4319 * wxEVT_LEAVE_WINDOW
4320 * wxEVT_LEFT_DOWN
4321 * wxEVT_LEFT_UP
4322 * wxEVT_LEFT_DCLICK
4323 * wxEVT_MIDDLE_DOWN
4324 * wxEVT_MIDDLE_UP
4325 * wxEVT_MIDDLE_DCLICK
4326 * wxEVT_RIGHT_DOWN
4327 * wxEVT_RIGHT_UP
4328 * wxEVT_RIGHT_DCLICK
4329 * wxEVT_MOTION
4330 * wxEVT_MOUSEWHEEL
4331 """
4332 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4333 def IsButton(*args, **kwargs):
4334 """
4335 IsButton(self) -> bool
4336
4337 Returns true if the event was a mouse button event (not necessarily a
4338 button down event - that may be tested using `ButtonDown`).
4339 """
4340 return _core_.MouseEvent_IsButton(*args, **kwargs)
4341
4342 def ButtonDown(*args, **kwargs):
4343 """
4344 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4345
4346 If the argument is omitted, this returns true if the event was any
4347 mouse button down event. Otherwise the argument specifies which
4348 button-down event shold be checked for (see `Button` for the possible
4349 values).
4350 """
4351 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4352
4353 def ButtonDClick(*args, **kwargs):
4354 """
4355 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4356
4357 If the argument is omitted, this returns true if the event was any
4358 mouse double click event. Otherwise the argument specifies which
4359 double click event to check for (see `Button` for the possible
4360 values).
4361 """
4362 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4363
4364 def ButtonUp(*args, **kwargs):
4365 """
4366 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4367
4368 If the argument is omitted, this returns true if the event was any
4369 mouse button up event. Otherwise the argument specifies which button
4370 up event to check for (see `Button` for the possible values).
4371 """
4372 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4373
4374 def Button(*args, **kwargs):
4375 """
4376 Button(self, int button) -> bool
4377
4378 Returns true if the identified mouse button is changing state. Valid
4379 values of button are:
4380
4381 ==================== =====================================
4382 wx.MOUSE_BTN_LEFT check if left button was pressed
4383 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4384 wx.MOUSE_BTN_RIGHT check if right button was pressed
4385 wx.MOUSE_BTN_ANY check if any button was pressed
4386 ==================== =====================================
4387
4388 """
4389 return _core_.MouseEvent_Button(*args, **kwargs)
4390
4391 def ButtonIsDown(*args, **kwargs):
4392 """ButtonIsDown(self, int but) -> bool"""
4393 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4394
4395 def GetButton(*args, **kwargs):
4396 """
4397 GetButton(self) -> int
4398
4399 Returns the mouse button which generated this event or
4400 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4401 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4402 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4403 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4404 right buttons respectively.
4405 """
4406 return _core_.MouseEvent_GetButton(*args, **kwargs)
4407
4408 def ControlDown(*args, **kwargs):
4409 """
4410 ControlDown(self) -> bool
4411
4412 Returns true if the control key was down at the time of the event.
4413 """
4414 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4415
4416 def MetaDown(*args, **kwargs):
4417 """
4418 MetaDown(self) -> bool
4419
4420 Returns true if the Meta key was down at the time of the event.
4421 """
4422 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4423
4424 def AltDown(*args, **kwargs):
4425 """
4426 AltDown(self) -> bool
4427
4428 Returns true if the Alt key was down at the time of the event.
4429 """
4430 return _core_.MouseEvent_AltDown(*args, **kwargs)
4431
4432 def ShiftDown(*args, **kwargs):
4433 """
4434 ShiftDown(self) -> bool
4435
4436 Returns true if the Shift key was down at the time of the event.
4437 """
4438 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4439
4440 def CmdDown(*args, **kwargs):
4441 """
4442 CmdDown(self) -> bool
4443
4444 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4445 platforms but the special "Apple" (a.k.a as "Command") key on
4446 Macs. It often makes sense to use it instead of, say, `ControlDown`
4447 because Cmd key is used for the same thing under Mac as Ctrl
4448 elsewhere. The Ctrl key still exists, it's just not used for this
4449 purpose. So for non-Mac platforms this is the same as `ControlDown`
4450 and Macs this is the same as `MetaDown`.
4451 """
4452 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4453
4454 def LeftDown(*args, **kwargs):
4455 """
4456 LeftDown(self) -> bool
4457
4458 Returns true if the left mouse button state changed to down.
4459 """
4460 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4461
4462 def MiddleDown(*args, **kwargs):
4463 """
4464 MiddleDown(self) -> bool
4465
4466 Returns true if the middle mouse button state changed to down.
4467 """
4468 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4469
4470 def RightDown(*args, **kwargs):
4471 """
4472 RightDown(self) -> bool
4473
4474 Returns true if the right mouse button state changed to down.
4475 """
4476 return _core_.MouseEvent_RightDown(*args, **kwargs)
4477
4478 def LeftUp(*args, **kwargs):
4479 """
4480 LeftUp(self) -> bool
4481
4482 Returns true if the left mouse button state changed to up.
4483 """
4484 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4485
4486 def MiddleUp(*args, **kwargs):
4487 """
4488 MiddleUp(self) -> bool
4489
4490 Returns true if the middle mouse button state changed to up.
4491 """
4492 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4493
4494 def RightUp(*args, **kwargs):
4495 """
4496 RightUp(self) -> bool
4497
4498 Returns true if the right mouse button state changed to up.
4499 """
4500 return _core_.MouseEvent_RightUp(*args, **kwargs)
4501
4502 def LeftDClick(*args, **kwargs):
4503 """
4504 LeftDClick(self) -> bool
4505
4506 Returns true if the event was a left button double click.
4507 """
4508 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4509
4510 def MiddleDClick(*args, **kwargs):
4511 """
4512 MiddleDClick(self) -> bool
4513
4514 Returns true if the event was a middle button double click.
4515 """
4516 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4517
4518 def RightDClick(*args, **kwargs):
4519 """
4520 RightDClick(self) -> bool
4521
4522 Returns true if the event was a right button double click.
4523 """
4524 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4525
4526 def LeftIsDown(*args, **kwargs):
4527 """
4528 LeftIsDown(self) -> bool
4529
4530 Returns true if the left mouse button is currently down, independent
4531 of the current event type.
4532
4533 Please notice that it is not the same as LeftDown which returns true
4534 if the left mouse button was just pressed. Rather, it describes the
4535 state of the mouse button before the event happened.
4536
4537 This event is usually used in the mouse event handlers which process
4538 "move mouse" messages to determine whether the user is (still)
4539 dragging the mouse.
4540 """
4541 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4542
4543 def MiddleIsDown(*args, **kwargs):
4544 """
4545 MiddleIsDown(self) -> bool
4546
4547 Returns true if the middle mouse button is currently down, independent
4548 of the current event type.
4549 """
4550 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4551
4552 def RightIsDown(*args, **kwargs):
4553 """
4554 RightIsDown(self) -> bool
4555
4556 Returns true if the right mouse button is currently down, independent
4557 of the current event type.
4558 """
4559 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4560
4561 def Dragging(*args, **kwargs):
4562 """
4563 Dragging(self) -> bool
4564
4565 Returns true if this was a dragging event (motion while a button is
4566 depressed).
4567 """
4568 return _core_.MouseEvent_Dragging(*args, **kwargs)
4569
4570 def Moving(*args, **kwargs):
4571 """
4572 Moving(self) -> bool
4573
4574 Returns true if this was a motion event and no mouse buttons were
4575 pressed. If any mouse button is held pressed, then this method returns
4576 false and Dragging returns true.
4577 """
4578 return _core_.MouseEvent_Moving(*args, **kwargs)
4579
4580 def Entering(*args, **kwargs):
4581 """
4582 Entering(self) -> bool
4583
4584 Returns true if the mouse was entering the window.
4585 """
4586 return _core_.MouseEvent_Entering(*args, **kwargs)
4587
4588 def Leaving(*args, **kwargs):
4589 """
4590 Leaving(self) -> bool
4591
4592 Returns true if the mouse was leaving the window.
4593 """
4594 return _core_.MouseEvent_Leaving(*args, **kwargs)
4595
4596 def GetPosition(*args, **kwargs):
4597 """
4598 GetPosition(self) -> Point
4599
4600 Returns the pixel position of the mouse in window coordinates when the
4601 event happened.
4602 """
4603 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4604
4605 def GetPositionTuple(*args, **kwargs):
4606 """
4607 GetPositionTuple() -> (x,y)
4608
4609 Returns the pixel position of the mouse in window coordinates when the
4610 event happened.
4611 """
4612 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4613
4614 def GetLogicalPosition(*args, **kwargs):
4615 """
4616 GetLogicalPosition(self, DC dc) -> Point
4617
4618 Returns the logical mouse position in pixels (i.e. translated
4619 according to the translation set for the DC, which usually indicates
4620 that the window has been scrolled).
4621 """
4622 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4623
4624 def GetX(*args, **kwargs):
4625 """
4626 GetX(self) -> int
4627
4628 Returns X coordinate of the physical mouse event position.
4629 """
4630 return _core_.MouseEvent_GetX(*args, **kwargs)
4631
4632 def GetY(*args, **kwargs):
4633 """
4634 GetY(self) -> int
4635
4636 Returns Y coordinate of the physical mouse event position.
4637 """
4638 return _core_.MouseEvent_GetY(*args, **kwargs)
4639
4640 def GetWheelRotation(*args, **kwargs):
4641 """
4642 GetWheelRotation(self) -> int
4643
4644 Get wheel rotation, positive or negative indicates direction of
4645 rotation. Current devices all send an event when rotation is equal to
4646 +/-WheelDelta, but this allows for finer resolution devices to be
4647 created in the future. Because of this you shouldn't assume that one
4648 event is equal to 1 line or whatever, but you should be able to either
4649 do partial line scrolling or wait until +/-WheelDelta rotation values
4650 have been accumulated before scrolling.
4651 """
4652 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4653
4654 def GetWheelDelta(*args, **kwargs):
4655 """
4656 GetWheelDelta(self) -> int
4657
4658 Get wheel delta, normally 120. This is the threshold for action to be
4659 taken, and one such action (for example, scrolling one increment)
4660 should occur for each delta.
4661 """
4662 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4663
4664 def GetLinesPerAction(*args, **kwargs):
4665 """
4666 GetLinesPerAction(self) -> int
4667
4668 Returns the configured number of lines (or whatever) to be scrolled
4669 per wheel action. Defaults to three.
4670 """
4671 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4672
4673 def IsPageScroll(*args, **kwargs):
4674 """
4675 IsPageScroll(self) -> bool
4676
4677 Returns true if the system has been setup to do page scrolling with
4678 the mouse wheel instead of line scrolling.
4679 """
4680 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4681
4682 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4683 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4684 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4685 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4686 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4687 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4688 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4689 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4690 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4691 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4692 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4693 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4694 Button = property(GetButton,doc="See `GetButton`")
4695 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4696 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4697 Position = property(GetPosition,doc="See `GetPosition`")
4698 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4699 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4700 X = property(GetX,doc="See `GetX`")
4701 Y = property(GetY,doc="See `GetY`")
4702 _core_.MouseEvent_swigregister(MouseEvent)
4703
4704 #---------------------------------------------------------------------------
4705
4706 class SetCursorEvent(Event):
4707 """
4708 A SetCursorEvent is generated when the mouse cursor is about to be set
4709 as a result of mouse motion. This event gives the application the
4710 chance to perform specific mouse cursor processing based on the
4711 current position of the mouse within the window. Use the `SetCursor`
4712 method to specify the cursor you want to be displayed.
4713 """
4714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4715 __repr__ = _swig_repr
4716 def __init__(self, *args, **kwargs):
4717 """
4718 __init__(self, int x=0, int y=0) -> SetCursorEvent
4719
4720 Construct a new `wx.SetCursorEvent`.
4721 """
4722 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4723 def GetX(*args, **kwargs):
4724 """
4725 GetX(self) -> int
4726
4727 Returns the X coordinate of the mouse in client coordinates.
4728 """
4729 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4730
4731 def GetY(*args, **kwargs):
4732 """
4733 GetY(self) -> int
4734
4735 Returns the Y coordinate of the mouse in client coordinates.
4736 """
4737 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4738
4739 def SetCursor(*args, **kwargs):
4740 """
4741 SetCursor(self, Cursor cursor)
4742
4743 Sets the cursor associated with this event.
4744 """
4745 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4746
4747 def GetCursor(*args, **kwargs):
4748 """
4749 GetCursor(self) -> Cursor
4750
4751 Returns a reference to the cursor specified by this event.
4752 """
4753 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4754
4755 def HasCursor(*args, **kwargs):
4756 """
4757 HasCursor(self) -> bool
4758
4759 Returns true if the cursor specified by this event is a valid cursor.
4760 """
4761 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4762
4763 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4764
4765 #---------------------------------------------------------------------------
4766
4767 class KeyEvent(Event):
4768 """
4769 This event class contains information about keypress and character
4770 events. These events are only sent to the widget that currently has
4771 the keyboard focus.
4772
4773 Notice that there are three different kinds of keyboard events in
4774 wxWidgets: key down and up events and char events. The difference
4775 between the first two is clear - the first corresponds to a key press
4776 and the second to a key release - otherwise they are identical. Just
4777 note that if the key is maintained in a pressed state you will
4778 typically get a lot of (automatically generated) down events but only
4779 one up so it is wrong to assume that there is one up event
4780 corresponding to each down one.
4781
4782 Both key events provide untranslated key codes while the char event
4783 carries the translated one. The untranslated code for alphanumeric
4784 keys is always an upper case value. For the other keys it is one of
4785 WXK_XXX values from the keycodes table. The translated key is, in
4786 general, the character the user expects to appear as the result of the
4787 key combination when typing the text into a text entry zone, for
4788 example.
4789
4790 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4791 and the standard US keyboard): when the 'A' key is pressed, the key
4792 down event key code is equal to ASCII A == 65. But the char event key
4793 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4794 'A' keys simultaneously , the key code in key down event will still be
4795 just 'A' while the char event key code parameter will now be 'A' as
4796 well.
4797
4798 Although in this simple case it is clear that the correct key code
4799 could be found in the key down event handler by checking the value
4800 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4801 as for non alphanumeric keys or non-US keyboard layouts the
4802 translation is keyboard-layout dependent and can only be done properly
4803 by the system itself.
4804
4805 Another kind of translation is done when the control key is pressed:
4806 for example, for CTRL-A key press the key down event still carries the
4807 same key code 'A' as usual but the char event will have key code of 1,
4808 the ASCII value of this key combination.
4809
4810 You may discover how the other keys on your system behave
4811 interactively by running the KeyEvents sample in the wxPython demo and
4812 pressing some keys while the blue box at the top has the keyboard
4813 focus.
4814
4815 **Note**: If a key down event is caught and the event handler does not
4816 call event.Skip() then the coresponding char event will not
4817 happen. This is by design and enables the programs that handle both
4818 types of events to be a bit simpler.
4819
4820 **Note for Windows programmers**: The key and char events in wxWidgets
4821 are similar to but slightly different from Windows WM_KEYDOWN and
4822 WM_CHAR events. In particular, Alt-x combination will generate a char
4823 event in wxWidgets (unless it is used as an accelerator).
4824
4825 **Tip**: be sure to call event.Skip() for events that you don't
4826 process in key event function, otherwise menu shortcuts may cease to
4827 work under Windows.
4828
4829 """
4830 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4831 __repr__ = _swig_repr
4832 def __init__(self, *args, **kwargs):
4833 """
4834 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4835
4836 Construct a new `wx.KeyEvent`. Valid event types are:
4837 *
4838 """
4839 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4840 def GetModifiers(*args, **kwargs):
4841 """
4842 GetModifiers(self) -> int
4843
4844 Returns a bitmask of the current modifier settings. Can be used to
4845 check if the key event has exactly the given modifiers without having
4846 to explicitly check that the other modifiers are not down. For
4847 example::
4848
4849 if event.GetModifers() == wx.MOD_CONTROL:
4850 DoSomething()
4851
4852 """
4853 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4854
4855 def ControlDown(*args, **kwargs):
4856 """
4857 ControlDown(self) -> bool
4858
4859 Returns ``True`` if the Control key was down at the time of the event.
4860 """
4861 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4862
4863 def MetaDown(*args, **kwargs):
4864 """
4865 MetaDown(self) -> bool
4866
4867 Returns ``True`` if the Meta key was down at the time of the event.
4868 """
4869 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4870
4871 def AltDown(*args, **kwargs):
4872 """
4873 AltDown(self) -> bool
4874
4875 Returns ``True`` if the Alt key was down at the time of the event.
4876 """
4877 return _core_.KeyEvent_AltDown(*args, **kwargs)
4878
4879 def ShiftDown(*args, **kwargs):
4880 """
4881 ShiftDown(self) -> bool
4882
4883 Returns ``True`` if the Shift key was down at the time of the event.
4884 """
4885 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4886
4887 def CmdDown(*args, **kwargs):
4888 """
4889 CmdDown(self) -> bool
4890
4891 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4892 platforms but the special "Apple" (a.k.a as "Command") key on
4893 Macs. It makes often sense to use it instead of, say, `ControlDown`
4894 because Cmd key is used for the same thing under Mac as Ctrl
4895 elsewhere. The Ctrl still exists, it's just not used for this
4896 purpose. So for non-Mac platforms this is the same as `ControlDown`
4897 and Macs this is the same as `MetaDown`.
4898 """
4899 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4900
4901 def HasModifiers(*args, **kwargs):
4902 """
4903 HasModifiers(self) -> bool
4904
4905 Returns true if either CTRL or ALT keys was down at the time of the
4906 key event. Note that this function does not take into account neither
4907 SHIFT nor META key states (the reason for ignoring the latter is that
4908 it is common for NUMLOCK key to be configured as META under X but the
4909 key presses even while NUMLOCK is on should be still processed
4910 normally).
4911 """
4912 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4913
4914 def GetKeyCode(*args, **kwargs):
4915 """
4916 GetKeyCode(self) -> int
4917
4918 Returns the virtual key code. ASCII events return normal ASCII values,
4919 while non-ASCII events return values such as WXK_LEFT for the left
4920 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4921 codes.
4922
4923 Note that in Unicode build, the returned value is meaningful only if
4924 the user entered a character that can be represented in current
4925 locale's default charset. You can obtain the corresponding Unicode
4926 character using `GetUnicodeKey`.
4927 """
4928 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4929
4930 def GetUnicodeKey(*args, **kwargs):
4931 """
4932 GetUnicodeKey(self) -> int
4933
4934 Returns the Unicode character corresponding to this key event. This
4935 function is only meaningfule in a Unicode build of wxPython.
4936 """
4937 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4938
4939 GetUniChar = GetUnicodeKey
4940 def SetUnicodeKey(*args, **kwargs):
4941 """
4942 SetUnicodeKey(self, int uniChar)
4943
4944 Set the Unicode value of the key event, but only if this is a Unicode
4945 build of wxPython.
4946 """
4947 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4948
4949 def GetRawKeyCode(*args, **kwargs):
4950 """
4951 GetRawKeyCode(self) -> unsigned int
4952
4953 Returns the raw key code for this event. This is a platform-dependent
4954 scan code which should only be used in advanced
4955 applications. Currently the raw key codes are not supported by all
4956 ports.
4957 """
4958 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4959
4960 def GetRawKeyFlags(*args, **kwargs):
4961 """
4962 GetRawKeyFlags(self) -> unsigned int
4963
4964 Returns the low level key flags for this event. The flags are
4965 platform-dependent and should only be used in advanced applications.
4966 Currently the raw key flags are not supported by all ports.
4967 """
4968 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4969
4970 def GetPosition(*args, **kwargs):
4971 """
4972 GetPosition(self) -> Point
4973
4974 Find the position of the event, if applicable.
4975 """
4976 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4977
4978 def GetPositionTuple(*args, **kwargs):
4979 """
4980 GetPositionTuple() -> (x,y)
4981
4982 Find the position of the event, if applicable.
4983 """
4984 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4985
4986 def GetX(*args, **kwargs):
4987 """
4988 GetX(self) -> int
4989
4990 Returns the X position (in client coordinates) of the event, if
4991 applicable.
4992 """
4993 return _core_.KeyEvent_GetX(*args, **kwargs)
4994
4995 def GetY(*args, **kwargs):
4996 """
4997 GetY(self) -> int
4998
4999 Returns the Y position (in client coordinates) of the event, if
5000 applicable.
5001 """
5002 return _core_.KeyEvent_GetY(*args, **kwargs)
5003
5004 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5005 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5006 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5007 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5008 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5009 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5010 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5011 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5012 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5013 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5014 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5015 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5016 Position = property(GetPosition,doc="See `GetPosition`")
5017 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5018 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5019 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5020 X = property(GetX,doc="See `GetX`")
5021 Y = property(GetY,doc="See `GetY`")
5022 _core_.KeyEvent_swigregister(KeyEvent)
5023
5024 #---------------------------------------------------------------------------
5025
5026 class SizeEvent(Event):
5027 """
5028 A size event holds information about size change events. The EVT_SIZE
5029 handler function will be called when the window it is bound to has
5030 been resized.
5031
5032 Note that the size passed is of the whole window: call
5033 `wx.Window.GetClientSize` for the area which may be used by the
5034 application.
5035
5036 When a window is resized, usually only a small part of the window is
5037 damaged and and that area is all that is in the update region for the
5038 next paint event. However, if your drawing depends on the size of the
5039 window, you may need to clear the DC explicitly and repaint the whole
5040 window. In which case, you may need to call `wx.Window.Refresh` to
5041 invalidate the entire window.
5042
5043 """
5044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5045 __repr__ = _swig_repr
5046 def __init__(self, *args, **kwargs):
5047 """
5048 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5049
5050 Construct a new ``wx.SizeEvent``.
5051 """
5052 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5053 def GetSize(*args, **kwargs):
5054 """
5055 GetSize(self) -> Size
5056
5057 Returns the entire size of the window generating the size change
5058 event.
5059 """
5060 return _core_.SizeEvent_GetSize(*args, **kwargs)
5061
5062 def GetRect(*args, **kwargs):
5063 """GetRect(self) -> Rect"""
5064 return _core_.SizeEvent_GetRect(*args, **kwargs)
5065
5066 def SetRect(*args, **kwargs):
5067 """SetRect(self, Rect rect)"""
5068 return _core_.SizeEvent_SetRect(*args, **kwargs)
5069
5070 def SetSize(*args, **kwargs):
5071 """SetSize(self, Size size)"""
5072 return _core_.SizeEvent_SetSize(*args, **kwargs)
5073
5074 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5075 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5076 _core_.SizeEvent_swigregister(SizeEvent)
5077
5078 #---------------------------------------------------------------------------
5079
5080 class MoveEvent(Event):
5081 """
5082 This event object is sent for EVT_MOVE event bindings when a window is
5083 moved to a new position.
5084 """
5085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5086 __repr__ = _swig_repr
5087 def __init__(self, *args, **kwargs):
5088 """
5089 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5090
5091 Constructor.
5092 """
5093 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5094 def GetPosition(*args, **kwargs):
5095 """
5096 GetPosition(self) -> Point
5097
5098 Returns the position of the window generating the move change event.
5099 """
5100 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5101
5102 def GetRect(*args, **kwargs):
5103 """GetRect(self) -> Rect"""
5104 return _core_.MoveEvent_GetRect(*args, **kwargs)
5105
5106 def SetRect(*args, **kwargs):
5107 """SetRect(self, Rect rect)"""
5108 return _core_.MoveEvent_SetRect(*args, **kwargs)
5109
5110 def SetPosition(*args, **kwargs):
5111 """SetPosition(self, Point pos)"""
5112 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5113
5114 m_pos = property(GetPosition, SetPosition)
5115 m_rect = property(GetRect, SetRect)
5116
5117 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5118 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5119 _core_.MoveEvent_swigregister(MoveEvent)
5120
5121 #---------------------------------------------------------------------------
5122
5123 class PaintEvent(Event):
5124 """
5125 A paint event is sent when a window's contents needs to be repainted.
5126 Note that in an EVT_PAINT handler the application must *always* create
5127 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5128 Windows assumes that the window has not been painted yet and will send
5129 the event again, causing endless refreshes.
5130
5131 You can optimize painting by retrieving the rectangles that have been
5132 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5133 and only repainting these rectangles. The rectangles are in terms of
5134 the client area, and are unscrolled, so you will need to do some
5135 calculations using the current view position to obtain logical,
5136 scrolled units.
5137
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 """__init__(self, int Id=0) -> PaintEvent"""
5143 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5144 _core_.PaintEvent_swigregister(PaintEvent)
5145
5146 class NcPaintEvent(Event):
5147 """Proxy of C++ NcPaintEvent class"""
5148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5149 __repr__ = _swig_repr
5150 def __init__(self, *args, **kwargs):
5151 """__init__(self, int winid=0) -> NcPaintEvent"""
5152 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5153 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5154
5155 #---------------------------------------------------------------------------
5156
5157 class EraseEvent(Event):
5158 """
5159 An erase event is sent whenever the background of a window needs to be
5160 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5161 binder. On some platforms, such as GTK+, this event is simulated
5162 (simply generated just before the paint event) and may cause flicker.
5163
5164 To paint a custom background use the `GetDC` method and use the returned
5165 device context if it is not ``None``, otherwise create a temporary
5166 `wx.ClientDC` and draw on that.
5167
5168 """
5169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5170 __repr__ = _swig_repr
5171 def __init__(self, *args, **kwargs):
5172 """
5173 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5174
5175 Constructor
5176 """
5177 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5178 def GetDC(*args, **kwargs):
5179 """
5180 GetDC(self) -> DC
5181
5182 Returns the device context the event handler should draw upon. If
5183 ``None`` is returned then create a temporary `wx.ClientDC` and use
5184 that instead.
5185 """
5186 return _core_.EraseEvent_GetDC(*args, **kwargs)
5187
5188 DC = property(GetDC,doc="See `GetDC`")
5189 _core_.EraseEvent_swigregister(EraseEvent)
5190
5191 #---------------------------------------------------------------------------
5192
5193 class FocusEvent(Event):
5194 """
5195 A focus event is sent when a window's focus changes. The window losing
5196 focus receives an EVT_KILL_FOCUS event while the window gaining it
5197 gets an EVT_SET_FOCUS event.
5198
5199 Notice that the set focus event happens both when the user gives focus
5200 to the window (whether using the mouse or keyboard) and when it is
5201 done from the program itself using `wx.Window.SetFocus`.
5202
5203 """
5204 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5205 __repr__ = _swig_repr
5206 def __init__(self, *args, **kwargs):
5207 """
5208 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5209
5210 Constructor
5211 """
5212 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5213 def GetWindow(*args, **kwargs):
5214 """
5215 GetWindow(self) -> Window
5216
5217 Returns the other window associated with this event, that is the
5218 window which had the focus before for the EVT_SET_FOCUS event and the
5219 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5220
5221 Warning: the window returned may be None!
5222 """
5223 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5224
5225 def SetWindow(*args, **kwargs):
5226 """SetWindow(self, Window win)"""
5227 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5228
5229 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5230 _core_.FocusEvent_swigregister(FocusEvent)
5231
5232 #---------------------------------------------------------------------------
5233
5234 class ChildFocusEvent(CommandEvent):
5235 """
5236 wx.ChildFocusEvent notifies the parent that a child has received the
5237 focus. Unlike `wx.FocusEvent` it is propagated up the window
5238 heirarchy.
5239 """
5240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5241 __repr__ = _swig_repr
5242 def __init__(self, *args, **kwargs):
5243 """
5244 __init__(self, Window win=None) -> ChildFocusEvent
5245
5246 Constructor
5247 """
5248 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5249 def GetWindow(*args, **kwargs):
5250 """
5251 GetWindow(self) -> Window
5252
5253 The window which has just received the focus.
5254 """
5255 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5256
5257 Window = property(GetWindow,doc="See `GetWindow`")
5258 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5259
5260 #---------------------------------------------------------------------------
5261
5262 class ActivateEvent(Event):
5263 """
5264 An activate event is sent when a top-level window or the entire
5265 application is being activated or deactivated.
5266
5267 A top-level window (a dialog or frame) receives an activate event when
5268 is being activated or deactivated. This is indicated visually by the
5269 title bar changing colour, and a subwindow gaining the keyboard focus.
5270 An application is activated or deactivated when one of its frames
5271 becomes activated, or a frame becomes inactivate resulting in all
5272 application frames being inactive.
5273
5274 Please note that usually you should call event.Skip() in your handlers
5275 for these events so the default handlers will still be called, as not
5276 doing so can result in strange effects.
5277
5278 """
5279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5280 __repr__ = _swig_repr
5281 def __init__(self, *args, **kwargs):
5282 """
5283 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5284
5285 Constructor
5286 """
5287 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5288 def GetActive(*args, **kwargs):
5289 """
5290 GetActive(self) -> bool
5291
5292 Returns true if the application or window is being activated, false
5293 otherwise.
5294 """
5295 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5296
5297 Active = property(GetActive,doc="See `GetActive`")
5298 _core_.ActivateEvent_swigregister(ActivateEvent)
5299
5300 #---------------------------------------------------------------------------
5301
5302 class InitDialogEvent(Event):
5303 """
5304 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5305 any window when `wx.Window.InitDialog` is called. Handlers for this
5306 event can transfer data to the window, or anything else that should be
5307 done before the user begins editing the form. The default handler
5308 calls `wx.Window.TransferDataToWindow`.
5309 """
5310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5311 __repr__ = _swig_repr
5312 def __init__(self, *args, **kwargs):
5313 """
5314 __init__(self, int Id=0) -> InitDialogEvent
5315
5316 Constructor
5317 """
5318 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5319 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5320
5321 #---------------------------------------------------------------------------
5322
5323 class MenuEvent(Event):
5324 """
5325 This class is used for a variety of menu-related events. Note that
5326 these do not include menu command events, which are handled by sending
5327 `wx.CommandEvent` objects.
5328
5329 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5330 text in the first field of the status bar.
5331 """
5332 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5333 __repr__ = _swig_repr
5334 def __init__(self, *args, **kwargs):
5335 """
5336 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5337
5338 Constructor
5339 """
5340 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5341 def GetMenuId(*args, **kwargs):
5342 """
5343 GetMenuId(self) -> int
5344
5345 Returns the menu identifier associated with the event. This method
5346 should be only used with the HIGHLIGHT events.
5347 """
5348 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5349
5350 def IsPopup(*args, **kwargs):
5351 """
5352 IsPopup(self) -> bool
5353
5354 Returns ``True`` if the menu which is being opened or closed is a
5355 popup menu, ``False`` if it is a normal one. This method should only
5356 be used with the OPEN and CLOSE events.
5357 """
5358 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5359
5360 def GetMenu(*args, **kwargs):
5361 """
5362 GetMenu(self) -> Menu
5363
5364 Returns the menu which is being opened or closed. This method should
5365 only be used with the OPEN and CLOSE events.
5366 """
5367 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5368
5369 Menu = property(GetMenu,doc="See `GetMenu`")
5370 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5371 _core_.MenuEvent_swigregister(MenuEvent)
5372
5373 #---------------------------------------------------------------------------
5374
5375 class CloseEvent(Event):
5376 """
5377 This event class contains information about window and session close
5378 events.
5379
5380 The handler function for EVT_CLOSE is called when the user has tried
5381 to close a a frame or dialog box using the window manager controls or
5382 the system menu. It can also be invoked by the application itself
5383 programmatically, for example by calling the `wx.Window.Close`
5384 function.
5385
5386 You should check whether the application is forcing the deletion of
5387 the window using `CanVeto`. If it returns ``False``, you must destroy
5388 the window using `wx.Window.Destroy`. If the return value is ``True``,
5389 it is up to you whether you respond by destroying the window or not.
5390 For example you may wish to display a message dialog prompting to save
5391 files or to cancel the close.
5392
5393 If you don't destroy the window, you should call `Veto` to let the
5394 calling code know that you did not destroy the window. This allows the
5395 `wx.Window.Close` function to return ``True`` or ``False`` depending
5396 on whether the close instruction was honored or not.
5397 """
5398 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5399 __repr__ = _swig_repr
5400 def __init__(self, *args, **kwargs):
5401 """
5402 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5403
5404 Constructor.
5405 """
5406 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5407 def SetLoggingOff(*args, **kwargs):
5408 """
5409 SetLoggingOff(self, bool logOff)
5410
5411 Sets the 'logging off' flag.
5412 """
5413 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5414
5415 def GetLoggingOff(*args, **kwargs):
5416 """
5417 GetLoggingOff(self) -> bool
5418
5419 Returns ``True`` if the user is logging off or ``False`` if the
5420 system is shutting down. This method can only be called for end
5421 session and query end session events, it doesn't make sense for close
5422 window event.
5423 """
5424 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5425
5426 def Veto(*args, **kwargs):
5427 """
5428 Veto(self, bool veto=True)
5429
5430 Call this from your event handler to veto a system shutdown or to
5431 signal to the calling application that a window close did not happen.
5432
5433 You can only veto a shutdown or close if `CanVeto` returns true.
5434 """
5435 return _core_.CloseEvent_Veto(*args, **kwargs)
5436
5437 def GetVeto(*args, **kwargs):
5438 """GetVeto(self) -> bool"""
5439 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5440
5441 def SetCanVeto(*args, **kwargs):
5442 """
5443 SetCanVeto(self, bool canVeto)
5444
5445 Sets the 'can veto' flag.
5446 """
5447 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5448
5449 def CanVeto(*args, **kwargs):
5450 """
5451 CanVeto(self) -> bool
5452
5453 Returns true if you can veto a system shutdown or a window close
5454 event. Vetoing a window close event is not possible if the calling
5455 code wishes to force the application to exit, and so this function
5456 must be called to check this.
5457 """
5458 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5459
5460 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5461 _core_.CloseEvent_swigregister(CloseEvent)
5462
5463 #---------------------------------------------------------------------------
5464
5465 class ShowEvent(Event):
5466 """An EVT_SHOW event is sent when a window is shown or hidden."""
5467 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5468 __repr__ = _swig_repr
5469 def __init__(self, *args, **kwargs):
5470 """
5471 __init__(self, int winid=0, bool show=False) -> ShowEvent
5472
5473 An EVT_SHOW event is sent when a window is shown or hidden.
5474 """
5475 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5476 def SetShow(*args, **kwargs):
5477 """SetShow(self, bool show)"""
5478 return _core_.ShowEvent_SetShow(*args, **kwargs)
5479
5480 def GetShow(*args, **kwargs):
5481 """GetShow(self) -> bool"""
5482 return _core_.ShowEvent_GetShow(*args, **kwargs)
5483
5484 _core_.ShowEvent_swigregister(ShowEvent)
5485
5486 #---------------------------------------------------------------------------
5487
5488 class IconizeEvent(Event):
5489 """
5490 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5491 restored.
5492 """
5493 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5494 __repr__ = _swig_repr
5495 def __init__(self, *args, **kwargs):
5496 """
5497 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5498
5499 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5500 restored.
5501 """
5502 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5503 def Iconized(*args, **kwargs):
5504 """
5505 Iconized(self) -> bool
5506
5507 Returns ``True`` if the frame has been iconized, ``False`` if it has
5508 been restored.
5509 """
5510 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5511
5512 _core_.IconizeEvent_swigregister(IconizeEvent)
5513
5514 #---------------------------------------------------------------------------
5515
5516 class MaximizeEvent(Event):
5517 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5518 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5519 __repr__ = _swig_repr
5520 def __init__(self, *args, **kwargs):
5521 """
5522 __init__(self, int id=0) -> MaximizeEvent
5523
5524 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5525 """
5526 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5527 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5528
5529 #---------------------------------------------------------------------------
5530
5531 class DropFilesEvent(Event):
5532 """
5533 This class is used for drop files events, that is, when files have
5534 been dropped onto the window. This functionality is only available
5535 under Windows. The window must have previously been enabled for
5536 dropping by calling `wx.Window.DragAcceptFiles`.
5537
5538 Important note: this is a separate implementation to the more general
5539 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5540 implementation uses the older, Windows message-based approach of
5541 dropping files.
5542
5543 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5544 events.
5545
5546 """
5547 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5548 def __init__(self): raise AttributeError, "No constructor defined"
5549 __repr__ = _swig_repr
5550 def GetPosition(*args, **kwargs):
5551 """
5552 GetPosition(self) -> Point
5553
5554 Returns the position at which the files were dropped.
5555 """
5556 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5557
5558 def GetNumberOfFiles(*args, **kwargs):
5559 """
5560 GetNumberOfFiles(self) -> int
5561
5562 Returns the number of files dropped.
5563 """
5564 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5565
5566 def GetFiles(*args, **kwargs):
5567 """
5568 GetFiles(self) -> PyObject
5569
5570 Returns a list of the filenames that were dropped.
5571 """
5572 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5573
5574 Files = property(GetFiles,doc="See `GetFiles`")
5575 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5576 Position = property(GetPosition,doc="See `GetPosition`")
5577 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5578
5579 #---------------------------------------------------------------------------
5580
5581 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5582 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5583 class UpdateUIEvent(CommandEvent):
5584 """
5585 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5586 wxWidgets to give an application the chance to update various user
5587 interface elements.
5588
5589 Without update UI events, an application has to work hard to
5590 check/uncheck, enable/disable, and set the text for elements such as
5591 menu items and toolbar buttons. The code for doing this has to be
5592 mixed up with the code that is invoked when an action is invoked for a
5593 menu item or button.
5594
5595 With update UI events, you define an event handler to look at the
5596 state of the application and change UI elements accordingly. wxWidgets
5597 will call your handler functions in idle time, so you don't have to
5598 worry where to call this code. In addition to being a clearer and more
5599 declarative method, it also means you don't have to worry whether
5600 you're updating a toolbar or menubar identifier. The same handler can
5601 update a menu item and toolbar button, if the ID values are the same.
5602
5603 Instead of directly manipulating the menu or button, you call
5604 functions in the event object, such as `Check`. wxWidgets will
5605 determine whether such a call has been made, and which UI element to
5606 update.
5607
5608 These events will work for popup menus as well as menubars. Just
5609 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5610 any UI events for the window that owns the menu.
5611
5612 If you find that the overhead of UI update processing is affecting
5613 your application, you can do one or both of the following:
5614
5615 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5616 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5617 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5618 receive update events. No other windows will receive update
5619 events.
5620
5621 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5622 value to set the delay between updates. You may need to call
5623 `wx.Window.UpdateWindowUI` at critical points, for example when
5624 a dialog is about to be shown, in case the user sees a slight
5625 delay before windows are updated.
5626
5627 Note that although events are sent in idle time, defining a EVT_IDLE
5628 handler for a window does not affect this because the events are sent
5629 from an internal idle handler.
5630
5631 wxWidgets tries to optimize update events on some platforms. On
5632 Windows and GTK+, events for menubar items are only sent when the menu
5633 is about to be shown, and not in idle time.
5634
5635 """
5636 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5637 __repr__ = _swig_repr
5638 def __init__(self, *args, **kwargs):
5639 """
5640 __init__(self, int commandId=0) -> UpdateUIEvent
5641
5642 Constructor
5643 """
5644 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5645 def GetChecked(*args, **kwargs):
5646 """
5647 GetChecked(self) -> bool
5648
5649 Returns ``True`` if the UI element should be checked.
5650 """
5651 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5652
5653 def GetEnabled(*args, **kwargs):
5654 """
5655 GetEnabled(self) -> bool
5656
5657 Returns ``True`` if the UI element should be enabled.
5658 """
5659 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5660
5661 def GetShown(*args, **kwargs):
5662 """
5663 GetShown(self) -> bool
5664
5665 Returns ``True`` if the UI element should be shown.
5666 """
5667 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5668
5669 def GetText(*args, **kwargs):
5670 """
5671 GetText(self) -> String
5672
5673 Returns the text that should be set for the UI element.
5674 """
5675 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5676
5677 def GetSetText(*args, **kwargs):
5678 """
5679 GetSetText(self) -> bool
5680
5681 Returns ``True`` if the application has called `SetText`. For
5682 wxWidgets internal use only.
5683 """
5684 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5685
5686 def GetSetChecked(*args, **kwargs):
5687 """
5688 GetSetChecked(self) -> bool
5689
5690 Returns ``True`` if the application has called `Check`. For wxWidgets
5691 internal use only.
5692 """
5693 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5694
5695 def GetSetEnabled(*args, **kwargs):
5696 """
5697 GetSetEnabled(self) -> bool
5698
5699 Returns ``True`` if the application has called `Enable`. For wxWidgets
5700 internal use only.
5701 """
5702 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5703
5704 def GetSetShown(*args, **kwargs):
5705 """
5706 GetSetShown(self) -> bool
5707
5708 Returns ``True`` if the application has called `Show`. For wxWidgets
5709 internal use only.
5710 """
5711 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5712
5713 def Check(*args, **kwargs):
5714 """
5715 Check(self, bool check)
5716
5717 Check or uncheck the UI element.
5718 """
5719 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5720
5721 def Enable(*args, **kwargs):
5722 """
5723 Enable(self, bool enable)
5724
5725 Enable or disable the UI element.
5726 """
5727 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5728
5729 def Show(*args, **kwargs):
5730 """
5731 Show(self, bool show)
5732
5733 Show or hide the UI element.
5734 """
5735 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5736
5737 def SetText(*args, **kwargs):
5738 """
5739 SetText(self, String text)
5740
5741 Sets the text for this UI element.
5742 """
5743 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5744
5745 def SetUpdateInterval(*args, **kwargs):
5746 """
5747 SetUpdateInterval(long updateInterval)
5748
5749 Sets the interval between updates in milliseconds. Set to -1 to
5750 disable updates, or to 0 to update as frequently as possible. The
5751 default is 0.
5752
5753 Use this to reduce the overhead of UI update events if your
5754 application has a lot of windows. If you set the value to -1 or
5755 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5756 at appropriate points in your application, such as when a dialog is
5757 about to be shown.
5758 """
5759 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5760
5761 SetUpdateInterval = staticmethod(SetUpdateInterval)
5762 def GetUpdateInterval(*args, **kwargs):
5763 """
5764 GetUpdateInterval() -> long
5765
5766 Returns the current interval between updates in milliseconds. -1
5767 disables updates, 0 updates as frequently as possible.
5768 """
5769 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5770
5771 GetUpdateInterval = staticmethod(GetUpdateInterval)
5772 def CanUpdate(*args, **kwargs):
5773 """
5774 CanUpdate(Window win) -> bool
5775
5776 Returns ``True`` if it is appropriate to update (send UI update events
5777 to) this window.
5778
5779 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5780 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5781 events were last sent in idle time, and the update interval, to
5782 determine whether events should be sent to this window now. By default
5783 this will always return true because the update mode is initially
5784 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5785 events will be sent as often as possible. You can reduce the frequency
5786 that events are sent by changing the mode and/or setting an update
5787 interval.
5788
5789 """
5790 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5791
5792 CanUpdate = staticmethod(CanUpdate)
5793 def ResetUpdateTime(*args, **kwargs):
5794 """
5795 ResetUpdateTime()
5796
5797 Used internally to reset the last-updated time to the current time. It
5798 is assumed that update events are normally sent in idle time, so this
5799 is called at the end of idle processing.
5800 """
5801 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5802
5803 ResetUpdateTime = staticmethod(ResetUpdateTime)
5804 def SetMode(*args, **kwargs):
5805 """
5806 SetMode(int mode)
5807
5808 Specify how wxWidgets will send update events: to all windows, or only
5809 to those which specify that they will process the events.
5810
5811 The mode may be one of the following values:
5812
5813 ============================= ==========================================
5814 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5815 is the default setting.
5816 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5817 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5818 style set.
5819 ============================= ==========================================
5820
5821 """
5822 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5823
5824 SetMode = staticmethod(SetMode)
5825 def GetMode(*args, **kwargs):
5826 """
5827 GetMode() -> int
5828
5829 Returns a value specifying how wxWidgets will send update events: to
5830 all windows, or only to those which specify that they will process the
5831 events.
5832 """
5833 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5834
5835 GetMode = staticmethod(GetMode)
5836 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5837
5838 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5839 """
5840 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5841
5842 Sets the interval between updates in milliseconds. Set to -1 to
5843 disable updates, or to 0 to update as frequently as possible. The
5844 default is 0.
5845
5846 Use this to reduce the overhead of UI update events if your
5847 application has a lot of windows. If you set the value to -1 or
5848 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5849 at appropriate points in your application, such as when a dialog is
5850 about to be shown.
5851 """
5852 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5853
5854 def UpdateUIEvent_GetUpdateInterval(*args):
5855 """
5856 UpdateUIEvent_GetUpdateInterval() -> long
5857
5858 Returns the current interval between updates in milliseconds. -1
5859 disables updates, 0 updates as frequently as possible.
5860 """
5861 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5862
5863 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5864 """
5865 UpdateUIEvent_CanUpdate(Window win) -> bool
5866
5867 Returns ``True`` if it is appropriate to update (send UI update events
5868 to) this window.
5869
5870 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5871 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5872 events were last sent in idle time, and the update interval, to
5873 determine whether events should be sent to this window now. By default
5874 this will always return true because the update mode is initially
5875 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5876 events will be sent as often as possible. You can reduce the frequency
5877 that events are sent by changing the mode and/or setting an update
5878 interval.
5879
5880 """
5881 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5882
5883 def UpdateUIEvent_ResetUpdateTime(*args):
5884 """
5885 UpdateUIEvent_ResetUpdateTime()
5886
5887 Used internally to reset the last-updated time to the current time. It
5888 is assumed that update events are normally sent in idle time, so this
5889 is called at the end of idle processing.
5890 """
5891 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5892
5893 def UpdateUIEvent_SetMode(*args, **kwargs):
5894 """
5895 UpdateUIEvent_SetMode(int mode)
5896
5897 Specify how wxWidgets will send update events: to all windows, or only
5898 to those which specify that they will process the events.
5899
5900 The mode may be one of the following values:
5901
5902 ============================= ==========================================
5903 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5904 is the default setting.
5905 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5906 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5907 style set.
5908 ============================= ==========================================
5909
5910 """
5911 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5912
5913 def UpdateUIEvent_GetMode(*args):
5914 """
5915 UpdateUIEvent_GetMode() -> int
5916
5917 Returns a value specifying how wxWidgets will send update events: to
5918 all windows, or only to those which specify that they will process the
5919 events.
5920 """
5921 return _core_.UpdateUIEvent_GetMode(*args)
5922
5923 #---------------------------------------------------------------------------
5924
5925 class SysColourChangedEvent(Event):
5926 """
5927 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5928 when the user changes the colour settings using the control
5929 panel. This is only applicable under Windows.
5930
5931 The default event handler for this event propagates the event to child
5932 windows, since Windows only sends the events to top-level windows. If
5933 intercepting this event for a top-level window, remember to call
5934 `Skip` so the the base class handler will still be executed, or to
5935 pass the event on to the window's children explicitly.
5936
5937 """
5938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5939 __repr__ = _swig_repr
5940 def __init__(self, *args, **kwargs):
5941 """
5942 __init__(self) -> SysColourChangedEvent
5943
5944 Constructor
5945 """
5946 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5947 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5948
5949 #---------------------------------------------------------------------------
5950
5951 class MouseCaptureChangedEvent(Event):
5952 """
5953 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5954 a window that loses its mouse capture. This is called even if
5955 `wx.Window.ReleaseMouse` was called by the application code. Handling
5956 this event allows an application to cater for unexpected capture
5957 releases which might otherwise confuse mouse handling code.
5958
5959 This event is implemented under Windows only.
5960 """
5961 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5962 __repr__ = _swig_repr
5963 def __init__(self, *args, **kwargs):
5964 """
5965 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5966
5967 Constructor
5968 """
5969 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5970 def GetCapturedWindow(*args, **kwargs):
5971 """
5972 GetCapturedWindow(self) -> Window
5973
5974 Returns the window that gained the capture, or ``None`` if it was a
5975 non-wxWidgets window.
5976 """
5977 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5978
5979 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
5980 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5981
5982 #---------------------------------------------------------------------------
5983
5984 class MouseCaptureLostEvent(Event):
5985 """
5986 A mouse capture lost event is sent to a window that obtained mouse
5987 capture, which was subsequently loss due to "external" event, for
5988 example when a dialog box is shown or if another application captures
5989 the mouse.
5990
5991 If this happens, this event is sent to all windows that are on the
5992 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5993 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5994 if the capture changes because of a call to CaptureMouse or
5995 ReleaseMouse.
5996
5997 This event is currently emitted under Windows only.
5998
5999 """
6000 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6001 __repr__ = _swig_repr
6002 def __init__(self, *args, **kwargs):
6003 """
6004 __init__(self, int winid=0) -> MouseCaptureLostEvent
6005
6006 A mouse capture lost event is sent to a window that obtained mouse
6007 capture, which was subsequently loss due to "external" event, for
6008 example when a dialog box is shown or if another application captures
6009 the mouse.
6010
6011 If this happens, this event is sent to all windows that are on the
6012 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6013 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6014 if the capture changes because of a call to CaptureMouse or
6015 ReleaseMouse.
6016
6017 This event is currently emitted under Windows only.
6018
6019 """
6020 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6021 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6022
6023 #---------------------------------------------------------------------------
6024
6025 class DisplayChangedEvent(Event):
6026 """
6027 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6028 resolution has changed.
6029
6030 This event is implemented under Windows only.
6031 """
6032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6033 __repr__ = _swig_repr
6034 def __init__(self, *args, **kwargs):
6035 """__init__(self) -> DisplayChangedEvent"""
6036 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6037 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6038
6039 #---------------------------------------------------------------------------
6040
6041 class PaletteChangedEvent(Event):
6042 """
6043 An EVT_PALETTE_CHANGED event is sent when the system palette has
6044 changed, thereby giving each window a chance to redo their own to
6045 match.
6046
6047 This event is implemented under Windows only.
6048 """
6049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6050 __repr__ = _swig_repr
6051 def __init__(self, *args, **kwargs):
6052 """
6053 __init__(self, int id=0) -> PaletteChangedEvent
6054
6055 An EVT_PALETTE_CHANGED event is sent when the system palette has
6056 changed, thereby giving each window a chance to redo their own to
6057 match.
6058
6059 This event is implemented under Windows only.
6060 """
6061 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6062 def SetChangedWindow(*args, **kwargs):
6063 """SetChangedWindow(self, Window win)"""
6064 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6065
6066 def GetChangedWindow(*args, **kwargs):
6067 """GetChangedWindow(self) -> Window"""
6068 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6069
6070 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6071
6072 #---------------------------------------------------------------------------
6073
6074 class QueryNewPaletteEvent(Event):
6075 """
6076 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6077 focus and should re-do its palette.
6078
6079 This event is implemented under Windows only.
6080 """
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
6084 """
6085 __init__(self, int winid=0) -> QueryNewPaletteEvent
6086
6087 Constructor.
6088 """
6089 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6090 def SetPaletteRealized(*args, **kwargs):
6091 """
6092 SetPaletteRealized(self, bool realized)
6093
6094 App should set this if it changes the palette.
6095 """
6096 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6097
6098 def GetPaletteRealized(*args, **kwargs):
6099 """GetPaletteRealized(self) -> bool"""
6100 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6101
6102 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6103
6104 #---------------------------------------------------------------------------
6105
6106 class NavigationKeyEvent(Event):
6107 """
6108 EVT_NAVIGATION_KEY events are used to control moving the focus between
6109 widgets, otherwise known as tab-traversal. You woudl normally not
6110 catch navigation events in applications as there are already
6111 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6112 it useful to send navigation events in certain situations to change
6113 the focus in certain ways, although it's probably easier to just call
6114 `wx.Window.Navigate`.
6115 """
6116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6117 __repr__ = _swig_repr
6118 def __init__(self, *args, **kwargs):
6119 """__init__(self) -> NavigationKeyEvent"""
6120 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6121 def GetDirection(*args, **kwargs):
6122 """
6123 GetDirection(self) -> bool
6124
6125 Returns ``True`` if the direction is forward, ``False`` otherwise.
6126 """
6127 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6128
6129 def SetDirection(*args, **kwargs):
6130 """
6131 SetDirection(self, bool forward)
6132
6133 Specify the direction that the navigation should take. Usually the
6134 difference between using Tab and Shift-Tab.
6135 """
6136 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6137
6138 def IsWindowChange(*args, **kwargs):
6139 """
6140 IsWindowChange(self) -> bool
6141
6142 Returns ``True`` if window change is allowed.
6143 """
6144 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6145
6146 def SetWindowChange(*args, **kwargs):
6147 """
6148 SetWindowChange(self, bool ischange)
6149
6150 Specify if the navigation should be able to change parent windows.
6151 For example, changing notebook pages, etc. This is usually implemented
6152 by using Control-Tab.
6153 """
6154 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6155
6156 def IsFromTab(*args, **kwargs):
6157 """
6158 IsFromTab(self) -> bool
6159
6160 Returns ``True`` if the navigation event is originated from the Tab
6161 key.
6162 """
6163 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6164
6165 def SetFromTab(*args, **kwargs):
6166 """
6167 SetFromTab(self, bool bIs)
6168
6169 Set to true under MSW if the event was generated using the tab key.
6170 This is required for proper navogation over radio buttons.
6171 """
6172 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6173
6174 def SetFlags(*args, **kwargs):
6175 """
6176 SetFlags(self, long flags)
6177
6178 Set the navigation flags to a combination of the following:
6179
6180 * wx.NavigationKeyEvent.IsBackward
6181 * wx.NavigationKeyEvent.IsForward
6182 * wx.NavigationKeyEvent.WinChange
6183 * wx.NavigationKeyEvent.FromTab
6184
6185 """
6186 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6187
6188 def GetCurrentFocus(*args, **kwargs):
6189 """
6190 GetCurrentFocus(self) -> Window
6191
6192 Returns the child window which currenty has the focus. May be
6193 ``None``.
6194 """
6195 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6196
6197 def SetCurrentFocus(*args, **kwargs):
6198 """
6199 SetCurrentFocus(self, Window win)
6200
6201 Set the window that has the focus.
6202 """
6203 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6204
6205 IsBackward = _core_.NavigationKeyEvent_IsBackward
6206 IsForward = _core_.NavigationKeyEvent_IsForward
6207 WinChange = _core_.NavigationKeyEvent_WinChange
6208 FromTab = _core_.NavigationKeyEvent_FromTab
6209 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6210 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6211 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6212
6213 #---------------------------------------------------------------------------
6214
6215 class WindowCreateEvent(CommandEvent):
6216 """
6217 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6218 underlying GUI object) exists.
6219 """
6220 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6221 __repr__ = _swig_repr
6222 def __init__(self, *args, **kwargs):
6223 """
6224 __init__(self, Window win=None) -> WindowCreateEvent
6225
6226 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6227 underlying GUI object) exists.
6228 """
6229 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6230 def GetWindow(*args, **kwargs):
6231 """
6232 GetWindow(self) -> Window
6233
6234 Returns the window that this event refers to.
6235 """
6236 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6237
6238 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6239
6240 class WindowDestroyEvent(CommandEvent):
6241 """
6242 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6243 when the GUI window is destroyed.
6244
6245 When a class derived from `wx.Window` is destroyed its destructor will
6246 have already run by the time this event is sent. Therefore this event
6247 will not usually be received at all by the window itself. Since it is
6248 received after the destructor has run, an object should not try to
6249 handle its own wx.WindowDestroyEvent, but it can be used to get
6250 notification of the destruction of another window.
6251 """
6252 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6253 __repr__ = _swig_repr
6254 def __init__(self, *args, **kwargs):
6255 """
6256 __init__(self, Window win=None) -> WindowDestroyEvent
6257
6258 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6259 when the GUI window is destroyed.
6260
6261 When a class derived from `wx.Window` is destroyed its destructor will
6262 have already run by the time this event is sent. Therefore this event
6263 will not usually be received at all by the window itself. Since it is
6264 received after the destructor has run, an object should not try to
6265 handle its own wx.WindowDestroyEvent, but it can be used to get
6266 notification of the destruction of another window.
6267 """
6268 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6269 def GetWindow(*args, **kwargs):
6270 """
6271 GetWindow(self) -> Window
6272
6273 Returns the window that this event refers to.
6274 """
6275 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6276
6277 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6278
6279 #---------------------------------------------------------------------------
6280
6281 class ContextMenuEvent(CommandEvent):
6282 """
6283 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6284 give the application a chance to show a context (popup) menu.
6285 """
6286 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6287 __repr__ = _swig_repr
6288 def __init__(self, *args, **kwargs):
6289 """
6290 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6291
6292 Constructor.
6293 """
6294 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6295 def GetPosition(*args, **kwargs):
6296 """
6297 GetPosition(self) -> Point
6298
6299 Returns the position (in screen coordinants) at which the menu should
6300 be shown.
6301 """
6302 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6303
6304 def SetPosition(*args, **kwargs):
6305 """
6306 SetPosition(self, Point pos)
6307
6308 Sets the position at which the menu should be shown.
6309 """
6310 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6311
6312 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6313 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6314
6315 #---------------------------------------------------------------------------
6316
6317 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6318 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6319 class IdleEvent(Event):
6320 """
6321 This class is used for EVT_IDLE events, which are generated and sent
6322 when the application *becomes* idle. In other words, the when the
6323 event queue becomes empty then idle events are sent to all windows (by
6324 default) and as long as none of them call `RequestMore` then there are
6325 no more idle events until after the system event queue has some normal
6326 events and then becomes empty again.
6327
6328 By default, idle events are sent to all windows. If this is causing a
6329 significant overhead in your application, you can call
6330 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6331 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6332 which should receive idle events. Then idle events will only be sent
6333 to those windows and not to any others.
6334 """
6335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6336 __repr__ = _swig_repr
6337 def __init__(self, *args, **kwargs):
6338 """
6339 __init__(self) -> IdleEvent
6340
6341 Constructor
6342 """
6343 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6344 def RequestMore(*args, **kwargs):
6345 """
6346 RequestMore(self, bool needMore=True)
6347
6348 Tells wxWidgets that more processing is required. This function can be
6349 called by an EVT_IDLE handler for a window to indicate that the
6350 application should forward the EVT_IDLE event once more to the
6351 application windows. If no window calls this function during its
6352 EVT_IDLE handler, then the application will remain in a passive event
6353 loop until a new event is posted to the application by the windowing
6354 system.
6355 """
6356 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6357
6358 def MoreRequested(*args, **kwargs):
6359 """
6360 MoreRequested(self) -> bool
6361
6362 Returns ``True`` if the OnIdle function processing this event
6363 requested more processing time.
6364 """
6365 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6366
6367 def SetMode(*args, **kwargs):
6368 """
6369 SetMode(int mode)
6370
6371 Static method for specifying how wxWidgets will send idle events: to
6372 all windows, or only to those which specify that they will process the
6373 events.
6374
6375 The mode can be one of the following values:
6376
6377 ========================= ========================================
6378 wx.IDLE_PROCESS_ALL Send idle events to all windows
6379 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6380 the wx.WS_EX_PROCESS_IDLE extra style
6381 flag set.
6382 ========================= ========================================
6383
6384 """
6385 return _core_.IdleEvent_SetMode(*args, **kwargs)
6386
6387 SetMode = staticmethod(SetMode)
6388 def GetMode(*args, **kwargs):
6389 """
6390 GetMode() -> int
6391
6392 Static method returning a value specifying how wxWidgets will send
6393 idle events: to all windows, or only to those which specify that they
6394 will process the events.
6395 """
6396 return _core_.IdleEvent_GetMode(*args, **kwargs)
6397
6398 GetMode = staticmethod(GetMode)
6399 def CanSend(*args, **kwargs):
6400 """
6401 CanSend(Window win) -> bool
6402
6403 Returns ``True`` if it is appropriate to send idle events to this
6404 window.
6405
6406 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6407 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6408 events should be sent to this window now. By default this will always
6409 return ``True`` because the update mode is initially
6410 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6411 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6412 """
6413 return _core_.IdleEvent_CanSend(*args, **kwargs)
6414
6415 CanSend = staticmethod(CanSend)
6416 _core_.IdleEvent_swigregister(IdleEvent)
6417
6418 def IdleEvent_SetMode(*args, **kwargs):
6419 """
6420 IdleEvent_SetMode(int mode)
6421
6422 Static method for specifying how wxWidgets will send idle events: to
6423 all windows, or only to those which specify that they will process the
6424 events.
6425
6426 The mode can be one of the following values:
6427
6428 ========================= ========================================
6429 wx.IDLE_PROCESS_ALL Send idle events to all windows
6430 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6431 the wx.WS_EX_PROCESS_IDLE extra style
6432 flag set.
6433 ========================= ========================================
6434
6435 """
6436 return _core_.IdleEvent_SetMode(*args, **kwargs)
6437
6438 def IdleEvent_GetMode(*args):
6439 """
6440 IdleEvent_GetMode() -> int
6441
6442 Static method returning a value specifying how wxWidgets will send
6443 idle events: to all windows, or only to those which specify that they
6444 will process the events.
6445 """
6446 return _core_.IdleEvent_GetMode(*args)
6447
6448 def IdleEvent_CanSend(*args, **kwargs):
6449 """
6450 IdleEvent_CanSend(Window win) -> bool
6451
6452 Returns ``True`` if it is appropriate to send idle events to this
6453 window.
6454
6455 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6456 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6457 events should be sent to this window now. By default this will always
6458 return ``True`` because the update mode is initially
6459 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6460 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6461 """
6462 return _core_.IdleEvent_CanSend(*args, **kwargs)
6463
6464 #---------------------------------------------------------------------------
6465
6466 class ClipboardTextEvent(CommandEvent):
6467 """
6468 A Clipboard Text event is sent when a window intercepts a text
6469 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6470 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6471 popup menu command, etc. NOTE : under windows these events are *NOT*
6472 generated automatically for a Rich Edit text control.
6473 """
6474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6475 __repr__ = _swig_repr
6476 def __init__(self, *args, **kwargs):
6477 """
6478 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6479
6480 A Clipboard Text event is sent when a window intercepts a text
6481 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6482 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6483 popup menu command, etc. NOTE : under windows these events are *NOT*
6484 generated automatically for a Rich Edit text control.
6485 """
6486 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6487 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6488
6489 #---------------------------------------------------------------------------
6490
6491 class PyEvent(Event):
6492 """
6493 wx.PyEvent can be used as a base class for implementing custom event
6494 types in Python. You should derived from this class instead of
6495 `wx.Event` because this class is Python-aware and is able to transport
6496 its Python bits safely through the wxWidgets event system and have
6497 them still be there when the event handler is invoked.
6498
6499 :see: `wx.PyCommandEvent`
6500
6501 """
6502 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6503 __repr__ = _swig_repr
6504 def __init__(self, *args, **kwargs):
6505 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6506 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6507 self._SetSelf(self)
6508
6509 __swig_destroy__ = _core_.delete_PyEvent
6510 __del__ = lambda self : None;
6511 def _SetSelf(*args, **kwargs):
6512 """_SetSelf(self, PyObject self)"""
6513 return _core_.PyEvent__SetSelf(*args, **kwargs)
6514
6515 def _GetSelf(*args, **kwargs):
6516 """_GetSelf(self) -> PyObject"""
6517 return _core_.PyEvent__GetSelf(*args, **kwargs)
6518
6519 _core_.PyEvent_swigregister(PyEvent)
6520
6521 class PyCommandEvent(CommandEvent):
6522 """
6523 wx.PyCommandEvent can be used as a base class for implementing custom
6524 event types in Python, where the event shoudl travel up to parent
6525 windows looking for a handler. You should derived from this class
6526 instead of `wx.CommandEvent` because this class is Python-aware and is
6527 able to transport its Python bits safely through the wxWidgets event
6528 system and have them still be there when the event handler is invoked.
6529
6530 :see: `wx.PyEvent`
6531
6532 """
6533 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6534 __repr__ = _swig_repr
6535 def __init__(self, *args, **kwargs):
6536 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6537 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6538 self._SetSelf(self)
6539
6540 __swig_destroy__ = _core_.delete_PyCommandEvent
6541 __del__ = lambda self : None;
6542 def _SetSelf(*args, **kwargs):
6543 """_SetSelf(self, PyObject self)"""
6544 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6545
6546 def _GetSelf(*args, **kwargs):
6547 """_GetSelf(self) -> PyObject"""
6548 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6549
6550 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6551
6552 class DateEvent(CommandEvent):
6553 """
6554 This event class holds information about a date change event and is
6555 used together with `wx.DatePickerCtrl`. It also serves as a base class
6556 for `wx.calendar.CalendarEvent`. Bind these event types with
6557 EVT_DATE_CHANGED.
6558 """
6559 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6560 __repr__ = _swig_repr
6561 def __init__(self, *args, **kwargs):
6562 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6563 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6564 def GetDate(*args, **kwargs):
6565 """
6566 GetDate(self) -> DateTime
6567
6568 Returns the date.
6569 """
6570 return _core_.DateEvent_GetDate(*args, **kwargs)
6571
6572 def SetDate(*args, **kwargs):
6573 """
6574 SetDate(self, DateTime date)
6575
6576 Sets the date carried by the event, normally only used by the library
6577 internally.
6578 """
6579 return _core_.DateEvent_SetDate(*args, **kwargs)
6580
6581 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6582 _core_.DateEvent_swigregister(DateEvent)
6583
6584 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6585 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6586
6587 #---------------------------------------------------------------------------
6588
6589 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6590 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6591 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6592 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6593 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6594 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6595 class PyApp(EvtHandler):
6596 """
6597 The ``wx.PyApp`` class is an *implementation detail*, please use the
6598 `wx.App` class (or some other derived class) instead.
6599 """
6600 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6601 __repr__ = _swig_repr
6602 def __init__(self, *args, **kwargs):
6603 """
6604 __init__(self) -> PyApp
6605
6606 Create a new application object, starting the bootstrap process.
6607 """
6608 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6609 self._setCallbackInfo(self, PyApp, False)
6610 self._setOORInfo(self, False)
6611
6612 __swig_destroy__ = _core_.delete_PyApp
6613 __del__ = lambda self : None;
6614 def _setCallbackInfo(*args, **kwargs):
6615 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6616 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6617
6618 def GetAppName(*args, **kwargs):
6619 """
6620 GetAppName(self) -> String
6621
6622 Get the application name.
6623 """
6624 return _core_.PyApp_GetAppName(*args, **kwargs)
6625
6626 def SetAppName(*args, **kwargs):
6627 """
6628 SetAppName(self, String name)
6629
6630 Set the application name. This value may be used automatically by
6631 `wx.Config` and such.
6632 """
6633 return _core_.PyApp_SetAppName(*args, **kwargs)
6634
6635 def GetClassName(*args, **kwargs):
6636 """
6637 GetClassName(self) -> String
6638
6639 Get the application's class name.
6640 """
6641 return _core_.PyApp_GetClassName(*args, **kwargs)
6642
6643 def SetClassName(*args, **kwargs):
6644 """
6645 SetClassName(self, String name)
6646
6647 Set the application's class name. This value may be used for
6648 X-resources if applicable for the platform
6649 """
6650 return _core_.PyApp_SetClassName(*args, **kwargs)
6651
6652 def GetVendorName(*args, **kwargs):
6653 """
6654 GetVendorName(self) -> String
6655
6656 Get the application's vendor name.
6657 """
6658 return _core_.PyApp_GetVendorName(*args, **kwargs)
6659
6660 def SetVendorName(*args, **kwargs):
6661 """
6662 SetVendorName(self, String name)
6663
6664 Set the application's vendor name. This value may be used
6665 automatically by `wx.Config` and such.
6666 """
6667 return _core_.PyApp_SetVendorName(*args, **kwargs)
6668
6669 def GetTraits(*args, **kwargs):
6670 """
6671 GetTraits(self) -> wxAppTraits
6672
6673 Return (and create if necessary) the app traits object to which we
6674 delegate for everything which either should be configurable by the
6675 user (then he can change the default behaviour simply by overriding
6676 CreateTraits() and returning his own traits object) or which is
6677 GUI/console dependent as then wx.AppTraits allows us to abstract the
6678 differences behind the common facade.
6679
6680 :todo: Add support for overriding CreateAppTraits in wxPython.
6681 """
6682 return _core_.PyApp_GetTraits(*args, **kwargs)
6683
6684 def ProcessPendingEvents(*args, **kwargs):
6685 """
6686 ProcessPendingEvents(self)
6687
6688 Process all events in the Pending Events list -- it is necessary to
6689 call this function to process posted events. This normally happens
6690 during each event loop iteration.
6691 """
6692 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6693
6694 def Yield(*args, **kwargs):
6695 """
6696 Yield(self, bool onlyIfNeeded=False) -> bool
6697
6698 Process all currently pending events right now, instead of waiting
6699 until return to the event loop. It is an error to call ``Yield``
6700 recursively unless the value of ``onlyIfNeeded`` is True.
6701
6702 :warning: This function is dangerous as it can lead to unexpected
6703 reentrancies (i.e. when called from an event handler it may
6704 result in calling the same event handler again), use with
6705 extreme care or, better, don't use at all!
6706
6707 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6708
6709 """
6710 return _core_.PyApp_Yield(*args, **kwargs)
6711
6712 def WakeUpIdle(*args, **kwargs):
6713 """
6714 WakeUpIdle(self)
6715
6716 Make sure that idle events are sent again.
6717 :see: `wx.WakeUpIdle`
6718 """
6719 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6720
6721 def IsMainLoopRunning(*args, **kwargs):
6722 """
6723 IsMainLoopRunning() -> bool
6724
6725 Returns True if we're running the main loop, i.e. if the events can
6726 currently be dispatched.
6727 """
6728 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6729
6730 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6731 def MainLoop(*args, **kwargs):
6732 """
6733 MainLoop(self) -> int
6734
6735 Execute the main GUI loop, the function doesn't normally return until
6736 all top level windows have been closed and destroyed.
6737 """
6738 return _core_.PyApp_MainLoop(*args, **kwargs)
6739
6740 def Exit(*args, **kwargs):
6741 """
6742 Exit(self)
6743
6744 Exit the main loop thus terminating the application.
6745 :see: `wx.Exit`
6746 """
6747 return _core_.PyApp_Exit(*args, **kwargs)
6748
6749 def GetLayoutDirection(*args, **kwargs):
6750 """
6751 GetLayoutDirection(self) -> wxLayoutDirection
6752
6753 Return the layout direction for the current locale.
6754 """
6755 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6756
6757 def ExitMainLoop(*args, **kwargs):
6758 """
6759 ExitMainLoop(self)
6760
6761 Exit the main GUI loop during the next iteration of the main
6762 loop, (i.e. it does not stop the program immediately!)
6763 """
6764 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6765
6766 def Pending(*args, **kwargs):
6767 """
6768 Pending(self) -> bool
6769
6770 Returns True if there are unprocessed events in the event queue.
6771 """
6772 return _core_.PyApp_Pending(*args, **kwargs)
6773
6774 def Dispatch(*args, **kwargs):
6775 """
6776 Dispatch(self) -> bool
6777
6778 Process the first event in the event queue (blocks until an event
6779 appears if there are none currently)
6780 """
6781 return _core_.PyApp_Dispatch(*args, **kwargs)
6782
6783 def ProcessIdle(*args, **kwargs):
6784 """
6785 ProcessIdle(self) -> bool
6786
6787 Called from the MainLoop when the application becomes idle (there are
6788 no pending events) and sends a `wx.IdleEvent` to all interested
6789 parties. Returns True if more idle events are needed, False if not.
6790 """
6791 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6792
6793 def SendIdleEvents(*args, **kwargs):
6794 """
6795 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6796
6797 Send idle event to window and all subwindows. Returns True if more
6798 idle time is requested.
6799 """
6800 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6801
6802 def IsActive(*args, **kwargs):
6803 """
6804 IsActive(self) -> bool
6805
6806 Return True if our app has focus.
6807 """
6808 return _core_.PyApp_IsActive(*args, **kwargs)
6809
6810 def SetTopWindow(*args, **kwargs):
6811 """
6812 SetTopWindow(self, Window win)
6813
6814 Set the *main* top level window
6815 """
6816 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6817
6818 def GetTopWindow(*args, **kwargs):
6819 """
6820 GetTopWindow(self) -> Window
6821
6822 Return the *main* top level window (if it hadn't been set previously
6823 with SetTopWindow(), will return just some top level window and, if
6824 there not any, will return None)
6825 """
6826 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6827
6828 def SetExitOnFrameDelete(*args, **kwargs):
6829 """
6830 SetExitOnFrameDelete(self, bool flag)
6831
6832 Control the exit behaviour: by default, the program will exit the main
6833 loop (and so, usually, terminate) when the last top-level program
6834 window is deleted. Beware that if you disable this behaviour (with
6835 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6836 explicitly from somewhere.
6837 """
6838 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6839
6840 def GetExitOnFrameDelete(*args, **kwargs):
6841 """
6842 GetExitOnFrameDelete(self) -> bool
6843
6844 Get the current exit behaviour setting.
6845 """
6846 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6847
6848 def SetUseBestVisual(*args, **kwargs):
6849 """
6850 SetUseBestVisual(self, bool flag)
6851
6852 Set whether the app should try to use the best available visual on
6853 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6854 """
6855 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6856
6857 def GetUseBestVisual(*args, **kwargs):
6858 """
6859 GetUseBestVisual(self) -> bool
6860
6861 Get current UseBestVisual setting.
6862 """
6863 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6864
6865 def SetPrintMode(*args, **kwargs):
6866 """SetPrintMode(self, int mode)"""
6867 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6868
6869 def GetPrintMode(*args, **kwargs):
6870 """GetPrintMode(self) -> int"""
6871 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6872
6873 def SetAssertMode(*args, **kwargs):
6874 """
6875 SetAssertMode(self, int mode)
6876
6877 Set the OnAssert behaviour for debug and hybrid builds.
6878 """
6879 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6880
6881 def GetAssertMode(*args, **kwargs):
6882 """
6883 GetAssertMode(self) -> int
6884
6885 Get the current OnAssert behaviour setting.
6886 """
6887 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6888
6889 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6890 """GetMacSupportPCMenuShortcuts() -> bool"""
6891 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6892
6893 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6894 def GetMacAboutMenuItemId(*args, **kwargs):
6895 """GetMacAboutMenuItemId() -> long"""
6896 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6897
6898 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6899 def GetMacPreferencesMenuItemId(*args, **kwargs):
6900 """GetMacPreferencesMenuItemId() -> long"""
6901 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6902
6903 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6904 def GetMacExitMenuItemId(*args, **kwargs):
6905 """GetMacExitMenuItemId() -> long"""
6906 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6907
6908 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6909 def GetMacHelpMenuTitleName(*args, **kwargs):
6910 """GetMacHelpMenuTitleName() -> String"""
6911 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6912
6913 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6914 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6915 """SetMacSupportPCMenuShortcuts(bool val)"""
6916 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6917
6918 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6919 def SetMacAboutMenuItemId(*args, **kwargs):
6920 """SetMacAboutMenuItemId(long val)"""
6921 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6922
6923 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6924 def SetMacPreferencesMenuItemId(*args, **kwargs):
6925 """SetMacPreferencesMenuItemId(long val)"""
6926 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6927
6928 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6929 def SetMacExitMenuItemId(*args, **kwargs):
6930 """SetMacExitMenuItemId(long val)"""
6931 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6932
6933 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6934 def SetMacHelpMenuTitleName(*args, **kwargs):
6935 """SetMacHelpMenuTitleName(String val)"""
6936 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6937
6938 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6939 def _BootstrapApp(*args, **kwargs):
6940 """
6941 _BootstrapApp(self)
6942
6943 For internal use only
6944 """
6945 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6946
6947 def GetComCtl32Version(*args, **kwargs):
6948 """
6949 GetComCtl32Version() -> int
6950
6951 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6952 it wasn't found at all. Raises an exception on non-Windows platforms.
6953 """
6954 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6955
6956 GetComCtl32Version = staticmethod(GetComCtl32Version)
6957 def DisplayAvailable(*args, **kwargs):
6958 """
6959 DisplayAvailable() -> bool
6960
6961 Tests if it is possible to create a GUI in the current environment.
6962 This will mean different things on the different platforms.
6963
6964 * On X Windows systems this function will return ``False`` if it is
6965 not able to open a connection to the X display, which can happen
6966 if $DISPLAY is not set, or is not set correctly.
6967
6968 * On Mac OS X a ``False`` return value will mean that wx is not
6969 able to access the window manager, which can happen if logged in
6970 remotely or if running from the normal version of python instead
6971 of the framework version, (i.e., pythonw.)
6972
6973 * On MS Windows...
6974
6975 """
6976 return _core_.PyApp_DisplayAvailable(*args, **kwargs)
6977
6978 DisplayAvailable = staticmethod(DisplayAvailable)
6979 _core_.PyApp_swigregister(PyApp)
6980
6981 def PyApp_IsMainLoopRunning(*args):
6982 """
6983 PyApp_IsMainLoopRunning() -> bool
6984
6985 Returns True if we're running the main loop, i.e. if the events can
6986 currently be dispatched.
6987 """
6988 return _core_.PyApp_IsMainLoopRunning(*args)
6989
6990 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6991 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6992 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6993
6994 def PyApp_GetMacAboutMenuItemId(*args):
6995 """PyApp_GetMacAboutMenuItemId() -> long"""
6996 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6997
6998 def PyApp_GetMacPreferencesMenuItemId(*args):
6999 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7000 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7001
7002 def PyApp_GetMacExitMenuItemId(*args):
7003 """PyApp_GetMacExitMenuItemId() -> long"""
7004 return _core_.PyApp_GetMacExitMenuItemId(*args)
7005
7006 def PyApp_GetMacHelpMenuTitleName(*args):
7007 """PyApp_GetMacHelpMenuTitleName() -> String"""
7008 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7009
7010 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7011 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7012 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7013
7014 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7015 """PyApp_SetMacAboutMenuItemId(long val)"""
7016 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7017
7018 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7019 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7020 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7021
7022 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7023 """PyApp_SetMacExitMenuItemId(long val)"""
7024 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7025
7026 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7027 """PyApp_SetMacHelpMenuTitleName(String val)"""
7028 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7029
7030 def PyApp_GetComCtl32Version(*args):
7031 """
7032 PyApp_GetComCtl32Version() -> int
7033
7034 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7035 it wasn't found at all. Raises an exception on non-Windows platforms.
7036 """
7037 return _core_.PyApp_GetComCtl32Version(*args)
7038
7039 def PyApp_DisplayAvailable(*args):
7040 """
7041 PyApp_DisplayAvailable() -> bool
7042
7043 Tests if it is possible to create a GUI in the current environment.
7044 This will mean different things on the different platforms.
7045
7046 * On X Windows systems this function will return ``False`` if it is
7047 not able to open a connection to the X display, which can happen
7048 if $DISPLAY is not set, or is not set correctly.
7049
7050 * On Mac OS X a ``False`` return value will mean that wx is not
7051 able to access the window manager, which can happen if logged in
7052 remotely or if running from the normal version of python instead
7053 of the framework version, (i.e., pythonw.)
7054
7055 * On MS Windows...
7056
7057 """
7058 return _core_.PyApp_DisplayAvailable(*args)
7059
7060 #---------------------------------------------------------------------------
7061
7062
7063 def Exit(*args):
7064 """
7065 Exit()
7066
7067 Force an exit of the application. Convenience for wx.GetApp().Exit()
7068 """
7069 return _core_.Exit(*args)
7070
7071 def Yield(*args):
7072 """
7073 Yield() -> bool
7074
7075 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7076 """
7077 return _core_.Yield(*args)
7078
7079 def YieldIfNeeded(*args):
7080 """
7081 YieldIfNeeded() -> bool
7082
7083 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7084 """
7085 return _core_.YieldIfNeeded(*args)
7086
7087 def SafeYield(*args, **kwargs):
7088 """
7089 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7090
7091 This function is similar to `wx.Yield`, except that it disables the
7092 user input to all program windows before calling `wx.Yield` and
7093 re-enables it again afterwards. If ``win`` is not None, this window
7094 will remain enabled, allowing the implementation of some limited user
7095 interaction.
7096
7097 :Returns: the result of the call to `wx.Yield`.
7098 """
7099 return _core_.SafeYield(*args, **kwargs)
7100
7101 def WakeUpIdle(*args):
7102 """
7103 WakeUpIdle()
7104
7105 Cause the message queue to become empty again, so idle events will be
7106 sent.
7107 """
7108 return _core_.WakeUpIdle(*args)
7109
7110 def PostEvent(*args, **kwargs):
7111 """
7112 PostEvent(EvtHandler dest, Event event)
7113
7114 Send an event to a window or other wx.EvtHandler to be processed
7115 later.
7116 """
7117 return _core_.PostEvent(*args, **kwargs)
7118
7119 def App_CleanUp(*args):
7120 """
7121 App_CleanUp()
7122
7123 For internal use only, it is used to cleanup after wxWidgets when
7124 Python shuts down.
7125 """
7126 return _core_.App_CleanUp(*args)
7127
7128 def GetApp(*args):
7129 """
7130 GetApp() -> PyApp
7131
7132 Return a reference to the current wx.App object.
7133 """
7134 return _core_.GetApp(*args)
7135
7136 def SetDefaultPyEncoding(*args, **kwargs):
7137 """
7138 SetDefaultPyEncoding(string encoding)
7139
7140 Sets the encoding that wxPython will use when it needs to convert a
7141 Python string or unicode object to or from a wxString.
7142
7143 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7144 but please be aware that the default encoding within the same locale
7145 may be slightly different on different platforms. For example, please
7146 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7147 between the common latin/roman encodings.
7148 """
7149 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7150
7151 def GetDefaultPyEncoding(*args):
7152 """
7153 GetDefaultPyEncoding() -> string
7154
7155 Gets the current encoding that wxPython will use when it needs to
7156 convert a Python string or unicode object to or from a wxString.
7157 """
7158 return _core_.GetDefaultPyEncoding(*args)
7159 #----------------------------------------------------------------------
7160
7161 class PyOnDemandOutputWindow:
7162 """
7163 A class that can be used for redirecting Python's stdout and
7164 stderr streams. It will do nothing until something is wrriten to
7165 the stream at which point it will create a Frame with a text area
7166 and write the text there.
7167 """
7168 def __init__(self, title = "wxPython: stdout/stderr"):
7169 self.frame = None
7170 self.title = title
7171 self.pos = wx.DefaultPosition
7172 self.size = (450, 300)
7173 self.parent = None
7174
7175 def SetParent(self, parent):
7176 """Set the window to be used as the popup Frame's parent."""
7177 self.parent = parent
7178
7179
7180 def CreateOutputWindow(self, st):
7181 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7182 style=wx.DEFAULT_FRAME_STYLE)
7183 self.text = wx.TextCtrl(self.frame, -1, "",
7184 style=wx.TE_MULTILINE|wx.TE_READONLY)
7185 self.text.AppendText(st)
7186 self.frame.Show(True)
7187 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7188
7189
7190 def OnCloseWindow(self, event):
7191 if self.frame is not None:
7192 self.frame.Destroy()
7193 self.frame = None
7194 self.text = None
7195
7196
7197 # These methods provide the file-like output behaviour.
7198 def write(self, text):
7199 """
7200 Create the output window if needed and write the string to it.
7201 If not called in the context of the gui thread then uses
7202 CallAfter to do the work there.
7203 """
7204 if self.frame is None:
7205 if not wx.Thread_IsMain():
7206 wx.CallAfter(self.CreateOutputWindow, text)
7207 else:
7208 self.CreateOutputWindow(text)
7209 else:
7210 if not wx.Thread_IsMain():
7211 wx.CallAfter(self.text.AppendText, text)
7212 else:
7213 self.text.AppendText(text)
7214
7215
7216 def close(self):
7217 if self.frame is not None:
7218 wx.CallAfter(self.frame.Close)
7219
7220
7221 def flush(self):
7222 pass
7223
7224
7225
7226 #----------------------------------------------------------------------
7227
7228 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7229
7230 class App(wx.PyApp):
7231 """
7232 The ``wx.App`` class represents the application and is used to:
7233
7234 * bootstrap the wxPython system and initialize the underlying
7235 gui toolkit
7236 * set and get application-wide properties
7237 * implement the windowing system main message or event loop,
7238 and to dispatch events to window instances
7239 * etc.
7240
7241 Every application must have a ``wx.App`` instance, and all
7242 creation of UI objects should be delayed until after the
7243 ``wx.App`` object has been created in order to ensure that the gui
7244 platform and wxWidgets have been fully initialized.
7245
7246 Normally you would derive from this class and implement an
7247 ``OnInit`` method that creates a frame and then calls
7248 ``self.SetTopWindow(frame)``.
7249
7250 :see: `wx.PySimpleApp` for a simpler app class that can be used
7251 directly.
7252 """
7253
7254 outputWindowClass = PyOnDemandOutputWindow
7255
7256 def __init__(self, redirect=_defRedirect, filename=None,
7257 useBestVisual=False, clearSigInt=True):
7258 """
7259 Construct a ``wx.App`` object.
7260
7261 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7262 redirected? Defaults to True on Windows and Mac, False
7263 otherwise. If `filename` is None then output will be
7264 redirected to a window that pops up as needed. (You can
7265 control what kind of window is created for the output by
7266 resetting the class variable ``outputWindowClass`` to a
7267 class of your choosing.)
7268
7269 :param filename: The name of a file to redirect output to, if
7270 redirect is True.
7271
7272 :param useBestVisual: Should the app try to use the best
7273 available visual provided by the system (only relevant on
7274 systems that have more than one visual.) This parameter
7275 must be used instead of calling `SetUseBestVisual` later
7276 on because it must be set before the underlying GUI
7277 toolkit is initialized.
7278
7279 :param clearSigInt: Should SIGINT be cleared? This allows the
7280 app to terminate upon a Ctrl-C in the console like other
7281 GUI apps will.
7282
7283 :note: You should override OnInit to do applicaition
7284 initialization to ensure that the system, toolkit and
7285 wxWidgets are fully initialized.
7286 """
7287
7288 wx.PyApp.__init__(self)
7289
7290 # make sure we can create a GUI
7291 if not self.DisplayAvailable():
7292
7293 if wx.Platform == "__WXMAC__":
7294 msg = """This program needs access to the screen.
7295 Please run with 'pythonw', not 'python', and only when you are logged
7296 in on the main display of your Mac."""
7297
7298 elif wx.Platform == "__WXGTK__":
7299 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7300
7301 else:
7302 msg = "Unable to create GUI"
7303 # TODO: more description is needed for wxMSW...
7304
7305 raise SystemExit(msg)
7306
7307 # This has to be done before OnInit
7308 self.SetUseBestVisual(useBestVisual)
7309
7310 # Set the default handler for SIGINT. This fixes a problem
7311 # where if Ctrl-C is pressed in the console that started this
7312 # app then it will not appear to do anything, (not even send
7313 # KeyboardInterrupt???) but will later segfault on exit. By
7314 # setting the default handler then the app will exit, as
7315 # expected (depending on platform.)
7316 if clearSigInt:
7317 try:
7318 import signal
7319 signal.signal(signal.SIGINT, signal.SIG_DFL)
7320 except:
7321 pass
7322
7323 # Save and redirect the stdio to a window?
7324 self.stdioWin = None
7325 self.saveStdio = (_sys.stdout, _sys.stderr)
7326 if redirect:
7327 self.RedirectStdio(filename)
7328
7329 # Use Python's install prefix as the default
7330 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7331
7332 # This finishes the initialization of wxWindows and then calls
7333 # the OnInit that should be present in the derived class
7334 self._BootstrapApp()
7335
7336
7337 def OnPreInit(self):
7338 """
7339 Things that must be done after _BootstrapApp has done its
7340 thing, but would be nice if they were already done by the time
7341 that OnInit is called.
7342 """
7343 wx.StockGDI._initStockObjects()
7344
7345
7346 def __del__(self, destroy=wx.PyApp.__del__):
7347 self.RestoreStdio() # Just in case the MainLoop was overridden
7348 destroy(self)
7349
7350 def Destroy(self):
7351 wx.PyApp.Destroy(self)
7352 self.thisown = 0
7353
7354 def SetTopWindow(self, frame):
7355 """Set the \"main\" top level window"""
7356 if self.stdioWin:
7357 self.stdioWin.SetParent(frame)
7358 wx.PyApp.SetTopWindow(self, frame)
7359
7360
7361 def MainLoop(self):
7362 """Execute the main GUI event loop"""
7363 wx.PyApp.MainLoop(self)
7364 self.RestoreStdio()
7365
7366
7367 def RedirectStdio(self, filename=None):
7368 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7369 if filename:
7370 _sys.stdout = _sys.stderr = open(filename, 'a')
7371 else:
7372 self.stdioWin = self.outputWindowClass()
7373 _sys.stdout = _sys.stderr = self.stdioWin
7374
7375
7376 def RestoreStdio(self):
7377 try:
7378 _sys.stdout, _sys.stderr = self.saveStdio
7379 except:
7380 pass
7381
7382
7383 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7384 """
7385 Set the title, position and/or size of the output window if
7386 the stdio has been redirected. This should be called before
7387 any output would cause the output window to be created.
7388 """
7389 if self.stdioWin:
7390 if title is not None:
7391 self.stdioWin.title = title
7392 if pos is not None:
7393 self.stdioWin.pos = pos
7394 if size is not None:
7395 self.stdioWin.size = size
7396
7397
7398
7399
7400 # change from wx.PyApp_XX to wx.App_XX
7401 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7402 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7403 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7404 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7405 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7406 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7407 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7408 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7409 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7410 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7411 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7412
7413 #----------------------------------------------------------------------------
7414
7415 class PySimpleApp(wx.App):
7416 """
7417 A simple application class. You can just create one of these and
7418 then then make your top level windows later, and not have to worry
7419 about OnInit. For example::
7420
7421 app = wx.PySimpleApp()
7422 frame = wx.Frame(None, title='Hello World')
7423 frame.Show()
7424 app.MainLoop()
7425
7426 :see: `wx.App`
7427 """
7428
7429 def __init__(self, redirect=False, filename=None,
7430 useBestVisual=False, clearSigInt=True):
7431 """
7432 :see: `wx.App.__init__`
7433 """
7434 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7435
7436 def OnInit(self):
7437 return True
7438
7439
7440
7441 # Is anybody using this one?
7442 class PyWidgetTester(wx.App):
7443 def __init__(self, size = (250, 100)):
7444 self.size = size
7445 wx.App.__init__(self, 0)
7446
7447 def OnInit(self):
7448 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7449 self.SetTopWindow(self.frame)
7450 return True
7451
7452 def SetWidget(self, widgetClass, *args, **kwargs):
7453 w = widgetClass(self.frame, *args, **kwargs)
7454 self.frame.Show(True)
7455
7456 #----------------------------------------------------------------------------
7457 # DO NOT hold any other references to this object. This is how we
7458 # know when to cleanup system resources that wxWidgets is holding. When
7459 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7460 # goes to zero and it calls the wx.App_CleanUp function.
7461
7462 class __wxPyCleanup:
7463 def __init__(self):
7464 self.cleanup = _core_.App_CleanUp
7465 def __del__(self):
7466 self.cleanup()
7467
7468 _sys.__wxPythonCleanup = __wxPyCleanup()
7469
7470 ## # another possible solution, but it gets called too early...
7471 ## import atexit
7472 ## atexit.register(_core_.wxApp_CleanUp)
7473
7474
7475 #----------------------------------------------------------------------------
7476
7477 #---------------------------------------------------------------------------
7478
7479 class EventLoop(object):
7480 """Proxy of C++ EventLoop class"""
7481 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7482 __repr__ = _swig_repr
7483 def __init__(self, *args, **kwargs):
7484 """__init__(self) -> EventLoop"""
7485 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7486 __swig_destroy__ = _core_.delete_EventLoop
7487 __del__ = lambda self : None;
7488 def Run(*args, **kwargs):
7489 """Run(self) -> int"""
7490 return _core_.EventLoop_Run(*args, **kwargs)
7491
7492 def Exit(*args, **kwargs):
7493 """Exit(self, int rc=0)"""
7494 return _core_.EventLoop_Exit(*args, **kwargs)
7495
7496 def Pending(*args, **kwargs):
7497 """Pending(self) -> bool"""
7498 return _core_.EventLoop_Pending(*args, **kwargs)
7499
7500 def Dispatch(*args, **kwargs):
7501 """Dispatch(self) -> bool"""
7502 return _core_.EventLoop_Dispatch(*args, **kwargs)
7503
7504 def IsRunning(*args, **kwargs):
7505 """IsRunning(self) -> bool"""
7506 return _core_.EventLoop_IsRunning(*args, **kwargs)
7507
7508 def GetActive(*args, **kwargs):
7509 """GetActive() -> EventLoop"""
7510 return _core_.EventLoop_GetActive(*args, **kwargs)
7511
7512 GetActive = staticmethod(GetActive)
7513 def SetActive(*args, **kwargs):
7514 """SetActive(EventLoop loop)"""
7515 return _core_.EventLoop_SetActive(*args, **kwargs)
7516
7517 SetActive = staticmethod(SetActive)
7518 _core_.EventLoop_swigregister(EventLoop)
7519
7520 def EventLoop_GetActive(*args):
7521 """EventLoop_GetActive() -> EventLoop"""
7522 return _core_.EventLoop_GetActive(*args)
7523
7524 def EventLoop_SetActive(*args, **kwargs):
7525 """EventLoop_SetActive(EventLoop loop)"""
7526 return _core_.EventLoop_SetActive(*args, **kwargs)
7527
7528 class EventLoopActivator(object):
7529 """Proxy of C++ EventLoopActivator class"""
7530 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7531 __repr__ = _swig_repr
7532 def __init__(self, *args, **kwargs):
7533 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7534 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7535 __swig_destroy__ = _core_.delete_EventLoopActivator
7536 __del__ = lambda self : None;
7537 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7538
7539 #---------------------------------------------------------------------------
7540
7541 ACCEL_ALT = _core_.ACCEL_ALT
7542 ACCEL_CTRL = _core_.ACCEL_CTRL
7543 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7544 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7545 ACCEL_CMD = _core_.ACCEL_CMD
7546 class AcceleratorEntry(object):
7547 """
7548 A class used to define items in an `wx.AcceleratorTable`. wxPython
7549 programs can choose to use wx.AcceleratorEntry objects, but using a
7550 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7551 as well. See `__init__` for of the tuple values.
7552
7553 :see: `wx.AcceleratorTable`
7554 """
7555 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7556 __repr__ = _swig_repr
7557 def __init__(self, *args, **kwargs):
7558 """
7559 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7560
7561 Construct a wx.AcceleratorEntry.
7562 """
7563 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7564 __swig_destroy__ = _core_.delete_AcceleratorEntry
7565 __del__ = lambda self : None;
7566 def Set(*args, **kwargs):
7567 """
7568 Set(self, int flags, int keyCode, int cmd)
7569
7570 (Re)set the attributes of a wx.AcceleratorEntry.
7571 :see `__init__`
7572 """
7573 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7574
7575 def Create(*args, **kwargs):
7576 """
7577 Create(String str) -> AcceleratorEntry
7578
7579 Create accelerator corresponding to the specified string, or None if
7580 it coulnd't be parsed.
7581 """
7582 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7583
7584 Create = staticmethod(Create)
7585 def GetFlags(*args, **kwargs):
7586 """
7587 GetFlags(self) -> int
7588
7589 Get the AcceleratorEntry's flags.
7590 """
7591 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7592
7593 def GetKeyCode(*args, **kwargs):
7594 """
7595 GetKeyCode(self) -> int
7596
7597 Get the AcceleratorEntry's keycode.
7598 """
7599 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7600
7601 def GetCommand(*args, **kwargs):
7602 """
7603 GetCommand(self) -> int
7604
7605 Get the AcceleratorEntry's command ID.
7606 """
7607 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7608
7609 def IsOk(*args, **kwargs):
7610 """IsOk(self) -> bool"""
7611 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7612
7613 def ToString(*args, **kwargs):
7614 """
7615 ToString(self) -> String
7616
7617 Returns a string representation for the this accelerator. The string
7618 is formatted using the <flags>-<keycode> format where <flags> maybe a
7619 hyphen-separed list of "shift|alt|ctrl"
7620
7621 """
7622 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7623
7624 def FromString(*args, **kwargs):
7625 """
7626 FromString(self, String str) -> bool
7627
7628 Returns true if the given string correctly initialized this object.
7629 """
7630 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7631
7632 Command = property(GetCommand,doc="See `GetCommand`")
7633 Flags = property(GetFlags,doc="See `GetFlags`")
7634 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7635 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7636
7637 def AcceleratorEntry_Create(*args, **kwargs):
7638 """
7639 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7640
7641 Create accelerator corresponding to the specified string, or None if
7642 it coulnd't be parsed.
7643 """
7644 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7645
7646 class AcceleratorTable(Object):
7647 """
7648 An accelerator table allows the application to specify a table of
7649 keyboard shortcuts for menus or other commands. On Windows, menu or
7650 button commands are supported; on GTK, only menu commands are
7651 supported.
7652 """
7653 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7654 __repr__ = _swig_repr
7655 def __init__(self, *args, **kwargs):
7656 """
7657 __init__(entries) -> AcceleratorTable
7658
7659 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7660 items or or of 3-tuples (flags, keyCode, cmdID)
7661
7662 :see: `wx.AcceleratorEntry`
7663 """
7664 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7665 __swig_destroy__ = _core_.delete_AcceleratorTable
7666 __del__ = lambda self : None;
7667 def Ok(*args, **kwargs):
7668 """Ok(self) -> bool"""
7669 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7670
7671 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7672
7673
7674 def GetAccelFromString(*args, **kwargs):
7675 """GetAccelFromString(String label) -> AcceleratorEntry"""
7676 return _core_.GetAccelFromString(*args, **kwargs)
7677 #---------------------------------------------------------------------------
7678
7679 class VisualAttributes(object):
7680 """struct containing all the visual attributes of a control"""
7681 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7682 __repr__ = _swig_repr
7683 def __init__(self, *args, **kwargs):
7684 """
7685 __init__(self) -> VisualAttributes
7686
7687 struct containing all the visual attributes of a control
7688 """
7689 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7690 __swig_destroy__ = _core_.delete_VisualAttributes
7691 __del__ = lambda self : None;
7692 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7693 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7694 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7695 _core_.VisualAttributes_swigregister(VisualAttributes)
7696 NullAcceleratorTable = cvar.NullAcceleratorTable
7697 PanelNameStr = cvar.PanelNameStr
7698
7699 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7700 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7701 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7702 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7703 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7704 class Window(EvtHandler):
7705 """
7706 wx.Window is the base class for all windows and represents any visible
7707 object on the screen. All controls, top level windows and so on are
7708 wx.Windows. Sizers and device contexts are not however, as they don't
7709 appear on screen themselves.
7710
7711 """
7712 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7713 __repr__ = _swig_repr
7714 def __init__(self, *args, **kwargs):
7715 """
7716 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7717 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7718
7719 Construct and show a generic Window.
7720 """
7721 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7722 self._setOORInfo(self)
7723
7724 def Create(*args, **kwargs):
7725 """
7726 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7727 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7728
7729 Create the GUI part of the Window for 2-phase creation mode.
7730 """
7731 return _core_.Window_Create(*args, **kwargs)
7732
7733 def Close(*args, **kwargs):
7734 """
7735 Close(self, bool force=False) -> bool
7736
7737 This function simply generates a EVT_CLOSE event whose handler usually
7738 tries to close the window. It doesn't close the window itself,
7739 however. If force is False (the default) then the window's close
7740 handler will be allowed to veto the destruction of the window.
7741 """
7742 return _core_.Window_Close(*args, **kwargs)
7743
7744 def Destroy(*args, **kwargs):
7745 """
7746 Destroy(self) -> bool
7747
7748 Destroys the window safely. Frames and dialogs are not destroyed
7749 immediately when this function is called -- they are added to a list
7750 of windows to be deleted on idle time, when all the window's events
7751 have been processed. This prevents problems with events being sent to
7752 non-existent windows.
7753
7754 Returns True if the window has either been successfully deleted, or it
7755 has been added to the list of windows pending real deletion.
7756 """
7757 val = _core_.Window_Destroy(*args, **kwargs)
7758 args[0].thisown = 0
7759 return val
7760
7761 def DestroyChildren(*args, **kwargs):
7762 """
7763 DestroyChildren(self) -> bool
7764
7765 Destroys all children of a window. Called automatically by the
7766 destructor.
7767 """
7768 return _core_.Window_DestroyChildren(*args, **kwargs)
7769
7770 def IsBeingDeleted(*args, **kwargs):
7771 """
7772 IsBeingDeleted(self) -> bool
7773
7774 Is the window in the process of being deleted?
7775 """
7776 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7777
7778 def SetLabel(*args, **kwargs):
7779 """
7780 SetLabel(self, String label)
7781
7782 Set the text which the window shows in its label if applicable.
7783 """
7784 return _core_.Window_SetLabel(*args, **kwargs)
7785
7786 def GetLabel(*args, **kwargs):
7787 """
7788 GetLabel(self) -> String
7789
7790 Generic way of getting a label from any window, for identification
7791 purposes. The interpretation of this function differs from class to
7792 class. For frames and dialogs, the value returned is the title. For
7793 buttons or static text controls, it is the button text. This function
7794 can be useful for meta-programs such as testing tools or special-needs
7795 access programs)which need to identify windows by name.
7796 """
7797 return _core_.Window_GetLabel(*args, **kwargs)
7798
7799 def SetName(*args, **kwargs):
7800 """
7801 SetName(self, String name)
7802
7803 Sets the window's name. The window name is used for ressource setting
7804 in X, it is not the same as the window title/label
7805 """
7806 return _core_.Window_SetName(*args, **kwargs)
7807
7808 def GetName(*args, **kwargs):
7809 """
7810 GetName(self) -> String
7811
7812 Returns the windows name. This name is not guaranteed to be unique;
7813 it is up to the programmer to supply an appropriate name in the window
7814 constructor or via wx.Window.SetName.
7815 """
7816 return _core_.Window_GetName(*args, **kwargs)
7817
7818 def SetWindowVariant(*args, **kwargs):
7819 """
7820 SetWindowVariant(self, int variant)
7821
7822 Sets the variant of the window/font size to use for this window, if
7823 the platform supports variants, for example, wxMac.
7824 """
7825 return _core_.Window_SetWindowVariant(*args, **kwargs)
7826
7827 def GetWindowVariant(*args, **kwargs):
7828 """GetWindowVariant(self) -> int"""
7829 return _core_.Window_GetWindowVariant(*args, **kwargs)
7830
7831 def SetId(*args, **kwargs):
7832 """
7833 SetId(self, int winid)
7834
7835 Sets the identifier of the window. Each window has an integer
7836 identifier. If the application has not provided one, an identifier
7837 will be generated. Normally, the identifier should be provided on
7838 creation and should not be modified subsequently.
7839 """
7840 return _core_.Window_SetId(*args, **kwargs)
7841
7842 def GetId(*args, **kwargs):
7843 """
7844 GetId(self) -> int
7845
7846 Returns the identifier of the window. Each window has an integer
7847 identifier. If the application has not provided one (or the default Id
7848 -1 is used) then an unique identifier with a negative value will be
7849 generated.
7850 """
7851 return _core_.Window_GetId(*args, **kwargs)
7852
7853 def NewControlId(*args, **kwargs):
7854 """
7855 NewControlId() -> int
7856
7857 Generate a control id for the controls which were not given one.
7858 """
7859 return _core_.Window_NewControlId(*args, **kwargs)
7860
7861 NewControlId = staticmethod(NewControlId)
7862 def NextControlId(*args, **kwargs):
7863 """
7864 NextControlId(int winid) -> int
7865
7866 Get the id of the control following the one with the given
7867 autogenerated) id
7868 """
7869 return _core_.Window_NextControlId(*args, **kwargs)
7870
7871 NextControlId = staticmethod(NextControlId)
7872 def PrevControlId(*args, **kwargs):
7873 """
7874 PrevControlId(int winid) -> int
7875
7876 Get the id of the control preceding the one with the given
7877 autogenerated) id
7878 """
7879 return _core_.Window_PrevControlId(*args, **kwargs)
7880
7881 PrevControlId = staticmethod(PrevControlId)
7882 def GetLayoutDirection(*args, **kwargs):
7883 """
7884 GetLayoutDirection(self) -> wxLayoutDirection
7885
7886 Get the layout direction (LTR or RTL) for this window. Returns
7887 ``wx.Layout_Default`` if layout direction is not supported.
7888 """
7889 return _core_.Window_GetLayoutDirection(*args, **kwargs)
7890
7891 def SetLayoutDirection(*args, **kwargs):
7892 """
7893 SetLayoutDirection(self, wxLayoutDirection dir)
7894
7895 Set the layout direction (LTR or RTL) for this window.
7896 """
7897 return _core_.Window_SetLayoutDirection(*args, **kwargs)
7898
7899 def AdjustForLayoutDirection(*args, **kwargs):
7900 """
7901 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7902
7903 Mirror coordinates for RTL layout if this window uses it and if the
7904 mirroring is not done automatically like Win32.
7905 """
7906 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
7907
7908 def SetSize(*args, **kwargs):
7909 """
7910 SetSize(self, Size size)
7911
7912 Sets the size of the window in pixels.
7913 """
7914 return _core_.Window_SetSize(*args, **kwargs)
7915
7916 def SetDimensions(*args, **kwargs):
7917 """
7918 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7919
7920 Sets the position and size of the window in pixels. The sizeFlags
7921 parameter indicates the interpretation of the other params if they are
7922 equal to -1.
7923
7924 ======================== ======================================
7925 wx.SIZE_AUTO A -1 indicates that a class-specific
7926 default should be used.
7927 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7928 -1 values are supplied.
7929 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7930 interpreted as real dimensions, not
7931 default values.
7932 ======================== ======================================
7933
7934 """
7935 return _core_.Window_SetDimensions(*args, **kwargs)
7936
7937 def SetRect(*args, **kwargs):
7938 """
7939 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7940
7941 Sets the position and size of the window in pixels using a wx.Rect.
7942 """
7943 return _core_.Window_SetRect(*args, **kwargs)
7944
7945 def SetSizeWH(*args, **kwargs):
7946 """
7947 SetSizeWH(self, int width, int height)
7948
7949 Sets the size of the window in pixels.
7950 """
7951 return _core_.Window_SetSizeWH(*args, **kwargs)
7952
7953 def Move(*args, **kwargs):
7954 """
7955 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7956
7957 Moves the window to the given position.
7958 """
7959 return _core_.Window_Move(*args, **kwargs)
7960
7961 SetPosition = Move
7962 def MoveXY(*args, **kwargs):
7963 """
7964 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7965
7966 Moves the window to the given position.
7967 """
7968 return _core_.Window_MoveXY(*args, **kwargs)
7969
7970 def SetBestFittingSize(*args, **kwargs):
7971 """
7972 SetBestFittingSize(self, Size size=DefaultSize)
7973
7974 A 'Smart' SetSize that will fill in default size components with the
7975 window's *best size* values. Also set's the minsize for use with sizers.
7976 """
7977 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7978
7979 def Raise(*args, **kwargs):
7980 """
7981 Raise(self)
7982
7983 Raises the window to the top of the window hierarchy. In current
7984 version of wxWidgets this works both for manage and child windows.
7985 """
7986 return _core_.Window_Raise(*args, **kwargs)
7987
7988 def Lower(*args, **kwargs):
7989 """
7990 Lower(self)
7991
7992 Lowers the window to the bottom of the window hierarchy. In current
7993 version of wxWidgets this works both for manage and child windows.
7994 """
7995 return _core_.Window_Lower(*args, **kwargs)
7996
7997 def SetClientSize(*args, **kwargs):
7998 """
7999 SetClientSize(self, Size size)
8000
8001 This sets the size of the window client area in pixels. Using this
8002 function to size a window tends to be more device-independent than
8003 wx.Window.SetSize, since the application need not worry about what
8004 dimensions the border or title bar have when trying to fit the window
8005 around panel items, for example.
8006 """
8007 return _core_.Window_SetClientSize(*args, **kwargs)
8008
8009 def SetClientSizeWH(*args, **kwargs):
8010 """
8011 SetClientSizeWH(self, int width, int height)
8012
8013 This sets the size of the window client area in pixels. Using this
8014 function to size a window tends to be more device-independent than
8015 wx.Window.SetSize, since the application need not worry about what
8016 dimensions the border or title bar have when trying to fit the window
8017 around panel items, for example.
8018 """
8019 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8020
8021 def SetClientRect(*args, **kwargs):
8022 """
8023 SetClientRect(self, Rect rect)
8024
8025 This sets the size of the window client area in pixels. Using this
8026 function to size a window tends to be more device-independent than
8027 wx.Window.SetSize, since the application need not worry about what
8028 dimensions the border or title bar have when trying to fit the window
8029 around panel items, for example.
8030 """
8031 return _core_.Window_SetClientRect(*args, **kwargs)
8032
8033 def GetPosition(*args, **kwargs):
8034 """
8035 GetPosition(self) -> Point
8036
8037 Get the window's position. Notice that the position is in client
8038 coordinates for child windows and screen coordinates for the top level
8039 ones, use `GetScreenPosition` if you need screen coordinates for all
8040 kinds of windows.
8041 """
8042 return _core_.Window_GetPosition(*args, **kwargs)
8043
8044 def GetPositionTuple(*args, **kwargs):
8045 """
8046 GetPositionTuple() -> (x,y)
8047
8048 Get the window's position. Notice that the position is in client
8049 coordinates for child windows and screen coordinates for the top level
8050 ones, use `GetScreenPosition` if you need screen coordinates for all
8051 kinds of windows.
8052 """
8053 return _core_.Window_GetPositionTuple(*args, **kwargs)
8054
8055 def GetScreenPosition(*args, **kwargs):
8056 """
8057 GetScreenPosition(self) -> Point
8058
8059 Get the position of the window in screen coordinantes.
8060 """
8061 return _core_.Window_GetScreenPosition(*args, **kwargs)
8062
8063 def GetScreenPositionTuple(*args, **kwargs):
8064 """
8065 GetScreenPositionTuple() -> (x,y)
8066
8067 Get the position of the window in screen coordinantes.
8068 """
8069 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8070
8071 def GetScreenRect(*args, **kwargs):
8072 """
8073 GetScreenRect(self) -> Rect
8074
8075 Returns the size and position of the window in screen coordinantes as
8076 a `wx.Rect` object.
8077 """
8078 return _core_.Window_GetScreenRect(*args, **kwargs)
8079
8080 def GetSize(*args, **kwargs):
8081 """
8082 GetSize(self) -> Size
8083
8084 Get the window size.
8085 """
8086 return _core_.Window_GetSize(*args, **kwargs)
8087
8088 def GetSizeTuple(*args, **kwargs):
8089 """
8090 GetSizeTuple() -> (width, height)
8091
8092 Get the window size.
8093 """
8094 return _core_.Window_GetSizeTuple(*args, **kwargs)
8095
8096 def GetRect(*args, **kwargs):
8097 """
8098 GetRect(self) -> Rect
8099
8100 Returns the size and position of the window as a `wx.Rect` object.
8101 """
8102 return _core_.Window_GetRect(*args, **kwargs)
8103
8104 def GetClientSize(*args, **kwargs):
8105 """
8106 GetClientSize(self) -> Size
8107
8108 This gets the size of the window's 'client area' in pixels. The client
8109 area is the area which may be drawn on by the programmer, excluding
8110 title bar, border, scrollbars, etc.
8111 """
8112 return _core_.Window_GetClientSize(*args, **kwargs)
8113
8114 def GetClientSizeTuple(*args, **kwargs):
8115 """
8116 GetClientSizeTuple() -> (width, height)
8117
8118 This gets the size of the window's 'client area' in pixels. The client
8119 area is the area which may be drawn on by the programmer, excluding
8120 title bar, border, scrollbars, etc.
8121 """
8122 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8123
8124 def GetClientAreaOrigin(*args, **kwargs):
8125 """
8126 GetClientAreaOrigin(self) -> Point
8127
8128 Get the origin of the client area of the window relative to the
8129 window's top left corner (the client area may be shifted because of
8130 the borders, scrollbars, other decorations...)
8131 """
8132 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8133
8134 def GetClientRect(*args, **kwargs):
8135 """
8136 GetClientRect(self) -> Rect
8137
8138 Get the client area position and size as a `wx.Rect` object.
8139 """
8140 return _core_.Window_GetClientRect(*args, **kwargs)
8141
8142 def GetBestSize(*args, **kwargs):
8143 """
8144 GetBestSize(self) -> Size
8145
8146 This function returns the best acceptable minimal size for the
8147 window, if applicable. For example, for a static text control, it will
8148 be the minimal size such that the control label is not truncated. For
8149 windows containing subwindows (suzh aswx.Panel), the size returned by
8150 this function will be the same as the size the window would have had
8151 after calling Fit.
8152 """
8153 return _core_.Window_GetBestSize(*args, **kwargs)
8154
8155 def GetBestSizeTuple(*args, **kwargs):
8156 """
8157 GetBestSizeTuple() -> (width, height)
8158
8159 This function returns the best acceptable minimal size for the
8160 window, if applicable. For example, for a static text control, it will
8161 be the minimal size such that the control label is not truncated. For
8162 windows containing subwindows (suzh aswx.Panel), the size returned by
8163 this function will be the same as the size the window would have had
8164 after calling Fit.
8165 """
8166 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8167
8168 def InvalidateBestSize(*args, **kwargs):
8169 """
8170 InvalidateBestSize(self)
8171
8172 Reset the cached best size value so it will be recalculated the next
8173 time it is needed.
8174 """
8175 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8176
8177 def CacheBestSize(*args, **kwargs):
8178 """
8179 CacheBestSize(self, Size size)
8180
8181 Cache the best size so it doesn't need to be calculated again, (at least until
8182 some properties of the window change.)
8183 """
8184 return _core_.Window_CacheBestSize(*args, **kwargs)
8185
8186 def GetBestFittingSize(*args, **kwargs):
8187 """
8188 GetBestFittingSize(self) -> Size
8189
8190 This function will merge the window's best size into the window's
8191 minimum size, giving priority to the min size components, and returns
8192 the results.
8193
8194 """
8195 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8196
8197 def GetAdjustedBestSize(*args, **kwargs):
8198 """
8199 GetAdjustedBestSize(self) -> Size
8200
8201 This method is similar to GetBestSize, except in one
8202 thing. GetBestSize should return the minimum untruncated size of the
8203 window, while this method will return the largest of BestSize and any
8204 user specified minimum size. ie. it is the minimum size the window
8205 should currently be drawn at, not the minimal size it can possibly
8206 tolerate.
8207 """
8208 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8209
8210 def Center(*args, **kwargs):
8211 """
8212 Center(self, int direction=BOTH)
8213
8214 Centers the window. The parameter specifies the direction for
8215 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8216 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8217 on the entire screen and not on its parent window. If it is a
8218 top-level window and has no parent then it will always be centered
8219 relative to the screen.
8220 """
8221 return _core_.Window_Center(*args, **kwargs)
8222
8223 Centre = Center
8224 def CenterOnParent(*args, **kwargs):
8225 """
8226 CenterOnParent(self, int dir=BOTH)
8227
8228 Center with respect to the the parent window
8229 """
8230 return _core_.Window_CenterOnParent(*args, **kwargs)
8231
8232 CentreOnParent = CenterOnParent
8233 def Fit(*args, **kwargs):
8234 """
8235 Fit(self)
8236
8237 Sizes the window so that it fits around its subwindows. This function
8238 won't do anything if there are no subwindows and will only really work
8239 correctly if sizers are used for the subwindows layout. Also, if the
8240 window has exactly one subwindow it is better (faster and the result
8241 is more precise as Fit adds some margin to account for fuzziness of
8242 its calculations) to call window.SetClientSize(child.GetSize())
8243 instead of calling Fit.
8244 """
8245 return _core_.Window_Fit(*args, **kwargs)
8246
8247 def FitInside(*args, **kwargs):
8248 """
8249 FitInside(self)
8250
8251 Similar to Fit, but sizes the interior (virtual) size of a
8252 window. Mainly useful with scrolled windows to reset scrollbars after
8253 sizing changes that do not trigger a size event, and/or scrolled
8254 windows without an interior sizer. This function similarly won't do
8255 anything if there are no subwindows.
8256 """
8257 return _core_.Window_FitInside(*args, **kwargs)
8258
8259 def SetSizeHints(*args, **kwargs):
8260 """
8261 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8262 int incH=-1)
8263
8264 Allows specification of minimum and maximum window sizes, and window
8265 size increments. If a pair of values is not set (or set to -1), the
8266 default values will be used. If this function is called, the user
8267 will not be able to size the window outside the given bounds (if it is
8268 a top-level window.) Sizers will also inspect the minimum window size
8269 and will use that value if set when calculating layout.
8270
8271 The resizing increments are only significant under Motif or Xt.
8272 """
8273 return _core_.Window_SetSizeHints(*args, **kwargs)
8274
8275 def SetSizeHintsSz(*args, **kwargs):
8276 """
8277 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8278
8279 Allows specification of minimum and maximum window sizes, and window
8280 size increments. If a pair of values is not set (or set to -1), the
8281 default values will be used. If this function is called, the user
8282 will not be able to size the window outside the given bounds (if it is
8283 a top-level window.) Sizers will also inspect the minimum window size
8284 and will use that value if set when calculating layout.
8285
8286 The resizing increments are only significant under Motif or Xt.
8287 """
8288 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8289
8290 def SetVirtualSizeHints(*args, **kwargs):
8291 """
8292 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8293
8294 Allows specification of minimum and maximum virtual window sizes. If a
8295 pair of values is not set (or set to -1), the default values will be
8296 used. If this function is called, the user will not be able to size
8297 the virtual area of the window outside the given bounds.
8298 """
8299 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8300
8301 def SetVirtualSizeHintsSz(*args, **kwargs):
8302 """
8303 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8304
8305 Allows specification of minimum and maximum virtual window sizes. If a
8306 pair of values is not set (or set to -1), the default values will be
8307 used. If this function is called, the user will not be able to size
8308 the virtual area of the window outside the given bounds.
8309 """
8310 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8311
8312 def GetMaxSize(*args, **kwargs):
8313 """GetMaxSize(self) -> Size"""
8314 return _core_.Window_GetMaxSize(*args, **kwargs)
8315
8316 def GetMinSize(*args, **kwargs):
8317 """GetMinSize(self) -> Size"""
8318 return _core_.Window_GetMinSize(*args, **kwargs)
8319
8320 def SetMinSize(*args, **kwargs):
8321 """
8322 SetMinSize(self, Size minSize)
8323
8324 A more convenient method than `SetSizeHints` for setting just the
8325 min size.
8326 """
8327 return _core_.Window_SetMinSize(*args, **kwargs)
8328
8329 def SetMaxSize(*args, **kwargs):
8330 """
8331 SetMaxSize(self, Size maxSize)
8332
8333 A more convenient method than `SetSizeHints` for setting just the
8334 max size.
8335 """
8336 return _core_.Window_SetMaxSize(*args, **kwargs)
8337
8338 def GetMinWidth(*args, **kwargs):
8339 """GetMinWidth(self) -> int"""
8340 return _core_.Window_GetMinWidth(*args, **kwargs)
8341
8342 def GetMinHeight(*args, **kwargs):
8343 """GetMinHeight(self) -> int"""
8344 return _core_.Window_GetMinHeight(*args, **kwargs)
8345
8346 def GetMaxWidth(*args, **kwargs):
8347 """GetMaxWidth(self) -> int"""
8348 return _core_.Window_GetMaxWidth(*args, **kwargs)
8349
8350 def GetMaxHeight(*args, **kwargs):
8351 """GetMaxHeight(self) -> int"""
8352 return _core_.Window_GetMaxHeight(*args, **kwargs)
8353
8354 def SetVirtualSize(*args, **kwargs):
8355 """
8356 SetVirtualSize(self, Size size)
8357
8358 Set the the virtual size of a window in pixels. For most windows this
8359 is just the client area of the window, but for some like scrolled
8360 windows it is more or less independent of the screen window size.
8361 """
8362 return _core_.Window_SetVirtualSize(*args, **kwargs)
8363
8364 def SetVirtualSizeWH(*args, **kwargs):
8365 """
8366 SetVirtualSizeWH(self, int w, int h)
8367
8368 Set the the virtual size of a window in pixels. For most windows this
8369 is just the client area of the window, but for some like scrolled
8370 windows it is more or less independent of the screen window size.
8371 """
8372 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8373
8374 def GetVirtualSize(*args, **kwargs):
8375 """
8376 GetVirtualSize(self) -> Size
8377
8378 Get the the virtual size of the window in pixels. For most windows
8379 this is just the client area of the window, but for some like scrolled
8380 windows it is more or less independent of the screen window size.
8381 """
8382 return _core_.Window_GetVirtualSize(*args, **kwargs)
8383
8384 def GetVirtualSizeTuple(*args, **kwargs):
8385 """
8386 GetVirtualSizeTuple() -> (width, height)
8387
8388 Get the the virtual size of the window in pixels. For most windows
8389 this is just the client area of the window, but for some like scrolled
8390 windows it is more or less independent of the screen window size.
8391 """
8392 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8393
8394 def GetBestVirtualSize(*args, **kwargs):
8395 """
8396 GetBestVirtualSize(self) -> Size
8397
8398 Return the largest of ClientSize and BestSize (as determined by a
8399 sizer, interior children, or other means)
8400 """
8401 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8402
8403 def Show(*args, **kwargs):
8404 """
8405 Show(self, bool show=True) -> bool
8406
8407 Shows or hides the window. You may need to call Raise for a top level
8408 window if you want to bring it to top, although this is not needed if
8409 Show is called immediately after the frame creation. Returns True if
8410 the window has been shown or hidden or False if nothing was done
8411 because it already was in the requested state.
8412 """
8413 return _core_.Window_Show(*args, **kwargs)
8414
8415 def Hide(*args, **kwargs):
8416 """
8417 Hide(self) -> bool
8418
8419 Equivalent to calling Show(False).
8420 """
8421 return _core_.Window_Hide(*args, **kwargs)
8422
8423 def Enable(*args, **kwargs):
8424 """
8425 Enable(self, bool enable=True) -> bool
8426
8427 Enable or disable the window for user input. Note that when a parent
8428 window is disabled, all of its children are disabled as well and they
8429 are reenabled again when the parent is. Returns true if the window
8430 has been enabled or disabled, false if nothing was done, i.e. if the
8431 window had already been in the specified state.
8432 """
8433 return _core_.Window_Enable(*args, **kwargs)
8434
8435 def Disable(*args, **kwargs):
8436 """
8437 Disable(self) -> bool
8438
8439 Disables the window, same as Enable(false).
8440 """
8441 return _core_.Window_Disable(*args, **kwargs)
8442
8443 def IsShown(*args, **kwargs):
8444 """
8445 IsShown(self) -> bool
8446
8447 Returns true if the window is shown, false if it has been hidden.
8448 """
8449 return _core_.Window_IsShown(*args, **kwargs)
8450
8451 def IsEnabled(*args, **kwargs):
8452 """
8453 IsEnabled(self) -> bool
8454
8455 Returns true if the window is enabled for input, false otherwise.
8456 """
8457 return _core_.Window_IsEnabled(*args, **kwargs)
8458
8459 def SetWindowStyleFlag(*args, **kwargs):
8460 """
8461 SetWindowStyleFlag(self, long style)
8462
8463 Sets the style of the window. Please note that some styles cannot be
8464 changed after the window creation and that Refresh() might need to be
8465 called after changing the others for the change to take place
8466 immediately.
8467 """
8468 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8469
8470 def GetWindowStyleFlag(*args, **kwargs):
8471 """
8472 GetWindowStyleFlag(self) -> long
8473
8474 Gets the window style that was passed to the constructor or Create
8475 method.
8476 """
8477 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8478
8479 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8480 def HasFlag(*args, **kwargs):
8481 """
8482 HasFlag(self, int flag) -> bool
8483
8484 Test if the given style is set for this window.
8485 """
8486 return _core_.Window_HasFlag(*args, **kwargs)
8487
8488 def IsRetained(*args, **kwargs):
8489 """
8490 IsRetained(self) -> bool
8491
8492 Returns true if the window is retained, false otherwise. Retained
8493 windows are only available on X platforms.
8494 """
8495 return _core_.Window_IsRetained(*args, **kwargs)
8496
8497 def SetExtraStyle(*args, **kwargs):
8498 """
8499 SetExtraStyle(self, long exStyle)
8500
8501 Sets the extra style bits for the window. Extra styles are the less
8502 often used style bits which can't be set with the constructor or with
8503 SetWindowStyleFlag()
8504 """
8505 return _core_.Window_SetExtraStyle(*args, **kwargs)
8506
8507 def GetExtraStyle(*args, **kwargs):
8508 """
8509 GetExtraStyle(self) -> long
8510
8511 Returns the extra style bits for the window.
8512 """
8513 return _core_.Window_GetExtraStyle(*args, **kwargs)
8514
8515 def MakeModal(*args, **kwargs):
8516 """
8517 MakeModal(self, bool modal=True)
8518
8519 Disables all other windows in the application so that the user can
8520 only interact with this window. Passing False will reverse this
8521 effect.
8522 """
8523 return _core_.Window_MakeModal(*args, **kwargs)
8524
8525 def SetThemeEnabled(*args, **kwargs):
8526 """
8527 SetThemeEnabled(self, bool enableTheme)
8528
8529 This function tells a window if it should use the system's "theme"
8530 code to draw the windows' background instead if its own background
8531 drawing code. This will only have an effect on platforms that support
8532 the notion of themes in user defined windows. One such platform is
8533 GTK+ where windows can have (very colourful) backgrounds defined by a
8534 user's selected theme.
8535
8536 Dialogs, notebook pages and the status bar have this flag set to true
8537 by default so that the default look and feel is simulated best.
8538 """
8539 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8540
8541 def GetThemeEnabled(*args, **kwargs):
8542 """
8543 GetThemeEnabled(self) -> bool
8544
8545 Return the themeEnabled flag.
8546 """
8547 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8548
8549 def SetFocus(*args, **kwargs):
8550 """
8551 SetFocus(self)
8552
8553 Set's the focus to this window, allowing it to receive keyboard input.
8554 """
8555 return _core_.Window_SetFocus(*args, **kwargs)
8556
8557 def SetFocusFromKbd(*args, **kwargs):
8558 """
8559 SetFocusFromKbd(self)
8560
8561 Set focus to this window as the result of a keyboard action. Normally
8562 only called internally.
8563 """
8564 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8565
8566 def FindFocus(*args, **kwargs):
8567 """
8568 FindFocus() -> Window
8569
8570 Returns the window or control that currently has the keyboard focus,
8571 or None.
8572 """
8573 return _core_.Window_FindFocus(*args, **kwargs)
8574
8575 FindFocus = staticmethod(FindFocus)
8576 def AcceptsFocus(*args, **kwargs):
8577 """
8578 AcceptsFocus(self) -> bool
8579
8580 Can this window have focus?
8581 """
8582 return _core_.Window_AcceptsFocus(*args, **kwargs)
8583
8584 def AcceptsFocusFromKeyboard(*args, **kwargs):
8585 """
8586 AcceptsFocusFromKeyboard(self) -> bool
8587
8588 Can this window be given focus by keyboard navigation? if not, the
8589 only way to give it focus (provided it accepts it at all) is to click
8590 it.
8591 """
8592 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8593
8594 def Navigate(*args, **kwargs):
8595 """
8596 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8597
8598 Does keyboard navigation from this window to another, by sending a
8599 `wx.NavigationKeyEvent`.
8600 """
8601 return _core_.Window_Navigate(*args, **kwargs)
8602
8603 def MoveAfterInTabOrder(*args, **kwargs):
8604 """
8605 MoveAfterInTabOrder(self, Window win)
8606
8607 Moves this window in the tab navigation order after the specified
8608 sibling window. This means that when the user presses the TAB key on
8609 that other window, the focus switches to this window.
8610
8611 The default tab order is the same as creation order. This function
8612 and `MoveBeforeInTabOrder` allow to change it after creating all the
8613 windows.
8614
8615 """
8616 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8617
8618 def MoveBeforeInTabOrder(*args, **kwargs):
8619 """
8620 MoveBeforeInTabOrder(self, Window win)
8621
8622 Same as `MoveAfterInTabOrder` except that it inserts this window just
8623 before win instead of putting it right after it.
8624 """
8625 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8626
8627 def GetChildren(*args, **kwargs):
8628 """
8629 GetChildren(self) -> PyObject
8630
8631 Returns a list of the window's children. NOTE: Currently this is a
8632 copy of the child window list maintained by the window, so the return
8633 value of this function is only valid as long as the window's children
8634 do not change.
8635 """
8636 return _core_.Window_GetChildren(*args, **kwargs)
8637
8638 def GetParent(*args, **kwargs):
8639 """
8640 GetParent(self) -> Window
8641
8642 Returns the parent window of this window, or None if there isn't one.
8643 """
8644 return _core_.Window_GetParent(*args, **kwargs)
8645
8646 def GetGrandParent(*args, **kwargs):
8647 """
8648 GetGrandParent(self) -> Window
8649
8650 Returns the parent of the parent of this window, or None if there
8651 isn't one.
8652 """
8653 return _core_.Window_GetGrandParent(*args, **kwargs)
8654
8655 def IsTopLevel(*args, **kwargs):
8656 """
8657 IsTopLevel(self) -> bool
8658
8659 Returns true if the given window is a top-level one. Currently all
8660 frames and dialogs are always considered to be top-level windows (even
8661 if they have a parent window).
8662 """
8663 return _core_.Window_IsTopLevel(*args, **kwargs)
8664
8665 def Reparent(*args, **kwargs):
8666 """
8667 Reparent(self, Window newParent) -> bool
8668
8669 Reparents the window, i.e the window will be removed from its current
8670 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8671 re-inserted into another. Available on Windows and GTK. Returns True
8672 if the parent was changed, False otherwise (error or newParent ==
8673 oldParent)
8674 """
8675 return _core_.Window_Reparent(*args, **kwargs)
8676
8677 def AddChild(*args, **kwargs):
8678 """
8679 AddChild(self, Window child)
8680
8681 Adds a child window. This is called automatically by window creation
8682 functions so should not be required by the application programmer.
8683 """
8684 return _core_.Window_AddChild(*args, **kwargs)
8685
8686 def RemoveChild(*args, **kwargs):
8687 """
8688 RemoveChild(self, Window child)
8689
8690 Removes a child window. This is called automatically by window
8691 deletion functions so should not be required by the application
8692 programmer.
8693 """
8694 return _core_.Window_RemoveChild(*args, **kwargs)
8695
8696 def SetDoubleBuffered(*args, **kwargs):
8697 """
8698 SetDoubleBuffered(self, bool on)
8699
8700 Currently wxGTK2 only.
8701 """
8702 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8703
8704 def FindWindowById(*args, **kwargs):
8705 """
8706 FindWindowById(self, long winid) -> Window
8707
8708 Find a chld of this window by window ID
8709 """
8710 return _core_.Window_FindWindowById(*args, **kwargs)
8711
8712 def FindWindowByName(*args, **kwargs):
8713 """
8714 FindWindowByName(self, String name) -> Window
8715
8716 Find a child of this window by name
8717 """
8718 return _core_.Window_FindWindowByName(*args, **kwargs)
8719
8720 def GetEventHandler(*args, **kwargs):
8721 """
8722 GetEventHandler(self) -> EvtHandler
8723
8724 Returns the event handler for this window. By default, the window is
8725 its own event handler.
8726 """
8727 return _core_.Window_GetEventHandler(*args, **kwargs)
8728
8729 def SetEventHandler(*args, **kwargs):
8730 """
8731 SetEventHandler(self, EvtHandler handler)
8732
8733 Sets the event handler for this window. An event handler is an object
8734 that is capable of processing the events sent to a window. By default,
8735 the window is its own event handler, but an application may wish to
8736 substitute another, for example to allow central implementation of
8737 event-handling for a variety of different window classes.
8738
8739 It is usually better to use `wx.Window.PushEventHandler` since this sets
8740 up a chain of event handlers, where an event not handled by one event
8741 handler is handed to the next one in the chain.
8742 """
8743 return _core_.Window_SetEventHandler(*args, **kwargs)
8744
8745 def PushEventHandler(*args, **kwargs):
8746 """
8747 PushEventHandler(self, EvtHandler handler)
8748
8749 Pushes this event handler onto the event handler stack for the window.
8750 An event handler is an object that is capable of processing the events
8751 sent to a window. By default, the window is its own event handler, but
8752 an application may wish to substitute another, for example to allow
8753 central implementation of event-handling for a variety of different
8754 window classes.
8755
8756 wx.Window.PushEventHandler allows an application to set up a chain of
8757 event handlers, where an event not handled by one event handler is
8758 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8759 remove the event handler.
8760 """
8761 return _core_.Window_PushEventHandler(*args, **kwargs)
8762
8763 def PopEventHandler(*args, **kwargs):
8764 """
8765 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8766
8767 Removes and returns the top-most event handler on the event handler
8768 stack. If deleteHandler is True then the wx.EvtHandler object will be
8769 destroyed after it is popped.
8770 """
8771 return _core_.Window_PopEventHandler(*args, **kwargs)
8772
8773 def RemoveEventHandler(*args, **kwargs):
8774 """
8775 RemoveEventHandler(self, EvtHandler handler) -> bool
8776
8777 Find the given handler in the event handler chain and remove (but not
8778 delete) it from the event handler chain, return True if it was found
8779 and False otherwise (this also results in an assert failure so this
8780 function should only be called when the handler is supposed to be
8781 there.)
8782 """
8783 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8784
8785 def SetValidator(*args, **kwargs):
8786 """
8787 SetValidator(self, Validator validator)
8788
8789 Deletes the current validator (if any) and sets the window validator,
8790 having called wx.Validator.Clone to create a new validator of this
8791 type.
8792 """
8793 return _core_.Window_SetValidator(*args, **kwargs)
8794
8795 def GetValidator(*args, **kwargs):
8796 """
8797 GetValidator(self) -> Validator
8798
8799 Returns a pointer to the current validator for the window, or None if
8800 there is none.
8801 """
8802 return _core_.Window_GetValidator(*args, **kwargs)
8803
8804 def Validate(*args, **kwargs):
8805 """
8806 Validate(self) -> bool
8807
8808 Validates the current values of the child controls using their
8809 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8810 style flag set, the method will also call Validate() of all child
8811 windows. Returns false if any of the validations failed.
8812 """
8813 return _core_.Window_Validate(*args, **kwargs)
8814
8815 def TransferDataToWindow(*args, **kwargs):
8816 """
8817 TransferDataToWindow(self) -> bool
8818
8819 Transfers values to child controls from data areas specified by their
8820 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8821 style flag set, the method will also call TransferDataToWindow() of
8822 all child windows.
8823 """
8824 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8825
8826 def TransferDataFromWindow(*args, **kwargs):
8827 """
8828 TransferDataFromWindow(self) -> bool
8829
8830 Transfers values from child controls to data areas specified by their
8831 validators. Returns false if a transfer failed. If the window has
8832 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8833 also call TransferDataFromWindow() of all child windows.
8834 """
8835 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8836
8837 def InitDialog(*args, **kwargs):
8838 """
8839 InitDialog(self)
8840
8841 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8842 to the dialog via validators.
8843 """
8844 return _core_.Window_InitDialog(*args, **kwargs)
8845
8846 def SetAcceleratorTable(*args, **kwargs):
8847 """
8848 SetAcceleratorTable(self, AcceleratorTable accel)
8849
8850 Sets the accelerator table for this window.
8851 """
8852 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8853
8854 def GetAcceleratorTable(*args, **kwargs):
8855 """
8856 GetAcceleratorTable(self) -> AcceleratorTable
8857
8858 Gets the accelerator table for this window.
8859 """
8860 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8861
8862 def RegisterHotKey(*args, **kwargs):
8863 """
8864 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8865
8866 Registers a system wide hotkey. Every time the user presses the hotkey
8867 registered here, this window will receive a hotkey event. It will
8868 receive the event even if the application is in the background and
8869 does not have the input focus because the user is working with some
8870 other application. To bind an event handler function to this hotkey
8871 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8872 hotkey was registered successfully.
8873 """
8874 return _core_.Window_RegisterHotKey(*args, **kwargs)
8875
8876 def UnregisterHotKey(*args, **kwargs):
8877 """
8878 UnregisterHotKey(self, int hotkeyId) -> bool
8879
8880 Unregisters a system wide hotkey.
8881 """
8882 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8883
8884 def ConvertDialogPointToPixels(*args, **kwargs):
8885 """
8886 ConvertDialogPointToPixels(self, Point pt) -> Point
8887
8888 Converts a point or size from dialog units to pixels. Dialog units
8889 are used for maintaining a dialog's proportions even if the font
8890 changes. For the x dimension, the dialog units are multiplied by the
8891 average character width and then divided by 4. For the y dimension,
8892 the dialog units are multiplied by the average character height and
8893 then divided by 8.
8894 """
8895 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8896
8897 def ConvertDialogSizeToPixels(*args, **kwargs):
8898 """
8899 ConvertDialogSizeToPixels(self, Size sz) -> Size
8900
8901 Converts a point or size from dialog units to pixels. Dialog units
8902 are used for maintaining a dialog's proportions even if the font
8903 changes. For the x dimension, the dialog units are multiplied by the
8904 average character width and then divided by 4. For the y dimension,
8905 the dialog units are multiplied by the average character height and
8906 then divided by 8.
8907 """
8908 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8909
8910 def DLG_PNT(*args, **kwargs):
8911 """
8912 DLG_PNT(self, Point pt) -> Point
8913
8914 Converts a point or size from dialog units to pixels. Dialog units
8915 are used for maintaining a dialog's proportions even if the font
8916 changes. For the x dimension, the dialog units are multiplied by the
8917 average character width and then divided by 4. For the y dimension,
8918 the dialog units are multiplied by the average character height and
8919 then divided by 8.
8920 """
8921 return _core_.Window_DLG_PNT(*args, **kwargs)
8922
8923 def DLG_SZE(*args, **kwargs):
8924 """
8925 DLG_SZE(self, Size sz) -> Size
8926
8927 Converts a point or size from dialog units to pixels. Dialog units
8928 are used for maintaining a dialog's proportions even if the font
8929 changes. For the x dimension, the dialog units are multiplied by the
8930 average character width and then divided by 4. For the y dimension,
8931 the dialog units are multiplied by the average character height and
8932 then divided by 8.
8933 """
8934 return _core_.Window_DLG_SZE(*args, **kwargs)
8935
8936 def ConvertPixelPointToDialog(*args, **kwargs):
8937 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8938 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8939
8940 def ConvertPixelSizeToDialog(*args, **kwargs):
8941 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8942 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8943
8944 def WarpPointer(*args, **kwargs):
8945 """
8946 WarpPointer(self, int x, int y)
8947
8948 Moves the pointer to the given position on the window.
8949
8950 NOTE: This function is not supported under Mac because Apple Human
8951 Interface Guidelines forbid moving the mouse cursor programmatically.
8952 """
8953 return _core_.Window_WarpPointer(*args, **kwargs)
8954
8955 def CaptureMouse(*args, **kwargs):
8956 """
8957 CaptureMouse(self)
8958
8959 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8960 release the capture.
8961
8962 Note that wxWindows maintains the stack of windows having captured the
8963 mouse and when the mouse is released the capture returns to the window
8964 which had had captured it previously and it is only really released if
8965 there were no previous window. In particular, this means that you must
8966 release the mouse as many times as you capture it, unless the window
8967 receives the `wx.MouseCaptureLostEvent` event.
8968
8969 Any application which captures the mouse in the beginning of some
8970 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8971 operation when it receives the event. The event handler must not
8972 recapture mouse.
8973 """
8974 return _core_.Window_CaptureMouse(*args, **kwargs)
8975
8976 def ReleaseMouse(*args, **kwargs):
8977 """
8978 ReleaseMouse(self)
8979
8980 Releases mouse input captured with wx.Window.CaptureMouse.
8981 """
8982 return _core_.Window_ReleaseMouse(*args, **kwargs)
8983
8984 def GetCapture(*args, **kwargs):
8985 """
8986 GetCapture() -> Window
8987
8988 Returns the window which currently captures the mouse or None
8989 """
8990 return _core_.Window_GetCapture(*args, **kwargs)
8991
8992 GetCapture = staticmethod(GetCapture)
8993 def HasCapture(*args, **kwargs):
8994 """
8995 HasCapture(self) -> bool
8996
8997 Returns true if this window has the current mouse capture.
8998 """
8999 return _core_.Window_HasCapture(*args, **kwargs)
9000
9001 def Refresh(*args, **kwargs):
9002 """
9003 Refresh(self, bool eraseBackground=True, Rect rect=None)
9004
9005 Mark the specified rectangle (or the whole window) as "dirty" so it
9006 will be repainted. Causes an EVT_PAINT event to be generated and sent
9007 to the window.
9008 """
9009 return _core_.Window_Refresh(*args, **kwargs)
9010
9011 def RefreshRect(*args, **kwargs):
9012 """
9013 RefreshRect(self, Rect rect, bool eraseBackground=True)
9014
9015 Redraws the contents of the given rectangle: the area inside it will
9016 be repainted. This is the same as Refresh but has a nicer syntax.
9017 """
9018 return _core_.Window_RefreshRect(*args, **kwargs)
9019
9020 def Update(*args, **kwargs):
9021 """
9022 Update(self)
9023
9024 Calling this method immediately repaints the invalidated area of the
9025 window instead of waiting for the EVT_PAINT event to happen, (normally
9026 this would usually only happen when the flow of control returns to the
9027 event loop.) Notice that this function doesn't refresh the window and
9028 does nothing if the window has been already repainted. Use Refresh
9029 first if you want to immediately redraw the window (or some portion of
9030 it) unconditionally.
9031 """
9032 return _core_.Window_Update(*args, **kwargs)
9033
9034 def ClearBackground(*args, **kwargs):
9035 """
9036 ClearBackground(self)
9037
9038 Clears the window by filling it with the current background
9039 colour. Does not cause an erase background event to be generated.
9040 """
9041 return _core_.Window_ClearBackground(*args, **kwargs)
9042
9043 def Freeze(*args, **kwargs):
9044 """
9045 Freeze(self)
9046
9047 Freezes the window or, in other words, prevents any updates from
9048 taking place on screen, the window is not redrawn at all. Thaw must be
9049 called to reenable window redrawing. Calls to Freeze/Thaw may be
9050 nested, with the actual Thaw being delayed until all the nesting has
9051 been undone.
9052
9053 This method is useful for visual appearance optimization (for example,
9054 it is a good idea to use it before inserting large amount of text into
9055 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9056 for all controls so it is mostly just a hint to wxWindows and not a
9057 mandatory directive.
9058 """
9059 return _core_.Window_Freeze(*args, **kwargs)
9060
9061 def Thaw(*args, **kwargs):
9062 """
9063 Thaw(self)
9064
9065 Reenables window updating after a previous call to Freeze. Calls to
9066 Freeze/Thaw may be nested, so Thaw must be called the same number of
9067 times that Freeze was before the window will be updated.
9068 """
9069 return _core_.Window_Thaw(*args, **kwargs)
9070
9071 def PrepareDC(*args, **kwargs):
9072 """
9073 PrepareDC(self, DC dc)
9074
9075 Call this function to prepare the device context for drawing a
9076 scrolled image. It sets the device origin according to the current
9077 scroll position.
9078 """
9079 return _core_.Window_PrepareDC(*args, **kwargs)
9080
9081 def GetUpdateRegion(*args, **kwargs):
9082 """
9083 GetUpdateRegion(self) -> Region
9084
9085 Returns the region specifying which parts of the window have been
9086 damaged. Should only be called within an EVT_PAINT handler.
9087 """
9088 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9089
9090 def GetUpdateClientRect(*args, **kwargs):
9091 """
9092 GetUpdateClientRect(self) -> Rect
9093
9094 Get the update rectangle region bounding box in client coords.
9095 """
9096 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9097
9098 def IsExposed(*args, **kwargs):
9099 """
9100 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9101
9102 Returns true if the given point or rectangle area has been exposed
9103 since the last repaint. Call this in an paint event handler to
9104 optimize redrawing by only redrawing those areas, which have been
9105 exposed.
9106 """
9107 return _core_.Window_IsExposed(*args, **kwargs)
9108
9109 def IsExposedPoint(*args, **kwargs):
9110 """
9111 IsExposedPoint(self, Point pt) -> bool
9112
9113 Returns true if the given point or rectangle area has been exposed
9114 since the last repaint. Call this in an paint event handler to
9115 optimize redrawing by only redrawing those areas, which have been
9116 exposed.
9117 """
9118 return _core_.Window_IsExposedPoint(*args, **kwargs)
9119
9120 def IsExposedRect(*args, **kwargs):
9121 """
9122 IsExposedRect(self, Rect rect) -> bool
9123
9124 Returns true if the given point or rectangle area has been exposed
9125 since the last repaint. Call this in an paint event handler to
9126 optimize redrawing by only redrawing those areas, which have been
9127 exposed.
9128 """
9129 return _core_.Window_IsExposedRect(*args, **kwargs)
9130
9131 def GetDefaultAttributes(*args, **kwargs):
9132 """
9133 GetDefaultAttributes(self) -> VisualAttributes
9134
9135 Get the default attributes for an instance of this class. This is
9136 useful if you want to use the same font or colour in your own control
9137 as in a standard control -- which is a much better idea than hard
9138 coding specific colours or fonts which might look completely out of
9139 place on the user's system, especially if it uses themes.
9140 """
9141 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9142
9143 def GetClassDefaultAttributes(*args, **kwargs):
9144 """
9145 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9146
9147 Get the default attributes for this class. This is useful if you want
9148 to use the same font or colour in your own control as in a standard
9149 control -- which is a much better idea than hard coding specific
9150 colours or fonts which might look completely out of place on the
9151 user's system, especially if it uses themes.
9152
9153 The variant parameter is only relevant under Mac currently and is
9154 ignore under other platforms. Under Mac, it will change the size of
9155 the returned font. See `wx.Window.SetWindowVariant` for more about
9156 this.
9157 """
9158 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9159
9160 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9161 def SetBackgroundColour(*args, **kwargs):
9162 """
9163 SetBackgroundColour(self, Colour colour) -> bool
9164
9165 Sets the background colour of the window. Returns True if the colour
9166 was changed. The background colour is usually painted by the default
9167 EVT_ERASE_BACKGROUND event handler function under Windows and
9168 automatically under GTK. Using `wx.NullColour` will reset the window
9169 to the default background colour.
9170
9171 Note that setting the background colour may not cause an immediate
9172 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9173 calling this function.
9174
9175 Using this function will disable attempts to use themes for this
9176 window, if the system supports them. Use with care since usually the
9177 themes represent the appearance chosen by the user to be used for all
9178 applications on the system.
9179 """
9180 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9181
9182 def SetOwnBackgroundColour(*args, **kwargs):
9183 """SetOwnBackgroundColour(self, Colour colour)"""
9184 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9185
9186 def SetForegroundColour(*args, **kwargs):
9187 """
9188 SetForegroundColour(self, Colour colour) -> bool
9189
9190 Sets the foreground colour of the window. Returns True is the colour
9191 was changed. The interpretation of foreground colour is dependent on
9192 the window class; it may be the text colour or other colour, or it may
9193 not be used at all.
9194 """
9195 return _core_.Window_SetForegroundColour(*args, **kwargs)
9196
9197 def SetOwnForegroundColour(*args, **kwargs):
9198 """SetOwnForegroundColour(self, Colour colour)"""
9199 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9200
9201 def GetBackgroundColour(*args, **kwargs):
9202 """
9203 GetBackgroundColour(self) -> Colour
9204
9205 Returns the background colour of the window.
9206 """
9207 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9208
9209 def GetForegroundColour(*args, **kwargs):
9210 """
9211 GetForegroundColour(self) -> Colour
9212
9213 Returns the foreground colour of the window. The interpretation of
9214 foreground colour is dependent on the window class; it may be the text
9215 colour or other colour, or it may not be used at all.
9216 """
9217 return _core_.Window_GetForegroundColour(*args, **kwargs)
9218
9219 def InheritsBackgroundColour(*args, **kwargs):
9220 """InheritsBackgroundColour(self) -> bool"""
9221 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9222
9223 def UseBgCol(*args, **kwargs):
9224 """UseBgCol(self) -> bool"""
9225 return _core_.Window_UseBgCol(*args, **kwargs)
9226
9227 def SetBackgroundStyle(*args, **kwargs):
9228 """
9229 SetBackgroundStyle(self, int style) -> bool
9230
9231 Returns the background style of the window. The background style
9232 indicates how the background of the window is drawn.
9233
9234 ====================== ========================================
9235 wx.BG_STYLE_SYSTEM The background colour or pattern should
9236 be determined by the system
9237 wx.BG_STYLE_COLOUR The background should be a solid colour
9238 wx.BG_STYLE_CUSTOM The background will be implemented by the
9239 application.
9240 ====================== ========================================
9241
9242 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9243 a custom background, such as a tiled bitmap. Currently the style has
9244 no effect on other platforms.
9245
9246 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9247 """
9248 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9249
9250 def GetBackgroundStyle(*args, **kwargs):
9251 """
9252 GetBackgroundStyle(self) -> int
9253
9254 Returns the background style of the window.
9255
9256 :see: `SetBackgroundStyle`
9257 """
9258 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9259
9260 def HasTransparentBackground(*args, **kwargs):
9261 """
9262 HasTransparentBackground(self) -> bool
9263
9264 Returns True if this window's background is transparent (as, for
9265 example, for `wx.StaticText`) and should show the parent window's
9266 background.
9267
9268 This method is mostly used internally by the library itself and you
9269 normally shouldn't have to call it. You may, however, have to override
9270 it in your custom control classes to ensure that background is painted
9271 correctly.
9272 """
9273 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9274
9275 def SetCursor(*args, **kwargs):
9276 """
9277 SetCursor(self, Cursor cursor) -> bool
9278
9279 Sets the window's cursor. Notice that the window cursor also sets it
9280 for the children of the window implicitly.
9281
9282 The cursor may be wx.NullCursor in which case the window cursor will
9283 be reset back to default.
9284 """
9285 return _core_.Window_SetCursor(*args, **kwargs)
9286
9287 def GetCursor(*args, **kwargs):
9288 """
9289 GetCursor(self) -> Cursor
9290
9291 Return the cursor associated with this window.
9292 """
9293 return _core_.Window_GetCursor(*args, **kwargs)
9294
9295 def SetFont(*args, **kwargs):
9296 """
9297 SetFont(self, Font font) -> bool
9298
9299 Sets the font for this window.
9300 """
9301 return _core_.Window_SetFont(*args, **kwargs)
9302
9303 def SetOwnFont(*args, **kwargs):
9304 """SetOwnFont(self, Font font)"""
9305 return _core_.Window_SetOwnFont(*args, **kwargs)
9306
9307 def GetFont(*args, **kwargs):
9308 """
9309 GetFont(self) -> Font
9310
9311 Returns the default font used for this window.
9312 """
9313 return _core_.Window_GetFont(*args, **kwargs)
9314
9315 def SetCaret(*args, **kwargs):
9316 """
9317 SetCaret(self, Caret caret)
9318
9319 Sets the caret associated with the window.
9320 """
9321 return _core_.Window_SetCaret(*args, **kwargs)
9322
9323 def GetCaret(*args, **kwargs):
9324 """
9325 GetCaret(self) -> Caret
9326
9327 Returns the caret associated with the window.
9328 """
9329 return _core_.Window_GetCaret(*args, **kwargs)
9330
9331 def GetCharHeight(*args, **kwargs):
9332 """
9333 GetCharHeight(self) -> int
9334
9335 Get the (average) character size for the current font.
9336 """
9337 return _core_.Window_GetCharHeight(*args, **kwargs)
9338
9339 def GetCharWidth(*args, **kwargs):
9340 """
9341 GetCharWidth(self) -> int
9342
9343 Get the (average) character size for the current font.
9344 """
9345 return _core_.Window_GetCharWidth(*args, **kwargs)
9346
9347 def GetTextExtent(*args, **kwargs):
9348 """
9349 GetTextExtent(String string) -> (width, height)
9350
9351 Get the width and height of the text using the current font.
9352 """
9353 return _core_.Window_GetTextExtent(*args, **kwargs)
9354
9355 def GetFullTextExtent(*args, **kwargs):
9356 """
9357 GetFullTextExtent(String string, Font font=None) ->
9358 (width, height, descent, externalLeading)
9359
9360 Get the width, height, decent and leading of the text using the
9361 current or specified font.
9362 """
9363 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9364
9365 def ClientToScreenXY(*args, **kwargs):
9366 """
9367 ClientToScreenXY(int x, int y) -> (x,y)
9368
9369 Converts to screen coordinates from coordinates relative to this window.
9370 """
9371 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9372
9373 def ScreenToClientXY(*args, **kwargs):
9374 """
9375 ScreenToClientXY(int x, int y) -> (x,y)
9376
9377 Converts from screen to client window coordinates.
9378 """
9379 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9380
9381 def ClientToScreen(*args, **kwargs):
9382 """
9383 ClientToScreen(self, Point pt) -> Point
9384
9385 Converts to screen coordinates from coordinates relative to this window.
9386 """
9387 return _core_.Window_ClientToScreen(*args, **kwargs)
9388
9389 def ScreenToClient(*args, **kwargs):
9390 """
9391 ScreenToClient(self, Point pt) -> Point
9392
9393 Converts from screen to client window coordinates.
9394 """
9395 return _core_.Window_ScreenToClient(*args, **kwargs)
9396
9397 def HitTestXY(*args, **kwargs):
9398 """
9399 HitTestXY(self, int x, int y) -> int
9400
9401 Test where the given (in client coords) point lies
9402 """
9403 return _core_.Window_HitTestXY(*args, **kwargs)
9404
9405 def HitTest(*args, **kwargs):
9406 """
9407 HitTest(self, Point pt) -> int
9408
9409 Test where the given (in client coords) point lies
9410 """
9411 return _core_.Window_HitTest(*args, **kwargs)
9412
9413 def GetBorder(*args):
9414 """
9415 GetBorder(self, long flags) -> int
9416 GetBorder(self) -> int
9417
9418 Get border for the flags of this window
9419 """
9420 return _core_.Window_GetBorder(*args)
9421
9422 def UpdateWindowUI(*args, **kwargs):
9423 """
9424 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9425
9426 This function sends EVT_UPDATE_UI events to the window. The particular
9427 implementation depends on the window; for example a wx.ToolBar will
9428 send an update UI event for each toolbar button, and a wx.Frame will
9429 send an update UI event for each menubar menu item. You can call this
9430 function from your application to ensure that your UI is up-to-date at
9431 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9432 concerned). This may be necessary if you have called
9433 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9434 limit the overhead that wxWindows incurs by sending update UI events
9435 in idle time.
9436 """
9437 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9438
9439 def PopupMenuXY(*args, **kwargs):
9440 """
9441 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9442
9443 Pops up the given menu at the specified coordinates, relative to this window,
9444 and returns control when the user has dismissed the menu. If a menu item is
9445 selected, the corresponding menu event is generated and will be processed as
9446 usual. If the default position is given then the current position of the
9447 mouse cursor will be used.
9448 """
9449 return _core_.Window_PopupMenuXY(*args, **kwargs)
9450
9451 def PopupMenu(*args, **kwargs):
9452 """
9453 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9454
9455 Pops up the given menu at the specified coordinates, relative to this window,
9456 and returns control when the user has dismissed the menu. If a menu item is
9457 selected, the corresponding menu event is generated and will be processed as
9458 usual. If the default position is given then the current position of the
9459 mouse cursor will be used.
9460 """
9461 return _core_.Window_PopupMenu(*args, **kwargs)
9462
9463 def HasMultiplePages(*args, **kwargs):
9464 """HasMultiplePages(self) -> bool"""
9465 return _core_.Window_HasMultiplePages(*args, **kwargs)
9466
9467 def GetHandle(*args, **kwargs):
9468 """
9469 GetHandle(self) -> long
9470
9471 Returns the platform-specific handle (as a long integer) of the
9472 physical window. Currently on wxMac it returns the handle of the
9473 toplevel parent of the window.
9474 """
9475 return _core_.Window_GetHandle(*args, **kwargs)
9476
9477 def AssociateHandle(*args, **kwargs):
9478 """
9479 AssociateHandle(self, long handle)
9480
9481 Associate the window with a new native handle
9482 """
9483 return _core_.Window_AssociateHandle(*args, **kwargs)
9484
9485 def DissociateHandle(*args, **kwargs):
9486 """
9487 DissociateHandle(self)
9488
9489 Dissociate the current native handle from the window
9490 """
9491 return _core_.Window_DissociateHandle(*args, **kwargs)
9492
9493 def HasScrollbar(*args, **kwargs):
9494 """
9495 HasScrollbar(self, int orient) -> bool
9496
9497 Does the window have the scrollbar for this orientation?
9498 """
9499 return _core_.Window_HasScrollbar(*args, **kwargs)
9500
9501 def SetScrollbar(*args, **kwargs):
9502 """
9503 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9504 bool refresh=True)
9505
9506 Sets the scrollbar properties of a built-in scrollbar.
9507 """
9508 return _core_.Window_SetScrollbar(*args, **kwargs)
9509
9510 def SetScrollPos(*args, **kwargs):
9511 """
9512 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9513
9514 Sets the position of one of the built-in scrollbars.
9515 """
9516 return _core_.Window_SetScrollPos(*args, **kwargs)
9517
9518 def GetScrollPos(*args, **kwargs):
9519 """
9520 GetScrollPos(self, int orientation) -> int
9521
9522 Returns the built-in scrollbar position.
9523 """
9524 return _core_.Window_GetScrollPos(*args, **kwargs)
9525
9526 def GetScrollThumb(*args, **kwargs):
9527 """
9528 GetScrollThumb(self, int orientation) -> int
9529
9530 Returns the built-in scrollbar thumb size.
9531 """
9532 return _core_.Window_GetScrollThumb(*args, **kwargs)
9533
9534 def GetScrollRange(*args, **kwargs):
9535 """
9536 GetScrollRange(self, int orientation) -> int
9537
9538 Returns the built-in scrollbar range.
9539 """
9540 return _core_.Window_GetScrollRange(*args, **kwargs)
9541
9542 def ScrollWindow(*args, **kwargs):
9543 """
9544 ScrollWindow(self, int dx, int dy, Rect rect=None)
9545
9546 Physically scrolls the pixels in the window and move child windows
9547 accordingly. Use this function to optimise your scrolling
9548 implementations, to minimise the area that must be redrawn. Note that
9549 it is rarely required to call this function from a user program.
9550 """
9551 return _core_.Window_ScrollWindow(*args, **kwargs)
9552
9553 def ScrollLines(*args, **kwargs):
9554 """
9555 ScrollLines(self, int lines) -> bool
9556
9557 If the platform and window class supports it, scrolls the window by
9558 the given number of lines down, if lines is positive, or up if lines
9559 is negative. Returns True if the window was scrolled, False if it was
9560 already on top/bottom and nothing was done.
9561 """
9562 return _core_.Window_ScrollLines(*args, **kwargs)
9563
9564 def ScrollPages(*args, **kwargs):
9565 """
9566 ScrollPages(self, int pages) -> bool
9567
9568 If the platform and window class supports it, scrolls the window by
9569 the given number of pages down, if pages is positive, or up if pages
9570 is negative. Returns True if the window was scrolled, False if it was
9571 already on top/bottom and nothing was done.
9572 """
9573 return _core_.Window_ScrollPages(*args, **kwargs)
9574
9575 def LineUp(*args, **kwargs):
9576 """
9577 LineUp(self) -> bool
9578
9579 This is just a wrapper for ScrollLines(-1).
9580 """
9581 return _core_.Window_LineUp(*args, **kwargs)
9582
9583 def LineDown(*args, **kwargs):
9584 """
9585 LineDown(self) -> bool
9586
9587 This is just a wrapper for ScrollLines(1).
9588 """
9589 return _core_.Window_LineDown(*args, **kwargs)
9590
9591 def PageUp(*args, **kwargs):
9592 """
9593 PageUp(self) -> bool
9594
9595 This is just a wrapper for ScrollPages(-1).
9596 """
9597 return _core_.Window_PageUp(*args, **kwargs)
9598
9599 def PageDown(*args, **kwargs):
9600 """
9601 PageDown(self) -> bool
9602
9603 This is just a wrapper for ScrollPages(1).
9604 """
9605 return _core_.Window_PageDown(*args, **kwargs)
9606
9607 def SetHelpText(*args, **kwargs):
9608 """
9609 SetHelpText(self, String text)
9610
9611 Sets the help text to be used as context-sensitive help for this
9612 window. Note that the text is actually stored by the current
9613 `wx.HelpProvider` implementation, and not in the window object itself.
9614 """
9615 return _core_.Window_SetHelpText(*args, **kwargs)
9616
9617 def SetHelpTextForId(*args, **kwargs):
9618 """
9619 SetHelpTextForId(self, String text)
9620
9621 Associate this help text with all windows with the same id as this
9622 one.
9623 """
9624 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9625
9626 def GetHelpTextAtPoint(*args, **kwargs):
9627 """
9628 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9629
9630 Get the help string associated with the given position in this window.
9631
9632 Notice that pt may be invalid if event origin is keyboard or unknown
9633 and this method should return the global window help text then
9634
9635 """
9636 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9637
9638 def GetHelpText(*args, **kwargs):
9639 """
9640 GetHelpText(self) -> String
9641
9642 Gets the help text to be used as context-sensitive help for this
9643 window. Note that the text is actually stored by the current
9644 `wx.HelpProvider` implementation, and not in the window object itself.
9645 """
9646 return _core_.Window_GetHelpText(*args, **kwargs)
9647
9648 def SetToolTipString(*args, **kwargs):
9649 """
9650 SetToolTipString(self, String tip)
9651
9652 Attach a tooltip to the window.
9653 """
9654 return _core_.Window_SetToolTipString(*args, **kwargs)
9655
9656 def SetToolTip(*args, **kwargs):
9657 """
9658 SetToolTip(self, ToolTip tip)
9659
9660 Attach a tooltip to the window.
9661 """
9662 return _core_.Window_SetToolTip(*args, **kwargs)
9663
9664 def GetToolTip(*args, **kwargs):
9665 """
9666 GetToolTip(self) -> ToolTip
9667
9668 get the associated tooltip or None if none
9669 """
9670 return _core_.Window_GetToolTip(*args, **kwargs)
9671
9672 def SetDropTarget(*args, **kwargs):
9673 """
9674 SetDropTarget(self, DropTarget dropTarget)
9675
9676 Associates a drop target with this window. If the window already has
9677 a drop target, it is deleted.
9678 """
9679 return _core_.Window_SetDropTarget(*args, **kwargs)
9680
9681 def GetDropTarget(*args, **kwargs):
9682 """
9683 GetDropTarget(self) -> DropTarget
9684
9685 Returns the associated drop target, which may be None.
9686 """
9687 return _core_.Window_GetDropTarget(*args, **kwargs)
9688
9689 def DragAcceptFiles(*args, **kwargs):
9690 """
9691 DragAcceptFiles(self, bool accept)
9692
9693 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9694 Only functional on Windows.
9695 """
9696 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9697
9698 def SetConstraints(*args, **kwargs):
9699 """
9700 SetConstraints(self, LayoutConstraints constraints)
9701
9702 Sets the window to have the given layout constraints. If an existing
9703 layout constraints object is already owned by the window, it will be
9704 deleted. Pass None to disassociate and delete the window's current
9705 constraints.
9706
9707 You must call SetAutoLayout to tell a window to use the constraints
9708 automatically in its default EVT_SIZE handler; otherwise, you must
9709 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9710 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9711 effect.
9712 """
9713 return _core_.Window_SetConstraints(*args, **kwargs)
9714
9715 def GetConstraints(*args, **kwargs):
9716 """
9717 GetConstraints(self) -> LayoutConstraints
9718
9719 Returns a pointer to the window's layout constraints, or None if there
9720 are none.
9721 """
9722 return _core_.Window_GetConstraints(*args, **kwargs)
9723
9724 def SetAutoLayout(*args, **kwargs):
9725 """
9726 SetAutoLayout(self, bool autoLayout)
9727
9728 Determines whether the Layout function will be called automatically
9729 when the window is resized. lease note that this only happens for the
9730 windows usually used to contain children, namely `wx.Panel` and
9731 `wx.TopLevelWindow` (and the classes deriving from them).
9732
9733 This method is called implicitly by `SetSizer` but if you use
9734 `SetConstraints` you should call it manually or otherwise the window
9735 layout won't be correctly updated when its size changes.
9736 """
9737 return _core_.Window_SetAutoLayout(*args, **kwargs)
9738
9739 def GetAutoLayout(*args, **kwargs):
9740 """
9741 GetAutoLayout(self) -> bool
9742
9743 Returns the current autoLayout setting
9744 """
9745 return _core_.Window_GetAutoLayout(*args, **kwargs)
9746
9747 def Layout(*args, **kwargs):
9748 """
9749 Layout(self) -> bool
9750
9751 Invokes the constraint-based layout algorithm or the sizer-based
9752 algorithm for this window. See SetAutoLayout: when auto layout is on,
9753 this function gets called automatically by the default EVT_SIZE
9754 handler when the window is resized.
9755 """
9756 return _core_.Window_Layout(*args, **kwargs)
9757
9758 def SetSizer(*args, **kwargs):
9759 """
9760 SetSizer(self, Sizer sizer, bool deleteOld=True)
9761
9762 Sets the window to have the given layout sizer. The window will then
9763 own the object, and will take care of its deletion. If an existing
9764 layout sizer object is already owned by the window, it will be deleted
9765 if the deleteOld parameter is true. Note that this function will also
9766 call SetAutoLayout implicitly with a True parameter if the sizer is
9767 non-None, and False otherwise.
9768 """
9769 return _core_.Window_SetSizer(*args, **kwargs)
9770
9771 def SetSizerAndFit(*args, **kwargs):
9772 """
9773 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9774
9775 The same as SetSizer, except it also sets the size hints for the
9776 window based on the sizer's minimum size.
9777 """
9778 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9779
9780 def GetSizer(*args, **kwargs):
9781 """
9782 GetSizer(self) -> Sizer
9783
9784 Return the sizer associated with the window by a previous call to
9785 SetSizer or None if there isn't one.
9786 """
9787 return _core_.Window_GetSizer(*args, **kwargs)
9788
9789 def SetContainingSizer(*args, **kwargs):
9790 """
9791 SetContainingSizer(self, Sizer sizer)
9792
9793 This normally does not need to be called by application code. It is
9794 called internally when a window is added to a sizer, and is used so
9795 the window can remove itself from the sizer when it is destroyed.
9796 """
9797 return _core_.Window_SetContainingSizer(*args, **kwargs)
9798
9799 def GetContainingSizer(*args, **kwargs):
9800 """
9801 GetContainingSizer(self) -> Sizer
9802
9803 Return the sizer that this window is a member of, if any, otherwise None.
9804 """
9805 return _core_.Window_GetContainingSizer(*args, **kwargs)
9806
9807 def InheritAttributes(*args, **kwargs):
9808 """
9809 InheritAttributes(self)
9810
9811 This function is (or should be, in case of custom controls) called
9812 during window creation to intelligently set up the window visual
9813 attributes, that is the font and the foreground and background
9814 colours.
9815
9816 By 'intelligently' the following is meant: by default, all windows use
9817 their own default attributes. However if some of the parent's
9818 attributes are explicitly changed (that is, using SetFont and not
9819 SetOwnFont) and if the corresponding attribute hadn't been
9820 explicitly set for this window itself, then this window takes the same
9821 value as used by the parent. In addition, if the window overrides
9822 ShouldInheritColours to return false, the colours will not be changed
9823 no matter what and only the font might.
9824
9825 This rather complicated logic is necessary in order to accommodate the
9826 different usage scenarios. The most common one is when all default
9827 attributes are used and in this case, nothing should be inherited as
9828 in modern GUIs different controls use different fonts (and colours)
9829 than their siblings so they can't inherit the same value from the
9830 parent. However it was also deemed desirable to allow to simply change
9831 the attributes of all children at once by just changing the font or
9832 colour of their common parent, hence in this case we do inherit the
9833 parents attributes.
9834
9835 """
9836 return _core_.Window_InheritAttributes(*args, **kwargs)
9837
9838 def ShouldInheritColours(*args, **kwargs):
9839 """
9840 ShouldInheritColours(self) -> bool
9841
9842 Return true from here to allow the colours of this window to be
9843 changed by InheritAttributes, returning false forbids inheriting them
9844 from the parent window.
9845
9846 The base class version returns false, but this method is overridden in
9847 wxControl where it returns true.
9848 """
9849 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9850
9851 def CanSetTransparent(*args, **kwargs):
9852 """
9853 CanSetTransparent(self) -> bool
9854
9855 Returns ``True`` if the platform supports setting the transparency for
9856 this window. Note that this method will err on the side of caution,
9857 so it is possible that this will return ``False`` when it is in fact
9858 possible to set the transparency.
9859
9860 NOTE: On X-windows systems the X server must have the composite
9861 extension loaded, and there must be a composite manager program (such
9862 as xcompmgr) running.
9863 """
9864 return _core_.Window_CanSetTransparent(*args, **kwargs)
9865
9866 def SetTransparent(*args, **kwargs):
9867 """
9868 SetTransparent(self, byte alpha) -> bool
9869
9870 Attempt to set the transparency of this window to the ``alpha`` value,
9871 returns True on success. The ``alpha`` value is an integer in the
9872 range of 0 to 255, where 0 is fully transparent and 255 is fully
9873 opaque.
9874 """
9875 return _core_.Window_SetTransparent(*args, **kwargs)
9876
9877 def PostCreate(self, pre):
9878 """
9879 Phase 3 of the 2-phase create <wink!>
9880 Call this method after precreating the window with the 2-phase create method.
9881 """
9882 self.this = pre.this
9883 self.thisown = pre.thisown
9884 pre.thisown = 0
9885 if hasattr(self, '_setOORInfo'):
9886 self._setOORInfo(self)
9887 if hasattr(self, '_setCallbackInfo'):
9888 self._setCallbackInfo(self, self.__class__)
9889
9890 def SendSizeEvent(self):
9891 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9892
9893 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9894 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
9895 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
9896 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
9897 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9898 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
9899 BestSize = property(GetBestSize,doc="See `GetBestSize`")
9900 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
9901 Border = property(GetBorder,doc="See `GetBorder`")
9902 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
9903 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
9904 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
9905 Children = property(GetChildren,doc="See `GetChildren`")
9906 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
9907 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
9908 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
9909 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
9910 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
9911 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
9912 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
9913 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
9914 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
9915 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
9916 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
9917 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
9918 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
9919 Handle = property(GetHandle,doc="See `GetHandle`")
9920 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
9921 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
9922 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
9923 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
9924 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
9925 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
9926 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
9927 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
9928 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
9929 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
9930 Parent = property(GetParent,doc="See `GetParent`")
9931 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
9932 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
9933 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
9934 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
9935 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
9936 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
9937 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
9938 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
9939 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
9940 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
9941 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
9942 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
9943 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
9944 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9945 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
9946 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
9947 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
9948 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
9949 _core_.Window_swigregister(Window)
9950
9951 def PreWindow(*args, **kwargs):
9952 """
9953 PreWindow() -> Window
9954
9955 Precreate a Window for 2-phase creation.
9956 """
9957 val = _core_.new_PreWindow(*args, **kwargs)
9958 return val
9959
9960 def Window_NewControlId(*args):
9961 """
9962 Window_NewControlId() -> int
9963
9964 Generate a control id for the controls which were not given one.
9965 """
9966 return _core_.Window_NewControlId(*args)
9967
9968 def Window_NextControlId(*args, **kwargs):
9969 """
9970 Window_NextControlId(int winid) -> int
9971
9972 Get the id of the control following the one with the given
9973 autogenerated) id
9974 """
9975 return _core_.Window_NextControlId(*args, **kwargs)
9976
9977 def Window_PrevControlId(*args, **kwargs):
9978 """
9979 Window_PrevControlId(int winid) -> int
9980
9981 Get the id of the control preceding the one with the given
9982 autogenerated) id
9983 """
9984 return _core_.Window_PrevControlId(*args, **kwargs)
9985
9986 def Window_FindFocus(*args):
9987 """
9988 Window_FindFocus() -> Window
9989
9990 Returns the window or control that currently has the keyboard focus,
9991 or None.
9992 """
9993 return _core_.Window_FindFocus(*args)
9994
9995 def Window_GetCapture(*args):
9996 """
9997 Window_GetCapture() -> Window
9998
9999 Returns the window which currently captures the mouse or None
10000 """
10001 return _core_.Window_GetCapture(*args)
10002
10003 def Window_GetClassDefaultAttributes(*args, **kwargs):
10004 """
10005 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10006
10007 Get the default attributes for this class. This is useful if you want
10008 to use the same font or colour in your own control as in a standard
10009 control -- which is a much better idea than hard coding specific
10010 colours or fonts which might look completely out of place on the
10011 user's system, especially if it uses themes.
10012
10013 The variant parameter is only relevant under Mac currently and is
10014 ignore under other platforms. Under Mac, it will change the size of
10015 the returned font. See `wx.Window.SetWindowVariant` for more about
10016 this.
10017 """
10018 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10019
10020 def DLG_PNT(win, point_or_x, y=None):
10021 """
10022 Convenience function for converting a Point or (x,y) in
10023 dialog units to pixel units.
10024 """
10025 if y is None:
10026 return win.ConvertDialogPointToPixels(point_or_x)
10027 else:
10028 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10029
10030 def DLG_SZE(win, size_width, height=None):
10031 """
10032 Convenience function for converting a Size or (w,h) in
10033 dialog units to pixel units.
10034 """
10035 if height is None:
10036 return win.ConvertDialogSizeToPixels(size_width)
10037 else:
10038 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10039
10040
10041 def FindWindowById(*args, **kwargs):
10042 """
10043 FindWindowById(long id, Window parent=None) -> Window
10044
10045 Find the first window in the application with the given id. If parent
10046 is None, the search will start from all top-level frames and dialog
10047 boxes; if non-None, the search will be limited to the given window
10048 hierarchy. The search is recursive in both cases.
10049 """
10050 return _core_.FindWindowById(*args, **kwargs)
10051
10052 def FindWindowByName(*args, **kwargs):
10053 """
10054 FindWindowByName(String name, Window parent=None) -> Window
10055
10056 Find a window by its name (as given in a window constructor or Create
10057 function call). If parent is None, the search will start from all
10058 top-level frames and dialog boxes; if non-None, the search will be
10059 limited to the given window hierarchy. The search is recursive in both
10060 cases.
10061
10062 If no window with such name is found, wx.FindWindowByLabel is called.
10063 """
10064 return _core_.FindWindowByName(*args, **kwargs)
10065
10066 def FindWindowByLabel(*args, **kwargs):
10067 """
10068 FindWindowByLabel(String label, Window parent=None) -> Window
10069
10070 Find a window by its label. Depending on the type of window, the label
10071 may be a window title or panel item label. If parent is None, the
10072 search will start from all top-level frames and dialog boxes; if
10073 non-None, the search will be limited to the given window
10074 hierarchy. The search is recursive in both cases.
10075 """
10076 return _core_.FindWindowByLabel(*args, **kwargs)
10077
10078 def Window_FromHWND(*args, **kwargs):
10079 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10080 return _core_.Window_FromHWND(*args, **kwargs)
10081
10082 def GetTopLevelWindows(*args):
10083 """
10084 GetTopLevelWindows() -> PyObject
10085
10086 Returns a list of the the application's top-level windows, (frames,
10087 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10088 by wxWidgets, and so it is only valid as long as no top-level windows
10089 are closed or new top-level windows are created.
10090
10091 """
10092 return _core_.GetTopLevelWindows(*args)
10093 #---------------------------------------------------------------------------
10094
10095 class Validator(EvtHandler):
10096 """Proxy of C++ Validator class"""
10097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10098 __repr__ = _swig_repr
10099 def __init__(self, *args, **kwargs):
10100 """__init__(self) -> Validator"""
10101 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10102 self._setOORInfo(self)
10103
10104 def Clone(*args, **kwargs):
10105 """Clone(self) -> Validator"""
10106 return _core_.Validator_Clone(*args, **kwargs)
10107
10108 def Validate(*args, **kwargs):
10109 """Validate(self, Window parent) -> bool"""
10110 return _core_.Validator_Validate(*args, **kwargs)
10111
10112 def TransferToWindow(*args, **kwargs):
10113 """TransferToWindow(self) -> bool"""
10114 return _core_.Validator_TransferToWindow(*args, **kwargs)
10115
10116 def TransferFromWindow(*args, **kwargs):
10117 """TransferFromWindow(self) -> bool"""
10118 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10119
10120 def GetWindow(*args, **kwargs):
10121 """GetWindow(self) -> Window"""
10122 return _core_.Validator_GetWindow(*args, **kwargs)
10123
10124 def SetWindow(*args, **kwargs):
10125 """SetWindow(self, Window window)"""
10126 return _core_.Validator_SetWindow(*args, **kwargs)
10127
10128 def IsSilent(*args, **kwargs):
10129 """IsSilent() -> bool"""
10130 return _core_.Validator_IsSilent(*args, **kwargs)
10131
10132 IsSilent = staticmethod(IsSilent)
10133 def SetBellOnError(*args, **kwargs):
10134 """SetBellOnError(int doIt=True)"""
10135 return _core_.Validator_SetBellOnError(*args, **kwargs)
10136
10137 SetBellOnError = staticmethod(SetBellOnError)
10138 _core_.Validator_swigregister(Validator)
10139
10140 def Validator_IsSilent(*args):
10141 """Validator_IsSilent() -> bool"""
10142 return _core_.Validator_IsSilent(*args)
10143
10144 def Validator_SetBellOnError(*args, **kwargs):
10145 """Validator_SetBellOnError(int doIt=True)"""
10146 return _core_.Validator_SetBellOnError(*args, **kwargs)
10147
10148 class PyValidator(Validator):
10149 """Proxy of C++ PyValidator class"""
10150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10151 __repr__ = _swig_repr
10152 def __init__(self, *args, **kwargs):
10153 """__init__(self) -> PyValidator"""
10154 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10155
10156 self._setCallbackInfo(self, PyValidator, 1)
10157 self._setOORInfo(self)
10158
10159 def _setCallbackInfo(*args, **kwargs):
10160 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10161 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10162
10163 _core_.PyValidator_swigregister(PyValidator)
10164
10165 #---------------------------------------------------------------------------
10166
10167 class Menu(EvtHandler):
10168 """Proxy of C++ Menu class"""
10169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10170 __repr__ = _swig_repr
10171 def __init__(self, *args, **kwargs):
10172 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10173 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10174 self._setOORInfo(self)
10175
10176 def Append(*args, **kwargs):
10177 """
10178 Append(self, int id, String text=EmptyString, String help=EmptyString,
10179 int kind=ITEM_NORMAL) -> MenuItem
10180 """
10181 return _core_.Menu_Append(*args, **kwargs)
10182
10183 def AppendSeparator(*args, **kwargs):
10184 """AppendSeparator(self) -> MenuItem"""
10185 return _core_.Menu_AppendSeparator(*args, **kwargs)
10186
10187 def AppendCheckItem(*args, **kwargs):
10188 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10189 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10190
10191 def AppendRadioItem(*args, **kwargs):
10192 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10193 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10194
10195 def AppendMenu(*args, **kwargs):
10196 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10197 return _core_.Menu_AppendMenu(*args, **kwargs)
10198
10199 def AppendSubMenu(*args, **kwargs):
10200 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10201 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10202
10203 def AppendItem(*args, **kwargs):
10204 """AppendItem(self, MenuItem item) -> MenuItem"""
10205 return _core_.Menu_AppendItem(*args, **kwargs)
10206
10207 def InsertItem(*args, **kwargs):
10208 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10209 return _core_.Menu_InsertItem(*args, **kwargs)
10210
10211 def PrependItem(*args, **kwargs):
10212 """PrependItem(self, MenuItem item) -> MenuItem"""
10213 return _core_.Menu_PrependItem(*args, **kwargs)
10214
10215 def Break(*args, **kwargs):
10216 """Break(self)"""
10217 return _core_.Menu_Break(*args, **kwargs)
10218
10219 def Insert(*args, **kwargs):
10220 """
10221 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10222 int kind=ITEM_NORMAL) -> MenuItem
10223 """
10224 return _core_.Menu_Insert(*args, **kwargs)
10225
10226 def InsertSeparator(*args, **kwargs):
10227 """InsertSeparator(self, size_t pos) -> MenuItem"""
10228 return _core_.Menu_InsertSeparator(*args, **kwargs)
10229
10230 def InsertCheckItem(*args, **kwargs):
10231 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10232 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10233
10234 def InsertRadioItem(*args, **kwargs):
10235 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10236 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10237
10238 def InsertMenu(*args, **kwargs):
10239 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10240 return _core_.Menu_InsertMenu(*args, **kwargs)
10241
10242 def Prepend(*args, **kwargs):
10243 """
10244 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10245 int kind=ITEM_NORMAL) -> MenuItem
10246 """
10247 return _core_.Menu_Prepend(*args, **kwargs)
10248
10249 def PrependSeparator(*args, **kwargs):
10250 """PrependSeparator(self) -> MenuItem"""
10251 return _core_.Menu_PrependSeparator(*args, **kwargs)
10252
10253 def PrependCheckItem(*args, **kwargs):
10254 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10255 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10256
10257 def PrependRadioItem(*args, **kwargs):
10258 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10259 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10260
10261 def PrependMenu(*args, **kwargs):
10262 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10263 return _core_.Menu_PrependMenu(*args, **kwargs)
10264
10265 def Remove(*args, **kwargs):
10266 """Remove(self, int id) -> MenuItem"""
10267 return _core_.Menu_Remove(*args, **kwargs)
10268
10269 def RemoveItem(*args, **kwargs):
10270 """RemoveItem(self, MenuItem item) -> MenuItem"""
10271 return _core_.Menu_RemoveItem(*args, **kwargs)
10272
10273 def Delete(*args, **kwargs):
10274 """Delete(self, int id) -> bool"""
10275 return _core_.Menu_Delete(*args, **kwargs)
10276
10277 def DeleteItem(*args, **kwargs):
10278 """DeleteItem(self, MenuItem item) -> bool"""
10279 return _core_.Menu_DeleteItem(*args, **kwargs)
10280
10281 def Destroy(*args, **kwargs):
10282 """
10283 Destroy(self)
10284
10285 Deletes the C++ object this Python object is a proxy for.
10286 """
10287 val = _core_.Menu_Destroy(*args, **kwargs)
10288 args[0].thisown = 0
10289 return val
10290
10291 def DestroyId(*args, **kwargs):
10292 """
10293 DestroyId(self, int id) -> bool
10294
10295 Deletes the C++ object this Python object is a proxy for.
10296 """
10297 val = _core_.Menu_DestroyId(*args, **kwargs)
10298 args[0].thisown = 0
10299 return val
10300
10301 def DestroyItem(*args, **kwargs):
10302 """
10303 DestroyItem(self, MenuItem item) -> bool
10304
10305 Deletes the C++ object this Python object is a proxy for.
10306 """
10307 val = _core_.Menu_DestroyItem(*args, **kwargs)
10308 args[0].thisown = 0
10309 return val
10310
10311 def GetMenuItemCount(*args, **kwargs):
10312 """GetMenuItemCount(self) -> size_t"""
10313 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10314
10315 def GetMenuItems(*args, **kwargs):
10316 """GetMenuItems(self) -> PyObject"""
10317 return _core_.Menu_GetMenuItems(*args, **kwargs)
10318
10319 def FindItem(*args, **kwargs):
10320 """FindItem(self, String item) -> int"""
10321 return _core_.Menu_FindItem(*args, **kwargs)
10322
10323 def FindItemById(*args, **kwargs):
10324 """FindItemById(self, int id) -> MenuItem"""
10325 return _core_.Menu_FindItemById(*args, **kwargs)
10326
10327 def FindItemByPosition(*args, **kwargs):
10328 """FindItemByPosition(self, size_t position) -> MenuItem"""
10329 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10330
10331 def Enable(*args, **kwargs):
10332 """Enable(self, int id, bool enable)"""
10333 return _core_.Menu_Enable(*args, **kwargs)
10334
10335 def IsEnabled(*args, **kwargs):
10336 """IsEnabled(self, int id) -> bool"""
10337 return _core_.Menu_IsEnabled(*args, **kwargs)
10338
10339 def Check(*args, **kwargs):
10340 """Check(self, int id, bool check)"""
10341 return _core_.Menu_Check(*args, **kwargs)
10342
10343 def IsChecked(*args, **kwargs):
10344 """IsChecked(self, int id) -> bool"""
10345 return _core_.Menu_IsChecked(*args, **kwargs)
10346
10347 def SetLabel(*args, **kwargs):
10348 """SetLabel(self, int id, String label)"""
10349 return _core_.Menu_SetLabel(*args, **kwargs)
10350
10351 def GetLabel(*args, **kwargs):
10352 """GetLabel(self, int id) -> String"""
10353 return _core_.Menu_GetLabel(*args, **kwargs)
10354
10355 def SetHelpString(*args, **kwargs):
10356 """SetHelpString(self, int id, String helpString)"""
10357 return _core_.Menu_SetHelpString(*args, **kwargs)
10358
10359 def GetHelpString(*args, **kwargs):
10360 """GetHelpString(self, int id) -> String"""
10361 return _core_.Menu_GetHelpString(*args, **kwargs)
10362
10363 def SetTitle(*args, **kwargs):
10364 """SetTitle(self, String title)"""
10365 return _core_.Menu_SetTitle(*args, **kwargs)
10366
10367 def GetTitle(*args, **kwargs):
10368 """GetTitle(self) -> String"""
10369 return _core_.Menu_GetTitle(*args, **kwargs)
10370
10371 def SetEventHandler(*args, **kwargs):
10372 """SetEventHandler(self, EvtHandler handler)"""
10373 return _core_.Menu_SetEventHandler(*args, **kwargs)
10374
10375 def GetEventHandler(*args, **kwargs):
10376 """GetEventHandler(self) -> EvtHandler"""
10377 return _core_.Menu_GetEventHandler(*args, **kwargs)
10378
10379 def SetInvokingWindow(*args, **kwargs):
10380 """SetInvokingWindow(self, Window win)"""
10381 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10382
10383 def GetInvokingWindow(*args, **kwargs):
10384 """GetInvokingWindow(self) -> Window"""
10385 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10386
10387 def GetStyle(*args, **kwargs):
10388 """GetStyle(self) -> long"""
10389 return _core_.Menu_GetStyle(*args, **kwargs)
10390
10391 def UpdateUI(*args, **kwargs):
10392 """UpdateUI(self, EvtHandler source=None)"""
10393 return _core_.Menu_UpdateUI(*args, **kwargs)
10394
10395 def GetMenuBar(*args, **kwargs):
10396 """GetMenuBar(self) -> MenuBar"""
10397 return _core_.Menu_GetMenuBar(*args, **kwargs)
10398
10399 def Attach(*args, **kwargs):
10400 """Attach(self, wxMenuBarBase menubar)"""
10401 return _core_.Menu_Attach(*args, **kwargs)
10402
10403 def Detach(*args, **kwargs):
10404 """Detach(self)"""
10405 return _core_.Menu_Detach(*args, **kwargs)
10406
10407 def IsAttached(*args, **kwargs):
10408 """IsAttached(self) -> bool"""
10409 return _core_.Menu_IsAttached(*args, **kwargs)
10410
10411 def SetParent(*args, **kwargs):
10412 """SetParent(self, Menu parent)"""
10413 return _core_.Menu_SetParent(*args, **kwargs)
10414
10415 def GetParent(*args, **kwargs):
10416 """GetParent(self) -> Menu"""
10417 return _core_.Menu_GetParent(*args, **kwargs)
10418
10419 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10420 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10421 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10422 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10423 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10424 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10425 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10426 Style = property(GetStyle,doc="See `GetStyle`")
10427 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
10428 _core_.Menu_swigregister(Menu)
10429 DefaultValidator = cvar.DefaultValidator
10430
10431 #---------------------------------------------------------------------------
10432
10433 class MenuBar(Window):
10434 """Proxy of C++ MenuBar class"""
10435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10436 __repr__ = _swig_repr
10437 def __init__(self, *args, **kwargs):
10438 """__init__(self, long style=0) -> MenuBar"""
10439 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10440 self._setOORInfo(self)
10441
10442 def Append(*args, **kwargs):
10443 """Append(self, Menu menu, String title) -> bool"""
10444 return _core_.MenuBar_Append(*args, **kwargs)
10445
10446 def Insert(*args, **kwargs):
10447 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10448 return _core_.MenuBar_Insert(*args, **kwargs)
10449
10450 def GetMenuCount(*args, **kwargs):
10451 """GetMenuCount(self) -> size_t"""
10452 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10453
10454 def GetMenu(*args, **kwargs):
10455 """GetMenu(self, size_t pos) -> Menu"""
10456 return _core_.MenuBar_GetMenu(*args, **kwargs)
10457
10458 def Replace(*args, **kwargs):
10459 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10460 return _core_.MenuBar_Replace(*args, **kwargs)
10461
10462 def Remove(*args, **kwargs):
10463 """Remove(self, size_t pos) -> Menu"""
10464 return _core_.MenuBar_Remove(*args, **kwargs)
10465
10466 def EnableTop(*args, **kwargs):
10467 """EnableTop(self, size_t pos, bool enable)"""
10468 return _core_.MenuBar_EnableTop(*args, **kwargs)
10469
10470 def IsEnabledTop(*args, **kwargs):
10471 """IsEnabledTop(self, size_t pos) -> bool"""
10472 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10473
10474 def SetLabelTop(*args, **kwargs):
10475 """SetLabelTop(self, size_t pos, String label)"""
10476 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10477
10478 def GetLabelTop(*args, **kwargs):
10479 """GetLabelTop(self, size_t pos) -> String"""
10480 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10481
10482 def FindMenuItem(*args, **kwargs):
10483 """FindMenuItem(self, String menu, String item) -> int"""
10484 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10485
10486 def FindItemById(*args, **kwargs):
10487 """FindItemById(self, int id) -> MenuItem"""
10488 return _core_.MenuBar_FindItemById(*args, **kwargs)
10489
10490 def FindMenu(*args, **kwargs):
10491 """FindMenu(self, String title) -> int"""
10492 return _core_.MenuBar_FindMenu(*args, **kwargs)
10493
10494 def Enable(*args, **kwargs):
10495 """Enable(self, int id, bool enable)"""
10496 return _core_.MenuBar_Enable(*args, **kwargs)
10497
10498 def Check(*args, **kwargs):
10499 """Check(self, int id, bool check)"""
10500 return _core_.MenuBar_Check(*args, **kwargs)
10501
10502 def IsChecked(*args, **kwargs):
10503 """IsChecked(self, int id) -> bool"""
10504 return _core_.MenuBar_IsChecked(*args, **kwargs)
10505
10506 def IsEnabled(*args, **kwargs):
10507 """IsEnabled(self, int id) -> bool"""
10508 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10509
10510 def SetLabel(*args, **kwargs):
10511 """SetLabel(self, int id, String label)"""
10512 return _core_.MenuBar_SetLabel(*args, **kwargs)
10513
10514 def GetLabel(*args, **kwargs):
10515 """GetLabel(self, int id) -> String"""
10516 return _core_.MenuBar_GetLabel(*args, **kwargs)
10517
10518 def SetHelpString(*args, **kwargs):
10519 """SetHelpString(self, int id, String helpString)"""
10520 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10521
10522 def GetHelpString(*args, **kwargs):
10523 """GetHelpString(self, int id) -> String"""
10524 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10525
10526 def GetFrame(*args, **kwargs):
10527 """GetFrame(self) -> wxFrame"""
10528 return _core_.MenuBar_GetFrame(*args, **kwargs)
10529
10530 def IsAttached(*args, **kwargs):
10531 """IsAttached(self) -> bool"""
10532 return _core_.MenuBar_IsAttached(*args, **kwargs)
10533
10534 def Attach(*args, **kwargs):
10535 """Attach(self, wxFrame frame)"""
10536 return _core_.MenuBar_Attach(*args, **kwargs)
10537
10538 def Detach(*args, **kwargs):
10539 """Detach(self)"""
10540 return _core_.MenuBar_Detach(*args, **kwargs)
10541
10542 def UpdateMenus(*args, **kwargs):
10543 """UpdateMenus(self)"""
10544 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10545
10546 def SetAutoWindowMenu(*args, **kwargs):
10547 """SetAutoWindowMenu(bool enable)"""
10548 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10549
10550 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10551 def GetAutoWindowMenu(*args, **kwargs):
10552 """GetAutoWindowMenu() -> bool"""
10553 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10554
10555 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10556 def GetMenus(self):
10557 """Return a list of (menu, label) items for the menus in the MenuBar. """
10558 return [(self.GetMenu(i), self.GetLabelTop(i))
10559 for i in range(self.GetMenuCount())]
10560
10561 def SetMenus(self, items):
10562 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10563 for i in range(self.GetMenuCount()-1, -1, -1):
10564 self.Remove(i)
10565 for m, l in items:
10566 self.Append(m, l)
10567
10568 Frame = property(GetFrame,doc="See `GetFrame`")
10569 Menu = property(GetMenu,doc="See `GetMenu`")
10570 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10571 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
10572 _core_.MenuBar_swigregister(MenuBar)
10573
10574 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10575 """MenuBar_SetAutoWindowMenu(bool enable)"""
10576 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10577
10578 def MenuBar_GetAutoWindowMenu(*args):
10579 """MenuBar_GetAutoWindowMenu() -> bool"""
10580 return _core_.MenuBar_GetAutoWindowMenu(*args)
10581
10582 #---------------------------------------------------------------------------
10583
10584 class MenuItem(Object):
10585 """Proxy of C++ MenuItem class"""
10586 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10587 __repr__ = _swig_repr
10588 def __init__(self, *args, **kwargs):
10589 """
10590 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10591 String help=EmptyString, int kind=ITEM_NORMAL,
10592 Menu subMenu=None) -> MenuItem
10593 """
10594 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10595 __swig_destroy__ = _core_.delete_MenuItem
10596 __del__ = lambda self : None;
10597 def GetMenu(*args, **kwargs):
10598 """GetMenu(self) -> Menu"""
10599 return _core_.MenuItem_GetMenu(*args, **kwargs)
10600
10601 def SetMenu(*args, **kwargs):
10602 """SetMenu(self, Menu menu)"""
10603 return _core_.MenuItem_SetMenu(*args, **kwargs)
10604
10605 def SetId(*args, **kwargs):
10606 """SetId(self, int id)"""
10607 return _core_.MenuItem_SetId(*args, **kwargs)
10608
10609 def GetId(*args, **kwargs):
10610 """GetId(self) -> int"""
10611 return _core_.MenuItem_GetId(*args, **kwargs)
10612
10613 def IsSeparator(*args, **kwargs):
10614 """IsSeparator(self) -> bool"""
10615 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10616
10617 def SetText(*args, **kwargs):
10618 """SetText(self, String str)"""
10619 return _core_.MenuItem_SetText(*args, **kwargs)
10620
10621 def GetLabel(*args, **kwargs):
10622 """GetLabel(self) -> String"""
10623 return _core_.MenuItem_GetLabel(*args, **kwargs)
10624
10625 def GetText(*args, **kwargs):
10626 """GetText(self) -> String"""
10627 return _core_.MenuItem_GetText(*args, **kwargs)
10628
10629 def GetLabelFromText(*args, **kwargs):
10630 """GetLabelFromText(String text) -> String"""
10631 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10632
10633 GetLabelFromText = staticmethod(GetLabelFromText)
10634 def GetKind(*args, **kwargs):
10635 """GetKind(self) -> int"""
10636 return _core_.MenuItem_GetKind(*args, **kwargs)
10637
10638 def SetKind(*args, **kwargs):
10639 """SetKind(self, int kind)"""
10640 return _core_.MenuItem_SetKind(*args, **kwargs)
10641
10642 def SetCheckable(*args, **kwargs):
10643 """SetCheckable(self, bool checkable)"""
10644 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10645
10646 def IsCheckable(*args, **kwargs):
10647 """IsCheckable(self) -> bool"""
10648 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10649
10650 def IsSubMenu(*args, **kwargs):
10651 """IsSubMenu(self) -> bool"""
10652 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10653
10654 def SetSubMenu(*args, **kwargs):
10655 """SetSubMenu(self, Menu menu)"""
10656 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10657
10658 def GetSubMenu(*args, **kwargs):
10659 """GetSubMenu(self) -> Menu"""
10660 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10661
10662 def Enable(*args, **kwargs):
10663 """Enable(self, bool enable=True)"""
10664 return _core_.MenuItem_Enable(*args, **kwargs)
10665
10666 def IsEnabled(*args, **kwargs):
10667 """IsEnabled(self) -> bool"""
10668 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10669
10670 def Check(*args, **kwargs):
10671 """Check(self, bool check=True)"""
10672 return _core_.MenuItem_Check(*args, **kwargs)
10673
10674 def IsChecked(*args, **kwargs):
10675 """IsChecked(self) -> bool"""
10676 return _core_.MenuItem_IsChecked(*args, **kwargs)
10677
10678 def Toggle(*args, **kwargs):
10679 """Toggle(self)"""
10680 return _core_.MenuItem_Toggle(*args, **kwargs)
10681
10682 def SetHelp(*args, **kwargs):
10683 """SetHelp(self, String str)"""
10684 return _core_.MenuItem_SetHelp(*args, **kwargs)
10685
10686 def GetHelp(*args, **kwargs):
10687 """GetHelp(self) -> String"""
10688 return _core_.MenuItem_GetHelp(*args, **kwargs)
10689
10690 def GetAccel(*args, **kwargs):
10691 """GetAccel(self) -> AcceleratorEntry"""
10692 return _core_.MenuItem_GetAccel(*args, **kwargs)
10693
10694 def SetAccel(*args, **kwargs):
10695 """SetAccel(self, AcceleratorEntry accel)"""
10696 return _core_.MenuItem_SetAccel(*args, **kwargs)
10697
10698 def SetBitmap(*args, **kwargs):
10699 """SetBitmap(self, Bitmap bitmap)"""
10700 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10701
10702 def GetBitmap(*args, **kwargs):
10703 """GetBitmap(self) -> Bitmap"""
10704 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10705
10706 def SetFont(*args, **kwargs):
10707 """SetFont(self, Font font)"""
10708 return _core_.MenuItem_SetFont(*args, **kwargs)
10709
10710 def GetFont(*args, **kwargs):
10711 """GetFont(self) -> Font"""
10712 return _core_.MenuItem_GetFont(*args, **kwargs)
10713
10714 def SetTextColour(*args, **kwargs):
10715 """SetTextColour(self, Colour colText)"""
10716 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10717
10718 def GetTextColour(*args, **kwargs):
10719 """GetTextColour(self) -> Colour"""
10720 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10721
10722 def SetBackgroundColour(*args, **kwargs):
10723 """SetBackgroundColour(self, Colour colBack)"""
10724 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10725
10726 def GetBackgroundColour(*args, **kwargs):
10727 """GetBackgroundColour(self) -> Colour"""
10728 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10729
10730 def SetBitmaps(*args, **kwargs):
10731 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10732 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10733
10734 def SetDisabledBitmap(*args, **kwargs):
10735 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10736 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10737
10738 def GetDisabledBitmap(*args, **kwargs):
10739 """GetDisabledBitmap(self) -> Bitmap"""
10740 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10741
10742 def SetMarginWidth(*args, **kwargs):
10743 """SetMarginWidth(self, int nWidth)"""
10744 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10745
10746 def GetMarginWidth(*args, **kwargs):
10747 """GetMarginWidth(self) -> int"""
10748 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10749
10750 def GetDefaultMarginWidth(*args, **kwargs):
10751 """GetDefaultMarginWidth() -> int"""
10752 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10753
10754 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10755 def IsOwnerDrawn(*args, **kwargs):
10756 """IsOwnerDrawn(self) -> bool"""
10757 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10758
10759 def SetOwnerDrawn(*args, **kwargs):
10760 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10761 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10762
10763 def ResetOwnerDrawn(*args, **kwargs):
10764 """ResetOwnerDrawn(self)"""
10765 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10766
10767 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10768 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10769 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10770 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10771 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10772 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10773 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10774 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10775 Label = property(GetLabel,doc="See `GetLabel`")
10776 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10777 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10778 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10779 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10780 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
10781 _core_.MenuItem_swigregister(MenuItem)
10782
10783 def MenuItem_GetLabelFromText(*args, **kwargs):
10784 """MenuItem_GetLabelFromText(String text) -> String"""
10785 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10786
10787 def MenuItem_GetDefaultMarginWidth(*args):
10788 """MenuItem_GetDefaultMarginWidth() -> int"""
10789 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10790
10791 #---------------------------------------------------------------------------
10792
10793 class Control(Window):
10794 """
10795 This is the base class for a control or 'widget'.
10796
10797 A control is generally a small window which processes user input
10798 and/or displays one or more item of data.
10799 """
10800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10801 __repr__ = _swig_repr
10802 def __init__(self, *args, **kwargs):
10803 """
10804 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10805 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10806 String name=ControlNameStr) -> Control
10807
10808 Create a Control. Normally you should only call this from a subclass'
10809 __init__ as a plain old wx.Control is not very useful.
10810 """
10811 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10812 self._setOORInfo(self)
10813
10814 def Create(*args, **kwargs):
10815 """
10816 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10817 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10818 String name=ControlNameStr) -> bool
10819
10820 Do the 2nd phase and create the GUI control.
10821 """
10822 return _core_.Control_Create(*args, **kwargs)
10823
10824 def GetAlignment(*args, **kwargs):
10825 """
10826 GetAlignment(self) -> int
10827
10828 Get the control alignment (left/right/centre, top/bottom/centre)
10829 """
10830 return _core_.Control_GetAlignment(*args, **kwargs)
10831
10832 def GetLabelText(*args, **kwargs):
10833 """
10834 GetLabelText(self) -> String
10835
10836 Get just the text of the label, without mnemonic characters ('&')
10837 """
10838 return _core_.Control_GetLabelText(*args, **kwargs)
10839
10840 def Command(*args, **kwargs):
10841 """
10842 Command(self, CommandEvent event)
10843
10844 Simulates the effect of the user issuing a command to the item.
10845
10846 :see: `wx.CommandEvent`
10847
10848 """
10849 return _core_.Control_Command(*args, **kwargs)
10850
10851 def GetLabel(*args, **kwargs):
10852 """
10853 GetLabel(self) -> String
10854
10855 Return a control's text.
10856 """
10857 return _core_.Control_GetLabel(*args, **kwargs)
10858
10859 def GetClassDefaultAttributes(*args, **kwargs):
10860 """
10861 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10862
10863 Get the default attributes for this class. This is useful if you want
10864 to use the same font or colour in your own control as in a standard
10865 control -- which is a much better idea than hard coding specific
10866 colours or fonts which might look completely out of place on the
10867 user's system, especially if it uses themes.
10868
10869 The variant parameter is only relevant under Mac currently and is
10870 ignore under other platforms. Under Mac, it will change the size of
10871 the returned font. See `wx.Window.SetWindowVariant` for more about
10872 this.
10873 """
10874 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10875
10876 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10877 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10878 Label = property(GetLabel,doc="See `GetLabel`")
10879 LabelText = property(GetLabelText,doc="See `GetLabelText`")
10880 _core_.Control_swigregister(Control)
10881 ControlNameStr = cvar.ControlNameStr
10882
10883 def PreControl(*args, **kwargs):
10884 """
10885 PreControl() -> Control
10886
10887 Precreate a Control control for 2-phase creation
10888 """
10889 val = _core_.new_PreControl(*args, **kwargs)
10890 return val
10891
10892 def Control_GetClassDefaultAttributes(*args, **kwargs):
10893 """
10894 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10895
10896 Get the default attributes for this class. This is useful if you want
10897 to use the same font or colour in your own control as in a standard
10898 control -- which is a much better idea than hard coding specific
10899 colours or fonts which might look completely out of place on the
10900 user's system, especially if it uses themes.
10901
10902 The variant parameter is only relevant under Mac currently and is
10903 ignore under other platforms. Under Mac, it will change the size of
10904 the returned font. See `wx.Window.SetWindowVariant` for more about
10905 this.
10906 """
10907 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10908
10909 #---------------------------------------------------------------------------
10910
10911 class ItemContainer(object):
10912 """
10913 The wx.ItemContainer class defines an interface which is implemented
10914 by all controls which have string subitems, each of which may be
10915 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10916 as `wx.ComboBox` which implements an extended interface deriving from
10917 this one.
10918
10919 It defines the methods for accessing the control's items and although
10920 each of the derived classes implements them differently, they still
10921 all conform to the same interface.
10922
10923 The items in a wx.ItemContainer have (non empty) string labels and,
10924 optionally, client data associated with them.
10925
10926 """
10927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10928 def __init__(self): raise AttributeError, "No constructor defined"
10929 __repr__ = _swig_repr
10930 def Append(*args, **kwargs):
10931 """
10932 Append(self, String item, PyObject clientData=None) -> int
10933
10934 Adds the item to the control, associating the given data with the item
10935 if not None. The return value is the index of the newly added item
10936 which may be different from the last one if the control is sorted (e.g.
10937 has wx.LB_SORT or wx.CB_SORT style).
10938 """
10939 return _core_.ItemContainer_Append(*args, **kwargs)
10940
10941 def AppendItems(*args, **kwargs):
10942 """
10943 AppendItems(self, List strings)
10944
10945 Apend several items at once to the control. Notice that calling this
10946 method may be much faster than appending the items one by one if you
10947 need to add a lot of items.
10948 """
10949 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10950
10951 def Insert(*args, **kwargs):
10952 """
10953 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10954
10955 Insert an item into the control before the item at the ``pos`` index,
10956 optionally associating some data object with the item.
10957 """
10958 return _core_.ItemContainer_Insert(*args, **kwargs)
10959
10960 def Clear(*args, **kwargs):
10961 """
10962 Clear(self)
10963
10964 Removes all items from the control.
10965 """
10966 return _core_.ItemContainer_Clear(*args, **kwargs)
10967
10968 def Delete(*args, **kwargs):
10969 """
10970 Delete(self, unsigned int n)
10971
10972 Deletes the item at the zero-based index 'n' from the control. Note
10973 that it is an error (signalled by a `wx.PyAssertionError` exception if
10974 enabled) to remove an item with the index negative or greater or equal
10975 than the number of items in the control.
10976 """
10977 return _core_.ItemContainer_Delete(*args, **kwargs)
10978
10979 def GetClientData(*args, **kwargs):
10980 """
10981 GetClientData(self, unsigned int n) -> PyObject
10982
10983 Returns the client data associated with the given item, (if any.)
10984 """
10985 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10986
10987 def SetClientData(*args, **kwargs):
10988 """
10989 SetClientData(self, unsigned int n, PyObject clientData)
10990
10991 Associate the given client data with the item at position n.
10992 """
10993 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10994
10995 def GetCount(*args, **kwargs):
10996 """
10997 GetCount(self) -> unsigned int
10998
10999 Returns the number of items in the control.
11000 """
11001 return _core_.ItemContainer_GetCount(*args, **kwargs)
11002
11003 def IsEmpty(*args, **kwargs):
11004 """
11005 IsEmpty(self) -> bool
11006
11007 Returns True if the control is empty or False if it has some items.
11008 """
11009 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11010
11011 def GetString(*args, **kwargs):
11012 """
11013 GetString(self, unsigned int n) -> String
11014
11015 Returns the label of the item with the given index.
11016 """
11017 return _core_.ItemContainer_GetString(*args, **kwargs)
11018
11019 def GetStrings(*args, **kwargs):
11020 """GetStrings(self) -> wxArrayString"""
11021 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11022
11023 def SetString(*args, **kwargs):
11024 """
11025 SetString(self, unsigned int n, String s)
11026
11027 Sets the label for the given item.
11028 """
11029 return _core_.ItemContainer_SetString(*args, **kwargs)
11030
11031 def FindString(*args, **kwargs):
11032 """
11033 FindString(self, String s) -> int
11034
11035 Finds an item whose label matches the given string. Returns the
11036 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11037 found.
11038 """
11039 return _core_.ItemContainer_FindString(*args, **kwargs)
11040
11041 def SetSelection(*args, **kwargs):
11042 """
11043 SetSelection(self, int n)
11044
11045 Sets the item at index 'n' to be the selected item.
11046 """
11047 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11048
11049 def GetSelection(*args, **kwargs):
11050 """
11051 GetSelection(self) -> int
11052
11053 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11054 is selected.
11055 """
11056 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11057
11058 def SetStringSelection(*args, **kwargs):
11059 """SetStringSelection(self, String s) -> bool"""
11060 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11061
11062 def GetStringSelection(*args, **kwargs):
11063 """
11064 GetStringSelection(self) -> String
11065
11066 Returns the label of the selected item or an empty string if no item
11067 is selected.
11068 """
11069 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11070
11071 def Select(*args, **kwargs):
11072 """
11073 Select(self, int n)
11074
11075 This is the same as `SetSelection` and exists only because it is
11076 slightly more natural for controls which support multiple selection.
11077 """
11078 return _core_.ItemContainer_Select(*args, **kwargs)
11079
11080 def GetItems(self):
11081 """Return a list of the strings in the control"""
11082 return [self.GetString(i) for i in xrange(self.GetCount())]
11083
11084 def SetItems(self, items):
11085 """Clear and set the strings in the control from a list"""
11086 self.Clear()
11087 for i in items:
11088 self.Append(i)
11089
11090 Count = property(GetCount,doc="See `GetCount`")
11091 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11092 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11093 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11094 Strings = property(GetStrings,doc="See `GetStrings`")
11095 _core_.ItemContainer_swigregister(ItemContainer)
11096
11097 #---------------------------------------------------------------------------
11098
11099 class ControlWithItems(Control,ItemContainer):
11100 """
11101 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11102 wx.Control class, and is used for the base class of various controls
11103 that have items.
11104 """
11105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11106 def __init__(self): raise AttributeError, "No constructor defined"
11107 __repr__ = _swig_repr
11108 _core_.ControlWithItems_swigregister(ControlWithItems)
11109
11110 #---------------------------------------------------------------------------
11111
11112 class SizerItem(Object):
11113 """
11114 The wx.SizerItem class is used to track the position, size and other
11115 attributes of each item managed by a `wx.Sizer`. It is not usually
11116 necessary to use this class because the sizer elements can also be
11117 identified by their positions or window or sizer references but
11118 sometimes it may be more convenient to use wx.SizerItem directly.
11119 Also, custom classes derived from `wx.PySizer` will probably need to
11120 use the collection of wx.SizerItems held by wx.Sizer when calculating
11121 layout.
11122
11123 :see: `wx.Sizer`, `wx.GBSizerItem`
11124 """
11125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11126 __repr__ = _swig_repr
11127 def __init__(self, *args, **kwargs):
11128 """
11129 __init__(self) -> SizerItem
11130
11131 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11132 size will need to be set before this item can be used in a Sizer.
11133
11134 You will probably never need to create a wx.SizerItem directly as they
11135 are created automatically when the sizer's Add, Insert or Prepend
11136 methods are called.
11137
11138 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11139 """
11140 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11141 __swig_destroy__ = _core_.delete_SizerItem
11142 __del__ = lambda self : None;
11143 def DeleteWindows(*args, **kwargs):
11144 """
11145 DeleteWindows(self)
11146
11147 Destroy the window or the windows in a subsizer, depending on the type
11148 of item.
11149 """
11150 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11151
11152 def DetachSizer(*args, **kwargs):
11153 """
11154 DetachSizer(self)
11155
11156 Enable deleting the SizerItem without destroying the contained sizer.
11157 """
11158 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11159
11160 def GetSize(*args, **kwargs):
11161 """
11162 GetSize(self) -> Size
11163
11164 Get the current size of the item, as set in the last Layout.
11165 """
11166 return _core_.SizerItem_GetSize(*args, **kwargs)
11167
11168 def CalcMin(*args, **kwargs):
11169 """
11170 CalcMin(self) -> Size
11171
11172 Calculates the minimum desired size for the item, including any space
11173 needed by borders.
11174 """
11175 return _core_.SizerItem_CalcMin(*args, **kwargs)
11176
11177 def SetDimension(*args, **kwargs):
11178 """
11179 SetDimension(self, Point pos, Size size)
11180
11181 Set the position and size of the space allocated for this item by the
11182 sizer, and adjust the position and size of the item (window or
11183 subsizer) to be within that space taking alignment and borders into
11184 account.
11185 """
11186 return _core_.SizerItem_SetDimension(*args, **kwargs)
11187
11188 def GetMinSize(*args, **kwargs):
11189 """
11190 GetMinSize(self) -> Size
11191
11192 Get the minimum size needed for the item.
11193 """
11194 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11195
11196 def GetMinSizeWithBorder(*args, **kwargs):
11197 """
11198 GetMinSizeWithBorder(self) -> Size
11199
11200 Get the minimum size needed for the item with space for the borders
11201 added, if needed.
11202 """
11203 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11204
11205 def SetInitSize(*args, **kwargs):
11206 """SetInitSize(self, int x, int y)"""
11207 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11208
11209 def SetRatioWH(*args, **kwargs):
11210 """
11211 SetRatioWH(self, int width, int height)
11212
11213 Set the ratio item attribute.
11214 """
11215 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11216
11217 def SetRatioSize(*args, **kwargs):
11218 """
11219 SetRatioSize(self, Size size)
11220
11221 Set the ratio item attribute.
11222 """
11223 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11224
11225 def SetRatio(*args, **kwargs):
11226 """
11227 SetRatio(self, float ratio)
11228
11229 Set the ratio item attribute.
11230 """
11231 return _core_.SizerItem_SetRatio(*args, **kwargs)
11232
11233 def GetRatio(*args, **kwargs):
11234 """
11235 GetRatio(self) -> float
11236
11237 Set the ratio item attribute.
11238 """
11239 return _core_.SizerItem_GetRatio(*args, **kwargs)
11240
11241 def GetRect(*args, **kwargs):
11242 """
11243 GetRect(self) -> Rect
11244
11245 Returns the rectangle that the sizer item should occupy
11246 """
11247 return _core_.SizerItem_GetRect(*args, **kwargs)
11248
11249 def IsWindow(*args, **kwargs):
11250 """
11251 IsWindow(self) -> bool
11252
11253 Is this sizer item a window?
11254 """
11255 return _core_.SizerItem_IsWindow(*args, **kwargs)
11256
11257 def IsSizer(*args, **kwargs):
11258 """
11259 IsSizer(self) -> bool
11260
11261 Is this sizer item a subsizer?
11262 """
11263 return _core_.SizerItem_IsSizer(*args, **kwargs)
11264
11265 def IsSpacer(*args, **kwargs):
11266 """
11267 IsSpacer(self) -> bool
11268
11269 Is this sizer item a spacer?
11270 """
11271 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11272
11273 def SetProportion(*args, **kwargs):
11274 """
11275 SetProportion(self, int proportion)
11276
11277 Set the proportion value for this item.
11278 """
11279 return _core_.SizerItem_SetProportion(*args, **kwargs)
11280
11281 def GetProportion(*args, **kwargs):
11282 """
11283 GetProportion(self) -> int
11284
11285 Get the proportion value for this item.
11286 """
11287 return _core_.SizerItem_GetProportion(*args, **kwargs)
11288
11289 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11290 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11291 def SetFlag(*args, **kwargs):
11292 """
11293 SetFlag(self, int flag)
11294
11295 Set the flag value for this item.
11296 """
11297 return _core_.SizerItem_SetFlag(*args, **kwargs)
11298
11299 def GetFlag(*args, **kwargs):
11300 """
11301 GetFlag(self) -> int
11302
11303 Get the flag value for this item.
11304 """
11305 return _core_.SizerItem_GetFlag(*args, **kwargs)
11306
11307 def SetBorder(*args, **kwargs):
11308 """
11309 SetBorder(self, int border)
11310
11311 Set the border value for this item.
11312 """
11313 return _core_.SizerItem_SetBorder(*args, **kwargs)
11314
11315 def GetBorder(*args, **kwargs):
11316 """
11317 GetBorder(self) -> int
11318
11319 Get the border value for this item.
11320 """
11321 return _core_.SizerItem_GetBorder(*args, **kwargs)
11322
11323 def GetWindow(*args, **kwargs):
11324 """
11325 GetWindow(self) -> Window
11326
11327 Get the window (if any) that is managed by this sizer item.
11328 """
11329 return _core_.SizerItem_GetWindow(*args, **kwargs)
11330
11331 def SetWindow(*args, **kwargs):
11332 """
11333 SetWindow(self, Window window)
11334
11335 Set the window to be managed by this sizer item.
11336 """
11337 return _core_.SizerItem_SetWindow(*args, **kwargs)
11338
11339 def GetSizer(*args, **kwargs):
11340 """
11341 GetSizer(self) -> Sizer
11342
11343 Get the subsizer (if any) that is managed by this sizer item.
11344 """
11345 return _core_.SizerItem_GetSizer(*args, **kwargs)
11346
11347 def SetSizer(*args, **kwargs):
11348 """
11349 SetSizer(self, Sizer sizer)
11350
11351 Set the subsizer to be managed by this sizer item.
11352 """
11353 return _core_.SizerItem_SetSizer(*args, **kwargs)
11354
11355 def GetSpacer(*args, **kwargs):
11356 """
11357 GetSpacer(self) -> Size
11358
11359 Get the size of the spacer managed by this sizer item.
11360 """
11361 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11362
11363 def SetSpacer(*args, **kwargs):
11364 """
11365 SetSpacer(self, Size size)
11366
11367 Set the size of the spacer to be managed by this sizer item.
11368 """
11369 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11370
11371 def Show(*args, **kwargs):
11372 """
11373 Show(self, bool show)
11374
11375 Set the show item attribute, which sizers use to determine if the item
11376 is to be made part of the layout or not. If the item is tracking a
11377 window then it is shown or hidden as needed.
11378 """
11379 return _core_.SizerItem_Show(*args, **kwargs)
11380
11381 def IsShown(*args, **kwargs):
11382 """
11383 IsShown(self) -> bool
11384
11385 Is the item to be shown in the layout?
11386 """
11387 return _core_.SizerItem_IsShown(*args, **kwargs)
11388
11389 def GetPosition(*args, **kwargs):
11390 """
11391 GetPosition(self) -> Point
11392
11393 Returns the current position of the item, as set in the last Layout.
11394 """
11395 return _core_.SizerItem_GetPosition(*args, **kwargs)
11396
11397 def GetUserData(*args, **kwargs):
11398 """
11399 GetUserData(self) -> PyObject
11400
11401 Returns the userData associated with this sizer item, or None if there
11402 isn't any.
11403 """
11404 return _core_.SizerItem_GetUserData(*args, **kwargs)
11405
11406 def SetUserData(*args, **kwargs):
11407 """
11408 SetUserData(self, PyObject userData)
11409
11410 Associate a Python object with this sizer item.
11411 """
11412 return _core_.SizerItem_SetUserData(*args, **kwargs)
11413
11414 _core_.SizerItem_swigregister(SizerItem)
11415
11416 def SizerItemWindow(*args, **kwargs):
11417 """
11418 SizerItemWindow(Window window, int proportion, int flag, int border,
11419 PyObject userData=None) -> SizerItem
11420
11421 Constructs a `wx.SizerItem` for tracking a window.
11422 """
11423 val = _core_.new_SizerItemWindow(*args, **kwargs)
11424 return val
11425
11426 def SizerItemSpacer(*args, **kwargs):
11427 """
11428 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11429 PyObject userData=None) -> SizerItem
11430
11431 Constructs a `wx.SizerItem` for tracking a spacer.
11432 """
11433 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11434 return val
11435
11436 def SizerItemSizer(*args, **kwargs):
11437 """
11438 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11439 PyObject userData=None) -> SizerItem
11440
11441 Constructs a `wx.SizerItem` for tracking a subsizer
11442 """
11443 val = _core_.new_SizerItemSizer(*args, **kwargs)
11444 return val
11445
11446 class Sizer(Object):
11447 """
11448 wx.Sizer is the abstract base class used for laying out subwindows in
11449 a window. You cannot use wx.Sizer directly; instead, you will have to
11450 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11451 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11452 `wx.GridBagSizer`.
11453
11454 The concept implemented by sizers in wxWidgets is closely related to
11455 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11456 toolkit or the Qt toolkit. It is based upon the idea of the individual
11457 subwindows reporting their minimal required size and their ability to
11458 get stretched if the size of the parent window has changed. This will
11459 most often mean that the programmer does not set the original size of
11460 a dialog in the beginning, rather the dialog will assigned a sizer and
11461 this sizer will be queried about the recommended size. The sizer in
11462 turn will query its children, which can be normal windows or contorls,
11463 empty space or other sizers, so that a hierarchy of sizers can be
11464 constructed. Note that wxSizer does not derive from wxWindow and thus
11465 do not interfere with tab ordering and requires very little resources
11466 compared to a real window on screen.
11467
11468 What makes sizers so well fitted for use in wxWidgets is the fact that
11469 every control reports its own minimal size and the algorithm can
11470 handle differences in font sizes or different window (dialog item)
11471 sizes on different platforms without problems. If for example the
11472 standard font as well as the overall design of Mac widgets requires
11473 more space than on Windows, then the initial size of a dialog using a
11474 sizer will automatically be bigger on Mac than on Windows.
11475 """
11476 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11477 def __init__(self): raise AttributeError, "No constructor defined"
11478 __repr__ = _swig_repr
11479 __swig_destroy__ = _core_.delete_Sizer
11480 __del__ = lambda self : None;
11481 def _setOORInfo(*args, **kwargs):
11482 """_setOORInfo(self, PyObject _self)"""
11483 return _core_.Sizer__setOORInfo(*args, **kwargs)
11484
11485 def Add(*args, **kwargs):
11486 """
11487 Add(self, item, int proportion=0, int flag=0, int border=0,
11488 PyObject userData=None) -> wx.SizerItem
11489
11490 Appends a child item to the sizer.
11491 """
11492 return _core_.Sizer_Add(*args, **kwargs)
11493
11494 def Insert(*args, **kwargs):
11495 """
11496 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11497 PyObject userData=None) -> wx.SizerItem
11498
11499 Inserts a new item into the list of items managed by this sizer before
11500 the item at index *before*. See `Add` for a description of the parameters.
11501 """
11502 return _core_.Sizer_Insert(*args, **kwargs)
11503
11504 def Prepend(*args, **kwargs):
11505 """
11506 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11507 PyObject userData=None) -> wx.SizerItem
11508
11509 Adds a new item to the begining of the list of sizer items managed by
11510 this sizer. See `Add` for a description of the parameters.
11511 """
11512 return _core_.Sizer_Prepend(*args, **kwargs)
11513
11514 def Remove(*args, **kwargs):
11515 """
11516 Remove(self, item) -> bool
11517
11518 Removes an item from the sizer and destroys it. This method does not
11519 cause any layout or resizing to take place, call `Layout` to update
11520 the layout on screen after removing a child from the sizer. The
11521 *item* parameter can be either a window, a sizer, or the zero-based
11522 index of an item to remove. Returns True if the child item was found
11523 and removed.
11524 """
11525 return _core_.Sizer_Remove(*args, **kwargs)
11526
11527 def Detach(*args, **kwargs):
11528 """
11529 Detach(self, item) -> bool
11530
11531 Detaches an item from the sizer without destroying it. This method
11532 does not cause any layout or resizing to take place, call `Layout` to
11533 do so. The *item* parameter can be either a window, a sizer, or the
11534 zero-based index of the item to be detached. Returns True if the child item
11535 was found and detached.
11536 """
11537 return _core_.Sizer_Detach(*args, **kwargs)
11538
11539 def GetItem(*args, **kwargs):
11540 """
11541 GetItem(self, item) -> wx.SizerItem
11542
11543 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11544 parameter can be either a window, a sizer, or the zero-based index of
11545 the item to be found.
11546 """
11547 return _core_.Sizer_GetItem(*args, **kwargs)
11548
11549 def _SetItemMinSize(*args, **kwargs):
11550 """_SetItemMinSize(self, PyObject item, Size size)"""
11551 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11552
11553 def _ReplaceWin(*args, **kwargs):
11554 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11555 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11556
11557 def _ReplaceSizer(*args, **kwargs):
11558 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11559 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11560
11561 def _ReplaceItem(*args, **kwargs):
11562 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11563 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11564
11565 def Replace(self, olditem, item, recursive=False):
11566 """
11567 Detaches the given ``olditem`` from the sizer and replaces it with
11568 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11569 detached child is destroyed only if it is not a window, (because
11570 windows are owned by their parent, not the sizer.) The
11571 ``recursive`` parameter can be used to search for the given
11572 element recursivly in subsizers.
11573
11574 This method does not cause any layout or resizing to take place,
11575 call `Layout` to do so.
11576
11577 Returns ``True`` if the child item was found and removed.
11578 """
11579 if isinstance(olditem, wx.Window):
11580 return self._ReplaceWin(olditem, item, recursive)
11581 elif isinstnace(olditem, wx.Sizer):
11582 return self._ReplaceSizer(olditem, item, recursive)
11583 elif isinstnace(olditem, int):
11584 return self._ReplaceItem(olditem, item)
11585 else:
11586 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11587
11588 def SetContainingWindow(*args, **kwargs):
11589 """
11590 SetContainingWindow(self, Window window)
11591
11592 Set (or unset) the window this sizer is used in.
11593 """
11594 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11595
11596 def GetContainingWindow(*args, **kwargs):
11597 """
11598 GetContainingWindow(self) -> Window
11599
11600 Get the window this sizer is used in.
11601 """
11602 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11603
11604 def SetItemMinSize(self, item, *args):
11605 """
11606 SetItemMinSize(self, item, Size size)
11607
11608 Sets the minimum size that will be allocated for an item in the sizer.
11609 The *item* parameter can be either a window, a sizer, or the
11610 zero-based index of the item. If a window or sizer is given then it
11611 will be searched for recursivly in subsizers if neccessary.
11612 """
11613 if len(args) == 2:
11614 # for backward compatibility accept separate width,height args too
11615 return self._SetItemMinSize(item, args)
11616 else:
11617 return self._SetItemMinSize(item, args[0])
11618
11619 def AddItem(*args, **kwargs):
11620 """
11621 AddItem(self, SizerItem item)
11622
11623 Adds a `wx.SizerItem` to the sizer.
11624 """
11625 return _core_.Sizer_AddItem(*args, **kwargs)
11626
11627 def InsertItem(*args, **kwargs):
11628 """
11629 InsertItem(self, int index, SizerItem item)
11630
11631 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11632 """
11633 return _core_.Sizer_InsertItem(*args, **kwargs)
11634
11635 def PrependItem(*args, **kwargs):
11636 """
11637 PrependItem(self, SizerItem item)
11638
11639 Prepends a `wx.SizerItem` to the sizer.
11640 """
11641 return _core_.Sizer_PrependItem(*args, **kwargs)
11642
11643 def AddMany(self, items):
11644 """
11645 AddMany is a convenience method for adding several items
11646 to a sizer at one time. Simply pass it a list of tuples,
11647 where each tuple consists of the parameters that you
11648 would normally pass to the `Add` method.
11649 """
11650 for item in items:
11651 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11652 item = (item, )
11653 self.Add(*item)
11654
11655 def AddSpacer(self, *args, **kw):
11656 """AddSpacer(int size) --> SizerItem
11657
11658 Add a spacer that is (size,size) pixels.
11659 """
11660 if args and type(args[0]) == int:
11661 return self.Add( (args[0],args[0] ), 0)
11662 else: # otherwise stay compatible with old AddSpacer
11663 return self.Add(*args, **kw)
11664 def PrependSpacer(self, *args, **kw):
11665 """PrependSpacer(int size) --> SizerItem
11666
11667 Prepend a spacer that is (size, size) pixels."""
11668 if args and type(args[0]) == int:
11669 return self.Prepend( (args[0],args[0] ), 0)
11670 else: # otherwise stay compatible with old PrependSpacer
11671 return self.Prepend(*args, **kw)
11672 def InsertSpacer(self, index, *args, **kw):
11673 """InsertSpacer(int index, int size) --> SizerItem
11674
11675 Insert a spacer at position index that is (size, size) pixels."""
11676 if args and type(args[0]) == int:
11677 return self.Insert( index, (args[0],args[0] ), 0)
11678 else: # otherwise stay compatible with old InsertSpacer
11679 return self.Insert(index, *args, **kw)
11680
11681
11682 def AddStretchSpacer(self, prop=1):
11683 """AddStretchSpacer(int prop=1) --> SizerItem
11684
11685 Add a stretchable spacer."""
11686 return self.Add((0,0), prop)
11687 def PrependStretchSpacer(self, prop=1):
11688 """PrependStretchSpacer(int prop=1) --> SizerItem
11689
11690 Prepend a stretchable spacer."""
11691 return self.Prepend((0,0), prop)
11692 def InsertStretchSpacer(self, index, prop=1):
11693 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11694
11695 Insert a stretchable spacer."""
11696 return self.Insert(index, (0,0), prop)
11697
11698
11699 # for backwards compatibility only, please do not use in new code
11700 def AddWindow(self, *args, **kw):
11701 """Compatibility alias for `Add`."""
11702 return self.Add(*args, **kw)
11703 def AddSizer(self, *args, **kw):
11704 """Compatibility alias for `Add`."""
11705 return self.Add(*args, **kw)
11706
11707 def PrependWindow(self, *args, **kw):
11708 """Compatibility alias for `Prepend`."""
11709 return self.Prepend(*args, **kw)
11710 def PrependSizer(self, *args, **kw):
11711 """Compatibility alias for `Prepend`."""
11712 return self.Prepend(*args, **kw)
11713
11714 def InsertWindow(self, *args, **kw):
11715 """Compatibility alias for `Insert`."""
11716 return self.Insert(*args, **kw)
11717 def InsertSizer(self, *args, **kw):
11718 """Compatibility alias for `Insert`."""
11719 return self.Insert(*args, **kw)
11720
11721 def RemoveWindow(self, *args, **kw):
11722 """Compatibility alias for `Remove`."""
11723 return self.Remove(*args, **kw)
11724 def RemoveSizer(self, *args, **kw):
11725 """Compatibility alias for `Remove`."""
11726 return self.Remove(*args, **kw)
11727 def RemovePos(self, *args, **kw):
11728 """Compatibility alias for `Remove`."""
11729 return self.Remove(*args, **kw)
11730
11731
11732 def SetDimension(*args, **kwargs):
11733 """
11734 SetDimension(self, int x, int y, int width, int height)
11735
11736 Call this to force the sizer to take the given dimension and thus
11737 force the items owned by the sizer to resize themselves according to
11738 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11739 methods.
11740 """
11741 return _core_.Sizer_SetDimension(*args, **kwargs)
11742
11743 def SetMinSize(*args, **kwargs):
11744 """
11745 SetMinSize(self, Size size)
11746
11747 Call this to give the sizer a minimal size. Normally, the sizer will
11748 calculate its minimal size based purely on how much space its children
11749 need. After calling this method `GetMinSize` will return either the
11750 minimal size as requested by its children or the minimal size set
11751 here, depending on which is bigger.
11752 """
11753 return _core_.Sizer_SetMinSize(*args, **kwargs)
11754
11755 def GetSize(*args, **kwargs):
11756 """
11757 GetSize(self) -> Size
11758
11759 Returns the current size of the space managed by the sizer.
11760 """
11761 return _core_.Sizer_GetSize(*args, **kwargs)
11762
11763 def GetPosition(*args, **kwargs):
11764 """
11765 GetPosition(self) -> Point
11766
11767 Returns the current position of the sizer's managed space.
11768 """
11769 return _core_.Sizer_GetPosition(*args, **kwargs)
11770
11771 def GetMinSize(*args, **kwargs):
11772 """
11773 GetMinSize(self) -> Size
11774
11775 Returns the minimal size of the sizer. This is either the combined
11776 minimal size of all the children and their borders or the minimal size
11777 set by SetMinSize, depending on which is bigger.
11778 """
11779 return _core_.Sizer_GetMinSize(*args, **kwargs)
11780
11781 def GetSizeTuple(self):
11782 return self.GetSize().Get()
11783 def GetPositionTuple(self):
11784 return self.GetPosition().Get()
11785 def GetMinSizeTuple(self):
11786 return self.GetMinSize().Get()
11787
11788 def RecalcSizes(*args, **kwargs):
11789 """
11790 RecalcSizes(self)
11791
11792 Using the sizes calculated by `CalcMin` reposition and resize all the
11793 items managed by this sizer. You should not need to call this directly as
11794 it is called by `Layout`.
11795 """
11796 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11797
11798 def CalcMin(*args, **kwargs):
11799 """
11800 CalcMin(self) -> Size
11801
11802 This method is where the sizer will do the actual calculation of its
11803 children's minimal sizes. You should not need to call this directly as
11804 it is called by `Layout`.
11805 """
11806 return _core_.Sizer_CalcMin(*args, **kwargs)
11807
11808 def Layout(*args, **kwargs):
11809 """
11810 Layout(self)
11811
11812 This method will force the recalculation and layout of the items
11813 controlled by the sizer using the current space allocated to the
11814 sizer. Normally this is called automatically from the owning window's
11815 EVT_SIZE handler, but it is also useful to call it from user code when
11816 one of the items in a sizer change size, or items are added or
11817 removed.
11818 """
11819 return _core_.Sizer_Layout(*args, **kwargs)
11820
11821 def Fit(*args, **kwargs):
11822 """
11823 Fit(self, Window window) -> Size
11824
11825 Tell the sizer to resize the *window* to match the sizer's minimal
11826 size. This is commonly done in the constructor of the window itself in
11827 order to set its initial size to match the needs of the children as
11828 determined by the sizer. Returns the new size.
11829
11830 For a top level window this is the total window size, not the client size.
11831 """
11832 return _core_.Sizer_Fit(*args, **kwargs)
11833
11834 def FitInside(*args, **kwargs):
11835 """
11836 FitInside(self, Window window)
11837
11838 Tell the sizer to resize the *virtual size* of the *window* to match the
11839 sizer's minimal size. This will not alter the on screen size of the
11840 window, but may cause the addition/removal/alteration of scrollbars
11841 required to view the virtual area in windows which manage it.
11842
11843 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11844
11845 """
11846 return _core_.Sizer_FitInside(*args, **kwargs)
11847
11848 def SetSizeHints(*args, **kwargs):
11849 """
11850 SetSizeHints(self, Window window)
11851
11852 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11853 match the sizer's minimal size. This is commonly done in the
11854 constructor of the window itself if the window is resizable (as are
11855 many dialogs under Unix and frames on probably all platforms) in order
11856 to prevent the window from being sized smaller than the minimal size
11857 required by the sizer.
11858 """
11859 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11860
11861 def SetVirtualSizeHints(*args, **kwargs):
11862 """
11863 SetVirtualSizeHints(self, Window window)
11864
11865 Tell the sizer to set the minimal size of the window virtual area to
11866 match the sizer's minimal size. For windows with managed scrollbars
11867 this will set them appropriately.
11868
11869 :see: `wx.ScrolledWindow.SetScrollbars`
11870
11871 """
11872 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11873
11874 def Clear(*args, **kwargs):
11875 """
11876 Clear(self, bool deleteWindows=False)
11877
11878 Clear all items from the sizer, optionally destroying the window items
11879 as well.
11880 """
11881 return _core_.Sizer_Clear(*args, **kwargs)
11882
11883 def DeleteWindows(*args, **kwargs):
11884 """
11885 DeleteWindows(self)
11886
11887 Destroy all windows managed by the sizer.
11888 """
11889 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11890
11891 def GetChildren(*args, **kwargs):
11892 """
11893 GetChildren(self) -> list
11894
11895 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11896 """
11897 return _core_.Sizer_GetChildren(*args, **kwargs)
11898
11899 def Show(*args, **kwargs):
11900 """
11901 Show(self, item, bool show=True, bool recursive=false) -> bool
11902
11903 Shows or hides an item managed by the sizer. To make a sizer item
11904 disappear or reappear, use Show followed by `Layout`. The *item*
11905 parameter can be either a window, a sizer, or the zero-based index of
11906 the item. Use the recursive parameter to show or hide an item in a
11907 subsizer. Returns True if the item was found.
11908 """
11909 return _core_.Sizer_Show(*args, **kwargs)
11910
11911 def IsShown(*args, **kwargs):
11912 """
11913 IsShown(self, item)
11914
11915 Determines if the item is currently shown. To make a sizer
11916 item disappear or reappear, use Show followed by `Layout`. The *item*
11917 parameter can be either a window, a sizer, or the zero-based index of
11918 the item.
11919 """
11920 return _core_.Sizer_IsShown(*args, **kwargs)
11921
11922 def Hide(self, item, recursive=False):
11923 """
11924 A convenience method for `Show` (item, False, recursive).
11925 """
11926 return self.Show(item, False, recursive)
11927
11928 def ShowItems(*args, **kwargs):
11929 """
11930 ShowItems(self, bool show)
11931
11932 Recursively call `wx.SizerItem.Show` on all sizer items.
11933 """
11934 return _core_.Sizer_ShowItems(*args, **kwargs)
11935
11936 _core_.Sizer_swigregister(Sizer)
11937
11938 class PySizer(Sizer):
11939 """
11940 wx.PySizer is a special version of `wx.Sizer` that has been
11941 instrumented to allow the C++ virtual methods to be overloaded in
11942 Python derived classes. You would derive from this class if you are
11943 wanting to implement a custom sizer in Python code. Simply implement
11944 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11945 For example::
11946
11947 class MySizer(wx.PySizer):
11948 def __init__(self):
11949 wx.PySizer.__init__(self)
11950
11951 def CalcMin(self):
11952 for item in self.GetChildren():
11953 # calculate the total minimum width and height needed
11954 # by all items in the sizer according to this sizer's
11955 # layout algorithm.
11956 ...
11957 return wx.Size(width, height)
11958
11959 def RecalcSizes(self):
11960 # find the space allotted to this sizer
11961 pos = self.GetPosition()
11962 size = self.GetSize()
11963 for item in self.GetChildren():
11964 # Recalculate (if necessary) the position and size of
11965 # each item and then call item.SetDimension to do the
11966 # actual positioning and sizing of the items within the
11967 # space alloted to this sizer.
11968 ...
11969 item.SetDimension(itemPos, itemSize)
11970
11971
11972 When `Layout` is called it first calls `CalcMin` followed by
11973 `RecalcSizes` so you can optimize a bit by saving the results of
11974 `CalcMin` and reusing them in `RecalcSizes`.
11975
11976 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11977
11978
11979 """
11980 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11981 __repr__ = _swig_repr
11982 def __init__(self, *args, **kwargs):
11983 """
11984 __init__(self) -> PySizer
11985
11986 Creates a wx.PySizer. Must be called from the __init__ in the derived
11987 class.
11988 """
11989 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11990 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11991
11992 def _setCallbackInfo(*args, **kwargs):
11993 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11994 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11995
11996 _core_.PySizer_swigregister(PySizer)
11997
11998 #---------------------------------------------------------------------------
11999
12000 class BoxSizer(Sizer):
12001 """
12002 The basic idea behind a box sizer is that windows will most often be
12003 laid out in rather simple basic geometry, typically in a row or a
12004 column or nested hierarchies of either. A wx.BoxSizer will lay out
12005 its items in a simple row or column, depending on the orientation
12006 parameter passed to the constructor.
12007 """
12008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12009 __repr__ = _swig_repr
12010 def __init__(self, *args, **kwargs):
12011 """
12012 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12013
12014 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12015 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12016 sizer.
12017 """
12018 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12019 self._setOORInfo(self)
12020
12021 def GetOrientation(*args, **kwargs):
12022 """
12023 GetOrientation(self) -> int
12024
12025 Returns the current orientation of the sizer.
12026 """
12027 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12028
12029 def SetOrientation(*args, **kwargs):
12030 """
12031 SetOrientation(self, int orient)
12032
12033 Resets the orientation of the sizer.
12034 """
12035 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12036
12037 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12038 _core_.BoxSizer_swigregister(BoxSizer)
12039
12040 #---------------------------------------------------------------------------
12041
12042 class StaticBoxSizer(BoxSizer):
12043 """
12044 wx.StaticBoxSizer derives from and functions identically to the
12045 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12046 manages. Note that this static box must be created separately and
12047 passed to the sizer constructor.
12048 """
12049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12050 __repr__ = _swig_repr
12051 def __init__(self, *args, **kwargs):
12052 """
12053 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12054
12055 Constructor. It takes an associated static box and the orientation
12056 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12057 ``wx.HORIZONTAL``.
12058 """
12059 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12060 self._setOORInfo(self)
12061
12062 def GetStaticBox(*args, **kwargs):
12063 """
12064 GetStaticBox(self) -> StaticBox
12065
12066 Returns the static box associated with this sizer.
12067 """
12068 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12069
12070 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12071
12072 #---------------------------------------------------------------------------
12073
12074 class GridSizer(Sizer):
12075 """
12076 A grid sizer is a sizer which lays out its children in a
12077 two-dimensional table with all cells having the same size. In other
12078 words, the width of each cell within the grid is the width of the
12079 widest item added to the sizer and the height of each grid cell is the
12080 height of the tallest item. An optional vertical and/or horizontal
12081 gap between items can also be specified (in pixels.)
12082
12083 Items are placed in the cells of the grid in the order they are added,
12084 in row-major order. In other words, the first row is filled first,
12085 then the second, and so on until all items have been added. (If
12086 neccessary, additional rows will be added as items are added.) If you
12087 need to have greater control over the cells that items are placed in
12088 then use the `wx.GridBagSizer`.
12089
12090 """
12091 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12092 __repr__ = _swig_repr
12093 def __init__(self, *args, **kwargs):
12094 """
12095 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12096
12097 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12098 of columns and rows in the sizer - if either of the parameters is
12099 zero, it will be calculated to from the total number of children in
12100 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12101 define extra space between all children.
12102 """
12103 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
12104 self._setOORInfo(self)
12105
12106 def SetCols(*args, **kwargs):
12107 """
12108 SetCols(self, int cols)
12109
12110 Sets the number of columns in the sizer.
12111 """
12112 return _core_.GridSizer_SetCols(*args, **kwargs)
12113
12114 def SetRows(*args, **kwargs):
12115 """
12116 SetRows(self, int rows)
12117
12118 Sets the number of rows in the sizer.
12119 """
12120 return _core_.GridSizer_SetRows(*args, **kwargs)
12121
12122 def SetVGap(*args, **kwargs):
12123 """
12124 SetVGap(self, int gap)
12125
12126 Sets the vertical gap (in pixels) between the cells in the sizer.
12127 """
12128 return _core_.GridSizer_SetVGap(*args, **kwargs)
12129
12130 def SetHGap(*args, **kwargs):
12131 """
12132 SetHGap(self, int gap)
12133
12134 Sets the horizontal gap (in pixels) between cells in the sizer
12135 """
12136 return _core_.GridSizer_SetHGap(*args, **kwargs)
12137
12138 def GetCols(*args, **kwargs):
12139 """
12140 GetCols(self) -> int
12141
12142 Returns the number of columns in the sizer.
12143 """
12144 return _core_.GridSizer_GetCols(*args, **kwargs)
12145
12146 def GetRows(*args, **kwargs):
12147 """
12148 GetRows(self) -> int
12149
12150 Returns the number of rows in the sizer.
12151 """
12152 return _core_.GridSizer_GetRows(*args, **kwargs)
12153
12154 def GetVGap(*args, **kwargs):
12155 """
12156 GetVGap(self) -> int
12157
12158 Returns the vertical gap (in pixels) between the cells in the sizer.
12159 """
12160 return _core_.GridSizer_GetVGap(*args, **kwargs)
12161
12162 def GetHGap(*args, **kwargs):
12163 """
12164 GetHGap(self) -> int
12165
12166 Returns the horizontal gap (in pixels) between cells in the sizer.
12167 """
12168 return _core_.GridSizer_GetHGap(*args, **kwargs)
12169
12170 def CalcRowsCols(self):
12171 """
12172 CalcRowsCols() -> (rows, cols)
12173
12174 Calculates how many rows and columns will be in the sizer based
12175 on the current number of items and also the rows, cols specified
12176 in the constructor.
12177 """
12178 nitems = len(self.GetChildren())
12179 rows = self.GetRows()
12180 cols = self.GetCols()
12181 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12182 if cols != 0:
12183 rows = (nitems + cols - 1) / cols
12184 elif rows != 0:
12185 cols = (nitems + rows - 1) / rows
12186 return (rows, cols)
12187
12188 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12189 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12190 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12191 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
12192 _core_.GridSizer_swigregister(GridSizer)
12193
12194 #---------------------------------------------------------------------------
12195
12196 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12197 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12198 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12199 class FlexGridSizer(GridSizer):
12200 """
12201 A flex grid sizer is a sizer which lays out its children in a
12202 two-dimensional table with all table cells in one row having the same
12203 height and all cells in one column having the same width, but all
12204 rows or all columns are not necessarily the same height or width as in
12205 the `wx.GridSizer`.
12206
12207 wx.FlexGridSizer can also size items equally in one direction but
12208 unequally ("flexibly") in the other. If the sizer is only flexible
12209 in one direction (this can be changed using `SetFlexibleDirection`), it
12210 needs to be decided how the sizer should grow in the other ("non
12211 flexible") direction in order to fill the available space. The
12212 `SetNonFlexibleGrowMode` method serves this purpose.
12213
12214
12215 """
12216 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12217 __repr__ = _swig_repr
12218 def __init__(self, *args, **kwargs):
12219 """
12220 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12221
12222 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12223 number of columns and rows in the sizer - if either of the parameters
12224 is zero, it will be calculated to from the total number of children in
12225 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12226 define extra space between all children.
12227 """
12228 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
12229 self._setOORInfo(self)
12230
12231 def AddGrowableRow(*args, **kwargs):
12232 """
12233 AddGrowableRow(self, size_t idx, int proportion=0)
12234
12235 Specifies that row *idx* (starting from zero) should be grown if there
12236 is extra space available to the sizer.
12237
12238 The *proportion* parameter has the same meaning as the stretch factor
12239 for the box sizers except that if all proportions are 0, then all
12240 columns are resized equally (instead of not being resized at all).
12241 """
12242 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12243
12244 def RemoveGrowableRow(*args, **kwargs):
12245 """
12246 RemoveGrowableRow(self, size_t idx)
12247
12248 Specifies that row *idx* is no longer growable.
12249 """
12250 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12251
12252 def AddGrowableCol(*args, **kwargs):
12253 """
12254 AddGrowableCol(self, size_t idx, int proportion=0)
12255
12256 Specifies that column *idx* (starting from zero) should be grown if
12257 there is extra space available to the sizer.
12258
12259 The *proportion* parameter has the same meaning as the stretch factor
12260 for the box sizers except that if all proportions are 0, then all
12261 columns are resized equally (instead of not being resized at all).
12262 """
12263 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12264
12265 def RemoveGrowableCol(*args, **kwargs):
12266 """
12267 RemoveGrowableCol(self, size_t idx)
12268
12269 Specifies that column *idx* is no longer growable.
12270 """
12271 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12272
12273 def SetFlexibleDirection(*args, **kwargs):
12274 """
12275 SetFlexibleDirection(self, int direction)
12276
12277 Specifies whether the sizer should flexibly resize its columns, rows,
12278 or both. Argument *direction* can be one of the following values. Any
12279 other value is ignored.
12280
12281 ============== =======================================
12282 wx.VERTICAL Rows are flexibly sized.
12283 wx.HORIZONTAL Columns are flexibly sized.
12284 wx.BOTH Both rows and columns are flexibly sized
12285 (this is the default value).
12286 ============== =======================================
12287
12288 Note that this method does not trigger relayout.
12289
12290 """
12291 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12292
12293 def GetFlexibleDirection(*args, **kwargs):
12294 """
12295 GetFlexibleDirection(self) -> int
12296
12297 Returns a value that specifies whether the sizer
12298 flexibly resizes its columns, rows, or both (default).
12299
12300 :see: `SetFlexibleDirection`
12301 """
12302 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12303
12304 def SetNonFlexibleGrowMode(*args, **kwargs):
12305 """
12306 SetNonFlexibleGrowMode(self, int mode)
12307
12308 Specifies how the sizer should grow in the non-flexible direction if
12309 there is one (so `SetFlexibleDirection` must have been called
12310 previously). Argument *mode* can be one of the following values:
12311
12312 ========================== =================================================
12313 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12314 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12315 `AddGrowableCol` and `AddGrowableRow`. In this
12316 case equal sizing applies to minimum sizes of
12317 columns or rows (this is the default value).
12318 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12319 the non flexible direction, whether they are
12320 growable or not in the flexbile direction.
12321 ========================== =================================================
12322
12323 Note that this method does not trigger relayout.
12324 """
12325 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12326
12327 def GetNonFlexibleGrowMode(*args, **kwargs):
12328 """
12329 GetNonFlexibleGrowMode(self) -> int
12330
12331 Returns the value that specifies how the sizer grows in the
12332 non-flexible direction if there is one.
12333
12334 :see: `SetNonFlexibleGrowMode`
12335 """
12336 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12337
12338 def GetRowHeights(*args, **kwargs):
12339 """
12340 GetRowHeights(self) -> list
12341
12342 Returns a list of integers representing the heights of each of the
12343 rows in the sizer.
12344 """
12345 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12346
12347 def GetColWidths(*args, **kwargs):
12348 """
12349 GetColWidths(self) -> list
12350
12351 Returns a list of integers representing the widths of each of the
12352 columns in the sizer.
12353 """
12354 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12355
12356 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12357 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12358 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12359 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
12360 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12361
12362 class StdDialogButtonSizer(BoxSizer):
12363 """
12364 A special sizer that knows how to order and position standard buttons
12365 in order to conform to the current platform's standards. You simply
12366 need to add each `wx.Button` to the sizer, and be sure to create the
12367 buttons using the standard ID's. Then call `Realize` and the sizer
12368 will take care of the rest.
12369
12370 """
12371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12372 __repr__ = _swig_repr
12373 def __init__(self, *args, **kwargs):
12374 """__init__(self) -> StdDialogButtonSizer"""
12375 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12376 def AddButton(*args, **kwargs):
12377 """
12378 AddButton(self, wxButton button)
12379
12380 Use this to add the buttons to this sizer. Do not use the `Add`
12381 method in the base class.
12382 """
12383 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12384
12385 def Realize(*args, **kwargs):
12386 """
12387 Realize(self)
12388
12389 This funciton needs to be called after all the buttons have been added
12390 to the sizer. It will reorder them and position them in a platform
12391 specifc manner.
12392 """
12393 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12394
12395 def SetAffirmativeButton(*args, **kwargs):
12396 """SetAffirmativeButton(self, wxButton button)"""
12397 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12398
12399 def SetNegativeButton(*args, **kwargs):
12400 """SetNegativeButton(self, wxButton button)"""
12401 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12402
12403 def SetCancelButton(*args, **kwargs):
12404 """SetCancelButton(self, wxButton button)"""
12405 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12406
12407 def GetAffirmativeButton(*args, **kwargs):
12408 """GetAffirmativeButton(self) -> wxButton"""
12409 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12410
12411 def GetApplyButton(*args, **kwargs):
12412 """GetApplyButton(self) -> wxButton"""
12413 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12414
12415 def GetNegativeButton(*args, **kwargs):
12416 """GetNegativeButton(self) -> wxButton"""
12417 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12418
12419 def GetCancelButton(*args, **kwargs):
12420 """GetCancelButton(self) -> wxButton"""
12421 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12422
12423 def GetHelpButton(*args, **kwargs):
12424 """GetHelpButton(self) -> wxButton"""
12425 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12426
12427 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12428
12429 #---------------------------------------------------------------------------
12430
12431 class GBPosition(object):
12432 """
12433 This class represents the position of an item in a virtual grid of
12434 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12435 typemaps that will automatically convert from a 2-element sequence of
12436 integers to a wx.GBPosition, so you can use the more pythonic
12437 representation of the position nearly transparently in Python code.
12438 """
12439 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12440 __repr__ = _swig_repr
12441 def __init__(self, *args, **kwargs):
12442 """
12443 __init__(self, int row=0, int col=0) -> GBPosition
12444
12445 This class represents the position of an item in a virtual grid of
12446 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12447 typemaps that will automatically convert from a 2-element sequence of
12448 integers to a wx.GBPosition, so you can use the more pythonic
12449 representation of the position nearly transparently in Python code.
12450 """
12451 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12452 __swig_destroy__ = _core_.delete_GBPosition
12453 __del__ = lambda self : None;
12454 def GetRow(*args, **kwargs):
12455 """GetRow(self) -> int"""
12456 return _core_.GBPosition_GetRow(*args, **kwargs)
12457
12458 def GetCol(*args, **kwargs):
12459 """GetCol(self) -> int"""
12460 return _core_.GBPosition_GetCol(*args, **kwargs)
12461
12462 def SetRow(*args, **kwargs):
12463 """SetRow(self, int row)"""
12464 return _core_.GBPosition_SetRow(*args, **kwargs)
12465
12466 def SetCol(*args, **kwargs):
12467 """SetCol(self, int col)"""
12468 return _core_.GBPosition_SetCol(*args, **kwargs)
12469
12470 def __eq__(*args, **kwargs):
12471 """
12472 __eq__(self, PyObject other) -> bool
12473
12474 Compare GBPosition for equality.
12475 """
12476 return _core_.GBPosition___eq__(*args, **kwargs)
12477
12478 def __ne__(*args, **kwargs):
12479 """
12480 __ne__(self, PyObject other) -> bool
12481
12482 Compare GBPosition for inequality.
12483 """
12484 return _core_.GBPosition___ne__(*args, **kwargs)
12485
12486 def Set(*args, **kwargs):
12487 """Set(self, int row=0, int col=0)"""
12488 return _core_.GBPosition_Set(*args, **kwargs)
12489
12490 def Get(*args, **kwargs):
12491 """Get(self) -> PyObject"""
12492 return _core_.GBPosition_Get(*args, **kwargs)
12493
12494 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12495 def __str__(self): return str(self.Get())
12496 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12497 def __len__(self): return len(self.Get())
12498 def __getitem__(self, index): return self.Get()[index]
12499 def __setitem__(self, index, val):
12500 if index == 0: self.SetRow(val)
12501 elif index == 1: self.SetCol(val)
12502 else: raise IndexError
12503 def __nonzero__(self): return self.Get() != (0,0)
12504 __safe_for_unpickling__ = True
12505 def __reduce__(self): return (wx.GBPosition, self.Get())
12506
12507 row = property(GetRow, SetRow)
12508 col = property(GetCol, SetCol)
12509
12510 _core_.GBPosition_swigregister(GBPosition)
12511
12512 class GBSpan(object):
12513 """
12514 This class is used to hold the row and column spanning attributes of
12515 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12516 automatically convert from a 2-element sequence of integers to a
12517 wx.GBSpan, so you can use the more pythonic representation of the span
12518 nearly transparently in Python code.
12519
12520 """
12521 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12522 __repr__ = _swig_repr
12523 def __init__(self, *args, **kwargs):
12524 """
12525 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12526
12527 Construct a new wxGBSpan, optionally setting the rowspan and
12528 colspan. The default is (1,1). (Meaning that the item occupies one
12529 cell in each direction.
12530 """
12531 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12532 __swig_destroy__ = _core_.delete_GBSpan
12533 __del__ = lambda self : None;
12534 def GetRowspan(*args, **kwargs):
12535 """GetRowspan(self) -> int"""
12536 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12537
12538 def GetColspan(*args, **kwargs):
12539 """GetColspan(self) -> int"""
12540 return _core_.GBSpan_GetColspan(*args, **kwargs)
12541
12542 def SetRowspan(*args, **kwargs):
12543 """SetRowspan(self, int rowspan)"""
12544 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12545
12546 def SetColspan(*args, **kwargs):
12547 """SetColspan(self, int colspan)"""
12548 return _core_.GBSpan_SetColspan(*args, **kwargs)
12549
12550 def __eq__(*args, **kwargs):
12551 """
12552 __eq__(self, PyObject other) -> bool
12553
12554 Compare wxGBSpan for equality.
12555 """
12556 return _core_.GBSpan___eq__(*args, **kwargs)
12557
12558 def __ne__(*args, **kwargs):
12559 """
12560 __ne__(self, PyObject other) -> bool
12561
12562 Compare GBSpan for inequality.
12563 """
12564 return _core_.GBSpan___ne__(*args, **kwargs)
12565
12566 def Set(*args, **kwargs):
12567 """Set(self, int rowspan=1, int colspan=1)"""
12568 return _core_.GBSpan_Set(*args, **kwargs)
12569
12570 def Get(*args, **kwargs):
12571 """Get(self) -> PyObject"""
12572 return _core_.GBSpan_Get(*args, **kwargs)
12573
12574 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12575 def __str__(self): return str(self.Get())
12576 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12577 def __len__(self): return len(self.Get())
12578 def __getitem__(self, index): return self.Get()[index]
12579 def __setitem__(self, index, val):
12580 if index == 0: self.SetRowspan(val)
12581 elif index == 1: self.SetColspan(val)
12582 else: raise IndexError
12583 def __nonzero__(self): return self.Get() != (0,0)
12584 __safe_for_unpickling__ = True
12585 def __reduce__(self): return (wx.GBSpan, self.Get())
12586
12587 rowspan = property(GetRowspan, SetRowspan)
12588 colspan = property(GetColspan, SetColspan)
12589
12590 _core_.GBSpan_swigregister(GBSpan)
12591
12592 class GBSizerItem(SizerItem):
12593 """
12594 The wx.GBSizerItem class is used to track the additional data about
12595 items in a `wx.GridBagSizer` such as the item's position in the grid
12596 and how many rows or columns it spans.
12597
12598 """
12599 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12600 __repr__ = _swig_repr
12601 def __init__(self, *args, **kwargs):
12602 """
12603 __init__(self) -> GBSizerItem
12604
12605 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12606 size will need to be set, as well as a position and span before this
12607 item can be used in a Sizer.
12608
12609 You will probably never need to create a wx.GBSizerItem directly as they
12610 are created automatically when the sizer's Add method is called.
12611 """
12612 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12613 __swig_destroy__ = _core_.delete_GBSizerItem
12614 __del__ = lambda self : None;
12615 def GetPos(*args, **kwargs):
12616 """
12617 GetPos(self) -> GBPosition
12618
12619 Get the grid position of the item
12620 """
12621 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12622
12623 def GetPosTuple(self): return self.GetPos().Get()
12624 def GetSpan(*args, **kwargs):
12625 """
12626 GetSpan(self) -> GBSpan
12627
12628 Get the row and column spanning of the item
12629 """
12630 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12631
12632 def GetSpanTuple(self): return self.GetSpan().Get()
12633 def SetPos(*args, **kwargs):
12634 """
12635 SetPos(self, GBPosition pos) -> bool
12636
12637 If the item is already a member of a sizer then first ensure that
12638 there is no other item that would intersect with this one at the new
12639 position, then set the new position. Returns True if the change is
12640 successful and after the next Layout() the item will be moved.
12641 """
12642 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12643
12644 def SetSpan(*args, **kwargs):
12645 """
12646 SetSpan(self, GBSpan span) -> bool
12647
12648 If the item is already a member of a sizer then first ensure that
12649 there is no other item that would intersect with this one with its new
12650 spanning size, then set the new spanning. Returns True if the change
12651 is successful and after the next Layout() the item will be resized.
12652
12653 """
12654 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12655
12656 def Intersects(*args, **kwargs):
12657 """
12658 Intersects(self, GBSizerItem other) -> bool
12659
12660 Returns True if this item and the other item instersect.
12661 """
12662 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12663
12664 def IntersectsPos(*args, **kwargs):
12665 """
12666 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12667
12668 Returns True if the given pos/span would intersect with this item.
12669 """
12670 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12671
12672 def GetEndPos(*args, **kwargs):
12673 """
12674 GetEndPos(self) -> GBPosition
12675
12676 Get the row and column of the endpoint of this item.
12677 """
12678 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12679
12680 def GetGBSizer(*args, **kwargs):
12681 """
12682 GetGBSizer(self) -> GridBagSizer
12683
12684 Get the sizer this item is a member of.
12685 """
12686 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12687
12688 def SetGBSizer(*args, **kwargs):
12689 """
12690 SetGBSizer(self, GridBagSizer sizer)
12691
12692 Set the sizer this item is a member of.
12693 """
12694 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12695
12696 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12697 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12698 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12699 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
12700 _core_.GBSizerItem_swigregister(GBSizerItem)
12701 DefaultSpan = cvar.DefaultSpan
12702
12703 def GBSizerItemWindow(*args, **kwargs):
12704 """
12705 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12706 int border, PyObject userData=None) -> GBSizerItem
12707
12708 Construct a `wx.GBSizerItem` for a window.
12709 """
12710 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12711 return val
12712
12713 def GBSizerItemSizer(*args, **kwargs):
12714 """
12715 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12716 int border, PyObject userData=None) -> GBSizerItem
12717
12718 Construct a `wx.GBSizerItem` for a sizer
12719 """
12720 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12721 return val
12722
12723 def GBSizerItemSpacer(*args, **kwargs):
12724 """
12725 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12726 int flag, int border, PyObject userData=None) -> GBSizerItem
12727
12728 Construct a `wx.GBSizerItem` for a spacer.
12729 """
12730 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12731 return val
12732
12733 class GridBagSizer(FlexGridSizer):
12734 """
12735 A `wx.Sizer` that can lay out items in a virtual grid like a
12736 `wx.FlexGridSizer` but in this case explicit positioning of the items
12737 is allowed using `wx.GBPosition`, and items can optionally span more
12738 than one row and/or column using `wx.GBSpan`. The total size of the
12739 virtual grid is determined by the largest row and column that items are
12740 positioned at, adjusted for spanning.
12741
12742 """
12743 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12744 __repr__ = _swig_repr
12745 def __init__(self, *args, **kwargs):
12746 """
12747 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12748
12749 Constructor, with optional parameters to specify the gap between the
12750 rows and columns.
12751 """
12752 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12753 self._setOORInfo(self)
12754
12755 def Add(*args, **kwargs):
12756 """
12757 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12758 int border=0, userData=None) -> wx.GBSizerItem
12759
12760 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12761 more than one row or column as specified with *span*. The remaining
12762 args behave similarly to `wx.Sizer.Add`.
12763
12764 Returns True if the item was successfully placed at the given cell
12765 position, False if something was already there.
12766
12767 """
12768 return _core_.GridBagSizer_Add(*args, **kwargs)
12769
12770 def AddItem(*args, **kwargs):
12771 """
12772 Add(self, GBSizerItem item) -> wx.GBSizerItem
12773
12774 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12775 the item was successfully placed at its given cell position, False if
12776 something was already there.
12777 """
12778 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12779
12780 def GetCellSize(*args, **kwargs):
12781 """
12782 GetCellSize(self, int row, int col) -> Size
12783
12784 Get the size of the specified cell, including hgap and
12785 vgap. Only valid after a Layout.
12786 """
12787 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12788
12789 def GetEmptyCellSize(*args, **kwargs):
12790 """
12791 GetEmptyCellSize(self) -> Size
12792
12793 Get the size used for cells in the grid with no item.
12794 """
12795 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12796
12797 def SetEmptyCellSize(*args, **kwargs):
12798 """
12799 SetEmptyCellSize(self, Size sz)
12800
12801 Set the size used for cells in the grid with no item.
12802 """
12803 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12804
12805 def GetItemPosition(*args):
12806 """
12807 GetItemPosition(self, item) -> GBPosition
12808
12809 Get the grid position of the specified *item* where *item* is either a
12810 window or subsizer that is a member of this sizer, or a zero-based
12811 index of an item.
12812 """
12813 return _core_.GridBagSizer_GetItemPosition(*args)
12814
12815 def SetItemPosition(*args):
12816 """
12817 SetItemPosition(self, item, GBPosition pos) -> bool
12818
12819 Set the grid position of the specified *item* where *item* is either a
12820 window or subsizer that is a member of this sizer, or a zero-based
12821 index of an item. Returns True on success. If the move is not
12822 allowed (because an item is already there) then False is returned.
12823
12824 """
12825 return _core_.GridBagSizer_SetItemPosition(*args)
12826
12827 def GetItemSpan(*args):
12828 """
12829 GetItemSpan(self, item) -> GBSpan
12830
12831 Get the row/col spanning of the specified *item* where *item* is
12832 either a window or subsizer that is a member of this sizer, or a
12833 zero-based index of an item.
12834 """
12835 return _core_.GridBagSizer_GetItemSpan(*args)
12836
12837 def SetItemSpan(*args):
12838 """
12839 SetItemSpan(self, item, GBSpan span) -> bool
12840
12841 Set the row/col spanning of the specified *item* where *item* is
12842 either a window or subsizer that is a member of this sizer, or a
12843 zero-based index of an item. Returns True on success. If the move is
12844 not allowed (because an item is already there) then False is returned.
12845 """
12846 return _core_.GridBagSizer_SetItemSpan(*args)
12847
12848 def FindItem(*args):
12849 """
12850 FindItem(self, item) -> GBSizerItem
12851
12852 Find the sizer item for the given window or subsizer, returns None if
12853 not found. (non-recursive)
12854 """
12855 return _core_.GridBagSizer_FindItem(*args)
12856
12857 def FindItemAtPosition(*args, **kwargs):
12858 """
12859 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12860
12861 Return the sizer item for the given grid cell, or None if there is no
12862 item at that position. (non-recursive)
12863 """
12864 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12865
12866 def FindItemAtPoint(*args, **kwargs):
12867 """
12868 FindItemAtPoint(self, Point pt) -> GBSizerItem
12869
12870 Return the sizer item located at the point given in *pt*, or None if
12871 there is no item at that point. The (x,y) coordinates in pt correspond
12872 to the client coordinates of the window using the sizer for
12873 layout. (non-recursive)
12874 """
12875 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12876
12877 def CheckForIntersection(*args, **kwargs):
12878 """
12879 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12880
12881 Look at all items and see if any intersect (or would overlap) the
12882 given *item*. Returns True if so, False if there would be no overlap.
12883 If an *excludeItem* is given then it will not be checked for
12884 intersection, for example it may be the item we are checking the
12885 position of.
12886
12887 """
12888 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12889
12890 def CheckForIntersectionPos(*args, **kwargs):
12891 """
12892 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12893
12894 Look at all items and see if any intersect (or would overlap) the
12895 given position and span. Returns True if so, False if there would be
12896 no overlap. If an *excludeItem* is given then it will not be checked
12897 for intersection, for example it may be the item we are checking the
12898 position of.
12899 """
12900 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12901
12902 _core_.GridBagSizer_swigregister(GridBagSizer)
12903
12904 #---------------------------------------------------------------------------
12905
12906 Left = _core_.Left
12907 Top = _core_.Top
12908 Right = _core_.Right
12909 Bottom = _core_.Bottom
12910 Width = _core_.Width
12911 Height = _core_.Height
12912 Centre = _core_.Centre
12913 Center = _core_.Center
12914 CentreX = _core_.CentreX
12915 CentreY = _core_.CentreY
12916 Unconstrained = _core_.Unconstrained
12917 AsIs = _core_.AsIs
12918 PercentOf = _core_.PercentOf
12919 Above = _core_.Above
12920 Below = _core_.Below
12921 LeftOf = _core_.LeftOf
12922 RightOf = _core_.RightOf
12923 SameAs = _core_.SameAs
12924 Absolute = _core_.Absolute
12925 class IndividualLayoutConstraint(Object):
12926 """
12927 Objects of this class are stored in the `wx.LayoutConstraints` class as
12928 one of eight possible constraints that a window can be involved in.
12929 You will never need to create an instance of
12930 wx.IndividualLayoutConstraint, rather you should create a
12931 `wx.LayoutConstraints` instance and use the individual contstraints
12932 that it contains.
12933 """
12934 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12935 def __init__(self): raise AttributeError, "No constructor defined"
12936 __repr__ = _swig_repr
12937 def Set(*args, **kwargs):
12938 """
12939 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12940
12941 Sets the properties of the constraint. Normally called by one of the
12942 convenience functions such as Above, RightOf, SameAs.
12943 """
12944 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12945
12946 def LeftOf(*args, **kwargs):
12947 """
12948 LeftOf(self, Window sibling, int marg=0)
12949
12950 Constrains this edge to be to the left of the given window, with an
12951 optional margin. Implicitly, this is relative to the left edge of the
12952 other window.
12953 """
12954 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12955
12956 def RightOf(*args, **kwargs):
12957 """
12958 RightOf(self, Window sibling, int marg=0)
12959
12960 Constrains this edge to be to the right of the given window, with an
12961 optional margin. Implicitly, this is relative to the right edge of the
12962 other window.
12963 """
12964 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12965
12966 def Above(*args, **kwargs):
12967 """
12968 Above(self, Window sibling, int marg=0)
12969
12970 Constrains this edge to be above the given window, with an optional
12971 margin. Implicitly, this is relative to the top edge of the other
12972 window.
12973 """
12974 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12975
12976 def Below(*args, **kwargs):
12977 """
12978 Below(self, Window sibling, int marg=0)
12979
12980 Constrains this edge to be below the given window, with an optional
12981 margin. Implicitly, this is relative to the bottom edge of the other
12982 window.
12983 """
12984 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12985
12986 def SameAs(*args, **kwargs):
12987 """
12988 SameAs(self, Window otherW, int edge, int marg=0)
12989
12990 Constrains this edge or dimension to be to the same as the edge of the
12991 given window, with an optional margin.
12992 """
12993 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12994
12995 def PercentOf(*args, **kwargs):
12996 """
12997 PercentOf(self, Window otherW, int wh, int per)
12998
12999 Constrains this edge or dimension to be to a percentage of the given
13000 window, with an optional margin.
13001 """
13002 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13003
13004 def Absolute(*args, **kwargs):
13005 """
13006 Absolute(self, int val)
13007
13008 Constrains this edge or dimension to be the given absolute value.
13009 """
13010 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13011
13012 def Unconstrained(*args, **kwargs):
13013 """
13014 Unconstrained(self)
13015
13016 Sets this edge or dimension to be unconstrained, that is, dependent on
13017 other edges and dimensions from which this value can be deduced.
13018 """
13019 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13020
13021 def AsIs(*args, **kwargs):
13022 """
13023 AsIs(self)
13024
13025 Sets this edge or constraint to be whatever the window's value is at
13026 the moment. If either of the width and height constraints are *as is*,
13027 the window will not be resized, but moved instead. This is important
13028 when considering panel items which are intended to have a default
13029 size, such as a button, which may take its size from the size of the
13030 button label.
13031 """
13032 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13033
13034 def GetOtherWindow(*args, **kwargs):
13035 """GetOtherWindow(self) -> Window"""
13036 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13037
13038 def GetMyEdge(*args, **kwargs):
13039 """GetMyEdge(self) -> int"""
13040 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13041
13042 def SetEdge(*args, **kwargs):
13043 """SetEdge(self, int which)"""
13044 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13045
13046 def SetValue(*args, **kwargs):
13047 """SetValue(self, int v)"""
13048 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13049
13050 def GetMargin(*args, **kwargs):
13051 """GetMargin(self) -> int"""
13052 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13053
13054 def SetMargin(*args, **kwargs):
13055 """SetMargin(self, int m)"""
13056 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13057
13058 def GetValue(*args, **kwargs):
13059 """GetValue(self) -> int"""
13060 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13061
13062 def GetPercent(*args, **kwargs):
13063 """GetPercent(self) -> int"""
13064 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13065
13066 def GetOtherEdge(*args, **kwargs):
13067 """GetOtherEdge(self) -> int"""
13068 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13069
13070 def GetDone(*args, **kwargs):
13071 """GetDone(self) -> bool"""
13072 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13073
13074 def SetDone(*args, **kwargs):
13075 """SetDone(self, bool d)"""
13076 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13077
13078 def GetRelationship(*args, **kwargs):
13079 """GetRelationship(self) -> int"""
13080 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13081
13082 def SetRelationship(*args, **kwargs):
13083 """SetRelationship(self, int r)"""
13084 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13085
13086 def ResetIfWin(*args, **kwargs):
13087 """
13088 ResetIfWin(self, Window otherW) -> bool
13089
13090 Reset constraint if it mentions otherWin
13091 """
13092 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13093
13094 def SatisfyConstraint(*args, **kwargs):
13095 """
13096 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13097
13098 Try to satisfy constraint
13099 """
13100 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13101
13102 def GetEdge(*args, **kwargs):
13103 """
13104 GetEdge(self, int which, Window thisWin, Window other) -> int
13105
13106 Get the value of this edge or dimension, or if this
13107 is not determinable, -1.
13108 """
13109 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13110
13111 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13112 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13113 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13114 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13115 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13116 Percent = property(GetPercent,doc="See `GetPercent`")
13117 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13118 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
13119 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
13120
13121 class LayoutConstraints(Object):
13122 """
13123 **Note:** constraints are now deprecated and you should use sizers
13124 instead.
13125
13126 Objects of this class can be associated with a window to define its
13127 layout constraints, with respect to siblings or its parent.
13128
13129 The class consists of the following eight constraints of class
13130 wx.IndividualLayoutConstraint, some or all of which should be accessed
13131 directly to set the appropriate constraints.
13132
13133 * left: represents the left hand edge of the window
13134 * right: represents the right hand edge of the window
13135 * top: represents the top edge of the window
13136 * bottom: represents the bottom edge of the window
13137 * width: represents the width of the window
13138 * height: represents the height of the window
13139 * centreX: represents the horizontal centre point of the window
13140 * centreY: represents the vertical centre point of the window
13141
13142 Most constraints are initially set to have the relationship
13143 wxUnconstrained, which means that their values should be calculated by
13144 looking at known constraints. The exceptions are width and height,
13145 which are set to wxAsIs to ensure that if the user does not specify a
13146 constraint, the existing width and height will be used, to be
13147 compatible with panel items which often have take a default size. If
13148 the constraint is ``wx.AsIs``, the dimension will not be changed.
13149
13150 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13151
13152 """
13153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13154 __repr__ = _swig_repr
13155 left = property(_core_.LayoutConstraints_left_get)
13156 top = property(_core_.LayoutConstraints_top_get)
13157 right = property(_core_.LayoutConstraints_right_get)
13158 bottom = property(_core_.LayoutConstraints_bottom_get)
13159 width = property(_core_.LayoutConstraints_width_get)
13160 height = property(_core_.LayoutConstraints_height_get)
13161 centreX = property(_core_.LayoutConstraints_centreX_get)
13162 centreY = property(_core_.LayoutConstraints_centreY_get)
13163 def __init__(self, *args, **kwargs):
13164 """__init__(self) -> LayoutConstraints"""
13165 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13166 __swig_destroy__ = _core_.delete_LayoutConstraints
13167 __del__ = lambda self : None;
13168 def SatisfyConstraints(*args, **kwargs):
13169 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13170 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13171
13172 def AreSatisfied(*args, **kwargs):
13173 """AreSatisfied(self) -> bool"""
13174 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13175
13176 _core_.LayoutConstraints_swigregister(LayoutConstraints)
13177
13178 #----------------------------------------------------------------------------
13179
13180 # Use Python's bool constants if available, make some if not
13181 try:
13182 True
13183 except NameError:
13184 __builtins__.True = 1==1
13185 __builtins__.False = 1==0
13186 def bool(value): return not not value
13187 __builtins__.bool = bool
13188
13189
13190
13191 # workarounds for bad wxRTTI names
13192 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13193 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13194 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13195
13196
13197 #----------------------------------------------------------------------------
13198 # Load version numbers from __version__... Ensure that major and minor
13199 # versions are the same for both wxPython and wxWidgets.
13200
13201 from __version__ import *
13202 __version__ = VERSION_STRING
13203
13204 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13205 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
13206 if RELEASE_VERSION != _core_.RELEASE_VERSION:
13207 import warnings
13208 warnings.warn("wxPython/wxWidgets release number mismatch")
13209
13210 #----------------------------------------------------------------------------
13211
13212 # Set wxPython's default string<-->unicode conversion encoding from
13213 # the locale, but only if Python's default hasn't been changed. (We
13214 # assume that if the user has customized it already then that is the
13215 # encoding we need to use as well.)
13216 #
13217 # The encoding selected here is used when string or unicode objects
13218 # need to be converted in order to pass them to wxWidgets. Please be
13219 # aware that the default encoding within the same locale may be
13220 # slightly different on different platforms. For example, please see
13221 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13222 # between the common latin/roman encodings.
13223
13224 default = _sys.getdefaultencoding()
13225 if default == 'ascii':
13226 import locale
13227 import codecs
13228 try:
13229 default = locale.getdefaultlocale()[1]
13230 codecs.lookup(default)
13231 except (ValueError, LookupError, TypeError):
13232 default = _sys.getdefaultencoding()
13233 del locale
13234 del codecs
13235 if default:
13236 wx.SetDefaultPyEncoding(default)
13237 del default
13238
13239 #----------------------------------------------------------------------------
13240
13241 class PyDeadObjectError(AttributeError):
13242 pass
13243
13244 class _wxPyDeadObject(object):
13245 """
13246 Instances of wx objects that are OOR capable will have their __class__
13247 changed to this class when the C++ object is deleted. This should help
13248 prevent crashes due to referencing a bogus C++ pointer.
13249 """
13250 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13251 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13252
13253 def __repr__(self):
13254 if not hasattr(self, "_name"):
13255 self._name = "[unknown]"
13256 return self.reprStr % self._name
13257
13258 def __getattr__(self, *args):
13259 if not hasattr(self, "_name"):
13260 self._name = "[unknown]"
13261 raise PyDeadObjectError(self.attrStr % self._name)
13262
13263 def __nonzero__(self):
13264 return 0
13265
13266
13267
13268 class PyUnbornObjectError(AttributeError):
13269 pass
13270
13271 class _wxPyUnbornObject(object):
13272 """
13273 Some stock objects are created when the wx._core module is
13274 imported, but their C++ instance is not created until the wx.App
13275 object is created and initialized. These object instances will
13276 temporarily have their __class__ changed to this class so an
13277 exception will be raised if they are used before the C++ instance
13278 is ready.
13279 """
13280
13281 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13282 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13283
13284 def __repr__(self):
13285 #if not hasattr(self, "_name"):
13286 # self._name = "[unknown]"
13287 return self.reprStr #% self._name
13288
13289 def __getattr__(self, *args):
13290 #if not hasattr(self, "_name"):
13291 # self._name = "[unknown]"
13292 raise PyUnbornObjectError(self.attrStr) # % self._name )
13293
13294 def __nonzero__(self):
13295 return 0
13296
13297
13298 #----------------------------------------------------------------------------
13299
13300 def CallAfter(callable, *args, **kw):
13301 """
13302 Call the specified function after the current and pending event
13303 handlers have been completed. This is also good for making GUI
13304 method calls from non-GUI threads. Any extra positional or
13305 keyword args are passed on to the callable when it is called.
13306
13307 :see: `wx.FutureCall`
13308 """
13309 app = wx.GetApp()
13310 assert app is not None, 'No wx.App created yet'
13311
13312 if not hasattr(app, "_CallAfterId"):
13313 app._CallAfterId = wx.NewEventType()
13314 app.Connect(-1, -1, app._CallAfterId,
13315 lambda event: event.callable(*event.args, **event.kw) )
13316 evt = wx.PyEvent()
13317 evt.SetEventType(app._CallAfterId)
13318 evt.callable = callable
13319 evt.args = args
13320 evt.kw = kw
13321 wx.PostEvent(app, evt)
13322
13323 #----------------------------------------------------------------------------
13324
13325
13326 class FutureCall:
13327 """
13328 A convenience class for `wx.Timer`, that calls the given callable
13329 object once after the given amount of milliseconds, passing any
13330 positional or keyword args. The return value of the callable is
13331 availbale after it has been run with the `GetResult` method.
13332
13333 If you don't need to get the return value or restart the timer
13334 then there is no need to hold a reference to this object. It will
13335 hold a reference to itself while the timer is running (the timer
13336 has a reference to self.Notify) but the cycle will be broken when
13337 the timer completes, automatically cleaning up the wx.FutureCall
13338 object.
13339
13340 :see: `wx.CallAfter`
13341 """
13342 def __init__(self, millis, callable, *args, **kwargs):
13343 self.millis = millis
13344 self.callable = callable
13345 self.SetArgs(*args, **kwargs)
13346 self.runCount = 0
13347 self.running = False
13348 self.hasRun = False
13349 self.result = None
13350 self.timer = None
13351 self.Start()
13352
13353 def __del__(self):
13354 self.Stop()
13355
13356
13357 def Start(self, millis=None, *args, **kwargs):
13358 """
13359 (Re)start the timer
13360 """
13361 self.hasRun = False
13362 if millis is not None:
13363 self.millis = millis
13364 if args or kwargs:
13365 self.SetArgs(*args, **kwargs)
13366 self.Stop()
13367 self.timer = wx.PyTimer(self.Notify)
13368 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13369 self.running = True
13370 Restart = Start
13371
13372
13373 def Stop(self):
13374 """
13375 Stop and destroy the timer.
13376 """
13377 if self.timer is not None:
13378 self.timer.Stop()
13379 self.timer = None
13380
13381
13382 def GetInterval(self):
13383 if self.timer is not None:
13384 return self.timer.GetInterval()
13385 else:
13386 return 0
13387
13388
13389 def IsRunning(self):
13390 return self.timer is not None and self.timer.IsRunning()
13391
13392
13393 def SetArgs(self, *args, **kwargs):
13394 """
13395 (Re)set the args passed to the callable object. This is
13396 useful in conjunction with Restart if you want to schedule a
13397 new call to the same callable object but with different
13398 parameters.
13399 """
13400 self.args = args
13401 self.kwargs = kwargs
13402
13403
13404 def HasRun(self):
13405 return self.hasRun
13406
13407 def GetResult(self):
13408 return self.result
13409
13410 def Notify(self):
13411 """
13412 The timer has expired so call the callable.
13413 """
13414 if self.callable and getattr(self.callable, 'im_self', True):
13415 self.runCount += 1
13416 self.running = False
13417 self.result = self.callable(*self.args, **self.kwargs)
13418 self.hasRun = True
13419 if not self.running:
13420 # if it wasn't restarted, then cleanup
13421 wx.CallAfter(self.Stop)
13422
13423 Interval = property(GetInterval)
13424 Result = property(GetResult)
13425
13426
13427 #----------------------------------------------------------------------------
13428 # Control which items in this module should be documented by epydoc.
13429 # We allow only classes and functions, which will help reduce the size
13430 # of the docs by filtering out the zillions of constants, EVT objects,
13431 # and etc that don't make much sense by themselves, but are instead
13432 # documented (or will be) as part of the classes/functions/methods
13433 # where they should be used.
13434
13435 class __DocFilter:
13436 """
13437 A filter for epydoc that only allows non-Ptr classes and
13438 functions, in order to reduce the clutter in the API docs.
13439 """
13440 def __init__(self, globals):
13441 self._globals = globals
13442
13443 def __call__(self, name):
13444 import types
13445 obj = self._globals.get(name, None)
13446
13447 # only document classes and function
13448 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13449 return False
13450
13451 # skip other things that are private or will be documented as part of somethign else
13452 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13453 return False
13454
13455 # skip functions that are duplicates of static functions in a class
13456 if name.find('_') != -1:
13457 cls = self._globals.get(name.split('_')[0], None)
13458 methname = name.split('_')[1]
13459 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13460 return False
13461
13462 return True
13463
13464 #----------------------------------------------------------------------------
13465 #----------------------------------------------------------------------------
13466
13467 # Import other modules in this package that should show up in the
13468 # "core" wx namespace
13469 from _gdi import *
13470 from _windows import *
13471 from _controls import *
13472 from _misc import *
13473
13474 #----------------------------------------------------------------------------
13475 #----------------------------------------------------------------------------
13476
13477
13478