]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
Forward declare new wxPy classes
[wxWidgets.git] / wxPython / src / msw / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 CB_SIMPLE = _core_.CB_SIMPLE
120 CB_DROPDOWN = _core_.CB_DROPDOWN
121 CB_SORT = _core_.CB_SORT
122 CB_READONLY = _core_.CB_READONLY
123 RA_HORIZONTAL = _core_.RA_HORIZONTAL
124 RA_VERTICAL = _core_.RA_VERTICAL
125 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
126 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
127 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
128 RB_GROUP = _core_.RB_GROUP
129 RB_SINGLE = _core_.RB_SINGLE
130 SB_HORIZONTAL = _core_.SB_HORIZONTAL
131 SB_VERTICAL = _core_.SB_VERTICAL
132 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
133 ST_SIZEGRIP = _core_.ST_SIZEGRIP
134 FLOOD_SURFACE = _core_.FLOOD_SURFACE
135 FLOOD_BORDER = _core_.FLOOD_BORDER
136 ODDEVEN_RULE = _core_.ODDEVEN_RULE
137 WINDING_RULE = _core_.WINDING_RULE
138 TOOL_TOP = _core_.TOOL_TOP
139 TOOL_BOTTOM = _core_.TOOL_BOTTOM
140 TOOL_LEFT = _core_.TOOL_LEFT
141 TOOL_RIGHT = _core_.TOOL_RIGHT
142 OK = _core_.OK
143 YES_NO = _core_.YES_NO
144 CANCEL = _core_.CANCEL
145 YES = _core_.YES
146 NO = _core_.NO
147 NO_DEFAULT = _core_.NO_DEFAULT
148 YES_DEFAULT = _core_.YES_DEFAULT
149 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
150 ICON_HAND = _core_.ICON_HAND
151 ICON_QUESTION = _core_.ICON_QUESTION
152 ICON_INFORMATION = _core_.ICON_INFORMATION
153 ICON_STOP = _core_.ICON_STOP
154 ICON_ASTERISK = _core_.ICON_ASTERISK
155 ICON_MASK = _core_.ICON_MASK
156 ICON_WARNING = _core_.ICON_WARNING
157 ICON_ERROR = _core_.ICON_ERROR
158 FORWARD = _core_.FORWARD
159 BACKWARD = _core_.BACKWARD
160 RESET = _core_.RESET
161 HELP = _core_.HELP
162 MORE = _core_.MORE
163 SETUP = _core_.SETUP
164 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
165 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
166 SIZE_AUTO = _core_.SIZE_AUTO
167 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
168 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
169 SIZE_FORCE = _core_.SIZE_FORCE
170 PORTRAIT = _core_.PORTRAIT
171 LANDSCAPE = _core_.LANDSCAPE
172 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
173 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
174 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
175 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
176 ID_ANY = _core_.ID_ANY
177 ID_SEPARATOR = _core_.ID_SEPARATOR
178 ID_NONE = _core_.ID_NONE
179 ID_LOWEST = _core_.ID_LOWEST
180 ID_OPEN = _core_.ID_OPEN
181 ID_CLOSE = _core_.ID_CLOSE
182 ID_NEW = _core_.ID_NEW
183 ID_SAVE = _core_.ID_SAVE
184 ID_SAVEAS = _core_.ID_SAVEAS
185 ID_REVERT = _core_.ID_REVERT
186 ID_EXIT = _core_.ID_EXIT
187 ID_UNDO = _core_.ID_UNDO
188 ID_REDO = _core_.ID_REDO
189 ID_HELP = _core_.ID_HELP
190 ID_PRINT = _core_.ID_PRINT
191 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
192 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
193 ID_PREVIEW = _core_.ID_PREVIEW
194 ID_ABOUT = _core_.ID_ABOUT
195 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
196 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
197 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
198 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
199 ID_HELP_INDEX = _core_.ID_HELP_INDEX
200 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
201 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
202 ID_PREFERENCES = _core_.ID_PREFERENCES
203 ID_EDIT = _core_.ID_EDIT
204 ID_CUT = _core_.ID_CUT
205 ID_COPY = _core_.ID_COPY
206 ID_PASTE = _core_.ID_PASTE
207 ID_CLEAR = _core_.ID_CLEAR
208 ID_FIND = _core_.ID_FIND
209 ID_DUPLICATE = _core_.ID_DUPLICATE
210 ID_SELECTALL = _core_.ID_SELECTALL
211 ID_DELETE = _core_.ID_DELETE
212 ID_REPLACE = _core_.ID_REPLACE
213 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214 ID_PROPERTIES = _core_.ID_PROPERTIES
215 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST = _core_.ID_VIEW_LIST
219 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223 ID_FILE = _core_.ID_FILE
224 ID_FILE1 = _core_.ID_FILE1
225 ID_FILE2 = _core_.ID_FILE2
226 ID_FILE3 = _core_.ID_FILE3
227 ID_FILE4 = _core_.ID_FILE4
228 ID_FILE5 = _core_.ID_FILE5
229 ID_FILE6 = _core_.ID_FILE6
230 ID_FILE7 = _core_.ID_FILE7
231 ID_FILE8 = _core_.ID_FILE8
232 ID_FILE9 = _core_.ID_FILE9
233 ID_OK = _core_.ID_OK
234 ID_CANCEL = _core_.ID_CANCEL
235 ID_APPLY = _core_.ID_APPLY
236 ID_YES = _core_.ID_YES
237 ID_NO = _core_.ID_NO
238 ID_STATIC = _core_.ID_STATIC
239 ID_FORWARD = _core_.ID_FORWARD
240 ID_BACKWARD = _core_.ID_BACKWARD
241 ID_DEFAULT = _core_.ID_DEFAULT
242 ID_MORE = _core_.ID_MORE
243 ID_SETUP = _core_.ID_SETUP
244 ID_RESET = _core_.ID_RESET
245 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246 ID_YESTOALL = _core_.ID_YESTOALL
247 ID_NOTOALL = _core_.ID_NOTOALL
248 ID_ABORT = _core_.ID_ABORT
249 ID_RETRY = _core_.ID_RETRY
250 ID_IGNORE = _core_.ID_IGNORE
251 ID_ADD = _core_.ID_ADD
252 ID_REMOVE = _core_.ID_REMOVE
253 ID_UP = _core_.ID_UP
254 ID_DOWN = _core_.ID_DOWN
255 ID_HOME = _core_.ID_HOME
256 ID_REFRESH = _core_.ID_REFRESH
257 ID_STOP = _core_.ID_STOP
258 ID_INDEX = _core_.ID_INDEX
259 ID_BOLD = _core_.ID_BOLD
260 ID_ITALIC = _core_.ID_ITALIC
261 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265 ID_UNDERLINE = _core_.ID_UNDERLINE
266 ID_INDENT = _core_.ID_INDENT
267 ID_UNINDENT = _core_.ID_UNINDENT
268 ID_ZOOM_100 = _core_.ID_ZOOM_100
269 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270 ID_ZOOM_IN = _core_.ID_ZOOM_IN
271 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272 ID_UNDELETE = _core_.ID_UNDELETE
273 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
274 ID_HIGHEST = _core_.ID_HIGHEST
275 MENU_TEAROFF = _core_.MENU_TEAROFF
276 MB_DOCKABLE = _core_.MB_DOCKABLE
277 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
278 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
279 LI_HORIZONTAL = _core_.LI_HORIZONTAL
280 LI_VERTICAL = _core_.LI_VERTICAL
281 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
282 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
283 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
284 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
285 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
286 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
287 MM_TEXT = _core_.MM_TEXT
288 MM_LOMETRIC = _core_.MM_LOMETRIC
289 MM_HIMETRIC = _core_.MM_HIMETRIC
290 MM_LOENGLISH = _core_.MM_LOENGLISH
291 MM_HIENGLISH = _core_.MM_HIENGLISH
292 MM_TWIPS = _core_.MM_TWIPS
293 MM_ISOTROPIC = _core_.MM_ISOTROPIC
294 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
295 MM_POINTS = _core_.MM_POINTS
296 MM_METRIC = _core_.MM_METRIC
297 CENTRE = _core_.CENTRE
298 CENTER = _core_.CENTER
299 HORIZONTAL = _core_.HORIZONTAL
300 VERTICAL = _core_.VERTICAL
301 BOTH = _core_.BOTH
302 LEFT = _core_.LEFT
303 RIGHT = _core_.RIGHT
304 UP = _core_.UP
305 DOWN = _core_.DOWN
306 TOP = _core_.TOP
307 BOTTOM = _core_.BOTTOM
308 NORTH = _core_.NORTH
309 SOUTH = _core_.SOUTH
310 WEST = _core_.WEST
311 EAST = _core_.EAST
312 ALL = _core_.ALL
313 ALIGN_NOT = _core_.ALIGN_NOT
314 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
315 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
316 ALIGN_LEFT = _core_.ALIGN_LEFT
317 ALIGN_TOP = _core_.ALIGN_TOP
318 ALIGN_RIGHT = _core_.ALIGN_RIGHT
319 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
320 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
321 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
322 ALIGN_CENTER = _core_.ALIGN_CENTER
323 ALIGN_CENTRE = _core_.ALIGN_CENTRE
324 ALIGN_MASK = _core_.ALIGN_MASK
325 STRETCH_NOT = _core_.STRETCH_NOT
326 SHRINK = _core_.SHRINK
327 GROW = _core_.GROW
328 EXPAND = _core_.EXPAND
329 SHAPED = _core_.SHAPED
330 FIXED_MINSIZE = _core_.FIXED_MINSIZE
331 TILE = _core_.TILE
332 ADJUST_MINSIZE = 0
333 BORDER_DEFAULT = _core_.BORDER_DEFAULT
334 BORDER_NONE = _core_.BORDER_NONE
335 BORDER_STATIC = _core_.BORDER_STATIC
336 BORDER_SIMPLE = _core_.BORDER_SIMPLE
337 BORDER_RAISED = _core_.BORDER_RAISED
338 BORDER_SUNKEN = _core_.BORDER_SUNKEN
339 BORDER_DOUBLE = _core_.BORDER_DOUBLE
340 BORDER_MASK = _core_.BORDER_MASK
341 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
342 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
343 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
344 DEFAULT = _core_.DEFAULT
345 DECORATIVE = _core_.DECORATIVE
346 ROMAN = _core_.ROMAN
347 SCRIPT = _core_.SCRIPT
348 SWISS = _core_.SWISS
349 MODERN = _core_.MODERN
350 TELETYPE = _core_.TELETYPE
351 VARIABLE = _core_.VARIABLE
352 FIXED = _core_.FIXED
353 NORMAL = _core_.NORMAL
354 LIGHT = _core_.LIGHT
355 BOLD = _core_.BOLD
356 ITALIC = _core_.ITALIC
357 SLANT = _core_.SLANT
358 SOLID = _core_.SOLID
359 DOT = _core_.DOT
360 LONG_DASH = _core_.LONG_DASH
361 SHORT_DASH = _core_.SHORT_DASH
362 DOT_DASH = _core_.DOT_DASH
363 USER_DASH = _core_.USER_DASH
364 TRANSPARENT = _core_.TRANSPARENT
365 STIPPLE = _core_.STIPPLE
366 STIPPLE_MASK = _core_.STIPPLE_MASK
367 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
368 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
369 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
370 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
371 CROSS_HATCH = _core_.CROSS_HATCH
372 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
373 VERTICAL_HATCH = _core_.VERTICAL_HATCH
374 JOIN_BEVEL = _core_.JOIN_BEVEL
375 JOIN_MITER = _core_.JOIN_MITER
376 JOIN_ROUND = _core_.JOIN_ROUND
377 CAP_ROUND = _core_.CAP_ROUND
378 CAP_PROJECTING = _core_.CAP_PROJECTING
379 CAP_BUTT = _core_.CAP_BUTT
380 CLEAR = _core_.CLEAR
381 XOR = _core_.XOR
382 INVERT = _core_.INVERT
383 OR_REVERSE = _core_.OR_REVERSE
384 AND_REVERSE = _core_.AND_REVERSE
385 COPY = _core_.COPY
386 AND = _core_.AND
387 AND_INVERT = _core_.AND_INVERT
388 NO_OP = _core_.NO_OP
389 NOR = _core_.NOR
390 EQUIV = _core_.EQUIV
391 SRC_INVERT = _core_.SRC_INVERT
392 OR_INVERT = _core_.OR_INVERT
393 NAND = _core_.NAND
394 OR = _core_.OR
395 SET = _core_.SET
396 WXK_BACK = _core_.WXK_BACK
397 WXK_TAB = _core_.WXK_TAB
398 WXK_RETURN = _core_.WXK_RETURN
399 WXK_ESCAPE = _core_.WXK_ESCAPE
400 WXK_SPACE = _core_.WXK_SPACE
401 WXK_DELETE = _core_.WXK_DELETE
402 WXK_START = _core_.WXK_START
403 WXK_LBUTTON = _core_.WXK_LBUTTON
404 WXK_RBUTTON = _core_.WXK_RBUTTON
405 WXK_CANCEL = _core_.WXK_CANCEL
406 WXK_MBUTTON = _core_.WXK_MBUTTON
407 WXK_CLEAR = _core_.WXK_CLEAR
408 WXK_SHIFT = _core_.WXK_SHIFT
409 WXK_ALT = _core_.WXK_ALT
410 WXK_CONTROL = _core_.WXK_CONTROL
411 WXK_MENU = _core_.WXK_MENU
412 WXK_PAUSE = _core_.WXK_PAUSE
413 WXK_CAPITAL = _core_.WXK_CAPITAL
414 WXK_END = _core_.WXK_END
415 WXK_HOME = _core_.WXK_HOME
416 WXK_LEFT = _core_.WXK_LEFT
417 WXK_UP = _core_.WXK_UP
418 WXK_RIGHT = _core_.WXK_RIGHT
419 WXK_DOWN = _core_.WXK_DOWN
420 WXK_SELECT = _core_.WXK_SELECT
421 WXK_PRINT = _core_.WXK_PRINT
422 WXK_EXECUTE = _core_.WXK_EXECUTE
423 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
424 WXK_INSERT = _core_.WXK_INSERT
425 WXK_HELP = _core_.WXK_HELP
426 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
427 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
428 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
429 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
430 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
431 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
432 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
433 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
434 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
435 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
436 WXK_MULTIPLY = _core_.WXK_MULTIPLY
437 WXK_ADD = _core_.WXK_ADD
438 WXK_SEPARATOR = _core_.WXK_SEPARATOR
439 WXK_SUBTRACT = _core_.WXK_SUBTRACT
440 WXK_DECIMAL = _core_.WXK_DECIMAL
441 WXK_DIVIDE = _core_.WXK_DIVIDE
442 WXK_F1 = _core_.WXK_F1
443 WXK_F2 = _core_.WXK_F2
444 WXK_F3 = _core_.WXK_F3
445 WXK_F4 = _core_.WXK_F4
446 WXK_F5 = _core_.WXK_F5
447 WXK_F6 = _core_.WXK_F6
448 WXK_F7 = _core_.WXK_F7
449 WXK_F8 = _core_.WXK_F8
450 WXK_F9 = _core_.WXK_F9
451 WXK_F10 = _core_.WXK_F10
452 WXK_F11 = _core_.WXK_F11
453 WXK_F12 = _core_.WXK_F12
454 WXK_F13 = _core_.WXK_F13
455 WXK_F14 = _core_.WXK_F14
456 WXK_F15 = _core_.WXK_F15
457 WXK_F16 = _core_.WXK_F16
458 WXK_F17 = _core_.WXK_F17
459 WXK_F18 = _core_.WXK_F18
460 WXK_F19 = _core_.WXK_F19
461 WXK_F20 = _core_.WXK_F20
462 WXK_F21 = _core_.WXK_F21
463 WXK_F22 = _core_.WXK_F22
464 WXK_F23 = _core_.WXK_F23
465 WXK_F24 = _core_.WXK_F24
466 WXK_NUMLOCK = _core_.WXK_NUMLOCK
467 WXK_SCROLL = _core_.WXK_SCROLL
468 WXK_PAGEUP = _core_.WXK_PAGEUP
469 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
470 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
471 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
472 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
473 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
474 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
475 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
476 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
477 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
478 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
479 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
480 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
481 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
482 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
483 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
484 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
485 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
486 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
487 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
488 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
489 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
490 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
491 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
492 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
493 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
494 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
495 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
496 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
497 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
498 WXK_COMMAND = _core_.WXK_COMMAND
499 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
500 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
501 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
502 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
503 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
504 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
505 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
506 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
507 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
508 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
509 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
510 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
511 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
512 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
513 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
514 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
515 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
516 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
517 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
518 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
519 WXK_PRIOR = WXK_PAGEUP
520 WXK_NEXT = WXK_PAGEDOWN
521 WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
522 WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
523
524 PAPER_NONE = _core_.PAPER_NONE
525 PAPER_LETTER = _core_.PAPER_LETTER
526 PAPER_LEGAL = _core_.PAPER_LEGAL
527 PAPER_A4 = _core_.PAPER_A4
528 PAPER_CSHEET = _core_.PAPER_CSHEET
529 PAPER_DSHEET = _core_.PAPER_DSHEET
530 PAPER_ESHEET = _core_.PAPER_ESHEET
531 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
532 PAPER_TABLOID = _core_.PAPER_TABLOID
533 PAPER_LEDGER = _core_.PAPER_LEDGER
534 PAPER_STATEMENT = _core_.PAPER_STATEMENT
535 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
536 PAPER_A3 = _core_.PAPER_A3
537 PAPER_A4SMALL = _core_.PAPER_A4SMALL
538 PAPER_A5 = _core_.PAPER_A5
539 PAPER_B4 = _core_.PAPER_B4
540 PAPER_B5 = _core_.PAPER_B5
541 PAPER_FOLIO = _core_.PAPER_FOLIO
542 PAPER_QUARTO = _core_.PAPER_QUARTO
543 PAPER_10X14 = _core_.PAPER_10X14
544 PAPER_11X17 = _core_.PAPER_11X17
545 PAPER_NOTE = _core_.PAPER_NOTE
546 PAPER_ENV_9 = _core_.PAPER_ENV_9
547 PAPER_ENV_10 = _core_.PAPER_ENV_10
548 PAPER_ENV_11 = _core_.PAPER_ENV_11
549 PAPER_ENV_12 = _core_.PAPER_ENV_12
550 PAPER_ENV_14 = _core_.PAPER_ENV_14
551 PAPER_ENV_DL = _core_.PAPER_ENV_DL
552 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
553 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
554 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
555 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
556 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
557 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
558 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
559 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
560 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
561 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
562 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
563 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
564 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
565 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
566 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
567 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
568 PAPER_9X11 = _core_.PAPER_9X11
569 PAPER_10X11 = _core_.PAPER_10X11
570 PAPER_15X11 = _core_.PAPER_15X11
571 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
572 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
573 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
574 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
575 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
576 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
577 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
578 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
579 PAPER_A_PLUS = _core_.PAPER_A_PLUS
580 PAPER_B_PLUS = _core_.PAPER_B_PLUS
581 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
582 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
583 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
584 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
585 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
586 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
587 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
588 PAPER_A2 = _core_.PAPER_A2
589 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
590 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
591 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
592 PAPER_A6 = _core_.PAPER_A6
593 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
594 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
595 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
596 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
597 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
598 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
599 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
600 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
601 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
602 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
603 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
604 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
606 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
607 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
608 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
609 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
610 PAPER_B6_JIS = _core_.PAPER_B6_JIS
611 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
612 PAPER_12X11 = _core_.PAPER_12X11
613 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
614 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
615 PAPER_P16K = _core_.PAPER_P16K
616 PAPER_P32K = _core_.PAPER_P32K
617 PAPER_P32KBIG = _core_.PAPER_P32KBIG
618 PAPER_PENV_1 = _core_.PAPER_PENV_1
619 PAPER_PENV_2 = _core_.PAPER_PENV_2
620 PAPER_PENV_3 = _core_.PAPER_PENV_3
621 PAPER_PENV_4 = _core_.PAPER_PENV_4
622 PAPER_PENV_5 = _core_.PAPER_PENV_5
623 PAPER_PENV_6 = _core_.PAPER_PENV_6
624 PAPER_PENV_7 = _core_.PAPER_PENV_7
625 PAPER_PENV_8 = _core_.PAPER_PENV_8
626 PAPER_PENV_9 = _core_.PAPER_PENV_9
627 PAPER_PENV_10 = _core_.PAPER_PENV_10
628 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
629 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
630 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
631 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
632 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
633 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
634 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
635 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
636 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
637 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
638 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
639 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
640 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
641 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
642 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
643 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
644 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
645 ITEM_NORMAL = _core_.ITEM_NORMAL
646 ITEM_CHECK = _core_.ITEM_CHECK
647 ITEM_RADIO = _core_.ITEM_RADIO
648 ITEM_MAX = _core_.ITEM_MAX
649 HT_NOWHERE = _core_.HT_NOWHERE
650 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
651 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
652 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
653 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
654 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
655 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
656 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
657 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
658 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
659 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
660 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
661 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
662 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
663 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
664 HT_MAX = _core_.HT_MAX
665 MOD_NONE = _core_.MOD_NONE
666 MOD_ALT = _core_.MOD_ALT
667 MOD_CONTROL = _core_.MOD_CONTROL
668 MOD_ALTGR = _core_.MOD_ALTGR
669 MOD_SHIFT = _core_.MOD_SHIFT
670 MOD_META = _core_.MOD_META
671 MOD_WIN = _core_.MOD_WIN
672 MOD_CMD = _core_.MOD_CMD
673 MOD_ALL = _core_.MOD_ALL
674 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
675 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
676 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
677 Layout_Default = _core_.Layout_Default
678 Layout_LeftToRight = _core_.Layout_LeftToRight
679 Layout_RightToLeft = _core_.Layout_RightToLeft
680 #---------------------------------------------------------------------------
681
682 class Object(object):
683 """
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
686 """
687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
688 def __init__(self): raise AttributeError, "No constructor defined"
689 __repr__ = _swig_repr
690 def GetClassName(*args, **kwargs):
691 """
692 GetClassName(self) -> String
693
694 Returns the class name of the C++ class using wxRTTI.
695 """
696 return _core_.Object_GetClassName(*args, **kwargs)
697
698 def Destroy(*args, **kwargs):
699 """
700 Destroy(self)
701
702 Deletes the C++ object this Python object is a proxy for.
703 """
704 args[0].this.own(False)
705 return _core_.Object_Destroy(*args, **kwargs)
706
707 def IsSameAs(*args, **kwargs):
708 """
709 IsSameAs(self, Object p) -> bool
710
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
713 object.
714 """
715 return _core_.Object_IsSameAs(*args, **kwargs)
716
717 ClassName = property(GetClassName,doc="See `GetClassName`")
718 _core_.Object_swigregister(Object)
719 _wxPySetDictionary = _core_._wxPySetDictionary
720 cvar = _core_.cvar
721 EmptyString = cvar.EmptyString
722
723 #---------------------------------------------------------------------------
724
725 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
743 BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
744 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746 CURSOR_NONE = _core_.CURSOR_NONE
747 CURSOR_ARROW = _core_.CURSOR_ARROW
748 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750 CURSOR_CHAR = _core_.CURSOR_CHAR
751 CURSOR_CROSS = _core_.CURSOR_CROSS
752 CURSOR_HAND = _core_.CURSOR_HAND
753 CURSOR_IBEAM = _core_.CURSOR_IBEAM
754 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759 CURSOR_PENCIL = _core_.CURSOR_PENCIL
760 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765 CURSOR_SIZENS = _core_.CURSOR_SIZENS
766 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768 CURSOR_SIZING = _core_.CURSOR_SIZING
769 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770 CURSOR_WAIT = _core_.CURSOR_WAIT
771 CURSOR_WATCH = _core_.CURSOR_WATCH
772 CURSOR_BLANK = _core_.CURSOR_BLANK
773 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776 CURSOR_MAX = _core_.CURSOR_MAX
777 #---------------------------------------------------------------------------
778
779 class Size(object):
780 """
781 wx.Size is a useful data structure used to represent the size of
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
784 expected a (width, height) tuple can be used instead.
785 """
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
790 x = width; y = height
791 def __init__(self, *args, **kwargs):
792 """
793 __init__(self, int w=0, int h=0) -> Size
794
795 Creates a size object.
796 """
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
800 def __eq__(*args, **kwargs):
801 """
802 __eq__(self, PyObject other) -> bool
803
804 Test for equality of wx.Size objects.
805 """
806 return _core_.Size___eq__(*args, **kwargs)
807
808 def __ne__(*args, **kwargs):
809 """
810 __ne__(self, PyObject other) -> bool
811
812 Test for inequality of wx.Size objects.
813 """
814 return _core_.Size___ne__(*args, **kwargs)
815
816 def __add__(*args, **kwargs):
817 """
818 __add__(self, Size sz) -> Size
819
820 Add sz's proprties to this and return the result.
821 """
822 return _core_.Size___add__(*args, **kwargs)
823
824 def __sub__(*args, **kwargs):
825 """
826 __sub__(self, Size sz) -> Size
827
828 Subtract sz's properties from this and return the result.
829 """
830 return _core_.Size___sub__(*args, **kwargs)
831
832 def IncTo(*args, **kwargs):
833 """
834 IncTo(self, Size sz)
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
839 return _core_.Size_IncTo(*args, **kwargs)
840
841 def DecTo(*args, **kwargs):
842 """
843 DecTo(self, Size sz)
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
848 return _core_.Size_DecTo(*args, **kwargs)
849
850 def IncBy(*args, **kwargs):
851 """IncBy(self, int dx, int dy)"""
852 return _core_.Size_IncBy(*args, **kwargs)
853
854 def DecBy(*args, **kwargs):
855 """DecBy(self, int dx, int dy)"""
856 return _core_.Size_DecBy(*args, **kwargs)
857
858 def Scale(*args, **kwargs):
859 """
860 Scale(self, float xscale, float yscale)
861
862 Scales the dimensions of this object by the given factors.
863 """
864 return _core_.Size_Scale(*args, **kwargs)
865
866 def Set(*args, **kwargs):
867 """
868 Set(self, int w, int h)
869
870 Set both width and height.
871 """
872 return _core_.Size_Set(*args, **kwargs)
873
874 def SetWidth(*args, **kwargs):
875 """SetWidth(self, int w)"""
876 return _core_.Size_SetWidth(*args, **kwargs)
877
878 def SetHeight(*args, **kwargs):
879 """SetHeight(self, int h)"""
880 return _core_.Size_SetHeight(*args, **kwargs)
881
882 def GetWidth(*args, **kwargs):
883 """GetWidth(self) -> int"""
884 return _core_.Size_GetWidth(*args, **kwargs)
885
886 def GetHeight(*args, **kwargs):
887 """GetHeight(self) -> int"""
888 return _core_.Size_GetHeight(*args, **kwargs)
889
890 def IsFullySpecified(*args, **kwargs):
891 """
892 IsFullySpecified(self) -> bool
893
894 Returns True if both components of the size are non-default values.
895 """
896 return _core_.Size_IsFullySpecified(*args, **kwargs)
897
898 def SetDefaults(*args, **kwargs):
899 """
900 SetDefaults(self, Size size)
901
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
904 """
905 return _core_.Size_SetDefaults(*args, **kwargs)
906
907 def Get(*args, **kwargs):
908 """
909 Get() -> (width,height)
910
911 Returns the width and height properties as a tuple.
912 """
913 return _core_.Size_Get(*args, **kwargs)
914
915 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
916 def __str__(self): return str(self.Get())
917 def __repr__(self): return 'wx.Size'+str(self.Get())
918 def __len__(self): return len(self.Get())
919 def __getitem__(self, index): return self.Get()[index]
920 def __setitem__(self, index, val):
921 if index == 0: self.width = val
922 elif index == 1: self.height = val
923 else: raise IndexError
924 def __nonzero__(self): return self.Get() != (0,0)
925 __safe_for_unpickling__ = True
926 def __reduce__(self): return (wx.Size, self.Get())
927
928 _core_.Size_swigregister(Size)
929
930 #---------------------------------------------------------------------------
931
932 class RealPoint(object):
933 """
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
937 """
938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
939 __repr__ = _swig_repr
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
942 def __init__(self, *args, **kwargs):
943 """
944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
945
946 Create a wx.RealPoint object
947 """
948 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
949 __swig_destroy__ = _core_.delete_RealPoint
950 __del__ = lambda self : None;
951 def __eq__(*args, **kwargs):
952 """
953 __eq__(self, PyObject other) -> bool
954
955 Test for equality of wx.RealPoint objects.
956 """
957 return _core_.RealPoint___eq__(*args, **kwargs)
958
959 def __ne__(*args, **kwargs):
960 """
961 __ne__(self, PyObject other) -> bool
962
963 Test for inequality of wx.RealPoint objects.
964 """
965 return _core_.RealPoint___ne__(*args, **kwargs)
966
967 def __add__(*args, **kwargs):
968 """
969 __add__(self, RealPoint pt) -> RealPoint
970
971 Add pt's proprties to this and return the result.
972 """
973 return _core_.RealPoint___add__(*args, **kwargs)
974
975 def __sub__(*args, **kwargs):
976 """
977 __sub__(self, RealPoint pt) -> RealPoint
978
979 Subtract pt's proprties from this and return the result
980 """
981 return _core_.RealPoint___sub__(*args, **kwargs)
982
983 def Set(*args, **kwargs):
984 """
985 Set(self, double x, double y)
986
987 Set both the x and y properties
988 """
989 return _core_.RealPoint_Set(*args, **kwargs)
990
991 def Get(*args, **kwargs):
992 """
993 Get() -> (x,y)
994
995 Return the x and y properties as a tuple.
996 """
997 return _core_.RealPoint_Get(*args, **kwargs)
998
999 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1000 def __str__(self): return str(self.Get())
1001 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1002 def __len__(self): return len(self.Get())
1003 def __getitem__(self, index): return self.Get()[index]
1004 def __setitem__(self, index, val):
1005 if index == 0: self.x = val
1006 elif index == 1: self.y = val
1007 else: raise IndexError
1008 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1009 __safe_for_unpickling__ = True
1010 def __reduce__(self): return (wx.RealPoint, self.Get())
1011
1012 _core_.RealPoint_swigregister(RealPoint)
1013
1014 #---------------------------------------------------------------------------
1015
1016 class Point(object):
1017 """
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
1021 """
1022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1023 __repr__ = _swig_repr
1024 x = property(_core_.Point_x_get, _core_.Point_x_set)
1025 y = property(_core_.Point_y_get, _core_.Point_y_set)
1026 def __init__(self, *args, **kwargs):
1027 """
1028 __init__(self, int x=0, int y=0) -> Point
1029
1030 Create a wx.Point object
1031 """
1032 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1033 __swig_destroy__ = _core_.delete_Point
1034 __del__ = lambda self : None;
1035 def __eq__(*args, **kwargs):
1036 """
1037 __eq__(self, PyObject other) -> bool
1038
1039 Test for equality of wx.Point objects.
1040 """
1041 return _core_.Point___eq__(*args, **kwargs)
1042
1043 def __ne__(*args, **kwargs):
1044 """
1045 __ne__(self, PyObject other) -> bool
1046
1047 Test for inequality of wx.Point objects.
1048 """
1049 return _core_.Point___ne__(*args, **kwargs)
1050
1051 def __add__(*args, **kwargs):
1052 """
1053 __add__(self, Point pt) -> Point
1054
1055 Add pt's proprties to this and return the result.
1056 """
1057 return _core_.Point___add__(*args, **kwargs)
1058
1059 def __sub__(*args, **kwargs):
1060 """
1061 __sub__(self, Point pt) -> Point
1062
1063 Subtract pt's proprties from this and return the result
1064 """
1065 return _core_.Point___sub__(*args, **kwargs)
1066
1067 def __iadd__(*args, **kwargs):
1068 """
1069 __iadd__(self, Point pt) -> Point
1070
1071 Add pt to this object.
1072 """
1073 return _core_.Point___iadd__(*args, **kwargs)
1074
1075 def __isub__(*args, **kwargs):
1076 """
1077 __isub__(self, Point pt) -> Point
1078
1079 Subtract pt from this object.
1080 """
1081 return _core_.Point___isub__(*args, **kwargs)
1082
1083 def Set(*args, **kwargs):
1084 """
1085 Set(self, long x, long y)
1086
1087 Set both the x and y properties
1088 """
1089 return _core_.Point_Set(*args, **kwargs)
1090
1091 def Get(*args, **kwargs):
1092 """
1093 Get() -> (x,y)
1094
1095 Return the x and y properties as a tuple.
1096 """
1097 return _core_.Point_Get(*args, **kwargs)
1098
1099 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1100 def __str__(self): return str(self.Get())
1101 def __repr__(self): return 'wx.Point'+str(self.Get())
1102 def __len__(self): return len(self.Get())
1103 def __getitem__(self, index): return self.Get()[index]
1104 def __setitem__(self, index, val):
1105 if index == 0: self.x = val
1106 elif index == 1: self.y = val
1107 else: raise IndexError
1108 def __nonzero__(self): return self.Get() != (0,0)
1109 __safe_for_unpickling__ = True
1110 def __reduce__(self): return (wx.Point, self.Get())
1111
1112 _core_.Point_swigregister(Point)
1113
1114 #---------------------------------------------------------------------------
1115
1116 class Rect(object):
1117 """
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
1121 """
1122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1123 __repr__ = _swig_repr
1124 def __init__(self, *args, **kwargs):
1125 """
1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1127
1128 Create a new Rect object.
1129 """
1130 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1131 __swig_destroy__ = _core_.delete_Rect
1132 __del__ = lambda self : None;
1133 def GetX(*args, **kwargs):
1134 """GetX(self) -> int"""
1135 return _core_.Rect_GetX(*args, **kwargs)
1136
1137 def SetX(*args, **kwargs):
1138 """SetX(self, int x)"""
1139 return _core_.Rect_SetX(*args, **kwargs)
1140
1141 def GetY(*args, **kwargs):
1142 """GetY(self) -> int"""
1143 return _core_.Rect_GetY(*args, **kwargs)
1144
1145 def SetY(*args, **kwargs):
1146 """SetY(self, int y)"""
1147 return _core_.Rect_SetY(*args, **kwargs)
1148
1149 def GetWidth(*args, **kwargs):
1150 """GetWidth(self) -> int"""
1151 return _core_.Rect_GetWidth(*args, **kwargs)
1152
1153 def SetWidth(*args, **kwargs):
1154 """SetWidth(self, int w)"""
1155 return _core_.Rect_SetWidth(*args, **kwargs)
1156
1157 def GetHeight(*args, **kwargs):
1158 """GetHeight(self) -> int"""
1159 return _core_.Rect_GetHeight(*args, **kwargs)
1160
1161 def SetHeight(*args, **kwargs):
1162 """SetHeight(self, int h)"""
1163 return _core_.Rect_SetHeight(*args, **kwargs)
1164
1165 def GetPosition(*args, **kwargs):
1166 """GetPosition(self) -> Point"""
1167 return _core_.Rect_GetPosition(*args, **kwargs)
1168
1169 def SetPosition(*args, **kwargs):
1170 """SetPosition(self, Point p)"""
1171 return _core_.Rect_SetPosition(*args, **kwargs)
1172
1173 def GetSize(*args, **kwargs):
1174 """GetSize(self) -> Size"""
1175 return _core_.Rect_GetSize(*args, **kwargs)
1176
1177 def SetSize(*args, **kwargs):
1178 """SetSize(self, Size s)"""
1179 return _core_.Rect_SetSize(*args, **kwargs)
1180
1181 def IsEmpty(*args, **kwargs):
1182 """IsEmpty(self) -> bool"""
1183 return _core_.Rect_IsEmpty(*args, **kwargs)
1184
1185 def GetTopLeft(*args, **kwargs):
1186 """GetTopLeft(self) -> Point"""
1187 return _core_.Rect_GetTopLeft(*args, **kwargs)
1188
1189 def SetTopLeft(*args, **kwargs):
1190 """SetTopLeft(self, Point p)"""
1191 return _core_.Rect_SetTopLeft(*args, **kwargs)
1192
1193 def GetBottomRight(*args, **kwargs):
1194 """GetBottomRight(self) -> Point"""
1195 return _core_.Rect_GetBottomRight(*args, **kwargs)
1196
1197 def SetBottomRight(*args, **kwargs):
1198 """SetBottomRight(self, Point p)"""
1199 return _core_.Rect_SetBottomRight(*args, **kwargs)
1200
1201 def GetTopRight(*args, **kwargs):
1202 """GetTopRight(self) -> Point"""
1203 return _core_.Rect_GetTopRight(*args, **kwargs)
1204
1205 def SetTopRight(*args, **kwargs):
1206 """SetTopRight(self, Point p)"""
1207 return _core_.Rect_SetTopRight(*args, **kwargs)
1208
1209 def GetBottomLeft(*args, **kwargs):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1212
1213 def SetBottomLeft(*args, **kwargs):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1216
1217 def GetLeft(*args, **kwargs):
1218 """GetLeft(self) -> int"""
1219 return _core_.Rect_GetLeft(*args, **kwargs)
1220
1221 def GetTop(*args, **kwargs):
1222 """GetTop(self) -> int"""
1223 return _core_.Rect_GetTop(*args, **kwargs)
1224
1225 def GetBottom(*args, **kwargs):
1226 """GetBottom(self) -> int"""
1227 return _core_.Rect_GetBottom(*args, **kwargs)
1228
1229 def GetRight(*args, **kwargs):
1230 """GetRight(self) -> int"""
1231 return _core_.Rect_GetRight(*args, **kwargs)
1232
1233 def SetLeft(*args, **kwargs):
1234 """SetLeft(self, int left)"""
1235 return _core_.Rect_SetLeft(*args, **kwargs)
1236
1237 def SetRight(*args, **kwargs):
1238 """SetRight(self, int right)"""
1239 return _core_.Rect_SetRight(*args, **kwargs)
1240
1241 def SetTop(*args, **kwargs):
1242 """SetTop(self, int top)"""
1243 return _core_.Rect_SetTop(*args, **kwargs)
1244
1245 def SetBottom(*args, **kwargs):
1246 """SetBottom(self, int bottom)"""
1247 return _core_.Rect_SetBottom(*args, **kwargs)
1248
1249 position = property(GetPosition, SetPosition)
1250 size = property(GetSize, SetSize)
1251 left = property(GetLeft, SetLeft)
1252 right = property(GetRight, SetRight)
1253 top = property(GetTop, SetTop)
1254 bottom = property(GetBottom, SetBottom)
1255
1256 def Inflate(*args, **kwargs):
1257 """
1258 Inflate(self, int dx, int dy) -> Rect
1259
1260 Increases the size of the rectangle.
1261
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1268 direction.
1269
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1272 first::
1273
1274 copy = wx.Rect(*original)
1275 copy.Inflate(10,15)
1276
1277
1278 """
1279 return _core_.Rect_Inflate(*args, **kwargs)
1280
1281 def Deflate(*args, **kwargs):
1282 """
1283 Deflate(self, int dx, int dy) -> Rect
1284
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
1288 """
1289 return _core_.Rect_Deflate(*args, **kwargs)
1290
1291 def OffsetXY(*args, **kwargs):
1292 """
1293 OffsetXY(self, int dx, int dy)
1294
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
1298 """
1299 return _core_.Rect_OffsetXY(*args, **kwargs)
1300
1301 def Offset(*args, **kwargs):
1302 """
1303 Offset(self, Point pt)
1304
1305 Same as `OffsetXY` but uses dx,dy from Point
1306 """
1307 return _core_.Rect_Offset(*args, **kwargs)
1308
1309 def Intersect(*args, **kwargs):
1310 """
1311 Intersect(self, Rect rect) -> Rect
1312
1313 Returns the intersectsion of this rectangle and rect.
1314 """
1315 return _core_.Rect_Intersect(*args, **kwargs)
1316
1317 def Union(*args, **kwargs):
1318 """
1319 Union(self, Rect rect) -> Rect
1320
1321 Returns the union of this rectangle and rect.
1322 """
1323 return _core_.Rect_Union(*args, **kwargs)
1324
1325 def __add__(*args, **kwargs):
1326 """
1327 __add__(self, Rect rect) -> Rect
1328
1329 Add the properties of rect to this rectangle and return the result.
1330 """
1331 return _core_.Rect___add__(*args, **kwargs)
1332
1333 def __iadd__(*args, **kwargs):
1334 """
1335 __iadd__(self, Rect rect) -> Rect
1336
1337 Add the properties of rect to this rectangle, updating this rectangle.
1338 """
1339 return _core_.Rect___iadd__(*args, **kwargs)
1340
1341 def __eq__(*args, **kwargs):
1342 """
1343 __eq__(self, PyObject other) -> bool
1344
1345 Test for equality of wx.Rect objects.
1346 """
1347 return _core_.Rect___eq__(*args, **kwargs)
1348
1349 def __ne__(*args, **kwargs):
1350 """
1351 __ne__(self, PyObject other) -> bool
1352
1353 Test for inequality of wx.Rect objects.
1354 """
1355 return _core_.Rect___ne__(*args, **kwargs)
1356
1357 def ContainsXY(*args, **kwargs):
1358 """
1359 ContainsXY(self, int x, int y) -> bool
1360
1361 Return True if the point is inside the rect.
1362 """
1363 return _core_.Rect_ContainsXY(*args, **kwargs)
1364
1365 def Contains(*args, **kwargs):
1366 """
1367 Contains(self, Point pt) -> bool
1368
1369 Return True if the point is inside the rect.
1370 """
1371 return _core_.Rect_Contains(*args, **kwargs)
1372
1373 def ContainsRect(*args, **kwargs):
1374 """
1375 ContainsRect(self, Rect rect) -> bool
1376
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1379 """
1380 return _core_.Rect_ContainsRect(*args, **kwargs)
1381
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1385 Inside = Contains
1386 InsideXY = ContainsXY
1387 InsideRect = ContainsRect
1388
1389 def Intersects(*args, **kwargs):
1390 """
1391 Intersects(self, Rect rect) -> bool
1392
1393 Returns True if the rectangles have a non empty intersection.
1394 """
1395 return _core_.Rect_Intersects(*args, **kwargs)
1396
1397 def CenterIn(*args, **kwargs):
1398 """
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1400
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1403 """
1404 return _core_.Rect_CenterIn(*args, **kwargs)
1405
1406 CentreIn = CenterIn
1407 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1408 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1409 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1410 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1411 def Set(*args, **kwargs):
1412 """
1413 Set(self, int x=0, int y=0, int width=0, int height=0)
1414
1415 Set all rectangle properties.
1416 """
1417 return _core_.Rect_Set(*args, **kwargs)
1418
1419 def Get(*args, **kwargs):
1420 """
1421 Get() -> (x,y,width,height)
1422
1423 Return the rectangle properties as a tuple.
1424 """
1425 return _core_.Rect_Get(*args, **kwargs)
1426
1427 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1428 def __str__(self): return str(self.Get())
1429 def __repr__(self): return 'wx.Rect'+str(self.Get())
1430 def __len__(self): return len(self.Get())
1431 def __getitem__(self, index): return self.Get()[index]
1432 def __setitem__(self, index, val):
1433 if index == 0: self.x = val
1434 elif index == 1: self.y = val
1435 elif index == 2: self.width = val
1436 elif index == 3: self.height = val
1437 else: raise IndexError
1438 def __nonzero__(self): return self.Get() != (0,0,0,0)
1439 __safe_for_unpickling__ = True
1440 def __reduce__(self): return (wx.Rect, self.Get())
1441
1442 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1443 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
1444 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
1445 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1446 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1447 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1448 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1449 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1450 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1451 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
1452 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
1453 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1454 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1455 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1456 Empty = property(IsEmpty,doc="See `IsEmpty`")
1457 _core_.Rect_swigregister(Rect)
1458
1459 def RectPP(*args, **kwargs):
1460 """
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
1462
1463 Create a new Rect object from Points representing two corners.
1464 """
1465 val = _core_.new_RectPP(*args, **kwargs)
1466 return val
1467
1468 def RectPS(*args, **kwargs):
1469 """
1470 RectPS(Point pos, Size size) -> Rect
1471
1472 Create a new Rect from a position and size.
1473 """
1474 val = _core_.new_RectPS(*args, **kwargs)
1475 return val
1476
1477 def RectS(*args, **kwargs):
1478 """
1479 RectS(Size size) -> Rect
1480
1481 Create a new Rect from a size only.
1482 """
1483 val = _core_.new_RectS(*args, **kwargs)
1484 return val
1485
1486
1487 def IntersectRect(*args, **kwargs):
1488 """
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1490
1491 Calculate and return the intersection of r1 and r2.
1492 """
1493 return _core_.IntersectRect(*args, **kwargs)
1494 #---------------------------------------------------------------------------
1495
1496 class Point2D(object):
1497 """
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1500 """
1501 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1502 __repr__ = _swig_repr
1503 def __init__(self, *args, **kwargs):
1504 """
1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
1506
1507 Create a w.Point2D object.
1508 """
1509 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1510 __swig_destroy__ = _core_.delete_Point2D
1511 __del__ = lambda self : None;
1512 def GetFloor(*args, **kwargs):
1513 """
1514 GetFloor() -> (x,y)
1515
1516 Convert to integer
1517 """
1518 return _core_.Point2D_GetFloor(*args, **kwargs)
1519
1520 def GetRounded(*args, **kwargs):
1521 """
1522 GetRounded() -> (x,y)
1523
1524 Convert to integer
1525 """
1526 return _core_.Point2D_GetRounded(*args, **kwargs)
1527
1528 def GetVectorLength(*args, **kwargs):
1529 """GetVectorLength(self) -> double"""
1530 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1531
1532 def GetVectorAngle(*args, **kwargs):
1533 """GetVectorAngle(self) -> double"""
1534 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1535
1536 def SetVectorLength(*args, **kwargs):
1537 """SetVectorLength(self, double length)"""
1538 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1539
1540 def SetVectorAngle(*args, **kwargs):
1541 """SetVectorAngle(self, double degrees)"""
1542 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1543
1544 def SetPolarCoordinates(self, angle, length):
1545 self.SetVectorLength(length)
1546 self.SetVectorAngle(angle)
1547 def Normalize(self):
1548 self.SetVectorLength(1.0)
1549
1550 def GetDistance(*args, **kwargs):
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_.Point2D_GetDistance(*args, **kwargs)
1553
1554 def GetDistanceSquare(*args, **kwargs):
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1557
1558 def GetDotProduct(*args, **kwargs):
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1561
1562 def GetCrossProduct(*args, **kwargs):
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1565
1566 def __neg__(*args, **kwargs):
1567 """
1568 __neg__(self) -> Point2D
1569
1570 the reflection of this point
1571 """
1572 return _core_.Point2D___neg__(*args, **kwargs)
1573
1574 def __iadd__(*args, **kwargs):
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___iadd__(*args, **kwargs)
1577
1578 def __isub__(*args, **kwargs):
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___isub__(*args, **kwargs)
1581
1582 def __imul__(*args, **kwargs):
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_.Point2D___imul__(*args, **kwargs)
1585
1586 def __idiv__(*args, **kwargs):
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_.Point2D___idiv__(*args, **kwargs)
1589
1590 def __eq__(*args, **kwargs):
1591 """
1592 __eq__(self, PyObject other) -> bool
1593
1594 Test for equality of wx.Point2D objects.
1595 """
1596 return _core_.Point2D___eq__(*args, **kwargs)
1597
1598 def __ne__(*args, **kwargs):
1599 """
1600 __ne__(self, PyObject other) -> bool
1601
1602 Test for inequality of wx.Point2D objects.
1603 """
1604 return _core_.Point2D___ne__(*args, **kwargs)
1605
1606 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1607 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1608 def Set(*args, **kwargs):
1609 """Set(self, double x=0, double y=0)"""
1610 return _core_.Point2D_Set(*args, **kwargs)
1611
1612 def Get(*args, **kwargs):
1613 """
1614 Get() -> (x,y)
1615
1616 Return x and y properties as a tuple.
1617 """
1618 return _core_.Point2D_Get(*args, **kwargs)
1619
1620 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1621 def __str__(self): return str(self.Get())
1622 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1623 def __len__(self): return len(self.Get())
1624 def __getitem__(self, index): return self.Get()[index]
1625 def __setitem__(self, index, val):
1626 if index == 0: self.x = val
1627 elif index == 1: self.y = val
1628 else: raise IndexError
1629 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1630 __safe_for_unpickling__ = True
1631 def __reduce__(self): return (wx.Point2D, self.Get())
1632
1633 Floor = property(GetFloor,doc="See `GetFloor`")
1634 Rounded = property(GetRounded,doc="See `GetRounded`")
1635 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
1637 _core_.Point2D_swigregister(Point2D)
1638
1639 def Point2DCopy(*args, **kwargs):
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
1642
1643 Create a w.Point2D object.
1644 """
1645 val = _core_.new_Point2DCopy(*args, **kwargs)
1646 return val
1647
1648 def Point2DFromPoint(*args, **kwargs):
1649 """
1650 Point2DFromPoint(Point pt) -> Point2D
1651
1652 Create a w.Point2D object.
1653 """
1654 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1655 return val
1656
1657 #---------------------------------------------------------------------------
1658
1659 Inside = _core_.Inside
1660 OutLeft = _core_.OutLeft
1661 OutRight = _core_.OutRight
1662 OutTop = _core_.OutTop
1663 OutBottom = _core_.OutBottom
1664 class Rect2D(object):
1665 """
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1668 """
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 __repr__ = _swig_repr
1671 def __init__(self, *args, **kwargs):
1672 """
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1674
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1677 """
1678 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1679 __swig_destroy__ = _core_.delete_Rect2D
1680 __del__ = lambda self : None;
1681 def GetPosition(*args, **kwargs):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_.Rect2D_GetPosition(*args, **kwargs)
1684
1685 def GetSize(*args, **kwargs):
1686 """GetSize(self) -> Size"""
1687 return _core_.Rect2D_GetSize(*args, **kwargs)
1688
1689 def GetLeft(*args, **kwargs):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_.Rect2D_GetLeft(*args, **kwargs)
1692
1693 def SetLeft(*args, **kwargs):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_.Rect2D_SetLeft(*args, **kwargs)
1696
1697 def MoveLeftTo(*args, **kwargs):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1700
1701 def GetTop(*args, **kwargs):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_.Rect2D_GetTop(*args, **kwargs)
1704
1705 def SetTop(*args, **kwargs):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_.Rect2D_SetTop(*args, **kwargs)
1708
1709 def MoveTopTo(*args, **kwargs):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1712
1713 def GetBottom(*args, **kwargs):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_.Rect2D_GetBottom(*args, **kwargs)
1716
1717 def SetBottom(*args, **kwargs):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_.Rect2D_SetBottom(*args, **kwargs)
1720
1721 def MoveBottomTo(*args, **kwargs):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1724
1725 def GetRight(*args, **kwargs):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_.Rect2D_GetRight(*args, **kwargs)
1728
1729 def SetRight(*args, **kwargs):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_.Rect2D_SetRight(*args, **kwargs)
1732
1733 def MoveRightTo(*args, **kwargs):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1736
1737 def GetLeftTop(*args, **kwargs):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1740
1741 def SetLeftTop(*args, **kwargs):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1744
1745 def MoveLeftTopTo(*args, **kwargs):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1748
1749 def GetLeftBottom(*args, **kwargs):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1752
1753 def SetLeftBottom(*args, **kwargs):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1756
1757 def MoveLeftBottomTo(*args, **kwargs):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1760
1761 def GetRightTop(*args, **kwargs):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1764
1765 def SetRightTop(*args, **kwargs):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1768
1769 def MoveRightTopTo(*args, **kwargs):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1772
1773 def GetRightBottom(*args, **kwargs):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1776
1777 def SetRightBottom(*args, **kwargs):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1780
1781 def MoveRightBottomTo(*args, **kwargs):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1784
1785 def GetCentre(*args, **kwargs):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_.Rect2D_GetCentre(*args, **kwargs)
1788
1789 def SetCentre(*args, **kwargs):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_.Rect2D_SetCentre(*args, **kwargs)
1792
1793 def MoveCentreTo(*args, **kwargs):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1796
1797 def GetOutcode(*args, **kwargs):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1800
1801 def Contains(*args, **kwargs):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_.Rect2D_Contains(*args, **kwargs)
1804
1805 def ContainsRect(*args, **kwargs):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1808
1809 def IsEmpty(*args, **kwargs):
1810 """IsEmpty(self) -> bool"""
1811 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1812
1813 def HaveEqualSize(*args, **kwargs):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1816
1817 def Inset(*args):
1818 """
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1821 """
1822 return _core_.Rect2D_Inset(*args)
1823
1824 def Offset(*args, **kwargs):
1825 """Offset(self, Point2D pt)"""
1826 return _core_.Rect2D_Offset(*args, **kwargs)
1827
1828 def ConstrainTo(*args, **kwargs):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1831
1832 def Interpolate(*args, **kwargs):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_.Rect2D_Interpolate(*args, **kwargs)
1835
1836 def Intersect(*args, **kwargs):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_.Rect2D_Intersect(*args, **kwargs)
1839
1840 def CreateIntersection(*args, **kwargs):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1843
1844 def Intersects(*args, **kwargs):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_.Rect2D_Intersects(*args, **kwargs)
1847
1848 def Union(*args, **kwargs):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_.Rect2D_Union(*args, **kwargs)
1851
1852 def CreateUnion(*args, **kwargs):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1855
1856 def Scale(*args):
1857 """
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1860 """
1861 return _core_.Rect2D_Scale(*args)
1862
1863 def __eq__(*args, **kwargs):
1864 """
1865 __eq__(self, PyObject other) -> bool
1866
1867 Test for equality of wx.Rect2D objects.
1868 """
1869 return _core_.Rect2D___eq__(*args, **kwargs)
1870
1871 def __ne__(*args, **kwargs):
1872 """
1873 __ne__(self, PyObject other) -> bool
1874
1875 Test for inequality of wx.Rect2D objects.
1876 """
1877 return _core_.Rect2D___ne__(*args, **kwargs)
1878
1879 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1880 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1881 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1882 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1883 def Set(*args, **kwargs):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_.Rect2D_Set(*args, **kwargs)
1886
1887 def Get(*args, **kwargs):
1888 """
1889 Get() -> (x,y, width, height)
1890
1891 Return x, y, width and height y properties as a tuple.
1892 """
1893 return _core_.Rect2D_Get(*args, **kwargs)
1894
1895 def __str__(self): return str(self.Get())
1896 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1897 def __len__(self): return len(self.Get())
1898 def __getitem__(self, index): return self.Get()[index]
1899 def __setitem__(self, index, val):
1900 if index == 0: self.x = val
1901 elif index == 1: self.y = val
1902 elif index == 2: self.width = val
1903 elif index == 3: self.height = val
1904 else: raise IndexError
1905 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__ = True
1907 def __reduce__(self): return (wx.Rect2D, self.Get())
1908
1909 _core_.Rect2D_swigregister(Rect2D)
1910
1911 class Position(object):
1912 """Proxy of C++ Position class"""
1913 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1914 __repr__ = _swig_repr
1915 def __init__(self, *args, **kwargs):
1916 """__init__(self, int row=0, int col=0) -> Position"""
1917 _core_.Position_swiginit(self,_core_.new_Position(*args, **kwargs))
1918 __swig_destroy__ = _core_.delete_Position
1919 __del__ = lambda self : None;
1920 def GetRow(*args, **kwargs):
1921 """GetRow(self) -> int"""
1922 return _core_.Position_GetRow(*args, **kwargs)
1923
1924 def GetColumn(*args, **kwargs):
1925 """GetColumn(self) -> int"""
1926 return _core_.Position_GetColumn(*args, **kwargs)
1927
1928 def GetCol(*args, **kwargs):
1929 """GetCol(self) -> int"""
1930 return _core_.Position_GetCol(*args, **kwargs)
1931
1932 def SetRow(*args, **kwargs):
1933 """SetRow(self, int row)"""
1934 return _core_.Position_SetRow(*args, **kwargs)
1935
1936 def SetColumn(*args, **kwargs):
1937 """SetColumn(self, int column)"""
1938 return _core_.Position_SetColumn(*args, **kwargs)
1939
1940 def SetCol(*args, **kwargs):
1941 """SetCol(self, int column)"""
1942 return _core_.Position_SetCol(*args, **kwargs)
1943
1944 def __eq__(*args, **kwargs):
1945 """
1946 __eq__(self, PyObject other) -> bool
1947
1948 Test for equality of wx.Position objects.
1949 """
1950 return _core_.Position___eq__(*args, **kwargs)
1951
1952 def __ne__(*args, **kwargs):
1953 """
1954 __ne__(self, PyObject other) -> bool
1955
1956 Test for inequality of wx.Position objects.
1957 """
1958 return _core_.Position___ne__(*args, **kwargs)
1959
1960 def __add__(*args):
1961 """
1962 __add__(self, Position p) -> Position
1963 __add__(self, Size s) -> Position
1964 """
1965 return _core_.Position___add__(*args)
1966
1967 def __sub__(*args):
1968 """
1969 __sub__(self, Position p) -> Position
1970 __sub__(self, Size s) -> Position
1971 """
1972 return _core_.Position___sub__(*args)
1973
1974 row = property(GetRow,SetRow)
1975 col = property(GetCol,SetCol)
1976 _core_.Position_swigregister(Position)
1977
1978 #---------------------------------------------------------------------------
1979
1980 FromStart = _core_.FromStart
1981 FromCurrent = _core_.FromCurrent
1982 FromEnd = _core_.FromEnd
1983 class InputStream(object):
1984 """Proxy of C++ InputStream class"""
1985 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1986 __repr__ = _swig_repr
1987 def __init__(self, *args, **kwargs):
1988 """__init__(self, PyObject p) -> InputStream"""
1989 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1990 __swig_destroy__ = _core_.delete_InputStream
1991 __del__ = lambda self : None;
1992 def close(*args, **kwargs):
1993 """close(self)"""
1994 return _core_.InputStream_close(*args, **kwargs)
1995
1996 def flush(*args, **kwargs):
1997 """flush(self)"""
1998 return _core_.InputStream_flush(*args, **kwargs)
1999
2000 def eof(*args, **kwargs):
2001 """eof(self) -> bool"""
2002 return _core_.InputStream_eof(*args, **kwargs)
2003
2004 def read(*args, **kwargs):
2005 """read(self, int size=-1) -> PyObject"""
2006 return _core_.InputStream_read(*args, **kwargs)
2007
2008 def readline(*args, **kwargs):
2009 """readline(self, int size=-1) -> PyObject"""
2010 return _core_.InputStream_readline(*args, **kwargs)
2011
2012 def readlines(*args, **kwargs):
2013 """readlines(self, int sizehint=-1) -> PyObject"""
2014 return _core_.InputStream_readlines(*args, **kwargs)
2015
2016 def seek(*args, **kwargs):
2017 """seek(self, int offset, int whence=0)"""
2018 return _core_.InputStream_seek(*args, **kwargs)
2019
2020 def tell(*args, **kwargs):
2021 """tell(self) -> int"""
2022 return _core_.InputStream_tell(*args, **kwargs)
2023
2024 def Peek(*args, **kwargs):
2025 """Peek(self) -> char"""
2026 return _core_.InputStream_Peek(*args, **kwargs)
2027
2028 def GetC(*args, **kwargs):
2029 """GetC(self) -> char"""
2030 return _core_.InputStream_GetC(*args, **kwargs)
2031
2032 def LastRead(*args, **kwargs):
2033 """LastRead(self) -> size_t"""
2034 return _core_.InputStream_LastRead(*args, **kwargs)
2035
2036 def CanRead(*args, **kwargs):
2037 """CanRead(self) -> bool"""
2038 return _core_.InputStream_CanRead(*args, **kwargs)
2039
2040 def Eof(*args, **kwargs):
2041 """Eof(self) -> bool"""
2042 return _core_.InputStream_Eof(*args, **kwargs)
2043
2044 def Ungetch(*args, **kwargs):
2045 """Ungetch(self, char c) -> bool"""
2046 return _core_.InputStream_Ungetch(*args, **kwargs)
2047
2048 def SeekI(*args, **kwargs):
2049 """SeekI(self, long pos, int mode=FromStart) -> long"""
2050 return _core_.InputStream_SeekI(*args, **kwargs)
2051
2052 def TellI(*args, **kwargs):
2053 """TellI(self) -> long"""
2054 return _core_.InputStream_TellI(*args, **kwargs)
2055
2056 _core_.InputStream_swigregister(InputStream)
2057 DefaultPosition = cvar.DefaultPosition
2058 DefaultSize = cvar.DefaultSize
2059
2060 class OutputStream(object):
2061 """Proxy of C++ OutputStream class"""
2062 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2063 def __init__(self): raise AttributeError, "No constructor defined"
2064 __repr__ = _swig_repr
2065 def write(*args, **kwargs):
2066 """write(self, PyObject obj)"""
2067 return _core_.OutputStream_write(*args, **kwargs)
2068
2069 def LastWrite(*args, **kwargs):
2070 """LastWrite(self) -> size_t"""
2071 return _core_.OutputStream_LastWrite(*args, **kwargs)
2072
2073 _core_.OutputStream_swigregister(OutputStream)
2074
2075 #---------------------------------------------------------------------------
2076
2077 class FSFile(Object):
2078 """Proxy of C++ FSFile class"""
2079 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2080 __repr__ = _swig_repr
2081 def __init__(self, *args, **kwargs):
2082 """
2083 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2084 DateTime modif) -> FSFile
2085 """
2086 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
2087 __swig_destroy__ = _core_.delete_FSFile
2088 __del__ = lambda self : None;
2089 def GetStream(*args, **kwargs):
2090 """GetStream(self) -> InputStream"""
2091 return _core_.FSFile_GetStream(*args, **kwargs)
2092
2093 def DetachStream(*args, **kwargs):
2094 """DetachStream(self)"""
2095 return _core_.FSFile_DetachStream(*args, **kwargs)
2096
2097 def GetMimeType(*args, **kwargs):
2098 """GetMimeType(self) -> String"""
2099 return _core_.FSFile_GetMimeType(*args, **kwargs)
2100
2101 def GetLocation(*args, **kwargs):
2102 """GetLocation(self) -> String"""
2103 return _core_.FSFile_GetLocation(*args, **kwargs)
2104
2105 def GetAnchor(*args, **kwargs):
2106 """GetAnchor(self) -> String"""
2107 return _core_.FSFile_GetAnchor(*args, **kwargs)
2108
2109 def GetModificationTime(*args, **kwargs):
2110 """GetModificationTime(self) -> DateTime"""
2111 return _core_.FSFile_GetModificationTime(*args, **kwargs)
2112
2113 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2114 Location = property(GetLocation,doc="See `GetLocation`")
2115 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2116 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2117 Stream = property(GetStream,doc="See `GetStream`")
2118 _core_.FSFile_swigregister(FSFile)
2119
2120 class CPPFileSystemHandler(object):
2121 """Proxy of C++ CPPFileSystemHandler class"""
2122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2123 def __init__(self): raise AttributeError, "No constructor defined"
2124 __repr__ = _swig_repr
2125 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2126 __del__ = lambda self : None;
2127 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
2128
2129 class FileSystemHandler(CPPFileSystemHandler):
2130 """Proxy of C++ FileSystemHandler class"""
2131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2132 __repr__ = _swig_repr
2133 def __init__(self, *args, **kwargs):
2134 """__init__(self) -> FileSystemHandler"""
2135 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
2136 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
2137
2138 def _setCallbackInfo(*args, **kwargs):
2139 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2140 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
2141
2142 def CanOpen(*args, **kwargs):
2143 """CanOpen(self, String location) -> bool"""
2144 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
2145
2146 def OpenFile(*args, **kwargs):
2147 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2148 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
2149
2150 def FindFirst(*args, **kwargs):
2151 """FindFirst(self, String spec, int flags=0) -> String"""
2152 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
2153
2154 def FindNext(*args, **kwargs):
2155 """FindNext(self) -> String"""
2156 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
2157
2158 def GetProtocol(*args, **kwargs):
2159 """GetProtocol(self, String location) -> String"""
2160 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
2161
2162 def GetLeftLocation(*args, **kwargs):
2163 """GetLeftLocation(self, String location) -> String"""
2164 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
2165
2166 def GetAnchor(*args, **kwargs):
2167 """GetAnchor(self, String location) -> String"""
2168 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
2169
2170 def GetRightLocation(*args, **kwargs):
2171 """GetRightLocation(self, String location) -> String"""
2172 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
2173
2174 def GetMimeTypeFromExt(*args, **kwargs):
2175 """GetMimeTypeFromExt(self, String location) -> String"""
2176 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
2177
2178 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2179 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2180 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2181 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2182 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2183 _core_.FileSystemHandler_swigregister(FileSystemHandler)
2184
2185 class FileSystem(Object):
2186 """Proxy of C++ FileSystem class"""
2187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2188 __repr__ = _swig_repr
2189 def __init__(self, *args, **kwargs):
2190 """__init__(self) -> FileSystem"""
2191 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2192 __swig_destroy__ = _core_.delete_FileSystem
2193 __del__ = lambda self : None;
2194 def ChangePathTo(*args, **kwargs):
2195 """ChangePathTo(self, String location, bool is_dir=False)"""
2196 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
2197
2198 def GetPath(*args, **kwargs):
2199 """GetPath(self) -> String"""
2200 return _core_.FileSystem_GetPath(*args, **kwargs)
2201
2202 def OpenFile(*args, **kwargs):
2203 """OpenFile(self, String location) -> FSFile"""
2204 return _core_.FileSystem_OpenFile(*args, **kwargs)
2205
2206 def FindFirst(*args, **kwargs):
2207 """FindFirst(self, String spec, int flags=0) -> String"""
2208 return _core_.FileSystem_FindFirst(*args, **kwargs)
2209
2210 def FindNext(*args, **kwargs):
2211 """FindNext(self) -> String"""
2212 return _core_.FileSystem_FindNext(*args, **kwargs)
2213
2214 def AddHandler(*args, **kwargs):
2215 """AddHandler(CPPFileSystemHandler handler)"""
2216 return _core_.FileSystem_AddHandler(*args, **kwargs)
2217
2218 AddHandler = staticmethod(AddHandler)
2219 def RemoveHandler(*args, **kwargs):
2220 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2221 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2222
2223 RemoveHandler = staticmethod(RemoveHandler)
2224 def CleanUpHandlers(*args, **kwargs):
2225 """CleanUpHandlers()"""
2226 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
2227
2228 CleanUpHandlers = staticmethod(CleanUpHandlers)
2229 def FileNameToURL(*args, **kwargs):
2230 """FileNameToURL(String filename) -> String"""
2231 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
2232
2233 FileNameToURL = staticmethod(FileNameToURL)
2234 def URLToFileName(*args, **kwargs):
2235 """URLToFileName(String url) -> String"""
2236 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2237
2238 URLToFileName = staticmethod(URLToFileName)
2239 Path = property(GetPath,doc="See `GetPath`")
2240 _core_.FileSystem_swigregister(FileSystem)
2241
2242 def FileSystem_AddHandler(*args, **kwargs):
2243 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2244 return _core_.FileSystem_AddHandler(*args, **kwargs)
2245
2246 def FileSystem_RemoveHandler(*args, **kwargs):
2247 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2248 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2249
2250 def FileSystem_CleanUpHandlers(*args):
2251 """FileSystem_CleanUpHandlers()"""
2252 return _core_.FileSystem_CleanUpHandlers(*args)
2253
2254 def FileSystem_FileNameToURL(*args, **kwargs):
2255 """FileSystem_FileNameToURL(String filename) -> String"""
2256 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
2257
2258 def FileSystem_URLToFileName(*args, **kwargs):
2259 """FileSystem_URLToFileName(String url) -> String"""
2260 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2261
2262 class InternetFSHandler(CPPFileSystemHandler):
2263 """Proxy of C++ InternetFSHandler class"""
2264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2265 __repr__ = _swig_repr
2266 def __init__(self, *args, **kwargs):
2267 """__init__(self) -> InternetFSHandler"""
2268 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
2269 def CanOpen(*args, **kwargs):
2270 """CanOpen(self, String location) -> bool"""
2271 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
2272
2273 def OpenFile(*args, **kwargs):
2274 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2275 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
2276
2277 _core_.InternetFSHandler_swigregister(InternetFSHandler)
2278
2279 class ZipFSHandler(CPPFileSystemHandler):
2280 """Proxy of C++ ZipFSHandler class"""
2281 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2282 __repr__ = _swig_repr
2283 def __init__(self, *args, **kwargs):
2284 """__init__(self) -> ZipFSHandler"""
2285 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
2286 def CanOpen(*args, **kwargs):
2287 """CanOpen(self, String location) -> bool"""
2288 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
2289
2290 def OpenFile(*args, **kwargs):
2291 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2292 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
2293
2294 def FindFirst(*args, **kwargs):
2295 """FindFirst(self, String spec, int flags=0) -> String"""
2296 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
2297
2298 def FindNext(*args, **kwargs):
2299 """FindNext(self) -> String"""
2300 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
2301
2302 _core_.ZipFSHandler_swigregister(ZipFSHandler)
2303
2304
2305 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
2306 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2307 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
2308
2309 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
2310 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2311 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
2312
2313 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
2314 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2315 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2316 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2317 """
2318 Add 'file' to the memory filesystem. The dataItem parameter can
2319 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2320 arbitrary data. If a bitmap or image is used then the imgType
2321 parameter should specify what kind of image file it should be
2322 written as, wx.BITMAP_TYPE_PNG, etc.
2323 """
2324 if isinstance(dataItem, wx.Image):
2325 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2326 elif isinstance(dataItem, wx.Bitmap):
2327 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2328 elif type(dataItem) == str:
2329 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2330 else:
2331 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2332
2333 class MemoryFSHandler(CPPFileSystemHandler):
2334 """Proxy of C++ MemoryFSHandler class"""
2335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2336 __repr__ = _swig_repr
2337 def __init__(self, *args, **kwargs):
2338 """__init__(self) -> MemoryFSHandler"""
2339 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
2340 def RemoveFile(*args, **kwargs):
2341 """RemoveFile(String filename)"""
2342 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2343
2344 RemoveFile = staticmethod(RemoveFile)
2345 AddFile = staticmethod(MemoryFSHandler_AddFile)
2346 def CanOpen(*args, **kwargs):
2347 """CanOpen(self, String location) -> bool"""
2348 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2349
2350 def OpenFile(*args, **kwargs):
2351 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2352 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2353
2354 def FindFirst(*args, **kwargs):
2355 """FindFirst(self, String spec, int flags=0) -> String"""
2356 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2357
2358 def FindNext(*args, **kwargs):
2359 """FindNext(self) -> String"""
2360 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2361
2362 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
2363
2364 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2365 """MemoryFSHandler_RemoveFile(String filename)"""
2366 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2367
2368 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2369 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2370 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2371 IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2372 IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
2373 #---------------------------------------------------------------------------
2374
2375 class ImageHandler(Object):
2376 """
2377 This is the base class for implementing image file loading/saving, and
2378 image creation from data. It is used within `wx.Image` and is not
2379 normally seen by the application.
2380 """
2381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2382 def __init__(self): raise AttributeError, "No constructor defined"
2383 __repr__ = _swig_repr
2384 def GetName(*args, **kwargs):
2385 """GetName(self) -> String"""
2386 return _core_.ImageHandler_GetName(*args, **kwargs)
2387
2388 def GetExtension(*args, **kwargs):
2389 """GetExtension(self) -> String"""
2390 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2391
2392 def GetType(*args, **kwargs):
2393 """GetType(self) -> long"""
2394 return _core_.ImageHandler_GetType(*args, **kwargs)
2395
2396 def GetMimeType(*args, **kwargs):
2397 """GetMimeType(self) -> String"""
2398 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2399
2400 def CanRead(*args, **kwargs):
2401 """CanRead(self, String name) -> bool"""
2402 return _core_.ImageHandler_CanRead(*args, **kwargs)
2403
2404 def CanReadStream(*args, **kwargs):
2405 """CanReadStream(self, InputStream stream) -> bool"""
2406 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2407
2408 def SetName(*args, **kwargs):
2409 """SetName(self, String name)"""
2410 return _core_.ImageHandler_SetName(*args, **kwargs)
2411
2412 def SetExtension(*args, **kwargs):
2413 """SetExtension(self, String extension)"""
2414 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2415
2416 def SetType(*args, **kwargs):
2417 """SetType(self, long type)"""
2418 return _core_.ImageHandler_SetType(*args, **kwargs)
2419
2420 def SetMimeType(*args, **kwargs):
2421 """SetMimeType(self, String mimetype)"""
2422 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2423
2424 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2425 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2426 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2427 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2428 _core_.ImageHandler_swigregister(ImageHandler)
2429
2430 class PyImageHandler(ImageHandler):
2431 """
2432 This is the base class for implementing image file loading/saving, and
2433 image creation from data, all written in Python. To create a custom
2434 image handler derive a new class from wx.PyImageHandler and provide
2435 the following methods::
2436
2437 def DoCanRead(self, stream) --> bool
2438 '''Check if this handler can read the image on the stream'''
2439
2440 def LoadFile(self, image, stream, verbose, index) --> bool
2441 '''Load image data from the stream and load it into image.'''
2442
2443 def SaveFile(self, image, stream, verbose) --> bool
2444 '''Save the iamge data in image to the stream using
2445 this handler's image file format.'''
2446
2447 def GetImageCount(self, stream) --> int
2448 '''If this image format can hold more than one image,
2449 how many does the image on the stream have?'''
2450
2451 To activate your handler create an instance of it and pass it to
2452 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2453 `SetExtension` from your constructor.
2454
2455 """
2456 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2457 __repr__ = _swig_repr
2458 def __init__(self, *args, **kwargs):
2459 """
2460 __init__(self) -> PyImageHandler
2461
2462 This is the base class for implementing image file loading/saving, and
2463 image creation from data, all written in Python. To create a custom
2464 image handler derive a new class from wx.PyImageHandler and provide
2465 the following methods::
2466
2467 def DoCanRead(self, stream) --> bool
2468 '''Check if this handler can read the image on the stream'''
2469
2470 def LoadFile(self, image, stream, verbose, index) --> bool
2471 '''Load image data from the stream and load it into image.'''
2472
2473 def SaveFile(self, image, stream, verbose) --> bool
2474 '''Save the iamge data in image to the stream using
2475 this handler's image file format.'''
2476
2477 def GetImageCount(self, stream) --> int
2478 '''If this image format can hold more than one image,
2479 how many does the image on the stream have?'''
2480
2481 To activate your handler create an instance of it and pass it to
2482 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2483 `SetExtension` from your constructor.
2484
2485 """
2486 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2487 self._SetSelf(self)
2488
2489 def _SetSelf(*args, **kwargs):
2490 """_SetSelf(self, PyObject self)"""
2491 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2492
2493 _core_.PyImageHandler_swigregister(PyImageHandler)
2494
2495 class ImageHistogram(object):
2496 """Proxy of C++ ImageHistogram class"""
2497 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2498 __repr__ = _swig_repr
2499 def __init__(self, *args, **kwargs):
2500 """__init__(self) -> ImageHistogram"""
2501 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2502 def MakeKey(*args, **kwargs):
2503 """
2504 MakeKey(byte r, byte g, byte b) -> unsigned long
2505
2506 Get the key in the histogram for the given RGB values
2507 """
2508 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2509
2510 MakeKey = staticmethod(MakeKey)
2511 def FindFirstUnusedColour(*args, **kwargs):
2512 """
2513 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2514
2515 Find first colour that is not used in the image and has higher RGB
2516 values than startR, startG, startB. Returns a tuple consisting of a
2517 success flag and rgb values.
2518 """
2519 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2520
2521 def GetCount(*args, **kwargs):
2522 """
2523 GetCount(self, unsigned long key) -> unsigned long
2524
2525 Returns the pixel count for the given key. Use `MakeKey` to create a
2526 key value from a RGB tripple.
2527 """
2528 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2529
2530 def GetCountRGB(*args, **kwargs):
2531 """
2532 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2533
2534 Returns the pixel count for the given RGB values.
2535 """
2536 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2537
2538 def GetCountColour(*args, **kwargs):
2539 """
2540 GetCountColour(self, Colour colour) -> unsigned long
2541
2542 Returns the pixel count for the given `wx.Colour` value.
2543 """
2544 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2545
2546 _core_.ImageHistogram_swigregister(ImageHistogram)
2547
2548 def ImageHistogram_MakeKey(*args, **kwargs):
2549 """
2550 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2551
2552 Get the key in the histogram for the given RGB values
2553 """
2554 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2555
2556 class Image_RGBValue(object):
2557 """
2558 An object that contains values for red, green and blue which represent
2559 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2560 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2561 color space.
2562 """
2563 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2564 __repr__ = _swig_repr
2565 def __init__(self, *args, **kwargs):
2566 """
2567 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2568
2569 Constructor.
2570 """
2571 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2572 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2573 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2574 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2575 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2576
2577 class Image_HSVValue(object):
2578 """
2579 An object that contains values for hue, saturation and value which
2580 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2581 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2582 color space.
2583 """
2584 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2585 __repr__ = _swig_repr
2586 def __init__(self, *args, **kwargs):
2587 """
2588 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2589
2590 Constructor.
2591 """
2592 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2593 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2594 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2595 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2596 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2597
2598 class Image(Object):
2599 """
2600 A platform-independent image class. An image can be created from
2601 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2602 variety of formats. Functions are available to set and get image
2603 bits, so it can be used for basic image manipulation.
2604
2605 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2606 platform-specific `wx.Bitmap` object must be created from it using the
2607 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2608 device context, using `wx.DC.DrawBitmap`.
2609
2610 One colour value of the image may be used as a mask colour which will
2611 lead to the automatic creation of a `wx.Mask` object associated to the
2612 bitmap object.
2613
2614 wx.Image supports alpha channel data, that is in addition to a byte
2615 for the red, green and blue colour components for each pixel it also
2616 stores a byte representing the pixel opacity. An alpha value of 0
2617 corresponds to a transparent pixel (null opacity) while a value of 255
2618 means that the pixel is 100% opaque.
2619
2620 Unlike RGB data, not all images have an alpha channel and before using
2621 `GetAlpha` you should check if this image contains an alpha channel
2622 with `HasAlpha`. Note that currently only images loaded from PNG files
2623 with transparency information will have an alpha channel.
2624 """
2625 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2626 __repr__ = _swig_repr
2627 def __init__(self, *args, **kwargs):
2628 """
2629 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2630
2631 Loads an image from a file.
2632 """
2633 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2634 __swig_destroy__ = _core_.delete_Image
2635 __del__ = lambda self : None;
2636 def Create(*args, **kwargs):
2637 """
2638 Create(self, int width, int height, bool clear=True)
2639
2640 Creates a fresh image. If clear is ``True``, the new image will be
2641 initialized to black. Otherwise, the image data will be uninitialized.
2642 """
2643 return _core_.Image_Create(*args, **kwargs)
2644
2645 def Destroy(*args, **kwargs):
2646 """
2647 Destroy(self)
2648
2649 Destroys the image data.
2650 """
2651 args[0].this.own(False)
2652 return _core_.Image_Destroy(*args, **kwargs)
2653
2654 def Scale(*args, **kwargs):
2655 """
2656 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2657
2658 Returns a scaled version of the image. This is also useful for scaling
2659 bitmaps in general as the only other way to scale bitmaps is to blit a
2660 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2661 specifies what method to use for resampling the image. It can be
2662 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2663 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2664 bicubic and box averaging resampling methods for upsampling and
2665 downsampling respectively.
2666 """
2667 return _core_.Image_Scale(*args, **kwargs)
2668
2669 def ResampleBox(*args, **kwargs):
2670 """ResampleBox(self, int width, int height) -> Image"""
2671 return _core_.Image_ResampleBox(*args, **kwargs)
2672
2673 def ResampleBicubic(*args, **kwargs):
2674 """ResampleBicubic(self, int width, int height) -> Image"""
2675 return _core_.Image_ResampleBicubic(*args, **kwargs)
2676
2677 def Blur(*args, **kwargs):
2678 """
2679 Blur(self, int radius) -> Image
2680
2681 Blurs the image in both horizontal and vertical directions by the
2682 specified pixel ``radius``. This should not be used when using a
2683 single mask colour for transparency.
2684 """
2685 return _core_.Image_Blur(*args, **kwargs)
2686
2687 def BlurHorizontal(*args, **kwargs):
2688 """
2689 BlurHorizontal(self, int radius) -> Image
2690
2691 Blurs the image in the horizontal direction only. This should not be
2692 used when using a single mask colour for transparency.
2693
2694 """
2695 return _core_.Image_BlurHorizontal(*args, **kwargs)
2696
2697 def BlurVertical(*args, **kwargs):
2698 """
2699 BlurVertical(self, int radius) -> Image
2700
2701 Blurs the image in the vertical direction only. This should not be
2702 used when using a single mask colour for transparency.
2703 """
2704 return _core_.Image_BlurVertical(*args, **kwargs)
2705
2706 def ShrinkBy(*args, **kwargs):
2707 """
2708 ShrinkBy(self, int xFactor, int yFactor) -> Image
2709
2710 Return a version of the image scaled smaller by the given factors.
2711 """
2712 return _core_.Image_ShrinkBy(*args, **kwargs)
2713
2714 def Rescale(*args, **kwargs):
2715 """
2716 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2717
2718 Changes the size of the image in-place by scaling it: after a call to
2719 this function, the image will have the given width and height.
2720
2721 Returns the (modified) image itself.
2722 """
2723 return _core_.Image_Rescale(*args, **kwargs)
2724
2725 def Resize(*args, **kwargs):
2726 """
2727 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2728
2729 Changes the size of the image in-place without scaling it, by adding
2730 either a border with the given colour or cropping as necessary. The
2731 image is pasted into a new image with the given size and background
2732 colour at the position pos relative to the upper left of the new
2733 image. If red = green = blue = -1 then use either the current mask
2734 colour if set or find, use, and set a suitable mask colour for any
2735 newly exposed areas.
2736
2737 Returns the (modified) image itself.
2738 """
2739 return _core_.Image_Resize(*args, **kwargs)
2740
2741 def SetRGB(*args, **kwargs):
2742 """
2743 SetRGB(self, int x, int y, byte r, byte g, byte b)
2744
2745 Sets the pixel at the given coordinate. This routine performs
2746 bounds-checks for the coordinate so it can be considered a safe way to
2747 manipulate the data, but in some cases this might be too slow so that
2748 the data will have to be set directly. In that case you will have to
2749 get access to the image data using the `GetData` method.
2750 """
2751 return _core_.Image_SetRGB(*args, **kwargs)
2752
2753 def SetRGBRect(*args, **kwargs):
2754 """
2755 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2756
2757 Sets the colour of the pixels within the given rectangle. This routine
2758 performs bounds-checks for the rectangle so it can be considered a
2759 safe way to manipulate the data.
2760 """
2761 return _core_.Image_SetRGBRect(*args, **kwargs)
2762
2763 def GetRed(*args, **kwargs):
2764 """
2765 GetRed(self, int x, int y) -> byte
2766
2767 Returns the red intensity at the given coordinate.
2768 """
2769 return _core_.Image_GetRed(*args, **kwargs)
2770
2771 def GetGreen(*args, **kwargs):
2772 """
2773 GetGreen(self, int x, int y) -> byte
2774
2775 Returns the green intensity at the given coordinate.
2776 """
2777 return _core_.Image_GetGreen(*args, **kwargs)
2778
2779 def GetBlue(*args, **kwargs):
2780 """
2781 GetBlue(self, int x, int y) -> byte
2782
2783 Returns the blue intensity at the given coordinate.
2784 """
2785 return _core_.Image_GetBlue(*args, **kwargs)
2786
2787 def SetAlpha(*args, **kwargs):
2788 """
2789 SetAlpha(self, int x, int y, byte alpha)
2790
2791 Sets the alpha value for the given pixel. This function should only be
2792 called if the image has alpha channel data, use `HasAlpha` to check
2793 for this.
2794 """
2795 return _core_.Image_SetAlpha(*args, **kwargs)
2796
2797 def GetAlpha(*args, **kwargs):
2798 """
2799 GetAlpha(self, int x, int y) -> byte
2800
2801 Returns the alpha value for the given pixel. This function may only be
2802 called for the images with alpha channel, use `HasAlpha` to check for
2803 this.
2804
2805 The returned value is the *opacity* of the image, i.e. the value of 0
2806 corresponds to the fully transparent pixels while the value of 255 to
2807 the fully opaque pixels.
2808 """
2809 return _core_.Image_GetAlpha(*args, **kwargs)
2810
2811 def HasAlpha(*args, **kwargs):
2812 """
2813 HasAlpha(self) -> bool
2814
2815 Returns true if this image has alpha channel, false otherwise.
2816 """
2817 return _core_.Image_HasAlpha(*args, **kwargs)
2818
2819 def InitAlpha(*args, **kwargs):
2820 """
2821 InitAlpha(self)
2822
2823 Initializes the image alpha channel data. It is an error to call it if
2824 the image already has alpha data. If it doesn't, alpha data will be by
2825 default initialized to all pixels being fully opaque. But if the image
2826 has a a mask colour, all mask pixels will be completely transparent.
2827 """
2828 return _core_.Image_InitAlpha(*args, **kwargs)
2829
2830 def IsTransparent(*args, **kwargs):
2831 """
2832 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2833
2834 Returns ``True`` if this pixel is masked or has an alpha value less
2835 than the spcified threshold.
2836 """
2837 return _core_.Image_IsTransparent(*args, **kwargs)
2838
2839 def FindFirstUnusedColour(*args, **kwargs):
2840 """
2841 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2842
2843 Find first colour that is not used in the image and has higher RGB
2844 values than startR, startG, startB. Returns a tuple consisting of a
2845 success flag and rgb values.
2846 """
2847 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2848
2849 def ConvertAlphaToMask(*args, **kwargs):
2850 """
2851 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2852
2853 If the image has alpha channel, this method converts it to mask. All
2854 pixels with alpha value less than ``threshold`` are replaced with the
2855 mask colour and the alpha channel is removed. The mask colour is
2856 chosen automatically using `FindFirstUnusedColour`.
2857
2858 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2859 nothing.
2860 """
2861 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2862
2863 def ConvertColourToAlpha(*args, **kwargs):
2864 """
2865 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2866
2867 This method converts an image where the original alpha information is
2868 only available as a shades of a colour (actually shades of grey)
2869 typically when you draw anti-aliased text into a bitmap. The DC
2870 drawing routines draw grey values on the black background although
2871 they actually mean to draw white with differnt alpha values. This
2872 method reverses it, assuming a black (!) background and white text.
2873 The method will then fill up the whole image with the colour given.
2874 """
2875 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2876
2877 def SetMaskFromImage(*args, **kwargs):
2878 """
2879 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2880
2881 Sets the image's mask so that the pixels that have RGB value of
2882 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2883 by first finding an unused colour in the image, setting this colour as
2884 the mask colour and then using this colour to draw all pixels in the
2885 image who corresponding pixel in mask has given RGB value.
2886
2887 Returns ``False`` if ``mask`` does not have same dimensions as the
2888 image or if there is no unused colour left. Returns ``True`` if the
2889 mask was successfully applied.
2890
2891 Note that this method involves computing the histogram, which is
2892 computationally intensive operation.
2893 """
2894 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2895
2896 def CanRead(*args, **kwargs):
2897 """
2898 CanRead(String filename) -> bool
2899
2900 Returns True if the image handlers can read this file.
2901 """
2902 return _core_.Image_CanRead(*args, **kwargs)
2903
2904 CanRead = staticmethod(CanRead)
2905 def GetImageCount(*args, **kwargs):
2906 """
2907 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2908
2909 If the image file contains more than one image and the image handler
2910 is capable of retrieving these individually, this function will return
2911 the number of available images.
2912 """
2913 return _core_.Image_GetImageCount(*args, **kwargs)
2914
2915 GetImageCount = staticmethod(GetImageCount)
2916 def LoadFile(*args, **kwargs):
2917 """
2918 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2919
2920 Loads an image from a file. If no handler type is provided, the
2921 library will try to autodetect the format.
2922 """
2923 return _core_.Image_LoadFile(*args, **kwargs)
2924
2925 def LoadMimeFile(*args, **kwargs):
2926 """
2927 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2928
2929 Loads an image from a file, specifying the image type with a MIME type
2930 string.
2931 """
2932 return _core_.Image_LoadMimeFile(*args, **kwargs)
2933
2934 def SaveFile(*args, **kwargs):
2935 """
2936 SaveFile(self, String name, int type) -> bool
2937
2938 Saves an image in the named file.
2939 """
2940 return _core_.Image_SaveFile(*args, **kwargs)
2941
2942 def SaveMimeFile(*args, **kwargs):
2943 """
2944 SaveMimeFile(self, String name, String mimetype) -> bool
2945
2946 Saves an image in the named file.
2947 """
2948 return _core_.Image_SaveMimeFile(*args, **kwargs)
2949
2950 def CanReadStream(*args, **kwargs):
2951 """
2952 CanReadStream(InputStream stream) -> bool
2953
2954 Returns True if the image handlers can read an image file from the
2955 data currently on the input stream, or a readable Python file-like
2956 object.
2957 """
2958 return _core_.Image_CanReadStream(*args, **kwargs)
2959
2960 CanReadStream = staticmethod(CanReadStream)
2961 def LoadStream(*args, **kwargs):
2962 """
2963 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2964
2965 Loads an image from an input stream or a readable Python file-like
2966 object. If no handler type is provided, the library will try to
2967 autodetect the format.
2968 """
2969 return _core_.Image_LoadStream(*args, **kwargs)
2970
2971 def LoadMimeStream(*args, **kwargs):
2972 """
2973 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2974
2975 Loads an image from an input stream or a readable Python file-like
2976 object, using a MIME type string to specify the image file format.
2977 """
2978 return _core_.Image_LoadMimeStream(*args, **kwargs)
2979
2980 def IsOk(*args, **kwargs):
2981 """
2982 IsOk(self) -> bool
2983
2984 Returns true if image data is present.
2985 """
2986 return _core_.Image_IsOk(*args, **kwargs)
2987
2988 Ok = IsOk
2989 def GetWidth(*args, **kwargs):
2990 """
2991 GetWidth(self) -> int
2992
2993 Gets the width of the image in pixels.
2994 """
2995 return _core_.Image_GetWidth(*args, **kwargs)
2996
2997 def GetHeight(*args, **kwargs):
2998 """
2999 GetHeight(self) -> int
3000
3001 Gets the height of the image in pixels.
3002 """
3003 return _core_.Image_GetHeight(*args, **kwargs)
3004
3005 def GetSize(*args, **kwargs):
3006 """
3007 GetSize(self) -> Size
3008
3009 Returns the size of the image in pixels.
3010 """
3011 return _core_.Image_GetSize(*args, **kwargs)
3012
3013 def GetSubImage(*args, **kwargs):
3014 """
3015 GetSubImage(self, Rect rect) -> Image
3016
3017 Returns a sub image of the current one as long as the rect belongs
3018 entirely to the image.
3019 """
3020 return _core_.Image_GetSubImage(*args, **kwargs)
3021
3022 def Size(*args, **kwargs):
3023 """
3024 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
3025
3026 Returns a resized version of this image without scaling it by adding
3027 either a border with the given colour or cropping as necessary. The
3028 image is pasted into a new image with the given size and background
3029 colour at the position ``pos`` relative to the upper left of the new
3030 image. If red = green = blue = -1 then use either the current mask
3031 colour if set or find, use, and set a suitable mask colour for any
3032 newly exposed areas.
3033 """
3034 return _core_.Image_Size(*args, **kwargs)
3035
3036 def Copy(*args, **kwargs):
3037 """
3038 Copy(self) -> Image
3039
3040 Returns an identical copy of the image.
3041 """
3042 return _core_.Image_Copy(*args, **kwargs)
3043
3044 def Paste(*args, **kwargs):
3045 """
3046 Paste(self, Image image, int x, int y)
3047
3048 Pastes ``image`` into this instance and takes care of the mask colour
3049 and any out of bounds problems.
3050 """
3051 return _core_.Image_Paste(*args, **kwargs)
3052
3053 def GetData(*args, **kwargs):
3054 """
3055 GetData(self) -> PyObject
3056
3057 Returns a string containing a copy of the RGB bytes of the image.
3058 """
3059 return _core_.Image_GetData(*args, **kwargs)
3060
3061 def SetData(*args, **kwargs):
3062 """
3063 SetData(self, buffer data)
3064
3065 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3066 either a string or a buffer object holding the data and the length of
3067 the data must be width*height*3.
3068 """
3069 return _core_.Image_SetData(*args, **kwargs)
3070
3071 def GetDataBuffer(*args, **kwargs):
3072 """
3073 GetDataBuffer(self) -> PyObject
3074
3075 Returns a writable Python buffer object that is pointing at the RGB
3076 image data buffer inside the wx.Image. You need to ensure that you do
3077 not use this buffer object after the image has been destroyed.
3078 """
3079 return _core_.Image_GetDataBuffer(*args, **kwargs)
3080
3081 def SetDataBuffer(*args, **kwargs):
3082 """
3083 SetDataBuffer(self, buffer data)
3084
3085 Sets the internal image data pointer to point at a Python buffer
3086 object. This can save making an extra copy of the data but you must
3087 ensure that the buffer object lives longer than the wx.Image does.
3088 """
3089 return _core_.Image_SetDataBuffer(*args, **kwargs)
3090
3091 def GetAlphaData(*args, **kwargs):
3092 """
3093 GetAlphaData(self) -> PyObject
3094
3095 Returns a string containing a copy of the alpha bytes of the image.
3096 """
3097 return _core_.Image_GetAlphaData(*args, **kwargs)
3098
3099 def SetAlphaData(*args, **kwargs):
3100 """
3101 SetAlphaData(self, buffer alpha)
3102
3103 Resets the Image's alpha data from a buffer of bytes. Accepts either
3104 a string or a buffer object holding the data and the length of the
3105 data must be width*height.
3106 """
3107 return _core_.Image_SetAlphaData(*args, **kwargs)
3108
3109 def GetAlphaBuffer(*args, **kwargs):
3110 """
3111 GetAlphaBuffer(self) -> PyObject
3112
3113 Returns a writable Python buffer object that is pointing at the Alpha
3114 data buffer inside the wx.Image. You need to ensure that you do not
3115 use this buffer object after the image has been destroyed.
3116 """
3117 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
3118
3119 def SetAlphaBuffer(*args, **kwargs):
3120 """
3121 SetAlphaBuffer(self, buffer alpha)
3122
3123 Sets the internal image alpha pointer to point at a Python buffer
3124 object. This can save making an extra copy of the data but you must
3125 ensure that the buffer object lives as long as the wx.Image does.
3126 """
3127 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
3128
3129 def SetMaskColour(*args, **kwargs):
3130 """
3131 SetMaskColour(self, byte r, byte g, byte b)
3132
3133 Sets the mask colour for this image (and tells the image to use the
3134 mask).
3135 """
3136 return _core_.Image_SetMaskColour(*args, **kwargs)
3137
3138 def GetOrFindMaskColour(*args, **kwargs):
3139 """
3140 GetOrFindMaskColour() -> (r,g,b)
3141
3142 Get the current mask colour or find a suitable colour.
3143 """
3144 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
3145
3146 def GetMaskRed(*args, **kwargs):
3147 """
3148 GetMaskRed(self) -> byte
3149
3150 Gets the red component of the mask colour.
3151 """
3152 return _core_.Image_GetMaskRed(*args, **kwargs)
3153
3154 def GetMaskGreen(*args, **kwargs):
3155 """
3156 GetMaskGreen(self) -> byte
3157
3158 Gets the green component of the mask colour.
3159 """
3160 return _core_.Image_GetMaskGreen(*args, **kwargs)
3161
3162 def GetMaskBlue(*args, **kwargs):
3163 """
3164 GetMaskBlue(self) -> byte
3165
3166 Gets the blue component of the mask colour.
3167 """
3168 return _core_.Image_GetMaskBlue(*args, **kwargs)
3169
3170 def SetMask(*args, **kwargs):
3171 """
3172 SetMask(self, bool mask=True)
3173
3174 Specifies whether there is a mask or not. The area of the mask is
3175 determined by the current mask colour.
3176 """
3177 return _core_.Image_SetMask(*args, **kwargs)
3178
3179 def HasMask(*args, **kwargs):
3180 """
3181 HasMask(self) -> bool
3182
3183 Returns ``True`` if there is a mask active, ``False`` otherwise.
3184 """
3185 return _core_.Image_HasMask(*args, **kwargs)
3186
3187 def Rotate(*args, **kwargs):
3188 """
3189 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3190 Point offset_after_rotation=None) -> Image
3191
3192 Rotates the image about the given point, by ``angle`` radians. Passing
3193 ``True`` to ``interpolating`` results in better image quality, but is
3194 slower. If the image has a mask, then the mask colour is used for the
3195 uncovered pixels in the rotated image background. Otherwise, black
3196 will be used as the fill colour.
3197
3198 Returns the rotated image, leaving this image intact.
3199 """
3200 return _core_.Image_Rotate(*args, **kwargs)
3201
3202 def Rotate90(*args, **kwargs):
3203 """
3204 Rotate90(self, bool clockwise=True) -> Image
3205
3206 Returns a copy of the image rotated 90 degrees in the direction
3207 indicated by ``clockwise``.
3208 """
3209 return _core_.Image_Rotate90(*args, **kwargs)
3210
3211 def Mirror(*args, **kwargs):
3212 """
3213 Mirror(self, bool horizontally=True) -> Image
3214
3215 Returns a mirrored copy of the image. The parameter ``horizontally``
3216 indicates the orientation.
3217 """
3218 return _core_.Image_Mirror(*args, **kwargs)
3219
3220 def Replace(*args, **kwargs):
3221 """
3222 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3223
3224 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3225 ``(r2,g2,b2)``.
3226 """
3227 return _core_.Image_Replace(*args, **kwargs)
3228
3229 def ConvertToGreyscale(*args, **kwargs):
3230 """
3231 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3232
3233 Convert to greyscale image. Uses the luminance component (Y) of the
3234 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3235 defaults to ITU-T BT.601
3236 """
3237 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3238
3239 def ConvertToMono(*args, **kwargs):
3240 """
3241 ConvertToMono(self, byte r, byte g, byte b) -> Image
3242
3243 Returns monochromatic version of the image. The returned image has
3244 white colour where the original has ``(r,g,b)`` colour and black
3245 colour everywhere else.
3246 """
3247 return _core_.Image_ConvertToMono(*args, **kwargs)
3248
3249 def SetOption(*args, **kwargs):
3250 """
3251 SetOption(self, String name, String value)
3252
3253 Sets an image handler defined option. For example, when saving as a
3254 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3255 number between 0 and 100 (0 is terrible, 100 is very good).
3256 """
3257 return _core_.Image_SetOption(*args, **kwargs)
3258
3259 def SetOptionInt(*args, **kwargs):
3260 """
3261 SetOptionInt(self, String name, int value)
3262
3263 Sets an image option as an integer.
3264 """
3265 return _core_.Image_SetOptionInt(*args, **kwargs)
3266
3267 def GetOption(*args, **kwargs):
3268 """
3269 GetOption(self, String name) -> String
3270
3271 Gets the value of an image handler option.
3272 """
3273 return _core_.Image_GetOption(*args, **kwargs)
3274
3275 def GetOptionInt(*args, **kwargs):
3276 """
3277 GetOptionInt(self, String name) -> int
3278
3279 Gets the value of an image handler option as an integer. If the given
3280 option is not present, the function returns 0.
3281 """
3282 return _core_.Image_GetOptionInt(*args, **kwargs)
3283
3284 def HasOption(*args, **kwargs):
3285 """
3286 HasOption(self, String name) -> bool
3287
3288 Returns true if the given option is present.
3289 """
3290 return _core_.Image_HasOption(*args, **kwargs)
3291
3292 def CountColours(*args, **kwargs):
3293 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3294 return _core_.Image_CountColours(*args, **kwargs)
3295
3296 def ComputeHistogram(*args, **kwargs):
3297 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3298 return _core_.Image_ComputeHistogram(*args, **kwargs)
3299
3300 def AddHandler(*args, **kwargs):
3301 """AddHandler(ImageHandler handler)"""
3302 return _core_.Image_AddHandler(*args, **kwargs)
3303
3304 AddHandler = staticmethod(AddHandler)
3305 def InsertHandler(*args, **kwargs):
3306 """InsertHandler(ImageHandler handler)"""
3307 return _core_.Image_InsertHandler(*args, **kwargs)
3308
3309 InsertHandler = staticmethod(InsertHandler)
3310 def RemoveHandler(*args, **kwargs):
3311 """RemoveHandler(String name) -> bool"""
3312 return _core_.Image_RemoveHandler(*args, **kwargs)
3313
3314 RemoveHandler = staticmethod(RemoveHandler)
3315 def GetHandlers(*args, **kwargs):
3316 """GetHandlers() -> PyObject"""
3317 return _core_.Image_GetHandlers(*args, **kwargs)
3318
3319 GetHandlers = staticmethod(GetHandlers)
3320 def GetImageExtWildcard(*args, **kwargs):
3321 """
3322 GetImageExtWildcard() -> String
3323
3324 Iterates all registered wxImageHandler objects, and returns a string
3325 containing file extension masks suitable for passing to file open/save
3326 dialog boxes.
3327 """
3328 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3329
3330 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3331 def ConvertToBitmap(*args, **kwargs):
3332 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3333 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3334
3335 def ConvertToMonoBitmap(*args, **kwargs):
3336 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3337 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3338
3339 def RotateHue(*args, **kwargs):
3340 """
3341 RotateHue(self, double angle)
3342
3343 Rotates the hue of each pixel of the image. Hue is a double in the
3344 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3345 """
3346 return _core_.Image_RotateHue(*args, **kwargs)
3347
3348 def RGBtoHSV(*args, **kwargs):
3349 """
3350 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3351
3352 Converts a color in RGB color space to HSV color space.
3353 """
3354 return _core_.Image_RGBtoHSV(*args, **kwargs)
3355
3356 RGBtoHSV = staticmethod(RGBtoHSV)
3357 def HSVtoRGB(*args, **kwargs):
3358 """
3359 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3360
3361 Converts a color in HSV color space to RGB color space.
3362 """
3363 return _core_.Image_HSVtoRGB(*args, **kwargs)
3364
3365 HSVtoRGB = staticmethod(HSVtoRGB)
3366 def __nonzero__(self): return self.IsOk()
3367 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3368 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3369 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3370 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3371 Height = property(GetHeight,doc="See `GetHeight`")
3372 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3373 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3374 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3375 Width = property(GetWidth,doc="See `GetWidth`")
3376 _core_.Image_swigregister(Image)
3377
3378 def ImageFromMime(*args, **kwargs):
3379 """
3380 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3381
3382 Loads an image from a file, using a MIME type string (such as
3383 'image/jpeg') to specify image type.
3384 """
3385 val = _core_.new_ImageFromMime(*args, **kwargs)
3386 return val
3387
3388 def ImageFromStream(*args, **kwargs):
3389 """
3390 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3391
3392 Loads an image from an input stream, or any readable Python file-like
3393 object.
3394 """
3395 val = _core_.new_ImageFromStream(*args, **kwargs)
3396 return val
3397
3398 def ImageFromStreamMime(*args, **kwargs):
3399 """
3400 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3401
3402 Loads an image from an input stream, or any readable Python file-like
3403 object, specifying the image format with a MIME type string.
3404 """
3405 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3406 return val
3407
3408 def EmptyImage(*args, **kwargs):
3409 """
3410 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3411
3412 Construct an empty image of a given size, optionally setting all
3413 pixels to black.
3414 """
3415 val = _core_.new_EmptyImage(*args, **kwargs)
3416 return val
3417
3418 def ImageFromBitmap(*args, **kwargs):
3419 """
3420 ImageFromBitmap(Bitmap bitmap) -> Image
3421
3422 Construct an Image from a `wx.Bitmap`.
3423 """
3424 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3425 return val
3426
3427 def ImageFromData(*args, **kwargs):
3428 """
3429 ImageFromData(int width, int height, buffer data) -> Image
3430
3431 Construct an Image from a buffer of RGB bytes. Accepts either a
3432 string or a buffer object holding the data and the length of the data
3433 must be width*height*3.
3434 """
3435 val = _core_.new_ImageFromData(*args, **kwargs)
3436 return val
3437
3438 def ImageFromDataWithAlpha(*args, **kwargs):
3439 """
3440 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3441
3442 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3443 Accepts either a string or a buffer object holding the data and the
3444 length of the data must be width*height*3 bytes, and the length of the
3445 alpha data must be width*height bytes.
3446 """
3447 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3448 return val
3449
3450 def Image_CanRead(*args, **kwargs):
3451 """
3452 Image_CanRead(String filename) -> bool
3453
3454 Returns True if the image handlers can read this file.
3455 """
3456 return _core_.Image_CanRead(*args, **kwargs)
3457
3458 def Image_GetImageCount(*args, **kwargs):
3459 """
3460 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3461
3462 If the image file contains more than one image and the image handler
3463 is capable of retrieving these individually, this function will return
3464 the number of available images.
3465 """
3466 return _core_.Image_GetImageCount(*args, **kwargs)
3467
3468 def Image_CanReadStream(*args, **kwargs):
3469 """
3470 Image_CanReadStream(InputStream stream) -> bool
3471
3472 Returns True if the image handlers can read an image file from the
3473 data currently on the input stream, or a readable Python file-like
3474 object.
3475 """
3476 return _core_.Image_CanReadStream(*args, **kwargs)
3477
3478 def Image_AddHandler(*args, **kwargs):
3479 """Image_AddHandler(ImageHandler handler)"""
3480 return _core_.Image_AddHandler(*args, **kwargs)
3481
3482 def Image_InsertHandler(*args, **kwargs):
3483 """Image_InsertHandler(ImageHandler handler)"""
3484 return _core_.Image_InsertHandler(*args, **kwargs)
3485
3486 def Image_RemoveHandler(*args, **kwargs):
3487 """Image_RemoveHandler(String name) -> bool"""
3488 return _core_.Image_RemoveHandler(*args, **kwargs)
3489
3490 def Image_GetHandlers(*args):
3491 """Image_GetHandlers() -> PyObject"""
3492 return _core_.Image_GetHandlers(*args)
3493
3494 def Image_GetImageExtWildcard(*args):
3495 """
3496 Image_GetImageExtWildcard() -> String
3497
3498 Iterates all registered wxImageHandler objects, and returns a string
3499 containing file extension masks suitable for passing to file open/save
3500 dialog boxes.
3501 """
3502 return _core_.Image_GetImageExtWildcard(*args)
3503
3504 def Image_RGBtoHSV(*args, **kwargs):
3505 """
3506 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3507
3508 Converts a color in RGB color space to HSV color space.
3509 """
3510 return _core_.Image_RGBtoHSV(*args, **kwargs)
3511
3512 def Image_HSVtoRGB(*args, **kwargs):
3513 """
3514 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3515
3516 Converts a color in HSV color space to RGB color space.
3517 """
3518 return _core_.Image_HSVtoRGB(*args, **kwargs)
3519
3520
3521 def _ImageFromBuffer(*args, **kwargs):
3522 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3523 return _core_._ImageFromBuffer(*args, **kwargs)
3524 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3525 """
3526 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3527 parameter must be a Python object that implements the buffer interface,
3528 such as a string, array, etc. The dataBuffer object is expected to
3529 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3530 object can optionally be supplied for the image's alpha channel data, and
3531 it is expected to be width*height bytes long.
3532
3533 The wx.Image will be created with its data and alpha pointers initialized
3534 to the memory address pointed to by the buffer objects, thus saving the
3535 time needed to copy the image data from the buffer object to the wx.Image.
3536 While this has advantages, it also has the shoot-yourself-in-the-foot
3537 risks associated with sharing a C pointer between two objects.
3538
3539 To help alleviate the risk a reference to the data and alpha buffer
3540 objects are kept with the wx.Image, so that they won't get deleted until
3541 after the wx.Image is deleted. However please be aware that it is not
3542 guaranteed that an object won't move its memory buffer to a new location
3543 when it needs to resize its contents. If that happens then the wx.Image
3544 will end up referring to an invalid memory location and could cause the
3545 application to crash. Therefore care should be taken to not manipulate
3546 the objects used for the data and alpha buffers in a way that would cause
3547 them to change size.
3548 """
3549 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3550 image._buffer = dataBuffer
3551 image._alpha = alphaBuffer
3552 return image
3553
3554 def InitAllImageHandlers():
3555 """
3556 The former functionality of InitAllImageHanders is now done internal to
3557 the _core_ extension module and so this function has become a simple NOP.
3558 """
3559 pass
3560
3561 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3562 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3563 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3564 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3565 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3566 BMP_24BPP = _core_.BMP_24BPP
3567 BMP_8BPP = _core_.BMP_8BPP
3568 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3569 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3570 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3571 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3572 BMP_4BPP = _core_.BMP_4BPP
3573 BMP_1BPP = _core_.BMP_1BPP
3574 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3575 class BMPHandler(ImageHandler):
3576 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3577 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3578 __repr__ = _swig_repr
3579 def __init__(self, *args, **kwargs):
3580 """
3581 __init__(self) -> BMPHandler
3582
3583 A `wx.ImageHandler` for \*.bmp bitmap files.
3584 """
3585 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3586 _core_.BMPHandler_swigregister(BMPHandler)
3587 NullImage = cvar.NullImage
3588 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3589 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3590 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3591 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3592 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3593 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3594 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3595 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3596 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3597 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3598 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3599 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3600 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3601 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3602 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3603
3604 class ICOHandler(BMPHandler):
3605 """A `wx.ImageHandler` for \*.ico icon files."""
3606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3607 __repr__ = _swig_repr
3608 def __init__(self, *args, **kwargs):
3609 """
3610 __init__(self) -> ICOHandler
3611
3612 A `wx.ImageHandler` for \*.ico icon files.
3613 """
3614 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3615 _core_.ICOHandler_swigregister(ICOHandler)
3616
3617 class CURHandler(ICOHandler):
3618 """A `wx.ImageHandler` for \*.cur cursor files."""
3619 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3620 __repr__ = _swig_repr
3621 def __init__(self, *args, **kwargs):
3622 """
3623 __init__(self) -> CURHandler
3624
3625 A `wx.ImageHandler` for \*.cur cursor files.
3626 """
3627 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3628 _core_.CURHandler_swigregister(CURHandler)
3629
3630 class ANIHandler(CURHandler):
3631 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3632 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3633 __repr__ = _swig_repr
3634 def __init__(self, *args, **kwargs):
3635 """
3636 __init__(self) -> ANIHandler
3637
3638 A `wx.ImageHandler` for \*.ani animated cursor files.
3639 """
3640 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3641 _core_.ANIHandler_swigregister(ANIHandler)
3642
3643 class PNGHandler(ImageHandler):
3644 """A `wx.ImageHandler` for PNG image files."""
3645 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3646 __repr__ = _swig_repr
3647 def __init__(self, *args, **kwargs):
3648 """
3649 __init__(self) -> PNGHandler
3650
3651 A `wx.ImageHandler` for PNG image files.
3652 """
3653 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3654 _core_.PNGHandler_swigregister(PNGHandler)
3655
3656 class GIFHandler(ImageHandler):
3657 """A `wx.ImageHandler` for GIF image files."""
3658 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3659 __repr__ = _swig_repr
3660 def __init__(self, *args, **kwargs):
3661 """
3662 __init__(self) -> GIFHandler
3663
3664 A `wx.ImageHandler` for GIF image files.
3665 """
3666 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3667 _core_.GIFHandler_swigregister(GIFHandler)
3668
3669 class PCXHandler(ImageHandler):
3670 """A `wx.ImageHandler` for PCX imager files."""
3671 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3672 __repr__ = _swig_repr
3673 def __init__(self, *args, **kwargs):
3674 """
3675 __init__(self) -> PCXHandler
3676
3677 A `wx.ImageHandler` for PCX imager files.
3678 """
3679 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3680 _core_.PCXHandler_swigregister(PCXHandler)
3681
3682 class JPEGHandler(ImageHandler):
3683 """A `wx.ImageHandler` for JPEG/JPG image files."""
3684 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3685 __repr__ = _swig_repr
3686 def __init__(self, *args, **kwargs):
3687 """
3688 __init__(self) -> JPEGHandler
3689
3690 A `wx.ImageHandler` for JPEG/JPG image files.
3691 """
3692 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3693 _core_.JPEGHandler_swigregister(JPEGHandler)
3694
3695 class PNMHandler(ImageHandler):
3696 """A `wx.ImageHandler` for PNM image files."""
3697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3698 __repr__ = _swig_repr
3699 def __init__(self, *args, **kwargs):
3700 """
3701 __init__(self) -> PNMHandler
3702
3703 A `wx.ImageHandler` for PNM image files.
3704 """
3705 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3706 _core_.PNMHandler_swigregister(PNMHandler)
3707
3708 class XPMHandler(ImageHandler):
3709 """A `wx.ImageHandler` for XPM image."""
3710 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3711 __repr__ = _swig_repr
3712 def __init__(self, *args, **kwargs):
3713 """
3714 __init__(self) -> XPMHandler
3715
3716 A `wx.ImageHandler` for XPM image.
3717 """
3718 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3719 _core_.XPMHandler_swigregister(XPMHandler)
3720
3721 class TIFFHandler(ImageHandler):
3722 """A `wx.ImageHandler` for TIFF image files."""
3723 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3724 __repr__ = _swig_repr
3725 def __init__(self, *args, **kwargs):
3726 """
3727 __init__(self) -> TIFFHandler
3728
3729 A `wx.ImageHandler` for TIFF image files.
3730 """
3731 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3732 _core_.TIFFHandler_swigregister(TIFFHandler)
3733
3734 class TGAHandler(ImageHandler):
3735 """A `wx.ImageHandler` for TGA image files."""
3736 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3737 __repr__ = _swig_repr
3738 def __init__(self, *args, **kwargs):
3739 """
3740 __init__(self) -> TGAHandler
3741
3742 A `wx.ImageHandler` for TGA image files.
3743 """
3744 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3745 _core_.TGAHandler_swigregister(TGAHandler)
3746
3747 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3748 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3749 class Quantize(object):
3750 """Performs quantization, or colour reduction, on a wxImage."""
3751 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3752 def __init__(self): raise AttributeError, "No constructor defined"
3753 __repr__ = _swig_repr
3754 def Quantize(*args, **kwargs):
3755 """
3756 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3757
3758 Reduce the colours in the source image and put the result into the
3759 destination image, setting the palette in the destination if
3760 needed. Both images may be the same, to overwrite the source image.
3761 """
3762 return _core_.Quantize_Quantize(*args, **kwargs)
3763
3764 Quantize = staticmethod(Quantize)
3765 _core_.Quantize_swigregister(Quantize)
3766
3767 def Quantize_Quantize(*args, **kwargs):
3768 """
3769 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3770
3771 Reduce the colours in the source image and put the result into the
3772 destination image, setting the palette in the destination if
3773 needed. Both images may be the same, to overwrite the source image.
3774 """
3775 return _core_.Quantize_Quantize(*args, **kwargs)
3776
3777 #---------------------------------------------------------------------------
3778
3779 class EvtHandler(Object):
3780 """Proxy of C++ EvtHandler class"""
3781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3782 __repr__ = _swig_repr
3783 def __init__(self, *args, **kwargs):
3784 """__init__(self) -> EvtHandler"""
3785 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3786 self._setOORInfo(self)
3787
3788 def GetNextHandler(*args, **kwargs):
3789 """GetNextHandler(self) -> EvtHandler"""
3790 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3791
3792 def GetPreviousHandler(*args, **kwargs):
3793 """GetPreviousHandler(self) -> EvtHandler"""
3794 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3795
3796 def SetNextHandler(*args, **kwargs):
3797 """SetNextHandler(self, EvtHandler handler)"""
3798 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3799
3800 def SetPreviousHandler(*args, **kwargs):
3801 """SetPreviousHandler(self, EvtHandler handler)"""
3802 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3803
3804 def GetEvtHandlerEnabled(*args, **kwargs):
3805 """GetEvtHandlerEnabled(self) -> bool"""
3806 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3807
3808 def SetEvtHandlerEnabled(*args, **kwargs):
3809 """SetEvtHandlerEnabled(self, bool enabled)"""
3810 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3811
3812 def ProcessEvent(*args, **kwargs):
3813 """ProcessEvent(self, Event event) -> bool"""
3814 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3815
3816 def AddPendingEvent(*args, **kwargs):
3817 """AddPendingEvent(self, Event event)"""
3818 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3819
3820 def ProcessPendingEvents(*args, **kwargs):
3821 """ProcessPendingEvents(self)"""
3822 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3823
3824 def Connect(*args, **kwargs):
3825 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3826 return _core_.EvtHandler_Connect(*args, **kwargs)
3827
3828 def Disconnect(*args, **kwargs):
3829 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3830 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3831
3832 def _setOORInfo(*args, **kwargs):
3833 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3834 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3835 args[0].this.own(False)
3836 return val
3837
3838 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3839 """
3840 Bind an event to an event handler.
3841
3842 :param event: One of the EVT_* objects that specifies the
3843 type of event to bind,
3844
3845 :param handler: A callable object to be invoked when the
3846 event is delivered to self. Pass None to
3847 disconnect an event handler.
3848
3849 :param source: Sometimes the event originates from a
3850 different window than self, but you still
3851 want to catch it in self. (For example, a
3852 button event delivered to a frame.) By
3853 passing the source of the event, the event
3854 handling system is able to differentiate
3855 between the same event type from different
3856 controls.
3857
3858 :param id: Used to spcify the event source by ID instead
3859 of instance.
3860
3861 :param id2: Used when it is desirable to bind a handler
3862 to a range of IDs, such as with EVT_MENU_RANGE.
3863 """
3864 if source is not None:
3865 id = source.GetId()
3866 event.Bind(self, id, id2, handler)
3867
3868 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3869 """
3870 Disconencts the event handler binding for event from self.
3871 Returns True if successful.
3872 """
3873 if source is not None:
3874 id = source.GetId()
3875 return event.Unbind(self, id, id2)
3876
3877 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3878 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3879 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
3880 _core_.EvtHandler_swigregister(EvtHandler)
3881
3882 #---------------------------------------------------------------------------
3883
3884 class PyEventBinder(object):
3885 """
3886 Instances of this class are used to bind specific events to event
3887 handlers.
3888 """
3889 def __init__(self, evtType, expectedIDs=0):
3890 if expectedIDs not in [0, 1, 2]:
3891 raise ValueError, "Invalid number of expectedIDs"
3892 self.expectedIDs = expectedIDs
3893
3894 if type(evtType) == list or type(evtType) == tuple:
3895 self.evtType = evtType
3896 else:
3897 self.evtType = [evtType]
3898
3899
3900 def Bind(self, target, id1, id2, function):
3901 """Bind this set of event types to target."""
3902 for et in self.evtType:
3903 target.Connect(id1, id2, et, function)
3904
3905
3906 def Unbind(self, target, id1, id2):
3907 """Remove an event binding."""
3908 success = 0
3909 for et in self.evtType:
3910 success += target.Disconnect(id1, id2, et)
3911 return success != 0
3912
3913 def _getEvtType(self):
3914 """
3915 Make it easy to get to the default wxEventType typeID for this
3916 event binder.
3917 """
3918 return self.evtType[0]
3919
3920 typeId = property(_getEvtType)
3921
3922
3923 def __call__(self, *args):
3924 """
3925 For backwards compatibility with the old EVT_* functions.
3926 Should be called with either (window, func), (window, ID,
3927 func) or (window, ID1, ID2, func) parameters depending on the
3928 type of the event.
3929 """
3930 assert len(args) == 2 + self.expectedIDs
3931 id1 = wx.ID_ANY
3932 id2 = wx.ID_ANY
3933 target = args[0]
3934 if self.expectedIDs == 0:
3935 func = args[1]
3936 elif self.expectedIDs == 1:
3937 id1 = args[1]
3938 func = args[2]
3939 elif self.expectedIDs == 2:
3940 id1 = args[1]
3941 id2 = args[2]
3942 func = args[3]
3943 else:
3944 raise ValueError, "Unexpected number of IDs"
3945
3946 self.Bind(target, id1, id2, func)
3947
3948
3949 # These two are square pegs that don't fit the PyEventBinder hole...
3950 def EVT_COMMAND(win, id, cmd, func):
3951 win.Connect(id, -1, cmd, func)
3952 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3953 win.Connect(id1, id2, cmd, func)
3954
3955
3956 #---------------------------------------------------------------------------
3957
3958 #---------------------------------------------------------------------------
3959
3960 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3961 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3962
3963 def NewEventType(*args):
3964 """NewEventType() -> EventType"""
3965 return _core_.NewEventType(*args)
3966 wxEVT_ANY = _core_.wxEVT_ANY
3967 wxEVT_NULL = _core_.wxEVT_NULL
3968 wxEVT_FIRST = _core_.wxEVT_FIRST
3969 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3970 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3971 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3972 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3973 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3974 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3975 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3976 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3977 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3978 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3979 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3980 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3981 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3982 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3983 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3984 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3985 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3986 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3987 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3988 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3989 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3990 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3991 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3992 wxEVT_MOTION = _core_.wxEVT_MOTION
3993 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3994 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3995 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3996 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3997 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3998 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3999 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
4000 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
4001 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
4002 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
4003 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
4004 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
4005 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
4006 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
4007 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
4008 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
4009 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
4010 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
4011 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
4012 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
4013 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
4014 wxEVT_CHAR = _core_.wxEVT_CHAR
4015 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
4016 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
4017 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
4018 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
4019 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
4020 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
4021 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
4022 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
4023 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
4024 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
4025 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
4026 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
4027 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
4028 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4029 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
4030 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
4031 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
4032 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
4033 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
4034 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
4035 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
4036 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
4037 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
4038 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
4039 wxEVT_SIZE = _core_.wxEVT_SIZE
4040 wxEVT_MOVE = _core_.wxEVT_MOVE
4041 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
4042 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
4043 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
4044 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
4045 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
4046 wxEVT_CREATE = _core_.wxEVT_CREATE
4047 wxEVT_DESTROY = _core_.wxEVT_DESTROY
4048 wxEVT_SHOW = _core_.wxEVT_SHOW
4049 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
4050 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
4051 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
4052 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
4053 wxEVT_PAINT = _core_.wxEVT_PAINT
4054 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
4055 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
4056 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
4057 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
4058 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
4059 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
4060 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
4061 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
4062 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
4063 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
4064 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
4065 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
4066 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4067 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4068 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4069 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4070 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4071 wxEVT_IDLE = _core_.wxEVT_IDLE
4072 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4073 wxEVT_SIZING = _core_.wxEVT_SIZING
4074 wxEVT_MOVING = _core_.wxEVT_MOVING
4075 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
4076 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4077 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4078 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
4079 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4080 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4081 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4082 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4083 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4084 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4085 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
4086 #
4087 # Create some event binders
4088 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4089 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4090 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4091 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4092 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4093 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4094 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4095 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4096 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4097 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4098 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4099 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4100 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
4101 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
4102 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4103 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4104 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4105 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4106 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4107 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4108 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4109 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4110 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4111 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
4112 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
4113 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4114 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4115 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4116 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4117 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4118 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4119 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4120 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4121 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4122 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4123 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4124 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4125 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4126 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4127 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4128 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
4129 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
4130
4131 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4132 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4133 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4134 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4135 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4136 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4137 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4138 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4139 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4140 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4141 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4142 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4143 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4144
4145 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4146 wxEVT_LEFT_UP,
4147 wxEVT_MIDDLE_DOWN,
4148 wxEVT_MIDDLE_UP,
4149 wxEVT_RIGHT_DOWN,
4150 wxEVT_RIGHT_UP,
4151 wxEVT_MOTION,
4152 wxEVT_LEFT_DCLICK,
4153 wxEVT_MIDDLE_DCLICK,
4154 wxEVT_RIGHT_DCLICK,
4155 wxEVT_ENTER_WINDOW,
4156 wxEVT_LEAVE_WINDOW,
4157 wxEVT_MOUSEWHEEL
4158 ])
4159
4160
4161 # Scrolling from wxWindow (sent to wxScrolledWindow)
4162 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
4163 wxEVT_SCROLLWIN_BOTTOM,
4164 wxEVT_SCROLLWIN_LINEUP,
4165 wxEVT_SCROLLWIN_LINEDOWN,
4166 wxEVT_SCROLLWIN_PAGEUP,
4167 wxEVT_SCROLLWIN_PAGEDOWN,
4168 wxEVT_SCROLLWIN_THUMBTRACK,
4169 wxEVT_SCROLLWIN_THUMBRELEASE,
4170 ])
4171
4172 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4173 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4174 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4175 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4176 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4177 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4178 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4179 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4180
4181 # Scrolling from wx.Slider and wx.ScrollBar
4182 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4183 wxEVT_SCROLL_BOTTOM,
4184 wxEVT_SCROLL_LINEUP,
4185 wxEVT_SCROLL_LINEDOWN,
4186 wxEVT_SCROLL_PAGEUP,
4187 wxEVT_SCROLL_PAGEDOWN,
4188 wxEVT_SCROLL_THUMBTRACK,
4189 wxEVT_SCROLL_THUMBRELEASE,
4190 wxEVT_SCROLL_CHANGED,
4191 ])
4192
4193 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4194 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4195 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4196 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4197 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4198 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4199 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4200 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4201 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4202 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
4203
4204 # Scrolling from wx.Slider and wx.ScrollBar, with an id
4205 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4206 wxEVT_SCROLL_BOTTOM,
4207 wxEVT_SCROLL_LINEUP,
4208 wxEVT_SCROLL_LINEDOWN,
4209 wxEVT_SCROLL_PAGEUP,
4210 wxEVT_SCROLL_PAGEDOWN,
4211 wxEVT_SCROLL_THUMBTRACK,
4212 wxEVT_SCROLL_THUMBRELEASE,
4213 wxEVT_SCROLL_CHANGED,
4214 ], 1)
4215
4216 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4217 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4218 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4219 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4220 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4221 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4222 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4223 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4224 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4225 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
4226
4227 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4228 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4229 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4230 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4231 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4232 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4233 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4234 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4235 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4236 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4237
4238 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4239 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4240 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4241 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4242 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4243 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4244 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4245 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4246 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4247
4248
4249 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4250 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4251 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4252 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4253 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4254 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4255 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4256
4257 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4258
4259 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4260 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4261
4262 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4263
4264 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4265 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4266 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
4267
4268
4269 #---------------------------------------------------------------------------
4270
4271 class Event(Object):
4272 """
4273 An event is a structure holding information about an event passed to a
4274 callback or member function. wx.Event is an abstract base class for
4275 other event classes
4276 """
4277 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4278 def __init__(self): raise AttributeError, "No constructor defined"
4279 __repr__ = _swig_repr
4280 __swig_destroy__ = _core_.delete_Event
4281 __del__ = lambda self : None;
4282 def SetEventType(*args, **kwargs):
4283 """
4284 SetEventType(self, EventType typ)
4285
4286 Sets the specific type of the event.
4287 """
4288 return _core_.Event_SetEventType(*args, **kwargs)
4289
4290 def GetEventType(*args, **kwargs):
4291 """
4292 GetEventType(self) -> EventType
4293
4294 Returns the identifier of the given event type, such as
4295 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4296 """
4297 return _core_.Event_GetEventType(*args, **kwargs)
4298
4299 def GetEventObject(*args, **kwargs):
4300 """
4301 GetEventObject(self) -> Object
4302
4303 Returns the object (usually a window) associated with the event, if
4304 any.
4305 """
4306 return _core_.Event_GetEventObject(*args, **kwargs)
4307
4308 def SetEventObject(*args, **kwargs):
4309 """
4310 SetEventObject(self, Object obj)
4311
4312 Sets the originating object, or in other words, obj is normally the
4313 object that is sending the event.
4314 """
4315 return _core_.Event_SetEventObject(*args, **kwargs)
4316
4317 def GetTimestamp(*args, **kwargs):
4318 """GetTimestamp(self) -> long"""
4319 return _core_.Event_GetTimestamp(*args, **kwargs)
4320
4321 def SetTimestamp(*args, **kwargs):
4322 """SetTimestamp(self, long ts=0)"""
4323 return _core_.Event_SetTimestamp(*args, **kwargs)
4324
4325 def GetId(*args, **kwargs):
4326 """
4327 GetId(self) -> int
4328
4329 Returns the identifier associated with this event, such as a button
4330 command id.
4331 """
4332 return _core_.Event_GetId(*args, **kwargs)
4333
4334 def SetId(*args, **kwargs):
4335 """
4336 SetId(self, int Id)
4337
4338 Set's the ID for the event. This is usually the ID of the window that
4339 is sending the event, but it can also be a command id from a menu
4340 item, etc.
4341 """
4342 return _core_.Event_SetId(*args, **kwargs)
4343
4344 def IsCommandEvent(*args, **kwargs):
4345 """
4346 IsCommandEvent(self) -> bool
4347
4348 Returns true if the event is or is derived from `wx.CommandEvent` else
4349 it returns false. Note: Exists only for optimization purposes.
4350 """
4351 return _core_.Event_IsCommandEvent(*args, **kwargs)
4352
4353 def Skip(*args, **kwargs):
4354 """
4355 Skip(self, bool skip=True)
4356
4357 This method can be used inside an event handler to control whether
4358 further event handlers bound to this event will be called after the
4359 current one returns. Without Skip() (or equivalently if Skip(False) is
4360 used), the event will not be processed any more. If Skip(True) is
4361 called, the event processing system continues searching for a further
4362 handler function for this event, even though it has been processed
4363 already in the current handler.
4364 """
4365 return _core_.Event_Skip(*args, **kwargs)
4366
4367 def GetSkipped(*args, **kwargs):
4368 """
4369 GetSkipped(self) -> bool
4370
4371 Returns true if the event handler should be skipped, false otherwise.
4372 :see: `Skip`
4373 """
4374 return _core_.Event_GetSkipped(*args, **kwargs)
4375
4376 def ShouldPropagate(*args, **kwargs):
4377 """
4378 ShouldPropagate(self) -> bool
4379
4380 Test if this event should be propagated to the parent window or not,
4381 i.e. if the propagation level is currently greater than 0.
4382 """
4383 return _core_.Event_ShouldPropagate(*args, **kwargs)
4384
4385 def StopPropagation(*args, **kwargs):
4386 """
4387 StopPropagation(self) -> int
4388
4389 Stop the event from propagating to its parent window. Returns the old
4390 propagation level value which may be later passed to
4391 `ResumePropagation` to allow propagating the event again.
4392 """
4393 return _core_.Event_StopPropagation(*args, **kwargs)
4394
4395 def ResumePropagation(*args, **kwargs):
4396 """
4397 ResumePropagation(self, int propagationLevel)
4398
4399 Resume the event propagation by restoring the propagation level. (For
4400 example, you can use the value returned by an earlier call to
4401 `StopPropagation`.)
4402
4403 """
4404 return _core_.Event_ResumePropagation(*args, **kwargs)
4405
4406 def Clone(*args, **kwargs):
4407 """Clone(self) -> Event"""
4408 return _core_.Event_Clone(*args, **kwargs)
4409
4410 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4411 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4412 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4413 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4414 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
4415 _core_.Event_swigregister(Event)
4416
4417 #---------------------------------------------------------------------------
4418
4419 class PropagationDisabler(object):
4420 """
4421 Helper class to temporarily change an event not to propagate. Simply
4422 create an instance of this class and then whe it is destroyed the
4423 propogation of the event will be restored.
4424 """
4425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4426 __repr__ = _swig_repr
4427 def __init__(self, *args, **kwargs):
4428 """
4429 __init__(self, Event event) -> PropagationDisabler
4430
4431 Helper class to temporarily change an event not to propagate. Simply
4432 create an instance of this class and then whe it is destroyed the
4433 propogation of the event will be restored.
4434 """
4435 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4436 __swig_destroy__ = _core_.delete_PropagationDisabler
4437 __del__ = lambda self : None;
4438 _core_.PropagationDisabler_swigregister(PropagationDisabler)
4439
4440 class PropagateOnce(object):
4441 """
4442 A helper class that will temporarily lower propagation level of an
4443 event. Simply create an instance of this class and then whe it is
4444 destroyed the propogation of the event will be restored.
4445 """
4446 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4447 __repr__ = _swig_repr
4448 def __init__(self, *args, **kwargs):
4449 """
4450 __init__(self, Event event) -> PropagateOnce
4451
4452 A helper class that will temporarily lower propagation level of an
4453 event. Simply create an instance of this class and then whe it is
4454 destroyed the propogation of the event will be restored.
4455 """
4456 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4457 __swig_destroy__ = _core_.delete_PropagateOnce
4458 __del__ = lambda self : None;
4459 _core_.PropagateOnce_swigregister(PropagateOnce)
4460
4461 #---------------------------------------------------------------------------
4462
4463 class CommandEvent(Event):
4464 """
4465 This event class contains information about command events, which
4466 originate from a variety of simple controls, as well as menus and
4467 toolbars.
4468 """
4469 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4470 __repr__ = _swig_repr
4471 def __init__(self, *args, **kwargs):
4472 """
4473 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4474
4475 This event class contains information about command events, which
4476 originate from a variety of simple controls, as well as menus and
4477 toolbars.
4478 """
4479 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
4480 def GetSelection(*args, **kwargs):
4481 """
4482 GetSelection(self) -> int
4483
4484 Returns item index for a listbox or choice selection event (not valid
4485 for a deselection).
4486 """
4487 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4488
4489 def SetString(*args, **kwargs):
4490 """SetString(self, String s)"""
4491 return _core_.CommandEvent_SetString(*args, **kwargs)
4492
4493 def GetString(*args, **kwargs):
4494 """
4495 GetString(self) -> String
4496
4497 Returns item string for a listbox or choice selection event (not valid
4498 for a deselection).
4499 """
4500 return _core_.CommandEvent_GetString(*args, **kwargs)
4501
4502 def IsChecked(*args, **kwargs):
4503 """
4504 IsChecked(self) -> bool
4505
4506 This method can be used with checkbox and menu events: for the
4507 checkboxes, the method returns true for a selection event and false
4508 for a deselection one. For the menu events, this method indicates if
4509 the menu item just has become checked or unchecked (and thus only
4510 makes sense for checkable menu items).
4511 """
4512 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4513
4514 Checked = IsChecked
4515 def IsSelection(*args, **kwargs):
4516 """
4517 IsSelection(self) -> bool
4518
4519 For a listbox or similar event, returns true if it is a selection,
4520 false if it is a deselection.
4521 """
4522 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4523
4524 def SetExtraLong(*args, **kwargs):
4525 """SetExtraLong(self, long extraLong)"""
4526 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4527
4528 def GetExtraLong(*args, **kwargs):
4529 """
4530 GetExtraLong(self) -> long
4531
4532 Returns extra information dependant on the event objects type. If the
4533 event comes from a listbox selection, it is a boolean determining
4534 whether the event was a selection (true) or a deselection (false). A
4535 listbox deselection only occurs for multiple-selection boxes, and in
4536 this case the index and string values are indeterminate and the
4537 listbox must be examined by the application.
4538 """
4539 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4540
4541 def SetInt(*args, **kwargs):
4542 """SetInt(self, int i)"""
4543 return _core_.CommandEvent_SetInt(*args, **kwargs)
4544
4545 def GetInt(*args, **kwargs):
4546 """
4547 GetInt(self) -> int
4548
4549 Returns the integer identifier corresponding to a listbox, choice or
4550 radiobox selection (only if the event was a selection, not a
4551 deselection), or a boolean value representing the value of a checkbox.
4552 """
4553 return _core_.CommandEvent_GetInt(*args, **kwargs)
4554
4555 def GetClientData(*args, **kwargs):
4556 """
4557 GetClientData(self) -> PyObject
4558
4559 Returns the client data object for a listbox or choice selection event, (if any.)
4560 """
4561 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4562
4563 def SetClientData(*args, **kwargs):
4564 """
4565 SetClientData(self, PyObject clientData)
4566
4567 Associate the given client data with the item at position n.
4568 """
4569 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4570
4571 GetClientObject = GetClientData
4572 SetClientObject = SetClientData
4573
4574 def Clone(*args, **kwargs):
4575 """Clone(self) -> Event"""
4576 return _core_.CommandEvent_Clone(*args, **kwargs)
4577
4578 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4579 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4580 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4581 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4582 Selection = property(GetSelection,doc="See `GetSelection`")
4583 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4584 _core_.CommandEvent_swigregister(CommandEvent)
4585
4586 #---------------------------------------------------------------------------
4587
4588 class NotifyEvent(CommandEvent):
4589 """
4590 An instance of this class (or one of its derived classes) is sent from
4591 a control when the control's state is being changed and the control
4592 allows that change to be prevented from happening. The event handler
4593 can call `Veto` or `Allow` to tell the control what to do.
4594 """
4595 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4596 __repr__ = _swig_repr
4597 def __init__(self, *args, **kwargs):
4598 """
4599 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4600
4601 An instance of this class (or one of its derived classes) is sent from
4602 a control when the control's state is being changed and the control
4603 allows that change to be prevented from happening. The event handler
4604 can call `Veto` or `Allow` to tell the control what to do.
4605 """
4606 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4607 def Veto(*args, **kwargs):
4608 """
4609 Veto(self)
4610
4611 Prevents the change announced by this event from happening.
4612
4613 It is in general a good idea to notify the user about the reasons for
4614 vetoing the change because otherwise the applications behaviour (which
4615 just refuses to do what the user wants) might be quite surprising.
4616 """
4617 return _core_.NotifyEvent_Veto(*args, **kwargs)
4618
4619 def Allow(*args, **kwargs):
4620 """
4621 Allow(self)
4622
4623 This is the opposite of `Veto`: it explicitly allows the event to be
4624 processed. For most events it is not necessary to call this method as
4625 the events are allowed anyhow but some are forbidden by default (this
4626 will be mentioned in the corresponding event description).
4627 """
4628 return _core_.NotifyEvent_Allow(*args, **kwargs)
4629
4630 def IsAllowed(*args, **kwargs):
4631 """
4632 IsAllowed(self) -> bool
4633
4634 Returns true if the change is allowed (`Veto` hasn't been called) or
4635 false otherwise (if it was).
4636 """
4637 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4638
4639 _core_.NotifyEvent_swigregister(NotifyEvent)
4640
4641 #---------------------------------------------------------------------------
4642
4643 class ScrollEvent(CommandEvent):
4644 """
4645 A scroll event holds information about events sent from stand-alone
4646 scrollbars and sliders. Note that scrolled windows do not send
4647 instances of this event class, but send the `wx.ScrollWinEvent`
4648 instead.
4649 """
4650 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4651 __repr__ = _swig_repr
4652 def __init__(self, *args, **kwargs):
4653 """
4654 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4655 int orient=0) -> ScrollEvent
4656 """
4657 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4658 def GetOrientation(*args, **kwargs):
4659 """
4660 GetOrientation(self) -> int
4661
4662 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4663 the scrollbar.
4664 """
4665 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4666
4667 def GetPosition(*args, **kwargs):
4668 """
4669 GetPosition(self) -> int
4670
4671 Returns the position of the scrollbar.
4672 """
4673 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4674
4675 def SetOrientation(*args, **kwargs):
4676 """SetOrientation(self, int orient)"""
4677 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4678
4679 def SetPosition(*args, **kwargs):
4680 """SetPosition(self, int pos)"""
4681 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4682
4683 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4684 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4685 _core_.ScrollEvent_swigregister(ScrollEvent)
4686
4687 #---------------------------------------------------------------------------
4688
4689 class ScrollWinEvent(Event):
4690 """
4691 A wx.ScrollWinEvent holds information about scrolling and is sent from
4692 scrolling windows.
4693 """
4694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4695 __repr__ = _swig_repr
4696 def __init__(self, *args, **kwargs):
4697 """
4698 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4699
4700 A wx.ScrollWinEvent holds information about scrolling and is sent from
4701 scrolling windows.
4702 """
4703 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4704 def GetOrientation(*args, **kwargs):
4705 """
4706 GetOrientation(self) -> int
4707
4708 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4709 the scrollbar.
4710 """
4711 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4712
4713 def GetPosition(*args, **kwargs):
4714 """
4715 GetPosition(self) -> int
4716
4717 Returns the position of the scrollbar for the thumb track and release
4718 events. Note that this field can't be used for the other events, you
4719 need to query the window itself for the current position in that case.
4720 """
4721 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4722
4723 def SetOrientation(*args, **kwargs):
4724 """SetOrientation(self, int orient)"""
4725 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4726
4727 def SetPosition(*args, **kwargs):
4728 """SetPosition(self, int pos)"""
4729 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4730
4731 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4732 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
4733 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4734
4735 #---------------------------------------------------------------------------
4736
4737 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4738 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4739 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4740 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4741 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4742 class MouseEvent(Event):
4743 """
4744 This event class contains information about the events generated by
4745 the mouse: they include mouse buttons press and release events and
4746 mouse move events.
4747
4748 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4749 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4750 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4751 a middle button so a portable application should avoid relying on the
4752 events from it.
4753
4754 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4755 the former returns true when the event corresponds to the left mouse
4756 button click while the latter returns true if the left mouse button is
4757 currently being pressed. For example, when the user is dragging the
4758 mouse you can use `LeftIsDown` to test whether the left mouse button
4759 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4760 `LeftIsDown` will also return true in wxWidgets whatever the
4761 underlying GUI behaviour is (which is platform-dependent). The same
4762 applies, of course, to other mouse buttons as well.
4763 """
4764 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4765 __repr__ = _swig_repr
4766 def __init__(self, *args, **kwargs):
4767 """
4768 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4769
4770 Constructs a wx.MouseEvent. Valid event types are:
4771
4772 * wxEVT_ENTER_WINDOW
4773 * wxEVT_LEAVE_WINDOW
4774 * wxEVT_LEFT_DOWN
4775 * wxEVT_LEFT_UP
4776 * wxEVT_LEFT_DCLICK
4777 * wxEVT_MIDDLE_DOWN
4778 * wxEVT_MIDDLE_UP
4779 * wxEVT_MIDDLE_DCLICK
4780 * wxEVT_RIGHT_DOWN
4781 * wxEVT_RIGHT_UP
4782 * wxEVT_RIGHT_DCLICK
4783 * wxEVT_MOTION
4784 * wxEVT_MOUSEWHEEL
4785 """
4786 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4787 def IsButton(*args, **kwargs):
4788 """
4789 IsButton(self) -> bool
4790
4791 Returns true if the event was a mouse button event (not necessarily a
4792 button down event - that may be tested using `ButtonDown`).
4793 """
4794 return _core_.MouseEvent_IsButton(*args, **kwargs)
4795
4796 def ButtonDown(*args, **kwargs):
4797 """
4798 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4799
4800 If the argument is omitted, this returns true if the event was any
4801 mouse button down event. Otherwise the argument specifies which
4802 button-down event shold be checked for (see `Button` for the possible
4803 values).
4804 """
4805 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4806
4807 def ButtonDClick(*args, **kwargs):
4808 """
4809 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4810
4811 If the argument is omitted, this returns true if the event was any
4812 mouse double click event. Otherwise the argument specifies which
4813 double click event to check for (see `Button` for the possible
4814 values).
4815 """
4816 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4817
4818 def ButtonUp(*args, **kwargs):
4819 """
4820 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4821
4822 If the argument is omitted, this returns true if the event was any
4823 mouse button up event. Otherwise the argument specifies which button
4824 up event to check for (see `Button` for the possible values).
4825 """
4826 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4827
4828 def Button(*args, **kwargs):
4829 """
4830 Button(self, int button) -> bool
4831
4832 Returns true if the identified mouse button is changing state. Valid
4833 values of button are:
4834
4835 ==================== =====================================
4836 wx.MOUSE_BTN_LEFT check if left button was pressed
4837 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4838 wx.MOUSE_BTN_RIGHT check if right button was pressed
4839 wx.MOUSE_BTN_ANY check if any button was pressed
4840 ==================== =====================================
4841
4842 """
4843 return _core_.MouseEvent_Button(*args, **kwargs)
4844
4845 def ButtonIsDown(*args, **kwargs):
4846 """ButtonIsDown(self, int but) -> bool"""
4847 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4848
4849 def GetButton(*args, **kwargs):
4850 """
4851 GetButton(self) -> int
4852
4853 Returns the mouse button which generated this event or
4854 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4855 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4856 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4857 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4858 right buttons respectively.
4859 """
4860 return _core_.MouseEvent_GetButton(*args, **kwargs)
4861
4862 def ControlDown(*args, **kwargs):
4863 """
4864 ControlDown(self) -> bool
4865
4866 Returns true if the control key was down at the time of the event.
4867 """
4868 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4869
4870 def MetaDown(*args, **kwargs):
4871 """
4872 MetaDown(self) -> bool
4873
4874 Returns true if the Meta key was down at the time of the event.
4875 """
4876 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4877
4878 def AltDown(*args, **kwargs):
4879 """
4880 AltDown(self) -> bool
4881
4882 Returns true if the Alt key was down at the time of the event.
4883 """
4884 return _core_.MouseEvent_AltDown(*args, **kwargs)
4885
4886 def ShiftDown(*args, **kwargs):
4887 """
4888 ShiftDown(self) -> bool
4889
4890 Returns true if the Shift key was down at the time of the event.
4891 """
4892 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4893
4894 def CmdDown(*args, **kwargs):
4895 """
4896 CmdDown(self) -> bool
4897
4898 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4899 platforms but the special "Apple" (a.k.a as "Command") key on
4900 Macs. It often makes sense to use it instead of, say, `ControlDown`
4901 because Cmd key is used for the same thing under Mac as Ctrl
4902 elsewhere. The Ctrl key still exists, it's just not used for this
4903 purpose. So for non-Mac platforms this is the same as `ControlDown`
4904 and Macs this is the same as `MetaDown`.
4905 """
4906 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4907
4908 def LeftDown(*args, **kwargs):
4909 """
4910 LeftDown(self) -> bool
4911
4912 Returns true if the left mouse button state changed to down.
4913 """
4914 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4915
4916 def MiddleDown(*args, **kwargs):
4917 """
4918 MiddleDown(self) -> bool
4919
4920 Returns true if the middle mouse button state changed to down.
4921 """
4922 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4923
4924 def RightDown(*args, **kwargs):
4925 """
4926 RightDown(self) -> bool
4927
4928 Returns true if the right mouse button state changed to down.
4929 """
4930 return _core_.MouseEvent_RightDown(*args, **kwargs)
4931
4932 def LeftUp(*args, **kwargs):
4933 """
4934 LeftUp(self) -> bool
4935
4936 Returns true if the left mouse button state changed to up.
4937 """
4938 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4939
4940 def MiddleUp(*args, **kwargs):
4941 """
4942 MiddleUp(self) -> bool
4943
4944 Returns true if the middle mouse button state changed to up.
4945 """
4946 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4947
4948 def RightUp(*args, **kwargs):
4949 """
4950 RightUp(self) -> bool
4951
4952 Returns true if the right mouse button state changed to up.
4953 """
4954 return _core_.MouseEvent_RightUp(*args, **kwargs)
4955
4956 def LeftDClick(*args, **kwargs):
4957 """
4958 LeftDClick(self) -> bool
4959
4960 Returns true if the event was a left button double click.
4961 """
4962 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4963
4964 def MiddleDClick(*args, **kwargs):
4965 """
4966 MiddleDClick(self) -> bool
4967
4968 Returns true if the event was a middle button double click.
4969 """
4970 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4971
4972 def RightDClick(*args, **kwargs):
4973 """
4974 RightDClick(self) -> bool
4975
4976 Returns true if the event was a right button double click.
4977 """
4978 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4979
4980 def LeftIsDown(*args, **kwargs):
4981 """
4982 LeftIsDown(self) -> bool
4983
4984 Returns true if the left mouse button is currently down, independent
4985 of the current event type.
4986
4987 Please notice that it is not the same as LeftDown which returns true
4988 if the left mouse button was just pressed. Rather, it describes the
4989 state of the mouse button before the event happened.
4990
4991 This event is usually used in the mouse event handlers which process
4992 "move mouse" messages to determine whether the user is (still)
4993 dragging the mouse.
4994 """
4995 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4996
4997 def MiddleIsDown(*args, **kwargs):
4998 """
4999 MiddleIsDown(self) -> bool
5000
5001 Returns true if the middle mouse button is currently down, independent
5002 of the current event type.
5003 """
5004 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
5005
5006 def RightIsDown(*args, **kwargs):
5007 """
5008 RightIsDown(self) -> bool
5009
5010 Returns true if the right mouse button is currently down, independent
5011 of the current event type.
5012 """
5013 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
5014
5015 def Dragging(*args, **kwargs):
5016 """
5017 Dragging(self) -> bool
5018
5019 Returns true if this was a dragging event (motion while a button is
5020 depressed).
5021 """
5022 return _core_.MouseEvent_Dragging(*args, **kwargs)
5023
5024 def Moving(*args, **kwargs):
5025 """
5026 Moving(self) -> bool
5027
5028 Returns true if this was a motion event and no mouse buttons were
5029 pressed. If any mouse button is held pressed, then this method returns
5030 false and Dragging returns true.
5031 """
5032 return _core_.MouseEvent_Moving(*args, **kwargs)
5033
5034 def Entering(*args, **kwargs):
5035 """
5036 Entering(self) -> bool
5037
5038 Returns true if the mouse was entering the window.
5039 """
5040 return _core_.MouseEvent_Entering(*args, **kwargs)
5041
5042 def Leaving(*args, **kwargs):
5043 """
5044 Leaving(self) -> bool
5045
5046 Returns true if the mouse was leaving the window.
5047 """
5048 return _core_.MouseEvent_Leaving(*args, **kwargs)
5049
5050 def GetPosition(*args, **kwargs):
5051 """
5052 GetPosition(self) -> Point
5053
5054 Returns the pixel position of the mouse in window coordinates when the
5055 event happened.
5056 """
5057 return _core_.MouseEvent_GetPosition(*args, **kwargs)
5058
5059 def GetPositionTuple(*args, **kwargs):
5060 """
5061 GetPositionTuple() -> (x,y)
5062
5063 Returns the pixel position of the mouse in window coordinates when the
5064 event happened.
5065 """
5066 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
5067
5068 def GetLogicalPosition(*args, **kwargs):
5069 """
5070 GetLogicalPosition(self, DC dc) -> Point
5071
5072 Returns the logical mouse position in pixels (i.e. translated
5073 according to the translation set for the DC, which usually indicates
5074 that the window has been scrolled).
5075 """
5076 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
5077
5078 def GetX(*args, **kwargs):
5079 """
5080 GetX(self) -> int
5081
5082 Returns X coordinate of the physical mouse event position.
5083 """
5084 return _core_.MouseEvent_GetX(*args, **kwargs)
5085
5086 def GetY(*args, **kwargs):
5087 """
5088 GetY(self) -> int
5089
5090 Returns Y coordinate of the physical mouse event position.
5091 """
5092 return _core_.MouseEvent_GetY(*args, **kwargs)
5093
5094 def GetWheelRotation(*args, **kwargs):
5095 """
5096 GetWheelRotation(self) -> int
5097
5098 Get wheel rotation, positive or negative indicates direction of
5099 rotation. Current devices all send an event when rotation is equal to
5100 +/-WheelDelta, but this allows for finer resolution devices to be
5101 created in the future. Because of this you shouldn't assume that one
5102 event is equal to 1 line or whatever, but you should be able to either
5103 do partial line scrolling or wait until +/-WheelDelta rotation values
5104 have been accumulated before scrolling.
5105 """
5106 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
5107
5108 def GetWheelDelta(*args, **kwargs):
5109 """
5110 GetWheelDelta(self) -> int
5111
5112 Get wheel delta, normally 120. This is the threshold for action to be
5113 taken, and one such action (for example, scrolling one increment)
5114 should occur for each delta.
5115 """
5116 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
5117
5118 def GetWheelAxis(*args, **kwargs):
5119 """
5120 GetWheelAxis(self) -> int
5121
5122 Gets the axis the wheel operation concerns, 0 being the y axis as on
5123 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5124 or horizontal trackpad scrolling.
5125 """
5126 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5127
5128 def GetLinesPerAction(*args, **kwargs):
5129 """
5130 GetLinesPerAction(self) -> int
5131
5132 Returns the configured number of lines (or whatever) to be scrolled
5133 per wheel action. Defaults to three.
5134 """
5135 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
5136
5137 def IsPageScroll(*args, **kwargs):
5138 """
5139 IsPageScroll(self) -> bool
5140
5141 Returns true if the system has been setup to do page scrolling with
5142 the mouse wheel instead of line scrolling.
5143 """
5144 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5145
5146 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5147 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5148 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5149 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5150 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5151 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5152 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5153 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5154 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5155 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5156 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5157 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
5158 Button = property(GetButton,doc="See `GetButton`")
5159 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5160 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5161 Position = property(GetPosition,doc="See `GetPosition`")
5162 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5163 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5164 X = property(GetX,doc="See `GetX`")
5165 Y = property(GetY,doc="See `GetY`")
5166 _core_.MouseEvent_swigregister(MouseEvent)
5167
5168 #---------------------------------------------------------------------------
5169
5170 class SetCursorEvent(Event):
5171 """
5172 A SetCursorEvent is generated when the mouse cursor is about to be set
5173 as a result of mouse motion. This event gives the application the
5174 chance to perform specific mouse cursor processing based on the
5175 current position of the mouse within the window. Use the `SetCursor`
5176 method to specify the cursor you want to be displayed.
5177 """
5178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5179 __repr__ = _swig_repr
5180 def __init__(self, *args, **kwargs):
5181 """
5182 __init__(self, int x=0, int y=0) -> SetCursorEvent
5183
5184 Construct a new `wx.SetCursorEvent`.
5185 """
5186 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
5187 def GetX(*args, **kwargs):
5188 """
5189 GetX(self) -> int
5190
5191 Returns the X coordinate of the mouse in client coordinates.
5192 """
5193 return _core_.SetCursorEvent_GetX(*args, **kwargs)
5194
5195 def GetY(*args, **kwargs):
5196 """
5197 GetY(self) -> int
5198
5199 Returns the Y coordinate of the mouse in client coordinates.
5200 """
5201 return _core_.SetCursorEvent_GetY(*args, **kwargs)
5202
5203 def SetCursor(*args, **kwargs):
5204 """
5205 SetCursor(self, Cursor cursor)
5206
5207 Sets the cursor associated with this event.
5208 """
5209 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
5210
5211 def GetCursor(*args, **kwargs):
5212 """
5213 GetCursor(self) -> Cursor
5214
5215 Returns a reference to the cursor specified by this event.
5216 """
5217 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
5218
5219 def HasCursor(*args, **kwargs):
5220 """
5221 HasCursor(self) -> bool
5222
5223 Returns true if the cursor specified by this event is a valid cursor.
5224 """
5225 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
5226
5227 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5228 X = property(GetX,doc="See `GetX`")
5229 Y = property(GetY,doc="See `GetY`")
5230 _core_.SetCursorEvent_swigregister(SetCursorEvent)
5231
5232 #---------------------------------------------------------------------------
5233
5234 class KeyEvent(Event):
5235 """
5236 This event class contains information about keypress and character
5237 events. These events are only sent to the widget that currently has
5238 the keyboard focus.
5239
5240 Notice that there are three different kinds of keyboard events in
5241 wxWidgets: key down and up events and char events. The difference
5242 between the first two is clear - the first corresponds to a key press
5243 and the second to a key release - otherwise they are identical. Just
5244 note that if the key is maintained in a pressed state you will
5245 typically get a lot of (automatically generated) down events but only
5246 one up so it is wrong to assume that there is one up event
5247 corresponding to each down one.
5248
5249 Both key events provide untranslated key codes while the char event
5250 carries the translated one. The untranslated code for alphanumeric
5251 keys is always an upper case value. For the other keys it is one of
5252 WXK_XXX values from the keycodes table. The translated key is, in
5253 general, the character the user expects to appear as the result of the
5254 key combination when typing the text into a text entry zone, for
5255 example.
5256
5257 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5258 and the standard US keyboard): when the 'A' key is pressed, the key
5259 down event key code is equal to ASCII A == 65. But the char event key
5260 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5261 'A' keys simultaneously , the key code in key down event will still be
5262 just 'A' while the char event key code parameter will now be 'A' as
5263 well.
5264
5265 Although in this simple case it is clear that the correct key code
5266 could be found in the key down event handler by checking the value
5267 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5268 as for non alphanumeric keys or non-US keyboard layouts the
5269 translation is keyboard-layout dependent and can only be done properly
5270 by the system itself.
5271
5272 Another kind of translation is done when the control key is pressed:
5273 for example, for CTRL-A key press the key down event still carries the
5274 same key code 'A' as usual but the char event will have key code of 1,
5275 the ASCII value of this key combination.
5276
5277 You may discover how the other keys on your system behave
5278 interactively by running the KeyEvents sample in the wxPython demo and
5279 pressing some keys while the blue box at the top has the keyboard
5280 focus.
5281
5282 **Note**: If a key down event is caught and the event handler does not
5283 call event.Skip() then the coresponding char event will not
5284 happen. This is by design and enables the programs that handle both
5285 types of events to be a bit simpler.
5286
5287 **Note for Windows programmers**: The key and char events in wxWidgets
5288 are similar to but slightly different from Windows WM_KEYDOWN and
5289 WM_CHAR events. In particular, Alt-x combination will generate a char
5290 event in wxWidgets (unless it is used as an accelerator).
5291
5292 **Tip**: be sure to call event.Skip() for events that you don't
5293 process in key event function, otherwise menu shortcuts may cease to
5294 work under Windows.
5295
5296 """
5297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5298 __repr__ = _swig_repr
5299 def __init__(self, *args, **kwargs):
5300 """
5301 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5302
5303 Construct a new `wx.KeyEvent`. Valid event types are:
5304 *
5305 """
5306 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
5307 def GetModifiers(*args, **kwargs):
5308 """
5309 GetModifiers(self) -> int
5310
5311 Returns a bitmask of the current modifier settings. Can be used to
5312 check if the key event has exactly the given modifiers without having
5313 to explicitly check that the other modifiers are not down. For
5314 example::
5315
5316 if event.GetModifers() == wx.MOD_CONTROL:
5317 DoSomething()
5318
5319 """
5320 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5321
5322 def ControlDown(*args, **kwargs):
5323 """
5324 ControlDown(self) -> bool
5325
5326 Returns ``True`` if the Control key was down at the time of the event.
5327 """
5328 return _core_.KeyEvent_ControlDown(*args, **kwargs)
5329
5330 def MetaDown(*args, **kwargs):
5331 """
5332 MetaDown(self) -> bool
5333
5334 Returns ``True`` if the Meta key was down at the time of the event.
5335 """
5336 return _core_.KeyEvent_MetaDown(*args, **kwargs)
5337
5338 def AltDown(*args, **kwargs):
5339 """
5340 AltDown(self) -> bool
5341
5342 Returns ``True`` if the Alt key was down at the time of the event.
5343 """
5344 return _core_.KeyEvent_AltDown(*args, **kwargs)
5345
5346 def ShiftDown(*args, **kwargs):
5347 """
5348 ShiftDown(self) -> bool
5349
5350 Returns ``True`` if the Shift key was down at the time of the event.
5351 """
5352 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
5353
5354 def CmdDown(*args, **kwargs):
5355 """
5356 CmdDown(self) -> bool
5357
5358 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5359 platforms but the special "Apple" (a.k.a as "Command") key on
5360 Macs. It makes often sense to use it instead of, say, `ControlDown`
5361 because Cmd key is used for the same thing under Mac as Ctrl
5362 elsewhere. The Ctrl still exists, it's just not used for this
5363 purpose. So for non-Mac platforms this is the same as `ControlDown`
5364 and Macs this is the same as `MetaDown`.
5365 """
5366 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5367
5368 def HasModifiers(*args, **kwargs):
5369 """
5370 HasModifiers(self) -> bool
5371
5372 Returns true if either CTRL or ALT keys was down at the time of the
5373 key event. Note that this function does not take into account neither
5374 SHIFT nor META key states (the reason for ignoring the latter is that
5375 it is common for NUMLOCK key to be configured as META under X but the
5376 key presses even while NUMLOCK is on should be still processed
5377 normally).
5378 """
5379 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5380
5381 def GetKeyCode(*args, **kwargs):
5382 """
5383 GetKeyCode(self) -> int
5384
5385 Returns the virtual key code. ASCII events return normal ASCII values,
5386 while non-ASCII events return values such as WXK_LEFT for the left
5387 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5388 codes.
5389
5390 Note that in Unicode build, the returned value is meaningful only if
5391 the user entered a character that can be represented in current
5392 locale's default charset. You can obtain the corresponding Unicode
5393 character using `GetUnicodeKey`.
5394 """
5395 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5396
5397 def GetUnicodeKey(*args, **kwargs):
5398 """
5399 GetUnicodeKey(self) -> int
5400
5401 Returns the Unicode character corresponding to this key event. This
5402 function is only meaningfule in a Unicode build of wxPython.
5403 """
5404 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
5405
5406 GetUniChar = GetUnicodeKey
5407 def SetUnicodeKey(*args, **kwargs):
5408 """
5409 SetUnicodeKey(self, int uniChar)
5410
5411 Set the Unicode value of the key event, but only if this is a Unicode
5412 build of wxPython.
5413 """
5414 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5415
5416 def GetRawKeyCode(*args, **kwargs):
5417 """
5418 GetRawKeyCode(self) -> unsigned int
5419
5420 Returns the raw key code for this event. This is a platform-dependent
5421 scan code which should only be used in advanced
5422 applications. Currently the raw key codes are not supported by all
5423 ports.
5424 """
5425 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5426
5427 def GetRawKeyFlags(*args, **kwargs):
5428 """
5429 GetRawKeyFlags(self) -> unsigned int
5430
5431 Returns the low level key flags for this event. The flags are
5432 platform-dependent and should only be used in advanced applications.
5433 Currently the raw key flags are not supported by all ports.
5434 """
5435 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5436
5437 def GetPosition(*args, **kwargs):
5438 """
5439 GetPosition(self) -> Point
5440
5441 Find the position of the event, if applicable.
5442 """
5443 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5444
5445 def GetPositionTuple(*args, **kwargs):
5446 """
5447 GetPositionTuple() -> (x,y)
5448
5449 Find the position of the event, if applicable.
5450 """
5451 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5452
5453 def GetX(*args, **kwargs):
5454 """
5455 GetX(self) -> int
5456
5457 Returns the X position (in client coordinates) of the event, if
5458 applicable.
5459 """
5460 return _core_.KeyEvent_GetX(*args, **kwargs)
5461
5462 def GetY(*args, **kwargs):
5463 """
5464 GetY(self) -> int
5465
5466 Returns the Y position (in client coordinates) of the event, if
5467 applicable.
5468 """
5469 return _core_.KeyEvent_GetY(*args, **kwargs)
5470
5471 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5472 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5473 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5474 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5475 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5476 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5477 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5478 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5479 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5480 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5481 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5482 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5483 Position = property(GetPosition,doc="See `GetPosition`")
5484 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5485 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5486 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5487 X = property(GetX,doc="See `GetX`")
5488 Y = property(GetY,doc="See `GetY`")
5489 _core_.KeyEvent_swigregister(KeyEvent)
5490
5491 #---------------------------------------------------------------------------
5492
5493 class SizeEvent(Event):
5494 """
5495 A size event holds information about size change events. The EVT_SIZE
5496 handler function will be called when the window it is bound to has
5497 been resized.
5498
5499 Note that the size passed is of the whole window: call
5500 `wx.Window.GetClientSize` for the area which may be used by the
5501 application.
5502
5503 When a window is resized, usually only a small part of the window is
5504 damaged and and that area is all that is in the update region for the
5505 next paint event. However, if your drawing depends on the size of the
5506 window, you may need to clear the DC explicitly and repaint the whole
5507 window. In which case, you may need to call `wx.Window.Refresh` to
5508 invalidate the entire window.
5509
5510 """
5511 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5512 __repr__ = _swig_repr
5513 def __init__(self, *args, **kwargs):
5514 """
5515 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5516
5517 Construct a new ``wx.SizeEvent``.
5518 """
5519 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
5520 def GetSize(*args, **kwargs):
5521 """
5522 GetSize(self) -> Size
5523
5524 Returns the entire size of the window generating the size change
5525 event.
5526 """
5527 return _core_.SizeEvent_GetSize(*args, **kwargs)
5528
5529 def GetRect(*args, **kwargs):
5530 """GetRect(self) -> Rect"""
5531 return _core_.SizeEvent_GetRect(*args, **kwargs)
5532
5533 def SetRect(*args, **kwargs):
5534 """SetRect(self, Rect rect)"""
5535 return _core_.SizeEvent_SetRect(*args, **kwargs)
5536
5537 def SetSize(*args, **kwargs):
5538 """SetSize(self, Size size)"""
5539 return _core_.SizeEvent_SetSize(*args, **kwargs)
5540
5541 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5542 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5543 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5544 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
5545 _core_.SizeEvent_swigregister(SizeEvent)
5546
5547 #---------------------------------------------------------------------------
5548
5549 class MoveEvent(Event):
5550 """
5551 This event object is sent for EVT_MOVE event bindings when a window is
5552 moved to a new position.
5553 """
5554 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5555 __repr__ = _swig_repr
5556 def __init__(self, *args, **kwargs):
5557 """
5558 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5559
5560 Constructor.
5561 """
5562 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5563 def GetPosition(*args, **kwargs):
5564 """
5565 GetPosition(self) -> Point
5566
5567 Returns the position of the window generating the move change event.
5568 """
5569 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5570
5571 def GetRect(*args, **kwargs):
5572 """GetRect(self) -> Rect"""
5573 return _core_.MoveEvent_GetRect(*args, **kwargs)
5574
5575 def SetRect(*args, **kwargs):
5576 """SetRect(self, Rect rect)"""
5577 return _core_.MoveEvent_SetRect(*args, **kwargs)
5578
5579 def SetPosition(*args, **kwargs):
5580 """SetPosition(self, Point pos)"""
5581 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5582
5583 m_pos = property(GetPosition, SetPosition)
5584 m_rect = property(GetRect, SetRect)
5585
5586 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5587 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5588 _core_.MoveEvent_swigregister(MoveEvent)
5589
5590 #---------------------------------------------------------------------------
5591
5592 class PaintEvent(Event):
5593 """
5594 A paint event is sent when a window's contents needs to be repainted.
5595 Note that in an EVT_PAINT handler the application must *always* create
5596 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5597 Windows assumes that the window has not been painted yet and will send
5598 the event again, causing endless refreshes.
5599
5600 You can optimize painting by retrieving the rectangles that have been
5601 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5602 and only repainting these rectangles. The rectangles are in terms of
5603 the client area, and are unscrolled, so you will need to do some
5604 calculations using the current view position to obtain logical,
5605 scrolled units.
5606
5607 """
5608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5609 __repr__ = _swig_repr
5610 def __init__(self, *args, **kwargs):
5611 """__init__(self, int Id=0) -> PaintEvent"""
5612 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5613 _core_.PaintEvent_swigregister(PaintEvent)
5614
5615 class NcPaintEvent(Event):
5616 """Proxy of C++ NcPaintEvent class"""
5617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5618 __repr__ = _swig_repr
5619 def __init__(self, *args, **kwargs):
5620 """__init__(self, int winid=0) -> NcPaintEvent"""
5621 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5622 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5623
5624 #---------------------------------------------------------------------------
5625
5626 class EraseEvent(Event):
5627 """
5628 An erase event is sent whenever the background of a window needs to be
5629 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5630 binder. On some platforms, such as GTK+, this event is simulated
5631 (simply generated just before the paint event) and may cause flicker.
5632
5633 To paint a custom background use the `GetDC` method and use the returned
5634 device context if it is not ``None``, otherwise create a temporary
5635 `wx.ClientDC` and draw on that.
5636
5637 """
5638 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5639 __repr__ = _swig_repr
5640 def __init__(self, *args, **kwargs):
5641 """
5642 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5643
5644 Constructor
5645 """
5646 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5647 def GetDC(*args, **kwargs):
5648 """
5649 GetDC(self) -> DC
5650
5651 Returns the device context the event handler should draw upon. If
5652 ``None`` is returned then create a temporary `wx.ClientDC` and use
5653 that instead.
5654 """
5655 return _core_.EraseEvent_GetDC(*args, **kwargs)
5656
5657 DC = property(GetDC,doc="See `GetDC`")
5658 _core_.EraseEvent_swigregister(EraseEvent)
5659
5660 #---------------------------------------------------------------------------
5661
5662 class FocusEvent(Event):
5663 """
5664 A focus event is sent when a window's focus changes. The window losing
5665 focus receives an EVT_KILL_FOCUS event while the window gaining it
5666 gets an EVT_SET_FOCUS event.
5667
5668 Notice that the set focus event happens both when the user gives focus
5669 to the window (whether using the mouse or keyboard) and when it is
5670 done from the program itself using `wx.Window.SetFocus`.
5671
5672 """
5673 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5674 __repr__ = _swig_repr
5675 def __init__(self, *args, **kwargs):
5676 """
5677 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5678
5679 Constructor
5680 """
5681 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5682 def GetWindow(*args, **kwargs):
5683 """
5684 GetWindow(self) -> Window
5685
5686 Returns the other window associated with this event, that is the
5687 window which had the focus before for the EVT_SET_FOCUS event and the
5688 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5689
5690 Warning: the window returned may be None!
5691 """
5692 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5693
5694 def SetWindow(*args, **kwargs):
5695 """SetWindow(self, Window win)"""
5696 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5697
5698 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
5699 _core_.FocusEvent_swigregister(FocusEvent)
5700
5701 #---------------------------------------------------------------------------
5702
5703 class ChildFocusEvent(CommandEvent):
5704 """
5705 A child focus event is sent to a (parent-)window when one of its child
5706 windows gains focus, so that the window could restore the focus back
5707 to its corresponding child if it loses it now and regains later.
5708
5709 Notice that child window is the direct child of the window receiving
5710 the event, and so may not be the actual widget recieving focus if it
5711 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5712 to get the widget that is actually receiving focus.
5713 """
5714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5715 __repr__ = _swig_repr
5716 def __init__(self, *args, **kwargs):
5717 """
5718 __init__(self, Window win=None) -> ChildFocusEvent
5719
5720 Constructor
5721 """
5722 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5723 def GetWindow(*args, **kwargs):
5724 """
5725 GetWindow(self) -> Window
5726
5727 The window, or (grand)parent of the window which has just received the
5728 focus.
5729 """
5730 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5731
5732 Window = property(GetWindow,doc="See `GetWindow`")
5733 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5734
5735 #---------------------------------------------------------------------------
5736
5737 class ActivateEvent(Event):
5738 """
5739 An activate event is sent when a top-level window or the entire
5740 application is being activated or deactivated.
5741
5742 A top-level window (a dialog or frame) receives an activate event when
5743 is being activated or deactivated. This is indicated visually by the
5744 title bar changing colour, and a subwindow gaining the keyboard focus.
5745 An application is activated or deactivated when one of its frames
5746 becomes activated, or a frame becomes inactivate resulting in all
5747 application frames being inactive.
5748
5749 Please note that usually you should call event.Skip() in your handlers
5750 for these events so the default handlers will still be called, as not
5751 doing so can result in strange effects.
5752
5753 """
5754 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5755 __repr__ = _swig_repr
5756 def __init__(self, *args, **kwargs):
5757 """
5758 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5759
5760 Constructor
5761 """
5762 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5763 def GetActive(*args, **kwargs):
5764 """
5765 GetActive(self) -> bool
5766
5767 Returns true if the application or window is being activated, false
5768 otherwise.
5769 """
5770 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5771
5772 Active = property(GetActive,doc="See `GetActive`")
5773 _core_.ActivateEvent_swigregister(ActivateEvent)
5774
5775 #---------------------------------------------------------------------------
5776
5777 class InitDialogEvent(Event):
5778 """
5779 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5780 any window when `wx.Window.InitDialog` is called. Handlers for this
5781 event can transfer data to the window, or anything else that should be
5782 done before the user begins editing the form. The default handler
5783 calls `wx.Window.TransferDataToWindow`.
5784 """
5785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5786 __repr__ = _swig_repr
5787 def __init__(self, *args, **kwargs):
5788 """
5789 __init__(self, int Id=0) -> InitDialogEvent
5790
5791 Constructor
5792 """
5793 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5794 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5795
5796 #---------------------------------------------------------------------------
5797
5798 class MenuEvent(Event):
5799 """
5800 This class is used for a variety of menu-related events. Note that
5801 these do not include menu command events, which are handled by sending
5802 `wx.CommandEvent` objects.
5803
5804 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5805 text in the first field of the status bar.
5806 """
5807 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5808 __repr__ = _swig_repr
5809 def __init__(self, *args, **kwargs):
5810 """
5811 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5812
5813 Constructor
5814 """
5815 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5816 def GetMenuId(*args, **kwargs):
5817 """
5818 GetMenuId(self) -> int
5819
5820 Returns the menu identifier associated with the event. This method
5821 should be only used with the HIGHLIGHT events.
5822 """
5823 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5824
5825 def IsPopup(*args, **kwargs):
5826 """
5827 IsPopup(self) -> bool
5828
5829 Returns ``True`` if the menu which is being opened or closed is a
5830 popup menu, ``False`` if it is a normal one. This method should only
5831 be used with the OPEN and CLOSE events.
5832 """
5833 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5834
5835 def GetMenu(*args, **kwargs):
5836 """
5837 GetMenu(self) -> Menu
5838
5839 Returns the menu which is being opened or closed. This method should
5840 only be used with the OPEN and CLOSE events.
5841 """
5842 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5843
5844 Menu = property(GetMenu,doc="See `GetMenu`")
5845 MenuId = property(GetMenuId,doc="See `GetMenuId`")
5846 _core_.MenuEvent_swigregister(MenuEvent)
5847
5848 #---------------------------------------------------------------------------
5849
5850 class CloseEvent(Event):
5851 """
5852 This event class contains information about window and session close
5853 events.
5854
5855 The handler function for EVT_CLOSE is called when the user has tried
5856 to close a a frame or dialog box using the window manager controls or
5857 the system menu. It can also be invoked by the application itself
5858 programmatically, for example by calling the `wx.Window.Close`
5859 function.
5860
5861 You should check whether the application is forcing the deletion of
5862 the window using `CanVeto`. If it returns ``False``, you must destroy
5863 the window using `wx.Window.Destroy`. If the return value is ``True``,
5864 it is up to you whether you respond by destroying the window or not.
5865 For example you may wish to display a message dialog prompting to save
5866 files or to cancel the close.
5867
5868 If you don't destroy the window, you should call `Veto` to let the
5869 calling code know that you did not destroy the window. This allows the
5870 `wx.Window.Close` function to return ``True`` or ``False`` depending
5871 on whether the close instruction was honored or not.
5872 """
5873 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5874 __repr__ = _swig_repr
5875 def __init__(self, *args, **kwargs):
5876 """
5877 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5878
5879 Constructor.
5880 """
5881 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5882 def SetLoggingOff(*args, **kwargs):
5883 """
5884 SetLoggingOff(self, bool logOff)
5885
5886 Sets the 'logging off' flag.
5887 """
5888 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5889
5890 def GetLoggingOff(*args, **kwargs):
5891 """
5892 GetLoggingOff(self) -> bool
5893
5894 Returns ``True`` if the user is logging off or ``False`` if the
5895 system is shutting down. This method can only be called for end
5896 session and query end session events, it doesn't make sense for close
5897 window event.
5898 """
5899 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5900
5901 def Veto(*args, **kwargs):
5902 """
5903 Veto(self, bool veto=True)
5904
5905 Call this from your event handler to veto a system shutdown or to
5906 signal to the calling application that a window close did not happen.
5907
5908 You can only veto a shutdown or close if `CanVeto` returns true.
5909 """
5910 return _core_.CloseEvent_Veto(*args, **kwargs)
5911
5912 def GetVeto(*args, **kwargs):
5913 """GetVeto(self) -> bool"""
5914 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5915
5916 def SetCanVeto(*args, **kwargs):
5917 """
5918 SetCanVeto(self, bool canVeto)
5919
5920 Sets the 'can veto' flag.
5921 """
5922 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5923
5924 def CanVeto(*args, **kwargs):
5925 """
5926 CanVeto(self) -> bool
5927
5928 Returns true if you can veto a system shutdown or a window close
5929 event. Vetoing a window close event is not possible if the calling
5930 code wishes to force the application to exit, and so this function
5931 must be called to check this.
5932 """
5933 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5934
5935 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5936 _core_.CloseEvent_swigregister(CloseEvent)
5937
5938 #---------------------------------------------------------------------------
5939
5940 class ShowEvent(Event):
5941 """An EVT_SHOW event is sent when a window is shown or hidden."""
5942 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5943 __repr__ = _swig_repr
5944 def __init__(self, *args, **kwargs):
5945 """
5946 __init__(self, int winid=0, bool show=False) -> ShowEvent
5947
5948 An EVT_SHOW event is sent when a window is shown or hidden.
5949 """
5950 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5951 def SetShow(*args, **kwargs):
5952 """SetShow(self, bool show)"""
5953 return _core_.ShowEvent_SetShow(*args, **kwargs)
5954
5955 def GetShow(*args, **kwargs):
5956 """GetShow(self) -> bool"""
5957 return _core_.ShowEvent_GetShow(*args, **kwargs)
5958
5959 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
5960 _core_.ShowEvent_swigregister(ShowEvent)
5961
5962 #---------------------------------------------------------------------------
5963
5964 class IconizeEvent(Event):
5965 """
5966 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5967 restored.
5968 """
5969 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5970 __repr__ = _swig_repr
5971 def __init__(self, *args, **kwargs):
5972 """
5973 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5974
5975 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5976 restored.
5977 """
5978 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5979 def Iconized(*args, **kwargs):
5980 """
5981 Iconized(self) -> bool
5982
5983 Returns ``True`` if the frame has been iconized, ``False`` if it has
5984 been restored.
5985 """
5986 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5987
5988 _core_.IconizeEvent_swigregister(IconizeEvent)
5989
5990 #---------------------------------------------------------------------------
5991
5992 class MaximizeEvent(Event):
5993 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5994 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5995 __repr__ = _swig_repr
5996 def __init__(self, *args, **kwargs):
5997 """
5998 __init__(self, int id=0) -> MaximizeEvent
5999
6000 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
6001 """
6002 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
6003 _core_.MaximizeEvent_swigregister(MaximizeEvent)
6004
6005 #---------------------------------------------------------------------------
6006
6007 class DropFilesEvent(Event):
6008 """
6009 This class is used for drop files events, that is, when files have
6010 been dropped onto the window. This functionality is only available
6011 under Windows. The window must have previously been enabled for
6012 dropping by calling `wx.Window.DragAcceptFiles`.
6013
6014 Important note: this is a separate implementation to the more general
6015 drag and drop implementation using `wx.FileDropTarget`, and etc. This
6016 implementation uses the older, Windows message-based approach of
6017 dropping files.
6018
6019 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
6020 events.
6021
6022 """
6023 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6024 def __init__(self): raise AttributeError, "No constructor defined"
6025 __repr__ = _swig_repr
6026 def GetPosition(*args, **kwargs):
6027 """
6028 GetPosition(self) -> Point
6029
6030 Returns the position at which the files were dropped.
6031 """
6032 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
6033
6034 def GetNumberOfFiles(*args, **kwargs):
6035 """
6036 GetNumberOfFiles(self) -> int
6037
6038 Returns the number of files dropped.
6039 """
6040 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
6041
6042 def GetFiles(*args, **kwargs):
6043 """
6044 GetFiles(self) -> PyObject
6045
6046 Returns a list of the filenames that were dropped.
6047 """
6048 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
6049
6050 Files = property(GetFiles,doc="See `GetFiles`")
6051 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
6052 Position = property(GetPosition,doc="See `GetPosition`")
6053 _core_.DropFilesEvent_swigregister(DropFilesEvent)
6054
6055 #---------------------------------------------------------------------------
6056
6057 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
6058 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
6059 class UpdateUIEvent(CommandEvent):
6060 """
6061 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
6062 wxWidgets to give an application the chance to update various user
6063 interface elements.
6064
6065 Without update UI events, an application has to work hard to
6066 check/uncheck, enable/disable, and set the text for elements such as
6067 menu items and toolbar buttons. The code for doing this has to be
6068 mixed up with the code that is invoked when an action is invoked for a
6069 menu item or button.
6070
6071 With update UI events, you define an event handler to look at the
6072 state of the application and change UI elements accordingly. wxWidgets
6073 will call your handler functions in idle time, so you don't have to
6074 worry where to call this code. In addition to being a clearer and more
6075 declarative method, it also means you don't have to worry whether
6076 you're updating a toolbar or menubar identifier. The same handler can
6077 update a menu item and toolbar button, if the ID values are the same.
6078
6079 Instead of directly manipulating the menu or button, you call
6080 functions in the event object, such as `Check`. wxWidgets will
6081 determine whether such a call has been made, and which UI element to
6082 update.
6083
6084 These events will work for popup menus as well as menubars. Just
6085 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6086 any UI events for the window that owns the menu.
6087
6088 If you find that the overhead of UI update processing is affecting
6089 your application, you can do one or both of the following:
6090
6091 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6092 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6093 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6094 receive update events. No other windows will receive update
6095 events.
6096
6097 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6098 value to set the delay between updates. You may need to call
6099 `wx.Window.UpdateWindowUI` at critical points, for example when
6100 a dialog is about to be shown, in case the user sees a slight
6101 delay before windows are updated.
6102
6103 Note that although events are sent in idle time, defining a EVT_IDLE
6104 handler for a window does not affect this because the events are sent
6105 from an internal idle handler.
6106
6107 wxWidgets tries to optimize update events on some platforms. On
6108 Windows and GTK+, events for menubar items are only sent when the menu
6109 is about to be shown, and not in idle time.
6110
6111 """
6112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6113 __repr__ = _swig_repr
6114 def __init__(self, *args, **kwargs):
6115 """
6116 __init__(self, int commandId=0) -> UpdateUIEvent
6117
6118 Constructor
6119 """
6120 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
6121 def GetChecked(*args, **kwargs):
6122 """
6123 GetChecked(self) -> bool
6124
6125 Returns ``True`` if the UI element should be checked.
6126 """
6127 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
6128
6129 def GetEnabled(*args, **kwargs):
6130 """
6131 GetEnabled(self) -> bool
6132
6133 Returns ``True`` if the UI element should be enabled.
6134 """
6135 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
6136
6137 def GetShown(*args, **kwargs):
6138 """
6139 GetShown(self) -> bool
6140
6141 Returns ``True`` if the UI element should be shown.
6142 """
6143 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6144
6145 def GetText(*args, **kwargs):
6146 """
6147 GetText(self) -> String
6148
6149 Returns the text that should be set for the UI element.
6150 """
6151 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
6152
6153 def GetSetText(*args, **kwargs):
6154 """
6155 GetSetText(self) -> bool
6156
6157 Returns ``True`` if the application has called `SetText`. For
6158 wxWidgets internal use only.
6159 """
6160 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
6161
6162 def GetSetChecked(*args, **kwargs):
6163 """
6164 GetSetChecked(self) -> bool
6165
6166 Returns ``True`` if the application has called `Check`. For wxWidgets
6167 internal use only.
6168 """
6169 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
6170
6171 def GetSetEnabled(*args, **kwargs):
6172 """
6173 GetSetEnabled(self) -> bool
6174
6175 Returns ``True`` if the application has called `Enable`. For wxWidgets
6176 internal use only.
6177 """
6178 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
6179
6180 def GetSetShown(*args, **kwargs):
6181 """
6182 GetSetShown(self) -> bool
6183
6184 Returns ``True`` if the application has called `Show`. For wxWidgets
6185 internal use only.
6186 """
6187 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6188
6189 def Check(*args, **kwargs):
6190 """
6191 Check(self, bool check)
6192
6193 Check or uncheck the UI element.
6194 """
6195 return _core_.UpdateUIEvent_Check(*args, **kwargs)
6196
6197 def Enable(*args, **kwargs):
6198 """
6199 Enable(self, bool enable)
6200
6201 Enable or disable the UI element.
6202 """
6203 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
6204
6205 def Show(*args, **kwargs):
6206 """
6207 Show(self, bool show)
6208
6209 Show or hide the UI element.
6210 """
6211 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6212
6213 def SetText(*args, **kwargs):
6214 """
6215 SetText(self, String text)
6216
6217 Sets the text for this UI element.
6218 """
6219 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
6220
6221 def SetUpdateInterval(*args, **kwargs):
6222 """
6223 SetUpdateInterval(long updateInterval)
6224
6225 Sets the interval between updates in milliseconds. Set to -1 to
6226 disable updates, or to 0 to update as frequently as possible. The
6227 default is 0.
6228
6229 Use this to reduce the overhead of UI update events if your
6230 application has a lot of windows. If you set the value to -1 or
6231 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6232 at appropriate points in your application, such as when a dialog is
6233 about to be shown.
6234 """
6235 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6236
6237 SetUpdateInterval = staticmethod(SetUpdateInterval)
6238 def GetUpdateInterval(*args, **kwargs):
6239 """
6240 GetUpdateInterval() -> long
6241
6242 Returns the current interval between updates in milliseconds. -1
6243 disables updates, 0 updates as frequently as possible.
6244 """
6245 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6246
6247 GetUpdateInterval = staticmethod(GetUpdateInterval)
6248 def CanUpdate(*args, **kwargs):
6249 """
6250 CanUpdate(Window win) -> bool
6251
6252 Returns ``True`` if it is appropriate to update (send UI update events
6253 to) this window.
6254
6255 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6256 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6257 events were last sent in idle time, and the update interval, to
6258 determine whether events should be sent to this window now. By default
6259 this will always return true because the update mode is initially
6260 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6261 events will be sent as often as possible. You can reduce the frequency
6262 that events are sent by changing the mode and/or setting an update
6263 interval.
6264
6265 """
6266 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6267
6268 CanUpdate = staticmethod(CanUpdate)
6269 def ResetUpdateTime(*args, **kwargs):
6270 """
6271 ResetUpdateTime()
6272
6273 Used internally to reset the last-updated time to the current time. It
6274 is assumed that update events are normally sent in idle time, so this
6275 is called at the end of idle processing.
6276 """
6277 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6278
6279 ResetUpdateTime = staticmethod(ResetUpdateTime)
6280 def SetMode(*args, **kwargs):
6281 """
6282 SetMode(int mode)
6283
6284 Specify how wxWidgets will send update events: to all windows, or only
6285 to those which specify that they will process the events.
6286
6287 The mode may be one of the following values:
6288
6289 ============================= ==========================================
6290 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6291 is the default setting.
6292 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6293 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6294 style set.
6295 ============================= ==========================================
6296
6297 """
6298 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6299
6300 SetMode = staticmethod(SetMode)
6301 def GetMode(*args, **kwargs):
6302 """
6303 GetMode() -> int
6304
6305 Returns a value specifying how wxWidgets will send update events: to
6306 all windows, or only to those which specify that they will process the
6307 events.
6308 """
6309 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6310
6311 GetMode = staticmethod(GetMode)
6312 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6313 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6314 Shown = property(GetShown,Show,doc="See `GetShown`")
6315 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
6316 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
6317
6318 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
6319 """
6320 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6321
6322 Sets the interval between updates in milliseconds. Set to -1 to
6323 disable updates, or to 0 to update as frequently as possible. The
6324 default is 0.
6325
6326 Use this to reduce the overhead of UI update events if your
6327 application has a lot of windows. If you set the value to -1 or
6328 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6329 at appropriate points in your application, such as when a dialog is
6330 about to be shown.
6331 """
6332 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6333
6334 def UpdateUIEvent_GetUpdateInterval(*args):
6335 """
6336 UpdateUIEvent_GetUpdateInterval() -> long
6337
6338 Returns the current interval between updates in milliseconds. -1
6339 disables updates, 0 updates as frequently as possible.
6340 """
6341 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
6342
6343 def UpdateUIEvent_CanUpdate(*args, **kwargs):
6344 """
6345 UpdateUIEvent_CanUpdate(Window win) -> bool
6346
6347 Returns ``True`` if it is appropriate to update (send UI update events
6348 to) this window.
6349
6350 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6351 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6352 events were last sent in idle time, and the update interval, to
6353 determine whether events should be sent to this window now. By default
6354 this will always return true because the update mode is initially
6355 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6356 events will be sent as often as possible. You can reduce the frequency
6357 that events are sent by changing the mode and/or setting an update
6358 interval.
6359
6360 """
6361 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6362
6363 def UpdateUIEvent_ResetUpdateTime(*args):
6364 """
6365 UpdateUIEvent_ResetUpdateTime()
6366
6367 Used internally to reset the last-updated time to the current time. It
6368 is assumed that update events are normally sent in idle time, so this
6369 is called at the end of idle processing.
6370 """
6371 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
6372
6373 def UpdateUIEvent_SetMode(*args, **kwargs):
6374 """
6375 UpdateUIEvent_SetMode(int mode)
6376
6377 Specify how wxWidgets will send update events: to all windows, or only
6378 to those which specify that they will process the events.
6379
6380 The mode may be one of the following values:
6381
6382 ============================= ==========================================
6383 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6384 is the default setting.
6385 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6386 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6387 style set.
6388 ============================= ==========================================
6389
6390 """
6391 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6392
6393 def UpdateUIEvent_GetMode(*args):
6394 """
6395 UpdateUIEvent_GetMode() -> int
6396
6397 Returns a value specifying how wxWidgets will send update events: to
6398 all windows, or only to those which specify that they will process the
6399 events.
6400 """
6401 return _core_.UpdateUIEvent_GetMode(*args)
6402
6403 #---------------------------------------------------------------------------
6404
6405 class SysColourChangedEvent(Event):
6406 """
6407 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6408 when the user changes the colour settings using the control
6409 panel. This is only applicable under Windows.
6410
6411 The default event handler for this event propagates the event to child
6412 windows, since Windows only sends the events to top-level windows. If
6413 intercepting this event for a top-level window, remember to call
6414 `Skip` so the the base class handler will still be executed, or to
6415 pass the event on to the window's children explicitly.
6416
6417 """
6418 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6419 __repr__ = _swig_repr
6420 def __init__(self, *args, **kwargs):
6421 """
6422 __init__(self) -> SysColourChangedEvent
6423
6424 Constructor
6425 """
6426 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
6427 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
6428
6429 #---------------------------------------------------------------------------
6430
6431 class MouseCaptureChangedEvent(Event):
6432 """
6433 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6434 a window that loses its mouse capture. This is called even if
6435 `wx.Window.ReleaseMouse` was called by the application code. Handling
6436 this event allows an application to cater for unexpected capture
6437 releases which might otherwise confuse mouse handling code.
6438
6439 This event is implemented under Windows only.
6440 """
6441 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6442 __repr__ = _swig_repr
6443 def __init__(self, *args, **kwargs):
6444 """
6445 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6446
6447 Constructor
6448 """
6449 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
6450 def GetCapturedWindow(*args, **kwargs):
6451 """
6452 GetCapturedWindow(self) -> Window
6453
6454 Returns the window that gained the capture, or ``None`` if it was a
6455 non-wxWidgets window.
6456 """
6457 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6458
6459 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
6460 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
6461
6462 #---------------------------------------------------------------------------
6463
6464 class MouseCaptureLostEvent(Event):
6465 """
6466 A mouse capture lost event is sent to a window that obtained mouse
6467 capture, which was subsequently loss due to "external" event, for
6468 example when a dialog box is shown or if another application captures
6469 the mouse.
6470
6471 If this happens, this event is sent to all windows that are on the
6472 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6473 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6474 if the capture changes because of a call to CaptureMouse or
6475 ReleaseMouse.
6476
6477 This event is currently emitted under Windows only.
6478
6479 """
6480 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6481 __repr__ = _swig_repr
6482 def __init__(self, *args, **kwargs):
6483 """
6484 __init__(self, int winid=0) -> MouseCaptureLostEvent
6485
6486 A mouse capture lost event is sent to a window that obtained mouse
6487 capture, which was subsequently loss due to "external" event, for
6488 example when a dialog box is shown or if another application captures
6489 the mouse.
6490
6491 If this happens, this event is sent to all windows that are on the
6492 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6493 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6494 if the capture changes because of a call to CaptureMouse or
6495 ReleaseMouse.
6496
6497 This event is currently emitted under Windows only.
6498
6499 """
6500 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6501 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6502
6503 #---------------------------------------------------------------------------
6504
6505 class DisplayChangedEvent(Event):
6506 """
6507 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6508 resolution has changed.
6509
6510 This event is implemented under Windows only.
6511 """
6512 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6513 __repr__ = _swig_repr
6514 def __init__(self, *args, **kwargs):
6515 """__init__(self) -> DisplayChangedEvent"""
6516 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
6517 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
6518
6519 #---------------------------------------------------------------------------
6520
6521 class PaletteChangedEvent(Event):
6522 """
6523 An EVT_PALETTE_CHANGED event is sent when the system palette has
6524 changed, thereby giving each window a chance to redo their own to
6525 match.
6526
6527 This event is implemented under Windows only.
6528 """
6529 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6530 __repr__ = _swig_repr
6531 def __init__(self, *args, **kwargs):
6532 """
6533 __init__(self, int id=0) -> PaletteChangedEvent
6534
6535 An EVT_PALETTE_CHANGED event is sent when the system palette has
6536 changed, thereby giving each window a chance to redo their own to
6537 match.
6538
6539 This event is implemented under Windows only.
6540 """
6541 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6542 def SetChangedWindow(*args, **kwargs):
6543 """SetChangedWindow(self, Window win)"""
6544 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6545
6546 def GetChangedWindow(*args, **kwargs):
6547 """GetChangedWindow(self) -> Window"""
6548 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6549
6550 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
6551 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6552
6553 #---------------------------------------------------------------------------
6554
6555 class QueryNewPaletteEvent(Event):
6556 """
6557 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6558 focus and should re-do its palette.
6559
6560 This event is implemented under Windows only.
6561 """
6562 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6563 __repr__ = _swig_repr
6564 def __init__(self, *args, **kwargs):
6565 """
6566 __init__(self, int winid=0) -> QueryNewPaletteEvent
6567
6568 Constructor.
6569 """
6570 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6571 def SetPaletteRealized(*args, **kwargs):
6572 """
6573 SetPaletteRealized(self, bool realized)
6574
6575 App should set this if it changes the palette.
6576 """
6577 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6578
6579 def GetPaletteRealized(*args, **kwargs):
6580 """GetPaletteRealized(self) -> bool"""
6581 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6582
6583 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
6584 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6585
6586 #---------------------------------------------------------------------------
6587
6588 class NavigationKeyEvent(Event):
6589 """
6590 EVT_NAVIGATION_KEY events are used to control moving the focus between
6591 widgets, otherwise known as tab-traversal. You woudl normally not
6592 catch navigation events in applications as there are already
6593 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6594 it useful to send navigation events in certain situations to change
6595 the focus in certain ways, although it's probably easier to just call
6596 `wx.Window.Navigate`.
6597 """
6598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6599 __repr__ = _swig_repr
6600 def __init__(self, *args, **kwargs):
6601 """__init__(self) -> NavigationKeyEvent"""
6602 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6603 def GetDirection(*args, **kwargs):
6604 """
6605 GetDirection(self) -> bool
6606
6607 Returns ``True`` if the direction is forward, ``False`` otherwise.
6608 """
6609 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6610
6611 def SetDirection(*args, **kwargs):
6612 """
6613 SetDirection(self, bool forward)
6614
6615 Specify the direction that the navigation should take. Usually the
6616 difference between using Tab and Shift-Tab.
6617 """
6618 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6619
6620 def IsWindowChange(*args, **kwargs):
6621 """
6622 IsWindowChange(self) -> bool
6623
6624 Returns ``True`` if window change is allowed.
6625 """
6626 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6627
6628 def SetWindowChange(*args, **kwargs):
6629 """
6630 SetWindowChange(self, bool ischange)
6631
6632 Specify if the navigation should be able to change parent windows.
6633 For example, changing notebook pages, etc. This is usually implemented
6634 by using Control-Tab.
6635 """
6636 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6637
6638 def IsFromTab(*args, **kwargs):
6639 """
6640 IsFromTab(self) -> bool
6641
6642 Returns ``True`` if the navigation event is originated from the Tab
6643 key.
6644 """
6645 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6646
6647 def SetFromTab(*args, **kwargs):
6648 """
6649 SetFromTab(self, bool bIs)
6650
6651 Set to true under MSW if the event was generated using the tab key.
6652 This is required for proper navogation over radio buttons.
6653 """
6654 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6655
6656 def SetFlags(*args, **kwargs):
6657 """
6658 SetFlags(self, long flags)
6659
6660 Set the navigation flags to a combination of the following:
6661
6662 * wx.NavigationKeyEvent.IsBackward
6663 * wx.NavigationKeyEvent.IsForward
6664 * wx.NavigationKeyEvent.WinChange
6665 * wx.NavigationKeyEvent.FromTab
6666
6667 """
6668 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6669
6670 def GetCurrentFocus(*args, **kwargs):
6671 """
6672 GetCurrentFocus(self) -> Window
6673
6674 Returns the child window which currenty has the focus. May be
6675 ``None``.
6676 """
6677 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6678
6679 def SetCurrentFocus(*args, **kwargs):
6680 """
6681 SetCurrentFocus(self, Window win)
6682
6683 Set the window that has the focus.
6684 """
6685 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6686
6687 IsBackward = _core_.NavigationKeyEvent_IsBackward
6688 IsForward = _core_.NavigationKeyEvent_IsForward
6689 WinChange = _core_.NavigationKeyEvent_WinChange
6690 FromTab = _core_.NavigationKeyEvent_FromTab
6691 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6692 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
6693 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6694
6695 #---------------------------------------------------------------------------
6696
6697 class WindowCreateEvent(CommandEvent):
6698 """
6699 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6700 underlying GUI object) exists.
6701 """
6702 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6703 __repr__ = _swig_repr
6704 def __init__(self, *args, **kwargs):
6705 """
6706 __init__(self, Window win=None) -> WindowCreateEvent
6707
6708 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6709 underlying GUI object) exists.
6710 """
6711 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6712 def GetWindow(*args, **kwargs):
6713 """
6714 GetWindow(self) -> Window
6715
6716 Returns the window that this event refers to.
6717 """
6718 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6719
6720 Window = property(GetWindow,doc="See `GetWindow`")
6721 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6722
6723 class WindowDestroyEvent(CommandEvent):
6724 """
6725 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6726 when the GUI window is destroyed.
6727
6728 When a class derived from `wx.Window` is destroyed its destructor will
6729 have already run by the time this event is sent. Therefore this event
6730 will not usually be received at all by the window itself. Since it is
6731 received after the destructor has run, an object should not try to
6732 handle its own wx.WindowDestroyEvent, but it can be used to get
6733 notification of the destruction of another window.
6734 """
6735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6736 __repr__ = _swig_repr
6737 def __init__(self, *args, **kwargs):
6738 """
6739 __init__(self, Window win=None) -> WindowDestroyEvent
6740
6741 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6742 when the GUI window is destroyed.
6743
6744 When a class derived from `wx.Window` is destroyed its destructor will
6745 have already run by the time this event is sent. Therefore this event
6746 will not usually be received at all by the window itself. Since it is
6747 received after the destructor has run, an object should not try to
6748 handle its own wx.WindowDestroyEvent, but it can be used to get
6749 notification of the destruction of another window.
6750 """
6751 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6752 def GetWindow(*args, **kwargs):
6753 """
6754 GetWindow(self) -> Window
6755
6756 Returns the window that this event refers to.
6757 """
6758 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6759
6760 Window = property(GetWindow,doc="See `GetWindow`")
6761 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6762
6763 #---------------------------------------------------------------------------
6764
6765 class ContextMenuEvent(CommandEvent):
6766 """
6767 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6768 give the application a chance to show a context (popup) menu.
6769 """
6770 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6771 __repr__ = _swig_repr
6772 def __init__(self, *args, **kwargs):
6773 """
6774 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6775
6776 Constructor.
6777 """
6778 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6779 def GetPosition(*args, **kwargs):
6780 """
6781 GetPosition(self) -> Point
6782
6783 Returns the position (in screen coordinants) at which the menu should
6784 be shown.
6785 """
6786 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6787
6788 def SetPosition(*args, **kwargs):
6789 """
6790 SetPosition(self, Point pos)
6791
6792 Sets the position at which the menu should be shown.
6793 """
6794 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6795
6796 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6797 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6798
6799 #---------------------------------------------------------------------------
6800
6801 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6802 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6803 class IdleEvent(Event):
6804 """
6805 This class is used for EVT_IDLE events, which are generated and sent
6806 when the application *becomes* idle. In other words, the when the
6807 event queue becomes empty then idle events are sent to all windows (by
6808 default) and as long as none of them call `RequestMore` then there are
6809 no more idle events until after the system event queue has some normal
6810 events and then becomes empty again.
6811
6812 By default, idle events are sent to all windows. If this is causing a
6813 significant overhead in your application, you can call
6814 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6815 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6816 which should receive idle events. Then idle events will only be sent
6817 to those windows and not to any others.
6818 """
6819 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6820 __repr__ = _swig_repr
6821 def __init__(self, *args, **kwargs):
6822 """
6823 __init__(self) -> IdleEvent
6824
6825 Constructor
6826 """
6827 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6828 def RequestMore(*args, **kwargs):
6829 """
6830 RequestMore(self, bool needMore=True)
6831
6832 Tells wxWidgets that more processing is required. This function can be
6833 called by an EVT_IDLE handler for a window to indicate that the
6834 application should forward the EVT_IDLE event once more to the
6835 application windows. If no window calls this function during its
6836 EVT_IDLE handler, then the application will remain in a passive event
6837 loop until a new event is posted to the application by the windowing
6838 system.
6839 """
6840 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6841
6842 def MoreRequested(*args, **kwargs):
6843 """
6844 MoreRequested(self) -> bool
6845
6846 Returns ``True`` if the OnIdle function processing this event
6847 requested more processing time.
6848 """
6849 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6850
6851 def SetMode(*args, **kwargs):
6852 """
6853 SetMode(int mode)
6854
6855 Static method for specifying how wxWidgets will send idle events: to
6856 all windows, or only to those which specify that they will process the
6857 events.
6858
6859 The mode can be one of the following values:
6860
6861 ========================= ========================================
6862 wx.IDLE_PROCESS_ALL Send idle events to all windows
6863 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6864 the wx.WS_EX_PROCESS_IDLE extra style
6865 flag set.
6866 ========================= ========================================
6867
6868 """
6869 return _core_.IdleEvent_SetMode(*args, **kwargs)
6870
6871 SetMode = staticmethod(SetMode)
6872 def GetMode(*args, **kwargs):
6873 """
6874 GetMode() -> int
6875
6876 Static method returning a value specifying how wxWidgets will send
6877 idle events: to all windows, or only to those which specify that they
6878 will process the events.
6879 """
6880 return _core_.IdleEvent_GetMode(*args, **kwargs)
6881
6882 GetMode = staticmethod(GetMode)
6883 def CanSend(*args, **kwargs):
6884 """
6885 CanSend(Window win) -> bool
6886
6887 Returns ``True`` if it is appropriate to send idle events to this
6888 window.
6889
6890 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6891 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6892 events should be sent to this window now. By default this will always
6893 return ``True`` because the update mode is initially
6894 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6895 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6896 """
6897 return _core_.IdleEvent_CanSend(*args, **kwargs)
6898
6899 CanSend = staticmethod(CanSend)
6900 _core_.IdleEvent_swigregister(IdleEvent)
6901
6902 def IdleEvent_SetMode(*args, **kwargs):
6903 """
6904 IdleEvent_SetMode(int mode)
6905
6906 Static method for specifying how wxWidgets will send idle events: to
6907 all windows, or only to those which specify that they will process the
6908 events.
6909
6910 The mode can be one of the following values:
6911
6912 ========================= ========================================
6913 wx.IDLE_PROCESS_ALL Send idle events to all windows
6914 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6915 the wx.WS_EX_PROCESS_IDLE extra style
6916 flag set.
6917 ========================= ========================================
6918
6919 """
6920 return _core_.IdleEvent_SetMode(*args, **kwargs)
6921
6922 def IdleEvent_GetMode(*args):
6923 """
6924 IdleEvent_GetMode() -> int
6925
6926 Static method returning a value specifying how wxWidgets will send
6927 idle events: to all windows, or only to those which specify that they
6928 will process the events.
6929 """
6930 return _core_.IdleEvent_GetMode(*args)
6931
6932 def IdleEvent_CanSend(*args, **kwargs):
6933 """
6934 IdleEvent_CanSend(Window win) -> bool
6935
6936 Returns ``True`` if it is appropriate to send idle events to this
6937 window.
6938
6939 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6940 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6941 events should be sent to this window now. By default this will always
6942 return ``True`` because the update mode is initially
6943 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6944 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6945 """
6946 return _core_.IdleEvent_CanSend(*args, **kwargs)
6947
6948 #---------------------------------------------------------------------------
6949
6950 class ClipboardTextEvent(CommandEvent):
6951 """
6952 A Clipboard Text event is sent when a window intercepts a text
6953 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6954 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6955 popup menu command, etc. NOTE : under windows these events are *NOT*
6956 generated automatically for a Rich Edit text control.
6957 """
6958 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6959 __repr__ = _swig_repr
6960 def __init__(self, *args, **kwargs):
6961 """
6962 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6963
6964 A Clipboard Text event is sent when a window intercepts a text
6965 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6966 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6967 popup menu command, etc. NOTE : under windows these events are *NOT*
6968 generated automatically for a Rich Edit text control.
6969 """
6970 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6971 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6972
6973 #---------------------------------------------------------------------------
6974
6975 class PyEvent(Event):
6976 """
6977 wx.PyEvent can be used as a base class for implementing custom event
6978 types in Python. You should derived from this class instead of
6979 `wx.Event` because this class is Python-aware and is able to transport
6980 its Python bits safely through the wxWidgets event system and have
6981 them still be there when the event handler is invoked.
6982
6983 :see: `wx.PyCommandEvent`
6984
6985 """
6986 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6987 __repr__ = _swig_repr
6988 def __init__(self, *args, **kwargs):
6989 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6990 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6991 self._SetSelf(self)
6992
6993 __swig_destroy__ = _core_.delete_PyEvent
6994 __del__ = lambda self : None;
6995 def _SetSelf(*args, **kwargs):
6996 """_SetSelf(self, PyObject self)"""
6997 return _core_.PyEvent__SetSelf(*args, **kwargs)
6998
6999 def _GetSelf(*args, **kwargs):
7000 """_GetSelf(self) -> PyObject"""
7001 return _core_.PyEvent__GetSelf(*args, **kwargs)
7002
7003 _core_.PyEvent_swigregister(PyEvent)
7004
7005 class PyCommandEvent(CommandEvent):
7006 """
7007 wx.PyCommandEvent can be used as a base class for implementing custom
7008 event types in Python, where the event shoudl travel up to parent
7009 windows looking for a handler. You should derived from this class
7010 instead of `wx.CommandEvent` because this class is Python-aware and is
7011 able to transport its Python bits safely through the wxWidgets event
7012 system and have them still be there when the event handler is invoked.
7013
7014 :see: `wx.PyEvent`
7015
7016 """
7017 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7018 __repr__ = _swig_repr
7019 def __init__(self, *args, **kwargs):
7020 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
7021 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
7022 self._SetSelf(self)
7023
7024 __swig_destroy__ = _core_.delete_PyCommandEvent
7025 __del__ = lambda self : None;
7026 def _SetSelf(*args, **kwargs):
7027 """_SetSelf(self, PyObject self)"""
7028 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
7029
7030 def _GetSelf(*args, **kwargs):
7031 """_GetSelf(self) -> PyObject"""
7032 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
7033
7034 _core_.PyCommandEvent_swigregister(PyCommandEvent)
7035
7036 class DateEvent(CommandEvent):
7037 """
7038 This event class holds information about a date change event and is
7039 used together with `wx.DatePickerCtrl`. It also serves as a base class
7040 for `wx.calendar.CalendarEvent`. Bind these event types with
7041 EVT_DATE_CHANGED.
7042 """
7043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7044 __repr__ = _swig_repr
7045 def __init__(self, *args, **kwargs):
7046 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
7047 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
7048 def GetDate(*args, **kwargs):
7049 """
7050 GetDate(self) -> DateTime
7051
7052 Returns the date.
7053 """
7054 return _core_.DateEvent_GetDate(*args, **kwargs)
7055
7056 def SetDate(*args, **kwargs):
7057 """
7058 SetDate(self, DateTime date)
7059
7060 Sets the date carried by the event, normally only used by the library
7061 internally.
7062 """
7063 return _core_.DateEvent_SetDate(*args, **kwargs)
7064
7065 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
7066 _core_.DateEvent_swigregister(DateEvent)
7067
7068 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7069 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7070
7071 class EventBlocker(EvtHandler):
7072 """Helper class to temporarily disable event handling for a window."""
7073 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7074 __repr__ = _swig_repr
7075 def __init__(self, *args, **kwargs):
7076 """
7077 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7078
7079 Helper class to temporarily disable event handling for a window.
7080 """
7081 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7082 __swig_destroy__ = _core_.delete_EventBlocker
7083 __del__ = lambda self : None;
7084 def Block(*args, **kwargs):
7085 """Block(self, EventType type)"""
7086 return _core_.EventBlocker_Block(*args, **kwargs)
7087
7088 _core_.EventBlocker_swigregister(EventBlocker)
7089
7090 #---------------------------------------------------------------------------
7091
7092 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7093 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7094 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7095 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7096 PRINT_WINDOWS = _core_.PRINT_WINDOWS
7097 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
7098 class PyApp(EvtHandler):
7099 """
7100 The ``wx.PyApp`` class is an *implementation detail*, please use the
7101 `wx.App` class (or some other derived class) instead.
7102 """
7103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7104 __repr__ = _swig_repr
7105 def __init__(self, *args, **kwargs):
7106 """
7107 __init__(self) -> PyApp
7108
7109 Create a new application object, starting the bootstrap process.
7110 """
7111 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7112 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
7113
7114 __swig_destroy__ = _core_.delete_PyApp
7115 __del__ = lambda self : None;
7116 def _setCallbackInfo(*args, **kwargs):
7117 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
7118 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
7119
7120 def GetAppName(*args, **kwargs):
7121 """
7122 GetAppName(self) -> String
7123
7124 Get the application name.
7125 """
7126 return _core_.PyApp_GetAppName(*args, **kwargs)
7127
7128 def SetAppName(*args, **kwargs):
7129 """
7130 SetAppName(self, String name)
7131
7132 Set the application name. This value may be used automatically by
7133 `wx.Config` and such.
7134 """
7135 return _core_.PyApp_SetAppName(*args, **kwargs)
7136
7137 def GetClassName(*args, **kwargs):
7138 """
7139 GetClassName(self) -> String
7140
7141 Get the application's class name.
7142 """
7143 return _core_.PyApp_GetClassName(*args, **kwargs)
7144
7145 def SetClassName(*args, **kwargs):
7146 """
7147 SetClassName(self, String name)
7148
7149 Set the application's class name. This value may be used for
7150 X-resources if applicable for the platform
7151 """
7152 return _core_.PyApp_SetClassName(*args, **kwargs)
7153
7154 def GetVendorName(*args, **kwargs):
7155 """
7156 GetVendorName(self) -> String
7157
7158 Get the application's vendor name.
7159 """
7160 return _core_.PyApp_GetVendorName(*args, **kwargs)
7161
7162 def SetVendorName(*args, **kwargs):
7163 """
7164 SetVendorName(self, String name)
7165
7166 Set the application's vendor name. This value may be used
7167 automatically by `wx.Config` and such.
7168 """
7169 return _core_.PyApp_SetVendorName(*args, **kwargs)
7170
7171 def GetTraits(*args, **kwargs):
7172 """
7173 GetTraits(self) -> wxAppTraits
7174
7175 Return (and create if necessary) the app traits object to which we
7176 delegate for everything which either should be configurable by the
7177 user (then he can change the default behaviour simply by overriding
7178 CreateTraits() and returning his own traits object) or which is
7179 GUI/console dependent as then wx.AppTraits allows us to abstract the
7180 differences behind the common facade.
7181
7182 :todo: Add support for overriding CreateAppTraits in wxPython.
7183 """
7184 return _core_.PyApp_GetTraits(*args, **kwargs)
7185
7186 def ProcessPendingEvents(*args, **kwargs):
7187 """
7188 ProcessPendingEvents(self)
7189
7190 Process all events in the Pending Events list -- it is necessary to
7191 call this function to process posted events. This normally happens
7192 during each event loop iteration.
7193 """
7194 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
7195
7196 def Yield(*args, **kwargs):
7197 """
7198 Yield(self, bool onlyIfNeeded=False) -> bool
7199
7200 Process all currently pending events right now, instead of waiting
7201 until return to the event loop. It is an error to call ``Yield``
7202 recursively unless the value of ``onlyIfNeeded`` is True.
7203
7204 :warning: This function is dangerous as it can lead to unexpected
7205 reentrancies (i.e. when called from an event handler it may
7206 result in calling the same event handler again), use with
7207 extreme care or, better, don't use at all!
7208
7209 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
7210
7211 """
7212 return _core_.PyApp_Yield(*args, **kwargs)
7213
7214 def WakeUpIdle(*args, **kwargs):
7215 """
7216 WakeUpIdle(self)
7217
7218 Make sure that idle events are sent again.
7219 :see: `wx.WakeUpIdle`
7220 """
7221 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
7222
7223 def IsMainLoopRunning(*args, **kwargs):
7224 """
7225 IsMainLoopRunning() -> bool
7226
7227 Returns True if we're running the main loop, i.e. if the events can
7228 currently be dispatched.
7229 """
7230 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7231
7232 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
7233 def MainLoop(*args, **kwargs):
7234 """
7235 MainLoop(self) -> int
7236
7237 Execute the main GUI loop, the function doesn't normally return until
7238 all top level windows have been closed and destroyed.
7239 """
7240 return _core_.PyApp_MainLoop(*args, **kwargs)
7241
7242 def Exit(*args, **kwargs):
7243 """
7244 Exit(self)
7245
7246 Exit the main loop thus terminating the application.
7247 :see: `wx.Exit`
7248 """
7249 return _core_.PyApp_Exit(*args, **kwargs)
7250
7251 def GetLayoutDirection(*args, **kwargs):
7252 """
7253 GetLayoutDirection(self) -> int
7254
7255 Return the layout direction for the current locale.
7256 """
7257 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7258
7259 def ExitMainLoop(*args, **kwargs):
7260 """
7261 ExitMainLoop(self)
7262
7263 Exit the main GUI loop during the next iteration of the main
7264 loop, (i.e. it does not stop the program immediately!)
7265 """
7266 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
7267
7268 def Pending(*args, **kwargs):
7269 """
7270 Pending(self) -> bool
7271
7272 Returns True if there are unprocessed events in the event queue.
7273 """
7274 return _core_.PyApp_Pending(*args, **kwargs)
7275
7276 def Dispatch(*args, **kwargs):
7277 """
7278 Dispatch(self) -> bool
7279
7280 Process the first event in the event queue (blocks until an event
7281 appears if there are none currently)
7282 """
7283 return _core_.PyApp_Dispatch(*args, **kwargs)
7284
7285 def ProcessIdle(*args, **kwargs):
7286 """
7287 ProcessIdle(self) -> bool
7288
7289 Called from the MainLoop when the application becomes idle (there are
7290 no pending events) and sends a `wx.IdleEvent` to all interested
7291 parties. Returns True if more idle events are needed, False if not.
7292 """
7293 return _core_.PyApp_ProcessIdle(*args, **kwargs)
7294
7295 def SendIdleEvents(*args, **kwargs):
7296 """
7297 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7298
7299 Send idle event to window and all subwindows. Returns True if more
7300 idle time is requested.
7301 """
7302 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
7303
7304 def IsActive(*args, **kwargs):
7305 """
7306 IsActive(self) -> bool
7307
7308 Return True if our app has focus.
7309 """
7310 return _core_.PyApp_IsActive(*args, **kwargs)
7311
7312 def SetTopWindow(*args, **kwargs):
7313 """
7314 SetTopWindow(self, Window win)
7315
7316 Set the *main* top level window
7317 """
7318 return _core_.PyApp_SetTopWindow(*args, **kwargs)
7319
7320 def GetTopWindow(*args, **kwargs):
7321 """
7322 GetTopWindow(self) -> Window
7323
7324 Return the *main* top level window (if it hadn't been set previously
7325 with SetTopWindow(), will return just some top level window and, if
7326 there not any, will return None)
7327 """
7328 return _core_.PyApp_GetTopWindow(*args, **kwargs)
7329
7330 def SetExitOnFrameDelete(*args, **kwargs):
7331 """
7332 SetExitOnFrameDelete(self, bool flag)
7333
7334 Control the exit behaviour: by default, the program will exit the main
7335 loop (and so, usually, terminate) when the last top-level program
7336 window is deleted. Beware that if you disable this behaviour (with
7337 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7338 explicitly from somewhere.
7339 """
7340 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
7341
7342 def GetExitOnFrameDelete(*args, **kwargs):
7343 """
7344 GetExitOnFrameDelete(self) -> bool
7345
7346 Get the current exit behaviour setting.
7347 """
7348 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
7349
7350 def SetUseBestVisual(*args, **kwargs):
7351 """
7352 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
7353
7354 Set whether the app should try to use the best available visual on
7355 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7356 """
7357 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
7358
7359 def GetUseBestVisual(*args, **kwargs):
7360 """
7361 GetUseBestVisual(self) -> bool
7362
7363 Get current UseBestVisual setting.
7364 """
7365 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
7366
7367 def SetPrintMode(*args, **kwargs):
7368 """SetPrintMode(self, int mode)"""
7369 return _core_.PyApp_SetPrintMode(*args, **kwargs)
7370
7371 def GetPrintMode(*args, **kwargs):
7372 """GetPrintMode(self) -> int"""
7373 return _core_.PyApp_GetPrintMode(*args, **kwargs)
7374
7375 def SetAssertMode(*args, **kwargs):
7376 """
7377 SetAssertMode(self, int mode)
7378
7379 Set the OnAssert behaviour for debug and hybrid builds.
7380 """
7381 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7382
7383 def GetAssertMode(*args, **kwargs):
7384 """
7385 GetAssertMode(self) -> int
7386
7387 Get the current OnAssert behaviour setting.
7388 """
7389 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7390
7391 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
7392 """GetMacSupportPCMenuShortcuts() -> bool"""
7393 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7394
7395 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7396 def GetMacAboutMenuItemId(*args, **kwargs):
7397 """GetMacAboutMenuItemId() -> long"""
7398 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7399
7400 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7401 def GetMacPreferencesMenuItemId(*args, **kwargs):
7402 """GetMacPreferencesMenuItemId() -> long"""
7403 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7404
7405 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7406 def GetMacExitMenuItemId(*args, **kwargs):
7407 """GetMacExitMenuItemId() -> long"""
7408 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7409
7410 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7411 def GetMacHelpMenuTitleName(*args, **kwargs):
7412 """GetMacHelpMenuTitleName() -> String"""
7413 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7414
7415 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7416 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
7417 """SetMacSupportPCMenuShortcuts(bool val)"""
7418 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7419
7420 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7421 def SetMacAboutMenuItemId(*args, **kwargs):
7422 """SetMacAboutMenuItemId(long val)"""
7423 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7424
7425 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7426 def SetMacPreferencesMenuItemId(*args, **kwargs):
7427 """SetMacPreferencesMenuItemId(long val)"""
7428 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7429
7430 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7431 def SetMacExitMenuItemId(*args, **kwargs):
7432 """SetMacExitMenuItemId(long val)"""
7433 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7434
7435 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7436 def SetMacHelpMenuTitleName(*args, **kwargs):
7437 """SetMacHelpMenuTitleName(String val)"""
7438 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7439
7440 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7441 def _BootstrapApp(*args, **kwargs):
7442 """
7443 _BootstrapApp(self)
7444
7445 For internal use only
7446 """
7447 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7448
7449 def GetComCtl32Version(*args, **kwargs):
7450 """
7451 GetComCtl32Version() -> int
7452
7453 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7454 it wasn't found at all. Raises an exception on non-Windows platforms.
7455 """
7456 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7457
7458 GetComCtl32Version = staticmethod(GetComCtl32Version)
7459 def IsDisplayAvailable(*args, **kwargs):
7460 """
7461 IsDisplayAvailable() -> bool
7462
7463 Tests if it is possible to create a GUI in the current environment.
7464 This will mean different things on the different platforms.
7465
7466 * On X Windows systems this function will return ``False`` if it is
7467 not able to open a connection to the X display, which can happen
7468 if $DISPLAY is not set, or is not set correctly.
7469
7470 * On Mac OS X a ``False`` return value will mean that wx is not
7471 able to access the window manager, which can happen if logged in
7472 remotely or if running from the normal version of python instead
7473 of the framework version, (i.e., pythonw.)
7474
7475 * On MS Windows...
7476
7477 """
7478 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7479
7480 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7481 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7482 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7483 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7484 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7485 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7486 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7487 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7488 Traits = property(GetTraits,doc="See `GetTraits`")
7489 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7490 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7491 Active = property(IsActive)
7492 _core_.PyApp_swigregister(PyApp)
7493
7494 def PyApp_IsMainLoopRunning(*args):
7495 """
7496 PyApp_IsMainLoopRunning() -> bool
7497
7498 Returns True if we're running the main loop, i.e. if the events can
7499 currently be dispatched.
7500 """
7501 return _core_.PyApp_IsMainLoopRunning(*args)
7502
7503 def PyApp_GetMacSupportPCMenuShortcuts(*args):
7504 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7505 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
7506
7507 def PyApp_GetMacAboutMenuItemId(*args):
7508 """PyApp_GetMacAboutMenuItemId() -> long"""
7509 return _core_.PyApp_GetMacAboutMenuItemId(*args)
7510
7511 def PyApp_GetMacPreferencesMenuItemId(*args):
7512 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7513 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
7514
7515 def PyApp_GetMacExitMenuItemId(*args):
7516 """PyApp_GetMacExitMenuItemId() -> long"""
7517 return _core_.PyApp_GetMacExitMenuItemId(*args)
7518
7519 def PyApp_GetMacHelpMenuTitleName(*args):
7520 """PyApp_GetMacHelpMenuTitleName() -> String"""
7521 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
7522
7523 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7524 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7525 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7526
7527 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7528 """PyApp_SetMacAboutMenuItemId(long val)"""
7529 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7530
7531 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7532 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7533 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7534
7535 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7536 """PyApp_SetMacExitMenuItemId(long val)"""
7537 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7538
7539 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7540 """PyApp_SetMacHelpMenuTitleName(String val)"""
7541 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7542
7543 def PyApp_GetComCtl32Version(*args):
7544 """
7545 PyApp_GetComCtl32Version() -> int
7546
7547 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7548 it wasn't found at all. Raises an exception on non-Windows platforms.
7549 """
7550 return _core_.PyApp_GetComCtl32Version(*args)
7551
7552 def PyApp_IsDisplayAvailable(*args):
7553 """
7554 PyApp_IsDisplayAvailable() -> bool
7555
7556 Tests if it is possible to create a GUI in the current environment.
7557 This will mean different things on the different platforms.
7558
7559 * On X Windows systems this function will return ``False`` if it is
7560 not able to open a connection to the X display, which can happen
7561 if $DISPLAY is not set, or is not set correctly.
7562
7563 * On Mac OS X a ``False`` return value will mean that wx is not
7564 able to access the window manager, which can happen if logged in
7565 remotely or if running from the normal version of python instead
7566 of the framework version, (i.e., pythonw.)
7567
7568 * On MS Windows...
7569
7570 """
7571 return _core_.PyApp_IsDisplayAvailable(*args)
7572
7573 #---------------------------------------------------------------------------
7574
7575
7576 def Exit(*args):
7577 """
7578 Exit()
7579
7580 Force an exit of the application. Convenience for wx.GetApp().Exit()
7581 """
7582 return _core_.Exit(*args)
7583
7584 def Yield(*args):
7585 """
7586 Yield() -> bool
7587
7588 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7589 """
7590 return _core_.Yield(*args)
7591
7592 def YieldIfNeeded(*args):
7593 """
7594 YieldIfNeeded() -> bool
7595
7596 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7597 """
7598 return _core_.YieldIfNeeded(*args)
7599
7600 def SafeYield(*args, **kwargs):
7601 """
7602 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7603
7604 This function is similar to `wx.Yield`, except that it disables the
7605 user input to all program windows before calling `wx.Yield` and
7606 re-enables it again afterwards. If ``win`` is not None, this window
7607 will remain enabled, allowing the implementation of some limited user
7608 interaction.
7609
7610 :Returns: the result of the call to `wx.Yield`.
7611 """
7612 return _core_.SafeYield(*args, **kwargs)
7613
7614 def WakeUpIdle(*args):
7615 """
7616 WakeUpIdle()
7617
7618 Cause the message queue to become empty again, so idle events will be
7619 sent.
7620 """
7621 return _core_.WakeUpIdle(*args)
7622
7623 def PostEvent(*args, **kwargs):
7624 """
7625 PostEvent(EvtHandler dest, Event event)
7626
7627 Send an event to a window or other wx.EvtHandler to be processed
7628 later.
7629 """
7630 return _core_.PostEvent(*args, **kwargs)
7631
7632 def App_CleanUp(*args):
7633 """
7634 App_CleanUp()
7635
7636 For internal use only, it is used to cleanup after wxWidgets when
7637 Python shuts down.
7638 """
7639 return _core_.App_CleanUp(*args)
7640
7641 def GetApp(*args):
7642 """
7643 GetApp() -> PyApp
7644
7645 Return a reference to the current wx.App object.
7646 """
7647 return _core_.GetApp(*args)
7648
7649 def SetDefaultPyEncoding(*args, **kwargs):
7650 """
7651 SetDefaultPyEncoding(string encoding)
7652
7653 Sets the encoding that wxPython will use when it needs to convert a
7654 Python string or unicode object to or from a wxString.
7655
7656 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7657 but please be aware that the default encoding within the same locale
7658 may be slightly different on different platforms. For example, please
7659 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7660 between the common latin/roman encodings.
7661 """
7662 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7663
7664 def GetDefaultPyEncoding(*args):
7665 """
7666 GetDefaultPyEncoding() -> string
7667
7668 Gets the current encoding that wxPython will use when it needs to
7669 convert a Python string or unicode object to or from a wxString.
7670 """
7671 return _core_.GetDefaultPyEncoding(*args)
7672 #----------------------------------------------------------------------
7673
7674 class PyOnDemandOutputWindow:
7675 """
7676 A class that can be used for redirecting Python's stdout and
7677 stderr streams. It will do nothing until something is wrriten to
7678 the stream at which point it will create a Frame with a text area
7679 and write the text there.
7680 """
7681 def __init__(self, title = "wxPython: stdout/stderr"):
7682 self.frame = None
7683 self.title = title
7684 self.pos = wx.DefaultPosition
7685 self.size = (450, 300)
7686 self.parent = None
7687
7688 def SetParent(self, parent):
7689 """Set the window to be used as the popup Frame's parent."""
7690 self.parent = parent
7691
7692
7693 def CreateOutputWindow(self, st):
7694 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7695 style=wx.DEFAULT_FRAME_STYLE)
7696 self.text = wx.TextCtrl(self.frame, -1, "",
7697 style=wx.TE_MULTILINE|wx.TE_READONLY)
7698 self.text.AppendText(st)
7699 self.frame.Show(True)
7700 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7701
7702
7703 def OnCloseWindow(self, event):
7704 if self.frame is not None:
7705 self.frame.Destroy()
7706 self.frame = None
7707 self.text = None
7708
7709
7710 # These methods provide the file-like output behaviour.
7711 def write(self, text):
7712 """
7713 Create the output window if needed and write the string to it.
7714 If not called in the context of the gui thread then uses
7715 CallAfter to do the work there.
7716 """
7717 if self.frame is None:
7718 if not wx.Thread_IsMain():
7719 wx.CallAfter(self.CreateOutputWindow, text)
7720 else:
7721 self.CreateOutputWindow(text)
7722 else:
7723 if not wx.Thread_IsMain():
7724 wx.CallAfter(self.text.AppendText, text)
7725 else:
7726 self.text.AppendText(text)
7727
7728
7729 def close(self):
7730 if self.frame is not None:
7731 wx.CallAfter(self.frame.Close)
7732
7733
7734 def flush(self):
7735 pass
7736
7737
7738
7739 #----------------------------------------------------------------------
7740
7741 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7742
7743 class App(wx.PyApp):
7744 """
7745 The ``wx.App`` class represents the application and is used to:
7746
7747 * bootstrap the wxPython system and initialize the underlying
7748 gui toolkit
7749 * set and get application-wide properties
7750 * implement the windowing system main message or event loop,
7751 and to dispatch events to window instances
7752 * etc.
7753
7754 Every application must have a ``wx.App`` instance, and all
7755 creation of UI objects should be delayed until after the
7756 ``wx.App`` object has been created in order to ensure that the gui
7757 platform and wxWidgets have been fully initialized.
7758
7759 Normally you would derive from this class and implement an
7760 ``OnInit`` method that creates a frame and then calls
7761 ``self.SetTopWindow(frame)``.
7762
7763 :see: `wx.PySimpleApp` for a simpler app class that can be used
7764 directly.
7765 """
7766
7767 outputWindowClass = PyOnDemandOutputWindow
7768
7769 def __init__(self, redirect=_defRedirect, filename=None,
7770 useBestVisual=False, clearSigInt=True):
7771 """
7772 Construct a ``wx.App`` object.
7773
7774 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7775 redirected? Defaults to True on Windows and Mac, False
7776 otherwise. If `filename` is None then output will be
7777 redirected to a window that pops up as needed. (You can
7778 control what kind of window is created for the output by
7779 resetting the class variable ``outputWindowClass`` to a
7780 class of your choosing.)
7781
7782 :param filename: The name of a file to redirect output to, if
7783 redirect is True.
7784
7785 :param useBestVisual: Should the app try to use the best
7786 available visual provided by the system (only relevant on
7787 systems that have more than one visual.) This parameter
7788 must be used instead of calling `SetUseBestVisual` later
7789 on because it must be set before the underlying GUI
7790 toolkit is initialized.
7791
7792 :param clearSigInt: Should SIGINT be cleared? This allows the
7793 app to terminate upon a Ctrl-C in the console like other
7794 GUI apps will.
7795
7796 :note: You should override OnInit to do applicaition
7797 initialization to ensure that the system, toolkit and
7798 wxWidgets are fully initialized.
7799 """
7800
7801 wx.PyApp.__init__(self)
7802
7803 # make sure we can create a GUI
7804 if not self.IsDisplayAvailable():
7805
7806 if wx.Platform == "__WXMAC__":
7807 msg = """This program needs access to the screen.
7808 Please run with 'pythonw', not 'python', and only when you are logged
7809 in on the main display of your Mac."""
7810
7811 elif wx.Platform == "__WXGTK__":
7812 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7813
7814 else:
7815 msg = "Unable to create GUI"
7816 # TODO: more description is needed for wxMSW...
7817
7818 raise SystemExit(msg)
7819
7820 # This has to be done before OnInit
7821 self.SetUseBestVisual(useBestVisual)
7822
7823 # Set the default handler for SIGINT. This fixes a problem
7824 # where if Ctrl-C is pressed in the console that started this
7825 # app then it will not appear to do anything, (not even send
7826 # KeyboardInterrupt???) but will later segfault on exit. By
7827 # setting the default handler then the app will exit, as
7828 # expected (depending on platform.)
7829 if clearSigInt:
7830 try:
7831 import signal
7832 signal.signal(signal.SIGINT, signal.SIG_DFL)
7833 except:
7834 pass
7835
7836 # Save and redirect the stdio to a window?
7837 self.stdioWin = None
7838 self.saveStdio = (_sys.stdout, _sys.stderr)
7839 if redirect:
7840 self.RedirectStdio(filename)
7841
7842 # Use Python's install prefix as the default
7843 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7844
7845 # Until the new native control for wxMac is up to par, still use the generic one.
7846 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7847
7848 # This finishes the initialization of wxWindows and then calls
7849 # the OnInit that should be present in the derived class
7850 self._BootstrapApp()
7851
7852
7853 def OnPreInit(self):
7854 """
7855 Things that must be done after _BootstrapApp has done its
7856 thing, but would be nice if they were already done by the time
7857 that OnInit is called.
7858 """
7859 wx.StockGDI._initStockObjects()
7860
7861
7862 def __del__(self, destroy=wx.PyApp.__del__):
7863 self.RestoreStdio() # Just in case the MainLoop was overridden
7864 destroy(self)
7865
7866 def Destroy(self):
7867 self.this.own(False)
7868 wx.PyApp.Destroy(self)
7869
7870 def SetTopWindow(self, frame):
7871 """Set the \"main\" top level window"""
7872 if self.stdioWin:
7873 self.stdioWin.SetParent(frame)
7874 wx.PyApp.SetTopWindow(self, frame)
7875
7876
7877 def MainLoop(self):
7878 """Execute the main GUI event loop"""
7879 wx.PyApp.MainLoop(self)
7880 self.RestoreStdio()
7881
7882
7883 def RedirectStdio(self, filename=None):
7884 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7885 if filename:
7886 _sys.stdout = _sys.stderr = open(filename, 'a')
7887 else:
7888 self.stdioWin = self.outputWindowClass()
7889 _sys.stdout = _sys.stderr = self.stdioWin
7890
7891
7892 def RestoreStdio(self):
7893 try:
7894 _sys.stdout, _sys.stderr = self.saveStdio
7895 except:
7896 pass
7897
7898
7899 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7900 """
7901 Set the title, position and/or size of the output window if
7902 the stdio has been redirected. This should be called before
7903 any output would cause the output window to be created.
7904 """
7905 if self.stdioWin:
7906 if title is not None:
7907 self.stdioWin.title = title
7908 if pos is not None:
7909 self.stdioWin.pos = pos
7910 if size is not None:
7911 self.stdioWin.size = size
7912
7913
7914
7915
7916 # change from wx.PyApp_XX to wx.App_XX
7917 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7918 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7919 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7920 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7921 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7922 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7923 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7924 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7925 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7926 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7927 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7928
7929 #----------------------------------------------------------------------------
7930
7931 class PySimpleApp(wx.App):
7932 """
7933 A simple application class. You can just create one of these and
7934 then then make your top level windows later, and not have to worry
7935 about OnInit. For example::
7936
7937 app = wx.PySimpleApp()
7938 frame = wx.Frame(None, title='Hello World')
7939 frame.Show()
7940 app.MainLoop()
7941
7942 :see: `wx.App`
7943 """
7944
7945 def __init__(self, redirect=False, filename=None,
7946 useBestVisual=False, clearSigInt=True):
7947 """
7948 :see: `wx.App.__init__`
7949 """
7950 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7951
7952 def OnInit(self):
7953 return True
7954
7955
7956
7957 # Is anybody using this one?
7958 class PyWidgetTester(wx.App):
7959 def __init__(self, size = (250, 100)):
7960 self.size = size
7961 wx.App.__init__(self, 0)
7962
7963 def OnInit(self):
7964 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7965 self.SetTopWindow(self.frame)
7966 return True
7967
7968 def SetWidget(self, widgetClass, *args, **kwargs):
7969 w = widgetClass(self.frame, *args, **kwargs)
7970 self.frame.Show(True)
7971
7972 #----------------------------------------------------------------------------
7973 # DO NOT hold any other references to this object. This is how we
7974 # know when to cleanup system resources that wxWidgets is holding. When
7975 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7976 # goes to zero and it calls the wx.App_CleanUp function.
7977
7978 class __wxPyCleanup:
7979 def __init__(self):
7980 self.cleanup = _core_.App_CleanUp
7981 def __del__(self):
7982 self.cleanup()
7983
7984 _sys.__wxPythonCleanup = __wxPyCleanup()
7985
7986 ## # another possible solution, but it gets called too early...
7987 ## import atexit
7988 ## atexit.register(_core_.wxApp_CleanUp)
7989
7990
7991 #----------------------------------------------------------------------------
7992
7993 #---------------------------------------------------------------------------
7994
7995 class EventLoop(object):
7996 """Proxy of C++ EventLoop class"""
7997 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7998 __repr__ = _swig_repr
7999 def __init__(self, *args, **kwargs):
8000 """__init__(self) -> EventLoop"""
8001 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
8002 __swig_destroy__ = _core_.delete_EventLoop
8003 __del__ = lambda self : None;
8004 def Run(*args, **kwargs):
8005 """Run(self) -> int"""
8006 return _core_.EventLoop_Run(*args, **kwargs)
8007
8008 def Exit(*args, **kwargs):
8009 """Exit(self, int rc=0)"""
8010 return _core_.EventLoop_Exit(*args, **kwargs)
8011
8012 def Pending(*args, **kwargs):
8013 """Pending(self) -> bool"""
8014 return _core_.EventLoop_Pending(*args, **kwargs)
8015
8016 def Dispatch(*args, **kwargs):
8017 """Dispatch(self) -> bool"""
8018 return _core_.EventLoop_Dispatch(*args, **kwargs)
8019
8020 def IsRunning(*args, **kwargs):
8021 """IsRunning(self) -> bool"""
8022 return _core_.EventLoop_IsRunning(*args, **kwargs)
8023
8024 def GetActive(*args, **kwargs):
8025 """GetActive() -> EventLoop"""
8026 return _core_.EventLoop_GetActive(*args, **kwargs)
8027
8028 GetActive = staticmethod(GetActive)
8029 def SetActive(*args, **kwargs):
8030 """SetActive(EventLoop loop)"""
8031 return _core_.EventLoop_SetActive(*args, **kwargs)
8032
8033 SetActive = staticmethod(SetActive)
8034 _core_.EventLoop_swigregister(EventLoop)
8035
8036 def EventLoop_GetActive(*args):
8037 """EventLoop_GetActive() -> EventLoop"""
8038 return _core_.EventLoop_GetActive(*args)
8039
8040 def EventLoop_SetActive(*args, **kwargs):
8041 """EventLoop_SetActive(EventLoop loop)"""
8042 return _core_.EventLoop_SetActive(*args, **kwargs)
8043
8044 class EventLoopActivator(object):
8045 """Proxy of C++ EventLoopActivator class"""
8046 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8047 __repr__ = _swig_repr
8048 def __init__(self, *args, **kwargs):
8049 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
8050 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
8051 __swig_destroy__ = _core_.delete_EventLoopActivator
8052 __del__ = lambda self : None;
8053 _core_.EventLoopActivator_swigregister(EventLoopActivator)
8054
8055 #---------------------------------------------------------------------------
8056
8057 ACCEL_ALT = _core_.ACCEL_ALT
8058 ACCEL_CTRL = _core_.ACCEL_CTRL
8059 ACCEL_SHIFT = _core_.ACCEL_SHIFT
8060 ACCEL_NORMAL = _core_.ACCEL_NORMAL
8061 ACCEL_CMD = _core_.ACCEL_CMD
8062 class AcceleratorEntry(object):
8063 """
8064 A class used to define items in an `wx.AcceleratorTable`. wxPython
8065 programs can choose to use wx.AcceleratorEntry objects, but using a
8066 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
8067 as well. See `__init__` for of the tuple values.
8068
8069 :see: `wx.AcceleratorTable`
8070 """
8071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8072 __repr__ = _swig_repr
8073 def __init__(self, *args, **kwargs):
8074 """
8075 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8076
8077 Construct a wx.AcceleratorEntry.
8078 """
8079 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8080 __swig_destroy__ = _core_.delete_AcceleratorEntry
8081 __del__ = lambda self : None;
8082 def Set(*args, **kwargs):
8083 """
8084 Set(self, int flags, int keyCode, int cmd)
8085
8086 (Re)set the attributes of a wx.AcceleratorEntry.
8087 :see `__init__`
8088 """
8089 return _core_.AcceleratorEntry_Set(*args, **kwargs)
8090
8091 def Create(*args, **kwargs):
8092 """
8093 Create(String str) -> AcceleratorEntry
8094
8095 Create accelerator corresponding to the specified string, or None if
8096 it coulnd't be parsed.
8097 """
8098 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8099
8100 Create = staticmethod(Create)
8101 def GetFlags(*args, **kwargs):
8102 """
8103 GetFlags(self) -> int
8104
8105 Get the AcceleratorEntry's flags.
8106 """
8107 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
8108
8109 def GetKeyCode(*args, **kwargs):
8110 """
8111 GetKeyCode(self) -> int
8112
8113 Get the AcceleratorEntry's keycode.
8114 """
8115 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
8116
8117 def GetCommand(*args, **kwargs):
8118 """
8119 GetCommand(self) -> int
8120
8121 Get the AcceleratorEntry's command ID.
8122 """
8123 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
8124
8125 def IsOk(*args, **kwargs):
8126 """IsOk(self) -> bool"""
8127 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8128
8129 def ToString(*args, **kwargs):
8130 """
8131 ToString(self) -> String
8132
8133 Returns a string representation for the this accelerator. The string
8134 is formatted using the <flags>-<keycode> format where <flags> maybe a
8135 hyphen-separed list of "shift|alt|ctrl"
8136
8137 """
8138 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8139
8140 def FromString(*args, **kwargs):
8141 """
8142 FromString(self, String str) -> bool
8143
8144 Returns true if the given string correctly initialized this object.
8145 """
8146 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8147
8148 Command = property(GetCommand,doc="See `GetCommand`")
8149 Flags = property(GetFlags,doc="See `GetFlags`")
8150 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
8151 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
8152
8153 def AcceleratorEntry_Create(*args, **kwargs):
8154 """
8155 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8156
8157 Create accelerator corresponding to the specified string, or None if
8158 it coulnd't be parsed.
8159 """
8160 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8161
8162 class AcceleratorTable(Object):
8163 """
8164 An accelerator table allows the application to specify a table of
8165 keyboard shortcuts for menus or other commands. On Windows, menu or
8166 button commands are supported; on GTK, only menu commands are
8167 supported.
8168 """
8169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8170 __repr__ = _swig_repr
8171 def __init__(self, *args, **kwargs):
8172 """
8173 __init__(entries) -> AcceleratorTable
8174
8175 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8176 items or or of 3-tuples (flags, keyCode, cmdID)
8177
8178 :see: `wx.AcceleratorEntry`
8179 """
8180 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8181 __swig_destroy__ = _core_.delete_AcceleratorTable
8182 __del__ = lambda self : None;
8183 def IsOk(*args, **kwargs):
8184 """IsOk(self) -> bool"""
8185 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
8186
8187 Ok = IsOk
8188 _core_.AcceleratorTable_swigregister(AcceleratorTable)
8189
8190 def GetAccelFromString(label):
8191 entry = AcceleratorEntry()
8192 entry.FromString(label)
8193 return entry
8194
8195 #---------------------------------------------------------------------------
8196
8197 class VisualAttributes(object):
8198 """struct containing all the visual attributes of a control"""
8199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8200 __repr__ = _swig_repr
8201 def __init__(self, *args, **kwargs):
8202 """
8203 __init__(self) -> VisualAttributes
8204
8205 struct containing all the visual attributes of a control
8206 """
8207 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8208 __swig_destroy__ = _core_.delete_VisualAttributes
8209 __del__ = lambda self : None;
8210 def _get_font(*args, **kwargs):
8211 """_get_font(self) -> Font"""
8212 return _core_.VisualAttributes__get_font(*args, **kwargs)
8213
8214 def _get_colFg(*args, **kwargs):
8215 """_get_colFg(self) -> Colour"""
8216 return _core_.VisualAttributes__get_colFg(*args, **kwargs)
8217
8218 def _get_colBg(*args, **kwargs):
8219 """_get_colBg(self) -> Colour"""
8220 return _core_.VisualAttributes__get_colBg(*args, **kwargs)
8221
8222 font = property(_get_font)
8223 colFg = property(_get_colFg)
8224 colBg = property(_get_colBg)
8225 _core_.VisualAttributes_swigregister(VisualAttributes)
8226 NullAcceleratorTable = cvar.NullAcceleratorTable
8227 PanelNameStr = cvar.PanelNameStr
8228
8229 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8230 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8231 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8232 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8233 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8234 class Window(EvtHandler):
8235 """
8236 wx.Window is the base class for all windows and represents any visible
8237 object on the screen. All controls, top level windows and so on are
8238 wx.Windows. Sizers and device contexts are not however, as they don't
8239 appear on screen themselves.
8240
8241 """
8242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8243 __repr__ = _swig_repr
8244 def __init__(self, *args, **kwargs):
8245 """
8246 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8247 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8248
8249 Construct and show a generic Window.
8250 """
8251 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
8252 self._setOORInfo(self)
8253
8254 def Create(*args, **kwargs):
8255 """
8256 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8257 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8258
8259 Create the GUI part of the Window for 2-phase creation mode.
8260 """
8261 return _core_.Window_Create(*args, **kwargs)
8262
8263 def Close(*args, **kwargs):
8264 """
8265 Close(self, bool force=False) -> bool
8266
8267 This function simply generates a EVT_CLOSE event whose handler usually
8268 tries to close the window. It doesn't close the window itself,
8269 however. If force is False (the default) then the window's close
8270 handler will be allowed to veto the destruction of the window.
8271 """
8272 return _core_.Window_Close(*args, **kwargs)
8273
8274 def Destroy(*args, **kwargs):
8275 """
8276 Destroy(self) -> bool
8277
8278 Destroys the window safely. Frames and dialogs are not destroyed
8279 immediately when this function is called -- they are added to a list
8280 of windows to be deleted on idle time, when all the window's events
8281 have been processed. This prevents problems with events being sent to
8282 non-existent windows.
8283
8284 Returns True if the window has either been successfully deleted, or it
8285 has been added to the list of windows pending real deletion.
8286 """
8287 args[0].this.own(False)
8288 return _core_.Window_Destroy(*args, **kwargs)
8289
8290 def DestroyChildren(*args, **kwargs):
8291 """
8292 DestroyChildren(self) -> bool
8293
8294 Destroys all children of a window. Called automatically by the
8295 destructor.
8296 """
8297 return _core_.Window_DestroyChildren(*args, **kwargs)
8298
8299 def IsBeingDeleted(*args, **kwargs):
8300 """
8301 IsBeingDeleted(self) -> bool
8302
8303 Is the window in the process of being deleted?
8304 """
8305 return _core_.Window_IsBeingDeleted(*args, **kwargs)
8306
8307 def SetLabel(*args, **kwargs):
8308 """
8309 SetLabel(self, String label)
8310
8311 Set the text which the window shows in its label if applicable.
8312 """
8313 return _core_.Window_SetLabel(*args, **kwargs)
8314
8315 def GetLabel(*args, **kwargs):
8316 """
8317 GetLabel(self) -> String
8318
8319 Generic way of getting a label from any window, for identification
8320 purposes. The interpretation of this function differs from class to
8321 class. For frames and dialogs, the value returned is the title. For
8322 buttons or static text controls, it is the button text. This function
8323 can be useful for meta-programs such as testing tools or special-needs
8324 access programs)which need to identify windows by name.
8325 """
8326 return _core_.Window_GetLabel(*args, **kwargs)
8327
8328 def SetName(*args, **kwargs):
8329 """
8330 SetName(self, String name)
8331
8332 Sets the window's name. The window name is used for ressource setting
8333 in X, it is not the same as the window title/label
8334 """
8335 return _core_.Window_SetName(*args, **kwargs)
8336
8337 def GetName(*args, **kwargs):
8338 """
8339 GetName(self) -> String
8340
8341 Returns the windows name. This name is not guaranteed to be unique;
8342 it is up to the programmer to supply an appropriate name in the window
8343 constructor or via wx.Window.SetName.
8344 """
8345 return _core_.Window_GetName(*args, **kwargs)
8346
8347 def SetWindowVariant(*args, **kwargs):
8348 """
8349 SetWindowVariant(self, int variant)
8350
8351 Sets the variant of the window/font size to use for this window, if
8352 the platform supports variants, for example, wxMac.
8353 """
8354 return _core_.Window_SetWindowVariant(*args, **kwargs)
8355
8356 def GetWindowVariant(*args, **kwargs):
8357 """GetWindowVariant(self) -> int"""
8358 return _core_.Window_GetWindowVariant(*args, **kwargs)
8359
8360 def SetId(*args, **kwargs):
8361 """
8362 SetId(self, int winid)
8363
8364 Sets the identifier of the window. Each window has an integer
8365 identifier. If the application has not provided one, an identifier
8366 will be generated. Normally, the identifier should be provided on
8367 creation and should not be modified subsequently.
8368 """
8369 return _core_.Window_SetId(*args, **kwargs)
8370
8371 def GetId(*args, **kwargs):
8372 """
8373 GetId(self) -> int
8374
8375 Returns the identifier of the window. Each window has an integer
8376 identifier. If the application has not provided one (or the default Id
8377 -1 is used) then an unique identifier with a negative value will be
8378 generated.
8379 """
8380 return _core_.Window_GetId(*args, **kwargs)
8381
8382 def NewControlId(*args, **kwargs):
8383 """
8384 NewControlId() -> int
8385
8386 Generate a control id for the controls which were not given one.
8387 """
8388 return _core_.Window_NewControlId(*args, **kwargs)
8389
8390 NewControlId = staticmethod(NewControlId)
8391 def NextControlId(*args, **kwargs):
8392 """
8393 NextControlId(int winid) -> int
8394
8395 Get the id of the control following the one with the given
8396 autogenerated) id
8397 """
8398 return _core_.Window_NextControlId(*args, **kwargs)
8399
8400 NextControlId = staticmethod(NextControlId)
8401 def PrevControlId(*args, **kwargs):
8402 """
8403 PrevControlId(int winid) -> int
8404
8405 Get the id of the control preceding the one with the given
8406 autogenerated) id
8407 """
8408 return _core_.Window_PrevControlId(*args, **kwargs)
8409
8410 PrevControlId = staticmethod(PrevControlId)
8411 def GetLayoutDirection(*args, **kwargs):
8412 """
8413 GetLayoutDirection(self) -> int
8414
8415 Get the layout direction (LTR or RTL) for this window. Returns
8416 ``wx.Layout_Default`` if layout direction is not supported.
8417 """
8418 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8419
8420 def SetLayoutDirection(*args, **kwargs):
8421 """
8422 SetLayoutDirection(self, int dir)
8423
8424 Set the layout direction (LTR or RTL) for this window.
8425 """
8426 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8427
8428 def AdjustForLayoutDirection(*args, **kwargs):
8429 """
8430 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8431
8432 Mirror coordinates for RTL layout if this window uses it and if the
8433 mirroring is not done automatically like Win32.
8434 """
8435 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8436
8437 def SetSize(*args, **kwargs):
8438 """
8439 SetSize(self, Size size)
8440
8441 Sets the size of the window in pixels.
8442 """
8443 return _core_.Window_SetSize(*args, **kwargs)
8444
8445 def SetDimensions(*args, **kwargs):
8446 """
8447 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8448
8449 Sets the position and size of the window in pixels. The sizeFlags
8450 parameter indicates the interpretation of the other params if they are
8451 equal to -1.
8452
8453 ======================== ======================================
8454 wx.SIZE_AUTO A -1 indicates that a class-specific
8455 default should be used.
8456 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8457 -1 values are supplied.
8458 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8459 interpreted as real dimensions, not
8460 default values.
8461 ======================== ======================================
8462
8463 """
8464 return _core_.Window_SetDimensions(*args, **kwargs)
8465
8466 def SetRect(*args, **kwargs):
8467 """
8468 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8469
8470 Sets the position and size of the window in pixels using a wx.Rect.
8471 """
8472 return _core_.Window_SetRect(*args, **kwargs)
8473
8474 def SetSizeWH(*args, **kwargs):
8475 """
8476 SetSizeWH(self, int width, int height)
8477
8478 Sets the size of the window in pixels.
8479 """
8480 return _core_.Window_SetSizeWH(*args, **kwargs)
8481
8482 def Move(*args, **kwargs):
8483 """
8484 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8485
8486 Moves the window to the given position.
8487 """
8488 return _core_.Window_Move(*args, **kwargs)
8489
8490 SetPosition = Move
8491 def MoveXY(*args, **kwargs):
8492 """
8493 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8494
8495 Moves the window to the given position.
8496 """
8497 return _core_.Window_MoveXY(*args, **kwargs)
8498
8499 def SetInitialSize(*args, **kwargs):
8500 """
8501 SetInitialSize(self, Size size=DefaultSize)
8502
8503 A 'Smart' SetSize that will fill in default size components with the
8504 window's *best size* values. Also set's the minsize for use with sizers.
8505 """
8506 return _core_.Window_SetInitialSize(*args, **kwargs)
8507
8508 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
8509 def Raise(*args, **kwargs):
8510 """
8511 Raise(self)
8512
8513 Raises the window to the top of the window hierarchy. In current
8514 version of wxWidgets this works both for managed and child windows.
8515 """
8516 return _core_.Window_Raise(*args, **kwargs)
8517
8518 def Lower(*args, **kwargs):
8519 """
8520 Lower(self)
8521
8522 Lowers the window to the bottom of the window hierarchy. In current
8523 version of wxWidgets this works both for managed and child windows.
8524 """
8525 return _core_.Window_Lower(*args, **kwargs)
8526
8527 def SetClientSize(*args, **kwargs):
8528 """
8529 SetClientSize(self, Size size)
8530
8531 This sets the size of the window client area in pixels. Using this
8532 function to size a window tends to be more device-independent than
8533 wx.Window.SetSize, since the application need not worry about what
8534 dimensions the border or title bar have when trying to fit the window
8535 around panel items, for example.
8536 """
8537 return _core_.Window_SetClientSize(*args, **kwargs)
8538
8539 def SetClientSizeWH(*args, **kwargs):
8540 """
8541 SetClientSizeWH(self, int width, int height)
8542
8543 This sets the size of the window client area in pixels. Using this
8544 function to size a window tends to be more device-independent than
8545 wx.Window.SetSize, since the application need not worry about what
8546 dimensions the border or title bar have when trying to fit the window
8547 around panel items, for example.
8548 """
8549 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8550
8551 def SetClientRect(*args, **kwargs):
8552 """
8553 SetClientRect(self, Rect rect)
8554
8555 This sets the size of the window client area in pixels. Using this
8556 function to size a window tends to be more device-independent than
8557 wx.Window.SetSize, since the application need not worry about what
8558 dimensions the border or title bar have when trying to fit the window
8559 around panel items, for example.
8560 """
8561 return _core_.Window_SetClientRect(*args, **kwargs)
8562
8563 def GetPosition(*args, **kwargs):
8564 """
8565 GetPosition(self) -> Point
8566
8567 Get the window's position. Notice that the position is in client
8568 coordinates for child windows and screen coordinates for the top level
8569 ones, use `GetScreenPosition` if you need screen coordinates for all
8570 kinds of windows.
8571 """
8572 return _core_.Window_GetPosition(*args, **kwargs)
8573
8574 def GetPositionTuple(*args, **kwargs):
8575 """
8576 GetPositionTuple() -> (x,y)
8577
8578 Get the window's position. Notice that the position is in client
8579 coordinates for child windows and screen coordinates for the top level
8580 ones, use `GetScreenPosition` if you need screen coordinates for all
8581 kinds of windows.
8582 """
8583 return _core_.Window_GetPositionTuple(*args, **kwargs)
8584
8585 def GetScreenPosition(*args, **kwargs):
8586 """
8587 GetScreenPosition(self) -> Point
8588
8589 Get the position of the window in screen coordinantes.
8590 """
8591 return _core_.Window_GetScreenPosition(*args, **kwargs)
8592
8593 def GetScreenPositionTuple(*args, **kwargs):
8594 """
8595 GetScreenPositionTuple() -> (x,y)
8596
8597 Get the position of the window in screen coordinantes.
8598 """
8599 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8600
8601 def GetScreenRect(*args, **kwargs):
8602 """
8603 GetScreenRect(self) -> Rect
8604
8605 Returns the size and position of the window in screen coordinantes as
8606 a `wx.Rect` object.
8607 """
8608 return _core_.Window_GetScreenRect(*args, **kwargs)
8609
8610 def GetSize(*args, **kwargs):
8611 """
8612 GetSize(self) -> Size
8613
8614 Get the window size.
8615 """
8616 return _core_.Window_GetSize(*args, **kwargs)
8617
8618 def GetSizeTuple(*args, **kwargs):
8619 """
8620 GetSizeTuple() -> (width, height)
8621
8622 Get the window size.
8623 """
8624 return _core_.Window_GetSizeTuple(*args, **kwargs)
8625
8626 def GetRect(*args, **kwargs):
8627 """
8628 GetRect(self) -> Rect
8629
8630 Returns the size and position of the window as a `wx.Rect` object.
8631 """
8632 return _core_.Window_GetRect(*args, **kwargs)
8633
8634 def GetClientSize(*args, **kwargs):
8635 """
8636 GetClientSize(self) -> Size
8637
8638 This gets the size of the window's 'client area' in pixels. The client
8639 area is the area which may be drawn on by the programmer, excluding
8640 title bar, border, scrollbars, etc.
8641 """
8642 return _core_.Window_GetClientSize(*args, **kwargs)
8643
8644 def GetClientSizeTuple(*args, **kwargs):
8645 """
8646 GetClientSizeTuple() -> (width, height)
8647
8648 This gets the size of the window's 'client area' in pixels. The client
8649 area is the area which may be drawn on by the programmer, excluding
8650 title bar, border, scrollbars, etc.
8651 """
8652 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8653
8654 def GetClientAreaOrigin(*args, **kwargs):
8655 """
8656 GetClientAreaOrigin(self) -> Point
8657
8658 Get the origin of the client area of the window relative to the
8659 window's top left corner (the client area may be shifted because of
8660 the borders, scrollbars, other decorations...)
8661 """
8662 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8663
8664 def GetClientRect(*args, **kwargs):
8665 """
8666 GetClientRect(self) -> Rect
8667
8668 Get the client area position and size as a `wx.Rect` object.
8669 """
8670 return _core_.Window_GetClientRect(*args, **kwargs)
8671
8672 def GetBestSize(*args, **kwargs):
8673 """
8674 GetBestSize(self) -> Size
8675
8676 This function returns the best acceptable minimal size for the
8677 window, if applicable. For example, for a static text control, it will
8678 be the minimal size such that the control label is not truncated. For
8679 windows containing subwindows (suzh aswx.Panel), the size returned by
8680 this function will be the same as the size the window would have had
8681 after calling Fit.
8682 """
8683 return _core_.Window_GetBestSize(*args, **kwargs)
8684
8685 def GetBestSizeTuple(*args, **kwargs):
8686 """
8687 GetBestSizeTuple() -> (width, height)
8688
8689 This function returns the best acceptable minimal size for the
8690 window, if applicable. For example, for a static text control, it will
8691 be the minimal size such that the control label is not truncated. For
8692 windows containing subwindows (suzh aswx.Panel), the size returned by
8693 this function will be the same as the size the window would have had
8694 after calling Fit.
8695 """
8696 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8697
8698 def InvalidateBestSize(*args, **kwargs):
8699 """
8700 InvalidateBestSize(self)
8701
8702 Reset the cached best size value so it will be recalculated the next
8703 time it is needed.
8704 """
8705 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8706
8707 def CacheBestSize(*args, **kwargs):
8708 """
8709 CacheBestSize(self, Size size)
8710
8711 Cache the best size so it doesn't need to be calculated again, (at least until
8712 some properties of the window change.)
8713 """
8714 return _core_.Window_CacheBestSize(*args, **kwargs)
8715
8716 def GetEffectiveMinSize(*args, **kwargs):
8717 """
8718 GetEffectiveMinSize(self) -> Size
8719
8720 This function will merge the window's best size into the window's
8721 minimum size, giving priority to the min size components, and returns
8722 the results.
8723
8724 """
8725 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
8726
8727 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8728 def GetAdjustedBestSize(self):
8729 s = self.GetBestSize()
8730 return wx.Size(max(s.width, self.GetMinWidth()),
8731 max(s.height, self.GetMinHeight()))
8732 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
8733
8734 def Center(*args, **kwargs):
8735 """
8736 Center(self, int direction=BOTH)
8737
8738 Centers the window. The parameter specifies the direction for
8739 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8740 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8741 on the entire screen and not on its parent window. If it is a
8742 top-level window and has no parent then it will always be centered
8743 relative to the screen.
8744 """
8745 return _core_.Window_Center(*args, **kwargs)
8746
8747 Centre = Center
8748 def CenterOnParent(*args, **kwargs):
8749 """
8750 CenterOnParent(self, int dir=BOTH)
8751
8752 Center with respect to the the parent window
8753 """
8754 return _core_.Window_CenterOnParent(*args, **kwargs)
8755
8756 CentreOnParent = CenterOnParent
8757 def Fit(*args, **kwargs):
8758 """
8759 Fit(self)
8760
8761 Sizes the window so that it fits around its subwindows. This function
8762 won't do anything if there are no subwindows and will only really work
8763 correctly if sizers are used for the subwindows layout. Also, if the
8764 window has exactly one subwindow it is better (faster and the result
8765 is more precise as Fit adds some margin to account for fuzziness of
8766 its calculations) to call window.SetClientSize(child.GetSize())
8767 instead of calling Fit.
8768 """
8769 return _core_.Window_Fit(*args, **kwargs)
8770
8771 def FitInside(*args, **kwargs):
8772 """
8773 FitInside(self)
8774
8775 Similar to Fit, but sizes the interior (virtual) size of a
8776 window. Mainly useful with scrolled windows to reset scrollbars after
8777 sizing changes that do not trigger a size event, and/or scrolled
8778 windows without an interior sizer. This function similarly won't do
8779 anything if there are no subwindows.
8780 """
8781 return _core_.Window_FitInside(*args, **kwargs)
8782
8783 def SetSizeHints(*args, **kwargs):
8784 """
8785 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8786 int incH=-1)
8787
8788 Allows specification of minimum and maximum window sizes, and window
8789 size increments. If a pair of values is not set (or set to -1), the
8790 default values will be used. If this function is called, the user
8791 will not be able to size the window outside the given bounds (if it is
8792 a top-level window.) Sizers will also inspect the minimum window size
8793 and will use that value if set when calculating layout.
8794
8795 The resizing increments are only significant under Motif or Xt.
8796 """
8797 return _core_.Window_SetSizeHints(*args, **kwargs)
8798
8799 def SetSizeHintsSz(*args, **kwargs):
8800 """
8801 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8802
8803 Allows specification of minimum and maximum window sizes, and window
8804 size increments. If a pair of values is not set (or set to -1), the
8805 default values will be used. If this function is called, the user
8806 will not be able to size the window outside the given bounds (if it is
8807 a top-level window.) Sizers will also inspect the minimum window size
8808 and will use that value if set when calculating layout.
8809
8810 The resizing increments are only significant under Motif or Xt.
8811 """
8812 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8813
8814 def SetVirtualSizeHints(*args, **kwargs):
8815 """
8816 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8817
8818 Allows specification of minimum and maximum virtual window sizes. If a
8819 pair of values is not set (or set to -1), the default values will be
8820 used. If this function is called, the user will not be able to size
8821 the virtual area of the window outside the given bounds.
8822 """
8823 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8824
8825 def SetVirtualSizeHintsSz(*args, **kwargs):
8826 """
8827 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8828
8829 Allows specification of minimum and maximum virtual window sizes. If a
8830 pair of values is not set (or set to -1), the default values will be
8831 used. If this function is called, the user will not be able to size
8832 the virtual area of the window outside the given bounds.
8833 """
8834 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8835
8836 def GetMaxSize(*args, **kwargs):
8837 """GetMaxSize(self) -> Size"""
8838 return _core_.Window_GetMaxSize(*args, **kwargs)
8839
8840 def GetMinSize(*args, **kwargs):
8841 """GetMinSize(self) -> Size"""
8842 return _core_.Window_GetMinSize(*args, **kwargs)
8843
8844 def SetMinSize(*args, **kwargs):
8845 """
8846 SetMinSize(self, Size minSize)
8847
8848 A more convenient method than `SetSizeHints` for setting just the
8849 min size.
8850 """
8851 return _core_.Window_SetMinSize(*args, **kwargs)
8852
8853 def SetMaxSize(*args, **kwargs):
8854 """
8855 SetMaxSize(self, Size maxSize)
8856
8857 A more convenient method than `SetSizeHints` for setting just the
8858 max size.
8859 """
8860 return _core_.Window_SetMaxSize(*args, **kwargs)
8861
8862 def GetMinWidth(*args, **kwargs):
8863 """GetMinWidth(self) -> int"""
8864 return _core_.Window_GetMinWidth(*args, **kwargs)
8865
8866 def GetMinHeight(*args, **kwargs):
8867 """GetMinHeight(self) -> int"""
8868 return _core_.Window_GetMinHeight(*args, **kwargs)
8869
8870 def GetMaxWidth(*args, **kwargs):
8871 """GetMaxWidth(self) -> int"""
8872 return _core_.Window_GetMaxWidth(*args, **kwargs)
8873
8874 def GetMaxHeight(*args, **kwargs):
8875 """GetMaxHeight(self) -> int"""
8876 return _core_.Window_GetMaxHeight(*args, **kwargs)
8877
8878 def SetVirtualSize(*args, **kwargs):
8879 """
8880 SetVirtualSize(self, Size size)
8881
8882 Set the the virtual size of a window in pixels. For most windows this
8883 is just the client area of the window, but for some like scrolled
8884 windows it is more or less independent of the screen window size.
8885 """
8886 return _core_.Window_SetVirtualSize(*args, **kwargs)
8887
8888 def SetVirtualSizeWH(*args, **kwargs):
8889 """
8890 SetVirtualSizeWH(self, int w, int h)
8891
8892 Set the the virtual size of a window in pixels. For most windows this
8893 is just the client area of the window, but for some like scrolled
8894 windows it is more or less independent of the screen window size.
8895 """
8896 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8897
8898 def GetVirtualSize(*args, **kwargs):
8899 """
8900 GetVirtualSize(self) -> Size
8901
8902 Get the the virtual size of the window in pixels. For most windows
8903 this is just the client area of the window, but for some like scrolled
8904 windows it is more or less independent of the screen window size.
8905 """
8906 return _core_.Window_GetVirtualSize(*args, **kwargs)
8907
8908 def GetVirtualSizeTuple(*args, **kwargs):
8909 """
8910 GetVirtualSizeTuple() -> (width, height)
8911
8912 Get the the virtual size of the window in pixels. For most windows
8913 this is just the client area of the window, but for some like scrolled
8914 windows it is more or less independent of the screen window size.
8915 """
8916 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8917
8918 def GetWindowBorderSize(*args, **kwargs):
8919 """
8920 GetWindowBorderSize(self) -> Size
8921
8922 Return the size of the left/right and top/bottom borders.
8923 """
8924 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8925
8926 def GetBestVirtualSize(*args, **kwargs):
8927 """
8928 GetBestVirtualSize(self) -> Size
8929
8930 Return the largest of ClientSize and BestSize (as determined by a
8931 sizer, interior children, or other means)
8932 """
8933 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8934
8935 def Show(*args, **kwargs):
8936 """
8937 Show(self, bool show=True) -> bool
8938
8939 Shows or hides the window. You may need to call Raise for a top level
8940 window if you want to bring it to top, although this is not needed if
8941 Show is called immediately after the frame creation. Returns True if
8942 the window has been shown or hidden or False if nothing was done
8943 because it already was in the requested state.
8944 """
8945 return _core_.Window_Show(*args, **kwargs)
8946
8947 def Hide(*args, **kwargs):
8948 """
8949 Hide(self) -> bool
8950
8951 Equivalent to calling Show(False).
8952 """
8953 return _core_.Window_Hide(*args, **kwargs)
8954
8955 def Enable(*args, **kwargs):
8956 """
8957 Enable(self, bool enable=True) -> bool
8958
8959 Enable or disable the window for user input. Note that when a parent
8960 window is disabled, all of its children are disabled as well and they
8961 are reenabled again when the parent is. Returns true if the window
8962 has been enabled or disabled, false if nothing was done, i.e. if the
8963 window had already been in the specified state.
8964 """
8965 return _core_.Window_Enable(*args, **kwargs)
8966
8967 def Disable(*args, **kwargs):
8968 """
8969 Disable(self) -> bool
8970
8971 Disables the window, same as Enable(false).
8972 """
8973 return _core_.Window_Disable(*args, **kwargs)
8974
8975 def IsShown(*args, **kwargs):
8976 """
8977 IsShown(self) -> bool
8978
8979 Returns true if the window is shown, false if it has been hidden.
8980 """
8981 return _core_.Window_IsShown(*args, **kwargs)
8982
8983 def IsEnabled(*args, **kwargs):
8984 """
8985 IsEnabled(self) -> bool
8986
8987 Returns true if the window is enabled for input, false otherwise.
8988 This method takes into account the enabled state of parent windows up
8989 to the top-level window.
8990 """
8991 return _core_.Window_IsEnabled(*args, **kwargs)
8992
8993 def IsThisEnabled(*args, **kwargs):
8994 """
8995 IsThisEnabled(self) -> bool
8996
8997 Returns the internal enabled state independent of the parent(s) state,
8998 i.e. the state in which the window would be if all of its parents are
8999 enabled. Use `IsEnabled` to get the effective window state.
9000 """
9001 return _core_.Window_IsThisEnabled(*args, **kwargs)
9002
9003 def IsShownOnScreen(*args, **kwargs):
9004 """
9005 IsShownOnScreen(self) -> bool
9006
9007 Returns ``True`` if the window is physically visible on the screen,
9008 i.e. it is shown and all its parents up to the toplevel window are
9009 shown as well.
9010 """
9011 return _core_.Window_IsShownOnScreen(*args, **kwargs)
9012
9013 def SetWindowStyleFlag(*args, **kwargs):
9014 """
9015 SetWindowStyleFlag(self, long style)
9016
9017 Sets the style of the window. Please note that some styles cannot be
9018 changed after the window creation and that Refresh() might need to be
9019 called after changing the others for the change to take place
9020 immediately.
9021 """
9022 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
9023
9024 def GetWindowStyleFlag(*args, **kwargs):
9025 """
9026 GetWindowStyleFlag(self) -> long
9027
9028 Gets the window style that was passed to the constructor or Create
9029 method.
9030 """
9031 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
9032
9033 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
9034 def HasFlag(*args, **kwargs):
9035 """
9036 HasFlag(self, int flag) -> bool
9037
9038 Test if the given style is set for this window.
9039 """
9040 return _core_.Window_HasFlag(*args, **kwargs)
9041
9042 def IsRetained(*args, **kwargs):
9043 """
9044 IsRetained(self) -> bool
9045
9046 Returns true if the window is retained, false otherwise. Retained
9047 windows are only available on X platforms.
9048 """
9049 return _core_.Window_IsRetained(*args, **kwargs)
9050
9051 def ToggleWindowStyle(*args, **kwargs):
9052 """
9053 ToggleWindowStyle(self, int flag) -> bool
9054
9055 Turn the flag on if it had been turned off before and vice versa,
9056 returns True if the flag is turned on by this function call.
9057 """
9058 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
9059
9060 def SetExtraStyle(*args, **kwargs):
9061 """
9062 SetExtraStyle(self, long exStyle)
9063
9064 Sets the extra style bits for the window. Extra styles are the less
9065 often used style bits which can't be set with the constructor or with
9066 SetWindowStyleFlag()
9067 """
9068 return _core_.Window_SetExtraStyle(*args, **kwargs)
9069
9070 def GetExtraStyle(*args, **kwargs):
9071 """
9072 GetExtraStyle(self) -> long
9073
9074 Returns the extra style bits for the window.
9075 """
9076 return _core_.Window_GetExtraStyle(*args, **kwargs)
9077
9078 def MakeModal(*args, **kwargs):
9079 """
9080 MakeModal(self, bool modal=True)
9081
9082 Disables all other windows in the application so that the user can
9083 only interact with this window. Passing False will reverse this
9084 effect.
9085 """
9086 return _core_.Window_MakeModal(*args, **kwargs)
9087
9088 def SetThemeEnabled(*args, **kwargs):
9089 """
9090 SetThemeEnabled(self, bool enableTheme)
9091
9092 This function tells a window if it should use the system's "theme"
9093 code to draw the windows' background instead if its own background
9094 drawing code. This will only have an effect on platforms that support
9095 the notion of themes in user defined windows. One such platform is
9096 GTK+ where windows can have (very colourful) backgrounds defined by a
9097 user's selected theme.
9098
9099 Dialogs, notebook pages and the status bar have this flag set to true
9100 by default so that the default look and feel is simulated best.
9101 """
9102 return _core_.Window_SetThemeEnabled(*args, **kwargs)
9103
9104 def GetThemeEnabled(*args, **kwargs):
9105 """
9106 GetThemeEnabled(self) -> bool
9107
9108 Return the themeEnabled flag.
9109 """
9110 return _core_.Window_GetThemeEnabled(*args, **kwargs)
9111
9112 def SetFocus(*args, **kwargs):
9113 """
9114 SetFocus(self)
9115
9116 Set's the focus to this window, allowing it to receive keyboard input.
9117 """
9118 return _core_.Window_SetFocus(*args, **kwargs)
9119
9120 def SetFocusFromKbd(*args, **kwargs):
9121 """
9122 SetFocusFromKbd(self)
9123
9124 Set focus to this window as the result of a keyboard action. Normally
9125 only called internally.
9126 """
9127 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
9128
9129 def FindFocus(*args, **kwargs):
9130 """
9131 FindFocus() -> Window
9132
9133 Returns the window or control that currently has the keyboard focus,
9134 or None.
9135 """
9136 return _core_.Window_FindFocus(*args, **kwargs)
9137
9138 FindFocus = staticmethod(FindFocus)
9139 def AcceptsFocus(*args, **kwargs):
9140 """
9141 AcceptsFocus(self) -> bool
9142
9143 Can this window have focus?
9144 """
9145 return _core_.Window_AcceptsFocus(*args, **kwargs)
9146
9147 def CanAcceptFocus(*args, **kwargs):
9148 """
9149 CanAcceptFocus(self) -> bool
9150
9151 Can this window have focus right now?
9152 """
9153 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9154
9155 def AcceptsFocusFromKeyboard(*args, **kwargs):
9156 """
9157 AcceptsFocusFromKeyboard(self) -> bool
9158
9159 Can this window be given focus by keyboard navigation? if not, the
9160 only way to give it focus (provided it accepts it at all) is to click
9161 it.
9162 """
9163 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
9164
9165 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9166 """
9167 CanAcceptFocusFromKeyboard(self) -> bool
9168
9169 Can this window be assigned focus from keyboard right now?
9170 """
9171 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9172
9173 def SetCanFocus(*args, **kwargs):
9174 """SetCanFocus(self, bool canFocus)"""
9175 return _core_.Window_SetCanFocus(*args, **kwargs)
9176
9177 def NavigateIn(*args, **kwargs):
9178 """
9179 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9180
9181 Navigates inside this window.
9182 """
9183 return _core_.Window_NavigateIn(*args, **kwargs)
9184
9185 def Navigate(*args, **kwargs):
9186 """
9187 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9188
9189 Does keyboard navigation starting from this window to another. This is
9190 equivalient to self.GetParent().NavigateIn().
9191 """
9192 return _core_.Window_Navigate(*args, **kwargs)
9193
9194 def MoveAfterInTabOrder(*args, **kwargs):
9195 """
9196 MoveAfterInTabOrder(self, Window win)
9197
9198 Moves this window in the tab navigation order after the specified
9199 sibling window. This means that when the user presses the TAB key on
9200 that other window, the focus switches to this window.
9201
9202 The default tab order is the same as creation order. This function
9203 and `MoveBeforeInTabOrder` allow to change it after creating all the
9204 windows.
9205
9206 """
9207 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
9208
9209 def MoveBeforeInTabOrder(*args, **kwargs):
9210 """
9211 MoveBeforeInTabOrder(self, Window win)
9212
9213 Same as `MoveAfterInTabOrder` except that it inserts this window just
9214 before win instead of putting it right after it.
9215 """
9216 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9217
9218 def GetChildren(*args, **kwargs):
9219 """
9220 GetChildren(self) -> PyObject
9221
9222 Returns a list of the window's children. NOTE: Currently this is a
9223 copy of the child window list maintained by the window, so the return
9224 value of this function is only valid as long as the window's children
9225 do not change.
9226 """
9227 return _core_.Window_GetChildren(*args, **kwargs)
9228
9229 def GetParent(*args, **kwargs):
9230 """
9231 GetParent(self) -> Window
9232
9233 Returns the parent window of this window, or None if there isn't one.
9234 """
9235 return _core_.Window_GetParent(*args, **kwargs)
9236
9237 def GetGrandParent(*args, **kwargs):
9238 """
9239 GetGrandParent(self) -> Window
9240
9241 Returns the parent of the parent of this window, or None if there
9242 isn't one.
9243 """
9244 return _core_.Window_GetGrandParent(*args, **kwargs)
9245
9246 def GetTopLevelParent(*args, **kwargs):
9247 """
9248 GetTopLevelParent(self) -> Window
9249
9250 Returns the first frame or dialog in this window's parental hierarchy.
9251 """
9252 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9253
9254 def IsTopLevel(*args, **kwargs):
9255 """
9256 IsTopLevel(self) -> bool
9257
9258 Returns true if the given window is a top-level one. Currently all
9259 frames and dialogs are always considered to be top-level windows (even
9260 if they have a parent window).
9261 """
9262 return _core_.Window_IsTopLevel(*args, **kwargs)
9263
9264 def Reparent(*args, **kwargs):
9265 """
9266 Reparent(self, Window newParent) -> bool
9267
9268 Reparents the window, i.e the window will be removed from its current
9269 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9270 re-inserted into another. Available on Windows and GTK. Returns True
9271 if the parent was changed, False otherwise (error or newParent ==
9272 oldParent)
9273 """
9274 return _core_.Window_Reparent(*args, **kwargs)
9275
9276 def AddChild(*args, **kwargs):
9277 """
9278 AddChild(self, Window child)
9279
9280 Adds a child window. This is called automatically by window creation
9281 functions so should not be required by the application programmer.
9282 """
9283 return _core_.Window_AddChild(*args, **kwargs)
9284
9285 def RemoveChild(*args, **kwargs):
9286 """
9287 RemoveChild(self, Window child)
9288
9289 Removes a child window. This is called automatically by window
9290 deletion functions so should not be required by the application
9291 programmer.
9292 """
9293 return _core_.Window_RemoveChild(*args, **kwargs)
9294
9295 def SetDoubleBuffered(*args, **kwargs):
9296 """
9297 SetDoubleBuffered(self, bool on)
9298
9299 Currently wxGTK2 only.
9300 """
9301 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9302
9303 def FindWindowById(*args, **kwargs):
9304 """
9305 FindWindowById(self, long winid) -> Window
9306
9307 Find a chld of this window by window ID
9308 """
9309 return _core_.Window_FindWindowById(*args, **kwargs)
9310
9311 def FindWindowByName(*args, **kwargs):
9312 """
9313 FindWindowByName(self, String name) -> Window
9314
9315 Find a child of this window by name
9316 """
9317 return _core_.Window_FindWindowByName(*args, **kwargs)
9318
9319 def GetEventHandler(*args, **kwargs):
9320 """
9321 GetEventHandler(self) -> EvtHandler
9322
9323 Returns the event handler for this window. By default, the window is
9324 its own event handler.
9325 """
9326 return _core_.Window_GetEventHandler(*args, **kwargs)
9327
9328 def SetEventHandler(*args, **kwargs):
9329 """
9330 SetEventHandler(self, EvtHandler handler)
9331
9332 Sets the event handler for this window. An event handler is an object
9333 that is capable of processing the events sent to a window. (In other
9334 words, is able to dispatch the events to handler function.) By
9335 default, the window is its own event handler, but an application may
9336 wish to substitute another, for example to allow central
9337 implementation of event-handling for a variety of different window
9338 classes.
9339
9340 It is usually better to use `wx.Window.PushEventHandler` since this sets
9341 up a chain of event handlers, where an event not handled by one event
9342 handler is handed off to the next one in the chain.
9343 """
9344 return _core_.Window_SetEventHandler(*args, **kwargs)
9345
9346 def PushEventHandler(*args, **kwargs):
9347 """
9348 PushEventHandler(self, EvtHandler handler)
9349
9350 Pushes this event handler onto the event handler stack for the window.
9351 An event handler is an object that is capable of processing the events
9352 sent to a window. (In other words, is able to dispatch the events to
9353 handler function.) By default, the window is its own event handler,
9354 but an application may wish to substitute another, for example to
9355 allow central implementation of event-handling for a variety of
9356 different window classes.
9357
9358 wx.Window.PushEventHandler allows an application to set up a chain of
9359 event handlers, where an event not handled by one event handler is
9360 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9361 to remove the event handler. Ownership of the handler is *not* given
9362 to the window, so you should be sure to pop the handler before the
9363 window is destroyed and either let PopEventHandler destroy it, or call
9364 its Destroy method yourself.
9365 """
9366 return _core_.Window_PushEventHandler(*args, **kwargs)
9367
9368 def PopEventHandler(*args, **kwargs):
9369 """
9370 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9371
9372 Removes and returns the top-most event handler on the event handler
9373 stack. If deleteHandler is True then the wx.EvtHandler object will be
9374 destroyed after it is popped, and ``None`` will be returned instead.
9375 """
9376 return _core_.Window_PopEventHandler(*args, **kwargs)
9377
9378 def RemoveEventHandler(*args, **kwargs):
9379 """
9380 RemoveEventHandler(self, EvtHandler handler) -> bool
9381
9382 Find the given handler in the event handler chain and remove (but not
9383 delete) it from the event handler chain, returns True if it was found
9384 and False otherwise (this also results in an assert failure so this
9385 function should only be called when the handler is supposed to be
9386 there.)
9387 """
9388 return _core_.Window_RemoveEventHandler(*args, **kwargs)
9389
9390 def SetValidator(*args, **kwargs):
9391 """
9392 SetValidator(self, Validator validator)
9393
9394 Deletes the current validator (if any) and sets the window validator,
9395 having called wx.Validator.Clone to create a new validator of this
9396 type.
9397 """
9398 return _core_.Window_SetValidator(*args, **kwargs)
9399
9400 def GetValidator(*args, **kwargs):
9401 """
9402 GetValidator(self) -> Validator
9403
9404 Returns a pointer to the current validator for the window, or None if
9405 there is none.
9406 """
9407 return _core_.Window_GetValidator(*args, **kwargs)
9408
9409 def Validate(*args, **kwargs):
9410 """
9411 Validate(self) -> bool
9412
9413 Validates the current values of the child controls using their
9414 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9415 style flag set, the method will also call Validate() of all child
9416 windows. Returns false if any of the validations failed.
9417 """
9418 return _core_.Window_Validate(*args, **kwargs)
9419
9420 def TransferDataToWindow(*args, **kwargs):
9421 """
9422 TransferDataToWindow(self) -> bool
9423
9424 Transfers values to child controls from data areas specified by their
9425 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9426 style flag set, the method will also call TransferDataToWindow() of
9427 all child windows.
9428 """
9429 return _core_.Window_TransferDataToWindow(*args, **kwargs)
9430
9431 def TransferDataFromWindow(*args, **kwargs):
9432 """
9433 TransferDataFromWindow(self) -> bool
9434
9435 Transfers values from child controls to data areas specified by their
9436 validators. Returns false if a transfer failed. If the window has
9437 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9438 also call TransferDataFromWindow() of all child windows.
9439 """
9440 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
9441
9442 def InitDialog(*args, **kwargs):
9443 """
9444 InitDialog(self)
9445
9446 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9447 to the dialog via validators.
9448 """
9449 return _core_.Window_InitDialog(*args, **kwargs)
9450
9451 def SetAcceleratorTable(*args, **kwargs):
9452 """
9453 SetAcceleratorTable(self, AcceleratorTable accel)
9454
9455 Sets the accelerator table for this window.
9456 """
9457 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9458
9459 def GetAcceleratorTable(*args, **kwargs):
9460 """
9461 GetAcceleratorTable(self) -> AcceleratorTable
9462
9463 Gets the accelerator table for this window.
9464 """
9465 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9466
9467 def RegisterHotKey(*args, **kwargs):
9468 """
9469 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9470
9471 Registers a system wide hotkey. Every time the user presses the hotkey
9472 registered here, this window will receive a hotkey event. It will
9473 receive the event even if the application is in the background and
9474 does not have the input focus because the user is working with some
9475 other application. To bind an event handler function to this hotkey
9476 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9477 hotkey was registered successfully.
9478 """
9479 return _core_.Window_RegisterHotKey(*args, **kwargs)
9480
9481 def UnregisterHotKey(*args, **kwargs):
9482 """
9483 UnregisterHotKey(self, int hotkeyId) -> bool
9484
9485 Unregisters a system wide hotkey.
9486 """
9487 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9488
9489 def ConvertDialogPointToPixels(*args, **kwargs):
9490 """
9491 ConvertDialogPointToPixels(self, Point pt) -> Point
9492
9493 Converts a point or size from dialog units to pixels. Dialog units
9494 are used for maintaining a dialog's proportions even if the font
9495 changes. For the x dimension, the dialog units are multiplied by the
9496 average character width and then divided by 4. For the y dimension,
9497 the dialog units are multiplied by the average character height and
9498 then divided by 8.
9499 """
9500 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9501
9502 def ConvertDialogSizeToPixels(*args, **kwargs):
9503 """
9504 ConvertDialogSizeToPixels(self, Size sz) -> Size
9505
9506 Converts a point or size from dialog units to pixels. Dialog units
9507 are used for maintaining a dialog's proportions even if the font
9508 changes. For the x dimension, the dialog units are multiplied by the
9509 average character width and then divided by 4. For the y dimension,
9510 the dialog units are multiplied by the average character height and
9511 then divided by 8.
9512 """
9513 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9514
9515 def DLG_PNT(*args, **kwargs):
9516 """
9517 DLG_PNT(self, Point pt) -> Point
9518
9519 Converts a point or size from dialog units to pixels. Dialog units
9520 are used for maintaining a dialog's proportions even if the font
9521 changes. For the x dimension, the dialog units are multiplied by the
9522 average character width and then divided by 4. For the y dimension,
9523 the dialog units are multiplied by the average character height and
9524 then divided by 8.
9525 """
9526 return _core_.Window_DLG_PNT(*args, **kwargs)
9527
9528 def DLG_SZE(*args, **kwargs):
9529 """
9530 DLG_SZE(self, Size sz) -> Size
9531
9532 Converts a point or size from dialog units to pixels. Dialog units
9533 are used for maintaining a dialog's proportions even if the font
9534 changes. For the x dimension, the dialog units are multiplied by the
9535 average character width and then divided by 4. For the y dimension,
9536 the dialog units are multiplied by the average character height and
9537 then divided by 8.
9538 """
9539 return _core_.Window_DLG_SZE(*args, **kwargs)
9540
9541 def ConvertPixelPointToDialog(*args, **kwargs):
9542 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9543 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9544
9545 def ConvertPixelSizeToDialog(*args, **kwargs):
9546 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9547 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9548
9549 def WarpPointer(*args, **kwargs):
9550 """
9551 WarpPointer(self, int x, int y)
9552
9553 Moves the pointer to the given position on the window.
9554
9555 NOTE: This function is not supported under Mac because Apple Human
9556 Interface Guidelines forbid moving the mouse cursor programmatically.
9557 """
9558 return _core_.Window_WarpPointer(*args, **kwargs)
9559
9560 def CaptureMouse(*args, **kwargs):
9561 """
9562 CaptureMouse(self)
9563
9564 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9565 release the capture.
9566
9567 Note that wxWindows maintains the stack of windows having captured the
9568 mouse and when the mouse is released the capture returns to the window
9569 which had had captured it previously and it is only really released if
9570 there were no previous window. In particular, this means that you must
9571 release the mouse as many times as you capture it, unless the window
9572 receives the `wx.MouseCaptureLostEvent` event.
9573
9574 Any application which captures the mouse in the beginning of some
9575 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9576 operation when it receives the event. The event handler must not
9577 recapture mouse.
9578 """
9579 return _core_.Window_CaptureMouse(*args, **kwargs)
9580
9581 def ReleaseMouse(*args, **kwargs):
9582 """
9583 ReleaseMouse(self)
9584
9585 Releases mouse input captured with wx.Window.CaptureMouse.
9586 """
9587 return _core_.Window_ReleaseMouse(*args, **kwargs)
9588
9589 def GetCapture(*args, **kwargs):
9590 """
9591 GetCapture() -> Window
9592
9593 Returns the window which currently captures the mouse or None
9594 """
9595 return _core_.Window_GetCapture(*args, **kwargs)
9596
9597 GetCapture = staticmethod(GetCapture)
9598 def HasCapture(*args, **kwargs):
9599 """
9600 HasCapture(self) -> bool
9601
9602 Returns true if this window has the current mouse capture.
9603 """
9604 return _core_.Window_HasCapture(*args, **kwargs)
9605
9606 def Refresh(*args, **kwargs):
9607 """
9608 Refresh(self, bool eraseBackground=True, Rect rect=None)
9609
9610 Mark the specified rectangle (or the whole window) as "dirty" so it
9611 will be repainted. Causes an EVT_PAINT event to be generated and sent
9612 to the window.
9613 """
9614 return _core_.Window_Refresh(*args, **kwargs)
9615
9616 def RefreshRect(*args, **kwargs):
9617 """
9618 RefreshRect(self, Rect rect, bool eraseBackground=True)
9619
9620 Redraws the contents of the given rectangle: the area inside it will
9621 be repainted. This is the same as Refresh but has a nicer syntax.
9622 """
9623 return _core_.Window_RefreshRect(*args, **kwargs)
9624
9625 def Update(*args, **kwargs):
9626 """
9627 Update(self)
9628
9629 Calling this method immediately repaints the invalidated area of the
9630 window instead of waiting for the EVT_PAINT event to happen, (normally
9631 this would usually only happen when the flow of control returns to the
9632 event loop.) Notice that this function doesn't refresh the window and
9633 does nothing if the window has been already repainted. Use `Refresh`
9634 first if you want to immediately redraw the window (or some portion of
9635 it) unconditionally.
9636 """
9637 return _core_.Window_Update(*args, **kwargs)
9638
9639 def ClearBackground(*args, **kwargs):
9640 """
9641 ClearBackground(self)
9642
9643 Clears the window by filling it with the current background
9644 colour. Does not cause an erase background event to be generated.
9645 """
9646 return _core_.Window_ClearBackground(*args, **kwargs)
9647
9648 def Freeze(*args, **kwargs):
9649 """
9650 Freeze(self)
9651
9652 Freezes the window or, in other words, prevents any updates from
9653 taking place on screen, the window is not redrawn at all. Thaw must be
9654 called to reenable window redrawing. Calls to Freeze/Thaw may be
9655 nested, with the actual Thaw being delayed until all the nesting has
9656 been undone.
9657
9658 This method is useful for visual appearance optimization (for example,
9659 it is a good idea to use it before inserting large amount of text into
9660 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9661 for all controls so it is mostly just a hint to wxWindows and not a
9662 mandatory directive.
9663 """
9664 return _core_.Window_Freeze(*args, **kwargs)
9665
9666 def IsFrozen(*args, **kwargs):
9667 """
9668 IsFrozen(self) -> bool
9669
9670 Returns ``True`` if the window has been frozen and not thawed yet.
9671
9672 :see: `Freeze` and `Thaw`
9673 """
9674 return _core_.Window_IsFrozen(*args, **kwargs)
9675
9676 def Thaw(*args, **kwargs):
9677 """
9678 Thaw(self)
9679
9680 Reenables window updating after a previous call to Freeze. Calls to
9681 Freeze/Thaw may be nested, so Thaw must be called the same number of
9682 times that Freeze was before the window will be updated.
9683 """
9684 return _core_.Window_Thaw(*args, **kwargs)
9685
9686 def PrepareDC(*args, **kwargs):
9687 """
9688 PrepareDC(self, DC dc)
9689
9690 Call this function to prepare the device context for drawing a
9691 scrolled image. It sets the device origin according to the current
9692 scroll position.
9693 """
9694 return _core_.Window_PrepareDC(*args, **kwargs)
9695
9696 def IsDoubleBuffered(*args, **kwargs):
9697 """
9698 IsDoubleBuffered(self) -> bool
9699
9700 Returns ``True`` if the window contents is double-buffered by the
9701 system, i.e. if any drawing done on the window is really done on a
9702 temporary backing surface and transferred to the screen all at once
9703 later.
9704 """
9705 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9706
9707 def GetUpdateRegion(*args, **kwargs):
9708 """
9709 GetUpdateRegion(self) -> Region
9710
9711 Returns the region specifying which parts of the window have been
9712 damaged. Should only be called within an EVT_PAINT handler.
9713 """
9714 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9715
9716 def GetUpdateClientRect(*args, **kwargs):
9717 """
9718 GetUpdateClientRect(self) -> Rect
9719
9720 Get the update rectangle region bounding box in client coords.
9721 """
9722 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9723
9724 def IsExposed(*args, **kwargs):
9725 """
9726 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9727
9728 Returns true if the given point or rectangle area has been exposed
9729 since the last repaint. Call this in an paint event handler to
9730 optimize redrawing by only redrawing those areas, which have been
9731 exposed.
9732 """
9733 return _core_.Window_IsExposed(*args, **kwargs)
9734
9735 def IsExposedPoint(*args, **kwargs):
9736 """
9737 IsExposedPoint(self, Point pt) -> bool
9738
9739 Returns true if the given point or rectangle area has been exposed
9740 since the last repaint. Call this in an paint event handler to
9741 optimize redrawing by only redrawing those areas, which have been
9742 exposed.
9743 """
9744 return _core_.Window_IsExposedPoint(*args, **kwargs)
9745
9746 def IsExposedRect(*args, **kwargs):
9747 """
9748 IsExposedRect(self, Rect rect) -> bool
9749
9750 Returns true if the given point or rectangle area has been exposed
9751 since the last repaint. Call this in an paint event handler to
9752 optimize redrawing by only redrawing those areas, which have been
9753 exposed.
9754 """
9755 return _core_.Window_IsExposedRect(*args, **kwargs)
9756
9757 def GetDefaultAttributes(*args, **kwargs):
9758 """
9759 GetDefaultAttributes(self) -> VisualAttributes
9760
9761 Get the default attributes for an instance of this class. This is
9762 useful if you want to use the same font or colour in your own control
9763 as in a standard control -- which is a much better idea than hard
9764 coding specific colours or fonts which might look completely out of
9765 place on the user's system, especially if it uses themes.
9766 """
9767 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9768
9769 def GetClassDefaultAttributes(*args, **kwargs):
9770 """
9771 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9772
9773 Get the default attributes for this class. This is useful if you want
9774 to use the same font or colour in your own control as in a standard
9775 control -- which is a much better idea than hard coding specific
9776 colours or fonts which might look completely out of place on the
9777 user's system, especially if it uses themes.
9778
9779 The variant parameter is only relevant under Mac currently and is
9780 ignore under other platforms. Under Mac, it will change the size of
9781 the returned font. See `wx.Window.SetWindowVariant` for more about
9782 this.
9783 """
9784 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9785
9786 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9787 def SetBackgroundColour(*args, **kwargs):
9788 """
9789 SetBackgroundColour(self, Colour colour) -> bool
9790
9791 Sets the background colour of the window. Returns True if the colour
9792 was changed. The background colour is usually painted by the default
9793 EVT_ERASE_BACKGROUND event handler function under Windows and
9794 automatically under GTK. Using `wx.NullColour` will reset the window
9795 to the default background colour.
9796
9797 Note that setting the background colour may not cause an immediate
9798 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9799 calling this function.
9800
9801 Using this function will disable attempts to use themes for this
9802 window, if the system supports them. Use with care since usually the
9803 themes represent the appearance chosen by the user to be used for all
9804 applications on the system.
9805 """
9806 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9807
9808 def SetOwnBackgroundColour(*args, **kwargs):
9809 """SetOwnBackgroundColour(self, Colour colour)"""
9810 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9811
9812 def SetForegroundColour(*args, **kwargs):
9813 """
9814 SetForegroundColour(self, Colour colour) -> bool
9815
9816 Sets the foreground colour of the window. Returns True is the colour
9817 was changed. The interpretation of foreground colour is dependent on
9818 the window class; it may be the text colour or other colour, or it may
9819 not be used at all.
9820 """
9821 return _core_.Window_SetForegroundColour(*args, **kwargs)
9822
9823 def SetOwnForegroundColour(*args, **kwargs):
9824 """SetOwnForegroundColour(self, Colour colour)"""
9825 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9826
9827 def GetBackgroundColour(*args, **kwargs):
9828 """
9829 GetBackgroundColour(self) -> Colour
9830
9831 Returns the background colour of the window.
9832 """
9833 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9834
9835 def GetForegroundColour(*args, **kwargs):
9836 """
9837 GetForegroundColour(self) -> Colour
9838
9839 Returns the foreground colour of the window. The interpretation of
9840 foreground colour is dependent on the window class; it may be the text
9841 colour or other colour, or it may not be used at all.
9842 """
9843 return _core_.Window_GetForegroundColour(*args, **kwargs)
9844
9845 def InheritsBackgroundColour(*args, **kwargs):
9846 """InheritsBackgroundColour(self) -> bool"""
9847 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9848
9849 def UseBgCol(*args, **kwargs):
9850 """UseBgCol(self) -> bool"""
9851 return _core_.Window_UseBgCol(*args, **kwargs)
9852
9853 def SetBackgroundStyle(*args, **kwargs):
9854 """
9855 SetBackgroundStyle(self, int style) -> bool
9856
9857 Returns the background style of the window. The background style
9858 indicates how the background of the window is drawn.
9859
9860 ====================== ========================================
9861 wx.BG_STYLE_SYSTEM The background colour or pattern should
9862 be determined by the system
9863 wx.BG_STYLE_COLOUR The background should be a solid colour
9864 wx.BG_STYLE_CUSTOM The background will be implemented by the
9865 application.
9866 ====================== ========================================
9867
9868 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9869 a custom background, such as a tiled bitmap. Currently the style has
9870 no effect on other platforms.
9871
9872 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9873 """
9874 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9875
9876 def GetBackgroundStyle(*args, **kwargs):
9877 """
9878 GetBackgroundStyle(self) -> int
9879
9880 Returns the background style of the window.
9881
9882 :see: `SetBackgroundStyle`
9883 """
9884 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9885
9886 def HasTransparentBackground(*args, **kwargs):
9887 """
9888 HasTransparentBackground(self) -> bool
9889
9890 Returns True if this window's background is transparent (as, for
9891 example, for `wx.StaticText`) and should show the parent window's
9892 background.
9893
9894 This method is mostly used internally by the library itself and you
9895 normally shouldn't have to call it. You may, however, have to override
9896 it in your custom control classes to ensure that background is painted
9897 correctly.
9898 """
9899 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9900
9901 def SetCursor(*args, **kwargs):
9902 """
9903 SetCursor(self, Cursor cursor) -> bool
9904
9905 Sets the window's cursor. Notice that the window cursor also sets it
9906 for the children of the window implicitly.
9907
9908 The cursor may be wx.NullCursor in which case the window cursor will
9909 be reset back to default.
9910 """
9911 return _core_.Window_SetCursor(*args, **kwargs)
9912
9913 def GetCursor(*args, **kwargs):
9914 """
9915 GetCursor(self) -> Cursor
9916
9917 Return the cursor associated with this window.
9918 """
9919 return _core_.Window_GetCursor(*args, **kwargs)
9920
9921 def SetFont(*args, **kwargs):
9922 """
9923 SetFont(self, Font font) -> bool
9924
9925 Sets the font for this window.
9926 """
9927 return _core_.Window_SetFont(*args, **kwargs)
9928
9929 def SetOwnFont(*args, **kwargs):
9930 """SetOwnFont(self, Font font)"""
9931 return _core_.Window_SetOwnFont(*args, **kwargs)
9932
9933 def GetFont(*args, **kwargs):
9934 """
9935 GetFont(self) -> Font
9936
9937 Returns the default font used for this window.
9938 """
9939 return _core_.Window_GetFont(*args, **kwargs)
9940
9941 def SetCaret(*args, **kwargs):
9942 """
9943 SetCaret(self, Caret caret)
9944
9945 Sets the caret associated with the window.
9946 """
9947 return _core_.Window_SetCaret(*args, **kwargs)
9948
9949 def GetCaret(*args, **kwargs):
9950 """
9951 GetCaret(self) -> Caret
9952
9953 Returns the caret associated with the window.
9954 """
9955 return _core_.Window_GetCaret(*args, **kwargs)
9956
9957 def GetCharHeight(*args, **kwargs):
9958 """
9959 GetCharHeight(self) -> int
9960
9961 Get the (average) character size for the current font.
9962 """
9963 return _core_.Window_GetCharHeight(*args, **kwargs)
9964
9965 def GetCharWidth(*args, **kwargs):
9966 """
9967 GetCharWidth(self) -> int
9968
9969 Get the (average) character size for the current font.
9970 """
9971 return _core_.Window_GetCharWidth(*args, **kwargs)
9972
9973 def GetTextExtent(*args, **kwargs):
9974 """
9975 GetTextExtent(String string) -> (width, height)
9976
9977 Get the width and height of the text using the current font.
9978 """
9979 return _core_.Window_GetTextExtent(*args, **kwargs)
9980
9981 def GetFullTextExtent(*args, **kwargs):
9982 """
9983 GetFullTextExtent(String string, Font font=None) ->
9984 (width, height, descent, externalLeading)
9985
9986 Get the width, height, decent and leading of the text using the
9987 current or specified font.
9988 """
9989 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9990
9991 def ClientToScreenXY(*args, **kwargs):
9992 """
9993 ClientToScreenXY(int x, int y) -> (x,y)
9994
9995 Converts to screen coordinates from coordinates relative to this window.
9996 """
9997 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9998
9999 def ScreenToClientXY(*args, **kwargs):
10000 """
10001 ScreenToClientXY(int x, int y) -> (x,y)
10002
10003 Converts from screen to client window coordinates.
10004 """
10005 return _core_.Window_ScreenToClientXY(*args, **kwargs)
10006
10007 def ClientToScreen(*args, **kwargs):
10008 """
10009 ClientToScreen(self, Point pt) -> Point
10010
10011 Converts to screen coordinates from coordinates relative to this window.
10012 """
10013 return _core_.Window_ClientToScreen(*args, **kwargs)
10014
10015 def ScreenToClient(*args, **kwargs):
10016 """
10017 ScreenToClient(self, Point pt) -> Point
10018
10019 Converts from screen to client window coordinates.
10020 """
10021 return _core_.Window_ScreenToClient(*args, **kwargs)
10022
10023 def HitTestXY(*args, **kwargs):
10024 """
10025 HitTestXY(self, int x, int y) -> int
10026
10027 Test where the given (in client coords) point lies
10028 """
10029 return _core_.Window_HitTestXY(*args, **kwargs)
10030
10031 def HitTest(*args, **kwargs):
10032 """
10033 HitTest(self, Point pt) -> int
10034
10035 Test where the given (in client coords) point lies
10036 """
10037 return _core_.Window_HitTest(*args, **kwargs)
10038
10039 def GetBorder(*args):
10040 """
10041 GetBorder(self, long flags) -> int
10042 GetBorder(self) -> int
10043
10044 Get border for the flags of this window
10045 """
10046 return _core_.Window_GetBorder(*args)
10047
10048 def UpdateWindowUI(*args, **kwargs):
10049 """
10050 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
10051
10052 This function sends EVT_UPDATE_UI events to the window. The particular
10053 implementation depends on the window; for example a wx.ToolBar will
10054 send an update UI event for each toolbar button, and a wx.Frame will
10055 send an update UI event for each menubar menu item. You can call this
10056 function from your application to ensure that your UI is up-to-date at
10057 a particular point in time (as far as your EVT_UPDATE_UI handlers are
10058 concerned). This may be necessary if you have called
10059 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
10060 limit the overhead that wxWindows incurs by sending update UI events
10061 in idle time.
10062 """
10063 return _core_.Window_UpdateWindowUI(*args, **kwargs)
10064
10065 def PopupMenuXY(*args, **kwargs):
10066 """
10067 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
10068
10069 Pops up the given menu at the specified coordinates, relative to this window,
10070 and returns control when the user has dismissed the menu. If a menu item is
10071 selected, the corresponding menu event is generated and will be processed as
10072 usual. If the default position is given then the current position of the
10073 mouse cursor will be used.
10074 """
10075 return _core_.Window_PopupMenuXY(*args, **kwargs)
10076
10077 def PopupMenu(*args, **kwargs):
10078 """
10079 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
10080
10081 Pops up the given menu at the specified coordinates, relative to this window,
10082 and returns control when the user has dismissed the menu. If a menu item is
10083 selected, the corresponding menu event is generated and will be processed as
10084 usual. If the default position is given then the current position of the
10085 mouse cursor will be used.
10086 """
10087 return _core_.Window_PopupMenu(*args, **kwargs)
10088
10089 def HasMultiplePages(*args, **kwargs):
10090 """HasMultiplePages(self) -> bool"""
10091 return _core_.Window_HasMultiplePages(*args, **kwargs)
10092
10093 def GetHandle(*args, **kwargs):
10094 """
10095 GetHandle(self) -> long
10096
10097 Returns the platform-specific handle (as a long integer) of the
10098 physical window. Currently on wxMac it returns the handle of the
10099 toplevel parent of the window.
10100 """
10101 return _core_.Window_GetHandle(*args, **kwargs)
10102
10103 def AssociateHandle(*args, **kwargs):
10104 """
10105 AssociateHandle(self, long handle)
10106
10107 Associate the window with a new native handle
10108 """
10109 return _core_.Window_AssociateHandle(*args, **kwargs)
10110
10111 def DissociateHandle(*args, **kwargs):
10112 """
10113 DissociateHandle(self)
10114
10115 Dissociate the current native handle from the window
10116 """
10117 return _core_.Window_DissociateHandle(*args, **kwargs)
10118
10119 def OnPaint(*args, **kwargs):
10120 """OnPaint(self, PaintEvent event)"""
10121 return _core_.Window_OnPaint(*args, **kwargs)
10122
10123 def HasScrollbar(*args, **kwargs):
10124 """
10125 HasScrollbar(self, int orient) -> bool
10126
10127 Does the window have the scrollbar for this orientation?
10128 """
10129 return _core_.Window_HasScrollbar(*args, **kwargs)
10130
10131 def SetScrollbar(*args, **kwargs):
10132 """
10133 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
10134 bool refresh=True)
10135
10136 Sets the scrollbar properties of a built-in scrollbar.
10137 """
10138 return _core_.Window_SetScrollbar(*args, **kwargs)
10139
10140 def SetScrollPos(*args, **kwargs):
10141 """
10142 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10143
10144 Sets the position of one of the built-in scrollbars.
10145 """
10146 return _core_.Window_SetScrollPos(*args, **kwargs)
10147
10148 def GetScrollPos(*args, **kwargs):
10149 """
10150 GetScrollPos(self, int orientation) -> int
10151
10152 Returns the built-in scrollbar position.
10153 """
10154 return _core_.Window_GetScrollPos(*args, **kwargs)
10155
10156 def GetScrollThumb(*args, **kwargs):
10157 """
10158 GetScrollThumb(self, int orientation) -> int
10159
10160 Returns the built-in scrollbar thumb size.
10161 """
10162 return _core_.Window_GetScrollThumb(*args, **kwargs)
10163
10164 def GetScrollRange(*args, **kwargs):
10165 """
10166 GetScrollRange(self, int orientation) -> int
10167
10168 Returns the built-in scrollbar range.
10169 """
10170 return _core_.Window_GetScrollRange(*args, **kwargs)
10171
10172 def ScrollWindow(*args, **kwargs):
10173 """
10174 ScrollWindow(self, int dx, int dy, Rect rect=None)
10175
10176 Physically scrolls the pixels in the window and move child windows
10177 accordingly. Use this function to optimise your scrolling
10178 implementations, to minimise the area that must be redrawn. Note that
10179 it is rarely required to call this function from a user program.
10180 """
10181 return _core_.Window_ScrollWindow(*args, **kwargs)
10182
10183 def ScrollLines(*args, **kwargs):
10184 """
10185 ScrollLines(self, int lines) -> bool
10186
10187 If the platform and window class supports it, scrolls the window by
10188 the given number of lines down, if lines is positive, or up if lines
10189 is negative. Returns True if the window was scrolled, False if it was
10190 already on top/bottom and nothing was done.
10191 """
10192 return _core_.Window_ScrollLines(*args, **kwargs)
10193
10194 def ScrollPages(*args, **kwargs):
10195 """
10196 ScrollPages(self, int pages) -> bool
10197
10198 If the platform and window class supports it, scrolls the window by
10199 the given number of pages down, if pages is positive, or up if pages
10200 is negative. Returns True if the window was scrolled, False if it was
10201 already on top/bottom and nothing was done.
10202 """
10203 return _core_.Window_ScrollPages(*args, **kwargs)
10204
10205 def LineUp(*args, **kwargs):
10206 """
10207 LineUp(self) -> bool
10208
10209 This is just a wrapper for ScrollLines(-1).
10210 """
10211 return _core_.Window_LineUp(*args, **kwargs)
10212
10213 def LineDown(*args, **kwargs):
10214 """
10215 LineDown(self) -> bool
10216
10217 This is just a wrapper for ScrollLines(1).
10218 """
10219 return _core_.Window_LineDown(*args, **kwargs)
10220
10221 def PageUp(*args, **kwargs):
10222 """
10223 PageUp(self) -> bool
10224
10225 This is just a wrapper for ScrollPages(-1).
10226 """
10227 return _core_.Window_PageUp(*args, **kwargs)
10228
10229 def PageDown(*args, **kwargs):
10230 """
10231 PageDown(self) -> bool
10232
10233 This is just a wrapper for ScrollPages(1).
10234 """
10235 return _core_.Window_PageDown(*args, **kwargs)
10236
10237 def SetHelpText(*args, **kwargs):
10238 """
10239 SetHelpText(self, String text)
10240
10241 Sets the help text to be used as context-sensitive help for this
10242 window. Note that the text is actually stored by the current
10243 `wx.HelpProvider` implementation, and not in the window object itself.
10244 """
10245 return _core_.Window_SetHelpText(*args, **kwargs)
10246
10247 def SetHelpTextForId(*args, **kwargs):
10248 """
10249 SetHelpTextForId(self, String text)
10250
10251 Associate this help text with all windows with the same id as this
10252 one.
10253 """
10254 return _core_.Window_SetHelpTextForId(*args, **kwargs)
10255
10256 def GetHelpTextAtPoint(*args, **kwargs):
10257 """
10258 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10259
10260 Get the help string associated with the given position in this window.
10261
10262 Notice that pt may be invalid if event origin is keyboard or unknown
10263 and this method should return the global window help text then
10264
10265 """
10266 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10267
10268 def GetHelpText(*args, **kwargs):
10269 """
10270 GetHelpText(self) -> String
10271
10272 Gets the help text to be used as context-sensitive help for this
10273 window. Note that the text is actually stored by the current
10274 `wx.HelpProvider` implementation, and not in the window object itself.
10275 """
10276 return _core_.Window_GetHelpText(*args, **kwargs)
10277
10278 def SetToolTipString(*args, **kwargs):
10279 """
10280 SetToolTipString(self, String tip)
10281
10282 Attach a tooltip to the window.
10283 """
10284 return _core_.Window_SetToolTipString(*args, **kwargs)
10285
10286 def SetToolTip(*args, **kwargs):
10287 """
10288 SetToolTip(self, ToolTip tip)
10289
10290 Attach a tooltip to the window.
10291 """
10292 return _core_.Window_SetToolTip(*args, **kwargs)
10293
10294 def GetToolTip(*args, **kwargs):
10295 """
10296 GetToolTip(self) -> ToolTip
10297
10298 get the associated tooltip or None if none
10299 """
10300 return _core_.Window_GetToolTip(*args, **kwargs)
10301
10302 def SetDropTarget(*args, **kwargs):
10303 """
10304 SetDropTarget(self, DropTarget dropTarget)
10305
10306 Associates a drop target with this window. If the window already has
10307 a drop target, it is deleted.
10308 """
10309 return _core_.Window_SetDropTarget(*args, **kwargs)
10310
10311 def GetDropTarget(*args, **kwargs):
10312 """
10313 GetDropTarget(self) -> DropTarget
10314
10315 Returns the associated drop target, which may be None.
10316 """
10317 return _core_.Window_GetDropTarget(*args, **kwargs)
10318
10319 def DragAcceptFiles(*args, **kwargs):
10320 """
10321 DragAcceptFiles(self, bool accept)
10322
10323 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10324 Only functional on Windows.
10325 """
10326 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10327
10328 def SetConstraints(*args, **kwargs):
10329 """
10330 SetConstraints(self, LayoutConstraints constraints)
10331
10332 Sets the window to have the given layout constraints. If an existing
10333 layout constraints object is already owned by the window, it will be
10334 deleted. Pass None to disassociate and delete the window's current
10335 constraints.
10336
10337 You must call SetAutoLayout to tell a window to use the constraints
10338 automatically in its default EVT_SIZE handler; otherwise, you must
10339 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10340 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10341 effect.
10342 """
10343 return _core_.Window_SetConstraints(*args, **kwargs)
10344
10345 def GetConstraints(*args, **kwargs):
10346 """
10347 GetConstraints(self) -> LayoutConstraints
10348
10349 Returns a pointer to the window's layout constraints, or None if there
10350 are none.
10351 """
10352 return _core_.Window_GetConstraints(*args, **kwargs)
10353
10354 def SetAutoLayout(*args, **kwargs):
10355 """
10356 SetAutoLayout(self, bool autoLayout)
10357
10358 Determines whether the Layout function will be called automatically
10359 when the window is resized. lease note that this only happens for the
10360 windows usually used to contain children, namely `wx.Panel` and
10361 `wx.TopLevelWindow` (and the classes deriving from them).
10362
10363 This method is called implicitly by `SetSizer` but if you use
10364 `SetConstraints` you should call it manually or otherwise the window
10365 layout won't be correctly updated when its size changes.
10366 """
10367 return _core_.Window_SetAutoLayout(*args, **kwargs)
10368
10369 def GetAutoLayout(*args, **kwargs):
10370 """
10371 GetAutoLayout(self) -> bool
10372
10373 Returns the current autoLayout setting
10374 """
10375 return _core_.Window_GetAutoLayout(*args, **kwargs)
10376
10377 def Layout(*args, **kwargs):
10378 """
10379 Layout(self) -> bool
10380
10381 Invokes the constraint-based layout algorithm or the sizer-based
10382 algorithm for this window. See SetAutoLayout: when auto layout is on,
10383 this function gets called automatically by the default EVT_SIZE
10384 handler when the window is resized.
10385 """
10386 return _core_.Window_Layout(*args, **kwargs)
10387
10388 def SetSizer(*args, **kwargs):
10389 """
10390 SetSizer(self, Sizer sizer, bool deleteOld=True)
10391
10392 Sets the window to have the given layout sizer. The window will then
10393 own the object, and will take care of its deletion. If an existing
10394 layout sizer object is already owned by the window, it will be deleted
10395 if the deleteOld parameter is true. Note that this function will also
10396 call SetAutoLayout implicitly with a True parameter if the sizer is
10397 non-None, and False otherwise.
10398 """
10399 return _core_.Window_SetSizer(*args, **kwargs)
10400
10401 def SetSizerAndFit(*args, **kwargs):
10402 """
10403 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10404
10405 The same as SetSizer, except it also sets the size hints for the
10406 window based on the sizer's minimum size.
10407 """
10408 return _core_.Window_SetSizerAndFit(*args, **kwargs)
10409
10410 def GetSizer(*args, **kwargs):
10411 """
10412 GetSizer(self) -> Sizer
10413
10414 Return the sizer associated with the window by a previous call to
10415 SetSizer or None if there isn't one.
10416 """
10417 return _core_.Window_GetSizer(*args, **kwargs)
10418
10419 def SetContainingSizer(*args, **kwargs):
10420 """
10421 SetContainingSizer(self, Sizer sizer)
10422
10423 This normally does not need to be called by application code. It is
10424 called internally when a window is added to a sizer, and is used so
10425 the window can remove itself from the sizer when it is destroyed.
10426 """
10427 return _core_.Window_SetContainingSizer(*args, **kwargs)
10428
10429 def GetContainingSizer(*args, **kwargs):
10430 """
10431 GetContainingSizer(self) -> Sizer
10432
10433 Return the sizer that this window is a member of, if any, otherwise None.
10434 """
10435 return _core_.Window_GetContainingSizer(*args, **kwargs)
10436
10437 def InheritAttributes(*args, **kwargs):
10438 """
10439 InheritAttributes(self)
10440
10441 This function is (or should be, in case of custom controls) called
10442 during window creation to intelligently set up the window visual
10443 attributes, that is the font and the foreground and background
10444 colours.
10445
10446 By 'intelligently' the following is meant: by default, all windows use
10447 their own default attributes. However if some of the parent's
10448 attributes are explicitly changed (that is, using SetFont and not
10449 SetOwnFont) and if the corresponding attribute hadn't been
10450 explicitly set for this window itself, then this window takes the same
10451 value as used by the parent. In addition, if the window overrides
10452 ShouldInheritColours to return false, the colours will not be changed
10453 no matter what and only the font might.
10454
10455 This rather complicated logic is necessary in order to accommodate the
10456 different usage scenarios. The most common one is when all default
10457 attributes are used and in this case, nothing should be inherited as
10458 in modern GUIs different controls use different fonts (and colours)
10459 than their siblings so they can't inherit the same value from the
10460 parent. However it was also deemed desirable to allow to simply change
10461 the attributes of all children at once by just changing the font or
10462 colour of their common parent, hence in this case we do inherit the
10463 parents attributes.
10464
10465 """
10466 return _core_.Window_InheritAttributes(*args, **kwargs)
10467
10468 def ShouldInheritColours(*args, **kwargs):
10469 """
10470 ShouldInheritColours(self) -> bool
10471
10472 Return true from here to allow the colours of this window to be
10473 changed by InheritAttributes, returning false forbids inheriting them
10474 from the parent window.
10475
10476 The base class version returns false, but this method is overridden in
10477 wxControl where it returns true.
10478 """
10479 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10480
10481 def CanSetTransparent(*args, **kwargs):
10482 """
10483 CanSetTransparent(self) -> bool
10484
10485 Returns ``True`` if the platform supports setting the transparency for
10486 this window. Note that this method will err on the side of caution,
10487 so it is possible that this will return ``False`` when it is in fact
10488 possible to set the transparency.
10489
10490 NOTE: On X-windows systems the X server must have the composite
10491 extension loaded, and there must be a composite manager program (such
10492 as xcompmgr) running.
10493 """
10494 return _core_.Window_CanSetTransparent(*args, **kwargs)
10495
10496 def SetTransparent(*args, **kwargs):
10497 """
10498 SetTransparent(self, byte alpha) -> bool
10499
10500 Attempt to set the transparency of this window to the ``alpha`` value,
10501 returns True on success. The ``alpha`` value is an integer in the
10502 range of 0 to 255, where 0 is fully transparent and 255 is fully
10503 opaque.
10504 """
10505 return _core_.Window_SetTransparent(*args, **kwargs)
10506
10507 def PostCreate(self, pre):
10508 """
10509 Phase 3 of the 2-phase create <wink!>
10510 Call this method after precreating the window with the 2-phase create method.
10511 """
10512 self.this = pre.this
10513 self.thisown = pre.thisown
10514 pre.thisown = 0
10515 if hasattr(self, '_setOORInfo'):
10516 try:
10517 self._setOORInfo(self)
10518 except TypeError:
10519 pass
10520 if hasattr(self, '_setCallbackInfo'):
10521 try:
10522 self._setCallbackInfo(self, pre.__class__)
10523 except TypeError:
10524 pass
10525
10526 def SendSizeEvent(self):
10527 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10528
10529 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10530 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10531 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10532 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10533 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
10534 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10535 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10536 Border = property(GetBorder,doc="See `GetBorder`")
10537 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10538 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10539 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10540 Children = property(GetChildren,doc="See `GetChildren`")
10541 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10542 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10543 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10544 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10545 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10546 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10547 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10548 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10549 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10550 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10551 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10552 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
10553 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10554 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
10555 Handle = property(GetHandle,doc="See `GetHandle`")
10556 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
10557 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10558 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
10559 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
10560 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10561 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10562 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10563 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10564 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10565 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10566 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10567 Parent = property(GetParent,doc="See `GetParent`")
10568 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10569 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10570 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10571 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
10572 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10573 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
10574 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10575 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10576 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10577 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10578 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10579 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10580 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10581 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10582 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
10583 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10584 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10585 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
10586 _core_.Window_swigregister(Window)
10587
10588 def PreWindow(*args, **kwargs):
10589 """
10590 PreWindow() -> Window
10591
10592 Precreate a Window for 2-phase creation.
10593 """
10594 val = _core_.new_PreWindow(*args, **kwargs)
10595 return val
10596
10597 def Window_NewControlId(*args):
10598 """
10599 Window_NewControlId() -> int
10600
10601 Generate a control id for the controls which were not given one.
10602 """
10603 return _core_.Window_NewControlId(*args)
10604
10605 def Window_NextControlId(*args, **kwargs):
10606 """
10607 Window_NextControlId(int winid) -> int
10608
10609 Get the id of the control following the one with the given
10610 autogenerated) id
10611 """
10612 return _core_.Window_NextControlId(*args, **kwargs)
10613
10614 def Window_PrevControlId(*args, **kwargs):
10615 """
10616 Window_PrevControlId(int winid) -> int
10617
10618 Get the id of the control preceding the one with the given
10619 autogenerated) id
10620 """
10621 return _core_.Window_PrevControlId(*args, **kwargs)
10622
10623 def Window_FindFocus(*args):
10624 """
10625 Window_FindFocus() -> Window
10626
10627 Returns the window or control that currently has the keyboard focus,
10628 or None.
10629 """
10630 return _core_.Window_FindFocus(*args)
10631
10632 def Window_GetCapture(*args):
10633 """
10634 Window_GetCapture() -> Window
10635
10636 Returns the window which currently captures the mouse or None
10637 """
10638 return _core_.Window_GetCapture(*args)
10639
10640 def Window_GetClassDefaultAttributes(*args, **kwargs):
10641 """
10642 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10643
10644 Get the default attributes for this class. This is useful if you want
10645 to use the same font or colour in your own control as in a standard
10646 control -- which is a much better idea than hard coding specific
10647 colours or fonts which might look completely out of place on the
10648 user's system, especially if it uses themes.
10649
10650 The variant parameter is only relevant under Mac currently and is
10651 ignore under other platforms. Under Mac, it will change the size of
10652 the returned font. See `wx.Window.SetWindowVariant` for more about
10653 this.
10654 """
10655 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10656
10657 def DLG_PNT(win, point_or_x, y=None):
10658 """
10659 Convenience function for converting a Point or (x,y) in
10660 dialog units to pixel units.
10661 """
10662 if y is None:
10663 return win.ConvertDialogPointToPixels(point_or_x)
10664 else:
10665 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10666
10667 def DLG_SZE(win, size_width, height=None):
10668 """
10669 Convenience function for converting a Size or (w,h) in
10670 dialog units to pixel units.
10671 """
10672 if height is None:
10673 return win.ConvertDialogSizeToPixels(size_width)
10674 else:
10675 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10676
10677
10678 def FindWindowById(*args, **kwargs):
10679 """
10680 FindWindowById(long id, Window parent=None) -> Window
10681
10682 Find the first window in the application with the given id. If parent
10683 is None, the search will start from all top-level frames and dialog
10684 boxes; if non-None, the search will be limited to the given window
10685 hierarchy. The search is recursive in both cases.
10686 """
10687 return _core_.FindWindowById(*args, **kwargs)
10688
10689 def FindWindowByName(*args, **kwargs):
10690 """
10691 FindWindowByName(String name, Window parent=None) -> Window
10692
10693 Find a window by its name (as given in a window constructor or Create
10694 function call). If parent is None, the search will start from all
10695 top-level frames and dialog boxes; if non-None, the search will be
10696 limited to the given window hierarchy. The search is recursive in both
10697 cases.
10698
10699 If no window with such name is found, wx.FindWindowByLabel is called.
10700 """
10701 return _core_.FindWindowByName(*args, **kwargs)
10702
10703 def FindWindowByLabel(*args, **kwargs):
10704 """
10705 FindWindowByLabel(String label, Window parent=None) -> Window
10706
10707 Find a window by its label. Depending on the type of window, the label
10708 may be a window title or panel item label. If parent is None, the
10709 search will start from all top-level frames and dialog boxes; if
10710 non-None, the search will be limited to the given window
10711 hierarchy. The search is recursive in both cases.
10712 """
10713 return _core_.FindWindowByLabel(*args, **kwargs)
10714
10715 def Window_FromHWND(*args, **kwargs):
10716 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10717 return _core_.Window_FromHWND(*args, **kwargs)
10718
10719 def GetTopLevelWindows(*args):
10720 """
10721 GetTopLevelWindows() -> PyObject
10722
10723 Returns a list of the the application's top-level windows, (frames,
10724 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10725 by wxWidgets, and so it is only valid as long as no top-level windows
10726 are closed or new top-level windows are created.
10727
10728 """
10729 return _core_.GetTopLevelWindows(*args)
10730 #---------------------------------------------------------------------------
10731
10732 class Validator(EvtHandler):
10733 """Proxy of C++ Validator class"""
10734 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10735 __repr__ = _swig_repr
10736 def __init__(self, *args, **kwargs):
10737 """__init__(self) -> Validator"""
10738 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
10739 self._setOORInfo(self)
10740
10741 def Clone(*args, **kwargs):
10742 """Clone(self) -> Validator"""
10743 return _core_.Validator_Clone(*args, **kwargs)
10744
10745 def Validate(*args, **kwargs):
10746 """Validate(self, Window parent) -> bool"""
10747 return _core_.Validator_Validate(*args, **kwargs)
10748
10749 def TransferToWindow(*args, **kwargs):
10750 """TransferToWindow(self) -> bool"""
10751 return _core_.Validator_TransferToWindow(*args, **kwargs)
10752
10753 def TransferFromWindow(*args, **kwargs):
10754 """TransferFromWindow(self) -> bool"""
10755 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10756
10757 def GetWindow(*args, **kwargs):
10758 """GetWindow(self) -> Window"""
10759 return _core_.Validator_GetWindow(*args, **kwargs)
10760
10761 def SetWindow(*args, **kwargs):
10762 """SetWindow(self, Window window)"""
10763 return _core_.Validator_SetWindow(*args, **kwargs)
10764
10765 def IsSilent(*args, **kwargs):
10766 """IsSilent() -> bool"""
10767 return _core_.Validator_IsSilent(*args, **kwargs)
10768
10769 IsSilent = staticmethod(IsSilent)
10770 def SetBellOnError(*args, **kwargs):
10771 """SetBellOnError(int doIt=True)"""
10772 return _core_.Validator_SetBellOnError(*args, **kwargs)
10773
10774 SetBellOnError = staticmethod(SetBellOnError)
10775 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
10776 _core_.Validator_swigregister(Validator)
10777
10778 def Validator_IsSilent(*args):
10779 """Validator_IsSilent() -> bool"""
10780 return _core_.Validator_IsSilent(*args)
10781
10782 def Validator_SetBellOnError(*args, **kwargs):
10783 """Validator_SetBellOnError(int doIt=True)"""
10784 return _core_.Validator_SetBellOnError(*args, **kwargs)
10785
10786 class PyValidator(Validator):
10787 """Proxy of C++ PyValidator class"""
10788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10789 __repr__ = _swig_repr
10790 def __init__(self, *args, **kwargs):
10791 """__init__(self) -> PyValidator"""
10792 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10793 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
10794
10795 def _setCallbackInfo(*args, **kwargs):
10796 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
10797 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10798
10799 _core_.PyValidator_swigregister(PyValidator)
10800
10801 #---------------------------------------------------------------------------
10802
10803 class Menu(EvtHandler):
10804 """Proxy of C++ Menu class"""
10805 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10806 __repr__ = _swig_repr
10807 def __init__(self, *args, **kwargs):
10808 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10809 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10810 self._setOORInfo(self)
10811
10812 def Append(*args, **kwargs):
10813 """
10814 Append(self, int id, String text=EmptyString, String help=EmptyString,
10815 int kind=ITEM_NORMAL) -> MenuItem
10816 """
10817 return _core_.Menu_Append(*args, **kwargs)
10818
10819 def AppendSeparator(*args, **kwargs):
10820 """AppendSeparator(self) -> MenuItem"""
10821 return _core_.Menu_AppendSeparator(*args, **kwargs)
10822
10823 def AppendCheckItem(*args, **kwargs):
10824 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10825 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10826
10827 def AppendRadioItem(*args, **kwargs):
10828 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10829 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10830
10831 def AppendMenu(*args, **kwargs):
10832 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10833 return _core_.Menu_AppendMenu(*args, **kwargs)
10834
10835 def AppendSubMenu(*args, **kwargs):
10836 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10837 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10838
10839 def AppendItem(*args, **kwargs):
10840 """AppendItem(self, MenuItem item) -> MenuItem"""
10841 return _core_.Menu_AppendItem(*args, **kwargs)
10842
10843 def InsertItem(*args, **kwargs):
10844 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10845 return _core_.Menu_InsertItem(*args, **kwargs)
10846
10847 def PrependItem(*args, **kwargs):
10848 """PrependItem(self, MenuItem item) -> MenuItem"""
10849 return _core_.Menu_PrependItem(*args, **kwargs)
10850
10851 def Break(*args, **kwargs):
10852 """Break(self)"""
10853 return _core_.Menu_Break(*args, **kwargs)
10854
10855 def Insert(*args, **kwargs):
10856 """
10857 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10858 int kind=ITEM_NORMAL) -> MenuItem
10859 """
10860 return _core_.Menu_Insert(*args, **kwargs)
10861
10862 def InsertSeparator(*args, **kwargs):
10863 """InsertSeparator(self, size_t pos) -> MenuItem"""
10864 return _core_.Menu_InsertSeparator(*args, **kwargs)
10865
10866 def InsertCheckItem(*args, **kwargs):
10867 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10868 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10869
10870 def InsertRadioItem(*args, **kwargs):
10871 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10872 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10873
10874 def InsertMenu(*args, **kwargs):
10875 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10876 return _core_.Menu_InsertMenu(*args, **kwargs)
10877
10878 def Prepend(*args, **kwargs):
10879 """
10880 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10881 int kind=ITEM_NORMAL) -> MenuItem
10882 """
10883 return _core_.Menu_Prepend(*args, **kwargs)
10884
10885 def PrependSeparator(*args, **kwargs):
10886 """PrependSeparator(self) -> MenuItem"""
10887 return _core_.Menu_PrependSeparator(*args, **kwargs)
10888
10889 def PrependCheckItem(*args, **kwargs):
10890 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10891 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10892
10893 def PrependRadioItem(*args, **kwargs):
10894 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10895 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10896
10897 def PrependMenu(*args, **kwargs):
10898 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10899 return _core_.Menu_PrependMenu(*args, **kwargs)
10900
10901 def Remove(*args, **kwargs):
10902 """Remove(self, int id) -> MenuItem"""
10903 return _core_.Menu_Remove(*args, **kwargs)
10904
10905 def RemoveItem(self, item):
10906 """RemoveItem(self, MenuItem item) -> MenuItem"""
10907 #// The return object is always the parameter, so return that
10908 #// proxy instead of the new one
10909 val = _core_.Menu_RemoveItem(self, item)
10910 item.this.own(val.this.own())
10911 val.this.disown()
10912 return item
10913
10914
10915 def Delete(*args, **kwargs):
10916 """Delete(self, int id) -> bool"""
10917 return _core_.Menu_Delete(*args, **kwargs)
10918
10919 def DeleteItem(*args, **kwargs):
10920 """DeleteItem(self, MenuItem item) -> bool"""
10921 return _core_.Menu_DeleteItem(*args, **kwargs)
10922
10923 def Destroy(*args, **kwargs):
10924 """
10925 Destroy(self)
10926
10927 Deletes the C++ object this Python object is a proxy for.
10928 """
10929 args[0].this.own(False)
10930 return _core_.Menu_Destroy(*args, **kwargs)
10931
10932 def DestroyId(*args, **kwargs):
10933 """DestroyId(self, int id) -> bool"""
10934 return _core_.Menu_DestroyId(*args, **kwargs)
10935
10936 def DestroyItem(*args, **kwargs):
10937 """DestroyItem(self, MenuItem item) -> bool"""
10938 return _core_.Menu_DestroyItem(*args, **kwargs)
10939
10940 def GetMenuItemCount(*args, **kwargs):
10941 """GetMenuItemCount(self) -> size_t"""
10942 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10943
10944 def GetMenuItems(*args, **kwargs):
10945 """GetMenuItems(self) -> PyObject"""
10946 return _core_.Menu_GetMenuItems(*args, **kwargs)
10947
10948 def FindItem(*args, **kwargs):
10949 """FindItem(self, String item) -> int"""
10950 return _core_.Menu_FindItem(*args, **kwargs)
10951
10952 def FindItemById(*args, **kwargs):
10953 """FindItemById(self, int id) -> MenuItem"""
10954 return _core_.Menu_FindItemById(*args, **kwargs)
10955
10956 def FindItemByPosition(*args, **kwargs):
10957 """FindItemByPosition(self, size_t position) -> MenuItem"""
10958 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10959
10960 def Enable(*args, **kwargs):
10961 """Enable(self, int id, bool enable)"""
10962 return _core_.Menu_Enable(*args, **kwargs)
10963
10964 def IsEnabled(*args, **kwargs):
10965 """IsEnabled(self, int id) -> bool"""
10966 return _core_.Menu_IsEnabled(*args, **kwargs)
10967
10968 def Check(*args, **kwargs):
10969 """Check(self, int id, bool check)"""
10970 return _core_.Menu_Check(*args, **kwargs)
10971
10972 def IsChecked(*args, **kwargs):
10973 """IsChecked(self, int id) -> bool"""
10974 return _core_.Menu_IsChecked(*args, **kwargs)
10975
10976 def SetLabel(*args, **kwargs):
10977 """SetLabel(self, int id, String label)"""
10978 return _core_.Menu_SetLabel(*args, **kwargs)
10979
10980 def GetLabel(*args, **kwargs):
10981 """GetLabel(self, int id) -> String"""
10982 return _core_.Menu_GetLabel(*args, **kwargs)
10983
10984 def SetHelpString(*args, **kwargs):
10985 """SetHelpString(self, int id, String helpString)"""
10986 return _core_.Menu_SetHelpString(*args, **kwargs)
10987
10988 def GetHelpString(*args, **kwargs):
10989 """GetHelpString(self, int id) -> String"""
10990 return _core_.Menu_GetHelpString(*args, **kwargs)
10991
10992 def SetTitle(*args, **kwargs):
10993 """SetTitle(self, String title)"""
10994 return _core_.Menu_SetTitle(*args, **kwargs)
10995
10996 def GetTitle(*args, **kwargs):
10997 """GetTitle(self) -> String"""
10998 return _core_.Menu_GetTitle(*args, **kwargs)
10999
11000 def SetEventHandler(*args, **kwargs):
11001 """SetEventHandler(self, EvtHandler handler)"""
11002 return _core_.Menu_SetEventHandler(*args, **kwargs)
11003
11004 def GetEventHandler(*args, **kwargs):
11005 """GetEventHandler(self) -> EvtHandler"""
11006 return _core_.Menu_GetEventHandler(*args, **kwargs)
11007
11008 def SetInvokingWindow(*args, **kwargs):
11009 """SetInvokingWindow(self, Window win)"""
11010 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
11011
11012 def GetInvokingWindow(*args, **kwargs):
11013 """GetInvokingWindow(self) -> Window"""
11014 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
11015
11016 def GetStyle(*args, **kwargs):
11017 """GetStyle(self) -> long"""
11018 return _core_.Menu_GetStyle(*args, **kwargs)
11019
11020 def UpdateUI(*args, **kwargs):
11021 """UpdateUI(self, EvtHandler source=None)"""
11022 return _core_.Menu_UpdateUI(*args, **kwargs)
11023
11024 def GetMenuBar(*args, **kwargs):
11025 """GetMenuBar(self) -> MenuBar"""
11026 return _core_.Menu_GetMenuBar(*args, **kwargs)
11027
11028 def Attach(*args, **kwargs):
11029 """Attach(self, wxMenuBarBase menubar)"""
11030 return _core_.Menu_Attach(*args, **kwargs)
11031
11032 def Detach(*args, **kwargs):
11033 """Detach(self)"""
11034 return _core_.Menu_Detach(*args, **kwargs)
11035
11036 def IsAttached(*args, **kwargs):
11037 """IsAttached(self) -> bool"""
11038 return _core_.Menu_IsAttached(*args, **kwargs)
11039
11040 def SetParent(*args, **kwargs):
11041 """SetParent(self, Menu parent)"""
11042 return _core_.Menu_SetParent(*args, **kwargs)
11043
11044 def GetParent(*args, **kwargs):
11045 """GetParent(self) -> Menu"""
11046 return _core_.Menu_GetParent(*args, **kwargs)
11047
11048 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
11049 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
11050 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
11051 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
11052 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
11053 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
11054 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
11055 Style = property(GetStyle,doc="See `GetStyle`")
11056 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
11057 _core_.Menu_swigregister(Menu)
11058 DefaultValidator = cvar.DefaultValidator
11059
11060 #---------------------------------------------------------------------------
11061
11062 class MenuBar(Window):
11063 """Proxy of C++ MenuBar class"""
11064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11065 __repr__ = _swig_repr
11066 def __init__(self, *args, **kwargs):
11067 """__init__(self, long style=0) -> MenuBar"""
11068 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
11069 self._setOORInfo(self)
11070
11071 def Append(*args, **kwargs):
11072 """Append(self, Menu menu, String title) -> bool"""
11073 return _core_.MenuBar_Append(*args, **kwargs)
11074
11075 def Insert(*args, **kwargs):
11076 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
11077 return _core_.MenuBar_Insert(*args, **kwargs)
11078
11079 def GetMenuCount(*args, **kwargs):
11080 """GetMenuCount(self) -> size_t"""
11081 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
11082
11083 def GetMenu(*args, **kwargs):
11084 """GetMenu(self, size_t pos) -> Menu"""
11085 return _core_.MenuBar_GetMenu(*args, **kwargs)
11086
11087 def Replace(*args, **kwargs):
11088 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11089 return _core_.MenuBar_Replace(*args, **kwargs)
11090
11091 def Remove(*args, **kwargs):
11092 """Remove(self, size_t pos) -> Menu"""
11093 return _core_.MenuBar_Remove(*args, **kwargs)
11094
11095 def EnableTop(*args, **kwargs):
11096 """EnableTop(self, size_t pos, bool enable)"""
11097 return _core_.MenuBar_EnableTop(*args, **kwargs)
11098
11099 def IsEnabledTop(*args, **kwargs):
11100 """IsEnabledTop(self, size_t pos) -> bool"""
11101 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
11102
11103 def SetLabelTop(*args, **kwargs):
11104 """SetLabelTop(self, size_t pos, String label)"""
11105 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
11106
11107 def GetLabelTop(*args, **kwargs):
11108 """GetLabelTop(self, size_t pos) -> String"""
11109 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
11110
11111 def FindMenuItem(*args, **kwargs):
11112 """FindMenuItem(self, String menu, String item) -> int"""
11113 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
11114
11115 def FindItemById(*args, **kwargs):
11116 """FindItemById(self, int id) -> MenuItem"""
11117 return _core_.MenuBar_FindItemById(*args, **kwargs)
11118
11119 def FindMenu(*args, **kwargs):
11120 """FindMenu(self, String title) -> int"""
11121 return _core_.MenuBar_FindMenu(*args, **kwargs)
11122
11123 def Enable(*args, **kwargs):
11124 """Enable(self, int id, bool enable)"""
11125 return _core_.MenuBar_Enable(*args, **kwargs)
11126
11127 def Check(*args, **kwargs):
11128 """Check(self, int id, bool check)"""
11129 return _core_.MenuBar_Check(*args, **kwargs)
11130
11131 def IsChecked(*args, **kwargs):
11132 """IsChecked(self, int id) -> bool"""
11133 return _core_.MenuBar_IsChecked(*args, **kwargs)
11134
11135 def IsEnabled(*args, **kwargs):
11136 """IsEnabled(self, int id) -> bool"""
11137 return _core_.MenuBar_IsEnabled(*args, **kwargs)
11138
11139 def SetLabel(*args, **kwargs):
11140 """SetLabel(self, int id, String label)"""
11141 return _core_.MenuBar_SetLabel(*args, **kwargs)
11142
11143 def GetLabel(*args, **kwargs):
11144 """GetLabel(self, int id) -> String"""
11145 return _core_.MenuBar_GetLabel(*args, **kwargs)
11146
11147 def SetHelpString(*args, **kwargs):
11148 """SetHelpString(self, int id, String helpString)"""
11149 return _core_.MenuBar_SetHelpString(*args, **kwargs)
11150
11151 def GetHelpString(*args, **kwargs):
11152 """GetHelpString(self, int id) -> String"""
11153 return _core_.MenuBar_GetHelpString(*args, **kwargs)
11154
11155 def GetFrame(*args, **kwargs):
11156 """GetFrame(self) -> wxFrame"""
11157 return _core_.MenuBar_GetFrame(*args, **kwargs)
11158
11159 def IsAttached(*args, **kwargs):
11160 """IsAttached(self) -> bool"""
11161 return _core_.MenuBar_IsAttached(*args, **kwargs)
11162
11163 def Attach(*args, **kwargs):
11164 """Attach(self, wxFrame frame)"""
11165 return _core_.MenuBar_Attach(*args, **kwargs)
11166
11167 def Detach(*args, **kwargs):
11168 """Detach(self)"""
11169 return _core_.MenuBar_Detach(*args, **kwargs)
11170
11171 def UpdateMenus(*args, **kwargs):
11172 """UpdateMenus(self)"""
11173 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11174
11175 def SetAutoWindowMenu(*args, **kwargs):
11176 """SetAutoWindowMenu(bool enable)"""
11177 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11178
11179 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11180 def GetAutoWindowMenu(*args, **kwargs):
11181 """GetAutoWindowMenu() -> bool"""
11182 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11183
11184 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
11185 def GetMenus(self):
11186 """Return a list of (menu, label) items for the menus in the MenuBar. """
11187 return [(self.GetMenu(i), self.GetLabelTop(i))
11188 for i in range(self.GetMenuCount())]
11189
11190 def SetMenus(self, items):
11191 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11192 for i in range(self.GetMenuCount()-1, -1, -1):
11193 self.Remove(i)
11194 for m, l in items:
11195 self.Append(m, l)
11196
11197 Frame = property(GetFrame,doc="See `GetFrame`")
11198 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11199 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
11200 _core_.MenuBar_swigregister(MenuBar)
11201
11202 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
11203 """MenuBar_SetAutoWindowMenu(bool enable)"""
11204 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11205
11206 def MenuBar_GetAutoWindowMenu(*args):
11207 """MenuBar_GetAutoWindowMenu() -> bool"""
11208 return _core_.MenuBar_GetAutoWindowMenu(*args)
11209
11210 #---------------------------------------------------------------------------
11211
11212 class MenuItem(Object):
11213 """Proxy of C++ MenuItem class"""
11214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11215 __repr__ = _swig_repr
11216 def __init__(self, *args, **kwargs):
11217 """
11218 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
11219 String help=EmptyString, int kind=ITEM_NORMAL,
11220 Menu subMenu=None) -> MenuItem
11221 """
11222 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11223 __swig_destroy__ = _core_.delete_MenuItem
11224 __del__ = lambda self : None;
11225 def Destroy(self): pass
11226 def GetMenu(*args, **kwargs):
11227 """GetMenu(self) -> Menu"""
11228 return _core_.MenuItem_GetMenu(*args, **kwargs)
11229
11230 def SetMenu(*args, **kwargs):
11231 """SetMenu(self, Menu menu)"""
11232 return _core_.MenuItem_SetMenu(*args, **kwargs)
11233
11234 def SetId(*args, **kwargs):
11235 """SetId(self, int id)"""
11236 return _core_.MenuItem_SetId(*args, **kwargs)
11237
11238 def GetId(*args, **kwargs):
11239 """GetId(self) -> int"""
11240 return _core_.MenuItem_GetId(*args, **kwargs)
11241
11242 def IsSeparator(*args, **kwargs):
11243 """IsSeparator(self) -> bool"""
11244 return _core_.MenuItem_IsSeparator(*args, **kwargs)
11245
11246 def SetText(*args, **kwargs):
11247 """SetText(self, String str)"""
11248 return _core_.MenuItem_SetText(*args, **kwargs)
11249
11250 def GetLabel(*args, **kwargs):
11251 """GetLabel(self) -> String"""
11252 return _core_.MenuItem_GetLabel(*args, **kwargs)
11253
11254 def GetText(*args, **kwargs):
11255 """GetText(self) -> String"""
11256 return _core_.MenuItem_GetText(*args, **kwargs)
11257
11258 def GetLabelFromText(*args, **kwargs):
11259 """GetLabelFromText(String text) -> String"""
11260 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11261
11262 GetLabelFromText = staticmethod(GetLabelFromText)
11263 def GetKind(*args, **kwargs):
11264 """GetKind(self) -> int"""
11265 return _core_.MenuItem_GetKind(*args, **kwargs)
11266
11267 def SetKind(*args, **kwargs):
11268 """SetKind(self, int kind)"""
11269 return _core_.MenuItem_SetKind(*args, **kwargs)
11270
11271 def SetCheckable(*args, **kwargs):
11272 """SetCheckable(self, bool checkable)"""
11273 return _core_.MenuItem_SetCheckable(*args, **kwargs)
11274
11275 def IsCheckable(*args, **kwargs):
11276 """IsCheckable(self) -> bool"""
11277 return _core_.MenuItem_IsCheckable(*args, **kwargs)
11278
11279 def IsSubMenu(*args, **kwargs):
11280 """IsSubMenu(self) -> bool"""
11281 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
11282
11283 def SetSubMenu(*args, **kwargs):
11284 """SetSubMenu(self, Menu menu)"""
11285 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
11286
11287 def GetSubMenu(*args, **kwargs):
11288 """GetSubMenu(self) -> Menu"""
11289 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
11290
11291 def Enable(*args, **kwargs):
11292 """Enable(self, bool enable=True)"""
11293 return _core_.MenuItem_Enable(*args, **kwargs)
11294
11295 def IsEnabled(*args, **kwargs):
11296 """IsEnabled(self) -> bool"""
11297 return _core_.MenuItem_IsEnabled(*args, **kwargs)
11298
11299 def Check(*args, **kwargs):
11300 """Check(self, bool check=True)"""
11301 return _core_.MenuItem_Check(*args, **kwargs)
11302
11303 def IsChecked(*args, **kwargs):
11304 """IsChecked(self) -> bool"""
11305 return _core_.MenuItem_IsChecked(*args, **kwargs)
11306
11307 def Toggle(*args, **kwargs):
11308 """Toggle(self)"""
11309 return _core_.MenuItem_Toggle(*args, **kwargs)
11310
11311 def SetHelp(*args, **kwargs):
11312 """SetHelp(self, String str)"""
11313 return _core_.MenuItem_SetHelp(*args, **kwargs)
11314
11315 def GetHelp(*args, **kwargs):
11316 """GetHelp(self) -> String"""
11317 return _core_.MenuItem_GetHelp(*args, **kwargs)
11318
11319 def GetAccel(*args, **kwargs):
11320 """GetAccel(self) -> AcceleratorEntry"""
11321 return _core_.MenuItem_GetAccel(*args, **kwargs)
11322
11323 def SetAccel(*args, **kwargs):
11324 """SetAccel(self, AcceleratorEntry accel)"""
11325 return _core_.MenuItem_SetAccel(*args, **kwargs)
11326
11327 def SetBitmap(*args, **kwargs):
11328 """SetBitmap(self, Bitmap bitmap)"""
11329 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11330
11331 def GetBitmap(*args, **kwargs):
11332 """GetBitmap(self) -> Bitmap"""
11333 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11334
11335 def SetFont(*args, **kwargs):
11336 """SetFont(self, Font font)"""
11337 return _core_.MenuItem_SetFont(*args, **kwargs)
11338
11339 def GetFont(*args, **kwargs):
11340 """GetFont(self) -> Font"""
11341 return _core_.MenuItem_GetFont(*args, **kwargs)
11342
11343 def SetTextColour(*args, **kwargs):
11344 """SetTextColour(self, Colour colText)"""
11345 return _core_.MenuItem_SetTextColour(*args, **kwargs)
11346
11347 def GetTextColour(*args, **kwargs):
11348 """GetTextColour(self) -> Colour"""
11349 return _core_.MenuItem_GetTextColour(*args, **kwargs)
11350
11351 def SetBackgroundColour(*args, **kwargs):
11352 """SetBackgroundColour(self, Colour colBack)"""
11353 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
11354
11355 def GetBackgroundColour(*args, **kwargs):
11356 """GetBackgroundColour(self) -> Colour"""
11357 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11358
11359 def SetBitmaps(*args, **kwargs):
11360 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11361 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11362
11363 def SetDisabledBitmap(*args, **kwargs):
11364 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11365 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11366
11367 def GetDisabledBitmap(*args, **kwargs):
11368 """GetDisabledBitmap(self) -> Bitmap"""
11369 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11370
11371 def SetMarginWidth(*args, **kwargs):
11372 """SetMarginWidth(self, int nWidth)"""
11373 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11374
11375 def GetMarginWidth(*args, **kwargs):
11376 """GetMarginWidth(self) -> int"""
11377 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11378
11379 def GetDefaultMarginWidth(*args, **kwargs):
11380 """GetDefaultMarginWidth() -> int"""
11381 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
11382
11383 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
11384 def IsOwnerDrawn(*args, **kwargs):
11385 """IsOwnerDrawn(self) -> bool"""
11386 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11387
11388 def SetOwnerDrawn(*args, **kwargs):
11389 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11390 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11391
11392 def ResetOwnerDrawn(*args, **kwargs):
11393 """ResetOwnerDrawn(self)"""
11394 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11395
11396 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11397 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11398 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11399 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11400 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11401 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11402 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11403 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11404 Label = property(GetLabel,doc="See `GetLabel`")
11405 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11406 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11407 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11408 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11409 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
11410 _core_.MenuItem_swigregister(MenuItem)
11411
11412 def MenuItem_GetLabelFromText(*args, **kwargs):
11413 """MenuItem_GetLabelFromText(String text) -> String"""
11414 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11415
11416 def MenuItem_GetDefaultMarginWidth(*args):
11417 """MenuItem_GetDefaultMarginWidth() -> int"""
11418 return _core_.MenuItem_GetDefaultMarginWidth(*args)
11419
11420 #---------------------------------------------------------------------------
11421
11422 class Control(Window):
11423 """
11424 This is the base class for a control or 'widget'.
11425
11426 A control is generally a small window which processes user input
11427 and/or displays one or more item of data.
11428 """
11429 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11430 __repr__ = _swig_repr
11431 def __init__(self, *args, **kwargs):
11432 """
11433 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11434 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11435 String name=ControlNameStr) -> Control
11436
11437 Create a Control. Normally you should only call this from a subclass'
11438 __init__ as a plain old wx.Control is not very useful.
11439 """
11440 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
11441 self._setOORInfo(self)
11442
11443 def Create(*args, **kwargs):
11444 """
11445 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11446 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11447 String name=ControlNameStr) -> bool
11448
11449 Do the 2nd phase and create the GUI control.
11450 """
11451 return _core_.Control_Create(*args, **kwargs)
11452
11453 def GetAlignment(*args, **kwargs):
11454 """
11455 GetAlignment(self) -> int
11456
11457 Get the control alignment (left/right/centre, top/bottom/centre)
11458 """
11459 return _core_.Control_GetAlignment(*args, **kwargs)
11460
11461 def GetLabelText(*args, **kwargs):
11462 """
11463 GetLabelText(self) -> String
11464
11465 Get just the text of the label, without mnemonic characters ('&')
11466 """
11467 return _core_.Control_GetLabelText(*args, **kwargs)
11468
11469 def Command(*args, **kwargs):
11470 """
11471 Command(self, CommandEvent event)
11472
11473 Simulates the effect of the user issuing a command to the item.
11474
11475 :see: `wx.CommandEvent`
11476
11477 """
11478 return _core_.Control_Command(*args, **kwargs)
11479
11480 def RemoveMnemonics(*args, **kwargs):
11481 """
11482 RemoveMnemonics(String str) -> String
11483
11484 removes the mnemonics characters
11485 """
11486 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11487
11488 RemoveMnemonics = staticmethod(RemoveMnemonics)
11489 def GetClassDefaultAttributes(*args, **kwargs):
11490 """
11491 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11492
11493 Get the default attributes for this class. This is useful if you want
11494 to use the same font or colour in your own control as in a standard
11495 control -- which is a much better idea than hard coding specific
11496 colours or fonts which might look completely out of place on the
11497 user's system, especially if it uses themes.
11498
11499 The variant parameter is only relevant under Mac currently and is
11500 ignore under other platforms. Under Mac, it will change the size of
11501 the returned font. See `wx.Window.SetWindowVariant` for more about
11502 this.
11503 """
11504 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11505
11506 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11507 Alignment = property(GetAlignment,doc="See `GetAlignment`")
11508 LabelText = property(GetLabelText,doc="See `GetLabelText`")
11509 _core_.Control_swigregister(Control)
11510 ControlNameStr = cvar.ControlNameStr
11511
11512 def PreControl(*args, **kwargs):
11513 """
11514 PreControl() -> Control
11515
11516 Precreate a Control control for 2-phase creation
11517 """
11518 val = _core_.new_PreControl(*args, **kwargs)
11519 return val
11520
11521 def Control_RemoveMnemonics(*args, **kwargs):
11522 """
11523 Control_RemoveMnemonics(String str) -> String
11524
11525 removes the mnemonics characters
11526 """
11527 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11528
11529 def Control_GetClassDefaultAttributes(*args, **kwargs):
11530 """
11531 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11532
11533 Get the default attributes for this class. This is useful if you want
11534 to use the same font or colour in your own control as in a standard
11535 control -- which is a much better idea than hard coding specific
11536 colours or fonts which might look completely out of place on the
11537 user's system, especially if it uses themes.
11538
11539 The variant parameter is only relevant under Mac currently and is
11540 ignore under other platforms. Under Mac, it will change the size of
11541 the returned font. See `wx.Window.SetWindowVariant` for more about
11542 this.
11543 """
11544 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11545
11546 #---------------------------------------------------------------------------
11547
11548 class ItemContainer(object):
11549 """
11550 The wx.ItemContainer class defines an interface which is implemented
11551 by all controls which have string subitems, each of which may be
11552 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11553 as `wx.ComboBox` which implements an extended interface deriving from
11554 this one.
11555
11556 It defines the methods for accessing the control's items and although
11557 each of the derived classes implements them differently, they still
11558 all conform to the same interface.
11559
11560 The items in a wx.ItemContainer have (non empty) string labels and,
11561 optionally, client data associated with them.
11562
11563 """
11564 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11565 def __init__(self): raise AttributeError, "No constructor defined"
11566 __repr__ = _swig_repr
11567 def Append(*args, **kwargs):
11568 """
11569 Append(self, String item, PyObject clientData=None) -> int
11570
11571 Adds the item to the control, associating the given data with the item
11572 if not None. The return value is the index of the newly added item
11573 which may be different from the last one if the control is sorted (e.g.
11574 has wx.LB_SORT or wx.CB_SORT style).
11575 """
11576 return _core_.ItemContainer_Append(*args, **kwargs)
11577
11578 def AppendItems(*args, **kwargs):
11579 """
11580 AppendItems(self, List strings)
11581
11582 Apend several items at once to the control. Notice that calling this
11583 method may be much faster than appending the items one by one if you
11584 need to add a lot of items.
11585 """
11586 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11587
11588 def Insert(*args, **kwargs):
11589 """
11590 Insert(self, String item, int pos, PyObject clientData=None) -> int
11591
11592 Insert an item into the control before the item at the ``pos`` index,
11593 optionally associating some data object with the item.
11594 """
11595 return _core_.ItemContainer_Insert(*args, **kwargs)
11596
11597 def Clear(*args, **kwargs):
11598 """
11599 Clear(self)
11600
11601 Removes all items from the control.
11602 """
11603 return _core_.ItemContainer_Clear(*args, **kwargs)
11604
11605 def Delete(*args, **kwargs):
11606 """
11607 Delete(self, int n)
11608
11609 Deletes the item at the zero-based index 'n' from the control. Note
11610 that it is an error (signalled by a `wx.PyAssertionError` exception if
11611 enabled) to remove an item with the index negative or greater or equal
11612 than the number of items in the control.
11613 """
11614 return _core_.ItemContainer_Delete(*args, **kwargs)
11615
11616 def GetClientData(*args, **kwargs):
11617 """
11618 GetClientData(self, int n) -> PyObject
11619
11620 Returns the client data associated with the given item, (if any.)
11621 """
11622 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11623
11624 def SetClientData(*args, **kwargs):
11625 """
11626 SetClientData(self, int n, PyObject clientData)
11627
11628 Associate the given client data with the item at position n.
11629 """
11630 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11631
11632 def GetCount(*args, **kwargs):
11633 """
11634 GetCount(self) -> int
11635
11636 Returns the number of items in the control.
11637 """
11638 return _core_.ItemContainer_GetCount(*args, **kwargs)
11639
11640 def IsEmpty(*args, **kwargs):
11641 """
11642 IsEmpty(self) -> bool
11643
11644 Returns True if the control is empty or False if it has some items.
11645 """
11646 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11647
11648 def GetString(*args, **kwargs):
11649 """
11650 GetString(self, int n) -> String
11651
11652 Returns the label of the item with the given index.
11653 """
11654 return _core_.ItemContainer_GetString(*args, **kwargs)
11655
11656 def GetStrings(*args, **kwargs):
11657 """GetStrings(self) -> wxArrayString"""
11658 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11659
11660 def SetString(*args, **kwargs):
11661 """
11662 SetString(self, int n, String s)
11663
11664 Sets the label for the given item.
11665 """
11666 return _core_.ItemContainer_SetString(*args, **kwargs)
11667
11668 def FindString(*args, **kwargs):
11669 """
11670 FindString(self, String s) -> int
11671
11672 Finds an item whose label matches the given string. Returns the
11673 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11674 found.
11675 """
11676 return _core_.ItemContainer_FindString(*args, **kwargs)
11677
11678 def SetSelection(*args, **kwargs):
11679 """
11680 SetSelection(self, int n)
11681
11682 Sets the item at index 'n' to be the selected item.
11683 """
11684 return _core_.ItemContainer_SetSelection(*args, **kwargs)
11685
11686 def GetSelection(*args, **kwargs):
11687 """
11688 GetSelection(self) -> int
11689
11690 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11691 is selected.
11692 """
11693 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11694
11695 def SetStringSelection(*args, **kwargs):
11696 """SetStringSelection(self, String s) -> bool"""
11697 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11698
11699 def GetStringSelection(*args, **kwargs):
11700 """
11701 GetStringSelection(self) -> String
11702
11703 Returns the label of the selected item or an empty string if no item
11704 is selected.
11705 """
11706 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11707
11708 def Select(*args, **kwargs):
11709 """
11710 Select(self, int n)
11711
11712 This is the same as `SetSelection` and exists only because it is
11713 slightly more natural for controls which support multiple selection.
11714 """
11715 return _core_.ItemContainer_Select(*args, **kwargs)
11716
11717 def GetItems(self):
11718 """Return a list of the strings in the control"""
11719 return [self.GetString(i) for i in xrange(self.GetCount())]
11720
11721 def SetItems(self, items):
11722 """Clear and set the strings in the control from a list"""
11723 self.Clear()
11724 for i in items:
11725 self.Append(i)
11726
11727 Count = property(GetCount,doc="See `GetCount`")
11728 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11729 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11730 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11731 Strings = property(GetStrings,doc="See `GetStrings`")
11732 _core_.ItemContainer_swigregister(ItemContainer)
11733
11734 #---------------------------------------------------------------------------
11735
11736 class ControlWithItems(Control,ItemContainer):
11737 """
11738 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11739 wx.Control class, and is used for the base class of various controls
11740 that have items.
11741 """
11742 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11743 def __init__(self): raise AttributeError, "No constructor defined"
11744 __repr__ = _swig_repr
11745 _core_.ControlWithItems_swigregister(ControlWithItems)
11746
11747 #---------------------------------------------------------------------------
11748
11749 class SizerFlags(object):
11750 """
11751 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11752 to specify a lot of flags and parameters which can be unwieldy. This
11753 is where wx.SizerFlags comes in: it allows you to specify all
11754 parameters using the named methods instead. For example, instead of::
11755
11756 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11757
11758 you can now write::
11759
11760 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11761
11762 This is more readable and also allows you to create wx.SizerFlags
11763 objects which can be reused for several sizer items.::
11764
11765 flagsExpand = wx.SizerFlags(1)
11766 flagsExpand.Expand().Border(wx.ALL, 10)
11767 sizer.AddF(ctrl1, flagsExpand)
11768 sizer.AddF(ctrl2, flagsExpand)
11769
11770 Note that by specification, all methods of wx.SizerFlags return the
11771 wx.SizerFlags object itself allowing chaining multiple method calls
11772 like in the examples above.
11773 """
11774 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11775 __repr__ = _swig_repr
11776 def __init__(self, *args, **kwargs):
11777 """
11778 __init__(self, int proportion=0) -> SizerFlags
11779
11780 Constructs the flags object with the specified proportion.
11781 """
11782 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11783 __swig_destroy__ = _core_.delete_SizerFlags
11784 __del__ = lambda self : None;
11785 def Proportion(*args, **kwargs):
11786 """
11787 Proportion(self, int proportion) -> SizerFlags
11788
11789 Sets the item's proportion value.
11790 """
11791 return _core_.SizerFlags_Proportion(*args, **kwargs)
11792
11793 def Align(*args, **kwargs):
11794 """
11795 Align(self, int alignment) -> SizerFlags
11796
11797 Sets the item's alignment
11798 """
11799 return _core_.SizerFlags_Align(*args, **kwargs)
11800
11801 def Expand(*args, **kwargs):
11802 """
11803 Expand(self) -> SizerFlags
11804
11805 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11806 fill as much space as it is given by the sizer.
11807 """
11808 return _core_.SizerFlags_Expand(*args, **kwargs)
11809
11810 def Centre(*args, **kwargs):
11811 """
11812 Centre(self) -> SizerFlags
11813
11814 Same as `Center` for those with an alternate dialect of English.
11815 """
11816 return _core_.SizerFlags_Centre(*args, **kwargs)
11817
11818 def Center(*args, **kwargs):
11819 """
11820 Center(self) -> SizerFlags
11821
11822 Sets the centering alignment flags.
11823 """
11824 return _core_.SizerFlags_Center(*args, **kwargs)
11825
11826 def Left(*args, **kwargs):
11827 """
11828 Left(self) -> SizerFlags
11829
11830 Aligns the object to the left, a shortcut for calling
11831 Align(wx.ALIGN_LEFT)
11832 """
11833 return _core_.SizerFlags_Left(*args, **kwargs)
11834
11835 def Right(*args, **kwargs):
11836 """
11837 Right(self) -> SizerFlags
11838
11839 Aligns the object to the right, a shortcut for calling
11840 Align(wx.ALIGN_RIGHT)
11841 """
11842 return _core_.SizerFlags_Right(*args, **kwargs)
11843
11844 def Top(*args, **kwargs):
11845 """
11846 Top(self) -> SizerFlags
11847
11848 Aligns the object to the top of the available space, a shortcut for
11849 calling Align(wx.ALIGN_TOP)
11850 """
11851 return _core_.SizerFlags_Top(*args, **kwargs)
11852
11853 def Bottom(*args, **kwargs):
11854 """
11855 Bottom(self) -> SizerFlags
11856
11857 Aligns the object to the bottom of the available space, a shortcut for
11858 calling Align(wx.ALIGN_BOTTOM)
11859 """
11860 return _core_.SizerFlags_Bottom(*args, **kwargs)
11861
11862 def Shaped(*args, **kwargs):
11863 """
11864 Shaped(self) -> SizerFlags
11865
11866 Sets the wx.SHAPED flag.
11867 """
11868 return _core_.SizerFlags_Shaped(*args, **kwargs)
11869
11870 def FixedMinSize(*args, **kwargs):
11871 """
11872 FixedMinSize(self) -> SizerFlags
11873
11874 Sets the wx.FIXED_MINSIZE flag.
11875 """
11876 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11877
11878 def Border(*args, **kwargs):
11879 """
11880 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11881
11882 Sets the border of the item in the direction(s) or sides given by the
11883 direction parameter. If the borderInPixels value is not given then
11884 the default border size (see `GetDefaultBorder`) will be used.
11885 """
11886 return _core_.SizerFlags_Border(*args, **kwargs)
11887
11888 def DoubleBorder(*args, **kwargs):
11889 """
11890 DoubleBorder(self, int direction=ALL) -> SizerFlags
11891
11892 Sets the border in the given direction to twice the default border
11893 size.
11894 """
11895 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11896
11897 def TripleBorder(*args, **kwargs):
11898 """
11899 TripleBorder(self, int direction=ALL) -> SizerFlags
11900
11901 Sets the border in the given direction to three times the default
11902 border size.
11903 """
11904 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11905
11906 def HorzBorder(*args, **kwargs):
11907 """
11908 HorzBorder(self) -> SizerFlags
11909
11910 Sets the left and right borders to the default border size.
11911 """
11912 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11913
11914 def DoubleHorzBorder(*args, **kwargs):
11915 """
11916 DoubleHorzBorder(self) -> SizerFlags
11917
11918 Sets the left and right borders to twice the default border size.
11919 """
11920 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11921
11922 def GetDefaultBorder(*args, **kwargs):
11923 """
11924 GetDefaultBorder() -> int
11925
11926 Returns the default border size used by the other border methods
11927 """
11928 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11929
11930 GetDefaultBorder = staticmethod(GetDefaultBorder)
11931 def GetProportion(*args, **kwargs):
11932 """
11933 GetProportion(self) -> int
11934
11935 Returns the proportion value to be used in the sizer item.
11936 """
11937 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11938
11939 def GetFlags(*args, **kwargs):
11940 """
11941 GetFlags(self) -> int
11942
11943 Returns the flags value to be used in the sizer item.
11944 """
11945 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11946
11947 def GetBorderInPixels(*args, **kwargs):
11948 """
11949 GetBorderInPixels(self) -> int
11950
11951 Returns the border value in pixels to be used in the sizer item.
11952 """
11953 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11954
11955 _core_.SizerFlags_swigregister(SizerFlags)
11956
11957 def SizerFlags_GetDefaultBorder(*args):
11958 """
11959 SizerFlags_GetDefaultBorder() -> int
11960
11961 Returns the default border size used by the other border methods
11962 """
11963 return _core_.SizerFlags_GetDefaultBorder(*args)
11964
11965 class SizerItem(Object):
11966 """
11967 The wx.SizerItem class is used to track the position, size and other
11968 attributes of each item managed by a `wx.Sizer`. It is not usually
11969 necessary to use this class because the sizer elements can also be
11970 identified by their positions or window or sizer references but
11971 sometimes it may be more convenient to use wx.SizerItem directly.
11972 Also, custom classes derived from `wx.PySizer` will probably need to
11973 use the collection of wx.SizerItems held by wx.Sizer when calculating
11974 layout.
11975
11976 :see: `wx.Sizer`, `wx.GBSizerItem`
11977 """
11978 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11979 __repr__ = _swig_repr
11980 def __init__(self, *args, **kwargs):
11981 """
11982 __init__(self) -> SizerItem
11983
11984 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11985 size will need to be set before this item can be used in a Sizer.
11986
11987 You will probably never need to create a wx.SizerItem directly as they
11988 are created automatically when the sizer's Add, Insert or Prepend
11989 methods are called.
11990
11991 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11992 """
11993 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11994 __swig_destroy__ = _core_.delete_SizerItem
11995 __del__ = lambda self : None;
11996 def DeleteWindows(*args, **kwargs):
11997 """
11998 DeleteWindows(self)
11999
12000 Destroy the window or the windows in a subsizer, depending on the type
12001 of item.
12002 """
12003 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
12004
12005 def DetachSizer(*args, **kwargs):
12006 """
12007 DetachSizer(self)
12008
12009 Enable deleting the SizerItem without destroying the contained sizer.
12010 """
12011 return _core_.SizerItem_DetachSizer(*args, **kwargs)
12012
12013 def GetSize(*args, **kwargs):
12014 """
12015 GetSize(self) -> Size
12016
12017 Get the current size of the item, as set in the last Layout.
12018 """
12019 return _core_.SizerItem_GetSize(*args, **kwargs)
12020
12021 def CalcMin(*args, **kwargs):
12022 """
12023 CalcMin(self) -> Size
12024
12025 Calculates the minimum desired size for the item, including any space
12026 needed by borders.
12027 """
12028 return _core_.SizerItem_CalcMin(*args, **kwargs)
12029
12030 def SetDimension(*args, **kwargs):
12031 """
12032 SetDimension(self, Point pos, Size size)
12033
12034 Set the position and size of the space allocated for this item by the
12035 sizer, and adjust the position and size of the item (window or
12036 subsizer) to be within that space taking alignment and borders into
12037 account.
12038 """
12039 return _core_.SizerItem_SetDimension(*args, **kwargs)
12040
12041 def GetMinSize(*args, **kwargs):
12042 """
12043 GetMinSize(self) -> Size
12044
12045 Get the minimum size needed for the item.
12046 """
12047 return _core_.SizerItem_GetMinSize(*args, **kwargs)
12048
12049 def GetMinSizeWithBorder(*args, **kwargs):
12050 """
12051 GetMinSizeWithBorder(self) -> Size
12052
12053 Get the minimum size needed for the item with space for the borders
12054 added, if needed.
12055 """
12056 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
12057
12058 def SetInitSize(*args, **kwargs):
12059 """SetInitSize(self, int x, int y)"""
12060 return _core_.SizerItem_SetInitSize(*args, **kwargs)
12061
12062 def SetRatioWH(*args, **kwargs):
12063 """
12064 SetRatioWH(self, int width, int height)
12065
12066 Set the ratio item attribute.
12067 """
12068 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
12069
12070 def SetRatioSize(*args, **kwargs):
12071 """
12072 SetRatioSize(self, Size size)
12073
12074 Set the ratio item attribute.
12075 """
12076 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
12077
12078 def SetRatio(*args, **kwargs):
12079 """
12080 SetRatio(self, float ratio)
12081
12082 Set the ratio item attribute.
12083 """
12084 return _core_.SizerItem_SetRatio(*args, **kwargs)
12085
12086 def GetRatio(*args, **kwargs):
12087 """
12088 GetRatio(self) -> float
12089
12090 Set the ratio item attribute.
12091 """
12092 return _core_.SizerItem_GetRatio(*args, **kwargs)
12093
12094 def GetRect(*args, **kwargs):
12095 """
12096 GetRect(self) -> Rect
12097
12098 Returns the rectangle that the sizer item should occupy
12099 """
12100 return _core_.SizerItem_GetRect(*args, **kwargs)
12101
12102 def IsWindow(*args, **kwargs):
12103 """
12104 IsWindow(self) -> bool
12105
12106 Is this sizer item a window?
12107 """
12108 return _core_.SizerItem_IsWindow(*args, **kwargs)
12109
12110 def IsSizer(*args, **kwargs):
12111 """
12112 IsSizer(self) -> bool
12113
12114 Is this sizer item a subsizer?
12115 """
12116 return _core_.SizerItem_IsSizer(*args, **kwargs)
12117
12118 def IsSpacer(*args, **kwargs):
12119 """
12120 IsSpacer(self) -> bool
12121
12122 Is this sizer item a spacer?
12123 """
12124 return _core_.SizerItem_IsSpacer(*args, **kwargs)
12125
12126 def SetProportion(*args, **kwargs):
12127 """
12128 SetProportion(self, int proportion)
12129
12130 Set the proportion value for this item.
12131 """
12132 return _core_.SizerItem_SetProportion(*args, **kwargs)
12133
12134 def GetProportion(*args, **kwargs):
12135 """
12136 GetProportion(self) -> int
12137
12138 Get the proportion value for this item.
12139 """
12140 return _core_.SizerItem_GetProportion(*args, **kwargs)
12141
12142 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12143 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
12144 def SetFlag(*args, **kwargs):
12145 """
12146 SetFlag(self, int flag)
12147
12148 Set the flag value for this item.
12149 """
12150 return _core_.SizerItem_SetFlag(*args, **kwargs)
12151
12152 def GetFlag(*args, **kwargs):
12153 """
12154 GetFlag(self) -> int
12155
12156 Get the flag value for this item.
12157 """
12158 return _core_.SizerItem_GetFlag(*args, **kwargs)
12159
12160 def SetBorder(*args, **kwargs):
12161 """
12162 SetBorder(self, int border)
12163
12164 Set the border value for this item.
12165 """
12166 return _core_.SizerItem_SetBorder(*args, **kwargs)
12167
12168 def GetBorder(*args, **kwargs):
12169 """
12170 GetBorder(self) -> int
12171
12172 Get the border value for this item.
12173 """
12174 return _core_.SizerItem_GetBorder(*args, **kwargs)
12175
12176 def GetWindow(*args, **kwargs):
12177 """
12178 GetWindow(self) -> Window
12179
12180 Get the window (if any) that is managed by this sizer item.
12181 """
12182 return _core_.SizerItem_GetWindow(*args, **kwargs)
12183
12184 def GetSizer(*args, **kwargs):
12185 """
12186 GetSizer(self) -> Sizer
12187
12188 Get the subsizer (if any) that is managed by this sizer item.
12189 """
12190 return _core_.SizerItem_GetSizer(*args, **kwargs)
12191
12192 def GetSpacer(*args, **kwargs):
12193 """
12194 GetSpacer(self) -> Size
12195
12196 Get the size of the spacer managed by this sizer item.
12197 """
12198 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12199
12200 def SetWindow(*args, **kwargs):
12201 """
12202 SetWindow(self, Window window)
12203
12204 Set the window to be managed by this sizer item.
12205 """
12206 return _core_.SizerItem_SetWindow(*args, **kwargs)
12207
12208 def SetSizer(*args, **kwargs):
12209 """
12210 SetSizer(self, Sizer sizer)
12211
12212 Set the subsizer to be managed by this sizer item.
12213 """
12214 return _core_.SizerItem_SetSizer(*args, **kwargs)
12215
12216 def SetSpacer(*args, **kwargs):
12217 """
12218 SetSpacer(self, Size size)
12219
12220 Set the size of the spacer to be managed by this sizer item.
12221 """
12222 return _core_.SizerItem_SetSpacer(*args, **kwargs)
12223
12224 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12225 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12226 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12227
12228 def AssignWindow(*args, **kwargs):
12229 """
12230 AssignWindow(self, Window window)
12231
12232 Set the window to be managed by this sizer item.
12233 """
12234 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12235
12236 def AssignSizer(*args, **kwargs):
12237 """
12238 AssignSizer(self, Sizer sizer)
12239
12240 Set the subsizer to be managed by this sizer item.
12241 """
12242 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12243
12244 def AssignSpacer(*args, **kwargs):
12245 """
12246 AssignSpacer(self, Size size)
12247
12248 Set the size of the spacer to be managed by this sizer item.
12249 """
12250 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
12251
12252 def Show(*args, **kwargs):
12253 """
12254 Show(self, bool show)
12255
12256 Set the show item attribute, which sizers use to determine if the item
12257 is to be made part of the layout or not. If the item is tracking a
12258 window then it is shown or hidden as needed.
12259 """
12260 return _core_.SizerItem_Show(*args, **kwargs)
12261
12262 def IsShown(*args, **kwargs):
12263 """
12264 IsShown(self) -> bool
12265
12266 Is the item to be shown in the layout?
12267 """
12268 return _core_.SizerItem_IsShown(*args, **kwargs)
12269
12270 def GetPosition(*args, **kwargs):
12271 """
12272 GetPosition(self) -> Point
12273
12274 Returns the current position of the item, as set in the last Layout.
12275 """
12276 return _core_.SizerItem_GetPosition(*args, **kwargs)
12277
12278 def GetUserData(*args, **kwargs):
12279 """
12280 GetUserData(self) -> PyObject
12281
12282 Returns the userData associated with this sizer item, or None if there
12283 isn't any.
12284 """
12285 return _core_.SizerItem_GetUserData(*args, **kwargs)
12286
12287 def SetUserData(*args, **kwargs):
12288 """
12289 SetUserData(self, PyObject userData)
12290
12291 Associate a Python object with this sizer item.
12292 """
12293 return _core_.SizerItem_SetUserData(*args, **kwargs)
12294
12295 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12296 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12297 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12298 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12299 Position = property(GetPosition,doc="See `GetPosition`")
12300 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12301 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12302 Rect = property(GetRect,doc="See `GetRect`")
12303 Size = property(GetSize,doc="See `GetSize`")
12304 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12305 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
12306 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
12307 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
12308 _core_.SizerItem_swigregister(SizerItem)
12309
12310 def SizerItemWindow(*args, **kwargs):
12311 """
12312 SizerItemWindow(Window window, int proportion, int flag, int border,
12313 PyObject userData=None) -> SizerItem
12314
12315 Constructs a `wx.SizerItem` for tracking a window.
12316 """
12317 val = _core_.new_SizerItemWindow(*args, **kwargs)
12318 return val
12319
12320 def SizerItemSpacer(*args, **kwargs):
12321 """
12322 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12323 PyObject userData=None) -> SizerItem
12324
12325 Constructs a `wx.SizerItem` for tracking a spacer.
12326 """
12327 val = _core_.new_SizerItemSpacer(*args, **kwargs)
12328 return val
12329
12330 def SizerItemSizer(*args, **kwargs):
12331 """
12332 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12333 PyObject userData=None) -> SizerItem
12334
12335 Constructs a `wx.SizerItem` for tracking a subsizer
12336 """
12337 val = _core_.new_SizerItemSizer(*args, **kwargs)
12338 return val
12339
12340 class Sizer(Object):
12341 """
12342 wx.Sizer is the abstract base class used for laying out subwindows in
12343 a window. You cannot use wx.Sizer directly; instead, you will have to
12344 use one of the sizer classes derived from it such as `wx.BoxSizer`,
12345 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12346 `wx.GridBagSizer`.
12347
12348 The concept implemented by sizers in wxWidgets is closely related to
12349 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12350 toolkit or the Qt toolkit. It is based upon the idea of the individual
12351 subwindows reporting their minimal required size and their ability to
12352 get stretched if the size of the parent window has changed. This will
12353 most often mean that the programmer does not set the original size of
12354 a dialog in the beginning, rather the dialog will assigned a sizer and
12355 this sizer will be queried about the recommended size. The sizer in
12356 turn will query its children, which can be normal windows or contorls,
12357 empty space or other sizers, so that a hierarchy of sizers can be
12358 constructed. Note that wxSizer does not derive from wxWindow and thus
12359 do not interfere with tab ordering and requires very little resources
12360 compared to a real window on screen.
12361
12362 What makes sizers so well fitted for use in wxWidgets is the fact that
12363 every control reports its own minimal size and the algorithm can
12364 handle differences in font sizes or different window (dialog item)
12365 sizes on different platforms without problems. If for example the
12366 standard font as well as the overall design of Mac widgets requires
12367 more space than on Windows, then the initial size of a dialog using a
12368 sizer will automatically be bigger on Mac than on Windows.
12369 """
12370 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12371 def __init__(self): raise AttributeError, "No constructor defined"
12372 __repr__ = _swig_repr
12373 __swig_destroy__ = _core_.delete_Sizer
12374 __del__ = lambda self : None;
12375 def _setOORInfo(*args, **kwargs):
12376 """_setOORInfo(self, PyObject _self)"""
12377 return _core_.Sizer__setOORInfo(*args, **kwargs)
12378
12379 def Add(*args, **kwargs):
12380 """
12381 Add(self, item, int proportion=0, int flag=0, int border=0,
12382 PyObject userData=None) -> wx.SizerItem
12383
12384 Appends a child item to the sizer.
12385 """
12386 return _core_.Sizer_Add(*args, **kwargs)
12387
12388 def AddF(*args, **kwargs):
12389 """
12390 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12391
12392 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12393 setting the various flags, options and borders.
12394 """
12395 return _core_.Sizer_AddF(*args, **kwargs)
12396
12397 def Insert(*args, **kwargs):
12398 """
12399 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
12400 PyObject userData=None) -> wx.SizerItem
12401
12402 Inserts a new item into the list of items managed by this sizer before
12403 the item at index *before*. See `Add` for a description of the parameters.
12404 """
12405 return _core_.Sizer_Insert(*args, **kwargs)
12406
12407 def InsertF(*args, **kwargs):
12408 """
12409 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12410
12411 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12412 for setting the various flags, options and borders.
12413 """
12414 return _core_.Sizer_InsertF(*args, **kwargs)
12415
12416 def Prepend(*args, **kwargs):
12417 """
12418 Prepend(self, item, int proportion=0, int flag=0, int border=0,
12419 PyObject userData=None) -> wx.SizerItem
12420
12421 Adds a new item to the begining of the list of sizer items managed by
12422 this sizer. See `Add` for a description of the parameters.
12423 """
12424 return _core_.Sizer_Prepend(*args, **kwargs)
12425
12426 def PrependF(*args, **kwargs):
12427 """
12428 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12429
12430 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12431 for setting the various flags, options and borders.
12432 """
12433 return _core_.Sizer_PrependF(*args, **kwargs)
12434
12435 def Remove(*args, **kwargs):
12436 """
12437 Remove(self, item) -> bool
12438
12439 Removes an item from the sizer and destroys it. This method does not
12440 cause any layout or resizing to take place, call `Layout` to update
12441 the layout on screen after removing a child from the sizer. The
12442 *item* parameter can be either a window, a sizer, or the zero-based
12443 index of an item to remove. Returns True if the child item was found
12444 and removed.
12445 """
12446 return _core_.Sizer_Remove(*args, **kwargs)
12447
12448 def Detach(*args, **kwargs):
12449 """
12450 Detach(self, item) -> bool
12451
12452 Detaches an item from the sizer without destroying it. This method
12453 does not cause any layout or resizing to take place, call `Layout` to
12454 do so. The *item* parameter can be either a window, a sizer, or the
12455 zero-based index of the item to be detached. Returns True if the child item
12456 was found and detached.
12457 """
12458 return _core_.Sizer_Detach(*args, **kwargs)
12459
12460 def GetItem(*args, **kwargs):
12461 """
12462 GetItem(self, item, recursive=False) -> wx.SizerItem
12463
12464 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12465 parameter can be either a window, a sizer, or the zero-based index of
12466 the item to be found.
12467 """
12468 return _core_.Sizer_GetItem(*args, **kwargs)
12469
12470 def _SetItemMinSize(*args, **kwargs):
12471 """_SetItemMinSize(self, PyObject item, Size size)"""
12472 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
12473
12474 def _ReplaceWin(*args, **kwargs):
12475 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12476 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12477
12478 def _ReplaceSizer(*args, **kwargs):
12479 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12480 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12481
12482 def _ReplaceItem(*args, **kwargs):
12483 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12484 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12485
12486 def Replace(self, olditem, item, recursive=False):
12487 """
12488 Detaches the given ``olditem`` from the sizer and replaces it with
12489 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12490 detached child is destroyed only if it is not a window, (because
12491 windows are owned by their parent, not the sizer.) The
12492 ``recursive`` parameter can be used to search for the given
12493 element recursivly in subsizers.
12494
12495 This method does not cause any layout or resizing to take place,
12496 call `Layout` to do so.
12497
12498 Returns ``True`` if the child item was found and removed.
12499 """
12500 if isinstance(olditem, wx.Window):
12501 return self._ReplaceWin(olditem, item, recursive)
12502 elif isinstance(olditem, wx.Sizer):
12503 return self._ReplaceSizer(olditem, item, recursive)
12504 elif isinstance(olditem, int):
12505 return self._ReplaceItem(olditem, item)
12506 else:
12507 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12508
12509 def SetContainingWindow(*args, **kwargs):
12510 """
12511 SetContainingWindow(self, Window window)
12512
12513 Set (or unset) the window this sizer is used in.
12514 """
12515 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12516
12517 def GetContainingWindow(*args, **kwargs):
12518 """
12519 GetContainingWindow(self) -> Window
12520
12521 Get the window this sizer is used in.
12522 """
12523 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12524
12525 def SetItemMinSize(self, item, *args):
12526 """
12527 SetItemMinSize(self, item, Size size)
12528
12529 Sets the minimum size that will be allocated for an item in the sizer.
12530 The *item* parameter can be either a window, a sizer, or the
12531 zero-based index of the item. If a window or sizer is given then it
12532 will be searched for recursivly in subsizers if neccessary.
12533 """
12534 if len(args) == 2:
12535 # for backward compatibility accept separate width,height args too
12536 return self._SetItemMinSize(item, args)
12537 else:
12538 return self._SetItemMinSize(item, args[0])
12539
12540 def AddItem(*args, **kwargs):
12541 """
12542 AddItem(self, SizerItem item)
12543
12544 Adds a `wx.SizerItem` to the sizer.
12545 """
12546 return _core_.Sizer_AddItem(*args, **kwargs)
12547
12548 def InsertItem(*args, **kwargs):
12549 """
12550 InsertItem(self, int index, SizerItem item)
12551
12552 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12553 """
12554 return _core_.Sizer_InsertItem(*args, **kwargs)
12555
12556 def PrependItem(*args, **kwargs):
12557 """
12558 PrependItem(self, SizerItem item)
12559
12560 Prepends a `wx.SizerItem` to the sizer.
12561 """
12562 return _core_.Sizer_PrependItem(*args, **kwargs)
12563
12564 def AddMany(self, items):
12565 """
12566 AddMany is a convenience method for adding several items
12567 to a sizer at one time. Simply pass it a list of tuples,
12568 where each tuple consists of the parameters that you
12569 would normally pass to the `Add` method.
12570 """
12571 for item in items:
12572 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12573 item = (item, )
12574 self.Add(*item)
12575
12576 def AddSpacer(self, *args, **kw):
12577 """AddSpacer(int size) --> SizerItem
12578
12579 Add a spacer that is (size,size) pixels.
12580 """
12581 if args and type(args[0]) == int:
12582 return self.Add( (args[0],args[0] ), 0)
12583 else: # otherwise stay compatible with old AddSpacer
12584 return self.Add(*args, **kw)
12585 def PrependSpacer(self, *args, **kw):
12586 """PrependSpacer(int size) --> SizerItem
12587
12588 Prepend a spacer that is (size, size) pixels."""
12589 if args and type(args[0]) == int:
12590 return self.Prepend( (args[0],args[0] ), 0)
12591 else: # otherwise stay compatible with old PrependSpacer
12592 return self.Prepend(*args, **kw)
12593 def InsertSpacer(self, index, *args, **kw):
12594 """InsertSpacer(int index, int size) --> SizerItem
12595
12596 Insert a spacer at position index that is (size, size) pixels."""
12597 if args and type(args[0]) == int:
12598 return self.Insert( index, (args[0],args[0] ), 0)
12599 else: # otherwise stay compatible with old InsertSpacer
12600 return self.Insert(index, *args, **kw)
12601
12602
12603 def AddStretchSpacer(self, prop=1):
12604 """AddStretchSpacer(int prop=1) --> SizerItem
12605
12606 Add a stretchable spacer."""
12607 return self.Add((0,0), prop)
12608 def PrependStretchSpacer(self, prop=1):
12609 """PrependStretchSpacer(int prop=1) --> SizerItem
12610
12611 Prepend a stretchable spacer."""
12612 return self.Prepend((0,0), prop)
12613 def InsertStretchSpacer(self, index, prop=1):
12614 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12615
12616 Insert a stretchable spacer."""
12617 return self.Insert(index, (0,0), prop)
12618
12619
12620 # for backwards compatibility only, please do not use in new code
12621 def AddWindow(self, *args, **kw):
12622 """Compatibility alias for `Add`."""
12623 return self.Add(*args, **kw)
12624 def AddSizer(self, *args, **kw):
12625 """Compatibility alias for `Add`."""
12626 return self.Add(*args, **kw)
12627
12628 def PrependWindow(self, *args, **kw):
12629 """Compatibility alias for `Prepend`."""
12630 return self.Prepend(*args, **kw)
12631 def PrependSizer(self, *args, **kw):
12632 """Compatibility alias for `Prepend`."""
12633 return self.Prepend(*args, **kw)
12634
12635 def InsertWindow(self, *args, **kw):
12636 """Compatibility alias for `Insert`."""
12637 return self.Insert(*args, **kw)
12638 def InsertSizer(self, *args, **kw):
12639 """Compatibility alias for `Insert`."""
12640 return self.Insert(*args, **kw)
12641
12642 def RemoveWindow(self, *args, **kw):
12643 """Compatibility alias for `Remove`."""
12644 return self.Remove(*args, **kw)
12645 def RemoveSizer(self, *args, **kw):
12646 """Compatibility alias for `Remove`."""
12647 return self.Remove(*args, **kw)
12648 def RemovePos(self, *args, **kw):
12649 """Compatibility alias for `Remove`."""
12650 return self.Remove(*args, **kw)
12651
12652
12653 def SetDimension(*args, **kwargs):
12654 """
12655 SetDimension(self, int x, int y, int width, int height)
12656
12657 Call this to force the sizer to take the given dimension and thus
12658 force the items owned by the sizer to resize themselves according to
12659 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12660 methods.
12661 """
12662 return _core_.Sizer_SetDimension(*args, **kwargs)
12663
12664 def SetMinSize(*args, **kwargs):
12665 """
12666 SetMinSize(self, Size size)
12667
12668 Call this to give the sizer a minimal size. Normally, the sizer will
12669 calculate its minimal size based purely on how much space its children
12670 need. After calling this method `GetMinSize` will return either the
12671 minimal size as requested by its children or the minimal size set
12672 here, depending on which is bigger.
12673 """
12674 return _core_.Sizer_SetMinSize(*args, **kwargs)
12675
12676 def GetSize(*args, **kwargs):
12677 """
12678 GetSize(self) -> Size
12679
12680 Returns the current size of the space managed by the sizer.
12681 """
12682 return _core_.Sizer_GetSize(*args, **kwargs)
12683
12684 def GetPosition(*args, **kwargs):
12685 """
12686 GetPosition(self) -> Point
12687
12688 Returns the current position of the sizer's managed space.
12689 """
12690 return _core_.Sizer_GetPosition(*args, **kwargs)
12691
12692 def GetMinSize(*args, **kwargs):
12693 """
12694 GetMinSize(self) -> Size
12695
12696 Returns the minimal size of the sizer. This is either the combined
12697 minimal size of all the children and their borders or the minimal size
12698 set by SetMinSize, depending on which is bigger.
12699 """
12700 return _core_.Sizer_GetMinSize(*args, **kwargs)
12701
12702 def GetSizeTuple(self):
12703 return self.GetSize().Get()
12704 def GetPositionTuple(self):
12705 return self.GetPosition().Get()
12706 def GetMinSizeTuple(self):
12707 return self.GetMinSize().Get()
12708
12709 def RecalcSizes(*args, **kwargs):
12710 """
12711 RecalcSizes(self)
12712
12713 Using the sizes calculated by `CalcMin` reposition and resize all the
12714 items managed by this sizer. You should not need to call this directly as
12715 it is called by `Layout`.
12716 """
12717 return _core_.Sizer_RecalcSizes(*args, **kwargs)
12718
12719 def CalcMin(*args, **kwargs):
12720 """
12721 CalcMin(self) -> Size
12722
12723 This method is where the sizer will do the actual calculation of its
12724 children's minimal sizes. You should not need to call this directly as
12725 it is called by `Layout`.
12726 """
12727 return _core_.Sizer_CalcMin(*args, **kwargs)
12728
12729 def Layout(*args, **kwargs):
12730 """
12731 Layout(self)
12732
12733 This method will force the recalculation and layout of the items
12734 controlled by the sizer using the current space allocated to the
12735 sizer. Normally this is called automatically from the owning window's
12736 EVT_SIZE handler, but it is also useful to call it from user code when
12737 one of the items in a sizer change size, or items are added or
12738 removed.
12739 """
12740 return _core_.Sizer_Layout(*args, **kwargs)
12741
12742 def Fit(*args, **kwargs):
12743 """
12744 Fit(self, Window window) -> Size
12745
12746 Tell the sizer to resize the *window* to match the sizer's minimal
12747 size. This is commonly done in the constructor of the window itself in
12748 order to set its initial size to match the needs of the children as
12749 determined by the sizer. Returns the new size.
12750
12751 For a top level window this is the total window size, not the client size.
12752 """
12753 return _core_.Sizer_Fit(*args, **kwargs)
12754
12755 def FitInside(*args, **kwargs):
12756 """
12757 FitInside(self, Window window)
12758
12759 Tell the sizer to resize the *virtual size* of the *window* to match the
12760 sizer's minimal size. This will not alter the on screen size of the
12761 window, but may cause the addition/removal/alteration of scrollbars
12762 required to view the virtual area in windows which manage it.
12763
12764 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12765
12766 """
12767 return _core_.Sizer_FitInside(*args, **kwargs)
12768
12769 def SetSizeHints(*args, **kwargs):
12770 """
12771 SetSizeHints(self, Window window)
12772
12773 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12774 match the sizer's minimal size. This is commonly done in the
12775 constructor of the window itself if the window is resizable (as are
12776 many dialogs under Unix and frames on probably all platforms) in order
12777 to prevent the window from being sized smaller than the minimal size
12778 required by the sizer.
12779 """
12780 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12781
12782 def SetVirtualSizeHints(*args, **kwargs):
12783 """
12784 SetVirtualSizeHints(self, Window window)
12785
12786 Tell the sizer to set the minimal size of the window virtual area to
12787 match the sizer's minimal size. For windows with managed scrollbars
12788 this will set them appropriately.
12789
12790 :see: `wx.ScrolledWindow.SetScrollbars`
12791
12792 """
12793 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12794
12795 def Clear(*args, **kwargs):
12796 """
12797 Clear(self, bool deleteWindows=False)
12798
12799 Clear all items from the sizer, optionally destroying the window items
12800 as well.
12801 """
12802 return _core_.Sizer_Clear(*args, **kwargs)
12803
12804 def DeleteWindows(*args, **kwargs):
12805 """
12806 DeleteWindows(self)
12807
12808 Destroy all windows managed by the sizer.
12809 """
12810 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12811
12812 def GetChildren(*args, **kwargs):
12813 """
12814 GetChildren(self) -> list
12815
12816 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12817 """
12818 return _core_.Sizer_GetChildren(*args, **kwargs)
12819
12820 def Show(*args, **kwargs):
12821 """
12822 Show(self, item, bool show=True, bool recursive=false) -> bool
12823
12824 Shows or hides an item managed by the sizer. To make a sizer item
12825 disappear or reappear, use Show followed by `Layout`. The *item*
12826 parameter can be either a window, a sizer, or the zero-based index of
12827 the item. Use the recursive parameter to show or hide an item in a
12828 subsizer. Returns True if the item was found.
12829 """
12830 return _core_.Sizer_Show(*args, **kwargs)
12831
12832 def IsShown(*args, **kwargs):
12833 """
12834 IsShown(self, item)
12835
12836 Determines if the item is currently shown. To make a sizer
12837 item disappear or reappear, use Show followed by `Layout`. The *item*
12838 parameter can be either a window, a sizer, or the zero-based index of
12839 the item.
12840 """
12841 return _core_.Sizer_IsShown(*args, **kwargs)
12842
12843 def Hide(self, item, recursive=False):
12844 """
12845 A convenience method for `Show` (item, False, recursive).
12846 """
12847 return self.Show(item, False, recursive)
12848
12849 def ShowItems(*args, **kwargs):
12850 """
12851 ShowItems(self, bool show)
12852
12853 Recursively call `wx.SizerItem.Show` on all sizer items.
12854 """
12855 return _core_.Sizer_ShowItems(*args, **kwargs)
12856
12857 Children = property(GetChildren,doc="See `GetChildren`")
12858 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12859 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12860 Position = property(GetPosition,doc="See `GetPosition`")
12861 Size = property(GetSize,doc="See `GetSize`")
12862 _core_.Sizer_swigregister(Sizer)
12863
12864 class PySizer(Sizer):
12865 """
12866 wx.PySizer is a special version of `wx.Sizer` that has been
12867 instrumented to allow the C++ virtual methods to be overloaded in
12868 Python derived classes. You would derive from this class if you are
12869 wanting to implement a custom sizer in Python code. Simply implement
12870 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12871 For example::
12872
12873 class MySizer(wx.PySizer):
12874 def __init__(self):
12875 wx.PySizer.__init__(self)
12876
12877 def CalcMin(self):
12878 for item in self.GetChildren():
12879 # calculate the total minimum width and height needed
12880 # by all items in the sizer according to this sizer's
12881 # layout algorithm.
12882 ...
12883 return wx.Size(width, height)
12884
12885 def RecalcSizes(self):
12886 # find the space allotted to this sizer
12887 pos = self.GetPosition()
12888 size = self.GetSize()
12889 for item in self.GetChildren():
12890 # Recalculate (if necessary) the position and size of
12891 # each item and then call item.SetDimension to do the
12892 # actual positioning and sizing of the items within the
12893 # space alloted to this sizer.
12894 ...
12895 item.SetDimension(itemPos, itemSize)
12896
12897
12898 When `Layout` is called it first calls `CalcMin` followed by
12899 `RecalcSizes` so you can optimize a bit by saving the results of
12900 `CalcMin` and reusing them in `RecalcSizes`.
12901
12902 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12903
12904
12905 """
12906 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12907 __repr__ = _swig_repr
12908 def __init__(self, *args, **kwargs):
12909 """
12910 __init__(self) -> PySizer
12911
12912 Creates a wx.PySizer. Must be called from the __init__ in the derived
12913 class.
12914 """
12915 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
12916 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
12917
12918 def _setCallbackInfo(*args, **kwargs):
12919 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12920 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12921
12922 _core_.PySizer_swigregister(PySizer)
12923
12924 #---------------------------------------------------------------------------
12925
12926 class BoxSizer(Sizer):
12927 """
12928 The basic idea behind a box sizer is that windows will most often be
12929 laid out in rather simple basic geometry, typically in a row or a
12930 column or nested hierarchies of either. A wx.BoxSizer will lay out
12931 its items in a simple row or column, depending on the orientation
12932 parameter passed to the constructor.
12933 """
12934 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12935 __repr__ = _swig_repr
12936 def __init__(self, *args, **kwargs):
12937 """
12938 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12939
12940 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12941 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12942 sizer.
12943 """
12944 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
12945 self._setOORInfo(self)
12946
12947 def GetOrientation(*args, **kwargs):
12948 """
12949 GetOrientation(self) -> int
12950
12951 Returns the current orientation of the sizer.
12952 """
12953 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12954
12955 def SetOrientation(*args, **kwargs):
12956 """
12957 SetOrientation(self, int orient)
12958
12959 Resets the orientation of the sizer.
12960 """
12961 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
12962
12963 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
12964 _core_.BoxSizer_swigregister(BoxSizer)
12965
12966 #---------------------------------------------------------------------------
12967
12968 class StaticBoxSizer(BoxSizer):
12969 """
12970 wx.StaticBoxSizer derives from and functions identically to the
12971 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12972 manages. Note that this static box must be created separately and
12973 passed to the sizer constructor.
12974 """
12975 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12976 __repr__ = _swig_repr
12977 def __init__(self, *args, **kwargs):
12978 """
12979 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12980
12981 Constructor. It takes an associated static box and the orientation
12982 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12983 ``wx.HORIZONTAL``.
12984 """
12985 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
12986 self._setOORInfo(self)
12987
12988 def GetStaticBox(*args, **kwargs):
12989 """
12990 GetStaticBox(self) -> StaticBox
12991
12992 Returns the static box associated with this sizer.
12993 """
12994 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
12995
12996 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
12997 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
12998
12999 #---------------------------------------------------------------------------
13000
13001 class GridSizer(Sizer):
13002 """
13003 A grid sizer is a sizer which lays out its children in a
13004 two-dimensional table with all cells having the same size. In other
13005 words, the width of each cell within the grid is the width of the
13006 widest item added to the sizer and the height of each grid cell is the
13007 height of the tallest item. An optional vertical and/or horizontal
13008 gap between items can also be specified (in pixels.)
13009
13010 Items are placed in the cells of the grid in the order they are added,
13011 in row-major order. In other words, the first row is filled first,
13012 then the second, and so on until all items have been added. (If
13013 neccessary, additional rows will be added as items are added.) If you
13014 need to have greater control over the cells that items are placed in
13015 then use the `wx.GridBagSizer`.
13016
13017 """
13018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13019 __repr__ = _swig_repr
13020 def __init__(self, *args, **kwargs):
13021 """
13022 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
13023
13024 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
13025 of columns and rows in the sizer - if either of the parameters is
13026 zero, it will be calculated to from the total number of children in
13027 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13028 define extra space between all children.
13029 """
13030 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
13031 self._setOORInfo(self)
13032
13033 def SetCols(*args, **kwargs):
13034 """
13035 SetCols(self, int cols)
13036
13037 Sets the number of columns in the sizer.
13038 """
13039 return _core_.GridSizer_SetCols(*args, **kwargs)
13040
13041 def SetRows(*args, **kwargs):
13042 """
13043 SetRows(self, int rows)
13044
13045 Sets the number of rows in the sizer.
13046 """
13047 return _core_.GridSizer_SetRows(*args, **kwargs)
13048
13049 def SetVGap(*args, **kwargs):
13050 """
13051 SetVGap(self, int gap)
13052
13053 Sets the vertical gap (in pixels) between the cells in the sizer.
13054 """
13055 return _core_.GridSizer_SetVGap(*args, **kwargs)
13056
13057 def SetHGap(*args, **kwargs):
13058 """
13059 SetHGap(self, int gap)
13060
13061 Sets the horizontal gap (in pixels) between cells in the sizer
13062 """
13063 return _core_.GridSizer_SetHGap(*args, **kwargs)
13064
13065 def GetCols(*args, **kwargs):
13066 """
13067 GetCols(self) -> int
13068
13069 Returns the number of columns in the sizer.
13070 """
13071 return _core_.GridSizer_GetCols(*args, **kwargs)
13072
13073 def GetRows(*args, **kwargs):
13074 """
13075 GetRows(self) -> int
13076
13077 Returns the number of rows in the sizer.
13078 """
13079 return _core_.GridSizer_GetRows(*args, **kwargs)
13080
13081 def GetVGap(*args, **kwargs):
13082 """
13083 GetVGap(self) -> int
13084
13085 Returns the vertical gap (in pixels) between the cells in the sizer.
13086 """
13087 return _core_.GridSizer_GetVGap(*args, **kwargs)
13088
13089 def GetHGap(*args, **kwargs):
13090 """
13091 GetHGap(self) -> int
13092
13093 Returns the horizontal gap (in pixels) between cells in the sizer.
13094 """
13095 return _core_.GridSizer_GetHGap(*args, **kwargs)
13096
13097 def CalcRowsCols(self):
13098 """
13099 CalcRowsCols() -> (rows, cols)
13100
13101 Calculates how many rows and columns will be in the sizer based
13102 on the current number of items and also the rows, cols specified
13103 in the constructor.
13104 """
13105 nitems = len(self.GetChildren())
13106 rows = self.GetRows()
13107 cols = self.GetCols()
13108 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13109 if cols != 0:
13110 rows = (nitems + cols - 1) / cols
13111 elif rows != 0:
13112 cols = (nitems + rows - 1) / rows
13113 return (rows, cols)
13114
13115 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13116 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13117 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13118 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
13119 _core_.GridSizer_swigregister(GridSizer)
13120
13121 #---------------------------------------------------------------------------
13122
13123 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13124 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13125 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
13126 class FlexGridSizer(GridSizer):
13127 """
13128 A flex grid sizer is a sizer which lays out its children in a
13129 two-dimensional table with all table cells in one row having the same
13130 height and all cells in one column having the same width, but all
13131 rows or all columns are not necessarily the same height or width as in
13132 the `wx.GridSizer`.
13133
13134 wx.FlexGridSizer can also size items equally in one direction but
13135 unequally ("flexibly") in the other. If the sizer is only flexible
13136 in one direction (this can be changed using `SetFlexibleDirection`), it
13137 needs to be decided how the sizer should grow in the other ("non
13138 flexible") direction in order to fill the available space. The
13139 `SetNonFlexibleGrowMode` method serves this purpose.
13140
13141
13142 """
13143 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13144 __repr__ = _swig_repr
13145 def __init__(self, *args, **kwargs):
13146 """
13147 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13148
13149 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13150 number of columns and rows in the sizer - if either of the parameters
13151 is zero, it will be calculated to from the total number of children in
13152 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13153 define extra space between all children.
13154 """
13155 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
13156 self._setOORInfo(self)
13157
13158 def AddGrowableRow(*args, **kwargs):
13159 """
13160 AddGrowableRow(self, size_t idx, int proportion=0)
13161
13162 Specifies that row *idx* (starting from zero) should be grown if there
13163 is extra space available to the sizer.
13164
13165 The *proportion* parameter has the same meaning as the stretch factor
13166 for the box sizers except that if all proportions are 0, then all
13167 columns are resized equally (instead of not being resized at all).
13168 """
13169 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
13170
13171 def RemoveGrowableRow(*args, **kwargs):
13172 """
13173 RemoveGrowableRow(self, size_t idx)
13174
13175 Specifies that row *idx* is no longer growable.
13176 """
13177 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
13178
13179 def AddGrowableCol(*args, **kwargs):
13180 """
13181 AddGrowableCol(self, size_t idx, int proportion=0)
13182
13183 Specifies that column *idx* (starting from zero) should be grown if
13184 there is extra space available to the sizer.
13185
13186 The *proportion* parameter has the same meaning as the stretch factor
13187 for the box sizers except that if all proportions are 0, then all
13188 columns are resized equally (instead of not being resized at all).
13189 """
13190 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
13191
13192 def RemoveGrowableCol(*args, **kwargs):
13193 """
13194 RemoveGrowableCol(self, size_t idx)
13195
13196 Specifies that column *idx* is no longer growable.
13197 """
13198 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
13199
13200 def SetFlexibleDirection(*args, **kwargs):
13201 """
13202 SetFlexibleDirection(self, int direction)
13203
13204 Specifies whether the sizer should flexibly resize its columns, rows,
13205 or both. Argument *direction* can be one of the following values. Any
13206 other value is ignored.
13207
13208 ============== =======================================
13209 wx.VERTICAL Rows are flexibly sized.
13210 wx.HORIZONTAL Columns are flexibly sized.
13211 wx.BOTH Both rows and columns are flexibly sized
13212 (this is the default value).
13213 ============== =======================================
13214
13215 Note that this method does not trigger relayout.
13216
13217 """
13218 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
13219
13220 def GetFlexibleDirection(*args, **kwargs):
13221 """
13222 GetFlexibleDirection(self) -> int
13223
13224 Returns a value that specifies whether the sizer
13225 flexibly resizes its columns, rows, or both (default).
13226
13227 :see: `SetFlexibleDirection`
13228 """
13229 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
13230
13231 def SetNonFlexibleGrowMode(*args, **kwargs):
13232 """
13233 SetNonFlexibleGrowMode(self, int mode)
13234
13235 Specifies how the sizer should grow in the non-flexible direction if
13236 there is one (so `SetFlexibleDirection` must have been called
13237 previously). Argument *mode* can be one of the following values:
13238
13239 ========================== =================================================
13240 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13241 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13242 `AddGrowableCol` and `AddGrowableRow`. In this
13243 case equal sizing applies to minimum sizes of
13244 columns or rows (this is the default value).
13245 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13246 the non flexible direction, whether they are
13247 growable or not in the flexbile direction.
13248 ========================== =================================================
13249
13250 Note that this method does not trigger relayout.
13251 """
13252 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
13253
13254 def GetNonFlexibleGrowMode(*args, **kwargs):
13255 """
13256 GetNonFlexibleGrowMode(self) -> int
13257
13258 Returns the value that specifies how the sizer grows in the
13259 non-flexible direction if there is one.
13260
13261 :see: `SetNonFlexibleGrowMode`
13262 """
13263 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
13264
13265 def GetRowHeights(*args, **kwargs):
13266 """
13267 GetRowHeights(self) -> list
13268
13269 Returns a list of integers representing the heights of each of the
13270 rows in the sizer.
13271 """
13272 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
13273
13274 def GetColWidths(*args, **kwargs):
13275 """
13276 GetColWidths(self) -> list
13277
13278 Returns a list of integers representing the widths of each of the
13279 columns in the sizer.
13280 """
13281 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
13282
13283 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13284 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13285 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13286 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
13287 _core_.FlexGridSizer_swigregister(FlexGridSizer)
13288
13289 class StdDialogButtonSizer(BoxSizer):
13290 """
13291 A special sizer that knows how to order and position standard buttons
13292 in order to conform to the current platform's standards. You simply
13293 need to add each `wx.Button` to the sizer, and be sure to create the
13294 buttons using the standard ID's. Then call `Realize` and the sizer
13295 will take care of the rest.
13296
13297 """
13298 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13299 __repr__ = _swig_repr
13300 def __init__(self, *args, **kwargs):
13301 """__init__(self) -> StdDialogButtonSizer"""
13302 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
13303 def AddButton(*args, **kwargs):
13304 """
13305 AddButton(self, wxButton button)
13306
13307 Use this to add the buttons to this sizer. Do not use the `Add`
13308 method in the base class.
13309 """
13310 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
13311
13312 def Realize(*args, **kwargs):
13313 """
13314 Realize(self)
13315
13316 This funciton needs to be called after all the buttons have been added
13317 to the sizer. It will reorder them and position them in a platform
13318 specifc manner.
13319 """
13320 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
13321
13322 def SetAffirmativeButton(*args, **kwargs):
13323 """SetAffirmativeButton(self, wxButton button)"""
13324 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
13325
13326 def SetNegativeButton(*args, **kwargs):
13327 """SetNegativeButton(self, wxButton button)"""
13328 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
13329
13330 def SetCancelButton(*args, **kwargs):
13331 """SetCancelButton(self, wxButton button)"""
13332 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
13333
13334 def GetAffirmativeButton(*args, **kwargs):
13335 """GetAffirmativeButton(self) -> wxButton"""
13336 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
13337
13338 def GetApplyButton(*args, **kwargs):
13339 """GetApplyButton(self) -> wxButton"""
13340 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
13341
13342 def GetNegativeButton(*args, **kwargs):
13343 """GetNegativeButton(self) -> wxButton"""
13344 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
13345
13346 def GetCancelButton(*args, **kwargs):
13347 """GetCancelButton(self) -> wxButton"""
13348 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
13349
13350 def GetHelpButton(*args, **kwargs):
13351 """GetHelpButton(self) -> wxButton"""
13352 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
13353
13354 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13355 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13356 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13357 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13358 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
13359 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
13360
13361 #---------------------------------------------------------------------------
13362
13363 class GBPosition(object):
13364 """
13365 This class represents the position of an item in a virtual grid of
13366 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13367 typemaps that will automatically convert from a 2-element sequence of
13368 integers to a wx.GBPosition, so you can use the more pythonic
13369 representation of the position nearly transparently in Python code.
13370 """
13371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13372 __repr__ = _swig_repr
13373 def __init__(self, *args, **kwargs):
13374 """
13375 __init__(self, int row=0, int col=0) -> GBPosition
13376
13377 This class represents the position of an item in a virtual grid of
13378 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13379 typemaps that will automatically convert from a 2-element sequence of
13380 integers to a wx.GBPosition, so you can use the more pythonic
13381 representation of the position nearly transparently in Python code.
13382 """
13383 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13384 __swig_destroy__ = _core_.delete_GBPosition
13385 __del__ = lambda self : None;
13386 def GetRow(*args, **kwargs):
13387 """GetRow(self) -> int"""
13388 return _core_.GBPosition_GetRow(*args, **kwargs)
13389
13390 def GetCol(*args, **kwargs):
13391 """GetCol(self) -> int"""
13392 return _core_.GBPosition_GetCol(*args, **kwargs)
13393
13394 def SetRow(*args, **kwargs):
13395 """SetRow(self, int row)"""
13396 return _core_.GBPosition_SetRow(*args, **kwargs)
13397
13398 def SetCol(*args, **kwargs):
13399 """SetCol(self, int col)"""
13400 return _core_.GBPosition_SetCol(*args, **kwargs)
13401
13402 def __eq__(*args, **kwargs):
13403 """
13404 __eq__(self, PyObject other) -> bool
13405
13406 Compare GBPosition for equality.
13407 """
13408 return _core_.GBPosition___eq__(*args, **kwargs)
13409
13410 def __ne__(*args, **kwargs):
13411 """
13412 __ne__(self, PyObject other) -> bool
13413
13414 Compare GBPosition for inequality.
13415 """
13416 return _core_.GBPosition___ne__(*args, **kwargs)
13417
13418 def Set(*args, **kwargs):
13419 """Set(self, int row=0, int col=0)"""
13420 return _core_.GBPosition_Set(*args, **kwargs)
13421
13422 def Get(*args, **kwargs):
13423 """Get(self) -> PyObject"""
13424 return _core_.GBPosition_Get(*args, **kwargs)
13425
13426 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
13427 def __str__(self): return str(self.Get())
13428 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13429 def __len__(self): return len(self.Get())
13430 def __getitem__(self, index): return self.Get()[index]
13431 def __setitem__(self, index, val):
13432 if index == 0: self.SetRow(val)
13433 elif index == 1: self.SetCol(val)
13434 else: raise IndexError
13435 def __nonzero__(self): return self.Get() != (0,0)
13436 __safe_for_unpickling__ = True
13437 def __reduce__(self): return (wx.GBPosition, self.Get())
13438
13439 row = property(GetRow, SetRow)
13440 col = property(GetCol, SetCol)
13441
13442 _core_.GBPosition_swigregister(GBPosition)
13443
13444 class GBSpan(object):
13445 """
13446 This class is used to hold the row and column spanning attributes of
13447 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13448 automatically convert from a 2-element sequence of integers to a
13449 wx.GBSpan, so you can use the more pythonic representation of the span
13450 nearly transparently in Python code.
13451
13452 """
13453 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13454 __repr__ = _swig_repr
13455 def __init__(self, *args, **kwargs):
13456 """
13457 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13458
13459 Construct a new wxGBSpan, optionally setting the rowspan and
13460 colspan. The default is (1,1). (Meaning that the item occupies one
13461 cell in each direction.
13462 """
13463 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13464 __swig_destroy__ = _core_.delete_GBSpan
13465 __del__ = lambda self : None;
13466 def GetRowspan(*args, **kwargs):
13467 """GetRowspan(self) -> int"""
13468 return _core_.GBSpan_GetRowspan(*args, **kwargs)
13469
13470 def GetColspan(*args, **kwargs):
13471 """GetColspan(self) -> int"""
13472 return _core_.GBSpan_GetColspan(*args, **kwargs)
13473
13474 def SetRowspan(*args, **kwargs):
13475 """SetRowspan(self, int rowspan)"""
13476 return _core_.GBSpan_SetRowspan(*args, **kwargs)
13477
13478 def SetColspan(*args, **kwargs):
13479 """SetColspan(self, int colspan)"""
13480 return _core_.GBSpan_SetColspan(*args, **kwargs)
13481
13482 def __eq__(*args, **kwargs):
13483 """
13484 __eq__(self, PyObject other) -> bool
13485
13486 Compare wxGBSpan for equality.
13487 """
13488 return _core_.GBSpan___eq__(*args, **kwargs)
13489
13490 def __ne__(*args, **kwargs):
13491 """
13492 __ne__(self, PyObject other) -> bool
13493
13494 Compare GBSpan for inequality.
13495 """
13496 return _core_.GBSpan___ne__(*args, **kwargs)
13497
13498 def Set(*args, **kwargs):
13499 """Set(self, int rowspan=1, int colspan=1)"""
13500 return _core_.GBSpan_Set(*args, **kwargs)
13501
13502 def Get(*args, **kwargs):
13503 """Get(self) -> PyObject"""
13504 return _core_.GBSpan_Get(*args, **kwargs)
13505
13506 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
13507 def __str__(self): return str(self.Get())
13508 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13509 def __len__(self): return len(self.Get())
13510 def __getitem__(self, index): return self.Get()[index]
13511 def __setitem__(self, index, val):
13512 if index == 0: self.SetRowspan(val)
13513 elif index == 1: self.SetColspan(val)
13514 else: raise IndexError
13515 def __nonzero__(self): return self.Get() != (0,0)
13516 __safe_for_unpickling__ = True
13517 def __reduce__(self): return (wx.GBSpan, self.Get())
13518
13519 rowspan = property(GetRowspan, SetRowspan)
13520 colspan = property(GetColspan, SetColspan)
13521
13522 _core_.GBSpan_swigregister(GBSpan)
13523
13524 class GBSizerItem(SizerItem):
13525 """
13526 The wx.GBSizerItem class is used to track the additional data about
13527 items in a `wx.GridBagSizer` such as the item's position in the grid
13528 and how many rows or columns it spans.
13529
13530 """
13531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13532 __repr__ = _swig_repr
13533 def __init__(self, *args, **kwargs):
13534 """
13535 __init__(self) -> GBSizerItem
13536
13537 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13538 size will need to be set, as well as a position and span before this
13539 item can be used in a Sizer.
13540
13541 You will probably never need to create a wx.GBSizerItem directly as they
13542 are created automatically when the sizer's Add method is called.
13543 """
13544 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13545 __swig_destroy__ = _core_.delete_GBSizerItem
13546 __del__ = lambda self : None;
13547 def GetPos(*args, **kwargs):
13548 """
13549 GetPos(self) -> GBPosition
13550
13551 Get the grid position of the item
13552 """
13553 return _core_.GBSizerItem_GetPos(*args, **kwargs)
13554
13555 def GetPosTuple(self): return self.GetPos().Get()
13556 def GetSpan(*args, **kwargs):
13557 """
13558 GetSpan(self) -> GBSpan
13559
13560 Get the row and column spanning of the item
13561 """
13562 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
13563
13564 def GetSpanTuple(self): return self.GetSpan().Get()
13565 def SetPos(*args, **kwargs):
13566 """
13567 SetPos(self, GBPosition pos) -> bool
13568
13569 If the item is already a member of a sizer then first ensure that
13570 there is no other item that would intersect with this one at the new
13571 position, then set the new position. Returns True if the change is
13572 successful and after the next Layout() the item will be moved.
13573 """
13574 return _core_.GBSizerItem_SetPos(*args, **kwargs)
13575
13576 def SetSpan(*args, **kwargs):
13577 """
13578 SetSpan(self, GBSpan span) -> bool
13579
13580 If the item is already a member of a sizer then first ensure that
13581 there is no other item that would intersect with this one with its new
13582 spanning size, then set the new spanning. Returns True if the change
13583 is successful and after the next Layout() the item will be resized.
13584
13585 """
13586 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
13587
13588 def Intersects(*args, **kwargs):
13589 """
13590 Intersects(self, GBSizerItem other) -> bool
13591
13592 Returns True if this item and the other item instersect.
13593 """
13594 return _core_.GBSizerItem_Intersects(*args, **kwargs)
13595
13596 def IntersectsPos(*args, **kwargs):
13597 """
13598 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13599
13600 Returns True if the given pos/span would intersect with this item.
13601 """
13602 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
13603
13604 def GetEndPos(*args, **kwargs):
13605 """
13606 GetEndPos(self) -> GBPosition
13607
13608 Get the row and column of the endpoint of this item.
13609 """
13610 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
13611
13612 def GetGBSizer(*args, **kwargs):
13613 """
13614 GetGBSizer(self) -> GridBagSizer
13615
13616 Get the sizer this item is a member of.
13617 """
13618 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
13619
13620 def SetGBSizer(*args, **kwargs):
13621 """
13622 SetGBSizer(self, GridBagSizer sizer)
13623
13624 Set the sizer this item is a member of.
13625 """
13626 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
13627
13628 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13629 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13630 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13631 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
13632 _core_.GBSizerItem_swigregister(GBSizerItem)
13633 DefaultSpan = cvar.DefaultSpan
13634
13635 def GBSizerItemWindow(*args, **kwargs):
13636 """
13637 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13638 int border, PyObject userData=None) -> GBSizerItem
13639
13640 Construct a `wx.GBSizerItem` for a window.
13641 """
13642 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
13643 return val
13644
13645 def GBSizerItemSizer(*args, **kwargs):
13646 """
13647 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13648 int border, PyObject userData=None) -> GBSizerItem
13649
13650 Construct a `wx.GBSizerItem` for a sizer
13651 """
13652 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
13653 return val
13654
13655 def GBSizerItemSpacer(*args, **kwargs):
13656 """
13657 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13658 int flag, int border, PyObject userData=None) -> GBSizerItem
13659
13660 Construct a `wx.GBSizerItem` for a spacer.
13661 """
13662 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
13663 return val
13664
13665 class GridBagSizer(FlexGridSizer):
13666 """
13667 A `wx.Sizer` that can lay out items in a virtual grid like a
13668 `wx.FlexGridSizer` but in this case explicit positioning of the items
13669 is allowed using `wx.GBPosition`, and items can optionally span more
13670 than one row and/or column using `wx.GBSpan`. The total size of the
13671 virtual grid is determined by the largest row and column that items are
13672 positioned at, adjusted for spanning.
13673
13674 """
13675 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13676 __repr__ = _swig_repr
13677 def __init__(self, *args, **kwargs):
13678 """
13679 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13680
13681 Constructor, with optional parameters to specify the gap between the
13682 rows and columns.
13683 """
13684 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
13685 self._setOORInfo(self)
13686
13687 def Add(*args, **kwargs):
13688 """
13689 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
13690 int border=0, userData=None) -> wx.GBSizerItem
13691
13692 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13693 more than one row or column as specified with *span*. The remaining
13694 args behave similarly to `wx.Sizer.Add`.
13695
13696 Returns True if the item was successfully placed at the given cell
13697 position, False if something was already there.
13698
13699 """
13700 return _core_.GridBagSizer_Add(*args, **kwargs)
13701
13702 def AddItem(*args, **kwargs):
13703 """
13704 Add(self, GBSizerItem item) -> wx.GBSizerItem
13705
13706 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13707 the item was successfully placed at its given cell position, False if
13708 something was already there.
13709 """
13710 return _core_.GridBagSizer_AddItem(*args, **kwargs)
13711
13712 def GetCellSize(*args, **kwargs):
13713 """
13714 GetCellSize(self, int row, int col) -> Size
13715
13716 Get the size of the specified cell, including hgap and
13717 vgap. Only valid after a Layout.
13718 """
13719 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13720
13721 def GetEmptyCellSize(*args, **kwargs):
13722 """
13723 GetEmptyCellSize(self) -> Size
13724
13725 Get the size used for cells in the grid with no item.
13726 """
13727 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
13728
13729 def SetEmptyCellSize(*args, **kwargs):
13730 """
13731 SetEmptyCellSize(self, Size sz)
13732
13733 Set the size used for cells in the grid with no item.
13734 """
13735 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
13736
13737 def GetItemPosition(*args):
13738 """
13739 GetItemPosition(self, item) -> GBPosition
13740
13741 Get the grid position of the specified *item* where *item* is either a
13742 window or subsizer that is a member of this sizer, or a zero-based
13743 index of an item.
13744 """
13745 return _core_.GridBagSizer_GetItemPosition(*args)
13746
13747 def SetItemPosition(*args):
13748 """
13749 SetItemPosition(self, item, GBPosition pos) -> bool
13750
13751 Set the grid position of the specified *item* where *item* is either a
13752 window or subsizer that is a member of this sizer, or a zero-based
13753 index of an item. Returns True on success. If the move is not
13754 allowed (because an item is already there) then False is returned.
13755
13756 """
13757 return _core_.GridBagSizer_SetItemPosition(*args)
13758
13759 def GetItemSpan(*args):
13760 """
13761 GetItemSpan(self, item) -> GBSpan
13762
13763 Get the row/col spanning of the specified *item* where *item* is
13764 either a window or subsizer that is a member of this sizer, or a
13765 zero-based index of an item.
13766 """
13767 return _core_.GridBagSizer_GetItemSpan(*args)
13768
13769 def SetItemSpan(*args):
13770 """
13771 SetItemSpan(self, item, GBSpan span) -> bool
13772
13773 Set the row/col spanning of the specified *item* where *item* is
13774 either a window or subsizer that is a member of this sizer, or a
13775 zero-based index of an item. Returns True on success. If the move is
13776 not allowed (because an item is already there) then False is returned.
13777 """
13778 return _core_.GridBagSizer_SetItemSpan(*args)
13779
13780 def FindItem(*args):
13781 """
13782 FindItem(self, item) -> GBSizerItem
13783
13784 Find the sizer item for the given window or subsizer, returns None if
13785 not found. (non-recursive)
13786 """
13787 return _core_.GridBagSizer_FindItem(*args)
13788
13789 def GetItem(self, item):
13790 gbsi = None
13791 si = wx.FlexGridSizer.GetItem(self, item)
13792 if not si:
13793 return None
13794 if type(item) is not int:
13795 gbsi = self.FindItem(item)
13796 if gbsi: return gbsi
13797 return si
13798
13799 def FindItemAtPosition(*args, **kwargs):
13800 """
13801 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13802
13803 Return the sizer item for the given grid cell, or None if there is no
13804 item at that position. (non-recursive)
13805 """
13806 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13807
13808 def FindItemAtPoint(*args, **kwargs):
13809 """
13810 FindItemAtPoint(self, Point pt) -> GBSizerItem
13811
13812 Return the sizer item located at the point given in *pt*, or None if
13813 there is no item at that point. The (x,y) coordinates in pt correspond
13814 to the client coordinates of the window using the sizer for
13815 layout. (non-recursive)
13816 """
13817 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13818
13819 def CheckForIntersection(*args, **kwargs):
13820 """
13821 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13822
13823 Look at all items and see if any intersect (or would overlap) the
13824 given *item*. Returns True if so, False if there would be no overlap.
13825 If an *excludeItem* is given then it will not be checked for
13826 intersection, for example it may be the item we are checking the
13827 position of.
13828
13829 """
13830 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
13831
13832 def CheckForIntersectionPos(*args, **kwargs):
13833 """
13834 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13835
13836 Look at all items and see if any intersect (or would overlap) the
13837 given position and span. Returns True if so, False if there would be
13838 no overlap. If an *excludeItem* is given then it will not be checked
13839 for intersection, for example it may be the item we are checking the
13840 position of.
13841 """
13842 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
13843
13844 _core_.GridBagSizer_swigregister(GridBagSizer)
13845
13846 #---------------------------------------------------------------------------
13847
13848 Left = _core_.Left
13849 Top = _core_.Top
13850 Right = _core_.Right
13851 Bottom = _core_.Bottom
13852 Width = _core_.Width
13853 Height = _core_.Height
13854 Centre = _core_.Centre
13855 Center = _core_.Center
13856 CentreX = _core_.CentreX
13857 CentreY = _core_.CentreY
13858 Unconstrained = _core_.Unconstrained
13859 AsIs = _core_.AsIs
13860 PercentOf = _core_.PercentOf
13861 Above = _core_.Above
13862 Below = _core_.Below
13863 LeftOf = _core_.LeftOf
13864 RightOf = _core_.RightOf
13865 SameAs = _core_.SameAs
13866 Absolute = _core_.Absolute
13867 class IndividualLayoutConstraint(Object):
13868 """
13869 Objects of this class are stored in the `wx.LayoutConstraints` class as
13870 one of eight possible constraints that a window can be involved in.
13871 You will never need to create an instance of
13872 wx.IndividualLayoutConstraint, rather you should create a
13873 `wx.LayoutConstraints` instance and use the individual contstraints
13874 that it contains.
13875 """
13876 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13877 def __init__(self): raise AttributeError, "No constructor defined"
13878 __repr__ = _swig_repr
13879 def Set(*args, **kwargs):
13880 """
13881 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13882
13883 Sets the properties of the constraint. Normally called by one of the
13884 convenience functions such as Above, RightOf, SameAs.
13885 """
13886 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13887
13888 def LeftOf(*args, **kwargs):
13889 """
13890 LeftOf(self, Window sibling, int marg=0)
13891
13892 Constrains this edge to be to the left of the given window, with an
13893 optional margin. Implicitly, this is relative to the left edge of the
13894 other window.
13895 """
13896 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13897
13898 def RightOf(*args, **kwargs):
13899 """
13900 RightOf(self, Window sibling, int marg=0)
13901
13902 Constrains this edge to be to the right of the given window, with an
13903 optional margin. Implicitly, this is relative to the right edge of the
13904 other window.
13905 """
13906 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13907
13908 def Above(*args, **kwargs):
13909 """
13910 Above(self, Window sibling, int marg=0)
13911
13912 Constrains this edge to be above the given window, with an optional
13913 margin. Implicitly, this is relative to the top edge of the other
13914 window.
13915 """
13916 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13917
13918 def Below(*args, **kwargs):
13919 """
13920 Below(self, Window sibling, int marg=0)
13921
13922 Constrains this edge to be below the given window, with an optional
13923 margin. Implicitly, this is relative to the bottom edge of the other
13924 window.
13925 """
13926 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13927
13928 def SameAs(*args, **kwargs):
13929 """
13930 SameAs(self, Window otherW, int edge, int marg=0)
13931
13932 Constrains this edge or dimension to be to the same as the edge of the
13933 given window, with an optional margin.
13934 """
13935 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13936
13937 def PercentOf(*args, **kwargs):
13938 """
13939 PercentOf(self, Window otherW, int wh, int per)
13940
13941 Constrains this edge or dimension to be to a percentage of the given
13942 window, with an optional margin.
13943 """
13944 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13945
13946 def Absolute(*args, **kwargs):
13947 """
13948 Absolute(self, int val)
13949
13950 Constrains this edge or dimension to be the given absolute value.
13951 """
13952 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13953
13954 def Unconstrained(*args, **kwargs):
13955 """
13956 Unconstrained(self)
13957
13958 Sets this edge or dimension to be unconstrained, that is, dependent on
13959 other edges and dimensions from which this value can be deduced.
13960 """
13961 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13962
13963 def AsIs(*args, **kwargs):
13964 """
13965 AsIs(self)
13966
13967 Sets this edge or constraint to be whatever the window's value is at
13968 the moment. If either of the width and height constraints are *as is*,
13969 the window will not be resized, but moved instead. This is important
13970 when considering panel items which are intended to have a default
13971 size, such as a button, which may take its size from the size of the
13972 button label.
13973 """
13974 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13975
13976 def GetOtherWindow(*args, **kwargs):
13977 """GetOtherWindow(self) -> Window"""
13978 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13979
13980 def GetMyEdge(*args, **kwargs):
13981 """GetMyEdge(self) -> int"""
13982 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13983
13984 def SetEdge(*args, **kwargs):
13985 """SetEdge(self, int which)"""
13986 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13987
13988 def SetValue(*args, **kwargs):
13989 """SetValue(self, int v)"""
13990 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13991
13992 def GetMargin(*args, **kwargs):
13993 """GetMargin(self) -> int"""
13994 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13995
13996 def SetMargin(*args, **kwargs):
13997 """SetMargin(self, int m)"""
13998 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13999
14000 def GetValue(*args, **kwargs):
14001 """GetValue(self) -> int"""
14002 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
14003
14004 def GetPercent(*args, **kwargs):
14005 """GetPercent(self) -> int"""
14006 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
14007
14008 def GetOtherEdge(*args, **kwargs):
14009 """GetOtherEdge(self) -> int"""
14010 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
14011
14012 def GetDone(*args, **kwargs):
14013 """GetDone(self) -> bool"""
14014 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
14015
14016 def SetDone(*args, **kwargs):
14017 """SetDone(self, bool d)"""
14018 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
14019
14020 def GetRelationship(*args, **kwargs):
14021 """GetRelationship(self) -> int"""
14022 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
14023
14024 def SetRelationship(*args, **kwargs):
14025 """SetRelationship(self, int r)"""
14026 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
14027
14028 def ResetIfWin(*args, **kwargs):
14029 """
14030 ResetIfWin(self, Window otherW) -> bool
14031
14032 Reset constraint if it mentions otherWin
14033 """
14034 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
14035
14036 def SatisfyConstraint(*args, **kwargs):
14037 """
14038 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
14039
14040 Try to satisfy constraint
14041 """
14042 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
14043
14044 def GetEdge(*args, **kwargs):
14045 """
14046 GetEdge(self, int which, Window thisWin, Window other) -> int
14047
14048 Get the value of this edge or dimension, or if this
14049 is not determinable, -1.
14050 """
14051 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
14052
14053 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
14054 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
14055 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
14056 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
14057 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
14058 Percent = property(GetPercent,doc="See `GetPercent`")
14059 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
14060 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
14061 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
14062
14063 class LayoutConstraints(Object):
14064 """
14065 **Note:** constraints are now deprecated and you should use sizers
14066 instead.
14067
14068 Objects of this class can be associated with a window to define its
14069 layout constraints, with respect to siblings or its parent.
14070
14071 The class consists of the following eight constraints of class
14072 wx.IndividualLayoutConstraint, some or all of which should be accessed
14073 directly to set the appropriate constraints.
14074
14075 * left: represents the left hand edge of the window
14076 * right: represents the right hand edge of the window
14077 * top: represents the top edge of the window
14078 * bottom: represents the bottom edge of the window
14079 * width: represents the width of the window
14080 * height: represents the height of the window
14081 * centreX: represents the horizontal centre point of the window
14082 * centreY: represents the vertical centre point of the window
14083
14084 Most constraints are initially set to have the relationship
14085 wxUnconstrained, which means that their values should be calculated by
14086 looking at known constraints. The exceptions are width and height,
14087 which are set to wxAsIs to ensure that if the user does not specify a
14088 constraint, the existing width and height will be used, to be
14089 compatible with panel items which often have take a default size. If
14090 the constraint is ``wx.AsIs``, the dimension will not be changed.
14091
14092 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
14093
14094 """
14095 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14096 __repr__ = _swig_repr
14097 left = property(_core_.LayoutConstraints_left_get)
14098 top = property(_core_.LayoutConstraints_top_get)
14099 right = property(_core_.LayoutConstraints_right_get)
14100 bottom = property(_core_.LayoutConstraints_bottom_get)
14101 width = property(_core_.LayoutConstraints_width_get)
14102 height = property(_core_.LayoutConstraints_height_get)
14103 centreX = property(_core_.LayoutConstraints_centreX_get)
14104 centreY = property(_core_.LayoutConstraints_centreY_get)
14105 def __init__(self, *args, **kwargs):
14106 """__init__(self) -> LayoutConstraints"""
14107 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14108 __swig_destroy__ = _core_.delete_LayoutConstraints
14109 __del__ = lambda self : None;
14110 def SatisfyConstraints(*args, **kwargs):
14111 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
14112 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
14113
14114 def AreSatisfied(*args, **kwargs):
14115 """AreSatisfied(self) -> bool"""
14116 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
14117
14118 _core_.LayoutConstraints_swigregister(LayoutConstraints)
14119
14120 #----------------------------------------------------------------------------
14121
14122 # Use Python's bool constants if available, make some if not
14123 try:
14124 True
14125 except NameError:
14126 __builtins__.True = 1==1
14127 __builtins__.False = 1==0
14128 def bool(value): return not not value
14129 __builtins__.bool = bool
14130
14131
14132
14133 # workarounds for bad wxRTTI names
14134 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14135 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14136 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14137
14138
14139 #----------------------------------------------------------------------------
14140 # Load version numbers from __version__... Ensure that major and minor
14141 # versions are the same for both wxPython and wxWidgets.
14142
14143 from __version__ import *
14144 __version__ = VERSION_STRING
14145
14146 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14147 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
14148 if RELEASE_VERSION != _core_.RELEASE_VERSION:
14149 import warnings
14150 warnings.warn("wxPython/wxWidgets release number mismatch")
14151
14152
14153 def version():
14154 """Returns a string containing version and port info"""
14155 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14156 if wx.Platform == '__WXMSW__':
14157 port = 'msw'
14158 elif wx.Platform == '__WXMAC__':
14159 port = 'mac'
14160 elif wx.Platform == '__WXGTK__':
14161 port = 'gtk'
14162 if 'gtk2' in wx.PlatformInfo:
14163 port = 'gtk2'
14164 else:
14165 port = '?'
14166
14167 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14168
14169
14170 #----------------------------------------------------------------------------
14171
14172 # Set wxPython's default string<-->unicode conversion encoding from
14173 # the locale, but only if Python's default hasn't been changed. (We
14174 # assume that if the user has customized it already then that is the
14175 # encoding we need to use as well.)
14176 #
14177 # The encoding selected here is used when string or unicode objects
14178 # need to be converted in order to pass them to wxWidgets. Please be
14179 # aware that the default encoding within the same locale may be
14180 # slightly different on different platforms. For example, please see
14181 # http://www.alanwood.net/demos/charsetdiffs.html for differences
14182 # between the common latin/roman encodings.
14183
14184 default = _sys.getdefaultencoding()
14185 if default == 'ascii':
14186 import locale
14187 import codecs
14188 try:
14189 if hasattr(locale, 'getpreferredencoding'):
14190 default = locale.getpreferredencoding()
14191 else:
14192 default = locale.getdefaultlocale()[1]
14193 codecs.lookup(default)
14194 except (ValueError, LookupError, TypeError):
14195 default = _sys.getdefaultencoding()
14196 del locale
14197 del codecs
14198 if default:
14199 wx.SetDefaultPyEncoding(default)
14200 del default
14201
14202 #----------------------------------------------------------------------------
14203
14204 class PyDeadObjectError(AttributeError):
14205 pass
14206
14207 class _wxPyDeadObject(object):
14208 """
14209 Instances of wx objects that are OOR capable will have their __class__
14210 changed to this class when the C++ object is deleted. This should help
14211 prevent crashes due to referencing a bogus C++ pointer.
14212 """
14213 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14214 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14215
14216 def __repr__(self):
14217 if not hasattr(self, "_name"):
14218 self._name = "[unknown]"
14219 return self.reprStr % self._name
14220
14221 def __getattr__(self, *args):
14222 if not hasattr(self, "_name"):
14223 self._name = "[unknown]"
14224 raise PyDeadObjectError(self.attrStr % self._name)
14225
14226 def __nonzero__(self):
14227 return 0
14228
14229
14230
14231 class PyUnbornObjectError(AttributeError):
14232 pass
14233
14234 class _wxPyUnbornObject(object):
14235 """
14236 Some stock objects are created when the wx._core module is
14237 imported, but their C++ instance is not created until the wx.App
14238 object is created and initialized. These object instances will
14239 temporarily have their __class__ changed to this class so an
14240 exception will be raised if they are used before the C++ instance
14241 is ready.
14242 """
14243
14244 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14245 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14246
14247 def __repr__(self):
14248 #if not hasattr(self, "_name"):
14249 # self._name = "[unknown]"
14250 return self.reprStr #% self._name
14251
14252 def __getattr__(self, *args):
14253 #if not hasattr(self, "_name"):
14254 # self._name = "[unknown]"
14255 raise PyUnbornObjectError(self.attrStr) # % self._name )
14256
14257 def __nonzero__(self):
14258 return 0
14259
14260
14261 #----------------------------------------------------------------------------
14262
14263 def CallAfter(callable, *args, **kw):
14264 """
14265 Call the specified function after the current and pending event
14266 handlers have been completed. This is also good for making GUI
14267 method calls from non-GUI threads. Any extra positional or
14268 keyword args are passed on to the callable when it is called.
14269
14270 :see: `wx.CallLater`
14271 """
14272 app = wx.GetApp()
14273 assert app is not None, 'No wx.App created yet'
14274
14275 if not hasattr(app, "_CallAfterId"):
14276 app._CallAfterId = wx.NewEventType()
14277 app.Connect(-1, -1, app._CallAfterId,
14278 lambda event: event.callable(*event.args, **event.kw) )
14279 evt = wx.PyEvent()
14280 evt.SetEventType(app._CallAfterId)
14281 evt.callable = callable
14282 evt.args = args
14283 evt.kw = kw
14284 wx.PostEvent(app, evt)
14285
14286 #----------------------------------------------------------------------------
14287
14288
14289 class CallLater:
14290 """
14291 A convenience class for `wx.Timer`, that calls the given callable
14292 object once after the given amount of milliseconds, passing any
14293 positional or keyword args. The return value of the callable is
14294 availbale after it has been run with the `GetResult` method.
14295
14296 If you don't need to get the return value or restart the timer
14297 then there is no need to hold a reference to this object. It will
14298 hold a reference to itself while the timer is running (the timer
14299 has a reference to self.Notify) but the cycle will be broken when
14300 the timer completes, automatically cleaning up the wx.CallLater
14301 object.
14302
14303 :see: `wx.CallAfter`
14304 """
14305 def __init__(self, millis, callable, *args, **kwargs):
14306 self.millis = millis
14307 self.callable = callable
14308 self.SetArgs(*args, **kwargs)
14309 self.runCount = 0
14310 self.running = False
14311 self.hasRun = False
14312 self.result = None
14313 self.timer = None
14314 self.Start()
14315
14316 def __del__(self):
14317 self.Stop()
14318
14319
14320 def Start(self, millis=None, *args, **kwargs):
14321 """
14322 (Re)start the timer
14323 """
14324 self.hasRun = False
14325 if millis is not None:
14326 self.millis = millis
14327 if args or kwargs:
14328 self.SetArgs(*args, **kwargs)
14329 self.Stop()
14330 self.timer = wx.PyTimer(self.Notify)
14331 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
14332 self.running = True
14333 Restart = Start
14334
14335
14336 def Stop(self):
14337 """
14338 Stop and destroy the timer.
14339 """
14340 if self.timer is not None:
14341 self.timer.Stop()
14342 self.timer = None
14343
14344
14345 def GetInterval(self):
14346 if self.timer is not None:
14347 return self.timer.GetInterval()
14348 else:
14349 return 0
14350
14351
14352 def IsRunning(self):
14353 return self.timer is not None and self.timer.IsRunning()
14354
14355
14356 def SetArgs(self, *args, **kwargs):
14357 """
14358 (Re)set the args passed to the callable object. This is
14359 useful in conjunction with Restart if you want to schedule a
14360 new call to the same callable object but with different
14361 parameters.
14362 """
14363 self.args = args
14364 self.kwargs = kwargs
14365
14366
14367 def HasRun(self):
14368 return self.hasRun
14369
14370 def GetResult(self):
14371 return self.result
14372
14373 def Notify(self):
14374 """
14375 The timer has expired so call the callable.
14376 """
14377 if self.callable and getattr(self.callable, 'im_self', True):
14378 self.runCount += 1
14379 self.running = False
14380 self.result = self.callable(*self.args, **self.kwargs)
14381 self.hasRun = True
14382 if not self.running:
14383 # if it wasn't restarted, then cleanup
14384 wx.CallAfter(self.Stop)
14385
14386 Interval = property(GetInterval)
14387 Result = property(GetResult)
14388
14389
14390 class FutureCall(CallLater):
14391 """A compatibility alias for `CallLater`."""
14392
14393 #----------------------------------------------------------------------------
14394 # Control which items in this module should be documented by epydoc.
14395 # We allow only classes and functions, which will help reduce the size
14396 # of the docs by filtering out the zillions of constants, EVT objects,
14397 # and etc that don't make much sense by themselves, but are instead
14398 # documented (or will be) as part of the classes/functions/methods
14399 # where they should be used.
14400
14401 class __DocFilter:
14402 """
14403 A filter for epydoc that only allows non-Ptr classes and
14404 functions, in order to reduce the clutter in the API docs.
14405 """
14406 def __init__(self, globals):
14407 self._globals = globals
14408
14409 def __call__(self, name):
14410 import types
14411 obj = self._globals.get(name, None)
14412
14413 # only document classes and function
14414 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14415 return False
14416
14417 # skip other things that are private or will be documented as part of somethign else
14418 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
14419 return False
14420
14421 # skip functions that are duplicates of static functions in a class
14422 if name.find('_') != -1:
14423 cls = self._globals.get(name.split('_')[0], None)
14424 methname = name.split('_')[1]
14425 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14426 return False
14427
14428 return True
14429
14430 #----------------------------------------------------------------------------
14431 #----------------------------------------------------------------------------
14432
14433 # Import other modules in this package that should show up in the
14434 # "core" wx namespace
14435 from _gdi import *
14436 from _windows import *
14437 from _controls import *
14438 from _misc import *
14439
14440 #----------------------------------------------------------------------------
14441 #----------------------------------------------------------------------------
14442
14443
14444